@streamlayer/react-ui 1.20.0 → 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.
@@ -2,4 +2,5 @@ export declare const EmergencyScreen: React.FC<{
2
2
  actionFn: () => void;
3
3
  description: string;
4
4
  isMobile?: boolean;
5
+ height?: number;
5
6
  }>;
@@ -1,15 +1,15 @@
1
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
- import { cx as m } from "@linaria/core";
3
- import { useDynamicParentFont as s } from "../ScreenContainer/useDynamicParentFont.js";
4
- import { EmergencyContainer as a, EmergencyScreenTitle as l, EmergencyScreenDescription as g, EmergencyScreenButton as y } from "./styles.js";
5
- const E = ({ actionFn: n, description: r, isMobile: c }) => {
6
- const { container: o, fontSize: t } = s();
7
- return /* @__PURE__ */ i(a, { style: { fontSize: t }, ref: o, className: m("betPack", !!c && "isMobile"), children: [
1
+ import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
+ import { cx as s } from "@linaria/core";
3
+ import { useDynamicParentFont as a } from "../ScreenContainer/useDynamicParentFont.js";
4
+ import { EmergencyContainer as g, EmergencyScreenTitle as l, EmergencyScreenDescription as y, EmergencyScreenButton as f } from "./styles.js";
5
+ const d = ({ actionFn: r, description: c, isMobile: n, height: t }) => {
6
+ const { container: o, fontSize: i } = a(t, n);
7
+ return /* @__PURE__ */ m(g, { style: { fontSize: i }, ref: o, className: s("betPack", !!n && "isMobile"), children: [
8
8
  /* @__PURE__ */ e(l, { children: "Something went wrong." }),
9
- /* @__PURE__ */ e(g, { children: r }),
10
- /* @__PURE__ */ e(y, { onClick: n, children: "Try again" })
9
+ /* @__PURE__ */ e(y, { children: c }),
10
+ /* @__PURE__ */ e(f, { onClick: r, children: "Try again" })
11
11
  ] });
12
12
  };
13
13
  export {
14
- E as EmergencyScreen
14
+ d as EmergencyScreen
15
15
  };
@@ -1,27 +1,27 @@
1
- import { useState as T, useRef as p, useEffect as w } from "react";
2
- const g = "16px", m = 17, S = 21, f = 24, h = (r) => r < 0.9 ? f : r < 1.17 ? S : m, C = (r, E) => {
3
- const [v, a] = T(g), [_, u] = T(""), c = p(null), e = p();
4
- return w(() => {
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
5
  const t = c.current, n = () => {
6
6
  e.current && (clearTimeout(e.current), e.current = void 0), e.current = setTimeout(() => {
7
7
  if (t) {
8
- const o = getComputedStyle(t), d = +o.width.replace("px", ""), O = +o.height.replace("px", "") / d, l = d / h(O);
8
+ const i = getComputedStyle(t), d = +i.width.replace("px", ""), O = +i.height.replace("px", "") / d, l = d / w(O);
9
9
  a(`${l < 20 ? l : 20}px`);
10
10
  }
11
11
  e.current = void 0;
12
12
  }, 200);
13
13
  }, s = () => {
14
- window.screen.orientation.type.includes("landscape") || String(window.orientation).includes("90") ? u("landscape") : u("portrait");
15
- }, i = () => {
14
+ window.screen.orientation.type.includes("landscape") || Math.abs(window.orientation) === 90 ? u("landscape") : u("portrait");
15
+ }, o = () => {
16
16
  s(), n();
17
17
  };
18
- return window.screen.orientation.addEventListener("change", i), window.addEventListener("orientationchange", i), window.addEventListener("resize", n), t == null || t.addEventListener("transitionend", n, !1), s(), n(), () => {
19
- window.screen.orientation.removeEventListener("change", i), window.removeEventListener("orientationchange", i), window.removeEventListener("resize", n), t == null || t.removeEventListener("transitionend", n), e.current && clearTimeout(e.current);
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
20
  };
21
- }, []), w(() => (e.current && (clearTimeout(e.current), e.current = void 0), e.current = setTimeout(() => {
21
+ }, []), p(() => (e.current && (clearTimeout(e.current), e.current = void 0), e.current = setTimeout(() => {
22
22
  if (c.current) {
23
- const t = getComputedStyle(c.current), n = +t.width.replace("px", ""), i = +t.height.replace("px", "") / n, o = n / h(i);
24
- a(`${o < 20 ? o : 20}px`), e.current = void 0;
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
25
  }
26
26
  }, 200), () => {
27
27
  e.current && clearTimeout(e.current);
@@ -1,38 +1,38 @@
1
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
3
  import { cx as A } from "@linaria/core";
4
- import { useCallback as x, useSyncExternalStore as F, useRef as b, useState as I, useMemo as B, useEffect as v } from "react";
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 D } from "./EndScreen/index.js";
7
- import { LoaderScreen as H } from "./LoaderScreen/index.js";
8
- import { QuestionScreen as L } from "./QuestionScreen/index.js";
9
- import { ScreenContainer as V } from "./ScreenContainer/index.js";
10
- import { StartScreen as w } 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, o, n) {
14
- let a = new Set(o).add(void 0);
15
- return t.listen((s, c, p) => {
16
- a.has(p) && n(s, c, p);
6
+ import { EndScreen as M } from "./EndScreen/index.js";
7
+ import { LoaderScreen as D } from "./LoaderScreen/index.js";
8
+ import { QuestionScreen as H } from "./QuestionScreen/index.js";
9
+ import { ScreenContainer as L } from "./ScreenContainer/index.js";
10
+ import { StartScreen as V } from "./StartScreen/index.js";
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, o = {}) {
20
- let n = x(
21
- (s) => o.keys ? q(t, o.keys, s) : t.listen(s),
22
- [o.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 F(n, a, a);
24
+ return F(r, a, a);
25
25
  }
26
- const re = ({ gamification: t, autoplay: o, swipeable: n, changeHeightOnInit: a, height: s, onEvent: c, centerPadding: p }) => {
27
- const i = b(), l = b(null), [P, C] = I(!1), { data: r, error: f, loading: y } = z(t.betPack.getStore()), { listOfQuestions: m, countQuestionsAvailable: O } = B(() => {
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 && c({
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,31 +52,33 @@ const re = ({ gamification: t, autoplay: o, swipeable: n, changeHeightOnInit: a,
52
52
  canPrev: !1
53
53
  }
54
54
  });
55
- }, [r, f, y, c]);
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
- i.current && clearTimeout(i.current), o && (i.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, o]
67
+ [t, l, s]
68
68
  );
69
69
  if (v(() => () => {
70
70
  i.current && clearTimeout(i.current);
71
71
  }, []), y)
72
- return /* @__PURE__ */ u(H, {});
73
- if (!f && (r == null || !Object.keys(r).length))
72
+ return /* @__PURE__ */ u(D, {});
73
+ if (!f && (n == null || !Object.keys(n).length))
74
74
  return /* @__PURE__ */ u(
75
75
  S,
76
76
  {
77
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)
@@ -86,19 +88,21 @@ const re = ({ gamification: t, autoplay: o, swipeable: n, changeHeightOnInit: a,
86
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
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
107
  openedFrom: "bet-pack",
104
108
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -115,32 +119,32 @@ handle this request.`
115
119
  return;
116
120
  }
117
121
  t.closeQuestion();
118
- }, j = (e) => e ? /* @__PURE__ */ u(V, { height: s, swipeable: n, children: /* @__PURE__ */ u(L, { 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: n,
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
132
  i.current && clearTimeout(i.current);
129
133
  },
130
134
  ref: l,
131
- className: A(!n && M),
135
+ className: A(!r && q),
132
136
  children: [
133
137
  /* @__PURE__ */ u(
134
- w,
138
+ V,
135
139
  {
136
- height: s,
140
+ height: o,
137
141
  sliderRef: l,
138
- countQuestionsAvailable: O,
139
- swipeable: n
142
+ countQuestionsAvailable: Q,
143
+ swipeable: r
140
144
  }
141
145
  ),
142
- Object.values(r).map(j),
143
- /* @__PURE__ */ u(D, { onEvent: c, height: s, swipeable: n })
146
+ Object.values(n).map(g),
147
+ /* @__PURE__ */ u(M, { onEvent: c, height: o, swipeable: r })
144
148
  ]
145
149
  }
146
150
  );
@@ -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,93 +1,95 @@
1
1
  import { jsxs as f, jsx as e } from "react/jsx-runtime";
2
- import { cx as x } from "@linaria/core";
3
- import A from "lodash.throttle";
4
- import { forwardRef as b, useState as y, useCallback as p, memo as L, useMemo as R, useRef as z, useEffect as F } from "react";
5
- import { useStore as k } from "@streamlayer/react-polyfills";
6
- import { FeatureType as I } from "@streamlayer/sdk-web-types";
7
- import { BetPackContent as O } from "./BetPackContent/index.js";
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
8
  import { EmergencyScreen as M } from "./BetPackContent/EmergencyScreen/index.js";
9
- import { LoaderScreen as j } from "./BetPackContent/LoaderScreen/index.js";
10
- import { BetPackContainer as E } from "./styles.js";
11
- import { defaultEventHandler as T } from "./utils.js";
12
- import { SvgIcon as w } from "../../../ui/icons/index.js";
13
- import { Container as G, Header as U, HeaderTitle as Y, CloseButton as q, Main as D, Footer as J, SlideSwitchButton as C, IconArrowPrev as K, buttonAvailable as H, IconArrowNext as Q } from "./BetPackOverlay/styles.js";
14
- const tr = b(
15
- ({ sdk: m, onEvent: o, close: h, isMobile: a }, g) => {
16
- const [c, d] = y(), [r, i] = y(), u = p(
17
- (t) => {
18
- if (t.type === "slBetPackReady") {
19
- const { next: l, prev: s, current: P, canNext: B, canPrev: N } = t.payload || {};
20
- d({ next: l, prev: s }), i((n) => ({
21
- current: n != null && n.current ? n == null ? void 0 : n.current : P,
22
- canPrev: n != null && n.current ? n == null ? void 0 : n.canPrev : N,
23
- canNext: B
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
24
25
  }));
25
26
  }
26
- if (t.type === "slBetPackChangeCard") {
27
- const { current: l, canNext: s, canPrev: P } = t.payload || {};
28
- i({ current: l, canNext: s, canPrev: P });
27
+ if (a.type === "slBetPackChangeCard") {
28
+ const { current: P, canNext: x, canPrev: p } = a.payload || {};
29
+ t({ current: P, canNext: x, canPrev: p });
29
30
  }
30
- o == null || o(t);
31
+ o == null || o(a);
31
32
  },
32
33
  [o]
33
- );
34
- return /* @__PURE__ */ f(G, { ref: g, children: [
35
- /* @__PURE__ */ f(U, { children: [
36
- /* @__PURE__ */ f(Y, { children: [
37
- /* @__PURE__ */ e(w, { name: "icon-trophy-bet-pack" }),
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" }),
38
39
  "LiveMatch Experience",
39
40
  " "
40
41
  ] }),
41
- /* @__PURE__ */ e(q, { onClick: h, children: /* @__PURE__ */ e(w, { name: "icon-close-btn-gray" }) })
42
+ /* @__PURE__ */ e(K, { onClick: u, children: /* @__PURE__ */ e(C, { name: "icon-close-btn-gray" }) })
42
43
  ] }),
43
- /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(
44
- V,
44
+ /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(
45
+ Z,
45
46
  {
46
47
  sdk: m,
47
- onEvent: u,
48
- swipeable: !!a,
49
- centerPadding: a ? "18px" : "30px",
50
- heightOffset: a ? 0 : 48
48
+ onEvent: l,
49
+ swipeable: !!c,
50
+ centerPadding: g,
51
+ heightOffset: c ? 0 : 48
51
52
  }
52
53
  ) }),
53
- !a && /* @__PURE__ */ f(J, { children: [
54
- /* @__PURE__ */ e(C, { onClick: c == null ? void 0 : c.prev, disabled: !(r != null && r.canPrev), children: /* @__PURE__ */ e(K, { name: "iconArrowPrev", className: x((r == null ? void 0 : r.canPrev) && H) }) }),
55
- /* @__PURE__ */ e(C, { onClick: c == null ? void 0 : c.next, disabled: !(r != null && r.canNext), children: /* @__PURE__ */ e(Q, { name: "iconArrowPrev", className: x((r == null ? void 0 : r.canNext) && H) }) })
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) }) })
56
57
  ] })
57
58
  ] });
58
59
  }
59
- ), V = L(({ sdk: m, swipeable: o = !0, heightOffset: h = 65, onEvent: a = T, centerPadding: g }) => {
60
- const c = k(m.featuresList.getStore()), d = R(() => m.getFeature(I.GAMES), [c]), r = k(m.getUserStore()), i = z(null), [u, t] = y(), l = p(() => {
61
- i.current && t(i.current.clientHeight);
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);
62
63
  }, []);
63
- return F(() => {
64
- const s = A(() => {
65
- i.current && t(i.current.clientHeight);
64
+ return O(() => {
65
+ const a = R(() => {
66
+ t.current && l(t.current.clientHeight);
66
67
  }, 200);
67
- return window.addEventListener("resize", s), () => {
68
- window.removeEventListener("resize", s);
68
+ return window.addEventListener("resize", a), () => {
69
+ window.removeEventListener("resize", a);
69
70
  };
70
- }, []), r.data ? d ? /* @__PURE__ */ e(E, { ref: i, className: x("betPack", o && "isMobile"), children: /* @__PURE__ */ e(
71
- O,
71
+ }, []), r.data ? d ? /* @__PURE__ */ e(G, { ref: t, className: y("betPack", o && "isMobile"), children: /* @__PURE__ */ e(
72
+ E,
72
73
  {
73
74
  gamification: d,
74
- onEvent: a,
75
+ onEvent: c,
75
76
  swipeable: o,
76
- centerPadding: g,
77
- changeHeightOnInit: l,
78
- height: u ? u - h : void 0
77
+ centerPadding: h,
78
+ changeHeightOnInit: g,
79
+ height: s ? s - u : void 0
79
80
  }
80
81
  ) }) : /* @__PURE__ */ e("div", { children: "no gamification" }) : r.error && !r.loading ? /* @__PURE__ */ e(
81
82
  M,
82
83
  {
83
- actionFn: () => a({ type: "slHardRefresh" }),
84
+ actionFn: () => c({ type: "slHardRefresh" }),
84
85
  description: `You are not authorized to
85
86
  view this resource.`,
86
- isMobile: o
87
+ isMobile: o,
88
+ height: s ? s - u : void 0
87
89
  }
88
- ) : /* @__PURE__ */ e(j, {});
90
+ ) : /* @__PURE__ */ e(T, {});
89
91
  });
90
92
  export {
91
- V as BetPack,
92
- tr as BetPackOverlay
93
+ Z as BetPack,
94
+ ur as BetPackOverlay
93
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
@@ -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
  }>;