@streamlayer/react-ui 0.99.0 → 0.100.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 (42) hide show
  1. package/lib/assets/style.css +1 -1
  2. package/lib/hooks/showIn.js +45 -0
  3. package/lib/ui/app/Features/Gamification/Leaderboard.d.ts +1 -2
  4. package/lib/ui/app/Features/Gamification/Leaderboard.js +24 -26
  5. package/lib/ui/app/Features/Gamification/Question.js +19 -19
  6. package/lib/ui/app/Features/Gamification/Tabs.d.ts +1 -2
  7. package/lib/ui/app/Features/Gamification/Tabs.js +27 -37
  8. package/lib/ui/app/Features/Gamification/index.d.ts +1 -2
  9. package/lib/ui/app/Features/Gamification/index.js +46 -40
  10. package/lib/ui/app/Features/index.d.ts +1 -2
  11. package/lib/ui/app/Features/index.js +16 -17
  12. package/lib/ui/app/Notifications/Onboarding/index.js +33 -33
  13. package/lib/ui/app/masters.js +42 -42
  14. package/lib/ui/app/useSdkScroll.js +30 -27
  15. package/lib/ui/gamification/leaderboard/list-item/index.d.ts +0 -1
  16. package/lib/ui/gamification/leaderboard/list-item/index.js +16 -16
  17. package/lib/ui/gamification/leaderboard/static.js +31 -24
  18. package/lib/ui/gamification/question/index.d.ts +1 -3
  19. package/lib/ui/gamification/question/index.js +25 -26
  20. package/lib/ui/gamification/question/insight/index.d.ts +0 -1
  21. package/lib/ui/gamification/question/insight/index.js +7 -7
  22. package/lib/ui/gamification/question/list/index.js +19 -35
  23. package/lib/ui/gamification/question/twitter/index.d.ts +0 -1
  24. package/lib/ui/gamification/question/twitter/index.js +8 -8
  25. package/lib/ui/gamification/vote/alert/index.d.ts +8 -0
  26. package/lib/ui/gamification/vote/alert/index.js +11 -0
  27. package/lib/ui/gamification/vote/{expired-alert → alert}/styles.js +7 -7
  28. package/lib/ui/gamification/vote/feedback/index.js +31 -31
  29. package/lib/ui/gamification/vote/index.d.ts +1 -0
  30. package/lib/ui/gamification/vote/index.js +109 -89
  31. package/lib/ui/gamification/vote/styles.d.ts +1 -0
  32. package/lib/ui/gamification/vote/styles.js +14 -8
  33. package/lib/ui/gamification/vote/vote-option/index.js +28 -28
  34. package/lib/ui/gamification/vote/vote-option/styles.d.ts +1 -0
  35. package/lib/ui/gamification/vote/vote-option/styles.js +34 -29
  36. package/lib/ui/modal/index.js +31 -31
  37. package/lib/ui/show-in/index.d.ts +1 -0
  38. package/lib/ui/show-in/index.js +12 -10
  39. package/package.json +19 -20
  40. package/lib/ui/gamification/vote/expired-alert/index.d.ts +0 -7
  41. package/lib/ui/gamification/vote/expired-alert/index.js +0 -11
  42. /package/lib/ui/gamification/vote/{expired-alert → alert}/styles.d.ts +0 -0
@@ -1,69 +1,69 @@
1
1
  import { jsx as i, jsxs as n } from "react/jsx-runtime";
2
- import { QuestionType as e } from "@streamlayer/sdk-web-types";
2
+ import { QuestionType as d } from "@streamlayer/sdk-web-types";
3
3
  import { SvgIcon as h } from "../../../icons/index.js";
