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