@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.
Files changed (32) hide show
  1. package/lib/assets/style.css +1 -1
  2. package/lib/ui/app/Features/FeatureProvider.d.ts +1 -0
  3. package/lib/ui/app/Features/FeatureProvider.js +34 -6
  4. package/lib/ui/app/Features/Gamification/Friends.js +24 -21
  5. package/lib/ui/app/Features/Gamification/gamification-feature.js +1 -1
  6. package/lib/ui/app/Features/Gamification/index.d.ts +10 -0
  7. package/lib/ui/app/Features/Gamification/index.js +68 -67
  8. package/lib/ui/app/Features/index.d.ts +8 -0
  9. package/lib/ui/app/Features/index.js +112 -19
  10. package/lib/ui/app/Navigation/MastersNavigation/index.js +5 -4
  11. package/lib/ui/app/Navigation/index.js +7 -6
  12. package/lib/ui/app/masters.js +153 -83
  13. package/lib/ui/app/useMastersApp.js +3 -2
  14. package/lib/ui/gamification/question/list/index.js +45 -32
  15. package/lib/ui/gamification/question/notification/index.js +19 -22
  16. package/lib/ui/gamification/question/twitter/index.js +3 -3
  17. package/lib/ui/gamification/vote/feedback/index.js +29 -26
  18. package/lib/ui/gamification/vote/feedback/styles.d.ts +1 -0
  19. package/lib/ui/gamification/vote/feedback/styles.js +9 -4
  20. package/lib/ui/gamification/vote/index.js +52 -45
  21. package/lib/ui/icons/index.js +90 -25
  22. package/lib/ui/navigation/button/Channels.js +6 -5
  23. package/lib/ui/navigation/button/FeaturedGroups.js +4 -3
  24. package/lib/ui/navigation/button/LeaderBoard.js +6 -5
  25. package/lib/ui/navigation/button/index.js +20 -7
  26. package/lib/ui/navigation/button/styles.d.ts +3 -0
  27. package/lib/ui/navigation/button/styles.js +9 -6
  28. package/lib/ui/questions/insight/index.js +15 -16
  29. package/lib/ui/video-player/index.d.ts +1 -0
  30. package/lib/ui/video-player/index.js +44 -37
  31. package/lib/utils/createDemo.js +6 -1
  32. package/package.json +14 -14
@@ -1,78 +1,131 @@
1
- import { jsx as r, jsxs as f } from "react/jsx-runtime";
2
- import { useRef as u, useEffect as C, useMemo as x } from "react";
3
- import { resetCss as v } from "../theme/theme.js";
4
- import { ActiveFeature as A } from "./Features/index.js";
5
- import { MastersNavigation as I } from "./Navigation/MastersNavigation/index.js";
6
- import { SDKNotifications as M } from "./Notifications/index.js";
7
- import { SDKContainer as B, SDKScrollContainer as F } from "./styles.js";
8
- import { useMastersApp as j } from "./useMastersApp.js";
9
- import { MastersContext as D } from "./useMastersContext.js";
10
- import { useSdkFeature as E } from "./useSdkFeature.js";
11
- import { useSdkResponsive as K } from "./useSdkResponsive.js";
12
- import { useSdkScroll as L } from "./useSdkScroll.js";
13
- import { ChannelsButtonId as O } from "../navigation/button/Channels.js";
14
- import { LeaderBoardButtonId as R } from "../navigation/button/LeaderBoard.js";
15
- import { FeaturedGroupsButtonId as T } from "../navigation/button/FeaturedGroups.js";
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 "@nanostores/react";
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 b = ({ sdk: t, className: s, scrollStore: a, appNode: o, scrollNode: p, headerNode: i, responsiveStore: m }) => {
84
- const [, n] = E(t);
85
- return /* @__PURE__ */ r(
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: s,
141
+ className: e,
89
142
  scrollNode: p,
90
- appNode: o,
91
- scrollStore: a,
92
- feature: n,
93
- headerNode: i,
94
- responsiveStore: m,
143
+ appNode: r,
144
+ scrollStore: n,
145
+ feature: s,
146
+ headerNode: o,
147
+ responsiveStore: i,
95
148
  sdk: t
96
149
  }
97
150
  );
