@anker-in/headless-ui 1.3.21 → 1.3.22-alpha.1781754422536
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/AccessoriesShelf/components/AccessoriesProductGrid/index.d.ts +11 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.d.ts +23 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/index.d.ts +40 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/types.d.ts +103 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/MainProductArea/index.d.ts +27 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/MainProductArea/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/MainProductArea/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/ProductGrid/index.d.ts +11 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/ProductGrid/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/ProductGrid/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/PromoBanner/index.d.ts +10 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/PromoBanner/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/PromoBanner/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/SectionHeader/index.d.ts +9 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/SectionHeader/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/SectionHeader/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/index.d.ts +8 -0
- package/dist/cjs/biz-components/AccessoriesShelf/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/product.d.ts +280 -0
- package/dist/cjs/biz-components/AccessoriesShelf/product.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/product.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/types.d.ts +43 -0
- package/dist/cjs/biz-components/AccessoriesShelf/types.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/types.js.map +7 -0
- 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/ActivityMechanism/index.js +1 -1
- package/dist/cjs/biz-components/ActivityMechanism/index.js.map +3 -3
- package/dist/cjs/biz-components/ActivitySchedule/index.d.ts +1 -1
- package/dist/cjs/biz-components/ActivitySchedule/index.js +1 -1
- package/dist/cjs/biz-components/ActivitySchedule/index.js.map +3 -3
- 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/AnchorNavigation/index.js +1 -1
- package/dist/cjs/biz-components/AnchorNavigation/index.js.map +3 -3
- 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/BrandCardLink/BrandCardLink.js +1 -1
- package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js.map +3 -3
- 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/BuyOneGetOneShelf/ProductCard.d.ts +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js.map +3 -3
- package/dist/cjs/biz-components/BuyOneGetOneShelf/context.d.ts +4 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/context.js +2 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/context.js.map +7 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/types.d.ts +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/types.js.map +1 -1
- package/dist/cjs/biz-components/Category/SwiperCategory.js +1 -1
- package/dist/cjs/biz-components/Category/SwiperCategory.js.map +3 -3
- package/dist/cjs/biz-components/Category/index.d.ts +1 -1
- package/dist/cjs/biz-components/Category/index.js +1 -1
- package/dist/cjs/biz-components/Category/index.js.map +3 -3
- 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/Evaluate/index.js +1 -1
- package/dist/cjs/biz-components/Evaluate/index.js.map +3 -3
- package/dist/cjs/biz-components/EventSchedule/index.d.ts +1 -1
- package/dist/cjs/biz-components/EventSchedule/index.js +1 -1
- package/dist/cjs/biz-components/EventSchedule/index.js.map +3 -3
- package/dist/cjs/biz-components/Faq/Faq.d.ts +1 -1
- package/dist/cjs/biz-components/FeatureCards/FeatureCards.d.ts +1 -1
- package/dist/cjs/biz-components/FeatureCards/FeatureCards.js +1 -1
- package/dist/cjs/biz-components/FeatureCards/FeatureCards.js.map +3 -3
- 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/FeaturedBlogPosts/index.js +1 -1
- package/dist/cjs/biz-components/FeaturedBlogPosts/index.js.map +2 -2
- 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/FooterNavigation/index.js +1 -1
- package/dist/cjs/biz-components/FooterNavigation/index.js.map +3 -3
- 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/GiftShelf/index.js +1 -1
- package/dist/cjs/biz-components/GiftShelf/index.js.map +2 -2
- 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/Graphic/index.js +1 -1
- package/dist/cjs/biz-components/Graphic/index.js.map +3 -3
- package/dist/cjs/biz-components/GraphicAttractionBlock/index.d.ts +1 -1
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.d.ts +2 -2
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/MobileTextLinksMenu.d.ts +12 -0
- package/dist/cjs/biz-components/HeaderNavigation/MobileTextLinksMenu.js +2 -0
- package/dist/cjs/biz-components/HeaderNavigation/MobileTextLinksMenu.js.map +7 -0
- package/dist/cjs/biz-components/HeaderNavigation/MulticolDropdown.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/MulticolDropdown.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/TextLinksDropdown.d.ts +10 -0
- package/dist/cjs/biz-components/HeaderNavigation/TextLinksDropdown.js +2 -0
- package/dist/cjs/biz-components/HeaderNavigation/TextLinksDropdown.js.map +7 -0
- package/dist/cjs/biz-components/HeaderNavigation/index.d.ts +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/types.d.ts +11 -1
- package/dist/cjs/biz-components/HeaderNavigation/types.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/types.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.d.ts +1 -0
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.js.map +3 -3
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.d.ts +1 -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.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBannerCarousel.js.map +3 -3
- package/dist/cjs/biz-components/ImageOverlayShelf/index.d.ts +1 -1
- package/dist/cjs/biz-components/ImageTextFeature/ImageTextFeature.d.ts +1 -1
- package/dist/cjs/biz-components/ImageTextOverlay/index.d.ts +1 -1
- package/dist/cjs/biz-components/ImageTextOverlay/index.js +2 -2
- package/dist/cjs/biz-components/ImageTextOverlay/index.js.map +3 -3
- 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 +3 -3
- package/dist/cjs/biz-components/Ksp/index.d.ts +1 -1
- package/dist/cjs/biz-components/Ksp/index.js +1 -1
- package/dist/cjs/biz-components/Ksp/index.js.map +3 -3
- package/dist/cjs/biz-components/Listing/BizProductProvider.d.ts +3 -1
- package/dist/cjs/biz-components/Listing/BizProductProvider.js +1 -1
- package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/CartActionButtons/index.d.ts +9 -1
- package/dist/cjs/biz-components/Listing/components/CartActionButtons/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/CartActionButtons/index.js.map +3 -3
- 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/ProductCard/ProductSummary/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.d.ts +1 -1
- package/dist/cjs/biz-components/LotteryShared/ErrorModal.d.ts +4 -0
- package/dist/cjs/biz-components/LotteryShared/ErrorModal.js.map +2 -2
- package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.d.ts +13 -13
- 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/types.d.ts +9 -0
- package/dist/cjs/biz-components/LotteryShared/types.js.map +2 -2
- package/dist/cjs/biz-components/Marquee/Marquee.d.ts +1 -1
- package/dist/cjs/biz-components/MarqueeReview/index.d.ts +1 -1
- 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/MediaPlayerMulti/index.d.ts +1 -1
- package/dist/cjs/biz-components/MediaPlayerMulti/index.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerMulti/index.js.map +3 -3
- package/dist/cjs/biz-components/MediaPlayerSticky/index.d.ts +1 -1
- package/dist/cjs/biz-components/MediaPlayerSticky/index.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerSticky/index.js.map +3 -3
- package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.d.ts +1 -1
- package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +2 -2
- package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js.map +3 -3
- package/dist/cjs/biz-components/MediaSceneSwitcherV2/index.d.ts +1 -1
- package/dist/cjs/biz-components/MediaSceneSwitcherV2/index.js +1 -1
- package/dist/cjs/biz-components/MediaSceneSwitcherV2/index.js.map +3 -3
- package/dist/cjs/biz-components/MediaShelf/index.d.ts +1 -1
- package/dist/cjs/biz-components/MediaTextOverlay/MediaTextOverlay.d.ts +1 -1
- package/dist/cjs/biz-components/MediaTextOverlay/MediaTextOverlay.js +1 -1
- package/dist/cjs/biz-components/MediaTextOverlay/MediaTextOverlay.js.map +3 -3
- package/dist/cjs/biz-components/MemberEquity/index.d.ts +1 -1
- package/dist/cjs/biz-components/MemberEquity/index.js +2 -2
- package/dist/cjs/biz-components/MemberEquity/index.js.map +3 -3
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +2 -2
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlockCarousel.js +1 -1
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlockCarousel.js.map +2 -2
- package/dist/cjs/biz-components/NavigationSearch/index.d.ts +1 -1
- package/dist/cjs/biz-components/NavigationSearch/index.js +2 -2
- package/dist/cjs/biz-components/NavigationSearch/index.js.map +2 -2
- package/dist/cjs/biz-components/NotifyMeDialog/NotifyMeDialog.d.ts +7 -0
- package/dist/cjs/biz-components/NotifyMeDialog/NotifyMeDialog.js +2 -0
- package/dist/cjs/biz-components/NotifyMeDialog/NotifyMeDialog.js.map +7 -0
- package/dist/cjs/biz-components/NotifyMeDialog/index.d.ts +2 -0
- package/dist/cjs/biz-components/NotifyMeDialog/index.js +2 -0
- package/dist/cjs/biz-components/NotifyMeDialog/index.js.map +7 -0
- package/dist/cjs/biz-components/NotifyMeDialog/types.d.ts +111 -0
- package/dist/cjs/biz-components/NotifyMeDialog/types.js +2 -0
- package/dist/cjs/biz-components/NotifyMeDialog/types.js.map +7 -0
- package/dist/cjs/biz-components/ProductCompare/index.d.ts +1 -1
- package/dist/cjs/biz-components/ProductCompare/index.js +1 -1
- package/dist/cjs/biz-components/ProductCompare/index.js.map +2 -2
- package/dist/cjs/biz-components/ProductHero/ProductHero.d.ts +1 -1
- package/dist/cjs/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/cjs/biz-components/ProductHero/ProductHero.js.map +3 -3
- package/dist/cjs/biz-components/ProductLottery/types.d.ts +62 -5
- 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/ProductNav/ProductNav.js +1 -1
- package/dist/cjs/biz-components/ProductNav/ProductNav.js.map +3 -3
- package/dist/cjs/biz-components/PromotionalBar/index.d.ts +1 -1
- 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 +1 -1
- package/dist/cjs/biz-components/SceneShelfV3/index.d.ts +1 -1
- package/dist/cjs/biz-components/SearchPage/index.js +1 -1
- package/dist/cjs/biz-components/SearchPage/index.js.map +3 -3
- package/dist/cjs/biz-components/SecondaryBanner/index.d.ts +1 -1
- package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/cjs/biz-components/SecondaryBanner/index.js.map +2 -2
- 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/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
- 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/Specs/index.js +1 -1
- package/dist/cjs/biz-components/Specs/index.js.map +3 -3
- package/dist/cjs/biz-components/SpecsComparison/SpecsComparison.d.ts +1 -1
- package/dist/cjs/biz-components/Subscribe/index.js +1 -1
- package/dist/cjs/biz-components/Subscribe/index.js.map +2 -2
- package/dist/cjs/biz-components/SwiperBox/index.js +1 -1
- package/dist/cjs/biz-components/SwiperBox/index.js.map +3 -3
- 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/TabsWithMedia/TabsWithMedia.js +1 -1
- package/dist/cjs/biz-components/TabsWithMedia/TabsWithMedia.js.map +3 -3
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.d.ts +1 -1
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +3 -3
- 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/VideoFeature/VideoFeature.d.ts +1 -1
- package/dist/cjs/biz-components/VideoModal/index.d.ts +1 -0
- package/dist/cjs/biz-components/VideoModal/index.js +1 -1
- package/dist/cjs/biz-components/VideoModal/index.js.map +3 -3
- 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/WhyChoose/WhyChoose.d.ts +1 -1
- package/dist/cjs/biz-components/index.d.ts +8 -0
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/biz-components/index.js.map +3 -3
- package/dist/cjs/components/Countdown.js +1 -1
- package/dist/cjs/components/Countdown.js.map +3 -3
- package/dist/cjs/components/alert.d.ts +1 -0
- package/dist/cjs/components/alert.js +1 -1
- package/dist/cjs/components/alert.js.map +2 -2
- package/dist/cjs/components/breadcrumb.d.ts +12 -0
- package/dist/cjs/components/breadcrumb.js +2 -0
- package/dist/cjs/components/breadcrumb.js.map +7 -0
- package/dist/cjs/components/checkbox.js +1 -1
- package/dist/cjs/components/checkbox.js.map +2 -2
- package/dist/cjs/components/dialog.js +1 -1
- package/dist/cjs/components/dialog.js.map +3 -3
- package/dist/cjs/components/index.d.ts +5 -0
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/components/input-number.d.ts +22 -0
- package/dist/cjs/components/input-number.js +1 -1
- package/dist/cjs/components/input-number.js.map +3 -3
- package/dist/cjs/components/link.js +1 -1
- package/dist/cjs/components/link.js.map +2 -2
- package/dist/cjs/components/otp-input.d.ts +18 -0
- package/dist/cjs/components/otp-input.js +2 -0
- package/dist/cjs/components/otp-input.js.map +7 -0
- package/dist/cjs/components/toast.d.ts +25 -0
- package/dist/cjs/components/toast.js +2 -0
- package/dist/cjs/components/toast.js.map +7 -0
- package/dist/cjs/helpers/index.d.ts +2 -2
- package/dist/cjs/helpers/index.js +1 -1
- package/dist/cjs/helpers/index.js.map +2 -2
- package/dist/cjs/helpers/isLexicalEmpty.d.ts +5 -0
- package/dist/cjs/helpers/isLexicalEmpty.js +1 -1
- package/dist/cjs/helpers/isLexicalEmpty.js.map +3 -3
- package/dist/cjs/helpers/priceFormatting.d.ts +5 -0
- package/dist/cjs/helpers/priceFormatting.js +1 -1
- package/dist/cjs/helpers/priceFormatting.js.map +3 -3
- package/dist/cjs/helpers/utils.d.ts +7 -1
- package/dist/cjs/helpers/utils.js +1 -1
- package/dist/cjs/helpers/utils.js.map +3 -3
- package/dist/cjs/hooks/useIsomorphicMediaQuery.d.ts +14 -0
- package/dist/cjs/hooks/useIsomorphicMediaQuery.js +2 -0
- package/dist/cjs/hooks/useIsomorphicMediaQuery.js.map +7 -0
- package/dist/cjs/hooks/useProductListTrack.d.ts +43 -0
- package/dist/cjs/hooks/useProductListTrack.js +2 -0
- package/dist/cjs/hooks/useProductListTrack.js.map +7 -0
- package/dist/cjs/index.d.ts +10 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +3 -3
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.d.ts +11 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.d.ts +23 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/index.d.ts +40 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/types.d.ts +103 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js +1 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/MainProductArea/index.d.ts +27 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/MainProductArea/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/MainProductArea/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/ProductGrid/index.d.ts +11 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/ProductGrid/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/ProductGrid/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/PromoBanner/index.d.ts +10 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/PromoBanner/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/PromoBanner/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/SectionHeader/index.d.ts +9 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/SectionHeader/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/SectionHeader/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/index.d.ts +8 -0
- package/dist/esm/biz-components/AccessoriesShelf/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/product.d.ts +280 -0
- package/dist/esm/biz-components/AccessoriesShelf/product.js +1 -0
- package/dist/esm/biz-components/AccessoriesShelf/product.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/types.d.ts +43 -0
- package/dist/esm/biz-components/AccessoriesShelf/types.js +1 -0
- package/dist/esm/biz-components/AccessoriesShelf/types.js.map +7 -0
- 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/ActivityMechanism/index.js +1 -1
- package/dist/esm/biz-components/ActivityMechanism/index.js.map +3 -3
- package/dist/esm/biz-components/ActivitySchedule/index.d.ts +1 -1
- package/dist/esm/biz-components/ActivitySchedule/index.js +1 -1
- package/dist/esm/biz-components/ActivitySchedule/index.js.map +3 -3
- 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/AnchorNavigation/index.js +1 -1
- package/dist/esm/biz-components/AnchorNavigation/index.js.map +3 -3
- 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/BrandCardLink/BrandCardLink.js +1 -1
- package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js.map +3 -3
- 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/BuyOneGetOneShelf/ProductCard.d.ts +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js.map +3 -3
- package/dist/esm/biz-components/BuyOneGetOneShelf/context.d.ts +4 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/context.js +2 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/context.js.map +7 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/types.d.ts +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/types.js.map +1 -1
- package/dist/esm/biz-components/Category/SwiperCategory.js +1 -1
- package/dist/esm/biz-components/Category/SwiperCategory.js.map +3 -3
- package/dist/esm/biz-components/Category/index.d.ts +1 -1
- package/dist/esm/biz-components/Category/index.js +1 -1
- package/dist/esm/biz-components/Category/index.js.map +3 -3
- 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/Evaluate/index.js +1 -1
- package/dist/esm/biz-components/Evaluate/index.js.map +3 -3
- package/dist/esm/biz-components/EventSchedule/index.d.ts +1 -1
- package/dist/esm/biz-components/EventSchedule/index.js +1 -1
- package/dist/esm/biz-components/EventSchedule/index.js.map +3 -3
- package/dist/esm/biz-components/Faq/Faq.d.ts +1 -1
- package/dist/esm/biz-components/FeatureCards/FeatureCards.d.ts +1 -1
- package/dist/esm/biz-components/FeatureCards/FeatureCards.js +1 -1
- package/dist/esm/biz-components/FeatureCards/FeatureCards.js.map +3 -3
- 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/FeaturedBlogPosts/index.js +1 -1
- package/dist/esm/biz-components/FeaturedBlogPosts/index.js.map +2 -2
- 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/FooterNavigation/index.js +1 -1
- package/dist/esm/biz-components/FooterNavigation/index.js.map +3 -3
- 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/GiftShelf/index.js +1 -1
- package/dist/esm/biz-components/GiftShelf/index.js.map +2 -2
- 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/Graphic/index.js +1 -1
- package/dist/esm/biz-components/Graphic/index.js.map +3 -3
- package/dist/esm/biz-components/GraphicAttractionBlock/index.d.ts +1 -1
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.d.ts +2 -2
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/MobileTextLinksMenu.d.ts +12 -0
- package/dist/esm/biz-components/HeaderNavigation/MobileTextLinksMenu.js +2 -0
- package/dist/esm/biz-components/HeaderNavigation/MobileTextLinksMenu.js.map +7 -0
- package/dist/esm/biz-components/HeaderNavigation/MulticolDropdown.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/MulticolDropdown.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/TextLinksDropdown.d.ts +10 -0
- package/dist/esm/biz-components/HeaderNavigation/TextLinksDropdown.js +2 -0
- package/dist/esm/biz-components/HeaderNavigation/TextLinksDropdown.js.map +7 -0
- package/dist/esm/biz-components/HeaderNavigation/index.d.ts +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/types.d.ts +11 -1
- package/dist/esm/biz-components/HeaderNavigation/types.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/types.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/withCategory.d.ts +1 -0
- package/dist/esm/biz-components/HeaderNavigation/withCategory.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/withCategory.js.map +3 -3
- package/dist/esm/biz-components/HeroBanner/HeroBanner.d.ts +1 -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.js +1 -1
- package/dist/esm/biz-components/HeroBanner/HeroBannerCarousel.js.map +3 -3
- package/dist/esm/biz-components/ImageOverlayShelf/index.d.ts +1 -1
- package/dist/esm/biz-components/ImageTextFeature/ImageTextFeature.d.ts +1 -1
- package/dist/esm/biz-components/ImageTextOverlay/index.d.ts +1 -1
- package/dist/esm/biz-components/ImageTextOverlay/index.js +2 -2
- package/dist/esm/biz-components/ImageTextOverlay/index.js.map +3 -3
- 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 +3 -3
- package/dist/esm/biz-components/Ksp/index.d.ts +1 -1
- package/dist/esm/biz-components/Ksp/index.js +1 -1
- package/dist/esm/biz-components/Ksp/index.js.map +3 -3
- package/dist/esm/biz-components/Listing/BizProductProvider.d.ts +3 -1
- package/dist/esm/biz-components/Listing/BizProductProvider.js +1 -1
- package/dist/esm/biz-components/Listing/BizProductProvider.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/CartActionButtons/index.d.ts +9 -1
- package/dist/esm/biz-components/Listing/components/CartActionButtons/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/CartActionButtons/index.js.map +3 -3
- 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/ProductCard/ProductSummary/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.d.ts +1 -1
- package/dist/esm/biz-components/LotteryShared/ErrorModal.d.ts +4 -0
- package/dist/esm/biz-components/LotteryShared/ErrorModal.js.map +2 -2
- package/dist/esm/biz-components/LotteryShared/MyRewardsModal.d.ts +13 -13
- 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/types.d.ts +9 -0
- package/dist/esm/biz-components/LotteryShared/types.js.map +2 -2
- package/dist/esm/biz-components/Marquee/Marquee.d.ts +1 -1
- package/dist/esm/biz-components/MarqueeReview/index.d.ts +1 -1
- 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/MediaPlayerMulti/index.d.ts +1 -1
- package/dist/esm/biz-components/MediaPlayerMulti/index.js +1 -1
- package/dist/esm/biz-components/MediaPlayerMulti/index.js.map +3 -3
- package/dist/esm/biz-components/MediaPlayerSticky/index.d.ts +1 -1
- package/dist/esm/biz-components/MediaPlayerSticky/index.js +1 -1
- package/dist/esm/biz-components/MediaPlayerSticky/index.js.map +3 -3
- package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.d.ts +1 -1
- package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +2 -2
- package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js.map +3 -3
- package/dist/esm/biz-components/MediaSceneSwitcherV2/index.d.ts +1 -1
- package/dist/esm/biz-components/MediaSceneSwitcherV2/index.js +1 -1
- package/dist/esm/biz-components/MediaSceneSwitcherV2/index.js.map +3 -3
- package/dist/esm/biz-components/MediaShelf/index.d.ts +1 -1
- package/dist/esm/biz-components/MediaTextOverlay/MediaTextOverlay.d.ts +1 -1
- package/dist/esm/biz-components/MediaTextOverlay/MediaTextOverlay.js +1 -1
- package/dist/esm/biz-components/MediaTextOverlay/MediaTextOverlay.js.map +3 -3
- package/dist/esm/biz-components/MemberEquity/index.d.ts +1 -1
- package/dist/esm/biz-components/MemberEquity/index.js +2 -2
- package/dist/esm/biz-components/MemberEquity/index.js.map +3 -3
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +2 -2
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlockCarousel.js +1 -1
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlockCarousel.js.map +2 -2
- package/dist/esm/biz-components/NavigationSearch/index.d.ts +1 -1
- package/dist/esm/biz-components/NavigationSearch/index.js +2 -2
- package/dist/esm/biz-components/NavigationSearch/index.js.map +3 -3
- package/dist/esm/biz-components/NotifyMeDialog/NotifyMeDialog.d.ts +7 -0
- package/dist/esm/biz-components/NotifyMeDialog/NotifyMeDialog.js +2 -0
- package/dist/esm/biz-components/NotifyMeDialog/NotifyMeDialog.js.map +7 -0
- package/dist/esm/biz-components/NotifyMeDialog/index.d.ts +2 -0
- package/dist/esm/biz-components/NotifyMeDialog/index.js +2 -0
- package/dist/esm/biz-components/NotifyMeDialog/index.js.map +7 -0
- package/dist/esm/biz-components/NotifyMeDialog/types.d.ts +111 -0
- package/dist/esm/biz-components/NotifyMeDialog/types.js +1 -0
- package/dist/esm/biz-components/NotifyMeDialog/types.js.map +7 -0
- package/dist/esm/biz-components/ProductCompare/index.d.ts +1 -1
- package/dist/esm/biz-components/ProductCompare/index.js +1 -1
- package/dist/esm/biz-components/ProductCompare/index.js.map +2 -2
- package/dist/esm/biz-components/ProductHero/ProductHero.d.ts +1 -1
- package/dist/esm/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/esm/biz-components/ProductHero/ProductHero.js.map +3 -3
- package/dist/esm/biz-components/ProductLottery/types.d.ts +62 -5
- 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/ProductNav/ProductNav.js +1 -1
- package/dist/esm/biz-components/ProductNav/ProductNav.js.map +3 -3
- package/dist/esm/biz-components/PromotionalBar/index.d.ts +1 -1
- 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 +1 -1
- package/dist/esm/biz-components/SceneShelfV3/index.d.ts +1 -1
- package/dist/esm/biz-components/SearchPage/index.js +1 -1
- package/dist/esm/biz-components/SearchPage/index.js.map +3 -3
- package/dist/esm/biz-components/SecondaryBanner/index.d.ts +1 -1
- package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/esm/biz-components/SecondaryBanner/index.js.map +2 -2
- 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/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
- 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/Specs/index.js +1 -1
- package/dist/esm/biz-components/Specs/index.js.map +3 -3
- package/dist/esm/biz-components/SpecsComparison/SpecsComparison.d.ts +1 -1
- package/dist/esm/biz-components/Subscribe/index.js +1 -1
- package/dist/esm/biz-components/Subscribe/index.js.map +2 -2
- package/dist/esm/biz-components/SwiperBox/index.js +1 -1
- package/dist/esm/biz-components/SwiperBox/index.js.map +3 -3
- 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/TabsWithMedia/TabsWithMedia.js +1 -1
- package/dist/esm/biz-components/TabsWithMedia/TabsWithMedia.js.map +3 -3
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.d.ts +1 -1
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +3 -3
- 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/VideoFeature/VideoFeature.d.ts +1 -1
- package/dist/esm/biz-components/VideoModal/index.d.ts +1 -0
- package/dist/esm/biz-components/VideoModal/index.js +1 -1
- package/dist/esm/biz-components/VideoModal/index.js.map +3 -3
- package/dist/esm/biz-components/WheelLottery/index.js +1 -1
- package/dist/esm/biz-components/WheelLottery/index.js.map +2 -2
- package/dist/esm/biz-components/WhyChoose/WhyChoose.d.ts +1 -1
- package/dist/esm/biz-components/index.d.ts +8 -0
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/biz-components/index.js.map +3 -3
- package/dist/esm/components/Countdown.js +1 -1
- package/dist/esm/components/Countdown.js.map +3 -3
- package/dist/esm/components/alert.d.ts +1 -0
- package/dist/esm/components/alert.js +1 -1
- package/dist/esm/components/alert.js.map +2 -2
- package/dist/esm/components/breadcrumb.d.ts +12 -0
- package/dist/esm/components/breadcrumb.js +2 -0
- package/dist/esm/components/breadcrumb.js.map +7 -0
- package/dist/esm/components/checkbox.js +1 -1
- package/dist/esm/components/checkbox.js.map +2 -2
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dialog.js.map +3 -3
- package/dist/esm/components/index.d.ts +5 -0
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +3 -3
- package/dist/esm/components/input-number.d.ts +22 -0
- package/dist/esm/components/input-number.js +1 -1
- package/dist/esm/components/input-number.js.map +3 -3
- package/dist/esm/components/link.js +1 -1
- package/dist/esm/components/link.js.map +2 -2
- package/dist/esm/components/otp-input.d.ts +18 -0
- package/dist/esm/components/otp-input.js +2 -0
- package/dist/esm/components/otp-input.js.map +7 -0
- package/dist/esm/components/toast.d.ts +25 -0
- package/dist/esm/components/toast.js +2 -0
- package/dist/esm/components/toast.js.map +7 -0
- package/dist/esm/helpers/index.d.ts +2 -2
- package/dist/esm/helpers/index.js +1 -1
- package/dist/esm/helpers/index.js.map +3 -3
- package/dist/esm/helpers/isLexicalEmpty.d.ts +5 -0
- package/dist/esm/helpers/isLexicalEmpty.js +1 -1
- package/dist/esm/helpers/isLexicalEmpty.js.map +3 -3
- package/dist/esm/helpers/priceFormatting.d.ts +5 -0
- package/dist/esm/helpers/priceFormatting.js +1 -1
- package/dist/esm/helpers/priceFormatting.js.map +3 -3
- package/dist/esm/helpers/utils.d.ts +7 -1
- package/dist/esm/helpers/utils.js +1 -1
- package/dist/esm/helpers/utils.js.map +3 -3
- package/dist/esm/hooks/useIsomorphicMediaQuery.d.ts +14 -0
- package/dist/esm/hooks/useIsomorphicMediaQuery.js +2 -0
- package/dist/esm/hooks/useIsomorphicMediaQuery.js.map +7 -0
- package/dist/esm/hooks/useProductListTrack.d.ts +43 -0
- package/dist/esm/hooks/useProductListTrack.js +2 -0
- package/dist/esm/hooks/useProductListTrack.js.map +7 -0
- package/dist/esm/index.d.ts +10 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +3 -3
- package/package.json +1 -1
- package/style.css +208 -10
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var U=Object.create;var _=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty;var Y=(n,l)=>{for(var d in l)_(n,d,{get:l[d],enumerable:!0})},H=(n,l,d,w)=>{if(l&&typeof l=="object"||typeof l=="function")for(let h of J(l))!X.call(n,h)&&h!==d&&_(n,h,{get:()=>l[h],enumerable:!(w=G(l,h))||w.enumerable});return n};var Z=(n,l,d)=>(d=n!=null?U(K(n)):{},H(l||!n||!n.__esModule?_(d,"default",{value:n,enumerable:!0}):d,n)),$=n=>H(_({},"__esModule",{value:!0}),n);var
|
|
1
|
+
"use strict";"use client";var U=Object.create;var _=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty;var Y=(n,l)=>{for(var d in l)_(n,d,{get:l[d],enumerable:!0})},H=(n,l,d,w)=>{if(l&&typeof l=="object"||typeof l=="function")for(let h of J(l))!X.call(n,h)&&h!==d&&_(n,h,{get:()=>l[h],enumerable:!(w=G(l,h))||w.enumerable});return n};var Z=(n,l,d)=>(d=n!=null?U(K(n)):{},H(l||!n||!n.__esModule?_(d,"default",{value:n,enumerable:!0}):d,n)),$=n=>H(_({},"__esModule",{value:!0}),n);var ae={};Y(ae,{default:()=>se});module.exports=$(ae);var i=require("react/jsx-runtime"),a=Z(require("react")),f=require("../../components/index.js"),u=require("../../helpers/utils.js"),W=require("../../shared/Styles.js"),j=require("../../hooks/useExposure.js"),T=require("swiper/react"),k=require("swiper/modules"),I=require("framer-motion"),F=require("../../hooks/useIsomorphicMediaQuery.js");const ee="video",te="tabs_with_media",ie=[{time:2.4,point:2.4,highlightIdx:0},{time:2.5,point:4.9,highlightIdx:1},{time:2.5,point:7.4,highlightIdx:2},{time:2.8,point:10.2,highlightIdx:3},{time:2.6,point:12.8,highlightIdx:4},{time:3.2,point:16,highlightIdx:5}],P=a.default.forwardRef(({data:n,className:l},d)=>{const{title:w,poster:h,video:A,mobvideo:B,items:v=[],timeIdx:p=ie,theme:V="light"}=n,[M,q]=(0,a.useState)(null),S=(0,a.useRef)([]),E=(0,a.useRef)(null),y=(0,a.useRef)(null),N=(0,a.useRef)(null);(0,j.useExposure)(N,{componentType:ee,componentName:te,componentTitle:w}),(0,a.useImperativeHandle)(d,()=>N.current);const ne=e=>{const s=E.current,r=S.current[e];if(s&&r){const t=s.getBoundingClientRect(),c=r.getBoundingClientRect().left-t.left-s.clientWidth/2+r.clientWidth/2;s.scrollTo({left:s.scrollLeft+c,behavior:"smooth"})}},R=(0,F.useIsomorphicMediaQuery)({query:"(max-width: 768px)"}),[oe,L,O,x,Q]=(0,a.useMemo)(()=>{const r=v.length,t=v?.map((m,c)=>({...m,key:c,index:c}))||[],o=v?.map((m,c)=>({...m,key:c+r,index:c}))||[];return[t,t.concat(o),5,2,r]},[v,R]),[g,z]=(0,a.useState)(x),[b,C]=(0,a.useState)(L.slice(0,O)),D=(e,s,r)=>{if(e!==g&&s!==x){if(s>x){const t=s-x,o=[...b];o.splice(0,t);const m=b[b.length-1]?.key+1,c=[...L].splice(m,t);o.push(...c),C([...o])}if(s<x){const t=x-s,o=[...b];o.splice(-t);const m=b[0]?.key,c=[...L].splice(Q+m-t,t);o.unshift(...c),C([...o])}if(z(e),M?.slideTo(e),!r){let t=0;p.forEach(o=>{o.highlightIdx<e&&(t+=o.time)}),y.current&&(y.current.currentTime=t)}}};return(0,a.useEffect)(()=>{const e=y.current;if(!e)return;const s=()=>{const r=e.currentTime;for(let t=0;t<p.length;t++){const o=t===0?0:p[t-1].point;if(r>=o&&r<p[t].point){D(p[t].highlightIdx,p[t].highlightIdx,!0);break}}r>=p[p.length-1].point&&(e.currentTime=0,e.play())};return e.addEventListener("timeupdate",s),()=>{e.removeEventListener("timeupdate",s)}},[M,p]),(0,i.jsxs)("section",{ref:N,"data-ui-component-id":"TabsWithMedia",className:(0,u.cn)("tabs-with-media text-info-primary flex flex-col overflow-hidden sm:overflow-visible",{"aiui-dark":V==="dark"},l),children:[(0,i.jsx)(f.Heading,{as:"h3",size:4,html:w,className:"tabs-with-media__title text-center"}),(0,i.jsx)("div",{className:"tabs-with-media__tabs-wrapper scrollbar-hidden relative w-full overflow-x-auto sm:overflow-visible",children:(0,i.jsx)("div",{className:(0,u.cn)("tabs-with-media__tabs-inner tablet:w-fit mx-auto mt-[16px] w-full max-w-[824px]"),children:(0,i.jsx)("div",{className:(0,u.cn)("tabs-with-media__tabs-container flex translate-x-0 items-center justify-center gap-[16px] transition-all md:gap-[8px]"),ref:E,children:(0,i.jsx)(I.AnimatePresence,{mode:"popLayout",children:b?.map((e,s)=>(0,i.jsx)(I.motion.div,{layout:!0,ref:r=>{S.current[e?.index]=r},onClick:()=>{D(e?.key,s)},className:"tabs-with-media__tab-item min-w-[28px] flex-none cursor-pointer overflow-hidden sm:overflow-visible",initial:{opacity:1},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3,ease:"easeOut"},children:(0,i.jsx)("div",{className:"tabs-with-media__tab-inner flex items-center justify-between",children:(0,i.jsxs)("div",{className:(0,u.cn)("tabs-with-media__tab-content flex",{"flex items-center justify-center gap-[8px] rounded-btn bg-[#fff] p-2 md:gap-[4px] md:p-1":g===e?.key}),children:[(0,i.jsx)("div",{className:(0,u.cn)("tabs-with-media__tab-icon lg-desktop:size-[48px] flex size-[28] items-center justify-center rounded-full md:shrink-0",{"h-[28px] w-[28px] bg-[#ccc] bg-opacity-50 lg-desktop:h-[48px] lg-desktop:w-[48px]":g!==e?.index}),style:g===e?.key?{background:"var(--1, linear-gradient(90deg, #3AD1FF 0%, #008CD6 100%))"}:void 0,children:(0,i.jsx)(f.Picture,{source:e?.icon?.url,alt:e?.icon?.alt,className:"tabs-with-media__tab-icon-image size-[22px] md:size-[14px]"})}),(0,i.jsx)("div",{className:"tabs-with-media__tab-text-wrapper",children:(0,i.jsx)(f.Heading,{as:"h4",size:2,html:e?.tab,className:(0,u.cn)("tabs-with-media__tab-text dynamic-width-heading xs:text-[16px] line-clamp-1 size-0 overflow-hidden whitespace-nowrap text-nowrap text-black opacity-0 transition-all duration-300 ease-linear sm:text-[18px]",{"h-auto w-[calc-size(auto,size)] px-[6px] opacity-100":g===e?.key})})})]})})},e?.key))})})})}),(0,i.jsx)("div",{className:"tabs-with-media__description-container lg-desktop:mt-[24px] mt-[16px]",children:(0,i.jsx)(T.Swiper,{slidesPerView:1,effect:"fade",fadeEffect:{crossFade:!0},modules:[k.Pagination,k.EffectFade],onSlideChange:e=>{const s=e.realIndex;z(s)},onSwiper:e=>q(e),className:"tabs-with-media__description-swiper",children:v.map((e,s)=>(0,i.jsx)(T.SwiperSlide,{style:{transition:"opacity 1s ease-in-out"},className:"tabs-with-media__description-slide rounded-btn",children:(0,i.jsx)("div",{className:"tabs-with-media__description-content",children:(0,i.jsx)(f.Text,{as:"p",size:2,html:e.desc,className:"tabs-with-media__description-text desktop:text-[20px] lg-desktop:text-[18px] text-center"})})},s))})}),(0,i.jsx)("div",{className:"tabs-with-media__video-wrapper rounded-box laptop:mt-[32px] desktop:mt-[40px] lg-desktop:mt-[64px] mt-[24px] overflow-hidden",children:(0,i.jsx)("video",{className:"tabs-with-media__video desktop:h-[448px] lg-desktop:h-[560px] mx-auto h-[360px] w-fit",src:R?B?.url:A?.url,poster:h?.url,playsInline:!0,autoPlay:!0,muted:!0,loop:!0,ref:y})})]})});P.displayName="TabsWithMedia";var se=(0,W.withLayout)(P);
|
|
2
2
|
//# sourceMappingURL=TabsWithMedia.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/TabsWithMedia/TabsWithMedia.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport React, { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'\nimport { Heading, Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport type { TabsWithMediaProps, TabItem, TimeIndex } from './types.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Pagination, EffectFade } from 'swiper/modules'\nimport type { Swiper as SwiperType } from 'swiper'\nimport { motion, AnimatePresence } from 'framer-motion'\nimport { useMediaQuery } from 'react-responsive'\n\nconst componentType = 'video'\nconst componentName = 'tabs_with_media'\n\n// \u9ED8\u8BA4\u65F6\u95F4\u70B9\u914D\u7F6E\nconst defaultTimeIdx: TimeIndex[] = [\n { time: 2.4, point: 2.4, highlightIdx: 0 },\n { time: 2.5, point: 4.9, highlightIdx: 1 },\n { time: 2.5, point: 7.4, highlightIdx: 2 },\n { time: 2.8, point: 10.2, highlightIdx: 3 },\n { time: 2.6, point: 12.8, highlightIdx: 4 },\n { time: 3.2, point: 16, highlightIdx: 5 },\n]\n\nconst TabsWithMedia = React.forwardRef<HTMLDivElement, TabsWithMediaProps>(({ data, className }, ref) => {\n const { title, poster, video, mobvideo, items = [], timeIdx = defaultTimeIdx, theme = 'light' } = data\n\n const [swiper, setSwiper] = useState<SwiperType | null>(null)\n const tabRefs = useRef<(HTMLDivElement | null)[]>([])\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n const videoRef = useRef<HTMLVideoElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n const scrollToTabCenter = (index: number) => {\n const container = scrollContainerRef.current\n const tab = tabRefs.current[index]\n\n if (container && tab) {\n const containerRect = container.getBoundingClientRect()\n const tabRect = tab.getBoundingClientRect()\n const offset = tabRect.left - containerRect.left\n const scroll = offset - container.clientWidth / 2 + tab.clientWidth / 2\n\n container.scrollTo({\n left: container.scrollLeft + scroll,\n behavior: 'smooth',\n })\n }\n }\n\n const isMob = useMediaQuery({ query: '(max-width: 768px)' })\n\n const [list, listDouble, row, center, listLength] = useMemo(() => {\n const row = 5\n const center = 2\n const listLength = items.length\n\n const list =\n items?.map((item: TabItem, index: number) => {\n return {\n ...item,\n key: index,\n index: index,\n }\n }) || []\n\n // \u4E3A\u7B2C\u4E8C\u4E2A\u5217\u8868\u7684\u5143\u7D20\u521B\u5EFA\u552F\u4E00\u7684 key,\u907F\u514D\u91CD\u590D\n const listSecond =\n items?.map((item: TabItem, index: number) => {\n return {\n ...item,\n key: index + listLength,\n index: index,\n }\n }) || []\n\n return [list, list.concat(listSecond), row, center, listLength]\n }, [items, isMob])\n\n const [idx, setIdx] = useState(center)\n\n const [cureentList, setCureentList] = useState(listDouble.slice(0, row))\n\n // \u70B9\u51FB tab \u8DF3\u8F6C\u5BF9\u5E94\u89C6\u9891\u4F4D\u7F6E\n const handleNavClick = (key: number, index: number, isAuto?: boolean) => {\n if (key === idx) return\n if (index === center) return\n if (index > center) {\n const gap = index - center\n const copy = [...cureentList]\n copy.splice(0, gap)\n const lastkey = (cureentList[cureentList.length - 1] as any)?.key + 1\n const add = [...listDouble].splice(lastkey, gap)\n copy.push(...add)\n setCureentList([...copy])\n }\n if (index < center) {\n const gap = center - index\n const copy = [...cureentList]\n copy.splice(-gap)\n const firstkey = (cureentList[0] as any)?.key\n const add = [...listDouble].splice(listLength + firstkey - gap, gap)\n copy.unshift(...add)\n setCureentList([...copy])\n }\n\n setIdx(key)\n swiper?.slideTo(key)\n\n if (!isAuto) {\n let time = 0\n timeIdx.forEach(item => {\n if (item.highlightIdx < key) {\n time += item.time\n }\n })\n if (videoRef.current) {\n videoRef.current.currentTime = time\n }\n }\n }\n\n // \u64AD\u653E\u65F6\u6839\u636E\u65F6\u95F4\u5207\u6362 Swiper + tab\n useEffect(() => {\n const video = videoRef.current\n if (!video) return\n\n const handleTimeUpdate = () => {\n const currentTime = video.currentTime\n\n // \u81EA\u52A8\u5207\u6362\u5185\u5BB9\n for (let i = 0; i < timeIdx.length; i++) {\n const prev = i === 0 ? 0 : timeIdx[i - 1].point\n if (currentTime >= prev && currentTime < timeIdx[i].point) {\n handleNavClick(timeIdx[i].highlightIdx, timeIdx[i].highlightIdx, true)\n break\n }\n }\n\n // \u4FEE\u590D\uFF1A\u64AD\u653E\u5230\u6700\u540E\u540E\u81EA\u52A8\u5F52\u96F6\u5E76\u91CD\u65B0\u64AD\u653E\n if (currentTime >= timeIdx[timeIdx.length - 1].point) {\n video.currentTime = 0\n video.play()\n }\n }\n\n video.addEventListener('timeupdate', handleTimeUpdate)\n return () => {\n video.removeEventListener('timeupdate', handleTimeUpdate)\n }\n }, [swiper, timeIdx])\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"TabsWithMedia\"\n className={cn(\n 'tabs-with-media text-info-primary flex flex-col overflow-hidden sm:overflow-visible',\n {\n 'aiui-dark': theme === 'dark',\n },\n className\n )}\n >\n <Heading as=\"h3\" size={4} html={title} className=\"tabs-with-media__title text-center\" />\n <div className=\"tabs-with-media__tabs-wrapper scrollbar-hidden relative w-full overflow-x-auto sm:overflow-visible\">\n <div className={cn('tabs-with-media__tabs-inner tablet:w-fit mx-auto mt-[16px] w-full max-w-[824px]')}>\n <div\n className={cn(\n 'tabs-with-media__tabs-container flex translate-x-0 items-center justify-center gap-[16px] transition-all md:gap-[8px]'\n )}\n ref={scrollContainerRef}\n >\n <AnimatePresence mode=\"popLayout\">\n {cureentList?.map((item: any, index: number) => (\n <motion.div\n layout\n key={item?.key}\n ref={el => {\n tabRefs.current[item?.index] = el\n }}\n onClick={() => {\n handleNavClick(item?.key, index)\n }}\n className=\"tabs-with-media__tab-item min-w-[28px] flex-none cursor-pointer overflow-hidden sm:overflow-visible\"\n initial={{ opacity: 1 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{\n duration: 0.3,\n ease: 'easeOut',\n }}\n >\n <div className=\"tabs-with-media__tab-inner flex items-center justify-between\">\n <div\n className={cn('tabs-with-media__tab-content flex', {\n 'flex items-center justify-center gap-[8px] rounded-btn bg-[#fff] p-2 md:gap-[4px] md:p-1':\n idx === item?.key,\n })}\n >\n <div\n className={cn(\n 'tabs-with-media__tab-icon lg-desktop:size-[48px] flex size-[28] items-center justify-center rounded-full md:shrink-0',\n {\n 'h-[28px] w-[28px] bg-[#ccc] bg-opacity-50 lg-desktop:h-[48px] lg-desktop:w-[48px]':\n idx !== item?.index,\n }\n )}\n style={\n idx === item?.key\n ? {\n background: 'var(--1, linear-gradient(90deg, #3AD1FF 0%, #008CD6 100%))',\n }\n : undefined\n }\n >\n <Picture\n source={item?.icon?.url}\n alt={item?.icon?.alt}\n className=\"tabs-with-media__tab-icon-image size-[22px] md:size-[14px]\"\n />\n </div>\n\n <div className=\"tabs-with-media__tab-text-wrapper\">\n <Heading\n as=\"h4\"\n size={2}\n html={item?.tab}\n className={cn(\n 'tabs-with-media__tab-text dynamic-width-heading xs:text-[16px] line-clamp-1 size-0 overflow-hidden whitespace-nowrap text-nowrap text-black opacity-0 transition-all duration-300 ease-linear sm:text-[18px]',\n {\n 'h-auto w-[calc-size(auto,size)] px-[6px] opacity-100': idx === item?.key,\n }\n )}\n />\n </div>\n </div>\n </div>\n </motion.div>\n ))}\n </AnimatePresence>\n </div>\n </div>\n </div>\n <div className=\"tabs-with-media__description-container lg-desktop:mt-[24px] mt-[16px]\">\n <Swiper\n slidesPerView={1}\n effect=\"fade\"\n fadeEffect={{ crossFade: true }}\n modules={[Pagination, EffectFade]}\n onSlideChange={swiper => {\n const newIndex = swiper.realIndex\n setIdx(newIndex)\n }}\n onSwiper={swiper => setSwiper(swiper)}\n className=\"tabs-with-media__description-swiper\"\n >\n {items.map((it: TabItem, ind: number) => (\n <SwiperSlide\n key={ind}\n style={{ transition: 'opacity 1s ease-in-out' }}\n className=\"tabs-with-media__description-slide rounded-btn\"\n >\n <div className=\"tabs-with-media__description-content\">\n <Text\n as=\"p\"\n size={2}\n html={it.desc}\n className=\"tabs-with-media__description-text desktop:text-[20px] lg-desktop:text-[18px] text-center\"\n />\n </div>\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n <div className=\"tabs-with-media__video-wrapper rounded-box laptop:mt-[32px] desktop:mt-[40px] lg-desktop:mt-[64px] mt-[24px] overflow-hidden\">\n <video\n className=\"tabs-with-media__video desktop:h-[448px] lg-desktop:h-[560px] mx-auto h-[360px] w-fit\"\n src={isMob ? mobvideo?.url : video?.url}\n poster={poster?.url}\n playsInline\n autoPlay\n muted\n loop\n ref={videoRef}\n />\n </div>\n </section>\n )\n})\n\nTabsWithMedia.displayName = 'TabsWithMedia'\n\nexport default withLayout(TabsWithMedia)\n"],
|
|
5
|
-
"mappings": "ukBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,KAAA,eAAAC,EAAAH,IA8KM,IAAAI,EAAA,6BA7KNC,EAAiF,oBACjFC,EAAuC,qCACvCC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAA4B,sCAE5BJ,EAAoC,wBACpCK,EAAuC,0BAEvCC,EAAwC,yBACxCC,
|
|
6
|
-
"names": ["TabsWithMedia_exports", "__export", "TabsWithMedia_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_utils", "import_Styles", "import_useExposure", "import_modules", "import_framer_motion", "
|
|
4
|
+
"sourcesContent": ["'use client'\nimport React, { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'\nimport { Heading, Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport type { TabsWithMediaProps, TabItem, TimeIndex } from './types.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Pagination, EffectFade } from 'swiper/modules'\nimport type { Swiper as SwiperType } from 'swiper'\nimport { motion, AnimatePresence } from 'framer-motion'\nimport { useIsomorphicMediaQuery } from '../../hooks/useIsomorphicMediaQuery.js'\n\nconst componentType = 'video'\nconst componentName = 'tabs_with_media'\n\n// \u9ED8\u8BA4\u65F6\u95F4\u70B9\u914D\u7F6E\nconst defaultTimeIdx: TimeIndex[] = [\n { time: 2.4, point: 2.4, highlightIdx: 0 },\n { time: 2.5, point: 4.9, highlightIdx: 1 },\n { time: 2.5, point: 7.4, highlightIdx: 2 },\n { time: 2.8, point: 10.2, highlightIdx: 3 },\n { time: 2.6, point: 12.8, highlightIdx: 4 },\n { time: 3.2, point: 16, highlightIdx: 5 },\n]\n\nconst TabsWithMedia = React.forwardRef<HTMLDivElement, TabsWithMediaProps>(({ data, className }, ref) => {\n const { title, poster, video, mobvideo, items = [], timeIdx = defaultTimeIdx, theme = 'light' } = data\n\n const [swiper, setSwiper] = useState<SwiperType | null>(null)\n const tabRefs = useRef<(HTMLDivElement | null)[]>([])\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n const videoRef = useRef<HTMLVideoElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n const scrollToTabCenter = (index: number) => {\n const container = scrollContainerRef.current\n const tab = tabRefs.current[index]\n\n if (container && tab) {\n const containerRect = container.getBoundingClientRect()\n const tabRect = tab.getBoundingClientRect()\n const offset = tabRect.left - containerRect.left\n const scroll = offset - container.clientWidth / 2 + tab.clientWidth / 2\n\n container.scrollTo({\n left: container.scrollLeft + scroll,\n behavior: 'smooth',\n })\n }\n }\n\n const isMob = useIsomorphicMediaQuery({ query: '(max-width: 768px)' })\n\n const [list, listDouble, row, center, listLength] = useMemo(() => {\n const row = 5\n const center = 2\n const listLength = items.length\n\n const list =\n items?.map((item: TabItem, index: number) => {\n return {\n ...item,\n key: index,\n index: index,\n }\n }) || []\n\n // \u4E3A\u7B2C\u4E8C\u4E2A\u5217\u8868\u7684\u5143\u7D20\u521B\u5EFA\u552F\u4E00\u7684 key,\u907F\u514D\u91CD\u590D\n const listSecond =\n items?.map((item: TabItem, index: number) => {\n return {\n ...item,\n key: index + listLength,\n index: index,\n }\n }) || []\n\n return [list, list.concat(listSecond), row, center, listLength]\n }, [items, isMob])\n\n const [idx, setIdx] = useState(center)\n\n const [cureentList, setCureentList] = useState(listDouble.slice(0, row))\n\n // \u70B9\u51FB tab \u8DF3\u8F6C\u5BF9\u5E94\u89C6\u9891\u4F4D\u7F6E\n const handleNavClick = (key: number, index: number, isAuto?: boolean) => {\n if (key === idx) return\n if (index === center) return\n if (index > center) {\n const gap = index - center\n const copy = [...cureentList]\n copy.splice(0, gap)\n const lastkey = (cureentList[cureentList.length - 1] as any)?.key + 1\n const add = [...listDouble].splice(lastkey, gap)\n copy.push(...add)\n setCureentList([...copy])\n }\n if (index < center) {\n const gap = center - index\n const copy = [...cureentList]\n copy.splice(-gap)\n const firstkey = (cureentList[0] as any)?.key\n const add = [...listDouble].splice(listLength + firstkey - gap, gap)\n copy.unshift(...add)\n setCureentList([...copy])\n }\n\n setIdx(key)\n swiper?.slideTo(key)\n\n if (!isAuto) {\n let time = 0\n timeIdx.forEach(item => {\n if (item.highlightIdx < key) {\n time += item.time\n }\n })\n if (videoRef.current) {\n videoRef.current.currentTime = time\n }\n }\n }\n\n // \u64AD\u653E\u65F6\u6839\u636E\u65F6\u95F4\u5207\u6362 Swiper + tab\n useEffect(() => {\n const video = videoRef.current\n if (!video) return\n\n const handleTimeUpdate = () => {\n const currentTime = video.currentTime\n\n // \u81EA\u52A8\u5207\u6362\u5185\u5BB9\n for (let i = 0; i < timeIdx.length; i++) {\n const prev = i === 0 ? 0 : timeIdx[i - 1].point\n if (currentTime >= prev && currentTime < timeIdx[i].point) {\n handleNavClick(timeIdx[i].highlightIdx, timeIdx[i].highlightIdx, true)\n break\n }\n }\n\n // \u4FEE\u590D\uFF1A\u64AD\u653E\u5230\u6700\u540E\u540E\u81EA\u52A8\u5F52\u96F6\u5E76\u91CD\u65B0\u64AD\u653E\n if (currentTime >= timeIdx[timeIdx.length - 1].point) {\n video.currentTime = 0\n video.play()\n }\n }\n\n video.addEventListener('timeupdate', handleTimeUpdate)\n return () => {\n video.removeEventListener('timeupdate', handleTimeUpdate)\n }\n }, [swiper, timeIdx])\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"TabsWithMedia\"\n className={cn(\n 'tabs-with-media text-info-primary flex flex-col overflow-hidden sm:overflow-visible',\n {\n 'aiui-dark': theme === 'dark',\n },\n className\n )}\n >\n <Heading as=\"h3\" size={4} html={title} className=\"tabs-with-media__title text-center\" />\n <div className=\"tabs-with-media__tabs-wrapper scrollbar-hidden relative w-full overflow-x-auto sm:overflow-visible\">\n <div className={cn('tabs-with-media__tabs-inner tablet:w-fit mx-auto mt-[16px] w-full max-w-[824px]')}>\n <div\n className={cn(\n 'tabs-with-media__tabs-container flex translate-x-0 items-center justify-center gap-[16px] transition-all md:gap-[8px]'\n )}\n ref={scrollContainerRef}\n >\n <AnimatePresence mode=\"popLayout\">\n {cureentList?.map((item: any, index: number) => (\n <motion.div\n layout\n key={item?.key}\n ref={el => {\n tabRefs.current[item?.index] = el\n }}\n onClick={() => {\n handleNavClick(item?.key, index)\n }}\n className=\"tabs-with-media__tab-item min-w-[28px] flex-none cursor-pointer overflow-hidden sm:overflow-visible\"\n initial={{ opacity: 1 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{\n duration: 0.3,\n ease: 'easeOut',\n }}\n >\n <div className=\"tabs-with-media__tab-inner flex items-center justify-between\">\n <div\n className={cn('tabs-with-media__tab-content flex', {\n 'flex items-center justify-center gap-[8px] rounded-btn bg-[#fff] p-2 md:gap-[4px] md:p-1':\n idx === item?.key,\n })}\n >\n <div\n className={cn(\n 'tabs-with-media__tab-icon lg-desktop:size-[48px] flex size-[28] items-center justify-center rounded-full md:shrink-0',\n {\n 'h-[28px] w-[28px] bg-[#ccc] bg-opacity-50 lg-desktop:h-[48px] lg-desktop:w-[48px]':\n idx !== item?.index,\n }\n )}\n style={\n idx === item?.key\n ? {\n background: 'var(--1, linear-gradient(90deg, #3AD1FF 0%, #008CD6 100%))',\n }\n : undefined\n }\n >\n <Picture\n source={item?.icon?.url}\n alt={item?.icon?.alt}\n className=\"tabs-with-media__tab-icon-image size-[22px] md:size-[14px]\"\n />\n </div>\n\n <div className=\"tabs-with-media__tab-text-wrapper\">\n <Heading\n as=\"h4\"\n size={2}\n html={item?.tab}\n className={cn(\n 'tabs-with-media__tab-text dynamic-width-heading xs:text-[16px] line-clamp-1 size-0 overflow-hidden whitespace-nowrap text-nowrap text-black opacity-0 transition-all duration-300 ease-linear sm:text-[18px]',\n {\n 'h-auto w-[calc-size(auto,size)] px-[6px] opacity-100': idx === item?.key,\n }\n )}\n />\n </div>\n </div>\n </div>\n </motion.div>\n ))}\n </AnimatePresence>\n </div>\n </div>\n </div>\n <div className=\"tabs-with-media__description-container lg-desktop:mt-[24px] mt-[16px]\">\n <Swiper\n slidesPerView={1}\n effect=\"fade\"\n fadeEffect={{ crossFade: true }}\n modules={[Pagination, EffectFade]}\n onSlideChange={swiper => {\n const newIndex = swiper.realIndex\n setIdx(newIndex)\n }}\n onSwiper={swiper => setSwiper(swiper)}\n className=\"tabs-with-media__description-swiper\"\n >\n {items.map((it: TabItem, ind: number) => (\n <SwiperSlide\n key={ind}\n style={{ transition: 'opacity 1s ease-in-out' }}\n className=\"tabs-with-media__description-slide rounded-btn\"\n >\n <div className=\"tabs-with-media__description-content\">\n <Text\n as=\"p\"\n size={2}\n html={it.desc}\n className=\"tabs-with-media__description-text desktop:text-[20px] lg-desktop:text-[18px] text-center\"\n />\n </div>\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n <div className=\"tabs-with-media__video-wrapper rounded-box laptop:mt-[32px] desktop:mt-[40px] lg-desktop:mt-[64px] mt-[24px] overflow-hidden\">\n <video\n className=\"tabs-with-media__video desktop:h-[448px] lg-desktop:h-[560px] mx-auto h-[360px] w-fit\"\n src={isMob ? mobvideo?.url : video?.url}\n poster={poster?.url}\n playsInline\n autoPlay\n muted\n loop\n ref={videoRef}\n />\n </div>\n </section>\n )\n})\n\nTabsWithMedia.displayName = 'TabsWithMedia'\n\nexport default withLayout(TabsWithMedia)\n"],
|
|
5
|
+
"mappings": "ukBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,KAAA,eAAAC,EAAAH,IA8KM,IAAAI,EAAA,6BA7KNC,EAAiF,oBACjFC,EAAuC,qCACvC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AY,wBAAyB,EAC9C,UAAU,iDAEV,mBAAC,OAAI,UAAU,uCACb,mBAAC,QACC,GAAG,IACH,KAAM,EACN,KAAMD,EAAG,KACT,UAAU,2FACZ,EACF,GAXKC,CAYP,CACD,EACH,EACF,KACA,OAAC,OAAI,UAAU,+HACb,mBAAC,SACC,UAAU,wFACV,IAAK5B,EAAQhB,GAAU,IAAMD,GAAO,IACpC,OAAQD,GAAQ,IAChB,YAAW,GACX,SAAQ,GACR,MAAK,GACL,KAAI,GACJ,IAAKU,EACP,EACF,GACF,CAEJ,CAAC,EAEDhB,EAAc,YAAc,gBAE5B,IAAOd,MAAQ,cAAWc,CAAa",
|
|
6
|
+
"names": ["TabsWithMedia_exports", "__export", "TabsWithMedia_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_utils", "import_Styles", "import_useExposure", "import_modules", "import_framer_motion", "import_useIsomorphicMediaQuery", "componentType", "componentName", "defaultTimeIdx", "TabsWithMedia", "React", "data", "className", "ref", "title", "poster", "video", "mobvideo", "items", "timeIdx", "theme", "swiper", "setSwiper", "tabRefs", "scrollContainerRef", "videoRef", "boxRef", "scrollToTabCenter", "index", "container", "tab", "containerRect", "scroll", "isMob", "list", "listDouble", "row", "center", "listLength", "item", "listSecond", "idx", "setIdx", "cureentList", "setCureentList", "handleNavClick", "key", "isAuto", "gap", "copy", "lastkey", "add", "firstkey", "time", "handleTimeUpdate", "currentTime", "i", "prev", "el", "newIndex", "it", "ind"]
|
|
7
7
|
}
|
|
@@ -4,7 +4,7 @@ import 'swiper/css';
|
|
|
4
4
|
import 'swiper/css/navigation';
|
|
5
5
|
import 'swiper/css/pagination';
|
|
6
6
|
import 'swiper/css/effect-coverflow';
|
|
7
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<ThreeDCarouselProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
7
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<ThreeDCarouselProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../index.js").ContainerProps & React.RefAttributes<unknown>> & {
|
|
8
8
|
readonly $$typeof: symbol;
|
|
9
9
|
};
|
|
10
10
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var
|
|
1
|
+
"use strict";"use client";var H=Object.create;var f=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var U=(o,r)=>{for(var s in r)f(o,s,{get:r[s],enumerable:!0})},S=(o,r,s,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of j(r))!M.call(o,a)&&a!==s&&f(o,a,{get:()=>r[a],enumerable:!(u=P(r,a))||u.enumerable});return o};var $=(o,r,s)=>(s=o!=null?H(B(o)):{},S(r||!o||!o.__esModule?f(s,"default",{value:o,enumerable:!0}):s,o)),I=o=>S(f({},"__esModule",{value:!0}),o);var A={};U(A,{default:()=>W});module.exports=I(A);var e=require("react/jsx-runtime"),i=$(require("react")),l=require("../../components/index.js"),c=require("../../helpers/utils.js"),C=require("../../shared/Styles.js"),L=require("../../hooks/useExposure.js"),z=require("../AiuiProvider/index.js"),b=require("../../shared/trackUrlRef.js"),p=require("swiper/react"),h=require("swiper/modules"),F=require("swiper/css"),G=require("swiper/css/navigation"),J=require("swiper/css/pagination"),K=require("swiper/css/effect-coverflow");const w="carousel",x="three_d_carousel",O=()=>(0,e.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]",children:[(0,e.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),(0,e.jsx)("path",{d:"M32 20L24 28L32 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),V=()=>(0,e.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]",children:[(0,e.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),(0,e.jsx)("path",{d:"M24 20L32 28L24 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),T=i.default.forwardRef(({data:o,className:r},s)=>{const{title:u,items:a=[]}=o,_=a.length<4?[...a,...a]:a,n=(0,i.useRef)(null),v=(0,i.useRef)(null),g=(0,i.useRef)(null),[D,E]=i.default.useState(180),{locale:k="us",trackingData:N}=(0,z.useAiuiContext)();return(0,L.useExposure)(v,{componentType:w,componentName:x,componentTitle:u}),(0,i.useImperativeHandle)(s,()=>v.current),i.default.useEffect(()=>{const t=g.current;if(!t)return;const d=()=>{const R=t.offsetWidth,y=Math.round(R*.125);E(y),n.current?.params?.coverflowEffect&&(n.current.params.coverflowEffect.stretch=y,n.current.update())};d();const m=new ResizeObserver(d);return m.observe(t),()=>m.disconnect()},[]),(0,e.jsxs)("section",{ref:v,"data-ui-component-id":"ThreeDCarousel",className:(0,c.cn)("three-d-carousel laptop:overflow-hidden w-full overflow-visible",r),children:[(0,e.jsx)(l.Heading,{as:"h1",size:4,html:u,className:"three-d-carousel__title laptop:text-center text-left"}),(0,e.jsxs)("div",{ref:g,className:"three-d-carousel__desktop laptop:block relative mx-auto mt-[24px] hidden w-full",children:[(0,e.jsx)(p.Swiper,{onSwiper:t=>n.current=t,centeredSlides:!0,initialSlide:0,loop:!0,slidesPerView:"auto",spaceBetween:0,grabCursor:!0,modules:[h.EffectCoverflow,h.Navigation],slideToClickedSlide:!0,className:"three-d-carousel__swiper rounded-box relative aspect-[1386/502] overflow-visible",effect:"coverflow",coverflowEffect:{rotate:0,stretch:D,depth:300,modifier:1,slideShadows:!0},children:_.map((t,d)=>(0,e.jsx)(p.SwiperSlide,{className:"three-d-carousel__slide relative !w-1/2 cursor-grab overflow-hidden opacity-0 [.swiper-slide-active&]:opacity-100 [.swiper-slide-next&]:opacity-100 [.swiper-slide-prev&]:opacity-100",children:({isActive:m})=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.Picture,{source:t.imageUrl?.url||"",alt:t.imageUrl?.alt||t.title,className:(0,c.cn)("three-d-carousel__image rounded-box mx-auto h-full overflow-hidden"),imgClassName:"h-full object-cover",style:{filter:m?"":"brightness(50%) contrast(120%)"}}),(0,e.jsxs)("div",{className:(0,c.cn)("three-d-carousel__image-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]",{"aiui-dark":t.theme==="dark","opacity-0":!m}),children:[(0,e.jsx)(l.Heading,{as:"h2",size:2,html:t.title}),(0,e.jsx)(l.Text,{as:"p",size:4,html:t.description,className:"three-d-carousel__image-description lg-desktop:text-[18px] desktop:text-[16px] text-[14px]"}),t.buttonText&&(0,e.jsx)("a",{href:(0,b.trackUrlRef)((0,c.getLocalizedPath)(t.buttonLink||"",k),`${N?.contextHandle||""}_${w}_${x}`),className:"three-d-carousel__image-link ",children:(0,e.jsx)(l.Button,{size:"base",variant:"secondary",className:"three-d-carousel__image-button desktop:mt-6 mt-4",children:t.buttonText})})]})]})},d))}),(0,e.jsxs)("div",{className:"three-d-carousel__nav-controls laptop:px-[64px] desktop:px-[140px] lg-desktop:px-[200px] absolute left-1/2 top-1/2 z-20 flex w-full -translate-x-1/2 -translate-y-1/2 justify-between",children:[(0,e.jsx)("button",{className:"three-d-carousel__nav-button three-d-carousel__nav-button--prev",onClick:()=>n.current?.slidePrev(),"aria-label":"Previous slide",children:(0,e.jsx)(O,{})}),(0,e.jsx)("button",{className:"three-d-carousel__nav-button three-d-carousel__nav-button--next",onClick:()=>n.current?.slideNext(),"aria-label":"Next slide",children:(0,e.jsx)(V,{})})]})]}),(0,e.jsx)("div",{className:"three-d-carousel__mobile laptop:hidden mt-[24px] block w-full overflow-visible",children:(0,e.jsx)(p.Swiper,{loop:!0,loopAdditionalSlides:1,slidesPerView:"auto",spaceBetween:12,grabCursor:!0,className:"three-d-carousel__swiper-mobile relative w-full !overflow-visible",children:_.map((t,d)=>(0,e.jsxs)(p.SwiperSlide,{className:"three-d-carousel__slide-mobile relative !h-[360px] !w-[296px] cursor-grab overflow-hidden",children:[(0,e.jsx)(l.Picture,{source:t.mobImageUrl?.url||t.imageUrl?.url||"",alt:t.mobImageUrl?.alt||t.title,className:"three-d-carousel__image-mobile rounded-box mx-auto h-full overflow-hidden",imgClassName:"h-full object-cover"}),(0,e.jsxs)("div",{className:(0,c.cn)("three-d-carousel__image-mobile-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]",{"aiui-dark":t.theme==="dark"}),children:[(0,e.jsx)(l.Heading,{as:"h2",size:2,html:t.title}),(0,e.jsx)(l.Text,{as:"p",size:4,html:t.description,className:"three-d-carousel__image-mobile-description text-[14px]"}),t.buttonText&&(0,e.jsx)("a",{href:(0,b.trackUrlRef)((0,c.getLocalizedPath)(t.buttonLink||"",k),`${N?.contextHandle||""}_${w}_${x}`),className:"three-d-carousel__image-mobile-link ",children:(0,e.jsx)(l.Button,{size:"base",variant:"secondary",className:"three-d-carousel__image-mobile-button mt-3",children:t.buttonText})})]})]},d))})})]})});T.displayName="ThreeDCarousel";var W=(0,C.withLayout)(T,{style:"overflow: hidden;"});
|
|
2
2
|
//# sourceMappingURL=ThreeDCarousel.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/ThreeDCarousel/ThreeDCarousel.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport React, { useRef, useImperativeHandle } from 'react'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport type { ThreeDCarouselProps } from './types.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Navigation, EffectCoverflow } from 'swiper/modules'\nimport type { Swiper as SwiperType } from 'swiper'\n\nimport 'swiper/css'\nimport 'swiper/css/navigation'\nimport 'swiper/css/pagination'\nimport 'swiper/css/effect-coverflow'\n\nconst componentType = 'carousel'\nconst componentName = 'three_d_carousel'\n\nconst ChevronLeft = () => (\n <svg\n width=\"56\"\n height=\"56\"\n viewBox=\"0 0 56 56\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]\"\n >\n <circle cx=\"28\" cy=\"28\" r=\"28\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M32 20L24 28L32 36\" stroke=\"white\" strokeWidth=\"2.66667\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\nconst ChevronRight = () => (\n <svg\n width=\"56\"\n height=\"56\"\n viewBox=\"0 0 56 56\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]\"\n >\n <circle cx=\"28\" cy=\"28\" r=\"28\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M24 20L32 28L24 36\" stroke=\"white\" strokeWidth=\"2.66667\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\nconst ThreeDCarousel = React.forwardRef<HTMLDivElement, ThreeDCarouselProps>(({ data, className }, ref) => {\n const { title, items = [] } = data\n const cloneItems = items.length < 4 ? [...items, ...items] : items\n const swiperRef = useRef<SwiperType | null>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const containerRef = useRef<HTMLDivElement>(null)\n const [stretchValue, setStretchValue] = React.useState(180)\n const { locale = 'us' } = useAiuiContext()\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n // \u52A8\u6001\u8BA1\u7B97 stretch \u503C\uFF0C\u8BA9\u4E09\u4E2A slide \u521A\u597D\u5360\u6EE1\u5BB9\u5668\u5BBD\u5EA6\n React.useEffect(() => {\n const container = containerRef.current\n if (!container) return\n\n const updateStretch = () => {\n const containerWidth = container.offsetWidth\n // stretch \u4E3A\u5BB9\u5668\u5BBD\u5EA6\u7684 12.5%\uFF0C\u8BA9\u4E09\u4E2A slide (50% + 2*25%) \u521A\u597D\u5360\u6EE1\n const newStretch = Math.round(containerWidth * 0.125)\n setStretchValue(newStretch)\n\n // \u66F4\u65B0 Swiper \u914D\u7F6E\n if (swiperRef.current?.params?.coverflowEffect) {\n swiperRef.current.params.coverflowEffect.stretch = newStretch\n swiperRef.current.update()\n }\n }\n\n // \u521D\u59CB\u5316\u8BA1\u7B97\n updateStretch()\n\n // \u76D1\u542C\u5BB9\u5668\u5C3A\u5BF8\u53D8\u5316\n const resizeObserver = new ResizeObserver(updateStretch)\n resizeObserver.observe(container)\n\n return () => resizeObserver.disconnect()\n }, [])\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"ThreeDCarousel\"\n className={cn('three-d-carousel laptop:overflow-hidden w-full overflow-visible', className)}\n >\n <Heading as=\"h1\" size={4} html={title} className=\"three-d-carousel__title laptop:text-center text-left\" />\n\n {/* Desktop carousel with 3D effect */}\n <div\n ref={containerRef}\n className=\"three-d-carousel__desktop laptop:block relative mx-auto mt-[24px] hidden w-full\"\n >\n <Swiper\n onSwiper={swiper => (swiperRef.current = swiper)}\n centeredSlides={true}\n initialSlide={0}\n loop\n slidesPerView={'auto'}\n // loopAdditionalSlides={2}\n spaceBetween={0}\n grabCursor\n modules={[EffectCoverflow, Navigation]}\n slideToClickedSlide\n className=\"three-d-carousel__swiper rounded-box relative aspect-[1386/502] overflow-visible\"\n effect=\"coverflow\"\n coverflowEffect={{\n rotate: 0,\n stretch: stretchValue,\n depth: 300,\n modifier: 1,\n slideShadows: true,\n }}\n >\n {cloneItems.map((item, index) => (\n <SwiperSlide\n key={index}\n className=\"three-d-carousel__slide relative !w-1/2 cursor-grab overflow-hidden opacity-0 [.swiper-slide-active&]:opacity-100 [.swiper-slide-next&]:opacity-100 [.swiper-slide-prev&]:opacity-100\"\n >\n {({ isActive }) => (\n <>\n <Picture\n source={item.imageUrl?.url || ''}\n alt={item.imageUrl?.alt || item.title}\n className={cn('three-d-carousel__image rounded-box mx-auto h-full overflow-hidden')}\n imgClassName=\"h-full object-cover\"\n style={{\n filter: isActive ? '' : 'brightness(50%) contrast(120%)',\n }}\n />\n <div\n className={cn(\n 'three-d-carousel__image-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]',\n {\n 'aiui-dark': item.theme === 'dark',\n 'opacity-0': !isActive,\n }\n )}\n >\n <Heading as=\"h2\" size={2} html={item.title} />\n <Text\n as=\"p\"\n size={4}\n html={item.description}\n className=\"three-d-carousel__image-description lg-desktop:text-[18px] desktop:text-[16px] text-[14px]\"\n />\n {item.buttonText && (\n <a\n href={getLocalizedPath(item.buttonLink || '', locale)}\n className=\"three-d-carousel__image-link \"\n >\n <Button\n size=\"base\"\n variant=\"secondary\"\n className=\"three-d-carousel__image-button desktop:mt-6 mt-4\"\n >\n {item.buttonText}\n </Button>\n </a>\n )}\n </div>\n </>\n )}\n </SwiperSlide>\n ))}\n </Swiper>\n <div className=\"three-d-carousel__nav-controls laptop:px-[64px] desktop:px-[140px] lg-desktop:px-[200px] absolute left-1/2 top-1/2 z-20 flex w-full -translate-x-1/2 -translate-y-1/2 justify-between\">\n <button\n className=\"three-d-carousel__nav-button three-d-carousel__nav-button--prev\"\n onClick={() => swiperRef.current?.slidePrev()}\n aria-label=\"Previous slide\"\n >\n <ChevronLeft />\n </button>\n <button\n className=\"three-d-carousel__nav-button three-d-carousel__nav-button--next\"\n onClick={() => swiperRef.current?.slideNext()}\n aria-label=\"Next slide\"\n >\n <ChevronRight />\n </button>\n </div>\n </div>\n\n {/* Mobile carousel */}\n <div className=\"three-d-carousel__mobile laptop:hidden mt-[24px] block w-full overflow-visible\">\n <Swiper\n loop={true}\n loopAdditionalSlides={1}\n slidesPerView={'auto'}\n spaceBetween={12}\n grabCursor\n className=\"three-d-carousel__swiper-mobile relative w-full !overflow-visible\"\n >\n {cloneItems.map((item, index) => (\n <SwiperSlide\n key={index}\n className=\"three-d-carousel__slide-mobile relative !h-[360px] !w-[296px] cursor-grab overflow-hidden\"\n >\n <Picture\n source={item.mobImageUrl?.url || item.imageUrl?.url || ''}\n alt={item.mobImageUrl?.alt || item.title}\n className=\"three-d-carousel__image-mobile rounded-box mx-auto h-full overflow-hidden\"\n imgClassName=\"h-full object-cover\"\n />\n <div\n className={cn(\n 'three-d-carousel__image-mobile-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]',\n {\n 'aiui-dark': item.theme === 'dark',\n }\n )}\n >\n <Heading as=\"h2\" size={2} html={item.title} />\n <Text\n as=\"p\"\n size={4}\n html={item.description}\n className=\"three-d-carousel__image-mobile-description text-[14px]\"\n />\n {item.buttonText && (\n <a\n href={getLocalizedPath(item.buttonLink || '', locale)}\n className=\"three-d-carousel__image-mobile-link \"\n >\n <Button size=\"base\" variant=\"secondary\" className=\"three-d-carousel__image-mobile-button mt-3\">\n {item.buttonText}\n </Button>\n </a>\n )}\n </div>\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n </section>\n )\n})\n\nThreeDCarousel.displayName = 'ThreeDCarousel'\n\nexport default withLayout(ThreeDCarousel, { style: 'overflow: hidden;' })\n"],
|
|
5
|
-
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,
|
|
6
|
-
"names": ["ThreeDCarousel_exports", "__export", "ThreeDCarousel_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_utils", "import_Styles", "import_useExposure", "import_AiuiProvider", "import_modules", "import_css", "import_navigation", "import_pagination", "import_effect_coverflow", "componentType", "componentName", "ChevronLeft", "ChevronRight", "ThreeDCarousel", "React", "data", "className", "ref", "title", "items", "cloneItems", "swiperRef", "boxRef", "containerRef", "stretchValue", "setStretchValue", "locale", "container", "updateStretch", "containerWidth", "newStretch", "resizeObserver", "swiper", "item", "index", "isActive"]
|
|
4
|
+
"sourcesContent": ["'use client'\nimport React, { useRef, useImperativeHandle } from 'react'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { ThreeDCarouselProps } from './types.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Navigation, EffectCoverflow } from 'swiper/modules'\nimport type { Swiper as SwiperType } from 'swiper'\n\nimport 'swiper/css'\nimport 'swiper/css/navigation'\nimport 'swiper/css/pagination'\nimport 'swiper/css/effect-coverflow'\n\nconst componentType = 'carousel'\nconst componentName = 'three_d_carousel'\n\nconst ChevronLeft = () => (\n <svg\n width=\"56\"\n height=\"56\"\n viewBox=\"0 0 56 56\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]\"\n >\n <circle cx=\"28\" cy=\"28\" r=\"28\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M32 20L24 28L32 36\" stroke=\"white\" strokeWidth=\"2.66667\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\nconst ChevronRight = () => (\n <svg\n width=\"56\"\n height=\"56\"\n viewBox=\"0 0 56 56\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]\"\n >\n <circle cx=\"28\" cy=\"28\" r=\"28\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M24 20L32 28L24 36\" stroke=\"white\" strokeWidth=\"2.66667\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\nconst ThreeDCarousel = React.forwardRef<HTMLDivElement, ThreeDCarouselProps>(({ data, className }, ref) => {\n const { title, items = [] } = data\n const cloneItems = items.length < 4 ? [...items, ...items] : items\n const swiperRef = useRef<SwiperType | null>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const containerRef = useRef<HTMLDivElement>(null)\n const [stretchValue, setStretchValue] = React.useState(180)\n const { locale = 'us', trackingData } = useAiuiContext()\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n // \u52A8\u6001\u8BA1\u7B97 stretch \u503C\uFF0C\u8BA9\u4E09\u4E2A slide \u521A\u597D\u5360\u6EE1\u5BB9\u5668\u5BBD\u5EA6\n React.useEffect(() => {\n const container = containerRef.current\n if (!container) return\n\n const updateStretch = () => {\n const containerWidth = container.offsetWidth\n // stretch \u4E3A\u5BB9\u5668\u5BBD\u5EA6\u7684 12.5%\uFF0C\u8BA9\u4E09\u4E2A slide (50% + 2*25%) \u521A\u597D\u5360\u6EE1\n const newStretch = Math.round(containerWidth * 0.125)\n setStretchValue(newStretch)\n\n // \u66F4\u65B0 Swiper \u914D\u7F6E\n if (swiperRef.current?.params?.coverflowEffect) {\n swiperRef.current.params.coverflowEffect.stretch = newStretch\n swiperRef.current.update()\n }\n }\n\n // \u521D\u59CB\u5316\u8BA1\u7B97\n updateStretch()\n\n // \u76D1\u542C\u5BB9\u5668\u5C3A\u5BF8\u53D8\u5316\n const resizeObserver = new ResizeObserver(updateStretch)\n resizeObserver.observe(container)\n\n return () => resizeObserver.disconnect()\n }, [])\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"ThreeDCarousel\"\n className={cn('three-d-carousel laptop:overflow-hidden w-full overflow-visible', className)}\n >\n <Heading as=\"h1\" size={4} html={title} className=\"three-d-carousel__title laptop:text-center text-left\" />\n\n {/* Desktop carousel with 3D effect */}\n <div\n ref={containerRef}\n className=\"three-d-carousel__desktop laptop:block relative mx-auto mt-[24px] hidden w-full\"\n >\n <Swiper\n onSwiper={swiper => (swiperRef.current = swiper)}\n centeredSlides={true}\n initialSlide={0}\n loop\n slidesPerView={'auto'}\n // loopAdditionalSlides={2}\n spaceBetween={0}\n grabCursor\n modules={[EffectCoverflow, Navigation]}\n slideToClickedSlide\n className=\"three-d-carousel__swiper rounded-box relative aspect-[1386/502] overflow-visible\"\n effect=\"coverflow\"\n coverflowEffect={{\n rotate: 0,\n stretch: stretchValue,\n depth: 300,\n modifier: 1,\n slideShadows: true,\n }}\n >\n {cloneItems.map((item, index) => (\n <SwiperSlide\n key={index}\n className=\"three-d-carousel__slide relative !w-1/2 cursor-grab overflow-hidden opacity-0 [.swiper-slide-active&]:opacity-100 [.swiper-slide-next&]:opacity-100 [.swiper-slide-prev&]:opacity-100\"\n >\n {({ isActive }) => (\n <>\n <Picture\n source={item.imageUrl?.url || ''}\n alt={item.imageUrl?.alt || item.title}\n className={cn('three-d-carousel__image rounded-box mx-auto h-full overflow-hidden')}\n imgClassName=\"h-full object-cover\"\n style={{\n filter: isActive ? '' : 'brightness(50%) contrast(120%)',\n }}\n />\n <div\n className={cn(\n 'three-d-carousel__image-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]',\n {\n 'aiui-dark': item.theme === 'dark',\n 'opacity-0': !isActive,\n }\n )}\n >\n <Heading as=\"h2\" size={2} html={item.title} />\n <Text\n as=\"p\"\n size={4}\n html={item.description}\n className=\"three-d-carousel__image-description lg-desktop:text-[18px] desktop:text-[16px] text-[14px]\"\n />\n {item.buttonText && (\n <a\n href={trackUrlRef(\n getLocalizedPath(item.buttonLink || '', locale),\n `${trackingData?.contextHandle || ''}_${componentType}_${componentName}`\n )}\n className=\"three-d-carousel__image-link \"\n >\n <Button\n size=\"base\"\n variant=\"secondary\"\n className=\"three-d-carousel__image-button desktop:mt-6 mt-4\"\n >\n {item.buttonText}\n </Button>\n </a>\n )}\n </div>\n </>\n )}\n </SwiperSlide>\n ))}\n </Swiper>\n <div className=\"three-d-carousel__nav-controls laptop:px-[64px] desktop:px-[140px] lg-desktop:px-[200px] absolute left-1/2 top-1/2 z-20 flex w-full -translate-x-1/2 -translate-y-1/2 justify-between\">\n <button\n className=\"three-d-carousel__nav-button three-d-carousel__nav-button--prev\"\n onClick={() => swiperRef.current?.slidePrev()}\n aria-label=\"Previous slide\"\n >\n <ChevronLeft />\n </button>\n <button\n className=\"three-d-carousel__nav-button three-d-carousel__nav-button--next\"\n onClick={() => swiperRef.current?.slideNext()}\n aria-label=\"Next slide\"\n >\n <ChevronRight />\n </button>\n </div>\n </div>\n\n {/* Mobile carousel */}\n <div className=\"three-d-carousel__mobile laptop:hidden mt-[24px] block w-full overflow-visible\">\n <Swiper\n loop={true}\n loopAdditionalSlides={1}\n slidesPerView={'auto'}\n spaceBetween={12}\n grabCursor\n className=\"three-d-carousel__swiper-mobile relative w-full !overflow-visible\"\n >\n {cloneItems.map((item, index) => (\n <SwiperSlide\n key={index}\n className=\"three-d-carousel__slide-mobile relative !h-[360px] !w-[296px] cursor-grab overflow-hidden\"\n >\n <Picture\n source={item.mobImageUrl?.url || item.imageUrl?.url || ''}\n alt={item.mobImageUrl?.alt || item.title}\n className=\"three-d-carousel__image-mobile rounded-box mx-auto h-full overflow-hidden\"\n imgClassName=\"h-full object-cover\"\n />\n <div\n className={cn(\n 'three-d-carousel__image-mobile-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]',\n {\n 'aiui-dark': item.theme === 'dark',\n }\n )}\n >\n <Heading as=\"h2\" size={2} html={item.title} />\n <Text\n as=\"p\"\n size={4}\n html={item.description}\n className=\"three-d-carousel__image-mobile-description text-[14px]\"\n />\n {item.buttonText && (\n <a\n href={trackUrlRef(\n getLocalizedPath(item.buttonLink || '', locale),\n `${trackingData?.contextHandle || ''}_${componentType}_${componentName}`\n )}\n className=\"three-d-carousel__image-mobile-link \"\n >\n <Button size=\"base\" variant=\"secondary\" className=\"three-d-carousel__image-mobile-button mt-3\">\n {item.buttonText}\n </Button>\n </a>\n )}\n </div>\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n </section>\n )\n})\n\nThreeDCarousel.displayName = 'ThreeDCarousel'\n\nexport default withLayout(ThreeDCarousel, { style: 'overflow: hidden;' })\n"],
|
|
5
|
+
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAsBE,IAAAI,EAAA,6BArBFC,EAAmD,oBACnDC,EAA+C,qCAC/CC,EAAqC,kCACrCC,EAA2B,kCAC3BC,EAA4B,sCAC5BC,EAA+B,oCAC/BC,EAA4B,uCAE5BN,EAAoC,wBACpCO,EAA4C,0BAG5CC,EAAO,sBACPC,EAAO,iCACPC,EAAO,iCACPC,EAAO,uCAEP,MAAMC,EAAgB,WAChBC,EAAgB,mBAEhBC,EAAc,OAClB,QAAC,OACC,MAAM,KACN,OAAO,KACP,QAAQ,YACR,KAAK,OACL,MAAM,6BACN,UAAU,8FAEV,oBAAC,UAAO,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,KAAK,eAAe,YAAY,MAAM,KACrE,OAAC,QAAK,EAAE,qBAAqB,OAAO,QAAQ,YAAY,UAAU,cA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DGC,CAkDP,CACD,EACH,KACA,QAAC,OAAI,UAAU,wLACb,oBAAC,UACC,UAAU,kEACV,QAAS,IAAMd,EAAU,SAAS,UAAU,EAC5C,aAAW,iBAEX,mBAACV,EAAA,EAAY,EACf,KACA,OAAC,UACC,UAAU,kEACV,QAAS,IAAMU,EAAU,SAAS,UAAU,EAC5C,aAAW,aAEX,mBAACT,EAAA,EAAa,EAChB,GACF,GACF,KAGA,OAAC,OAAI,UAAU,iFACb,mBAAC,UACC,KAAM,GACN,qBAAsB,EACtB,cAAe,OACf,aAAc,GACd,WAAU,GACV,UAAU,oEAET,SAAAQ,EAAW,IAAI,CAACc,EAAMC,OACrB,QAAC,eAEC,UAAU,4FAEV,oBAAC,WACC,OAAQD,EAAK,aAAa,KAAOA,EAAK,UAAU,KAAO,GACvD,IAAKA,EAAK,aAAa,KAAOA,EAAK,MACnC,UAAU,4EACV,aAAa,sBACf,KACA,QAAC,OACC,aAAW,MACT,qKACA,CACE,YAAaA,EAAK,QAAU,MAC9B,CACF,EAEA,oBAAC,WAAQ,GAAG,KAAK,KAAM,EAAG,KAAMA,EAAK,MAAO,KAC5C,OAAC,QACC,GAAG,IACH,KAAM,EACN,KAAMA,EAAK,YACX,UAAU,yDACZ,EACCA,EAAK,eACJ,OAAC,KACC,QAAM,kBACJ,oBAAiBA,EAAK,YAAc,GAAIR,CAAM,EAC9C,GAAGC,GAAc,eAAiB,EAAE,IAAIlB,CAAa,IAAIC,CAAa,EACxE,EACA,UAAU,uCAEV,mBAAC,UAAO,KAAK,OAAO,QAAQ,YAAY,UAAU,6CAC/C,SAAAwB,EAAK,WACR,EACF,GAEJ,IArCKC,CAsCP,CACD,EACH,EACF,GACF,CAEJ,CAAC,EAEDtB,EAAe,YAAc,iBAE7B,IAAOnB,KAAQ,cAAWmB,EAAgB,CAAE,MAAO,mBAAoB,CAAC",
|
|
6
|
+
"names": ["ThreeDCarousel_exports", "__export", "ThreeDCarousel_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_utils", "import_Styles", "import_useExposure", "import_AiuiProvider", "import_trackUrlRef", "import_modules", "import_css", "import_navigation", "import_pagination", "import_effect_coverflow", "componentType", "componentName", "ChevronLeft", "ChevronRight", "ThreeDCarousel", "React", "data", "className", "ref", "title", "items", "cloneItems", "swiperRef", "boxRef", "containerRef", "stretchValue", "setStretchValue", "locale", "trackingData", "container", "updateStretch", "containerWidth", "newStretch", "resizeObserver", "swiper", "item", "index", "isActive"]
|
|
7
7
|
}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { TitlePropsBase } from './types.js';
|
|
3
3
|
export interface TitleProps extends TitlePropsBase, Omit<React.HTMLAttributes<HTMLDivElement>, 'className' | 'title'> {
|
|
4
4
|
}
|
|
5
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<TitleProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
5
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<TitleProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../index.js").ContainerProps & React.RefAttributes<unknown>> & {
|
|
6
6
|
readonly $$typeof: symbol;
|
|
7
7
|
};
|
|
8
8
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var
|
|
1
|
+
"use strict";"use client";var ut=Object.create;var b=Object.defineProperty;var mt=Object.getOwnPropertyDescriptor;var pt=Object.getOwnPropertyNames;var ft=Object.getPrototypeOf,ht=Object.prototype.hasOwnProperty;var gt=(t,n)=>{for(var e in n)b(t,e,{get:n[e],enumerable:!0})},$=(t,n,e,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of pt(n))!ht.call(t,r)&&r!==e&&b(t,r,{get:()=>n[r],enumerable:!(s=mt(n,r))||s.enumerable});return t};var xt=(t,n,e)=>(e=t!=null?ut(ft(t)):{},$(n||!t||!t.__esModule?b(e,"default",{value:t,enumerable:!0}):e,t)),wt=t=>$(b({},"__esModule",{value:!0}),t);var Tt={};gt(Tt,{default:()=>yt});module.exports=wt(Tt);var i=require("react/jsx-runtime"),l=xt(require("react")),v=require("gsap"),M=require("gsap/dist/SplitText"),z=require("gsap/dist/ScrollTrigger"),o=require("../../helpers/index.js"),R=require("class-variance-authority"),c=require("../../components/index.js"),I=require("../../shared/Styles.js"),j=require("../../hooks/useExposure.js"),O=require("../../shared/trackUrlRef.js"),U=require("../AiuiProvider/index.js"),W=require("react-intersection-observer");const D="link",E="title";function bt(t){if(!t)return!1;if(typeof t=="string")return t.trim().length>0;const n=t?.root?.children;return!Array.isArray(n)||n.length===0?!1:n.some(e=>{const s=e?.children;return!Array.isArray(s)||s.length===0?!1:s.some(r=>typeof r?.text=="string"&&r.text.length>0)})}const vt=(0,R.cva)("",{variants:{theme:{light:"text-[#080A0F]",dark:"text-[#F5F6F7]"}},defaultVariants:{theme:"light"}}),kt=(0,R.cva)("desktop:text-base desktop:mt-2 lg-desktop:text-[18px] mt-1 text-[14px] font-bold leading-[1.4] tracking-[-0.36px]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-[#F5F6F7]"}},defaultVariants:{theme:"light"}}),_=({data:t,onClick:n,className:e})=>{const{theme:s="light",extensions:r,title:g,caption:k,align:x}=t,{trackingData:m}=(0,U.useAiuiContext)(),y=m?.contextHandle||"";if(!r?.textLink)return null;const d=r?.link?(0,O.trackUrlRef)(r.link,`${y}_${D}_${E}`):void 0;return(0,i.jsxs)("a",{className:(0,o.cn)({"aiui-dark":s==="dark"},"hover:text-brand-0 [&_svg_path]:hover:fill-brand-0 lg-desktop:text-base flex cursor-pointer items-center overflow-hidden text-sm font-[700] leading-[1.4] transition-all duration-[0.4s]",{"text-[#080A0F]":s==="light"},{"text-[#F5F6F7]":s==="dark"},{"justify-center mt-4":x==="center"},{"mt-1 laptop:mt-0":x==="left"},e),...d?{href:d}:{},"data-headless-type-name":`${D}#${E}`,"data-headless-title-desc-button":`${g}#${k}`,...n?{onClick:n}:{},children:[(0,i.jsx)("div",{className:"truncate whitespace-nowrap",children:r?.textLink}),(0,i.jsx)("div",{className:"lg-desktop:size-5 size-4",children:(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",children:(0,i.jsx)("path",{d:"M5.52827 3.52864C5.78862 3.26829 6.21063 3.26829 6.47098 3.52864L10.471 7.52864C10.7313 7.78899 10.7313 8.21099 10.471 8.47134L6.47098 12.4713C6.21063 12.7317 5.78862 12.7317 5.52827 12.4713C5.26792 12.211 5.26792 11.789 5.52827 11.5286L9.05692 7.99999L5.52827 4.47134C5.26792 4.21099 5.26792 3.78899 5.52827 3.52864Z",fill:s==="dark"?"#F5F6F7":"#080A0F",className:"transition-all duration-[0.4s]"})})})]})},B=l.default.forwardRef(({data:t,className:n,classNames:e,as:s="h2",weight:r="bold",onButtonClick:g,...k},x)=>{const{title:m,titleSize:y=4,caption:d,subtitle:T,content:A,countdown:a,showCountdown:Z=!1,theme:w="light",extensions:q,align:p="left"}=t,H=(0,l.useRef)(null),f=(0,l.useRef)(null),u=(0,l.useRef)(null),h=(0,l.useRef)(null),[G,J]=(0,l.useState)(!0),{ref:K,inView:V}=(0,W.useInView)();(0,l.useImperativeHandle)(x,()=>H.current),(0,j.useExposure)(H,{componentType:D,componentName:E,componentTitle:(0,o.extractLexicalText)(d)||(0,o.extractLexicalText)(m)||"",componentDescription:(0,o.extractLexicalText)(T)||""});const Q=()=>{J(!1)},X=a?.targetDateTime||a?.targetDate||"",Y=a?.targetDateTime_tz,tt=a?.labels?{day:a.labels.days||"Day",hour:a.labels.hours||"Hours",minute:a.labels.minutes||"Mins",second:a.labels.seconds||"Secs"}:void 0;return(0,l.useEffect)(()=>{v.gsap.registerPlugin(M.SplitText,z.ScrollTrigger);function et(){if(!f.current)return;const nt=f.current?.clientHeight||80;u.current&&u.current.revert(),h.current&&h.current.kill(),u.current=new M.SplitText(f.current,{type:"words",wordsClass:"word"});const F=u.current.words;v.gsap.set(F,{opacity:0}),h.current=z.ScrollTrigger.create({trigger:f.current,start:"bottom bottom-=4%",end:`bottom+=${nt*1.5+60}px bottom-=4%`,scrub:!0,invalidateOnRefresh:!0,onUpdate:rt=>{const it=rt.progress,N=F.length||1,ot=.5,L=1/N,P=L*(1-ot),S=(N-1)*P+L,st=Math.min(1,S>0?it/S:0);F.forEach((at,lt)=>{const ct=lt*P,dt=L;let C=(st-ct)/dt;C=Math.max(0,Math.min(1,C)),v.gsap.set(at,{opacity:C})})}})}return V&&et(),()=>{u.current&&u.current.revert(),h.current&&h.current.kill()}},[V]),(0,i.jsxs)("div",{...k,id:q?.id,className:(0,o.cn)("titleBottom title-box flex items-end justify-between gap-2 pb-6",n,e?.wrapper),ref:H,children:[(0,i.jsxs)("div",{ref:K,className:(0,o.cn)("flex-1",e?.container,{"aiui-dark":w==="dark","text-center":p==="center","text-left":p==="left"}),children:[(d||m)&&(0,i.jsx)(c.Heading,{ref:f,as:s,size:y,html:d||m,weight:r,className:(0,o.cn)(vt({theme:w}),e?.title)}),T&&(0,i.jsx)(c.Text,{html:T,as:"p",className:(0,o.cn)(kt({theme:w}),e?.subtitle)}),bt(A)&&(0,i.jsx)(c.Text,{html:A,as:"div",size:4,className:(0,o.cn)("title-content text-info-primary desktop:text-base desktop:mt-4 lg-desktop:text-[18px] mt-2 text-[14px] leading-[1.6]",e?.content)}),(0,i.jsx)(_,{data:t,className:(0,o.cn)({"laptop:hidden":p==="left"},e?.button),onClick:g}),Z&&a&&G&&(0,i.jsx)(c.Countdown,{endDate:X,endDate_tz:Y,timeLabels:tt,showDays:a?.showDays,showHours:a?.showHours,showMinutes:a?.showMinutes,showSeconds:a?.showSeconds,theme:w,onExpire:Q,hideWhenExpired:!0,align:p==="center"?"center":"left",className:(0,o.cn)("mt-4",e?.countdown)})]}),(0,i.jsx)(_,{data:t,className:(0,o.cn)("hidden",{"laptop:flex":p==="left"},e?.button),onClick:g})]})});B.displayName="Title";var yt=(0,I.withLayout)(B);
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/Title/index.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport React, { useEffect, useRef, useImperativeHandle, useState } from 'react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { cva } from 'class-variance-authority'\nimport { Heading, Text, Countdown, type HeadingProps } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { TitlePropsBase } from './types.js'\n\nexport interface TitleProps extends TitlePropsBase, Omit<React.HTMLAttributes<HTMLDivElement>, 'className' | 'title'> {}\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useInView } from 'react-intersection-observer'\n\nconst componentType = 'link'\nconst componentName = 'title'\n\n/**\n * \u5224\u65AD content \u5B57\u6BB5\u662F\u5426\u6709\u5B9E\u9645\u53EF\u89C1\u5185\u5BB9\u3002\n * - string\uFF1A\u53BB\u6389\u7A7A\u767D\u540E\u975E\u7A7A\u5373\u6709\u5185\u5BB9\n * - SerializedEditorState\uFF1A\u68C0\u67E5 root.children \u5185\u662F\u5426\u5B58\u5728\u975E\u7A7A\u6587\u672C\u8282\u70B9\uFF0C\n * \u907F\u514D convertLexicalToHTML \u628A\u7A7A\u6587\u6863\u8F93\u51FA\u4E3A <div class=\"payload-richtext\"></div>\n */\nfunction hasVisibleContent(content: string | { root?: { children?: unknown[] } } | null | undefined): boolean {\n if (!content) return false\n if (typeof content === 'string') return content.trim().length > 0\n const children = content?.root?.children\n if (!Array.isArray(children) || children.length === 0) return false\n return children.some((node: any) => {\n const nodeChildren = node?.children\n if (!Array.isArray(nodeChildren) || nodeChildren.length === 0) return false\n return nodeChildren.some((child: any) => typeof child?.text === 'string' && child.text.length > 0)\n })\n}\n\n/**\n * \u6807\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst titleHeadingVariants = cva('', {\n variants: {\n theme: {\n light: 'text-[#080A0F]',\n dark: 'text-[#F5F6F7]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n})\n\n/**\n * \u526F\u6807\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst subtitleVariants = cva(\n 'desktop:text-base desktop:mt-2 lg-desktop:text-[18px] mt-1 text-[14px] font-bold leading-[1.4] tracking-[-0.36px]',\n {\n variants: {\n theme: {\n light: 'text-[#080A0F]',\n dark: 'text-[#F5F6F7]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n }\n)\n\nconst TitleButton = ({\n data,\n onClick,\n className,\n}: {\n data: TitleProps['data']\n onClick?: () => void\n className?: string\n}) => {\n const { theme = 'light', extensions, title, caption, align } = data\n if (!extensions?.textLink) return null\n\n const href = extensions?.link ? trackUrlRef(extensions.link, `${componentType}_${componentName}`) : undefined\n\n return (\n <a\n className={cn(\n { 'aiui-dark': theme === 'dark' },\n 'hover:text-brand-0 [&_svg_path]:hover:fill-brand-0 lg-desktop:text-base flex cursor-pointer items-center overflow-hidden text-sm font-[700] leading-[1.4] transition-all duration-[0.4s]',\n { 'text-[#080A0F]': theme === 'light' },\n { 'text-[#F5F6F7]': theme === 'dark' },\n { 'justify-center mt-4': align === 'center' },\n { 'mt-1 laptop:mt-0': align === 'left' },\n className\n )}\n {...(href ? { href } : {})}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${caption}`}\n {...(onClick ? { onClick } : {})}\n >\n <div className=\"truncate whitespace-nowrap\">{extensions?.textLink}</div>\n <div className=\"lg-desktop:size-5 size-4\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" height=\"100%\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n d=\"M5.52827 3.52864C5.78862 3.26829 6.21063 3.26829 6.47098 3.52864L10.471 7.52864C10.7313 7.78899 10.7313 8.21099 10.471 8.47134L6.47098 12.4713C6.21063 12.7317 5.78862 12.7317 5.52827 12.4713C5.26792 12.211 5.26792 11.789 5.52827 11.5286L9.05692 7.99999L5.52827 4.47134C5.26792 4.21099 5.26792 3.78899 5.52827 3.52864Z\"\n fill={theme === 'dark' ? '#F5F6F7' : '#080A0F'}\n className=\"transition-all duration-[0.4s]\"\n />\n </svg>\n </div>\n </a>\n )\n}\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(\n ({ data, className, classNames, as = 'h2', weight = 'bold', onButtonClick, ...rest }, ref) => {\n const {\n title,\n titleSize = 4,\n caption,\n subtitle,\n content,\n countdown,\n showCountdown = false,\n theme = 'light',\n extensions,\n align = 'left',\n } = data\n const innerRef = useRef<HTMLDivElement>(null)\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n\n // \u63A7\u5236\u5012\u8BA1\u65F6\u663E\u793A\u72B6\u6001\n const [isCountdownVisible, setIsCountdownVisible] = useState(true)\n\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n // \u5012\u8BA1\u65F6\u7ED3\u675F\u56DE\u8C03\n const handleCountdownEnd = () => {\n setIsCountdownVisible(false)\n }\n\n // CMS field mapping: new targetDateTime > legacy targetDate\n const countdownEndDate = countdown?.targetDateTime || countdown?.targetDate || ''\n const countdownTz = countdown?.targetDateTime_tz\n // Label mapping: plural keys (Title CMS format) \u2192 atomic Countdown format\n const countdownLabels = countdown?.labels\n ? {\n day: countdown.labels.days || 'Day',\n hour: countdown.labels.hours || 'Hours',\n minute: countdown.labels.minutes || 'Mins',\n second: countdown.labels.seconds || 'Secs',\n }\n : undefined\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n if (splitTextInstance.current) {\n splitTextInstance.current.revert()\n }\n if (scrollTriggerRef.current) {\n scrollTriggerRef.current.kill()\n }\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n invalidateOnRefresh: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length || 1\n const overlap = 0.5\n const interval = 1 / total\n const step = interval * (1 - overlap)\n const lastEnd = (total - 1) * step + interval\n const normalizedProgress = Math.min(1, lastEnd > 0 ? progress / lastEnd : 0)\n words.forEach((word: any, i: number) => {\n const start = i * step\n const width = interval\n let opacity = (normalizedProgress - start) / width\n opacity = Math.max(0, Math.min(1, opacity))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n\n if (inView) {\n gsapResize()\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 }\n }, [inView])\n\n return (\n <div\n {...rest}\n id={extensions?.id}\n className={cn(\n 'titleBottom title-box flex items-end justify-between gap-2 pb-6',\n className,\n classNames?.wrapper\n )}\n ref={innerRef}\n >\n <div\n ref={inViewRef}\n className={cn('flex-1', classNames?.container, {\n 'aiui-dark': theme === 'dark',\n 'text-center': align === 'center',\n 'text-left': align === 'left',\n })}\n >\n {(caption || title) && (\n <Heading\n ref={titleRef}\n as={as}\n size={titleSize as HeadingProps['size']}\n html={caption || title}\n weight={weight}\n className={cn(titleHeadingVariants({ theme }), classNames?.title)}\n />\n )}\n {subtitle && (\n <Text html={subtitle} as=\"p\" className={cn(subtitleVariants({ theme }), classNames?.subtitle)} />\n )}\n {hasVisibleContent(content) && (\n <Text\n html={content}\n as=\"div\"\n size={4}\n className={cn(\n 'title-content text-info-primary desktop:text-base desktop:mt-4 lg-desktop:text-[18px] mt-2 text-[14px] leading-[1.6]',\n classNames?.content\n )}\n />\n )}\n <TitleButton\n data={data}\n className={cn({ 'laptop:hidden': align === 'left' }, classNames?.button)}\n onClick={onButtonClick}\n />\n {showCountdown && countdown && isCountdownVisible && (\n <Countdown\n endDate={countdownEndDate}\n endDate_tz={countdownTz}\n timeLabels={countdownLabels}\n showDays={countdown?.showDays}\n showHours={countdown?.showHours}\n showMinutes={countdown?.showMinutes}\n showSeconds={countdown?.showSeconds}\n theme={theme}\n onExpire={handleCountdownEnd}\n hideWhenExpired={true}\n align={align === 'center' ? 'center' : 'left'}\n className={cn('mt-4', classNames?.countdown)}\n />\n )}\n </div>\n <TitleButton\n data={data}\n className={cn('hidden', { ['laptop:flex']: align === 'left' }, classNames?.button)}\n onClick={onButtonClick}\n />\n </div>\n )\n }\n)\n\nTitle.displayName = 'Title'\n\nexport default withLayout(Title)\n"],
|
|
5
|
-
"mappings": "olBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,
|
|
6
|
-
"names": ["Title_exports", "__export", "Title_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_SplitText", "import_ScrollTrigger", "
|
|
4
|
+
"sourcesContent": ["'use client'\nimport React, { useEffect, useRef, useImperativeHandle, useState } from 'react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn, extractLexicalText } from '../../helpers/index.js'\nimport { cva } from 'class-variance-authority'\nimport { Heading, Text, Countdown, type HeadingProps } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport type { TitlePropsBase } from './types.js'\n\nexport interface TitleProps extends TitlePropsBase, Omit<React.HTMLAttributes<HTMLDivElement>, 'className' | 'title'> {}\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { useInView } from 'react-intersection-observer'\n\nconst componentType = 'link'\nconst componentName = 'title'\n\n/**\n * \u5224\u65AD content \u5B57\u6BB5\u662F\u5426\u6709\u5B9E\u9645\u53EF\u89C1\u5185\u5BB9\u3002\n * - string\uFF1A\u53BB\u6389\u7A7A\u767D\u540E\u975E\u7A7A\u5373\u6709\u5185\u5BB9\n * - SerializedEditorState\uFF1A\u68C0\u67E5 root.children \u5185\u662F\u5426\u5B58\u5728\u975E\u7A7A\u6587\u672C\u8282\u70B9\uFF0C\n * \u907F\u514D convertLexicalToHTML \u628A\u7A7A\u6587\u6863\u8F93\u51FA\u4E3A <div class=\"payload-richtext\"></div>\n */\nfunction hasVisibleContent(content: string | { root?: { children?: unknown[] } } | null | undefined): boolean {\n if (!content) return false\n if (typeof content === 'string') return content.trim().length > 0\n const children = content?.root?.children\n if (!Array.isArray(children) || children.length === 0) return false\n return children.some((node: any) => {\n const nodeChildren = node?.children\n if (!Array.isArray(nodeChildren) || nodeChildren.length === 0) return false\n return nodeChildren.some((child: any) => typeof child?.text === 'string' && child.text.length > 0)\n })\n}\n\n/**\n * \u6807\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst titleHeadingVariants = cva('', {\n variants: {\n theme: {\n light: 'text-[#080A0F]',\n dark: 'text-[#F5F6F7]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n})\n\n/**\n * \u526F\u6807\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst subtitleVariants = cva(\n 'desktop:text-base desktop:mt-2 lg-desktop:text-[18px] mt-1 text-[14px] font-bold leading-[1.4] tracking-[-0.36px]',\n {\n variants: {\n theme: {\n light: 'text-[#080A0F]',\n dark: 'text-[#F5F6F7]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n }\n)\n\nconst TitleButton = ({\n data,\n onClick,\n className,\n}: {\n data: TitleProps['data']\n onClick?: () => void\n className?: string\n}) => {\n const { theme = 'light', extensions, title, caption, align } = data\n const { trackingData } = useAiuiContext()\n const contextHandle = trackingData?.contextHandle || ''\n if (!extensions?.textLink) return null\n\n const href = extensions?.link\n ? trackUrlRef(extensions.link, `${contextHandle}_${componentType}_${componentName}`)\n : undefined\n\n return (\n <a\n className={cn(\n { 'aiui-dark': theme === 'dark' },\n 'hover:text-brand-0 [&_svg_path]:hover:fill-brand-0 lg-desktop:text-base flex cursor-pointer items-center overflow-hidden text-sm font-[700] leading-[1.4] transition-all duration-[0.4s]',\n { 'text-[#080A0F]': theme === 'light' },\n { 'text-[#F5F6F7]': theme === 'dark' },\n { 'justify-center mt-4': align === 'center' },\n { 'mt-1 laptop:mt-0': align === 'left' },\n className\n )}\n {...(href ? { href } : {})}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${caption}`}\n {...(onClick ? { onClick } : {})}\n >\n <div className=\"truncate whitespace-nowrap\">{extensions?.textLink}</div>\n <div className=\"lg-desktop:size-5 size-4\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" height=\"100%\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n d=\"M5.52827 3.52864C5.78862 3.26829 6.21063 3.26829 6.47098 3.52864L10.471 7.52864C10.7313 7.78899 10.7313 8.21099 10.471 8.47134L6.47098 12.4713C6.21063 12.7317 5.78862 12.7317 5.52827 12.4713C5.26792 12.211 5.26792 11.789 5.52827 11.5286L9.05692 7.99999L5.52827 4.47134C5.26792 4.21099 5.26792 3.78899 5.52827 3.52864Z\"\n fill={theme === 'dark' ? '#F5F6F7' : '#080A0F'}\n className=\"transition-all duration-[0.4s]\"\n />\n </svg>\n </div>\n </a>\n )\n}\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(\n ({ data, className, classNames, as = 'h2', weight = 'bold', onButtonClick, ...rest }, ref) => {\n const {\n title,\n titleSize = 4,\n caption,\n subtitle,\n content,\n countdown,\n showCountdown = false,\n theme = 'light',\n extensions,\n align = 'left',\n } = data\n const innerRef = useRef<HTMLDivElement>(null)\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n\n // \u63A7\u5236\u5012\u8BA1\u65F6\u663E\u793A\u72B6\u6001\n const [isCountdownVisible, setIsCountdownVisible] = useState(true)\n\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n // \u66DD\u5149\u57CB\u70B9\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: extractLexicalText(caption) || extractLexicalText(title) || '',\n componentDescription: extractLexicalText(subtitle) || '',\n })\n\n // \u5012\u8BA1\u65F6\u7ED3\u675F\u56DE\u8C03\n const handleCountdownEnd = () => {\n setIsCountdownVisible(false)\n }\n\n // CMS field mapping: new targetDateTime > legacy targetDate\n const countdownEndDate = countdown?.targetDateTime || countdown?.targetDate || ''\n const countdownTz = countdown?.targetDateTime_tz\n // Label mapping: plural keys (Title CMS format) \u2192 atomic Countdown format\n const countdownLabels = countdown?.labels\n ? {\n day: countdown.labels.days || 'Day',\n hour: countdown.labels.hours || 'Hours',\n minute: countdown.labels.minutes || 'Mins',\n second: countdown.labels.seconds || 'Secs',\n }\n : undefined\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n if (splitTextInstance.current) {\n splitTextInstance.current.revert()\n }\n if (scrollTriggerRef.current) {\n scrollTriggerRef.current.kill()\n }\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n invalidateOnRefresh: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length || 1\n const overlap = 0.5\n const interval = 1 / total\n const step = interval * (1 - overlap)\n const lastEnd = (total - 1) * step + interval\n const normalizedProgress = Math.min(1, lastEnd > 0 ? progress / lastEnd : 0)\n words.forEach((word: any, i: number) => {\n const start = i * step\n const width = interval\n let opacity = (normalizedProgress - start) / width\n opacity = Math.max(0, Math.min(1, opacity))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n\n if (inView) {\n gsapResize()\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 }\n }, [inView])\n\n return (\n <div\n {...rest}\n id={extensions?.id}\n className={cn(\n 'titleBottom title-box flex items-end justify-between gap-2 pb-6',\n className,\n classNames?.wrapper\n )}\n ref={innerRef}\n >\n <div\n ref={inViewRef}\n className={cn('flex-1', classNames?.container, {\n 'aiui-dark': theme === 'dark',\n 'text-center': align === 'center',\n 'text-left': align === 'left',\n })}\n >\n {(caption || title) && (\n <Heading\n ref={titleRef}\n as={as}\n size={titleSize as HeadingProps['size']}\n html={caption || title}\n weight={weight}\n className={cn(titleHeadingVariants({ theme }), classNames?.title)}\n />\n )}\n {subtitle && (\n <Text html={subtitle} as=\"p\" className={cn(subtitleVariants({ theme }), classNames?.subtitle)} />\n )}\n {hasVisibleContent(content) && (\n <Text\n html={content}\n as=\"div\"\n size={4}\n className={cn(\n 'title-content text-info-primary desktop:text-base desktop:mt-4 lg-desktop:text-[18px] mt-2 text-[14px] leading-[1.6]',\n classNames?.content\n )}\n />\n )}\n <TitleButton\n data={data}\n className={cn({ 'laptop:hidden': align === 'left' }, classNames?.button)}\n onClick={onButtonClick}\n />\n {showCountdown && countdown && isCountdownVisible && (\n <Countdown\n endDate={countdownEndDate}\n endDate_tz={countdownTz}\n timeLabels={countdownLabels}\n showDays={countdown?.showDays}\n showHours={countdown?.showHours}\n showMinutes={countdown?.showMinutes}\n showSeconds={countdown?.showSeconds}\n theme={theme}\n onExpire={handleCountdownEnd}\n hideWhenExpired={true}\n align={align === 'center' ? 'center' : 'left'}\n className={cn('mt-4', classNames?.countdown)}\n />\n )}\n </div>\n <TitleButton\n data={data}\n className={cn('hidden', { ['laptop:flex']: align === 'left' }, classNames?.button)}\n onClick={onButtonClick}\n />\n </div>\n )\n }\n)\n\nTitle.displayName = 'Title'\n\nexport default withLayout(Title)\n"],
|
|
5
|
+
"mappings": "olBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IA0FI,IAAAI,EAAA,6BAzFJC,EAAwE,qBACxEC,EAAqB,gBACrBC,EAA0B,+BAC1BC,EAA8B,mCAC9BC,EAAuC,kCACvCC,EAAoB,oCACpBC,EAA4D,qCAC5DC,EAA2B,kCAC3BC,EAA4B,sCAI5BC,EAA4B,uCAC5BC,EAA+B,oCAC/BC,EAA0B,uCAE1B,MAAMC,EAAgB,OAChBC,EAAgB,QAQtB,SAASC,GAAkBC,EAAmF,CAC5G,GAAI,CAACA,EAAS,MAAO,GACrB,GAAI,OAAOA,GAAY,SAAU,OAAOA,EAAQ,KAAK,EAAE,OAAS,EAChE,MAAMC,EAAWD,GAAS,MAAM,SAChC,MAAI,CAAC,MAAM,QAAQC,CAAQ,GAAKA,EAAS,SAAW,EAAU,GACvDA,EAAS,KAAMC,GAAc,CAClC,MAAMC,EAAeD,GAAM,SAC3B,MAAI,CAAC,MAAM,QAAQC,CAAY,GAAKA,EAAa,SAAW,EAAU,GAC/DA,EAAa,KAAMC,GAAe,OAAOA,GAAO,MAAS,UAAYA,EAAM,KAAK,OAAS,CAAC,CACnG,CAAC,CACH,CAKA,MAAMC,MAAuB,OAAI,GAAI,CACnC,SAAU,CACR,MAAO,CACL,MAAO,iBACP,KAAM,gBACR,CACF,EACA,gBAAiB,CACf,MAAO,OACT,CACF,CAA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WD,EACjB,OAAQU,EACR,aAAW,MAAGlB,GAAqB,CAAE,MAAAM,CAAM,CAAC,EAAGU,GAAY,KAAK,EAClE,EAEDO,MACC,OAAC,QAAK,KAAMA,EAAU,GAAG,IAAI,aAAW,MAAGtB,GAAiB,CAAE,MAAAK,CAAM,CAAC,EAAGU,GAAY,QAAQ,EAAG,EAEhGtB,GAAkBC,CAAO,MACxB,OAAC,QACC,KAAMA,EACN,GAAG,MACH,KAAM,EACN,aAAW,MACT,uHACAqB,GAAY,OACd,EACF,KAEF,OAACd,EAAA,CACC,KAAMC,EACN,aAAW,MAAG,CAAE,gBAAiBO,IAAU,MAAO,EAAGM,GAAY,MAAM,EACvE,QAASG,EACX,EACCM,GAAiBD,GAAaM,MAC7B,OAAC,aACC,QAASK,EACT,WAAYC,EACZ,WAAYC,GACZ,SAAUb,GAAW,SACrB,UAAWA,GAAW,UACtB,YAAaA,GAAW,YACxB,YAAaA,GAAW,YACxB,MAAOlB,EACP,SAAU4B,EACV,gBAAiB,GACjB,MAAOxB,IAAU,SAAW,SAAW,OACvC,aAAW,MAAG,OAAQM,GAAY,SAAS,EAC7C,GAEJ,KACA,OAACd,EAAA,CACC,KAAMC,EACN,aAAW,MAAG,SAAU,CAAG,cAAgBO,IAAU,MAAO,EAAGM,GAAY,MAAM,EACjF,QAASG,EACX,GACF,CAEJ,CACF,EAEAL,EAAM,YAAc,QAEpB,IAAOrC,MAAQ,cAAWqC,CAAK",
|
|
6
|
+
"names": ["Title_exports", "__export", "Title_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_SplitText", "import_ScrollTrigger", "import_helpers", "import_class_variance_authority", "import_components", "import_Styles", "import_useExposure", "import_trackUrlRef", "import_AiuiProvider", "import_react_intersection_observer", "componentType", "componentName", "hasVisibleContent", "content", "children", "node", "nodeChildren", "child", "titleHeadingVariants", "subtitleVariants", "TitleButton", "data", "onClick", "className", "theme", "extensions", "title", "caption", "align", "trackingData", "contextHandle", "href", "Title", "React", "classNames", "as", "weight", "onButtonClick", "rest", "ref", "titleSize", "subtitle", "countdown", "showCountdown", "innerRef", "titleRef", "splitTextInstance", "scrollTriggerRef", "isCountdownVisible", "setIsCountdownVisible", "inViewRef", "inView", "handleCountdownEnd", "countdownEndDate", "countdownTz", "countdownLabels", "gsapResize", "height", "words", "self", "progress", "total", "overlap", "interval", "step", "lastEnd", "normalizedProgress", "word", "i", "start", "width", "opacity"]
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { VideoFeatureProps } from './types.js';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<VideoFeatureProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<VideoFeatureProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../index.js").ContainerProps & React.RefAttributes<unknown>> & {
|
|
4
4
|
readonly $$typeof: symbol;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
@@ -3,6 +3,7 @@ export interface VideoModalType extends Omit<React.HTMLAttributes<HTMLDivElement
|
|
|
3
3
|
youTubeId?: string;
|
|
4
4
|
videoUrl?: string;
|
|
5
5
|
onCloseModal: () => void;
|
|
6
|
+
videoClassName?: string;
|
|
6
7
|
}
|
|
7
8
|
declare const VideoModal: (props: VideoModalType) => import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export { VideoModal };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var r=Object.defineProperty;var
|
|
1
|
+
"use strict";var r=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var g=(e,o)=>{for(var a in o)r(e,a,{get:o[a],enumerable:!0})},h=(e,o,a,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of v(o))!b.call(e,i)&&i!==a&&r(e,i,{get:()=>o[i],enumerable:!(l=m(o,i))||l.enumerable});return e};var w=e=>h(r({},"__esModule",{value:!0}),e);var C={};g(C,{VideoModal:()=>p});module.exports=w(C);var t=require("react/jsx-runtime"),n=require("../../components/dialog.js"),d=require("../VideoModal/YouTubePlayer.js"),s=require("../../helpers/index.js");const p=e=>{const{visible:o,youTubeId:a,videoUrl:l,onCloseModal:i,className:u,videoClassName:c}=e;return(0,t.jsx)(n.Dialog,{open:o,onOpenChange:()=>i(),children:(0,t.jsxs)(n.DialogContent,{className:(0,s.cn)("max-h-3/4 h-3/4 w-4/5 max-w-[1200px] border-none bg-transparent p-0 [&_button]:hidden",u),children:[a?(0,t.jsx)(d.YouTubePlayer,{youTubeId:a}):l?(0,t.jsx)("video",{className:(0,s.cn)("size-full overflow-hidden rounded-2xl object-contain",c),src:l,muted:!0,loop:!0,autoPlay:!0,controls:!0}):null,(0,t.jsx)("div",{onClick:()=>i(),className:"tablet:size-8 tablet:-right-8 tablet:-top-8 absolute -right-6 -top-6 size-6 cursor-pointer overflow-hidden text-white",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon",className:"HomeCharger_closeWrap__Z7aBo",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})})]})})};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/VideoModal/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Dialog, DialogContent } from '../../components/dialog.js'\nimport { YouTubePlayer } from '../VideoModal/YouTubePlayer.js'\n\nexport interface VideoModalType extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n visible: boolean\n youTubeId?: string\n videoUrl?: string\n onCloseModal: () => void\n}\n\nconst VideoModal = (props: VideoModalType) => {\n const { visible, youTubeId, videoUrl, onCloseModal, className,
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,IAAA,eAAAC,EAAAH,
|
|
6
|
-
"names": ["VideoModal_exports", "__export", "VideoModal", "__toCommonJS", "import_jsx_runtime", "import_dialog", "import_YouTubePlayer", "props", "visible", "youTubeId", "videoUrl", "onCloseModal", "className", "
|
|
4
|
+
"sourcesContent": ["import { Dialog, DialogContent } from '../../components/dialog.js'\nimport { YouTubePlayer } from '../VideoModal/YouTubePlayer.js'\nimport { cn } from '../../helpers/index.js'\n\nexport interface VideoModalType extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n visible: boolean\n youTubeId?: string\n videoUrl?: string\n onCloseModal: () => void\n videoClassName?: string\n}\n\nconst VideoModal = (props: VideoModalType) => {\n const { visible, youTubeId, videoUrl, onCloseModal, className, videoClassName } = props\n\n return (\n <Dialog open={visible} onOpenChange={() => onCloseModal()}>\n <DialogContent\n className={cn(\n 'max-h-3/4 h-3/4 w-4/5 max-w-[1200px] border-none bg-transparent p-0 [&_button]:hidden',\n className\n )}\n >\n {youTubeId ? (\n <YouTubePlayer youTubeId={youTubeId} />\n ) : videoUrl ? (\n <video\n className={cn('size-full overflow-hidden rounded-2xl object-contain', videoClassName)}\n src={videoUrl}\n muted\n loop\n autoPlay\n controls\n />\n ) : null}\n <div\n onClick={() => onCloseModal()}\n className=\"tablet:size-8 tablet:-right-8 tablet:-top-8 absolute -right-6 -top-6 size-6 cursor-pointer overflow-hidden text-white\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n className=\"HomeCharger_closeWrap__Z7aBo\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18 18 6M6 6l12 12\"></path>\n </svg>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport { VideoModal }\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,IAAA,eAAAC,EAAAH,GAiBM,IAAAI,EAAA,6BAjBNC,EAAsC,sCACtCC,EAA8B,0CAC9BC,EAAmB,kCAUnB,MAAML,EAAcM,GAA0B,CAC5C,KAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,SAAAC,EAAU,aAAAC,EAAc,UAAAC,EAAW,eAAAC,CAAe,EAAIN,EAElF,SACE,OAAC,UAAO,KAAMC,EAAS,aAAc,IAAMG,EAAa,EACtD,oBAAC,iBACC,aAAW,MACT,wFACAC,CACF,EAEC,UAAAH,KACC,OAAC,iBAAc,UAAWA,EAAW,EACnCC,KACF,OAAC,SACC,aAAW,MAAG,uDAAwDG,CAAc,EACpF,IAAKH,EACL,MAAK,GACL,KAAI,GACJ,SAAQ,GACR,SAAQ,GACV,EACE,QACJ,OAAC,OACC,QAAS,IAAMC,EAAa,EAC5B,UAAU,wHAEV,mBAAC,OACC,MAAM,6BACN,KAAK,OACL,QAAQ,YACR,YAAY,MACZ,OAAO,eACP,cAAY,OACZ,YAAU,OACV,UAAU,+BAEV,mBAAC,QAAK,cAAc,QAAQ,eAAe,QAAQ,EAAE,uBAAuB,EAC9E,EACF,GACF,EACF,CAEJ",
|
|
6
|
+
"names": ["VideoModal_exports", "__export", "VideoModal", "__toCommonJS", "import_jsx_runtime", "import_dialog", "import_YouTubePlayer", "import_helpers", "props", "visible", "youTubeId", "videoUrl", "onCloseModal", "className", "videoClassName"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var D=Object.defineProperty;var dt=Object.getOwnPropertyDescriptor;var ct=Object.getOwnPropertyNames;var mt=Object.prototype.hasOwnProperty;var ft=(n,
|
|
1
|
+
"use strict";"use client";var D=Object.defineProperty;var dt=Object.getOwnPropertyDescriptor;var ct=Object.getOwnPropertyNames;var mt=Object.prototype.hasOwnProperty;var ft=(n,r)=>{for(var p in r)D(n,p,{get:r[p],enumerable:!0})},ut=(n,r,p,w)=>{if(r&&typeof r=="object"||typeof r=="function")for(let f of ct(r))!mt.call(n,f)&&f!==p&&D(n,f,{get:()=>r[f],enumerable:!(w=dt(r,f))||w.enumerable});return n};var xt=n=>ut(D({},"__esModule",{value:!0}),n);var wt={};ft(wt,{BaseModal:()=>ce.BaseModal,ErrorModal:()=>pe.ErrorModal,MyRewardsModal:()=>le.MyRewardsModal,RulesModal:()=>ae.RulesModal,ShareModal:()=>de.ShareModal,WheelLottery:()=>B,WinnerModal:()=>ie.WinnerModal,default:()=>ht});module.exports=xt(wt);var t=require("react/jsx-runtime"),e=require("react"),u=require("../../helpers/index.js"),x=require("./types.js"),N=require("../../components/grid.js"),Z=require("./Wheel.js"),q=require("../LotteryShared/PrizePool.js"),ee=require("../LotteryShared/ChanceMethods.js"),te=require("../LotteryShared/WinnerModal.js"),oe=require("../LotteryShared/RulesModal.js"),re=require("../LotteryShared/MyRewardsModal.js"),F=require("../LotteryShared/ErrorModal.js"),ne=require("../LotteryShared/ShareModal.js"),se=require("../../shared/Styles.js"),ie=require("../LotteryShared/WinnerModal.js"),ae=require("../LotteryShared/RulesModal.js"),le=require("../LotteryShared/MyRewardsModal.js"),pe=require("../LotteryShared/ErrorModal.js"),de=require("../LotteryShared/ShareModal.js"),ce=require("../LotteryShared/BaseModal.js");const B=(0,e.forwardRef)(({prizes:n,theme:r,winningPrizeId:p,spinDuration:w=x.DEFAULT_WHEEL_CONFIG.spinDuration,wheelBackgroundImage:f,pointerImage:me,chanceMethods:U=x.DEFAULT_CHANCE_METHODS,chanceTitle:fe=x.DEFAULT_WHEEL_CONFIG.chanceTitle,chanceSubtitle:ue,chanceFooterNote:xe,chanceMethodsText:v,mechanismType:he,inputConfig:we,winningInfos:ge=[],winnerNameTemplate:ye,prizesTitle:Te,onSpinStart:I,onSpinEnd:L,onSpinError:O,winnerModalConfig:s,rulesModalConfig:be={},myRewardsModalConfig:Se={},errorModalConfig:h={},shareModalConfig:g={},userData:d,onLoginRequired:C,onCopyCode:We,opportunitiesText:j=["Number of draws remaining today:"],className:Me},Pe)=>{const{rulesData:y,rulesText:G="Rules"}=be,{rewardsData:A,myRewardsText:H="My Rewards",codeText:ze="CODE:",copyText:_="COPY",copiedText:K="COPIED",prizeText:Ee="Prize time:",emptyText:Ne,copyError:ve,availableText:Ce,usedStatusText:Re,expiredText:Ie,notFoundText:Le}=Se,Ae=v?.completedText,ke=v?.usedText,T=d?.isLoggedIn??!1,$=d?.availableChances??0,De=T&&$<=0,[i,c]=(0,e.useState)(x.INITIAL_WHEEL_STATE),[Fe,b]=(0,e.useState)(!1),[Be,S]=(0,e.useState)(!1),[Ue,W]=(0,e.useState)(!1),[Oe,M]=(0,e.useState)(!1),[je,P]=(0,e.useState)(!1),[Ge,z]=(0,e.useState)(!1),[He,V]=(0,e.useState)(""),[_e,Ke]=(0,e.useState)(),[$e,Ve]=(0,e.useState)(),[Ye,Je]=(0,e.useState)(),[Qe,Xe]=(0,e.useState)(),[Ze,qe]=(0,e.useState)(),[a,et]=(0,e.useState)(),R=(0,e.useRef)(null);(0,e.useImperativeHandle)(Pe,()=>({showError:({message:o,title:l,confirmText:E})=>{V(o),Ke(l),Ve(E),M(!0)},hideError:()=>{M(!1)},showNoWin:o=>{Je(o?.title),Xe(o?.message),qe(o?.confirmText),P(!0)},hideNoWin:()=>{P(!1)},showWinner:(o,l)=>{c(E=>({...E,winningPrize:o})),et(l),b(!0)},hideWinner:()=>{b(!1)},showRules:()=>{S(!0)},hideRules:()=>{S(!1)},showRewards:()=>{W(!0)},hideRewards:()=>{W(!1)},showShare:()=>{z(!0)},hideShare:()=>{z(!1)},hideAllModals:()=>{b(!1),S(!1),W(!1),M(!1),P(!1),z(!1)}}),[]),(0,e.useEffect)(()=>{},[n,p]),(0,e.useEffect)(()=>()=>{R.current!==null&&cancelAnimationFrame(R.current)},[]);const Y=(0,e.useCallback)(async()=>{if(!i.isSpinning){if(!d?.isLoggedIn){C?.();return}if(!(d.availableChances<=0)){c(o=>({...o,isSpinning:!0,isButtonDisabled:!0}));try{let o=p;I&&(o=await I());const l=n.find(m=>m.prizeKey===o)||n[0],E=n.findIndex(m=>m.prizeKey===l.prizeKey),nt=360/n.length,st=E*nt,J=3*360+(360-st);await new Promise(m=>setTimeout(m,1500)),c(m=>({...m,isFinished:!0,currentRotation:0}));const it=Date.now(),Q=()=>{const at=Date.now()-it,X=Math.min(at/w,1),lt=1-Math.pow(1-X,3),pt=J*lt;c(k=>({...k,currentRotation:pt})),X<1?R.current=requestAnimationFrame(Q):(c(k=>({...k,isSpinning:!1,isButtonDisabled:!0,winningPrize:l,currentRotation:J})),L?L?.(l):setTimeout(()=>{l.prizeKey==="try-again"?P(!0):b(!0)},500))};R.current=requestAnimationFrame(Q)}catch(o){c(l=>({...l,isSpinning:!1,isButtonDisabled:!1})),V(o.message||"An error occurred"),M(!0),O?.(o),console.error("\u62BD\u5956\u63A5\u53E3\u8C03\u7528\u5931\u8D25:",o)}}}},[i.isSpinning,n,p,w,I,L,O,d,C]),tt=(0,e.useCallback)(()=>{if(T){Y();return}C?.()},[Y,T,C]),ot=(0,e.useCallback)(()=>{b(!1),c(o=>({...o,isButtonDisabled:!1,isFinished:!1}))},[]),rt=(0,e.useCallback)(()=>{P(!1),c(o=>({...o,isButtonDisabled:!1,isFinished:!1}))},[]);return(0,t.jsxs)("div",{className:(0,u.cn)("wheel-lottery-container","w-full",r==="dark"?"aiui-dark":"",Me),children:[(0,t.jsxs)("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:[i.isSpinning&&"\u62BD\u5956\u8FDB\u884C\u4E2D...",i.winningPrize&&!i.isSpinning&&`\u5DF2\u4E2D\u5956: ${i.winningPrize.name}`]}),(0,t.jsxs)(N.Grid,{className:(0,u.cn)("wheel-lottery-main","tablet:mb-4 mb-3"),children:[(0,t.jsx)(N.GridItem,{span:7,className:(0,u.cn)("wheel-section","relative flex w-full flex-1 items-center justify-center overflow-hidden","rounded-box","laptop:min-h-[288px] min-h-[240px]","lg-desktop:aspect-w-[964] lg-desktop:aspect-h-[480]","desktop:aspect-w-[759] desktop:aspect-h-[384]","laptop:aspect-w-[516] laptop:aspect-h-[288]","l-tablet:col-span-12","l-tablet:mb-3",r==="dark"?"bg-[#1E2024]":"bg-[#EAEAEC]"),children:(0,t.jsxs)("div",{className:(0,u.cn)("w-full px-[16px] pt-[16px]","lg-desktop:pb-[32px] lg-desktop:px-[32px]","desktop:pt-[24px] desktop:px-[24px]","laptop:pt-[16px] laptop:px-[16px]","tablet:px-[24px]","l-tablet:absolute l-tablet:top-0 l-tablet:inset-x-0 l-tablet:z-10"),children:[(0,t.jsxs)("div",{className:"tablet:max-h-[24px] relative z-10 mb-2 flex max-h-[40px] w-full flex-wrap items-center justify-between gap-3",children:[(0,t.jsx)("div",{children:T&&(0,t.jsxs)("p",{className:"text-info-primary font-[700]",children:[j?.[0],(0,t.jsx)("span",{className:"ml-1 text-[#FF6B35]",children:$}),j?.[1]||""]})}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[y&&y.length>0&&(0,t.jsx)("button",{onClick:o=>{o.stopPropagation(),S(!0)},className:"cursor-pointer touch-manipulation",type:"button",children:(0,t.jsx)("span",{className:"text-info-primary font-[700] underline",children:G})}),d?.isLoggedIn&&A&&(0,t.jsx)("button",{onClick:o=>{o.stopPropagation(),W(!0)},className:"cursor-pointer touch-manipulation whitespace-nowrap",type:"button",children:(0,t.jsx)("span",{className:"text-info-primary font-[700] underline",children:H})})]})]}),(0,t.jsx)(Z.Wheel,{theme:r,prizes:n,rotation:i.currentRotation,isSpinning:i.isSpinning,isFinished:i.isFinished,isButtonDisabled:i.isButtonDisabled||!T||De,userData:d,onGoClick:tt,wheelBackgroundImage:f,pointerImage:me})]})}),U.length>0&&(0,t.jsx)(N.GridItem,{span:5,className:(0,u.cn)("info-section","rounded-box","relative flex flex-col overflow-hidden","lg-desktop:aspect-w-[684] lg-desktop:aspect-h-[480]","desktop:aspect-w-[536] desktop:aspect-h-[384]","laptop:aspect-w-[364] laptop:aspect-h-[288]","l-tablet:min-h-[280px] laptop:max-h-[320px]","w-full","l-tablet:col-span-12",r==="dark"?"bg-[#1E2024]":"bg-[#EAEAEC]"),children:(0,t.jsx)(ee.ChanceMethods,{theme:r,userData:d,methods:U,title:fe,subtitle:ue,footerNote:xe,onOpenShareModal:()=>z(!0),chanceBadgeText:v?.chanceBadgeText,completedText:Ae,usedText:ke,loadingText:v?.loadingText,mechanismType:he,inputConfig:we})})]}),(0,t.jsx)("div",{className:(0,u.cn)("wheel-lottery-footer","rounded-box","flex flex-col overflow-hidden",r==="dark"?"bg-[#1E2024]":"bg-[#EAEAEC]"),children:(0,t.jsx)(q.PrizePool,{theme:r,prizes:n,title:Te,winningInfos:ge,winnerNameTemplate:ye})}),(0,t.jsx)(te.WinnerModal,{isOpen:Fe,prize:i.winningPrize,title:a?.title||s?.title,prizeTitle:a?.prizeTitle||s?.prizeTitle,prizeImage:a?.prizeImage||s?.prizeImage,prizeDescription:a?.prizeDescription||s?.prizeDescription,winnerNote:a?.winnerNote??i.winningPrize?.winnerModalConfig?.winnerNote??s?.winnerNote,learnMoreUrl:a?.learnMoreUrl||i.winningPrize?.winnerModalConfig?.learnMoreUrl||s?.learnMoreUrl,learnMoreText:a?.learnMoreText||i.winningPrize?.winnerModalConfig?.learnMoreText||s?.learnMoreText,couponCode:a?.couponCode||s?.couponCode,expiresAt:a?.expiresAt||s?.expiresAt,expiresAtLabel:a?.expiresAtLabel||s?.expiresAtLabel,couponDiscount:a?.couponDiscount||s?.couponDiscount,couponUnit:a?.couponUnit||s?.couponUnit,confirmText:a?.confirmText||i.winningPrize?.winnerModalConfig?.confirmText||s?.confirmText,confirmUrl:a?.confirmUrl||i.winningPrize?.winnerModalConfig?.confirmUrl||s?.confirmUrl,copyText:a?.copyText||s?.copyText||_,copiedText:a?.copiedText||s?.copiedText||K,onClose:ot,theme:r}),y&&y.length>0&&(0,t.jsx)(oe.RulesModal,{title:G,isOpen:Be,onClose:()=>S(!1),rules:y,theme:r}),A&&(0,t.jsx)(re.MyRewardsModal,{isOpen:Ue,onClose:()=>W(!1),rewards:A,onCopyCode:We,codeText:ze,copyText:_,copiedText:K,prizeText:Ee,emptyText:Ne,copyError:ve,availableText:Ce,usedStatusText:Re,expiredText:Ie,notFoundText:Le,theme:r,title:H}),(0,t.jsx)(F.ErrorModal,{isOpen:Oe,onClose:()=>M(!1),title:_e||h?.title,message:He||h?.message,confirmText:$e||h?.confirmText,theme:r}),(0,t.jsx)(F.ErrorModal,{isOpen:je,onClose:rt,title:Ye||h?.title,message:Qe||h?.message,confirmText:Ze||h?.confirmText,theme:r}),(0,t.jsx)(ne.ShareModal,{isOpen:Ge,onClose:()=>z(!1),title:g?.title,subtitle:g?.subtitle,note:g?.note,platforms:g?.platforms,onShareSuccess:g?.onShareSuccess,theme:r})]})});B.displayName="WheelLottery";var ht=(0,se.withLayout)(B);
|
|
2
2
|
//# sourceMappingURL=index.js.map
|