@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,27 +1,36 @@
1
- import a from "lodash.throttle";
2
- import { useState as d, useRef as T, useEffect as c } from "react";
3
- const i = "16px", u = 17, O = 21, h = 24, f = (n) => n < 0.9 ? h : n < 1.17 ? O : u, I = (n) => {
4
- const [E, s] = d(i), r = T(null);
5
- return c(() => {
6
- const e = a(() => {
7
- const { offsetWidth: t, offsetHeight: o } = r.current || {};
8
- if (!t || !o) return;
9
- const _ = o / t;
10
- s(t ? `${t / f(_)}px` : i);
11
- }, 200);
12
- return window.screen.orientation.addEventListener("change", e), window.addEventListener("orientationchange", e), window.addEventListener("resize", e), e(), () => {
13
- window.screen.orientation.removeEventListener("change", e), window.removeEventListener("resize", e), window.removeEventListener("orientationchange", e);
1
+ import { useState as T, useRef as h, useEffect as p } from "react";
2
+ const m = "16px", g = 17, f = 21, S = 24, w = (r) => r < 0.9 ? S : r < 1.17 ? f : g, C = (r, E) => {
3
+ const [v, a] = T(m), [_, u] = T(""), c = h(null), e = h();
4
+ return p(() => {
5
+ const t = c.current, n = () => {
6
+ e.current && (clearTimeout(e.current), e.current = void 0), e.current = setTimeout(() => {
7
+ if (t) {
8
+ const i = getComputedStyle(t), d = +i.width.replace("px", ""), O = +i.height.replace("px", "") / d, l = d / w(O);
9
+ a(`${l < 20 ? l : 20}px`);
10
+ }
11
+ e.current = void 0;
12
+ }, 200);
13
+ }, s = () => {
14
+ window.screen.orientation.type.includes("landscape") || Math.abs(window.orientation) === 90 ? u("landscape") : u("portrait");
15
+ }, o = () => {
16
+ s(), n();
14
17
  };
15
- }, []), c(() => {
16
- const { offsetWidth: e, offsetHeight: t } = r.current || {};
17
- if (!e || !t) return;
18
- const o = t / e;
19
- s(e ? `${e / f(o)}px` : i);
20
- }, [n]), {
21
- container: r,
22
- fontSize: E
18
+ return window.screen.orientation.addEventListener("change", o), window.addEventListener("orientationchange", o), window.addEventListener("resize", n), t == null || t.addEventListener("transitionend", n, !1), s(), n(), () => {
19
+ window.screen.orientation.removeEventListener("change", o), window.removeEventListener("orientationchange", o), window.removeEventListener("resize", n), t == null || t.removeEventListener("transitionend", n), e.current && clearTimeout(e.current);
20
+ };
21
+ }, []), p(() => (e.current && (clearTimeout(e.current), e.current = void 0), e.current = setTimeout(() => {
22
+ if (c.current) {
23
+ const t = getComputedStyle(c.current), n = +t.width.replace("px", ""), o = +t.height.replace("px", "") / n, i = n / w(o);
24
+ a(`${i < 20 ? i : 20}px`), e.current = void 0;
25
+ }
26
+ }, 200), () => {
27
+ e.current && clearTimeout(e.current);
28
+ }), [r]), {
29
+ container: c,
30
+ fontSize: v,
31
+ calcHeight: _ === "landscape" && r !== void 0 && E ? r + 30 : r
23
32
  };
24
33
  };
25
34
  export {
26
- I as useDynamicParentFont
35
+ C as useDynamicParentFont
27
36
  };
@@ -2,4 +2,5 @@ export declare const StartScreen: React.FC<{
2
2
  height: number | undefined;
3
3
  countQuestionsAvailable: number;
4
4
  sliderRef: React.MutableRefObject<null>;
5
+ swipeable?: boolean;
5
6
  }>;
@@ -1,23 +1,23 @@
1
1
  import { jsx as r, jsxs as e } from "react/jsx-runtime";
2
- import { ScreenContainer as c } from "../ScreenContainer/index.js";
3
- import { ScreenWrap as s, Main as S, SponsorIcon as a, StartScreenSponsor as l, StartScreenTitle as p, StartScreenDescription as d, StartScreenButton as h, IconArrowRight as m } from "./styles.js";
4
- const R = ({ height: o, countQuestionsAvailable: n, sliderRef: i }) => /* @__PURE__ */ r(c, { height: o, children: /* @__PURE__ */ e(s, { children: [
5
- /* @__PURE__ */ e(S, { children: [
6
- /* @__PURE__ */ r(a, { name: "icon-masters-logo" }),
7
- /* @__PURE__ */ r(l, { children: "MASTERS PRESENTS" }),
8
- /* @__PURE__ */ e(p, { children: [
2
+ import { ScreenContainer as s } from "../ScreenContainer/index.js";
3
+ import { ScreenWrap as S, Main as a, SponsorIcon as l, StartScreenSponsor as p, StartScreenTitle as d, StartScreenDescription as h, StartScreenButton as m, IconArrowRight as x } from "./styles.js";
4
+ const T = ({ height: o, countQuestionsAvailable: n, sliderRef: i, swipeable: c }) => /* @__PURE__ */ r(s, { height: o, swipeable: c, children: /* @__PURE__ */ e(S, { children: [
5
+ /* @__PURE__ */ e(a, { children: [
6
+ /* @__PURE__ */ r(l, { name: "icon-masters-logo" }),
7
+ /* @__PURE__ */ r(p, { children: "MASTERS PRESENTS" }),
8
+ /* @__PURE__ */ e(d, { children: [
9
9
  "Tee time predictions:",
10
10
  /* @__PURE__ */ r("br", {}),
11
11
  "share your expertise"
12
12
  ] }),
13
- /* @__PURE__ */ e(d, { children: [
13
+ /* @__PURE__ */ e(h, { children: [
14
14
  "Swipe to answer today’s",
15
15
  /* @__PURE__ */ r("br", {}),
16
16
  "question cards."
17
17
  ] })
18
18
  ] }),
19
19
  /* @__PURE__ */ e(
20
- h,
20
+ m,
21
21
  {
22
22
  onClick: () => {
23
23
  var t;
@@ -25,11 +25,11 @@ const R = ({ height: o, countQuestionsAvailable: n, sliderRef: i }) => /* @__PUR
25
25
  },
26
26
  children: [
27
27
  n ? `${n} questions available` : "See all questions",
28
- /* @__PURE__ */ r(m, { name: "iconArrowRight" })
28
+ /* @__PURE__ */ r(x, { name: "iconArrowRight" })
29
29
  ]
30
30
  }
31
31
  )
32
32
  ] }) }, "start");
33
33
  export {
34
- R as StartScreen
34
+ T as StartScreen
35
35
  };
@@ -1,38 +1,38 @@
1
- import { jsx as i, jsxs as R } from "react/jsx-runtime";
1
+ import { jsx as u, jsxs as R } from "react/jsx-runtime";
2
2
  import { ConnectError as T, Code as N } from "@connectrpc/connect";
3
- import { cx as w } from "@linaria/core";
4
- import { useCallback as x, useSyncExternalStore as A, useRef as b, useState as F, useMemo as I, useEffect as v } from "react";
3
+ import { cx as A } from "@linaria/core";
4
+ import { useCallback as P, useSyncExternalStore as F, useRef as b, useState as I, useMemo as B, useEffect as v } from "react";
5
5
  import { EmergencyScreen as S } from "./EmergencyScreen/index.js";
6
- import { EndScreen as B } from "./EndScreen/index.js";
6
+ import { EndScreen as M } from "./EndScreen/index.js";
7
7
  import { LoaderScreen as D } from "./LoaderScreen/index.js";
8
8
  import { QuestionScreen as H } from "./QuestionScreen/index.js";
9
9
  import { ScreenContainer as L } from "./ScreenContainer/index.js";
10
10
  import { StartScreen as V } from "./StartScreen/index.js";
11
- import { settings as h } from "./constants.js";
12
- import { Carousel as K, desktopDots as M } from "./styles.js";
13
- function q(t, n, u) {
14
- let a = /* @__PURE__ */ new Set([...n, void 0]);
15
- return t.listen((s, o, p) => {
16
- a.has(p) && u(s, o, p);
11
+ import { settings as x } from "./constants.js";
12
+ import { Carousel as K, desktopDots as q } from "./styles.js";
13
+ function z(t, s, r) {
14
+ let a = new Set(s).add(void 0);
15
+ return t.listen((o, c, p) => {
16
+ a.has(p) && r(o, c, p);
17
17
  });
18
18
  }
19
- function z(t, n = {}) {
20
- let u = x(
21
- (s) => n.keys ? q(t, n.keys, s) : t.listen(s),
22
- [n.keys, t]
19
+ function E(t, s = {}) {
20
+ let r = P(
21
+ (o) => s.keys ? z(t, s.keys, o) : t.listen(o),
22
+ [s.keys, t]
23
23
  ), a = t.get.bind(t);
24
- return A(u, a, a);
24
+ return F(r, a, a);
25
25
  }
26
- const re = ({ gamification: t, autoplay: n, swipeable: u, changeHeightOnInit: a, height: s, onEvent: o, centerPadding: p }) => {
27
- const c = b(), l = b(null), [P, C] = F(!1), { data: r, error: f, loading: y } = z(t.betPack.getStore()), { listOfQuestions: m, countQuestionsAvailable: O } = I(() => {
28
- const e = r ? Object.values(r) : [];
26
+ const re = ({ gamification: t, autoplay: s, swipeable: r, changeHeightOnInit: a, height: o, onEvent: c, centerPadding: p }) => {
27
+ const i = b(), l = b(null), [C, O] = I(!1), { data: n, error: f, loading: y } = E(t.betPack.getStore()), { listOfQuestions: m, countQuestionsAvailable: Q } = B(() => {
28
+ const e = n ? Object.values(n) : [];
29
29
  return {
30
30
  listOfQuestions: e,
31
31
  countQuestionsAvailable: e.filter(({ marketClosed: d }) => !d).length
32
32
  };
33
- }, [r]);
33
+ }, [n]);
34
34
  v(() => {
35
- !f && !y && r !== void 0 && !P && o({
35
+ !f && !y && n !== void 0 && !C && c({
36
36
  type: "slBetPackReady",
37
37
  payload: {
38
38
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -52,55 +52,59 @@ const re = ({ gamification: t, autoplay: n, swipeable: u, changeHeightOnInit: a,
52
52
  canPrev: !1
53
53
  }
54
54
  });
55
- }, [r, f, y, o]);
56
- const Q = x(
55
+ }, [n, f, y, c]);
56
+ const h = P(
57
57
  async (e, d) => {
58
58
  try {
59
- C(!0), await t.betPackVote(e, d);
59
+ O(!0), await t.betPackVote(e, d);
60
60
  } finally {
61
- c.current && clearTimeout(c.current), n && (c.current = setTimeout(() => {
61
+ i.current && clearTimeout(i.current), s && (i.current = setTimeout(() => {
62
62
  var k;
63
63
  (k = l.current) == null || k.slickNext();
64
64
  }, 2e3));
65
65
  }
66
66
  },
67
- [t, l, n]
67
+ [t, l, s]
68
68
  );
69
69
  if (v(() => () => {
70
- c.current && clearTimeout(c.current);
70
+ i.current && clearTimeout(i.current);
71
71
  }, []), y)
72
- return /* @__PURE__ */ i(D, {});
73
- if (!f && (r == null || !Object.keys(r).length))
74
- return /* @__PURE__ */ i(
72
+ return /* @__PURE__ */ u(D, {});
73
+ if (!f && (n == null || !Object.keys(n).length))
74
+ return /* @__PURE__ */ u(
75
75
  S,
76
76
  {
77
- actionFn: () => o({ type: "slHardRefresh" }),
77
+ actionFn: () => c({ type: "slHardRefresh" }),
78
78
  description: `It looks like we couldn't
79
- load the questions.`
79
+ load the questions.`,
80
+ isMobile: r,
81
+ height: o
80
82
  }
81
83
  );
82
84
  if (f)
83
- return /* @__PURE__ */ i(
85
+ return /* @__PURE__ */ u(
84
86
  S,
85
87
  {
86
- actionFn: () => o({ type: "slHardRefresh" }),
88
+ actionFn: () => c({ type: "slHardRefresh" }),
87
89
  description: f instanceof T && f.code !== N.InvalidArgument ? `The event ID was not
88
90
  specified or is invalid.` : `The server is unable to
89
- handle this request.`
91
+ handle this request.`,
92
+ isMobile: r,
93
+ height: o
90
94
  }
91
95
  );
92
- const g = (e) => {
96
+ const j = (e) => {
93
97
  var d;
94
- if (o({
98
+ if (c({
95
99
  type: "slBetPackChangeCard",
96
100
  payload: {
97
101
  current: e,
98
- canNext: e < Object.keys(r).length + 1,
102
+ canNext: e < Object.keys(n).length + 1,
99
103
  canPrev: e >= 1
100
104
  }
101
- }), e !== 0 && e !== Object.keys(r).length + 1 && ((d = m[e - 1]) != null && d.id)) {
105
+ }), e !== 0 && e !== Object.keys(n).length + 1 && ((d = m[e - 1]) != null && d.id)) {
102
106
  t.openQuestion(m[e - 1].id, {
103
- openedFrom: "list",
107
+ openedFrom: "bet-pack",
104
108
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
105
109
  // @ts-expect-error
106
110
  attributes: {
@@ -115,24 +119,32 @@ handle this request.`
115
119
  return;
116
120
  }
117
121
  t.closeQuestion();
118
- }, j = (e) => e ? /* @__PURE__ */ i(L, { height: s, children: /* @__PURE__ */ i(H, { question: e, vote: Q }) }, e.id) : null;
122
+ }, g = (e) => e ? /* @__PURE__ */ u(L, { height: o, swipeable: r, children: /* @__PURE__ */ u(H, { question: e, vote: h }) }, e.id) : null;
119
123
  return /* @__PURE__ */ R(
120
124
  K,
121
125
  {
122
- ...h,
123
- swipe: u,
126
+ ...x,
127
+ swipe: r,
124
128
  onInit: a,
125
- centerPadding: p || h.centerPadding,
126
- afterChange: g,
129
+ centerPadding: p || x.centerPadding,
130
+ afterChange: j,
127
131
  beforeChange: () => {
128
- c.current && clearTimeout(c.current);
132
+ i.current && clearTimeout(i.current);
129
133
  },
130
134
  ref: l,
131
- className: w(!u && M),
135
+ className: A(!r && q),
132
136
  children: [
133
- /* @__PURE__ */ i(V, { height: s, sliderRef: l, countQuestionsAvailable: O }),
134
- Object.values(r).map(j),
135
- /* @__PURE__ */ i(B, { onEvent: o, height: s })
137
+ /* @__PURE__ */ u(
138
+ V,
139
+ {
140
+ height: o,
141
+ sliderRef: l,
142
+ countQuestionsAvailable: Q,
143
+ swipeable: r
144
+ }
145
+ ),
146
+ Object.values(n).map(g),
147
+ /* @__PURE__ */ u(M, { onEvent: c, height: o, swipeable: r })
136
148
  ]
137
149
  }
138
150
  );
@@ -9,4 +9,4 @@ export type BetPackOverlayProps = {
9
9
  payload?: unknown;
10
10
  }) => void;
11
11
  };
12
- export declare const BetPackOverlay: React.FC<BetPackOverlayProps>;
12
+ export declare const BetPackOverlay: import('react').ForwardRefExoticComponent<BetPackOverlayProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,9 +1,10 @@
1
1
  import "react/jsx-runtime";
2
2
  import "@linaria/core";
3
+ import "../../useOrientation.js";
3
4
  import "react";
4
- import { BetPackOverlay as a } from "../index.js";
5
+ import { BetPackOverlay as c } from "../index.js";
5
6
  import "../../../../ui/icons/index.js";
6
7
  import "./styles.js";
7
8
  export {
8
- a as BetPackOverlay
9
+ c as BetPackOverlay
9
10
  };
@@ -1,90 +1,95 @@
1
- import { jsxs as f, jsx as r } from "react/jsx-runtime";
2
- import { cx as p } from "@linaria/core";
3
- import C from "lodash.throttle";
4
- import { useState as g, useCallback as S, memo as H, useMemo as B, useRef as N, useEffect as A } from "react";
5
- import { useStore as P } from "@streamlayer/react-polyfills";
6
- import { FeatureType as b } from "@streamlayer/sdk-web-types";
7
- import { BetPackContent as L } from "./BetPackContent/index.js";
8
- import { EmergencyScreen as z } from "./BetPackContent/EmergencyScreen/index.js";
9
- import { LoaderScreen as F } from "./BetPackContent/LoaderScreen/index.js";
10
- import { BetPackContainer as I } from "./styles.js";
11
- import { defaultEventHandler as O } from "./utils.js";
12
- import { SvgIcon as x } from "../../../ui/icons/index.js";
13
- import { Container as R, Header as j, HeaderTitle as E, CloseButton as M, Main as T, Footer as G, SlideSwitchButton as v, IconArrowPrev as U, buttonAvailable as y, IconArrowNext as Y } from "./BetPackOverlay/styles.js";
14
- const ne = ({ sdk: l, onEvent: o, close: u, isMobile: c }) => {
15
- const [t, h] = g(), [e, a] = g(), i = S(
16
- (n) => {
17
- if (n.type === "slBetPackReady") {
18
- const { next: s, prev: d, current: m, canNext: k, canPrev: w } = n.payload || {};
19
- h({ next: s, prev: d }), a({
20
- current: m,
21
- canPrev: w,
22
- canNext: k
23
- });
24
- }
25
- if (n.type === "slBetPackChangeCard") {
26
- const { current: s, canNext: d, canPrev: m } = n.payload || {};
27
- a({ current: s, canNext: d, canPrev: m });
28
- }
29
- o == null || o(n);
30
- },
31
- [o]
32
- );
33
- return /* @__PURE__ */ f(R, { children: [
34
- /* @__PURE__ */ f(j, { children: [
35
- /* @__PURE__ */ f(E, { children: [
36
- /* @__PURE__ */ r(x, { name: "icon-trophy-bet-pack" }),
37
- "LiveMatch Experience",
38
- " "
1
+ import { jsxs as f, jsx as e } from "react/jsx-runtime";
2
+ import { cx as y } from "@linaria/core";
3
+ import R from "lodash.throttle";
4
+ import { forwardRef as z, useState as k, useCallback as N, useMemo as A, memo as F, useRef as I, useEffect as O } from "react";
5
+ import { useStore as w } from "@streamlayer/react-polyfills";
6
+ import { FeatureType as j } from "@streamlayer/sdk-web-types";
7
+ import { BetPackContent as E } from "./BetPackContent/index.js";
8
+ import { EmergencyScreen as M } from "./BetPackContent/EmergencyScreen/index.js";
9
+ import { LoaderScreen as T } from "./BetPackContent/LoaderScreen/index.js";
10
+ import { BetPackContainer as G } from "./styles.js";
11
+ import { defaultEventHandler as U } from "./utils.js";
12
+ import { useOrientation as Y } from "../useOrientation.js";
13
+ import { SvgIcon as C } from "../../../ui/icons/index.js";
14
+ import { Container as q, Header as D, HeaderTitle as J, CloseButton as K, Main as Q, Footer as V, SlideSwitchButton as H, IconArrowPrev as W, buttonAvailable as B, IconArrowNext as X } from "./BetPackOverlay/styles.js";
15
+ const ur = z(
16
+ ({ sdk: m, onEvent: o, close: u, isMobile: c }, h) => {
17
+ const [i, d] = k(), [r, t] = k(), { orientation: s } = Y(), l = N(
18
+ (a) => {
19
+ if (a.type === "slBetPackReady") {
20
+ const { next: P, prev: x, current: p, canNext: b, canPrev: L } = a.payload || {};
21
+ d({ next: P, prev: x }), t((n) => ({
22
+ current: n != null && n.current ? n == null ? void 0 : n.current : p,
23
+ canPrev: n != null && n.current ? n == null ? void 0 : n.canPrev : L,
24
+ canNext: b
25
+ }));
26
+ }
27
+ if (a.type === "slBetPackChangeCard") {
28
+ const { current: P, canNext: x, canPrev: p } = a.payload || {};
29
+ t({ current: P, canNext: x, canPrev: p });
30
+ }
31
+ o == null || o(a);
32
+ },
33
+ [o]
34
+ ), g = A(() => c ? s === "landscape" ? "60px" : "18px" : "30px", [c, s]);
35
+ return /* @__PURE__ */ f(q, { ref: h, children: [
36
+ /* @__PURE__ */ f(D, { children: [
37
+ /* @__PURE__ */ f(J, { children: [
38
+ /* @__PURE__ */ e(C, { name: "icon-trophy-bet-pack" }),
39
+ "LiveMatch Experience",
40
+ " "
41
+ ] }),
42
+ /* @__PURE__ */ e(K, { onClick: u, children: /* @__PURE__ */ e(C, { name: "icon-close-btn-gray" }) })
39
43
  ] }),
40
- /* @__PURE__ */ r(M, { onClick: u, children: /* @__PURE__ */ r(x, { name: "icon-close-btn-gray" }) })
41
- ] }),
42
- /* @__PURE__ */ r(T, { children: /* @__PURE__ */ r(
43
- q,
44
- {
45
- sdk: l,
46
- onEvent: i,
47
- swipeable: !!c,
48
- centerPadding: c ? "18px" : "30px",
49
- heightOffset: c ? 0 : 48
50
- }
51
- ) }),
52
- !c && /* @__PURE__ */ f(G, { children: [
53
- /* @__PURE__ */ r(v, { onClick: t == null ? void 0 : t.prev, disabled: !(e != null && e.canPrev), children: /* @__PURE__ */ r(U, { name: "iconArrowPrev", className: p((e == null ? void 0 : e.canPrev) && y) }) }),
54
- /* @__PURE__ */ r(v, { onClick: t == null ? void 0 : t.next, disabled: !(e != null && e.canNext), children: /* @__PURE__ */ r(Y, { name: "iconArrowPrev", className: p((e == null ? void 0 : e.canNext) && y) }) })
55
- ] })
56
- ] });
57
- }, q = H(({ sdk: l, swipeable: o = !0, heightOffset: u = 65, onEvent: c = O, centerPadding: t }) => {
58
- const h = P(l.featuresList.getStore()), e = B(() => l.getFeature(b.GAMES), [h]), a = P(l.getUserStore()), i = N(null), [n, s] = g(), d = S(() => {
59
- i.current && s(i.current.clientHeight);
44
+ /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(
45
+ Z,
46
+ {
47
+ sdk: m,
48
+ onEvent: l,
49
+ swipeable: !!c,
50
+ centerPadding: g,
51
+ heightOffset: c ? 0 : 48
52
+ }
53
+ ) }),
54
+ !c && /* @__PURE__ */ f(V, { children: [
55
+ /* @__PURE__ */ e(H, { onClick: i == null ? void 0 : i.prev, disabled: !(r != null && r.canPrev), children: /* @__PURE__ */ e(W, { name: "iconArrowPrev", className: y((r == null ? void 0 : r.canPrev) && B) }) }),
56
+ /* @__PURE__ */ e(H, { onClick: i == null ? void 0 : i.next, disabled: !(r != null && r.canNext), children: /* @__PURE__ */ e(X, { name: "iconArrowPrev", className: y((r == null ? void 0 : r.canNext) && B) }) })
57
+ ] })
58
+ ] });
59
+ }
60
+ ), Z = F(({ sdk: m, swipeable: o = !0, heightOffset: u = 65, onEvent: c = U, centerPadding: h }) => {
61
+ const i = w(m.featuresList.getStore()), d = A(() => m.getFeature(j.GAMES), [i]), r = w(m.getUserStore()), t = I(null), [s, l] = k(), g = N(() => {
62
+ t.current && l(t.current.clientHeight);
60
63
  }, []);
61
- return A(() => {
62
- const m = C(() => {
63
- i.current && s(i.current.clientHeight);
64
+ return O(() => {
65
+ const a = R(() => {
66
+ t.current && l(t.current.clientHeight);
64
67
  }, 200);
65
- return window.addEventListener("resize", m), () => {
66
- window.removeEventListener("resize", m);
68
+ return window.addEventListener("resize", a), () => {
69
+ window.removeEventListener("resize", a);
67
70
  };
68
- }, []), a.data ? e ? /* @__PURE__ */ r(I, { ref: i, className: p("betPack", o && "isMobile"), children: /* @__PURE__ */ r(
69
- L,
71
+ }, []), r.data ? d ? /* @__PURE__ */ e(G, { ref: t, className: y("betPack", o && "isMobile"), children: /* @__PURE__ */ e(
72
+ E,
70
73
  {
71
- gamification: e,
74
+ gamification: d,
72
75
  onEvent: c,
73
76
  swipeable: o,
74
- centerPadding: t,
75
- changeHeightOnInit: d,
76
- height: n ? n - u : void 0
77
+ centerPadding: h,
78
+ changeHeightOnInit: g,
79
+ height: s ? s - u : void 0
77
80
  }
78
- ) }) : /* @__PURE__ */ r("div", { children: "no gamification" }) : a.error && !a.loading ? /* @__PURE__ */ r(
79
- z,
81
+ ) }) : /* @__PURE__ */ e("div", { children: "no gamification" }) : r.error && !r.loading ? /* @__PURE__ */ e(
82
+ M,
80
83
  {
81
84
  actionFn: () => c({ type: "slHardRefresh" }),
82
85
  description: `You are not authorized to
83
- view this resource.`
86
+ view this resource.`,
87
+ isMobile: o,
88
+ height: s ? s - u : void 0
84
89
  }
85
- ) : /* @__PURE__ */ r(F, {});
90
+ ) : /* @__PURE__ */ e(T, {});
86
91
  });
87
92
  export {
88
- q as BetPack,
89
- ne as BetPackOverlay
93
+ Z as BetPack,
94
+ ur as BetPackOverlay
90
95
  };
@@ -1,5 +1,4 @@
1
1
  import { AppNodeRef } from '../../..';
2
- import { ResponsiveStore } from '../../useSdkResponsive';
3
2
  import { Gamification as GamificationClass } from '@streamlayer/feature-gamification';
4
3
  export declare const GamificationOverlay: React.FC<{
5
4
  gamification: GamificationClass;
@@ -12,6 +11,5 @@ export declare const GamificationOverlay: React.FC<{
12
11
  export declare const GamificationOverlayStandalone: React.FC<{
13
12
  gamification: GamificationClass;
14
13
  className?: string;
15
- responsiveStore: ResponsiveStore;
16
14
  appNode: AppNodeRef;
17
15
  }>;
@@ -1,49 +1,44 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { styled as u } from "@linaria/react";
3
- import { useHideTransition as c } from "../../../../hooks/showIn.js";
4
- import { useStore as t } from "@streamlayer/react-polyfills";
5
- import { ModalPortal as d } from "../../../../ui/modal/index.js";
6
- import { ShowIn as l } from "../../../../ui/show-in/index.js";
7
- import { Question as f } from "./Question.js";
8
- import { Tabs as k } from "./Tabs.js";
9
- const h = () => l, y = /* @__PURE__ */ u(h())({
2
+ import { styled as m } from "@linaria/react";
3
+ import { useHideTransition as a } from "../../../../hooks/showIn.js";
4
+ import { useStore as l } from "@streamlayer/react-polyfills";
5
+ import { ModalPortal as p } from "../../../../ui/modal/index.js";
6
+ import { ShowIn as u } from "../../../../ui/show-in/index.js";
7
+ import { Question as c } from "./Question.js";
8
+ import { Tabs as f } from "./Tabs.js";
9
+ const d = () => u, h = /* @__PURE__ */ m(d())({
10
10
  name: "OpenedContainer",
11
11
  class: "o1seszvt",
12
12
  propsAsIs: !0
13
- }), A = ({
13
+ }), G = ({
14
14
  gamification: o,
15
- className: e
16
- }) => /* @__PURE__ */ n(k, {
17
- className: e,
15
+ className: r
16
+ }) => /* @__PURE__ */ n(f, {
17
+ className: r,
18
18
  gamification: o
19
- }), D = ({
19
+ }), I = ({
20
20
  gamification: o,
21
- className: e,
22
- appNode: r,
23
- responsiveStore: i
21
+ className: r,
22
+ appNode: e
24
23
  }) => {
25
- const s = t(o.openedQuestion.$store), {
26
- sdkInDesktopView: m
27
- } = t(i, {
28
- keys: ["sdkInDesktopView"]
29
- }), {
30
- hiding: a,
31
- onAnimationEnd: p
32
- } = c();
33
- return !r.current || !s ? null : /* @__PURE__ */ n(d, {
34
- container: r,
35
- useContainer: !m,
36
- children: /* @__PURE__ */ n(y, {
37
- className: e,
38
- hiding: a,
39
- onAnimationEnd: p,
40
- children: /* @__PURE__ */ n(f, {
24
+ const t = l(o.openedQuestion.$store), {
25
+ hiding: i,
26
+ onAnimationEnd: s
27
+ } = a();
28
+ return !e.current || !t ? null : /* @__PURE__ */ n(p, {
29
+ container: e,
30
+ useContainer: !1,
31
+ children: /* @__PURE__ */ n(h, {
32
+ className: r,
33
+ hiding: i,
34
+ onAnimationEnd: s,
35
+ children: /* @__PURE__ */ n(c, {
41
36
  gamification: o
42
37
  })
43
38
  })
44
39
  });
45
40
  };
46
41
  export {
47
- A as GamificationOverlay,
48
- D as GamificationOverlayStandalone
42
+ G as GamificationOverlay,
43
+ I as GamificationOverlayStandalone
49
44
  };
@@ -1,5 +1,4 @@
1
1
  import { AppNodeRef } from '../..';
2
- import { ResponsiveStore } from '../useSdkResponsive';
3
2
  import { Features } from '@streamlayer/sdk-web-features';
4
3
  import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
5
4
  /** render feature by type */
@@ -12,7 +11,6 @@ export declare const ActiveFeature: React.FC<{
12
11
  export declare const StandaloneFeature: React.FC<{
13
12
  sdk: StreamLayerSDK;
14
13
  feature: Features | null;
15
- responsiveStore: ResponsiveStore;
16
14
  appNode: AppNodeRef;
17
15
  className?: string;
18
16
  }>;
@@ -1,26 +1,18 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import { lazy as l, useMemo as a, Suspense as m } from "react";
3
- import { FeatureType as o } from "@streamlayer/sdk-web-types";
3
+ import { FeatureType as n } from "@streamlayer/sdk-web-types";
4
4
  import { FeatureProvider as u } from "./FeatureProvider.js";
5
5
  import { GamificationOverlayStandalone as f } from "./Gamification/index.js";
6
6
  const c = l(() => import("./Gamification/gamification-feature.js")), h = ({ sdk: e, feature: t, className: i }) => {
7
- const n = a(() => t && t.featureConfig.get().type === o.GAMES ? /* @__PURE__ */ r(u, { className: i, sdk: e, feature: t, children: /* @__PURE__ */ r(c, { className: i, gamification: t }) }) : null, [e, t, i]);
7
+ const o = a(() => t && t.featureConfig.get().type === n.GAMES ? /* @__PURE__ */ r(u, { className: i, sdk: e, feature: t, children: /* @__PURE__ */ r(c, { className: i, gamification: t }) }) : null, [e, t, i]);
8
8
  return /* @__PURE__ */ r(
9
9
  m,
10
10
  {
11
11
  fallback: /* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: "page loading..." }),
12
- children: n
12
+ children: o
13
13
  }
14
14
  );
15
- }, v = ({ feature: e, className: t, appNode: i, responsiveStore: n }) => e && e.featureConfig.get().type === o.GAMES ? /* @__PURE__ */ r(
16
- f,
17
- {
18
- className: t,
19
- appNode: i,
20
- responsiveStore: n,
21
- gamification: e
22
- }
23
- ) : null;
15
+ }, v = ({ feature: e, className: t, appNode: i }) => e && e.featureConfig.get().type === n.GAMES ? /* @__PURE__ */ r(f, { className: t, appNode: i, gamification: e }) : null;
24
16
  export {
25
17
  h as ActiveFeature,
26
18
  v as StandaloneFeature