@streamlayer/react-ui 1.19.1 → 1.21.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 (56) hide show
  1. package/lib/app/app/Advertisement/index.js +74 -72
  2. package/lib/app/app/Points/index.js +21 -14
  3. package/lib/app/app/index.js +79 -89
  4. package/lib/app/app/useApp.d.ts +2 -1
  5. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.d.ts +2 -0
  6. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.js +11 -10
  7. package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.d.ts +1 -0
  8. package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +22 -18
  9. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.d.ts +1 -0
  10. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +7 -7
  11. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.d.ts +2 -1
  12. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.js +31 -22
  13. package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.d.ts +1 -0
  14. package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +11 -11
  15. package/lib/app/masters/BetPack/BetPackContent/index.js +61 -49
  16. package/lib/app/masters/BetPack/BetPackOverlay/index.d.ts +1 -1
  17. package/lib/app/masters/BetPack/BetPackOverlay/index.js +3 -2
  18. package/lib/app/masters/BetPack/index.js +80 -75
  19. package/lib/app/masters/Features/Gamification/index.d.ts +0 -2
  20. package/lib/app/masters/Features/Gamification/index.js +29 -34
  21. package/lib/app/masters/Features/index.d.ts +0 -2
  22. package/lib/app/masters/Features/index.js +4 -12
  23. package/lib/app/masters/Notifications/Onboarding/index.d.ts +0 -1
  24. package/lib/app/masters/Notifications/Onboarding/index.js +42 -43
  25. package/lib/app/masters/Notifications/index.js +50 -55
  26. package/lib/app/masters/Points/index.js +24 -18
  27. package/lib/app/masters/masters.js +70 -92
  28. package/lib/app/masters/useOrientation.d.ts +3 -0
  29. package/lib/app/masters/useOrientation.js +12 -0
  30. package/lib/app/masters/useSdkResponsive.d.ts +2 -0
  31. package/lib/app/masters/useSdkResponsive.js +3 -1
  32. package/lib/app/masters/useSdkScroll.js +1 -1
  33. package/lib/app/useSdkResponsive.js +1 -1
  34. package/lib/app/useSdkScroll.js +1 -1
  35. package/lib/assets/style.css +1 -1
  36. package/lib/hooks/analytics.js +17 -42
  37. package/lib/index-CLJzLXks.js +64 -0
  38. package/lib/reset.css +1 -1
  39. package/lib/ui/advertisement/notification/index.js +8 -8
  40. package/lib/ui/advertisement/overlay/externalAd/index.js +40310 -114
  41. package/lib/ui/advertisement/overlay/externalAd/styles.d.ts +8 -0
  42. package/lib/ui/advertisement/overlay/externalAd/styles.js +39 -0
  43. package/lib/ui/close-btn/index.d.ts +2 -0
  44. package/lib/ui/close-btn/index.js +40 -32
  45. package/lib/ui/gamification/question/inapp/prediction-result/frames/content.js +48 -33
  46. package/lib/ui/gamification/vote/feedback/index.js +30 -30
  47. package/lib/ui/gamification/vote/index.js +43 -43
  48. package/lib/ui/gamification/vote/vote-option/index.js +51 -53
  49. package/lib/ui/icons/index.d.ts +3 -0
  50. package/lib/ui/icons/index.js +75 -54
  51. package/lib/ui/modal/index.js +36 -32
  52. package/lib/ui/show-in/index.js +26 -26
  53. package/lib/ui/theme/masters-theme.js +12 -4
  54. package/lib/ui/theme/theme.js +9 -5
  55. package/package.json +22 -16
  56. package/lib/index-BEm7B1u1.js +0 -72
