@streamlayer/react-ui 0.51.0 → 0.52.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/index.js +32 -30
- package/lib/ui/app/Features/FeatureProvider.d.ts +1 -0
- package/lib/ui/app/Features/FeatureProvider.js +6 -10
- package/lib/ui/app/Features/Gamification/Question.js +3 -2
- package/lib/ui/app/Features/Gamification/index.d.ts +1 -0
- package/lib/ui/app/Features/Gamification/index.js +16 -18
- package/lib/ui/app/Features/Highlights/index.d.ts +1 -0
- package/lib/ui/app/Features/Highlights/index.js +15 -11
- package/lib/ui/app/Features/index.d.ts +1 -0
- package/lib/ui/app/Features/index.js +12 -8
- package/lib/ui/app/Navigation/MastersNavigation/index.d.ts +1 -0
- package/lib/ui/app/Navigation/MastersNavigation/index.js +10 -10
- package/lib/ui/app/masters.d.ts +1 -2
- package/lib/ui/app/masters.js +30 -33
- package/lib/ui/app/styles.js +14 -7
- package/lib/ui/app/useMastersApp.d.ts +4 -4
- package/lib/ui/app/useMastersApp.js +17 -17
- package/lib/ui/demo/DemoPoints.js +5 -3
- package/lib/ui/demo/Gamification.js +16 -15
- package/lib/ui/demo/Highlights.js +3 -2
- package/lib/ui/demo/components/Insight.d.ts +1 -0
- package/lib/ui/demo/components/Insight.js +10 -9
- package/lib/ui/demo/components/Insights.d.ts +1 -0
- package/lib/ui/demo/components/Insights.js +7 -7
- package/lib/ui/demo/components/Question.js +8 -7
- package/lib/ui/demo/components/index.js +15 -14
- package/lib/ui/demo/index.js +3 -2
- package/lib/ui/gamification/detailed-insight/index.d.ts +1 -0
- package/lib/ui/gamification/detailed-insight/index.js +14 -13
- package/lib/ui/gamification/insight-list/index.d.ts +1 -0
- package/lib/ui/gamification/insight-list/index.js +4 -4
- package/lib/ui/gamification/points/index.js +11 -9
- package/lib/ui/gamification/vote/index.js +40 -40
- package/lib/ui/gamification/vote/styles.js +5 -5
- package/lib/ui/gamification/vote/vote-option/index.d.ts +3 -1
- package/lib/ui/gamification/vote/vote-option/index.js +57 -36
- package/lib/ui/gamification/vote/vote-option/styles.js +7 -5
- package/lib/ui/icons/index.d.ts +1 -0
- package/lib/ui/icons/index.js +13 -12
- package/lib/ui/theme/index.js +2 -2
- package/lib/ui/theme/masters.js +3 -2
- package/lib/ui/theme/theme.d.ts +4 -0
- package/lib/ui/theme/theme.js +24 -19
- package/package.json +13 -13
|
@@ -32,6 +32,7 @@ import "../gamification/question/styles.js";
|
|
|
32
32
|
import "../icons/index.js";
|
|
33
33
|
import "../gamification/question/list/styles.js";
|
|
34
34
|
import "../gamification/vote/index.js";
|
|
35
|
+
import "../app/styles.js";
|
|
35
36
|
import "../gamification/vote/feedback/index.js";
|
|
36
37
|
import "../gamification/vote/feedback/styles.js";
|
|
37
38
|
import "../gamification/vote/styles.js";
|
|
@@ -59,17 +60,17 @@ import "react-window";
|
|
|
59
60
|
import "react-window-infinite-loader";
|
|
60
61
|
import "../gamification/leaderboard-item/index.js";
|
|
61
62
|
import "../gamification/leaderboard-item/styles.js";
|
|
62
|
-
const
|
|
63
|
+
const st = ({
|
|
63
64
|
gamification: r,
|
|
64
65
|
sdk: u
|
|
65
66
|
}) => {
|
|
66
67
|
var d, v, c, b, y, g, S, h, C, G, L, Q, A, E, f, w, x, P, F, O, B, D, R;
|
|
67
|
-
const T = p(r.status), j = p(r.onboardingStatus), l = p(r.openedQuestion), { slStreamId:
|
|
68
|
+
const T = p(r.status), j = p(r.onboardingStatus), l = p(r.openedQuestion), { slStreamId: e } = p(u.sdkStore), o = p(r.featureSettings), [n, q] = K(a.HOME);
|
|
68
69
|
if (T !== J.Ready)
|
|
69
70
|
return /* @__PURE__ */ t("div", { children: "wait..." });
|
|
70
|
-
if (
|
|
71
|
+
if (e != null && e.loading)
|
|
71
72
|
return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t("div", { children: "Event is loading" }) });
|
|
72
|
-
if (!(
|
|
73
|
+
if (!(e != null && e.data))
|
|
73
74
|
return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t("div", { children: "Event is forbidden" }) });
|
|
74
75
|
if (!j)
|
|
75
76
|
return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(
|
|
@@ -77,16 +78,16 @@ const nt = ({
|
|
|
77
78
|
{
|
|
78
79
|
closeFeature: u.closeFeature,
|
|
79
80
|
gamification: r,
|
|
80
|
-
steps: (v = (d =
|
|
81
|
-
gameIcon: (y = (b = (c =
|
|
82
|
-
sponsorLogo: (h = (S = (g =
|
|
83
|
-
rules: (G = (C =
|
|
84
|
-
rulesBtnLabel: (Q = (L =
|
|
85
|
-
rulesTitle: (E = (A =
|
|
86
|
-
primaryColor: (x = (w = (f =
|
|
87
|
-
inviteCardTitle: (F = (P =
|
|
88
|
-
inviteCardSubtext: (B = (O =
|
|
89
|
-
inviteCardBtnLabel: (R = (D =
|
|
81
|
+
steps: (v = (d = o.inplayGame) == null ? void 0 : d.onboarding) == null ? void 0 : v.steps,
|
|
82
|
+
gameIcon: (y = (b = (c = o.inplayGame) == null ? void 0 : c.overview) == null ? void 0 : b.media) == null ? void 0 : y.gameIcon,
|
|
83
|
+
sponsorLogo: (h = (S = (g = o.inplayGame) == null ? void 0 : g.overview) == null ? void 0 : S.media) == null ? void 0 : h.sponsorLogo,
|
|
84
|
+
rules: (G = (C = o.inplayGame) == null ? void 0 : C.rules) == null ? void 0 : G.rules,
|
|
85
|
+
rulesBtnLabel: (Q = (L = o.inplayGame) == null ? void 0 : L.rules) == null ? void 0 : Q.buttonLabel,
|
|
86
|
+
rulesTitle: (E = (A = o.inplayGame) == null ? void 0 : A.rules) == null ? void 0 : E.heading,
|
|
87
|
+
primaryColor: (x = (w = (f = o.inplayGame) == null ? void 0 : f.overview) == null ? void 0 : w.appearance) == null ? void 0 : x.primaryColor,
|
|
88
|
+
inviteCardTitle: (F = (P = o.inplayGame) == null ? void 0 : P.inviteCard) == null ? void 0 : F.heading,
|
|
89
|
+
inviteCardSubtext: (B = (O = o.inplayGame) == null ? void 0 : O.inviteCard) == null ? void 0 : B.subtext,
|
|
90
|
+
inviteCardBtnLabel: (R = (D = o.inplayGame) == null ? void 0 : D.inviteCard) == null ? void 0 : R.buttonLabel
|
|
90
91
|
}
|
|
91
92
|
) });
|
|
92
93
|
const H = (i) => {
|
|
@@ -111,5 +112,5 @@ const nt = ({
|
|
|
111
112
|
] });
|
|
112
113
|
};
|
|
113
114
|
export {
|
|
114
|
-
|
|
115
|
+
st as GamificationComponent
|
|
115
116
|
};
|
|
@@ -29,6 +29,7 @@ import "../gamification/constants.js";
|
|
|
29
29
|
import "../gamification/question/styles.js";
|
|
30
30
|
import "../icons/index.js";
|
|
31
31
|
import "../gamification/vote/index.js";
|
|
32
|
+
import "../app/styles.js";
|
|
32
33
|
import "../gamification/vote/feedback/index.js";
|
|
33
34
|
import "../gamification/vote/feedback/styles.js";
|
|
34
35
|
import "../gamification/vote/styles.js";
|
|
@@ -47,7 +48,7 @@ import "../gamification/detailed-insight/index.js";
|
|
|
47
48
|
import "../gamification/common-header/index.js";
|
|
48
49
|
import "../../icon-exit-d3f9fc80.js";
|
|
49
50
|
import "../gamification/detailed-insight/styles.js";
|
|
50
|
-
const
|
|
51
|
+
const st = ({ highlights: i, sdk: e }) => {
|
|
51
52
|
const n = m(i.status), r = m(i.openedInsight), { slStreamId: o } = m(e.sdkStore);
|
|
52
53
|
return n !== d.Ready ? /* @__PURE__ */ t("div", { children: "wait..." }) : o != null && o.loading ? /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t("div", { children: "Event is loading" }) }) : o != null && o.data ? i.insights === void 0 ? /* @__PURE__ */ t("div", { children: "wait insights..." }) : /* @__PURE__ */ s(p, { children: [
|
|
53
54
|
!r && /* @__PURE__ */ t(c, { highlights: i, store: i.insights.getStore() }),
|
|
@@ -62,5 +63,5 @@ const nt = ({ highlights: i, sdk: e }) => {
|
|
|
62
63
|
] }) : /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t("div", { children: "Event is forbidden" }) });
|
|
63
64
|
};
|
|
64
65
|
export {
|
|
65
|
-
|
|
66
|
+
st as HighlightsComponent
|
|
66
67
|
};
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { DetailedInsight as
|
|
1
|
+
import { jsx as L } from "react/jsx-runtime";
|
|
2
|
+
import { DetailedInsight as c } from "../../gamification/detailed-insight/index.js";
|
|
3
3
|
import "../../gamification/common-header/index.js";
|
|
4
4
|
import "../../../icon-exit-d3f9fc80.js";
|
|
5
5
|
import "../../gamification/common-header/styles.js";
|
|
6
6
|
import "@linaria/react";
|
|
7
7
|
import "../../gamification/detailed-insight/styles.js";
|
|
8
|
-
const
|
|
8
|
+
const x = ({ openedInsight: o, closeHighlights: r, closeInsight: s, className: l }) => {
|
|
9
9
|
var t, a, b, n, e;
|
|
10
10
|
const i = ((t = o.options) == null ? void 0 : t.options.case) === "factoid" ? {
|
|
11
11
|
image: o.options.options.value.image,
|
|
12
12
|
body: o.options.options.value.body,
|
|
13
13
|
webLink: (a = o.options.options.value.webLink) == null ? void 0 : a.url,
|
|
14
14
|
webLinkLabel: (b = o.options.options.value.webLink) == null ? void 0 : b.label
|
|
15
|
-
} : {},
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
|
|
15
|
+
} : {}, m = o.subject || ((n = o.notification) == null ? void 0 : n.title), p = i.body || ((e = o.notification) == null ? void 0 : e.body);
|
|
16
|
+
return /* @__PURE__ */ L(
|
|
17
|
+
c,
|
|
18
18
|
{
|
|
19
|
+
className: l,
|
|
19
20
|
image: i.image,
|
|
20
|
-
title:
|
|
21
|
-
description:
|
|
21
|
+
title: m,
|
|
22
|
+
description: p,
|
|
22
23
|
webLink: i.webLink,
|
|
23
24
|
webLinkLabel: i.webLinkLabel,
|
|
24
25
|
closeInsight: s,
|
|
@@ -27,5 +28,5 @@ const j = ({ openedInsight: o, closeHighlights: r, closeInsight: s }) => {
|
|
|
27
28
|
);
|
|
28
29
|
};
|
|
29
30
|
export {
|
|
30
|
-
|
|
31
|
+
x as Insight
|
|
31
32
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useStore as
|
|
3
|
-
import { InsightList as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useStore as p } from "@nanostores/react";
|
|
3
|
+
import { InsightList as s } from "../../gamification/insight-list/index.js";
|
|
4
4
|
import "../../gamification/insight/index.js";
|
|
5
5
|
import "@streamlayer/sdk-web-types";
|
|
6
6
|
import "../../gamification/insight/styles.js";
|
|
7
7
|
import "@linaria/react";
|
|
8
8
|
import "../../gamification/insight-list/styles.js";
|
|
9
|
-
const
|
|
10
|
-
const { data:
|
|
11
|
-
return
|
|
9
|
+
const c = ({ highlights: o, store: n, className: t }) => {
|
|
10
|
+
const { data: i } = p(n);
|
|
11
|
+
return i ? /* @__PURE__ */ r(s, { className: t, insights: i, openInsight: o.openHighlight }) : /* @__PURE__ */ r("div", { className: t, children: "wait insights..." });
|
|
12
12
|
};
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
c as Insights
|
|
15
15
|
};
|
|
@@ -2,6 +2,7 @@ import { jsx as o } from "react/jsx-runtime";
|
|
|
2
2
|
import { styled as f } from "@linaria/react";
|
|
3
3
|
import { useState as p, useCallback as n, useMemo as s } from "react";
|
|
4
4
|
import { Vote as d } from "../../gamification/vote/index.js";
|
|
5
|
+
import "../../app/styles.js";
|
|
5
6
|
import "../../gamification/vote/feedback/index.js";
|
|
6
7
|
import "@streamlayer/sdk-web-types";
|
|
7
8
|
import "../../icons/index.js";
|
|
@@ -41,14 +42,14 @@ const y = f.div`
|
|
|
41
42
|
transform: translateX(0);
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
|
-
`,
|
|
45
|
-
var
|
|
46
|
-
const [e,
|
|
45
|
+
`, S = ({ openedQuestion: t, closeQuestion: h, vote: a }) => {
|
|
46
|
+
var c;
|
|
47
|
+
const [e, m] = p(!1);
|
|
47
48
|
n(
|
|
48
49
|
(r) => {
|
|
49
|
-
|
|
50
|
+
m(r);
|
|
50
51
|
},
|
|
51
|
-
[
|
|
52
|
+
[m]
|
|
52
53
|
);
|
|
53
54
|
const i = s(
|
|
54
55
|
() => t == null ? void 0 : t.answers.find((r) => r.youVoted === !0),
|
|
@@ -61,7 +62,7 @@ const y = f.div`
|
|
|
61
62
|
d,
|
|
62
63
|
{
|
|
63
64
|
title: t.subject,
|
|
64
|
-
feedbackMessages: (
|
|
65
|
+
feedbackMessages: (c = t.options) == null ? void 0 : c.options.value,
|
|
65
66
|
questionType: t.type,
|
|
66
67
|
questionId: t.id,
|
|
67
68
|
questionVoted: !!i,
|
|
@@ -84,5 +85,5 @@ const y = f.div`
|
|
|
84
85
|
) }) }) }) : null;
|
|
85
86
|
};
|
|
86
87
|
export {
|
|
87
|
-
|
|
88
|
+
S as Question
|
|
88
89
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { UserSummary as
|
|
2
|
-
import { QuestionsList as
|
|
3
|
-
import { Question as
|
|
4
|
-
import { Onboarding as
|
|
5
|
-
import { Insights as
|
|
6
|
-
import { Insight as
|
|
7
|
-
import { Leaderboard as
|
|
1
|
+
import { UserSummary as pr } from "./UserSummary.js";
|
|
2
|
+
import { QuestionsList as er } from "./QuestionsList.js";
|
|
3
|
+
import { Question as fr } from "./Question.js";
|
|
4
|
+
import { Onboarding as nr } from "../../gamification/onboarding/index.js";
|
|
5
|
+
import { Insights as dr } from "./Insights.js";
|
|
6
|
+
import { Insight as ur } from "./Insight.js";
|
|
7
|
+
import { Leaderboard as hr } from "./Leaderboard.js";
|
|
8
8
|
import "react/jsx-runtime";
|
|
9
9
|
import "@nanostores/react";
|
|
10
10
|
import "../../gamification/user-statistics/index.js";
|
|
@@ -26,6 +26,7 @@ import "../../icons/index.js";
|
|
|
26
26
|
import "react";
|
|
27
27
|
import "../../gamification/question/list/styles.js";
|
|
28
28
|
import "../../gamification/vote/index.js";
|
|
29
|
+
import "../../app/styles.js";
|
|
29
30
|
import "../../gamification/vote/feedback/index.js";
|
|
30
31
|
import "../../gamification/vote/feedback/styles.js";
|
|
31
32
|
import "../../gamification/vote/styles.js";
|
|
@@ -61,11 +62,11 @@ import "react-window-infinite-loader";
|
|
|
61
62
|
import "../../gamification/leaderboard-item/index.js";
|
|
62
63
|
import "../../gamification/leaderboard-item/styles.js";
|
|
63
64
|
export {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
ur as Insight,
|
|
66
|
+
dr as Insights,
|
|
67
|
+
hr as Leaderboard,
|
|
68
|
+
nr as Onboarding,
|
|
69
|
+
fr as Question,
|
|
70
|
+
er as QuestionsList,
|
|
71
|
+
pr as UserSummary
|
|
71
72
|
};
|
package/lib/ui/demo/index.js
CHANGED
|
@@ -45,6 +45,7 @@ import "../icons/index.js";
|
|
|
45
45
|
import "../gamification/question/list/styles.js";
|
|
46
46
|
import "./components/Question.js";
|
|
47
47
|
import "../gamification/vote/index.js";
|
|
48
|
+
import "../app/styles.js";
|
|
48
49
|
import "../gamification/vote/feedback/index.js";
|
|
49
50
|
import "../gamification/vote/feedback/styles.js";
|
|
50
51
|
import "../gamification/vote/styles.js";
|
|
@@ -169,7 +170,7 @@ const R = ({ activeFeature: o, sdk: r }) => {
|
|
|
169
170
|
] }),
|
|
170
171
|
h
|
|
171
172
|
] });
|
|
172
|
-
},
|
|
173
|
+
}, Sr = ({ sdk: o }) => {
|
|
173
174
|
const r = f(o.organizationStore()), t = f(o.getUserStore()), a = f(o.getActiveFeature());
|
|
174
175
|
return r.loading ? /* @__PURE__ */ e("div", { children: "authentication..." }) : r.data ? t.loading ? /* @__PURE__ */ e("div", { children: "authentication..." }) : t.data ? /* @__PURE__ */ l(T, { children: [
|
|
175
176
|
/* @__PURE__ */ e(x, { notificationsStore: o.getNotificationsStore() }),
|
|
@@ -177,5 +178,5 @@ const R = ({ activeFeature: o, sdk: r }) => {
|
|
|
177
178
|
] }) : /* @__PURE__ */ e(H, { sdk: o }) : /* @__PURE__ */ e("div", { children: "wrong sdk key..." });
|
|
178
179
|
};
|
|
179
180
|
export {
|
|
180
|
-
|
|
181
|
+
Sr as Demo
|
|
181
182
|
};
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { jsxs as I, jsx as M } from "react/jsx-runtime";
|
|
2
|
-
import { CommonHeader as
|
|
3
|
-
import { Container as
|
|
2
|
+
import { CommonHeader as g } from "../common-header/index.js";
|
|
3
|
+
import { Container as l, Image as o, AdditionalContent as n, Title as d, Description as r, AdditionalBtn as a, LinkIcon as u } from "./styles.js";
|
|
4
4
|
import "../../../icon-exit-d3f9fc80.js";
|
|
5
5
|
import "../common-header/styles.js";
|
|
6
6
|
import "@linaria/react";
|
|
7
|
-
const
|
|
7
|
+
const b = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTciIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNyAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBjbGFzcz0ic2MtQU5kc04ga1RWV0pFIj48cGF0aCBkPSJNNi42NjY1IDMuMTY2NjlINC45OTk4NEM0LjI2MzQ2IDMuMTY2NjkgMy42NjY1IDMuNzYzNjQgMy42NjY1IDQuNTAwMDJWMTEuNUMzLjY2NjUgMTIuMjM2NCA0LjI2MzQ2IDEyLjgzMzQgNC45OTk4NCAxMi44MzM0SDExLjk5OThDMTIuNzM2MiAxMi44MzM0IDEzLjMzMzIgMTIuMjM2NCAxMy4zMzMyIDExLjVWOS44MzMzNSIgc3Ryb2tlPSIjZmZmZmZmIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48L3BhdGg+PHBhdGggZD0iTTEzLjMzMzUgNi4xNjY2OVYzLjE2NjY5SDEwLjMzMzUiIHN0cm9rZT0iI2ZmZmZmZiIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PC9wYXRoPjxwYXRoIGQ9Ik0xMy4xNjY4IDMuMzMzMzFMOC4zMzM1IDguMTY2NjUiIHN0cm9rZT0iI2ZmZmZmZiIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PC9wYXRoPjwvc3ZnPgo=", L = ({
|
|
8
8
|
image: i,
|
|
9
9
|
title: j,
|
|
10
10
|
description: m,
|
|
11
11
|
webLinkLabel: z,
|
|
12
12
|
webLink: c,
|
|
13
13
|
closeHighlights: t,
|
|
14
|
-
closeInsight: N
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
closeInsight: N,
|
|
15
|
+
className: Z
|
|
16
|
+
}) => /* @__PURE__ */ I(l, { className: Z, children: [
|
|
17
|
+
/* @__PURE__ */ M(g, { close: t, comeBack: N }),
|
|
18
|
+
i && /* @__PURE__ */ M(o, { alt: "detail-insight-image", src: i }),
|
|
19
|
+
/* @__PURE__ */ I(n, { children: [
|
|
20
|
+
j && /* @__PURE__ */ M(d, { children: j }),
|
|
21
|
+
m && /* @__PURE__ */ M(r, { children: m })
|
|
21
22
|
] }),
|
|
22
|
-
c && z && /* @__PURE__ */ I(
|
|
23
|
+
c && z && /* @__PURE__ */ I(a, { href: c, target: "_blank", children: [
|
|
23
24
|
z,
|
|
24
|
-
/* @__PURE__ */ M(
|
|
25
|
+
/* @__PURE__ */ M(u, { alt: "link-icon", src: b })
|
|
25
26
|
] })
|
|
26
27
|
] });
|
|
27
28
|
export {
|
|
28
|
-
|
|
29
|
+
L as DetailedInsight
|
|
29
30
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { Insight as
|
|
3
|
-
import { Container as
|
|
2
|
+
import { Insight as n } from "../insight/index.js";
|
|
3
|
+
import { Container as i, ItemsContainer as p } from "./styles.js";
|
|
4
4
|
import "@streamlayer/sdk-web-types";
|
|
5
5
|
import "../insight/styles.js";
|
|
6
6
|
import "@linaria/react";
|
|
7
|
-
const
|
|
7
|
+
const u = ({ insights: r, openInsight: m, className: e }) => /* @__PURE__ */ o(i, { className: e, children: /* @__PURE__ */ o(p, { children: r == null ? void 0 : r.map((t) => /* @__PURE__ */ o(n, { openInsight: m, ...t }, t.questionId)) }) });
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
u as InsightList
|
|
10
10
|
};
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { resetCss as r } from "../../theme/theme.js";
|
|
3
|
+
import { formatDecimals as n } from "../../../utils/common.js";
|
|
4
|
+
import { PointsContainer as m, PointsIcon as s, PointsSvg as e, PointsBody as p, PointsTitle as c, PointsValue as l } from "./styles.js";
|
|
5
|
+
import "@linaria/core";
|
|
6
|
+
import "../../theme/constants.js";
|
|
4
7
|
import "@linaria/react";
|
|
5
8
|
import "../../icons/index.js";
|
|
6
9
|
import "react";
|
|
7
10
|
import "../../theme/breakpoints.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
|
|
12
|
-
/* @__PURE__ */ o(
|
|
13
|
-
/* @__PURE__ */ o(c, { children: r(t) })
|
|
11
|
+
const T = ({ points: t }) => /* @__PURE__ */ i(m, { className: r, children: [
|
|
12
|
+
/* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(e, { name: "icon-trophy" }) }),
|
|
13
|
+
/* @__PURE__ */ i(p, { children: [
|
|
14
|
+
/* @__PURE__ */ o(c, { children: "Total points" }),
|
|
15
|
+
/* @__PURE__ */ o(l, { children: n(t) })
|
|
14
16
|
] })
|
|
15
17
|
] });
|
|
16
18
|
export {
|
|
17
|
-
|
|
19
|
+
T as Points
|
|
18
20
|
};
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as e, useCallback as
|
|
1
|
+
import { jsx as i, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import { useState as e, useCallback as A, useMemo as l } from "react";
|
|
3
|
+
import { SDKScrollContainer as S } from "../../app/styles.js";
|
|
3
4
|
import { Feedback as b } from "./feedback/index.js";
|
|
4
|
-
import { Container as E, Content as
|
|
5
|
+
import { Container as E, Content as j, Title as k, Options as u } from "./styles.js";
|
|
5
6
|
import { VotingOption as O } from "./vote-option/index.js";
|
|
6
7
|
import { WinBar as I } from "./win-bar/index.js";
|
|
8
|
+
import "@linaria/react";
|
|
7
9
|
import "@streamlayer/sdk-web-types";
|
|
8
10
|
import "../../icons/index.js";
|
|
9
|
-
import "@linaria/react";
|
|
10
11
|
import "./feedback/styles.js";
|
|
11
12
|
import "./vote-option/styles.js";
|
|
12
13
|
import "../../timer/index.js";
|
|
13
14
|
import "react-countdown-circle-timer";
|
|
14
15
|
import "../../theme/constants.js";
|
|
15
16
|
import "./win-bar/styles.js";
|
|
16
|
-
const
|
|
17
|
-
var
|
|
18
|
-
const
|
|
17
|
+
const Y = ({ openedQuestion: r, vote: n }) => {
|
|
18
|
+
var d;
|
|
19
|
+
const x = r.subject, V = r.type, a = (d = r.options) == null ? void 0 : d.options, [c, v] = e(!1), [f, w] = e(!1), [T, p] = e(""), o = r == null ? void 0 : r.id, q = A(
|
|
19
20
|
async (t) => {
|
|
20
|
-
if (
|
|
21
|
-
const
|
|
22
|
-
|
|
21
|
+
if (o) {
|
|
22
|
+
const h = t.currentTarget.value;
|
|
23
|
+
p(h), w(!0), await n(o, h), w(!1);
|
|
23
24
|
}
|
|
24
25
|
},
|
|
25
|
-
[
|
|
26
|
-
),
|
|
26
|
+
[o, p, n]
|
|
27
|
+
), s = l(
|
|
27
28
|
() => r == null ? void 0 : r.answers.find((t) => t.youVoted === !0),
|
|
28
29
|
[r]
|
|
29
|
-
),
|
|
30
|
+
), m = l(
|
|
30
31
|
() => !!(r != null && r.answers.find((t) => t.correct === !0)),
|
|
31
32
|
[r]
|
|
32
|
-
),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
x && /* @__PURE__ */ s(
|
|
33
|
+
), C = l(() => r ? r.answers.map((t) => ({
|
|
34
|
+
...t,
|
|
35
|
+
questionVoted: !!s,
|
|
36
|
+
youSelected: T === t.id,
|
|
37
|
+
isLoading: f,
|
|
38
|
+
hasCorrectAnswer: m,
|
|
39
|
+
questionType: r.type,
|
|
40
|
+
answerTimeExpired: c,
|
|
41
|
+
questionStatus: r.status,
|
|
42
|
+
// ToDo: Figure out why imageMode is not in the response
|
|
43
|
+
onVote: q
|
|
44
|
+
})) : [], [m, c, f, r, s, q, T]), y = a && (a.case === "trivia" || a.case === "prediction") ? a.value : void 0;
|
|
45
|
+
return /* @__PURE__ */ i(S, { "data-question-header": "true", children: /* @__PURE__ */ i(E, { children: /* @__PURE__ */ g(j, { children: [
|
|
46
|
+
y && /* @__PURE__ */ i(
|
|
47
47
|
b,
|
|
48
48
|
{
|
|
49
|
-
feedbackMessages:
|
|
50
|
-
questionVoted: !!
|
|
51
|
-
questionVotedCorrectly:
|
|
52
|
-
questionType:
|
|
53
|
-
hasCorrectAnswer:
|
|
49
|
+
feedbackMessages: y,
|
|
50
|
+
questionVoted: !!s,
|
|
51
|
+
questionVotedCorrectly: s == null ? void 0 : s.correct,
|
|
52
|
+
questionType: V,
|
|
53
|
+
hasCorrectAnswer: m
|
|
54
54
|
}
|
|
55
55
|
),
|
|
56
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ i(
|
|
57
57
|
I,
|
|
58
58
|
{
|
|
59
|
-
title:
|
|
60
|
-
points:
|
|
59
|
+
title: c ? "Expired" : "To win",
|
|
60
|
+
points: c ? void 0 : 100,
|
|
61
61
|
onTimerExpired: () => v(!0),
|
|
62
62
|
isTimer: !0
|
|
63
63
|
}
|
|
64
64
|
),
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
] }) });
|
|
65
|
+
/* @__PURE__ */ i(k, { children: x }),
|
|
66
|
+
/* @__PURE__ */ i(u, { children: C.map((t) => /* @__PURE__ */ i(O, { ...t }, t.id)) })
|
|
67
|
+
] }) }) });
|
|
68
68
|
};
|
|
69
69
|
export {
|
|
70
|
-
|
|
70
|
+
Y as Vote
|
|
71
71
|
};
|
|
@@ -8,15 +8,15 @@ const o = t.div`
|
|
|
8
8
|
}
|
|
9
9
|
`, n = t.div`
|
|
10
10
|
width: 100%;
|
|
11
|
-
padding: 0px 16px;
|
|
12
|
-
`,
|
|
11
|
+
padding: 16px 16px 0px 16px;
|
|
12
|
+
`, p = t.div`
|
|
13
13
|
font-family: var(--font-serif);
|
|
14
14
|
font-size: 16px;
|
|
15
15
|
color: var(--color-primary-green2);
|
|
16
16
|
font-weight: 400;
|
|
17
17
|
margin: 16px 0px;
|
|
18
18
|
margin-bottom: 16px;
|
|
19
|
-
`,
|
|
19
|
+
`, r = t.div`
|
|
20
20
|
position: relative;
|
|
21
21
|
gap: 8px;
|
|
22
22
|
display: flex;
|
|
@@ -25,6 +25,6 @@ const o = t.div`
|
|
|
25
25
|
export {
|
|
26
26
|
o as Container,
|
|
27
27
|
n as Content,
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
r as Options,
|
|
29
|
+
p as Title
|
|
30
30
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { QuestionType, QuestionImages, ExtendedQuestionAnswer } from '@streamlayer/sdk-web-types';
|
|
2
|
+
import { QuestionType, QuestionImages, QuestionStatus, ExtendedQuestionAnswer } from '@streamlayer/sdk-web-types';
|
|
3
3
|
export type VotingOptionProps = ExtendedQuestionAnswer & {
|
|
4
4
|
questionVoted: boolean;
|
|
5
5
|
youSelected: boolean;
|
|
@@ -7,6 +7,8 @@ export type VotingOptionProps = ExtendedQuestionAnswer & {
|
|
|
7
7
|
hasCorrectAnswer?: boolean;
|
|
8
8
|
questionType: QuestionType;
|
|
9
9
|
imageMode?: QuestionImages;
|
|
10
|
+
answerTimeExpired: boolean;
|
|
11
|
+
questionStatus: QuestionStatus;
|
|
10
12
|
onVote: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
11
13
|
};
|
|
12
14
|
export declare const VotingOption: React.FC<VotingOptionProps>;
|