@streamlayer/react-ui 1.11.3 → 1.12.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.d.ts +1 -0
- package/lib/app/app/Advertisement/index.js +86 -67
- package/lib/app/app/Features/Gamification/Tabs.js +13 -13
- package/lib/app/app/Navigation/index.js +70 -64
- package/lib/app/app/Notifications/Onboarding/index.js +66 -72
- package/lib/app/app/Notifications/index.d.ts +1 -0
- package/lib/app/app/Notifications/index.js +76 -72
- package/lib/app/app/index.js +28 -27
- package/lib/app/app/story/index.d.ts +3 -1
- package/lib/app/app/story/index.js +29 -26
- package/lib/app/app/story/promotion/video.js +34 -34
- package/lib/app/app/styles.d.ts +5 -0
- package/lib/app/app/styles.js +25 -20
- package/lib/assets/style.css +1 -1
- package/lib/ui/advertisement/index.d.ts +3 -0
- package/lib/ui/advertisement/index.js +25 -19
- package/lib/ui/advertisement/mock.d.ts +1 -0
- package/lib/ui/advertisement/mock.js +39 -5
- package/lib/ui/advertisement/overlay/externalAd/controls.d.ts +5 -0
- package/lib/ui/advertisement/overlay/externalAd/controls.js +33 -0
- package/lib/ui/advertisement/overlay/externalAd/index.d.ts +2 -0
- package/lib/ui/advertisement/overlay/externalAd/index.js +121 -0
- package/lib/ui/advertisement/overlay/index.d.ts +7 -2
- package/lib/ui/advertisement/overlay/index.js +67 -58
- package/lib/ui/close-btn/index.d.ts +1 -0
- package/lib/ui/close-btn/index.js +25 -23
- package/lib/ui/gamification/question/insight/styles.d.ts +10 -2
- package/lib/ui/gamification/question/insight/styles.js +8 -7
- package/lib/ui/gamification/question/notification/prediction-result/index.js +84 -64
- package/lib/ui/gamification/question/notification/prediction-result/styles.d.ts +2 -0
- package/lib/ui/gamification/question/notification/prediction-result/styles.js +36 -26
- package/lib/ui/gamification/question/twitter/styles.d.ts +5 -1
- package/lib/ui/gamification/question/twitter/styles.js +9 -8
- package/lib/ui/gamification/vote/alert/index.js +7 -8
- package/lib/ui/gamification/vote/alert/styles.d.ts +1 -0
- package/lib/ui/gamification/vote/alert/styles.js +12 -6
- package/lib/ui/gamification/vote/vote-option/index.js +59 -58
- package/lib/ui/icons/index.d.ts +1 -0
- package/lib/ui/icons/index.js +45 -44
- package/lib/ui/skeleton/index.d.ts +1 -1
- package/lib/ui/theme/constants.d.ts +32 -1
- package/lib/ui/theme/constants.js +50 -17
- package/lib/ui/theme/masters-theme.js +9 -4
- package/lib/ui/theme/theme.js +16 -9
- package/lib/ui/video-player/index.d.ts +2 -0
- package/lib/ui/video-player/index.js +57 -56
- package/package.json +14 -14
|
@@ -1,94 +1,95 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { QuestionImages as a, QuestionType as
|
|
1
|
+
import { jsx as e, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { useState as y, useLayoutEffect as U } from "react";
|
|
3
|
+
import { QuestionImages as a, QuestionType as i, QuestionStatus as D } from "@streamlayer/sdk-web-types";
|
|
4
4
|
import { AnimatedCounter as W } from "../../../animated-counter/index.js";
|
|
5
|
-
import { IconDefault as $, IconContainer as
|
|
6
|
-
const
|
|
5
|
+
import { IconDefault as $, 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 E = {
|
|
7
7
|
[a.CENTERED]: (t) => /* @__PURE__ */ e($, { "data-testid": "vote-icon", alt: "option-icon", src: t }),
|
|
8
|
-
[a.TRANSPARENT]: (t) => /* @__PURE__ */ e(
|
|
9
|
-
[a.ROUNDED]: (t) => /* @__PURE__ */ e(
|
|
8
|
+
[a.TRANSPARENT]: (t) => /* @__PURE__ */ e(F, { "data-testid": "vote-icon", children: /* @__PURE__ */ e(M, { style: { backgroundImage: `url(${t})` } }) }),
|
|
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
|
-
},
|
|
13
|
-
if (t ===
|
|
14
|
-
return "
|
|
15
|
-
if (t ===
|
|
16
|
-
if (c &&
|
|
17
|
-
return
|
|
18
|
-
if (
|
|
12
|
+
}, tt = ({ questionType: t, hasCorrectAnswer: c, correct: n, youVoted: o, questionVoted: r }) => {
|
|
13
|
+
if (t === i.POLL && o)
|
|
14
|
+
return "voted";
|
|
15
|
+
if (t === i.PREDICTION) {
|
|
16
|
+
if (c && r)
|
|
17
|
+
return o ? n ? "correct" : "incorrect" : "unset";
|
|
18
|
+
if (o)
|
|
19
19
|
return "correct";
|
|
20
20
|
}
|
|
21
|
-
return t ===
|
|
22
|
-
},
|
|
21
|
+
return t === i.TRIVIA && r && o ? n ? "correct" : "incorrect" : "unset";
|
|
22
|
+
}, et = ({
|
|
23
23
|
questionType: t,
|
|
24
24
|
questionVoted: c,
|
|
25
25
|
correct: n,
|
|
26
|
-
hasCorrectAnswer:
|
|
27
|
-
questionStatus:
|
|
28
|
-
}) => t ===
|
|
29
|
-
var
|
|
26
|
+
hasCorrectAnswer: o,
|
|
27
|
+
questionStatus: r
|
|
28
|
+
}) => t === i.TRIVIA ? c && n : t === i.PREDICTION ? c && n && o || r === D.RESOLVED && n : !1, st = (t) => {
|
|
29
|
+
var p;
|
|
30
30
|
const {
|
|
31
31
|
// option props
|
|
32
32
|
id: c,
|
|
33
33
|
icon: n,
|
|
34
|
-
text:
|
|
35
|
-
percentageDecimal:
|
|
36
|
-
points:
|
|
34
|
+
text: o,
|
|
35
|
+
percentageDecimal: r,
|
|
36
|
+
points: g,
|
|
37
37
|
// extra props
|
|
38
38
|
onVote: w,
|
|
39
39
|
markThatVoted: A,
|
|
40
|
-
onPercentsAnimated:
|
|
41
|
-
youSelected:
|
|
40
|
+
onPercentsAnimated: I,
|
|
41
|
+
youSelected: m,
|
|
42
|
+
youVoted: O,
|
|
42
43
|
questionVoted: s,
|
|
43
44
|
imageMode: C,
|
|
44
|
-
answerTimeExpired:
|
|
45
|
+
answerTimeExpired: v,
|
|
45
46
|
questionStatus: P,
|
|
46
|
-
isLoading:
|
|
47
|
+
isLoading: k,
|
|
47
48
|
questionType: d,
|
|
48
|
-
correct:
|
|
49
|
-
hasCorrectAnswer:
|
|
50
|
-
votedAfterQuestionClosed:
|
|
49
|
+
correct: x,
|
|
50
|
+
hasCorrectAnswer: L,
|
|
51
|
+
votedAfterQuestionClosed: B,
|
|
51
52
|
enteredAnActiveQuestion: R,
|
|
52
|
-
marketClosed:
|
|
53
|
-
} = t, [
|
|
54
|
-
return U(() => {
|
|
53
|
+
marketClosed: h
|
|
54
|
+
} = t, [Q, T] = y(0), l = tt(t), V = et({ questionType: d, questionVoted: s, correct: x, hasCorrectAnswer: L, questionStatus: P }), u = h && d === i.PREDICTION, N = s || u, b = d === i.PREDICTION && !s && !h, S = s && !m && l !== "incorrect" && !O;
|
|
55
|
+
return console.log({ isNotChecked: S, questionVoted: s, youSelected: m, answerState: l }), U(() => {
|
|
55
56
|
T(0), requestAnimationFrame(() => {
|
|
56
|
-
T(
|
|
57
|
+
T(r);
|
|
57
58
|
});
|
|
58
|
-
}, [
|
|
59
|
-
|
|
59
|
+
}, [r]), /* @__PURE__ */ f(
|
|
60
|
+
G,
|
|
60
61
|
{
|
|
61
62
|
value: c,
|
|
62
|
-
"data-selected":
|
|
63
|
-
"data-answer-state":
|
|
64
|
-
disabled: s ||
|
|
65
|
-
"data-is-not-checked":
|
|
66
|
-
onClick: (
|
|
63
|
+
"data-selected": m,
|
|
64
|
+
"data-answer-state": l,
|
|
65
|
+
disabled: s || k || v || u && !R || u && R && B,
|
|
66
|
+
"data-is-not-checked": S,
|
|
67
|
+
onClick: (j) => {
|
|
67
68
|
A(
|
|
68
|
-
d ===
|
|
69
|
-
), w(
|
|
69
|
+
d === i.PREDICTION ? h : P === D.RESOLVED
|
|
70
|
+
), w(j);
|
|
70
71
|
},
|
|
71
72
|
children: [
|
|
72
|
-
/* @__PURE__ */ e(
|
|
73
|
-
|
|
73
|
+
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
|
|
74
|
+
J,
|
|
74
75
|
{
|
|
75
|
-
"data-answer-state":
|
|
76
|
-
style: { width: `${N ?
|
|
76
|
+
"data-answer-state": l,
|
|
77
|
+
style: { width: `${N ? Q : 0}%` },
|
|
77
78
|
onTransitionEnd: () => {
|
|
78
|
-
u ||
|
|
79
|
+
u || I == null || I();
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
) }),
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
n && C && ((
|
|
84
|
-
/* @__PURE__ */ e(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
/* @__PURE__ */ e(
|
|
83
|
+
/* @__PURE__ */ f(K, { children: [
|
|
84
|
+
n && C && ((p = E[C]) == null ? void 0 : p.call(E, n)),
|
|
85
|
+
/* @__PURE__ */ e(X, { children: o }),
|
|
86
|
+
b && /* @__PURE__ */ f("div", { children: [
|
|
87
|
+
g,
|
|
88
|
+
/* @__PURE__ */ e(Y, { children: "pts" })
|
|
88
89
|
] }),
|
|
89
|
-
N && /* @__PURE__ */
|
|
90
|
-
|
|
91
|
-
/* @__PURE__ */ e(
|
|
90
|
+
N && /* @__PURE__ */ f(Z, { children: [
|
|
91
|
+
V && /* @__PURE__ */ e(_, { name: "selected" }),
|
|
92
|
+
/* @__PURE__ */ e(q, { children: /* @__PURE__ */ e(W, { value: r, suffix: "%" }) })
|
|
92
93
|
] })
|
|
93
94
|
] })
|
|
94
95
|
]
|
|
@@ -96,5 +97,5 @@ const h = {
|
|
|
96
97
|
);
|
|
97
98
|
};
|
|
98
99
|
export {
|
|
99
|
-
|
|
100
|
+
st as VotingOption
|
|
100
101
|
};
|