@streamlayer/react-ui 0.96.1 → 0.96.3
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/assets/style.css +1 -1
- package/lib/ui/app/Features/FeatureProvider.d.ts +1 -0
- package/lib/ui/app/Features/FeatureProvider.js +34 -6
- package/lib/ui/app/Features/Gamification/Friends.js +24 -21
- package/lib/ui/app/Features/Gamification/gamification-feature.js +1 -1
- package/lib/ui/app/Features/Gamification/index.d.ts +10 -0
- package/lib/ui/app/Features/Gamification/index.js +68 -67
- package/lib/ui/app/Features/index.d.ts +8 -0
- package/lib/ui/app/Features/index.js +112 -19
- package/lib/ui/app/Navigation/MastersNavigation/index.js +5 -4
- package/lib/ui/app/Navigation/index.js +7 -6
- package/lib/ui/app/masters.js +153 -83
- package/lib/ui/app/useMastersApp.js +3 -2
- package/lib/ui/gamification/question/list/index.js +45 -32
- package/lib/ui/gamification/question/notification/index.js +19 -22
- package/lib/ui/gamification/question/twitter/index.js +3 -3
- package/lib/ui/gamification/vote/feedback/index.js +29 -26
- package/lib/ui/gamification/vote/feedback/styles.d.ts +1 -0
- package/lib/ui/gamification/vote/feedback/styles.js +9 -4
- package/lib/ui/gamification/vote/index.js +52 -45
- package/lib/ui/icons/index.js +90 -25
- package/lib/ui/navigation/button/Channels.js +6 -5
- package/lib/ui/navigation/button/FeaturedGroups.js +4 -3
- package/lib/ui/navigation/button/LeaderBoard.js +6 -5
- package/lib/ui/navigation/button/index.js +20 -7
- package/lib/ui/navigation/button/styles.d.ts +3 -0
- package/lib/ui/navigation/button/styles.js +9 -6
- package/lib/ui/questions/insight/index.js +15 -16
- package/lib/ui/video-player/index.d.ts +1 -0
- package/lib/ui/video-player/index.js +44 -37
- package/lib/utils/createDemo.js +6 -1
- package/package.json +14 -14
|
@@ -22,21 +22,26 @@ const r = /* @__PURE__ */ s("div")({
|
|
|
22
22
|
name: "FeedbackTitle",
|
|
23
23
|
class: "f1913njx",
|
|
24
24
|
propsAsIs: !1
|
|
25
|
-
}),
|
|
25
|
+
}), m = /* @__PURE__ */ s("span")({
|
|
26
26
|
name: "FeedbackDescription",
|
|
27
27
|
class: "fzfk69z",
|
|
28
28
|
propsAsIs: !1
|
|
29
|
-
}),
|
|
29
|
+
}), f = /* @__PURE__ */ s("div")({
|
|
30
30
|
name: "FeedbackText",
|
|
31
31
|
class: "fx87qaj",
|
|
32
32
|
propsAsIs: !1
|
|
33
|
+
}), I = /* @__PURE__ */ s("span")({
|
|
34
|
+
name: "DynamicWrap",
|
|
35
|
+
class: "dvek9ew",
|
|
36
|
+
propsAsIs: !1
|
|
33
37
|
});
|
|
34
38
|
export {
|
|
35
39
|
r as Container,
|
|
36
|
-
|
|
40
|
+
I as DynamicWrap,
|
|
41
|
+
m as FeedbackDescription,
|
|
37
42
|
d as FeedbackHeader,
|
|
38
43
|
i as FeedbackIconWrap,
|
|
39
|
-
|
|
44
|
+
f as FeedbackText,
|
|
40
45
|
l as FeedbackTitle,
|
|
41
46
|
t as IconPrediction
|
|
42
47
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as n, jsxs as k, Fragment as
|
|
2
|
-
import { useState as I, useEffect as
|
|
3
|
-
import { QuestionType as
|
|
1
|
+
import { jsx as n, jsxs as k, Fragment as K } from "react/jsx-runtime";
|
|
2
|
+
import { useState as I, useEffect as A, useCallback as O, useMemo as f } from "react";
|
|
3
|
+
import { QuestionType as s, QuestionStatus as V } from "@streamlayer/sdk-web-types";
|
|
4
4
|
import { ExpiredAlert as U } from "./expired-alert/index.js";
|
|
5
5
|
import { Feedback as X } from "./feedback/index.js";
|
|
6
6
|
import { QuestionScrollContainer as Z, Container as _, Content as $, Title as Q, Options as tt } from "./styles.js";
|
|
@@ -18,41 +18,48 @@ import "../../timer/index.js";
|
|
|
18
18
|
import "react-countdown-circle-timer";
|
|
19
19
|
import "../../theme/constants.js";
|
|
20
20
|
import "./win-bar/styles.js";
|
|
21
|
-
const
|
|
22
|
-
var
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
a ===
|
|
21
|
+
const Ot = ({ openedQuestion: t, isLoading: C, vote: v, close: d }) => {
|
|
22
|
+
var S, g;
|
|
23
|
+
const b = t.subject, a = t.type, m = t.status, E = (S = t.options) == null ? void 0 : S.options, y = t.marketClosed, [R, L] = I(!1), [h, M] = I(!1), [T, w] = I(!0), [c, j] = I(!1), [x, D] = I(""), p = t == null ? void 0 : t.id;
|
|
24
|
+
A(() => {
|
|
25
|
+
a === s.PREDICTION ? y && w(!1) : m === V.RESOLVED && w(!1);
|
|
26
26
|
}, []);
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
}, []), q =
|
|
27
|
+
const B = O((e) => {
|
|
28
|
+
M(e), L(!0);
|
|
29
|
+
}, []), q = O(
|
|
30
30
|
async (e) => {
|
|
31
|
-
if (
|
|
31
|
+
if (p) {
|
|
32
32
|
const u = e.currentTarget.value;
|
|
33
|
-
D(u), await p
|
|
33
|
+
D(u), await v(p, u);
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
[
|
|
37
|
-
),
|
|
38
|
-
|
|
39
|
-
}, [
|
|
36
|
+
[p, D, v]
|
|
37
|
+
), W = O(() => {
|
|
38
|
+
j(!0), setTimeout(d, 3e3);
|
|
39
|
+
}, [d]), r = f(
|
|
40
40
|
() => t == null ? void 0 : t.answers.find((e) => e.youVoted === !0),
|
|
41
41
|
[t]
|
|
42
|
-
),
|
|
42
|
+
), o = f(
|
|
43
43
|
() => !!(t != null && t.answers.find((e) => e.correct === !0)),
|
|
44
44
|
[t]
|
|
45
45
|
), i = f(
|
|
46
46
|
() => t == null ? void 0 : t.answers.find((e) => e.correct === !0),
|
|
47
47
|
[t]
|
|
48
|
-
)
|
|
48
|
+
);
|
|
49
|
+
A(() => {
|
|
50
|
+
let e;
|
|
51
|
+
return a === s.PREDICTION && r && R && (e = setTimeout(d, 1e4)), () => {
|
|
52
|
+
clearTimeout(e);
|
|
53
|
+
};
|
|
54
|
+
}, [r]);
|
|
55
|
+
const F = f(() => t ? t.answers.map((e) => {
|
|
49
56
|
var u;
|
|
50
57
|
return {
|
|
51
58
|
...e,
|
|
52
59
|
questionVoted: !!r,
|
|
53
60
|
youSelected: x === e.id,
|
|
54
61
|
isLoading: C,
|
|
55
|
-
hasCorrectAnswer:
|
|
62
|
+
hasCorrectAnswer: o,
|
|
56
63
|
questionType: t.type,
|
|
57
64
|
answerTimeExpired: c,
|
|
58
65
|
questionStatus: m,
|
|
@@ -60,7 +67,7 @@ const vt = ({ openedQuestion: t, isLoading: C, vote: p, close: v }) => {
|
|
|
60
67
|
onVote: q
|
|
61
68
|
};
|
|
62
69
|
}) : [], [
|
|
63
|
-
|
|
70
|
+
o,
|
|
64
71
|
c,
|
|
65
72
|
C,
|
|
66
73
|
t,
|
|
@@ -68,11 +75,11 @@ const vt = ({ openedQuestion: t, isLoading: C, vote: p, close: v }) => {
|
|
|
68
75
|
m,
|
|
69
76
|
q,
|
|
70
77
|
x
|
|
71
|
-
]),
|
|
72
|
-
if (a ===
|
|
78
|
+
]), Y = E && (E.case === "trivia" || E.case === "prediction") ? E.value : void 0, l = m === V.RESOLVED && a === s.TRIVIA && !r && !T, N = a === s.TRIVIA && h && R && T, P = f(() => a === s.PREDICTION ? !!(r && !o || r && o && (i != null && i.youVoted)) : !0, [a, r, o, i]), H = f(() => {
|
|
79
|
+
if (a === s.PREDICTION && r && (!o || o && (i != null && i.youVoted)))
|
|
73
80
|
return r.points;
|
|
74
81
|
if (!(l || c))
|
|
75
|
-
return m ===
|
|
82
|
+
return m === V.RESOLVED ? 0 : r ? r.correct ? r.points : 0 : i == null ? void 0 : i.points;
|
|
76
83
|
}, [
|
|
77
84
|
c,
|
|
78
85
|
r,
|
|
@@ -80,37 +87,37 @@ const vt = ({ openedQuestion: t, isLoading: C, vote: p, close: v }) => {
|
|
|
80
87
|
m,
|
|
81
88
|
l,
|
|
82
89
|
a,
|
|
83
|
-
|
|
84
|
-
]),
|
|
90
|
+
o
|
|
91
|
+
]), z = f(() => a === s.PREDICTION && r ? o ? o && (i != null && i.youVoted) ? "You won" : "" : "To win" : l || c ? "Time expired" : a === s.POLL ? "Time remaining" : r ? "You won" : "To win", [c, a, r, l, o, i]), G = (a === s.TRIVIA || a === s.PREDICTION) && r && o && (i == null ? void 0 : i.youVoted), J = r || l || N || a === s.TRIVIA && m === V.RESOLVED && T;
|
|
85
92
|
return /* @__PURE__ */ n(Z, { children: /* @__PURE__ */ n(_, { children: /* @__PURE__ */ k($, { children: [
|
|
86
93
|
/* @__PURE__ */ n(
|
|
87
94
|
X,
|
|
88
95
|
{
|
|
89
|
-
feedbackMessages:
|
|
96
|
+
feedbackMessages: Y,
|
|
90
97
|
questionVoted: !!r,
|
|
91
98
|
questionVotedCorrectly: r == null ? void 0 : r.correct,
|
|
92
99
|
questionType: a,
|
|
93
|
-
hasCorrectAnswer:
|
|
100
|
+
hasCorrectAnswer: o,
|
|
94
101
|
questionStatus: m,
|
|
95
102
|
showExpiredNotification: l,
|
|
96
|
-
showClosedNotificationTrivia:
|
|
97
|
-
votedInCurrentRender:
|
|
98
|
-
votedAfterQuestionClosed:
|
|
103
|
+
showClosedNotificationTrivia: N,
|
|
104
|
+
votedInCurrentRender: R,
|
|
105
|
+
votedAfterQuestionClosed: h,
|
|
99
106
|
enteredAnActiveQuestion: T,
|
|
100
|
-
marketClosed:
|
|
107
|
+
marketClosed: y
|
|
101
108
|
}
|
|
102
109
|
),
|
|
103
|
-
|
|
110
|
+
P && /* @__PURE__ */ n(
|
|
104
111
|
it,
|
|
105
112
|
{
|
|
106
|
-
title:
|
|
107
|
-
points:
|
|
108
|
-
onTimerExpired:
|
|
113
|
+
title: z,
|
|
114
|
+
points: H,
|
|
115
|
+
onTimerExpired: W,
|
|
109
116
|
questionType: t.type,
|
|
110
117
|
isTimer: !C,
|
|
111
118
|
isPlayingTimer: !r,
|
|
112
|
-
animatePoints:
|
|
113
|
-
timerDuration:
|
|
119
|
+
animatePoints: G,
|
|
120
|
+
timerDuration: J ? 0 : Number(((g = t == null ? void 0 : t.appearance) == null ? void 0 : g.autoHideInterval) || "30")
|
|
114
121
|
}
|
|
115
122
|
),
|
|
116
123
|
c ? /* @__PURE__ */ n(
|
|
@@ -119,16 +126,16 @@ const vt = ({ openedQuestion: t, isLoading: C, vote: p, close: v }) => {
|
|
|
119
126
|
title: "More to come...",
|
|
120
127
|
description: "Watch for additional enhanced stream interactive experience."
|
|
121
128
|
}
|
|
122
|
-
) : /* @__PURE__ */ k(
|
|
123
|
-
/* @__PURE__ */ n(Q, { style:
|
|
124
|
-
/* @__PURE__ */ n(tt, { children:
|
|
129
|
+
) : /* @__PURE__ */ k(K, { children: [
|
|
130
|
+
/* @__PURE__ */ n(Q, { style: P ? {} : { marginTop: 0 }, children: b }),
|
|
131
|
+
/* @__PURE__ */ n(tt, { children: F.map((e) => /* @__PURE__ */ n(
|
|
125
132
|
rt,
|
|
126
133
|
{
|
|
127
134
|
...e,
|
|
128
|
-
markThatVoted:
|
|
129
|
-
votedAfterQuestionClosed:
|
|
135
|
+
markThatVoted: B,
|
|
136
|
+
votedAfterQuestionClosed: h,
|
|
130
137
|
enteredAnActiveQuestion: T,
|
|
131
|
-
marketClosed:
|
|
138
|
+
marketClosed: y
|
|
132
139
|
},
|
|
133
140
|
e.id
|
|
134
141
|
)) })
|
|
@@ -136,5 +143,5 @@ const vt = ({ openedQuestion: t, isLoading: C, vote: p, close: v }) => {
|
|
|
136
143
|
] }) }) });
|
|
137
144
|
};
|
|
138
145
|
export {
|
|
139
|
-
|
|
146
|
+
Ot as Vote
|
|
140
147
|
};
|