@streamlayer/react-ui 0.93.0 → 0.95.0

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.
Files changed (62) hide show
  1. package/lib/assets/style.css +1 -1
  2. package/lib/{useClipboardCopy-E5rEe6It.js → index-jRXrW6ie.js} +1513 -1537
  3. package/lib/ui/app/Features/Gamification/Friends.js +6 -5
  4. package/lib/ui/app/Features/Gamification/Leaderboard.js +4 -3
  5. package/lib/ui/app/Features/Gamification/Question.js +19 -21
  6. package/lib/ui/app/Features/Gamification/QuestionsList.js +1 -1
  7. package/lib/ui/app/Features/Gamification/Tabs.js +36 -37
  8. package/lib/ui/app/Features/Gamification/gamification-feature.js +12 -10
  9. package/lib/ui/app/Features/Gamification/index.js +73 -89
  10. package/lib/ui/app/Navigation/MastersNavigation/index.d.ts +3 -0
  11. package/lib/ui/app/Navigation/MastersNavigation/index.js +43 -35
  12. package/lib/ui/app/Notifications/Onboarding/index.d.ts +3 -2
  13. package/lib/ui/app/Notifications/Onboarding/index.js +97 -80
  14. package/lib/ui/app/Notifications/index.js +114 -112
  15. package/lib/ui/app/masters.js +48 -40
  16. package/lib/ui/app/useClipboardCopy.js +26 -5
  17. package/lib/ui/app/useMastersApp.js +42 -35
  18. package/lib/ui/app/useSdkResponsive.d.ts +1 -1
  19. package/lib/ui/app/useSdkResponsive.js +25 -25
  20. package/lib/ui/app/useSdkScroll.js +16 -15
  21. package/lib/ui/gamification/onboarding/index.d.ts +1 -1
  22. package/lib/ui/gamification/onboarding/index.js +11 -10
  23. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +14 -13
  24. package/lib/ui/gamification/question/insight/index.js +3 -4
  25. package/lib/ui/gamification/question/list/index.js +14 -14
  26. package/lib/ui/gamification/question/notification/index.js +3 -2
  27. package/lib/ui/gamification/question/notification/insight/index.d.ts +5 -3
  28. package/lib/ui/gamification/question/notification/insight/index.js +12 -17
  29. package/lib/ui/gamification/question/notification/insight/styles.d.ts +1 -0
  30. package/lib/ui/gamification/question/notification/insight/styles.js +15 -10
  31. package/lib/ui/gamification/question/notification/tweet/index.js +10 -7
  32. package/lib/ui/gamification/question/twitter/index.js +16 -33
  33. package/lib/ui/gamification/question/twitter/styles.d.ts +0 -1
  34. package/lib/ui/gamification/question/twitter/styles.js +7 -12
  35. package/lib/ui/gamification/vote/feedback/index.js +5 -5
  36. package/lib/ui/gamification/vote/insight-details/index.js +5 -6
  37. package/lib/ui/gamification/vote/twitter-details/index.js +13 -29
  38. package/lib/ui/gamification/vote/twitter-details/styles.d.ts +0 -1
  39. package/lib/ui/gamification/vote/twitter-details/styles.js +3 -8
  40. package/lib/ui/modal/index.d.ts +9 -0
  41. package/lib/ui/modal/index.js +34 -0
  42. package/lib/ui/navigation/button/FeaturedGroups.d.ts +3 -1
  43. package/lib/ui/navigation/button/FeaturedGroups.js +11 -11
  44. package/lib/ui/questions/insight/index.d.ts +1 -2
  45. package/lib/ui/questions/insight/index.js +13 -29
  46. package/lib/ui/questions/insight/styles.d.ts +0 -1
  47. package/lib/ui/questions/insight/styles.js +9 -14
  48. package/lib/ui/questions/twitter/account/index.d.ts +2 -1
  49. package/lib/ui/questions/twitter/account/index.js +24 -18
  50. package/lib/ui/questions/twitter/account/styles.d.ts +1 -1
  51. package/lib/ui/questions/twitter/account/styles.js +2 -2
  52. package/lib/ui/questions/twitter/index.d.ts +2 -2
  53. package/lib/ui/questions/twitter/index.js +62 -9
  54. package/lib/ui/questions/twitter/styles.d.ts +9 -0
  55. package/lib/ui/questions/twitter/styles.js +31 -6
  56. package/lib/ui/theme/constants.d.ts +1 -0
  57. package/lib/ui/theme/constants.js +3 -2
  58. package/lib/ui/theme/theme.js +26 -22
  59. package/lib/ui/video-player/index.js +44 -20
  60. package/lib/utils/common.js +22 -8
  61. package/lib/utils/debug/components/developer.js +62 -43
  62. package/package.json +14 -14
