@streamlayer/react-ui 0.93.0 → 0.94.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 (52) 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 +39 -40
  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 +2 -0
  11. package/lib/ui/app/Navigation/MastersNavigation/index.js +40 -34
  12. package/lib/ui/app/Notifications/Onboarding/index.d.ts +3 -2
  13. package/lib/ui/app/Notifications/Onboarding/index.js +96 -79
  14. package/lib/ui/app/Notifications/index.js +114 -112
  15. package/lib/ui/app/masters.js +35 -31
  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 +11 -10
  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/tweet/index.js +10 -7
  28. package/lib/ui/gamification/question/twitter/index.js +16 -33
  29. package/lib/ui/gamification/question/twitter/styles.d.ts +0 -1
  30. package/lib/ui/gamification/question/twitter/styles.js +7 -12
  31. package/lib/ui/gamification/vote/insight-details/index.js +5 -6
  32. package/lib/ui/gamification/vote/twitter-details/index.js +13 -29
  33. package/lib/ui/gamification/vote/twitter-details/styles.d.ts +0 -1
  34. package/lib/ui/gamification/vote/twitter-details/styles.js +3 -8
  35. package/lib/ui/modal/index.d.ts +9 -0
  36. package/lib/ui/modal/index.js +34 -0
  37. package/lib/ui/navigation/button/FeaturedGroups.d.ts +3 -1
  38. package/lib/ui/navigation/button/FeaturedGroups.js +11 -11
  39. package/lib/ui/questions/insight/index.d.ts +1 -2
  40. package/lib/ui/questions/insight/index.js +13 -29
  41. package/lib/ui/questions/insight/styles.d.ts +0 -1
  42. package/lib/ui/questions/insight/styles.js +9 -14
  43. package/lib/ui/questions/twitter/account/index.d.ts +2 -1
  44. package/lib/ui/questions/twitter/account/index.js +24 -18
  45. package/lib/ui/questions/twitter/account/styles.d.ts +1 -1
  46. package/lib/ui/questions/twitter/account/styles.js +2 -2
  47. package/lib/ui/questions/twitter/index.d.ts +2 -2
  48. package/lib/ui/questions/twitter/index.js +31 -9
  49. package/lib/ui/questions/twitter/styles.d.ts +1 -0
  50. package/lib/ui/questions/twitter/styles.js +8 -3
  51. package/lib/utils/common.js +22 -8
  52. package/package.json +14 -14
@@ -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,36 @@
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 l, jsx as n } from "react/jsx-runtime";
2
+ import { VideoPlayer as v } from "../../video-player/index.js";
3
+ import { Account as y } from "./account/index.js";
4
+ import { Container as C, Details as T, Body as U, Image as j } 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 x = new RegExp("\\s?https?://t.co[^\\s]+(\\s+)?$"), D = (i) => i == null ? void 0 : i.replace(x, ""), L = ({ image: i, body: f, account: h, accountVerified: u, tweet: o }) => {
12
+ var s, m, t, a, c, e, d;
13
+ const r = (m = (s = o == null ? void 0 : o.meta) == null ? void 0 : s.extendedEntities) == null ? void 0 : m.media, p = (e = (c = (a = (t = r == null ? void 0 : r[0]) == null ? void 0 : t.videoInfo) == null ? void 0 : a.variants) == null ? void 0 : c.find(
14
+ ({ contentType: g }) => g === "video/mp4"
15
+ )) == null ? void 0 : e.url;
16
+ return /* @__PURE__ */ l(C, { children: [
17
+ /* @__PURE__ */ l(T, { children: [
18
+ /* @__PURE__ */ n(
19
+ y,
20
+ {
21
+ image: i,
22
+ name: (d = o == null ? void 0 : o.meta) == null ? void 0 : d.accountName,
23
+ userName: h,
24
+ verified: u,
25
+ createdTweet: o == null ? void 0 : o.date
26
+ }
27
+ ),
28
+ /* @__PURE__ */ n(U, { children: D(f) }),
29
+ (r == null ? void 0 : r.length) && r[0].type === "photo" && /* @__PURE__ */ n(j, { src: r[0].mediaUrlHttps })
30
+ ] }),
31
+ (r == null ? void 0 : r.length) && (r[0].type === "video" || r[0].type === "animated_gif") && p && /* @__PURE__ */ n(v, { source: p, poster: r[0].mediaUrlHttps })
32
+ ] });
33
+ };
12
34
  export {
13
- j as TwitterContent
35
+ L as TwitterContent
14
36
  };
@@ -2,3 +2,4 @@
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 Image: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown>>;
@@ -7,13 +7,18 @@ const e = /* @__PURE__ */ s("div")({
7
7
  name: "Details",
8
8
  class: "d9r1hf9",
9
9
  propsAsIs: !1
10
- }), t = /* @__PURE__ */ s("div")({
10
+ }), n = /* @__PURE__ */ s("div")({
11
11
  name: "Body",
12
12
  class: "bezygt5",
13
13
  propsAsIs: !1
14
+ }), t = /* @__PURE__ */ s("img")({
15
+ name: "Image",
16
+ class: "i1y8f7ym",
17
+ propsAsIs: !1
14
18
  });
