@soul-refiner/design-system 2.14.85 → 2.14.86
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,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":"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"}
|