@soul-refiner/design-system 2.14.83 → 2.14.84

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.
@@ -109,4 +109,4 @@
109
109
  padding: 6px 16px;
110
110
  width: fit-content;
111
111
  cursor: pointer;
112
- `;exports.Post=({actions:t,author:i,authorActive:r,authorHref:n,authorImage:o,avatarTooltipContent:y,avatarTooltipSx:R,children:M,content:U,createdDate:_,dropdown:I,hasComments:A,id:B,images:F,isPaidUser:T,isPaywalled:W=!1,link:J,video:D,onJoin:X,monthlyMembershipPrice:G,onImageClick:V})=>{const N=v.default.useId(),O=v.default.useRef(null),[Y,K]=v.default.useState(!1),[Q,Z]=v.default.useState(-1),[ee,te]=v.default.useState(!1),ie=v.default.useRef(null),[re,ne]=v.default.useState(-1),[oe,le]=v.default.useState({x:"30vw",y:"30vh"}),se=!!D?.url&&!!D?.thumbnail,ae=!D?.displayHtmlVideo;v.default.useEffect(()=>{if(O.current&&U?.length>0){const e=24,t=Math.ceil(O.current.offsetHeight/e);if(Z(t),!Y)try{const t=O.current.style.webkitLineClamp;O.current.style.webkitLineClamp="none";const i=O.current.offsetHeight,r=Math.ceil(i/e);O.current.style.webkitLineClamp=t,te(r>3)}catch(e){te(t>=3)}}else Z(-1),te(!1)},[U,Y]),v.default.useEffect(()=>{const e=e=>{"ArrowLeft"===e.key?pe():"ArrowRight"===e.key?ce():"Escape"!==e.key&&"Enter"!==e.key||ne(-1)};return"undefined"!=typeof document&&F?.length&&re>-1&&document.addEventListener("keydown",e),()=>{F?.length&&document.removeEventListener("keydown",e)}},[]);const de=v.default.Children.toArray(t),he=v.default.Children.toArray(M),ce=()=>{ne(e=>F?.length&&e!==F.length-1?e+1:e)},pe=()=>{ne(e=>F?.length&&0!==e?e-1:e)};return e.jsxs($,{id:B,children:[re>-1&&!!F?.[re]&&e.jsx(c.Modal,{alwaysRender:!1,controlledOpen:!0,onChange:e=>!e&&ne(-1),children:e.jsxs(c.Modal.Content,{sx:`\n position: relative; \n height: ${oe.y}; \n width: ${oe.x};\n margin: 0 auto;\n `,children:[e.jsx(E,{$side:"left",$visible:0!==re,onClick:pe,children:e.jsx(g.ChevronLeft,{color:"white",size:48})}),e.jsx(w.default,{alt:"",fill:!0,quality:100,onLoad:e=>{const{naturalHeight:t,naturalWidth:i}=e.target;let r=`${i}px`,n=`${t}px`;window?.innerHeight<t&&window?.innerWidth<i?(r=`${Math.floor(.95*window.innerHeight*i/t)}px`,n=`${Math.round(.95*window.innerWidth*t/i)}px`):window?.innerHeight<t?(r=`${Math.floor(.95*window.innerHeight*i/t)}px`,n="95vh"):window?.innerWidth<i&&(r="95vw",n=`${Math.round(.95*window.innerWidth*t/i)}px`),le({x:r,y:n})},draggable:!1,priority:!0,sizes:"100vw",src:F[re],style:{objectFit:"cover"}}),e.jsx(E,{$side:"right",$visible:re!==F.length-1,onClick:ce,children:e.jsx(m.ChevronRight,{color:"white",size:48})})]})}),e.jsxs(k,{children:[e.jsx(x.Avatar,{isPaidUser:T,as:n?j.default:"button",href:n,image:o,size:64,status:r?"online":void 0,subtitle:e.jsx(h.P,{as:"span",sx:"vertical-align: top;",$fontSize:14,$lineHeight:20,children:e.jsx(p.TimeAgo,{date:new Date(_)})}),title:e.jsx(d.H,{as:n?j.default:"span",href:n,sx:"text-decoration:none;",$bold:!0,$fontSize:18,$lineHeight:26,children:i}),textPosition:"right",tooltipContent:y,tooltipSx:R,sx:n?"img { cursor: pointer; }":void 0}),I]}),!!U?.length&&e.jsxs("div",{style:{padding:"16px 24px"},children:[W&&Q>1?e.jsx(b.default,{lines:2,more:"Continue Reading",onClick:X,anchorClass:"see-more",expanded:!1,truncatedEndingComponent:"... ",children:e.jsx(h.P,{$sx:"white-space: pre-line; word-break: break-word;",$textClampLines:2,children:e.jsx(a.Highlighter,{highlightRender:t=>e.jsx(h.P,{as:"span",$color:"primary-blue-2",children:e.jsx(j.default,{href:t,target:"_blank",children:t})}),seperator:l.URL_REGEX,text:U})})}):e.jsxs(e.Fragment,{children:[e.jsx(h.P,{$sx:"white-space: pre-line; word-break: break-word;",innerRef:O,$textClampLines:Y?void 0:5,children:e.jsx(a.Highlighter,{highlightRender:t=>e.jsx(h.P,{as:"span",$color:"primary-blue-2",children:e.jsx(j.default,{href:t,target:"_blank",children:t})}),seperator:l.URL_REGEX,text:W&&1===Q?"This is a premium post. Join to the membership to unlock the full access.":U})}),ee&&!W?e.jsx(h.P,{$color:"grey-5",sx:"cursor:pointer;",$mediumBold:!0,$fontSize:14,onClick:()=>K(e=>!e),children:Y?"See less":"See more"}):null]}),W&&!F?.length&&e.jsx(L,{onClick:X,children:e.jsxs(h.P,{$fontSize:14,$mediumBold:!0,children:["Join now for $",G," per month"]})})]}),W&&!!F?.length&&!se&&e.jsxs(H,{children:[e.jsx(w.default,{alt:"",width:650,height:427,priority:!0,quality:100,src:F[0],style:{objectFit:"fill",height:"100%",width:"100%",filter:"blur(60px)",position:"absolute",top:0,left:"50%",transform:"translateX(-50%)"}}),e.jsx(u.Lock,{size:40,color:"white",sx:"z-index: 1"}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",zIndex:1},children:[e.jsx(h.P,{$color:"white",$fontSize:14,$bold:!0,$lineHeight:20,children:"Become a member"}),e.jsx(h.P,{$color:"white",$fontSize:14,$bold:!0,$lineHeight:20,children:"to unlock this post"})]}),e.jsx(L,{onClick:X,style:{zIndex:1,marginTop:0},children:e.jsxs(h.P,{$fontSize:14,$mediumBold:!0,children:["Join now for $",G," per month"]})})]}),!!F?.length&&!se&&!W&&e.jsxs(C,{$numImages:F.length,children:[F.slice(0,4).map((t,i)=>e.jsx(q,{children:e.jsx(w.default,{alt:"",fill:!0,onClick:()=>{V?.(i),ne(i)},quality:100,src:t,draggable:!1,style:{cursor:"pointer",objectFit:"cover"}})},`${N}${t.slice(0,15)}${i}`)),F.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:["+",F.length-4]})]}),!F?.length&&!se&&J&&!W&&e.jsxs(j.default,{href:J.url,target:"_blank",children:[e.jsx(q,{children:e.jsx(w.default,{alt:"",fill:!0,quality:100,src:J.imageUrl,draggable:!1,style:{cursor:"pointer",objectFit:"cover"}})}),e.jsxs(s.Box,{$dir:"column",$gap:8,sx:"padding: 8px 16px;",children:[e.jsx(h.P,{$color:"grey-2",$semiBold:!0,children:J.title}),e.jsx(h.P,{$color:"grey-5",children:J.description})]})]}),se&&e.jsx(z,{children:ae?e.jsxs("video",{ref:ie,style:{width:"100%",height:"100%"},controls:!0,playsInline:!0,poster:D.thumbnail,children:[D.videoUrls.webm&&e.jsx("source",{src:D.videoUrls.webm,type:"video/webm; codecs=vp9"}),D.videoUrls.mp4&&e.jsx("source",{src:D.videoUrls.mp4,type:"video/mp4; codecs=avc1.42E01E"}),"Your browser does not support the video tag."]}):e.jsx(f.Video,{src:D.url,thumbnail:D.thumbnail,subtitles:[],title:D?.title})}),!!de.length&&e.jsx(P,{children:!W&&de}),A&&!!he.length&&e.jsx(S,{children:he})]})};
112
+ `;exports.Post=({actions:t,author:i,authorActive:r,authorHref:n,authorImage:o,avatarTooltipContent:y,avatarTooltipSx:R,children:M,content:U,createdDate:_,dropdown:I,hasComments:A,id:B,images:F,isPaidUser:T,isPaywalled:W=!1,link:J,video:D,onJoin:X,monthlyMembershipPrice:G,onImageClick:V})=>{const N=v.default.useId(),O=v.default.useRef(null),[Y,K]=v.default.useState(!1),[Q,Z]=v.default.useState(-1),[ee,te]=v.default.useState(!1),ie=v.default.useRef(null),[re,ne]=v.default.useState(-1),[oe,le]=v.default.useState({x:"30vw",y:"30vh"}),se=!!D?.url&&!!D?.thumbnail,ae=D?.displayHtmlVideo;v.default.useEffect(()=>{if(O.current&&U?.length>0){const e=24,t=Math.ceil(O.current.offsetHeight/e);if(Z(t),!Y)try{const t=O.current.style.webkitLineClamp;O.current.style.webkitLineClamp="none";const i=O.current.offsetHeight,r=Math.ceil(i/e);O.current.style.webkitLineClamp=t,te(r>3)}catch(e){te(t>=3)}}else Z(-1),te(!1)},[U,Y]),v.default.useEffect(()=>{const e=e=>{"ArrowLeft"===e.key?pe():"ArrowRight"===e.key?ce():"Escape"!==e.key&&"Enter"!==e.key||ne(-1)};return"undefined"!=typeof document&&F?.length&&re>-1&&document.addEventListener("keydown",e),()=>{F?.length&&document.removeEventListener("keydown",e)}},[]);const de=v.default.Children.toArray(t),he=v.default.Children.toArray(M),ce=()=>{ne(e=>F?.length&&e!==F.length-1?e+1:e)},pe=()=>{ne(e=>F?.length&&0!==e?e-1:e)};return e.jsxs($,{id:B,children:[re>-1&&!!F?.[re]&&e.jsx(c.Modal,{alwaysRender:!1,controlledOpen:!0,onChange:e=>!e&&ne(-1),children:e.jsxs(c.Modal.Content,{sx:`\n position: relative; \n height: ${oe.y}; \n width: ${oe.x};\n margin: 0 auto;\n `,children:[e.jsx(E,{$side:"left",$visible:0!==re,onClick:pe,children:e.jsx(g.ChevronLeft,{color:"white",size:48})}),e.jsx(w.default,{alt:"",fill:!0,quality:100,onLoad:e=>{const{naturalHeight:t,naturalWidth:i}=e.target;let r=`${i}px`,n=`${t}px`;window?.innerHeight<t&&window?.innerWidth<i?(r=`${Math.floor(.95*window.innerHeight*i/t)}px`,n=`${Math.round(.95*window.innerWidth*t/i)}px`):window?.innerHeight<t?(r=`${Math.floor(.95*window.innerHeight*i/t)}px`,n="95vh"):window?.innerWidth<i&&(r="95vw",n=`${Math.round(.95*window.innerWidth*t/i)}px`),le({x:r,y:n})},draggable:!1,priority:!0,sizes:"100vw",src:F[re],style:{objectFit:"cover"}}),e.jsx(E,{$side:"right",$visible:re!==F.length-1,onClick:ce,children:e.jsx(m.ChevronRight,{color:"white",size:48})})]})}),e.jsxs(k,{children:[e.jsx(x.Avatar,{isPaidUser:T,as:n?j.default:"button",href:n,image:o,size:64,status:r?"online":void 0,subtitle:e.jsx(h.P,{as:"span",sx:"vertical-align: top;",$fontSize:14,$lineHeight:20,children:e.jsx(p.TimeAgo,{date:new Date(_)})}),title:e.jsx(d.H,{as:n?j.default:"span",href:n,sx:"text-decoration:none;",$bold:!0,$fontSize:18,$lineHeight:26,children:i}),textPosition:"right",tooltipContent:y,tooltipSx:R,sx:n?"img { cursor: pointer; }":void 0}),I]}),!!U?.length&&e.jsxs("div",{style:{padding:"16px 24px"},children:[W&&Q>1?e.jsx(b.default,{lines:2,more:"Continue Reading",onClick:X,anchorClass:"see-more",expanded:!1,truncatedEndingComponent:"... ",children:e.jsx(h.P,{$sx:"white-space: pre-line; word-break: break-word;",$textClampLines:2,children:e.jsx(a.Highlighter,{highlightRender:t=>e.jsx(h.P,{as:"span",$color:"primary-blue-2",children:e.jsx(j.default,{href:t,target:"_blank",children:t})}),seperator:l.URL_REGEX,text:U})})}):e.jsxs(e.Fragment,{children:[e.jsx(h.P,{$sx:"white-space: pre-line; word-break: break-word;",innerRef:O,$textClampLines:Y?void 0:5,children:e.jsx(a.Highlighter,{highlightRender:t=>e.jsx(h.P,{as:"span",$color:"primary-blue-2",children:e.jsx(j.default,{href:t,target:"_blank",children:t})}),seperator:l.URL_REGEX,text:W&&1===Q?"This is a premium post. Join to the membership to unlock the full access.":U})}),ee&&!W?e.jsx(h.P,{$color:"grey-5",sx:"cursor:pointer;",$mediumBold:!0,$fontSize:14,onClick:()=>K(e=>!e),children:Y?"See less":"See more"}):null]}),W&&!F?.length&&e.jsx(L,{onClick:X,children:e.jsxs(h.P,{$fontSize:14,$mediumBold:!0,children:["Join now for $",G," per month"]})})]}),W&&!!F?.length&&!se&&e.jsxs(H,{children:[e.jsx(w.default,{alt:"",width:650,height:427,priority:!0,quality:100,src:F[0],style:{objectFit:"fill",height:"100%",width:"100%",filter:"blur(60px)",position:"absolute",top:0,left:"50%",transform:"translateX(-50%)"}}),e.jsx(u.Lock,{size:40,color:"white",sx:"z-index: 1"}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",zIndex:1},children:[e.jsx(h.P,{$color:"white",$fontSize:14,$bold:!0,$lineHeight:20,children:"Become a member"}),e.jsx(h.P,{$color:"white",$fontSize:14,$bold:!0,$lineHeight:20,children:"to unlock this post"})]}),e.jsx(L,{onClick:X,style:{zIndex:1,marginTop:0},children:e.jsxs(h.P,{$fontSize:14,$mediumBold:!0,children:["Join now for $",G," per month"]})})]}),!!F?.length&&!se&&!W&&e.jsxs(C,{$numImages:F.length,children:[F.slice(0,4).map((t,i)=>e.jsx(q,{children:e.jsx(w.default,{alt:"",fill:!0,onClick:()=>{V?.(i),ne(i)},quality:100,src:t,draggable:!1,style:{cursor:"pointer",objectFit:"cover"}})},`${N}${t.slice(0,15)}${i}`)),F.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:["+",F.length-4]})]}),!F?.length&&!se&&J&&!W&&e.jsxs(j.default,{href:J.url,target:"_blank",children:[e.jsx(q,{children:e.jsx(w.default,{alt:"",fill:!0,quality:100,src:J.imageUrl,draggable:!1,style:{cursor:"pointer",objectFit:"cover"}})}),e.jsxs(s.Box,{$dir:"column",$gap:8,sx:"padding: 8px 16px;",children:[e.jsx(h.P,{$color:"grey-2",$semiBold:!0,children:J.title}),e.jsx(h.P,{$color:"grey-5",children:J.description})]})]}),se&&e.jsx(z,{children:ae?e.jsxs("video",{ref:ie,style:{width:"100%",height:"100%"},controls:!0,playsInline:!0,poster:D.thumbnail,children:[D.videoUrls.webm&&e.jsx("source",{src:D.videoUrls.webm,type:"video/webm; codecs=vp9"}),D.videoUrls.mp4&&e.jsx("source",{src:D.videoUrls.mp4,type:"video/mp4; codecs=avc1.42E01E"}),"Your browser does not support the video tag."]}):e.jsx(f.Video,{src:D.url,thumbnail:D.thumbnail,subtitles:[],title:D?.title})}),!!de.length&&e.jsx(P,{children:!W&&de}),A&&!!he.length&&e.jsx(S,{children:he})]})};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soul-refiner/design-system",
3
- "version": "2.14.83",
3
+ "version": "2.14.84",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "license": "MIT",