@streamlayer/react-ui 1.17.0 → 1.18.1
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/story/settings/login.js +18 -14
- package/lib/app/login/demo.d.ts +1 -4
- package/lib/app/login/demo.js +38 -24
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.d.ts +4 -0
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.js +10 -0
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/styles.d.ts +4 -0
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/styles.js +25 -0
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.d.ts +5 -0
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +18 -0
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/styles.d.ts +7 -0
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/styles.js +41 -0
- package/lib/app/masters/BetPack/BetPackContent/LoaderScreen/index.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/LoaderScreen/index.js +13 -0
- package/lib/app/masters/BetPack/BetPackContent/QuestionScreen/index.d.ts +6 -0
- package/lib/app/masters/BetPack/BetPackContent/QuestionScreen/index.js +7 -0
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.d.ts +4 -0
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +6 -0
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/styles.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/styles.js +9 -0
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.d.ts +5 -0
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +33 -0
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.d.ts +7 -0
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.js +41 -0
- package/lib/app/masters/BetPack/BetPackContent/constants.d.ts +13 -0
- package/lib/app/masters/BetPack/BetPackContent/constants.js +22 -0
- package/lib/app/masters/BetPack/BetPackContent/index.d.ts +11 -0
- package/lib/app/masters/BetPack/BetPackContent/index.js +116 -0
- package/lib/app/masters/BetPack/BetPackContent/styles.d.ts +3 -0
- package/lib/app/masters/BetPack/BetPackContent/styles.js +20 -0
- package/lib/app/masters/BetPack/BetPackOverlay/index.d.ts +12 -0
- package/lib/app/masters/BetPack/BetPackOverlay/index.js +9 -0
- package/lib/app/masters/BetPack/BetPackOverlay/styles.d.ts +10 -0
- package/lib/app/masters/BetPack/BetPackOverlay/styles.js +51 -0
- package/lib/app/masters/BetPack/index.d.ts +14 -0
- package/lib/app/masters/BetPack/index.js +84 -0
- package/lib/app/masters/BetPack/styles.d.ts +4 -0
- package/lib/app/masters/BetPack/styles.js +24 -0
- package/lib/app/masters/BetPack/typings.d.js +1 -0
- package/lib/app/masters/BetPack/utils.d.ts +19 -0
- package/lib/app/masters/BetPack/utils.js +10 -0
- package/lib/app/masters/masters.d.ts +0 -2
- package/lib/app/masters/masters.js +89 -85
- package/lib/app/masters/story/components.d.ts +11 -0
- package/lib/app/masters/story/components.js +151 -0
- package/lib/app/masters/story/index.d.ts +3 -0
- package/lib/app/masters/story/index.js +53 -0
- package/lib/assets/style.css +1 -1
- package/lib/ui/gamification/vote/feedback/index.d.ts +3 -1
- package/lib/ui/gamification/vote/feedback/index.js +52 -50
- package/lib/ui/gamification/vote/feedback/styles.d.ts +1 -0
- package/lib/ui/gamification/vote/feedback/styles.js +5 -0
- package/lib/ui/gamification/vote/index.d.ts +1 -0
- package/lib/ui/gamification/vote/index.js +150 -126
- package/lib/ui/gamification/vote/styles.d.ts +5 -0
- package/lib/ui/gamification/vote/styles.js +40 -14
- package/lib/ui/gamification/vote/vote-option/index.js +43 -40
- package/lib/ui/icons/index.d.ts +5 -0
- package/lib/ui/icons/index.js +87 -66
- package/lib/ui/loader/index.d.ts +4 -0
- package/lib/ui/loader/index.js +5 -0
- package/lib/ui/theme/masters-theme.js +4 -4
- package/lib/ui/theme/masters.js +3 -2
- package/lib/utils/decorators/container.js +11 -9
- package/package.json +22 -16
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import { useState as V, useLayoutEffect as W } from "react";
|
|
3
|
-
import { QuestionImages as a, QuestionType as o, QuestionStatus as
|
|
3
|
+
import { QuestionImages as a, QuestionType as o, QuestionStatus as N } from "@streamlayer/sdk-web-types";
|
|
4
4
|
import { AnimatedCounter as $ } from "../../../animated-counter/index.js";
|
|
5
5
|
import { IconDefault as y, IconContainer as F, IconWrap as M, IconCircle as z, ButtonContainer as G, ButtonPctWrap as H, ButtonPct as J, ButtonBody as K, Title as X, Pts as Y, Indicators as Z, CheckIcon as _, Percentage as q } from "./styles.js";
|
|
6
|
-
const
|
|
6
|
+
const h = {
|
|
7
7
|
[a.CENTERED]: (t) => /* @__PURE__ */ e(y, { "data-testid": "vote-icon", alt: "option-icon", src: t }),
|
|
8
8
|
[a.TRANSPARENT]: (t) => /* @__PURE__ */ e(F, { "data-testid": "vote-icon", children: /* @__PURE__ */ e(M, { style: { backgroundImage: `url(${t})` } }) }),
|
|
9
9
|
[a.ROUNDED]: (t) => /* @__PURE__ */ e(z, { "data-testid": "vote-icon", alt: "option-icon", src: t }),
|
|
10
10
|
[a.NONE]: () => null,
|
|
11
11
|
[a.UNSET]: () => null
|
|
12
|
-
}, tt = ({ questionType: t, hasCorrectAnswer:
|
|
12
|
+
}, tt = ({ questionType: t, hasCorrectAnswer: s, correct: n, youVoted: r, questionVoted: i }) => {
|
|
13
13
|
if (t === o.POLL && r)
|
|
14
14
|
return "voted";
|
|
15
15
|
if (t === o.PREDICTION) {
|
|
16
|
-
if (!
|
|
16
|
+
if (!s && i)
|
|
17
17
|
return r ? "voted" : "unset";
|
|
18
|
-
if (
|
|
18
|
+
if (s && i)
|
|
19
19
|
return r ? n ? "correct" : "incorrect" : "unset";
|
|
20
20
|
if (r)
|
|
21
21
|
return "correct";
|
|
@@ -23,74 +23,77 @@ const E = {
|
|
|
23
23
|
return t === o.TRIVIA && i && r ? n ? "correct" : "incorrect" : "unset";
|
|
24
24
|
}, et = ({
|
|
25
25
|
questionType: t,
|
|
26
|
-
questionVoted:
|
|
26
|
+
questionVoted: s,
|
|
27
27
|
correct: n,
|
|
28
28
|
hasCorrectAnswer: r,
|
|
29
29
|
questionStatus: i
|
|
30
|
-
}) => t === o.TRIVIA ?
|
|
31
|
-
var
|
|
30
|
+
}) => t === o.TRIVIA ? s && n : t === o.PREDICTION ? s && n && r || i === N.RESOLVED && n : !1, ct = (t) => {
|
|
31
|
+
var T;
|
|
32
32
|
const {
|
|
33
33
|
// option props
|
|
34
|
-
id:
|
|
34
|
+
id: s,
|
|
35
35
|
icon: n,
|
|
36
36
|
text: r,
|
|
37
37
|
percentageDecimal: i,
|
|
38
|
-
points:
|
|
38
|
+
points: S,
|
|
39
39
|
// extra props
|
|
40
|
-
onVote:
|
|
41
|
-
markThatVoted:
|
|
40
|
+
onVote: p,
|
|
41
|
+
markThatVoted: D,
|
|
42
42
|
onPercentsAnimated: f,
|
|
43
|
-
youSelected:
|
|
44
|
-
youVoted:
|
|
45
|
-
questionVoted:
|
|
43
|
+
youSelected: E,
|
|
44
|
+
youVoted: O,
|
|
45
|
+
questionVoted: c,
|
|
46
46
|
imageMode: C,
|
|
47
|
-
answerTimeExpired:
|
|
48
|
-
questionStatus:
|
|
49
|
-
isLoading:
|
|
47
|
+
answerTimeExpired: g,
|
|
48
|
+
questionStatus: v,
|
|
49
|
+
isLoading: k,
|
|
50
50
|
questionType: d,
|
|
51
|
-
correct:
|
|
52
|
-
hasCorrectAnswer:
|
|
53
|
-
votedAfterQuestionClosed:
|
|
54
|
-
enteredAnActiveQuestion:
|
|
51
|
+
correct: x,
|
|
52
|
+
hasCorrectAnswer: L,
|
|
53
|
+
votedAfterQuestionClosed: B,
|
|
54
|
+
enteredAnActiveQuestion: P,
|
|
55
55
|
marketClosed: I
|
|
56
|
-
} = t, [
|
|
56
|
+
} = t, [Q, R] = V(0), m = tt(t), b = et({ questionType: d, questionVoted: c, correct: x, hasCorrectAnswer: L, questionStatus: v }), u = I && d === o.PREDICTION, w = c || u, j = d === o.PREDICTION && !c && !I, A = c && !E && m !== "incorrect" && !O;
|
|
57
57
|
return W(() => {
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
R(0), requestAnimationFrame(() => {
|
|
59
|
+
R(i);
|
|
60
60
|
});
|
|
61
61
|
}, [i]), /* @__PURE__ */ l(
|
|
62
62
|
G,
|
|
63
63
|
{
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
id: "voteAnswerContainer",
|
|
65
|
+
value: s,
|
|
66
|
+
"data-selected": E,
|
|
66
67
|
"data-answer-state": m,
|
|
67
|
-
disabled:
|
|
68
|
-
"data-is-not-checked":
|
|
68
|
+
disabled: c || k || g || u && !P || u && P && B,
|
|
69
|
+
"data-is-not-checked": A,
|
|
69
70
|
onClick: (U) => {
|
|
70
|
-
|
|
71
|
-
d === o.PREDICTION ? I :
|
|
72
|
-
),
|
|
71
|
+
D(
|
|
72
|
+
d === o.PREDICTION ? I : v === N.RESOLVED
|
|
73
|
+
), p(U);
|
|
73
74
|
},
|
|
74
75
|
children: [
|
|
75
76
|
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
|
|
76
77
|
J,
|
|
77
78
|
{
|
|
79
|
+
id: "voteAnswerRct",
|
|
78
80
|
"data-answer-state": m,
|
|
79
|
-
|
|
81
|
+
"data-is-not-checked": A,
|
|
82
|
+
style: { width: `${w ? Q : 0}%` },
|
|
80
83
|
onTransitionEnd: () => {
|
|
81
84
|
u || f == null || f();
|
|
82
85
|
}
|
|
83
86
|
}
|
|
84
87
|
) }),
|
|
85
|
-
/* @__PURE__ */ l(K, { children: [
|
|
86
|
-
n && C && ((
|
|
88
|
+
/* @__PURE__ */ l(K, { id: "voteAnswer", children: [
|
|
89
|
+
n && C && ((T = h[C]) == null ? void 0 : T.call(h, n)),
|
|
87
90
|
/* @__PURE__ */ e(X, { children: r }),
|
|
88
|
-
|
|
89
|
-
|
|
91
|
+
j && /* @__PURE__ */ l("div", { children: [
|
|
92
|
+
S,
|
|
90
93
|
/* @__PURE__ */ e(Y, { children: "pts" })
|
|
91
94
|
] }),
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
w && /* @__PURE__ */ l(Z, { id: "voteAnswerIndicators", children: [
|
|
96
|
+
b && /* @__PURE__ */ e(_, { name: "selected" }),
|
|
94
97
|
/* @__PURE__ */ e(q, { children: /* @__PURE__ */ e($, { value: i, suffix: "%" }) })
|
|
95
98
|
] })
|
|
96
99
|
] })
|
|
@@ -99,5 +102,5 @@ const E = {
|
|
|
99
102
|
);
|
|
100
103
|
};
|
|
101
104
|
export {
|
|
102
|
-
|
|
105
|
+
ct as VotingOption
|
|
103
106
|
};
|
package/lib/ui/icons/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export declare const icons: {
|
|
|
38
38
|
'icon-btn-leaderboard': any;
|
|
39
39
|
'icon-arrow': any;
|
|
40
40
|
'icon-twitter-verified': any;
|
|
41
|
+
'icon-trophy-bet-pack': any;
|
|
41
42
|
dashboard: any;
|
|
42
43
|
correct: any;
|
|
43
44
|
incorrect: any;
|
|
@@ -52,6 +53,10 @@ export declare const icons: {
|
|
|
52
53
|
iconCopySuccess: any;
|
|
53
54
|
chevronRight: any;
|
|
54
55
|
noImageIcon: any;
|
|
56
|
+
iconArrowRight: any;
|
|
57
|
+
iconEarlyPrediction: any;
|
|
58
|
+
iconArrowPrev: any;
|
|
59
|
+
mastersLogoWhite: any;
|
|
55
60
|
};
|
|
56
61
|
export declare const IconsLibrary: () => import("react/jsx-runtime").JSX.Element;
|
|
57
62
|
type SvgIconProps = {
|