@anker-in/headless-ui 1.1.59 → 1.1.61

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";var u=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var i=(o,e)=>{for(var n in e)u(o,n,{get:e[n],enumerable:!0})},s=(o,e,n,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of m(e))!d.call(o,t)&&t!==n&&u(o,t,{get:()=>e[t],enumerable:!(c=f(e,t))||c.enumerable});return o};var p=o=>s(u({},"__esModule",{value:!0}),o);var w={};i(w,{default:()=>v,useScrollLock:()=>l});module.exports=p(w);var r=require("react");function l(o){const e=(0,r.useRef)("");(0,r.useEffect)(()=>{e.current||(e.current=document.documentElement.style.overflow),document.documentElement.style.overflow=o?"hidden":e.current},[o])}var v=l;
1
+ "use strict";var u=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var m=(n,e)=>{for(var o in e)u(n,o,{get:e[o],enumerable:!0})},s=(n,e,o,f)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of l(e))!i.call(n,t)&&t!==o&&u(n,t,{get:()=>e[t],enumerable:!(f=c(e,t))||f.enumerable});return n};var p=n=>s(u({},"__esModule",{value:!0}),n);var w={};m(w,{default:()=>v,useScrollLock:()=>d});module.exports=p(w);var r=require("react");function d(n){const e=(0,r.useRef)(void 0);(0,r.useEffect)(()=>{typeof e.current>"u"&&(e.current=document.documentElement.style.overflow),document.documentElement.style.overflow=n?"hidden":e.current},[n])}var v=d;
2
2
  //# sourceMappingURL=useScrollLock.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeaderNavigation/useScrollLock.ts"],
4
- "sourcesContent": ["import { useEffect, useRef } from 'react'\n\n/**\n * \u6EDA\u52A8\u9501\u5B9A Hook\n * \u5F53 isLocked \u4E3A true \u65F6\u9501\u5B9A\u9875\u9762\u6EDA\u52A8\uFF0Cfalse \u65F6\u6062\u590D\u539F\u59CB\u72B6\u6001\n * @param isLocked \u662F\u5426\u9501\u5B9A\u6EDA\u52A8\n */\nexport function useScrollLock(isLocked: boolean) {\n const initHTMLOverflowProp = useRef('')\n\n useEffect(() => {\n if (!initHTMLOverflowProp.current) {\n initHTMLOverflowProp.current = document.documentElement.style.overflow\n }\n document.documentElement.style.overflow = isLocked ? 'hidden' : initHTMLOverflowProp.current\n }, [isLocked])\n}\n\nexport default useScrollLock\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,kBAAAC,IAAA,eAAAC,EAAAJ,GAAA,IAAAK,EAAkC,iBAO3B,SAASF,EAAcG,EAAmB,CAC/C,MAAMC,KAAuB,UAAO,EAAE,KAEtC,aAAU,IAAM,CACTA,EAAqB,UACxBA,EAAqB,QAAU,SAAS,gBAAgB,MAAM,UAEhE,SAAS,gBAAgB,MAAM,SAAWD,EAAW,SAAWC,EAAqB,OACvF,EAAG,CAACD,CAAQ,CAAC,CACf,CAEA,IAAOJ,EAAQC",
4
+ "sourcesContent": ["import { useEffect, useRef } from 'react'\n\n/**\n * \u6EDA\u52A8\u9501\u5B9A Hook\n * \u5F53 isLocked \u4E3A true \u65F6\u9501\u5B9A\u9875\u9762\u6EDA\u52A8\uFF0Cfalse \u65F6\u6062\u590D\u539F\u59CB\u72B6\u6001\n * @param isLocked \u662F\u5426\u9501\u5B9A\u6EDA\u52A8\n */\nexport function useScrollLock(isLocked: boolean) {\n const initHTMLOverflowProp = useRef<string | undefined>(undefined)\n\n useEffect(() => {\n if (typeof initHTMLOverflowProp.current === 'undefined') {\n initHTMLOverflowProp.current = document.documentElement.style.overflow\n }\n document.documentElement.style.overflow = isLocked ? 'hidden' : initHTMLOverflowProp.current\n }, [isLocked])\n}\n\nexport default useScrollLock\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,kBAAAC,IAAA,eAAAC,EAAAJ,GAAA,IAAAK,EAAkC,iBAO3B,SAASF,EAAcG,EAAmB,CAC/C,MAAMC,KAAuB,UAA2B,MAAS,KAEjE,aAAU,IAAM,CACV,OAAOA,EAAqB,QAAY,MAC1CA,EAAqB,QAAU,SAAS,gBAAgB,MAAM,UAEhE,SAAS,gBAAgB,MAAM,SAAWD,EAAW,SAAWC,EAAqB,OACvF,EAAG,CAACD,CAAQ,CAAC,CACf,CAEA,IAAOJ,EAAQC",
6
6
  "names": ["useScrollLock_exports", "__export", "useScrollLock_default", "useScrollLock", "__toCommonJS", "import_react", "isLocked", "initHTMLOverflowProp"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var R=Object.create;var p=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var _=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty;var q=(e,t)=>{for(var i in t)p(e,i,{get:t[i],enumerable:!0})},h=(e,t,i,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of U(t))!j.call(e,s)&&s!==i&&p(e,s,{get:()=>t[s],enumerable:!(a=S(t,s))||a.enumerable});return e};var v=(e,t,i)=>(i=e!=null?R(_(e)):{},h(t||!e||!e.__esModule?p(i,"default",{value:e,enumerable:!0}):i,e)),Y=e=>h(p({},"__esModule",{value:!0}),e);var F={};q(F,{default:()=>A});module.exports=Y(F);var l=require("react/jsx-runtime"),o=require("react"),g=require("../../helpers/utils.js"),w=require("../../shared/Styles.js"),r=require("../../components/index.js"),y=v(require("../Title/index.js")),M=v(require("../SwiperBox/index.js")),k=require("../../components/container.js"),P=require("../VideoModal/index.js"),N=require("@payloadcms/richtext-lexical/html"),T=require("../../hooks/useExposure.js"),L=require("../../shared/trackUrlRef.js");const m="video",d="media_player_multi",Z=({data:e,configuration:t})=>{const i=(0,o.useRef)(null);return(0,T.useExposure)(i,{componentType:m,componentName:d,componentTitle:e?.title,position:t?.index+1,componentDescription:e?.description}),(0,l.jsxs)("div",{ref:i,className:(0,g.cn)("laptop:max-w-full w-full overflow-hidden","laptop:flex-row flex shrink-0 flex-col","lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] h-auto",t.shape==="round"?"rounded-2xl":""),children:[(0,l.jsxs)("div",{className:"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none",children:[(0,l.jsx)(r.Picture,{source:e.img?.url,alt:e.img?.alt||"",className:"tablet:block hidden size-full",imgClassName:"w-full h-full object-cover tablet:hover:scale-110 transition-all duration-300"}),(0,l.jsx)(r.Picture,{source:e.mobileImg?.url||e.img?.url,alt:e.mobileImg?.alt||e.img?.alt||"",className:"tablet:hidden block size-full",imgClassName:"w-full h-full object-cover"}),(0,l.jsx)("div",{className:"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4",children:(e?.video?.url||e?.youtubeId)&&(0,l.jsx)("button",{onClick:()=>{t?.onVideoPlayBtnClick?.(t?.index||0,e)},className:"laptop:size-14 bg-opacity/20 flex size-8 items-center justify-center rounded-full bg-white hover:bg-black/75",children:(0,l.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})]}),(0,l.jsxs)("div",{className:"laptop:gap-[60px] lg-desktop:p-8 tablet:p-6 bg-container-secondary-1 flex min-h-[200px] flex-1 flex-col gap-4 overflow-hidden p-4",children:[(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("h3",{className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary mb-2 text-[14px] font-bold leading-[1.2] tracking-[-0.02em]",children:e.title}),e.quote&&(0,l.jsx)(r.Link,{asChild:!e?.href,href:(0,L.trackUrlRef)(e?.href,`${m}_${d}`),"data-headless-type-name":`${m}#${d}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:(0,l.jsx)(r.Text,{html:e.quote,weight:"bold",className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm"})})]}),(0,l.jsx)("p",{className:"lg-desktop:text-2xl lg-desktop:leading-[1.2] text-info-primary desktop:max-h-[186px] line-clamp-6 max-h-[144px] min-h-[100px] text-xl font-bold leading-[1.2] tracking-[-0.04em]",children:e.description})]})]})},b=(0,o.forwardRef)(({data:{items:e=[],shape:t="square",title:i,containerProps:a},className:s="",key:I,onVideoPlayBtnClick:V},B)=>{const[f,c]=(0,o.useState)(!1),[C,$]=(0,o.useState)(""),[z,D]=(0,o.useState)(""),u=typeof i=="string"?i:i&&(0,N.convertLexicalToHTML)({data:i}),E=(0,o.useRef)(null),x=e.length===2;return(0,l.jsxs)("div",{className:s,ref:E,children:[(0,l.jsx)("div",{className:"mediaplayermulti-box",children:(0,l.jsx)(k.Container,{...a||{},className:"overflow-hidden",children:(0,l.jsxs)("div",{className:s,ref:B,children:[i&&(0,l.jsx)(y.default,{className:"mediaplayermulti-title",data:{title:u||""}}),(0,l.jsx)(M.default,{className:"!overflow-visible",id:"MediaPlayerMultiSwiper"+I,data:{list:e,configuration:{shape:t,onVideoPlayBtnClick:(H,n)=>{c(!0),n?.isYouTube?D?.(n?.youtubeId||""):$?.(n?.video?.url||""),V?.(H)},title:u}},Slide:Z,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:x?2:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:x?2:1.5},1440:{spaceBetween:16,freeMode:!1,slidesPerView:2}}})]})})}),f&&(0,l.jsx)(P.VideoModal,{visible:f,youTubeId:z,videoUrl:C,onCloseModal:()=>c(!1)})]})});b.displayName="MediaPlayerMulti";var A=(0,w.withLayout)(b);
