@soul-refiner/design-system 2.14.85 → 2.14.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/media/video-player/playlist-item.js +1 -1
- package/dist/components/media/video-player/video.js +2 -2
- package/dist/components/surfaces/post/post.js +41 -12
- package/dist/src/components/media/video-player/playlist-item.d.ts.map +1 -1
- package/dist/src/components/media/video-player/video.d.ts.map +1 -1
- package/dist/src/components/surfaces/post/post.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),i=require("react"),o=require("next/image"),t=require("styled-components"),r=require("../../atoms/box/box.js"),n=require("../../atoms/seconds_to_duration/seconds_to_duration.js"),s=require("../../atoms/typography/paragraph.js"),a=require("../../../icons/security/lock.js"),l=require("../../../icons/audio_video/play_solid.js"),c=require("../../../icons/basic/download_arrow.js"),d=require("../../../icons/basic/share_external.js");require("../../feedback/badge/badge.js"),require("../../feedback/banner/banner.js"),require("../../feedback/loader/loader.js"),require("../../feedback/notification/notification.js"),require("../../feedback/progress/progress.js"),require("../../feedback/toast/toast.js");var x=require("../../feedback/tooltip/tooltip.js");require("../../feedback/animated_toast/animated_toast.js"),require("../../feedback/emojiPicker/emoji-picker.js"),require("../../feedback/emojiPicker/emoji-reactions.js"),require("../../feedback/videoLoader/videoLoader.js");var p=require("../../actions/button/button.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../actions/dropdown/dropdown.js"),require("../../actions/rate/rate.js"),require("../../actions/switch/switch.js"),require("../../actions/toggle/toggle.js"),require("../../actions/upload/upload.js"),require("../../actions/AccountSelector/selector.js"),require("../../actions/stepIndicator/stepIndicator.js");var g=h(i),u=h(o);const j=g.default.forwardRef(({comingSoon:i,duration:o,onClick:t,playable:h,progress:g=0,shortDescription:j,thumbnail:v,nowplaying:k,playlistItemId:q,title:I,isFile:z=!1,type:L="VIDEO"},S)=>e.jsxs(y,{ref:S,onClick:h&&!i?t:void 0,$playable:h||"LINK"===L,$playlistItemId:q,$nowplaying:k,$isExternalLink:"LINK"===L,children:[h?e.jsx(l.PlaySolid,{color:"white",size:16,sx:"position: absolute; left: 10px; bottom: 10px;"}):"LINK"===L?e.jsx(d.ShareExternal,{color:"white",size:16,sx:"position: absolute; left: 10px; bottom: 10px;"}):e.jsx(a.Lock,{color:"white",size:16,sx:"position: absolute; left: 10px; bottom: 10px;"}),e.jsxs("div",{style:{position:"relative",overflow:"hidden",height:75,
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),i=require("react"),o=require("next/image"),t=require("styled-components"),r=require("../../atoms/box/box.js"),n=require("../../atoms/seconds_to_duration/seconds_to_duration.js"),s=require("../../atoms/typography/paragraph.js"),a=require("../../../icons/security/lock.js"),l=require("../../../icons/audio_video/play_solid.js"),c=require("../../../icons/basic/download_arrow.js"),d=require("../../../icons/basic/share_external.js");require("../../feedback/badge/badge.js"),require("../../feedback/banner/banner.js"),require("../../feedback/loader/loader.js"),require("../../feedback/notification/notification.js"),require("../../feedback/progress/progress.js"),require("../../feedback/toast/toast.js");var x=require("../../feedback/tooltip/tooltip.js");require("../../feedback/animated_toast/animated_toast.js"),require("../../feedback/emojiPicker/emoji-picker.js"),require("../../feedback/emojiPicker/emoji-reactions.js"),require("../../feedback/videoLoader/videoLoader.js");var p=require("../../actions/button/button.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../actions/dropdown/dropdown.js"),require("../../actions/rate/rate.js"),require("../../actions/switch/switch.js"),require("../../actions/toggle/toggle.js"),require("../../actions/upload/upload.js"),require("../../actions/AccountSelector/selector.js"),require("../../actions/stepIndicator/stepIndicator.js");var g=h(i),u=h(o);const j=g.default.forwardRef(({comingSoon:i,duration:o,onClick:t,playable:h,progress:g=0,shortDescription:j,thumbnail:v,nowplaying:k,playlistItemId:q,title:I,isFile:z=!1,type:L="VIDEO"},S)=>e.jsxs(y,{ref:S,onClick:h&&!i?t:void 0,$playable:h||"LINK"===L,$playlistItemId:q,$nowplaying:k,$isExternalLink:"LINK"===L,children:[h?e.jsx(l.PlaySolid,{color:"white",size:16,sx:"position: absolute; left: 10px; bottom: 10px;"}):"LINK"===L?e.jsx(d.ShareExternal,{color:"white",size:16,sx:"position: absolute; left: 10px; bottom: 10px;"}):e.jsx(a.Lock,{color:"white",size:16,sx:"position: absolute; left: 10px; bottom: 10px;"}),e.jsxs("div",{style:{position:"relative",overflow:"hidden",height:75,minWidth:133,width:"100%",maxWidth:133,backgroundColor:"white"},className:"imageContainer",children:[e.jsx(u.default,{alt:`thumbnail for ${I}`,height:75,quality:100,src:v,style:{objectFit:"LINK"===L?"fill":"cover",background:"LINK"===L?"white":"transparent"},width:133}),z&&e.jsx(f,{className:"overlay",children:e.jsx(m,{children:e.jsx(p.Button,{icon:e.jsx(c.DownloadArrow,{color:"grey-4",size:16}),type:"special",sx:"padding-left: 12px;padding-right: 12px; max-height: 32px;",children:e.jsx(s.P,{$color:"grey-4",$fontSize:14,$lineHeight:20,children:"Download"})})})}),"LINK"===L&&e.jsx(b,{className:"overlay",children:e.jsx(w,{children:e.jsx(p.Button,{icon:e.jsx(d.ShareExternal,{color:"grey-4",size:16}),type:"special",sx:"max-height: 32px;",children:e.jsx(s.P,{$color:"grey-4",$fontSize:14,$lineHeight:20,children:"Visit"})})})})]}),g&&o&&!i&&"LINK"!==L?e.jsx($,{progressPercent:g/o}):null,e.jsxs(r.Box,{$dir:"column",$gap:4,sx:"\n margin-left: 16px;\n margin-right: auto;\n flex: 0 1 auto;\n flex-basis: content;\n max-width: 70%;\n ",children:[e.jsx(s.P,{$color:"grey-10",$semiBold:!0,children:I}),e.jsxs(r.Box,{$gap:4,$align:"flex-end",children:[j&&e.jsx(s.P,{$color:"grey-9",$fontSize:14,$lineHeight:20,$textClampLines:2,sx:"max-width: min(500px, 100%);",dangerouslySetInnerHTML:{__html:j}}),j&&j?.length>70&&e.jsx(r.Box,{$justify:"flex-start",sx:"div{ text-align: left !important; z-index: 99; } .opaque { opacity: 1 !important;} margin-right: 16px; ",children:e.jsx(x.Tooltip,{content:j,place:"left",children:e.jsx(s.P,{$fontSize:14,$color:"white",children:"More"})})})]})]}),o&&!i&&"LINK"!==L&&e.jsx(s.P,{$color:"grey-8",$fontSize:14,$lineHeight:20,sx:"flex-shrink: 0;",children:e.jsx(n.SecToDuration,{seconds:o})}),"LINK"===L&&e.jsx(p.Button,{type:"special",sx:"&:hover { background-color: var(--color-grey-2); } svg { color: white; } padding: 6px 12px; max-height: 32px;",icon:e.jsx(d.ShareExternal,{color:"white",size:16}),children:e.jsx(s.P,{$color:"grey-8",$fontSize:14,$lineHeight:20,sx:"flex-shrink: 0;",children:"Visit"})}),"FILE"===L&&e.jsx(p.Button,{type:"special",sx:"&:hover { background-color: var(--color-grey-2); } svg { color: white; } padding: 6px 12px; max-height: 32px;",icon:e.jsx(c.DownloadArrow,{color:"white",size:16}),children:e.jsx(s.P,{$color:"grey-8",$fontSize:14,$lineHeight:20,sx:"flex-shrink: 0;",children:"Download"})}),i&&e.jsx(s.P,{$color:"grey-8",$fontSize:14,$lineHeight:20,sx:"flex-shrink: 0;",children:"Coming soon"})]})),y=t.styled.div`
|
|
2
2
|
width: 100%;
|
|
3
3
|
flex: 0 1 auto;
|
|
4
4
|
padding: 6px;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var e=require("react/jsx-runtime"),i=require("react"),t=require("next/image"),n=require("react-player"),r=require("styled-components"),o=require("../../actions/button/button.js"),l=require("../../atoms/box/box.js");require("../../navigation/breadcrumb/breadcrumb.js"),require("../../navigation/inner/inner.js");var s=require("../../navigation/tabs/tabs.js");require("../../navigation/tabs/custom-tabs.js");var a=require("../../../icons/basic/select_item.js"),d=require("../../atoms/typography/heading.js"),c=require("../../atoms/typography/paragraph.js"),p=require("../../../icons/security/lock_circle.js"),
|
|
2
|
+
"use strict";var e=require("react/jsx-runtime"),i=require("react"),t=require("next/image"),n=require("react-player"),r=require("styled-components"),o=require("../../actions/button/button.js"),l=require("../../atoms/box/box.js");require("../../navigation/breadcrumb/breadcrumb.js"),require("../../navigation/inner/inner.js");var s=require("../../navigation/tabs/tabs.js");require("../../navigation/tabs/custom-tabs.js");var a=require("../../../icons/basic/select_item.js"),d=require("../../atoms/typography/heading.js"),c=require("../../atoms/typography/paragraph.js"),p=require("../../../icons/security/lock_circle.js"),g=require("../../../icons/audio_video/play_solid.js"),u=require("../../../utils/local-storage.js"),h=require("./playlist-item.js"),x=require("./misc.js"),m=require("../../../icons/arrow/chevron_down.js"),f=require("../../surfaces/accordion/accordion.js");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var y=b(i),w=b(t),v=b(n);const j=1280/720,$=200*j,I=r.styled.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
background-color: var(--color-grey-0);
|
|
@@ -135,4 +135,4 @@
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
${({$showingAll:e})=>e?"height: 100%; overflow-y:auto;":"max-height: 350px;"}
|
|
138
|
-
`;exports.VideoPlayer=({activeIndex:t,pip:n,playable:r,playlist:b,onClickPreview:L,onPipChange:M,onProgress:H,onStart:T,orientation:E,setMediaItem:R,onShowAllPlaylist:O,forwardedRef:N,subtitle:F,title:W,trailer:_,additionalMedia:V})=>{const X="undefined"!=typeof window?window:{innerHeight:0,innerWidth:600},Y=X.innerHeight/3,K=j*(X.innerHeight/3),G=y.default.useRef(null),J=N||G,Q=y.default.useRef({}),U=y.default.useRef(null),Z=y.default.useRef(null),[ee,ie]=y.default.useState(0),[te,ne]=y.default.useState(!1),[re,oe]=y.default.useState(!r),[le,se]=y.default.useState(b?.[t].id||null),[ae,de]=g.useLocalStorage("videoPipHeight",Y),[ce,pe]=g.useLocalStorage("videoPipWidth",K),[ue,ge]=g.useLocalStorage("video-volume",1),[he,xe]=g.useLocalStorage("videoPipRight",16),[fe,me]=g.useLocalStorage("videoPipBottom",16),[be,ye]=y.default.useState([0,0]),[we,ve]=y.default.useState([0,0]),[je,$e]=y.default.useState(!1),[Ie,ke]=y.default.useState(0),[Se,De]=y.default.useState([]),[Pe,ze]=y.default.useState([]),[Ae,qe]=y.default.useState([]),Ce=re?_:je?Se?.[Ie]:b?.[t];y.default.useEffect(()=>{V&&(De(V.filter(e=>"VIDEO"===e.type)),ze(V.filter(e=>"FILE"===e.type)),qe(V.filter(e=>"LINK"===e.type)))},[V]),y.default.useEffect(()=>{const e=()=>{const e=Q.current[le];e&&setTimeout(()=>{e.scrollIntoView({behavior:"smooth",block:"center"})},0)};return b?.length&&le&&("undefined"!=typeof window&&window.addEventListener("load",e),e()),()=>{"undefined"!=typeof window&&window.removeEventListener("load",e)}},[b,le]);const Be=(e,i=!1)=>{oe(!1),$e(i),i?ke(e):R(e)},Le=()=>{ne(e=>!e),O&&O(!te)},Me=(e,i)=>{if(!Z?.current)return;const t=Z.current.getBoundingClientRect();t.x<16||t.y<16||e>=2*X.innerWidth/3||i>=2*X.innerHeight/3||e<$||i<200||(pe(e),de(i))},He=()=>{if(!Z?.current)return;const e=Z.current.getBoundingClientRect();ve([e.width,e.height])},Te=e=>{if(!Z?.current)return;const i=e.currentTarget.getAttribute("class")?.split(" ")||[],t=window.innerWidth-e.clientX,n=window.innerHeight-e.clientY;if(!(e.clientX<0||e.clientY<0))if(e.stopPropagation(),e.preventDefault(),i.includes("top")){const e=Math.round(n-be[1]+we[1]),i=Math.round(e*j);Me(i,e)}else if(i.includes("bottom")){const e=Math.round(be[1]-n+we[1]),i=Math.round(e*j);Me(i,e)}else if(i.includes("left")){const e=Math.round(t-be[0]+we[0]),i=Math.round(e/j);Me(e,i)}else if(i.includes("right")){const e=Math.round(be[0]-t+we[0]),i=Math.round(e/j);Me(e,i)}},Ee=i.useMemo(()=>{let e=[{label:"All lessons",color:"dark"}];return V?.length&&e.push({label:"Resources",color:"dark"}),e.push({label:"Trailer",color:"dark"}),e},[V]),Re=ee===Ee.length-1,Oe=V&&ee>0&&ee<Ee.length-1;return y.default.useEffect(()=>{ee>=Ee.length&&ie(0)},[Ee,ee]),Ce?e.jsx(I,{$orientation:E,children:e.jsxs(P,{$orientation:E,$playable:r||re||je,children:["vertical"===E&&e.jsxs(l.Box,{className:"pip-trigger-vertical pip-trigger",$dir:"column",$gap:4,sx:"margin: 24px;",children:[e.jsx(d.H,{as:"h2",$bold:!0,$color:"white",$fontSize:28,$lineHeight:36,children:W}),e.jsx(c.P,{as:"h3",$bold:!0,$color:"grey-8",children:F})]}),n&&e.jsx(S,{}),e.jsxs(k,{$pip:!!n,draggable:n&&0===we[0],onDrag:n?e=>{if(e.clientX<0||e.clientY<0)return;const i=window.innerWidth-e.clientX,t=window.innerHeight-e.clientY;((e,i)=>{if(!Z?.current)return;const t=Z.current.getBoundingClientRect();e&&e>=16&&e<=X.innerWidth-16-t.width&&xe(e),i&&i>=16&&i<=X.innerHeight-16-t.height&&me(i)})(he+(i-be[0]),fe+(t-be[1])),ye([i,t])}:void 0,onMouseDown:e=>{ye([window.innerWidth-e.clientX,window.innerHeight-e.clientY])},ref:Z,style:n?{bottom:fe,height:ae,right:he,width:ce}:void 0,children:[n&&e.jsx(o.Button,{className:"close-pip",icon:e.jsx(a.SelectItem,{color:"grey-0"}),onClick:e=>{e.stopPropagation(),M&&M(!1)},size:"large",sx:"\n display: none;\n position: absolute;\n top: 8px;\n right: 8px;\n z-index: 10;\n svg {\n fill: var(--color-white);\n }\n ",type:"text"}),e.jsx(v.default,{className:"player",config:{file:{attributes:{crossOrigin:"true",disablePictureInPicture:"true"},forceHLS:!0,hlsOptions:{autoStartLoad:!0},tracks:(Ce?.subtitles||[]).map(e=>({kind:"subtitles",label:e.label,src:e.src,srcLang:e.locale}))}},controls:!0,height:"100%",light:e.jsx(w.default,{alt:`thumbnail for ${W}`,layout:"fill",priority:!0,quality:100,style:{objectFit:"cover"},src:Ce.thumbnail}),progressInterval:4e3,onProgress:e=>H(e,je?Se[Ie]?.id:void 0),onStart:T,onClickPreview:L,onReady:()=>{if(!re){const e=J?.current?.getCurrentTime();0===e&&(je?0!==Se?.[Ie]?.progress&&J.current.seekTo(Se?.[Ie].progress):0!==Ce?.progress&&J.current.seekTo(Ce.progress))}},pip:n,playIcon:r||re||je?e.jsx(u.PlaySolid,{color:"white",size:24,sx:"position: absolute; width: 54px; height: 54px;"}):e.jsx(p.LockCircle,{color:"white",size:24,sx:"position: absolute; width: 54px; height: 54px;"}),playing:r,ref:J,url:Ce.src,width:"100%",volume:ue,onVolumeChange:e=>{ge(e.target.volume)}}),n&&e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"top horizontal",draggable:"false",onDrag:Te,onMouseDown:He,onDragEnd:()=>ve([0,0]),tabIndex:0}),e.jsx(D,{className:"bottom horizontal",draggable:"false",onDrag:Te,onMouseDown:He,onDragEnd:()=>ve([0,0]),tabIndex:0}),e.jsx(D,{className:"right vertical",draggable:"false",onDrag:Te,onMouseDown:He,onDragEnd:()=>ve([0,0]),tabIndex:0}),e.jsx(D,{className:"left vertical",draggable:"false",onDrag:Te,onMouseDown:He,onDragEnd:()=>ve([0,0]),tabIndex:0})]})]}),"horizontal"===E&&e.jsx(z,{children:e.jsxs(A,{$showingAll:te,children:[e.jsxs(l.Box,{$dir:"column",$gap:4,children:[e.jsx(d.H,{as:"h2",$bold:!0,$color:"white",$fontSize:28,$lineHeight:36,children:W}),e.jsx(c.P,{as:"h3",$bold:!0,$color:"grey-8",children:F})]}),e.jsxs(l.Box,{$align:"center",children:[e.jsx(s.Tabs,{activeIndex:ee,onChange:e=>ie(e),items:Ee,size:"medium",sx:"justify-content: flex-start;"}),e.jsx(x.ButtonViewAll,{showingAll:te,orientation:E,toggleShowingAll:Le})]}),0===ee?e.jsx(C,{ref:U,$showingAll:te,children:b.map((i,t)=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{se(i.id),Be(t)},title:i.title,thumbnail:i.thumbnail,shortDescription:i.shortDescription,duration:i.duration,progress:i.progress,playable:r,nowplaying:le,comingSoon:i.comingSoon||!1,ref:e=>{Q.current[i.id]=e}},i.id))}):Oe?e.jsxs(C,{$showingAll:te,children:[!!Se.length&&e.jsx(m.Accordion,{defaultOpen:0,children:[0].map(i=>e.jsx(m.Accordion.Item,{buttonSx:"padding: 0; align-items: center; flex-direction: row-reverse; justify-content: flex-end; gap: 16px; svg {fill: white !important; } &:hover {background: var(--color-grey-1);}",trigger:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:16},children:e.jsx(c.P,{$color:"white",$fontSize:16,$semiBold:!0,children:"Leaders"})}),sx:"flex-direction: column; ",children:e.jsx("div",{style:{marginTop:24,display:"flex",flexDirection:"column",gap:24},children:Se.map((i,t)=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{se(i.id),Be(t,!0)},progress:i.progress,duration:i.duration,title:i.name,thumbnail:i.thumbnail||"",shortDescription:i.shortDescription,playable:!0,nowplaying:le,ref:e=>{Q.current[i.id]=e}},i.id))})},i))}),(!!Pe.length||!!Ae.length)&&e.jsx(m.Accordion,{defaultOpen:0,children:[0].map(i=>e.jsx(m.Accordion.Item,{buttonSx:"padding: 0; align-items: center; flex-direction: row-reverse; justify-content: flex-end; gap: 16px; svg {fill: white !important; } &:hover {background: var(--color-grey-1);}",trigger:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:16},children:e.jsx(c.P,{$color:"white",$fontSize:16,$semiBold:!0,children:"Other Resources"})}),sx:"flex-direction: column; ",children:e.jsx("div",{style:{marginTop:24,display:"flex",flexDirection:"column",gap:24},children:[...Pe,...Ae].map(i=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{window.open(i.src,"_blank")},progress:i.progress,duration:i.duration,title:i.name,thumbnail:i.thumbnail||"",shortDescription:i.shortDescription,playable:!0,nowplaying:le,type:i.type,isFile:"FILE"===i.type,ref:e=>{Q.current[i.id]=e}},i.id))})},i))})]}):Re&&_?e.jsx(x.TrailerListItem,{title:W,handleSetPlayingTrailer:oe,trailer:_}):null]})}),"vertical"===E&&e.jsx(l.Box,{$dir:"column",$gap:24,sx:te?"z-index: 3; position:relative;":"height: auto",children:e.jsxs(q,{$showingAll:te,children:[e.jsxs(l.Box,{sx:"padding: 0 1.5rem;",$align:"center",children:[e.jsx(s.Tabs,{activeIndex:ee,onChange:e=>ie(e),items:Ee,size:"medium",sx:"justify-content: flex-start;"}),e.jsx(x.ButtonViewAll,{showingAll:te,orientation:E,toggleShowingAll:Le})]}),[e.jsx(B,{ref:U,$showingAll:te,children:b.map((i,t)=>e.jsx(h.PlaylistItem,{comingSoon:i.comingSoon||!1,nowplaying:le,playlistItemId:i.id,duration:i.duration,ref:e=>{Q.current[i.id]=e},onClick:()=>{Be(t),se(i.id)},playable:r,progress:i.progress,shortDescription:i.shortDescription,thumbnail:i.thumbnail,title:i.title},i.id))}),e.jsxs(B,{$showingAll:te,children:[!!Se.length&&e.jsx(m.Accordion,{defaultOpen:0,children:[0].map(i=>e.jsx(m.Accordion.Item,{buttonSx:"padding: 0;",trigger:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,marginBottom:24},children:[e.jsx(f.ChevronDown,{size:20,color:"white"}),e.jsx(c.P,{$color:"white",$fontSize:16,$semiBold:!0,children:"Leaders"})]}),sx:"flex-direction: column; gap: 24px;",children:Se.map((i,t)=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{se(i.id),Be(t,!0)},progress:i.progress,duration:i.duration,title:i.name,thumbnail:i.thumbnail||"",shortDescription:i.shortDescription,playable:!0,nowplaying:le,ref:e=>{Q.current[i.id]=e}},i.id))},i))}),(!!Pe.length||!!Ae.length)&&e.jsx(m.Accordion,{defaultOpen:0,children:[0].map(i=>e.jsx(m.Accordion.Item,{buttonSx:"padding: 0;",trigger:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,marginBottom:24},children:[e.jsx(f.ChevronDown,{size:20,color:"white"}),e.jsx(c.P,{$color:"white",$fontSize:16,$semiBold:!0,children:"Other Resources"})]}),sx:"flex-direction: column; gap: 24px;",children:[...Pe,...Ae].map(i=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{window.open(i.src,"_blank")},progress:i.progress,duration:i.duration,title:i.name,thumbnail:i.thumbnail||"",shortDescription:i.shortDescription,playable:!0,nowplaying:le,type:i.type,isFile:"FILE"===i.type,ref:e=>{Q.current[i.id]=e}},i.id))},i))})]}),!!_&&e.jsx(l.Box,{$dir:"column",$gap:8,sx:"margin: 0px 24px;",children:e.jsx(x.TrailerListItem,{title:W,handleSetPlayingTrailer:oe,trailer:_})})][ee]]})})]})}):null};
|
|
138
|
+
`;exports.VideoPlayer=({activeIndex:t,pip:n,playable:r,playlist:b,onClickPreview:L,onPipChange:M,onProgress:T,onStart:E,orientation:H,setMediaItem:R,onShowAllPlaylist:O,forwardedRef:F,subtitle:N,title:_,trailer:W,additionalMedia:V})=>{const X="undefined"!=typeof window?window:{innerHeight:0,innerWidth:600},Y=X.innerHeight/3,K=j*(X.innerHeight/3),G=y.default.useRef(null),J=F||G,Q=y.default.useRef({}),U=y.default.useRef(null),Z=y.default.useRef(null),[ee,ie]=y.default.useState(0),[te,ne]=y.default.useState(!1),[re,oe]=y.default.useState(!r),[le,se]=y.default.useState(b?.[t].id||null),[ae,de]=u.useLocalStorage("videoPipHeight",Y),[ce,pe]=u.useLocalStorage("videoPipWidth",K),[ge,ue]=u.useLocalStorage("video-volume",1),[he,xe]=u.useLocalStorage("videoPipRight",16),[me,fe]=u.useLocalStorage("videoPipBottom",16),[be,ye]=y.default.useState([0,0]),[we,ve]=y.default.useState([0,0]),[je,$e]=y.default.useState(!1),[Ie,ke]=y.default.useState(0),[Se,De]=y.default.useState([]),[Pe,ze]=y.default.useState([]),[Ae,qe]=y.default.useState([]),Ce=re?W:je?Se?.[Ie]:b?.[t];y.default.useEffect(()=>{V&&(De(V.filter(e=>"VIDEO"===e.type)),ze(V.filter(e=>"FILE"===e.type)),qe(V.filter(e=>"LINK"===e.type)))},[V]),y.default.useEffect(()=>{const e=()=>{const e=Q.current[le];e&&setTimeout(()=>{e.scrollIntoView({behavior:"smooth",block:"center"})},0)};return b?.length&&le&&("undefined"!=typeof window&&window.addEventListener("load",e),e()),()=>{"undefined"!=typeof window&&window.removeEventListener("load",e)}},[b,le]);const Be=(e,i=!1)=>{oe(!1),$e(i),i?ke(e):R(e)},Le=()=>{ne(e=>!e),O&&O(!te)},Me=(e,i)=>{if(!Z?.current)return;const t=Z.current.getBoundingClientRect();t.x<16||t.y<16||e>=2*X.innerWidth/3||i>=2*X.innerHeight/3||e<$||i<200||(pe(e),de(i))},Te=()=>{if(!Z?.current)return;const e=Z.current.getBoundingClientRect();ve([e.width,e.height])},Ee=e=>{if(!Z?.current)return;const i=e.currentTarget.getAttribute("class")?.split(" ")||[],t=window.innerWidth-e.clientX,n=window.innerHeight-e.clientY;if(!(e.clientX<0||e.clientY<0))if(e.stopPropagation(),e.preventDefault(),i.includes("top")){const e=Math.round(n-be[1]+we[1]),i=Math.round(e*j);Me(i,e)}else if(i.includes("bottom")){const e=Math.round(be[1]-n+we[1]),i=Math.round(e*j);Me(i,e)}else if(i.includes("left")){const e=Math.round(t-be[0]+we[0]),i=Math.round(e/j);Me(e,i)}else if(i.includes("right")){const e=Math.round(be[0]-t+we[0]),i=Math.round(e/j);Me(e,i)}},He=i.useMemo(()=>{let e=[{label:"All lessons",color:"dark"}];return V?.length&&e.push({label:"Resources",color:"dark"}),e.push({label:"Trailer",color:"dark"}),e},[V]),Re=ee===He.length-1,Oe=V&&ee>0&&ee<He.length-1;return y.default.useEffect(()=>{ee>=He.length&&ie(0)},[He,ee]),Ce?e.jsx(I,{$orientation:H,children:e.jsxs(P,{$orientation:H,$playable:r||re||je,children:["vertical"===H&&e.jsxs(l.Box,{className:"pip-trigger-vertical pip-trigger",$dir:"column",$gap:4,sx:"margin: 24px;",children:[e.jsx(d.H,{as:"h2",$bold:!0,$color:"white",$fontSize:28,$lineHeight:36,children:_}),e.jsx(c.P,{as:"h3",$bold:!0,$color:"grey-8",children:N})]}),n&&e.jsx(S,{}),e.jsxs(k,{$pip:!!n,draggable:n&&0===we[0],onDrag:n?e=>{if(e.clientX<0||e.clientY<0)return;const i=window.innerWidth-e.clientX,t=window.innerHeight-e.clientY;((e,i)=>{if(!Z?.current)return;const t=Z.current.getBoundingClientRect();e&&e>=16&&e<=X.innerWidth-16-t.width&&xe(e),i&&i>=16&&i<=X.innerHeight-16-t.height&&fe(i)})(he+(i-be[0]),me+(t-be[1])),ye([i,t])}:void 0,onMouseDown:e=>{ye([window.innerWidth-e.clientX,window.innerHeight-e.clientY])},ref:Z,style:n?{bottom:me,height:ae,right:he,width:ce}:void 0,children:[n&&e.jsx(o.Button,{className:"close-pip",icon:e.jsx(a.SelectItem,{color:"grey-0"}),onClick:e=>{e.stopPropagation(),M&&M(!1)},size:"large",sx:"\n display: none;\n position: absolute;\n top: 8px;\n right: 8px;\n z-index: 10;\n svg {\n fill: var(--color-white);\n }\n ",type:"text"}),e.jsx(v.default,{className:"player",config:{file:{attributes:{crossOrigin:"true",disablePictureInPicture:"true"},forceHLS:!0,hlsOptions:{autoStartLoad:!0},tracks:(Ce?.subtitles||[]).map(e=>({kind:"subtitles",label:e.label,src:e.src,srcLang:e.locale}))}},controls:!0,height:"100%",light:e.jsx(w.default,{alt:`thumbnail for ${_}`,layout:"fill",priority:!0,quality:100,style:{objectFit:"cover"},src:Ce.thumbnail}),progressInterval:4e3,onProgress:e=>T(e,je?Se[Ie]?.id:void 0),onStart:E,onClickPreview:L,onReady:()=>{if(!re){const e=J?.current?.getCurrentTime();0===e&&(je?0!==Se?.[Ie]?.progress&&J.current.seekTo(Se?.[Ie].progress):0!==Ce?.progress&&J.current.seekTo(Ce.progress))}},pip:n,playIcon:r||re||je?e.jsx(g.PlaySolid,{color:"white",size:24,sx:"position: absolute; width: 54px; height: 54px;"}):e.jsx(p.LockCircle,{color:"white",size:24,sx:"position: absolute; width: 54px; height: 54px;"}),playing:r,ref:J,url:Ce.src,width:"100%",volume:ge,onVolumeChange:e=>{ue(e.target.volume)}}),n&&e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"top horizontal",draggable:"false",onDrag:Ee,onMouseDown:Te,onDragEnd:()=>ve([0,0]),tabIndex:0}),e.jsx(D,{className:"bottom horizontal",draggable:"false",onDrag:Ee,onMouseDown:Te,onDragEnd:()=>ve([0,0]),tabIndex:0}),e.jsx(D,{className:"right vertical",draggable:"false",onDrag:Ee,onMouseDown:Te,onDragEnd:()=>ve([0,0]),tabIndex:0}),e.jsx(D,{className:"left vertical",draggable:"false",onDrag:Ee,onMouseDown:Te,onDragEnd:()=>ve([0,0]),tabIndex:0})]})]}),"horizontal"===H&&e.jsx(z,{children:e.jsxs(A,{$showingAll:te,children:[e.jsxs(l.Box,{$dir:"column",$gap:4,children:[e.jsx(d.H,{as:"h2",$bold:!0,$color:"white",$fontSize:28,$lineHeight:36,children:_}),e.jsx(c.P,{as:"h3",$bold:!0,$color:"grey-8",children:N})]}),e.jsxs(l.Box,{$align:"center",children:[e.jsx(s.Tabs,{activeIndex:ee,onChange:e=>ie(e),items:He,size:"medium",sx:"justify-content: flex-start;"}),e.jsx(x.ButtonViewAll,{showingAll:te,orientation:H,toggleShowingAll:Le})]}),0===ee?e.jsx(C,{ref:U,$showingAll:te,children:b.map((i,t)=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{se(i.id),Be(t)},title:i.title,thumbnail:i.thumbnail,shortDescription:i.shortDescription,duration:i.duration,progress:i.progress,playable:r,nowplaying:le,comingSoon:i.comingSoon||!1,ref:e=>{Q.current[i.id]=e}},i.id))}):Oe?e.jsxs(C,{$showingAll:te,children:[!!Se.length&&e.jsx(f.Accordion,{defaultOpen:0,children:[0].map(i=>e.jsx(f.Accordion.Item,{buttonSx:"padding: 0; align-items: center; flex-direction: row-reverse; justify-content: flex-end; gap: 16px; svg {fill: white !important; } &:hover {background: var(--color-grey-1);}",trigger:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:16},children:e.jsx(c.P,{$color:"white",$fontSize:16,$semiBold:!0,children:"Leaders"})}),sx:"flex-direction: column; ",children:e.jsx("div",{style:{marginTop:24,display:"flex",flexDirection:"column",gap:24},children:Se.map((i,t)=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{se(i.id),Be(t,!0)},progress:i.progress,duration:i.duration,title:i.name,thumbnail:i.thumbnail||"",shortDescription:i.shortDescription,playable:!0,nowplaying:le,ref:e=>{Q.current[i.id]=e}},i.id))})},i))}),!!Pe.length&&e.jsx(f.Accordion,{defaultOpen:0,children:[0].map(i=>e.jsx(f.Accordion.Item,{buttonSx:"padding: 0; align-items: center; flex-direction: row-reverse; justify-content: flex-end; gap: 16px; svg {fill: white !important; } &:hover {background: var(--color-grey-1);}",trigger:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:16},children:e.jsx(c.P,{$color:"white",$fontSize:16,$semiBold:!0,children:"Other Resources"})}),sx:"flex-direction: column; ",children:e.jsx("div",{style:{marginTop:24,display:"flex",flexDirection:"column",gap:24},children:[...Pe].map(i=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{window.open(i.src,"_blank")},progress:i.progress,duration:i.duration,title:i.name,thumbnail:i.thumbnail||"",shortDescription:i.shortDescription,playable:!0,nowplaying:le,type:i.type,isFile:"FILE"===i.type,ref:e=>{Q.current[i.id]=e}},i.id))})},i))}),!!Ae.length&&e.jsx(f.Accordion,{defaultOpen:0,children:[0].map(i=>e.jsx(f.Accordion.Item,{buttonSx:"padding: 0; align-items: center; flex-direction: row-reverse; justify-content: flex-end; gap: 16px; svg {fill: white !important; } &:hover {background: var(--color-grey-1);}",trigger:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:16},children:e.jsx(c.P,{$color:"white",$fontSize:16,$semiBold:!0,children:"Products"})}),sx:"flex-direction: column; ",children:e.jsx("div",{style:{marginTop:24,display:"flex",flexDirection:"column",gap:24},children:[...Ae].map(i=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{window.open(i.src,"_blank")},progress:i.progress,duration:i.duration,title:i.name,thumbnail:i.thumbnail||"",shortDescription:i.shortDescription,playable:!0,nowplaying:le,type:i.type,isFile:"FILE"===i.type,ref:e=>{Q.current[i.id]=e}},i.id))})},i))})]}):Re&&W?e.jsx(x.TrailerListItem,{title:_,handleSetPlayingTrailer:oe,trailer:W}):null]})}),"vertical"===H&&e.jsx(l.Box,{$dir:"column",$gap:24,sx:te?"z-index: 3; position:relative;":"height: auto",children:e.jsxs(q,{$showingAll:te,children:[e.jsxs(l.Box,{sx:"padding: 0 1.5rem;",$align:"center",children:[e.jsx(s.Tabs,{activeIndex:ee,onChange:e=>ie(e),items:He,size:"medium",sx:"justify-content: flex-start;"}),e.jsx(x.ButtonViewAll,{showingAll:te,orientation:H,toggleShowingAll:Le})]}),[e.jsx(B,{ref:U,$showingAll:te,children:b.map((i,t)=>e.jsx(h.PlaylistItem,{comingSoon:i.comingSoon||!1,nowplaying:le,playlistItemId:i.id,duration:i.duration,ref:e=>{Q.current[i.id]=e},onClick:()=>{Be(t),se(i.id)},playable:r,progress:i.progress,shortDescription:i.shortDescription,thumbnail:i.thumbnail,title:i.title},i.id))}),e.jsxs(B,{$showingAll:te,children:[!!Se.length&&e.jsx(f.Accordion,{defaultOpen:0,children:[0].map(i=>e.jsx(f.Accordion.Item,{buttonSx:"padding: 0;",trigger:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,marginBottom:24},children:[e.jsx(m.ChevronDown,{size:20,color:"white"}),e.jsx(c.P,{$color:"white",$fontSize:16,$semiBold:!0,children:"Leaders"})]}),sx:"flex-direction: column; gap: 24px;",children:Se.map((i,t)=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{se(i.id),Be(t,!0)},progress:i.progress,duration:i.duration,title:i.name,thumbnail:i.thumbnail||"",shortDescription:i.shortDescription,playable:!0,nowplaying:le,ref:e=>{Q.current[i.id]=e}},i.id))},i))}),(!!Pe.length||!!Ae.length)&&e.jsx(f.Accordion,{defaultOpen:0,children:[0].map(i=>e.jsx(f.Accordion.Item,{buttonSx:"padding: 0;",trigger:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,marginBottom:24},children:[e.jsx(m.ChevronDown,{size:20,color:"white"}),e.jsx(c.P,{$color:"white",$fontSize:16,$semiBold:!0,children:"Other Resources"})]}),sx:"flex-direction: column; gap: 24px;",children:[...Pe,...Ae].map(i=>e.jsx(h.PlaylistItem,{playlistItemId:i.id,onClick:()=>{window.open(i.src,"_blank")},progress:i.progress,duration:i.duration,title:i.name,thumbnail:i.thumbnail||"",shortDescription:i.shortDescription,playable:!0,nowplaying:le,type:i.type,isFile:"FILE"===i.type,ref:e=>{Q.current[i.id]=e}},i.id))},i))})]}),!!W&&e.jsx(l.Box,{$dir:"column",$gap:8,sx:"margin: 0px 24px;",children:e.jsx(x.TrailerListItem,{title:_,handleSetPlayingTrailer:oe,trailer:W})})][ee]]})})]})}):null};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var e=require("react/jsx-runtime"),
|
|
2
|
+
"use strict";var e=require("react/jsx-runtime"),i=require("react"),r=require("next/image"),t=require("next/link"),o=require("styled-components"),s=require("react-show-more-text"),n=require("../../../common/regex.js"),a=require("../../atoms/box/box.js"),l=require("../../atoms/highlighter/highlighter.js"),d=require("../../atoms/typography/heading.js"),c=require("../../atoms/typography/paragraph.js"),u=require("../modal/modal.js");require("../../atoms/typography/display.js"),require("../../atoms/typography/typography.js");var h=require("../../atoms/time_ago/time_ago.js"),p=require("../../iconography/avatar/avatar.js"),x=require("../../../icons/security/lock.js"),g=require("../../../icons/arrow/chevron_left.js"),j=require("../../../icons/arrow/chevron_right.js"),m=require("../../media/video/video.js");require("../../actions/button/button.js"),require("../../actions/dropdown/dropdown.js"),require("../../actions/rate/rate.js"),require("../../actions/switch/switch.js"),require("../../actions/toggle/toggle.js"),require("../../actions/upload/upload.js"),require("../../actions/AccountSelector/selector.js"),require("../../actions/stepIndicator/stepIndicator.js"),require("../../card/action/action.js"),require("../../card/audio/audio.js"),require("../../card/feature/feature.js"),require("../../card/person/person.js"),require("../../card/price/price.js"),require("../../card/regular/regular.js"),require("../../card/video/video.js"),require("../../card/written/written.js"),require("../../card/meeting/meeting.js"),require("../../card/course-seats/course-seats.js"),require("../../editor/editor.js"),require("../../editor/simple_editor/simple_editor.js"),require("../../editor/minimal_editor/minimal_editor.js"),require("../../feedback/badge/badge.js"),require("../../feedback/banner/banner.js"),require("../../feedback/loader/loader.js"),require("../../feedback/notification/notification.js"),require("../../feedback/progress/progress.js"),require("../../feedback/toast/toast.js"),require("react-tooltip"),require("../../feedback/animated_toast/animated_toast.js"),require("../../feedback/emojiPicker/emoji-picker.js"),require("../../feedback/emojiPicker/emoji-reactions.js"),require("../../feedback/videoLoader/videoLoader.js"),require("../../iconography/icon/icon.js"),require("../../input/checkbox/checkbox.js"),require("../../input/counter/counter.js"),require("../../input/date/date.js"),require("../../input/filter/filter.js"),require("../../input/radio/radio.js"),require("../../input/search/search.js"),require("../../input/select/select.js"),require("../../input/text_area/text_area.js"),require("../../input/text_input/text_input.js"),require("../../input/calendar/calendar.js"),require("../../input/time/time.js"),require("@mui/x-date-pickers/LocalizationProvider"),require("@mui/x-date-pickers/AdapterDateFnsV3"),require("@mui/x-date-pickers/TimeField"),require("../../media/audio-player/audio-player.js"),require("../../media/audio-playlist/audio-playlist.js"),require("../../media/audio-preview/audio-preview.js"),require("../../media/video-player/video.js"),require("../../media/audio-playlist/playing_indicator.js"),require("../../navigation/breadcrumb/breadcrumb.js"),require("../../navigation/inner/inner.js"),require("../../navigation/tabs/tabs.js"),require("../../navigation/tabs/custom-tabs.js"),require("../accordion/accordion.js"),require("../carousel/card/card.js"),require("../comment/comment.js"),require("../discuss_post/discuss_post.js"),require("../drawer/drawer.js"),require("../drawer/bottom-drawer.js"),require("../message/message.js"),require("react-dom"),require("../calendar_date/calendar_date.js"),require("../success_modal/success-modal.js"),require("../../table/table/table.js"),require("../../custom/users_selection/users_selection.js"),require("../../custom/courses_selection/courses_selection.js");var f=require("../../../icons/audio_video/play.js");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../../icons/basic/subtask.js"),require("../../../common/colors.js");var y=b(i),v=b(r),w=b(t),q=b(s);const $=o.styled.div`
|
|
3
3
|
position: relative;
|
|
4
4
|
max-width: 700px;
|
|
5
5
|
width: 100%;
|
|
@@ -16,18 +16,47 @@
|
|
|
16
16
|
text-decoration: underline;
|
|
17
17
|
cursor: pointer;
|
|
18
18
|
}
|
|
19
|
-
`;
|
|
19
|
+
`;o.styled.button`
|
|
20
20
|
background: none;
|
|
21
21
|
border: none;
|
|
22
22
|
cursor: pointer;
|
|
23
23
|
color: var(--color-grey-5);
|
|
24
|
-
`;const k=
|
|
24
|
+
`;const k=o.styled.div`
|
|
25
25
|
padding: 16px 24px;
|
|
26
26
|
display: flex;
|
|
27
27
|
justify-content: space-between;
|
|
28
28
|
align-items: flex-start;
|
|
29
29
|
border-bottom: 1px solid var(--color-grey-9);
|
|
30
|
-
`,
|
|
30
|
+
`,_=o.styled.div`
|
|
31
|
+
position: absolute;
|
|
32
|
+
width: 100%;
|
|
33
|
+
height: 100%;
|
|
34
|
+
top: 0;
|
|
35
|
+
left: 0;
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
z-index: 2;
|
|
41
|
+
background: var(--color-grey-0);
|
|
42
|
+
border-radius: inherit;
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
`,C=o.styled.div`
|
|
45
|
+
position: absolute;
|
|
46
|
+
width: 64px;
|
|
47
|
+
height: 64px;
|
|
48
|
+
left: 50%;
|
|
49
|
+
top: 50%;
|
|
50
|
+
transform: translate(-50%, -50%);
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
background: rgba(0, 0, 0, 0.5);
|
|
55
|
+
border-radius: 50%;
|
|
56
|
+
z-index: 3;
|
|
57
|
+
pointer-events: none;
|
|
58
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
59
|
+
`,z=o.styled.div`
|
|
31
60
|
position: relative;
|
|
32
61
|
display: flex;
|
|
33
62
|
gap: 8px;
|
|
@@ -46,7 +75,7 @@
|
|
|
46
75
|
}
|
|
47
76
|
|
|
48
77
|
${({$numImages:e})=>e>1?"\n div {\n min-width: calc(50% - 4px);\n max-width: calc(50% - 4px);\n\n flex:1;\n img {\n object-fit: cover;\n width: 100%;\n height: 100%;\n }\n }":"\n div > img {\n object-fit: contain;\n width: 100%;\n height: 100%;\n }\n "}
|
|
49
|
-
`,
|
|
78
|
+
`,P=o.styled.div`
|
|
50
79
|
position: relative;
|
|
51
80
|
aspect-ratio: 700 / 427;
|
|
52
81
|
flex: 1;
|
|
@@ -61,11 +90,11 @@
|
|
|
61
90
|
height: 100%;
|
|
62
91
|
pointer-events: none;
|
|
63
92
|
}
|
|
64
|
-
`,
|
|
93
|
+
`,S=o.styled.div`
|
|
65
94
|
position: relative;
|
|
66
95
|
width: 100%;
|
|
67
96
|
height: 480px;
|
|
68
|
-
`,H=
|
|
97
|
+
`,H=o.styled.div`
|
|
69
98
|
position: relative;
|
|
70
99
|
display: flex;
|
|
71
100
|
flex-direction: column;
|
|
@@ -75,17 +104,17 @@
|
|
|
75
104
|
justify-content: center;
|
|
76
105
|
gap: 16px;
|
|
77
106
|
overflow: hidden;
|
|
78
|
-
`,
|
|
107
|
+
`,L=o.styled.div`
|
|
79
108
|
display: flex;
|
|
80
109
|
justify-content: space-around;
|
|
81
110
|
align-items: center;
|
|
82
111
|
padding: 24px;
|
|
83
|
-
`,
|
|
112
|
+
`,R=o.styled.div`
|
|
84
113
|
padding: 24px;
|
|
85
114
|
display: flex;
|
|
86
115
|
flex-flow: column nowrap;
|
|
87
116
|
gap: 24px;
|
|
88
|
-
`,E=
|
|
117
|
+
`,E=o.styled.button`
|
|
89
118
|
width: 48px;
|
|
90
119
|
height: 150px;
|
|
91
120
|
display: flex;
|
|
@@ -101,7 +130,7 @@
|
|
|
101
130
|
&:hover {
|
|
102
131
|
background-color: rgba(0, 0, 0, 0.2);
|
|
103
132
|
}
|
|
104
|
-
`,
|
|
133
|
+
`,I=o.styled.div`
|
|
105
134
|
margin-top: 24px;
|
|
106
135
|
border-radius: 32px;
|
|
107
136
|
border: 1px solid var(--color-grey-8);
|
|
@@ -109,4 +138,4 @@
|
|
|
109
138
|
padding: 6px 16px;
|
|
110
139
|
width: fit-content;
|
|
111
140
|
cursor: pointer;
|
|
112
|
-
`;exports.Post=({actions:
|
|
141
|
+
`;exports.Post=({actions:i,author:r,authorActive:t,authorHref:o,authorImage:s,avatarTooltipContent:b,avatarTooltipSx:A,children:M,content:U,createdDate:F,dropdown:B,hasComments:T,id:W,images:D,isPaidUser:J,isPaywalled:V=!1,link:X,video:G,onJoin:N,monthlyMembershipPrice:O,onImageClick:Y})=>{const K=y.default.useId(),Q=y.default.useRef(null),[Z,ee]=y.default.useState(!1),[ie,re]=y.default.useState(-1),[te,oe]=y.default.useState(!1);y.default.useRef(null);const[se,ne]=y.default.useState(-1),[ae,le]=y.default.useState({x:"30vw",y:"30vh"}),de=!!G?.url&&!!G?.thumbnail,ce=G?.displayHtmlVideo,[ue,he]=y.default.useState(!1),pe=y.default.useRef(null);y.default.useEffect(()=>{if(Q.current&&U?.length>0){const e=24,i=Math.ceil(Q.current.offsetHeight/e);if(re(i),!Z)try{const i=Q.current.style.webkitLineClamp;Q.current.style.webkitLineClamp="none";const r=Q.current.offsetHeight,t=Math.ceil(r/e);Q.current.style.webkitLineClamp=i,oe(t>3)}catch(e){oe(i>=3)}}else re(-1),oe(!1)},[U,Z]),y.default.useEffect(()=>{const e=e=>{"ArrowLeft"===e.key?me():"ArrowRight"===e.key?je():"Escape"!==e.key&&"Enter"!==e.key||ne(-1)};return"undefined"!=typeof document&&D?.length&&se>-1&&document.addEventListener("keydown",e),()=>{D?.length&&document.removeEventListener("keydown",e)}},[]);const xe=y.default.Children.toArray(i),ge=y.default.Children.toArray(M),je=()=>{ne(e=>D?.length&&e!==D.length-1?e+1:e)},me=()=>{ne(e=>D?.length&&0!==e?e-1:e)};return e.jsxs($,{id:W,children:[se>-1&&!!D?.[se]&&e.jsx(u.Modal,{alwaysRender:!1,controlledOpen:!0,onChange:e=>!e&&ne(-1),children:e.jsxs(u.Modal.Content,{sx:`\n position: relative; \n height: ${ae.y}; \n width: ${ae.x};\n margin: 0 auto;\n `,children:[e.jsx(E,{$side:"left",$visible:0!==se,onClick:me,children:e.jsx(g.ChevronLeft,{color:"white",size:48})}),e.jsx(v.default,{alt:"",fill:!0,quality:100,onLoad:e=>{const{naturalHeight:i,naturalWidth:r}=e.target;let t=`${r}px`,o=`${i}px`;window?.innerHeight<i&&window?.innerWidth<r?(t=`${Math.floor(.95*window.innerHeight*r/i)}px`,o=`${Math.round(.95*window.innerWidth*i/r)}px`):window?.innerHeight<i?(t=`${Math.floor(.95*window.innerHeight*r/i)}px`,o="95vh"):window?.innerWidth<r&&(t="95vw",o=`${Math.round(.95*window.innerWidth*i/r)}px`),le({x:t,y:o})},draggable:!1,priority:!0,sizes:"100vw",src:D[se],style:{objectFit:"cover"}}),e.jsx(E,{$side:"right",$visible:se!==D.length-1,onClick:je,children:e.jsx(j.ChevronRight,{color:"white",size:48})})]})}),e.jsxs(k,{children:[e.jsx(p.Avatar,{isPaidUser:J,as:o?w.default:"button",href:o,image:s,size:64,status:t?"online":void 0,subtitle:e.jsx(c.P,{as:"span",sx:"vertical-align: top;",$fontSize:14,$lineHeight:20,children:e.jsx(h.TimeAgo,{date:new Date(F)})}),title:e.jsx(d.H,{as:o?w.default:"span",href:o,sx:"text-decoration:none;",$bold:!0,$fontSize:18,$lineHeight:26,children:r}),textPosition:"right",tooltipContent:b,tooltipSx:A,sx:o?"img { cursor: pointer; }":void 0}),B]}),!!U?.length&&e.jsxs("div",{style:{padding:"16px 24px"},children:[V&&ie>1?e.jsx(q.default,{lines:2,more:"Continue Reading",onClick:N,anchorClass:"see-more",expanded:!1,truncatedEndingComponent:"... ",children:e.jsx(c.P,{$sx:"white-space: pre-line; word-break: break-word;",$textClampLines:2,children:e.jsx(l.Highlighter,{highlightRender:i=>e.jsx(c.P,{as:"span",$color:"primary-blue-2",children:e.jsx(w.default,{href:i,target:"_blank",children:i})}),seperator:n.URL_REGEX,text:U})})}):e.jsxs(e.Fragment,{children:[e.jsx(c.P,{$sx:"white-space: pre-line; word-break: break-word;",innerRef:Q,$textClampLines:Z?void 0:5,children:e.jsx(l.Highlighter,{highlightRender:i=>e.jsx(c.P,{as:"span",$color:"primary-blue-2",children:e.jsx(w.default,{href:i,target:"_blank",children:i})}),seperator:n.URL_REGEX,text:V&&1===ie?"This is a premium post. Join to the membership to unlock the full access.":U})}),te&&!V?e.jsx(c.P,{$color:"grey-5",sx:"cursor:pointer;",$mediumBold:!0,$fontSize:14,onClick:()=>ee(e=>!e),children:Z?"See less":"See more"}):null]}),V&&!D?.length&&e.jsx(I,{onClick:N,children:e.jsxs(c.P,{$fontSize:14,$mediumBold:!0,children:["Join now for $",O," per month"]})})]}),V&&!!D?.length&&!de&&e.jsxs(H,{children:[e.jsx(v.default,{alt:"",width:650,height:427,priority:!0,quality:100,src:D[0],style:{objectFit:"fill",height:"100%",width:"100%",filter:"blur(60px)",position:"absolute",top:0,left:"50%",transform:"translateX(-50%)"}}),e.jsx(x.Lock,{size:40,color:"white",sx:"z-index: 1"}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",zIndex:1},children:[e.jsx(c.P,{$color:"white",$fontSize:14,$bold:!0,$lineHeight:20,children:"Become a member"}),e.jsx(c.P,{$color:"white",$fontSize:14,$bold:!0,$lineHeight:20,children:"to unlock this post"})]}),e.jsx(I,{onClick:N,style:{zIndex:1,marginTop:0},children:e.jsxs(c.P,{$fontSize:14,$mediumBold:!0,children:["Join now for $",O," per month"]})})]}),!!D?.length&&!de&&!V&&e.jsxs(z,{$numImages:D.length,children:[D.slice(0,4).map((i,r)=>e.jsx(P,{children:e.jsx(v.default,{alt:"",fill:!0,onClick:()=>{Y?.(r),ne(r)},quality:100,src:i,draggable:!1,style:{cursor:"pointer",objectFit:"cover"}})},`${K}${i.slice(0,15)}${r}`)),D.length>4&&e.jsxs(d.H,{as:"p",className:"more-than",sx:"pointer-events: none;",$color:"grey-10",$fontSize:28,$lineHeight:36,$semiBold:!0,children:["+",D.length-4]})]}),!D?.length&&!de&&X&&!V&&e.jsxs(w.default,{href:X.url,target:"_blank",children:[e.jsx(P,{children:e.jsx(v.default,{alt:"",fill:!0,quality:100,src:X.imageUrl,draggable:!1,style:{cursor:"pointer",objectFit:"cover"}})}),e.jsxs(a.Box,{$dir:"column",$gap:8,sx:"padding: 8px 16px;",children:[e.jsx(c.P,{$color:"grey-2",$semiBold:!0,children:X.title}),e.jsx(c.P,{$color:"grey-5",children:X.description})]})]}),de&&e.jsx(S,{children:ce?ue?e.jsxs("video",{ref:pe,style:{width:"100%",height:"100%"},controls:!0,playsInline:!0,poster:G.thumbnail,children:[G.videoUrls.webm&&e.jsx("source",{src:G.videoUrls.webm,type:"video/webm; codecs=vp9"}),G.videoUrls.mp4&&e.jsx("source",{src:G.videoUrls.mp4,type:"video/mp4; codecs=avc1.42E01E"}),"Your browser does not support the video tag."]}):e.jsxs(_,{onClick:()=>{he(!0),setTimeout(()=>{pe.current?.play()},100)},children:[e.jsx(v.default,{src:G.thumbnail,alt:"Video thumbnail",fill:!0,style:{objectFit:"cover",borderRadius:"inherit"},priority:!0,draggable:!1}),e.jsx(C,{children:e.jsx(f.Play,{size:32,color:"white"})})]}):e.jsx(m.Video,{src:G.url,thumbnail:G.thumbnail,subtitles:[],title:G?.title})}),!!xe.length&&e.jsx(L,{children:!V&&xe}),T&&!!ge.length&&e.jsx(R,{children:ge})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playlist-item.d.ts","sourceRoot":"","sources":["../../../../../src/components/media/video-player/playlist-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,UAAU,iBAAiB;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAiD;IAC3E,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;CAClC;AAED,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"playlist-item.d.ts","sourceRoot":"","sources":["../../../../../src/components/media/video-player/playlist-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,UAAU,iBAAiB;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAiD;IAC3E,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;CAClC;AAED,eAAO,MAAM,YAAY,0FAqMxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../../../../src/components/media/video-player/video.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAavC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWhE,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,WAAW,EAAE,YAAY,GAAG,UAAU,CAAC;IACvC;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI,CAAC;IACvD;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC;;OAEG;IACH,UAAU,EAAE,CACV,QAAQ,EAAE;QACR,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,EAAE,MAAM,CAAC;KACvB,EACD,UAAU,CAAC,EAAE,MAAM,KAChB,IAAI,CAAC;IACV;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB;;OAEG;IACH,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;IACpC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAE3C,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,uMAiBrB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../../../../src/components/media/video-player/video.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAavC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWhE,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,WAAW,EAAE,YAAY,GAAG,UAAU,CAAC;IACvC;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI,CAAC;IACvD;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC;;OAEG;IACH,UAAU,EAAE,CACV,QAAQ,EAAE;QACR,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,EAAE,MAAM,CAAC;KACvB,EACD,UAAU,CAAC,EAAE,MAAM,KAChB,IAAI,CAAC;IACV;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB;;OAEG;IACH,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;IACpC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAE3C,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,uMAiBrB,gBAAgB,4CAqyBlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../../../../src/components/surfaces/post/post.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../../../../src/components/surfaces/post/post.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAmB1B,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,iBAAiB;IACxD,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE;QACL,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,KAAK,CAAC,EAAE;QACN,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,EAAE;YACT,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,GAAG,CAAC,EAAE,MAAM,CAAC;SACd,CAAC;QACF,gBAAgB,CAAC,EAAE,OAAO,CAAC;KAC5B,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,IAAI,8PAsBd,SAAS,4CAscX,CAAC"}
|