15
19
  export {
16
- t as Body,
20
+ n as Body,
17
21
  e as Container,
18
- o as Details
22
+ o as Details,
23
+ t as Image
19
24
  };
@@ -1,15 +1,29 @@
1
- const o = (t) => t.split(/\s+/).map((e) => e[0]).join("").toUpperCase(), i = (t) => t ? t.toLocaleString("en-US") : "0", a = (t) => t.toLocaleDateString("en-US", {
1
+ const I = (t) => t.split(/\s+/).map((n) => n[0]).join("").toUpperCase(), s = (t) => t ? t.toLocaleString("en-US") : "0", S = (t) => t.toLocaleDateString("en-US", {
2
2
  weekday: "short",
3
3
  month: "short",
4
4
  day: "numeric"
5
- }), n = (t) => t.toLocaleTimeString("en-US", {
5
+ }), N = (t) => t.toLocaleTimeString("en-US", {
6
6
  hour: "2-digit",
7
7
  minute: "2-digit"
8
- }), r = (t) => !isNaN(t.getTime());
8
+ }), c = (t) => !isNaN(t.getTime()), L = (t) => {
9
+ const o = new Date(t);
10
+ if (!o)
11
+ return "";
12
+ const r = /* @__PURE__ */ new Date(), e = Math.floor(r.getTime() - o.getTime());
13
+ return e < 6e4 ? `${Math.floor(e / 1e3)}s` : e < 36e5 ? `${Math.floor(e / 6e4)}m` : e < 864e5 ? `${Math.floor(e / 36e5)}h` : o.getFullYear() === r.getFullYear() ? `${o.toLocaleDateString("en-US", {
14
+ month: "short",
15
+ day: "numeric"
16
+ })}` : `${o.toLocaleDateString("en-US", {
17
+ month: "2-digit",
18
+ day: "2-digit",
19
+ year: "2-digit"
20
+ })}`;
21
+ };
9
22
  export {
10
- o as abbreviate,
11
- a as formatDate,
12
- i as formatDecimals,
13
- n as formatTime,
14
- r as isValidDate
23
+ I as abbreviate,
24
+ S as formatDate,
25
+ s as formatDecimals,
26
+ N as formatTime,
27
+ L as getTimeUntilNow,
28
+ c as isValidDate
15
29
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react-ui",
3
- "version": "0.93.0",
3
+ "version": "0.94.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./lib/index.d.ts",
@@ -36,24 +36,24 @@
36
36
  ],
37
37
  "peerDependencies": {
38
38
  "@lottiefiles/react-lottie-player": "*",
39
- "@streamlayer/sl-eslib": "^5.64.1",
39
+ "@streamlayer/sl-eslib": "^5.66.0",
40
40
  "@types/lodash.throttle": "^4.1.9",
41
41
  "lodash.throttle": "^4.1.1",
42
42
  "react-infinite-scroller": "^1.2.6",
43
43
  "react-virtualized-auto-sizer": "^1.0.21",
44
44
  "react-window": "^1.8.10",
45
45
  "react-window-infinite-loader": "^1.0.9",
46
- "@streamlayer/feature-gamification": "^0.35.1",
47
- "@streamlayer/sdk-web": "^0.30.2",
48
- "@streamlayer/sdk-web-anonymous-auth": "^0.11.34",
49
- "@streamlayer/sdk-web-api": "^0.20.1",
50
- "@streamlayer/sdk-web-core": "^0.18.2",
51
- "@streamlayer/sdk-web-features": "^0.11.16",
52
- "@streamlayer/sdk-web-interfaces": "^0.20.1",
53
- "@streamlayer/sdk-web-notifications": "^0.13.7",
54
- "@streamlayer/sdk-web-logger": "^0.5.12",
55
- "@streamlayer/sdk-web-storage": "^0.3.12",
56
- "@streamlayer/sdk-web-types": "^0.21.1"
46
+ "@streamlayer/feature-gamification": "^0.36.0",
47
+ "@streamlayer/sdk-web": "^0.31.0",
48
+ "@streamlayer/sdk-web-api": "^0.21.0",
49
+ "@streamlayer/sdk-web-anonymous-auth": "^0.11.35",
50
+ "@streamlayer/sdk-web-core": "^0.19.0",
51
+ "@streamlayer/sdk-web-features": "^0.11.17",
52
+ "@streamlayer/sdk-web-interfaces": "^0.20.2",
53
+ "@streamlayer/sdk-web-logger": "^0.5.13",
54
+ "@streamlayer/sdk-web-notifications": "^0.13.8",
55
+ "@streamlayer/sdk-web-storage": "^0.4.0",
56
+ "@streamlayer/sdk-web-types": "^0.22.0"
57
57
  },
58
58
  "nx": {
59
59
  "implicitDependencies": [
@@ -94,6 +94,6 @@
94
94
  "vite-plugin-svgr": "^4.2.0",
95
95
  "vite-svg-loader": "^5.1.0",
96
96
  "vite-tsconfig-paths": "^4.3.1",
97
- "@streamlayer/react": "^0.37.1"
97
+ "@streamlayer/react": "^0.38.0"
98
98
  }
99
99
  }