1
+ "use strict";"use client";var R=Object.create;var p=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var _=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty;var q=(e,t)=>{for(var i in t)p(e,i,{get:t[i],enumerable:!0})},h=(e,t,i,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of U(t))!j.call(e,s)&&s!==i&&p(e,s,{get:()=>t[s],enumerable:!(a=S(t,s))||a.enumerable});return e};var v=(e,t,i)=>(i=e!=null?R(_(e)):{},h(t||!e||!e.__esModule?p(i,"default",{value:e,enumerable:!0}):i,e)),Y=e=>h(p({},"__esModule",{value:!0}),e);var F={};q(F,{default:()=>A});module.exports=Y(F);var l=require("react/jsx-runtime"),o=require("react"),g=require("../../helpers/utils.js"),w=require("../../shared/Styles.js"),r=require("../../components/index.js"),y=v(require("../Title/index.js")),M=v(require("../SwiperBox/index.js")),k=require("../../components/container.js"),P=require("../VideoModal/index.js"),N=require("@payloadcms/richtext-lexical/html"),T=require("../../hooks/useExposure.js"),L=require("../../shared/trackUrlRef.js");const m="video",d="media_player_multi",Z=({data:e,configuration:t})=>{const i=(0,o.useRef)(null);return(0,T.useExposure)(i,{componentType:m,componentName:d,componentTitle:e?.title,position:t?.index+1,componentDescription:e?.description}),(0,l.jsxs)("div",{ref:i,className:(0,g.cn)("laptop:max-w-full w-full overflow-hidden","laptop:flex-row flex shrink-0 flex-col","lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] h-auto",t.shape==="round"?"rounded-2xl":""),children:[(0,l.jsxs)("div",{className:"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none",children:[(0,l.jsx)(r.Picture,{source:e.img?.url,alt:e.img?.alt||"",className:"tablet:block hidden size-full",imgClassName:"w-full h-full object-cover tablet:hover:scale-110 transition-all duration-300"}),(0,l.jsx)(r.Picture,{source:e.mobileImg?.url||e.img?.url,alt:e.mobileImg?.alt||e.img?.alt||"",className:"tablet:hidden block size-full",imgClassName:"w-full h-full object-cover"}),(0,l.jsx)("div",{className:"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4",children:(e?.video?.url||e?.youtubeId)&&(0,l.jsx)("button",{onClick:()=>{t?.onVideoPlayBtnClick?.(t?.index||0,e)},className:"laptop:size-14 bg-opacity/20 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:(0,l.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})]}),(0,l.jsxs)("div",{className:"laptop:gap-[60px] lg-desktop:p-8 tablet:p-6 bg-container-secondary-1 flex min-h-[200px] flex-1 flex-col gap-4 overflow-hidden p-4",children:[(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("h3",{className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary mb-2 text-[14px] font-bold leading-[1.2] tracking-[-0.02em]",children:e.title}),e.quote&&(0,l.jsx)(r.Link,{asChild:!e?.href,href:(0,L.trackUrlRef)(e?.href,`${m}_${d}`),"data-headless-type-name":`${m}#${d}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:(0,l.jsx)(r.Text,{html:e.quote,weight:"bold",className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm"})})]}),(0,l.jsx)("p",{className:"lg-desktop:text-2xl lg-desktop:leading-[1.2] text-info-primary desktop:max-h-[186px] line-clamp-6 max-h-[144px] min-h-[100px] text-xl font-bold leading-[1.2] tracking-[-0.04em]",children:e.description})]})]})},b=(0,o.forwardRef)(({data:{items:e=[],shape:t="square",title:i,containerProps:a},className:s="",key:I,onVideoPlayBtnClick:V},B)=>{const[f,c]=(0,o.useState)(!1),[C,$]=(0,o.useState)(""),[z,D]=(0,o.useState)(""),u=typeof i=="string"?i:i&&(0,N.convertLexicalToHTML)({data:i}),E=(0,o.useRef)(null),x=e.length===2;return(0,l.jsxs)("div",{className:s,ref:E,children:[(0,l.jsx)("div",{className:"mediaplayermulti-box",children:(0,l.jsx)(k.Container,{...a||{},className:"overflow-hidden",children:(0,l.jsxs)("div",{className:s,ref:B,children:[i&&(0,l.jsx)(y.default,{className:"mediaplayermulti-title",data:{title:u||""}}),(0,l.jsx)(M.default,{className:"!overflow-visible",id:"MediaPlayerMultiSwiper"+I,data:{list:e,configuration:{shape:t,onVideoPlayBtnClick:(H,n)=>{c(!0),n?.isYouTube?D?.(n?.youtubeId||""):$?.(n?.video?.url||""),V?.(H)},title:u}},Slide:Z,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:x?2:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:x?2:1.5},1440:{spaceBetween:16,freeMode:!1,slidesPerView:2}}})]})})}),f&&(0,l.jsx)(P.VideoModal,{visible:f,youTubeId:z,videoUrl:C,onCloseModal:()=>c(!1)})]})});b.displayName="MediaPlayerMulti";var A=(0,w.withLayout)(b);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/MediaPlayerMulti/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport { useState, forwardRef, useRef } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Picture, Link, Text } from '../../components/index.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { Container } from '../../components/container.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\nimport type { MediaPlayerMultiProps, MediaPlayerItemProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'video'\nconst componentName = 'media_player_multi'\n\nconst MediaPlayerItem = ({ data, configuration }: { data: MediaPlayerItemProps; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n position: configuration?.index + 1,\n componentDescription: data?.description,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n 'laptop:max-w-full w-full overflow-hidden',\n 'laptop:flex-row flex shrink-0 flex-col',\n 'lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] h-auto',\n configuration.shape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n <div className=\"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none\">\n <Picture\n source={data.img?.url}\n alt={data.img?.alt || ''}\n className=\"tablet:block hidden size-full\"\n imgClassName=\"w-full h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n />\n <Picture\n source={data.mobileImg?.url || data.img?.url}\n alt={data.mobileImg?.alt || data.img?.alt || ''}\n className=\"tablet:hidden block size-full\"\n imgClassName=\"w-full h-full object-cover\"\n />\n <div className=\"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4\">\n {(data?.video?.url || data?.youtubeId) && (\n <button\n onClick={() => {\n configuration?.onVideoPlayBtnClick?.(configuration?.index || 0, data)\n }}\n className=\"laptop:size-14 bg-opacity/20 flex size-8 items-center justify-center rounded-full bg-white hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n )}\n </div>\n </div>\n\n <div className=\"laptop:gap-[60px] lg-desktop:p-8 tablet:p-6 bg-container-secondary-1 flex min-h-[200px] flex-1 flex-col gap-4 overflow-hidden p-4\">\n <div className=\"flex flex-col\">\n <h3 className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary mb-2 text-[14px] font-bold leading-[1.2] tracking-[-0.02em]\">\n {data.title}\n </h3>\n {data.quote && (\n <Link\n asChild={!data?.href}\n href={trackUrlRef(data?.href, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}`}\n >\n <Text\n html={data.quote}\n weight=\"bold\"\n className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm\"\n />\n </Link>\n )}\n </div>\n\n <p className=\"lg-desktop:text-2xl lg-desktop:leading-[1.2] text-info-primary desktop:max-h-[186px] line-clamp-6 max-h-[144px] min-h-[100px] text-xl font-bold leading-[1.2] tracking-[-0.04em]\">\n {data.description}\n </p>\n </div>\n </div>\n )\n}\n\nconst MediaPlayerMulti = forwardRef<HTMLDivElement, MediaPlayerMultiProps>(\n (\n { data: { items = [], shape = 'square', title, containerProps }, className = '', key, onVideoPlayBtnClick },\n ref\n ) => {\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n const title_html = typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title })\n const wrapperRef = useRef<HTMLDivElement>(null)\n\n // \u5982\u679C\u53EA\u6709\u4E24\u4E2Aitem, \u5219\u5E73\u5747\u5206\u914D\u7A7A\u95F4\n const itemsLength = items.length === 2\n\n return (\n <div className={className} ref={wrapperRef}>\n <div className=\"mediaplayermulti-box\">\n <Container {...(containerProps || {})} className=\"overflow-hidden\">\n <div className={className} ref={ref}>\n {title && <Title className=\"mediaplayermulti-title\" data={{ title: title_html || '' }} />}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MediaPlayerMultiSwiper' + key}\n data={{\n list: items,\n configuration: {\n shape,\n onVideoPlayBtnClick: (_: number, data: MediaPlayerItemProps) => {\n setVisible(true)\n if (data?.isYouTube) {\n setYouTubeId?.(data?.youtubeId || '')\n } else {\n setVideoUrl?.(data?.video?.url || '')\n }\n onVideoPlayBtnClick?.(_)\n },\n title: title_html,\n },\n }}\n Slide={MediaPlayerItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: itemsLength ? 2 : 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: itemsLength ? 2 : 1.5,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2,\n },\n }}\n />\n </div>\n </Container>\n </div>\n {visible && (\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n videoUrl={videoUrl}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </div>\n )\n }\n)\n\nMediaPlayerMulti.displayName = 'MediaPlayerMulti'\nexport default withLayout(MediaPlayerMulti)\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAsCM,IAAAI,EAAA,6BArCNC,EAA6C,iBAC7CC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAAoC,qCACpCC,EAAkB,gCAClBC,EAAsB,oCACtBC,EAA0B,yCAC1BC,EAA2B,kCAC3BC,EAAqC,6CAErCC,EAA4B,sCAC5BC,EAA4B,uCAE5B,MAAMC,EAAgB,QAChBC,EAAgB,qBAEhBC,EAAkB,CAAC,CAAE,KAAAC,EAAM,cAAAC,CAAc,IAA2D,CACxG,MAAMC,KAAM,UAAuB,IAAI,EAEvC,wBAAYA,EAAK,CACf,cAAAL,EACA,cAAAC,EACA,eAAgBE,GAAM,MACtB,SAAUC,GAAe,MAAQ,EACjC,qBAAsBD,GAAM,WAC9B,CAAC,KAGC,QAAC,OACC,IAAKE,EACL,aAAW,MACT,2CACA,yCACA,iEACAD,EAAc,QAAU,QAAU,cAAgB,EACpD,EAEA,qBAAC,OAAI,UAAU,uFACb,oBAAC,WACC,OAAQD,EAAK,KAAK,IAClB,IAAKA,EAAK,KAAK,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forwardRef, useRef } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Picture, Link, Text } from '../../components/index.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { Container } from '../../components/container.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\nimport type { MediaPlayerMultiProps, MediaPlayerItemProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'video'\nconst componentName = 'media_player_multi'\n\nconst MediaPlayerItem = ({ data, configuration }: { data: MediaPlayerItemProps; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n position: configuration?.index + 1,\n componentDescription: data?.description,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n 'laptop:max-w-full w-full overflow-hidden',\n 'laptop:flex-row flex shrink-0 flex-col',\n 'lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] h-auto',\n configuration.shape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n <div className=\"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none\">\n <Picture\n source={data.img?.url}\n alt={data.img?.alt || ''}\n className=\"tablet:block hidden size-full\"\n imgClassName=\"w-full h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n />\n <Picture\n source={data.mobileImg?.url || data.img?.url}\n alt={data.mobileImg?.alt || data.img?.alt || ''}\n className=\"tablet:hidden block size-full\"\n imgClassName=\"w-full h-full object-cover\"\n />\n <div className=\"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4\">\n {(data?.video?.url || data?.youtubeId) && (\n <button\n onClick={() => {\n configuration?.onVideoPlayBtnClick?.(configuration?.index || 0, data)\n }}\n className=\"laptop:size-14 bg-opacity/20 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n )}\n </div>\n </div>\n\n <div className=\"laptop:gap-[60px] lg-desktop:p-8 tablet:p-6 bg-container-secondary-1 flex min-h-[200px] flex-1 flex-col gap-4 overflow-hidden p-4\">\n <div className=\"flex flex-col\">\n <h3 className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary mb-2 text-[14px] font-bold leading-[1.2] tracking-[-0.02em]\">\n {data.title}\n </h3>\n {data.quote && (\n <Link\n asChild={!data?.href}\n href={trackUrlRef(data?.href, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}`}\n >\n <Text\n html={data.quote}\n weight=\"bold\"\n className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm\"\n />\n </Link>\n )}\n </div>\n\n <p className=\"lg-desktop:text-2xl lg-desktop:leading-[1.2] text-info-primary desktop:max-h-[186px] line-clamp-6 max-h-[144px] min-h-[100px] text-xl font-bold leading-[1.2] tracking-[-0.04em]\">\n {data.description}\n </p>\n </div>\n </div>\n )\n}\n\nconst MediaPlayerMulti = forwardRef<HTMLDivElement, MediaPlayerMultiProps>(\n (\n { data: { items = [], shape = 'square', title, containerProps }, className = '', key, onVideoPlayBtnClick },\n ref\n ) => {\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n const title_html = typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title })\n const wrapperRef = useRef<HTMLDivElement>(null)\n\n // \u5982\u679C\u53EA\u6709\u4E24\u4E2Aitem, \u5219\u5E73\u5747\u5206\u914D\u7A7A\u95F4\n const itemsLength = items.length === 2\n\n return (\n <div className={className} ref={wrapperRef}>\n <div className=\"mediaplayermulti-box\">\n <Container {...(containerProps || {})} className=\"overflow-hidden\">\n <div className={className} ref={ref}>\n {title && <Title className=\"mediaplayermulti-title\" data={{ title: title_html || '' }} />}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MediaPlayerMultiSwiper' + key}\n data={{\n list: items,\n configuration: {\n shape,\n onVideoPlayBtnClick: (_: number, data: MediaPlayerItemProps) => {\n setVisible(true)\n if (data?.isYouTube) {\n setYouTubeId?.(data?.youtubeId || '')\n } else {\n setVideoUrl?.(data?.video?.url || '')\n }\n onVideoPlayBtnClick?.(_)\n },\n title: title_html,\n },\n }}\n Slide={MediaPlayerItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: itemsLength ? 2 : 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: itemsLength ? 2 : 1.5,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2,\n },\n }}\n />\n </div>\n </Container>\n </div>\n {visible && (\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n videoUrl={videoUrl}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </div>\n )\n }\n)\n\nMediaPlayerMulti.displayName = 'MediaPlayerMulti'\nexport default withLayout(MediaPlayerMulti)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAsCM,IAAAI,EAAA,6BArCNC,EAA6C,iBAC7CC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAAoC,qCACpCC,EAAkB,gCAClBC,EAAsB,oCACtBC,EAA0B,yCAC1BC,EAA2B,kCAC3BC,EAAqC,6CAErCC,EAA4B,sCAC5BC,EAA4B,uCAE5B,MAAMC,EAAgB,Q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AAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAeoB,EAAc,EAAI,GACnC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAeA,EAAc,EAAI,GACnC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,GACF,EACF,EACF,EACCR,MACC,OAAC,cACC,QAASA,EACT,UAAWI,EACX,SAAUF,EACV,aAAc,IAAMD,EAAW,EAAK,EACtC,GAEJ,CAEJ,CACF,EAEAT,EAAiB,YAAc,mBAC/B,IAAOpB,KAAQ,cAAWoB,CAAgB",
6
6
  "names": ["MediaPlayerMulti_exports", "__export", "MediaPlayerMulti_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_Styles", "import_components", "import_Title", "import_SwiperBox", "import_container", "import_VideoModal", "import_html", "import_useExposure", "import_trackUrlRef", "componentType", "componentName", "MediaPlayerItem", "data", "configuration", "ref", "MediaPlayerMulti", "items", "shape", "title", "containerProps", "className", "key", "onVideoPlayBtnClick", "visible", "setVisible", "videoUrl", "setVideoUrl", "youTubeId", "setYouTubeId", "title_html", "wrapperRef", "itemsLength", "Title", "SwiperBox", "_"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{useEffect as t,useRef as n}from"react";function r(o){const e=n("");t(()=>{e.current||(e.current=document.documentElement.style.overflow),document.documentElement.style.overflow=o?"hidden":e.current},[o])}var c=r;export{c as default,r as useScrollLock};
1
+ import{useEffect as t,useRef as o}from"react";function r(n){const e=o(void 0);t(()=>{typeof e.current>"u"&&(e.current=document.documentElement.style.overflow),document.documentElement.style.overflow=n?"hidden":e.current},[n])}var f=r;export{f as default,r as useScrollLock};
2
2
  //# sourceMappingURL=useScrollLock.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeaderNavigation/useScrollLock.ts"],
4
- "sourcesContent": ["import { useEffect, useRef } from 'react'\n\n/**\n * \u6EDA\u52A8\u9501\u5B9A Hook\n * \u5F53 isLocked \u4E3A true \u65F6\u9501\u5B9A\u9875\u9762\u6EDA\u52A8\uFF0Cfalse \u65F6\u6062\u590D\u539F\u59CB\u72B6\u6001\n * @param isLocked \u662F\u5426\u9501\u5B9A\u6EDA\u52A8\n */\nexport function useScrollLock(isLocked: boolean) {\n const initHTMLOverflowProp = useRef('')\n\n useEffect(() => {\n if (!initHTMLOverflowProp.current) {\n initHTMLOverflowProp.current = document.documentElement.style.overflow\n }\n document.documentElement.style.overflow = isLocked ? 'hidden' : initHTMLOverflowProp.current\n }, [isLocked])\n}\n\nexport default useScrollLock\n"],
5
- "mappings": "AAAA,OAAS,aAAAA,EAAW,UAAAC,MAAc,QAO3B,SAASC,EAAcC,EAAmB,CAC/C,MAAMC,EAAuBH,EAAO,EAAE,EAEtCD,EAAU,IAAM,CACTI,EAAqB,UACxBA,EAAqB,QAAU,SAAS,gBAAgB,MAAM,UAEhE,SAAS,gBAAgB,MAAM,SAAWD,EAAW,SAAWC,EAAqB,OACvF,EAAG,CAACD,CAAQ,CAAC,CACf,CAEA,IAAOE,EAAQH",
4
+ "sourcesContent": ["import { useEffect, useRef } from 'react'\n\n/**\n * \u6EDA\u52A8\u9501\u5B9A Hook\n * \u5F53 isLocked \u4E3A true \u65F6\u9501\u5B9A\u9875\u9762\u6EDA\u52A8\uFF0Cfalse \u65F6\u6062\u590D\u539F\u59CB\u72B6\u6001\n * @param isLocked \u662F\u5426\u9501\u5B9A\u6EDA\u52A8\n */\nexport function useScrollLock(isLocked: boolean) {\n const initHTMLOverflowProp = useRef<string | undefined>(undefined)\n\n useEffect(() => {\n if (typeof initHTMLOverflowProp.current === 'undefined') {\n initHTMLOverflowProp.current = document.documentElement.style.overflow\n }\n document.documentElement.style.overflow = isLocked ? 'hidden' : initHTMLOverflowProp.current\n }, [isLocked])\n}\n\nexport default useScrollLock\n"],
5
+ "mappings": "AAAA,OAAS,aAAAA,EAAW,UAAAC,MAAc,QAO3B,SAASC,EAAcC,EAAmB,CAC/C,MAAMC,EAAuBH,EAA2B,MAAS,EAEjED,EAAU,IAAM,CACV,OAAOI,EAAqB,QAAY,MAC1CA,EAAqB,QAAU,SAAS,gBAAgB,MAAM,UAEhE,SAAS,gBAAgB,MAAM,SAAWD,EAAW,SAAWC,EAAqB,OACvF,EAAG,CAACD,CAAQ,CAAC,CACf,CAEA,IAAOE,EAAQH",
6
6
  "names": ["useEffect", "useRef", "useScrollLock", "isLocked", "initHTMLOverflowProp", "useScrollLock_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as l,jsxs as o}from"react/jsx-runtime";import{useState as r,forwardRef as L,useRef as u}from"react";import{cn as I}from"../../helpers/utils.js";import{withLayout as V}from"../../shared/Styles.js";import{Picture as x,Link as B,Text as C}from"../../components/index.js";import $ from"../Title/index.js";import z from"../SwiperBox/index.js";import{Container as D}from"../../components/container.js";import{VideoModal as E}from"../VideoModal/index.js";import{convertLexicalToHTML as H}from"@payloadcms/richtext-lexical/html";import{useExposure as R}from"../../hooks/useExposure.js";import{trackUrlRef as S}from"../../shared/trackUrlRef.js";const a="video",p="media_player_multi",U=({data:e,configuration:i})=>{const t=u(null);return R(t,{componentType:a,componentName:p,componentTitle:e?.title,position:i?.index+1,componentDescription:e?.description}),o("div",{ref:t,className:I("laptop:max-w-full w-full overflow-hidden","laptop:flex-row flex shrink-0 flex-col","lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] h-auto",i.shape==="round"?"rounded-2xl":""),children:[o("div",{className:"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none",children:[l(x,{source:e.img?.url,alt:e.img?.alt||"",className:"tablet:block hidden size-full",imgClassName:"w-full h-full object-cover tablet:hover:scale-110 transition-all duration-300"}),l(x,{source:e.mobileImg?.url||e.img?.url,alt:e.mobileImg?.alt||e.img?.alt||"",className:"tablet:hidden block size-full",imgClassName:"w-full h-full object-cover"}),l("div",{className:"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4",children:(e?.video?.url||e?.youtubeId)&&l("button",{onClick:()=>{i?.onVideoPlayBtnClick?.(i?.index||0,e)},className:"laptop:size-14 bg-opacity/20 flex size-8 items-center justify-center rounded-full bg-white hover:bg-black/75",children:l("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})]}),o("div",{className:"laptop:gap-[60px] lg-desktop:p-8 tablet:p-6 bg-container-secondary-1 flex min-h-[200px] flex-1 flex-col gap-4 overflow-hidden p-4",children:[o("div",{className:"flex flex-col",children:[l("h3",{className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary mb-2 text-[14px] font-bold leading-[1.2] tracking-[-0.02em]",children:e.title}),e.quote&&l(B,{asChild:!e?.href,href:S(e?.href,`${a}_${p}`),"data-headless-type-name":`${a}#${p}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:l(C,{html:e.quote,weight:"bold",className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm"})})]}),l("p",{className:"lg-desktop:text-2xl lg-desktop:leading-[1.2] text-info-primary desktop:max-h-[186px] line-clamp-6 max-h-[144px] min-h-[100px] text-xl font-bold leading-[1.2] tracking-[-0.04em]",children:e.description})]})]})},h=L(({data:{items:e=[],shape:i="square",title:t,containerProps:v},className:n="",key:b,onVideoPlayBtnClick:g},w)=>{const[m,d]=r(!1),[y,M]=r(""),[k,P]=r(""),f=typeof t=="string"?t:t&&H({data:t}),N=u(null),c=e.length===2;return o("div",{className:n,ref:N,children:[l("div",{className:"mediaplayermulti-box",children:l(D,{...v||{},className:"overflow-hidden",children:o("div",{className:n,ref:w,children:[t&&l($,{className:"mediaplayermulti-title",data:{title:f||""}}),l(z,{className:"!overflow-visible",id:"MediaPlayerMultiSwiper"+b,data:{list:e,configuration:{shape:i,onVideoPlayBtnClick:(T,s)=>{d(!0),s?.isYouTube?P?.(s?.youtubeId||""):M?.(s?.video?.url||""),g?.(T)},title:f}},Slide:U,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:c?2:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:c?2:1.5},1440:{spaceBetween:16,freeMode:!1,slidesPerView:2}}})]})})}),m&&l(E,{visible:m,youTubeId:k,videoUrl:y,onCloseModal:()=>d(!1)})]})});h.displayName="MediaPlayerMulti";var Q=V(h);export{Q as default};
