@anker-in/headless-ui 1.1.81 → 1.1.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/biz-components/AccordionCards/index.d.ts +1 -36
- package/dist/cjs/biz-components/ActivitySchedule/index.d.ts +1 -3
- package/dist/cjs/biz-components/AiuiProvider/index.d.ts +1 -13
- package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
- package/dist/cjs/biz-components/AiuiProvider/index.js.map +3 -3
- package/dist/cjs/biz-components/AnchorNavigation/index.d.ts +1 -1
- package/dist/cjs/biz-components/AplusDesc/index.d.ts +1 -17
- package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.d.ts +1 -2
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.d.ts +1 -2
- package/dist/cjs/biz-components/Category/index.d.ts +1 -1
- package/dist/cjs/biz-components/CreativeModule/index.d.ts +1 -7
- package/dist/cjs/biz-components/DownLoad/index.d.ts +1 -6
- package/dist/cjs/biz-components/Evaluate/index.d.ts +1 -1
- package/dist/cjs/biz-components/Faq/Faq.d.ts +2 -3
- package/dist/cjs/biz-components/FeatureCards/FeatureCards.d.ts +1 -3
- package/dist/cjs/biz-components/FeatureShowcase/FeatureShowcase.d.ts +1 -3
- package/dist/cjs/biz-components/Features/index.d.ts +1 -8
- package/dist/cjs/biz-components/FootCharger/index.d.ts +1 -7
- package/dist/cjs/biz-components/FooterNavigation/index.d.ts +1 -2
- package/dist/cjs/biz-components/GiftBox/index.d.ts +1 -3
- package/dist/cjs/biz-components/GiftShelf/index.d.ts +1 -3
- package/dist/cjs/biz-components/GiftTierShelf/index.d.ts +1 -3
- package/dist/cjs/biz-components/Graphic/index.d.ts +1 -1
- package/dist/cjs/biz-components/GraphicAttractionBlock/index.d.ts +1 -1
- package/dist/cjs/biz-components/GraphicMore/index.d.ts +1 -7
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.d.ts +2 -10
- package/dist/cjs/biz-components/HeaderNavigation/index.d.ts +1 -3
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.d.ts +1 -5
- package/dist/cjs/biz-components/ImageTextFeature/ImageTextFeature.d.ts +1 -3
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.d.ts +1 -3
- package/dist/cjs/biz-components/Ksp/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/PaidShipping/index.d.ts +1 -11
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +1 -26
- 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 -11
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.d.ts +1 -2
- package/dist/cjs/biz-components/Marquee/Marquee.d.ts +2 -3
- package/dist/cjs/biz-components/MarqueeReview/index.d.ts +1 -1
- package/dist/cjs/biz-components/MediaEndorsement/index.d.ts +1 -2
- package/dist/cjs/biz-components/MediaPlayerBase/index.d.ts +1 -2
- package/dist/cjs/biz-components/MediaPlayerBase/index.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerBase/index.js.map +2 -2
- package/dist/cjs/biz-components/MediaPlayerMulti/index.d.ts +1 -2
- package/dist/cjs/biz-components/MediaPlayerSticky/index.d.ts +1 -5
- package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.d.ts +1 -2
- package/dist/cjs/biz-components/MediaSceneSwitcherV2/index.d.ts +1 -1
- package/dist/cjs/biz-components/MemberEquity/index.d.ts +1 -3
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +2 -17
- package/dist/cjs/biz-components/NavigationSearch/index.d.ts +1 -2
- package/dist/cjs/biz-components/ProductCompare/index.d.ts +1 -1
- package/dist/cjs/biz-components/ProductHero/ProductHero.d.ts +1 -3
- package/dist/cjs/biz-components/ProductNav/ProductNav.d.ts +1 -2
- package/dist/cjs/biz-components/PromotionalBar/index.d.ts +1 -1
- package/dist/cjs/biz-components/SecondaryBanner/index.d.ts +1 -1
- package/dist/cjs/biz-components/SelectStore/index.d.ts +1 -7
- package/dist/cjs/biz-components/ShelfDisplay/index.d.ts +1 -3
- package/dist/cjs/biz-components/Slogan/index.d.ts +1 -3
- package/dist/cjs/biz-components/Spacer/index.d.ts +1 -3
- package/dist/cjs/biz-components/Specs/index.d.ts +1 -1
- package/dist/cjs/biz-components/SpecsComparison/SpecsComparison.d.ts +1 -3
- package/dist/cjs/biz-components/TabWithImage/TabWithImage.d.ts +1 -3
- package/dist/cjs/biz-components/Tabs/Tabs.d.ts +1 -3
- package/dist/cjs/biz-components/TabsGroup/index.d.ts +1 -3
- package/dist/cjs/biz-components/TabsWithMedia/TabsWithMedia.d.ts +1 -3
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.d.ts +1 -3
- package/dist/cjs/biz-components/Title/index.d.ts +1 -1
- package/dist/cjs/biz-components/VideoFeature/VideoFeature.d.ts +1 -3
- package/dist/cjs/biz-components/WheelLottery/index.d.ts +1 -1
- package/dist/cjs/biz-components/WhyChoose/WhyChoose.d.ts +2 -3
- package/dist/cjs/helpers/ScrollLoadVideo.js +1 -1
- package/dist/cjs/helpers/ScrollLoadVideo.js.map +2 -2
- package/dist/cjs/shared/Styles.d.ts +1 -2
- package/dist/cjs/shared/Styles.js +1 -1
- package/dist/cjs/shared/Styles.js.map +2 -2
- package/dist/esm/biz-components/AccordionCards/index.d.ts +1 -36
- package/dist/esm/biz-components/ActivitySchedule/index.d.ts +1 -3
- package/dist/esm/biz-components/AiuiProvider/index.d.ts +1 -13
- package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
- package/dist/esm/biz-components/AiuiProvider/index.js.map +3 -3
- package/dist/esm/biz-components/AnchorNavigation/index.d.ts +1 -1
- package/dist/esm/biz-components/AplusDesc/index.d.ts +1 -17
- package/dist/esm/biz-components/BrandCardLink/BrandCardLink.d.ts +1 -2
- package/dist/esm/biz-components/BrandEquity/BrandEquity.d.ts +1 -2
- package/dist/esm/biz-components/Category/index.d.ts +1 -1
- package/dist/esm/biz-components/CreativeModule/index.d.ts +1 -7
- package/dist/esm/biz-components/DownLoad/index.d.ts +1 -6
- package/dist/esm/biz-components/Evaluate/index.d.ts +1 -1
- package/dist/esm/biz-components/Faq/Faq.d.ts +2 -3
- package/dist/esm/biz-components/FeatureCards/FeatureCards.d.ts +1 -3
- package/dist/esm/biz-components/FeatureShowcase/FeatureShowcase.d.ts +1 -3
- package/dist/esm/biz-components/Features/index.d.ts +1 -8
- package/dist/esm/biz-components/FootCharger/index.d.ts +1 -7
- package/dist/esm/biz-components/FooterNavigation/index.d.ts +1 -2
- package/dist/esm/biz-components/GiftBox/index.d.ts +1 -3
- package/dist/esm/biz-components/GiftShelf/index.d.ts +1 -3
- package/dist/esm/biz-components/GiftTierShelf/index.d.ts +1 -3
- package/dist/esm/biz-components/Graphic/index.d.ts +1 -1
- package/dist/esm/biz-components/GraphicAttractionBlock/index.d.ts +1 -1
- package/dist/esm/biz-components/GraphicMore/index.d.ts +1 -7
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.d.ts +2 -10
- package/dist/esm/biz-components/HeaderNavigation/index.d.ts +1 -3
- package/dist/esm/biz-components/HeroBanner/HeroBanner.d.ts +1 -5
- package/dist/esm/biz-components/ImageTextFeature/ImageTextFeature.d.ts +1 -3
- package/dist/esm/biz-components/ImageWithText/ImageWithText.d.ts +1 -3
- package/dist/esm/biz-components/Ksp/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/PaidShipping/index.d.ts +1 -11
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +1 -26
- 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 -11
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.d.ts +1 -2
- package/dist/esm/biz-components/Marquee/Marquee.d.ts +2 -3
- package/dist/esm/biz-components/MarqueeReview/index.d.ts +1 -1
- package/dist/esm/biz-components/MediaEndorsement/index.d.ts +1 -2
- package/dist/esm/biz-components/MediaPlayerBase/index.d.ts +1 -2
- package/dist/esm/biz-components/MediaPlayerBase/index.js +1 -1
- package/dist/esm/biz-components/MediaPlayerBase/index.js.map +2 -2
- package/dist/esm/biz-components/MediaPlayerMulti/index.d.ts +1 -2
- package/dist/esm/biz-components/MediaPlayerSticky/index.d.ts +1 -5
- package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.d.ts +1 -2
- package/dist/esm/biz-components/MediaSceneSwitcherV2/index.d.ts +1 -1
- package/dist/esm/biz-components/MemberEquity/index.d.ts +1 -3
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +2 -17
- package/dist/esm/biz-components/NavigationSearch/index.d.ts +1 -2
- package/dist/esm/biz-components/ProductCompare/index.d.ts +1 -1
- package/dist/esm/biz-components/ProductHero/ProductHero.d.ts +1 -3
- package/dist/esm/biz-components/ProductNav/ProductNav.d.ts +1 -2
- package/dist/esm/biz-components/PromotionalBar/index.d.ts +1 -1
- package/dist/esm/biz-components/SecondaryBanner/index.d.ts +1 -1
- package/dist/esm/biz-components/SelectStore/index.d.ts +1 -7
- package/dist/esm/biz-components/ShelfDisplay/index.d.ts +1 -3
- package/dist/esm/biz-components/Slogan/index.d.ts +1 -3
- package/dist/esm/biz-components/Spacer/index.d.ts +1 -3
- package/dist/esm/biz-components/Specs/index.d.ts +1 -1
- package/dist/esm/biz-components/SpecsComparison/SpecsComparison.d.ts +1 -3
- package/dist/esm/biz-components/TabWithImage/TabWithImage.d.ts +1 -3
- package/dist/esm/biz-components/Tabs/Tabs.d.ts +1 -3
- package/dist/esm/biz-components/TabsGroup/index.d.ts +1 -3
- package/dist/esm/biz-components/TabsWithMedia/TabsWithMedia.d.ts +1 -3
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.d.ts +1 -3
- package/dist/esm/biz-components/Title/index.d.ts +1 -1
- package/dist/esm/biz-components/VideoFeature/VideoFeature.d.ts +1 -3
- package/dist/esm/biz-components/WheelLottery/index.d.ts +1 -1
- package/dist/esm/biz-components/WhyChoose/WhyChoose.d.ts +2 -3
- package/dist/esm/helpers/ScrollLoadVideo.js +1 -1
- package/dist/esm/helpers/ScrollLoadVideo.js.map +2 -2
- package/dist/esm/shared/Styles.d.ts +1 -2
- package/dist/esm/shared/Styles.js +1 -1
- package/dist/esm/shared/Styles.js.map +2 -2
- package/package.json +1 -1
- package/dist/cjs/biz-components/AiuiProvider/useAutoTracking.d.ts +0 -17
- package/dist/cjs/biz-components/AiuiProvider/useAutoTracking.js +0 -2
- package/dist/cjs/biz-components/AiuiProvider/useAutoTracking.js.map +0 -7
- package/dist/esm/biz-components/AiuiProvider/useAutoTracking.d.ts +0 -17
- package/dist/esm/biz-components/AiuiProvider/useAutoTracking.js +0 -2
- package/dist/esm/biz-components/AiuiProvider/useAutoTracking.js.map +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/MediaPlayerBase/index.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport { useState, useRef, useMemo, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport { debounce } from 'lodash'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport Button from '../../components/button.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\nimport type { MediaPlayerBaseProps } from './types.js'\n// import { Right } from './right.js'\nimport { useInView } from 'react-intersection-observer'\nimport type { HTMLConvertersFunction } from '@payloadcms/richtext-lexical/html'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport ScrollLoadVideo from '../../helpers/ScrollLoadVideo.js'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\n\nconst componentName = 'media_player_base'\nconst componentType = 'video'\n\n// \u6CE8\u518C gsap \u63D2\u4EF6\ngsap.registerPlugin(ScrollTrigger, SplitText)\n\nconst htmlConverters: HTMLConvertersFunction = ({ defaultConverters }) => ({\n ...defaultConverters,\n text: args => {\n const { node } = args\n // \u68C0\u67E5\u662F\u5426\u6709\u81EA\u5B9A\u4E49 color\n if (node.$ && node.$.color) {\n return `<span class=\"lexical-${node.$.color}\">${node.text}</span>`\n }\n return node.text\n },\n})\n\nconst MediaPlayerBase = forwardRef<HTMLDivElement, MediaPlayerBaseProps>(\n (\n {\n className = '',\n id,\n onBtnClick,\n data: {\n title,\n videoTitle,\n btnText,\n youtubeId,\n video,\n mobileVideo,\n theme,\n img,\n shape,\n titleAnimation = 'fade-in',\n ...dataRest\n },\n ...rest\n },\n ref\n ) => {\n const { sticky } = dataRest\n const [isPlaying, setIsPlaying] = useState(false)\n const [btb, setbtb] = useState(0)\n const [titleHeight, setTitleHeight] = useState(0)\n const [videoHeightProgress, setVideoHeightProgress] = useState(0)\n const [visible, setVisible] = useState<boolean>(false)\n\n const videoRef = useRef<HTMLVideoElement>(null)\n const bgRef = useRef<HTMLImageElement>(null)\n const titleRef = useRef<HTMLDivElement>(null)\n const titleFadeInRef = useRef<HTMLDivElement>(null)\n const trackRef = useRef<HTMLDivElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const btnFadeInRef = useRef<HTMLButtonElement>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n const heightTriggerRef = useRef<ScrollTrigger | null>(null)\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => titleRef.current as HTMLDivElement)\n\n const title_html =\n typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title, converters: htmlConverters })\n const videoTitle_html =\n typeof videoTitle === 'string'\n ? videoTitle\n : videoTitle && convertLexicalToHTML({ data: videoTitle, converters: htmlConverters })\n\n useEffect(() => {\n if (inView) {\n videoRef.current?.play()\n setIsPlaying(true)\n } else {\n videoRef.current?.pause()\n setIsPlaying(false)\n }\n }, [inView])\n\n const debouncedHandleResize = debounce(() => {\n if (titleRef.current) {\n const rect = titleRef.current.getBoundingClientRect()\n const screenHeight = window.innerHeight\n const scrollTop = window.scrollY || window.pageYOffset\n const elementBottomToPageTop = rect.bottom + scrollTop\n const pageHeight = document.documentElement.scrollHeight\n const distanceToPageBottom = pageHeight - elementBottomToPageTop\n setbtb(distanceToPageBottom > screenHeight ? screenHeight : distanceToPageBottom)\n }\n if (titleRef.current) {\n const titleHeight = titleRef.current.clientHeight\n const screenHeight = window.innerHeight\n setTitleHeight(titleHeight + screenHeight)\n }\n }, 600)\n\n useEffect(() => {\n debouncedHandleResize()\n window.addEventListener('resize', debouncedHandleResize)\n return () => {\n window.removeEventListener('resize', debouncedHandleResize)\n }\n }, [])\n\n useEffect(() => {\n function gsapResize() {\n if (!titleFadeInRef.current || titleAnimation !== 'fade-in') return\n const height = titleFadeInRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleFadeInRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n if (btnFadeInRef.current) gsap.set(btnFadeInRef.current, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'top center-=10%',\n end: `top+=${height * 1.5 + 80}px center-=10%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n gsap.set(bgRef.current, { opacity: progress })\n if (btnFadeInRef.current) {\n gsap.set(btnFadeInRef.current, { opacity: progress >= 0.6 ? 1 : 0 })\n }\n },\n })\n }\n\n function gsapVideoHeightResize() {\n heightTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom',\n end: `bottom top`,\n // markers: true,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n setVideoHeightProgress(progress)\n },\n })\n }\n\n if (inView) {\n gsapResize()\n gsapVideoHeightResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n heightTriggerRef.current && heightTriggerRef.current.kill()\n }\n }, [titleAnimation, inView])\n\n useExposure(trackRef, {\n componentType,\n componentName,\n componentTitle: title_html,\n })\n\n const zIndexVideo = useMemo(() => {\n if (inView && videoHeightProgress > 0 && videoHeightProgress < 0.9) return 3\n if (inView) return 2\n return 1\n }, [videoHeightProgress, inView])\n\n const aspect =\n 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]'\n return (\n <>\n {sticky && (\n <div\n {...rest}\n ref={titleRef}\n className={cn(\n 'pointer-events-none relative z-10',\n aspect,\n {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n },\n className\n )}\n >\n <div ref={inViewRef}>\n {!titleAnimation && (\n <div className=\"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4 text-center\">\n {title_html && !isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {videoTitle_html && isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: videoTitle_html }}\n />\n )}\n {btnText && (\n <Button\n variant=\"link\"\n className={cn('member-equity-button-secondary text-info-primary')}\n onClick={() => {\n setVisible(true)\n // if (isPlaying) {\n // if (videoRef.current) {\n // videoRef.current.pause()\n // }\n // setIsPlaying(false)\n // } else {\n // if (videoRef.current) {\n // videoRef.current.play()\n // }\n // setIsPlaying(true)\n // }\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n {/* <Right /> */}\n </Button>\n )}\n </div>\n )}\n </div>\n </div>\n )}\n <div\n {...(!sticky ? rest : {})}\n style={\n sticky\n ? {\n marginBottom: `-${btb}px`,\n marginTop: `-${titleHeight}px`,\n zIndex: zIndexVideo,\n }\n : { zIndex: 5 }\n }\n className={cn('relative', className)}\n >\n <div className=\"sticky top-0 \">\n <div\n id={id}\n className={cn('relative overflow-hidden', sticky ? 'h-screen w-full' : aspect, {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n })}\n >\n {titleAnimation === 'fade-in' && (\n <div\n className={cn(\n 'absolute z-30 flex w-full flex-col items-center justify-center gap-4 px-4 text-center',\n sticky ? 'left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2' : 'left-0 top-0'\n )}\n >\n {title_html && (\n <div\n ref={titleFadeInRef}\n className=\"media-player-base-title lg-desktop:text-[64px] text-info-primary text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {btnText && (\n <Button\n ref={btnFadeInRef}\n variant=\"link\"\n className={cn('media-player-base-button member-equity-button-secondary text-info-primary')}\n onClick={() => {\n setVisible(true)\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n </Button>\n )}\n </div>\n )}\n <div\n className=\"media-cover left-0 top-0 h-screen w-screen overflow-hidden\"\n style={{ height: `${102 - videoHeightProgress * 100}vh` }}\n >\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={video?.url!}\n className=\"tablet:block hidden size-full !h-auto\"\n videoClassName=\"object-cover\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline=\"true\"\n x5-playsinline=\"true\"\n />\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={mobileVideo?.url || video?.url!}\n className=\"tablet:hidden block min-h-screen w-full\"\n videoClassName=\"object-cover w-full h-auto\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline=\"true\"\n x5-playsinline=\"true\"\n />\n <div\n ref={bgRef}\n className=\"absolute left-0 top-0 z-10 size-full opacity-0\"\n style={{\n background: 'rgba(0, 0, 0, 0.2)',\n }}\n />\n </div>\n </div>\n </div>\n {sticky && (\n <div\n className={cn(sticky && 'pointer-events-none relative box-content block', aspect)}\n style={sticky ? { height: `${btb}px` } : {}}\n ref={trackRef}\n />\n )}\n </div>\n {visible && youtubeId && (\n <VideoModal visible={visible} youTubeId={youtubeId} onCloseModal={() => setVisible(false)} />\n )}\n </>\n )\n }\n)\n\nMediaPlayerBase.displayName = 'MediaPlayerBase'\n\nexport default withLayout(MediaPlayerBase)\n"],
|
|
5
|
-
"mappings": "olBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAuMM,IAAAI,EAAA,6BAtMNC,EAAsF,iBACtFC,GAAyB,kBACzBC,EAAmB,kCACnBC,GAA2B,kCAC3BC,EAAmB,0CACnBC,GAA2B,kCAC3BC,EAAqC,6CAGrCC,GAA0B,uCAE1BC,GAA4B,sCAC5BC,EAA4B,gDAC5BC,EAAqB,gBACrBC,EAA0B,+BAC1BC,EAA8B,mCAE9B,MAAMC,GAAgB,oBAChBC,GAAgB,QAGtB,OAAK,eAAe,gBAAe,WAAS,EAE5C,MAAMC,GAAyC,CAAC,CAAE,kBAAAC,CAAkB,KAAO,CACzE,GAAGA,EACH,KAAMC,GAAQ,CACZ,KAAM,CAAE,KAAAC,CAAK,EAAID,EAEjB,OAAIC,EAAK,GAAKA,EAAK,EAAE,MACZ,wBAAwBA,EAAK,EAAE,KAAK,KAAKA,EAAK,IAAI,UAEpDA,EAAK,IACd,CACF,GAEMC,MAAkB,cACtB,CACE,CACE,UAAAC,EAAY,GACZ,GAAAC,EACA,WAAAC,EACA,KAAM,CACJ,MAAAC,EACA,WAAAC,EACA,QAAAC,EACA,UAAAC,EACA,MAAAC,EACA,YAAAC,GACA,MAAAC,EACA,IAAAC,EACA,MAAAC,EACA,eAAAC,EAAiB,UACjB,GAAGC,EACL,EACA,GAAGC,CACL,EACAC,KACG,CACH,KAAM,CAAE,OAAAC,CAAO,EAAIH,GACb,CAACI,EAAWC,CAAY,KAAI,YAAS,EAAK,EAC1C,CAACC,EAAKC,EAAM,KAAI,YAAS,CAAC,EAC1B,CAACC,GAAaC,EAAc,KAAI,YAAS,CA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,MAAG,WAAY5D,CAAS,EAEnC,oBAAC,OAAI,UAAU,gBACb,oBAAC,OACC,GAAIC,EACJ,aAAW,MAAG,2BAA4Be,EAAS,kBAAoB6C,EAAQ,CAC7E,YAAapD,IAAU,OACvB,cAAeE,IAAU,SAC3B,CAAC,EAEA,UAAAC,IAAmB,cAClB,QAAC,OACC,aAAW,MACT,wFACAI,EAAS,qDAAuD,cAClE,EAEC,UAAAsB,MACC,OAAC,OACC,IAAKR,EACL,UAAU,kHACV,wBAAyB,CAAE,OAAQQ,CAAW,EAChD,EAEDjC,MACC,OAAC,EAAAyD,QAAA,CACC,IAAK7B,EACL,QAAQ,OACR,aAAW,MAAG,2EAA2E,EACzF,QAAS,IAAM,CACbP,EAAW,EAAI,EACfxB,GAAcA,IAAa,CAC7B,EAEC,SAAAG,EACH,GAEJ,KAEF,QAAC,OACC,UAAU,6DACV,MAAO,CAAE,OAAQ,GAAG,IAAMkB,EAAsB,GAAG,IAAK,EAExD,oBAAC,EAAAwC,QAAA,CACC,SAAUpC,EACV,OAAQjB,GAAK,KAAO,GACpB,IAAKH,GAAO,IACZ,UAAU,wCACV,eAAe,eACf,MAAK,GACL,KAAI,GACJ,YAAW,GACX,SAAQ,GACR,
|
|
4
|
+
"sourcesContent": ["'use client'\nimport { useState, useRef, useMemo, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport { debounce } from 'lodash'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport Button from '../../components/button.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\nimport type { MediaPlayerBaseProps } from './types.js'\n// import { Right } from './right.js'\nimport { useInView } from 'react-intersection-observer'\nimport type { HTMLConvertersFunction } from '@payloadcms/richtext-lexical/html'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport ScrollLoadVideo from '../../helpers/ScrollLoadVideo.js'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\n\nconst componentName = 'media_player_base'\nconst componentType = 'video'\n\n// \u6CE8\u518C gsap \u63D2\u4EF6\ngsap.registerPlugin(ScrollTrigger, SplitText)\n\nconst htmlConverters: HTMLConvertersFunction = ({ defaultConverters }) => ({\n ...defaultConverters,\n text: args => {\n const { node } = args\n // \u68C0\u67E5\u662F\u5426\u6709\u81EA\u5B9A\u4E49 color\n if (node.$ && node.$.color) {\n return `<span class=\"lexical-${node.$.color}\">${node.text}</span>`\n }\n return node.text\n },\n})\n\nconst MediaPlayerBase = forwardRef<HTMLDivElement, MediaPlayerBaseProps>(\n (\n {\n className = '',\n id,\n onBtnClick,\n data: {\n title,\n videoTitle,\n btnText,\n youtubeId,\n video,\n mobileVideo,\n theme,\n img,\n shape,\n titleAnimation = 'fade-in',\n ...dataRest\n },\n ...rest\n },\n ref\n ) => {\n const { sticky } = dataRest\n const [isPlaying, setIsPlaying] = useState(false)\n const [btb, setbtb] = useState(0)\n const [titleHeight, setTitleHeight] = useState(0)\n const [videoHeightProgress, setVideoHeightProgress] = useState(0)\n const [visible, setVisible] = useState<boolean>(false)\n\n const videoRef = useRef<HTMLVideoElement>(null)\n const bgRef = useRef<HTMLImageElement>(null)\n const titleRef = useRef<HTMLDivElement>(null)\n const titleFadeInRef = useRef<HTMLDivElement>(null)\n const trackRef = useRef<HTMLDivElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const btnFadeInRef = useRef<HTMLButtonElement>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n const heightTriggerRef = useRef<ScrollTrigger | null>(null)\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => titleRef.current as HTMLDivElement)\n\n const title_html =\n typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title, converters: htmlConverters })\n const videoTitle_html =\n typeof videoTitle === 'string'\n ? videoTitle\n : videoTitle && convertLexicalToHTML({ data: videoTitle, converters: htmlConverters })\n\n useEffect(() => {\n if (inView) {\n videoRef.current?.play()\n setIsPlaying(true)\n } else {\n videoRef.current?.pause()\n setIsPlaying(false)\n }\n }, [inView])\n\n const debouncedHandleResize = debounce(() => {\n if (titleRef.current) {\n const rect = titleRef.current.getBoundingClientRect()\n const screenHeight = window.innerHeight\n const scrollTop = window.scrollY || window.pageYOffset\n const elementBottomToPageTop = rect.bottom + scrollTop\n const pageHeight = document.documentElement.scrollHeight\n const distanceToPageBottom = pageHeight - elementBottomToPageTop\n setbtb(distanceToPageBottom > screenHeight ? screenHeight : distanceToPageBottom)\n }\n if (titleRef.current) {\n const titleHeight = titleRef.current.clientHeight\n const screenHeight = window.innerHeight\n setTitleHeight(titleHeight + screenHeight)\n }\n }, 600)\n\n useEffect(() => {\n debouncedHandleResize()\n window.addEventListener('resize', debouncedHandleResize)\n return () => {\n window.removeEventListener('resize', debouncedHandleResize)\n }\n }, [])\n\n useEffect(() => {\n function gsapResize() {\n if (!titleFadeInRef.current || titleAnimation !== 'fade-in') return\n const height = titleFadeInRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleFadeInRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n if (btnFadeInRef.current) gsap.set(btnFadeInRef.current, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'top center-=10%',\n end: `top+=${height * 1.5 + 80}px center-=10%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n gsap.set(bgRef.current, { opacity: progress })\n if (btnFadeInRef.current) {\n gsap.set(btnFadeInRef.current, { opacity: progress >= 0.6 ? 1 : 0 })\n }\n },\n })\n }\n\n function gsapVideoHeightResize() {\n heightTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom',\n end: `bottom top`,\n // markers: true,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n setVideoHeightProgress(progress)\n },\n })\n }\n\n if (inView) {\n gsapResize()\n gsapVideoHeightResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n heightTriggerRef.current && heightTriggerRef.current.kill()\n }\n }, [titleAnimation, inView])\n\n useExposure(trackRef, {\n componentType,\n componentName,\n componentTitle: title_html,\n })\n\n const zIndexVideo = useMemo(() => {\n if (inView && videoHeightProgress > 0 && videoHeightProgress < 0.9) return 3\n if (inView) return 2\n return 1\n }, [videoHeightProgress, inView])\n\n const aspect =\n 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]'\n return (\n <>\n {sticky && (\n <div\n {...rest}\n ref={titleRef}\n className={cn(\n 'pointer-events-none relative z-10',\n aspect,\n {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n },\n className\n )}\n >\n <div ref={inViewRef}>\n {!titleAnimation && (\n <div className=\"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4 text-center\">\n {title_html && !isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {videoTitle_html && isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: videoTitle_html }}\n />\n )}\n {btnText && (\n <Button\n variant=\"link\"\n className={cn('member-equity-button-secondary text-info-primary')}\n onClick={() => {\n setVisible(true)\n // if (isPlaying) {\n // if (videoRef.current) {\n // videoRef.current.pause()\n // }\n // setIsPlaying(false)\n // } else {\n // if (videoRef.current) {\n // videoRef.current.play()\n // }\n // setIsPlaying(true)\n // }\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n {/* <Right /> */}\n </Button>\n )}\n </div>\n )}\n </div>\n </div>\n )}\n <div\n {...(!sticky ? rest : {})}\n style={\n sticky\n ? {\n marginBottom: `-${btb}px`,\n marginTop: `-${titleHeight}px`,\n zIndex: zIndexVideo,\n }\n : { zIndex: 5 }\n }\n className={cn('relative', className)}\n >\n <div className=\"sticky top-0 \">\n <div\n id={id}\n className={cn('relative overflow-hidden', sticky ? 'h-screen w-full' : aspect, {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n })}\n >\n {titleAnimation === 'fade-in' && (\n <div\n className={cn(\n 'absolute z-30 flex w-full flex-col items-center justify-center gap-4 px-4 text-center',\n sticky ? 'left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2' : 'left-0 top-0'\n )}\n >\n {title_html && (\n <div\n ref={titleFadeInRef}\n className=\"media-player-base-title lg-desktop:text-[64px] text-info-primary text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {btnText && (\n <Button\n ref={btnFadeInRef}\n variant=\"link\"\n className={cn('media-player-base-button member-equity-button-secondary text-info-primary')}\n onClick={() => {\n setVisible(true)\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n </Button>\n )}\n </div>\n )}\n <div\n className=\"media-cover left-0 top-0 h-screen w-screen overflow-hidden\"\n style={{ height: `${102 - videoHeightProgress * 100}vh` }}\n >\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={video?.url!}\n className=\"tablet:block hidden size-full !h-auto\"\n videoClassName=\"object-cover\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline\n x5-playsinline\n />\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={mobileVideo?.url || video?.url!}\n className=\"tablet:hidden block min-h-screen w-full\"\n videoClassName=\"object-cover w-full h-auto\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline\n x5-playsinline\n />\n <div\n ref={bgRef}\n className=\"absolute left-0 top-0 z-10 size-full opacity-0\"\n style={{\n background: 'rgba(0, 0, 0, 0.2)',\n }}\n />\n </div>\n </div>\n </div>\n {sticky && (\n <div\n className={cn(sticky && 'pointer-events-none relative box-content block', aspect)}\n style={sticky ? { height: `${btb}px` } : {}}\n ref={trackRef}\n />\n )}\n </div>\n {visible && youtubeId && (\n <VideoModal visible={visible} youTubeId={youtubeId} onCloseModal={() => setVisible(false)} />\n )}\n </>\n )\n }\n)\n\nMediaPlayerBase.displayName = 'MediaPlayerBase'\n\nexport default withLayout(MediaPlayerBase)\n"],
|
|
5
|
+
"mappings": "olBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAuMM,IAAAI,EAAA,6BAtMNC,EAAsF,iBACtFC,GAAyB,kBACzBC,EAAmB,kCACnBC,GAA2B,kCAC3BC,EAAmB,0CACnBC,GAA2B,kCAC3BC,EAAqC,6CAGrCC,GAA0B,uCAE1BC,GAA4B,sCAC5BC,EAA4B,gDAC5BC,EAAqB,gBACrBC,EAA0B,+BAC1BC,EAA8B,mCAE9B,MAAMC,GAAgB,oBAChBC,GAAgB,QAGtB,OAAK,eAAe,gBAAe,WAAS,EAE5C,MAAMC,GAAyC,CAAC,CAAE,kBAAAC,CAAkB,KAAO,CACzE,GAAGA,EACH,KAAMC,GAAQ,CACZ,KAAM,CAAE,KAAAC,CAAK,EAAID,EAEjB,OAAIC,EAAK,GAAKA,EAAK,EAAE,MACZ,wBAAwBA,EAAK,EAAE,KAAK,KAAKA,EAAK,IAAI,UAEpDA,EA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AwD,QAAA,CACC,SAAUpC,EACV,OAAQjB,GAAK,KAAO,GACpB,IAAKF,IAAa,KAAOD,GAAO,IAChC,UAAU,0CACV,eAAe,6BACf,MAAK,GACL,KAAI,GACJ,YAAW,GACX,SAAQ,GACR,qBAAkB,GAClB,iBAAc,GAChB,KACA,OAAC,OACC,IAAKqB,EACL,UAAU,iDACV,MAAO,CACL,WAAY,oBACd,EACF,GACF,GACF,EACF,EACCZ,MACC,OAAC,OACC,aAAW,MAAGA,GAAU,iDAAkD6C,CAAM,EAChF,MAAO7C,EAAS,CAAE,OAAQ,GAAGG,CAAG,IAAK,EAAI,CAAC,EAC1C,IAAKY,EACP,GAEJ,EACCN,GAAWnB,MACV,OAAC,eAAW,QAASmB,EAAS,UAAWnB,EAAW,aAAc,IAAMoB,EAAW,EAAK,EAAG,GAE/F,CAEJ,CACF,EAEA3B,GAAgB,YAAc,kBAE9B,IAAOtB,MAAQ,eAAWsB,EAAe",
|
|
6
6
|
"names": ["MediaPlayerBase_exports", "__export", "MediaPlayerBase_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_lodash", "import_utils", "import_Styles", "import_button", "import_VideoModal", "import_html", "import_react_intersection_observer", "import_useExposure", "import_ScrollLoadVideo", "import_gsap", "import_SplitText", "import_ScrollTrigger", "componentName", "componentType", "htmlConverters", "defaultConverters", "args", "node", "MediaPlayerBase", "className", "id", "onBtnClick", "title", "videoTitle", "btnText", "youtubeId", "video", "mobileVideo", "theme", "img", "shape", "titleAnimation", "dataRest", "rest", "ref", "sticky", "isPlaying", "setIsPlaying", "btb", "setbtb", "titleHeight", "setTitleHeight", "videoHeightProgress", "setVideoHeightProgress", "visible", "setVisible", "videoRef", "bgRef", "titleRef", "titleFadeInRef", "trackRef", "splitTextInstance", "btnFadeInRef", "scrollTriggerRef", "heightTriggerRef", "inViewRef", "inView", "title_html", "videoTitle_html", "debouncedHandleResize", "rect", "screenHeight", "scrollTop", "elementBottomToPageTop", "distanceToPageBottom", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "i", "start", "width", "opacity", "gsapVideoHeightResize", "zIndexVideo", "aspect", "Button", "ScrollLoadVideo"]
|
|
7
7
|
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
declare const _default: import("react").ForwardRefExoticComponent<MediaPlayerMultiProps & import("react").RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
1
|
+
declare const _default: any;
|
|
3
2
|
export default _default;
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import type { MediaPlayerBaseProps } from './types.js';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<MediaPlayerBaseProps & React.RefAttributes<{
|
|
4
|
-
mediaPlayerStickyRef: HTMLDivElement;
|
|
5
|
-
}> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
1
|
+
declare const _default: any;
|
|
6
2
|
export default _default;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { MediaSceneSwitcherProps } from './types.js';
|
|
2
1
|
import 'swiper/css';
|
|
3
|
-
declare const _default:
|
|
2
|
+
declare const _default: any;
|
|
4
3
|
export default _default;
|
|
@@ -54,5 +54,5 @@ export interface MediaSceneSwitcherV2Props extends React.HTMLAttributes<HTMLDivE
|
|
|
54
54
|
/** 场景切换回调 */
|
|
55
55
|
onSceneChange?: (index: number, scene: MediaSceneSwitcherV2Item) => void;
|
|
56
56
|
}
|
|
57
|
-
declare const _default:
|
|
57
|
+
declare const _default: any;
|
|
58
58
|
export default _default;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import type { MemberEquityProps } from './types.js';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<MemberEquityProps & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & React.RefAttributes<any>>;
|
|
1
|
+
declare const _default: any;
|
|
4
2
|
export default _default;
|
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
|
|
4
|
-
onSecondaryButtonClick?: () => void;
|
|
5
|
-
onPrimaryButtonClick?: () => void;
|
|
6
|
-
data: {
|
|
7
|
-
shape?: import("../../types/props").Shape;
|
|
8
|
-
sectionTitle?: string;
|
|
9
|
-
groupByTab?: boolean;
|
|
10
|
-
items: ({
|
|
11
|
-
width?: "full" | "half" | "one-third";
|
|
12
|
-
} & Item)[];
|
|
13
|
-
carousel?: {
|
|
14
|
-
items: Item[];
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
} & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
1
|
+
import type { MultiLayoutGraphicBlockProps } from './types';
|
|
2
|
+
declare const _default: any;
|
|
18
3
|
export default _default;
|
|
19
4
|
export type { MultiLayoutGraphicBlockProps };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { NavigationSearchProps } from './types.js';
|
|
2
1
|
export declare const canSearch: (target: any) => boolean;
|
|
3
|
-
declare const _default:
|
|
2
|
+
declare const _default: any;
|
|
4
3
|
export default _default;
|
|
@@ -44,5 +44,5 @@ export interface ProductCompareProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
44
44
|
theme?: Theme;
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
declare const _default:
|
|
47
|
+
declare const _default: any;
|
|
48
48
|
export default _default;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ProductHeroProps } from './types.js';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<ProductHeroProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
1
|
+
declare const _default: any;
|
|
4
2
|
export default _default;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
declare const _default: import("react").ForwardRefExoticComponent<ProductNavProps & import("react").RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
1
|
+
declare const _default: any;
|
|
3
2
|
export default _default;
|
|
@@ -42,5 +42,5 @@ export interface PromotionalBarProps extends React.HTMLAttributes<HTMLDivElement
|
|
|
42
42
|
data: PromotionalBarData;
|
|
43
43
|
classNames?: Partial<Record<keyof PromotionalBarSemanticName, string>>;
|
|
44
44
|
}
|
|
45
|
-
declare const _default:
|
|
45
|
+
declare const _default: any;
|
|
46
46
|
export default _default;
|
|
@@ -87,5 +87,5 @@ export interface SecondaryBannerProps extends React.HTMLAttributes<HTMLElement>
|
|
|
87
87
|
*/
|
|
88
88
|
jumpOptions?: JumpOptions;
|
|
89
89
|
}
|
|
90
|
-
declare const _default:
|
|
90
|
+
declare const _default: any;
|
|
91
91
|
export default _default;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { Img } from '../../types/props.js';
|
|
3
2
|
export type SelectStoreDataType = {
|
|
4
3
|
title: string;
|
|
@@ -8,10 +7,5 @@ export type SelectStoreDataType = {
|
|
|
8
7
|
padImg: Img;
|
|
9
8
|
miniImg: Img;
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
data: {
|
|
13
|
-
list: SelectStoreDataType[];
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
declare const _default: React.ForwardRefExoticComponent<SelectStoreType & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & React.RefAttributes<any>>;
|
|
10
|
+
declare const _default: any;
|
|
17
11
|
export default _default;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ShelfDisplayProps } from './shelfDisplay.js';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<ShelfDisplayProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
1
|
+
declare const _default: any;
|
|
4
2
|
export default _default;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { SloganProps } from './types.js';
|
|
3
1
|
export declare const componentType = "copy";
|
|
4
2
|
export declare const componentName = "brand_slogan";
|
|
5
|
-
declare const _default:
|
|
3
|
+
declare const _default: any;
|
|
6
4
|
export default _default;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import type { SpacerProps } from './types.js';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<SpacerProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
1
|
+
declare const _default: any;
|
|
4
2
|
export default _default;
|
|
@@ -5,5 +5,5 @@ export interface SpecsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, '
|
|
|
5
5
|
onChange?: (product: any, index: number) => void;
|
|
6
6
|
onSecondaryChange?: (data: any) => void;
|
|
7
7
|
}
|
|
8
|
-
declare const _default:
|
|
8
|
+
declare const _default: any;
|
|
9
9
|
export default _default;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import type { SpecsComparisonProps } from './types.js';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<SpecsComparisonProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
1
|
+
declare const _default: any;
|
|
4
2
|
export default _default;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import type { TabWithImageProps } from './types.js';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<TabWithImageProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
1
|
+
declare const _default: any;
|
|
4
2
|
export default _default;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import React from 'react';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
1
|
+
declare const _default: any;
|
|
4
2
|
export default _default;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import React from 'react';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<TabsGroupProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
1
|
+
declare const _default: any;
|
|
4
2
|
export default _default;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import type { TabsWithMediaProps } from './types.js';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<TabsWithMediaProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
1
|
+
declare const _default: any;
|
|
4
2
|
export default _default;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ThreeDCarouselProps } from './types.js';
|
|
3
1
|
import 'swiper/css';
|
|
4
2
|
import 'swiper/css/navigation';
|
|
5
3
|
import 'swiper/css/pagination';
|
|
6
4
|
import 'swiper/css/effect-coverflow';
|
|
7
|
-
declare const _default:
|
|
5
|
+
declare const _default: any;
|
|
8
6
|
export default _default;
|
|
@@ -2,5 +2,5 @@ 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:
|
|
5
|
+
declare const _default: any;
|
|
6
6
|
export default _default;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import type { VideoFeatureProps } from './types.js';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<VideoFeatureProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
1
|
+
declare const _default: any;
|
|
4
2
|
export default _default;
|
|
@@ -32,7 +32,7 @@ import type { WheelLotteryProps, WheelLotteryHandle } from './types.js';
|
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
34
|
export declare const WheelLottery: import("react").ForwardRefExoticComponent<WheelLotteryProps & import("react").RefAttributes<WheelLotteryHandle>>;
|
|
35
|
-
declare const _default:
|
|
35
|
+
declare const _default: any;
|
|
36
36
|
export default _default;
|
|
37
37
|
export { WinnerModal } from './WinnerModal.js';
|
|
38
38
|
export { RulesModal } from './RulesModal.js';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { WhyChooseProps, WhyChooseItem as ItemType } from './types.js';
|
|
1
|
+
import type { WhyChooseItem as ItemType } from './types.js';
|
|
3
2
|
declare const WhyChooseItem: {
|
|
4
3
|
({ data }: {
|
|
5
4
|
data: ItemType;
|
|
6
5
|
}): import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
displayName: string;
|
|
8
7
|
};
|
|
9
|
-
declare const _default:
|
|
8
|
+
declare const _default: any;
|
|
10
9
|
export default _default;
|
|
11
10
|
export { WhyChooseItem };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var f=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var H=Object.prototype.hasOwnProperty;var O=(r,e)=>{for(var i in e)f(r,i,{get:e[i],enumerable:!0})},x=(r,e,i,
|
|
1
|
+
"use strict";var f=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var H=Object.prototype.hasOwnProperty;var O=(r,e)=>{for(var i in e)f(r,i,{get:e[i],enumerable:!0})},x=(r,e,i,d)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of T(e))!H.call(r,o)&&o!==i&&f(r,o,{get:()=>e[o],enumerable:!(d=N(e,o))||d.enumerable});return r};var z=r=>x(f({},"__esModule",{value:!0}),r);var D={};O(D,{default:()=>j});module.exports=z(D);var v=require("react/jsx-runtime"),n=require("react"),m=require("../helpers/utils.js");const C=({src:r,poster:e,className:i="",videoClassName:d="",autoplay:o=!0,muted:y=!0,loop:a=!0,controls:L=!1,playsInline:E=!0,videoRef:R,intersectionObserverConfig:M={threshold:0,rootMargin:"200px"},...V})=>{const[c,P]=(0,n.useState)(!1),w=(0,n.useRef)(null),b=(0,n.useRef)(null),p=(0,n.useRef)(!1),t=R||w,{threshold:h,rootMargin:g}=M;return(0,n.useEffect)(()=>{const l=t.current;if(!l||a)return;const s=()=>{p.current=!0};return l.addEventListener("ended",s),()=>{l.removeEventListener("ended",s)}},[t,a,c]),(0,n.useEffect)(()=>{const l=new IntersectionObserver(I=>{I.forEach(S=>{if(S.isIntersecting){if(c||P(!0),t.current){const u=t.current;if(!a&&p.current)return;u.muted=!0,u.currentTime=0,u.play().catch(k=>{console.warn("\u89C6\u9891\u81EA\u52A8\u64AD\u653E\u5931\u8D25:",k)})}}else t.current&&t.current.pause()})},{threshold:h,rootMargin:g}),s=b.current;return s&&l.observe(s),()=>{s&&l.unobserve(s)}},[t,a,g,c,h]),(0,v.jsx)("div",{ref:b,className:(0,m.cn)("relative size-full",i),children:(0,v.jsx)("video",{ref:t,src:c?r:void 0,poster:c?e:void 0,className:(0,m.cn)("size-full object-cover",d),loop:a,muted:y,controls:L,playsInline:E,preload:"metadata",disablePictureInPicture:!0,"webkit-playsinline":!0,autoPlay:o,...V})})};var j=C;
|
|
2
2
|
//# sourceMappingURL=ScrollLoadVideo.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/ScrollLoadVideo.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useRef, useEffect, useState } from 'react'\nimport { cn } from '../helpers/utils.js'\n\ninterface ScrollLoadVideoProps {\n src: string\n poster?: string\n className?: string\n videoClassName?: string\n autoplay?: boolean\n muted?: boolean\n loop?: boolean\n controls?: boolean\n playsInline?: boolean\n videoRef?: React.RefObject<HTMLVideoElement>\n intersectionObserverConfig?: {\n threshold?: number | number[]\n rootMargin?: string\n }\n [key: string]: any\n}\n\nconst ScrollLoadVideo = ({\n src,\n poster,\n className = '',\n videoClassName = '',\n autoplay = true,\n muted = true,\n loop = true,\n controls = false,\n playsInline = true,\n videoRef,\n intersectionObserverConfig = {\n threshold: 0, // \u5F53\u5143\u7D20\u8FDB\u5165\u89C6\u7A97\u65F6\u89E6\u53D1\n rootMargin: '200px', // \u63D0\u524D 200px \u89E6\u53D1\n },\n ...attr\n}: ScrollLoadVideoProps) => {\n const [shouldLoad, setShouldLoad] = useState(false)\n const internalVideoRef = useRef<HTMLVideoElement>(null)\n const containerRef = useRef<HTMLDivElement>(null)\n // \u8DDF\u8E2A\u89C6\u9891\u662F\u5426\u5DF2\u7ECF\u64AD\u653E\u5B8C\u6210\uFF08\u7528\u4E8E loop=false \u65F6\u53EA\u64AD\u653E\u4E00\u6B21\uFF09\n const hasPlayedRef = useRef(false)\n\n const currentVideoRef = videoRef || internalVideoRef\n const { threshold, rootMargin } = intersectionObserverConfig\n\n // \u76D1\u542C\u89C6\u9891\u64AD\u653E\u7ED3\u675F\u4E8B\u4EF6\n useEffect(() => {\n const video = currentVideoRef.current\n if (!video || loop) return\n\n const handleEnded = () => {\n hasPlayedRef.current = true\n }\n\n video.addEventListener('ended', handleEnded)\n return () => {\n video.removeEventListener('ended', handleEnded)\n }\n }, [currentVideoRef, loop, shouldLoad])\n\n // IntersectionObserver \u771F\u6B63\u7684\u61D2\u52A0\u8F7D + \u89C6\u7A97\u64AD\u653E\u63A7\u5236\n useEffect(() => {\n const observer = new IntersectionObserver(\n entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n // \u7B2C\u4E00\u6B21\u8FDB\u5165\u89C6\u7A97\u65F6\u624D\u5F00\u59CB\u52A0\u8F7D\u89C6\u9891\n if (!shouldLoad) {\n setShouldLoad(true)\n }\n\n // \u5982\u679C\u5141\u8BB8\u81EA\u52A8\u64AD\u653E\u4E14\u89C6\u9891\u5DF2\u52A0\u8F7D\n if (currentVideoRef.current) {\n const video = currentVideoRef.current\n\n // \u5982\u679C loop=false \u4E14\u89C6\u9891\u5DF2\u7ECF\u64AD\u653E\u8FC7\uFF0C\u4E0D\u518D\u91CD\u65B0\u64AD\u653E\n if (!loop && hasPlayedRef.current) {\n return\n }\n\n video.muted = true\n video.currentTime = 0 // \u6BCF\u6B21\u8FDB\u5165\u89C6\u7A97\u65F6\u4ECE\u5934\u64AD\u653E\n video.play().catch((error: unknown) => {\n console.warn('\u89C6\u9891\u81EA\u52A8\u64AD\u653E\u5931\u8D25:', error)\n })\n }\n } else if (currentVideoRef.current) {\n // \u79BB\u5F00\u89C6\u7A97\u65F6\u6682\u505C\u89C6\u9891\n currentVideoRef.current.pause()\n }\n })\n },\n {\n threshold: threshold,\n rootMargin: rootMargin,\n }\n )\n\n const currentElement = containerRef.current\n if (currentElement) {\n observer.observe(currentElement)\n }\n\n return () => {\n if (currentElement) {\n observer.unobserve(currentElement)\n }\n }\n }, [currentVideoRef, loop, rootMargin, shouldLoad, threshold])\n\n return (\n <div ref={containerRef} className={cn('relative size-full', className)}>\n {/* \u89C6\u9891 */}\n <video\n ref={currentVideoRef}\n src={shouldLoad ? src : undefined} // \u53EA\u6709\u5728\u9700\u8981\u65F6\u624D\u8BBE\u7F6E src\n poster={shouldLoad ? poster : undefined}\n className={cn('size-full object-cover', videoClassName)}\n loop={loop}\n muted={muted}\n controls={controls}\n playsInline={playsInline}\n preload=\"metadata\" // \u5B8C\u5168\u4E0D\u9884\u52A0\u8F7D\n disablePictureInPicture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AAQ,KAAK,oDAAaA,CAAK,CACjC,CAAC,CACH,OACSR,EAAgB,SAEzBA,EAAgB,QAAQ,MAAM,CAElC,CAAC,CACH,EACA,CACE,UAAWC,EACX,WAAYC,CACd,CACF,EAEMO,EAAiBX,EAAa,QACpC,OAAIW,GACFJ,EAAS,QAAQI,CAAc,EAG1B,IAAM,CACPA,GACFJ,EAAS,UAAUI,CAAc,CAErC,CACF,EAAG,CAACT,EAAiBX,EAAMa,EAAYP,EAAYM,CAAS,CAAC,KAG3D,OAAC,OAAI,IAAKH,EAAc,aAAW,MAAG,qBAAsBb,CAAS,EAEnE,mBAAC,SACC,IAAKe,EACL,IAAKL,EAAaZ,EAAM,OACxB,OAAQY,EAAaX,EAAS,OAC9B,aAAW,MAAG,yBAA0BE,CAAc,EACtD,KAAMG,EACN,MAAOD,EACP,SAAUE,EACV,YAAaC,EACb,QAAQ,WACR,wBAAuB,GAEvB,
|
|
4
|
+
"sourcesContent": ["import React, { useRef, useEffect, useState } from 'react'\nimport { cn } from '../helpers/utils.js'\n\ninterface ScrollLoadVideoProps {\n src: string\n poster?: string\n className?: string\n videoClassName?: string\n autoplay?: boolean\n muted?: boolean\n loop?: boolean\n controls?: boolean\n playsInline?: boolean\n videoRef?: React.RefObject<HTMLVideoElement>\n intersectionObserverConfig?: {\n threshold?: number | number[]\n rootMargin?: string\n }\n [key: string]: any\n}\n\nconst ScrollLoadVideo = ({\n src,\n poster,\n className = '',\n videoClassName = '',\n autoplay = true,\n muted = true,\n loop = true,\n controls = false,\n playsInline = true,\n videoRef,\n intersectionObserverConfig = {\n threshold: 0, // \u5F53\u5143\u7D20\u8FDB\u5165\u89C6\u7A97\u65F6\u89E6\u53D1\n rootMargin: '200px', // \u63D0\u524D 200px \u89E6\u53D1\n },\n ...attr\n}: ScrollLoadVideoProps) => {\n const [shouldLoad, setShouldLoad] = useState(false)\n const internalVideoRef = useRef<HTMLVideoElement>(null)\n const containerRef = useRef<HTMLDivElement>(null)\n // \u8DDF\u8E2A\u89C6\u9891\u662F\u5426\u5DF2\u7ECF\u64AD\u653E\u5B8C\u6210\uFF08\u7528\u4E8E loop=false \u65F6\u53EA\u64AD\u653E\u4E00\u6B21\uFF09\n const hasPlayedRef = useRef(false)\n\n const currentVideoRef = videoRef || internalVideoRef\n const { threshold, rootMargin } = intersectionObserverConfig\n\n // \u76D1\u542C\u89C6\u9891\u64AD\u653E\u7ED3\u675F\u4E8B\u4EF6\n useEffect(() => {\n const video = currentVideoRef.current\n if (!video || loop) return\n\n const handleEnded = () => {\n hasPlayedRef.current = true\n }\n\n video.addEventListener('ended', handleEnded)\n return () => {\n video.removeEventListener('ended', handleEnded)\n }\n }, [currentVideoRef, loop, shouldLoad])\n\n // IntersectionObserver \u771F\u6B63\u7684\u61D2\u52A0\u8F7D + \u89C6\u7A97\u64AD\u653E\u63A7\u5236\n useEffect(() => {\n const observer = new IntersectionObserver(\n entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n // \u7B2C\u4E00\u6B21\u8FDB\u5165\u89C6\u7A97\u65F6\u624D\u5F00\u59CB\u52A0\u8F7D\u89C6\u9891\n if (!shouldLoad) {\n setShouldLoad(true)\n }\n\n // \u5982\u679C\u5141\u8BB8\u81EA\u52A8\u64AD\u653E\u4E14\u89C6\u9891\u5DF2\u52A0\u8F7D\n if (currentVideoRef.current) {\n const video = currentVideoRef.current\n\n // \u5982\u679C loop=false \u4E14\u89C6\u9891\u5DF2\u7ECF\u64AD\u653E\u8FC7\uFF0C\u4E0D\u518D\u91CD\u65B0\u64AD\u653E\n if (!loop && hasPlayedRef.current) {\n return\n }\n\n video.muted = true\n video.currentTime = 0 // \u6BCF\u6B21\u8FDB\u5165\u89C6\u7A97\u65F6\u4ECE\u5934\u64AD\u653E\n video.play().catch((error: unknown) => {\n console.warn('\u89C6\u9891\u81EA\u52A8\u64AD\u653E\u5931\u8D25:', error)\n })\n }\n } else if (currentVideoRef.current) {\n // \u79BB\u5F00\u89C6\u7A97\u65F6\u6682\u505C\u89C6\u9891\n currentVideoRef.current.pause()\n }\n })\n },\n {\n threshold: threshold,\n rootMargin: rootMargin,\n }\n )\n\n const currentElement = containerRef.current\n if (currentElement) {\n observer.observe(currentElement)\n }\n\n return () => {\n if (currentElement) {\n observer.unobserve(currentElement)\n }\n }\n }, [currentVideoRef, loop, rootMargin, shouldLoad, threshold])\n\n return (\n <div ref={containerRef} className={cn('relative size-full', className)}>\n {/* \u89C6\u9891 */}\n <video\n ref={currentVideoRef}\n src={shouldLoad ? src : undefined} // \u53EA\u6709\u5728\u9700\u8981\u65F6\u624D\u8BBE\u7F6E src\n poster={shouldLoad ? poster : undefined}\n className={cn('size-full object-cover', videoClassName)}\n loop={loop}\n muted={muted}\n controls={controls}\n playsInline={playsInline}\n preload=\"metadata\" // \u5B8C\u5168\u4E0D\u9884\u52A0\u8F7D\n disablePictureInPicture\n // eslint-disable-next-line react/no-unknown-property\n webkit-playsinline\n autoPlay={autoplay}\n {...attr}\n />\n </div>\n )\n}\n\nexport default ScrollLoadVideo\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmHM,IAAAI,EAAA,6BAnHNC,EAAmD,iBACnDC,EAAmB,+BAoBnB,MAAMC,EAAkB,CAAC,CACvB,IAAAC,EACA,OAAAC,EACA,UAAAC,EAAY,GACZ,eAAAC,EAAiB,GACjB,SAAAC,EAAW,GACX,MAAAC,EAAQ,GACR,KAAAC,EAAO,GACP,SAAAC,EAAW,GACX,YAAAC,EAAc,GACd,SAAAC,EACA,2BAAAC,EAA6B,CAC3B,UAAW,EACX,WAAY,OACd,EACA,GAAGC,CACL,IAA4B,CAC1B,KAAM,CAACC,EAAYC,CAAa,KAAI,YAAS,EAAK,EAC5CC,KAAmB,UAAyB,IAAI,EAChDC,KAAe,UAAuB,IAAI,EAE1CC,KAAe,UAAO,EAAK,EAE3BC,EAAkBR,GAAYK,EAC9B,CAAE,UAAAI,EAA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B,EAAQK",
|
|
6
6
|
"names": ["ScrollLoadVideo_exports", "__export", "ScrollLoadVideo_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "ScrollLoadVideo", "src", "poster", "className", "videoClassName", "autoplay", "muted", "loop", "controls", "playsInline", "videoRef", "intersectionObserverConfig", "attr", "shouldLoad", "setShouldLoad", "internalVideoRef", "containerRef", "hasPlayedRef", "currentVideoRef", "threshold", "rootMargin", "video", "handleEnded", "observer", "entries", "entry", "error", "currentElement"]
|
|
7
7
|
}
|
|
@@ -34,5 +34,4 @@ export declare const useStyles: (styleProps: Partial<StylesProps>, data?: Record
|
|
|
34
34
|
* @param WrappedComponent - 需要包装的组件
|
|
35
35
|
* @param defaultLayoutProps - 默认样式属性
|
|
36
36
|
*/
|
|
37
|
-
export declare function withLayout<P
|
|
38
|
-
export declare function withLayout<P>(WrappedComponent: React.ComponentType<P>, defaultLayoutProps?: Partial<StylesProps & ContainerProps>): React.ForwardRefExoticComponent<React.PropsWithoutRef<P & Partial<StylesProps & ContainerProps>> & React.RefAttributes<any>>;
|
|
37
|
+
export declare function withLayout<P>(WrappedComponent: React.ComponentType<P>, defaultLayoutProps?: Partial<StylesProps & ContainerProps>): any;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var x=Object.create;var i=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty;var I=(t,e)=>{for(var n in e)i(t,n,{get:e[n],enumerable:!0})},p=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of B(e))!G.call(t,a)&&a!==n&&i(t,a,{get:()=>e[a],enumerable:!(o=j(e,a))||o.enumerable});return t};var m=(t,e,n)=>(n=t!=null?x(E(t)):{},p(e||!t||!t.__esModule?i(n,"default",{value:t,enumerable:!0}):n,t)),K=t=>p(i({},"__esModule",{value:!0}),t);var F={};I(F,{getStylesProps:()=>R,useStyles:()=>N,withLayout:()=>D});module.exports=K(F);var s=require("react/jsx-runtime"),l=m(require("react")),P=require("./simpleHash.js"),f=m(require("./getKeyPropsString.js")),c=require("../components/grid.js"),C=require("../components/container.js"),$=m(require("./ErrorBoundary.js"));const M={12:"col-start-1 col-end-13",10:"col-start-2 col-end-12",8:"col-start-3 col-end-11",6:"col-start-4 col-end-10",4:"col-start-5 col-end-9"},W={12:"tablet:col-start-1 tablet:col-end-13",10:"tablet:col-start-2 tablet:col-end-12",8:"tablet:col-start-3 tablet:col-end-11",6:"tablet:col-start-4 tablet:col-end-10",4:"tablet:col-start-5 tablet:col-end-9"},b=t=>{const e=(0,f.default)(t);return`style_${(0,P.simpleHash)(e)}`},R=t=>{const{style:e,uid:n,disabled:o}=t;return{style:e,uid:n,disabled:o}},H=({style:t,uid:e=b({}),disabled:n=!1})=>!t||n?null:(0,s.jsx)("style",{suppressHydrationWarning:!0,"data-style-id":e,dangerouslySetInnerHTML:{__html:`.block-${e} { ${t} }`}}),N=(t,e)=>{const n=(0,l.useMemo)(()=>t?.uid||b({...t,data:e}),[e,t]),o=(0,l.useMemo)(()=>(0,s.jsx)(H,{...t,uid:n}),[t,n]);return{className:`block-${n} `,StyleComponent:o,uid:n}},A=t=>{const{desktopSpan:e,mobileSpan:n}=t?.container||{},o=n?M[n]:"",a=e?W[e]:"";return`${o} ${a}`.trim()},g=Symbol("withLayoutWrapped");function D(t,e){if(t[g])return t;const n=l.default.forwardRef((o,a)=>{const d=R(o),h=r=>r?typeof r=="string"?r:typeof r=="object"&&Object.entries(r).length<=0?"":Object.entries(r).map(([L,O])=>`${L.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${O}`).join("; ")+";":"",u=[e?.style,d?.style].map(h).filter(r=>!!r).map(r=>r.trim().endsWith(";")?r:`${r};`).join(" "),w={...e,...d,...u&&{style:u}},{className:S,StyleComponent:k}=N(w,o?.data),T=r=>(0,s.jsx)(C.Container,{className:`${S} ${r?.className||""}`.trim(),children:(0,s.jsx)(c.Grid,{className:"container_grid",children:(0,s.jsx)(c.GridItem,{className:A(r),children:(0,s.jsx)(t,{...r,ref:a})})})}),_=r=>(0,s.jsx)(t,{...r,className:`${S} ${r?.className||""||""}`.trim(),ref:a}),{style:U,...y}=o;return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)($.default,{children:[k,Reflect.ownKeys(y?.container||{})?.length>0?T(y):_(y)]})})});return n.displayName=`WithLayout${t.displayName||t.name||"Component"}`,n[g]=!0,n}
|
|
2
2
|
//# sourceMappingURL=Styles.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/shared/Styles.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useMemo } from 'react'\nimport { simpleHash } from './simpleHash.js'\nimport getKeyPropsString from './getKeyPropsString.js'\nimport { Grid, GridItem } from '../components/grid.js'\nimport { Container } from '../components/container.js'\nimport ErrorBoundary from './ErrorBoundary.js'\n\nconst colContentClasses: Record<number, string> = {\n 12: 'col-start-1 col-end-13',\n 10: 'col-start-2 col-end-12',\n 8: 'col-start-3 col-end-11',\n 6: 'col-start-4 col-end-10',\n 4: 'col-start-5 col-end-9',\n} as const\n\n// \u9884\u5B9A\u4E49\u5E26 tablet \u524D\u7F00\u7684\u7C7B\u540D\uFF0C\u786E\u4FDD Tailwind \u53EF\u4EE5\u8BC6\u522B\nconst colContentClassesTablet: Record<number, string> = {\n 12: 'tablet:col-start-1 tablet:col-end-13',\n 10: 'tablet:col-start-2 tablet:col-end-12',\n 8: 'tablet:col-start-3 tablet:col-end-11',\n 6: 'tablet:col-start-4 tablet:col-end-10',\n 4: 'tablet:col-start-5 tablet:col-end-9',\n} as const\n\nexport interface ContainerProps {\n container?: {\n /** \u684C\u9762\u7AEF\u5217\u5185\u5BB9\u5BBD\u5EA6 */\n desktopSpan: number\n /** \u79FB\u52A8\u7AEF\u5217\u5185\u5BB9\u5BBD\u5EA6 */\n mobileSpan: number\n }\n}\n\nexport interface StylesProps {\n /** \u81EA\u5B9A\u4E49\u6837\u5F0F\u5B57\u7B26\u4E32\u6216\u5BF9\u8C61 */\n style?: string | React.CSSProperties\n /** \u552F\u4E00\u6807\u8BC6\u7B26 */\n uid?: string\n /** \u662F\u5426\u7981\u7528 */\n disabled?: boolean\n}\n\n/**\n * \u6839\u636E props \u751F\u6210\u786E\u5B9A\u6027 uid\n */\nconst generateUID = (props: Record<string, any>) => {\n const keyString = getKeyPropsString(props)\n return `style_${simpleHash(keyString)}`\n}\n\n/**\n * \u4ECE\u7EC4\u4EF6 props \u4E2D\u63D0\u53D6\u6837\u5F0F\u76F8\u5173\u5C5E\u6027\n */\nexport const getStylesProps = <T extends Record<string, unknown>>(props: T & StylesProps): StylesProps => {\n const { style, uid, disabled } = props\n return { style, uid, disabled }\n}\n\n/**\n * \u6837\u5F0F\u6CE8\u5165\u7EC4\u4EF6\n */\nconst Styles: React.FC<StylesProps> = ({ style, uid = generateUID({}), disabled = false }) => {\n if (!style || disabled) {\n return null\n }\n\n return (\n <style\n suppressHydrationWarning\n data-style-id={uid}\n dangerouslySetInnerHTML={{ __html: `.block-${uid} { ${style} }` }}\n />\n )\n}\n\n/**\n * \u6837\u5F0F Hook\uFF0C\u8FD4\u56DE\u6837\u5F0F\u7C7B\u540D\u548C\u6837\u5F0F\u7EC4\u4EF6\n * @param styleProps - \u6837\u5F0F\u5C5E\u6027\n */\nexport const useStyles = (styleProps: Partial<StylesProps>, data?: Record<string, any>) => {\n const uid = useMemo(() => styleProps?.uid || generateUID({ ...styleProps, data }), [data, styleProps])\n\n const StyleComponent = useMemo(() => <Styles {...styleProps} uid={uid} />, [styleProps, uid])\n\n return {\n className: `block-${uid} `,\n StyleComponent,\n uid,\n } as const\n}\n\nconst getContainerClassName = (props?: Partial<StylesProps & ContainerProps>) => {\n const { desktopSpan, mobileSpan } = props?.container || {}\n const mobileClasses = mobileSpan ? colContentClasses[mobileSpan] : ''\n const desktopClasses = desktopSpan ? colContentClassesTablet[desktopSpan] : ''\n return `${mobileClasses} ${desktopClasses}`.trim()\n}\n\n/**\n * \u6807\u8BB0\u7EC4\u4EF6\u662F\u5426\u5DF2\u88AB withLayout \u5305\u88C5\n */\nconst WRAPPED_COMPONENT_SYMBOL = Symbol('withLayoutWrapped')\n\n/**\n * \u9AD8\u9636\u7EC4\u4EF6\u901A\u8FC7 withLayout \u5305\u88C5\u7EC4\u4EF6\uFF0C\u81EA\u52A8\u5E94\u7528\u6837\u5F0F\u548C\u5BB9\u5668\u5E03\u5C40\n *\n * @param WrappedComponent - \u9700\u8981\u5305\u88C5\u7684\u7EC4\u4EF6\n * @param defaultLayoutProps - \u9ED8\u8BA4\u6837\u5F0F\u5C5E\u6027\n */\
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,EAAA,cAAAC,EAAA,eAAAC,IAAA,eAAAC,EAAAL,GAmEI,IAAAM,EAAA,6BAnEJC,EAA+B,oBAC/BC,EAA2B,2BAC3BC,EAA8B,qCAC9BC,EAA+B,iCAC/BC,EAA0B,sCAC1BC,EAA0B,iCAE1B,MAAMC,EAA4C,CAChD,GAAI,yBACJ,GAAI,yBACJ,EAAG,yBACH,EAAG,yBACH,EAAG,uBACL,EAGMC,EAAkD,CACtD,GAAI,uCACJ,GAAI,uCACJ,EAAG,uCACH,EAAG,uCACH,EAAG,qCACL,EAuBMC,EAAeC,GAA+B,CAClD,MAAMC,KAAY,EAAAC,SAAkBF,CAAK,EACzC,MAAO,YAAS,cAAWC,CAAS,CAAC,EACvC,EAKaf,EAAqDc,GAAwC,CACxG,KAAM,CAAE,MAAAG,EAAO,IAAAC,EAAK,SAAAC,CAAS,EAAIL,EACjC,MAAO,CAAE,MAAAG,EAAO,IAAAC,EAAK,SAAAC,CAAS,CAChC,EAKMC,EAAgC,CAAC,CAAE,MAAAH,EAAO,IAAAC,EAAML,EAAY,CAAC,CAAC,EAAG,SAAAM,EAAW,EAAM,IAClF,CAACF,GAASE,EACL,QAIP,OAAC,SACC,yBAAwB,GACxB,gBAAeD,EACf,wBAAyB,CAAE,OAAQ,UAAUA,CAAG,MAAMD,CAAK,IAAK,EAClE,EAQShB,EAAY,CAACoB,EAAkCC,IAA+B,CACzF,MAAMJ,KAAM,WAAQ,IAAMG,GAAY,KAAOR,EAAY,CAAE,GAAGQ,EAAY,KAAAC,CAAK,CAAC,EAAG,CAACA,EAAMD,CAAU,CAAC,EAE/FE,KAAiB,WAAQ,OAAM,OAACH,EAAA,CAAQ,GAAGC,EAAY,IAAKH,EAAK,EAAI,CAACG,EAAYH,CAAG,CAAC,EAE5F,MAAO,CACL,UAAW,SAASA,CAAG,IACvB,eAAAK,EACA,IAAAL,CACF,CACF,EAEMM,EAAyBV,GAAkD,CAC/E,KAAM,CAAE,YAAAW,EAAa,WAAAC,CAAW,EAAIZ,GAAO,WAAa,CAAC,EACnDa,EAAgBD,EAAaf,EAAkBe,CAAU,EAAI,GAC7DE,EAAiBH,EAAcb,EAAwBa,CAAW,EAAI,GAC5E,MAAO,GAAGE,CAAa,IAAIC,CAAc,GAAG,KAAK,CACnD,EAKMC,EAA2B,OAAO,mBAAmB,
|
|
4
|
+
"sourcesContent": ["import React, { useMemo } from 'react'\nimport { simpleHash } from './simpleHash.js'\nimport getKeyPropsString from './getKeyPropsString.js'\nimport { Grid, GridItem } from '../components/grid.js'\nimport { Container } from '../components/container.js'\nimport ErrorBoundary from './ErrorBoundary.js'\n\nconst colContentClasses: Record<number, string> = {\n 12: 'col-start-1 col-end-13',\n 10: 'col-start-2 col-end-12',\n 8: 'col-start-3 col-end-11',\n 6: 'col-start-4 col-end-10',\n 4: 'col-start-5 col-end-9',\n} as const\n\n// \u9884\u5B9A\u4E49\u5E26 tablet \u524D\u7F00\u7684\u7C7B\u540D\uFF0C\u786E\u4FDD Tailwind \u53EF\u4EE5\u8BC6\u522B\nconst colContentClassesTablet: Record<number, string> = {\n 12: 'tablet:col-start-1 tablet:col-end-13',\n 10: 'tablet:col-start-2 tablet:col-end-12',\n 8: 'tablet:col-start-3 tablet:col-end-11',\n 6: 'tablet:col-start-4 tablet:col-end-10',\n 4: 'tablet:col-start-5 tablet:col-end-9',\n} as const\n\nexport interface ContainerProps {\n container?: {\n /** \u684C\u9762\u7AEF\u5217\u5185\u5BB9\u5BBD\u5EA6 */\n desktopSpan: number\n /** \u79FB\u52A8\u7AEF\u5217\u5185\u5BB9\u5BBD\u5EA6 */\n mobileSpan: number\n }\n}\n\nexport interface StylesProps {\n /** \u81EA\u5B9A\u4E49\u6837\u5F0F\u5B57\u7B26\u4E32\u6216\u5BF9\u8C61 */\n style?: string | React.CSSProperties\n /** \u552F\u4E00\u6807\u8BC6\u7B26 */\n uid?: string\n /** \u662F\u5426\u7981\u7528 */\n disabled?: boolean\n}\n\n/**\n * \u6839\u636E props \u751F\u6210\u786E\u5B9A\u6027 uid\n */\nconst generateUID = (props: Record<string, any>) => {\n const keyString = getKeyPropsString(props)\n return `style_${simpleHash(keyString)}`\n}\n\n/**\n * \u4ECE\u7EC4\u4EF6 props \u4E2D\u63D0\u53D6\u6837\u5F0F\u76F8\u5173\u5C5E\u6027\n */\nexport const getStylesProps = <T extends Record<string, unknown>>(props: T & StylesProps): StylesProps => {\n const { style, uid, disabled } = props\n return { style, uid, disabled }\n}\n\n/**\n * \u6837\u5F0F\u6CE8\u5165\u7EC4\u4EF6\n */\nconst Styles: React.FC<StylesProps> = ({ style, uid = generateUID({}), disabled = false }) => {\n if (!style || disabled) {\n return null\n }\n\n return (\n <style\n suppressHydrationWarning\n data-style-id={uid}\n dangerouslySetInnerHTML={{ __html: `.block-${uid} { ${style} }` }}\n />\n )\n}\n\n/**\n * \u6837\u5F0F Hook\uFF0C\u8FD4\u56DE\u6837\u5F0F\u7C7B\u540D\u548C\u6837\u5F0F\u7EC4\u4EF6\n * @param styleProps - \u6837\u5F0F\u5C5E\u6027\n */\nexport const useStyles = (styleProps: Partial<StylesProps>, data?: Record<string, any>) => {\n const uid = useMemo(() => styleProps?.uid || generateUID({ ...styleProps, data }), [data, styleProps])\n\n const StyleComponent = useMemo(() => <Styles {...styleProps} uid={uid} />, [styleProps, uid])\n\n return {\n className: `block-${uid} `,\n StyleComponent,\n uid,\n } as const\n}\n\nconst getContainerClassName = (props?: Partial<StylesProps & ContainerProps>) => {\n const { desktopSpan, mobileSpan } = props?.container || {}\n const mobileClasses = mobileSpan ? colContentClasses[mobileSpan] : ''\n const desktopClasses = desktopSpan ? colContentClassesTablet[desktopSpan] : ''\n return `${mobileClasses} ${desktopClasses}`.trim()\n}\n\n/**\n * \u6807\u8BB0\u7EC4\u4EF6\u662F\u5426\u5DF2\u88AB withLayout \u5305\u88C5\n */\nconst WRAPPED_COMPONENT_SYMBOL = Symbol('withLayoutWrapped')\n\n/**\n * \u9AD8\u9636\u7EC4\u4EF6\u901A\u8FC7 withLayout \u5305\u88C5\u7EC4\u4EF6\uFF0C\u81EA\u52A8\u5E94\u7528\u6837\u5F0F\u548C\u5BB9\u5668\u5E03\u5C40\n *\n * @param WrappedComponent - \u9700\u8981\u5305\u88C5\u7684\u7EC4\u4EF6\n * @param defaultLayoutProps - \u9ED8\u8BA4\u6837\u5F0F\u5C5E\u6027\n */\nexport function withLayout<P>(\n WrappedComponent: React.ComponentType<P>,\n defaultLayoutProps?: Partial<StylesProps & ContainerProps>\n) {\n // \u9632\u6B62\u91CD\u590D\u5305\u88C5\n if ((WrappedComponent as any)[WRAPPED_COMPONENT_SYMBOL]) {\n return WrappedComponent as any\n }\n // \u4F7F\u7528\u60A8\u7684\u7B80\u6D01\u65B9\u6CD5\uFF1A\u76F4\u63A5\u7528\u6CDB\u578B\u4FDD\u7559\u7C7B\u578B\n const withLayout = React.forwardRef<\n any,\n P & { style?: string | React.CSSProperties; container?: ContainerProps['container'] }\n >((props, ref) => {\n const propsStyleProps = getStylesProps(props)\n\n // \u5C06 style \u5BF9\u8C61\u8F6C\u6362\u4E3A\u5B57\u7B26\u4E32\n const styleToString = (style?: string | React.CSSProperties): string => {\n if (!style) return ''\n if (typeof style === 'string') return style\n if (typeof style === 'object' && Object.entries(style).length <= 0) return ''\n return (\n Object.entries(style)\n .map(([key, value]) => {\n const cssKey = key.replace(/([A-Z])/g, '-$1').toLowerCase()\n return `${cssKey}: ${value}`\n })\n .join('; ') + ';'\n )\n }\n\n // \u5408\u5E76 style \u5B57\u6BB5\uFF0C\u907F\u514D\u8986\u76D6\uFF0C\u786E\u4FDD\u6BCF\u4E2A\u6837\u5F0F\u90FD\u4EE5\u5206\u53F7\u7ED3\u5C3E\n const mergedStyle = [defaultLayoutProps?.style, propsStyleProps?.style]\n .map(styleToString)\n .filter((style): style is string => Boolean(style))\n .map(style => (style.trim().endsWith(';') ? style : `${style};`))\n .join(' ')\n\n const finalStyleProps = {\n ...defaultLayoutProps,\n ...propsStyleProps,\n ...(mergedStyle && { style: mergedStyle }),\n }\n\n const { className, StyleComponent } = useStyles(finalStyleProps, (props as any)?.data)\n\n const WithContainerWrapper = (props: any) => {\n return (\n <Container className={`${className} ${(props as any)?.className || ''}`.trim()}>\n <Grid className=\"container_grid\">\n <GridItem className={getContainerClassName(props)}>\n <WrappedComponent {...props} ref={ref} />\n </GridItem>\n </Grid>\n </Container>\n )\n }\n\n const WithoutContainerWrapper = (props: any) => {\n return <WrappedComponent {...props} className={`${className} ${props?.className || '' || ''}`.trim()} ref={ref} />\n }\n\n // @ts-ignore\n // eslint-disable-next-line no-unused-vars\n const { style: _style, ...withOutStyleProps } = props\n\n return (\n <>\n <ErrorBoundary>\n {StyleComponent}\n {Reflect.ownKeys((withOutStyleProps as any)?.container || {})?.length > 0\n ? WithContainerWrapper(withOutStyleProps)\n : WithoutContainerWrapper(withOutStyleProps)}\n </ErrorBoundary>\n </>\n )\n })\n\n withLayout.displayName = `WithLayout${WrappedComponent.displayName || WrappedComponent.name || 'Component'}`\n\n // \u6807\u8BB0\u7EC4\u4EF6\u5DF2\u88AB\u5305\u88C5\n ;(withLayout as any)[WRAPP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EAC3E,mBAAC,QAAK,UAAU,iBACd,mBAAC,YAAS,UAAWU,EAAsBV,CAAK,EAC9C,mBAACgB,EAAA,CAAkB,GAAGhB,EAAO,IAAKmB,EAAK,EACzC,EACF,EACF,EAIES,EAA2B5B,MACxB,OAACgB,EAAA,CAAkB,GAAGhB,EAAO,UAAW,GAAG0B,CAAS,IAAI1B,GAAO,WAAa,IAAM,EAAE,GAAG,KAAK,EAAG,IAAKmB,EAAK,EAK5G,CAAE,MAAOU,EAAQ,GAAGC,CAAkB,EAAI9B,EAEhD,SACE,mBACE,oBAAC,EAAA+B,QAAA,CACE,UAAAtB,EACA,QAAQ,QAASqB,GAA2B,WAAa,CAAC,CAAC,GAAG,OAAS,EACpEH,EAAqBG,CAAiB,EACtCF,EAAwBE,CAAiB,GAC/C,EACF,CAEJ,CAAC,EAED,OAAA1C,EAAW,YAAc,aAAa4B,EAAiB,aAAeA,EAAiB,MAAQ,WAAW,GAGxG5B,EAAmB2B,CAAwB,EAAI,GAC1C3B,CACT",
|
|
6
6
|
"names": ["Styles_exports", "__export", "getStylesProps", "useStyles", "withLayout", "__toCommonJS", "import_jsx_runtime", "import_react", "import_simpleHash", "import_getKeyPropsString", "import_grid", "import_container", "import_ErrorBoundary", "colContentClasses", "colContentClassesTablet", "generateUID", "props", "keyString", "getKeyPropsString", "style", "uid", "disabled", "Styles", "styleProps", "data", "StyleComponent", "getContainerClassName", "desktopSpan", "mobileSpan", "mobileClasses", "desktopClasses", "WRAPPED_COMPONENT_SYMBOL", "WrappedComponent", "defaultLayoutProps", "React", "ref", "propsStyleProps", "styleToString", "key", "value", "mergedStyle", "finalStyleProps", "className", "WithContainerWrapper", "WithoutContainerWrapper", "_style", "withOutStyleProps", "ErrorBoundary"]
|
|
7
7
|
}
|
|
@@ -48,40 +48,5 @@ export type AccordionCardsType = Omit<React.HTMLAttributes<HTMLDivElement>, 'cla
|
|
|
48
48
|
primaryButton?: (_v: any, _index: number) => void;
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
|
-
declare const _default:
|
|
52
|
-
className?: string;
|
|
53
|
-
data: {
|
|
54
|
-
key?: string;
|
|
55
|
-
title?: string;
|
|
56
|
-
products: Array<ItemType>;
|
|
57
|
-
/** 按钮形状 */
|
|
58
|
-
shape?: "round" | "square";
|
|
59
|
-
/** 卡片形状 */
|
|
60
|
-
itemShape?: "round" | "square";
|
|
61
|
-
/** 主按钮配置 */
|
|
62
|
-
primaryButton?: string;
|
|
63
|
-
theme?: "light" | "dark";
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* 自动播放配置
|
|
67
|
-
*/
|
|
68
|
-
autoplay?: {
|
|
69
|
-
/**
|
|
70
|
-
* 是否开启自动播放
|
|
71
|
-
*/
|
|
72
|
-
enabled: boolean;
|
|
73
|
-
/**
|
|
74
|
-
* 是否循环播放
|
|
75
|
-
*/
|
|
76
|
-
loop?: boolean;
|
|
77
|
-
/**
|
|
78
|
-
* 自动播放间隔时间,单位毫秒
|
|
79
|
-
*/
|
|
80
|
-
interval?: number;
|
|
81
|
-
};
|
|
82
|
-
/** 按钮事件*/
|
|
83
|
-
event?: {
|
|
84
|
-
primaryButton?: (_v: any, _index: number) => void;
|
|
85
|
-
};
|
|
86
|
-
} & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
51
|
+
declare const _default: any;
|
|
87
52
|
export default _default;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ActivityScheduleProps } from './types.js';
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<ActivityScheduleProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
1
|
+
declare const _default: any;
|
|
4
2
|
export default _default;
|
|
5
3
|
export type { ActivityScheduleProps, ActivityScheduleData, ActivityScheduleItem } from './types.js';
|
|
@@ -54,18 +54,6 @@ interface AiuiContextType {
|
|
|
54
54
|
* 文案配置,商户可通过此字段覆盖默认文案
|
|
55
55
|
*/
|
|
56
56
|
copyWriting?: Record<string, string>;
|
|
57
|
-
/**
|
|
58
|
-
* 是否启用自动埋点(点击事件追踪),默认为 true
|
|
59
|
-
* 设置为 false 可关闭自动埋点,适用于需要完全自定义埋点的场景
|
|
60
|
-
*
|
|
61
|
-
* @default true
|
|
62
|
-
* @example
|
|
63
|
-
* // 关闭自动埋点
|
|
64
|
-
* <AiuiProvider trackingData={{ pageGroup: 'Home' }} autoTracking={false}>
|
|
65
|
-
* {children}
|
|
66
|
-
* </AiuiProvider>
|
|
67
|
-
*/
|
|
68
|
-
autoTracking?: boolean;
|
|
69
57
|
/**
|
|
70
58
|
* 自定义曝光回调。传入后会替代默认的 GA 埋点逻辑。
|
|
71
59
|
*
|
|
@@ -84,7 +72,7 @@ interface AiuiContextType {
|
|
|
84
72
|
}
|
|
85
73
|
export declare const AiuiContext: React.Context<AiuiContextType>;
|
|
86
74
|
export declare const useAiuiContext: () => AiuiContextType;
|
|
87
|
-
declare const AiuiProvider: ({ children,
|
|
75
|
+
declare const AiuiProvider: ({ children, ...rest }: {
|
|
88
76
|
children: React.ReactNode;
|
|
89
77
|
} & AiuiContextType) => import("react/jsx-runtime").JSX.Element;
|
|
90
78
|
export default AiuiProvider;
|