@anker-in/headless-ui 1.1.87 → 1.1.88
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.d.ts +1 -1
- package/dist/cjs/biz-components/ActiveShelf/index.d.ts +1 -1
- package/dist/cjs/biz-components/ActivitySchedule/index.d.ts +1 -1
- package/dist/cjs/biz-components/AiuiProvider/index.d.ts +6 -0
- package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
- package/dist/cjs/biz-components/AiuiProvider/index.js.map +3 -3
- package/dist/cjs/biz-components/AnchorNavigation/index.d.ts +1 -1
- package/dist/cjs/biz-components/AplusDesc/index.d.ts +1 -1
- package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.d.ts +1 -1
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.d.ts +1 -1
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.js +1 -1
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.js.map +3 -3
- package/dist/cjs/biz-components/BrandEquity/types.d.ts +8 -0
- package/dist/cjs/biz-components/BrandEquity/types.js +1 -1
- package/dist/cjs/biz-components/BrandEquity/types.js.map +1 -1
- package/dist/cjs/biz-components/Category/index.d.ts +1 -1
- package/dist/cjs/biz-components/CreativeModule/index.d.ts +1 -1
- package/dist/cjs/biz-components/DownLoad/index.d.ts +1 -1
- package/dist/cjs/biz-components/Evaluate/index.d.ts +1 -1
- package/dist/cjs/biz-components/EventSchedule/index.d.ts +1 -1
- package/dist/cjs/biz-components/Faq/Faq.d.ts +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/Faq/types.d.ts +1 -0
- package/dist/cjs/biz-components/Faq/types.js +1 -1
- package/dist/cjs/biz-components/Faq/types.js.map +1 -1
- package/dist/cjs/biz-components/FeatureCards/FeatureCards.d.ts +1 -1
- package/dist/cjs/biz-components/FeatureShowcase/FeatureShowcase.d.ts +1 -1
- package/dist/cjs/biz-components/FeaturedBlogPosts/index.d.ts +1 -1
- package/dist/cjs/biz-components/Features/index.d.ts +1 -1
- package/dist/cjs/biz-components/FootCharger/index.d.ts +1 -1
- package/dist/cjs/biz-components/FooterNavigation/index.d.ts +1 -1
- package/dist/cjs/biz-components/GiftBox/index.d.ts +1 -1
- package/dist/cjs/biz-components/GiftShelf/index.d.ts +1 -1
- package/dist/cjs/biz-components/GiftTierShelf/index.d.ts +1 -1
- package/dist/cjs/biz-components/Graphic/index.d.ts +1 -1
- package/dist/cjs/biz-components/GraphicAttractionBlock/index.d.ts +1 -1
- package/dist/cjs/biz-components/GraphicMore/index.d.ts +1 -1
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.d.ts +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.d.ts +1 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.d.ts +21 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +3 -3
- package/dist/cjs/biz-components/HeroBanner/HeroBannerCarousel.d.ts +23 -0
- package/dist/cjs/biz-components/HeroBanner/HeroBannerCarousel.js +2 -0
- package/dist/cjs/biz-components/HeroBanner/HeroBannerCarousel.js.map +7 -0
- package/dist/cjs/biz-components/HeroBanner/index.d.ts +1 -0
- package/dist/cjs/biz-components/HeroBanner/index.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/index.js.map +1 -1
- package/dist/cjs/biz-components/HeroBanner/types.d.ts +73 -0
- package/dist/cjs/biz-components/HeroBanner/types.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/types.js.map +1 -1
- package/dist/cjs/biz-components/ImageOverlayShelf/index.d.ts +2 -2
- package/dist/cjs/biz-components/ImageOverlayShelf/index.js +1 -1
- package/dist/cjs/biz-components/ImageOverlayShelf/index.js.map +3 -3
- package/dist/cjs/biz-components/ImageTextFeature/ImageTextFeature.d.ts +1 -1
- package/dist/cjs/biz-components/ImageTextOverlay/index.d.ts +9 -0
- package/dist/cjs/biz-components/ImageTextOverlay/index.js +18 -0
- package/dist/cjs/biz-components/ImageTextOverlay/index.js.map +7 -0
- package/dist/cjs/biz-components/ImageTextOverlay/types.d.ts +58 -0
- package/dist/cjs/biz-components/ImageTextOverlay/types.js +2 -0
- package/dist/cjs/biz-components/ImageTextOverlay/types.js.map +7 -0
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.d.ts +1 -1
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.js.map +2 -2
- package/dist/cjs/biz-components/Ksp/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/PaidShipping/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.d.ts +1 -1
- package/dist/cjs/biz-components/LotteryShared/BaseModal.js +1 -1
- package/dist/cjs/biz-components/LotteryShared/BaseModal.js.map +2 -2
- package/dist/cjs/biz-components/LotteryShared/ChanceMethods.js +1 -1
- package/dist/cjs/biz-components/LotteryShared/ChanceMethods.js.map +3 -3
- package/dist/cjs/biz-components/LotteryShared/ErrorModal.js +1 -1
- package/dist/cjs/biz-components/LotteryShared/ErrorModal.js.map +2 -2
- package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.d.ts +33 -0
- package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.js +1 -1
- package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.js.map +3 -3
- package/dist/cjs/biz-components/LotteryShared/PrizePool.js +1 -1
- package/dist/cjs/biz-components/LotteryShared/PrizePool.js.map +3 -3
- package/dist/cjs/biz-components/LotteryShared/WinnerModal.d.ts +1 -1
- package/dist/cjs/biz-components/LotteryShared/WinnerModal.js +1 -1
- package/dist/cjs/biz-components/LotteryShared/WinnerModal.js.map +3 -3
- package/dist/cjs/biz-components/LotteryShared/types.d.ts +101 -0
- package/dist/cjs/biz-components/LotteryShared/types.js +1 -1
- package/dist/cjs/biz-components/LotteryShared/types.js.map +2 -2
- package/dist/cjs/biz-components/Marquee/Marquee.d.ts +2 -1
- package/dist/cjs/biz-components/Marquee/Marquee.js +1 -1
- package/dist/cjs/biz-components/Marquee/Marquee.js.map +3 -3
- package/dist/cjs/biz-components/MarqueeReview/index.d.ts +1 -1
- package/dist/cjs/biz-components/Media/index.d.ts +15 -3
- package/dist/cjs/biz-components/Media/index.js +1 -1
- package/dist/cjs/biz-components/Media/index.js.map +3 -3
- package/dist/cjs/biz-components/MediaEndorsement/index.d.ts +1 -1
- package/dist/cjs/biz-components/MediaEndorsement/index.js +2 -2
- package/dist/cjs/biz-components/MediaEndorsement/index.js.map +3 -3
- package/dist/cjs/biz-components/MediaPlayerBase/index.d.ts +1 -1
- package/dist/cjs/biz-components/MediaPlayerBase/index.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerBase/index.js.map +3 -3
- package/dist/cjs/biz-components/MediaPlayerBase/types.d.ts +26 -0
- package/dist/cjs/biz-components/MediaPlayerBase/types.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerBase/types.js.map +1 -1
- package/dist/cjs/biz-components/MediaPlayerMulti/index.d.ts +1 -1
- package/dist/cjs/biz-components/MediaPlayerSticky/index.d.ts +1 -1
- package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.d.ts +1 -1
- package/dist/cjs/biz-components/MediaSceneSwitcherV2/index.d.ts +1 -1
- package/dist/cjs/biz-components/MediaShelf/index.d.ts +1 -1
- package/dist/cjs/biz-components/MemberEquity/index.d.ts +1 -1
- package/dist/cjs/biz-components/MiniCart/index.js +1 -1
- package/dist/cjs/biz-components/MiniCart/index.js.map +2 -2
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +1 -1
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
- package/dist/cjs/biz-components/NavigationSearch/index.d.ts +1 -1
- package/dist/cjs/biz-components/ProductCompare/index.d.ts +1 -1
- package/dist/cjs/biz-components/ProductHero/ProductHero.d.ts +1 -1
- package/dist/cjs/biz-components/ProductLottery/MediaDrawArea.js +1 -1
- package/dist/cjs/biz-components/ProductLottery/MediaDrawArea.js.map +3 -3
- package/dist/cjs/biz-components/ProductLottery/index.d.ts +3 -2
- package/dist/cjs/biz-components/ProductLottery/index.js +1 -1
- package/dist/cjs/biz-components/ProductLottery/index.js.map +3 -3
- package/dist/cjs/biz-components/ProductLottery/types.d.ts +75 -89
- package/dist/cjs/biz-components/ProductLottery/types.js +1 -1
- package/dist/cjs/biz-components/ProductLottery/types.js.map +2 -2
- package/dist/cjs/biz-components/ProductNav/ProductNav.d.ts +1 -1
- package/dist/cjs/biz-components/PromotionalBar/index.d.ts +3 -2
- package/dist/cjs/biz-components/PromotionalBar/index.js +1 -1
- package/dist/cjs/biz-components/PromotionalBar/index.js.map +3 -3
- package/dist/cjs/biz-components/SceneShelfV2/index.d.ts +113 -0
- package/dist/cjs/biz-components/SceneShelfV2/index.js +2 -0
- package/dist/cjs/biz-components/SceneShelfV2/index.js.map +7 -0
- package/dist/cjs/biz-components/SceneShelfV3/ProductCard.d.ts +89 -0
- package/dist/cjs/biz-components/SceneShelfV3/ProductCard.js +2 -0
- package/dist/cjs/biz-components/SceneShelfV3/ProductCard.js.map +7 -0
- package/dist/cjs/biz-components/SceneShelfV3/index.d.ts +79 -0
- package/dist/cjs/biz-components/SceneShelfV3/index.js +2 -0
- package/dist/cjs/biz-components/SceneShelfV3/index.js.map +7 -0
- package/dist/cjs/biz-components/SceneShelfV3/types.d.ts +19 -0
- package/dist/cjs/biz-components/SceneShelfV3/types.js +2 -0
- package/dist/cjs/biz-components/SceneShelfV3/types.js.map +7 -0
- package/dist/cjs/biz-components/SecondaryBanner/SecondaryBannerCarousel.d.ts +21 -0
- package/dist/cjs/biz-components/SecondaryBanner/SecondaryBannerCarousel.js +2 -0
- package/dist/cjs/biz-components/SecondaryBanner/SecondaryBannerCarousel.js.map +7 -0
- package/dist/cjs/biz-components/SecondaryBanner/index.d.ts +65 -1
- package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/cjs/biz-components/SecondaryBanner/index.js.map +3 -3
- package/dist/cjs/biz-components/SelectStore/index.d.ts +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/index.d.ts +1 -1
- package/dist/cjs/biz-components/Slogan/index.d.ts +1 -1
- package/dist/cjs/biz-components/Spacer/index.d.ts +1 -1
- package/dist/cjs/biz-components/Specs/index.d.ts +1 -1
- package/dist/cjs/biz-components/SpecsComparison/SpecsComparison.d.ts +1 -1
- package/dist/cjs/biz-components/TabWithImage/TabWithImage.d.ts +1 -1
- package/dist/cjs/biz-components/Tabs/Tabs.d.ts +1 -1
- package/dist/cjs/biz-components/TabsGroup/index.d.ts +1 -1
- package/dist/cjs/biz-components/TabsWithMedia/TabsWithMedia.d.ts +1 -1
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.d.ts +1 -1
- package/dist/cjs/biz-components/Title/index.d.ts +1 -1
- package/dist/cjs/biz-components/Title/index.js +1 -1
- package/dist/cjs/biz-components/Title/index.js.map +3 -3
- package/dist/cjs/biz-components/Title/types.d.ts +53 -1
- package/dist/cjs/biz-components/Title/types.js +1 -1
- package/dist/cjs/biz-components/Title/types.js.map +1 -1
- package/dist/cjs/biz-components/VideoFeature/VideoFeature.d.ts +1 -1
- package/dist/cjs/biz-components/WheelLottery/BaseModal.js +1 -1
- package/dist/cjs/biz-components/WheelLottery/BaseModal.js.map +2 -2
- package/dist/cjs/biz-components/WheelLottery/ErrorModal.js +1 -1
- package/dist/cjs/biz-components/WheelLottery/ErrorModal.js.map +2 -2
- package/dist/cjs/biz-components/WheelLottery/MyRewardsModal.js +1 -1
- package/dist/cjs/biz-components/WheelLottery/MyRewardsModal.js.map +2 -2
- package/dist/cjs/biz-components/WheelLottery/WinnerModal.js +1 -1
- package/dist/cjs/biz-components/WheelLottery/WinnerModal.js.map +2 -2
- package/dist/cjs/biz-components/WheelLottery/index.d.ts +2 -1
- package/dist/cjs/biz-components/WheelLottery/index.js +1 -1
- package/dist/cjs/biz-components/WheelLottery/index.js.map +3 -3
- package/dist/cjs/biz-components/WheelLottery/types.d.ts +6 -0
- package/dist/cjs/biz-components/WheelLottery/types.js.map +2 -2
- package/dist/cjs/biz-components/WhyChoose/WhyChoose.d.ts +1 -1
- package/dist/cjs/biz-components/index.d.ts +7 -0
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/biz-components/index.js.map +3 -3
- package/dist/cjs/hooks/useExposure.d.ts +4 -3
- package/dist/cjs/hooks/useExposure.js +1 -1
- package/dist/cjs/hooks/useExposure.js.map +3 -3
- package/dist/cjs/hooks/useGridRowCount.d.ts +16 -0
- package/dist/cjs/hooks/useGridRowCount.js +2 -0
- package/dist/cjs/hooks/useGridRowCount.js.map +7 -0
- package/dist/cjs/hooks/useViewItemList.d.ts +21 -0
- package/dist/cjs/hooks/useViewItemList.js +2 -0
- package/dist/cjs/hooks/useViewItemList.js.map +7 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +3 -3
- package/dist/cjs/shared/Styles.js +1 -1
- package/dist/cjs/shared/Styles.js.map +3 -3
- package/dist/cjs/shared/trackUrlRef.d.ts +9 -0
- package/dist/cjs/shared/trackUrlRef.js +1 -1
- package/dist/cjs/shared/trackUrlRef.js.map +3 -3
- package/dist/cjs/types/props.d.ts +18 -1
- package/dist/cjs/types/props.js +1 -1
- package/dist/cjs/types/props.js.map +1 -1
- package/dist/esm/biz-components/AccordionCards/index.d.ts +1 -1
- package/dist/esm/biz-components/ActiveShelf/index.d.ts +1 -1
- package/dist/esm/biz-components/ActivitySchedule/index.d.ts +1 -1
- package/dist/esm/biz-components/AiuiProvider/index.d.ts +6 -0
- package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
- package/dist/esm/biz-components/AiuiProvider/index.js.map +3 -3
- package/dist/esm/biz-components/AnchorNavigation/index.d.ts +1 -1
- package/dist/esm/biz-components/AplusDesc/index.d.ts +1 -1
- package/dist/esm/biz-components/BrandCardLink/BrandCardLink.d.ts +1 -1
- package/dist/esm/biz-components/BrandEquity/BrandEquity.d.ts +1 -1
- package/dist/esm/biz-components/BrandEquity/BrandEquity.js +1 -1
- package/dist/esm/biz-components/BrandEquity/BrandEquity.js.map +3 -3
- package/dist/esm/biz-components/BrandEquity/types.d.ts +8 -0
- package/dist/esm/biz-components/Category/index.d.ts +1 -1
- package/dist/esm/biz-components/CreativeModule/index.d.ts +1 -1
- package/dist/esm/biz-components/DownLoad/index.d.ts +1 -1
- package/dist/esm/biz-components/Evaluate/index.d.ts +1 -1
- package/dist/esm/biz-components/EventSchedule/index.d.ts +1 -1
- package/dist/esm/biz-components/Faq/Faq.d.ts +1 -1
- package/dist/esm/biz-components/Faq/Faq.js +1 -1
- package/dist/esm/biz-components/Faq/Faq.js.map +2 -2
- package/dist/esm/biz-components/Faq/types.d.ts +1 -0
- package/dist/esm/biz-components/FeatureCards/FeatureCards.d.ts +1 -1
- package/dist/esm/biz-components/FeatureShowcase/FeatureShowcase.d.ts +1 -1
- package/dist/esm/biz-components/FeaturedBlogPosts/index.d.ts +1 -1
- package/dist/esm/biz-components/Features/index.d.ts +1 -1
- package/dist/esm/biz-components/FootCharger/index.d.ts +1 -1
- package/dist/esm/biz-components/FooterNavigation/index.d.ts +1 -1
- package/dist/esm/biz-components/GiftBox/index.d.ts +1 -1
- package/dist/esm/biz-components/GiftShelf/index.d.ts +1 -1
- package/dist/esm/biz-components/GiftTierShelf/index.d.ts +1 -1
- package/dist/esm/biz-components/Graphic/index.d.ts +1 -1
- package/dist/esm/biz-components/GraphicAttractionBlock/index.d.ts +1 -1
- package/dist/esm/biz-components/GraphicMore/index.d.ts +1 -1
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.d.ts +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.d.ts +1 -1
- package/dist/esm/biz-components/HeroBanner/HeroBanner.d.ts +21 -1
- package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
- package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +3 -3
- package/dist/esm/biz-components/HeroBanner/HeroBannerCarousel.d.ts +23 -0
- package/dist/esm/biz-components/HeroBanner/HeroBannerCarousel.js +2 -0
- package/dist/esm/biz-components/HeroBanner/HeroBannerCarousel.js.map +7 -0
- package/dist/esm/biz-components/HeroBanner/index.d.ts +1 -0
- package/dist/esm/biz-components/HeroBanner/index.js +1 -1
- package/dist/esm/biz-components/HeroBanner/index.js.map +1 -1
- package/dist/esm/biz-components/HeroBanner/types.d.ts +73 -0
- package/dist/esm/biz-components/ImageOverlayShelf/index.d.ts +2 -2
- package/dist/esm/biz-components/ImageOverlayShelf/index.js +1 -1
- package/dist/esm/biz-components/ImageOverlayShelf/index.js.map +3 -3
- package/dist/esm/biz-components/ImageTextFeature/ImageTextFeature.d.ts +1 -1
- package/dist/esm/biz-components/ImageTextOverlay/index.d.ts +9 -0
- package/dist/esm/biz-components/ImageTextOverlay/index.js +18 -0
- package/dist/esm/biz-components/ImageTextOverlay/index.js.map +7 -0
- package/dist/esm/biz-components/ImageTextOverlay/types.d.ts +58 -0
- package/dist/esm/biz-components/ImageTextOverlay/types.js +1 -0
- package/dist/esm/biz-components/ImageTextOverlay/types.js.map +7 -0
- package/dist/esm/biz-components/ImageWithText/ImageWithText.d.ts +1 -1
- package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/esm/biz-components/ImageWithText/ImageWithText.js.map +2 -2
- package/dist/esm/biz-components/Ksp/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/PaidShipping/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.d.ts +1 -1
- package/dist/esm/biz-components/LotteryShared/BaseModal.js +1 -1
- package/dist/esm/biz-components/LotteryShared/BaseModal.js.map +2 -2
- package/dist/esm/biz-components/LotteryShared/ChanceMethods.js +1 -1
- package/dist/esm/biz-components/LotteryShared/ChanceMethods.js.map +3 -3
- package/dist/esm/biz-components/LotteryShared/ErrorModal.js +1 -1
- package/dist/esm/biz-components/LotteryShared/ErrorModal.js.map +2 -2
- package/dist/esm/biz-components/LotteryShared/MyRewardsModal.d.ts +33 -0
- package/dist/esm/biz-components/LotteryShared/MyRewardsModal.js +1 -1
- package/dist/esm/biz-components/LotteryShared/MyRewardsModal.js.map +3 -3
- package/dist/esm/biz-components/LotteryShared/PrizePool.js +1 -1
- package/dist/esm/biz-components/LotteryShared/PrizePool.js.map +3 -3
- package/dist/esm/biz-components/LotteryShared/WinnerModal.d.ts +1 -1
- package/dist/esm/biz-components/LotteryShared/WinnerModal.js +1 -1
- package/dist/esm/biz-components/LotteryShared/WinnerModal.js.map +3 -3
- package/dist/esm/biz-components/LotteryShared/types.d.ts +101 -0
- package/dist/esm/biz-components/LotteryShared/types.js +1 -1
- package/dist/esm/biz-components/LotteryShared/types.js.map +2 -2
- package/dist/esm/biz-components/Marquee/Marquee.d.ts +2 -1
- package/dist/esm/biz-components/Marquee/Marquee.js +1 -1
- package/dist/esm/biz-components/Marquee/Marquee.js.map +2 -2
- package/dist/esm/biz-components/MarqueeReview/index.d.ts +1 -1
- package/dist/esm/biz-components/Media/index.d.ts +15 -3
- package/dist/esm/biz-components/Media/index.js +1 -1
- package/dist/esm/biz-components/Media/index.js.map +3 -3
- package/dist/esm/biz-components/MediaEndorsement/index.d.ts +1 -1
- package/dist/esm/biz-components/MediaEndorsement/index.js +2 -2
- package/dist/esm/biz-components/MediaEndorsement/index.js.map +3 -3
- package/dist/esm/biz-components/MediaPlayerBase/index.d.ts +1 -1
- package/dist/esm/biz-components/MediaPlayerBase/index.js +1 -1
- package/dist/esm/biz-components/MediaPlayerBase/index.js.map +3 -3
- package/dist/esm/biz-components/MediaPlayerBase/types.d.ts +26 -0
- package/dist/esm/biz-components/MediaPlayerMulti/index.d.ts +1 -1
- package/dist/esm/biz-components/MediaPlayerSticky/index.d.ts +1 -1
- package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.d.ts +1 -1
- package/dist/esm/biz-components/MediaSceneSwitcherV2/index.d.ts +1 -1
- package/dist/esm/biz-components/MediaShelf/index.d.ts +1 -1
- package/dist/esm/biz-components/MemberEquity/index.d.ts +1 -1
- package/dist/esm/biz-components/MiniCart/index.js +1 -1
- package/dist/esm/biz-components/MiniCart/index.js.map +2 -2
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +1 -1
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
- package/dist/esm/biz-components/NavigationSearch/index.d.ts +1 -1
- package/dist/esm/biz-components/ProductCompare/index.d.ts +1 -1
- package/dist/esm/biz-components/ProductHero/ProductHero.d.ts +1 -1
- package/dist/esm/biz-components/ProductLottery/MediaDrawArea.js +1 -1
- package/dist/esm/biz-components/ProductLottery/MediaDrawArea.js.map +3 -3
- package/dist/esm/biz-components/ProductLottery/index.d.ts +3 -2
- package/dist/esm/biz-components/ProductLottery/index.js +1 -1
- package/dist/esm/biz-components/ProductLottery/index.js.map +3 -3
- package/dist/esm/biz-components/ProductLottery/types.d.ts +75 -89
- package/dist/esm/biz-components/ProductLottery/types.js.map +2 -2
- package/dist/esm/biz-components/ProductNav/ProductNav.d.ts +1 -1
- package/dist/esm/biz-components/PromotionalBar/index.d.ts +3 -2
- package/dist/esm/biz-components/PromotionalBar/index.js +1 -1
- package/dist/esm/biz-components/PromotionalBar/index.js.map +3 -3
- package/dist/esm/biz-components/SceneShelfV2/index.d.ts +113 -0
- package/dist/esm/biz-components/SceneShelfV2/index.js +2 -0
- package/dist/esm/biz-components/SceneShelfV2/index.js.map +7 -0
- package/dist/esm/biz-components/SceneShelfV3/ProductCard.d.ts +89 -0
- package/dist/esm/biz-components/SceneShelfV3/ProductCard.js +2 -0
- package/dist/esm/biz-components/SceneShelfV3/ProductCard.js.map +7 -0
- package/dist/esm/biz-components/SceneShelfV3/index.d.ts +79 -0
- package/dist/esm/biz-components/SceneShelfV3/index.js +2 -0
- package/dist/esm/biz-components/SceneShelfV3/index.js.map +7 -0
- package/dist/esm/biz-components/SceneShelfV3/types.d.ts +19 -0
- package/dist/esm/biz-components/SceneShelfV3/types.js +1 -0
- package/dist/esm/biz-components/SceneShelfV3/types.js.map +7 -0
- package/dist/esm/biz-components/SecondaryBanner/SecondaryBannerCarousel.d.ts +21 -0
- package/dist/esm/biz-components/SecondaryBanner/SecondaryBannerCarousel.js +2 -0
- package/dist/esm/biz-components/SecondaryBanner/SecondaryBannerCarousel.js.map +7 -0
- package/dist/esm/biz-components/SecondaryBanner/index.d.ts +65 -1
- package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/esm/biz-components/SecondaryBanner/index.js.map +3 -3
- package/dist/esm/biz-components/SelectStore/index.d.ts +1 -1
- package/dist/esm/biz-components/ShelfDisplay/index.d.ts +1 -1
- package/dist/esm/biz-components/Slogan/index.d.ts +1 -1
- package/dist/esm/biz-components/Spacer/index.d.ts +1 -1
- package/dist/esm/biz-components/Specs/index.d.ts +1 -1
- package/dist/esm/biz-components/SpecsComparison/SpecsComparison.d.ts +1 -1
- package/dist/esm/biz-components/TabWithImage/TabWithImage.d.ts +1 -1
- package/dist/esm/biz-components/Tabs/Tabs.d.ts +1 -1
- package/dist/esm/biz-components/TabsGroup/index.d.ts +1 -1
- package/dist/esm/biz-components/TabsWithMedia/TabsWithMedia.d.ts +1 -1
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.d.ts +1 -1
- package/dist/esm/biz-components/Title/index.d.ts +1 -1
- package/dist/esm/biz-components/Title/index.js +1 -1
- package/dist/esm/biz-components/Title/index.js.map +3 -3
- package/dist/esm/biz-components/Title/types.d.ts +53 -1
- package/dist/esm/biz-components/VideoFeature/VideoFeature.d.ts +1 -1
- package/dist/esm/biz-components/WheelLottery/BaseModal.js +1 -1
- package/dist/esm/biz-components/WheelLottery/BaseModal.js.map +2 -2
- package/dist/esm/biz-components/WheelLottery/ErrorModal.js +1 -1
- package/dist/esm/biz-components/WheelLottery/ErrorModal.js.map +2 -2
- package/dist/esm/biz-components/WheelLottery/MyRewardsModal.js +1 -1
- package/dist/esm/biz-components/WheelLottery/MyRewardsModal.js.map +2 -2
- package/dist/esm/biz-components/WheelLottery/WinnerModal.js +1 -1
- package/dist/esm/biz-components/WheelLottery/WinnerModal.js.map +2 -2
- package/dist/esm/biz-components/WheelLottery/index.d.ts +2 -1
- package/dist/esm/biz-components/WheelLottery/index.js +1 -1
- package/dist/esm/biz-components/WheelLottery/index.js.map +3 -3
- package/dist/esm/biz-components/WheelLottery/types.d.ts +6 -0
- package/dist/esm/biz-components/WheelLottery/types.js.map +2 -2
- package/dist/esm/biz-components/WhyChoose/WhyChoose.d.ts +1 -1
- package/dist/esm/biz-components/index.d.ts +7 -0
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/biz-components/index.js.map +3 -3
- package/dist/esm/hooks/useExposure.d.ts +4 -3
- package/dist/esm/hooks/useExposure.js +1 -1
- package/dist/esm/hooks/useExposure.js.map +3 -3
- package/dist/esm/hooks/useGridRowCount.d.ts +16 -0
- package/dist/esm/hooks/useGridRowCount.js +2 -0
- package/dist/esm/hooks/useGridRowCount.js.map +7 -0
- package/dist/esm/hooks/useViewItemList.d.ts +21 -0
- package/dist/esm/hooks/useViewItemList.js +2 -0
- package/dist/esm/hooks/useViewItemList.js.map +7 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +3 -3
- package/dist/esm/shared/Styles.js +1 -1
- package/dist/esm/shared/Styles.js.map +3 -3
- package/dist/esm/shared/trackUrlRef.d.ts +9 -0
- package/dist/esm/shared/trackUrlRef.js +1 -1
- package/dist/esm/shared/trackUrlRef.js.map +3 -3
- package/dist/esm/types/props.d.ts +18 -1
- package/dist/tokens/anker.css +2 -2
- package/dist/tokens/eufy.css +2 -2
- package/dist/tokens/eufyMake.css +2 -2
- package/dist/tokens/soundcore.css +2 -2
- package/package.json +1 -1
- package/style.css +215 -26
- package/tailwind.config.js +14 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as o,jsxs as E}from"react/jsx-runtime";import*as p from"react";import{cva as _}from"class-variance-authority";import{Swiper as b,SwiperSlide as M}from"swiper/react";import{FreeMode as A,Mousewheel as R,Pagination as O}from"swiper/modules";import{useMediaQuery as H}from"react-responsive";import"swiper/css/pagination";import{cn as a}from"../../helpers/index.js";import{Heading as h,Text as L}from"../../index.js";import{withLayout as B}from"../../shared/Styles.js";import{useExposure as V}from"../../hooks/useExposure.js";const j="image",z="Media Endorsement",w=3;function q(n,t){const d=[];for(let i=0;i<n.length;i+=t)d.push(n.slice(i,i+t));return d}const Q=_("rounded-box lg-desktop:h-[240px] desktop:px-6 flex h-[200px] flex-col justify-start gap-[26px] bg-[#EAEAEC] p-4",{variants:{theme:{light:"",dark:""},rounded:{true:"rounded-card",false:""}},defaultVariants:{theme:"light",rounded:!1}}),v=p.forwardRef(({className:n,classNames:t={},data:d,onItemClick:i,...x},k)=>{const{title:s,subtitle:l,items:c,theme:g="light",rounded:y=!1,layout:N="grid"}=d,T=H({query:"(max-width: 767px)"}),u=p.useRef(null);p.useImperativeHandle(k,()=>u.current),V(u,{componentType:j,componentName:z,componentTitle:s,componentDescription:l});const S=p.useCallback((e,r)=>m=>{i?.(e,r,m)},[i]),f=(e,r)=>E("div",{className:a("media-endorsement-card text-info-primary",Q({theme:g,rounded:y}),t.card),onClick:S(e,r),"aria-label":e.mediaName?`${e.mediaName} endorsement`:void 0,children:[o("div",{className:a("media-endorsement-card-icon","lg-desktop:h-16 flex h-12 items-center justify-start overflow-hidden",t.cardIcon),children:o("img",{src:e.icon.url,alt:e.icon.alt||e.mediaName||"Media logo",className:"lg-desktop:h-16 h-12 w-auto object-contain",loading:"lazy"})}),o(h,{size:2,as:"h6",className:a("media-endorsement-card-quote line-clamp-4",t.cardQuote),children:e.text})]},r),D=()=>{const e=q(c,w);return o(b,{className:a("media-endorsement-mobile-swiper","w-full !overflow-visible pb-8",t.carousel),modules:[O],slidesPerView:1,spaceBetween:12,pagination:{clickable:!0,bulletClass:"media-endorsement-bullet",bulletActiveClass:"media-endorsement-bullet-active"},children:e.map((r,m)=>o(M,{className:"!h-auto",children:o("div",{className:"flex flex-col gap-3",children:r.map((I,P)=>{const C=m*w+P;return f(I,C)})})},m))})};return E("div",{ref:u,className:a("media-endorsement-root text-info-primary","w-full",n,t.root,{"aiui-dark":g==="dark"}),...x,children:[o("style",{children:`
|
|
2
2
|
.media-endorsement-bullet {
|
|
3
3
|
display: inline-block;
|
|
4
4
|
width: 8px;
|
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
right: 0;
|
|
20
20
|
text-align: center;
|
|
21
21
|
}
|
|
22
|
-
`}),(l
|
|
22
|
+
`}),(s||l)&&E("div",{className:a("media-endorsement-header mb-6",t.header),children:[s&&o(h,{as:"h2",size:4,html:s,className:a("media-endorsement-title",t.title)}),l&&o(L,{as:"p",size:3,className:a("",t?.subtitle),html:l})]}),N==="carousel"?o(b,{className:a("media-endorsement-carousel","w-full !overflow-visible",t.carousel),modules:[A,R],freeMode:!0,mousewheel:{forceToAxis:!0},slidesPerView:"auto",spaceBetween:12,breakpoints:{768:{spaceBetween:16}},children:c.map((e,r)=>o(M,{className:"tablet:!w-[320px] laptop:!w-[360px] desktop:!w-[404px] !w-[280px]",children:f(e,r)},r))}):T?D():o("div",{className:a("media-endorsement-grid","laptop:grid-cols-2 laptop:gap-4 desktop:grid-cols-3 tablet:grid-cols-2 grid grid-cols-1 gap-3",t.grid),children:c.map((e,r)=>f(e,r))})]})});v.displayName="MediaEndorsement";var Z=B(v);export{Z as default};
|
|
23
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/MediaEndorsement/index.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cva } from 'class-variance-authority'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { FreeMode, Mousewheel, Pagination } from 'swiper/modules'\nimport { useMediaQuery } from 'react-responsive'\nimport 'swiper/css/pagination'\nimport { cn } from '../../helpers/index.js'\nimport type {\n MediaEndorsementProps,\n MediaEndorsementData,\n MediaEndorsementItem,\n MediaEndorsementSemanticName,\n} from './types.js'\nimport { Heading, Text } from '../../index.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nconst MOBILE_ITEMS_PER_SLIDE = 3\n\n// Helper to chunk array into groups\nfunction chunkArray<T>(array: T[], size: number): T[][] {\n const result: T[][] = []\n for (let i = 0; i < array.length; i += size) {\n result.push(array.slice(i, i + size))\n }\n return result\n}\n\n/**\n * \u5361\u7247\u5BB9\u5668\u53D8\u4F53\n */\nconst cardVariants = cva(\n 'rounded-box lg-desktop:h-[240px] desktop:px-6
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jsx", "jsxs", "React", "cva", "Swiper", "SwiperSlide", "FreeMode", "Mousewheel", "Pagination", "useMediaQuery", "cn", "Heading", "Text", "withLayout", "MOBILE_ITEMS_PER_SLIDE", "chunkArray", "array", "size", "result", "cardVariants", "MediaEndorsement", "className", "classNames", "data", "onItemClick", "props", "ref", "title", "subtitle", "items", "theme", "rounded", "layout", "isMobile", "handleCardClick", "item", "index", "event", "renderCard", "renderMobileGridSwiper", "chunkedItems", "group", "slideIndex", "itemIndex", "globalIndex", "MediaEndorsement_default"]
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cva } from 'class-variance-authority'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { FreeMode, Mousewheel, Pagination } from 'swiper/modules'\nimport { useMediaQuery } from 'react-responsive'\nimport 'swiper/css/pagination'\nimport { cn } from '../../helpers/index.js'\nimport type {\n MediaEndorsementProps,\n MediaEndorsementData,\n MediaEndorsementItem,\n MediaEndorsementSemanticName,\n} from './types.js'\nimport { Heading, Text } from '../../index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\n\nconst MEDIA_ENDORSEMENT_COMPONENT_TYPE = 'image'\nconst MEDIA_ENDORSEMENT_COMPONENT_NAME = 'Media Endorsement'\n\nconst MOBILE_ITEMS_PER_SLIDE = 3\n\n// Helper to chunk array into groups\nfunction chunkArray<T>(array: T[], size: number): T[][] {\n const result: T[][] = []\n for (let i = 0; i < array.length; i += size) {\n result.push(array.slice(i, i + size))\n }\n return result\n}\n\n/**\n * \u5361\u7247\u5BB9\u5668\u53D8\u4F53\n */\nconst cardVariants = cva(\n 'rounded-box lg-desktop:h-[240px] desktop:px-6 flex h-[200px] flex-col justify-start gap-[26px] bg-[#EAEAEC] p-4',\n {\n variants: {\n theme: {\n light: '',\n dark: '',\n },\n rounded: {\n true: 'rounded-card',\n false: '',\n },\n },\n defaultVariants: {\n theme: 'light',\n rounded: false,\n },\n }\n)\n\n/**\n * MediaEndorsement - \u5A92\u4F53\u80CC\u4E66\n *\n * @description \u5A92\u4F53\u80CC\u4E66\u7EC4\u4EF6\u7684\u4F5C\u7528\u662F\u901A\u8FC7\u5C55\u793A\u7B2C\u4E09\u65B9\u5A92\u4F53\u7684\u8BC4\u4EF7\u6216\u62A5\u9053\uFF0C\u63D0\u5347\u54C1\u724C\u6216\u4EA7\u54C1\u7684\u53EF\u4FE1\u5EA6\u548C\u5F71\u54CD\u529B\n */\nconst MediaEndorsement = React.forwardRef<HTMLDivElement, MediaEndorsementProps>(\n ({ className, classNames = {}, data, onItemClick, ...props }, ref) => {\n const { title, subtitle, items, theme = 'light', rounded = false, layout = 'grid' } = data\n const isMobile = useMediaQuery({ query: '(max-width: 767px)' })\n\n const innerRef = React.useRef<HTMLDivElement>(null)\n React.useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n useExposure(innerRef, {\n componentType: MEDIA_ENDORSEMENT_COMPONENT_TYPE,\n componentName: MEDIA_ENDORSEMENT_COMPONENT_NAME,\n componentTitle: title,\n componentDescription: subtitle,\n })\n const handleCardClick = React.useCallback(\n (item: MediaEndorsementItem, index: number) => (event: React.MouseEvent) => {\n onItemClick?.(item, index, event)\n },\n [onItemClick]\n )\n\n const renderCard = (item: MediaEndorsementItem, index: number) => (\n <div\n key={index}\n className={cn('media-endorsement-card text-info-primary', cardVariants({ theme, rounded }), classNames.card)}\n onClick={handleCardClick(item, index)}\n aria-label={item.mediaName ? `${item.mediaName} endorsement` : undefined}\n >\n {/* \u5A92\u4F53 Logo */}\n <div\n className={cn(\n 'media-endorsement-card-icon',\n 'lg-desktop:h-16 flex h-12 items-center justify-start overflow-hidden',\n classNames.cardIcon\n )}\n >\n <img\n src={item.icon.url}\n alt={item.icon.alt || item.mediaName || 'Media logo'}\n className=\"lg-desktop:h-16 h-12 w-auto object-contain\"\n loading=\"lazy\"\n />\n </div>\n\n {/* \u5F15\u7528\u6587\u6848 */}\n <Heading size={2} as={'h6'} className={cn('media-endorsement-card-quote line-clamp-4', classNames.cardQuote)}>\n {item.text}\n </Heading>\n </div>\n )\n\n // Mobile swiper for grid layout\n const renderMobileGridSwiper = () => {\n const chunkedItems = chunkArray(items, MOBILE_ITEMS_PER_SLIDE)\n return (\n <Swiper\n className={cn('media-endorsement-mobile-swiper', 'w-full !overflow-visible pb-8', classNames.carousel)}\n modules={[Pagination]}\n slidesPerView={1}\n spaceBetween={12}\n pagination={{\n clickable: true,\n bulletClass: 'media-endorsement-bullet',\n bulletActiveClass: 'media-endorsement-bullet-active',\n }}\n >\n {chunkedItems.map((group, slideIndex) => (\n <SwiperSlide key={slideIndex} className=\"!h-auto\">\n <div className=\"flex flex-col gap-3\">\n {group.map((item, itemIndex) => {\n const globalIndex = slideIndex * MOBILE_ITEMS_PER_SLIDE + itemIndex\n return renderCard(item, globalIndex)\n })}\n </div>\n </SwiperSlide>\n ))}\n </Swiper>\n )\n }\n\n return (\n <div\n ref={innerRef}\n className={cn('media-endorsement-root text-info-primary', 'w-full', className, classNames.root, {\n 'aiui-dark': theme === 'dark',\n })}\n {...props}\n >\n <style>{`\n .media-endorsement-bullet {\n display: inline-block;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: #D9D9D9;\n margin: 0 4px;\n cursor: pointer;\n transition: background-color 0.3s ease;\n }\n .media-endorsement-bullet-active {\n background: var(--info-primary-color);\n }\n .media-endorsement-mobile-swiper .swiper-pagination {\n position: absolute;\n bottom: -28px;\n left: 0;\n right: 0;\n text-align: center;\n }\n `}</style>\n {/* \u6807\u9898\u533A\u57DF */}\n {(title || subtitle) && (\n <div className={cn('media-endorsement-header mb-6', classNames.header)}>\n {title && (\n <Heading as=\"h2\" size={4} html={title} className={cn('media-endorsement-title', classNames.title)} />\n )}\n {subtitle && <Text as=\"p\" size={3} className={cn('', classNames?.subtitle)} html={subtitle} />}\n </div>\n )}\n {layout === 'carousel' ? (\n <Swiper\n className={cn('media-endorsement-carousel', 'w-full !overflow-visible', classNames.carousel)}\n modules={[FreeMode, Mousewheel]}\n freeMode={true}\n mousewheel={{ forceToAxis: true }}\n slidesPerView=\"auto\"\n spaceBetween={12}\n breakpoints={{\n 768: { spaceBetween: 16 },\n }}\n >\n {items.map((item, index) => (\n <SwiperSlide key={index} className=\"tablet:!w-[320px] laptop:!w-[360px] desktop:!w-[404px] !w-[280px]\">\n {renderCard(item, index)}\n </SwiperSlide>\n ))}\n </Swiper>\n ) : isMobile ? (\n renderMobileGridSwiper()\n ) : (\n <div\n className={cn(\n 'media-endorsement-grid',\n 'laptop:grid-cols-2 laptop:gap-4 desktop:grid-cols-3 tablet:grid-cols-2 grid grid-cols-1 gap-3',\n classNames.grid\n )}\n >\n {items.map((item, index) => renderCard(item, index))}\n </div>\n )}\n </div>\n )\n }\n)\n\nMediaEndorsement.displayName = 'MediaEndorsement'\n\nexport default withLayout(MediaEndorsement)\nexport type { MediaEndorsementProps, MediaEndorsementData, MediaEndorsementItem, MediaEndorsementSemanticName }\n"],
|
|
5
|
+
"mappings": "aAkFM,OAcI,OAAAA,EAdJ,QAAAC,MAAA,oBAhFN,UAAYC,MAAW,QACvB,OAAS,OAAAC,MAAW,2BACpB,OAAS,UAAAC,EAAQ,eAAAC,MAAmB,eACpC,OAAS,YAAAC,EAAU,cAAAC,EAAY,cAAAC,MAAkB,iBACjD,OAAS,iBAAAC,MAAqB,mBAC9B,MAAO,wBACP,OAAS,MAAAC,MAAU,yBAOnB,OAAS,WAAAC,EAAS,QAAAC,MAAY,iBAC9B,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,eAAAC,MAAmB,6BAE5B,MAAMC,EAAmC,QACnCC,EAAmC,oBAEnCC,EAAyB,EAG/B,SAASC,EAAcC,EAAYC,EAAqB,CACtD,MAAMC,EAAgB,CAAC,EACvB,QAAS,EAAI,EAAG,EAAIF,EAAM,OAAQ,GAAKC,EACrCC,EAAO,KAAKF,EAAM,MAAM,EAAG,EAAIC,CAAI,CAAC,EAEtC,OAAOC,CACT,CAKA,MAAMC,EAAenB,EACnB,kHACA,CACE,SAAU,CACR,MAAO,CACL,MAAO,GACP,KAAM,EACR,EACA,QAAS,CACP,KAAM,eACN,MAAO,EACT,CACF,EACA,gBAAiB,CACf,MAAO,QACP,QAAS,EACX,CACF,CACF,EAOMoB,EAAmBrB,EAAM,WAC7B,CAAC,CAAE,UAAAsB,EAAW,WAAAC,EAAa,CAAC,EAAG,KAAAC,EAAM,YAAAC,EAAa,GAAGC,CAAM,EAAGC,IAAQ,CACpE,KAAM,CAAE,MAAAC,EAAO,SAAAC,EAAU,MAAAC,EAAO,MAAAC,EAAQ,QAAS,QAAAC,EAAU,GAAO,OAAAC,EAAS,MAAO,EAAIT,EAChFU,EAAW3B,EAAc,CAAE,MAAO,oBAAqB,CAAC,EAExD4B,EAAWnC,EAAM,OAAuB,IAAI,EAClDA,EAAM,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YAAc,mBAE/B,IAAO0B,EAAQpC,EAAWU,CAAgB",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "cva", "Swiper", "SwiperSlide", "FreeMode", "Mousewheel", "Pagination", "useMediaQuery", "cn", "Heading", "Text", "withLayout", "useExposure", "MEDIA_ENDORSEMENT_COMPONENT_TYPE", "MEDIA_ENDORSEMENT_COMPONENT_NAME", "MOBILE_ITEMS_PER_SLIDE", "chunkArray", "array", "size", "result", "cardVariants", "MediaEndorsement", "className", "classNames", "data", "onItemClick", "props", "ref", "title", "subtitle", "items", "theme", "rounded", "layout", "isMobile", "innerRef", "handleCardClick", "item", "index", "event", "renderCard", "renderMobileGridSwiper", "chunkedItems", "group", "slideIndex", "itemIndex", "globalIndex", "MediaEndorsement_default"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MediaPlayerBaseProps } from './types.js';
|
|
2
|
-
declare const _default: import("react").ForwardRefExoticComponent<Omit<MediaPlayerBaseProps & import("react").RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("
|
|
2
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<MediaPlayerBaseProps & import("react").RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../WheelLottery/index.js").ContainerProps & import("react").RefAttributes<unknown>> & {
|
|
3
3
|
readonly $$typeof: symbol;
|
|
4
4
|
};
|
|
5
5
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{Fragment as
|
|
1
|
+
"use client";import{Fragment as Se,jsx as e,jsxs as l}from"react/jsx-runtime";import{useState as y,useRef as n,useMemo as ke,useEffect as F,forwardRef as Ne,useImperativeHandle as He}from"react";import{debounce as Te}from"lodash";import{cn as o}from"../../helpers/utils.js";import{withLayout as ze}from"../../shared/Styles.js";import le from"../../components/button.js";import{Heading as Me,Text as se}from"../../components/index.js";import{VideoModal as Le}from"../VideoModal/index.js";import{convertLexicalToHTML as ae}from"@payloadcms/richtext-lexical/html";import{useInView as Re}from"react-intersection-observer";import{useExposure as Ie}from"../../hooks/useExposure.js";import L from"../../helpers/ScrollLoadVideo.js";import{gsap as m}from"gsap";import{SplitText as re}from"gsap/dist/SplitText";import{ScrollTrigger as q}from"gsap/dist/ScrollTrigger";const Ee="media_player_base",Pe="video";m.registerPlugin(q,re);const ne=({defaultConverters:f})=>({...f,text:R=>{const{node:s}=R;return s.$&&s.$.color?`<span class="lexical-${s.$.color}">${s.text}</span>`:s.text}}),ie=Ne(({className:f="",id:R,onBtnClick:s,data:{title:b,videoTitle:h,btnText:w,youtubeId:U,video:k,mobileVideo:Y,theme:I,img:N,shape:E,titleAnimation:H="fade-in",variant:ce,headline:O,paragraphs:P,metrics:S,...pe},..._},de)=>{const{sticky:i}=pe,[G,J]=y(!1),[K,ue]=y(0),[me,fe]=y(0),[T,ge]=y(0),[Q,$]=y(!1),d=n(null),W=n(null),r=n(null),z=n(null),X=n(null),M=n(null),g=n(null),B=n(null),C=n(null),{ref:Z,inView:c}=Re();He(de,()=>r.current);const x=typeof b=="string"?b:b&&ae({data:b,converters:ne}),A=typeof h=="string"?h:h&&ae({data:h,converters:ne});F(()=>{c?(d.current?.play(),J(!0)):(d.current?.pause(),J(!1))},[c]);const V=Te(()=>{if(r.current){const t=r.current.getBoundingClientRect(),a=window.innerHeight,v=window.scrollY||window.pageYOffset,p=t.bottom+v,u=document.documentElement.scrollHeight-p;ue(u>a?a:u)}if(r.current){const t=r.current.clientHeight,a=window.innerHeight;fe(t+a)}},600);F(()=>(V(),window.addEventListener("resize",V),()=>{window.removeEventListener("resize",V)}),[]),F(()=>{function t(){if(!z.current||H!=="fade-in")return;const v=z.current?.clientHeight||80;M.current=new re(z.current,{type:"words",wordsClass:"word"});const p=M.current.words;m.set(p,{opacity:0}),g.current&&m.set(g.current,{opacity:0}),B.current=q.create({trigger:r.current,start:"top center-=10%",end:`top+=${v*1.5+80}px center-=10%`,scrub:!0,onUpdate:ee=>{const u=ee.progress,te=p.length,ve=1/te,oe=.5;p.forEach((ye,be)=>{const he=be/te*(1-oe),we=ve*(1+oe);let D=(u-he)/we;D=Math.max(0,Math.min(D,1)),m.set(ye,{opacity:D})}),m.set(W.current,{opacity:u}),g.current&&m.set(g.current,{opacity:u>=.6?1:0})}})}function a(){C.current=q.create({trigger:r.current,start:"bottom bottom",end:"bottom top",scrub:!0,onUpdate:v=>{const p=v.progress;ge(p)}})}return c&&(t(),a()),()=>{M.current&&M.current.revert(),B.current&&B.current.kill(),C.current&&C.current.kill()}},[H,c]),Ie(X,{componentType:Pe,componentName:Ee,componentTitle:x});const xe=ke(()=>c&&T>0&&T<.9?3:c?2:1,[T,c]);if(ce==="text-layout")return l("div",{..._,ref:r,className:o("relative flex w-full items-center overflow-hidden","aspect-w-[390] aspect-h-[660] tablet:aspect-w-[768] tablet:aspect-h-[660]","laptop:aspect-w-[1024] laptop:aspect-h-[520] desktop:aspect-w-[1440] desktop:aspect-h-[700]","lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930]",{"aiui-dark":I==="dark","rounded-box":E==="rounded"},f),children:[e("div",{ref:Z,className:"pointer-events-none absolute inset-0"}),l("div",{className:"absolute inset-0 z-0",children:[e(L,{videoRef:d,poster:N?.url||"",src:k?.url,className:"tablet:block hidden size-full",videoClassName:"size-full object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e(L,{videoRef:d,poster:N?.url||"",src:Y?.url||k?.url,className:"tablet:hidden block size-full",videoClassName:"size-full object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e("div",{className:"absolute inset-0 bg-black/30"})]}),l("div",{className:o("relative z-10 mx-auto flex w-full max-w-[1920px] flex-col","gap-6 px-4 py-10","tablet:gap-8 tablet:px-8","laptop:flex-row laptop:gap-12 laptop:px-16","desktop:gap-16 desktop:px-20","lg-desktop:px-24"),children:[e("div",{className:"laptop:w-1/2 w-full shrink-0",children:O&&e(Me,{as:"h2",size:5,className:"text-info-primary",children:O})}),l("div",{className:o("laptop:w-1/2 flex w-full flex-col justify-start","tablet:gap-8 laptop:gap-10 desktop:gap-12 gap-6"),children:[P&&P.length>0&&e("div",{className:"tablet:gap-4 flex flex-col gap-3",children:P.map((t,a)=>e(se,{as:"p",size:3,className:"text-info-primary lg-desktop:text-[18px] opacity-90",children:typeof t=="string"?t:t.text},a))}),S&&S.length>0&&e("div",{className:o("tablet:grid-cols-3 grid grid-cols-2","tablet:gap-6 desktop:gap-8 gap-4"),children:S.map((t,a)=>l("div",{className:"flex flex-col gap-1",children:[e("span",{className:"text-info-primary desktop:text-[40px] lg-desktop:text-[48px] text-balance text-[32px] font-bold leading-[100%] tracking-[-0.04em]",children:t.value}),e(se,{as:"span",size:2,className:"text-info-primary opacity-80",children:t.label})]},a))})]})]})]});const j="lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]";return l(Se,{children:[i&&e("div",{..._,ref:r,className:o("pointer-events-none relative z-10",j,{"aiui-dark":I==="dark","rounded-box":E==="rounded"},f),children:e("div",{ref:Z,children:!H&&l("div",{className:"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4 text-center",children:[x&&!G&&e("div",{className:"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:x}}),A&&G&&e("div",{className:"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:A}}),w&&e(le,{variant:"link",className:o("member-equity-button-secondary text-info-primary"),onClick:()=>{$(!0),s&&s?.()},children:w})]})})}),l("div",{...i?{}:_,style:i?{marginBottom:`-${K}px`,marginTop:`-${me}px`,zIndex:xe}:{zIndex:5},className:o("relative",f),children:[e("div",{className:"sticky top-0 ",children:l("div",{id:R,className:o("relative overflow-hidden",i?"h-screen w-full":j,{"aiui-dark":I==="dark","rounded-box":E==="rounded"}),children:[H==="fade-in"&&l("div",{className:o("absolute z-30 flex w-full flex-col items-center justify-center gap-4 px-4 text-center",i?"left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2":"left-0 top-0"),children:[x&&e("div",{ref:z,className:"media-player-base-title lg-desktop:text-[64px] text-info-primary text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:x}}),w&&e(le,{ref:g,variant:"link",className:o("media-player-base-button member-equity-button-secondary text-info-primary"),onClick:()=>{$(!0),s&&s?.()},children:w})]}),l("div",{className:"media-cover left-0 top-0 h-screen w-screen overflow-hidden",style:{height:`${102-T*100}vh`},children:[e(L,{videoRef:d,poster:N?.url||"",src:k?.url,className:"tablet:block hidden size-full !h-auto",videoClassName:"object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e(L,{videoRef:d,poster:N?.url||"",src:Y?.url||k?.url,className:"tablet:hidden block min-h-screen w-full",videoClassName:"object-cover w-full h-auto",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e("div",{ref:W,className:"absolute left-0 top-0 z-10 size-full opacity-0",style:{background:"rgba(0, 0, 0, 0.2)"}})]})]})}),i&&e("div",{className:o(i&&"pointer-events-none relative box-content block",j),style:i?{height:`${K}px`}:{},ref:X})]}),Q&&U&&e(Le,{visible:Q,youTubeId:U,onCloseModal:()=>$(!1)})]})});ie.displayName="MediaPlayerBase";var Ke=ze(ie);export{Ke as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/MediaPlayerBase/index.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport { useState, useRef, useMemo, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport { debounce } from 'lodash'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport Button from '../../components/button.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\nimport type { MediaPlayerBaseProps } from './types.js'\n// import { Right } from './right.js'\nimport { useInView } from 'react-intersection-observer'\nimport type { HTMLConvertersFunction } from '@payloadcms/richtext-lexical/html'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport ScrollLoadVideo from '../../helpers/ScrollLoadVideo.js'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\n\nconst componentName = 'media_player_base'\nconst componentType = 'video'\n\n// \u6CE8\u518C gsap \u63D2\u4EF6\ngsap.registerPlugin(ScrollTrigger, SplitText)\n\nconst htmlConverters: HTMLConvertersFunction = ({ defaultConverters }) => ({\n ...defaultConverters,\n text: args => {\n const { node } = args\n // \u68C0\u67E5\u662F\u5426\u6709\u81EA\u5B9A\u4E49 color\n if (node.$ && node.$.color) {\n return `<span class=\"lexical-${node.$.color}\">${node.text}</span>`\n }\n return node.text\n },\n})\n\nconst MediaPlayerBase = forwardRef<HTMLDivElement, MediaPlayerBaseProps>(\n (\n {\n className = '',\n id,\n onBtnClick,\n data: {\n title,\n videoTitle,\n btnText,\n youtubeId,\n video,\n mobileVideo,\n theme,\n img,\n shape,\n titleAnimation = 'fade-in',\n ...dataRest\n },\n ...rest\n },\n ref\n ) => {\n const { sticky } = dataRest\n const [isPlaying, setIsPlaying] = useState(false)\n const [btb, setbtb] = useState(0)\n const [titleHeight, setTitleHeight] = useState(0)\n const [videoHeightProgress, setVideoHeightProgress] = useState(0)\n const [visible, setVisible] = useState<boolean>(false)\n\n const videoRef = useRef<HTMLVideoElement>(null)\n const bgRef = useRef<HTMLImageElement>(null)\n const titleRef = useRef<HTMLDivElement>(null)\n const titleFadeInRef = useRef<HTMLDivElement>(null)\n const trackRef = useRef<HTMLDivElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const btnFadeInRef = useRef<HTMLButtonElement>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n const heightTriggerRef = useRef<ScrollTrigger | null>(null)\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => titleRef.current as HTMLDivElement)\n\n const title_html =\n typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title, converters: htmlConverters })\n const videoTitle_html =\n typeof videoTitle === 'string'\n ? videoTitle\n : videoTitle && convertLexicalToHTML({ data: videoTitle, converters: htmlConverters })\n\n useEffect(() => {\n if (inView) {\n videoRef.current?.play()\n setIsPlaying(true)\n } else {\n videoRef.current?.pause()\n setIsPlaying(false)\n }\n }, [inView])\n\n const debouncedHandleResize = debounce(() => {\n if (titleRef.current) {\n const rect = titleRef.current.getBoundingClientRect()\n const screenHeight = window.innerHeight\n const scrollTop = window.scrollY || window.pageYOffset\n const elementBottomToPageTop = rect.bottom + scrollTop\n const pageHeight = document.documentElement.scrollHeight\n const distanceToPageBottom = pageHeight - elementBottomToPageTop\n setbtb(distanceToPageBottom > screenHeight ? screenHeight : distanceToPageBottom)\n }\n if (titleRef.current) {\n const titleHeight = titleRef.current.clientHeight\n const screenHeight = window.innerHeight\n setTitleHeight(titleHeight + screenHeight)\n }\n }, 600)\n\n useEffect(() => {\n debouncedHandleResize()\n window.addEventListener('resize', debouncedHandleResize)\n return () => {\n window.removeEventListener('resize', debouncedHandleResize)\n }\n }, [])\n\n useEffect(() => {\n function gsapResize() {\n if (!titleFadeInRef.current || titleAnimation !== 'fade-in') return\n const height = titleFadeInRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleFadeInRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n if (btnFadeInRef.current) gsap.set(btnFadeInRef.current, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'top center-=10%',\n end: `top+=${height * 1.5 + 80}px center-=10%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n gsap.set(bgRef.current, { opacity: progress })\n if (btnFadeInRef.current) {\n gsap.set(btnFadeInRef.current, { opacity: progress >= 0.6 ? 1 : 0 })\n }\n },\n })\n }\n\n function gsapVideoHeightResize() {\n heightTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom',\n end: `bottom top`,\n // markers: true,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n setVideoHeightProgress(progress)\n },\n })\n }\n\n if (inView) {\n gsapResize()\n gsapVideoHeightResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n heightTriggerRef.current && heightTriggerRef.current.kill()\n }\n }, [titleAnimation, inView])\n\n useExposure(trackRef, {\n componentType,\n componentName,\n componentTitle: title_html,\n })\n\n const zIndexVideo = useMemo(() => {\n if (inView && videoHeightProgress > 0 && videoHeightProgress < 0.9) return 3\n if (inView) return 2\n return 1\n }, [videoHeightProgress, inView])\n\n const aspect =\n 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]'\n return (\n <>\n {sticky && (\n <div\n {...rest}\n ref={titleRef}\n className={cn(\n 'pointer-events-none relative z-10',\n aspect,\n {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n },\n className\n )}\n >\n <div ref={inViewRef}>\n {!titleAnimation && (\n <div className=\"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4 text-center\">\n {title_html && !isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {videoTitle_html && isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: videoTitle_html }}\n />\n )}\n {btnText && (\n <Button\n variant=\"link\"\n className={cn('member-equity-button-secondary text-info-primary')}\n onClick={() => {\n setVisible(true)\n // if (isPlaying) {\n // if (videoRef.current) {\n // videoRef.current.pause()\n // }\n // setIsPlaying(false)\n // } else {\n // if (videoRef.current) {\n // videoRef.current.play()\n // }\n // setIsPlaying(true)\n // }\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n {/* <Right /> */}\n </Button>\n )}\n </div>\n )}\n </div>\n </div>\n )}\n <div\n {...(!sticky ? rest : {})}\n style={\n sticky\n ? {\n marginBottom: `-${btb}px`,\n marginTop: `-${titleHeight}px`,\n zIndex: zIndexVideo,\n }\n : { zIndex: 5 }\n }\n className={cn('relative', className)}\n >\n <div className=\"sticky top-0 \">\n <div\n id={id}\n className={cn('relative overflow-hidden', sticky ? 'h-screen w-full' : aspect, {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n })}\n >\n {titleAnimation === 'fade-in' && (\n <div\n className={cn(\n 'absolute z-30 flex w-full flex-col items-center justify-center gap-4 px-4 text-center',\n sticky ? 'left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2' : 'left-0 top-0'\n )}\n >\n {title_html && (\n <div\n ref={titleFadeInRef}\n className=\"media-player-base-title lg-desktop:text-[64px] text-info-primary text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {btnText && (\n <Button\n ref={btnFadeInRef}\n variant=\"link\"\n className={cn('media-player-base-button member-equity-button-secondary text-info-primary')}\n onClick={() => {\n setVisible(true)\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n </Button>\n )}\n </div>\n )}\n <div\n className=\"media-cover left-0 top-0 h-screen w-screen overflow-hidden\"\n style={{ height: `${102 - videoHeightProgress * 100}vh` }}\n >\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={video?.url!}\n className=\"tablet:block hidden size-full !h-auto\"\n videoClassName=\"object-cover\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline\n x5-playsinline\n />\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={mobileVideo?.url || video?.url!}\n className=\"tablet:hidden block min-h-screen w-full\"\n videoClassName=\"object-cover w-full h-auto\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline\n x5-playsinline\n />\n <div\n ref={bgRef}\n className=\"absolute left-0 top-0 z-10 size-full opacity-0\"\n style={{\n background: 'rgba(0, 0, 0, 0.2)',\n }}\n />\n </div>\n </div>\n </div>\n {sticky && (\n <div\n className={cn(sticky && 'pointer-events-none relative box-content block', aspect)}\n style={sticky ? { height: `${btb}px` } : {}}\n ref={trackRef}\n />\n )}\n </div>\n {visible && youtubeId && (\n <VideoModal visible={visible} youTubeId={youtubeId} onCloseModal={() => setVisible(false)} />\n )}\n </>\n )\n }\n)\n\nMediaPlayerBase.displayName = 'MediaPlayerBase'\n\nexport default withLayout(MediaPlayerBase)\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["Fragment", "jsx", "jsxs", "useState", "useRef", "useMemo", "useEffect", "forwardRef", "useImperativeHandle", "debounce", "cn", "withLayout", "Button", "VideoModal", "convertLexicalToHTML", "useInView", "useExposure", "ScrollLoadVideo", "gsap", "SplitText", "ScrollTrigger", "componentName", "componentType", "htmlConverters", "defaultConverters", "args", "node", "MediaPlayerBase", "className", "id", "onBtnClick", "title", "videoTitle", "btnText", "youtubeId", "video", "mobileVideo", "theme", "img", "shape", "titleAnimation", "dataRest", "rest", "ref", "sticky", "isPlaying", "setIsPlaying", "btb", "setbtb", "titleHeight", "setTitleHeight", "videoHeightProgress", "setVideoHeightProgress", "visible", "setVisible", "videoRef", "bgRef", "titleRef", "titleFadeInRef", "trackRef", "splitTextInstance", "btnFadeInRef", "scrollTriggerRef", "heightTriggerRef", "inViewRef", "inView", "title_html", "videoTitle_html", "debouncedHandleResize", "rect", "screenHeight", "scrollTop", "elementBottomToPageTop", "distanceToPageBottom", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "i", "start", "width", "opacity", "gsapVideoHeightResize", "zIndexVideo", "aspect", "MediaPlayerBase_default"]
|
|
4
|
+
"sourcesContent": ["'use client'\nimport { useState, useRef, useMemo, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport { debounce } from 'lodash'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport Button from '../../components/button.js'\nimport { Heading, Text } from '../../components/index.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\nimport type { MediaPlayerBaseProps } from './types.js'\n// import { Right } from './right.js'\nimport { useInView } from 'react-intersection-observer'\nimport type { HTMLConvertersFunction } from '@payloadcms/richtext-lexical/html'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport ScrollLoadVideo from '../../helpers/ScrollLoadVideo.js'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\n\nconst componentName = 'media_player_base'\nconst componentType = 'video'\n\n// \u6CE8\u518C gsap \u63D2\u4EF6\ngsap.registerPlugin(ScrollTrigger, SplitText)\n\nconst htmlConverters: HTMLConvertersFunction = ({ defaultConverters }) => ({\n ...defaultConverters,\n text: args => {\n const { node } = args\n // \u68C0\u67E5\u662F\u5426\u6709\u81EA\u5B9A\u4E49 color\n if (node.$ && node.$.color) {\n return `<span class=\"lexical-${node.$.color}\">${node.text}</span>`\n }\n return node.text\n },\n})\n\nconst MediaPlayerBase = forwardRef<HTMLDivElement, MediaPlayerBaseProps>(\n (\n {\n className = '',\n id,\n onBtnClick,\n data: {\n title,\n videoTitle,\n btnText,\n youtubeId,\n video,\n mobileVideo,\n theme,\n img,\n shape,\n titleAnimation = 'fade-in',\n variant,\n headline,\n paragraphs,\n metrics,\n ...dataRest\n },\n ...rest\n },\n ref\n ) => {\n const { sticky } = dataRest\n const [isPlaying, setIsPlaying] = useState(false)\n const [btb, setbtb] = useState(0)\n const [titleHeight, setTitleHeight] = useState(0)\n const [videoHeightProgress, setVideoHeightProgress] = useState(0)\n const [visible, setVisible] = useState<boolean>(false)\n\n const videoRef = useRef<HTMLVideoElement>(null)\n const bgRef = useRef<HTMLImageElement>(null)\n const titleRef = useRef<HTMLDivElement>(null)\n const titleFadeInRef = useRef<HTMLDivElement>(null)\n const trackRef = useRef<HTMLDivElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const btnFadeInRef = useRef<HTMLButtonElement>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n const heightTriggerRef = useRef<ScrollTrigger | null>(null)\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => titleRef.current as HTMLDivElement)\n\n const title_html =\n typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title, converters: htmlConverters })\n const videoTitle_html =\n typeof videoTitle === 'string'\n ? videoTitle\n : videoTitle && convertLexicalToHTML({ data: videoTitle, converters: htmlConverters })\n\n useEffect(() => {\n if (inView) {\n videoRef.current?.play()\n setIsPlaying(true)\n } else {\n videoRef.current?.pause()\n setIsPlaying(false)\n }\n }, [inView])\n\n const debouncedHandleResize = debounce(() => {\n if (titleRef.current) {\n const rect = titleRef.current.getBoundingClientRect()\n const screenHeight = window.innerHeight\n const scrollTop = window.scrollY || window.pageYOffset\n const elementBottomToPageTop = rect.bottom + scrollTop\n const pageHeight = document.documentElement.scrollHeight\n const distanceToPageBottom = pageHeight - elementBottomToPageTop\n setbtb(distanceToPageBottom > screenHeight ? screenHeight : distanceToPageBottom)\n }\n if (titleRef.current) {\n const titleHeight = titleRef.current.clientHeight\n const screenHeight = window.innerHeight\n setTitleHeight(titleHeight + screenHeight)\n }\n }, 600)\n\n useEffect(() => {\n debouncedHandleResize()\n window.addEventListener('resize', debouncedHandleResize)\n return () => {\n window.removeEventListener('resize', debouncedHandleResize)\n }\n }, [])\n\n useEffect(() => {\n function gsapResize() {\n if (!titleFadeInRef.current || titleAnimation !== 'fade-in') return\n const height = titleFadeInRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleFadeInRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n if (btnFadeInRef.current) gsap.set(btnFadeInRef.current, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'top center-=10%',\n end: `top+=${height * 1.5 + 80}px center-=10%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n gsap.set(bgRef.current, { opacity: progress })\n if (btnFadeInRef.current) {\n gsap.set(btnFadeInRef.current, { opacity: progress >= 0.6 ? 1 : 0 })\n }\n },\n })\n }\n\n function gsapVideoHeightResize() {\n heightTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom',\n end: `bottom top`,\n // markers: true,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n setVideoHeightProgress(progress)\n },\n })\n }\n\n if (inView) {\n gsapResize()\n gsapVideoHeightResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n heightTriggerRef.current && heightTriggerRef.current.kill()\n }\n }, [titleAnimation, inView])\n\n useExposure(trackRef, {\n componentType,\n componentName,\n componentTitle: title_html,\n })\n\n const zIndexVideo = useMemo(() => {\n if (inView && videoHeightProgress > 0 && videoHeightProgress < 0.9) return 3\n if (inView) return 2\n return 1\n }, [videoHeightProgress, inView])\n\n if (variant === 'text-layout') {\n return (\n <div\n {...rest}\n ref={titleRef}\n className={cn(\n 'relative flex w-full items-center overflow-hidden',\n 'aspect-w-[390] aspect-h-[660] tablet:aspect-w-[768] tablet:aspect-h-[660]',\n 'laptop:aspect-w-[1024] laptop:aspect-h-[520] desktop:aspect-w-[1440] desktop:aspect-h-[700]',\n 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930]',\n {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n },\n className\n )}\n >\n <div ref={inViewRef} className=\"pointer-events-none absolute inset-0\" />\n\n {/* Video Background */}\n <div className=\"absolute inset-0 z-0\">\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={video?.url!}\n className=\"tablet:block hidden size-full\"\n videoClassName=\"size-full object-cover\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline\n x5-playsinline\n />\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={mobileVideo?.url || video?.url!}\n className=\"tablet:hidden block size-full\"\n videoClassName=\"size-full object-cover\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline\n x5-playsinline\n />\n <div className=\"absolute inset-0 bg-black/30\" />\n </div>\n\n {/* Content */}\n {/* Content \u2014 Fix#1/#9: laptop:flex-row, reduced spacing */}\n <div\n className={cn(\n 'relative z-10 mx-auto flex w-full max-w-[1920px] flex-col',\n 'gap-6 px-4 py-10',\n 'tablet:gap-8 tablet:px-8',\n 'laptop:flex-row laptop:gap-12 laptop:px-16',\n 'desktop:gap-16 desktop:px-20',\n 'lg-desktop:px-24'\n )}\n >\n {/* 1. Headline */}\n {/* 1. Headline \u2014 Fix#1(w-1/2) + Fix#5(Heading size=5) */}\n <div className=\"laptop:w-1/2 w-full shrink-0\">\n {headline && (\n <Heading as=\"h2\" size={5} className=\"text-info-primary\">\n {headline}\n </Heading>\n )}\n </div>\n\n {/* Right column for paragraphs and metrics */}\n {/* Right column \u2014 Fix#1(w-1/2) + Fix#4(justify-start) + Fix#10(gap) */}\n <div\n className={cn(\n 'laptop:w-1/2 flex w-full flex-col justify-start',\n 'tablet:gap-8 laptop:gap-10 desktop:gap-12 gap-6'\n )}\n >\n {/* 2. Paragraphs */}\n {paragraphs && paragraphs.length > 0 && (\n <div className=\"tablet:gap-4 flex flex-col gap-3\">\n {paragraphs.map((p, i) => (\n <Text key={i} as=\"p\" size={3} className=\"text-info-primary lg-desktop:text-[18px] opacity-90\">\n {typeof p === 'string' ? p : p.text}\n </Text>\n ))}\n </div>\n )}\n\n {/* 3. Metrics */}\n {metrics && metrics.length > 0 && (\n <div className={cn('tablet:grid-cols-3 grid grid-cols-2', 'tablet:gap-6 desktop:gap-8 gap-4')}>\n {metrics.map((m, i) => (\n <div key={i} className=\"flex flex-col gap-1\">\n {/* Fix#7: Heading size=4 equivalent classes on span */}\n <span className=\"text-info-primary desktop:text-[40px] lg-desktop:text-[48px] text-balance text-[32px] font-bold leading-[100%] tracking-[-0.04em]\">\n {m.value}\n </span>\n {/* Fix#8: Text size=2 \u2192 14px, removed uppercase/tracking-wider */}\n <Text as=\"span\" size={2} className=\"text-info-primary opacity-80\">\n {m.label}\n </Text>\n </div>\n ))}\n </div>\n )}\n </div>\n </div>\n </div>\n )\n }\n\n const aspect =\n 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]'\n return (\n <>\n {sticky && (\n <div\n {...rest}\n ref={titleRef}\n className={cn(\n 'pointer-events-none relative z-10',\n aspect,\n {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n },\n className\n )}\n >\n <div ref={inViewRef}>\n {!titleAnimation && (\n <div className=\"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4 text-center\">\n {title_html && !isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {videoTitle_html && isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: videoTitle_html }}\n />\n )}\n {btnText && (\n <Button\n variant=\"link\"\n className={cn('member-equity-button-secondary text-info-primary')}\n onClick={() => {\n setVisible(true)\n // if (isPlaying) {\n // if (videoRef.current) {\n // videoRef.current.pause()\n // }\n // setIsPlaying(false)\n // } else {\n // if (videoRef.current) {\n // videoRef.current.play()\n // }\n // setIsPlaying(true)\n // }\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n {/* <Right /> */}\n </Button>\n )}\n </div>\n )}\n </div>\n </div>\n )}\n <div\n {...(!sticky ? rest : {})}\n style={\n sticky\n ? {\n marginBottom: `-${btb}px`,\n marginTop: `-${titleHeight}px`,\n zIndex: zIndexVideo,\n }\n : { zIndex: 5 }\n }\n className={cn('relative', className)}\n >\n <div className=\"sticky top-0 \">\n <div\n id={id}\n className={cn('relative overflow-hidden', sticky ? 'h-screen w-full' : aspect, {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n })}\n >\n {titleAnimation === 'fade-in' && (\n <div\n className={cn(\n 'absolute z-30 flex w-full flex-col items-center justify-center gap-4 px-4 text-center',\n sticky ? 'left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2' : 'left-0 top-0'\n )}\n >\n {title_html && (\n <div\n ref={titleFadeInRef}\n className=\"media-player-base-title lg-desktop:text-[64px] text-info-primary text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {btnText && (\n <Button\n ref={btnFadeInRef}\n variant=\"link\"\n className={cn('media-player-base-button member-equity-button-secondary text-info-primary')}\n onClick={() => {\n setVisible(true)\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n </Button>\n )}\n </div>\n )}\n <div\n className=\"media-cover left-0 top-0 h-screen w-screen overflow-hidden\"\n style={{ height: `${102 - videoHeightProgress * 100}vh` }}\n >\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={video?.url!}\n className=\"tablet:block hidden size-full !h-auto\"\n videoClassName=\"object-cover\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline\n x5-playsinline\n />\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={mobileVideo?.url || video?.url!}\n className=\"tablet:hidden block min-h-screen w-full\"\n videoClassName=\"object-cover w-full h-auto\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline\n x5-playsinline\n />\n <div\n ref={bgRef}\n className=\"absolute left-0 top-0 z-10 size-full opacity-0\"\n style={{\n background: 'rgba(0, 0, 0, 0.2)',\n }}\n />\n </div>\n </div>\n </div>\n {sticky && (\n <div\n className={cn(sticky && 'pointer-events-none relative box-content block', aspect)}\n style={sticky ? { height: `${btb}px` } : {}}\n ref={trackRef}\n />\n )}\n </div>\n {visible && youtubeId && (\n <VideoModal visible={visible} youTubeId={youtubeId} onCloseModal={() => setVis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GAAK,KAAO,GACpB,IAAKH,GAAO,IACZ,UAAU,wCACV,eAAe,eACf,MAAK,GACL,KAAI,GACJ,YAAW,GACX,SAAQ,GACR,qBAAkB,GAClB,iBAAc,GAChB,EACApC,EAACkB,EAAA,CACC,SAAU0C,EACV,OAAQrB,GAAK,KAAO,GACpB,IAAKF,GAAa,KAAOD,GAAO,IAChC,UAAU,0CACV,eAAe,6BACf,MAAK,GACL,KAAI,GACJ,YAAW,GACX,SAAQ,GACR,qBAAkB,GAClB,iBAAc,GAChB,EACApC,EAAC,OACC,IAAK6D,EACL,UAAU,iDACV,MAAO,CACL,WAAY,oBACd,EACF,GACF,GACF,EACF,EACCZ,GACCjD,EAAC,OACC,UAAWS,EAAGwC,GAAU,iDAAkD+C,CAAM,EAChF,MAAO/C,EAAS,CAAE,OAAQ,GAAGG,CAAG,IAAK,EAAI,CAAC,EAC1C,IAAKY,EACP,GAEJ,EACCN,GAAWvB,GACVnC,EAACc,GAAA,CAAW,QAAS4C,EAAS,UAAWvB,EAAW,aAAc,IAAMwB,EAAW,EAAK,EAAG,GAE/F,CAEJ,CACF,EAEA/B,GAAgB,YAAc,kBAE9B,IAAOqE,GAAQvF,GAAWkB,EAAe",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "useState", "useRef", "useMemo", "useEffect", "forwardRef", "useImperativeHandle", "debounce", "cn", "withLayout", "Button", "Heading", "Text", "VideoModal", "convertLexicalToHTML", "useInView", "useExposure", "ScrollLoadVideo", "gsap", "SplitText", "ScrollTrigger", "componentName", "componentType", "htmlConverters", "defaultConverters", "args", "node", "MediaPlayerBase", "className", "id", "onBtnClick", "title", "videoTitle", "btnText", "youtubeId", "video", "mobileVideo", "theme", "img", "shape", "titleAnimation", "variant", "headline", "paragraphs", "metrics", "dataRest", "rest", "ref", "sticky", "isPlaying", "setIsPlaying", "btb", "setbtb", "titleHeight", "setTitleHeight", "videoHeightProgress", "setVideoHeightProgress", "visible", "setVisible", "videoRef", "bgRef", "titleRef", "titleFadeInRef", "trackRef", "splitTextInstance", "btnFadeInRef", "scrollTriggerRef", "heightTriggerRef", "inViewRef", "inView", "title_html", "videoTitle_html", "debouncedHandleResize", "rect", "screenHeight", "scrollTop", "elementBottomToPageTop", "distanceToPageBottom", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "i", "start", "width", "opacity", "gsapVideoHeightResize", "zIndexVideo", "p", "m", "aspect", "MediaPlayerBase_default"]
|
|
7
7
|
}
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import type { ComponentCommonProps, Shape, Theme, Video, Img } from '../../types/props.js';
|
|
2
|
+
/** Fixed shape for a single stat/metric entry in the text-layout variant. */
|
|
3
|
+
export interface MediaPlayerBaseMetric {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A single paragraph item. Accepts a plain string OR the Payload CMS array item shape
|
|
9
|
+
* (`{ text: string; id?: string | null }`) to avoid a consumer-side normalization step.
|
|
10
|
+
*/
|
|
11
|
+
export type MediaPlayerBaseParagraph = string | {
|
|
12
|
+
text: string;
|
|
13
|
+
id?: string | null;
|
|
14
|
+
};
|
|
2
15
|
export interface MediaPlayerBaseProps extends ComponentCommonProps, React.HTMLAttributes<HTMLDivElement> {
|
|
3
16
|
data: {
|
|
4
17
|
sticky?: boolean;
|
|
@@ -13,6 +26,19 @@ export interface MediaPlayerBaseProps extends ComponentCommonProps, React.HTMLAt
|
|
|
13
26
|
mobileVideo?: Video;
|
|
14
27
|
youtubeId?: string;
|
|
15
28
|
titleAnimation?: 'fade-in' | null;
|
|
29
|
+
/**
|
|
30
|
+
* Variant selector.
|
|
31
|
+
* - Omit or set to `'default'` to preserve all existing behaviour.
|
|
32
|
+
* - Set to `'text-layout'` to activate the fixed 3-section text layout.
|
|
33
|
+
*/
|
|
34
|
+
variant?: 'default' | 'text-layout';
|
|
35
|
+
/** Static headline rendered only in the `text-layout` variant. Never animated. */
|
|
36
|
+
headline?: string;
|
|
37
|
+
/** Paragraph blocks rendered only in the `text-layout` variant. */
|
|
38
|
+
/** Paragraph blocks rendered only in the `text-layout` variant. */
|
|
39
|
+
paragraphs?: MediaPlayerBaseParagraph[];
|
|
40
|
+
/** Metric items rendered only in the `text-layout` variant. Fixed shape: value + label only. */
|
|
41
|
+
metrics?: MediaPlayerBaseMetric[];
|
|
16
42
|
};
|
|
17
43
|
onBtnClick?: () => void;
|
|
18
44
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MediaPlayerMultiProps } from './types.js';
|
|
2
|
-
declare const _default: import("react").ForwardRefExoticComponent<Omit<MediaPlayerMultiProps & import("react").RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("
|
|
2
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<MediaPlayerMultiProps & import("react").RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../WheelLottery/index.js").ContainerProps & import("react").RefAttributes<unknown>> & {
|
|
3
3
|
readonly $$typeof: symbol;
|
|
4
4
|
};
|
|
5
5
|
export default _default;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { MediaPlayerBaseProps } from './types.js';
|
|
3
3
|
declare const _default: React.ForwardRefExoticComponent<Omit<MediaPlayerBaseProps & React.RefAttributes<{
|
|
4
4
|
mediaPlayerStickyRef: HTMLDivElement;
|
|
5
|
-
}>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("
|
|
5
|
+
}>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../WheelLottery/index.js").ContainerProps & React.RefAttributes<unknown>> & {
|
|
6
6
|
readonly $$typeof: symbol;
|
|
7
7
|
};
|
|
8
8
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MediaSceneSwitcherProps } from './types.js';
|
|
2
2
|
import 'swiper/css';
|
|
3
|
-
declare const _default: import("react").ForwardRefExoticComponent<Omit<MediaSceneSwitcherProps & import("react").RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("
|
|
3
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<MediaSceneSwitcherProps & import("react").RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../WheelLottery/index.js").ContainerProps & import("react").RefAttributes<unknown>> & {
|
|
4
4
|
readonly $$typeof: symbol;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
@@ -54,7 +54,7 @@ export interface MediaSceneSwitcherV2Props extends React.HTMLAttributes<HTMLDivE
|
|
|
54
54
|
/** 场景切换回调 */
|
|
55
55
|
onSceneChange?: (index: number, scene: MediaSceneSwitcherV2Item) => void;
|
|
56
56
|
}
|
|
57
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<MediaSceneSwitcherV2Props & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("
|
|
57
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<MediaSceneSwitcherV2Props & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../WheelLottery/index.js").ContainerProps & React.RefAttributes<unknown>> & {
|
|
58
58
|
readonly $$typeof: symbol;
|
|
59
59
|
};
|
|
60
60
|
export default _default;
|
|
@@ -114,7 +114,7 @@ export interface MediaShelfComponent extends React.ForwardRefExoticComponent<Med
|
|
|
114
114
|
/** 独立的 ProductCard 组件 */
|
|
115
115
|
ProductCard: typeof ProductCard;
|
|
116
116
|
}
|
|
117
|
-
declare const MediaShelfWrapped: React.ForwardRefExoticComponent<Omit<MediaShelfProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("
|
|
117
|
+
declare const MediaShelfWrapped: React.ForwardRefExoticComponent<Omit<MediaShelfProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../WheelLottery/index.js").ContainerProps & React.RefAttributes<unknown>> & {
|
|
118
118
|
readonly $$typeof: symbol;
|
|
119
119
|
ProductCard: typeof ProductCard;
|
|
120
120
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MemberEquityProps } from './types.js';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<MemberEquityProps, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<MemberEquityProps, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../WheelLottery/index.js").ContainerProps & React.RefAttributes<unknown>> & {};
|
|
4
4
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as i}from"react/jsx-runtime";import*as a from"react";import{cn as o}from"../../helpers/index.js";import{Button as vt}from"../../components/index.js";import{Text as h}from"../../components/index.js";import{Heading as m}from"../../components/index.js";import wt from"./CircleProgress.js";import{useExposure as yt}from"../../hooks/useExposure.js";const Ct="cart",kt="mini_cart",W=a.forwardRef(({className:q,classNames:n={},data:G,cart:l,progressConfig:s,onRemoveItem:U,onCheckout:X,onClickToView:k,...F},O)=>{const b=a.useRef(null),{copy:c,theme:L="light",locale:Lt="us",showMobileViewMore:Y=!0}=G||{};yt(b,{componentType:Ct,componentName:kt,componentTitle:c?.itemsInCart||"Mini Cart",componentDescription:c?.description}),a.useImperativeHandle(O,()=>b.current);const Z=c?.emptyCart||"Your Cart is Empty",M=c?.description||"",_=c?.itemsInCart||"You have selected {count} items",$=c?.total||"Total {total}",Mt=c?.totalWithCoupon||"total: {total} ({subtotal})",N=c?.clickToView||"Click to view cart",J=c?.buyNowText||"Buy Now",K=c?.savingText||"Saving {amount}",d=a.useMemo(()=>l?.lineItems||[],[l?.lineItems]),S=d.reduce((e,r)=>e+(r?.quantity||0),0),Q=S===0,tt=parseFloat(l?.cost?.totalAmount?.amount||"0"),et=parseFloat(l?.cost?.subtotalAmount?.amount||"0"),ot=parseFloat(l?.cost?.savingAmount?.amount||"0"),rt=l?.cost?.totalAmount?.formattedPrice||"",I=et>tt?l?.cost?.subtotalAmount?.formattedPrice:null,P=ot>0?l?.cost?.savingAmount?.formattedPrice:null,p=a.useRef(null),[v,nt]=a.useState(!1),[z,T]=a.useState(!1),[A,B]=a.useState(null),D=async e=>{if(!A){B(e);try{await U?.(e,l)}finally{B(null)}}},[j,w]=a.useState(!1),[at,it]=a.useState(0),[lt,st]=a.useState(0),[R,ct]=a.useState(!1),[E,pt]=a.useState(!0),f=a.useCallback(()=>{const e=p.current;if(!e)return;const{scrollLeft:r,scrollWidth:u,clientWidth:x}=e;ct(r>0),pt(r<u-x-1)},[]),dt=a.useCallback(()=>{f()},[f]);a.useEffect(()=>{f()},[d.length,f]);const ut=e=>{p.current&&(w(!0),it(e.pageX-p.current.offsetLeft),st(p.current.scrollLeft))},mt=e=>{if(!j||!p.current)return;e.preventDefault();const u=(e.pageX-p.current.offsetLeft-at)*1.5;p.current.scrollLeft=lt-u},gt=()=>{w(!1)},ft=()=>{w(!1)},H=e=>{if(p.current){const r=p.current,u=100;r.scrollBy({left:e==="right"?u:-u,behavior:"smooth"})}},y=({className:e})=>t("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"})}),xt=({className:e})=>t("svg",{className:e,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M2.5 5H17.5M8.33333 9.16667V14.1667M11.6667 9.16667V14.1667M3.33333 5L4.16667 16.6667C4.16667 17.1087 4.34226 17.5326 4.65482 17.8452C4.96738 18.1577 5.39131 18.3333 5.83333 18.3333H14.1667C14.6087 18.3333 15.0326 18.1577 15.3452 17.8452C15.6577 17.5326 15.8333 17.1087 15.8333 16.6667L16.6667 5M7.5 5V2.5C7.5 2.27899 7.5878 2.06702 7.74408 1.91074C7.90036 1.75446 8.11232 1.66667 8.33333 1.66667H11.6667C11.8877 1.66667 12.0996 1.75446 12.2559 1.91074C12.4122 2.06702 12.5 2.27899 12.5 2.5V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),ht=e=>d.length?i("div",{className:o("laptop:bg-container-secondary-0 flex gap-1 rounded-lg p-1",n?.itemsGrid),children:[d.length>=5&&t("button",{onClick:()=>H("left"),className:o("border-border laptop:flex hover:bg-muted-foreground/10 hidden w-[32px] shrink-0 items-center justify-center rounded-lg px-2 transition-colors",!R&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-ml-1 laptop:py-1 laptop:pl-1 laptop:rounded-r-none",n?.expandButton,{"laptop:bg-container-secondary-0":e==="dark","laptop:bg-container-primary":e==="dark"&&!R}),"aria-label":"Scroll left to see more items",children:t(y,{className:"laptop:size-4 size-5 rotate-180"})}),i("div",{ref:p,onMouseDown:ut,onMouseMove:mt,onMouseUp:gt,onMouseLeave:ft,onScroll:dt,className:o("scrollbar-hide laptop:gap-1 laptop:w-[256px] laptop:shrink-0 flex w-full gap-1 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",j?"cursor-grabbing":"cursor-grab",n?.itemGridContainer),children:[d.filter(r=>r&&r.id).map(r=>{const x=(r.merchandise||{}).image||{},V=x.url,bt=x.altText||"Product image",C=A===r.id;return i("div",{className:o("laptop:size-12 group relative size-16 shrink-0",n?.gridItem),children:[V&&t("img",{src:V,alt:bt,draggable:!1,className:"pointer-events-none size-full select-none rounded-lg object-cover"}),C&&t("div",{className:"absolute inset-0 flex items-center justify-center rounded-lg bg-black/50",children:i("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin text-white",children:[t("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),t("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),t("span",{role:"button",onClick:()=>D(r.id),className:o("laptop:hidden absolute right-[2px] top-[2px] cursor-pointer",C&&"pointer-events-none opacity-0"),"aria-label":"delete",children:i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"pointer-events-none",children:[t("rect",{x:"1.33301",y:"1.33301",width:"13.3333",height:"13.3333",rx:"6.66667",fill:"white"}),t("path",{d:"M5.37705 5.28896C5.57234 5.09402 5.88839 5.09442 6.08347 5.28965L8.08602 7.29358L10.0906 5.28896C10.2858 5.09402 10.6026 5.09395 10.7977 5.28896C10.9928 5.48418 10.9926 5.80078 10.7977 5.99607L8.79312 8.00069L10.7964 10.0053C10.9913 10.2007 10.9909 10.5179 10.7957 10.7131C10.6005 10.908 10.2844 10.9074 10.0893 10.7124L8.08602 8.7078L6.08347 10.7103C5.88821 10.9056 5.57155 10.9057 5.37636 10.7103C5.18148 10.515 5.18132 10.1984 5.37636 10.0032L7.37891 8.00069L5.37636 5.99676C5.18119 5.80143 5.18181 5.48423 5.37705 5.28896Z",fill:"#767880"})]})}),r.productLabel&&t("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center",children:t("div",{className:"relative flex w-full items-center justify-center rounded-b-lg px-1 py-px backdrop-blur-sm",style:{backgroundColor:"rgba(251, 148, 63, 0.60)"},children:t(h,{size:1,className:"relative text-center text-white",html:r.productLabel})})}),r.quantity>1&&!r.productLabel&&t("div",{className:"mini-cart-quantity bg-brand-0 laptop:size-4 absolute bottom-0 right-0 flex size-4 items-center justify-center rounded-full text-white",children:t(h,{className:"text-sm",html:String(r.quantity)})}),t("div",{role:"button",onClick:()=>D(r.id),className:o("absolute inset-0 hidden cursor-pointer items-center justify-center rounded-lg bg-black/60 transition-opacity","laptop:flex laptop:opacity-0 laptop:group-hover:opacity-100",C&&"laptop:hidden",n?.gridItemOverlay),"aria-label":"Remove item",children:t(xt,{className:"pointer-events-none size-[20px] text-white"})})]},r.id)}),Y&&t("button",{onClick:()=>k?.(l),className:o("bg-container-secondary-0 laptop:hidden flex size-16 shrink-0 items-center justify-center rounded-md",n?.mobileViewMoreButton),"aria-label":N,children:t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-quaternary",children:t("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),d.length>=5&&t("button",{onClick:()=>H("right"),className:o("border-border laptop:flex hover:bg-muted-foreground/10 hidden w-[32px] shrink-0 items-center justify-center rounded-lg px-2 transition-colors",!E&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-mr-1 laptop:py-1 laptop:pr-1 laptop:rounded-l-none",n?.expandButton,{"laptop:bg-container-secondary-0":e==="dark","laptop:bg-container-primary":e==="dark"&&!E}),"aria-label":"Scroll right to see more items",children:t(y,{className:"laptop:size-4 size-5"})})]}):null,g=!Q&&d.length>0;return t("div",{ref:b,className:o("bg-container-secondary-1 text-info-primary tablet:px-6 laptop:px-12 desktop:px-12 lg-desktop:px-[128px] laptop:py-[16px] flex w-full px-4 py-[12px]","flex-col items-stretch gap-3","laptop:flex-row laptop:items-center laptop:justify-around","laptop:items-center laptop:gap-4","tablet:gap-6 laptop:gap-8",q,n?.root,{"aiui-dark bg-container-primary":L==="dark"}),...F,children:i("div",{className:o("laptop:flex-row flex w-full flex-col gap-4","laptop:flex-1 laptop:items-center laptop:justify-between","tablet:gap-6 laptop:gap-8",n?.content),children:[i("div",{className:o("relative flex shrink flex-row items-center gap-2","desktop:gap-4",s&&"laptop:pl-[104px] pl-[72px]"),children:[s&&t(wt,{totalSteps:s.totalSteps,currentStep:s.currentStep,image:s.image,label:s.label,progressColor:s.progressColor,labelColor:s.labelColor,backgroundColor:s.backgroundColor,size:s.size,laptopSize:s.laptopSize,className:o("absolute bottom-0 left-0","lg-desktop:bottom-auto lg-desktop:top-[-46px] desktop:bottom-auto desktop:top-[-52px]",n?.circleProgress)}),i("div",{className:"laptop:flex-1 flex w-full flex-col",children:[t("div",{className:o("tablet:gap-2 flex flex-col gap-1",n?.cartInfo),children:g?i("div",{className:"flex w-full items-center gap-2",children:[t(m,{size:2,as:"h3",className:o("",n?.cartTitle),html:_.replace("{count}",`<span class="text-brand-0">${S||0}</span>`)}),i(m,{size:1,as:"h5",onClick:()=>{window.innerWidth<1025?nt(!v):k?.(l)},className:o("flex cursor-pointer items-center gap-1",n?.expandButton),children:[t(h,{as:"span",size:1,className:"desktop:block hidden text-nowrap text-[16px] ",html:N}),t(y,{className:o("size-4 transition-transform",v?"laptop:rotate-0 -rotate-90":"laptop:rotate-0 rotate-90")})]})]}):t(m,{as:"h3",size:2,className:o("tablet:text-2xl text-xl font-semibold",n?.cartTitle),html:Z})}),M&&t(h,{size:2,className:o("mini-cart-description text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",n?.cartDescription),html:M})]})]}),g&&t("div",{className:o("laptop:block laptop:shrink",v?"block":"hidden"),children:ht(L)}),g&&t("hr",{className:"laptop:hidden border-lines w-full border-t"}),i("div",{className:o("tablet:gap-6 laptop:gap-4 laptop:justify-end flex flex-row items-stretch justify-between gap-4",n?.priceSection),children:[i("div",{className:"flex flex-col items-end justify-center",children:[i("div",{className:"flex items-center gap-2",children:[t(m,{as:"h6",size:2,className:o("whitespace-nowrap text-nowrap",n?.totalPrice),html:$.replace("{total}",rt)}),I&&t(m,{as:"h6",size:2,className:o("text-info-tertiary whitespace-nowrap line-through",n?.originalPrice),html:I})]}),P&&t(m,{size:2,as:"h6",className:o("laptop:text-right text-marketing-1 w-full whitespace-nowrap text-nowrap text-left",n?.saveAmount),html:K.replace("{amount}",P)})]}),t(vt,{disabled:!g,loading:z,onClick:async()=>{if(!z){T(!0);try{await X?.(l)}finally{T(!1)}}},className:o("whitespace-nowrap",n?.actionButton),children:J})]})]})})});W.displayName="MiniCart";var At=W;export{At as default};
|
|
1
|
+
"use client";import{jsx as t,jsxs as i}from"react/jsx-runtime";import*as a from"react";import{cn as o}from"../../helpers/index.js";import{Button as vt}from"../../components/index.js";import{Text as h}from"../../components/index.js";import{Heading as m}from"../../components/index.js";import wt from"./CircleProgress.js";import{useExposure as yt}from"../../hooks/useExposure.js";const Ct="cart",kt="mini_cart",W=a.forwardRef(({className:q,classNames:n={},data:G,cart:l,progressConfig:s,onRemoveItem:U,onCheckout:X,onClickToView:k,...F},O)=>{const b=a.useRef(null),{copy:c,theme:L="light",locale:Lt="us",showMobileViewMore:Y=!0}=G||{};yt(b,{componentType:Ct,componentName:kt,componentTitle:c?.itemsInCart||"Mini Cart",componentDescription:c?.description}),a.useImperativeHandle(O,()=>b.current);const Z=c?.emptyCart||"Your Cart is Empty",M=c?.description||"",_=c?.itemsInCart||"You have selected {count} items",$=c?.total||"Total {total}",Mt=c?.totalWithCoupon||"total: {total} ({subtotal})",N=c?.clickToView||"Click to view cart",J=c?.buyNowText||"Buy Now",K=c?.savingText||"Saving {amount}",d=a.useMemo(()=>l?.lineItems||[],[l?.lineItems]),S=d.reduce((e,r)=>e+(r?.quantity||0),0),Q=S===0,tt=parseFloat(l?.cost?.totalAmount?.amount||"0"),et=parseFloat(l?.cost?.subtotalAmount?.amount||"0"),ot=parseFloat(l?.cost?.savingAmount?.amount||"0"),rt=l?.cost?.totalAmount?.formattedPrice||"",I=et>tt?l?.cost?.subtotalAmount?.formattedPrice:null,P=ot>0?l?.cost?.savingAmount?.formattedPrice:null,p=a.useRef(null),[v,nt]=a.useState(!1),[z,T]=a.useState(!1),[A,B]=a.useState(null),D=async e=>{if(!A){B(e);try{await U?.(e,l)}finally{B(null)}}},[j,w]=a.useState(!1),[at,it]=a.useState(0),[lt,st]=a.useState(0),[R,ct]=a.useState(!1),[E,pt]=a.useState(!0),f=a.useCallback(()=>{const e=p.current;if(!e)return;const{scrollLeft:r,scrollWidth:u,clientWidth:x}=e;ct(r>0),pt(r<u-x-1)},[]),dt=a.useCallback(()=>{f()},[f]);a.useEffect(()=>{f()},[d.length,f]);const ut=e=>{p.current&&(w(!0),it(e.pageX-p.current.offsetLeft),st(p.current.scrollLeft))},mt=e=>{if(!j||!p.current)return;e.preventDefault();const u=(e.pageX-p.current.offsetLeft-at)*1.5;p.current.scrollLeft=lt-u},gt=()=>{w(!1)},ft=()=>{w(!1)},H=e=>{if(p.current){const r=p.current,u=100;r.scrollBy({left:e==="right"?u:-u,behavior:"smooth"})}},y=({className:e})=>t("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"})}),xt=({className:e})=>t("svg",{className:e,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M2.5 5H17.5M8.33333 9.16667V14.1667M11.6667 9.16667V14.1667M3.33333 5L4.16667 16.6667C4.16667 17.1087 4.34226 17.5326 4.65482 17.8452C4.96738 18.1577 5.39131 18.3333 5.83333 18.3333H14.1667C14.6087 18.3333 15.0326 18.1577 15.3452 17.8452C15.6577 17.5326 15.8333 17.1087 15.8333 16.6667L16.6667 5M7.5 5V2.5C7.5 2.27899 7.5878 2.06702 7.74408 1.91074C7.90036 1.75446 8.11232 1.66667 8.33333 1.66667H11.6667C11.8877 1.66667 12.0996 1.75446 12.2559 1.91074C12.4122 2.06702 12.5 2.27899 12.5 2.5V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),ht=e=>d.length?i("div",{className:o("laptop:bg-container-secondary-0 rounded-box-small flex gap-1 p-1",n?.itemsGrid),children:[d.length>=5&&t("button",{onClick:()=>H("left"),className:o("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!R&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-ml-1 laptop:py-1 laptop:pl-1 laptop:rounded-r-none",n?.expandButton,{"laptop:bg-container-secondary-0":e==="dark","laptop:bg-container-primary":e==="dark"&&!R}),"aria-label":"Scroll left to see more items",children:t(y,{className:"laptop:size-4 size-5 rotate-180"})}),i("div",{ref:p,onMouseDown:ut,onMouseMove:mt,onMouseUp:gt,onMouseLeave:ft,onScroll:dt,className:o("scrollbar-hide laptop:gap-1 laptop:w-[256px] laptop:shrink-0 flex w-full gap-1 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",j?"cursor-grabbing":"cursor-grab",n?.itemGridContainer),children:[d.filter(r=>r&&r.id).map(r=>{const x=(r.merchandise||{}).image||{},V=x.url,bt=x.altText||"Product image",C=A===r.id;return i("div",{className:o("laptop:size-12 bg-container-primary laptop:bg-white rounded-box-small group relative size-16 shrink-0 overflow-hidden",n?.gridItem),children:[V&&t("img",{src:V,alt:bt,draggable:!1,className:"rounded-box-small pointer-events-none size-full select-none object-cover"}),C&&t("div",{className:"rounded-box-small absolute inset-0 flex items-center justify-center bg-black/50",children:i("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin text-white",children:[t("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),t("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),t("span",{role:"button",onClick:()=>D(r.id),className:o("laptop:hidden absolute right-[2px] top-[2px] cursor-pointer",C&&"pointer-events-none opacity-0"),"aria-label":"delete",children:i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"pointer-events-none",children:[t("rect",{x:"1.33301",y:"1.33301",width:"13.3333",height:"13.3333",rx:"6.66667",fill:"white"}),t("path",{d:"M5.37705 5.28896C5.57234 5.09402 5.88839 5.09442 6.08347 5.28965L8.08602 7.29358L10.0906 5.28896C10.2858 5.09402 10.6026 5.09395 10.7977 5.28896C10.9928 5.48418 10.9926 5.80078 10.7977 5.99607L8.79312 8.00069L10.7964 10.0053C10.9913 10.2007 10.9909 10.5179 10.7957 10.7131C10.6005 10.908 10.2844 10.9074 10.0893 10.7124L8.08602 8.7078L6.08347 10.7103C5.88821 10.9056 5.57155 10.9057 5.37636 10.7103C5.18148 10.515 5.18132 10.1984 5.37636 10.0032L7.37891 8.00069L5.37636 5.99676C5.18119 5.80143 5.18181 5.48423 5.37705 5.28896Z",fill:"#767880"})]})}),r.productLabel&&t("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center",children:t("div",{className:"relative flex w-full items-center justify-center rounded-b-lg px-1 py-px backdrop-blur-sm",style:{backgroundColor:"rgba(251, 148, 63, 0.60)"},children:t(h,{size:1,className:"relative text-center text-white",html:r.productLabel})})}),r.quantity>1&&!r.productLabel&&t("div",{className:"mini-cart-quantity bg-brand-0 laptop:size-4 absolute bottom-0 right-0 flex size-4 items-center justify-center rounded-full text-white",children:t(h,{className:"text-sm",html:String(r.quantity)})}),t("div",{role:"button",onClick:()=>D(r.id),className:o("rounded-box-small absolute inset-0 hidden cursor-pointer items-center justify-center bg-black/60 transition-opacity","laptop:flex laptop:opacity-0 laptop:group-hover:opacity-100",C&&"laptop:hidden",n?.gridItemOverlay),"aria-label":"Remove item",children:t(xt,{className:"pointer-events-none size-[20px] text-white"})})]},r.id)}),Y&&t("button",{onClick:()=>k?.(l),className:o("bg-container-secondary-0 laptop:hidden flex size-16 shrink-0 items-center justify-center rounded-md",n?.mobileViewMoreButton),"aria-label":N,children:t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-quaternary",children:t("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),d.length>=5&&t("button",{onClick:()=>H("right"),className:o("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!E&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-mr-1 laptop:py-1 laptop:pr-1 laptop:rounded-l-none",n?.expandButton,{"laptop:bg-container-secondary-0":e==="dark","laptop:bg-container-primary":e==="dark"&&!E}),"aria-label":"Scroll right to see more items",children:t(y,{className:"laptop:size-4 size-5"})})]}):null,g=!Q&&d.length>0;return t("div",{ref:b,className:o("bg-container-secondary-1 text-info-primary tablet:px-6 laptop:px-12 desktop:px-12 lg-desktop:px-[128px] laptop:py-[16px] flex w-full px-4 py-[12px]","flex-col items-stretch gap-3","laptop:flex-row laptop:items-center laptop:justify-around","laptop:items-center laptop:gap-4","tablet:gap-6 laptop:gap-8",q,n?.root,{"aiui-dark bg-container-primary":L==="dark"}),...F,children:i("div",{className:o("laptop:flex-row flex w-full flex-col gap-4","laptop:flex-1 laptop:items-center laptop:justify-between","tablet:gap-6 laptop:gap-8",n?.content),children:[i("div",{className:o("relative flex shrink flex-row items-center gap-2","desktop:gap-4",s&&"laptop:pl-[104px] pl-[72px]"),children:[s&&t(wt,{totalSteps:s.totalSteps,currentStep:s.currentStep,image:s.image,label:s.label,progressColor:s.progressColor,labelColor:s.labelColor,backgroundColor:s.backgroundColor,size:s.size,laptopSize:s.laptopSize,className:o("absolute bottom-0 left-0","lg-desktop:bottom-auto lg-desktop:top-[-46px] desktop:bottom-auto desktop:top-[-52px]",n?.circleProgress)}),i("div",{className:"laptop:flex-1 flex w-full flex-col",children:[t("div",{className:o("tablet:gap-2 flex flex-col gap-1",n?.cartInfo),children:g?i("div",{className:"flex w-full items-center gap-2",children:[t(m,{size:2,as:"h3",className:o("",n?.cartTitle),html:_.replace("{count}",`<span class="text-brand-0">${S||0}</span>`)}),i(m,{size:1,as:"h5",onClick:()=>{window.innerWidth<1025?nt(!v):k?.(l)},className:o("flex cursor-pointer items-center gap-1",n?.expandButton),children:[t(h,{as:"span",size:1,className:"desktop:block hidden text-nowrap text-[16px] ",html:N}),t(y,{className:o("size-4 transition-transform",v?"laptop:rotate-0 -rotate-90":"laptop:rotate-0 rotate-90")})]})]}):t(m,{as:"h3",size:2,className:o("tablet:text-2xl text-xl",n?.cartTitle),html:Z})}),M&&t(h,{size:2,className:o("mini-cart-description text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",n?.cartDescription),html:M})]})]}),g&&t("div",{className:o("laptop:block laptop:shrink",v?"block":"hidden"),children:ht(L)}),g&&t("hr",{className:"laptop:hidden border-lines w-full border-t"}),i("div",{className:o("tablet:gap-6 laptop:gap-4 laptop:justify-end flex flex-row items-stretch justify-between gap-4",n?.priceSection),children:[i("div",{className:"flex flex-col items-end justify-center",children:[i("div",{className:"flex items-center gap-2",children:[t(m,{as:"h6",size:2,className:o("whitespace-nowrap text-nowrap",n?.totalPrice),html:$.replace("{total}",rt)}),I&&t(m,{as:"h6",size:2,className:o("text-info-tertiary whitespace-nowrap line-through",n?.originalPrice),html:I})]}),P&&t(m,{size:2,as:"h6",className:o("laptop:text-right text-marketing-1 w-full whitespace-nowrap text-nowrap text-left",n?.saveAmount),html:K.replace("{amount}",P)})]}),t(vt,{disabled:!g,loading:z,onClick:async()=>{if(!z){T(!0);try{await X?.(l)}finally{T(!1)}}},className:o("whitespace-nowrap",n?.actionButton),children:J})]})]})})});W.displayName="MiniCart";var At=W;export{At as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|