4
- import { ShowInContainer as j, Container as L, FeedbackContainer as l, IconPrediction as C, FeedbackDescription as r, FeedbackIconWrap as a, FeedbackHeader as F, FeedbackText as I, DynamicWrap as Y, FeedbackTitle as E } from "./styles.js";
5
- const K = ({
4
+ import { ShowInContainer as j, Container as E, FeedbackContainer as r, IconPrediction as C, FeedbackDescription as l, FeedbackIconWrap as a, FeedbackHeader as F, FeedbackText as P, DynamicWrap as L, FeedbackTitle as Y } from "./styles.js";
5
+ const J = ({
6
6
  feedbackMessages: t,
7
- questionVotedCorrectly: P,
7
+ questionVotedCorrectly: u,
8
8
  questionVoted: m,
9
- questionType: d,
9
+ questionType: e,
10
10
  hasCorrectAnswer: b,
11
- showExpiredNotification: u,
12
- showClosedNotificationTrivia: w,
11
+ showExpiredNotification: w,
12
+ showClosedNotificationTrivia: x,
13
13
  votedInCurrentRender: p,
14
14
  votedAfterQuestionClosed: S,
15
15
  voteErrorMessage: c,
16
- enteredAnActiveQuestion: x,
16
+ enteredAnActiveQuestion: D,
17
17
  marketClosed: W,
18
18
  percentsAnimated: Q
19
19
  }) => {
20
- const D = m && (d === e.TRIVIA || d === e.PREDICTION), y = d === e.PREDICTION && !b, O = W && d === e.PREDICTION && !m && !x || d === e.PREDICTION && S && p && x, T = D && y, N = D && b, R = d === e.PREDICTION && m && p && b, f = m && d === e.POLL && p, k = P ? "correct" : "incorrect", o = P ? t == null ? void 0 : t.correctFeedback : t == null ? void 0 : t.incorrectFeedback;
21
- return u || w || T || N || O || f || R || c ? /* @__PURE__ */ i(j, { enabled: p, animate: Q, children: /* @__PURE__ */ n(L, { "data-prediction": y, children: [
22
- c && /* @__PURE__ */ n(l, { children: [
20
+ const y = m && (e === d.TRIVIA || e === d.PREDICTION), O = e === d.PREDICTION && !b, k = W && e === d.PREDICTION && !m && !D || e === d.PREDICTION && S && p && D, T = y && O, N = y && b, R = e === d.PREDICTION && m && p && b, f = m && e === d.POLL && p, I = u ? "correct" : "incorrect", o = u ? t == null ? void 0 : t.correctFeedback : t == null ? void 0 : t.incorrectFeedback;
21
+ return w || x || T || N || k || f || R || c ? /* @__PURE__ */ i(j, { enabled: p, animate: Q, children: /* @__PURE__ */ n(E, { "data-prediction": O, children: [
22
+ c && !k && /* @__PURE__ */ n(r, { children: [
23
23
  /* @__PURE__ */ i(C, { name: "questionExpired" }),
24
- /* @__PURE__ */ i(r, { children: c })
24
+ /* @__PURE__ */ i(l, { children: c })
25
25
  ] }),
26
- !c && u && /* @__PURE__ */ n(l, { children: [
26
+ !c && w && /* @__PURE__ */ n(r, { children: [
27
27
  /* @__PURE__ */ i(a, { children: /* @__PURE__ */ i(h, { name: "questionExpired" }) }),
28
28
  /* @__PURE__ */ n("div", { children: [
29
- /* @__PURE__ */ i(F, { children: /* @__PURE__ */ i(r, { children: "Question Expired" }) }),
30
- /* @__PURE__ */ i(I, { children: "You can still answer to see if you're correct, but no points are awarded for expired questions." })
29
+ /* @__PURE__ */ i(F, { children: /* @__PURE__ */ i(l, { children: "Question Expired" }) }),
30
+ /* @__PURE__ */ i(P, { children: "You can still answer to see if you're correct, but no points are awarded for expired questions." })
31
31
  ] })
32
32
  ] }),
33
- !c && w && /* @__PURE__ */ n(l, { children: [
33
+ !c && x && /* @__PURE__ */ n(r, { children: [
34
34
  /* @__PURE__ */ i(a, { children: /* @__PURE__ */ i(h, { name: "questionExpired" }) }),
35
35
  /* @__PURE__ */ n("div", { children: [
36
- /* @__PURE__ */ i(F, { children: /* @__PURE__ */ i(r, { children: "Question Closed" }) }),
37
- /* @__PURE__ */ i(I, { children: "This question was answered after the moderator closed the question. So the points for this answer won’t tally." })
36
+ /* @__PURE__ */ i(F, { children: /* @__PURE__ */ i(l, { children: "Question Closed" }) }),
37
+ /* @__PURE__ */ i(P, { children: "This question was answered after the moderator closed the question. So the points for this answer won’t tally." })
38
38
  ] })
39
39
  ] }),
40
- !c && O && /* @__PURE__ */ n(l, { children: [
40
+ k && /* @__PURE__ */ n(r, { children: [
41
41
  /* @__PURE__ */ i(a, { children: /* @__PURE__ */ i(h, { name: "questionExpired" }) }),
42
42
  /* @__PURE__ */ n("div", { children: [
43
- /* @__PURE__ */ i(F, { children: /* @__PURE__ */ i(r, { children: "Question Closed" }) }),
44
- /* @__PURE__ */ i(I, { children: "This event has already taken place, so the ability to make a prediction on its outcome is no longer available." })
43
+ /* @__PURE__ */ i(F, { children: /* @__PURE__ */ i(l, { children: "Question Closed" }) }),
44
+ /* @__PURE__ */ i(P, { children: "This event has already taken place, so the ability to make a prediction on its outcome is no longer available." })
45
45
  ] })
46
46
  ] }),
47
- !c && T && /* @__PURE__ */ n(l, { children: [
47
+ !c && T && /* @__PURE__ */ n(r, { children: [
48
48
  /* @__PURE__ */ i(C, { name: "icon-prediction" }),
49
- /* @__PURE__ */ n(r, { children: [
49
+ /* @__PURE__ */ n(l, { children: [
50
50
  "Your pick has been recorded. ",
51
- /* @__PURE__ */ i(Y, { children: "We’ll notify you of the result." })
51
+ /* @__PURE__ */ i(L, { children: "We’ll notify you of the result." })
52
52
  ] })
53
53
  ] }),
54
- !c && f && /* @__PURE__ */ n(l, { children: [
54
+ !c && f && /* @__PURE__ */ n(r, { children: [
55
55
  /* @__PURE__ */ i(a, { "data-feedback-type": "correct", children: /* @__PURE__ */ i(h, { name: "correct" }) }),
56
- /* @__PURE__ */ i(r, { children: "Thanks for answering. Please stay tuned for the next question." })
56
+ /* @__PURE__ */ i(l, { children: "Thanks for answering. Please stay tuned for the next question." })
57
57
  ] }),
58
- !c && (N || R) && /* @__PURE__ */ n(l, { children: [
59
- /* @__PURE__ */ i(a, { "data-feedback-type": k, children: /* @__PURE__ */ i(h, { name: k }) }),
58
+ !c && (N || R) && /* @__PURE__ */ n(r, { children: [
59
+ /* @__PURE__ */ i(a, { "data-feedback-type": I, children: /* @__PURE__ */ i(h, { name: I }) }),
60
60
  /* @__PURE__ */ i("div", { children: /* @__PURE__ */ n(F, { children: [
61
- /* @__PURE__ */ i(E, { "data-feedback-type": k, children: o == null ? void 0 : o.title }),
62
- /* @__PURE__ */ i(r, { children: o == null ? void 0 : o.description })
61
+ /* @__PURE__ */ i(Y, { "data-feedback-type": I, children: o == null ? void 0 : o.title }),
62
+ /* @__PURE__ */ i(l, { children: o == null ? void 0 : o.description })
63
63
  ] }) })
64
64
  ] })
65
65
  ] }) }) : null;
66
66
  };
67
67
  export {
68
- K as Feedback
68
+ J as Feedback
69
69
  };
@@ -6,5 +6,6 @@ interface VoteProps {
6
6
  vote: (questionId: string, answerId: string) => void;
7
7
  close: () => void;
8
8
  }
9
+ export declare const VoteSkeleton: React.FC;
9
10
  export declare const Vote: React.FC<VoteProps>;
10
11
  export {};
@@ -1,147 +1,167 @@
1
- import { jsx as a, jsxs as j, Fragment as it } from "react/jsx-runtime";
2
- import { useRef as F, useState as c, useEffect as y, useCallback as x, useMemo as u } from "react";
3
- import { QuestionType as n, QuestionStatus as N } from "@streamlayer/sdk-web-types";
4
- import { ExpiredAlert as nt } from "./expired-alert/index.js";
5
- import { Feedback as ot } from "./feedback/index.js";
6
- import { QuestionScrollContainer as at, Container as ct, Content as lt, Title as mt, Options as ut } from "./styles.js";
7
- import { VotingOption as ft } from "./vote-option/index.js";
8
- import { WinBar as dt } from "./win-bar/index.js";
9
- const Tt = (t, d) => {
1
+ import { jsx as s, jsxs as y, Fragment as D } from "react/jsx-runtime";
2
+ import { useHideTransition as ht } from "../../../hooks/showIn.js";
3
+ import { useRef as J, useState as c, useEffect as g, useCallback as w, useMemo as u } from "react";
4
+ import { QuestionType as a, QuestionStatus as k } from "@streamlayer/sdk-web-types";
5
+ import { Skeleton as N } from "../../skeleton/index.js";
6
+ import { Alert as Tt } from "./alert/index.js";
7
+ import { Feedback as gt } from "./feedback/index.js";
8
+ import { Container as K, Content as U, Options as X, QuestionScrollContainer as yt, AlertContainer as It, Title as Vt } from "./styles.js";
9
+ import { VotingOption as Ct } from "./vote-option/index.js";
10
+ import { WinBar as Et } from "./win-bar/index.js";
11
+ const vt = (t, l) => {
10
12
  switch (t) {
11
13
  case "already_voted":
12
- return d === n.POLL ? "You’ve already answered this question on another device." : "You’ve already answered this question on another device. So the points for this answer won't tally.";
14
+ return l === a.POLL ? "You’ve already answered this question on another device." : "You’ve already answered this question on another device. So the points for this answer won't tally.";
13
15
  default:
14
16
  return "Something went wrong, please try again";
15
17
  }
16
- }, Rt = ({ openedQuestion: t, isLoading: d, vote: p, close: V }) => {
17
- var W, Y;
18
- const H = t.subject, r = t.type, T = t.status, E = (W = t.options) == null ? void 0 : W.options, I = t.marketClosed, w = t.id, S = F(), [h, _] = c(!1), [R, z] = c(!1), [C, k] = c(!0), [l, G] = c(!1), [M, g] = c(""), [O, J] = c(""), [P, b] = c(!1), [K, U] = c(!1);
19
- y(() => {
20
- r === n.PREDICTION ? I && k(!1) : T === N.RESOLVED && k(!1);
18
+ }, kt = () => /* @__PURE__ */ s(K, { children: /* @__PURE__ */ y(U, { children: [
19
+ /* @__PURE__ */ s(N, { loading: !0, style: { height: "40px", borderRadius: "100px" } }),
20
+ /* @__PURE__ */ s(N, { loading: !0, style: { height: "24px", margin: "16px 0" } }),
21
+ /* @__PURE__ */ s(X, { children: Array.from({ length: 5 }).map((t, l) => /* @__PURE__ */ s(N, { loading: !0, style: { height: "44px" } }, l)) })
22
+ ] }) }), Nt = ({ openedQuestion: t, isLoading: l, vote: b, close: M }) => {
23
+ var z, G;
24
+ const Z = t.subject, r = t.type, h = t.status, I = (z = t.options) == null ? void 0 : z.options, T = t.marketClosed, A = t.id, L = J(), [V, $] = c(!1), [R, Q] = c(!1), [C, B] = c(!0), [f, tt] = c(!1), [W, et] = c(!1), [Y, p] = c(""), [x, rt] = c(""), [O, j] = c(!1), [it, nt] = c(!1), { runAnimation: E, finished: H } = ht();
25
+ g(() => {
26
+ H && M();
27
+ }, [M, H]), g(() => {
28
+ r === a.PREDICTION ? T && B(!1) : h === k.RESOLVED && B(!1);
21
29
  }, []);
22
- const X = x((i) => {
23
- z(i), _(!0);
24
- }, []), A = F(!1), L = x(
25
- async (i) => {
26
- if (!A.current && (A.current = !0, w)) {
27
- const m = i.currentTarget.value;
28
- g(m);
30
+ const st = w((n) => {
31
+ Q(n), $(!0);
32
+ }, []), P = J(!1), F = w(
33
+ async (n) => {
34
+ if (!P.current && (P.current = !0, A)) {
35
+ const m = n.currentTarget.value;
36
+ p(m);
29
37
  try {
30
- await p(w, m);
38
+ await b(A, m);
31
39
  } catch (v) {
32
- J(Tt(v.message, r)), g(""), console.error("Error while voting", v), A.current = !1;
40
+ rt(vt(v.message, r)), p(""), console.error("Error while voting", v), P.current = !1;
33
41
  }
34
42
  }
35
43
  },
36
- [r, w, g, p]
37
- ), Z = x(() => {
38
- G(!0), setTimeout(V, 3e3);
39
- }, [V]), e = u(
40
- () => t == null ? void 0 : t.answers.find((i) => i.youVoted === !0),
44
+ [r, A, p, b]
45
+ ), ot = w(() => {
46
+ tt(!0), E({ delay: 3500 });
47
+ }, [E]), at = w(() => {
48
+ et(!0), E({ delay: 3500 });
49
+ }, [E]), e = u(
50
+ () => t == null ? void 0 : t.answers.find((n) => n.youVoted === !0),
41
51
  [t]
42
52
  ), o = u(
43
- () => !!(t != null && t.answers.find((i) => i.correct === !0)),
53
+ () => !!(t != null && t.answers.find((n) => n.correct === !0)),
44
54
  [t]
45
- ), s = u(
46
- () => t == null ? void 0 : t.answers.find((i) => i.correct === !0),
55
+ ), i = u(
56
+ () => t == null ? void 0 : t.answers.find((n) => n.correct === !0),
47
57
  [t]
48
58
  );
49
- y(() => {
50
- r === n.PREDICTION && e && h && !K && (S.current = setTimeout(V, 1e4), U(!0));
51
- }, [e]), y(() => () => {
52
- clearTimeout(S.current);
59
+ g(() => {
60
+ e && V && !it && (L.current = setTimeout(at, 1e4), nt(!0));
61
+ }, [e]), g(() => () => {
62
+ clearTimeout(L.current);
53
63
  }, []);
54
- const D = u(() => t ? t.answers.map((i) => {
64
+ const S = u(() => t ? t.answers.map((n) => {
55
65
  var m;
56
66
  return {
57
- ...i,
67
+ ...n,
58
68
  questionVoted: !!e,
59
- youSelected: M === i.id,
60
- isLoading: d,
69
+ youSelected: Y === n.id,
70
+ isLoading: l,
61
71
  hasCorrectAnswer: o,
62
72
  questionType: t.type,
63
- answerTimeExpired: l,
64
- questionStatus: T,
73
+ answerTimeExpired: f,
74
+ questionStatus: h,
65
75
  imageMode: (m = t.appearance) == null ? void 0 : m.images,
66
- onVote: L
76
+ onVote: F
67
77
  };
68
78
  }) : [], [
69
79
  o,
80
+ f,
70
81
  l,
71
- d,
72
82
  t,
73
83
  e,
74
- T,
75
- L,
76
- M
84
+ h,
85
+ F,
86
+ Y
77
87
  ]);
78
- y(() => {
79
- const i = D.some(({ percentageDecimal: v }) => v !== 0), m = e && r === n.PREDICTION;
80
- O && (!i || I && m) && b(!0);
81
- }, [D, O, I, r, e]);
82
- const $ = E && (E.case === "trivia" || E.case === "prediction") ? E.value : void 0, f = T === N.RESOLVED && r === n.TRIVIA && !e && !C, B = r === n.TRIVIA && R, q = u(() => r === n.PREDICTION ? !!(e && !o || e && o && (s != null && s.youVoted)) : !0, [r, e, o, s]), Q = u(() => {
83
- if (r === n.PREDICTION && e && (!o || o && (s != null && s.youVoted)))
88
+ g(() => {
89
+ const n = S.some(({ percentageDecimal: v }) => v !== 0), m = e && r === a.PREDICTION;
90
+ x && (!n || T && m) && j(!0);
91
+ }, [S, x, T, r, e]);
92
+ const ct = I && (I.case === "trivia" || I.case === "prediction") ? I.value : void 0, d = h === k.RESOLVED && r === a.TRIVIA && !e && !C, _ = r === a.TRIVIA && R, q = u(() => r === a.PREDICTION ? !!(e && !o || e && o && (i != null && i.youVoted)) : !0, [r, e, o, i]), lt = u(() => {
93
+ if (r === a.PREDICTION && e && (!o || o && (i != null && i.youVoted)))
84
94
  return e.points;
85
- if (!(f || l))
86
- return e ? e.correct ? e.pointsEarned : 0 : s == null ? void 0 : s.points;
87
- }, [l, e, s, f, r, o]), tt = u(() => r === n.PREDICTION && e ? o ? o && (s != null && s.youVoted) ? "You won" : "" : "To win" : f || l ? "Time expired" : r === n.POLL ? "Time remaining" : e ? "You won" : "To win", [l, r, e, f, o, s]), et = !q || q && r === n.PREDICTION && h && !P, rt = (r === n.TRIVIA || r === n.PREDICTION) && e && o && (s == null ? void 0 : s.youVoted), st = e || f || B || r === n.TRIVIA && T === N.RESOLVED && C;
88
- return /* @__PURE__ */ a(at, { children: /* @__PURE__ */ a(ct, { children: /* @__PURE__ */ j(lt, { children: [
89
- /* @__PURE__ */ a(
90
- ot,
95
+ if (!(d || f))
96
+ return e ? e.correct ? e.pointsEarned : 0 : i == null ? void 0 : i.points;
97
+ }, [f, e, i, d, r, o]), ft = u(() => r === a.PREDICTION && e ? o ? o && (i != null && i.youVoted) ? "You won" : "" : "To win" : d || f ? "Time expired" : r === a.POLL ? "Time remaining" : e ? "You won" : "To win", [f, r, e, d, o, i]), mt = !q || q && r === a.PREDICTION && V && !O, ut = (r === a.TRIVIA || r === a.PREDICTION) && e && o && (i == null ? void 0 : i.youVoted), dt = e || d || _ || r === a.TRIVIA && h === k.RESOLVED && C;
98
+ return /* @__PURE__ */ s(yt, { children: /* @__PURE__ */ s(K, { children: /* @__PURE__ */ y(U, { children: [
99
+ /* @__PURE__ */ s(
100
+ gt,
91
101
  {
92
- feedbackMessages: $,
102
+ feedbackMessages: ct,
93
103
  questionVoted: !!e,
94
104
  questionVotedCorrectly: e == null ? void 0 : e.correct,
95
105
  questionType: r,
96
106
  hasCorrectAnswer: o,
97
- showExpiredNotification: f,
98
- showClosedNotificationTrivia: B,
99
- votedInCurrentRender: h,
107
+ showExpiredNotification: d,
108
+ showClosedNotificationTrivia: _,
109
+ votedInCurrentRender: V,
100
110
  votedAfterQuestionClosed: R,
101
111
  enteredAnActiveQuestion: C,
102
- marketClosed: I,
103
- percentsAnimated: P,
104
- voteErrorMessage: O
112
+ marketClosed: T,
113
+ percentsAnimated: O,
114
+ voteErrorMessage: x
105
115
  }
106
116
  ),
107
- q && /* @__PURE__ */ a(
108
- dt,
117
+ q && /* @__PURE__ */ s(
118
+ Et,
109
119
  {
110
- title: tt,
111
- points: Q,
112
- onTimerExpired: Z,
120
+ title: ft,
121
+ points: lt,
122
+ onTimerExpired: ot,
113
123
  questionType: t.type,
114
- isTimer: !d,
124
+ isTimer: !l,
115
125
  isPlayingTimer: !e,
116
- animatePoints: rt,
117
- timerDuration: st ? 0 : Number(((Y = t == null ? void 0 : t.appearance) == null ? void 0 : Y.autoHideInterval) || "30"),
118
- votedInCurrentRender: h,
119
- percentsAnimated: P
126
+ animatePoints: ut,
127
+ timerDuration: dt ? 0 : Number(((G = t == null ? void 0 : t.appearance) == null ? void 0 : G.autoHideInterval) || "30"),
128
+ votedInCurrentRender: V,
129
+ percentsAnimated: O
120
130
  }
121
131
  ),
122
- l ? /* @__PURE__ */ a(
123
- nt,
132
+ f || W ? /* @__PURE__ */ s(It, { children: /* @__PURE__ */ s(
133
+ Tt,
124
134
  {
135
+ icon: "icon-check-circle",
125
136
  title: "More to come...",
126
- description: "Watch for additional enhanced stream interactive experience."
137
+ description: W ? /* @__PURE__ */ y(D, { children: [
138
+ "Stay tuned for more questions ",
139
+ /* @__PURE__ */ s("br", {}),
140
+ " and insights."
141
+ ] }) : /* @__PURE__ */ y(D, { children: [
142
+ "Watch for additional enhanced stream ",
143
+ /* @__PURE__ */ s("br", {}),
144
+ " interactive experience."
145
+ ] })
127
146
  }
128
- ) : /* @__PURE__ */ j(it, { children: [
129
- /* @__PURE__ */ a(mt, { style: et ? { marginTop: 0 } : {}, children: H }),
130
- /* @__PURE__ */ a(ut, { children: D.map((i) => /* @__PURE__ */ a(
131
- ft,
147
+ ) }) : /* @__PURE__ */ y(D, { children: [
148
+ /* @__PURE__ */ s(Vt, { style: mt ? { marginTop: 0 } : {}, children: Z }),
149
+ /* @__PURE__ */ s(X, { children: S.map((n) => /* @__PURE__ */ s(
150
+ Ct,
132
151
  {
133
- ...i,
134
- markThatVoted: X,
135
- onPercentsAnimated: () => b(!0),
152
+ ...n,
153
+ markThatVoted: st,
154
+ onPercentsAnimated: () => j(!0),
136
155
  votedAfterQuestionClosed: R,
137
156
  enteredAnActiveQuestion: C,
138
- marketClosed: I
157
+ marketClosed: T
139
158
  },
140
- i.id
159
+ n.id
141
160
  )) })
142
161
  ] })
143
162
  ] }) }) });
144
163
  };
145
164
  export {
146
- Rt as Vote
165
+ Nt as Vote,
166
+ kt as VoteSkeleton
147
167
  };
@@ -4,3 +4,4 @@ export declare const QuestionScrollContainer: any;
4
4
  export declare const Content: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
5
5
  export declare const Title: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
6
6
  export declare const Options: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
7
+ export declare const AlertContainer: any;
@@ -1,30 +1,36 @@
1
1
  import { styled as s } from "@linaria/react";
2
2
  import { SDKScrollContainer as o } from "../../app/styles.js";
3
+ import { ShowIn as n } from "../../show-in/index.js";
3
4
  const l = /* @__PURE__ */ s("div")({
4
5
  name: "Container",
5
6
  class: "c14ielyq",
6
7
  propsAsIs: !1
7
- }), n = () => o, a = /* @__PURE__ */ s(n())({
8
+ }), t = () => o, i = /* @__PURE__ */ s(t())({
8
9
  name: "QuestionScrollContainer",
9
10
  class: "q1tlqx57",
10
11
  propsAsIs: !0
11
- }), c = /* @__PURE__ */ s("div")({
12
+ }), p = /* @__PURE__ */ s("div")({
12
13
  name: "Content",
13
14
  class: "c1hq58md",
14
15
  propsAsIs: !1
15
- }), i = /* @__PURE__ */ s("div")({
16
+ }), m = /* @__PURE__ */ s("div")({
16
17
  name: "Title",
17
18
  class: "t1c8nxcx",
18
19
  propsAsIs: !1
19
- }), r = /* @__PURE__ */ s("div")({
20
+ }), C = /* @__PURE__ */ s("div")({
20
21
  name: "Options",
21
22
  class: "oiozuc3",
22
23
  propsAsIs: !1
24
+ }), e = () => n, A = /* @__PURE__ */ s(e())({
25
+ name: "AlertContainer",
26
+ class: "apnc44r",
27
+ propsAsIs: !0
23
28
  });
24
29
  export {
30
+ A as AlertContainer,
25
31
  l as Container,
26
- c as Content,
27
- r as Options,
28
- a as QuestionScrollContainer,
29
- i as Title
32
+ p as Content,
33
+ C as Options,
34
+ i as QuestionScrollContainer,
35
+ m as Title
30
36
  };
@@ -1,15 +1,15 @@
1
1
  import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
2
  import { useState as j, useLayoutEffect as U } from "react";
3
- import { QuestionImages as a, QuestionType as o, QuestionStatus as D } from "@streamlayer/sdk-web-types";
4
- import { AnimatedCounter as $ } from "../../../animated-counter/index.js";
5
- import { IconDefault as y, IconContainer as F, IconWrap as M, IconCircle as W, ButtonContainer as z, ButtonPct as G, ButtonBody as H, Title as J, Pts as K, Indicators as X, CheckIcon as Y, Percentage as Z } from "./styles.js";
6
- const E = {
7
- [a.CENTERED]: (t) => /* @__PURE__ */ e(y, { alt: "option-icon", src: t }),
8
- [a.TRANSPARENT]: (t) => /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(M, { style: { backgroundImage: `url(${t})` } }) }),
9
- [a.ROUNDED]: (t) => /* @__PURE__ */ e(W, { alt: "option-icon", src: t }),
3
+ import { QuestionImages as a, QuestionType as o, QuestionStatus as p } from "@streamlayer/sdk-web-types";
4
+ import { AnimatedCounter as W } from "../../../animated-counter/index.js";
5
+ import { IconDefault as $, IconContainer as y, IconWrap as F, IconCircle as M, ButtonContainer as z, ButtonPctWrap as G, ButtonPct as H, ButtonBody as J, Title as K, Pts as X, Indicators as Y, CheckIcon as Z, Percentage as _ } from "./styles.js";
6
+ const h = {
7
+ [a.CENTERED]: (t) => /* @__PURE__ */ e($, { alt: "option-icon", src: t }),
8
+ [a.TRANSPARENT]: (t) => /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(F, { style: { backgroundImage: `url(${t})` } }) }),
9
+ [a.ROUNDED]: (t) => /* @__PURE__ */ e(M, { alt: "option-icon", src: t }),
10
10
  [a.NONE]: () => null,
11
11
  [a.UNSET]: () => null
12
- }, _ = ({ questionType: t, hasCorrectAnswer: c, correct: n, youVoted: r, questionVoted: i }) => {
12
+ }, q = ({ questionType: t, hasCorrectAnswer: c, correct: n, youVoted: r, questionVoted: i }) => {
13
13
  if (t === o.POLL && r)
14
14
  return "correct";
15
15
  if (t === o.PREDICTION) {
@@ -19,13 +19,13 @@ const E = {
19
19
  return "correct";
20
20
  }
21
21
  return t === o.TRIVIA && i && r ? n ? "correct" : "incorrect" : "unset";
22
- }, q = ({
22
+ }, tt = ({
23
23
  questionType: t,
24
24
  questionVoted: c,
25
25
  correct: n,
26
26
  hasCorrectAnswer: r,
27
27
  questionStatus: i
28
- }) => t === o.TRIVIA ? c && n : t === o.PREDICTION ? c && n && r || i === D.RESOLVED && n : !1, ot = (t) => {
28
+ }) => t === o.TRIVIA ? c && n : t === o.PREDICTION ? c && n && r || i === p.RESOLVED && n : !1, ct = (t) => {
29
29
  var S;
30
30
  const {
31
31
  // option props
@@ -33,12 +33,12 @@ const E = {
33
33
  icon: n,
34
34
  text: r,
35
35
  percentageDecimal: i,
36
- points: p,
36
+ points: D,
37
37
  // extra props
38
38
  onVote: w,
39
39
  markThatVoted: A,
40
40
  onPercentsAnimated: f,
41
- youSelected: h,
41
+ youSelected: E,
42
42
  questionVoted: s,
43
43
  imageMode: C,
44
44
  answerTimeExpired: O,
@@ -50,7 +50,7 @@ const E = {
50
50
  votedAfterQuestionClosed: x,
51
51
  enteredAnActiveQuestion: R,
52
52
  marketClosed: I
53
- } = t, [L, T] = j(0), m = _(t), Q = q({ questionType: d, questionVoted: s, correct: k, hasCorrectAnswer: v, questionStatus: P }), u = I && d === o.PREDICTION, N = s || u, B = d === o.PREDICTION && !s && !I, V = s && !h && m !== "incorrect";
53
+ } = t, [L, T] = j(0), m = q(t), B = tt({ questionType: d, questionVoted: s, correct: k, hasCorrectAnswer: v, questionStatus: P }), u = I && d === o.PREDICTION, N = s || u, Q = d === o.PREDICTION && !s && !I, V = s && !E && m !== "incorrect";
54
54
  return U(() => {
55
55
  T(0), requestAnimationFrame(() => {
56
56
  T(i);
@@ -59,18 +59,18 @@ const E = {
59
59
  z,
60
60
  {
61
61
  value: c,
62
- "data-selected": h,
62
+ "data-selected": E,
63
63
  "data-answer-state": m,
64
64
  disabled: s || g || O || u && !R || u && R && x,
65
65
  "data-is-not-checked": V,
66
66
  onClick: (b) => {
67
67
  A(
68
- d === o.PREDICTION ? I : P === D.RESOLVED
68
+ d === o.PREDICTION ? I : P === p.RESOLVED
69
69
  ), w(b);
70
70
  },
71
71
  children: [
72
- /* @__PURE__ */ e(
73
- G,
72
+ /* @__PURE__ */ e(G, { children: /* @__PURE__ */ e(
73
+ H,
74
74
  {
75
75
  "data-answer-state": m,
76
76
  style: { width: `${N ? L : 0}%` },
@@ -78,17 +78,17 @@ const E = {
78
78
  u || f == null || f();
79
79
  }
80
80
  }
81
- ),
82
- /* @__PURE__ */ l(H, { children: [
83
- n && C && ((S = E[C]) == null ? void 0 : S.call(E, n)),
84
- /* @__PURE__ */ e(J, { children: r }),
85
- B && /* @__PURE__ */ l("div", { children: [
86
- p,
87
- /* @__PURE__ */ e(K, { children: "pts" })
81
+ ) }),
82
+ /* @__PURE__ */ l(J, { children: [
83
+ n && C && ((S = h[C]) == null ? void 0 : S.call(h, n)),
84
+ /* @__PURE__ */ e(K, { children: r }),
85
+ Q && /* @__PURE__ */ l("div", { children: [
86
+ D,
87
+ /* @__PURE__ */ e(X, { children: "pts" })
88
88
  ] }),
89
- N && /* @__PURE__ */ l(X, { children: [
90
- Q && /* @__PURE__ */ e(Y, { name: "selected" }),
91
- /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e($, { value: i, suffix: "%" }) })
89
+ N && /* @__PURE__ */ l(Y, { children: [
90
+ B && /* @__PURE__ */ e(Z, { name: "selected" }),
91
+ /* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(W, { value: i, suffix: "%" }) })
92
92
  ] })
93
93
  ] })
94
94
  ]
@@ -96,5 +96,5 @@ const E = {
96
96
  );
97
97
  };
98
98
  export {
99
- ot as VotingOption
99
+ ct as VotingOption
100
100
  };
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  export declare const ButtonContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
3
+ export declare const ButtonPctWrap: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
4
  export declare const ButtonPct: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
5
  export declare const ButtonBody: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
5
6
  export declare const IconContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;