@@ -1,15 +1,15 @@
1
- import { jsx as e, jsxs as u } from "react/jsx-runtime";
2
- import { useState as U, useLayoutEffect as V } from "react";
3
- import { QuestionImages as a, QuestionType as o, QuestionStatus as D } from "@streamlayer/sdk-web-types";
4
- import { AnimatedCounter as $ } from "../../../animated-counter/index.js";
5
- import { IconDefault as F, IconContainer as M, IconWrap as z, IconCircle as G, ButtonContainer as H, ButtonPctWrap as J, ButtonPct as K, ButtonBody as X, Title as Y, PtsWrap as Z, Pts as _, Indicators as q, CheckIcon as tt, Percentage as et } from "./styles.js";
1
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
+ import { useState as j, useLayoutEffect as y } from "react";
3
+ import { QuestionImages as a, QuestionType as o, QuestionStatus as S } from "@streamlayer/sdk-web-types";
4
+ import { AnimatedCounter as U } from "../../../animated-counter/index.js";
5
+ import { IconDefault as V, IconContainer as $, IconWrap as F, IconCircle as M, ButtonContainer as z, ButtonPctWrap as G, ButtonPct as H, ButtonBody as J, Title as K, PtsWrap as X, Pts as Y, Indicators as Z, CheckIcon as _, Percentage as q } from "./styles.js";
6
6
  const E = {
7
- [a.CENTERED]: (t) => /* @__PURE__ */ e(F, { "data-testid": "vote-icon", alt: "option-icon", src: t }),
8
- [a.TRANSPARENT]: (t) => /* @__PURE__ */ e(M, { "data-testid": "vote-icon", children: /* @__PURE__ */ e(z, { style: { backgroundImage: `url(${t})` } }) }),
9
- [a.ROUNDED]: (t) => /* @__PURE__ */ e(G, { "data-testid": "vote-icon", alt: "option-icon", src: t }),
7
+ [a.CENTERED]: (t) => /* @__PURE__ */ e(V, { "data-testid": "vote-icon", alt: "option-icon", src: t }),
8
+ [a.TRANSPARENT]: (t) => /* @__PURE__ */ e($, { "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 }),
10
10
  [a.NONE]: () => null,
11
11
  [a.UNSET]: () => null
12
- }, nt = ({ questionType: t, hasCorrectAnswer: c, correct: n, youVoted: r, questionVoted: i }) => {
12
+ }, tt = ({ questionType: t, hasCorrectAnswer: c, correct: n, youVoted: r, questionVoted: i }) => {
13
13
  if (t === o.POLL && r)
14
14
  return "voted";
15
15
  if (t === o.PREDICTION) {
@@ -21,79 +21,77 @@ const E = {
21
21
  return "correct";
22
22
  }
23
23
  return t === o.TRIVIA && i && r ? n ? "correct" : "incorrect" : "unset";
24
- }, rt = ({
24
+ }, et = ({
25
25
  questionType: t,
26
26
  questionVoted: c,
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 === D.RESOLVED && n : !1, dt = (t) => {
31
- var S;
30
+ }) => t === o.TRIVIA ? c && n : t === o.PREDICTION ? c && n && r || i === S.RESOLVED && n : !1, st = (t) => {
31
+ var N;
32
32
  const {
33
33
  // option props
34
34
  id: c,
35
35
  icon: n,
36
36
  text: r,
37
37
  percentageDecimal: i,
38
- points: O,
38
+ points: D,
39
39
  // extra props
40
- onVote: g,
41
- markThatVoted: v,
42
- onPercentsAnimated: f,
40
+ onVote: O,
41
+ markThatVoted: g,
42
+ onPercentsAnimated: u,
43
43
  youSelected: h,
44
44
  youVoted: w,
45
45
  questionVoted: s,
46
46
  imageMode: P,
47
- answerTimeExpired: A,
47
+ answerTimeExpired: k,
48
48
  questionStatus: C,
49
- isLoading: k,
49
+ isLoading: v,
50
50
  questionType: d,
51
- correct: x,
52
- hasCorrectAnswer: B,
53
- votedAfterQuestionClosed: L,
54
- enteredAnActiveQuestion: R,
55
- marketClosed: I,
56
- isEarlyPrediction: Q
57
- } = t, [W, T] = U(0), m = nt(t), b = rt({ questionType: d, questionVoted: s, correct: x, hasCorrectAnswer: B, questionStatus: C }), l = I && d === o.PREDICTION, p = s || l, j = d === o.PREDICTION && !s && !I, N = s && !h && m !== "incorrect" && !w;
58
- return V(() => {
59
- T(0), requestAnimationFrame(() => {
60
- T(i);
51
+ correct: A,
52
+ hasCorrectAnswer: x,
53
+ marketClosed: f,
54
+ isEarlyPrediction: B
55
+ } = t, [L, R] = j(0), I = tt(t), Q = et({ questionType: d, questionVoted: s, correct: A, hasCorrectAnswer: x, questionStatus: C }), m = f && d === o.PREDICTION, T = s || m, W = d === o.PREDICTION && !s && !f, p = s && !h && I !== "incorrect" && !w;
56
+ return y(() => {
57
+ R(0), requestAnimationFrame(() => {
58
+ R(i);
61
59
  });
62
- }, [i]), /* @__PURE__ */ u(
63
- H,
60
+ }, [i]), /* @__PURE__ */ l(
61
+ z,
64
62
  {
65
63
  value: c,
66
64
  "data-selected": h,
67
- "data-answer-state": m,
68
- disabled: s || k || A || l && !R || l && R && L,
69
- "data-is-not-checked": N,
70
- onClick: (y) => {
71
- v(
72
- d === o.PREDICTION ? I : C === D.RESOLVED
73
- ), g(y);
65
+ "data-answer-state": I,
66
+ disabled: s || v || k || m,
67
+ "data-is-not-checked": p,
68
+ onClick: (b) => {
69
+ g(
70
+ d === o.PREDICTION ? f : C === S.RESOLVED
71
+ ), O(b);
74
72
  },
75
73
  children: [
76
- /* @__PURE__ */ e(J, { children: /* @__PURE__ */ e(
77
- K,
74
+ /* @__PURE__ */ e(G, { children: /* @__PURE__ */ e(
75
+ H,
78
76
  {
79
- "data-answer-state": m,
80
- "data-is-not-checked": N,
81
- style: { width: `${p ? W : 0}%` },
77
+ "data-answer-state": I,
78
+ "data-is-not-checked": p,
79
+ style: { width: `${T ? L : 0}%` },
82
80
  onTransitionEnd: () => {
83
- l || f == null || f();
81
+ m || u == null || u();
84
82
  }
85
83
  }
86
84
  ) }),
87
- /* @__PURE__ */ u(X, { children: [
88
- n && P && ((S = E[P]) == null ? void 0 : S.call(E, n)),
89
- /* @__PURE__ */ e(Y, { children: r }),
90
- j && /* @__PURE__ */ u(Z, { children: [
91
- O,
92
- /* @__PURE__ */ e(_, { children: "pts" })
85
+ /* @__PURE__ */ l(J, { children: [
86
+ n && P && ((N = E[P]) == null ? void 0 : N.call(E, n)),
87
+ /* @__PURE__ */ e(K, { children: r }),
88
+ W && /* @__PURE__ */ l(X, { children: [
89
+ D,
90
+ /* @__PURE__ */ e(Y, { children: "pts" })
93
91
  ] }),
94
- p && /* @__PURE__ */ u(q, { children: [
95
- b && /* @__PURE__ */ e(tt, { name: Q ? "selectedBetPack" : "selected" }),
96
- /* @__PURE__ */ e(et, { children: /* @__PURE__ */ e($, { value: i, suffix: "%" }) })
92
+ T && /* @__PURE__ */ l(Z, { children: [
93
+ Q && /* @__PURE__ */ e(_, { name: B ? "selectedBetPack" : "selected" }),
94
+ /* @__PURE__ */ e(q, { children: /* @__PURE__ */ e(U, { value: i, suffix: "%" }) })
97
95
  ] })
98
96
  ] })
99
97
  ]
@@ -101,5 +99,5 @@ const E = {
101
99
  );
102
100
  };
103
101
  export {
104
- dt as VotingOption
102
+ st as VotingOption
105
103
  };
@@ -41,7 +41,10 @@ export declare const icons: {
41
41
  'icon-trophy-bet-pack': any;
42
42
  'icon-trivia-transparent': any;
43
43
  dashboard: any;
44
+ iconMute: any;
45
+ iconUnMute: any;
44
46
  correct: any;
47
+ iconSkip: any;
45
48
  incorrect: any;
46
49
  questionExpired: any;
47
50
  selected: any;