@streamlayer/react-ui 0.92.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.
- package/lib/assets/style.css +1 -1
- package/lib/{useClipboardCopy-E5rEe6It.js → index-jRXrW6ie.js} +1513 -1537
- package/lib/index.js +5 -4
- package/lib/ui/app/Features/Gamification/Friends.js +6 -5
- package/lib/ui/app/Features/Gamification/Leaderboard.js +4 -3
- package/lib/ui/app/Features/Gamification/Question.js +19 -21
- package/lib/ui/app/Features/Gamification/QuestionsList.js +1 -1
- package/lib/ui/app/Features/Gamification/Tabs.js +42 -39
- package/lib/ui/app/Features/Gamification/gamification-feature.js +11 -6
- package/lib/ui/app/Features/Gamification/index.js +72 -84
- package/lib/ui/app/Navigation/MastersNavigation/index.d.ts +2 -0
- package/lib/ui/app/Navigation/MastersNavigation/index.js +43 -35
- package/lib/ui/app/Notifications/Onboarding/index.d.ts +3 -2
- package/lib/ui/app/Notifications/Onboarding/index.js +114 -86
- package/lib/ui/app/Notifications/index.js +115 -108
- package/lib/ui/app/Points/index.js +6 -5
- package/lib/ui/app/masters.js +41 -31
- package/lib/ui/app/styles.d.ts +1 -0
- package/lib/ui/app/styles.js +6 -1
- package/lib/ui/app/useClipboardCopy.js +26 -5
- package/lib/ui/app/useImagesPreload.d.ts +4 -0
- package/lib/ui/app/useImagesPreload.js +23 -0
- package/lib/ui/app/useMastersApp.js +42 -35
- package/lib/ui/app/useSdkResponsive.d.ts +1 -1
- package/lib/ui/app/useSdkResponsive.js +23 -23
- package/lib/ui/app/useSdkScroll.d.ts +1 -0
- package/lib/ui/app/useSdkScroll.js +32 -23
- package/lib/ui/gamification/detail/header/index.js +11 -11
- package/lib/ui/gamification/detail/header/styles.d.ts +1 -1
- package/lib/ui/gamification/detail/header/styles.js +11 -11
- package/lib/ui/gamification/onboarding/index.d.ts +2 -1
- package/lib/ui/gamification/onboarding/index.js +55 -43
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +1 -1
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.js +15 -13
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.d.ts +1 -1
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.js +9 -9
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +14 -13
- package/lib/ui/gamification/points/index.js +5 -4
- package/lib/ui/gamification/question/insight/index.js +4 -5
- package/lib/ui/gamification/question/list/index.js +14 -14
- package/lib/ui/gamification/question/notification/index.js +3 -2
- package/lib/ui/gamification/question/notification/prediction-result/animation-lines/index.js +17 -17
- package/lib/ui/gamification/question/notification/prediction-result/index.js +37 -39
- package/lib/ui/gamification/question/notification/prediction-result/styles.d.ts +1 -1
- package/lib/ui/gamification/question/notification/prediction-result/styles.js +12 -12
- package/lib/ui/gamification/question/notification/tweet/index.js +10 -7
- package/lib/ui/gamification/question/twitter/index.js +16 -33
- package/lib/ui/gamification/question/twitter/styles.d.ts +0 -1
- package/lib/ui/gamification/question/twitter/styles.js +7 -12
- package/lib/ui/gamification/vote/index.js +57 -56
- package/lib/ui/gamification/vote/insight-details/index.js +5 -6
- package/lib/ui/gamification/vote/twitter-details/index.js +13 -29
- package/lib/ui/gamification/vote/twitter-details/styles.d.ts +0 -1
- package/lib/ui/gamification/vote/twitter-details/styles.js +3 -8
- package/lib/ui/gamification/vote/vote-option/index.js +61 -57
- package/lib/ui/gamification/vote/win-bar/index.d.ts +1 -0
- package/lib/ui/gamification/vote/win-bar/index.js +21 -20
- package/lib/ui/modal/index.d.ts +9 -0
- package/lib/ui/modal/index.js +34 -0
- package/lib/ui/navigation/button/FeaturedGroups.d.ts +3 -1
- package/lib/ui/navigation/button/FeaturedGroups.js +11 -11
- package/lib/ui/navigation/masters.d.ts +2 -1
- package/lib/ui/navigation/masters.js +9 -4
- package/lib/ui/questions/insight/index.d.ts +2 -3
- package/lib/ui/questions/insight/index.js +13 -35
- package/lib/ui/questions/insight/styles.d.ts +0 -1
- package/lib/ui/questions/insight/styles.js +9 -14
- package/lib/ui/questions/twitter/account/index.d.ts +2 -1
- package/lib/ui/questions/twitter/account/index.js +24 -18
- package/lib/ui/questions/twitter/account/styles.d.ts +1 -1
- package/lib/ui/questions/twitter/account/styles.js +2 -2
- package/lib/ui/questions/twitter/index.d.ts +2 -2
- package/lib/ui/questions/twitter/index.js +31 -9
- package/lib/ui/questions/twitter/styles.d.ts +1 -0
- package/lib/ui/questions/twitter/styles.js +8 -3
- package/lib/ui/skeleton/index.d.ts +7 -0
- package/lib/ui/skeleton/index.js +7 -0
- package/lib/ui/skeleton/styles.d.ts +2 -0
- package/lib/ui/skeleton/styles.js +9 -0
- package/lib/ui/theme/breakpoints.d.ts +4 -1
- package/lib/ui/theme/breakpoints.js +24 -12
- package/lib/ui/theme/constants.d.ts +4 -0
- package/lib/ui/theme/constants.js +6 -2
- package/lib/ui/theme/index.js +4 -3
- package/lib/ui/theme/theme.js +29 -21
- package/lib/utils/common.js +22 -8
- package/lib/utils/decorators/container.js +4 -3
- package/package.json +18 -18
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-
import { styled as
|
|
2
|
-
import { Button as
|
|
1
|
+
import { styled as o } from "@linaria/react";
|
|
2
|
+
import { Button as t } from "../../../button/index.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "../../../button/styles.js";
|
|
5
|
-
const
|
|
5
|
+
const a = /* @__PURE__ */ o("div")({
|
|
6
6
|
name: "Container",
|
|
7
7
|
class: "cl56x6b",
|
|
8
8
|
propsAsIs: !1
|
|
9
|
-
}),
|
|
9
|
+
}), s = () => t, c = /* @__PURE__ */ o(s())({
|
|
10
10
|
name: "ActionButton",
|
|
11
11
|
class: "a11pzf92",
|
|
12
12
|
propsAsIs: !0
|
|
13
|
-
}),
|
|
14
|
-
name: "DateTime",
|
|
15
|
-
class: "d1hbaleq",
|
|
16
|
-
propsAsIs: !1
|
|
17
|
-
}), i = /* @__PURE__ */ s("blockquote")({
|
|
13
|
+
}), i = /* @__PURE__ */ o("blockquote")({
|
|
18
14
|
name: "Quote",
|
|
19
|
-
class: "
|
|
15
|
+
class: "q1hbaleq",
|
|
20
16
|
propsAsIs: !1
|
|
21
17
|
});
|
|
22
18
|
export {
|
|
23
19
|
c as ActionButton,
|
|
24
|
-
|
|
25
|
-
m as DateTime,
|
|
20
|
+
a as Container,
|
|
26
21
|
i as Quote
|
|
27
22
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { QuestionType as
|
|
4
|
-
import { ExpiredAlert as
|
|
5
|
-
import { Feedback as
|
|
6
|
-
import { QuestionScrollContainer as
|
|
7
|
-
import { VotingOption as
|
|
8
|
-
import { WinBar as
|
|
1
|
+
import { jsx as n, jsxs as k, Fragment as J } from "react/jsx-runtime";
|
|
2
|
+
import { useState as I, useEffect as K, useCallback as R, useMemo as f } from "react";
|
|
3
|
+
import { QuestionType as o, QuestionStatus as E } from "@streamlayer/sdk-web-types";
|
|
4
|
+
import { ExpiredAlert as U } from "./expired-alert/index.js";
|
|
5
|
+
import { Feedback as X } from "./feedback/index.js";
|
|
6
|
+
import { QuestionScrollContainer as Z, Container as _, Content as $, Title as Q, Options as tt } from "./styles.js";
|
|
7
|
+
import { VotingOption as rt } from "./vote-option/index.js";
|
|
8
|
+
import { WinBar as it } from "./win-bar/index.js";
|
|
9
9
|
import "../../icons/index.js";
|
|
10
10
|
import "@linaria/react";
|
|
11
11
|
import "./expired-alert/styles.js";
|
|
@@ -18,28 +18,28 @@ import "../../timer/index.js";
|
|
|
18
18
|
import "react-countdown-circle-timer";
|
|
19
19
|
import "../../theme/constants.js";
|
|
20
20
|
import "./win-bar/styles.js";
|
|
21
|
-
const
|
|
22
|
-
var
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
const vt = ({ openedQuestion: t, isLoading: C, vote: p, close: v }) => {
|
|
22
|
+
var P, g;
|
|
23
|
+
const A = t.subject, a = t.type, m = t.status, V = (P = t.options) == null ? void 0 : P.options, d = t.marketClosed, [O, b] = I(!1), [y, L] = I(!1), [T, w] = I(!0), [c, M] = I(!1), [x, D] = I(""), h = t == null ? void 0 : t.id;
|
|
24
|
+
K(() => {
|
|
25
|
+
a === o.PREDICTION ? d && w(!1) : m === E.RESOLVED && w(!1);
|
|
26
26
|
}, []);
|
|
27
|
-
const j =
|
|
27
|
+
const j = R((e) => {
|
|
28
28
|
L(e), b(!0);
|
|
29
|
-
}, []),
|
|
29
|
+
}, []), q = R(
|
|
30
30
|
async (e) => {
|
|
31
31
|
if (h) {
|
|
32
32
|
const u = e.currentTarget.value;
|
|
33
|
-
|
|
33
|
+
D(u), await p(h, u);
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
[h,
|
|
37
|
-
), B =
|
|
36
|
+
[h, D, p]
|
|
37
|
+
), B = R(() => {
|
|
38
38
|
M(!0), setTimeout(v, 3e3);
|
|
39
39
|
}, [v]), r = f(
|
|
40
40
|
() => t == null ? void 0 : t.answers.find((e) => e.youVoted === !0),
|
|
41
41
|
[t]
|
|
42
|
-
),
|
|
42
|
+
), s = f(
|
|
43
43
|
() => !!(t != null && t.answers.find((e) => e.correct === !0)),
|
|
44
44
|
[t]
|
|
45
45
|
), i = f(
|
|
@@ -51,77 +51,78 @@ const wt = ({ openedQuestion: t, isLoading: I, vote: w, close: v }) => {
|
|
|
51
51
|
...e,
|
|
52
52
|
questionVoted: !!r,
|
|
53
53
|
youSelected: x === e.id,
|
|
54
|
-
isLoading:
|
|
55
|
-
hasCorrectAnswer:
|
|
54
|
+
isLoading: C,
|
|
55
|
+
hasCorrectAnswer: s,
|
|
56
56
|
questionType: t.type,
|
|
57
|
-
answerTimeExpired:
|
|
58
|
-
questionStatus:
|
|
57
|
+
answerTimeExpired: c,
|
|
58
|
+
questionStatus: m,
|
|
59
59
|
imageMode: (u = t.appearance) == null ? void 0 : u.images,
|
|
60
|
-
onVote:
|
|
60
|
+
onVote: q
|
|
61
61
|
};
|
|
62
62
|
}) : [], [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
s,
|
|
64
|
+
c,
|
|
65
|
+
C,
|
|
66
66
|
t,
|
|
67
67
|
r,
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
m,
|
|
69
|
+
q,
|
|
70
70
|
x
|
|
71
|
-
]), F = V && (V.case === "trivia" || V.case === "prediction") ? V.value : void 0, l =
|
|
72
|
-
if (
|
|
71
|
+
]), F = V && (V.case === "trivia" || V.case === "prediction") ? V.value : void 0, l = m === E.RESOLVED && a === o.TRIVIA && !r && !T, S = a === o.TRIVIA && y && O && T, N = f(() => a === o.PREDICTION ? !!(r && !s || r && s && (i != null && i.youVoted)) : !0, [a, r, s, i]), Y = f(() => {
|
|
72
|
+
if (a === o.PREDICTION && r && (!s || s && (i != null && i.youVoted)))
|
|
73
73
|
return r.points;
|
|
74
|
-
if (!(l ||
|
|
75
|
-
return
|
|
74
|
+
if (!(l || c))
|
|
75
|
+
return m === E.RESOLVED ? 0 : r ? r.correct ? r.points : 0 : i == null ? void 0 : i.points;
|
|
76
76
|
}, [
|
|
77
|
-
|
|
77
|
+
c,
|
|
78
78
|
r,
|
|
79
79
|
i,
|
|
80
|
-
|
|
80
|
+
m,
|
|
81
81
|
l,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
]), H = f(() =>
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
|
|
82
|
+
a,
|
|
83
|
+
s
|
|
84
|
+
]), H = f(() => a === o.PREDICTION && r ? s ? s && (i != null && i.youVoted) ? "You won" : "" : "To win" : l || c ? "Time expired" : a === o.POLL ? "Time remaining" : r ? "You won" : "To win", [c, a, r, l, s, i]), z = (a === o.TRIVIA || a === o.PREDICTION) && r && s && (i == null ? void 0 : i.youVoted), G = r || l || S || a === o.TRIVIA && m === E.RESOLVED && T;
|
|
85
|
+
return /* @__PURE__ */ n(Z, { children: /* @__PURE__ */ n(_, { children: /* @__PURE__ */ k($, { children: [
|
|
86
|
+
/* @__PURE__ */ n(
|
|
87
|
+
X,
|
|
88
88
|
{
|
|
89
89
|
feedbackMessages: F,
|
|
90
90
|
questionVoted: !!r,
|
|
91
91
|
questionVotedCorrectly: r == null ? void 0 : r.correct,
|
|
92
|
-
questionType:
|
|
93
|
-
hasCorrectAnswer:
|
|
94
|
-
questionStatus:
|
|
92
|
+
questionType: a,
|
|
93
|
+
hasCorrectAnswer: s,
|
|
94
|
+
questionStatus: m,
|
|
95
95
|
showExpiredNotification: l,
|
|
96
96
|
showClosedNotificationTrivia: S,
|
|
97
|
-
votedInCurrentRender:
|
|
97
|
+
votedInCurrentRender: O,
|
|
98
98
|
votedAfterQuestionClosed: y,
|
|
99
99
|
enteredAnActiveQuestion: T,
|
|
100
100
|
marketClosed: d
|
|
101
101
|
}
|
|
102
102
|
),
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
N && /* @__PURE__ */ n(
|
|
104
|
+
it,
|
|
105
105
|
{
|
|
106
106
|
title: H,
|
|
107
107
|
points: Y,
|
|
108
108
|
onTimerExpired: B,
|
|
109
109
|
questionType: t.type,
|
|
110
|
-
isTimer: !
|
|
110
|
+
isTimer: !C,
|
|
111
111
|
isPlayingTimer: !r,
|
|
112
|
-
|
|
112
|
+
animatePoints: z,
|
|
113
|
+
timerDuration: G ? 0 : Number(((g = t == null ? void 0 : t.appearance) == null ? void 0 : g.autoHideInterval) || "30")
|
|
113
114
|
}
|
|
114
115
|
),
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
c ? /* @__PURE__ */ n(
|
|
117
|
+
U,
|
|
117
118
|
{
|
|
118
119
|
title: "More to come...",
|
|
119
120
|
description: "Watch for additional enhanced stream interactive experience."
|
|
120
121
|
}
|
|
121
|
-
) : /* @__PURE__ */
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
|
|
122
|
+
) : /* @__PURE__ */ k(J, { children: [
|
|
123
|
+
/* @__PURE__ */ n(Q, { style: N ? {} : { marginTop: 0 }, children: A }),
|
|
124
|
+
/* @__PURE__ */ n(tt, { children: W.map((e) => /* @__PURE__ */ n(
|
|
125
|
+
rt,
|
|
125
126
|
{
|
|
126
127
|
...e,
|
|
127
128
|
markThatVoted: j,
|
|
@@ -135,5 +136,5 @@ const wt = ({ openedQuestion: t, isLoading: I, vote: w, close: v }) => {
|
|
|
135
136
|
] }) }) });
|
|
136
137
|
};
|
|
137
138
|
export {
|
|
138
|
-
|
|
139
|
+
vt as Vote
|
|
139
140
|
};
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { jsxs as o, jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import { SvgIcon as
|
|
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
|
|
12
|
-
/* @__PURE__ */ m(b, { instantView: r, ...
|
|
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(
|
|
14
|
+
/* @__PURE__ */ m(p, { name: "icon-external-link" })
|
|
16
15
|
] })
|
|
17
16
|
] });
|
|
18
17
|
export {
|
|
19
|
-
|
|
18
|
+
j as InsightDetails
|
|
20
19
|
};
|
|
@@ -1,35 +1,19 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
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
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
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
|
|
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: "
|
|
8
|
+
class: "qb4q22c",
|
|
13
9
|
propsAsIs: !1
|
|
14
10
|
});
|
|
15
11
|
export {
|
|
16
|
-
|
|
17
|
-
a as DateTime,
|
|
12
|
+
e as Container,
|
|
18
13
|
t as Quote
|
|
19
14
|
};
|
|
@@ -1,83 +1,87 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { jsx as n, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { useState as b, useLayoutEffect as j } from "react";
|
|
3
|
+
import { QuestionImages as a, QuestionType as o, QuestionStatus as S } from "@streamlayer/sdk-web-types";
|
|
4
|
+
import { AnimatedCounter as U } from "../../../animated-counter/index.js";
|
|
5
|
+
import { IconDefault as $, IconContainer as y, IconWrap as F, IconCircle as M, ButtonContainer as W, ButtonPct as z, ButtonBody as G, Title as H, Pts as J, Indicators as K, CheckIcon as X, Percentage as Y } from "./styles.js";
|
|
5
6
|
import "react-countup";
|
|
6
7
|
import "@linaria/react";
|
|
7
8
|
import "../../../icons/index.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
[a.
|
|
11
|
-
[a.
|
|
12
|
-
[a.ROUNDED]: (t) => /* @__PURE__ */ e(j, { alt: "option-icon", src: t }),
|
|
9
|
+
const I = {
|
|
10
|
+
[a.CENTERED]: (t) => /* @__PURE__ */ n($, { alt: "option-icon", src: t }),
|
|
11
|
+
[a.TRANSPARENT]: (t) => /* @__PURE__ */ n(y, { children: /* @__PURE__ */ n(F, { style: { backgroundImage: `url(${t})` } }) }),
|
|
12
|
+
[a.ROUNDED]: (t) => /* @__PURE__ */ n(M, { alt: "option-icon", src: t }),
|
|
13
13
|
[a.NONE]: () => null,
|
|
14
14
|
[a.UNSET]: () => null
|
|
15
|
-
},
|
|
16
|
-
if (t ===
|
|
15
|
+
}, Z = ({ questionType: t, hasCorrectAnswer: c, correct: r, youVoted: i, questionVoted: e }) => {
|
|
16
|
+
if (t === o.POLL && i)
|
|
17
17
|
return "correct";
|
|
18
|
-
if (t ===
|
|
19
|
-
if (c &&
|
|
20
|
-
return
|
|
21
|
-
if (
|
|
18
|
+
if (t === o.PREDICTION) {
|
|
19
|
+
if (c && e)
|
|
20
|
+
return i ? r ? "correct" : "incorrect" : "unset";
|
|
21
|
+
if (i)
|
|
22
22
|
return "correct";
|
|
23
23
|
}
|
|
24
|
-
return t ===
|
|
25
|
-
},
|
|
24
|
+
return t === o.TRIVIA && e && i ? r ? "correct" : "incorrect" : "unset";
|
|
25
|
+
}, _ = ({
|
|
26
26
|
questionType: t,
|
|
27
27
|
questionVoted: c,
|
|
28
|
-
correct:
|
|
29
|
-
hasCorrectAnswer:
|
|
30
|
-
questionStatus:
|
|
31
|
-
}) => t ===
|
|
32
|
-
var
|
|
28
|
+
correct: r,
|
|
29
|
+
hasCorrectAnswer: i,
|
|
30
|
+
questionStatus: e
|
|
31
|
+
}) => t === o.TRIVIA ? c && r : t === o.PREDICTION ? c && r && i || e === S.RESOLVED && r : !1, st = (t) => {
|
|
32
|
+
var N;
|
|
33
33
|
const {
|
|
34
34
|
// option props
|
|
35
35
|
id: c,
|
|
36
|
-
icon:
|
|
37
|
-
text:
|
|
38
|
-
percentageDecimal:
|
|
39
|
-
points:
|
|
36
|
+
icon: r,
|
|
37
|
+
text: i,
|
|
38
|
+
percentageDecimal: e,
|
|
39
|
+
points: T,
|
|
40
40
|
// extra props
|
|
41
|
-
onVote:
|
|
42
|
-
markThatVoted:
|
|
41
|
+
onVote: A,
|
|
42
|
+
markThatVoted: D,
|
|
43
43
|
youSelected: h,
|
|
44
44
|
questionVoted: s,
|
|
45
|
-
imageMode:
|
|
46
|
-
answerTimeExpired:
|
|
47
|
-
questionStatus:
|
|
48
|
-
isLoading:
|
|
45
|
+
imageMode: E,
|
|
46
|
+
answerTimeExpired: w,
|
|
47
|
+
questionStatus: C,
|
|
48
|
+
isLoading: O,
|
|
49
49
|
questionType: d,
|
|
50
|
-
correct:
|
|
50
|
+
correct: g,
|
|
51
51
|
hasCorrectAnswer: k,
|
|
52
|
-
votedAfterQuestionClosed:
|
|
53
|
-
enteredAnActiveQuestion:
|
|
54
|
-
marketClosed:
|
|
55
|
-
} = t,
|
|
56
|
-
return
|
|
57
|
-
|
|
52
|
+
votedAfterQuestionClosed: x,
|
|
53
|
+
enteredAnActiveQuestion: P,
|
|
54
|
+
marketClosed: l
|
|
55
|
+
} = t, [L, p] = b(e), m = Z(t), v = _({ questionType: d, questionVoted: s, correct: g, hasCorrectAnswer: k, questionStatus: C }), f = l && d === o.PREDICTION, R = s || f, Q = d === o.PREDICTION && !s && !l, B = s && !h && m !== "incorrect";
|
|
56
|
+
return j(() => {
|
|
57
|
+
e > 0 && (p(0), requestAnimationFrame(() => {
|
|
58
|
+
p(e);
|
|
59
|
+
}));
|
|
60
|
+
}, [e]), /* @__PURE__ */ u(
|
|
61
|
+
W,
|
|
58
62
|
{
|
|
59
63
|
value: c,
|
|
60
64
|
"data-selected": h,
|
|
61
|
-
"data-answer-state":
|
|
62
|
-
disabled: s ||
|
|
63
|
-
"data-is-not-checked":
|
|
64
|
-
onClick: (
|
|
65
|
-
|
|
66
|
-
d ===
|
|
67
|
-
),
|
|
65
|
+
"data-answer-state": m,
|
|
66
|
+
disabled: s || O || w || f && !P || f && P && x,
|
|
67
|
+
"data-is-not-checked": B,
|
|
68
|
+
onClick: (V) => {
|
|
69
|
+
D(
|
|
70
|
+
d === o.PREDICTION ? l : C === S.RESOLVED
|
|
71
|
+
), A(V);
|
|
68
72
|
},
|
|
69
73
|
children: [
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ n(z, { "data-answer-state": m, style: { width: `${R ? L : 0}%` } }),
|
|
75
|
+
/* @__PURE__ */ u(G, { children: [
|
|
76
|
+
r && E && ((N = I[E]) == null ? void 0 : N.call(I, r)),
|
|
77
|
+
/* @__PURE__ */ n(H, { children: i }),
|
|
78
|
+
Q && /* @__PURE__ */ u("div", { children: [
|
|
79
|
+
T,
|
|
80
|
+
/* @__PURE__ */ n(J, { children: "pts" })
|
|
77
81
|
] }),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
/* @__PURE__ */
|
|
82
|
+
R && /* @__PURE__ */ u(K, { children: [
|
|
83
|
+
v && /* @__PURE__ */ n(X, { name: "selected" }),
|
|
84
|
+
/* @__PURE__ */ n(Y, { children: /* @__PURE__ */ n(U, { value: e, suffix: "%" }) })
|
|
81
85
|
] })
|
|
82
86
|
] })
|
|
83
87
|
]
|
|
@@ -85,5 +89,5 @@ const f = {
|
|
|
85
89
|
);
|
|
86
90
|
};
|
|
87
91
|
export {
|
|
88
|
-
|
|
92
|
+
st as VotingOption
|
|
89
93
|
};
|
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import { jsxs as i, jsx as r, Fragment as
|
|
2
|
-
import { QuestionType as
|
|
3
|
-
import { AnimatedCounter as
|
|
4
|
-
import { Timer as
|
|
5
|
-
import { WinBarContainer as
|
|
1
|
+
import { jsxs as i, jsx as r, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { QuestionType as o } from "@streamlayer/sdk-web-types";
|
|
3
|
+
import { AnimatedCounter as s } from "../../../animated-counter/index.js";
|
|
4
|
+
import { Timer as h } from "../../../timer/index.js";
|
|
5
|
+
import { WinBarContainer as P, Content as C, Title as f, WinIcon as u, Points as I, PointsCount as y, PointsUnits as T } from "./styles.js";
|
|
6
6
|
import "react-countup";
|
|
7
7
|
import "@linaria/react";
|
|
8
8
|
import "react";
|
|
9
9
|
import "react-countdown-circle-timer";
|
|
10
10
|
import "../../../theme/constants.js";
|
|
11
11
|
import "../../../icons/index.js";
|
|
12
|
-
const
|
|
13
|
-
title:
|
|
14
|
-
points:
|
|
12
|
+
const R = ({
|
|
13
|
+
title: e,
|
|
14
|
+
points: n,
|
|
15
15
|
isPlayingTimer: m,
|
|
16
16
|
isTimer: c,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
e
|
|
24
|
-
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
17
|
+
animatePoints: a,
|
|
18
|
+
questionType: t,
|
|
19
|
+
timerDuration: d,
|
|
20
|
+
onTimerExpired: l
|
|
21
|
+
}) => /* @__PURE__ */ i(P, { style: { justifyContent: t === o.PREDICTION ? "center" : "space-between" }, children: [
|
|
22
|
+
/* @__PURE__ */ i(C, { children: [
|
|
23
|
+
e && /* @__PURE__ */ r(f, { children: e }),
|
|
24
|
+
n !== void 0 && t !== o.POLL && /* @__PURE__ */ i(p, { children: [
|
|
25
|
+
/* @__PURE__ */ r(u, { name: "icon-trophy" }),
|
|
26
|
+
/* @__PURE__ */ i(I, { children: [
|
|
27
|
+
/* @__PURE__ */ r(y, { children: a ? /* @__PURE__ */ r(s, { value: n, delay: 0.3 }) : n }),
|
|
27
28
|
/* @__PURE__ */ r(T, { children: "PTS" })
|
|
28
29
|
] })
|
|
29
30
|
] })
|
|
30
31
|
] }),
|
|
31
|
-
c &&
|
|
32
|
+
c && t !== o.PREDICTION && /* @__PURE__ */ r(h, { isPlaying: m, onTimerExpired: l, duration: d })
|
|
32
33
|
] });
|
|
33
34
|
export {
|
|
34
|
-
|
|
35
|
+
R as WinBar
|
|
35
36
|
};
|
|
@@ -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
|
|
2
|
-
import { styled as
|
|
3
|
-
import { SvgIcon as
|
|
4
|
-
import { Button as
|
|
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
|
|
7
|
+
const s = () => u, a = /* @__PURE__ */ r(s())({
|
|
8
8
|
name: "ButtonIcon",
|
|
9
9
|
class: "b11des7c",
|
|
10
10
|
propsAsIs: !0
|
|
11
|
-
}),
|
|
11
|
+
}), f = "featuredGroups", G = (t) => {
|
|
12
12
|
var o;
|
|
13
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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
|
-
|
|
25
|
-
|
|
24
|
+
G as FeaturedGroupsButton,
|
|
25
|
+
f as FeaturedGroupsButtonId
|
|
26
26
|
};
|