@@ -1,20 +1,19 @@
1
1
  import { jsxs as o, jsx as m } from "react/jsx-runtime";
2
- import { SvgIcon as l } from "../../../icons/index.js";
2
+ import { SvgIcon as p } from "../../../icons/index.js";
3
3
  import { InsightContent as b } from "../../../questions/insight/index.js";
4
4
  import { Container as k, WebLinkBtn as c } from "./styles.js";
5
5
  import "@linaria/react";
6
6
  import "react";
7
7
  import "../../../video-player/index.js";
8
8
  import "../../../video-player/styles.js";
9
- import "../../../../utils/common.js";
10
9
  import "../../../questions/insight/styles.js";
11
- const C = ({ instantView: r, ...p }) => /* @__PURE__ */ o(k, { children: [
12
- /* @__PURE__ */ m(b, { instantView: r, ...p, isDetail: !0 }),
10
+ const j = ({ instantView: r, ...l }) => /* @__PURE__ */ o(k, { children: [
11
+ /* @__PURE__ */ m(b, { instantView: r, ...l, isDetail: !0 }),
13
12
  (r == null ? void 0 : r.webLink) && /* @__PURE__ */ o(c, { href: r == null ? void 0 : r.webLink.url, target: "_blank", children: [
14
13
  r == null ? void 0 : r.webLink.label,
15
- /* @__PURE__ */ m(l, { name: "icon-external-link" })
14
+ /* @__PURE__ */ m(p, { name: "icon-external-link" })
16
15
  ] })
17
16
  ] });
18
17
  export {
19
- C as InsightDetails
18
+ j as InsightDetails
20
19
  };
@@ -1,35 +1,19 @@
1
- import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
- import { useMemo as n } from "react";
3
- import { TwitterContent as a } from "../../../questions/twitter/index.js";
4
- import { isValidDate as f, formatDate as l, formatTime as p } from "../../../../utils/common.js";
5
- import { Container as s, DateTime as d, Quote as u } from "./styles.js";
6
- import "../../../questions/twitter/account/index.js";
1
+ import { jsxs as r, jsx as i } from "react/jsx-runtime";
2
+ import { TwitterContent as o } from "../../../questions/twitter/index.js";
3
+ import { Container as m, Quote as e } from "./styles.js";
4
+ import "../../../video-player/index.js";
5
+ import "react";
7
6
  import "../../../icons/index.js";
8
7
  import "@linaria/react";
8
+ import "../../../video-player/styles.js";
9
+ import "../../../questions/twitter/account/index.js";
10
+ import "../../../../utils/common.js";
9
11
  import "../../../questions/twitter/account/styles.js";
10
12
  import "../../../questions/twitter/styles.js";
11
- const V = ({ created: t, ...i }) => {
12
- const e = n(() => {
13
- if (t) {
14
- const r = new Date(t);
15
- if (f(r))
16
- return {
17
- date: l(r),
18
- time: p(r)
19
- };
20
- }
21
- return null;
22
- }, [t]);
23
- return /* @__PURE__ */ m(s, { children: [
24
- e && /* @__PURE__ */ m(d, { children: [
25
- e.date,
26
- " · ",
27
- e.time
28
- ] }),
29
- i.title && /* @__PURE__ */ o(u, { children: i.title }),
30
- /* @__PURE__ */ o(a, { ...i })
31
- ] });
32
- };
13
+ const w = (t) => /* @__PURE__ */ r(m, { children: [
14
+ t.title && /* @__PURE__ */ i(e, { children: t.title }),
15
+ /* @__PURE__ */ i(o, { ...t, isDetail: !0 })
16
+ ] });
33
17
  export {
34
- V as TwitterDetails
18
+ w as TwitterDetails
35
19
  };
@@ -1,4 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  export declare const Container: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
- export declare const DateTime: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
3
  export declare const Quote: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLQuoteElement> & import("react").BlockquoteHTMLAttributes<HTMLQuoteElement> & Record<never, unknown>>;
@@ -1,19 +1,14 @@
1
1
  import { styled as s } from "@linaria/react";
2
- const o = /* @__PURE__ */ s("div")({
2
+ const e = /* @__PURE__ */ s("div")({
3
3
  name: "Container",
4
4
  class: "c1dcxmvf",
5
5
  propsAsIs: !1
6
- }), a = /* @__PURE__ */ s("div")({
7
- name: "DateTime",
8
- class: "db4q22c",
9
- propsAsIs: !1
10
6
  }), t = /* @__PURE__ */ s("blockquote")({
11
7
  name: "Quote",
12
- class: "q111mmic",
8
+ class: "qb4q22c",
13
9
  propsAsIs: !1
14
10
  });
15
11
  export {
16
- o as Container,
17
- a as DateTime,
12
+ e as Container,
18
13
  t as Quote
19
14
  };
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ type ModalProps = {
3
+ Modal: React.ReactNode;
4
+ container: React.MutableRefObject<HTMLDivElement | null>;
5
+ fixedView: boolean;
6
+ useContainer: boolean;
7
+ };
8
+ export declare const createModal: ({ Modal, container, fixedView, useContainer }: ModalProps) => import("react").ReactPortal | null;
9
+ export {};
@@ -0,0 +1,34 @@
1
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
+ import { cx as l } from "@linaria/core";
3
+ import { styled as m } from "@linaria/react";
4
+ import { r as n } from "../../index-jRXrW6ie.js";
5
+ import "../../index-uEuzH3jr.js";
6
+ import "react";
7
+ const c = /* @__PURE__ */ m("div")({
8
+ name: "StaticContainer",
9
+ class: "svm502q",
10
+ propsAsIs: !1
11
+ }), i = "fd3gza8", d = `
12
+ body {
13
+ overflow: hidden !important;
14
+ }
15
+ `, p = `
16
+ .sl-hide-on-modal {
17
+ display: none !important;
18
+ }
19
+ `, C = ({
20
+ Modal: o,
21
+ container: t,
22
+ fixedView: r,
23
+ useContainer: s
24
+ }) => t.current ? s ? n.createPortal(/* @__PURE__ */ a(c, {
25
+ className: l(r && i),
26
+ children: [o, r && /* @__PURE__ */ e("style", {
27
+ children: d
28
+ }), !r && /* @__PURE__ */ e("style", {
29
+ children: p
30
+ })]
31
+ }), t.current, "modal-node") : n.createPortal(o, t.current, "modal-node") : null;
32
+ export {
33
+ C as createModal
34
+ };
@@ -1,4 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ButtonProps } from '.';
3
3
  export declare const FeaturedGroupsButtonId = "featuredGroups";
4
- export declare const FeaturedGroupsButton: React.FC<Omit<ButtonProps, 'label' | 'id' | 'icon'>>;
4
+ export declare const FeaturedGroupsButton: React.FC<Omit<ButtonProps, 'label' | 'id' | 'icon'> & {
5
+ labelFull: boolean;
6
+ }>;
@@ -1,26 +1,26 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { styled as e } from "@linaria/react";
3
- import { SvgIcon as n } from "../../icons/index.js";
4
- import { Button as s } from "./index.js";
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { styled as r } from "@linaria/react";
3
+ import { SvgIcon as u } from "../../icons/index.js";
4
+ import { Button as n } from "./index.js";
5
5
  import "react";
6
6
  import "./styles.js";
7
- const u = () => n, c = /* @__PURE__ */ e(u())({
7
+ const s = () => u, a = /* @__PURE__ */ r(s())({
8
8
  name: "ButtonIcon",
9
9
  class: "b11des7c",
10
10
  propsAsIs: !0
11
- }), l = "featuredGroups", B = (t) => {
11
+ }), f = "featuredGroups", G = (t) => {
12
12
  var o;
13
- return /* @__PURE__ */ r(s, {
13
+ return /* @__PURE__ */ e(n, {
14
14
  ...t,
15
- label: "FG+",
15
+ label: t.labelFull ? "Featured Groups +" : "FG+",
16
16
  id: "featuredGroups",
17
- icon: /* @__PURE__ */ r(c, {
17
+ icon: /* @__PURE__ */ e(a, {
18
18
  name: "icon-btn-feature-groups",
19
19
  "data-selected": (o = t.active) == null ? void 0 : o.toString()
20
20
  })
21
21
  });
22
22
  };
23
23
  export {
24
- B as FeaturedGroupsButton,
25
- l as FeaturedGroupsButtonId
24
+ G as FeaturedGroupsButton,
25
+ f as FeaturedGroupsButtonId
26
26
  };
@@ -1,7 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { InsightHistory, FeedItem } from '@streamlayer/sdk-web-types';
2
+ import { InsightHistory } from '@streamlayer/sdk-web-types';
3
3
  export type InsightContentProps = InsightHistory & {
4
- created?: FeedItem['created'];
5
4
  isDetail?: boolean;
6
5
  };
7
6
  export declare const InsightContent: React.FC<InsightContentProps>;
@@ -1,37 +1,21 @@
1
- import { jsxs as e, jsx as m } from "react/jsx-runtime";
2
- import { useMemo as T } from "react";
3
- import { VideoPlayer as v } from "../../video-player/index.js";
4
- import { isValidDate as b, formatDate as f, formatTime as x } from "../../../utils/common.js";
5
- import { Container as C, DateWrap as I, Image as j, Content as B, Title as M, Description as P } from "./styles.js";
1
+ import { jsxs as c, jsx as d } from "react/jsx-runtime";
2
+ import { VideoPlayer as u } from "../../video-player/index.js";
3
+ import { Container as v, Image as b, Content as x, Title as C, Description as I } from "./styles.js";
4
+ import "react";
6
5
  import "../../icons/index.js";
7
6
  import "@linaria/react";
8
7
  import "../../video-player/styles.js";
9
- const G = ({ created: d, instantView: r, isDetail: h, notification: o }) => {
10
- const l = T(() => {
11
- if (d) {
12
- const p = new Date(d);
13
- if (b(p))
14
- return {
15
- date: f(p),
16
- time: x(p)
17
- };
18
- }
19
- return null;
20
- }, [d]), u = r == null ? void 0 : r.heading, c = r == null ? void 0 : r.body, g = u || c, y = o == null ? void 0 : o.title, D = o == null ? void 0 : o.body;
21
- return /* @__PURE__ */ e(C, { children: [
22
- l && /* @__PURE__ */ e(I, { children: [
23
- l.date,
24
- " · ",
25
- l.time
26
- ] }),
27
- (r == null ? void 0 : r.video) && /* @__PURE__ */ m(v, { source: r.video.url, poster: r.video.thumbnailUrl }),
28
- (r == null ? void 0 : r.image) && !(r != null && r.video) && /* @__PURE__ */ m(j, { src: r == null ? void 0 : r.image }),
29
- /* @__PURE__ */ e(B, { children: [
30
- /* @__PURE__ */ m(M, { children: h && g ? u : y }),
31
- /* @__PURE__ */ m(P, { children: h && g ? c : D })
8
+ const q = ({ instantView: r, isDetail: l, notification: o }) => {
9
+ const m = r == null ? void 0 : r.heading, p = r == null ? void 0 : r.body, h = m || p, g = o == null ? void 0 : o.title, y = o == null ? void 0 : o.body;
10
+ return /* @__PURE__ */ c(v, { children: [
11
+ (r == null ? void 0 : r.video) && /* @__PURE__ */ d(u, { source: r.video.url, poster: r.video.thumbnailUrl }),
12
+ (r == null ? void 0 : r.image) && !(r != null && r.video) && /* @__PURE__ */ d(b, { src: r == null ? void 0 : r.image }),
13
+ /* @__PURE__ */ c(x, { children: [
14
+ /* @__PURE__ */ d(C, { children: l && h ? m : g }),
15
+ /* @__PURE__ */ d(I, { children: l && h ? p : y })
32
16
  ] })
33
17
  ] });
34
18
  };
35
19
  export {
36
- G as InsightContent
20
+ q as InsightContent
37
21
  };
@@ -3,5 +3,4 @@ export declare const Container: import("@linaria/react").StyledComponent<import(
3
3
  export declare const Content: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
4
  export declare const Title: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLHeadingElement> & import("react").HTMLAttributes<HTMLHeadingElement> & Record<never, unknown>>;
5
5
  export declare const Description: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
6
- export declare const DateWrap: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
7
6
  export declare const Image: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown>>;
@@ -1,13 +1,13 @@
1
1
  import { styled as s } from "@linaria/react";
2
- const a = /* @__PURE__ */ s("div")({
2
+ const n = /* @__PURE__ */ s("div")({
3
3
  name: "Container",
4
4
  class: "cgn5uen",
5
5
  propsAsIs: !1
6
- }), n = /* @__PURE__ */ s("div")({
6
+ }), t = /* @__PURE__ */ s("div")({
7
7
  name: "Content",
8
8
  class: "c1px8nt6",
9
9
  propsAsIs: !1
10
- }), t = /* @__PURE__ */ s("h3")({
10
+ }), a = /* @__PURE__ */ s("h3")({
11
11
  name: "Title",
12
12
  class: "t5et2jt",
13
13
  propsAsIs: !1
@@ -15,20 +15,15 @@ const a = /* @__PURE__ */ s("div")({
15
15
  name: "Description",
16
16
  class: "d1i2kpk2",
17
17
  propsAsIs: !1
18
- }), p = /* @__PURE__ */ s("div")({
19
- name: "DateWrap",
20
- class: "dd3lh3p",
21
- propsAsIs: !1
22
- }), c = /* @__PURE__ */ s("img")({
18
+ }), p = /* @__PURE__ */ s("img")({
23
19
  name: "Image",
24
- class: "i1gfjeu5",
20
+ class: "id3lh3p",
25
21
  propsAsIs: !1
26
22
  });
27
23
  export {
28
- a as Container,
29
- n as Content,
30
- p as DateWrap,
24
+ n as Container,
25
+ t as Content,
31
26
  o as Description,
32
- c as Image,
33
- t as Title
27
+ p as Image,
28
+ a as Title
34
29
  };
@@ -1,8 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  export type AccountProps = {
3
3
  image: string;
4
- name: string;
4
+ name: string | undefined;
5
5
  userName: string;
6
6
  verified: boolean;
7
+ createdTweet?: string;
7
8
  };
8
9
  export declare const Account: React.FC<AccountProps>;
@@ -1,25 +1,31 @@
1
1
  import { jsxs as r, jsx as t } from "react/jsx-runtime";
2
- import { SvgIcon as c } from "../../../icons/index.js";
3
- import { Container as m, ImageContainer as a, Image as d, TwitterIcon as l, Details as p, Name as s, UserName as h } from "./styles.js";
2
+ import { SvgIcon as a } from "../../../icons/index.js";
3
+ import { getTimeUntilNow as l } from "../../../../utils/common.js";
4
+ import { Container as p, ImageContainer as s, Image as d, TwitterIcon as f, Details as h, Name as D, UserNameAndDate as I } from "./styles.js";
4
5
  import "@linaria/react";
5
6
  import "react";
6
- const j = ({ image: e, name: n, userName: i, verified: o }) => /* @__PURE__ */ r(m, { children: [
7
- e && /* @__PURE__ */ r(a, { children: [
8
- /* @__PURE__ */ t(d, { src: e }),
9
- /* @__PURE__ */ t(l, { name: "twitter" })
10
- ] }),
11
- /* @__PURE__ */ r(p, { children: [
12
- /* @__PURE__ */ r(s, { children: [
13
- n,
14
- " ",
15
- o && /* @__PURE__ */ t(c, { name: "icon-twitter-verified" })
7
+ const C = ({ image: i, name: o, userName: e, verified: c, createdTweet: n }) => {
8
+ const m = n && l(n);
9
+ return /* @__PURE__ */ r(p, { children: [
10
+ i && /* @__PURE__ */ r(s, { children: [
11
+ /* @__PURE__ */ t(d, { src: i }),
12
+ /* @__PURE__ */ t(f, { name: "twitter" })
16
13
  ] }),
17
- i && /* @__PURE__ */ r(h, { children: [
18
- "@",
19
- i
14
+ /* @__PURE__ */ r(h, { children: [
15
+ o && /* @__PURE__ */ r(D, { children: [
16
+ o,
17
+ " ",
18
+ c && /* @__PURE__ */ t(a, { name: "icon-twitter-verified" })
19
+ ] }),
20
+ e && /* @__PURE__ */ r(I, { children: [
21
+ "@",
22
+ e,
23
+ " ",
24
+ m && `・ ${m}`
25
+ ] })
20
26
  ] })
21
- ] })
22
- ] });
27
+ ] });
28
+ };
23
29
  export {
24
- j as Account
30
+ C as Account
25
31
  };
@@ -5,4 +5,4 @@ export declare const Image: import("@linaria/react").StyledComponent<import("rea
5
5
  export declare const TwitterIcon: any;
6
6
  export declare const Details: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
7
7
  export declare const Name: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
8
- export declare const UserName: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
8
+ export declare const UserNameAndDate: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
@@ -27,7 +27,7 @@ const m = /* @__PURE__ */ s("div")({
27
27
  class: "nrxa4k8",
28
28
  propsAsIs: !1
29
29
  }), g = /* @__PURE__ */ s("div")({
30
- name: "UserName",
30
+ name: "UserNameAndDate",
31
31
  class: "u1p051g3",
32
32
  propsAsIs: !1
33
33
  });
@@ -38,5 +38,5 @@ export {
38
38
  c as ImageContainer,
39
39
  I as Name,
40
40
  p as TwitterIcon,
41
- g as UserName
41
+ g as UserNameAndDate
42
42
  };
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { TweetHistory, FeedItem } from '@streamlayer/sdk-web-types';
2
+ import { TweetHistory } from '@streamlayer/sdk-web-types';
3
3
  export type TwitterContentProps = TweetHistory & {
4
- created?: FeedItem['created'];
4
+ isDetail?: boolean;
5
5
  };
6
6
  export declare const TwitterContent: React.FC<TwitterContentProps>;
@@ -1,14 +1,67 @@
1
- import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
- import { Account as s } from "./account/index.js";
3
- import { Container as m, Details as p, Body as c } from "./styles.js";
1
+ import { jsxs as t, jsx as n, Fragment as T } from "react/jsx-runtime";
2
+ import { VideoPlayer as j } from "../../video-player/index.js";
3
+ import { Account as k } from "./account/index.js";
4
+ import { Container as x, Details as B, Body as E, ImagesContainer as c, ImageFullSize as i, ImageHalfSize as e, ImagesBlock as m } from "./styles.js";
5
+ import "react";
4
6
  import "../../icons/index.js";
5
7
  import "@linaria/react";
6
- import "react";
8
+ import "../../video-player/styles.js";
9
+ import "../../../utils/common.js";
7
10
  import "./account/styles.js";
8
- const a = new RegExp("\\s?https?://t.co[^\\s]+(\\s+)?$"), d = (r) => r == null ? void 0 : r.replace(a, ""), j = ({ image: r, body: o, account: i, accountVerified: t }) => /* @__PURE__ */ e(m, { children: /* @__PURE__ */ n(p, { children: [
9
- /* @__PURE__ */ e(s, { image: r, name: i, userName: i, verified: t }),
10
- /* @__PURE__ */ e(c, { children: d(o) })
11
- ] }) });
11
+ const N = new RegExp("\\s?https?://t.co[^\\s]+(\\s+)?$"), R = (o) => o == null ? void 0 : o.replace(N, ""), G = ({
12
+ image: o,
13
+ body: C,
14
+ account: z,
15
+ accountVerified: F,
16
+ tweet: s,
17
+ isDetail: a
18
+ }) => {
19
+ var h, g, H, U, f, u, v, I, y;
20
+ const r = (g = (h = s == null ? void 0 : s.meta) == null ? void 0 : h.extendedEntities) == null ? void 0 : g.media, l = r == null ? void 0 : r.find(({ type: p }) => p === "photo"), d = (u = (f = (U = (H = r == null ? void 0 : r[0]) == null ? void 0 : H.videoInfo) == null ? void 0 : U.variants) == null ? void 0 : f.find(
21
+ ({ contentType: p }) => p === "video/mp4"
22
+ )) == null ? void 0 : u.url;
23
+ return /* @__PURE__ */ t(x, { children: [
24
+ /* @__PURE__ */ t(B, { children: [
25
+ /* @__PURE__ */ n(
26
+ k,
27
+ {
28
+ image: o,
29
+ name: (v = s == null ? void 0 : s.meta) == null ? void 0 : v.accountName,
30
+ userName: z,
31
+ verified: F,
32
+ createdTweet: s == null ? void 0 : s.date
33
+ }
34
+ ),
35
+ /* @__PURE__ */ n(E, { children: R(C) }),
36
+ !a && l && /* @__PURE__ */ n(c, { children: /* @__PURE__ */ n(i, { src: r == null ? void 0 : r[0].mediaUrlHttps }) }),
37
+ a && l && /* @__PURE__ */ t(T, { children: [
38
+ (r == null ? void 0 : r.length) === 1 && /* @__PURE__ */ n(c, { children: /* @__PURE__ */ n(i, { src: r[0].mediaUrlHttps }) }),
39
+ (r == null ? void 0 : r.length) === 2 && /* @__PURE__ */ t(c, { children: [
40
+ /* @__PURE__ */ n(e, { src: r[0].mediaUrlHttps }),
41
+ /* @__PURE__ */ n(e, { src: r[1].mediaUrlHttps })
42
+ ] }),
43
+ (r == null ? void 0 : r.length) === 3 && /* @__PURE__ */ t(c, { children: [
44
+ /* @__PURE__ */ n(e, { src: r[0].mediaUrlHttps }),
45
+ /* @__PURE__ */ t(m, { children: [
46
+ /* @__PURE__ */ n(i, { src: r[1].mediaUrlHttps }),
47
+ /* @__PURE__ */ n(i, { src: r[2].mediaUrlHttps })
48
+ ] })
49
+ ] }),
50
+ (r == null ? void 0 : r.length) === 4 && /* @__PURE__ */ t(c, { children: [
51
+ /* @__PURE__ */ t(m, { children: [
52
+ /* @__PURE__ */ n(i, { src: r[0].mediaUrlHttps }),
53
+ /* @__PURE__ */ n(i, { src: r[1].mediaUrlHttps })
54
+ ] }),
55
+ /* @__PURE__ */ t(m, { children: [
56
+ /* @__PURE__ */ n(i, { src: r[2].mediaUrlHttps }),
57
+ /* @__PURE__ */ n(i, { src: r[3].mediaUrlHttps })
58
+ ] })
59
+ ] })
60
+ ] })
61
+ ] }),
62
+ !l && (((I = r == null ? void 0 : r[0]) == null ? void 0 : I.type) === "video" || ((y = r == null ? void 0 : r[0]) == null ? void 0 : y.type) === "animated_gif") && d && /* @__PURE__ */ n(j, { source: d, poster: r[0].mediaUrlHttps })
63
+ ] });
64
+ };
12
65
  export {
13
- j as TwitterContent
66
+ G as TwitterContent
14
67
  };
@@ -2,3 +2,12 @@
2
2
  export declare const Container: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
3
  export declare const Details: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
4
  export declare const Body: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
5
+ export declare const ImagesContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
6
+ export declare const ImagesBlock: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
7
+ export declare const Image: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown>>;
8
+ export declare const ImageFullSize: import("@linaria/react").WYWEvalMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown> & {
9
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
10
+ }>;
11
+ export declare const ImageHalfSize: import("@linaria/react").WYWEvalMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown> & {
12
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
13
+ }>;
@@ -1,19 +1,44 @@
1
1
  import { styled as s } from "@linaria/react";
2
- const e = /* @__PURE__ */ s("div")({
2
+ const l = /* @__PURE__ */ s("div")({
3
3
  name: "Container",
4
4
  class: "c1kzqw87",
5
5
  propsAsIs: !1
6
- }), o = /* @__PURE__ */ s("div")({
6
+ }), t = /* @__PURE__ */ s("div")({
7
7
  name: "Details",
8
8
  class: "d9r1hf9",
9
9
  propsAsIs: !1
10
- }), t = /* @__PURE__ */ s("div")({
10
+ }), i = /* @__PURE__ */ s("div")({
11
11
  name: "Body",
12
12
  class: "bezygt5",
13
13
  propsAsIs: !1
14
+ }), m = /* @__PURE__ */ s("div")({
15
+ name: "ImagesContainer",
16
+ class: "i1y8f7ym",
17
+ propsAsIs: !1
18
+ }), c = /* @__PURE__ */ s("div")({
19
+ name: "ImagesBlock",
20
+ class: "i18gwonx",
21
+ propsAsIs: !1
22
+ }), e = /* @__PURE__ */ s("img")({
23
+ name: "Image",
24
+ class: "i3g0xjd",
25
+ propsAsIs: !1
26
+ }), a = () => e, p = /* @__PURE__ */ s(a())({
27
+ name: "ImageFullSize",
28
+ class: "io8rt7p",
29
+ propsAsIs: !0
30
+ }), o = () => e, r = /* @__PURE__ */ s(o())({
31
+ name: "ImageHalfSize",
32
+ class: "i4hn3ox",
33
+ propsAsIs: !0
14
34
  });
15
35
  export {
16
- t as Body,
17
- e as Container,
18
- o as Details
36
+ i as Body,
37
+ l as Container,
38
+ t as Details,
39
+ e as Image,
40
+ p as ImageFullSize,
41
+ r as ImageHalfSize,
42
+ c as ImagesBlock,
43
+ m as ImagesContainer
19
44
  };
@@ -80,6 +80,7 @@ export declare const FONT: {
80
80
  WEIGHT_DEFAULT: string;
81
81
  };
82
82
  export declare const BREAKPOINTS: {
83
+ xs: number;
83
84
  sm: number;
84
85
  md: number;
85
86
  lg: number;
@@ -55,11 +55,12 @@ const N = {
55
55
  COLOR: "#fff",
56
56
  WEIGHT_DEFAULT: "500"
57
57
  }, O = {
58
+ xs: 324,
58
59
  sm: 576,
59
60
  md: 768,
60
61
  lg: 992,
61
- xl: 1200,
62
- xxl: 1400
62
+ xl: 1215,
63
+ xxl: 1440
63
64
  }, G = {
64
65
  landscape: "landscape",
65
66
  portrait: "portrait"