98
- }, co = ({ sdk: t, overlays: s, children: a }) => {
99
- const o = u(null), p = u(null), [i] = K(o), [m, n] = L(o, i), { sdkEnabled: l, sdkReady: d, activeOverlay: e, activateAndLoadOverlay: S, activateEventWithId: h, deactivate: g, isLogged: y } = j(t);
100
- C(() => {
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 N = x(() => ({ sdk: t }), [t]);
104
- return /* @__PURE__ */ r(D.Provider, { value: N, children: /* @__PURE__ */ f(B, { ref: o, children: [
105
- l && /* @__PURE__ */ r(
106
- I,
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: d,
110
- activeOverlay: e,
111
- className: v,
112
- setActiveOverlay: (c) => S("", c),
178
+ sdkReady: c,
179
+ activeOverlay: a,
180
+ className: d,
181
+ setActiveOverlay: (u) => S("", u),
113
182
  scrollToTop: () => {
114
- var c;
115
- return (c = m.current) == null ? void 0 : c.scrollTo(0, 0);
183
+ var u;
184
+ return (u = i.current) == null ? void 0 : u.scrollTo(0, 0);
116
185
  },
117
- responsiveStore: i
186
+ responsiveStore: o
118
187
  }
119
188
  ),
120
- /* @__PURE__ */ f(F, { className: "sl-hide-on-modal", ref: m, "data-nav": l.toString(), children: [
121
- d && /* @__PURE__ */ r(
122
- M,
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: m,
194
+ scrollNode: i,
126
195
  headerNode: p,
127
- appNode: o,
128
- scrollStore: n,
129
- responsiveStore: i
196
+ appNode: r,
197
+ scrollStore: s,
198
+ responsiveStore: o
130
199
  }
131
200
  ),
132
- /* @__PURE__ */ r("div", { style: !l || e === O ? {} : { display: "none" }, children: a && a({ activateEventWithId: h, deactivate: g }) }),
133
- s && e === R && s[e],
134
- d && e === T && /* @__PURE__ */ r(
135
- b,
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: n,
138
- responsiveStore: i,
139
- scrollNode: m,
140
- appNode: o,
206
+ scrollStore: s,
207
+ responsiveStore: o,
208
+ scrollNode: i,
209
+ appNode: r,
141
210
  headerNode: p,
142
- className: v,
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 && !y && /* @__PURE__ */ r(
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
- co as MastersApp
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 j = (e) => {
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
- j as useMastersApp
75
+ D as useMastersApp
75
76
  };
@@ -1,8 +1,9 @@
1
- import { jsx as r } from "react/jsx-runtime";
1
+ import { jsx as e } from "react/jsx-runtime";
2
2
  import { Question as b } from "../index.js";
3
- import { Insight as p } from "../insight/index.js";
4
- import { Twitter as c } from "../twitter/index.js";
5
- import { QuestionsContainer as f } from "./styles.js";
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 J = ({ questions: e, openQuestion: m, controlVideo: o }) => /* @__PURE__ */ r(f, { children: e == null ? void 0 : e.map((t) => {
26
- var u, a, n;
27
- if (t.type === "question" && ((u = t.attributes) == null ? void 0 : u.attributes.case) === "question") {
28
- const i = t.attributes.attributes.value;
29
- return /* @__PURE__ */ r(b, { openQuestion: m, ...i }, i.questionId);
30
- }
31
- if (t.type === "insight" && ((a = t.attributes) == null ? void 0 : a.attributes.case) === "insight") {
32
- const i = t.attributes.attributes.value;
33
- return /* @__PURE__ */ r(p, { openInsight: m, controlVideo: o, ...i }, i.questionId);
34
- }
35
- if (t.type === "tweet" && ((n = t.attributes) == null ? void 0 : n.attributes.case) === "tweet") {
36
- const i = t.attributes.attributes.value, s = t.attributes.id;
37
- return /* @__PURE__ */ r(
38
- c,
39
- {
40
- openTweet: m,
41
- controlVideo: o,
42
- ...i,
43
- tweetId: s
44
- },
45
- s
46
- );
47
- }
48
- return null;
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
- J as QuestionList
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 t } from "@streamlayer/sdk-web-types";
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 h, CloseIconWrap as E, CloseIcon as I, Header as C, TypeIcon as s, TypeName as A, Question as W, AnswerButton as x } from "./styles.js";
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 G = ({
20
- close: n,
21
- action: i,
19
+ const J = ({
20
+ close: e,
21
+ action: t,
22
22
  controlVideo: l,
23
- data: { questionType: r, question: m, insight: e, tweet: c }
23
+ data: { questionType: r, question: i, insight: n, tweet: c }
24
24
  }) => {
25
25
  const p = T[r];
26
- return p ? /* @__PURE__ */ a(h, { style: r === t.TWEET ? { paddingTop: "12px" } : {}, children: [
27
- /* @__PURE__ */ o(E, { onClick: n, children: /* @__PURE__ */ o(I, { name: "icon-cross" }) }),
28
- r !== t.TWEET && /* @__PURE__ */ a(C, { children: [
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
- s,
30
+ A,
31
31
  {
32
- "data-type-trivia": r === t.TRIVIA,
33
- "data-type-poll": r === t.POLL,
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(A, { children: p.label })
37
+ /* @__PURE__ */ o(W, { children: p.label })
38
38
  ] }),
39
- r === t.FACTOID && /* @__PURE__ */ o(f, { ...e, action: i, controlVideo: l }),
40
- r === t.TWEET && // ToDo: connect with real Api data
41
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
42
- // @ts-ignore
43
- /* @__PURE__ */ o(D, { ...c, action: i }),
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
- G as Notification
48
+ J as Notification
52
49
  };
@@ -1,4 +1,4 @@
1
- import { jsxs as r, jsx as i } from "react/jsx-runtime";
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: o, ...t }) => /* @__PURE__ */ r(e, { children: [
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
- o && /* @__PURE__ */ i(p, { onClick: () => o(t.tweetId), children: "View Insight" })
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 o, jsx as i } from "react/jsx-runtime";
2
- import { QuestionType as n, QuestionStatus as Q } from "@streamlayer/sdk-web-types";
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 f, FeedbackIconWrap as h, FeedbackHeader as p, FeedbackDescription as d, FeedbackText as s, IconPrediction as L, FeedbackTitle as j } from "./styles.js";
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 B = ({
7
+ const G = ({
8
8
  feedbackMessages: e,
9
- questionVotedCorrectly: I,
9
+ questionVotedCorrectly: u,
10
10
  questionVoted: a,
11
- questionType: c,
11
+ questionType: n,
12
12
  hasCorrectAnswer: F,
13
13
  questionStatus: T,
14
- showExpiredNotification: u,
15
- showClosedNotificationTrivia: w,
14
+ showExpiredNotification: I,
15
+ showClosedNotificationTrivia: b,
16
16
  votedInCurrentRender: m,
17
- votedAfterQuestionClosed: y,
18
- enteredAnActiveQuestion: E,
19
- marketClosed: N
17
+ votedAfterQuestionClosed: N,
18
+ enteredAnActiveQuestion: k,
19
+ marketClosed: S
20
20
  }) => {
21
- const b = a && (c === n.TRIVIA || c === n.PREDICTION) && m && T !== Q.RESOLVED, k = c === n.PREDICTION && !F, x = N && c === n.PREDICTION && !a && !E || c === n.PREDICTION && y && m && E, D = b && k, O = b && F, R = c === n.PREDICTION && a && m && F, S = a && c === n.POLL && m;
22
- if (!u && !w && !D && !O && !x && !S && !R)
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 = I ? "correct" : "incorrect", t = I ? e == null ? void 0 : e.correctFeedback : e == null ? void 0 : e.incorrectFeedback;
25
- return /* @__PURE__ */ r(f, { "data-isPrediction": k, children: [
26
- u && /* @__PURE__ */ r(o, { children: [
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
- w && /* @__PURE__ */ r(o, { children: [
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(o, { children: [
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(o, { children: [
48
- /* @__PURE__ */ i(L, { name: "icon-prediction" }),
49
- /* @__PURE__ */ i(d, { children: "Stay tuned to see if your prediction was correct." })
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
- S && /* @__PURE__ */ r(o, { children: [
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 || R) && /* @__PURE__ */ r(o, { children: [
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: t == null ? void 0 : t.title }),
59
- /* @__PURE__ */ i(d, { children: t == null ? void 0 : t.description })
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
- B as Feedback
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>>;