@streamlayer/react-ui 1.19.1 → 1.21.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/app/Advertisement/index.js +74 -72
- package/lib/app/app/Points/index.js +21 -14
- package/lib/app/app/index.js +79 -89
- package/lib/app/app/useApp.d.ts +2 -1
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.d.ts +2 -0
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.js +11 -10
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +22 -18
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +7 -7
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.d.ts +2 -1
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.js +31 -22
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +11 -11
- package/lib/app/masters/BetPack/BetPackContent/index.js +61 -49
- package/lib/app/masters/BetPack/BetPackOverlay/index.d.ts +1 -1
- package/lib/app/masters/BetPack/BetPackOverlay/index.js +3 -2
- package/lib/app/masters/BetPack/index.js +80 -75
- package/lib/app/masters/Features/Gamification/index.d.ts +0 -2
- package/lib/app/masters/Features/Gamification/index.js +29 -34
- package/lib/app/masters/Features/index.d.ts +0 -2
- package/lib/app/masters/Features/index.js +4 -12
- 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/Points/index.js +24 -18
- package/lib/app/masters/masters.js +70 -92
- package/lib/app/masters/useOrientation.d.ts +3 -0
- package/lib/app/masters/useOrientation.js +12 -0
- package/lib/app/masters/useSdkResponsive.d.ts +2 -0
- package/lib/app/masters/useSdkResponsive.js +3 -1
- package/lib/app/masters/useSdkScroll.js +1 -1
- package/lib/app/useSdkResponsive.js +1 -1
- package/lib/app/useSdkScroll.js +1 -1
- package/lib/assets/style.css +1 -1
- package/lib/hooks/analytics.js +17 -42
- package/lib/index-CLJzLXks.js +64 -0
- package/lib/reset.css +1 -1
- package/lib/ui/advertisement/notification/index.js +8 -8
- package/lib/ui/advertisement/overlay/externalAd/index.js +40310 -114
- package/lib/ui/advertisement/overlay/externalAd/styles.d.ts +8 -0
- package/lib/ui/advertisement/overlay/externalAd/styles.js +39 -0
- package/lib/ui/close-btn/index.d.ts +2 -0
- package/lib/ui/close-btn/index.js +40 -32
- package/lib/ui/gamification/question/inapp/prediction-result/frames/content.js +48 -33
- package/lib/ui/gamification/vote/feedback/index.js +30 -30
- package/lib/ui/gamification/vote/index.js +43 -43
- package/lib/ui/gamification/vote/vote-option/index.js +51 -53
- package/lib/ui/icons/index.d.ts +3 -0
- package/lib/ui/icons/index.js +75 -54
- package/lib/ui/modal/index.js +36 -32
- package/lib/ui/show-in/index.js +26 -26
- package/lib/ui/theme/masters-theme.js +12 -4
- package/lib/ui/theme/theme.js +9 -5
- package/package.json +22 -16
- package/lib/index-BEm7B1u1.js +0 -72
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { QuestionImages as a, QuestionType as o, QuestionStatus as
|
|
4
|
-
import { AnimatedCounter as
|
|
5
|
-
import { IconDefault as
|
|
1
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as j, useLayoutEffect as y } 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 V, IconContainer as $, IconWrap as F, IconCircle as M, ButtonContainer as z, ButtonPctWrap as G, ButtonPct as H, ButtonBody as J, Title as K, PtsWrap as X, Pts as Y, Indicators as Z, CheckIcon as _, Percentage as q } from "./styles.js";
|
|
6
6
|
const E = {
|
|
7
|
-
[a.CENTERED]: (t) => /* @__PURE__ */ e(
|
|
8
|
-
[a.TRANSPARENT]: (t) => /* @__PURE__ */ e(
|
|
9
|
-
[a.ROUNDED]: (t) => /* @__PURE__ */ e(
|
|
7
|
+
[a.CENTERED]: (t) => /* @__PURE__ */ e(V, { "data-testid": "vote-icon", alt: "option-icon", src: t }),
|
|
8
|
+
[a.TRANSPARENT]: (t) => /* @__PURE__ */ e($, { "data-testid": "vote-icon", children: /* @__PURE__ */ e(F, { style: { backgroundImage: `url(${t})` } }) }),
|
|
9
|
+
[a.ROUNDED]: (t) => /* @__PURE__ */ e(M, { "data-testid": "vote-icon", alt: "option-icon", src: t }),
|
|
10
10
|
[a.NONE]: () => null,
|
|
11
11
|
[a.UNSET]: () => null
|
|
12
|
-
},
|
|
12
|
+
}, tt = ({ questionType: t, hasCorrectAnswer: c, correct: n, youVoted: r, questionVoted: i }) => {
|
|
13
13
|
if (t === o.POLL && r)
|
|
14
14
|
return "voted";
|
|
15
15
|
if (t === o.PREDICTION) {
|
|
@@ -21,79 +21,77 @@ const E = {
|
|
|
21
21
|
return "correct";
|
|
22
22
|
}
|
|
23
23
|
return t === o.TRIVIA && i && r ? n ? "correct" : "incorrect" : "unset";
|
|
24
|
-
},
|
|
24
|
+
}, et = ({
|
|
25
25
|
questionType: t,
|
|
26
26
|
questionVoted: c,
|
|
27
27
|
correct: n,
|
|
28
28
|
hasCorrectAnswer: r,
|
|
29
29
|
questionStatus: i
|
|
30
|
-
}) => t === o.TRIVIA ? c && n : t === o.PREDICTION ? c && n && r || i ===
|
|
31
|
-
var
|
|
30
|
+
}) => t === o.TRIVIA ? c && n : t === o.PREDICTION ? c && n && r || i === S.RESOLVED && n : !1, st = (t) => {
|
|
31
|
+
var N;
|
|
32
32
|
const {
|
|
33
33
|
// option props
|
|
34
34
|
id: c,
|
|
35
35
|
icon: n,
|
|
36
36
|
text: r,
|
|
37
37
|
percentageDecimal: i,
|
|
38
|
-
points:
|
|
38
|
+
points: D,
|
|
39
39
|
// extra props
|
|
40
|
-
onVote:
|
|
41
|
-
markThatVoted:
|
|
42
|
-
onPercentsAnimated:
|
|
40
|
+
onVote: O,
|
|
41
|
+
markThatVoted: g,
|
|
42
|
+
onPercentsAnimated: u,
|
|
43
43
|
youSelected: h,
|
|
44
44
|
youVoted: w,
|
|
45
45
|
questionVoted: s,
|
|
46
46
|
imageMode: P,
|
|
47
|
-
answerTimeExpired:
|
|
47
|
+
answerTimeExpired: k,
|
|
48
48
|
questionStatus: C,
|
|
49
|
-
isLoading:
|
|
49
|
+
isLoading: v,
|
|
50
50
|
questionType: d,
|
|
51
|
-
correct:
|
|
52
|
-
hasCorrectAnswer:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
T(0), requestAnimationFrame(() => {
|
|
60
|
-
T(i);
|
|
51
|
+
correct: A,
|
|
52
|
+
hasCorrectAnswer: x,
|
|
53
|
+
marketClosed: f,
|
|
54
|
+
isEarlyPrediction: B
|
|
55
|
+
} = t, [L, R] = j(0), I = tt(t), Q = et({ questionType: d, questionVoted: s, correct: A, hasCorrectAnswer: x, questionStatus: C }), m = f && d === o.PREDICTION, T = s || m, W = d === o.PREDICTION && !s && !f, p = s && !h && I !== "incorrect" && !w;
|
|
56
|
+
return y(() => {
|
|
57
|
+
R(0), requestAnimationFrame(() => {
|
|
58
|
+
R(i);
|
|
61
59
|
});
|
|
62
|
-
}, [i]), /* @__PURE__ */
|
|
63
|
-
|
|
60
|
+
}, [i]), /* @__PURE__ */ l(
|
|
61
|
+
z,
|
|
64
62
|
{
|
|
65
63
|
value: c,
|
|
66
64
|
"data-selected": h,
|
|
67
|
-
"data-answer-state":
|
|
68
|
-
disabled: s ||
|
|
69
|
-
"data-is-not-checked":
|
|
70
|
-
onClick: (
|
|
71
|
-
|
|
72
|
-
d === o.PREDICTION ?
|
|
73
|
-
),
|
|
65
|
+
"data-answer-state": I,
|
|
66
|
+
disabled: s || v || k || m,
|
|
67
|
+
"data-is-not-checked": p,
|
|
68
|
+
onClick: (b) => {
|
|
69
|
+
g(
|
|
70
|
+
d === o.PREDICTION ? f : C === S.RESOLVED
|
|
71
|
+
), O(b);
|
|
74
72
|
},
|
|
75
73
|
children: [
|
|
76
|
-
/* @__PURE__ */ e(
|
|
77
|
-
|
|
74
|
+
/* @__PURE__ */ e(G, { children: /* @__PURE__ */ e(
|
|
75
|
+
H,
|
|
78
76
|
{
|
|
79
|
-
"data-answer-state":
|
|
80
|
-
"data-is-not-checked":
|
|
81
|
-
style: { width: `${
|
|
77
|
+
"data-answer-state": I,
|
|
78
|
+
"data-is-not-checked": p,
|
|
79
|
+
style: { width: `${T ? L : 0}%` },
|
|
82
80
|
onTransitionEnd: () => {
|
|
83
|
-
|
|
81
|
+
m || u == null || u();
|
|
84
82
|
}
|
|
85
83
|
}
|
|
86
84
|
) }),
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
n && P && ((
|
|
89
|
-
/* @__PURE__ */ e(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
/* @__PURE__ */ e(
|
|
85
|
+
/* @__PURE__ */ l(J, { children: [
|
|
86
|
+
n && P && ((N = E[P]) == null ? void 0 : N.call(E, n)),
|
|
87
|
+
/* @__PURE__ */ e(K, { children: r }),
|
|
88
|
+
W && /* @__PURE__ */ l(X, { children: [
|
|
89
|
+
D,
|
|
90
|
+
/* @__PURE__ */ e(Y, { children: "pts" })
|
|
93
91
|
] }),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
/* @__PURE__ */ e(
|
|
92
|
+
T && /* @__PURE__ */ l(Z, { children: [
|
|
93
|
+
Q && /* @__PURE__ */ e(_, { name: B ? "selectedBetPack" : "selected" }),
|
|
94
|
+
/* @__PURE__ */ e(q, { children: /* @__PURE__ */ e(U, { value: i, suffix: "%" }) })
|
|
97
95
|
] })
|
|
98
96
|
] })
|
|
99
97
|
]
|
|
@@ -101,5 +99,5 @@ const E = {
|
|
|
101
99
|
);
|
|
102
100
|
};
|
|
103
101
|
export {
|
|
104
|
-
|
|
102
|
+
st as VotingOption
|
|
105
103
|
};
|
package/lib/ui/icons/index.d.ts
CHANGED