@streamlayer/react-ui 1.17.0 → 1.18.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.
Files changed (64) hide show
  1. package/lib/app/app/story/settings/login.js +18 -14
  2. package/lib/app/login/demo.d.ts +1 -4
  3. package/lib/app/login/demo.js +38 -24
  4. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.d.ts +4 -0
  5. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.js +10 -0
  6. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/styles.d.ts +4 -0
  7. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/styles.js +25 -0
  8. package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.d.ts +5 -0
  9. package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +18 -0
  10. package/lib/app/masters/BetPack/BetPackContent/EndScreen/styles.d.ts +7 -0
  11. package/lib/app/masters/BetPack/BetPackContent/EndScreen/styles.js +41 -0
  12. package/lib/app/masters/BetPack/BetPackContent/LoaderScreen/index.d.ts +1 -0
  13. package/lib/app/masters/BetPack/BetPackContent/LoaderScreen/index.js +13 -0
  14. package/lib/app/masters/BetPack/BetPackContent/QuestionScreen/index.d.ts +6 -0
  15. package/lib/app/masters/BetPack/BetPackContent/QuestionScreen/index.js +7 -0
  16. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.d.ts +4 -0
  17. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +6 -0
  18. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/styles.d.ts +1 -0
  19. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/styles.js +9 -0
  20. package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.d.ts +5 -0
  21. package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +33 -0
  22. package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.d.ts +7 -0
  23. package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.js +41 -0
  24. package/lib/app/masters/BetPack/BetPackContent/constants.d.ts +13 -0
  25. package/lib/app/masters/BetPack/BetPackContent/constants.js +22 -0
  26. package/lib/app/masters/BetPack/BetPackContent/index.d.ts +11 -0
  27. package/lib/app/masters/BetPack/BetPackContent/index.js +116 -0
  28. package/lib/app/masters/BetPack/BetPackContent/styles.d.ts +3 -0
  29. package/lib/app/masters/BetPack/BetPackContent/styles.js +20 -0
  30. package/lib/app/masters/BetPack/BetPackOverlay/index.d.ts +12 -0
  31. package/lib/app/masters/BetPack/BetPackOverlay/index.js +9 -0
  32. package/lib/app/masters/BetPack/BetPackOverlay/styles.d.ts +10 -0
  33. package/lib/app/masters/BetPack/BetPackOverlay/styles.js +51 -0
  34. package/lib/app/masters/BetPack/index.d.ts +14 -0
  35. package/lib/app/masters/BetPack/index.js +84 -0
  36. package/lib/app/masters/BetPack/styles.d.ts +4 -0
  37. package/lib/app/masters/BetPack/styles.js +24 -0
  38. package/lib/app/masters/BetPack/typings.d.js +1 -0
  39. package/lib/app/masters/BetPack/utils.d.ts +19 -0
  40. package/lib/app/masters/BetPack/utils.js +10 -0
  41. package/lib/app/masters/masters.d.ts +0 -2
  42. package/lib/app/masters/masters.js +89 -85
  43. package/lib/app/masters/story/components.d.ts +11 -0
  44. package/lib/app/masters/story/components.js +151 -0
  45. package/lib/app/masters/story/index.d.ts +3 -0
  46. package/lib/app/masters/story/index.js +53 -0
  47. package/lib/assets/style.css +1 -1
  48. package/lib/ui/gamification/vote/feedback/index.d.ts +3 -1
  49. package/lib/ui/gamification/vote/feedback/index.js +52 -50
  50. package/lib/ui/gamification/vote/feedback/styles.d.ts +1 -0
  51. package/lib/ui/gamification/vote/feedback/styles.js +5 -0
  52. package/lib/ui/gamification/vote/index.d.ts +1 -0
  53. package/lib/ui/gamification/vote/index.js +150 -126
  54. package/lib/ui/gamification/vote/styles.d.ts +5 -0
  55. package/lib/ui/gamification/vote/styles.js +40 -14
  56. package/lib/ui/gamification/vote/vote-option/index.js +43 -40
  57. package/lib/ui/icons/index.d.ts +5 -0
  58. package/lib/ui/icons/index.js +87 -66
  59. package/lib/ui/loader/index.d.ts +4 -0
  60. package/lib/ui/loader/index.js +5 -0
  61. package/lib/ui/theme/masters-theme.js +4 -4
  62. package/lib/ui/theme/masters.js +3 -2
  63. package/lib/utils/decorators/container.js +11 -9
  64. package/package.json +22 -16
