@streamlayer/react-ui 1.11.4 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/lib/app/app/Advertisement/index.d.ts +1 -0
  2. package/lib/app/app/Advertisement/index.js +86 -67
  3. package/lib/app/app/Features/Gamification/Tabs.js +13 -13
  4. package/lib/app/app/Navigation/index.js +70 -64
  5. package/lib/app/app/Notifications/Onboarding/index.js +66 -72
  6. package/lib/app/app/Notifications/index.d.ts +1 -0
  7. package/lib/app/app/Notifications/index.js +76 -72
  8. package/lib/app/app/index.js +28 -27
  9. package/lib/app/app/story/index.d.ts +3 -1
  10. package/lib/app/app/story/index.js +29 -26
  11. package/lib/app/app/story/promotion/video.js +34 -34
  12. package/lib/app/app/styles.d.ts +5 -0
  13. package/lib/app/app/styles.js +25 -20
  14. package/lib/assets/style.css +1 -1
  15. package/lib/ui/advertisement/index.d.ts +3 -0
  16. package/lib/ui/advertisement/index.js +25 -19
  17. package/lib/ui/advertisement/mock.d.ts +1 -0
  18. package/lib/ui/advertisement/mock.js +39 -5
  19. package/lib/ui/advertisement/overlay/externalAd/controls.d.ts +5 -0
  20. package/lib/ui/advertisement/overlay/externalAd/controls.js +33 -0
  21. package/lib/ui/advertisement/overlay/externalAd/index.d.ts +2 -0
  22. package/lib/ui/advertisement/overlay/externalAd/index.js +121 -0
  23. package/lib/ui/advertisement/overlay/index.d.ts +7 -2
  24. package/lib/ui/advertisement/overlay/index.js +67 -58
  25. package/lib/ui/close-btn/index.d.ts +1 -0
  26. package/lib/ui/close-btn/index.js +25 -23
  27. package/lib/ui/gamification/question/insight/styles.d.ts +10 -2
  28. package/lib/ui/gamification/question/insight/styles.js +8 -7
  29. package/lib/ui/gamification/question/notification/prediction-result/index.js +84 -64
  30. package/lib/ui/gamification/question/notification/prediction-result/styles.d.ts +2 -0
  31. package/lib/ui/gamification/question/notification/prediction-result/styles.js +36 -26
  32. package/lib/ui/gamification/question/twitter/styles.d.ts +5 -1
  33. package/lib/ui/gamification/question/twitter/styles.js +9 -8
  34. package/lib/ui/gamification/vote/alert/index.js +7 -8
  35. package/lib/ui/gamification/vote/alert/styles.d.ts +1 -0
  36. package/lib/ui/gamification/vote/alert/styles.js +12 -6
  37. package/lib/ui/gamification/vote/vote-option/index.js +59 -58
  38. package/lib/ui/icons/index.d.ts +1 -0
  39. package/lib/ui/icons/index.js +45 -44
  40. package/lib/ui/skeleton/index.d.ts +1 -1
  41. package/lib/ui/theme/constants.d.ts +32 -1
  42. package/lib/ui/theme/constants.js +50 -17
  43. package/lib/ui/theme/masters-theme.js +9 -4
  44. package/lib/ui/theme/theme.js +16 -9
  45. package/lib/ui/video-player/index.d.ts +2 -0
  46. package/lib/ui/video-player/index.js +57 -56
  47. package/package.json +14 -14
@@ -1,94 +1,95 @@
1
- import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
- import { useState as j, useLayoutEffect as U } from "react";
3
- import { QuestionImages as a, QuestionType as o, QuestionStatus as p } from "@streamlayer/sdk-web-types";
1
+ import { jsx as e, jsxs as f } from "react/jsx-runtime";
2
+ import { useState as y, useLayoutEffect as U } from "react";
3
+ import { QuestionImages as a, QuestionType as i, QuestionStatus as D } from "@streamlayer/sdk-web-types";
4
4
  import { AnimatedCounter as W } from "../../../animated-counter/index.js";
