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