@streamlayer/react-ui 1.20.0 → 1.22.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/app/masters/BetPack/BetPackContent/EmergencyScreen/index.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.js +11 -11
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.d.ts +0 -1
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +18 -22
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.d.ts +0 -1
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +7 -7
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.d.ts +1 -2
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.js +16 -19
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.d.ts +0 -1
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +25 -24
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.js +14 -9
- package/lib/app/masters/BetPack/BetPackContent/index.js +68 -66
- package/lib/app/masters/BetPack/BetPackOverlay/index.js +3 -2
- package/lib/app/masters/BetPack/index.js +64 -62
- package/lib/app/masters/BetPack/utils.d.ts +1 -1
- package/lib/app/masters/BetPack/utils.js +8 -7
- package/lib/app/masters/Features/Gamification/index.js +5 -5
- package/lib/app/masters/Features/index.d.ts +2 -2
- package/lib/app/masters/Features/index.js +1 -1
- package/lib/app/masters/Header/index.js +19 -23
- package/lib/app/masters/Notifications/Onboarding/index.d.ts +0 -1
- package/lib/app/masters/Notifications/Onboarding/index.js +42 -43
- package/lib/app/masters/Notifications/index.js +50 -55
- package/lib/app/masters/masters.js +60 -56
- package/lib/app/masters/useOrientation.d.ts +3 -0
- package/lib/app/masters/useOrientation.js +12 -0
- package/lib/app/masters/useSdkResponsive.js +2 -2
- package/lib/app/masters/useSdkScroll.js +12 -12
- package/lib/app/useSdkResponsive.js +1 -1
- package/lib/app/useSdkScroll.js +1 -1
- package/lib/assets/style.css +1 -1
- package/lib/index-DSi8Qgfs.js +14 -0
- package/lib/index-DXvAPWiE.js +3743 -0
- package/lib/index-tnt2CtQe.js +55 -0
- package/lib/ui/advertisement/overlay/externalAd/index.d.ts +1 -1
- package/lib/ui/advertisement/overlay/externalAd/index.js +79 -40323
- package/lib/ui/advertisement/overlay/externalAd/styles.d.ts +10 -0
- package/lib/ui/advertisement/overlay/externalAd/styles.js +49 -0
- package/lib/ui/advertisement/overlay/externalAd/vast-player/module.d.js +1 -0
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.d.ts +19 -0
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.js +33199 -0
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useVastAds.d.ts +24 -0
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useVastAds.js +8 -0
- package/lib/ui/gamification/vote/feedback/index.d.ts +1 -0
- package/lib/ui/gamification/vote/feedback/index.js +83 -73
- package/lib/ui/gamification/vote/feedback/styles.d.ts +1 -0
- package/lib/ui/gamification/vote/feedback/styles.js +40 -39
- package/lib/ui/gamification/vote/index.js +98 -95
- package/lib/ui/icons/index.d.ts +1 -0
- package/lib/ui/icons/index.js +88 -79
- package/lib/ui/modal/index.js +31 -34
- package/lib/ui/theme/breakpoints.d.ts +1 -0
- package/lib/ui/theme/breakpoints.js +17 -9
- package/lib/ui/theme/masters-theme.js +1 -0
- package/lib/useVastAds-Dt_tRbpd.js +1284 -0
- package/package.json +18 -15
- package/lib/index-CLJzLXks.js +0 -64
|
@@ -1,52 +1,54 @@
|
|
|
1
|
-
import { jsx as r, jsxs as m, Fragment as
|
|
2
|
-
import { useHideTransition as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { QuestionType as
|
|
5
|
-
import { Skeleton as
|
|
6
|
-
import { Alert as
|
|
7
|
-
import { Feedback as
|
|
8
|
-
import { Container as
|
|
9
|
-
import { VotingOption as
|
|
10
|
-
import { WinBar as
|
|
11
|
-
const
|
|
1
|
+
import { jsx as r, jsxs as m, Fragment as S } from "react/jsx-runtime";
|
|
2
|
+
import { useHideTransition as It } from "../../../hooks/showIn.js";
|
|
3
|
+
import { useRef as X, useState as l, useEffect as p, useCallback as v, useMemo as g } from "react";
|
|
4
|
+
import { QuestionType as c, QuestionStatus as L } from "@streamlayer/sdk-web-types";
|
|
5
|
+
import { Skeleton as M } from "../../skeleton/index.js";
|
|
6
|
+
import { Alert as Ct } from "./alert/index.js";
|
|
7
|
+
import { Feedback as Z } from "./feedback/index.js";
|
|
8
|
+
import { Container as $, Content as Q, Options as tt, QuestionScrollContainer as Vt, TopShadow as pt, AlertContainer as vt, EarlyPrediction as wt, EarlyPredictionIcon as At, Title as yt, OptionsWrap as Rt, BottomShadow as Et, SponsorLogo as Ot, SponsorIcon as St } from "./styles.js";
|
|
9
|
+
import { VotingOption as xt } from "./vote-option/index.js";
|
|
10
|
+
import { WinBar as qt } from "./win-bar/index.js";
|
|
11
|
+
const Dt = (e, f) => {
|
|
12
12
|
switch (e) {
|
|
13
13
|
case "already_voted":
|
|
14
|
-
return
|
|
14
|
+
return f === c.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.";
|
|
15
15
|
default:
|
|
16
16
|
return "Something went wrong, please try again";
|
|
17
17
|
}
|
|
18
|
-
},
|
|
19
|
-
/* @__PURE__ */ r(
|
|
20
|
-
/* @__PURE__ */ r(
|
|
21
|
-
/* @__PURE__ */ r(
|
|
22
|
-
] }) }),
|
|
23
|
-
var
|
|
24
|
-
const
|
|
18
|
+
}, Ht = () => /* @__PURE__ */ r($, { children: /* @__PURE__ */ m(Q, { children: [
|
|
19
|
+
/* @__PURE__ */ r(M, { loading: !0, style: { height: "40px", borderRadius: "100px" } }),
|
|
20
|
+
/* @__PURE__ */ r(M, { loading: !0, style: { height: "24px", margin: "16px 0" } }),
|
|
21
|
+
/* @__PURE__ */ r(tt, { children: Array.from({ length: 5 }).map((e, f) => /* @__PURE__ */ r(M, { loading: !0, style: { height: "44px" } }, f)) })
|
|
22
|
+
] }) }), Ft = ({ openedQuestion: e, isLoading: f, vote: W, close: B, isEarlyPrediction: i }) => {
|
|
23
|
+
var K, U;
|
|
24
|
+
const et = e.subject, n = e.type, I = e.status, w = (K = e.options) == null ? void 0 : K.options, T = e.marketClosed, x = e.id, P = X(), [C, Y] = l(!1), [A, rt] = l(!1), [V, j] = l(!0), [u, nt] = l(!1), [H, ot] = l(!1), [F, q] = l(""), [y, st] = l(""), [R, _] = l(!1), [it, at] = l(!1), { runAnimation: E, finished: z } = It();
|
|
25
25
|
p(() => {
|
|
26
|
-
|
|
27
|
-
}, [
|
|
28
|
-
n ===
|
|
26
|
+
z && B();
|
|
27
|
+
}, [B, z]), p(() => {
|
|
28
|
+
n === c.PREDICTION ? T && j(!1) : I === L.RESOLVED && j(!1);
|
|
29
29
|
}, []);
|
|
30
|
-
const ct =
|
|
31
|
-
rt(s),
|
|
32
|
-
}, []),
|
|
30
|
+
const ct = v((s) => {
|
|
31
|
+
rt(s), Y(!0);
|
|
32
|
+
}, []), lt = v(() => {
|
|
33
|
+
i && Y(!1);
|
|
34
|
+
}, [i]), D = X(!1), G = v(
|
|
33
35
|
async (s) => {
|
|
34
36
|
if (!D.current && (D.current = !0, x)) {
|
|
35
37
|
const h = s.currentTarget.value;
|
|
36
38
|
q(h);
|
|
37
39
|
try {
|
|
38
|
-
await
|
|
39
|
-
} catch (
|
|
40
|
-
st(
|
|
40
|
+
await W(x, h);
|
|
41
|
+
} catch (O) {
|
|
42
|
+
st(Dt(O.message, n)), q(""), console.error("Error while voting", O), D.current = !1;
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
},
|
|
44
|
-
[n, x, q,
|
|
45
|
-
),
|
|
46
|
+
[n, x, q, W]
|
|
47
|
+
), mt = v(() => {
|
|
46
48
|
nt(!0), E({ delay: 3500 });
|
|
47
|
-
}, [E]),
|
|
49
|
+
}, [E]), ft = v(() => {
|
|
48
50
|
ot(!0), E({ delay: 3500 });
|
|
49
|
-
}, [E]), t = e == null ? void 0 : e.answers.find((s) => s.youVoted === !0),
|
|
51
|
+
}, [E]), t = e == null ? void 0 : e.answers.find((s) => s.youVoted === !0), a = g(
|
|
50
52
|
() => !!(e != null && e.answers.find((s) => s.correct === !0)),
|
|
51
53
|
[e]
|
|
52
54
|
), o = g(
|
|
@@ -54,140 +56,141 @@ const qt = (e, u) => {
|
|
|
54
56
|
[e]
|
|
55
57
|
);
|
|
56
58
|
p(() => {
|
|
57
|
-
t && C && !it && (
|
|
59
|
+
t && C && !it && (P.current = setTimeout(ft, 1e4), at(!0));
|
|
58
60
|
}, [t]), p(() => () => {
|
|
59
|
-
clearTimeout(
|
|
61
|
+
clearTimeout(P.current);
|
|
60
62
|
}, []);
|
|
61
63
|
const k = g(() => e ? e.answers.map((s) => {
|
|
62
64
|
var h;
|
|
63
65
|
return {
|
|
64
66
|
...s,
|
|
65
67
|
questionVoted: !!t,
|
|
66
|
-
youSelected:
|
|
67
|
-
isLoading:
|
|
68
|
-
hasCorrectAnswer:
|
|
68
|
+
youSelected: F === s.id,
|
|
69
|
+
isLoading: f,
|
|
70
|
+
hasCorrectAnswer: a,
|
|
69
71
|
questionType: e.type,
|
|
70
|
-
answerTimeExpired:
|
|
72
|
+
answerTimeExpired: u,
|
|
71
73
|
questionStatus: I,
|
|
72
74
|
imageMode: (h = e.appearance) == null ? void 0 : h.images,
|
|
73
|
-
onVote:
|
|
75
|
+
onVote: G
|
|
74
76
|
};
|
|
75
77
|
}) : [], [
|
|
76
|
-
|
|
77
|
-
f,
|
|
78
|
+
a,
|
|
78
79
|
u,
|
|
80
|
+
f,
|
|
79
81
|
e,
|
|
80
82
|
t,
|
|
81
83
|
I,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
+
G,
|
|
85
|
+
F
|
|
84
86
|
]);
|
|
85
87
|
p(() => {
|
|
86
|
-
const s = k.some(({ percentageDecimal:
|
|
87
|
-
|
|
88
|
-
}, [k,
|
|
89
|
-
const
|
|
90
|
-
if (n ===
|
|
88
|
+
const s = k.some(({ percentageDecimal: O }) => O !== 0), h = t && n === c.PREDICTION;
|
|
89
|
+
y && (i || !s || T && h) && _(!0);
|
|
90
|
+
}, [k, y, i, T, n, t]);
|
|
91
|
+
const J = w && (w.case === "trivia" || w.case === "prediction") ? w.value : void 0, d = I === L.RESOLVED && n === c.TRIVIA && !t && !V, N = n === c.TRIVIA && A, b = g(() => n === c.PREDICTION ? i ? !1 : !!(t && !a || t && a && (o != null && o.youVoted)) : !0, [n, t, a, o, i]), ut = g(() => {
|
|
92
|
+
if (n === c.PREDICTION && t && (!a || a && (o != null && o.youVoted)))
|
|
91
93
|
return t.points;
|
|
92
|
-
if (!(d ||
|
|
94
|
+
if (!(d || u))
|
|
93
95
|
return t ? t.correct ? t.pointsEarned : 0 : o == null ? void 0 : o.points;
|
|
94
|
-
}, [
|
|
95
|
-
return /* @__PURE__ */ m(
|
|
96
|
-
|
|
97
|
-
/* @__PURE__ */ r(
|
|
98
|
-
!
|
|
99
|
-
|
|
96
|
+
}, [u, t, o, d, n, a]), dt = g(() => n === c.PREDICTION && t ? a ? a && (o != null && o.youVoted) ? "You won" : "" : "To win" : d || u ? "Time expired" : n === c.POLL ? "Time remaining" : t ? "You won" : "To win", [u, n, t, d, a, o]), ht = !b || b && n === c.PREDICTION && C && !R, Tt = (n === c.TRIVIA || n === c.PREDICTION) && t && a && (o == null ? void 0 : o.youVoted), gt = t || d || N || n === c.TRIVIA && I === L.RESOLVED && V;
|
|
97
|
+
return /* @__PURE__ */ m(Vt, { children: [
|
|
98
|
+
i && /* @__PURE__ */ r(pt, {}),
|
|
99
|
+
/* @__PURE__ */ r($, { style: i ? { marginTop: "-40px" } : {}, children: /* @__PURE__ */ m(Q, { id: "questionContent", children: [
|
|
100
|
+
!i && /* @__PURE__ */ r(
|
|
101
|
+
Z,
|
|
100
102
|
{
|
|
101
|
-
feedbackMessages:
|
|
103
|
+
feedbackMessages: J,
|
|
102
104
|
questionVoted: !!t,
|
|
103
105
|
questionVotedCorrectly: t == null ? void 0 : t.correct,
|
|
104
106
|
questionType: n,
|
|
105
|
-
hasCorrectAnswer:
|
|
107
|
+
hasCorrectAnswer: a,
|
|
106
108
|
showExpiredNotification: d,
|
|
107
109
|
showClosedNotificationTrivia: N,
|
|
108
110
|
votedInCurrentRender: C,
|
|
109
|
-
votedAfterQuestionClosed:
|
|
111
|
+
votedAfterQuestionClosed: A,
|
|
110
112
|
enteredAnActiveQuestion: V,
|
|
111
113
|
marketClosed: T,
|
|
112
|
-
percentsAnimated:
|
|
113
|
-
voteErrorMessage:
|
|
114
|
+
percentsAnimated: R,
|
|
115
|
+
voteErrorMessage: y,
|
|
114
116
|
votedAnswer: t
|
|
115
117
|
}
|
|
116
118
|
),
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
b && /* @__PURE__ */ r(
|
|
120
|
+
qt,
|
|
119
121
|
{
|
|
120
|
-
title:
|
|
122
|
+
title: dt,
|
|
121
123
|
points: ut,
|
|
122
|
-
onTimerExpired:
|
|
124
|
+
onTimerExpired: mt,
|
|
123
125
|
questionType: e.type,
|
|
124
|
-
isTimer: !
|
|
126
|
+
isTimer: !f,
|
|
125
127
|
isPlayingTimer: !t,
|
|
126
|
-
animatePoints:
|
|
127
|
-
timerDuration:
|
|
128
|
+
animatePoints: Tt,
|
|
129
|
+
timerDuration: gt ? 0 : Number(((U = e == null ? void 0 : e.appearance) == null ? void 0 : U.autoHideInterval) || "30"),
|
|
128
130
|
votedInCurrentRender: C,
|
|
129
|
-
percentsAnimated:
|
|
131
|
+
percentsAnimated: R
|
|
130
132
|
}
|
|
131
133
|
),
|
|
132
|
-
!
|
|
133
|
-
|
|
134
|
+
!i && (u || H) ? /* @__PURE__ */ r(vt, { children: /* @__PURE__ */ r(
|
|
135
|
+
Ct,
|
|
134
136
|
{
|
|
135
137
|
icon: "icon-check-circle",
|
|
136
138
|
title: "More to come...",
|
|
137
|
-
description:
|
|
139
|
+
description: H ? /* @__PURE__ */ m(S, { children: [
|
|
138
140
|
"Stay tuned for more questions ",
|
|
139
141
|
/* @__PURE__ */ r("br", {}),
|
|
140
142
|
" and insights."
|
|
141
|
-
] }) : /* @__PURE__ */ m(
|
|
143
|
+
] }) : /* @__PURE__ */ m(S, { children: [
|
|
142
144
|
"Watch for additional enhanced stream ",
|
|
143
145
|
/* @__PURE__ */ r("br", {}),
|
|
144
146
|
" interactive experience."
|
|
145
147
|
] })
|
|
146
148
|
}
|
|
147
|
-
) }) : /* @__PURE__ */ m(
|
|
148
|
-
|
|
149
|
-
/* @__PURE__ */ r(
|
|
149
|
+
) }) : /* @__PURE__ */ m(S, { children: [
|
|
150
|
+
i && /* @__PURE__ */ m(wt, { children: [
|
|
151
|
+
/* @__PURE__ */ r(At, { name: "iconEarlyPrediction" }),
|
|
150
152
|
"EARLY PREDICTION"
|
|
151
153
|
] }),
|
|
152
|
-
/* @__PURE__ */ r(
|
|
153
|
-
|
|
154
|
-
|
|
154
|
+
/* @__PURE__ */ r(yt, { style: ht ? { marginTop: 0 } : {}, children: et }),
|
|
155
|
+
i && /* @__PURE__ */ r(
|
|
156
|
+
Z,
|
|
155
157
|
{
|
|
156
|
-
feedbackMessages:
|
|
158
|
+
feedbackMessages: J,
|
|
157
159
|
questionVoted: !!t,
|
|
158
160
|
questionVotedCorrectly: t == null ? void 0 : t.correct,
|
|
159
161
|
questionType: n,
|
|
160
|
-
hasCorrectAnswer:
|
|
162
|
+
hasCorrectAnswer: a,
|
|
161
163
|
showExpiredNotification: d,
|
|
162
164
|
showClosedNotificationTrivia: N,
|
|
163
165
|
votedInCurrentRender: C,
|
|
164
|
-
votedAfterQuestionClosed:
|
|
166
|
+
votedAfterQuestionClosed: A,
|
|
165
167
|
enteredAnActiveQuestion: V,
|
|
166
168
|
marketClosed: T,
|
|
167
|
-
percentsAnimated:
|
|
168
|
-
voteErrorMessage:
|
|
169
|
-
isEarlyPrediction:
|
|
169
|
+
percentsAnimated: R,
|
|
170
|
+
voteErrorMessage: y,
|
|
171
|
+
isEarlyPrediction: i,
|
|
170
172
|
correctAnswer: o,
|
|
171
|
-
votedAnswer: t
|
|
173
|
+
votedAnswer: t,
|
|
174
|
+
onAnimationEnd: lt
|
|
172
175
|
}
|
|
173
176
|
),
|
|
174
|
-
/* @__PURE__ */ m(
|
|
175
|
-
/* @__PURE__ */ r(
|
|
176
|
-
|
|
177
|
+
/* @__PURE__ */ m(Rt, { children: [
|
|
178
|
+
/* @__PURE__ */ r(tt, { children: k.map((s) => /* @__PURE__ */ r(
|
|
179
|
+
xt,
|
|
177
180
|
{
|
|
178
181
|
...s,
|
|
179
182
|
markThatVoted: ct,
|
|
180
|
-
onPercentsAnimated: () =>
|
|
181
|
-
votedAfterQuestionClosed:
|
|
183
|
+
onPercentsAnimated: () => _(!0),
|
|
184
|
+
votedAfterQuestionClosed: A,
|
|
182
185
|
enteredAnActiveQuestion: V,
|
|
183
186
|
marketClosed: T,
|
|
184
|
-
isEarlyPrediction:
|
|
187
|
+
isEarlyPrediction: i
|
|
185
188
|
},
|
|
186
189
|
s.id
|
|
187
190
|
)) }),
|
|
188
|
-
|
|
191
|
+
i && /* @__PURE__ */ m(S, { children: [
|
|
189
192
|
/* @__PURE__ */ r(Et, {}),
|
|
190
|
-
/* @__PURE__ */ r(
|
|
193
|
+
/* @__PURE__ */ r(Ot, { children: /* @__PURE__ */ r(St, { name: "mastersLogoWhite" }) })
|
|
191
194
|
] })
|
|
192
195
|
] })
|
|
193
196
|
] })
|
|
@@ -195,6 +198,6 @@ const qt = (e, u) => {
|
|
|
195
198
|
] });
|
|
196
199
|
};
|
|
197
200
|
export {
|
|
198
|
-
|
|
199
|
-
|
|
201
|
+
Ft as Vote,
|
|
202
|
+
Ht as VoteSkeleton
|
|
200
203
|
};
|
package/lib/ui/icons/index.d.ts
CHANGED