@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,15 +1,16 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
- import { OnboardingInviteCard as e } from "../../../gamification/onboarding/slides/onboarding-invite-card/index.js";
3
- import "../../../../useClipboardCopy-E5rEe6It.js";
2
+ import { OnboardingInviteCard as r } from "../../../gamification/onboarding/slides/onboarding-invite-card/index.js";
3
+ import "../../useClipboardCopy.js";
4
4
  import "react";
5
+ import "../../../../index-jRXrW6ie.js";
5
6
  import "../../../../index-uEuzH3jr.js";
6
7
  import "../../../gamification/copyNotification/index.js";
7
8
  import "../../../icons/index.js";
8
9
  import "@linaria/react";
9
10
  import "../../../gamification/copyNotification/styles.js";
10
11
  import "../../../gamification/onboarding/slides/onboarding-invite-card/styles.js";
11
- const h = ({ renderClipBoardNode: t, deepLink: o }) => /* @__PURE__ */ i(
12
- e,
12
+ const k = ({ renderClipBoardNode: t, deepLink: o }) => /* @__PURE__ */ i(
13
+ r,
13
14
  {
14
15
  renderToNode: t,
15
16
  inviteLink: o,
@@ -30,5 +31,5 @@ const h = ({ renderClipBoardNode: t, deepLink: o }) => /* @__PURE__ */ i(
30
31
  }
31
32
  );
32
33
  export {
33
- h as Friends
34
+ k as Friends
34
35
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as t, jsxs as L, Fragment as f } from "react/jsx-runtime";
2
2
  import { styled as h } from "@linaria/react";
3
3
  import { useStore as p } from "@nanostores/react";
4
- import { u as I } from "../../../../useClipboardCopy-E5rEe6It.js";
4
+ import { useClipboardCopy as I } from "../../useClipboardCopy.js";
5
5
  import { InviteLink as k } from "../../../gamification/invite-link/index.js";
6
6
  import "react-virtualized-auto-sizer";
7
7
  import "react-window";
@@ -12,6 +12,7 @@ import "../../../gamification/leaderboard/list-item/styles.js";
12
12
  import "../../../../styles_z07sl8-w40geAFS.js";
13
13
  import { LeaderboardStaticList as u } from "../../../gamification/leaderboard/static.js";
14
14
  import { Friends as y } from "./Friends.js";
15
+ import "../../../../index-jRXrW6ie.js";
15
16
  import "../../../../index-uEuzH3jr.js";
16
17
  import "../../../gamification/copyNotification/index.js";
17
18
  import "../../../gamification/copyNotification/styles.js";
@@ -25,7 +26,7 @@ const b = /* @__PURE__ */ h("div")({
25
26
  name: "InviteLinkContainer",
26
27
  class: "i1chxfpe",
27
28
  propsAsIs: !1
28
- }), Q = ({
29
+ }), R = ({
29
30
  gamification: r,
30
31
  scrollNode: m,
31
32
  scrollStore: n,
@@ -61,5 +62,5 @@ const b = /* @__PURE__ */ h("div")({
61
62
  });
62
63
  };
63
64
  export {
64
- Q as Leaderboard
65
+ R as Leaderboard
65
66
  };
@@ -1,9 +1,9 @@
1
1
  import { jsxs as p, jsx as o } from "react/jsx-runtime";
2
2
  import { styled as u } from "@linaria/react";
3
3
  import { useStore as m } from "@nanostores/react";
4
- import { QuestionType as a } from "@streamlayer/sdk-web-types";
5
- import { VoteHeader as n } from "../../../gamification/detail/header/index.js";
6
- import { Sponsor as l } from "../../../gamification/detail/sponsor/index.js";
4
+ import { QuestionType as n } from "@streamlayer/sdk-web-types";
5
+ import { VoteHeader as l } from "../../../gamification/detail/header/index.js";
6
+ import { Sponsor as a } from "../../../gamification/detail/sponsor/index.js";
7
7
  import { Vote as c } from "../../../gamification/vote/index.js";
8
8
  import { InsightDetails as b } from "../../../gamification/vote/insight-details/index.js";
9
9
  import { TwitterDetails as f } from "../../../gamification/vote/twitter-details/index.js";
@@ -29,27 +29,25 @@ import "../../../gamification/vote/win-bar/styles.js";
29
29
  import "../../../questions/insight/index.js";
30
30
  import "../../../video-player/index.js";
31
31
  import "../../../video-player/styles.js";
32
- import "../../../../utils/common.js";
33
32
  import "../../../questions/insight/styles.js";
34
33
  import "../../../gamification/vote/insight-details/styles.js";
35
34
  import "../../../questions/twitter/index.js";
36
35
  import "../../../questions/twitter/account/index.js";
36
+ import "../../../../utils/common.js";
37
37
  import "../../../questions/twitter/account/styles.js";
38
38
  import "../../../questions/twitter/styles.js";
39
39
  import "../../../gamification/vote/twitter-details/styles.js";
40
- const d = /* @__PURE__ */ u("div")({
40
+ const y = /* @__PURE__ */ u("div")({
41
41
  name: "QuestionContainer",
42
42
  class: "qdri6g3",
43
43
  propsAsIs: !1
44
- }), y = ({
44
+ }), d = ({
45
45
  openedQuestion: t
46
46
  }) => {
47
47
  var r, i;
48
48
  return ((r = t == null ? void 0 : t.attributes) == null ? void 0 : r.attributes.case) === "insight" ? /* @__PURE__ */ o(b, {
49
- created: t.attributes.created,
50
49
  ...t.attributes.attributes.value
51
50
  }) : ((i = t == null ? void 0 : t.attributes) == null ? void 0 : i.attributes.case) === "tweet" ? /* @__PURE__ */ o(f, {
52
- created: t.attributes.created,
53
51
  ...t.attributes.attributes.value
54
52
  }) : null;
55
53
  }, h = ({
@@ -58,34 +56,34 @@ const d = /* @__PURE__ */ u("div")({
58
56
  close: i
59
57
  }) => {
60
58
  const {
61
- loading: s,
62
- data: e
59
+ loading: e,
60
+ data: s
63
61
  } = t;
64
- return e ? /* @__PURE__ */ o(c, {
62
+ return s ? /* @__PURE__ */ o(c, {
65
63
  vote: r,
66
64
  close: i,
67
- openedQuestion: e,
68
- isLoading: !!s
65
+ openedQuestion: s,
66
+ isLoading: !!e
69
67
  }) : null;
70
68
  }, it = ({
71
69
  gamification: t
72
70
  }) => {
73
- var e;
71
+ var s;
74
72
  const r = m(t.openedQuestion.$store), i = m(t.openedQuestion.$extendedStore);
75
73
  if (!r)
76
74
  return null;
77
- const s = r.type;
78
- return /* @__PURE__ */ p(d, {
79
- children: [/* @__PURE__ */ o(n, {
75
+ const e = r.type;
76
+ return /* @__PURE__ */ p(y, {
77
+ children: [/* @__PURE__ */ o(l, {
80
78
  close: t.closeQuestion,
81
- type: ((e = r.attributes) == null ? void 0 : e.type) || a.UNSET
82
- }), s === "question" && /* @__PURE__ */ o(h, {
79
+ type: ((s = r.attributes) == null ? void 0 : s.type) || n.UNSET
80
+ }), e === "question" && /* @__PURE__ */ o(h, {
83
81
  vote: t.submitAnswer,
84
82
  close: t.closeQuestion,
85
83
  extendedQuestion: i
86
- }), s !== "question" && /* @__PURE__ */ o(y, {
84
+ }), e !== "question" && /* @__PURE__ */ o(d, {
87
85
  openedQuestion: r
88
- }), /* @__PURE__ */ o(l, {
86
+ }), /* @__PURE__ */ o(a, {
89
87
  sponsorLogo: ""
90
88
  })]
91
89
  });
@@ -12,12 +12,12 @@ import "../../../gamification/question/insight/index.js";
12
12
  import "../../../questions/insight/index.js";
13
13
  import "../../../video-player/index.js";
14
14
  import "../../../video-player/styles.js";
15
- import "../../../../utils/common.js";
16
15
  import "../../../questions/insight/styles.js";
17
16
  import "../../../gamification/question/insight/styles.js";
18
17
  import "../../../gamification/question/twitter/index.js";
19
18
  import "../../../questions/twitter/index.js";
20
19
  import "../../../questions/twitter/account/index.js";
20
+ import "../../../../utils/common.js";
21
21
  import "../../../questions/twitter/account/styles.js";
22
22
  import "../../../questions/twitter/styles.js";
23
23
  import "../../../gamification/question/twitter/styles.js";
@@ -1,19 +1,20 @@
1
- import { jsxs as f, jsx as r, Fragment as S } from "react/jsx-runtime";
2
- import { useStore as A } from "@nanostores/react";
3
- import { useState as h, useTransition as D, useEffect as P } from "react";
4
- import { TabsContainer as k, TabsNavContainer as E, SDKWhiteContainer as I, UserSummaryContainer as L, SDKContentContainer as V, LeaderboardContainer as K } from "../../styles.js";
5
- import { scrollIntoAppView as B } from "../../useSdkScroll.js";
6
- import { ActivePages as n, Tabs as F } from "../../../gamification/tabs/index.js";
7
- import { Leaderboard as O } from "./Leaderboard.js";
8
- import { QuestionsList as Q } from "./QuestionsList.js";
9
- import { UserSummary as R } from "./UserSummary.js";
1
+ import { jsxs as h, jsx as t, Fragment as C } from "react/jsx-runtime";
2
+ import { useStore as f } from "@nanostores/react";
3
+ import { useState as D, useTransition as T, useEffect as v } from "react";
4
+ import { TabsContainer as A, TabsNavContainer as I, SDKWhiteContainer as P, UserSummaryContainer as S, SDKContentContainer as V, LeaderboardContainer as E } from "../../styles.js";
5
+ import { scrollIntoAppView as K } from "../../useSdkScroll.js";
6
+ import { ActivePages as a, Tabs as L } from "../../../gamification/tabs/index.js";
7
+ import { Leaderboard as B } from "./Leaderboard.js";
8
+ import { QuestionsList as F } from "./QuestionsList.js";
9
+ import { UserSummary as O } from "./UserSummary.js";
10
10
  import "@linaria/react";
11
11
  import "lodash.throttle";
12
12
  import "../../../theme/constants.js";
13
13
  import "../../../../index-keh7OLCY.js";
14
14
  import "../../../../index-uEuzH3jr.js";
15
15
  import "../../../gamification/tabs/styles.js";
16
- import "../../../../useClipboardCopy-E5rEe6It.js";
16
+ import "../../useClipboardCopy.js";
17
+ import "../../../../index-jRXrW6ie.js";
17
18
  import "../../../gamification/copyNotification/index.js";
18
19
  import "../../../icons/index.js";
19
20
  import "../../../gamification/copyNotification/styles.js";
@@ -57,50 +58,48 @@ import "../../../gamification/user-statistics/components/rank/styles.js";
57
58
  import "../../../gamification/user-statistics/components/statistic/index.js";
58
59
  import "../../../gamification/user-statistics/components/statistic/styles.js";
59
60
  import "../../../gamification/user-statistics/styles.js";
60
- const qr = ({ gamification: i, className: u, scrollStore: o, scrollNode: b, appNode: e, style: g, responsiveStore: T, headerNode: y }) => {
61
- const [a, v] = h(!1), [m, w] = h(n.HOME), [, l] = D(), { sdkInScrollView: p } = A(T, { keys: ["sdkInScrollView"] }), x = (t) => {
62
- l(() => {
61
+ const $t = ({ gamification: o, className: l, scrollStore: r, scrollNode: u, appNode: e, style: b, responsiveStore: m, headerNode: w }) => {
62
+ const { tabsShown: d } = f(r, { keys: ["tabsShown"] }), [p, y] = D(a.HOME), [, g] = T(), { sdkInDesktopView: n } = f(m, { keys: ["sdkInDesktopView"] }), k = (i) => {
63
+ g(() => {
63
64
  var c;
64
- w(t), p === !1 && (((c = e.current) == null ? void 0 : c.getBoundingClientRect().y) || 0) < 0 && B(e, { behavior: "instant" });
65
+ y(i), n === !1 && (((c = e.current) == null ? void 0 : c.getBoundingClientRect().y) || 0) < 0 && K(e, { behavior: "instant" });
65
66
  });
66
- }, d = (t) => {
67
- l(() => v(t));
68
67
  };
69
- P(() => o.listen((t) => {
70
- if (t.scrollPosition === 0) {
71
- d(!1), o.setKey("tabsShown", !1);
68
+ v(() => r.listen((i) => {
69
+ if (i.scrollPosition === 0) {
70
+ r.setKey("tabsShown", !0);
72
71
  return;
73
72
  }
74
- d(t.scrollDirection === "forward"), o.setKey("tabsShown", t.scrollDirection !== "forward");
75
- }), [o]);
73
+ m.get().sdkInDesktopView ? r.setKey("tabsShown", i.scrollDirection === "backward") : r.setKey("tabsShown", i.scrollDirection === "forward");
74
+ }), [r, m]);
76
75
  let s = "0px";
77
- p ? s = a ? "calc(8px - var(--header-height) - var(--header-offset))" : "0px" : s = a ? "calc(var(--header-height) + var(--header-offset))" : "0px";
78
- const C = p ? e : y;
79
- return /* @__PURE__ */ f(k, { className: u, style: g, children: [
80
- /* @__PURE__ */ r(
81
- E,
76
+ n ? s = d ? "0px" : "calc(8px - var(--header-height) - var(--header-offset))" : s = d ? "calc(var(--header-height) + var(--header-offset) - 2px)" : "0px";
77
+ const x = n ? e : w;
78
+ return /* @__PURE__ */ h(A, { className: l, style: b, children: [
79
+ /* @__PURE__ */ t(
80
+ I,
82
81
  {
83
82
  style: {
84
83
  top: s
85
84
  },
86
- children: /* @__PURE__ */ r(F, { activePage: m, toggleActivePage: x })
85
+ children: /* @__PURE__ */ t(L, { activePage: p, toggleActivePage: k })
87
86
  }
88
87
  ),
89
- m === n.HOME && /* @__PURE__ */ f(S, { children: [
90
- /* @__PURE__ */ r(I, { style: { paddingTop: "8px" }, children: /* @__PURE__ */ r(L, { children: /* @__PURE__ */ r(R, { userSummary: i.userSummary }) }) }),
91
- /* @__PURE__ */ r(V, { style: { flex: 1 }, children: /* @__PURE__ */ r(Q, { openQuestion: i.openQuestion, store: i.feedList.getStore() }) })
88
+ p === a.HOME && /* @__PURE__ */ h(C, { children: [
89
+ /* @__PURE__ */ t(P, { style: { paddingTop: "8px" }, children: /* @__PURE__ */ t(S, { children: /* @__PURE__ */ t(O, { userSummary: o.userSummary }) }) }),
90
+ /* @__PURE__ */ t(V, { style: { flex: 1 }, children: /* @__PURE__ */ t(F, { openQuestion: o.openQuestion, store: o.feedList.getStore() }) })
92
91
  ] }),
93
- m === n.LEADERBOARD && /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(
94
- O,
92
+ p === a.LEADERBOARD && /* @__PURE__ */ t(E, { children: /* @__PURE__ */ t(
93
+ B,
95
94
  {
96
- renderClipBoardNode: C,
97
- scrollStore: o,
98
- scrollNode: b,
99
- gamification: i
95
+ renderClipBoardNode: x,
96
+ scrollStore: r,
97
+ scrollNode: u,
98
+ gamification: o
100
99
  }
101
100
  ) })
102
101
  ] });
103
102
  };
104
103
  export {
105
- qr as Tabs
104
+ $t as Tabs
106
105
  };
@@ -3,20 +3,12 @@ import "react/jsx-runtime";
3
3
  import "@linaria/react";
4
4
  import "@nanostores/react";
5
5
  import "react";
6
- import "../../../../useClipboardCopy-E5rEe6It.js";
7
- import "../../../../index-uEuzH3jr.js";
8
- import "../../../gamification/copyNotification/index.js";
9
- import "../../../icons/index.js";
10
- import "../../../gamification/copyNotification/styles.js";
11
6
  import "../../styles.js";
12
- import "../../useSdkScroll.js";
13
- import "lodash.throttle";
14
- import "../../../theme/constants.js";
15
- import "../../../../index-keh7OLCY.js";
16
7
  import "../../../gamification/detail/header/index.js";
17
8
  import "@streamlayer/sdk-web-types";
18
9
  import "../../../gamification/constants.js";
19
10
  import "../../../gamification/detail/header/styles.js";
11
+ import "../../../icons/index.js";
20
12
  import "../../../gamification/user-statistics/index.js";
21
13
  import "../../../../utils/common.js";
22
14
  import "../../../gamification/user-statistics/components/rank/index.js";
@@ -24,8 +16,11 @@ import "../../../gamification/user-statistics/components/rank/styles.js";
24
16
  import "../../../gamification/user-statistics/components/statistic/index.js";
25
17
  import "../../../gamification/user-statistics/components/statistic/styles.js";
26
18
  import "../../../gamification/user-statistics/styles.js";
27
- import "../../../show-in/index.js";
19
+ import "../../../modal/index.js";
28
20
  import "@linaria/core";
21
+ import "../../../../index-jRXrW6ie.js";
22
+ import "../../../../index-uEuzH3jr.js";
23
+ import "../../../show-in/index.js";
29
24
  import "./Question.js";
30
25
  import "../../../gamification/detail/sponsor/index.js";
31
26
  import "../../../gamification/vote/index.js";
@@ -41,6 +36,7 @@ import "../../../gamification/vote/vote-option/styles.js";
41
36
  import "../../../gamification/vote/win-bar/index.js";
42
37
  import "../../../timer/index.js";
43
38
  import "react-countdown-circle-timer";
39
+ import "../../../theme/constants.js";
44
40
  import "../../../gamification/vote/win-bar/styles.js";
45
41
  import "../../../gamification/vote/insight-details/index.js";
46
42
  import "../../../questions/insight/index.js";
@@ -55,9 +51,15 @@ import "../../../questions/twitter/account/styles.js";
55
51
  import "../../../questions/twitter/styles.js";
56
52
  import "../../../gamification/vote/twitter-details/styles.js";
57
53
  import "./Tabs.js";
54
+ import "../../useSdkScroll.js";
55
+ import "lodash.throttle";
56
+ import "../../../../index-keh7OLCY.js";
58
57
  import "../../../gamification/tabs/index.js";
59
58
  import "../../../gamification/tabs/styles.js";
60
59
  import "./Leaderboard.js";
60
+ import "../../useClipboardCopy.js";
61
+ import "../../../gamification/copyNotification/index.js";
62
+ import "../../../gamification/copyNotification/styles.js";
61
63
  import "../../../gamification/invite-link/index.js";
62
64
  import "../../../gamification/invite-link/styles.js";
63
65
  import "react-virtualized-auto-sizer";
@@ -1,25 +1,18 @@
1
- import { jsxs as d, jsx as t, Fragment as b } from "react/jsx-runtime";
2
- import { styled as S } from "@linaria/react";
3
- import { useStore as f } from "@nanostores/react";
4
- import { useRef as v, useMemo as x, useEffect as R } from "react";
5
- import { r as y } from "../../../../useClipboardCopy-E5rEe6It.js";
6
- import { SDKWhiteContainer as F } from "../../styles.js";
7
- import { scrollIntoAppView as O } from "../../useSdkScroll.js";
8
- import { VoteHeader as T } from "../../../gamification/detail/header/index.js";
9
- import { UserStatistics as A } from "../../../gamification/user-statistics/index.js";
10
- import { ShowIn as P } from "../../../show-in/index.js";
11
- import { Question as Q } from "./Question.js";
12
- import { Tabs as j } from "./Tabs.js";
13
- import "../../../../index-uEuzH3jr.js";
14
- import "../../../gamification/copyNotification/index.js";
15
- import "../../../icons/index.js";
16
- import "../../../gamification/copyNotification/styles.js";
17
- import "lodash.throttle";
18
- import "../../../theme/constants.js";
19
- import "../../../../index-keh7OLCY.js";
1
+ import { jsx as t, jsxs as c, Fragment as U } from "react/jsx-runtime";
2
+ import { styled as a } from "@linaria/react";
3
+ import { useStore as n } from "@nanostores/react";
4
+ import { useMemo as w } from "react";
5
+ import { SDKWhiteContainer as x } from "../../styles.js";
6
+ import { VoteHeader as V } from "../../../gamification/detail/header/index.js";
7
+ import { UserStatistics as y } from "../../../gamification/user-statistics/index.js";
8
+ import { createModal as M } from "../../../modal/index.js";
9
+ import { ShowIn as R } from "../../../show-in/index.js";
10
+ import { Question as S } from "./Question.js";
11
+ import { Tabs as D } from "./Tabs.js";
20
12
  import "@streamlayer/sdk-web-types";
21
13
  import "../../../gamification/constants.js";
22
14
  import "../../../gamification/detail/header/styles.js";
15
+ import "../../../icons/index.js";
23
16
  import "../../../../utils/common.js";
24
17
  import "../../../gamification/user-statistics/components/rank/index.js";
25
18
  import "../../../gamification/user-statistics/components/rank/styles.js";
@@ -27,6 +20,8 @@ import "../../../gamification/user-statistics/components/statistic/index.js";
27
20
  import "../../../gamification/user-statistics/components/statistic/styles.js";
28
21
  import "../../../gamification/user-statistics/styles.js";
29
22
  import "@linaria/core";
23
+ import "../../../../index-jRXrW6ie.js";
24
+ import "../../../../index-uEuzH3jr.js";
30
25
  import "../../../gamification/detail/sponsor/index.js";
31
26
  import "../../../gamification/vote/index.js";
32
27
  import "../../../gamification/vote/expired-alert/index.js";
@@ -41,6 +36,7 @@ import "../../../gamification/vote/vote-option/styles.js";
41
36
  import "../../../gamification/vote/win-bar/index.js";
42
37
  import "../../../timer/index.js";
43
38
  import "react-countdown-circle-timer";
39
+ import "../../../theme/constants.js";
44
40
  import "../../../gamification/vote/win-bar/styles.js";
45
41
  import "../../../gamification/vote/insight-details/index.js";
46
42
  import "../../../questions/insight/index.js";
@@ -54,9 +50,15 @@ import "../../../questions/twitter/account/index.js";
54
50
  import "../../../questions/twitter/account/styles.js";
55
51
  import "../../../questions/twitter/styles.js";
56
52
  import "../../../gamification/vote/twitter-details/styles.js";
53
+ import "../../useSdkScroll.js";
54
+ import "lodash.throttle";
55
+ import "../../../../index-keh7OLCY.js";
57
56
  import "../../../gamification/tabs/index.js";
58
57
  import "../../../gamification/tabs/styles.js";
59
58
  import "./Leaderboard.js";
59
+ import "../../useClipboardCopy.js";
60
+ import "../../../gamification/copyNotification/index.js";
61
+ import "../../../gamification/copyNotification/styles.js";
60
62
  import "../../../gamification/invite-link/index.js";
61
63
  import "../../../gamification/invite-link/styles.js";
62
64
  import "react-virtualized-auto-sizer";
@@ -82,94 +84,76 @@ import "../../../button/index.js";
82
84
  import "../../../button/styles.js";
83
85
  import "../../../gamification/question/list/styles.js";
84
86
  import "./UserSummary.js";
85
- const D = () => P, I = /* @__PURE__ */ S(D())({
87
+ const F = () => R, d = /* @__PURE__ */ a(F())({
86
88
  name: "OpenedContainer",
87
89
  class: "oar61gl",
88
90
  propsAsIs: !0
89
- }), E = /* @__PURE__ */ S("div")({
91
+ }), O = /* @__PURE__ */ a("div")({
90
92
  name: "UserContainer",
91
93
  class: "u14zaal4",
92
94
  propsAsIs: !1
93
- }), M = ({
95
+ }), Q = ({
94
96
  correct: r,
95
- incorrect: s
97
+ incorrect: p
96
98
  }) => {
97
- const o = r + s;
99
+ const o = r + p;
98
100
  return o === 0 ? 0 : Math.round(r / o * 100);
99
- }, z = `
100
- body {
101
- overflow: hidden
102
- }
103
- `, wt = ({
101
+ }, lo = ({
104
102
  gamification: r,
105
- scrollStore: s,
103
+ scrollStore: p,
106
104
  className: o,
107
105
  appNode: i,
108
- scrollNode: k,
109
- headerNode: l,
110
- responsiveStore: a
106
+ scrollNode: f,
107
+ headerNode: h,
108
+ responsiveStore: s
111
109
  }) => {
112
- const c = f(r.openedQuestion.$store), m = f(r.openedUser), {
113
- sdkInScrollView: e
114
- } = f(a, {
115
- keys: ["sdkInScrollView"]
116
- }), p = v(0), [C, w] = x(() => {
117
- var h;
118
- const u = e ? i : l, n = (((h = i.current) == null ? void 0 : h.getBoundingClientRect().y) || 0) < 0;
119
- if ((c || m) && u.current) {
120
- n && (p.current = window.scrollY);
121
- const U = () => (R(() => {
122
- const V = setTimeout(() => {
123
- O(i, {
124
- behavior: "instant"
125
- });
126
- }, 1e3);
127
- return () => {
128
- clearTimeout(V), p.current !== 0 && (window.scroll({
129
- top: p.current
130
- }), p.current = 0);
131
- };
132
- }, []), /* @__PURE__ */ t("style", {
133
- children: z
134
- }));
135
- return [n, c ? y.createPortal(/* @__PURE__ */ d(I, {
136
- className: o,
137
- children: [/* @__PURE__ */ t(Q, {
138
- gamification: r
139
- }), n && !e && /* @__PURE__ */ t(U, {})]
140
- }), u.current) : m ? y.createPortal(/* @__PURE__ */ t(I, {
141
- className: o,
142
- children: /* @__PURE__ */ d(E, {
143
- children: [/* @__PURE__ */ t(T, {
144
- label: "Friend's Rank",
145
- close: r.closeUser
146
- }), /* @__PURE__ */ t(F, {
147
- children: /* @__PURE__ */ t(A, {
148
- ...m,
149
- successRate: M(m)
150
- })
151
- })]
152
- })
153
- }), u.current) : null];
154
- }
155
- return [n, null];
156
- }, [i, o, r, l, c, m, e]);
157
- return /* @__PURE__ */ d(b, {
158
- children: [w, /* @__PURE__ */ t(j, {
110
+ const e = n(r.openedQuestion.$store), m = n(r.openedUser), {
111
+ sdkInDesktopView: l
112
+ } = n(s, {
113
+ keys: ["sdkInDesktopView"]
114
+ }), C = w(() => {
115
+ var u;
116
+ const k = (((u = i.current) == null ? void 0 : u.getBoundingClientRect().y) || 0) < 0;
117
+ if (!i.current || !e && !m)
118
+ return null;
119
+ const I = e ? /* @__PURE__ */ t(d, {
120
+ className: o,
121
+ children: /* @__PURE__ */ t(S, {
122
+ gamification: r
123
+ })
124
+ }) : m ? /* @__PURE__ */ t(d, {
125
+ className: o,
126
+ children: /* @__PURE__ */ c(O, {
127
+ children: [/* @__PURE__ */ t(V, {
128
+ label: "Friend's Rank",
129
+ close: r.closeUser
130
+ }), /* @__PURE__ */ t(x, {
131
+ children: /* @__PURE__ */ t(y, {
132
+ ...m,
133
+ successRate: Q(m)
134
+ })
135
+ })]
136
+ })
137
+ }) : null;
138
+ return M({
139
+ Modal: I,
140
+ container: i,
141
+ useContainer: !l,
142
+ fixedView: k
143
+ });
144
+ }, [i, o, r, e, m, l]);
145
+ return /* @__PURE__ */ c(U, {
146
+ children: [C, /* @__PURE__ */ t(D, {
159
147
  appNode: i,
160
- headerNode: l,
161
- scrollStore: s,
162
- scrollNode: k,
148
+ headerNode: h,
149
+ scrollStore: p,
150
+ scrollNode: f,
163
151
  className: o,
164
152
  gamification: r,
165
- responsiveStore: a,
166
- style: !e && !C && w !== null ? {
167
- height: "0",
168
- overflow: "hidden"
169
- } : {}
153
+ responsiveStore: s
170
154
  })]
171
155
  });
172
156
  };
173
157
  export {
174
- wt as GamificationOverlay
158
+ lo as GamificationOverlay
175
159
  };
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { ResponsiveStore } from '../../useSdkResponsive';
2
3
  import { ChannelsButtonId } from '../../../navigation/button/Channels';
3
4
  import { FeaturedGroupsButtonId } from '../../../navigation/button/FeaturedGroups';
4
5
  import { LeaderBoardButtonId } from '../../../navigation/button/LeaderBoard';
@@ -9,5 +10,7 @@ type MastersNavigationProps = {
9
10
  setActiveOverlay: (overlay: AvailableOverlays) => void;
10
11
  sdkReady: boolean;
11
12
  className?: string;
13
+ responsiveStore: ResponsiveStore;
14
+ scrollToTop: () => void;
12
15
  };
13
16
  export declare const MastersNavigation: import("react").ForwardRefExoticComponent<MastersNavigationProps & import("react").RefAttributes<HTMLDivElement | null>>;