5
- import { IconDefault as $, IconContainer as y, IconWrap as F, IconCircle as M, ButtonContainer as z, ButtonPctWrap as G, ButtonPct as H, ButtonBody as J, Title as K, Pts as X, Indicators as Y, CheckIcon as Z, Percentage as _ } from "./styles.js";
6
- const h = {
5
+ import { IconDefault as $, IconContainer as F, IconWrap as M, IconCircle as z, ButtonContainer as G, ButtonPctWrap as H, ButtonPct as J, ButtonBody as K, Title as X, Pts as Y, Indicators as Z, CheckIcon as _, Percentage as q } from "./styles.js";
6
+ const E = {
7
7
  [a.CENTERED]: (t) => /* @__PURE__ */ e($, { "data-testid": "vote-icon", alt: "option-icon", src: t }),
8
- [a.TRANSPARENT]: (t) => /* @__PURE__ */ e(y, { "data-testid": "vote-icon", children: /* @__PURE__ */ e(F, { style: { backgroundImage: `url(${t})` } }) }),
9
- [a.ROUNDED]: (t) => /* @__PURE__ */ e(M, { "data-testid": "vote-icon", alt: "option-icon", src: t }),
8
+ [a.TRANSPARENT]: (t) => /* @__PURE__ */ e(F, { "data-testid": "vote-icon", children: /* @__PURE__ */ e(M, { style: { backgroundImage: `url(${t})` } }) }),
9
+ [a.ROUNDED]: (t) => /* @__PURE__ */ e(z, { "data-testid": "vote-icon", alt: "option-icon", src: t }),
10
10
  [a.NONE]: () => null,
11
11
  [a.UNSET]: () => null
12
- }, q = ({ questionType: t, hasCorrectAnswer: c, correct: n, youVoted: r, questionVoted: i }) => {
13
- if (t === o.POLL && r)
14
- return "correct";
15
- if (t === o.PREDICTION) {
16
- if (c && i)
17
- return r ? n ? "correct" : "incorrect" : "unset";
18
- if (r)
12
+ }, tt = ({ questionType: t, hasCorrectAnswer: c, correct: n, youVoted: o, questionVoted: r }) => {
13
+ if (t === i.POLL && o)
14
+ return "voted";
15
+ if (t === i.PREDICTION) {
16
+ if (c && r)
17
+ return o ? n ? "correct" : "incorrect" : "unset";
18
+ if (o)
19
19
  return "correct";
20
20
  }
21
- return t === o.TRIVIA && i && r ? n ? "correct" : "incorrect" : "unset";
22
- }, tt = ({
21
+ return t === i.TRIVIA && r && o ? n ? "correct" : "incorrect" : "unset";
22
+ }, et = ({
23
23
  questionType: t,
24
24
  questionVoted: c,
25
25
  correct: n,
26
- hasCorrectAnswer: r,
27
- questionStatus: i
28
- }) => t === o.TRIVIA ? c && n : t === o.PREDICTION ? c && n && r || i === p.RESOLVED && n : !1, ct = (t) => {
29
- var S;
26
+ hasCorrectAnswer: o,
27
+ questionStatus: r
28
+ }) => t === i.TRIVIA ? c && n : t === i.PREDICTION ? c && n && o || r === D.RESOLVED && n : !1, st = (t) => {
29
+ var p;
30
30
  const {
31
31
  // option props
32
32
  id: c,
33
33
  icon: n,
34
- text: r,
35
- percentageDecimal: i,
36
- points: D,
34
+ text: o,
35
+ percentageDecimal: r,
36
+ points: g,
37
37
  // extra props
38
38
  onVote: w,
39
39
  markThatVoted: A,
40
- onPercentsAnimated: f,
41
- youSelected: E,
40
+ onPercentsAnimated: I,
41
+ youSelected: m,
42
+ youVoted: O,
42
43
  questionVoted: s,
43
44
  imageMode: C,
44
- answerTimeExpired: O,
45
+ answerTimeExpired: v,
45
46
  questionStatus: P,
46
- isLoading: g,
47
+ isLoading: k,
47
48
  questionType: d,
48
- correct: v,
49
- hasCorrectAnswer: k,
50
- votedAfterQuestionClosed: x,
49
+ correct: x,
50
+ hasCorrectAnswer: L,
51
+ votedAfterQuestionClosed: B,
51
52
  enteredAnActiveQuestion: R,
52
- marketClosed: I
53
- } = t, [L, T] = j(0), m = q(t), B = tt({ questionType: d, questionVoted: s, correct: v, hasCorrectAnswer: k, questionStatus: P }), u = I && d === o.PREDICTION, N = s || u, Q = d === o.PREDICTION && !s && !I, V = s && !E && m !== "incorrect";
54
- return U(() => {
53
+ marketClosed: h
54
+ } = t, [Q, T] = y(0), l = tt(t), V = et({ questionType: d, questionVoted: s, correct: x, hasCorrectAnswer: L, questionStatus: P }), u = h && d === i.PREDICTION, N = s || u, b = d === i.PREDICTION && !s && !h, S = s && !m && l !== "incorrect" && !O;
55
+ return console.log({ isNotChecked: S, questionVoted: s, youSelected: m, answerState: l }), U(() => {
55
56
  T(0), requestAnimationFrame(() => {
56
- T(i);
57
+ T(r);
57
58
  });
58
- }, [i]), /* @__PURE__ */ l(
59
- z,
59
+ }, [r]), /* @__PURE__ */ f(
60
+ G,
60
61
  {
61
62
  value: c,
62
- "data-selected": E,
63
- "data-answer-state": m,
64
- disabled: s || g || O || u && !R || u && R && x,
65
- "data-is-not-checked": V,
66
- onClick: (b) => {
63
+ "data-selected": m,
64
+ "data-answer-state": l,
65
+ disabled: s || k || v || u && !R || u && R && B,
66
+ "data-is-not-checked": S,
67
+ onClick: (j) => {
67
68
  A(
68
- d === o.PREDICTION ? I : P === p.RESOLVED
69
- ), w(b);
69
+ d === i.PREDICTION ? h : P === D.RESOLVED
70
+ ), w(j);
70
71
  },
71
72
  children: [
72
- /* @__PURE__ */ e(G, { children: /* @__PURE__ */ e(
73
- H,
73
+ /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
74
+ J,
74
75
  {
75
- "data-answer-state": m,
76
- style: { width: `${N ? L : 0}%` },
76
+ "data-answer-state": l,
77
+ style: { width: `${N ? Q : 0}%` },
77
78
  onTransitionEnd: () => {
78
- u || f == null || f();
79
+ u || I == null || I();
79
80
  }
80
81
  }
81
82
  ) }),
82
- /* @__PURE__ */ l(J, { children: [
83
- n && C && ((S = h[C]) == null ? void 0 : S.call(h, n)),
84
- /* @__PURE__ */ e(K, { children: r }),
85
- Q && /* @__PURE__ */ l("div", { children: [
86
- D,
87
- /* @__PURE__ */ e(X, { children: "pts" })
83
+ /* @__PURE__ */ f(K, { children: [
84
+ n && C && ((p = E[C]) == null ? void 0 : p.call(E, n)),
85
+ /* @__PURE__ */ e(X, { children: o }),
86
+ b && /* @__PURE__ */ f("div", { children: [
87
+ g,
88
+ /* @__PURE__ */ e(Y, { children: "pts" })
88
89
  ] }),
89
- N && /* @__PURE__ */ l(Y, { children: [
90
- B && /* @__PURE__ */ e(Z, { name: "selected" }),
91
- /* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(W, { value: i, suffix: "%" }) })
90
+ N && /* @__PURE__ */ f(Z, { children: [
91
+ V && /* @__PURE__ */ e(_, { name: "selected" }),
92
+ /* @__PURE__ */ e(q, { children: /* @__PURE__ */ e(W, { value: r, suffix: "%" }) })
92
93
  ] })
93
94
  ] })
94
95
  ]
@@ -96,5 +97,5 @@ const h = {
96
97
  );
97
98
  };
98
99
  export {
99
- ct as VotingOption
100
+ st as VotingOption
100
101
  };
@@ -37,6 +37,7 @@ export declare const icons: {
37
37
  'icon-btn-leaderboard': any;
38
38
  'icon-arrow': any;
39
39
  'icon-twitter-verified': any;
40
+ dashboard: any;
40
41
  correct: any;
41
42
  incorrect: any;
42
43
  questionExpired: any;