@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
package/lib/ui/app/masters.js
CHANGED
|
@@ -1,78 +1,131 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
1
|
+
import { jsx as m, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { useStore as C } from "@nanostores/react";
|
|
3
|
+
import { useRef as v, useEffect as F, useMemo as x } from "react";
|
|
4
|
+
import { resetCss as d } from "../theme/theme.js";
|
|
5
|
+
import { ActiveFeature as A, StandaloneFeature as I } from "./Features/index.js";
|
|
6
|
+
import { MastersNavigation as M } from "./Navigation/MastersNavigation/index.js";
|
|
7
|
+
import { SDKNotifications as B } from "./Notifications/index.js";
|
|
8
|
+
import { SDKContainer as L, SDKScrollContainer as j } from "./styles.js";
|
|
9
|
+
import { useMastersApp as D } from "./useMastersApp.js";
|
|
10
|
+
import { MastersContext as E } from "./useMastersContext.js";
|
|
11
|
+
import { useSdkFeature as K } from "./useSdkFeature.js";
|
|
12
|
+
import { useSdkResponsive as O } from "./useSdkResponsive.js";
|
|
13
|
+
import { useSdkScroll as R } from "./useSdkScroll.js";
|
|
14
|
+
import { ChannelsButtonId as T } from "../navigation/button/Channels.js";
|
|
15
|
+
import { LeaderBoardButtonId as b } from "../navigation/button/LeaderBoard.js";
|
|
16
|
+
import { FeaturedGroupsButtonId as w } from "../navigation/button/FeaturedGroups.js";
|
|
16
17
|
import "../theme/breakpoints.js";
|
|
17
18
|
import "../theme/constants.js";
|
|
18
19
|
import "@streamlayer/sdk-web-types";
|
|
19
20
|
import "./Features/FeatureProvider.js";
|
|
20
|
-
import "@
|
|
21
|
+
import "@linaria/react";
|
|
21
22
|
import "@streamlayer/sdk-web-interfaces";
|
|
23
|
+
import "./Features/Gamification/index.js";
|
|
24
|
+
import "../gamification/detail/header/index.js";
|
|
25
|
+
import "../gamification/constants.js";
|
|
26
|
+
import "../gamification/detail/header/styles.js";
|
|
27
|
+
import "../icons/index.js";
|
|
28
|
+
import "../gamification/user-statistics/index.js";
|
|
29
|
+
import "../../utils/common.js";
|
|
30
|
+
import "../gamification/user-statistics/components/rank/index.js";
|
|
31
|
+
import "../gamification/user-statistics/components/rank/styles.js";
|
|
32
|
+
import "../gamification/user-statistics/components/statistic/index.js";
|
|
33
|
+
import "../gamification/user-statistics/components/statistic/styles.js";
|
|
34
|
+
import "../gamification/user-statistics/styles.js";
|
|
35
|
+
import "../modal/index.js";
|
|
36
|
+
import "@linaria/core";
|
|
37
|
+
import "../../index-jRXrW6ie.js";
|
|
38
|
+
import "../../index-uEuzH3jr.js";
|
|
39
|
+
import "../show-in/index.js";
|
|
40
|
+
import "./Features/Gamification/Question.js";
|
|
41
|
+
import "../gamification/detail/sponsor/index.js";
|
|
42
|
+
import "../gamification/vote/index.js";
|
|
43
|
+
import "../gamification/vote/expired-alert/index.js";
|
|
44
|
+
import "../gamification/vote/expired-alert/styles.js";
|
|
45
|
+
import "../gamification/vote/feedback/index.js";
|
|
46
|
+
import "../gamification/vote/feedback/styles.js";
|
|
47
|
+
import "../gamification/vote/styles.js";
|
|
48
|
+
import "../gamification/vote/vote-option/index.js";
|
|
49
|
+
import "../animated-counter/index.js";
|
|
50
|
+
import "react-countup";
|
|
51
|
+
import "../gamification/vote/vote-option/styles.js";
|
|
52
|
+
import "../gamification/vote/win-bar/index.js";
|
|
53
|
+
import "../timer/index.js";
|
|
54
|
+
import "react-countdown-circle-timer";
|
|
55
|
+
import "../gamification/vote/win-bar/styles.js";
|
|
56
|
+
import "../gamification/vote/insight-details/index.js";
|
|
57
|
+
import "../questions/insight/index.js";
|
|
58
|
+
import "../video-player/index.js";
|
|
59
|
+
import "../video-player/styles.js";
|
|
60
|
+
import "../questions/insight/styles.js";
|
|
61
|
+
import "../gamification/vote/insight-details/styles.js";
|
|
62
|
+
import "../gamification/vote/twitter-details/index.js";
|
|
63
|
+
import "../questions/twitter/index.js";
|
|
64
|
+
import "../questions/twitter/account/index.js";
|
|
65
|
+
import "../questions/twitter/account/styles.js";
|
|
66
|
+
import "../questions/twitter/styles.js";
|
|
67
|
+
import "../gamification/vote/twitter-details/styles.js";
|
|
68
|
+
import "./Features/Gamification/Tabs.js";
|
|
69
|
+
import "../gamification/tabs/index.js";
|
|
70
|
+
import "../gamification/tabs/styles.js";
|
|
71
|
+
import "./Features/Gamification/Leaderboard.js";
|
|
72
|
+
import "./useClipboardCopy.js";
|
|
73
|
+
import "../gamification/copyNotification/index.js";
|
|
74
|
+
import "../gamification/copyNotification/styles.js";
|
|
75
|
+
import "../gamification/invite-link/index.js";
|
|
76
|
+
import "../gamification/invite-link/styles.js";
|
|
77
|
+
import "react-virtualized-auto-sizer";
|
|
78
|
+
import "react-window";
|
|
79
|
+
import "react-window-infinite-loader";
|
|
80
|
+
import "../gamification/leaderboard/list-item/styles.js";
|
|
81
|
+
import "../../styles_z07sl8-w40geAFS.js";
|
|
82
|
+
import "../gamification/leaderboard/static.js";
|
|
83
|
+
import "react-infinite-scroller";
|
|
84
|
+
import "../gamification/leaderboard/list-item/index.js";
|
|
85
|
+
import "./Features/Gamification/Friends.js";
|
|
86
|
+
import "../gamification/onboarding/slides/onboarding-invite-card/index.js";
|
|
87
|
+
import "../gamification/onboarding/slides/onboarding-invite-card/styles.js";
|
|
88
|
+
import "./Features/Gamification/QuestionsList.js";
|
|
89
|
+
import "../gamification/question/list/index.js";
|
|
90
|
+
import "../gamification/question/index.js";
|
|
91
|
+
import "../gamification/question/styles.js";
|
|
92
|
+
import "../gamification/question/insight/index.js";
|
|
93
|
+
import "../gamification/question/insight/styles.js";
|
|
94
|
+
import "../gamification/question/twitter/index.js";
|
|
95
|
+
import "../gamification/question/twitter/styles.js";
|
|
96
|
+
import "../button/index.js";
|
|
97
|
+
import "../button/styles.js";
|
|
98
|
+
import "../gamification/question/list/styles.js";
|
|
99
|
+
import "./Features/Gamification/UserSummary.js";
|
|
22
100
|
import "../navigation/masters.js";
|
|
23
|
-
import "@linaria/react";
|
|
24
101
|
import "../navigation/index.js";
|
|
25
|
-
import "../icons/index.js";
|
|
26
102
|
import "../navigation/button/index.js";
|
|
27
103
|
import "../navigation/button/styles.js";
|
|
28
|
-
import "../../index-jRXrW6ie.js";
|
|
29
|
-
import "../../index-uEuzH3jr.js";
|
|
30
104
|
import "@streamlayer/sdk-web-notifications";
|
|
31
|
-
import "../gamification/constants.js";
|
|
32
105
|
import "../gamification/question/notification/index.js";
|
|
33
106
|
import "../gamification/question/notification/insight/index.js";
|
|
34
|
-
import "../video-player/index.js";
|
|
35
|
-
import "../video-player/styles.js";
|
|
36
107
|
import "../gamification/question/notification/insight/styles.js";
|
|
37
108
|
import "../gamification/question/notification/styles.js";
|
|
38
109
|
import "../gamification/question/notification/tweet/index.js";
|
|
39
|
-
import "../questions/twitter/index.js";
|
|
40
|
-
import "../questions/twitter/account/index.js";
|
|
41
|
-
import "../../utils/common.js";
|
|
42
|
-
import "../questions/twitter/account/styles.js";
|
|
43
|
-
import "../questions/twitter/styles.js";
|
|
44
110
|
import "../gamification/question/notification/tweet/styles.js";
|
|
45
111
|
import "../gamification/question/notification/prediction-result/index.js";
|
|
46
|
-
import "../animated-counter/index.js";
|
|
47
|
-
import "react-countup";
|
|
48
112
|
import "../gamification/question/notification/prediction-result/animation-lines/index.js";
|
|
49
113
|
import "../gamification/question/notification/prediction-result/animation-lines/styles.js";
|
|
50
114
|
import "../gamification/question/notification/prediction-result/styles.js";
|
|
51
|
-
import "../show-in/index.js";
|
|
52
|
-
import "@linaria/core";
|
|
53
115
|
import "./Notifications/Onboarding/index.js";
|
|
54
116
|
import "./useImagesPreload.js";
|
|
55
117
|
import "../gamification/onboarding/index.js";
|
|
56
|
-
import "react-virtualized-auto-sizer";
|
|
57
118
|
import "../skeleton/index.js";
|
|
58
119
|
import "../skeleton/styles.js";
|
|
59
120
|
import "../gamification/onboarding/slides/onboarding-instructions/index.js";
|
|
60
121
|
import "../gamification/onboarding/invitingUser/index.js";
|
|
61
122
|
import "../gamification/onboarding/invitingUser/styles.js";
|
|
62
123
|
import "../gamification/onboarding/slides/onboarding-instructions/styles.js";
|
|
63
|
-
import "../gamification/onboarding/slides/onboarding-invite-card/index.js";
|
|
64
|
-
import "./useClipboardCopy.js";
|
|
65
|
-
import "../gamification/copyNotification/index.js";
|
|
66
|
-
import "../gamification/copyNotification/styles.js";
|
|
67
|
-
import "../gamification/onboarding/slides/onboarding-invite-card/styles.js";
|
|
68
124
|
import "../gamification/onboarding/slides/onboarding-rules/index.js";
|
|
69
125
|
import "../gamification/onboarding/slides/onboarding-rules/styles.js";
|
|
70
126
|
import "../gamification/onboarding/slides/onboarding-terms/index.js";
|
|
71
127
|
import "../gamification/onboarding/slides/onboarding-terms/styles.js";
|
|
72
128
|
import "../gamification/onboarding/styles.js";
|
|
73
|
-
import "../button/index.js";
|
|
74
|
-
import "../button/styles.js";
|
|
75
|
-
import "../modal/index.js";
|
|
76
129
|
import "./Notifications/Onboarding/Notification/index.js";
|
|
77
130
|
import "./Notifications/Onboarding/Notification/styles.js";
|
|
78
131
|
import "./Notifications/styles.js";
|
|
@@ -80,71 +133,88 @@ import "../gamification/question/notification/pill/index.js";
|
|
|
80
133
|
import "../gamification/question/notification/pill/styles.js";
|
|
81
134
|
import "lodash.throttle";
|
|
82
135
|
import "../../index-keh7OLCY.js";
|
|
83
|
-
const
|
|
84
|
-
const [,
|
|
85
|
-
return /* @__PURE__ */
|
|
136
|
+
const G = ({ sdk: t, className: e, scrollStore: n, appNode: r, scrollNode: p, headerNode: o, responsiveStore: i }) => {
|
|
137
|
+
const [, s] = K(t);
|
|
138
|
+
return /* @__PURE__ */ m(
|
|
86
139
|
A,
|
|
87
140
|
{
|
|
88
|
-
className:
|
|
141
|
+
className: e,
|
|
89
142
|
scrollNode: p,
|
|
90
|
-
appNode:
|
|
91
|
-
scrollStore:
|
|
92
|
-
feature:
|
|
93
|
-
headerNode:
|
|
94
|
-
responsiveStore:
|
|
143
|
+
appNode: r,
|
|
144
|
+
scrollStore: n,
|
|
145
|
+
feature: s,
|
|
146
|
+
headerNode: o,
|
|
147
|
+
responsiveStore: i,
|
|
95
148
|
sdk: t
|
|
96
149
|
}
|
|
97
150
|
);
|
|
98
|
-
},
|
|
99
|
-
const
|
|
100
|
-
|
|
151
|
+
}, P = ({ sdk: t, className: e, appNode: n, responsiveStore: r }) => {
|
|
152
|
+
const p = C(t.featuresList.getStore());
|
|
153
|
+
return p ? Array.from(p, (o) => {
|
|
154
|
+
const i = t.getFeature(o);
|
|
155
|
+
return i ? /* @__PURE__ */ m(
|
|
156
|
+
I,
|
|
157
|
+
{
|
|
158
|
+
className: e,
|
|
159
|
+
appNode: n,
|
|
160
|
+
feature: i,
|
|
161
|
+
responsiveStore: r,
|
|
162
|
+
sdk: t
|
|
163
|
+
},
|
|
164
|
+
o
|
|
165
|
+
) : null;
|
|
166
|
+
}) : null;
|
|
167
|
+
}, fo = ({ sdk: t, overlays: e, children: n }) => {
|
|
168
|
+
const r = v(null), p = v(null), [o] = O(r), [i, s] = R(r, o), { sdkEnabled: l, sdkReady: c, activeOverlay: a, activateAndLoadOverlay: S, activateEventWithId: h, deactivate: g, isLogged: N } = D(t);
|
|
169
|
+
F(() => {
|
|
101
170
|
import("./Features/Gamification/gamification-feature.js");
|
|
102
171
|
}, []);
|
|
103
|
-
const
|
|
104
|
-
return /* @__PURE__ */
|
|
105
|
-
l && /* @__PURE__ */
|
|
106
|
-
|
|
172
|
+
const y = x(() => ({ sdk: t }), [t]);
|
|
173
|
+
return /* @__PURE__ */ m(E.Provider, { value: y, children: /* @__PURE__ */ f(L, { ref: r, children: [
|
|
174
|
+
l && /* @__PURE__ */ m(
|
|
175
|
+
M,
|
|
107
176
|
{
|
|
108
177
|
ref: p,
|
|
109
|
-
sdkReady:
|
|
110
|
-
activeOverlay:
|
|
111
|
-
className:
|
|
112
|
-
setActiveOverlay: (
|
|
178
|
+
sdkReady: c,
|
|
179
|
+
activeOverlay: a,
|
|
180
|
+
className: d,
|
|
181
|
+
setActiveOverlay: (u) => S("", u),
|
|
113
182
|
scrollToTop: () => {
|
|
114
|
-
var
|
|
115
|
-
return (
|
|
183
|
+
var u;
|
|
184
|
+
return (u = i.current) == null ? void 0 : u.scrollTo(0, 0);
|
|
116
185
|
},
|
|
117
|
-
responsiveStore:
|
|
186
|
+
responsiveStore: o
|
|
118
187
|
}
|
|
119
188
|
),
|
|
120
|
-
/* @__PURE__ */ f(
|
|
121
|
-
|
|
122
|
-
|
|
189
|
+
/* @__PURE__ */ f(j, { className: "sl-hide-on-modal", ref: i, "data-nav": l.toString(), children: [
|
|
190
|
+
c && /* @__PURE__ */ m(
|
|
191
|
+
B,
|
|
123
192
|
{
|
|
124
193
|
sdk: t,
|
|
125
|
-
scrollNode:
|
|
194
|
+
scrollNode: i,
|
|
126
195
|
headerNode: p,
|
|
127
|
-
appNode:
|
|
128
|
-
scrollStore:
|
|
129
|
-
responsiveStore:
|
|
196
|
+
appNode: r,
|
|
197
|
+
scrollStore: s,
|
|
198
|
+
responsiveStore: o
|
|
130
199
|
}
|
|
131
200
|
),
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
201
|
+
/* @__PURE__ */ m("div", { style: !l || a === T ? {} : { display: "none" }, children: n && n({ activateEventWithId: h, deactivate: g }) }),
|
|
202
|
+
e && a === b && e[a],
|
|
203
|
+
c && a === w && /* @__PURE__ */ m(
|
|
204
|
+
G,
|
|
136
205
|
{
|
|
137
|
-
scrollStore:
|
|
138
|
-
responsiveStore:
|
|
139
|
-
scrollNode:
|
|
140
|
-
appNode:
|
|
206
|
+
scrollStore: s,
|
|
207
|
+
responsiveStore: o,
|
|
208
|
+
scrollNode: i,
|
|
209
|
+
appNode: r,
|
|
141
210
|
headerNode: p,
|
|
142
|
-
className:
|
|
211
|
+
className: d,
|
|
143
212
|
sdk: t
|
|
144
213
|
}
|
|
145
|
-
)
|
|
214
|
+
),
|
|
215
|
+
c && /* @__PURE__ */ m(P, { responsiveStore: o, appNode: r, className: d, sdk: t })
|
|
146
216
|
] }),
|
|
147
|
-
l && !
|
|
217
|
+
l && !N && /* @__PURE__ */ m(
|
|
148
218
|
"div",
|
|
149
219
|
{
|
|
150
220
|
style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" },
|
|
@@ -154,5 +224,5 @@ const b = ({ sdk: t, className: s, scrollStore: a, appNode: o, scrollNode: p, he
|
|
|
154
224
|
] }) });
|
|
155
225
|
};
|
|
156
226
|
export {
|
|
157
|
-
|
|
227
|
+
fo as MastersApp
|
|
158
228
|
};
|
|
@@ -9,11 +9,12 @@ import "../navigation/button/LeaderBoard.js";
|
|
|
9
9
|
import "@linaria/react";
|
|
10
10
|
import "../icons/index.js";
|
|
11
11
|
import "../navigation/button/index.js";
|
|
12
|
+
import "@linaria/core";
|
|
12
13
|
import "../navigation/button/styles.js";
|
|
13
14
|
import "../navigation/masters.js";
|
|
14
15
|
import "../navigation/index.js";
|
|
15
16
|
import "../theme/constants.js";
|
|
16
|
-
const
|
|
17
|
+
const D = (e) => {
|
|
17
18
|
const c = y(""), [S, o] = d(!1), E = A(e.status), a = A(e.userId()), f = A(e.getActiveFeature()), n = E === "ready", [l, r] = d(i), m = z(
|
|
18
19
|
(t, s) => {
|
|
19
20
|
r(s), s === i ? (t && e.createEventSession(t), window.requestAnimationFrame(() => {
|
|
@@ -71,5 +72,5 @@ const j = (e) => {
|
|
|
71
72
|
};
|
|
72
73
|
};
|
|
73
74
|
export {
|
|
74
|
-
|
|
75
|
+
D as useMastersApp
|
|
75
76
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Question as b } from "../index.js";
|
|
3
|
-
import { Insight as
|
|
4
|
-
import { Twitter as
|
|
5
|
-
import {
|
|
3
|
+
import { Insight as c } from "../insight/index.js";
|
|
4
|
+
import { Twitter as f } from "../twitter/index.js";
|
|
5
|
+
import { pauseAllVideos as l } from "../../../video-player/index.js";
|
|
6
|
+
import { QuestionsContainer as d } from "./styles.js";
|
|
6
7
|
import "@streamlayer/sdk-web-types";
|
|
7
8
|
import "../../constants.js";
|
|
8
9
|
import "../styles.js";
|
|
@@ -10,9 +11,8 @@ import "@linaria/react";
|
|
|
10
11
|
import "../../../icons/index.js";
|
|
11
12
|
import "react";
|
|
12
13
|
import "../../../questions/insight/index.js";
|
|
13
|
-
import "../../../video-player/index.js";
|
|
14
|
-
import "../../../video-player/styles.js";
|
|
15
14
|
import "../../../questions/insight/styles.js";
|
|
15
|
+
import "../../../video-player/styles.js";
|
|
16
16
|
import "../insight/styles.js";
|
|
17
17
|
import "../../../questions/twitter/index.js";
|
|
18
18
|
import "../../../questions/twitter/account/index.js";
|
|
@@ -22,31 +22,44 @@ import "../../../questions/twitter/styles.js";
|
|
|
22
22
|
import "../twitter/styles.js";
|
|
23
23
|
import "../../../button/index.js";
|
|
24
24
|
import "../../../button/styles.js";
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
25
|
+
const K = ({ questions: r, openQuestion: p, controlVideo: m }) => {
|
|
26
|
+
const o = (t) => {
|
|
27
|
+
l(), p(t);
|
|
28
|
+
};
|
|
29
|
+
return /* @__PURE__ */ e(d, { children: r == null ? void 0 : r.map((t) => {
|
|
30
|
+
var n, u, s;
|
|
31
|
+
if (t.type === "question" && ((n = t.attributes) == null ? void 0 : n.attributes.case) === "question") {
|
|
32
|
+
const i = t.attributes.attributes.value;
|
|
33
|
+
return /* @__PURE__ */ e(b, { openQuestion: o, ...i }, i.questionId);
|
|
34
|
+
}
|
|
35
|
+
if (t.type === "insight" && ((u = t.attributes) == null ? void 0 : u.attributes.case) === "insight") {
|
|
36
|
+
const i = t.attributes.attributes.value;
|
|
37
|
+
return /* @__PURE__ */ e(
|
|
38
|
+
c,
|
|
39
|
+
{
|
|
40
|
+
openInsight: o,
|
|
41
|
+
controlVideo: m,
|
|
42
|
+
...i
|
|
43
|
+
},
|
|
44
|
+
i.questionId
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
if (t.type === "tweet" && ((s = t.attributes) == null ? void 0 : s.attributes.case) === "tweet") {
|
|
48
|
+
const i = t.attributes.attributes.value, a = t.attributes.id;
|
|
49
|
+
return /* @__PURE__ */ e(
|
|
50
|
+
f,
|
|
51
|
+
{
|
|
52
|
+
openTweet: o,
|
|
53
|
+
controlVideo: m,
|
|
54
|
+
...i,
|
|
55
|
+
tweetId: a
|
|
56
|
+
},
|
|
57
|
+
a
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}) });
|
|
62
|
+
};
|
|
50
63
|
export {
|
|
51
|
-
|
|
64
|
+
K as QuestionList
|
|
52
65
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as a, jsx as o, Fragment as d } from "react/jsx-runtime";
|
|
2
|
-
import { QuestionType as
|
|
2
|
+
import { QuestionType as m } from "@streamlayer/sdk-web-types";
|
|
3
3
|
import { QuestionTypeData as T } from "../../constants.js";
|
|
4
4
|
import { Insight as f } from "./insight/index.js";
|
|
5
|
-
import { Container as
|
|
5
|
+
import { Container as E, CloseIconWrap as I, CloseIcon as h, Header as C, TypeIcon as A, TypeName as W, Question as s, AnswerButton as x } from "./styles.js";
|
|
6
6
|
import { Tweet as D } from "./tweet/index.js";
|
|
7
7
|
import "../../../video-player/index.js";
|
|
8
8
|
import "react";
|
|
@@ -16,37 +16,34 @@ import "../../../../utils/common.js";
|
|
|
16
16
|
import "../../../questions/twitter/account/styles.js";
|
|
17
17
|
import "../../../questions/twitter/styles.js";
|
|
18
18
|
import "./tweet/styles.js";
|
|
19
|
-
const
|
|
20
|
-
close:
|
|
21
|
-
action:
|
|
19
|
+
const J = ({
|
|
20
|
+
close: e,
|
|
21
|
+
action: t,
|
|
22
22
|
controlVideo: l,
|
|
23
|
-
data: { questionType: r, question:
|
|
23
|
+
data: { questionType: r, question: i, insight: n, tweet: c }
|
|
24
24
|
}) => {
|
|
25
25
|
const p = T[r];
|
|
26
|
-
return p ? /* @__PURE__ */ a(
|
|
27
|
-
/* @__PURE__ */ o(
|
|
28
|
-
r !==
|
|
26
|
+
return p ? /* @__PURE__ */ a(E, { style: r === m.TWEET ? { paddingTop: "12px" } : {}, children: [
|
|
27
|
+
/* @__PURE__ */ o(I, { onClick: e, children: /* @__PURE__ */ o(h, { name: "icon-cross" }) }),
|
|
28
|
+
r !== m.TWEET && /* @__PURE__ */ a(C, { children: [
|
|
29
29
|
/* @__PURE__ */ o(
|
|
30
|
-
|
|
30
|
+
A,
|
|
31
31
|
{
|
|
32
|
-
"data-type-trivia": r ===
|
|
33
|
-
"data-type-poll": r ===
|
|
32
|
+
"data-type-trivia": r === m.TRIVIA,
|
|
33
|
+
"data-type-poll": r === m.POLL,
|
|
34
34
|
name: p.iconName
|
|
35
35
|
}
|
|
36
36
|
),
|
|
37
|
-
/* @__PURE__ */ o(
|
|
37
|
+
/* @__PURE__ */ o(W, { children: p.label })
|
|
38
38
|
] }),
|
|
39
|
-
r ===
|
|
40
|
-
r ===
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
r !== t.FACTOID && r !== t.TWEET && /* @__PURE__ */ a(d, { children: [
|
|
45
|
-
/* @__PURE__ */ o(W, { children: m == null ? void 0 : m.title }),
|
|
46
|
-
/* @__PURE__ */ o(x, { onClick: i, children: "Answer" })
|
|
39
|
+
r === m.FACTOID && n && /* @__PURE__ */ o(f, { ...n, action: t, controlVideo: l }),
|
|
40
|
+
r === m.TWEET && c && /* @__PURE__ */ o(D, { ...c, action: t, controlVideo: l }),
|
|
41
|
+
r !== m.FACTOID && r !== m.TWEET && /* @__PURE__ */ a(d, { children: [
|
|
42
|
+
/* @__PURE__ */ o(s, { children: i == null ? void 0 : i.title }),
|
|
43
|
+
/* @__PURE__ */ o(x, { onClick: t, children: "Answer" })
|
|
47
44
|
] })
|
|
48
45
|
] }) : null;
|
|
49
46
|
};
|
|
50
47
|
export {
|
|
51
|
-
|
|
48
|
+
J as Notification
|
|
52
49
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as o, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { TwitterContent as m } from "../../../questions/twitter/index.js";
|
|
3
3
|
import { Container as e, Quote as n, ActionButton as p } from "./styles.js";
|
|
4
4
|
import "../../../video-player/index.js";
|
|
@@ -12,10 +12,10 @@ import "../../../questions/twitter/account/styles.js";
|
|
|
12
12
|
import "../../../questions/twitter/styles.js";
|
|
13
13
|
import "../../../button/index.js";
|
|
14
14
|
import "../../../button/styles.js";
|
|
15
|
-
const k = ({ openTweet:
|
|
15
|
+
const k = ({ openTweet: r, ...t }) => /* @__PURE__ */ o(e, { children: [
|
|
16
16
|
t.title && /* @__PURE__ */ i(n, { children: t.title }),
|
|
17
17
|
/* @__PURE__ */ i(m, { ...t }),
|
|
18
|
-
|
|
18
|
+
r && /* @__PURE__ */ i(p, { onClick: () => r(t.tweetId), children: "View Insight" })
|
|
19
19
|
] });
|
|
20
20
|
export {
|
|
21
21
|
k as Twitter
|
|
@@ -1,66 +1,69 @@
|
|
|
1
|
-
import { jsxs as r, Fragment as
|
|
2
|
-
import { QuestionType as
|
|
1
|
+
import { jsxs as r, Fragment as t, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { QuestionType as c, QuestionStatus as f } from "@streamlayer/sdk-web-types";
|
|
3
3
|
import { SvgIcon as l } from "../../../icons/index.js";
|
|
4
|
-
import { Container as
|
|
4
|
+
import { Container as Q, FeedbackIconWrap as h, FeedbackHeader as p, FeedbackDescription as d, FeedbackText as s, IconPrediction as W, DynamicWrap as L, FeedbackTitle as j } from "./styles.js";
|
|
5
5
|
import "@linaria/react";
|
|
6
6
|
import "react";
|
|
7
|
-
const
|
|
7
|
+
const G = ({
|
|
8
8
|
feedbackMessages: e,
|
|
9
|
-
questionVotedCorrectly:
|
|
9
|
+
questionVotedCorrectly: u,
|
|
10
10
|
questionVoted: a,
|
|
11
|
-
questionType:
|
|
11
|
+
questionType: n,
|
|
12
12
|
hasCorrectAnswer: F,
|
|
13
13
|
questionStatus: T,
|
|
14
|
-
showExpiredNotification:
|
|
15
|
-
showClosedNotificationTrivia:
|
|
14
|
+
showExpiredNotification: I,
|
|
15
|
+
showClosedNotificationTrivia: b,
|
|
16
16
|
votedInCurrentRender: m,
|
|
17
|
-
votedAfterQuestionClosed:
|
|
18
|
-
enteredAnActiveQuestion:
|
|
19
|
-
marketClosed:
|
|
17
|
+
votedAfterQuestionClosed: N,
|
|
18
|
+
enteredAnActiveQuestion: k,
|
|
19
|
+
marketClosed: S
|
|
20
20
|
}) => {
|
|
21
|
-
const
|
|
22
|
-
if (!
|
|
21
|
+
const E = a && (n === c.TRIVIA || n === c.PREDICTION) && m && T !== f.RESOLVED, w = n === c.PREDICTION && !F, x = S && n === c.PREDICTION && !a && !k || n === c.PREDICTION && N && m && k, D = E && w, O = E && F, y = n === c.PREDICTION && a && m && F, R = a && n === c.POLL && m;
|
|
22
|
+
if (!I && !b && !D && !O && !x && !R && !y)
|
|
23
23
|
return null;
|
|
24
|
-
const P =
|
|
25
|
-
return /* @__PURE__ */ r(
|
|
26
|
-
|
|
24
|
+
const P = u ? "correct" : "incorrect", o = u ? e == null ? void 0 : e.correctFeedback : e == null ? void 0 : e.incorrectFeedback;
|
|
25
|
+
return /* @__PURE__ */ r(Q, { "data-isPrediction": w, children: [
|
|
26
|
+
I && /* @__PURE__ */ r(t, { children: [
|
|
27
27
|
/* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(l, { name: "questionExpired" }) }),
|
|
28
28
|
/* @__PURE__ */ r("div", { children: [
|
|
29
29
|
/* @__PURE__ */ i(p, { children: /* @__PURE__ */ i(d, { children: "Question Expired" }) }),
|
|
30
30
|
/* @__PURE__ */ i(s, { children: "You can still answer to see if you're correct, but no points are awarded for expired questions." })
|
|
31
31
|
] })
|
|
32
32
|
] }),
|
|
33
|
-
|
|
33
|
+
b && /* @__PURE__ */ r(t, { children: [
|
|
34
34
|
/* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(l, { name: "questionExpired" }) }),
|
|
35
35
|
/* @__PURE__ */ r("div", { children: [
|
|
36
36
|
/* @__PURE__ */ i(p, { children: /* @__PURE__ */ i(d, { children: "Question Closed" }) }),
|
|
37
37
|
/* @__PURE__ */ i(s, { children: "This question was answered after the moderator closed the question. So the points for this answer won’t tally." })
|
|
38
38
|
] })
|
|
39
39
|
] }),
|
|
40
|
-
x && /* @__PURE__ */ r(
|
|
40
|
+
x && /* @__PURE__ */ r(t, { children: [
|
|
41
41
|
/* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(l, { name: "questionExpired" }) }),
|
|
42
42
|
/* @__PURE__ */ r("div", { children: [
|
|
43
43
|
/* @__PURE__ */ i(p, { children: /* @__PURE__ */ i(d, { children: "Question Closed" }) }),
|
|
44
44
|
/* @__PURE__ */ i(s, { children: "This event has already taken place, so the ability to make a prediction on its outcome is no longer available." })
|
|
45
45
|
] })
|
|
46
46
|
] }),
|
|
47
|
-
D && /* @__PURE__ */ r(
|
|
48
|
-
/* @__PURE__ */ i(
|
|
49
|
-
/* @__PURE__ */
|
|
47
|
+
D && /* @__PURE__ */ r(t, { children: [
|
|
48
|
+
/* @__PURE__ */ i(W, { name: "icon-prediction" }),
|
|
49
|
+
/* @__PURE__ */ r(d, { children: [
|
|
50
|
+
"Your pick has been recorded. ",
|
|
51
|
+
/* @__PURE__ */ i(L, { children: "We’ll notify you of the result." })
|
|
52
|
+
] })
|
|
50
53
|
] }),
|
|
51
|
-
|
|
54
|
+
R && /* @__PURE__ */ r(t, { children: [
|
|
52
55
|
/* @__PURE__ */ i(h, { "data-feedback-type": "correct", children: /* @__PURE__ */ i(l, { name: "correct" }) }),
|
|
53
56
|
/* @__PURE__ */ i(d, { children: "Thanks for answering. Please stay tuned for the next question." })
|
|
54
57
|
] }),
|
|
55
|
-
(O ||
|
|
58
|
+
(O || y) && /* @__PURE__ */ r(t, { children: [
|
|
56
59
|
/* @__PURE__ */ i(h, { "data-feedback-type": P, children: /* @__PURE__ */ i(l, { name: P }) }),
|
|
57
60
|
/* @__PURE__ */ i("div", { children: /* @__PURE__ */ r(p, { children: [
|
|
58
|
-
/* @__PURE__ */ i(j, { "data-feedback-type": P, children:
|
|
59
|
-
/* @__PURE__ */ i(d, { children:
|
|
61
|
+
/* @__PURE__ */ i(j, { "data-feedback-type": P, children: o == null ? void 0 : o.title }),
|
|
62
|
+
/* @__PURE__ */ i(d, { children: o == null ? void 0 : o.description })
|
|
60
63
|
] }) })
|
|
61
64
|
] })
|
|
62
65
|
] });
|
|
63
66
|
};
|
|
64
67
|
export {
|
|
65
|
-
|
|
68
|
+
G as Feedback
|
|
66
69
|
};
|
|
@@ -6,3 +6,4 @@ export declare const FeedbackHeader: import("@linaria/react").StyledComponent<im
|
|
|
6
6
|
export declare const FeedbackTitle: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
|
|
7
7
|
export declare const FeedbackDescription: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
|
|
8
8
|
export declare const FeedbackText: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
9
|
+
export declare const DynamicWrap: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
|