@@ -1,21 +1,21 @@
1
1
  import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
2
  import { useState as V, useLayoutEffect as W } from "react";
3
- import { QuestionImages as a, QuestionType as o, QuestionStatus as p } from "@streamlayer/sdk-web-types";
3
+ import { QuestionImages as a, QuestionType as o, QuestionStatus as N } from "@streamlayer/sdk-web-types";
4
4
  import { AnimatedCounter as $ } from "../../../animated-counter/index.js";
5
5
  import { IconDefault as y, 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 = {
6
+ const h = {
7
7
  [a.CENTERED]: (t) => /* @__PURE__ */ e(y, { "data-testid": "vote-icon", alt: "option-icon", src: t }),
8
8
  [a.TRANSPARENT]: (t) => /* @__PURE__ */ e(F, { "data-testid": "vote-icon", children: /* @__PURE__ */ e(M, { style: { backgroundImage: `url(${t})` } }) }),
9
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
- }, tt = ({ questionType: t, hasCorrectAnswer: c, correct: n, youVoted: r, questionVoted: i }) => {
12
+ }, tt = ({ questionType: t, hasCorrectAnswer: s, correct: n, youVoted: r, questionVoted: i }) => {
13
13
  if (t === o.POLL && r)
14
14
  return "voted";
15
15
  if (t === o.PREDICTION) {
16
- if (!c && i)
16
+ if (!s && i)
17
17
  return r ? "voted" : "unset";
18
- if (c && i)
18
+ if (s && i)
19
19
  return r ? n ? "correct" : "incorrect" : "unset";
20
20
  if (r)
21
21
  return "correct";
@@ -23,74 +23,77 @@ const E = {
23
23
  return t === o.TRIVIA && i && r ? n ? "correct" : "incorrect" : "unset";
24
24
  }, et = ({
25
25
  questionType: t,
26
- questionVoted: c,
26
+ questionVoted: s,
27
27
  correct: n,
28
28
  hasCorrectAnswer: r,
29
29
  questionStatus: i
30
- }) => t === o.TRIVIA ? c && n : t === o.PREDICTION ? c && n && r || i === p.RESOLVED && n : !1, st = (t) => {
31
- var S;
30
+ }) => t === o.TRIVIA ? s && n : t === o.PREDICTION ? s && n && r || i === N.RESOLVED && n : !1, ct = (t) => {
31
+ var T;
32
32
  const {
33
33
  // option props
34
- id: c,
34
+ id: s,
35
35
  icon: n,
36
36
  text: r,
37
37
  percentageDecimal: i,
38
- points: D,
38
+ points: S,
39
39
  // extra props
40
- onVote: v,
41
- markThatVoted: O,
40
+ onVote: p,
41
+ markThatVoted: D,
42
42
  onPercentsAnimated: f,
43
- youSelected: h,
44
- youVoted: g,
45
- questionVoted: s,
43
+ youSelected: E,
44
+ youVoted: O,
45
+ questionVoted: c,
46
46
  imageMode: C,
47
- answerTimeExpired: w,
48
- questionStatus: P,
49
- isLoading: A,
47
+ answerTimeExpired: g,
48
+ questionStatus: v,
49
+ isLoading: k,
50
50
  questionType: d,
51
- correct: k,
52
- hasCorrectAnswer: x,
53
- votedAfterQuestionClosed: L,
54
- enteredAnActiveQuestion: R,
51
+ correct: x,
52
+ hasCorrectAnswer: L,
53
+ votedAfterQuestionClosed: B,
54
+ enteredAnActiveQuestion: P,
55
55
  marketClosed: I
56
- } = t, [B, T] = V(0), m = tt(t), Q = et({ questionType: d, questionVoted: s, correct: k, hasCorrectAnswer: x, questionStatus: P }), u = I && d === o.PREDICTION, N = s || u, b = d === o.PREDICTION && !s && !I, j = s && !h && m !== "incorrect" && !g;
56
+ } = t, [Q, R] = V(0), m = tt(t), b = et({ questionType: d, questionVoted: c, correct: x, hasCorrectAnswer: L, questionStatus: v }), u = I && d === o.PREDICTION, w = c || u, j = d === o.PREDICTION && !c && !I, A = c && !E && m !== "incorrect" && !O;
57
57
  return W(() => {
58
- T(0), requestAnimationFrame(() => {
59
- T(i);
58
+ R(0), requestAnimationFrame(() => {
59
+ R(i);
60
60
  });
61
61
  }, [i]), /* @__PURE__ */ l(
62
62
  G,
63
63
  {
64
- value: c,
65
- "data-selected": h,
64
+ id: "voteAnswerContainer",
65
+ value: s,
66
+ "data-selected": E,
66
67
  "data-answer-state": m,
67
- disabled: s || A || w || u && !R || u && R && L,
68
- "data-is-not-checked": j,
68
+ disabled: c || k || g || u && !P || u && P && B,
69
+ "data-is-not-checked": A,
69
70
  onClick: (U) => {
70
- O(
71
- d === o.PREDICTION ? I : P === p.RESOLVED
72
- ), v(U);
71
+ D(
72
+ d === o.PREDICTION ? I : v === N.RESOLVED
73
+ ), p(U);
73
74
  },
74
75
  children: [
75
76
  /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
76
77
  J,
77
78
  {
79
+ id: "voteAnswerRct",
78
80
  "data-answer-state": m,
79
- style: { width: `${N ? B : 0}%` },
81
+ "data-is-not-checked": A,
82
+ style: { width: `${w ? Q : 0}%` },
80
83
  onTransitionEnd: () => {
81
84
  u || f == null || f();
82
85
  }
83
86
  }
84
87
  ) }),
85
- /* @__PURE__ */ l(K, { children: [
86
- n && C && ((S = E[C]) == null ? void 0 : S.call(E, n)),
88
+ /* @__PURE__ */ l(K, { id: "voteAnswer", children: [
89
+ n && C && ((T = h[C]) == null ? void 0 : T.call(h, n)),
87
90
  /* @__PURE__ */ e(X, { children: r }),
88
- b && /* @__PURE__ */ l("div", { children: [
89
- D,
91
+ j && /* @__PURE__ */ l("div", { children: [
92
+ S,
90
93
  /* @__PURE__ */ e(Y, { children: "pts" })
91
94
  ] }),
92
- N && /* @__PURE__ */ l(Z, { children: [
93
- Q && /* @__PURE__ */ e(_, { name: "selected" }),
95
+ w && /* @__PURE__ */ l(Z, { id: "voteAnswerIndicators", children: [
96
+ b && /* @__PURE__ */ e(_, { name: "selected" }),
94
97
  /* @__PURE__ */ e(q, { children: /* @__PURE__ */ e($, { value: i, suffix: "%" }) })
95
98
  ] })
96
99
  ] })
@@ -99,5 +102,5 @@ const E = {
99
102
  );
100
103
  };
101
104
  export {
102
- st as VotingOption
105
+ ct as VotingOption
103
106
  };
@@ -38,6 +38,7 @@ export declare const icons: {
38
38
  'icon-btn-leaderboard': any;
39
39
  'icon-arrow': any;
40
40
  'icon-twitter-verified': any;
41
+ 'icon-trophy-bet-pack': any;
41
42
  dashboard: any;
42
43
  correct: any;
43
44
  incorrect: any;
@@ -52,6 +53,10 @@ export declare const icons: {
52
53
  iconCopySuccess: any;
53
54
  chevronRight: any;
54
55
  noImageIcon: any;
56
+ iconArrowRight: any;
57
+ iconEarlyPrediction: any;
58
+ iconArrowPrev: any;
59
+ mastersLogoWhite: any;
55
60
  };
56
61
  export declare const IconsLibrary: () => import("react/jsx-runtime").JSX.Element;
57
62
  type SvgIconProps = {