@anker-in/headless-ui 1.1.9-temp-112704 → 1.1.9-temp-112705

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.
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var pe=Object.create;var g=Object.defineProperty;var ue=Object.getOwnPropertyDescriptor;var fe=Object.getOwnPropertyNames;var ye=Object.getPrototypeOf,ge=Object.prototype.hasOwnProperty;var ve=(a,o)=>{for(var t in o)g(a,t,{get:o[t],enumerable:!0})},B=(a,o,t,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of fe(o))!ge.call(a,n)&&n!==t&&g(a,n,{get:()=>o[n],enumerable:!(s=ue(o,n))||s.enumerable});return a};var c=(a,o,t)=>(t=a!=null?pe(ye(a)):{},B(o||!a||!a.__esModule?g(t,"default",{value:a,enumerable:!0}):t,a)),be=a=>B(g({},"__esModule",{value:!0}),a);var He={};ve(He,{default:()=>xe});module.exports=be(He);var e=require("react/jsx-runtime"),r=c(require("react")),Y=require("es-toolkit"),q=require("react-intersection-observer"),u=require("../../helpers/utils.js"),I=require("../../shared/Styles.js"),F=c(require("../Slogan/index.js")),j=require("../VideoModal/YouTubePlayer.js"),m=require("../../components/gird.js"),G=require("../../components/container.js"),V=c(require("../BrandEquity/index.js")),O=c(require("../MemberEquity/index.js")),Q=c(require("../Spacer/index.js")),W=c(require("gsap")),k=require("@payloadcms/richtext-lexical/html"),M=require("react-responsive"),_=c(require("../../helpers/ScrollLoadVideo.js"));const $=({defaultConverters:a})=>({...a,text:o=>{const{node:t}=o;return t.$&&t.$.color?`<span class="lexical-${t.$.color}">${t.text}</span>`:t.text}}),R=({children:a,spaceY:o,className:t})=>{const s=(0,M.useMediaQuery)({query:"(max-width: 768px)"});return(0,e.jsx)(G.Container,{spaceY:o,className:(0,u.cn)("!bg-transparent",t),children:(0,e.jsxs)(m.Grid,{children:[!s&&(0,e.jsx)(m.GridItem,{span:1}),(0,e.jsx)(m.GridItem,{span:s?12:10,children:a}),!s&&(0,e.jsx)(m.GridItem,{span:1})]})})},we=r.default.forwardRef(({children:a,id:o,components:t},s)=>{const n=(0,r.useRef)(null);return(0,r.useImperativeHandle)(s,()=>({mediaPlayerStickyRef:n.current})),(0,e.jsxs)("div",{ref:n,className:"relative z-10",children:[(0,e.jsx)(e.Fragment,{children:a}),(0,e.jsx)(e.Fragment,{children:t?.map(l=>{switch(l.blockType){case"ipc-brand-equity":return(0,e.jsx)("div",{className:"relative z-20 bg-transparent",children:(0,e.jsx)(R,{spaceY:"none",children:(0,e.jsx)(V.default,{data:l,style:l?.style})})});case"ipc-member-equity":return(0,e.jsx)("div",{className:"relative z-20 w-full bg-transparent",children:(0,e.jsx)(R,{spaceY:"none",children:(0,e.jsx)(O.default,{data:l,className:"w-full",style:l?.style})})});case"ipc-spacer":return(0,e.jsx)(Q.default,{data:l,style:l?.style,className:"!bg-transparent"});default:return null}})})]})}),he=(0,r.forwardRef)(({className:a="",wrapperClassName:o="",id:t,data:{title:s,videoTitle:n,mobVideo:l,mobImg:f,img:y,isYouTube:A,youtubePcId:N,youtubeMobileId:D,video:v,theme:P,shape:J,components:K}},Re)=>{const S=(0,r.useRef)(null),b=(0,r.useRef)(null),{ref:U,inView:p}=(0,q.useInView)(),[ke,X]=(0,r.useState)(0),[T,Z]=(0,r.useState)(!1),[ee,te]=(0,r.useState)(!1),re=(0,r.useRef)(null),w=(0,r.useRef)(null),ae=typeof s=="string"?s:s&&(0,k.convertLexicalToHTML)({data:s,converters:$});typeof n=="string"||n&&(0,k.convertLexicalToHTML)({data:n,converters:$});const[oe,E]=(0,r.useState)(0),[d,se]=(0,r.useState)(!1),z=(0,M.useMediaQuery)({query:"(max-width: 768px)"});(0,r.useEffect)(()=>{se(z)},[z]);const h=(0,Y.debounce)(()=>{if(b.current){const x=b.current.getBoundingClientRect(),i=d?window.screen.height:window.innerHeight,ne=window.scrollY||window.pageYOffset,le=x.bottom+ne,H=document.documentElement.scrollHeight-le;if(w.current?.mediaPlayerStickyRef){const ie=w.current.mediaPlayerStickyRef.getBoundingClientRect(),ce=window.scrollY||window.pageYOffset,de=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),me=ie.bottom+ce,C=Math.max(0,de-me),L=C>i?i:C;console.log("currentHeight1",L),E(L)}else console.log("currentHeight2",i,H),E(H>i?i:H);X(i)}},2e3);return(0,r.useEffect)(()=>{p&&!T&&(S.current?.play(),Z(!0))},[p,T]),(0,r.useEffect)(()=>(h(),window.addEventListener("resize",h),()=>{window.removeEventListener("resize",h)}),[]),(0,r.useEffect)(()=>{function x(){const i=d?window.screen.height:window.innerHeight;W.default.timeline({scrollTrigger:{trigger:`#${t}`,start:"top top",end:`top+=${i*1.8}px bottom`,scrub:.5}}).from(`#${t} .media-content`,{top:"50%",transform:"translate(-50%, -50%)"}).to(`.${t} .sticky-cover`,{backdropFilter:"blur(8px)",duration:.4}).to(`#${t} .media-content`,{top:"100%",transform:"translate(-50%, -100%)",duration:1},"<")}p&&x()},[p]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{id:t,className:(0,u.cn)("relative z-20 h-screen w-full",a,{"aiui-dark":P==="dark","rounded-box":J==="rounded"}),ref:re,children:(0,e.jsx)("div",{ref:U,className:"media-content translate-z-0 absolute left-1/2 top-1/2 z-10 w-full -translate-x-1/2 -translate-y-1/2 antialiased",style:{willChange:"transform",contain:"paint"},children:(0,e.jsx)(R,{spaceY:"tablet:my-[32px] my-[24px] space-y-4",children:(0,e.jsx)(F.default,{className:"sticky-title antialiased",data:{title:ae||"",theme:P}})})})}),(0,e.jsxs)("div",{ref:b,style:{marginBottom:`-${oe}px`,zIndex:p?2:1},className:(0,u.cn)(t,"relative mt-[-200vh]",o),children:[(0,e.jsx)("div",{className:"sticky top-0 ",children:(0,e.jsxs)("div",{className:(0,u.cn)("media-cover","relative h-screen w-full"),children:[A?(0,e.jsx)(j.YouTubePlayer,{youTubeId:d&&D||N}):v?.url&&(0,e.jsx)(_.default,{videoRef:S,poster:d&&f?.url?f?.url:y?.url,src:d&&l?.url?l?.url:v?.url,className:"lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] lg:aspect-w-[1440] lg:aspect-h-[700] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]",videoClassName:" object-cover object-[82%]",muted:!0,loop:!1,playsInline:!0,onEnded:()=>{te(!0)}}),y?.url&&(!v?.url||ee)&&(0,e.jsx)("img",{src:d&&f?.url?f?.url:y?.url,alt:y?.alt,className:"z-1 absolute left-0 top-0 size-full object-cover object-[82%]",loading:"lazy"}),(0,e.jsx)("div",{className:"sticky-cover absolute left-0 top-0 z-10 size-full",style:{backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)",willChange:"backdrop-filter"}})]})}),(0,e.jsx)("div",{className:"relative h-screen w-full"}),(0,e.jsx)(we,{ref:w,components:K}),(0,e.jsx)("div",{className:"relative h-screen w-full"})]})]})});var xe=(0,I.withLayout)(he);
1
+ "use strict";"use client";var pe=Object.create;var g=Object.defineProperty;var me=Object.getOwnPropertyDescriptor;var ue=Object.getOwnPropertyNames;var fe=Object.getPrototypeOf,ge=Object.prototype.hasOwnProperty;var ye=(r,s)=>{for(var t in s)g(r,t,{get:s[t],enumerable:!0})},L=(r,s,t,n)=>{if(s&&typeof s=="object"||typeof s=="function")for(let a of ue(s))!ge.call(r,a)&&a!==t&&g(r,a,{get:()=>s[a],enumerable:!(n=me(s,a))||n.enumerable});return r};var l=(r,s,t)=>(t=r!=null?pe(fe(r)):{},L(s||!r||!r.__esModule?g(t,"default",{value:r,enumerable:!0}):t,r)),be=r=>L(g({},"__esModule",{value:!0}),r);var xe={};ye(xe,{default:()=>he});module.exports=be(xe);var e=require("react/jsx-runtime"),o=l(require("react")),Y=require("es-toolkit"),q=require("react-intersection-observer"),m=require("../../helpers/utils.js"),F=require("../../shared/Styles.js"),I=l(require("../Slogan/index.js")),j=require("../VideoModal/YouTubePlayer.js"),d=require("../../components/gird.js"),G=require("../../components/container.js"),V=l(require("../BrandEquity/index.js")),O=l(require("../MemberEquity/index.js")),Q=l(require("../Spacer/index.js")),W=l(require("gsap")),N=require("@payloadcms/richtext-lexical/html"),k=require("react-responsive"),_=l(require("../../helpers/ScrollLoadVideo.js"));const $=({defaultConverters:r})=>({...r,text:s=>{const{node:t}=s;return t.$&&t.$.color?`<span class="lexical-${t.$.color}">${t.text}</span>`:t.text}}),H=({children:r,spaceY:s,className:t})=>{const n=(0,k.useMediaQuery)({query:"(max-width: 768px)"});return(0,e.jsx)(G.Container,{spaceY:s,className:(0,m.cn)("!bg-transparent",t),children:(0,e.jsxs)(d.Grid,{children:[!n&&(0,e.jsx)(d.GridItem,{span:1}),(0,e.jsx)(d.GridItem,{span:n?12:10,children:r}),!n&&(0,e.jsx)(d.GridItem,{span:1})]})})},ve=o.default.forwardRef(({children:r,id:s,components:t},n)=>(0,e.jsxs)("div",{className:"relative z-10",children:[(0,e.jsx)(e.Fragment,{children:r}),(0,e.jsx)(e.Fragment,{children:t?.map(a=>{switch(a.blockType){case"ipc-brand-equity":return(0,e.jsx)("div",{className:"relative z-20 bg-transparent",children:(0,e.jsx)(H,{spaceY:"none",children:(0,e.jsx)(V.default,{data:a,style:a?.style})})});case"ipc-member-equity":return(0,e.jsx)("div",{className:"relative z-20 w-full bg-transparent",children:(0,e.jsx)(H,{spaceY:"none",children:(0,e.jsx)(O.default,{data:a,className:"w-full",style:a?.style})})});case"ipc-spacer":return(0,e.jsx)(Q.default,{data:a,style:a?.style,className:"!bg-transparent"});default:return null}})})]})),we=(0,o.forwardRef)(({className:r="",wrapperClassName:s="",id:t,data:{title:n,videoTitle:a,mobVideo:M,mobImg:u,img:f,isYouTube:A,youtubePcId:R,youtubeMobileId:J,video:y,theme:T,shape:K,components:U}},He)=>{const z=(0,o.useRef)(null),b=(0,o.useRef)(null),{ref:X,inView:p}=(0,q.useInView)(),[Ne,Z]=(0,o.useState)(0),[C,D]=(0,o.useState)(!1),[ee,te]=(0,o.useState)(!1),v=(0,o.useRef)(null),re=typeof n=="string"?n:n&&(0,N.convertLexicalToHTML)({data:n,converters:$});typeof a=="string"||a&&(0,N.convertLexicalToHTML)({data:a,converters:$});const[oe,P]=(0,o.useState)(0),[c,se]=(0,o.useState)(!1),E=(0,k.useMediaQuery)({query:"(max-width: 768px)"});(0,o.useEffect)(()=>{se(E)},[E]);const w=(0,Y.debounce)(()=>{if(b.current){const h=b.current.getBoundingClientRect(),i=c?window.screen.height:window.innerHeight,ae=window.scrollY||window.pageYOffset,ne=h.bottom+ae,x=document.documentElement.scrollHeight-ne;if(v.current){const ie=v.current?.getBoundingClientRect(),le=window.scrollY||window.pageYOffset,ce=Math.min(document.documentElement.scrollHeight,document.body.scrollHeight),de=ie.bottom+le,S=Math.max(0,ce-de),B=S>i?i:S;console.log("currentHeight1",B),P(B)}else console.log("currentHeight2",i,x),P(x>i?i:x);Z(i)}},2e3);return(0,o.useEffect)(()=>{p&&!C&&(z.current?.play(),D(!0))},[p,C]),(0,o.useEffect)(()=>(w(),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)}),[]),(0,o.useEffect)(()=>{function h(){const i=c?window.screen.height:window.innerHeight;W.default.timeline({scrollTrigger:{trigger:`#${t}`,start:"top top",end:`top+=${i*1.8}px bottom`,scrub:.5}}).from(`#${t} .media-content`,{top:"50%",transform:"translate(-50%, -50%)"}).to(`.${t} .sticky-cover`,{backdropFilter:"blur(8px)",duration:.4}).to(`#${t} .media-content`,{top:"100%",transform:"translate(-50%, -100%)",duration:1},"<")}p&&h()},[p]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{id:t,className:(0,m.cn)("relative z-20 h-screen w-full",r,{"aiui-dark":T==="dark","rounded-box":K==="rounded"}),ref:v,children:(0,e.jsx)("div",{ref:X,className:"media-content translate-z-0 absolute left-1/2 top-1/2 z-10 w-full -translate-x-1/2 -translate-y-1/2 antialiased",style:{willChange:"transform",contain:"paint"},children:(0,e.jsx)(H,{spaceY:"tablet:my-[32px] my-[24px] space-y-4",children:(0,e.jsx)(I.default,{className:"sticky-title antialiased",data:{title:re||"",theme:T}})})})}),(0,e.jsxs)("div",{ref:b,style:{marginBottom:`-${oe}px`,zIndex:p?2:1},className:(0,m.cn)(t,"relative mt-[-200vh]",s),children:[(0,e.jsx)("div",{className:"sticky top-0 ",children:(0,e.jsxs)("div",{className:(0,m.cn)("media-cover","relative h-screen w-full"),children:[A?(0,e.jsx)(j.YouTubePlayer,{youTubeId:c&&J||R}):y?.url&&(0,e.jsx)(_.default,{videoRef:z,poster:c&&u?.url?u?.url:f?.url,src:c&&M?.url?M?.url:y?.url,className:"lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] lg:aspect-w-[1440] lg:aspect-h-[700] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]",videoClassName:" object-cover object-[82%]",muted:!0,loop:!1,playsInline:!0,onEnded:()=>{te(!0)}}),f?.url&&(!y?.url||ee)&&(0,e.jsx)("img",{src:c&&u?.url?u?.url:f?.url,alt:f?.alt,className:"z-1 absolute left-0 top-0 size-full object-cover object-[82%]",loading:"lazy"}),(0,e.jsx)("div",{className:"sticky-cover absolute left-0 top-0 z-10 size-full",style:{backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)",willChange:"backdrop-filter"}})]})}),(0,e.jsx)("div",{className:"relative h-screen w-full"}),(0,e.jsx)(ve,{components:U}),(0,e.jsx)("div",{className:"relative h-screen w-full"})]})]})});var he=(0,F.withLayout)(we);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/MediaPlayerSticky/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useState, useRef, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport { debounce } from 'es-toolkit'\nimport { useInView } from 'react-intersection-observer'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport Slogan from '../Slogan/index.js'\nimport { YouTubePlayer } from '../VideoModal/YouTubePlayer.js'\nimport { Grid, GridItem } from '../../components/gird.js'\nimport { Container } from '../../components/container.js'\nimport BrandEquity from '../BrandEquity/index.js'\nimport MemberEquity from '../MemberEquity/index.js'\nimport Spacer from '../Spacer/index.js'\nimport gsap from 'gsap'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\n\nimport type { HTMLConvertersFunction } from '@payloadcms/richtext-lexical/html'\n\nimport { useMediaQuery } from 'react-responsive'\nimport type { MediaPlayerBaseProps, MediaPlayerComponent } from './types.js'\nimport ScrollLoadVideo from '../../helpers/ScrollLoadVideo.js'\n\nconst htmlConverters: HTMLConvertersFunction = ({ defaultConverters }) => ({\n ...defaultConverters,\n text: args => {\n const { node } = args\n\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 SubContainer = ({\n children,\n spaceY,\n className,\n}: {\n children: React.ReactNode\n spaceY?: string\n className?: string\n}) => {\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n return (\n <Container spaceY={spaceY} className={cn('!bg-transparent', className)}>\n <Grid>\n {!isMobile && <GridItem span={1} />}\n <GridItem span={isMobile ? 12 : 10}>{children}</GridItem>\n {!isMobile && <GridItem span={1} />}\n </Grid>\n </Container>\n )\n}\n\nconst SubBox = React.forwardRef<\n {\n mediaPlayerStickyRef: HTMLDivElement | null\n },\n {\n children?: React.ReactNode\n id?: string\n components?: MediaPlayerComponent[]\n }\n>(({ children, id, components }, ref) => {\n const mediaPlayerStickyRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => ({\n mediaPlayerStickyRef: mediaPlayerStickyRef.current,\n }))\n\n return (\n <div ref={mediaPlayerStickyRef} className=\"relative z-10\">\n <>{children}</>\n <>\n {components?.map((componentData: any) => {\n switch (componentData.blockType) {\n case 'ipc-brand-equity': {\n return (\n <div className=\"relative z-20 bg-transparent\">\n <SubContainer spaceY=\"none\">\n <BrandEquity data={componentData} style={componentData?.style} />\n </SubContainer>\n </div>\n )\n }\n case 'ipc-member-equity': {\n return (\n <div className=\"relative z-20 w-full bg-transparent\">\n <SubContainer spaceY=\"none\">\n <MemberEquity data={componentData} className=\"w-full\" style={componentData?.style} />\n </SubContainer>\n </div>\n )\n }\n case 'ipc-spacer': {\n return <Spacer data={componentData} style={componentData?.style} className=\"!bg-transparent\" />\n }\n default:\n return null\n }\n })}\n </>\n </div>\n )\n})\n\nconst MediaPlayerSticky = forwardRef<\n {\n mediaPlayerStickyRef: HTMLDivElement\n },\n MediaPlayerBaseProps\n>(\n (\n {\n className = '',\n wrapperClassName = '',\n id,\n data: {\n title,\n videoTitle,\n mobVideo,\n mobImg,\n img,\n isYouTube,\n youtubePcId,\n youtubeMobileId,\n video,\n theme,\n shape,\n components,\n },\n },\n ref\n ) => {\n const videoRef = useRef<HTMLVideoElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const { ref: inViewRef, inView } = useInView()\n const [screenHeight, setScreenHeight] = useState(0)\n const [isPlaying, setIsPlaying] = useState(false)\n const [isEntered, setIsEntered] = useState(false)\n const wrapperRef = useRef<HTMLDivElement>(null)\n const subBoxRef = useRef<{ mediaPlayerStickyRef: HTMLDivElement | null }>(null)\n\n const title_html =\n typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title, converters: htmlConverters })\n typeof videoTitle === 'string'\n ? videoTitle\n : videoTitle && convertLexicalToHTML({ data: videoTitle, converters: htmlConverters })\n\n const [btb, setbtb] = useState(0)\n const [isMobile, setIsMobile] = useState(false)\n const mediaQuery = useMediaQuery({ query: '(max-width: 768px)' })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const debouncedHandleResize = debounce(() => {\n if (boxRef.current) {\n const rect = boxRef.current.getBoundingClientRect()\n const screenHeight = isMobile ? window.screen.height : 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 // \u8BA1\u7B97 mediaPlayerStickyRef \u7684\u5E95\u90E8\u5230\u5C4F\u5E55\u6EDA\u52A8\u533A\u57DF\u6700\u5E95\u90E8\u7684\u8DDD\u79BB\n if (subBoxRef.current?.mediaPlayerStickyRef) {\n const mediaPlayerStickyRect = subBoxRef.current.mediaPlayerStickyRef.getBoundingClientRect()\n const scrollTop = window.scrollY || window.pageYOffset\n // \u4F7F\u7528 body \u548C documentElement \u7684\u6700\u5927\u503C\u6765\u83B7\u53D6\u51C6\u786E\u7684\u9875\u9762\u9AD8\u5EA6\n const pageHeight = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight)\n // \u5143\u7D20\u5E95\u90E8\u5230\u9875\u9762\u5E95\u90E8\u7684\u8DDD\u79BB = \u9875\u9762\u9AD8\u5EA6 - (\u5143\u7D20\u5E95\u90E8\u5230\u89C6\u53E3\u9876\u90E8\u7684\u8DDD\u79BB + \u6EDA\u52A8\u8DDD\u79BB)\n const elementBottomToPageTop = mediaPlayerStickyRect.bottom + scrollTop\n const distanceToPageBottom = Math.max(0, pageHeight - elementBottomToPageTop)\n const currentHeight = distanceToPageBottom > screenHeight ? screenHeight : distanceToPageBottom\n console.log('currentHeight1', currentHeight)\n setbtb(currentHeight)\n } else {\n console.log('currentHeight2', screenHeight, distanceToPageBottom)\n setbtb(distanceToPageBottom > screenHeight ? screenHeight : distanceToPageBottom)\n }\n setScreenHeight(screenHeight)\n }\n }, 2000)\n\n useEffect(() => {\n if (inView && !isPlaying) {\n videoRef.current?.play()\n setIsPlaying(true)\n }\n }, [inView, isPlaying])\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 const height = isMobile ? window.screen.height : window.innerHeight\n gsap\n .timeline({\n scrollTrigger: {\n trigger: `#${id}`,\n start: 'top top',\n end: `top+=${height * 1.8}px bottom`,\n scrub: 0.5,\n },\n })\n .from(`#${id} .media-content`, { top: '50%', transform: 'translate(-50%, -50%)' })\n .to(`.${id} .sticky-cover`, {\n backdropFilter: 'blur(8px)',\n duration: 0.4,\n })\n .to(\n `#${id} .media-content`,\n {\n top: '100%',\n transform: 'translate(-50%, -100%)',\n duration: 1,\n },\n '<'\n )\n }\n if (inView) {\n gsapResize()\n }\n }, [inView])\n\n return (\n <>\n <div\n id={id}\n className={cn('relative z-20 h-screen w-full', className, {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n })}\n ref={wrapperRef}\n >\n <div\n ref={inViewRef}\n className=\"media-content translate-z-0 absolute left-1/2 top-1/2 z-10 w-full -translate-x-1/2 -translate-y-1/2 antialiased\"\n style={{ willChange: 'transform', contain: 'paint' }}\n >\n <SubContainer spaceY=\"tablet:my-[32px] my-[24px] space-y-4\">\n <Slogan className=\"sticky-title antialiased\" data={{ title: title_html || '', theme }} />\n </SubContainer>\n </div>\n </div>\n\n <div\n ref={boxRef}\n style={{ marginBottom: `-${btb}px`, zIndex: inView ? 2 : 1 }}\n className={cn(id, 'relative mt-[-200vh]', wrapperClassName)}\n >\n <div className=\"sticky top-0 \">\n <div className={cn('media-cover', 'relative h-screen w-full')}>\n {isYouTube ? (\n <YouTubePlayer youTubeId={isMobile ? youtubeMobileId || youtubePcId : youtubePcId} />\n ) : (\n video?.url && (\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={isMobile && mobImg?.url ? mobImg?.url : img?.url}\n src={isMobile && mobVideo?.url ? mobVideo?.url : video?.url}\n className=\"lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] lg:aspect-w-[1440] lg:aspect-h-[700] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]\"\n videoClassName=\" object-cover object-[82%]\"\n muted\n loop={false}\n playsInline\n onEnded={() => {\n setIsEntered(true)\n }}\n />\n )\n )}\n {img?.url && (!video?.url || isEntered) && (\n <img\n src={isMobile && mobImg?.url ? mobImg?.url : img?.url}\n alt={img?.alt}\n className=\"z-1 absolute left-0 top-0 size-full object-cover object-[82%]\"\n loading=\"lazy\"\n />\n )}\n <div\n className=\"sticky-cover absolute left-0 top-0 z-10 size-full\"\n style={{\n backdropFilter: 'blur(0px)',\n WebkitBackdropFilter: 'blur(0px)',\n willChange: 'backdrop-filter',\n }}\n />\n </div>\n </div>\n\n <div className=\"relative h-screen w-full\" />\n <SubBox ref={subBoxRef} components={components}></SubBox>\n <div className=\"relative h-screen w-full\" />\n </div>\n </>\n )\n }\n)\n\nexport default withLayout(MediaPlayerSticky)\n"],
5
- "mappings": "mlBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IA+CM,IAAAI,EAAA,6BA9CNC,EAAoF,oBACpFC,EAAyB,sBACzBC,EAA0B,uCAC1BC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAAmB,iCACnBC,EAA8B,0CAC9BC,EAA+B,oCAC/BC,EAA0B,yCAC1BC,EAAwB,sCACxBC,EAAyB,uCACzBC,EAAmB,iCACnBC,EAAiB,mBACjBC,EAAqC,6CAIrCC,EAA8B,4BAE9BC,EAA4B,+CAE5B,MAAMC,EAAyC,CAAC,CAAE,kBAAAC,CAAkB,KAAO,CACzE,GAAGA,EACH,KAAMC,GAAQ,CACZ,KAAM,CAAE,KAAAC,CAAK,EAAID,EAGjB,OAAIC,EAAK,GAAKA,EAAK,EAAE,MACZ,wBAAwBA,EAAK,EAAE,KAAK,KAAKA,EAAK,IAAI,UAEpDA,EAAK,IACd,CACF,GAEMC,EAAe,CAAC,CACpB,SAAAC,E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", "__export", "MediaPlayerSticky_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_es_toolkit", "import_react_intersection_observer", "import_utils", "import_Styles", "import_Slogan", "import_YouTubePlayer", "import_gird", "import_container", "import_BrandEquity", "import_MemberEquity", "import_Spacer", "import_gsap", "import_html", "import_react_responsive", "import_ScrollLoadVideo", "htmlConverters", "defaultConverters", "args", "node", "SubContainer", "children", "spaceY", "className", "isMobile", "SubBox", "React", "id", "components", "ref", "mediaPlayerStickyRef", "componentData", "BrandEquity", "MemberEquity", "Spacer", "MediaPlayerSticky", "wrapperClassName", "title", "videoTitle", "mobVideo", "mobImg", "img", "isYouTube", "youtubePcId", "youtubeMobileId", "video", "theme", "shape", "videoRef", "boxRef", "inViewRef", "inView", "screenHeight", "setScreenHeight", "isPlaying", "setIsPlaying", "isEntered", "setIsEntered", "wrapperRef", "subBoxRef", "title_html", "btb", "setbtb", "setIsMobile", "mediaQuery", "debouncedHandleResize", "rect", "scrollTop", "elementBottomToPageTop", "distanceToPageBottom", "mediaPlayerStickyRect", "pageHeight", "currentHeight", "gsapResize", "height", "gsap", "Slogan", "ScrollLoadVideo"]
4
+ "sourcesContent": ["'use client'\nimport React, { useState, useRef, useEffect, forwardRef } from 'react'\nimport { debounce } from 'es-toolkit'\nimport { useInView } from 'react-intersection-observer'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport Slogan from '../Slogan/index.js'\nimport { YouTubePlayer } from '../VideoModal/YouTubePlayer.js'\nimport { Grid, GridItem } from '../../components/gird.js'\nimport { Container } from '../../components/container.js'\nimport BrandEquity from '../BrandEquity/index.js'\nimport MemberEquity from '../MemberEquity/index.js'\nimport Spacer from '../Spacer/index.js'\nimport gsap from 'gsap'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\n\nimport type { HTMLConvertersFunction } from '@payloadcms/richtext-lexical/html'\n\nimport { useMediaQuery } from 'react-responsive'\nimport type { MediaPlayerBaseProps, MediaPlayerComponent } from './types.js'\nimport ScrollLoadVideo from '../../helpers/ScrollLoadVideo.js'\n\nconst htmlConverters: HTMLConvertersFunction = ({ defaultConverters }) => ({\n ...defaultConverters,\n text: args => {\n const { node } = args\n\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 SubContainer = ({\n children,\n spaceY,\n className,\n}: {\n children: React.ReactNode\n spaceY?: string\n className?: string\n}) => {\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n return (\n <Container spaceY={spaceY} className={cn('!bg-transparent', className)}>\n <Grid>\n {!isMobile && <GridItem span={1} />}\n <GridItem span={isMobile ? 12 : 10}>{children}</GridItem>\n {!isMobile && <GridItem span={1} />}\n </Grid>\n </Container>\n )\n}\n\nconst SubBox = React.forwardRef<\n {\n mediaPlayerStickyRef: HTMLDivElement | null\n },\n {\n children?: React.ReactNode\n id?: string\n components?: MediaPlayerComponent[]\n }\n>(({ children, id, components }, ref) => {\n return (\n <div className=\"relative z-10\">\n <>{children}</>\n <>\n {components?.map((componentData: any) => {\n switch (componentData.blockType) {\n case 'ipc-brand-equity': {\n return (\n <div className=\"relative z-20 bg-transparent\">\n <SubContainer spaceY=\"none\">\n <BrandEquity data={componentData} style={componentData?.style} />\n </SubContainer>\n </div>\n )\n }\n case 'ipc-member-equity': {\n return (\n <div className=\"relative z-20 w-full bg-transparent\">\n <SubContainer spaceY=\"none\">\n <MemberEquity data={componentData} className=\"w-full\" style={componentData?.style} />\n </SubContainer>\n </div>\n )\n }\n case 'ipc-spacer': {\n return <Spacer data={componentData} style={componentData?.style} className=\"!bg-transparent\" />\n }\n default:\n return null\n }\n })}\n </>\n </div>\n )\n})\n\nconst MediaPlayerSticky = forwardRef<\n {\n mediaPlayerStickyRef: HTMLDivElement\n },\n MediaPlayerBaseProps\n>(\n (\n {\n className = '',\n wrapperClassName = '',\n id,\n data: {\n title,\n videoTitle,\n mobVideo,\n mobImg,\n img,\n isYouTube,\n youtubePcId,\n youtubeMobileId,\n video,\n theme,\n shape,\n components,\n },\n },\n ref\n ) => {\n const videoRef = useRef<HTMLVideoElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const { ref: inViewRef, inView } = useInView()\n const [screenHeight, setScreenHeight] = useState(0)\n const [isPlaying, setIsPlaying] = useState(false)\n const [isEntered, setIsEntered] = useState(false)\n const wrapperRef = useRef<HTMLDivElement>(null)\n\n const title_html =\n typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title, converters: htmlConverters })\n typeof videoTitle === 'string'\n ? videoTitle\n : videoTitle && convertLexicalToHTML({ data: videoTitle, converters: htmlConverters })\n\n const [btb, setbtb] = useState(0)\n const [isMobile, setIsMobile] = useState(false)\n const mediaQuery = useMediaQuery({ query: '(max-width: 768px)' })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const debouncedHandleResize = debounce(() => {\n if (boxRef.current) {\n const rect = boxRef.current.getBoundingClientRect()\n const screenHeight = isMobile ? window.screen.height : 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 // \u8BA1\u7B97 mediaPlayerStickyRef \u7684\u5E95\u90E8\u5230\u5C4F\u5E55\u6EDA\u52A8\u533A\u57DF\u6700\u5E95\u90E8\u7684\u8DDD\u79BB\n if (wrapperRef.current) {\n const mediaPlayerStickyRect = wrapperRef.current?.getBoundingClientRect()\n const scrollTop = window.scrollY || window.pageYOffset\n // \u4F7F\u7528 body \u548C documentElement \u7684\u6700\u5927\u503C\u6765\u83B7\u53D6\u51C6\u786E\u7684\u9875\u9762\u9AD8\u5EA6\n const pageHeight = Math.min(document.documentElement.scrollHeight, document.body.scrollHeight)\n // \u5143\u7D20\u5E95\u90E8\u5230\u9875\u9762\u5E95\u90E8\u7684\u8DDD\u79BB = \u9875\u9762\u9AD8\u5EA6 - (\u5143\u7D20\u5E95\u90E8\u5230\u89C6\u53E3\u9876\u90E8\u7684\u8DDD\u79BB + \u6EDA\u52A8\u8DDD\u79BB)\n const elementBottomToPageTop = mediaPlayerStickyRect.bottom + scrollTop\n const distanceToPageBottom = Math.max(0, pageHeight - elementBottomToPageTop)\n const currentHeight = distanceToPageBottom > screenHeight ? screenHeight : distanceToPageBottom\n console.log('currentHeight1', currentHeight)\n setbtb(currentHeight)\n } else {\n console.log('currentHeight2', screenHeight, distanceToPageBottom)\n setbtb(distanceToPageBottom > screenHeight ? screenHeight : distanceToPageBottom)\n }\n setScreenHeight(screenHeight)\n }\n }, 2000)\n\n useEffect(() => {\n if (inView && !isPlaying) {\n videoRef.current?.play()\n setIsPlaying(true)\n }\n }, [inView, isPlaying])\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 const height = isMobile ? window.screen.height : window.innerHeight\n gsap\n .timeline({\n scrollTrigger: {\n trigger: `#${id}`,\n start: 'top top',\n end: `top+=${height * 1.8}px bottom`,\n scrub: 0.5,\n },\n })\n .from(`#${id} .media-content`, { top: '50%', transform: 'translate(-50%, -50%)' })\n .to(`.${id} .sticky-cover`, {\n backdropFilter: 'blur(8px)',\n duration: 0.4,\n })\n .to(\n `#${id} .media-content`,\n {\n top: '100%',\n transform: 'translate(-50%, -100%)',\n duration: 1,\n },\n '<'\n )\n }\n if (inView) {\n gsapResize()\n }\n }, [inView])\n\n return (\n <>\n <div\n id={id}\n className={cn('relative z-20 h-screen w-full', className, {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n })}\n ref={wrapperRef}\n >\n <div\n ref={inViewRef}\n className=\"media-content translate-z-0 absolute left-1/2 top-1/2 z-10 w-full -translate-x-1/2 -translate-y-1/2 antialiased\"\n style={{ willChange: 'transform', contain: 'paint' }}\n >\n <SubContainer spaceY=\"tablet:my-[32px] my-[24px] space-y-4\">\n <Slogan className=\"sticky-title antialiased\" data={{ title: title_html || '', theme }} />\n </SubContainer>\n </div>\n </div>\n\n <div\n ref={boxRef}\n style={{ marginBottom: `-${btb}px`, zIndex: inView ? 2 : 1 }}\n className={cn(id, 'relative mt-[-200vh]', wrapperClassName)}\n >\n <div className=\"sticky top-0 \">\n <div className={cn('media-cover', 'relative h-screen w-full')}>\n {isYouTube ? (\n <YouTubePlayer youTubeId={isMobile ? youtubeMobileId || youtubePcId : youtubePcId} />\n ) : (\n video?.url && (\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={isMobile && mobImg?.url ? mobImg?.url : img?.url}\n src={isMobile && mobVideo?.url ? mobVideo?.url : video?.url}\n className=\"lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] lg:aspect-w-[1440] lg:aspect-h-[700] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]\"\n videoClassName=\" object-cover object-[82%]\"\n muted\n loop={false}\n playsInline\n onEnded={() => {\n setIsEntered(true)\n }}\n />\n )\n )}\n {img?.url && (!video?.url || isEntered) && (\n <img\n src={isMobile && mobImg?.url ? mobImg?.url : img?.url}\n alt={img?.alt}\n className=\"z-1 absolute left-0 top-0 size-full object-cover object-[82%]\"\n loading=\"lazy\"\n />\n )}\n <div\n className=\"sticky-cover absolute left-0 top-0 z-10 size-full\"\n style={{\n backdropFilter: 'blur(0px)',\n WebkitBackdropFilter: 'blur(0px)',\n willChange: 'backdrop-filter',\n }}\n />\n </div>\n </div>\n\n <div className=\"relative h-screen w-full\" />\n <SubBox components={components}></SubBox>\n <div className=\"relative h-screen w-full\" />\n </div>\n </>\n )\n }\n)\n\nexport default withLayout(MediaPlayerSticky)\n"],
5
+ "mappings": "mlBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aA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ACC,IAAK/B,GAAYe,GAAQ,IAAMA,GAAQ,IAAMC,GAAK,IAClD,IAAKA,GAAK,IACV,UAAU,iEACV,QAAQ,OACV,KAEF,OAAC,OACC,UAAU,oDACV,MAAO,CACL,eAAgB,YAChB,qBAAsB,YACtB,WAAY,iBACd,EACF,GACF,EACF,KAEA,OAAC,OAAI,UAAU,2BAA2B,KAC1C,OAACf,GAAA,CAAO,WAAYG,EAAY,KAChC,OAAC,OAAI,UAAU,2BAA2B,GAC5C,GACF,CAEJ,CACF,EAEA,IAAO/B,MAAQ,cAAWqC,EAAiB",
6
+ "names": ["MediaPlayerSticky_exports", "__export", "MediaPlayerSticky_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_es_toolkit", "import_react_intersection_observer", "import_utils", "import_Styles", "import_Slogan", "import_YouTubePlayer", "import_gird", "import_container", "import_BrandEquity", "import_MemberEquity", "import_Spacer", "import_gsap", "import_html", "import_react_responsive", "import_ScrollLoadVideo", "htmlConverters", "defaultConverters", "args", "node", "SubContainer", "children", "spaceY", "className", "isMobile", "SubBox", "React", "id", "components", "ref", "componentData", "BrandEquity", "MemberEquity", "Spacer", "MediaPlayerSticky", "wrapperClassName", "title", "videoTitle", "mobVideo", "mobImg", "img", "isYouTube", "youtubePcId", "youtubeMobileId", "video", "theme", "shape", "videoRef", "boxRef", "inViewRef", "inView", "screenHeight", "setScreenHeight", "isPlaying", "setIsPlaying", "isEntered", "setIsEntered", "wrapperRef", "title_html", "btb", "setbtb", "setIsMobile", "mediaQuery", "debouncedHandleResize", "rect", "scrollTop", "elementBottomToPageTop", "distanceToPageBottom", "mediaPlayerStickyRect", "pageHeight", "currentHeight", "gsapResize", "height", "gsap", "Slogan", "ScrollLoadVideo"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{Fragment as M,jsx as e,jsxs as p}from"react/jsx-runtime";import re,{useState as d,useRef as m,useEffect as y,forwardRef as ae,useImperativeHandle as oe}from"react";import{debounce as se}from"es-toolkit";import{useInView as ne}from"react-intersection-observer";import{cn as g}from"../../helpers/utils.js";import{withLayout as le}from"../../shared/Styles.js";import ie from"../Slogan/index.js";import{YouTubePlayer as ce}from"../VideoModal/YouTubePlayer.js";import{Grid as de,GridItem as R}from"../../components/gird.js";import{Container as me}from"../../components/container.js";import pe from"../BrandEquity/index.js";import ue from"../MemberEquity/index.js";import fe from"../Spacer/index.js";import ye from"gsap";import{convertLexicalToHTML as B}from"@payloadcms/richtext-lexical/html";import{useMediaQuery as $}from"react-responsive";import ge from"../../helpers/ScrollLoadVideo.js";const Y=({defaultConverters:s})=>({...s,text:l=>{const{node:t}=l;return t.$&&t.$.color?`<span class="lexical-${t.$.color}">${t.text}</span>`:t.text}}),k=({children:s,spaceY:l,className:t})=>{const r=$({query:"(max-width: 768px)"});return e(me,{spaceY:l,className:g("!bg-transparent",t),children:p(de,{children:[!r&&e(R,{span:1}),e(R,{span:r?12:10,children:s}),!r&&e(R,{span:1})]})})},ve=re.forwardRef(({children:s,id:l,components:t},r)=>{const n=m(null);return oe(r,()=>({mediaPlayerStickyRef:n.current})),p("div",{ref:n,className:"relative z-10",children:[e(M,{children:s}),e(M,{children:t?.map(a=>{switch(a.blockType){case"ipc-brand-equity":return e("div",{className:"relative z-20 bg-transparent",children:e(k,{spaceY:"none",children:e(pe,{data:a,style:a?.style})})});case"ipc-member-equity":return e("div",{className:"relative z-20 w-full bg-transparent",children:e(k,{spaceY:"none",children:e(ue,{data:a,className:"w-full",style:a?.style})})});case"ipc-spacer":return e(fe,{data:a,style:a?.style,className:"!bg-transparent"});default:return null}})})]})}),be=ae(({className:s="",wrapperClassName:l="",id:t,data:{title:r,videoTitle:n,mobVideo:a,mobImg:u,img:f,isYouTube:q,youtubePcId:N,youtubeMobileId:I,video:v,theme:P,shape:F,components:j}},we)=>{const S=m(null),b=m(null),{ref:G,inView:c}=ne(),[he,V]=d(0),[T,O]=d(!1),[Q,W]=d(!1),_=m(null),w=m(null),A=typeof r=="string"?r:r&&B({data:r,converters:Y});typeof n=="string"||n&&B({data:n,converters:Y});const[D,E]=d(0),[i,J]=d(!1),z=$({query:"(max-width: 768px)"});y(()=>{J(z)},[z]);const h=se(()=>{if(b.current){const x=b.current.getBoundingClientRect(),o=i?window.screen.height:window.innerHeight,K=window.scrollY||window.pageYOffset,U=x.bottom+K,H=document.documentElement.scrollHeight-U;if(w.current?.mediaPlayerStickyRef){const X=w.current.mediaPlayerStickyRef.getBoundingClientRect(),Z=window.scrollY||window.pageYOffset,ee=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),te=X.bottom+Z,C=Math.max(0,ee-te),L=C>o?o:C;console.log("currentHeight1",L),E(L)}else console.log("currentHeight2",o,H),E(H>o?o:H);V(o)}},2e3);return y(()=>{c&&!T&&(S.current?.play(),O(!0))},[c,T]),y(()=>(h(),window.addEventListener("resize",h),()=>{window.removeEventListener("resize",h)}),[]),y(()=>{function x(){const o=i?window.screen.height:window.innerHeight;ye.timeline({scrollTrigger:{trigger:`#${t}`,start:"top top",end:`top+=${o*1.8}px bottom`,scrub:.5}}).from(`#${t} .media-content`,{top:"50%",transform:"translate(-50%, -50%)"}).to(`.${t} .sticky-cover`,{backdropFilter:"blur(8px)",duration:.4}).to(`#${t} .media-content`,{top:"100%",transform:"translate(-50%, -100%)",duration:1},"<")}c&&x()},[c]),p(M,{children:[e("div",{id:t,className:g("relative z-20 h-screen w-full",s,{"aiui-dark":P==="dark","rounded-box":F==="rounded"}),ref:_,children:e("div",{ref:G,className:"media-content translate-z-0 absolute left-1/2 top-1/2 z-10 w-full -translate-x-1/2 -translate-y-1/2 antialiased",style:{willChange:"transform",contain:"paint"},children:e(k,{spaceY:"tablet:my-[32px] my-[24px] space-y-4",children:e(ie,{className:"sticky-title antialiased",data:{title:A||"",theme:P}})})})}),p("div",{ref:b,style:{marginBottom:`-${D}px`,zIndex:c?2:1},className:g(t,"relative mt-[-200vh]",l),children:[e("div",{className:"sticky top-0 ",children:p("div",{className:g("media-cover","relative h-screen w-full"),children:[q?e(ce,{youTubeId:i&&I||N}):v?.url&&e(ge,{videoRef:S,poster:i&&u?.url?u?.url:f?.url,src:i&&a?.url?a?.url:v?.url,className:"lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] lg:aspect-w-[1440] lg:aspect-h-[700] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]",videoClassName:" object-cover object-[82%]",muted:!0,loop:!1,playsInline:!0,onEnded:()=>{W(!0)}}),f?.url&&(!v?.url||Q)&&e("img",{src:i&&u?.url?u?.url:f?.url,alt:f?.alt,className:"z-1 absolute left-0 top-0 size-full object-cover object-[82%]",loading:"lazy"}),e("div",{className:"sticky-cover absolute left-0 top-0 z-10 size-full",style:{backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)",willChange:"backdrop-filter"}})]})}),e("div",{className:"relative h-screen w-full"}),e(ve,{ref:w,components:j}),e("div",{className:"relative h-screen w-full"})]})]})});var Ie=le(be);export{Ie as default};
1
+ "use client";import{Fragment as k,jsx as e,jsxs as d}from"react/jsx-runtime";import te,{useState as c,useRef as x,useEffect as u,forwardRef as re}from"react";import{debounce as oe}from"es-toolkit";import{useInView as se}from"react-intersection-observer";import{cn as f}from"../../helpers/utils.js";import{withLayout as ae}from"../../shared/Styles.js";import ne from"../Slogan/index.js";import{YouTubePlayer as ie}from"../VideoModal/YouTubePlayer.js";import{Grid as le,GridItem as H}from"../../components/gird.js";import{Container as ce}from"../../components/container.js";import de from"../BrandEquity/index.js";import pe from"../MemberEquity/index.js";import me from"../Spacer/index.js";import ue from"gsap";import{convertLexicalToHTML as L}from"@payloadcms/richtext-lexical/html";import{useMediaQuery as $}from"react-responsive";import fe from"../../helpers/ScrollLoadVideo.js";const Y=({defaultConverters:a})=>({...a,text:n=>{const{node:t}=n;return t.$&&t.$.color?`<span class="lexical-${t.$.color}">${t.text}</span>`:t.text}}),N=({children:a,spaceY:n,className:t})=>{const o=$({query:"(max-width: 768px)"});return e(ce,{spaceY:n,className:f("!bg-transparent",t),children:d(le,{children:[!o&&e(H,{span:1}),e(H,{span:o?12:10,children:a}),!o&&e(H,{span:1})]})})},ge=te.forwardRef(({children:a,id:n,components:t},o)=>d("div",{className:"relative z-10",children:[e(k,{children:a}),e(k,{children:t?.map(r=>{switch(r.blockType){case"ipc-brand-equity":return e("div",{className:"relative z-20 bg-transparent",children:e(N,{spaceY:"none",children:e(de,{data:r,style:r?.style})})});case"ipc-member-equity":return e("div",{className:"relative z-20 w-full bg-transparent",children:e(N,{spaceY:"none",children:e(pe,{data:r,className:"w-full",style:r?.style})})});case"ipc-spacer":return e(me,{data:r,style:r?.style,className:"!bg-transparent"});default:return null}})})]})),ye=re(({className:a="",wrapperClassName:n="",id:t,data:{title:o,videoTitle:r,mobVideo:M,mobImg:p,img:m,isYouTube:q,youtubePcId:R,youtubeMobileId:F,video:g,theme:T,shape:I,components:j}},be)=>{const z=x(null),y=x(null),{ref:G,inView:l}=se(),[ve,V]=c(0),[C,O]=c(!1),[Q,W]=c(!1),b=x(null),_=typeof o=="string"?o:o&&L({data:o,converters:Y});typeof r=="string"||r&&L({data:r,converters:Y});const[A,P]=c(0),[i,J]=c(!1),E=$({query:"(max-width: 768px)"});u(()=>{J(E)},[E]);const v=oe(()=>{if(y.current){const w=y.current.getBoundingClientRect(),s=i?window.screen.height:window.innerHeight,K=window.scrollY||window.pageYOffset,U=w.bottom+K,h=document.documentElement.scrollHeight-U;if(b.current){const X=b.current?.getBoundingClientRect(),Z=window.scrollY||window.pageYOffset,D=Math.min(document.documentElement.scrollHeight,document.body.scrollHeight),ee=X.bottom+Z,S=Math.max(0,D-ee),B=S>s?s:S;console.log("currentHeight1",B),P(B)}else console.log("currentHeight2",s,h),P(h>s?s:h);V(s)}},2e3);return u(()=>{l&&!C&&(z.current?.play(),O(!0))},[l,C]),u(()=>(v(),window.addEventListener("resize",v),()=>{window.removeEventListener("resize",v)}),[]),u(()=>{function w(){const s=i?window.screen.height:window.innerHeight;ue.timeline({scrollTrigger:{trigger:`#${t}`,start:"top top",end:`top+=${s*1.8}px bottom`,scrub:.5}}).from(`#${t} .media-content`,{top:"50%",transform:"translate(-50%, -50%)"}).to(`.${t} .sticky-cover`,{backdropFilter:"blur(8px)",duration:.4}).to(`#${t} .media-content`,{top:"100%",transform:"translate(-50%, -100%)",duration:1},"<")}l&&w()},[l]),d(k,{children:[e("div",{id:t,className:f("relative z-20 h-screen w-full",a,{"aiui-dark":T==="dark","rounded-box":I==="rounded"}),ref:b,children:e("div",{ref:G,className:"media-content translate-z-0 absolute left-1/2 top-1/2 z-10 w-full -translate-x-1/2 -translate-y-1/2 antialiased",style:{willChange:"transform",contain:"paint"},children:e(N,{spaceY:"tablet:my-[32px] my-[24px] space-y-4",children:e(ne,{className:"sticky-title antialiased",data:{title:_||"",theme:T}})})})}),d("div",{ref:y,style:{marginBottom:`-${A}px`,zIndex:l?2:1},className:f(t,"relative mt-[-200vh]",n),children:[e("div",{className:"sticky top-0 ",children:d("div",{className:f("media-cover","relative h-screen w-full"),children:[q?e(ie,{youTubeId:i&&F||R}):g?.url&&e(fe,{videoRef:z,poster:i&&p?.url?p?.url:m?.url,src:i&&M?.url?M?.url:g?.url,className:"lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] lg:aspect-w-[1440] lg:aspect-h-[700] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]",videoClassName:" object-cover object-[82%]",muted:!0,loop:!1,playsInline:!0,onEnded:()=>{W(!0)}}),m?.url&&(!g?.url||Q)&&e("img",{src:i&&p?.url?p?.url:m?.url,alt:m?.alt,className:"z-1 absolute left-0 top-0 size-full object-cover object-[82%]",loading:"lazy"}),e("div",{className:"sticky-cover absolute left-0 top-0 z-10 size-full",style:{backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)",willChange:"backdrop-filter"}})]})}),e("div",{className:"relative h-screen w-full"}),e(ge,{components:j}),e("div",{className:"relative h-screen w-full"})]})]})});var Ye=ae(ye);export{Ye as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/MediaPlayerSticky/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useState, useRef, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport { debounce } from 'es-toolkit'\nimport { useInView } from 'react-intersection-observer'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport Slogan from '../Slogan/index.js'\nimport { YouTubePlayer } from '../VideoModal/YouTubePlayer.js'\nimport { Grid, GridItem } from '../../components/gird.js'\nimport { Container } from '../../components/container.js'\nimport BrandEquity from '../BrandEquity/index.js'\nimport MemberEquity from '../MemberEquity/index.js'\nimport Spacer from '../Spacer/index.js'\nimport gsap from 'gsap'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\n\nimport type { HTMLConvertersFunction } from '@payloadcms/richtext-lexical/html'\n\nimport { useMediaQuery } from 'react-responsive'\nimport type { MediaPlayerBaseProps, MediaPlayerComponent } from './types.js'\nimport ScrollLoadVideo from '../../helpers/ScrollLoadVideo.js'\n\nconst htmlConverters: HTMLConvertersFunction = ({ defaultConverters }) => ({\n ...defaultConverters,\n text: args => {\n const { node } = args\n\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 SubContainer = ({\n children,\n spaceY,\n className,\n}: {\n children: React.ReactNode\n spaceY?: string\n className?: string\n}) => {\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n return (\n <Container spaceY={spaceY} className={cn('!bg-transparent', className)}>\n <Grid>\n {!isMobile && <GridItem span={1} />}\n <GridItem span={isMobile ? 12 : 10}>{children}</GridItem>\n {!isMobile && <GridItem span={1} />}\n </Grid>\n </Container>\n )\n}\n\nconst SubBox = React.forwardRef<\n {\n mediaPlayerStickyRef: HTMLDivElement | null\n },\n {\n children?: React.ReactNode\n id?: string\n components?: MediaPlayerComponent[]\n }\n>(({ children, id, components }, ref) => {\n const mediaPlayerStickyRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => ({\n mediaPlayerStickyRef: mediaPlayerStickyRef.current,\n }))\n\n return (\n <div ref={mediaPlayerStickyRef} className=\"relative z-10\">\n <>{children}</>\n <>\n {components?.map((componentData: any) => {\n switch (componentData.blockType) {\n case 'ipc-brand-equity': {\n return (\n <div className=\"relative z-20 bg-transparent\">\n <SubContainer spaceY=\"none\">\n <BrandEquity data={componentData} style={componentData?.style} />\n </SubContainer>\n </div>\n )\n }\n case 'ipc-member-equity': {\n return (\n <div className=\"relative z-20 w-full bg-transparent\">\n <SubContainer spaceY=\"none\">\n <MemberEquity data={componentData} className=\"w-full\" style={componentData?.style} />\n </SubContainer>\n </div>\n )\n }\n case 'ipc-spacer': {\n return <Spacer data={componentData} style={componentData?.style} className=\"!bg-transparent\" />\n }\n default:\n return null\n }\n })}\n </>\n </div>\n )\n})\n\nconst MediaPlayerSticky = forwardRef<\n {\n mediaPlayerStickyRef: HTMLDivElement\n },\n MediaPlayerBaseProps\n>(\n (\n {\n className = '',\n wrapperClassName = '',\n id,\n data: {\n title,\n videoTitle,\n mobVideo,\n mobImg,\n img,\n isYouTube,\n youtubePcId,\n youtubeMobileId,\n video,\n theme,\n shape,\n components,\n },\n },\n ref\n ) => {\n const videoRef = useRef<HTMLVideoElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const { ref: inViewRef, inView } = useInView()\n const [screenHeight, setScreenHeight] = useState(0)\n const [isPlaying, setIsPlaying] = useState(false)\n const [isEntered, setIsEntered] = useState(false)\n const wrapperRef = useRef<HTMLDivElement>(null)\n const subBoxRef = useRef<{ mediaPlayerStickyRef: HTMLDivElement | null }>(null)\n\n const title_html =\n typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title, converters: htmlConverters })\n typeof videoTitle === 'string'\n ? videoTitle\n : videoTitle && convertLexicalToHTML({ data: videoTitle, converters: htmlConverters })\n\n const [btb, setbtb] = useState(0)\n const [isMobile, setIsMobile] = useState(false)\n const mediaQuery = useMediaQuery({ query: '(max-width: 768px)' })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const debouncedHandleResize = debounce(() => {\n if (boxRef.current) {\n const rect = boxRef.current.getBoundingClientRect()\n const screenHeight = isMobile ? window.screen.height : 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 // \u8BA1\u7B97 mediaPlayerStickyRef \u7684\u5E95\u90E8\u5230\u5C4F\u5E55\u6EDA\u52A8\u533A\u57DF\u6700\u5E95\u90E8\u7684\u8DDD\u79BB\n if (subBoxRef.current?.mediaPlayerStickyRef) {\n const mediaPlayerStickyRect = subBoxRef.current.mediaPlayerStickyRef.getBoundingClientRect()\n const scrollTop = window.scrollY || window.pageYOffset\n // \u4F7F\u7528 body \u548C documentElement \u7684\u6700\u5927\u503C\u6765\u83B7\u53D6\u51C6\u786E\u7684\u9875\u9762\u9AD8\u5EA6\n const pageHeight = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight)\n // \u5143\u7D20\u5E95\u90E8\u5230\u9875\u9762\u5E95\u90E8\u7684\u8DDD\u79BB = \u9875\u9762\u9AD8\u5EA6 - (\u5143\u7D20\u5E95\u90E8\u5230\u89C6\u53E3\u9876\u90E8\u7684\u8DDD\u79BB + \u6EDA\u52A8\u8DDD\u79BB)\n const elementBottomToPageTop = mediaPlayerStickyRect.bottom + scrollTop\n const distanceToPageBottom = Math.max(0, pageHeight - elementBottomToPageTop)\n const currentHeight = distanceToPageBottom > screenHeight ? screenHeight : distanceToPageBottom\n console.log('currentHeight1', currentHeight)\n setbtb(currentHeight)\n } else {\n console.log('currentHeight2', screenHeight, distanceToPageBottom)\n setbtb(distanceToPageBottom > screenHeight ? screenHeight : distanceToPageBottom)\n }\n setScreenHeight(screenHeight)\n }\n }, 2000)\n\n useEffect(() => {\n if (inView && !isPlaying) {\n videoRef.current?.play()\n setIsPlaying(true)\n }\n }, [inView, isPlaying])\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 const height = isMobile ? window.screen.height : window.innerHeight\n gsap\n .timeline({\n scrollTrigger: {\n trigger: `#${id}`,\n start: 'top top',\n end: `top+=${height * 1.8}px bottom`,\n scrub: 0.5,\n },\n })\n .from(`#${id} .media-content`, { top: '50%', transform: 'translate(-50%, -50%)' })\n .to(`.${id} .sticky-cover`, {\n backdropFilter: 'blur(8px)',\n duration: 0.4,\n })\n .to(\n `#${id} .media-content`,\n {\n top: '100%',\n transform: 'translate(-50%, -100%)',\n duration: 1,\n },\n '<'\n )\n }\n if (inView) {\n gsapResize()\n }\n }, [inView])\n\n return (\n <>\n <div\n id={id}\n className={cn('relative z-20 h-screen w-full', className, {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n })}\n ref={wrapperRef}\n >\n <div\n ref={inViewRef}\n className=\"media-content translate-z-0 absolute left-1/2 top-1/2 z-10 w-full -translate-x-1/2 -translate-y-1/2 antialiased\"\n style={{ willChange: 'transform', contain: 'paint' }}\n >\n <SubContainer spaceY=\"tablet:my-[32px] my-[24px] space-y-4\">\n <Slogan className=\"sticky-title antialiased\" data={{ title: title_html || '', theme }} />\n </SubContainer>\n </div>\n </div>\n\n <div\n ref={boxRef}\n style={{ marginBottom: `-${btb}px`, zIndex: inView ? 2 : 1 }}\n className={cn(id, 'relative mt-[-200vh]', wrapperClassName)}\n >\n <div className=\"sticky top-0 \">\n <div className={cn('media-cover', 'relative h-screen w-full')}>\n {isYouTube ? (\n <YouTubePlayer youTubeId={isMobile ? youtubeMobileId || youtubePcId : youtubePcId} />\n ) : (\n video?.url && (\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={isMobile && mobImg?.url ? mobImg?.url : img?.url}\n src={isMobile && mobVideo?.url ? mobVideo?.url : video?.url}\n className=\"lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] lg:aspect-w-[1440] lg:aspect-h-[700] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]\"\n videoClassName=\" object-cover object-[82%]\"\n muted\n loop={false}\n playsInline\n onEnded={() => {\n setIsEntered(true)\n }}\n />\n )\n )}\n {img?.url && (!video?.url || isEntered) && (\n <img\n src={isMobile && mobImg?.url ? mobImg?.url : img?.url}\n alt={img?.alt}\n className=\"z-1 absolute left-0 top-0 size-full object-cover object-[82%]\"\n loading=\"lazy\"\n />\n )}\n <div\n className=\"sticky-cover absolute left-0 top-0 z-10 size-full\"\n style={{\n backdropFilter: 'blur(0px)',\n WebkitBackdropFilter: 'blur(0px)',\n willChange: 'backdrop-filter',\n }}\n />\n </div>\n </div>\n\n <div className=\"relative h-screen w-full\" />\n <SubBox ref={subBoxRef} components={components}></SubBox>\n <div className=\"relative h-screen w-full\" />\n </div>\n </>\n )\n }\n)\n\nexport default withLayout(MediaPlayerSticky)\n"],
5
- "mappings": "aA+CM,OA2BA,YAAAA,EA1BgB,OAAAC,EADhB,QAAAC,MAAA,oBA9CN,OAAOC,IAAS,YAAAC,EAAU,UAAAC,EAAQ,aAAAC,EAAW,cAAAC,GAAY,uBAAAC,OAA2B,QACpF,OAAS,YAAAC,OAAgB,aACzB,OAAS,aAAAC,OAAiB,8BAC1B,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,OAAkB,yBAC3B,OAAOC,OAAY,qBACnB,OAAS,iBAAAC,OAAqB,iCAC9B,OAAS,QAAAC,GAAM,YAAAC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E,GAAO,KACLjD,EAACuB,GAAA,CACC,SAAU6B,EACV,OAAQpB,GAAYY,GAAQ,IAAMA,GAAQ,IAAMC,GAAK,IACrD,IAAKb,GAAYW,GAAU,IAAMA,GAAU,IAAMM,GAAO,IACxD,UAAU,qNACV,eAAe,6BACf,MAAK,GACL,KAAM,GACN,YAAW,GACX,QAAS,IAAM,CACbY,EAAa,EAAI,CACnB,EACF,EAGHhB,GAAK,MAAQ,CAACI,GAAO,KAAOW,IAC3B5D,EAAC,OACC,IAAKgC,GAAYY,GAAQ,IAAMA,GAAQ,IAAMC,GAAK,IAClD,IAAKA,GAAK,IACV,UAAU,iEACV,QAAQ,OACV,EAEF7C,EAAC,OACC,UAAU,oDACV,MAAO,CACL,eAAgB,YAChB,qBAAsB,YACtB,WAAY,iBACd,EACF,GACF,EACF,EAEAA,EAAC,OAAI,UAAU,2BAA2B,EAC1CA,EAACiC,GAAA,CAAO,IAAK8B,EAAW,WAAY5B,EAAY,EAChDnC,EAAC,OAAI,UAAU,2BAA2B,GAC5C,GACF,CAEJ,CACF,EAEA,IAAO+E,GAAQpE,GAAW4B,EAAiB",
6
- "names": ["Fragment", "jsx", "jsxs", "React", "useState", "useRef", "useEffect", "forwardRef", "useImperativeHandle", "debounce", "useInView", "cn", "withLayout", "Slogan", "YouTubePlayer", "Grid", "GridItem", "Container", "BrandEquity", "MemberEquity", "Spacer", "gsap", "convertLexicalToHTML", "useMediaQuery", "ScrollLoadVideo", "htmlConverters", "defaultConverters", "args", "node", "SubContainer", "children", "spaceY", "className", "isMobile", "SubBox", "id", "components", "ref", "mediaPlayerStickyRef", "componentData", "MediaPlayerSticky", "wrapperClassName", "title", "videoTitle", "mobVideo", "mobImg", "img", "isYouTube", "youtubePcId", "youtubeMobileId", "video", "theme", "shape", "videoRef", "boxRef", "inViewRef", "inView", "screenHeight", "setScreenHeight", "isPlaying", "setIsPlaying", "isEntered", "setIsEntered", "wrapperRef", "subBoxRef", "title_html", "btb", "setbtb", "setIsMobile", "mediaQuery", "debouncedHandleResize", "rect", "scrollTop", "elementBottomToPageTop", "distanceToPageBottom", "mediaPlayerStickyRect", "pageHeight", "currentHeight", "gsapResize", "height", "MediaPlayerSticky_default"]
4
+ "sourcesContent": ["'use client'\nimport React, { useState, useRef, useEffect, forwardRef } from 'react'\nimport { debounce } from 'es-toolkit'\nimport { useInView } from 'react-intersection-observer'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport Slogan from '../Slogan/index.js'\nimport { YouTubePlayer } from '../VideoModal/YouTubePlayer.js'\nimport { Grid, GridItem } from '../../components/gird.js'\nimport { Container } from '../../components/container.js'\nimport BrandEquity from '../BrandEquity/index.js'\nimport MemberEquity from '../MemberEquity/index.js'\nimport Spacer from '../Spacer/index.js'\nimport gsap from 'gsap'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\n\nimport type { HTMLConvertersFunction } from '@payloadcms/richtext-lexical/html'\n\nimport { useMediaQuery } from 'react-responsive'\nimport type { MediaPlayerBaseProps, MediaPlayerComponent } from './types.js'\nimport ScrollLoadVideo from '../../helpers/ScrollLoadVideo.js'\n\nconst htmlConverters: HTMLConvertersFunction = ({ defaultConverters }) => ({\n ...defaultConverters,\n text: args => {\n const { node } = args\n\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 SubContainer = ({\n children,\n spaceY,\n className,\n}: {\n children: React.ReactNode\n spaceY?: string\n className?: string\n}) => {\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n return (\n <Container spaceY={spaceY} className={cn('!bg-transparent', className)}>\n <Grid>\n {!isMobile && <GridItem span={1} />}\n <GridItem span={isMobile ? 12 : 10}>{children}</GridItem>\n {!isMobile && <GridItem span={1} />}\n </Grid>\n </Container>\n )\n}\n\nconst SubBox = React.forwardRef<\n {\n mediaPlayerStickyRef: HTMLDivElement | null\n },\n {\n children?: React.ReactNode\n id?: string\n components?: MediaPlayerComponent[]\n }\n>(({ children, id, components }, ref) => {\n return (\n <div className=\"relative z-10\">\n <>{children}</>\n <>\n {components?.map((componentData: any) => {\n switch (componentData.blockType) {\n case 'ipc-brand-equity': {\n return (\n <div className=\"relative z-20 bg-transparent\">\n <SubContainer spaceY=\"none\">\n <BrandEquity data={componentData} style={componentData?.style} />\n </SubContainer>\n </div>\n )\n }\n case 'ipc-member-equity': {\n return (\n <div className=\"relative z-20 w-full bg-transparent\">\n <SubContainer spaceY=\"none\">\n <MemberEquity data={componentData} className=\"w-full\" style={componentData?.style} />\n </SubContainer>\n </div>\n )\n }\n case 'ipc-spacer': {\n return <Spacer data={componentData} style={componentData?.style} className=\"!bg-transparent\" />\n }\n default:\n return null\n }\n })}\n </>\n </div>\n )\n})\n\nconst MediaPlayerSticky = forwardRef<\n {\n mediaPlayerStickyRef: HTMLDivElement\n },\n MediaPlayerBaseProps\n>(\n (\n {\n className = '',\n wrapperClassName = '',\n id,\n data: {\n title,\n videoTitle,\n mobVideo,\n mobImg,\n img,\n isYouTube,\n youtubePcId,\n youtubeMobileId,\n video,\n theme,\n shape,\n components,\n },\n },\n ref\n ) => {\n const videoRef = useRef<HTMLVideoElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const { ref: inViewRef, inView } = useInView()\n const [screenHeight, setScreenHeight] = useState(0)\n const [isPlaying, setIsPlaying] = useState(false)\n const [isEntered, setIsEntered] = useState(false)\n const wrapperRef = useRef<HTMLDivElement>(null)\n\n const title_html =\n typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title, converters: htmlConverters })\n typeof videoTitle === 'string'\n ? videoTitle\n : videoTitle && convertLexicalToHTML({ data: videoTitle, converters: htmlConverters })\n\n const [btb, setbtb] = useState(0)\n const [isMobile, setIsMobile] = useState(false)\n const mediaQuery = useMediaQuery({ query: '(max-width: 768px)' })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const debouncedHandleResize = debounce(() => {\n if (boxRef.current) {\n const rect = boxRef.current.getBoundingClientRect()\n const screenHeight = isMobile ? window.screen.height : 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 // \u8BA1\u7B97 mediaPlayerStickyRef \u7684\u5E95\u90E8\u5230\u5C4F\u5E55\u6EDA\u52A8\u533A\u57DF\u6700\u5E95\u90E8\u7684\u8DDD\u79BB\n if (wrapperRef.current) {\n const mediaPlayerStickyRect = wrapperRef.current?.getBoundingClientRect()\n const scrollTop = window.scrollY || window.pageYOffset\n // \u4F7F\u7528 body \u548C documentElement \u7684\u6700\u5927\u503C\u6765\u83B7\u53D6\u51C6\u786E\u7684\u9875\u9762\u9AD8\u5EA6\n const pageHeight = Math.min(document.documentElement.scrollHeight, document.body.scrollHeight)\n // \u5143\u7D20\u5E95\u90E8\u5230\u9875\u9762\u5E95\u90E8\u7684\u8DDD\u79BB = \u9875\u9762\u9AD8\u5EA6 - (\u5143\u7D20\u5E95\u90E8\u5230\u89C6\u53E3\u9876\u90E8\u7684\u8DDD\u79BB + \u6EDA\u52A8\u8DDD\u79BB)\n const elementBottomToPageTop = mediaPlayerStickyRect.bottom + scrollTop\n const distanceToPageBottom = Math.max(0, pageHeight - elementBottomToPageTop)\n const currentHeight = distanceToPageBottom > screenHeight ? screenHeight : distanceToPageBottom\n console.log('currentHeight1', currentHeight)\n setbtb(currentHeight)\n } else {\n console.log('currentHeight2', screenHeight, distanceToPageBottom)\n setbtb(distanceToPageBottom > screenHeight ? screenHeight : distanceToPageBottom)\n }\n setScreenHeight(screenHeight)\n }\n }, 2000)\n\n useEffect(() => {\n if (inView && !isPlaying) {\n videoRef.current?.play()\n setIsPlaying(true)\n }\n }, [inView, isPlaying])\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 const height = isMobile ? window.screen.height : window.innerHeight\n gsap\n .timeline({\n scrollTrigger: {\n trigger: `#${id}`,\n start: 'top top',\n end: `top+=${height * 1.8}px bottom`,\n scrub: 0.5,\n },\n })\n .from(`#${id} .media-content`, { top: '50%', transform: 'translate(-50%, -50%)' })\n .to(`.${id} .sticky-cover`, {\n backdropFilter: 'blur(8px)',\n duration: 0.4,\n })\n .to(\n `#${id} .media-content`,\n {\n top: '100%',\n transform: 'translate(-50%, -100%)',\n duration: 1,\n },\n '<'\n )\n }\n if (inView) {\n gsapResize()\n }\n }, [inView])\n\n return (\n <>\n <div\n id={id}\n className={cn('relative z-20 h-screen w-full', className, {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n })}\n ref={wrapperRef}\n >\n <div\n ref={inViewRef}\n className=\"media-content translate-z-0 absolute left-1/2 top-1/2 z-10 w-full -translate-x-1/2 -translate-y-1/2 antialiased\"\n style={{ willChange: 'transform', contain: 'paint' }}\n >\n <SubContainer spaceY=\"tablet:my-[32px] my-[24px] space-y-4\">\n <Slogan className=\"sticky-title antialiased\" data={{ title: title_html || '', theme }} />\n </SubContainer>\n </div>\n </div>\n\n <div\n ref={boxRef}\n style={{ marginBottom: `-${btb}px`, zIndex: inView ? 2 : 1 }}\n className={cn(id, 'relative mt-[-200vh]', wrapperClassName)}\n >\n <div className=\"sticky top-0 \">\n <div className={cn('media-cover', 'relative h-screen w-full')}>\n {isYouTube ? (\n <YouTubePlayer youTubeId={isMobile ? youtubeMobileId || youtubePcId : youtubePcId} />\n ) : (\n video?.url && (\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={isMobile && mobImg?.url ? mobImg?.url : img?.url}\n src={isMobile && mobVideo?.url ? mobVideo?.url : video?.url}\n className=\"lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] lg:aspect-w-[1440] lg:aspect-h-[700] desktop:aspect-w-[1024] desktop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]\"\n videoClassName=\" object-cover object-[82%]\"\n muted\n loop={false}\n playsInline\n onEnded={() => {\n setIsEntered(true)\n }}\n />\n )\n )}\n {img?.url && (!video?.url || isEntered) && (\n <img\n src={isMobile && mobImg?.url ? mobImg?.url : img?.url}\n alt={img?.alt}\n className=\"z-1 absolute left-0 top-0 size-full object-cover object-[82%]\"\n loading=\"lazy\"\n />\n )}\n <div\n className=\"sticky-cover absolute left-0 top-0 z-10 size-full\"\n style={{\n backdropFilter: 'blur(0px)',\n WebkitBackdropFilter: 'blur(0px)',\n willChange: 'backdrop-filter',\n }}\n />\n </div>\n </div>\n\n <div className=\"relative h-screen w-full\" />\n <SubBox components={components}></SubBox>\n <div className=\"relative h-screen w-full\" />\n </div>\n </>\n )\n }\n)\n\nexport default withLayout(MediaPlayerSticky)\n"],
5
+ "mappings": "aA+CM,OAqBA,YAAAA,EApBgB,OAAAC,EADhB,QAAAC,MAAA,oBA9CN,OAAOC,IAAS,YAAAC,EAAU,UAAAC,EAAQ,aAAAC,EAAW,cAAAC,OAAkB,QAC/D,OAAS,YAAAC,OAAgB,aACzB,OAAS,aAAAC,OAAiB,8BAC1B,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,OAAkB,yBAC3B,OAAOC,OAAY,qBACnB,OAAS,iBAAAC,OAAqB,iCAC9B,OAAS,QAAAC,GAAM,YAAAC,MAAgB,2BAC/B,OAAS,aAAAC,OAAiB,gCAC1B,OAAOC,OAAiB,0BACxB,OAAOC,OAAkB,2BACzB,OAAOC,OAAY,qBACnB,OAAOC,OAAU,OACjB,OAAS,wBAAAC,MAA4B,oCAIrC,OAAS,iBAAAC,MAAqB,mBAE9B,OAAOC,OAAqB,mCAE5B,MAAMC,EAAyC,CAAC,CAAE,kBAAAC,CAAkB,KAAO,CACzE,GAAGA,EACH,KAAMC,GAAQ,CACZ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AY,iBACd,EACF,GACF,EACF,EAEAA,EAAC,OAAI,UAAU,2BAA2B,EAC1CA,EAACgC,GAAA,CAAO,WAAYE,EAAY,EAChClC,EAAC,OAAI,UAAU,2BAA2B,GAC5C,GACF,CAEJ,CACF,EAEA,IAAO4E,GAAQlE,GAAW2B,EAAiB",
6
+ "names": ["Fragment", "jsx", "jsxs", "React", "useState", "useRef", "useEffect", "forwardRef", "debounce", "useInView", "cn", "withLayout", "Slogan", "YouTubePlayer", "Grid", "GridItem", "Container", "BrandEquity", "MemberEquity", "Spacer", "gsap", "convertLexicalToHTML", "useMediaQuery", "ScrollLoadVideo", "htmlConverters", "defaultConverters", "args", "node", "SubContainer", "children", "spaceY", "className", "isMobile", "SubBox", "id", "components", "ref", "componentData", "MediaPlayerSticky", "wrapperClassName", "title", "videoTitle", "mobVideo", "mobImg", "img", "isYouTube", "youtubePcId", "youtubeMobileId", "video", "theme", "shape", "videoRef", "boxRef", "inViewRef", "inView", "screenHeight", "setScreenHeight", "isPlaying", "setIsPlaying", "isEntered", "setIsEntered", "wrapperRef", "title_html", "btb", "setbtb", "setIsMobile", "mediaQuery", "debouncedHandleResize", "rect", "scrollTop", "elementBottomToPageTop", "distanceToPageBottom", "mediaPlayerStickyRect", "pageHeight", "currentHeight", "gsapResize", "height", "MediaPlayerSticky_default"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anker-in/headless-ui",
3
- "version": "1.1.9-temp-112704",
3
+ "version": "1.1.9-temp-112705",
4
4
  "type": "commonjs",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/cjs/index.d.ts",