1
+ "use client";import{jsx as l,jsxs as o}from"react/jsx-runtime";import{useState as r,forwardRef as L,useRef as u}from"react";import{cn as I}from"../../helpers/utils.js";import{withLayout as V}from"../../shared/Styles.js";import{Picture as x,Link as B,Text as C}from"../../components/index.js";import $ from"../Title/index.js";import z from"../SwiperBox/index.js";import{Container as D}from"../../components/container.js";import{VideoModal as E}from"../VideoModal/index.js";import{convertLexicalToHTML as H}from"@payloadcms/richtext-lexical/html";import{useExposure as R}from"../../hooks/useExposure.js";import{trackUrlRef as S}from"../../shared/trackUrlRef.js";const a="video",p="media_player_multi",U=({data:e,configuration:i})=>{const t=u(null);return R(t,{componentType:a,componentName:p,componentTitle:e?.title,position:i?.index+1,componentDescription:e?.description}),o("div",{ref:t,className:I("laptop:max-w-full w-full overflow-hidden","laptop:flex-row flex shrink-0 flex-col","lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] h-auto",i.shape==="round"?"rounded-2xl":""),children:[o("div",{className:"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none",children:[l(x,{source:e.img?.url,alt:e.img?.alt||"",className:"tablet:block hidden size-full",imgClassName:"w-full h-full object-cover tablet:hover:scale-110 transition-all duration-300"}),l(x,{source:e.mobileImg?.url||e.img?.url,alt:e.mobileImg?.alt||e.img?.alt||"",className:"tablet:hidden block size-full",imgClassName:"w-full h-full object-cover"}),l("div",{className:"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4",children:(e?.video?.url||e?.youtubeId)&&l("button",{onClick:()=>{i?.onVideoPlayBtnClick?.(i?.index||0,e)},className:"laptop:size-14 bg-opacity/20 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:l("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})]}),o("div",{className:"laptop:gap-[60px] lg-desktop:p-8 tablet:p-6 bg-container-secondary-1 flex min-h-[200px] flex-1 flex-col gap-4 overflow-hidden p-4",children:[o("div",{className:"flex flex-col",children:[l("h3",{className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary mb-2 text-[14px] font-bold leading-[1.2] tracking-[-0.02em]",children:e.title}),e.quote&&l(B,{asChild:!e?.href,href:S(e?.href,`${a}_${p}`),"data-headless-type-name":`${a}#${p}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:l(C,{html:e.quote,weight:"bold",className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm"})})]}),l("p",{className:"lg-desktop:text-2xl lg-desktop:leading-[1.2] text-info-primary desktop:max-h-[186px] line-clamp-6 max-h-[144px] min-h-[100px] text-xl font-bold leading-[1.2] tracking-[-0.04em]",children:e.description})]})]})},h=L(({data:{items:e=[],shape:i="square",title:t,containerProps:v},className:n="",key:b,onVideoPlayBtnClick:g},w)=>{const[m,d]=r(!1),[y,M]=r(""),[k,P]=r(""),f=typeof t=="string"?t:t&&H({data:t}),N=u(null),c=e.length===2;return o("div",{className:n,ref:N,children:[l("div",{className:"mediaplayermulti-box",children:l(D,{...v||{},className:"overflow-hidden",children:o("div",{className:n,ref:w,children:[t&&l($,{className:"mediaplayermulti-title",data:{title:f||""}}),l(z,{className:"!overflow-visible",id:"MediaPlayerMultiSwiper"+b,data:{list:e,configuration:{shape:i,onVideoPlayBtnClick:(T,s)=>{d(!0),s?.isYouTube?P?.(s?.youtubeId||""):M?.(s?.video?.url||""),g?.(T)},title:f}},Slide:U,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:c?2:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:c?2:1.5},1440:{spaceBetween:16,freeMode:!1,slidesPerView:2}}})]})})}),m&&l(E,{visible:m,youTubeId:k,videoUrl:y,onCloseModal:()=>d(!1)})]})});h.displayName="MediaPlayerMulti";var Q=V(h);export{Q as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/MediaPlayerMulti/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport { useState, forwardRef, useRef } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Picture, Link, Text } from '../../components/index.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { Container } from '../../components/container.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\nimport type { MediaPlayerMultiProps, MediaPlayerItemProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'video'\nconst componentName = 'media_player_multi'\n\nconst MediaPlayerItem = ({ data, configuration }: { data: MediaPlayerItemProps; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n position: configuration?.index + 1,\n componentDescription: data?.description,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n 'laptop:max-w-full w-full overflow-hidden',\n 'laptop:flex-row flex shrink-0 flex-col',\n 'lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] h-auto',\n configuration.shape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n <div className=\"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none\">\n <Picture\n source={data.img?.url}\n alt={data.img?.alt || ''}\n className=\"tablet:block hidden size-full\"\n imgClassName=\"w-full h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n />\n <Picture\n source={data.mobileImg?.url || data.img?.url}\n alt={data.mobileImg?.alt || data.img?.alt || ''}\n className=\"tablet:hidden block size-full\"\n imgClassName=\"w-full h-full object-cover\"\n />\n <div className=\"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4\">\n {(data?.video?.url || data?.youtubeId) && (\n <button\n onClick={() => {\n configuration?.onVideoPlayBtnClick?.(configuration?.index || 0, data)\n }}\n className=\"laptop:size-14 bg-opacity/20 flex size-8 items-center justify-center rounded-full bg-white hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n )}\n </div>\n </div>\n\n <div className=\"laptop:gap-[60px] lg-desktop:p-8 tablet:p-6 bg-container-secondary-1 flex min-h-[200px] flex-1 flex-col gap-4 overflow-hidden p-4\">\n <div className=\"flex flex-col\">\n <h3 className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary mb-2 text-[14px] font-bold leading-[1.2] tracking-[-0.02em]\">\n {data.title}\n </h3>\n {data.quote && (\n <Link\n asChild={!data?.href}\n href={trackUrlRef(data?.href, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}`}\n >\n <Text\n html={data.quote}\n weight=\"bold\"\n className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm\"\n />\n </Link>\n )}\n </div>\n\n <p className=\"lg-desktop:text-2xl lg-desktop:leading-[1.2] text-info-primary desktop:max-h-[186px] line-clamp-6 max-h-[144px] min-h-[100px] text-xl font-bold leading-[1.2] tracking-[-0.04em]\">\n {data.description}\n </p>\n </div>\n </div>\n )\n}\n\nconst MediaPlayerMulti = forwardRef<HTMLDivElement, MediaPlayerMultiProps>(\n (\n { data: { items = [], shape = 'square', title, containerProps }, className = '', key, onVideoPlayBtnClick },\n ref\n ) => {\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n const title_html = typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title })\n const wrapperRef = useRef<HTMLDivElement>(null)\n\n // \u5982\u679C\u53EA\u6709\u4E24\u4E2Aitem, \u5219\u5E73\u5747\u5206\u914D\u7A7A\u95F4\n const itemsLength = items.length === 2\n\n return (\n <div className={className} ref={wrapperRef}>\n <div className=\"mediaplayermulti-box\">\n <Container {...(containerProps || {})} className=\"overflow-hidden\">\n <div className={className} ref={ref}>\n {title && <Title className=\"mediaplayermulti-title\" data={{ title: title_html || '' }} />}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MediaPlayerMultiSwiper' + key}\n data={{\n list: items,\n configuration: {\n shape,\n onVideoPlayBtnClick: (_: number, data: MediaPlayerItemProps) => {\n setVisible(true)\n if (data?.isYouTube) {\n setYouTubeId?.(data?.youtubeId || '')\n } else {\n setVideoUrl?.(data?.video?.url || '')\n }\n onVideoPlayBtnClick?.(_)\n },\n title: title_html,\n },\n }}\n Slide={MediaPlayerItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: itemsLength ? 2 : 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: itemsLength ? 2 : 1.5,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2,\n },\n }}\n />\n </div>\n </Container>\n </div>\n {visible && (\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n videoUrl={videoUrl}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </div>\n )\n }\n)\n\nMediaPlayerMulti.displayName = 'MediaPlayerMulti'\nexport default withLayout(MediaPlayerMulti)\n"],
5
- "mappings": "aAsCM,OACE,OAAAA,EADF,QAAAC,MAAA,oBArCN,OAAS,YAAAC,EAAU,cAAAC,EAAY,UAAAC,MAAc,QAC7C,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,WAAAC,EAAS,QAAAC,EAAM,QAAAC,MAAY,4BACpC,OAAOC,MAAW,oBAClB,OAAOC,MAAe,wBACtB,OAAS,aAAAC,MAAiB,gCAC1B,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,wBAAAC,MAA4B,oCAErC,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,eAAAC,MAAmB,8BAE5B,MAAMC,EAAgB,QAChBC,EAAgB,qBAEhBC,EAAkB,CAAC,CAAE,KAAAC,EAAM,cAAAC,CAAc,IAA2D,CACxG,MAAMC,EAAMlB,EAAuB,IAAI,EAEvC,OAAAW,EAAYO,EAAK,CACf,cAAAL,EACA,cAAAC,EACA,eAAgBE,GAAM,MACtB,SAAUC,GAAe,MAAQ,EACjC,qBAAsBD,GAAM,WAC9B,CAAC,EAGCnB,EAAC,OACC,IAAKqB,EACL,UAAWjB,EACT,2CACA,yCACA,iEACAgB,EAAc,QAAU,QAAU,cAAgB,EACpD,EAEA,UAAApB,EAAC,OAAI,UAAU,uFACb,UAAAD,EAACO,EAAA,CACC,OAAQa,EAAK,KAAK,IAClB,IAAKA,EAAK,KAAK,KAAO,GACtB,UAAU,gCACV,aAAa,gFACf,EACApB,EAACO,EAAA,CACC,OAAQa,EAAK,WAAW,KAAOA,EAAK,KAAK,IACzC,IAAKA,EAAK,WAAW,KAAOA,EAAK,KAAK,KAAO,GAC7C,U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MY,CAAM,CAAC,EAC9FY,EAAalC,EAAuB,IAAI,EAGxCmC,EAAcf,EAAM,SAAW,EAErC,OACEvB,EAAC,OAAI,UAAW2B,EAAW,IAAKU,EAC9B,UAAAtC,EAAC,OAAI,UAAU,uBACb,SAAAA,EAACY,EAAA,CAAW,GAAIe,GAAkB,CAAC,EAAI,UAAU,kBAC/C,SAAA1B,EAAC,OAAI,UAAW2B,EAAW,IAAKN,EAC7B,UAAAI,GAAS1B,EAACU,EAAA,CAAM,UAAU,yBAAyB,KAAM,CAAE,MAAO2B,GAAc,EAAG,EAAG,EACvFrC,EAACW,EAAA,CACC,UAAU,oBACV,GAAI,yBAA2BkB,EAC/B,KAAM,CACJ,KAAML,EACN,cAAe,CACb,MAAAC,EACA,oBAAqB,CAACe,EAAWpB,IAA+B,CAC9DY,EAAW,EAAI,EACXZ,GAAM,UACRgB,IAAehB,GAAM,WAAa,EAAE,EAEpCc,IAAcd,GAAM,OAAO,KAAO,EAAE,EAEtCU,IAAsBU,CAAC,CACzB,EACA,MAAOH,CACT,CACF,EACA,MAAOlB,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAeoB,EAAc,EAAI,GACnC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAeA,EAAc,EAAI,GACnC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,GACF,EACF,EACF,EACCR,GACC/B,EAACa,EAAA,CACC,QAASkB,EACT,UAAWI,EACX,SAAUF,EACV,aAAc,IAAMD,EAAW,EAAK,EACtC,GAEJ,CAEJ,CACF,EAEAT,EAAiB,YAAc,mBAC/B,IAAOkB,EAAQnC,EAAWiB,CAAgB",
4
+ "sourcesContent": ["'use client'\nimport { useState, forwardRef, useRef } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Picture, Link, Text } from '../../components/index.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { Container } from '../../components/container.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\nimport type { MediaPlayerMultiProps, MediaPlayerItemProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'video'\nconst componentName = 'media_player_multi'\n\nconst MediaPlayerItem = ({ data, configuration }: { data: MediaPlayerItemProps; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n position: configuration?.index + 1,\n componentDescription: data?.description,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n 'laptop:max-w-full w-full overflow-hidden',\n 'laptop:flex-row flex shrink-0 flex-col',\n 'lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] h-auto',\n configuration.shape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n <div className=\"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none\">\n <Picture\n source={data.img?.url}\n alt={data.img?.alt || ''}\n className=\"tablet:block hidden size-full\"\n imgClassName=\"w-full h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n />\n <Picture\n source={data.mobileImg?.url || data.img?.url}\n alt={data.mobileImg?.alt || data.img?.alt || ''}\n className=\"tablet:hidden block size-full\"\n imgClassName=\"w-full h-full object-cover\"\n />\n <div className=\"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4\">\n {(data?.video?.url || data?.youtubeId) && (\n <button\n onClick={() => {\n configuration?.onVideoPlayBtnClick?.(configuration?.index || 0, data)\n }}\n className=\"laptop:size-14 bg-opacity/20 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n )}\n </div>\n </div>\n\n <div className=\"laptop:gap-[60px] lg-desktop:p-8 tablet:p-6 bg-container-secondary-1 flex min-h-[200px] flex-1 flex-col gap-4 overflow-hidden p-4\">\n <div className=\"flex flex-col\">\n <h3 className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary mb-2 text-[14px] font-bold leading-[1.2] tracking-[-0.02em]\">\n {data.title}\n </h3>\n {data.quote && (\n <Link\n asChild={!data?.href}\n href={trackUrlRef(data?.href, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}`}\n >\n <Text\n html={data.quote}\n weight=\"bold\"\n className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm\"\n />\n </Link>\n )}\n </div>\n\n <p className=\"lg-desktop:text-2xl lg-desktop:leading-[1.2] text-info-primary desktop:max-h-[186px] line-clamp-6 max-h-[144px] min-h-[100px] text-xl font-bold leading-[1.2] tracking-[-0.04em]\">\n {data.description}\n </p>\n </div>\n </div>\n )\n}\n\nconst MediaPlayerMulti = forwardRef<HTMLDivElement, MediaPlayerMultiProps>(\n (\n { data: { items = [], shape = 'square', title, containerProps }, className = '', key, onVideoPlayBtnClick },\n ref\n ) => {\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n const title_html = typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title })\n const wrapperRef = useRef<HTMLDivElement>(null)\n\n // \u5982\u679C\u53EA\u6709\u4E24\u4E2Aitem, \u5219\u5E73\u5747\u5206\u914D\u7A7A\u95F4\n const itemsLength = items.length === 2\n\n return (\n <div className={className} ref={wrapperRef}>\n <div className=\"mediaplayermulti-box\">\n <Container {...(containerProps || {})} className=\"overflow-hidden\">\n <div className={className} ref={ref}>\n {title && <Title className=\"mediaplayermulti-title\" data={{ title: title_html || '' }} />}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MediaPlayerMultiSwiper' + key}\n data={{\n list: items,\n configuration: {\n shape,\n onVideoPlayBtnClick: (_: number, data: MediaPlayerItemProps) => {\n setVisible(true)\n if (data?.isYouTube) {\n setYouTubeId?.(data?.youtubeId || '')\n } else {\n setVideoUrl?.(data?.video?.url || '')\n }\n onVideoPlayBtnClick?.(_)\n },\n title: title_html,\n },\n }}\n Slide={MediaPlayerItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: itemsLength ? 2 : 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: itemsLength ? 2 : 1.5,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2,\n },\n }}\n />\n </div>\n </Container>\n </div>\n {visible && (\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n videoUrl={videoUrl}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </div>\n )\n }\n)\n\nMediaPlayerMulti.displayName = 'MediaPlayerMulti'\nexport default withLayout(MediaPlayerMulti)\n"],
5
+ "mappings": "aAsCM,OACE,OAAAA,EADF,QAAAC,MAAA,oBArCN,OAAS,YAAAC,EAAU,cAAAC,EAAY,UAAAC,MAAc,QAC7C,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,WAAAC,EAAS,QAAAC,EAAM,QAAAC,MAAY,4BACpC,OAAOC,MAAW,oBAClB,OAAOC,MAAe,wBACtB,OAAS,aAAAC,MAAiB,gCAC1B,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,wBAAAC,MAA4B,oCAErC,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Aa,EAAE,EAEpCc,IAAcd,GAAM,OAAO,KAAO,EAAE,EAEtCU,IAAsBU,CAAC,CACzB,EACA,MAAOH,CACT,CACF,EACA,MAAOlB,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAeoB,EAAc,EAAI,GACnC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAeA,EAAc,EAAI,GACnC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,GACF,EACF,EACF,EACCR,GACC/B,EAACa,EAAA,CACC,QAASkB,EACT,UAAWI,EACX,SAAUF,EACV,aAAc,IAAMD,EAAW,EAAK,EACtC,GAEJ,CAEJ,CACF,EAEAT,EAAiB,YAAc,mBAC/B,IAAOkB,EAAQnC,EAAWiB,CAAgB",
6
6
  "names": ["jsx", "jsxs", "useState", "forwardRef", "useRef", "cn", "withLayout", "Picture", "Link", "Text", "Title", "SwiperBox", "Container", "VideoModal", "convertLexicalToHTML", "useExposure", "trackUrlRef", "componentType", "componentName", "MediaPlayerItem", "data", "configuration", "ref", "MediaPlayerMulti", "items", "shape", "title", "containerProps", "className", "key", "onVideoPlayBtnClick", "visible", "setVisible", "videoUrl", "setVideoUrl", "youTubeId", "setYouTubeId", "title_html", "wrapperRef", "itemsLength", "_", "MediaPlayerMulti_default"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anker-in/headless-ui",
3
- "version": "1.1.59",
3
+ "version": "1.1.61",
4
4
  "type": "commonjs",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/cjs/index.d.ts",