@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
@@ -7,7 +7,6 @@ export declare const Onboarding: React.FC<{
7
7
  notification: Notification;
8
8
  saveHeight: (height: number) => void;
9
9
  appNode: AppNodeRef;
10
- sdkInDesktopView?: boolean;
11
10
  style?: React.CSSProperties;
12
11
  responsiveStore: ResponsiveStore;
13
12
  }>;
@@ -41,26 +41,26 @@ const R = "data:image/svg+xml,%3csvg%20width='92'%20height='19'%20viewBox='0%200
41
41
  propsAsIs: !1
42
42
  }), q = ({
43
43
  deepLink: l,
44
- onboardingOpts: r,
44
+ onboardingOpts: C,
45
45
  notification: i,
46
- gamification: c,
46
+ gamification: p,
47
47
  loading: s,
48
48
  sdk: a
49
49
  }) => {
50
- var d, o, m, h, g, V, L;
51
- const p = x(c.friends.getStore()), [u, e] = I(void 0), f = S(() => {
52
- var n, b;
53
- const C = a.getInviter();
54
- return C ? (b = (n = p.data) == null ? void 0 : n.find(({
50
+ var o, m, h, g, V, L, n;
51
+ const d = x(p.friends.getStore()), [e, f] = I(void 0), u = S(() => {
52
+ var c, b;
53
+ const r = a.getInviter();
54
+ return r ? (b = (c = d.data) == null ? void 0 : c.find(({
55
55
  slId: k
56
- }) => k === C)) == null ? void 0 : b.name : "";
57
- }, [p.data, a]);
56
+ }) => k === r)) == null ? void 0 : b.name : "";
57
+ }, [d.data, a]);
58
58
  return B(() => {
59
- const C = l.$store.subscribe((n) => {
60
- n && e(n.data);
59
+ const r = l.$store.subscribe((c) => {
60
+ c && f(c.data);
61
61
  });
62
62
  return () => {
63
- C();
63
+ r();
64
64
  };
65
65
  }, [l.$store]), /* @__PURE__ */ t(W, {
66
66
  children: /* @__PURE__ */ t(E, {
@@ -75,45 +75,44 @@ const R = "data:image/svg+xml,%3csvg%20width='92'%20height='19'%20viewBox='0%200
75
75
  label: "Top the leader board and best your friends.",
76
76
  icon: "icon-trophy"
77
77
  }],
78
- rulesBtnLabel: (d = r.rules) == null ? void 0 : d.buttonLabel,
79
- rulesTitle: (o = r.rules) == null ? void 0 : o.heading,
78
+ rulesBtnLabel: (o = C.rules) == null ? void 0 : o.buttonLabel,
79
+ rulesTitle: (m = C.rules) == null ? void 0 : m.heading,
80
80
  termsTitle: "Terms and Conditions",
81
- termsText: (m = r.rules) == null ? void 0 : m.terms,
81
+ termsText: (h = C.rules) == null ? void 0 : h.terms,
82
82
  steps: H,
83
- primaryColor: (h = r.inviteCard) == null ? void 0 : h.iconColor,
84
- inviteLink: u,
85
- inviteCardTitle: (g = r.inviteCard) == null ? void 0 : g.heading,
86
- inviteCardSubtext: (V = r.inviteCard) == null ? void 0 : V.subtext,
87
- inviteCardBtnLabel: (L = r.inviteCard) == null ? void 0 : L.buttonLabel,
83
+ primaryColor: (g = C.inviteCard) == null ? void 0 : g.iconColor,
84
+ inviteLink: e,
85
+ inviteCardTitle: (V = C.inviteCard) == null ? void 0 : V.heading,
86
+ inviteCardSubtext: (L = C.inviteCard) == null ? void 0 : L.subtext,
87
+ inviteCardBtnLabel: (n = C.inviteCard) == null ? void 0 : n.buttonLabel,
88
88
  onClose: () => {
89
- var C;
90
- (C = i.close) == null || C.call(i);
89
+ var r;
90
+ (r = i.close) == null || r.call(i);
91
91
  },
92
- gamification: c,
92
+ gamification: p,
93
93
  sdk: a,
94
- inviterName: f
94
+ inviterName: u
95
95
  })
96
96
  });
97
97
  }, r2 = ({
98
98
  sdk: l,
99
- notification: r,
99
+ notification: C,
100
100
  saveHeight: i,
101
- style: c,
101
+ style: p,
102
102
  appNode: s,
103
- sdkInDesktopView: a,
104
- responsiveStore: p
103
+ responsiveStore: a
105
104
  }) => {
106
105
  var L;
107
- const u = A(null), e = r.data.onboarding, [f, d] = I(e == null ? void 0 : e.instantOpen), o = l.getFeature(j.GAMES), m = S(() => H == null ? void 0 : H.map(({
108
- graphicSrc: C
109
- }) => C), []), {
106
+ const d = A(null), e = C.data.onboarding, [f, u] = I(e == null ? void 0 : e.instantOpen), o = l.getFeature(j.GAMES), m = S(() => H == null ? void 0 : H.map(({
107
+ graphicSrc: n
108
+ }) => n), []), {
110
109
  screen: h
111
- } = x(p, {
110
+ } = x(a, {
112
111
  keys: ["screen"]
113
112
  });
114
113
  (L = e == null ? void 0 : e.titleCard) != null && L.media && (e.titleCard.media.sponsorLogo = R), _(() => {
115
- var C;
116
- i(((C = u.current) == null ? void 0 : C.getBoundingClientRect().height) || 0);
114
+ var n;
115
+ i(((n = d.current) == null ? void 0 : n.getBoundingClientRect().height) || 0);
117
116
  }, [i]);
118
117
  const {
119
118
  loading: g,
@@ -121,10 +120,10 @@ const R = "data:image/svg+xml,%3csvg%20width='92'%20height='19'%20viewBox='0%200
121
120
  } = T(m);
122
121
  return f && o && e && s.current && !V ? /* @__PURE__ */ t(G, {
123
122
  container: s,
124
- useContainer: !a,
123
+ useContainer: !1,
125
124
  children: /* @__PURE__ */ t(q, {
126
- notification: r,
127
- setOpened: d,
125
+ notification: C,
126
+ setOpened: u,
128
127
  gamification: o,
129
128
  onboardingOpts: e,
130
129
  deepLink: o.deepLink,
@@ -133,7 +132,7 @@ const R = "data:image/svg+xml,%3csvg%20width='92'%20height='19'%20viewBox='0%200
133
132
  })
134
133
  }) : /* @__PURE__ */ Z(w, {
135
134
  children: [/* @__PURE__ */ t(y, {
136
- ref: u,
135
+ ref: d,
137
136
  style: {
138
137
  position: "absolute",
139
138
  visibility: "hidden"
@@ -146,14 +145,14 @@ const R = "data:image/svg+xml,%3csvg%20width='92'%20height='19'%20viewBox='0%200
146
145
  onboarding: e
147
146
  })
148
147
  }), /* @__PURE__ */ t(O, {
149
- style: c,
150
- hiding: r.hiding,
148
+ style: p,
149
+ hiding: C.hiding,
151
150
  children: /* @__PURE__ */ t(y, {
152
151
  children: /* @__PURE__ */ t(M, {
153
- close: r.close,
152
+ close: C.close,
154
153
  action: () => {
155
- var n;
156
- d(!0), (((n = s.current) == null ? void 0 : n.getBoundingClientRect().y) || 0) < 0 && F(s, h.size, {
154
+ var r;
155
+ u(!0), (((r = s.current) == null ? void 0 : r.getBoundingClientRect().y) || 0) < 0 && F(s, h.size, {
157
156
  behavior: "smooth"
158
157
  });
159
158
  },
@@ -1,82 +1,77 @@
1
- import { jsxs as f, Fragment as D, jsx as c } from "react/jsx-runtime";
2
- import { cx as N } from "@linaria/core";
1
+ import { jsxs as g, Fragment as V, jsx as c } from "react/jsx-runtime";
2
+ import { cx as D } from "@linaria/core";
3
3
  import { useMastersContext as T } from "../useMastersContext.js";
4
4
  import { scrollIntoAppView as q } from "../useSdkScroll.js";
5
- import { useState as p, useMemo as E, useEffect as h, useRef as O, useCallback as w } from "react";
5
+ import { useState as f, useMemo as E, useEffect as h, useRef as O, useCallback as w } from "react";
6
6
  import { r as b } from "../../../index-DALxy-8N.js";
7
- import { useStore as g } from "@streamlayer/react-polyfills";
7
+ import { useStore as p } from "@streamlayer/react-polyfills";
8
8
  import { eventBus as C } from "@streamlayer/sdk-web-interfaces";
9
9
  import { NotificationType as a } from "@streamlayer/sdk-web-notifications";
10
10
  import { QuestionTypeData as R } from "../../../ui/gamification/constants.js";
11
- import { Notification as V } from "../../../ui/gamification/question/notification/index.js";
11
+ import { Notification as N } from "../../../ui/gamification/question/notification/index.js";
12
12
  import { PredictionResult as P } from "../../../ui/gamification/question/notification/prediction-result/index.js";
13
13
  import { Onboarding as x } from "./Onboarding/index.js";
14
14
  import { HiddenContainer as A, Container as B, InnerContainer as H, NotificationRefreshing as Q, Pill as U } from "./styles.js";
15
15
  const j = (n) => {
16
- const [t, u] = p(0), i = O(null), d = w((r) => {
17
- i.current = r;
16
+ const [t, u] = f(0), i = O(null), l = w((o) => {
17
+ i.current = o;
18
18
  }, []);
19
19
  h(() => {
20
- var l;
21
- const r = (l = i.current) == null ? void 0 : l.getBoundingClientRect();
22
- r && u(r.height);
20
+ var d;
21
+ const o = (d = i.current) == null ? void 0 : d.getBoundingClientRect();
22
+ o && u(o.height);
23
23
  }, [n]);
24
- const o = w((r) => {
25
- u(r);
24
+ const r = w((o) => {
25
+ u(o);
26
26
  }, []);
27
- return [d, t, o];
27
+ return [l, t, r];
28
28
  }, z = ({
29
29
  sdk: n,
30
30
  notification: t,
31
31
  appNode: u,
32
32
  responsiveStore: i
33
33
  }) => {
34
- var s, e;
34
+ var m, s;
35
35
  const {
36
- sdkInDesktopView: d
37
- } = g(i, {
38
- keys: ["sdkInDesktopView"]
39
- }), {
40
- sdk: o
41
- } = T(), [r, l, m] = j(t.id);
42
- return t.type === a.QUESTION ? /* @__PURE__ */ f(D, {
36
+ sdk: l
37
+ } = T(), [r, o, d] = j(t.id);
38
+ return t.type === a.QUESTION ? /* @__PURE__ */ g(V, {
43
39
  children: [/* @__PURE__ */ c(A, {
44
40
  ref: r,
45
- children: /* @__PURE__ */ c(V, {
41
+ children: /* @__PURE__ */ c(N, {
46
42
  ...t
47
43
  })
48
- }), /* @__PURE__ */ f(B, {
44
+ }), /* @__PURE__ */ g(B, {
49
45
  style: {
50
- height: t.hiding ? 0 : l
46
+ height: t.hiding ? 0 : o
51
47
  },
52
48
  hiding: t.hiding,
53
49
  children: [/* @__PURE__ */ c(H, {
54
50
  style: {
55
51
  height: "100%"
56
52
  },
57
- children: /* @__PURE__ */ c(V, {
53
+ children: /* @__PURE__ */ c(N, {
58
54
  ...t,
59
- controlVideo: o == null ? void 0 : o.controlVideoPlayer
55
+ controlVideo: l == null ? void 0 : l.controlVideoPlayer
60
56
  })
61
57
  }), /* @__PURE__ */ c(Q, {}, t.id)]
62
58
  })]
63
- }) : t.type === a.QUESTION_RESOLVED && ((e = (s = t.data) == null ? void 0 : s.question) != null && e.predictionResult) ? /* @__PURE__ */ c(P, {
59
+ }) : t.type === a.QUESTION_RESOLVED && ((s = (m = t.data) == null ? void 0 : m.question) != null && s.predictionResult) ? /* @__PURE__ */ c(P, {
64
60
  style: {
65
- height: t.hiding ? 0 : l
61
+ height: t.hiding ? 0 : o
66
62
  },
67
- saveHeight: m,
63
+ saveHeight: d,
68
64
  close: t.close,
69
65
  hiding: t.hiding,
70
66
  ...t.data.question,
71
67
  mastersApp: !0
72
68
  }) : t.type === a.ONBOARDING ? /* @__PURE__ */ c(x, {
73
69
  style: {
74
- height: t.hiding ? 0 : l
70
+ height: t.hiding ? 0 : o
75
71
  },
76
- saveHeight: m,
72
+ saveHeight: d,
77
73
  sdk: n,
78
74
  notification: t,
79
- sdkInDesktopView: d,
80
75
  appNode: u,
81
76
  responsiveStore: i
82
77
  }) : null;
@@ -85,47 +80,47 @@ const j = (n) => {
85
80
  setPill: t,
86
81
  appNode: u,
87
82
  headerNode: i,
88
- scrollNode: d,
89
- responsiveStore: o,
90
- scrollStore: r
83
+ scrollNode: l,
84
+ responsiveStore: r,
85
+ scrollStore: o
91
86
  }) => {
92
- var k, y;
87
+ var y, I;
93
88
  const {
94
- screen: l
95
- } = g(o, {
89
+ screen: d
90
+ } = p(r, {
96
91
  keys: ["screen"]
97
92
  }), {
98
93
  tabsShown: m,
99
94
  scrollPosition: s
100
- } = g(r, {
95
+ } = p(o, {
101
96
  keys: ["tabsShown", "scrollPosition"]
102
97
  });
103
98
  h(() => {
104
- o.get().sdkInDesktopView ? s < 50 && t(null) : s > -50 && t(null);
105
- }, [s, o, t]);
106
- const e = o.get().sdkInDesktopView ? u : i;
99
+ r.get().sdkInDesktopView ? s < 50 && t(null) : s > -50 && t(null);
100
+ }, [s, r, t]);
101
+ const e = r.get().sdkInDesktopView ? u : i;
107
102
  return !n || !e.current ? null : b.createPortal(/* @__PURE__ */ c(U, {
108
- title: n.type === a.QUESTION_RESOLVED ? "Prediction result" : `New ${((y = R[(k = n.data) == null ? void 0 : k.questionType]) == null ? void 0 : y.label) || "notification"}`,
103
+ title: n.type === a.QUESTION_RESOLVED ? "Prediction result" : `New ${((I = R[(y = n.data) == null ? void 0 : y.questionType]) == null ? void 0 : I.label) || "notification"}`,
109
104
  onClick: () => {
110
- var I;
111
- o.get().sdkInDesktopView ? (I = d.current) == null || I.scrollTo({
105
+ var k;
106
+ r.get().sdkInDesktopView ? (k = l.current) == null || k.scrollTo({
112
107
  top: 0,
113
108
  behavior: "smooth"
114
- }) : q(u, l.size, {
109
+ }) : q(u, d.size, {
115
110
  behavior: "smooth"
116
111
  }), t(null);
117
112
  },
118
- className: N(m && F, "sl-pill-button")
113
+ className: D(m && F, "sl-pill-button")
119
114
  }), e.current);
120
115
  }, it = ({
121
116
  sdk: n,
122
117
  headerNode: t,
123
118
  scrollNode: u,
124
119
  responsiveStore: i,
125
- appNode: d,
126
- scrollStore: o
120
+ appNode: l,
121
+ scrollStore: r
127
122
  }) => {
128
- const [r] = p(n.getNotificationsStore()), l = g(r), [m, s] = p(null), e = E(() => n.getActiveNotification(), [n, l]);
123
+ const [o] = f(n.getNotificationsStore()), d = p(o), [m, s] = f(null), e = E(() => n.getActiveNotification(), [n, d]);
129
124
  return h(() => {
130
125
  e && C.emit("notification", {
131
126
  action: "rendered",
@@ -136,25 +131,25 @@ const j = (n) => {
136
131
  });
137
132
  }, [e]), h(() => {
138
133
  e && (i.get().sdkInDesktopView || i.get().sdkInView) && (!i.get().sdkInDesktopView && i.get().sdkInView && s(e), i.get().sdkInDesktopView && window.requestAnimationFrame(() => {
139
- o.get().scrollPosition !== 0 && s(e);
134
+ r.get().scrollPosition !== 0 && s(e);
140
135
  }));
141
136
  }, [e]), h(() => {
142
137
  e || s(null);
143
- }, [e]), /* @__PURE__ */ f(D, {
138
+ }, [e]), /* @__PURE__ */ g(V, {
144
139
  children: [!m && e && /* @__PURE__ */ c(z, {
145
140
  headerNode: t,
146
- appNode: d,
141
+ appNode: l,
147
142
  sdk: n,
148
143
  notification: e,
149
144
  responsiveStore: i
150
145
  }), m && /* @__PURE__ */ c(L, {
151
146
  pill: m,
152
147
  setPill: s,
153
- appNode: d,
148
+ appNode: l,
154
149
  notification: e,
155
150
  headerNode: t,
156
151
  scrollNode: u,
157
- scrollStore: o,
152
+ scrollStore: r,
158
153
  responsiveStore: i
159
154
  })]
160
155
  });
@@ -1,28 +1,34 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { useState as i, useEffect as c } from "react";
3
- import { useStore as f } from "@streamlayer/react-polyfills";
4
- import { FeatureStatus as p } from "@streamlayer/sdk-web-interfaces";
5
- import { FeatureType as S } from "@streamlayer/sdk-web-types";
6
- import { Points as l } from "../../../ui/gamification/points/index.js";
7
- const a = ({ gamification: e }) => {
8
- const s = e.userSummary.$store, [r, u] = i(0);
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { useState as a, useEffect as c } from "react";
3
+ import { useStore as l } from "@streamlayer/react-polyfills";
4
+ import { FeatureStatus as u, eventBus as n } from "@streamlayer/sdk-web-interfaces";
5
+ import { FeatureType as f } from "@streamlayer/sdk-web-types";
6
+ import { Points as S } from "../../../ui/gamification/points/index.js";
7
+ const y = ({ gamification: e }) => {
8
+ const s = e.userSummary.$store, [t, p] = a(0);
9
9
  return c(() => {
10
- const m = s.subscribe((t) => {
10
+ const i = s.subscribe((r) => {
11
11
  var o;
12
- (o = t == null ? void 0 : t.summary) != null && o.points && u(t.summary.points);
12
+ (o = r == null ? void 0 : r.summary) != null && o.points && p(r.summary.points);
13
13
  });
14
14
  return () => {
15
- m();
15
+ i();
16
16
  };
17
- }, [s]), /* @__PURE__ */ n(l, { points: r, onClick: () => {
18
- e.status.get() === p.Suspended && e.openFeature();
17
+ }, [s]), /* @__PURE__ */ m(S, { points: t, onClick: () => {
18
+ e.status.get() === u.Suspended ? (e.openFeature(), n.emit("app", {
19
+ action: "open",
20
+ payload: {}
21
+ })) : e.status.get() === u.Ready && (e.closeFeature(!1), n.emit("app", {
22
+ action: "close",
23
+ payload: {}
24
+ }));
19
25
  } });
20
- }, h = ({ sdk: e }) => {
21
- if (!f(e.featuresList.getStore()))
26
+ }, k = ({ sdk: e }) => {
27
+ if (!l(e.featuresList.getStore()))
22
28
  return null;
23
- const r = e.getFeature(S.GAMES);
24
- return r ? /* @__PURE__ */ n(a, { gamification: r }) : null;
29
+ const t = e.getFeature(f.GAMES);
30
+ return t ? /* @__PURE__ */ m(y, { gamification: t }) : null;
25
31
  };
26
32
  export {
27
- h as StreamLayerSDKPoints
33
+ k as StreamLayerSDKPoints
28
34
  };
@@ -1,107 +1,85 @@
1
- import { jsxs as u, jsx as t } from "react/jsx-runtime";
2
- import { cx as x } from "@linaria/core";
3
- import { SDKContainer as y, SDKScrollContainer as A } from "./styles.js";
4
- import { useSdkScroll as C } from "./useSdkScroll.js";
5
- import { useSdkFeature as D } from "../useSdkFeature.js";
6
- import { useAnalyticsListener as p, newTabLinkListener as I, appScrollListener as M, appClickListener as P } from "../../hooks/analytics.js";
7
- import { useRef as d, useState as E, useEffect as S, useMemo as g } from "react";
8
- import { useStore as i } from "@streamlayer/react-polyfills";
9
- import { FeatureType as k } from "@streamlayer/sdk-web-types";
10
- import { resetCss as f } from "../../ui/theme/theme.js";
11
- import { BetPackOverlay as w } from "./BetPack/index.js";
12
- import { ActiveFeature as K, StandaloneFeature as B } from "./Features/index.js";
13
- import { SDKHeader as O } from "./Header/index.js";
14
- import { SDKNotifications as R } from "./Notifications/index.js";
15
- import { MastersContext as j } from "./useMastersContext.js";
16
- import { useSdkResponsive as G } from "./useSdkResponsive.js";
17
- import { StreamLayerMastersThemeProvider as me } from "../../ui/theme/masters.js";
18
- const T = ({ sdk: e, className: o }) => {
19
- const [, r] = D(e);
20
- return /* @__PURE__ */ t(K, { className: o, feature: r, sdk: e });
21
- }, V = ({ sdk: e, className: o, appNode: r, responsiveStore: l }) => {
22
- const n = i(e.featuresList.getStore());
23
- return n ? Array.from(n, (a) => {
24
- const s = e.getFeature(a);
25
- return s ? /* @__PURE__ */ t(
26
- B,
27
- {
28
- className: o,
29
- appNode: r,
30
- feature: s,
31
- responsiveStore: l,
32
- sdk: e
33
- },
34
- a
35
- ) : null;
1
+ import { jsxs as f, jsx as a } from "react/jsx-runtime";
2
+ import { cx as w } from "@linaria/core";
3
+ import { SDKContainer as L, SDKScrollContainer as N } from "./styles.js";
4
+ import { useSdkScroll as x } from "./useSdkScroll.js";
5
+ import { useSdkFeature as y } from "../useSdkFeature.js";
6
+ import { useAnalyticsListener as h, newTabLinkListener as F } from "../../hooks/analytics.js";
7
+ import A from "lodash.throttle";
8
+ import { useState as b, useMemo as E, useRef as d, useEffect as p } from "react";
9
+ import { useStore as c } from "@streamlayer/react-polyfills";
10
+ import { FeatureType as I } from "@streamlayer/sdk-web-types";
11
+ import { resetCss as u } from "../../ui/theme/theme.js";
12
+ import { BetPackOverlay as M } from "./BetPack/index.js";
13
+ import { ActiveFeature as k, StandaloneFeature as z } from "./Features/index.js";
14
+ import { SDKHeader as C } from "./Header/index.js";
15
+ import { SDKNotifications as P } from "./Notifications/index.js";
16
+ import { MastersContext as g } from "./useMastersContext.js";
17
+ import { checkSdkInDesktopView as S, getScreenSize as v, useSdkResponsive as D } from "./useSdkResponsive.js";
18
+ import { StreamLayerMastersThemeProvider as se } from "../../ui/theme/masters.js";
19
+ const B = ({ sdk: e, className: t }) => {
20
+ const [, r] = y(e);
21
+ return /* @__PURE__ */ a(k, { className: t, feature: r, sdk: e });
22
+ }, K = ({ sdk: e, className: t, appNode: r }) => {
23
+ const o = c(e.featuresList.getStore());
24
+ return o ? Array.from(o, (n) => {
25
+ const s = e.getFeature(n);
26
+ return s ? /* @__PURE__ */ a(z, { className: t, appNode: r, feature: s, sdk: e }, n) : null;
36
27
  }) : null;
37
- }, q = ({
38
- responsiveStore: e,
39
- ...o
40
- }) => {
41
- const { sdkInDesktopView: r } = i(e);
42
- return /* @__PURE__ */ t(w, { ...o, isMobile: !r });
43
- }, ae = ({ sdk: e, betPack: o }) => {
44
- const r = d(null), [l, n] = E(o), a = d(null), [s] = G(r), [m, v] = C(r, s), N = i(e.status), F = i(e.sdkStore.slStreamId), b = !!i(e.userId()), c = N === "ready" && !!F.data;
45
- S(() => {
28
+ }, O = (e) => {
29
+ const [t, r] = b(!S(v().size)), o = d(null);
30
+ return p(() => {
31
+ const n = A(() => {
32
+ const s = v();
33
+ r(!S(s.size));
34
+ }, 200);
35
+ return window.addEventListener("resize", n), () => {
36
+ window.removeEventListener("resize", n);
37
+ };
38
+ }, []), h(o, { enabled: !0, event: "click", listener: F }), /* @__PURE__ */ a(M, { ref: o, ...e, isMobile: t });
39
+ }, R = ({ sdk: e }) => {
40
+ const t = d(null), r = c(e.status), o = c(e.sdkStore.slStreamId), n = d(null), [s] = D(t), [i, l] = x(t, s), m = r === "ready" && !!o.data;
41
+ return p(() => {
46
42
  window.requestAnimationFrame(() => {
47
43
  e.initializeApp().then(() => {
48
- e.openFeature(k.GAMES);
44
+ e.openFeature(I.GAMES);
49
45
  });
50
46
  });
51
- }, [e]), p(r, { enabled: !0, event: "click", listener: I }), p(m, {
52
- enabled: !0,
53
- event: "scrollend",
54
- listener: M,
55
- useDomNode: !0
56
- }), p(m, {
57
- enabled: !0,
58
- event: "click",
59
- listener: P,
60
- useDomNode: !0
61
- });
62
- const h = g(() => ({ sdk: e }), [e]);
63
- return S(() => {
47
+ }, [e]), h(t, { enabled: !0, event: "click", listener: F }), p(() => {
64
48
  import("./Features/Gamification/gamification-feature.js");
65
- }, []), /* @__PURE__ */ u(j.Provider, { value: h, children: [
66
- l && b && /* @__PURE__ */ t(
67
- q,
49
+ }, []), /* @__PURE__ */ f(L, { ref: t, children: [
50
+ /* @__PURE__ */ a(C, { className: w(u, "sl-hide-on-modal"), ref: n }),
51
+ /* @__PURE__ */ f(N, { "data-nav": !0, className: "sl-hide-on-modal", ref: i, children: [
52
+ m && /* @__PURE__ */ a(
53
+ P,
54
+ {
55
+ sdk: e,
56
+ scrollNode: i,
57
+ headerNode: n,
58
+ appNode: t,
59
+ scrollStore: l,
60
+ responsiveStore: s
61
+ }
62
+ ),
63
+ m && /* @__PURE__ */ a(B, { className: u, sdk: e }),
64
+ m && /* @__PURE__ */ a(K, { appNode: t, className: u, sdk: e })
65
+ ] })
66
+ ] });
67
+ }, re = ({ sdk: e, betPack: t }) => {
68
+ const [r, o] = b(t), s = !!c(e.userId()), i = E(() => ({ sdk: e }), [e]);
69
+ return /* @__PURE__ */ f(g.Provider, { value: i, children: [
70
+ r && s && /* @__PURE__ */ a(
71
+ O,
68
72
  {
69
73
  sdk: e,
70
- onEvent: ({ type: L }) => L === "slOpenGameCenter" ? n(!1) : () => {
74
+ onEvent: ({ type: l }) => l === "slOpenGameCenter" ? o(!1) : () => {
71
75
  },
72
- close: () => n(!1),
73
- responsiveStore: s
76
+ close: () => o(!1)
74
77
  }
75
78
  ),
76
- !l && /* @__PURE__ */ u(y, { ref: r, children: [
77
- /* @__PURE__ */ t(O, { className: x(f, "sl-hide-on-modal"), ref: a }),
78
- /* @__PURE__ */ u(A, { "data-nav": !0, className: "sl-hide-on-modal", ref: m, children: [
79
- c && /* @__PURE__ */ t(
80
- R,
81
- {
82
- sdk: e,
83
- scrollNode: m,
84
- headerNode: a,
85
- appNode: r,
86
- scrollStore: v,
87
- responsiveStore: s
88
- }
89
- ),
90
- c && /* @__PURE__ */ t(T, { className: f, sdk: e }),
91
- c && /* @__PURE__ */ t(
92
- V,
93
- {
94
- responsiveStore: s,
95
- appNode: r,
96
- className: f,
97
- sdk: e
98
- }
99
- )
100
- ] })
101
- ] })
79
+ !r && /* @__PURE__ */ a(R, { sdk: e })
102
80
  ] });
103
81
  };
104
82
  export {
105
- ae as MastersApp,
106
- me as StreamLayerMastersThemeProvider
83
+ re as MastersApp,
84
+ se as StreamLayerMastersThemeProvider
107
85
  };
@@ -0,0 +1,3 @@
1
+ export declare const useOrientation: () => {
2
+ orientation: string;
3
+ };
@@ -0,0 +1,12 @@
1
+ import { useState as i, useEffect as o } from "react";
2
+ const a = () => {
3
+ const [t, n] = i(""), e = () => {
4
+ window.screen.orientation.type.includes("landscape") || Math.abs(window.orientation) === 90 ? n("landscape") : n("portrait");
5
+ };
6
+ return o(() => (window.screen.orientation.addEventListener("change", e), window.addEventListener("orientationchange", e), e(), () => {
7
+ window.screen.orientation.removeEventListener("change", e), window.removeEventListener("orientationchange", e);
8
+ }), []), { orientation: t };
9
+ };
10
+ export {
11
+ a as useOrientation
12
+ };
@@ -10,6 +10,8 @@ type ResponsiveData = {
10
10
  sdkInView: boolean;
11
11
  sdkInDesktopView: boolean;
12
12
  };
13
+ export declare const getScreenSize: () => ResponsiveData["screen"];
14
+ export declare const checkSdkInDesktopView: (screenSize: number) => boolean;
13
15
  export type ResponsiveStore = MapStore<ResponsiveData>;
14
16
  export declare const useSdkResponsive: (appNode: AppNodeRef) => [ResponsiveStore];
15
17
  export {};
@@ -1,7 +1,7 @@
1
1
  import c from "lodash.throttle";
2
2
  import { useState as m, useEffect as u } from "react";
3
3
  import { BREAKPOINTS as r } from "../../ui/theme/constants.js";
4
- import { m as l } from "../../index-BEm7B1u1.js";
4
+ import { m as l } from "../../index-CLJzLXks.js";
5
5
  const d = Object.keys(r), i = () => {
6
6
  const n = window.innerWidth;
7
7
  let e = "sm";
@@ -41,5 +41,7 @@ const d = Object.keys(r), i = () => {
41
41
  }, [e, n]), [e];
42
42
  };
43
43
  export {
44
+ k as checkSdkInDesktopView,
45
+ i as getScreenSize,
44
46
  v as useSdkResponsive
45
47
  };
@@ -2,7 +2,7 @@ import S from "lodash.throttle";
2
2
  import { useRef as m, useState as h, useEffect as b } from "react";
3
3
  import { useStore as g } from "@streamlayer/react-polyfills";
4
4
  import { BREAKPOINTS as c } from "../../ui/theme/constants.js";
5
- import { m as v } from "../../index-BEm7B1u1.js";
5
+ import { m as v } from "../../index-CLJzLXks.js";
6
6
  const C = (o, e, n) => {
7
7
  const t = e >= c.lg && e < c.xl ? 75 : 52;
8
8
  o.current && window.scrollTo({