@streamlayer/react-ui 0.74.2 → 0.75.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/assets/style.css +1 -1
- package/lib/ui/app/Features/Gamification/UserSummary.js +14 -7
- package/lib/ui/app/Notifications/Onboarding/index.d.ts +3 -2
- package/lib/ui/app/Notifications/Onboarding/index.js +85 -49
- package/lib/ui/app/Notifications/index.js +60 -23
- package/lib/ui/app/Notifications/styles.d.ts +2 -0
- package/lib/ui/app/Notifications/styles.js +9 -4
- package/lib/ui/app/masters.js +6 -6
- package/lib/ui/app/useMastersApp.js +19 -17
- package/lib/ui/gamification/question/notification/index.js +24 -28
- package/lib/ui/gamification/question/notification/prediction-result/index.d.ts +3 -0
- package/lib/ui/gamification/question/notification/prediction-result/index.js +99 -67
- package/lib/ui/gamification/question/notification/prediction-result/styles.d.ts +3 -2
- package/lib/ui/gamification/question/notification/prediction-result/styles.js +27 -24
- package/lib/ui/gamification/vote/index.js +54 -46
- package/lib/ui/gamification/vote/insight-details/styles.js +2 -2
- package/lib/ui/show-in/index.js +2 -2
- package/lib/ui/timer/index.js +16 -16
- package/package.json +7 -7
- package/lib/ui/theme/masters.d.ts +0 -2
- package/lib/ui/theme/masters.js +0 -4
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { QuestionType as
|
|
4
|
-
import { SDKScrollContainer as
|
|
5
|
-
import { ExpiredAlert as
|
|
6
|
-
import { Feedback as
|
|
7
|
-
import { Container as
|
|
8
|
-
import { VotingOption as
|
|
9
|
-
import { WinBar as
|
|
1
|
+
import { jsx as a, jsxs as C, Fragment as u } from "react/jsx-runtime";
|
|
2
|
+
import { useState as S, useCallback as V, useMemo as m } from "react";
|
|
3
|
+
import { QuestionStatus as M, QuestionType as y } from "@streamlayer/sdk-web-types";
|
|
4
|
+
import { SDKScrollContainer as j } from "../../app/styles.js";
|
|
5
|
+
import { ExpiredAlert as k } from "./expired-alert/index.js";
|
|
6
|
+
import { Feedback as N } from "./feedback/index.js";
|
|
7
|
+
import { Container as R, Content as B, Title as F, Options as W } from "./styles.js";
|
|
8
|
+
import { VotingOption as H } from "./vote-option/index.js";
|
|
9
|
+
import { WinBar as K } from "./win-bar/index.js";
|
|
10
10
|
import "@linaria/react";
|
|
11
11
|
import "../../icons/index.js";
|
|
12
12
|
import "./expired-alert/styles.js";
|
|
@@ -18,76 +18,84 @@ 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
|
|
21
|
+
const er = ({ openedQuestion: r, isLoading: f, vote: w, close: h }) => {
|
|
22
|
+
var n, v;
|
|
23
|
+
const I = r.subject, O = r.type, l = (n = r.options) == null ? void 0 : n.options, [c, g] = S(!1), [q, x] = S(""), T = r == null ? void 0 : r.id, p = V(
|
|
24
24
|
async (i) => {
|
|
25
|
-
if (
|
|
26
|
-
const
|
|
27
|
-
|
|
25
|
+
if (T) {
|
|
26
|
+
const s = i.currentTarget.value;
|
|
27
|
+
x(s), await w(T, s);
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
|
-
[
|
|
31
|
-
),
|
|
32
|
-
|
|
33
|
-
}, [
|
|
30
|
+
[T, x, w]
|
|
31
|
+
), b = V(() => {
|
|
32
|
+
g(!0), setTimeout(h, 3e3);
|
|
33
|
+
}, [h]), t = m(
|
|
34
34
|
() => r == null ? void 0 : r.answers.find((i) => i.youVoted === !0),
|
|
35
35
|
[r]
|
|
36
|
-
), o =
|
|
36
|
+
), o = m(
|
|
37
37
|
() => !!(r != null && r.answers.find((i) => i.correct === !0)),
|
|
38
38
|
[r]
|
|
39
|
-
),
|
|
40
|
-
|
|
39
|
+
), e = m(
|
|
40
|
+
() => r == null ? void 0 : r.answers.find((i) => i.correct === !0),
|
|
41
|
+
[r]
|
|
42
|
+
), A = m(() => r ? r.answers.map((i) => {
|
|
43
|
+
var s;
|
|
41
44
|
return {
|
|
42
45
|
...i,
|
|
43
46
|
questionVoted: !!t,
|
|
44
|
-
youSelected:
|
|
45
|
-
isLoading:
|
|
47
|
+
youSelected: q === i.id,
|
|
48
|
+
isLoading: f,
|
|
46
49
|
hasCorrectAnswer: o,
|
|
47
50
|
questionType: r.type,
|
|
48
|
-
answerTimeExpired:
|
|
51
|
+
answerTimeExpired: c,
|
|
49
52
|
questionStatus: r.status,
|
|
50
|
-
imageMode: (
|
|
53
|
+
imageMode: (s = r.appearance) == null ? void 0 : s.images,
|
|
51
54
|
// ToDo: Figure out why imageMode is not in the response
|
|
52
|
-
onVote:
|
|
55
|
+
onVote: p
|
|
53
56
|
};
|
|
54
|
-
}) : [], [o,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
}) : [], [o, c, f, r, t, p, q]), E = l && (l.case === "trivia" || l.case === "prediction") ? l.value : void 0, D = m(() => {
|
|
58
|
+
if (r.status === M.RESOLVED)
|
|
59
|
+
return 0;
|
|
60
|
+
if (!c)
|
|
61
|
+
return t ? t.correct ? t.points : 0 : e == null ? void 0 : e.points;
|
|
62
|
+
}, [c, t, e, r.status]), P = m(() => c ? "Time expired" : r.type === y.POLL ? "Time remaining" : t ? "You won" : "To win", [c, r.type, t]);
|
|
63
|
+
return /* @__PURE__ */ a(j, { "data-question-header": "true", children: /* @__PURE__ */ a(R, { children: /* @__PURE__ */ C(B, { children: [
|
|
64
|
+
E && /* @__PURE__ */ a(
|
|
65
|
+
N,
|
|
58
66
|
{
|
|
59
|
-
feedbackMessages:
|
|
67
|
+
feedbackMessages: E,
|
|
60
68
|
questionVoted: !!t,
|
|
61
69
|
questionVotedCorrectly: t == null ? void 0 : t.correct,
|
|
62
|
-
questionType:
|
|
70
|
+
questionType: O,
|
|
63
71
|
hasCorrectAnswer: o,
|
|
64
72
|
questionStatus: r.status
|
|
65
73
|
}
|
|
66
74
|
),
|
|
67
|
-
r.type !==
|
|
68
|
-
|
|
75
|
+
r.type !== y.PREDICTION && /* @__PURE__ */ a(
|
|
76
|
+
K,
|
|
69
77
|
{
|
|
70
|
-
title:
|
|
71
|
-
points:
|
|
72
|
-
onTimerExpired:
|
|
78
|
+
title: P,
|
|
79
|
+
points: D,
|
|
80
|
+
onTimerExpired: b,
|
|
73
81
|
questionType: r.type,
|
|
74
|
-
isTimer: !
|
|
82
|
+
isTimer: !f,
|
|
75
83
|
isPlayingTimer: !t,
|
|
76
|
-
timerDuration: t ? 0 : Number(((
|
|
84
|
+
timerDuration: t ? 0 : Number(((v = r == null ? void 0 : r.appearance) == null ? void 0 : v.autoHideInterval) || "30")
|
|
77
85
|
}
|
|
78
86
|
),
|
|
79
|
-
|
|
80
|
-
|
|
87
|
+
c ? /* @__PURE__ */ a(
|
|
88
|
+
k,
|
|
81
89
|
{
|
|
82
90
|
title: "More to come...",
|
|
83
91
|
description: "Watch for additional enhanced stream interactive experience."
|
|
84
92
|
}
|
|
85
|
-
) : /* @__PURE__ */
|
|
86
|
-
/* @__PURE__ */ a(
|
|
87
|
-
/* @__PURE__ */ a(
|
|
93
|
+
) : /* @__PURE__ */ C(u, { children: [
|
|
94
|
+
/* @__PURE__ */ a(F, { "data-isPrediction": r.type === y.PREDICTION, children: I }),
|
|
95
|
+
/* @__PURE__ */ a(W, { children: A.map((i) => /* @__PURE__ */ a(H, { ...i }, i.id)) })
|
|
88
96
|
] })
|
|
89
97
|
] }) }) });
|
|
90
98
|
};
|
|
91
99
|
export {
|
|
92
|
-
|
|
100
|
+
er as Vote
|
|
93
101
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
|
-
const
|
|
2
|
+
const n = /* @__PURE__ */ s("div")({
|
|
3
3
|
name: "Container",
|
|
4
4
|
class: "c1euiow",
|
|
5
5
|
propsAsIs: !1
|
|
@@ -9,6 +9,6 @@ const e = /* @__PURE__ */ s("div")({
|
|
|
9
9
|
propsAsIs: !1
|
|
10
10
|
});
|
|
11
11
|
export {
|
|
12
|
-
|
|
12
|
+
n as Container,
|
|
13
13
|
o as WebLinkBtn
|
|
14
14
|
};
|
package/lib/ui/show-in/index.js
CHANGED
|
@@ -5,7 +5,7 @@ const m = /* @__PURE__ */ e("div")({
|
|
|
5
5
|
name: "Container",
|
|
6
6
|
class: "c1pgyo67",
|
|
7
7
|
propsAsIs: !1
|
|
8
|
-
}), a = "hx17qu6",
|
|
8
|
+
}), a = "hx17qu6", f = ({
|
|
9
9
|
children: o,
|
|
10
10
|
style: n,
|
|
11
11
|
className: s,
|
|
@@ -16,5 +16,5 @@ const m = /* @__PURE__ */ e("div")({
|
|
|
16
16
|
children: o
|
|
17
17
|
});
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
f as ShowIn
|
|
20
20
|
};
|
package/lib/ui/timer/index.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as R } from "react/jsx-runtime";
|
|
2
2
|
import { styled as E } from "@linaria/react";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { CountdownCircleTimer as
|
|
3
|
+
import { useState as S, useCallback as n } from "react";
|
|
4
|
+
import { CountdownCircleTimer as _ } from "react-countdown-circle-timer";
|
|
5
5
|
import { COLORS as o } from "../theme/constants.js";
|
|
6
|
-
const
|
|
6
|
+
const A = [o.PRIMARY_GREEN1, o.SECONDARY_RED1, o.SECONDARY_RED1, o.NEUTRALS_GRAY3], O = [10, 10, 1, 0], N = /* @__PURE__ */ E("div")({
|
|
7
7
|
name: "RemainingTime",
|
|
8
8
|
class: "r165427",
|
|
9
9
|
propsAsIs: !1
|
|
10
|
-
}),
|
|
10
|
+
}), f = o.SECONDARY_GREEN6, c = o.SECONDARY_RED3, D = o.NEUTRALS_GRAY3, L = ({
|
|
11
11
|
isPlaying: i = !0,
|
|
12
12
|
duration: r = 30,
|
|
13
13
|
onTimerExpired: t
|
|
14
14
|
}) => {
|
|
15
|
-
const [l, s] =
|
|
15
|
+
const [l, s] = S(r > 10 ? f : c), m = ({
|
|
16
16
|
remainingTime: e
|
|
17
|
-
}) => /* @__PURE__ */
|
|
17
|
+
}) => /* @__PURE__ */ R(N, {
|
|
18
18
|
children: e
|
|
19
|
-
}), a =
|
|
20
|
-
t == null || t(), s(
|
|
21
|
-
}, [t, s]), C =
|
|
22
|
-
e === 10 && s(
|
|
19
|
+
}), a = n(() => {
|
|
20
|
+
t == null || t(), s(D);
|
|
21
|
+
}, [t, s]), C = n((e) => {
|
|
22
|
+
e === 10 && s(c);
|
|
23
23
|
}, [s]);
|
|
24
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ R(_, {
|
|
25
25
|
isPlaying: i,
|
|
26
26
|
duration: r,
|
|
27
|
-
colors:
|
|
28
|
-
colorsTime:
|
|
27
|
+
colors: A,
|
|
28
|
+
colorsTime: O,
|
|
29
29
|
size: 32,
|
|
30
30
|
strokeWidth: 2,
|
|
31
31
|
trailStrokeWidth: 2,
|
|
@@ -36,6 +36,6 @@ const _ = [o.PRIMARY_GREEN1, o.SECONDARY_RED1, o.SECONDARY_RED1], A = [10, 10, 0
|
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
38
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
N as RemainingTime,
|
|
40
|
+
L as Timer
|
|
41
41
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.75.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
"react-virtualized-auto-sizer": "^1.0.20",
|
|
41
41
|
"react-window": "^1.8.9",
|
|
42
42
|
"react-window-infinite-loader": "^1.0.9",
|
|
43
|
-
"@streamlayer/feature-gamification": "^0.
|
|
44
|
-
"@streamlayer/sdk-web": "^0.29.
|
|
45
|
-
"@streamlayer/sdk-web-anonymous-auth": "^0.11.
|
|
43
|
+
"@streamlayer/feature-gamification": "^0.28.0",
|
|
44
|
+
"@streamlayer/sdk-web": "^0.29.4",
|
|
45
|
+
"@streamlayer/sdk-web-anonymous-auth": "^0.11.29",
|
|
46
46
|
"@streamlayer/sdk-web-api": "^0.1.0",
|
|
47
47
|
"@streamlayer/sdk-web-core": "^0.0.6",
|
|
48
|
-
"@streamlayer/sdk-web-features": "^0.10.
|
|
48
|
+
"@streamlayer/sdk-web-features": "^0.10.36",
|
|
49
49
|
"@streamlayer/sdk-web-interfaces": "^0.0.1",
|
|
50
|
-
"@streamlayer/sdk-web-notifications": "^0.
|
|
50
|
+
"@streamlayer/sdk-web-notifications": "^0.1.0",
|
|
51
51
|
"@streamlayer/sdk-web-storage": "^0.0.4",
|
|
52
52
|
"@streamlayer/sdk-web-logger": "^0.0.1",
|
|
53
53
|
"@streamlayer/sdk-web-types": "^0.0.1"
|
|
@@ -90,6 +90,6 @@
|
|
|
90
90
|
"vite-plugin-svgr": "^4.1.0",
|
|
91
91
|
"vite-svg-loader": "^4.0.0",
|
|
92
92
|
"vite-tsconfig-paths": "^4.2.1",
|
|
93
|
-
"@streamlayer/react": "^0.32.
|
|
93
|
+
"@streamlayer/react": "^0.32.5"
|
|
94
94
|
}
|
|
95
95
|
}
|
package/lib/ui/theme/masters.js
DELETED