@streamlayer/react-ui 1.22.0 → 1.22.2

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 (45) hide show
  1. package/lib/app/app/Notifications/index.js +64 -60
  2. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.d.ts +3 -2
  3. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.js +10 -12
  4. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/styles.d.ts +5 -1
  5. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/styles.js +1 -1
  6. package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.d.ts +1 -1
  7. package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +20 -28
  8. package/lib/app/masters/BetPack/BetPackContent/EndScreen/styles.d.ts +5 -17
  9. package/lib/app/masters/BetPack/BetPackContent/EndScreen/styles.js +10 -56
  10. package/lib/app/masters/BetPack/BetPackContent/LoaderScreen/index.d.ts +3 -1
  11. package/lib/app/masters/BetPack/BetPackContent/LoaderScreen/index.js +9 -6
  12. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +4 -8
  13. package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.d.ts +2 -3
  14. package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +18 -24
  15. package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.d.ts +1 -6
  16. package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.js +14 -40
  17. package/lib/app/masters/BetPack/BetPackContent/constants.js +1 -1
  18. package/lib/app/masters/BetPack/BetPackContent/index.d.ts +1 -3
  19. package/lib/app/masters/BetPack/BetPackContent/index.js +106 -106
  20. package/lib/app/masters/BetPack/BetPackContent/styles.d.ts +9 -1
  21. package/lib/app/masters/BetPack/BetPackContent/styles.js +48 -10
  22. package/lib/app/masters/BetPack/BetPackOverlay/index.js +2 -3
  23. package/lib/app/masters/BetPack/index.d.ts +2 -2
  24. package/lib/app/masters/BetPack/index.js +60 -88
  25. package/lib/app/masters/BetPack/styles.d.ts +0 -1
  26. package/lib/app/masters/BetPack/styles.js +7 -12
  27. package/lib/app/masters/Features/Gamification/Tabs.js +1 -1
  28. package/lib/app/masters/masters.js +58 -67
  29. package/lib/app/masters/useSdkResponsive.d.ts +0 -2
  30. package/lib/app/masters/useSdkResponsive.js +0 -2
  31. package/lib/assets/style.css +1 -1
  32. package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.js +1 -1
  33. package/lib/ui/advertisement/overlay/externalAd/vast-player/useVastAds.js +1 -1
  34. package/lib/ui/gamification/question/inapp/prediction-result/frames/content.js +18 -16
  35. package/lib/ui/gamification/user-statistics/index.js +27 -25
  36. package/lib/ui/gamification/vote/index.js +1 -1
  37. package/lib/ui/theme/masters-theme.js +23 -92
  38. package/lib/ui/theme/theme.js +5 -5
  39. package/lib/{useVastAds-Dt_tRbpd.js → useVastAds-Bu_IhLJ2.js} +2 -2
  40. package/lib/utils/decorators/masters.js +49 -11
  41. package/package.json +15 -15
  42. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.d.ts +0 -4
  43. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.js +0 -33
  44. package/lib/app/masters/useOrientation.d.ts +0 -3
  45. package/lib/app/masters/useOrientation.js +0 -12
@@ -1,24 +1,19 @@
1
1
  import { styled as s } from "@linaria/react";
2
- const n = /* @__PURE__ */ s("button")({
3
- name: "ScreenButton",
4
- class: "s1pdy82n",
5
- propsAsIs: !1
6
- }), t = /* @__PURE__ */ s("div")({
2
+ const n = /* @__PURE__ */ s("div")({
7
3
  name: "ScreenTitle",
8
- class: "spc0iwi",
4
+ class: "s1pdy82n",
9
5
  propsAsIs: !1
10
6
  }), c = /* @__PURE__ */ s("div")({
11
7
  name: "ScreenDescription",
12
- class: "s18vssq2",
8
+ class: "spc0iwi",
13
9
  propsAsIs: !1
14
- }), o = /* @__PURE__ */ s("div")({
10
+ }), i = /* @__PURE__ */ s("div")({
15
11
  name: "BetPackContainer",
16
- class: "blelwov",
12
+ class: "b18vssq2",
17
13
  propsAsIs: !1
18
14
  });
19
15
  export {
20
- o as BetPackContainer,
21
- n as ScreenButton,
16
+ i as BetPackContainer,
22
17
  c as ScreenDescription,
23
- t as ScreenTitle
18
+ n as ScreenTitle
24
19
  };
@@ -3,7 +3,7 @@ import { TabsContainer as s, SDKWhiteContainer as m, UserSummaryContainer as i,
3
3
  import { QuestionsList as u } from "./QuestionsList.js";
4
4
  import { UserSummary as a } from "./UserSummary.js";
5
5
  const h = ({ gamification: r, className: t, style: o }) => /* @__PURE__ */ n(s, { className: t, style: o, children: [
6
- /* @__PURE__ */ e(m, { style: { paddingTop: "8px" }, children: /* @__PURE__ */ e(i, { children: /* @__PURE__ */ e(a, { userSummary: r.userSummary }) }) }),
6
+ /* @__PURE__ */ e(m, { style: { paddingTop: "16px" }, children: /* @__PURE__ */ e(i, { children: /* @__PURE__ */ e(a, { userSummary: r.userSummary }) }) }),
7
7
  /* @__PURE__ */ e(p, { style: { flex: 1 }, children: /* @__PURE__ */ e(u, { openQuestion: r.openQuestion, store: r.feedList.getStore() }) })
8
8
  ] });
9
9
  export {
@@ -1,99 +1,90 @@
1
- import { jsxs as f, jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as f, jsx as o } from "react/jsx-runtime";
2
2
  import { cx as A } from "@linaria/core";
3
- import { SDKContainer as E, SDKScrollContainer as L } from "./styles.js";
4
- import { useSdkScroll as M } from "./useSdkScroll.js";
5
- import { useSdkFeature as N } from "../useSdkFeature.js";
6
- import { useAnalyticsListener as h, newTabLinkListener as F } from "../../hooks/analytics.js";
7
- import x from "lodash.throttle";
8
- import { useState as b, useMemo as y, useCallback as C, useRef as p, useEffect as S } from "react";
3
+ import { SDKContainer as N, SDKScrollContainer as b } from "./styles.js";
4
+ import { useSdkScroll as h } from "./useSdkScroll.js";
5
+ import { useSdkFeature as x } from "../useSdkFeature.js";
6
+ import { useAnalyticsListener as d, newTabLinkListener as v } from "../../hooks/analytics.js";
7
+ import { useState as y, useMemo as C, useCallback as P, useRef as p, useEffect as S } from "react";
9
8
  import { useStore as m } from "@streamlayer/react-polyfills";
10
- import { FeatureType as w } from "@streamlayer/sdk-web-types";
9
+ import { FeatureType as F } from "@streamlayer/sdk-web-types";
11
10
  import { resetCss as u } from "../../ui/theme/theme.js";
12
- import { BetPackOverlay as I } from "./BetPack/index.js";
13
- import { ActiveFeature as P, StandaloneFeature as z } from "./Features/index.js";
14
- import { SDKHeader as g } from "./Header/index.js";
15
- import { SDKNotifications as B } from "./Notifications/index.js";
16
- import { MastersContext as D } from "./useMastersContext.js";
17
- import { checkSdkInDesktopView as d, getScreenSize as v, useSdkResponsive as K } from "./useSdkResponsive.js";
18
- import { StreamLayerMastersThemeProvider as ae } from "../../ui/theme/masters.js";
19
- const G = ({ sdk: e, className: t }) => {
20
- const [, r] = N(e);
21
- return /* @__PURE__ */ a(P, { className: t, feature: r, sdk: e });
22
- }, O = ({ sdk: e, className: t, appNode: r, responsiveStore: i }) => {
23
- const n = m(e.featuresList.getStore());
24
- return n ? Array.from(n, (o) => {
25
- const c = e.getFeature(o);
26
- return c ? /* @__PURE__ */ a(
27
- z,
11
+ import { BetPackOverlay as E } from "./BetPack/index.js";
12
+ import { ActiveFeature as L, StandaloneFeature as M } from "./Features/index.js";
13
+ import { SDKHeader as B } from "./Header/index.js";
14
+ import { SDKNotifications as I } from "./Notifications/index.js";
15
+ import { MastersContext as g } from "./useMastersContext.js";
16
+ import { useSdkResponsive as D } from "./useSdkResponsive.js";
17
+ import { StreamLayerMastersThemeProvider as re } from "../../ui/theme/masters.js";
18
+ const K = ({ sdk: e, className: t }) => {
19
+ const [, n] = x(e);
20
+ return /* @__PURE__ */ o(L, { className: t, feature: n, sdk: e });
21
+ }, w = ({ sdk: e, className: t, appNode: n, responsiveStore: c }) => {
22
+ const l = m(e.featuresList.getStore());
23
+ return l ? Array.from(l, (s) => {
24
+ const a = e.getFeature(s);
25
+ return a ? /* @__PURE__ */ o(
26
+ M,
28
27
  {
29
- responsiveStore: i,
28
+ responsiveStore: c,
30
29
  className: t,
31
- appNode: r,
32
- feature: c,
30
+ appNode: n,
31
+ feature: a,
33
32
  sdk: e
34
33
  },
35
- o
34
+ s
36
35
  ) : null;
37
36
  }) : null;
38
- }, R = (e) => {
39
- const [t, r] = b(!d(v().size)), i = p(null);
40
- return S(() => {
41
- const n = x(() => {
42
- const o = v();
43
- r(!d(o.size));
44
- }, 200);
45
- return window.addEventListener("resize", n), () => {
46
- window.removeEventListener("resize", n);
47
- };
48
- }, []), h(i, { enabled: !0, event: "click", listener: F }), /* @__PURE__ */ a(I, { ref: i, ...e, isMobile: t });
49
- }, j = ({ sdk: e }) => {
50
- const t = p(null), r = m(e.status), i = m(e.sdkStore.slStreamId), n = p(null), [o] = K(t), [c, l] = M(t, o), s = r === "ready" && !!i.data;
37
+ }, G = (e) => {
38
+ const t = p(null);
39
+ return d(t, { enabled: !0, event: "click", listener: v }), /* @__PURE__ */ o(E, { ref: t, ...e });
40
+ }, O = ({ sdk: e }) => {
41
+ const t = p(null), n = m(e.status), c = m(e.sdkStore.slStreamId), l = p(null), [s] = D(t), [a, i] = h(t, s), r = n === "ready" && !!c.data;
51
42
  return S(() => {
52
43
  window.requestAnimationFrame(() => {
53
44
  e.initializeApp().then(() => {
54
- e.openFeature(w.GAMES);
45
+ e.openFeature(F.GAMES);
55
46
  });
56
47
  });
57
- }, [e]), h(t, { enabled: !0, event: "click", listener: F }), S(() => {
48
+ }, [e]), d(t, { enabled: !0, event: "click", listener: v }), S(() => {
58
49
  import("./Features/Gamification/gamification-feature.js");
59
- }, []), /* @__PURE__ */ f(E, { ref: t, children: [
60
- /* @__PURE__ */ a(g, { className: A(u), ref: n }),
61
- /* @__PURE__ */ f(L, { className: "sl-hide-on-modal", ref: c, children: [
62
- s && /* @__PURE__ */ a(
63
- B,
50
+ }, []), /* @__PURE__ */ f(N, { ref: t, children: [
51
+ /* @__PURE__ */ o(B, { className: A(u), ref: l }),
52
+ /* @__PURE__ */ f(b, { className: "sl-hide-on-modal", ref: a, children: [
53
+ r && /* @__PURE__ */ o(
54
+ I,
64
55
  {
65
56
  sdk: e,
66
- scrollNode: c,
67
- headerNode: n,
57
+ scrollNode: a,
58
+ headerNode: l,
68
59
  appNode: t,
69
- scrollStore: l,
70
- responsiveStore: o
60
+ scrollStore: i,
61
+ responsiveStore: s
71
62
  }
72
63
  ),
73
- s && /* @__PURE__ */ a(G, { className: u, sdk: e }),
74
- s && /* @__PURE__ */ a(O, { responsiveStore: o, appNode: t, className: u, sdk: e })
64
+ r && /* @__PURE__ */ o(K, { className: u, sdk: e }),
65
+ r && /* @__PURE__ */ o(w, { responsiveStore: s, appNode: t, className: u, sdk: e })
75
66
  ] })
76
67
  ] });
77
- }, oe = ({ sdk: e, betPack: t }) => {
78
- const [r, i] = b(t), o = !!m(e.userId()), c = y(() => ({ sdk: e }), [e]), l = C(() => {
79
- i(!1);
80
- const s = e == null ? void 0 : e.getFeature(w.GAMES);
81
- s == null || s.closeQuestion();
68
+ }, k = ({ sdk: e, betPack: t }) => {
69
+ const [n, c] = y(t), s = !!m(e.userId()), a = C(() => ({ sdk: e }), [e]), i = P(() => {
70
+ c(!1);
71
+ const r = e == null ? void 0 : e.getFeature(F.GAMES);
72
+ r == null || r.closeQuestion();
82
73
  }, [e]);
83
- return /* @__PURE__ */ f(D.Provider, { value: c, children: [
84
- r && o && /* @__PURE__ */ a(
85
- R,
74
+ return /* @__PURE__ */ f(g.Provider, { value: a, children: [
75
+ n && s && /* @__PURE__ */ o(
76
+ G,
86
77
  {
87
78
  sdk: e,
88
- onEvent: ({ type: s }) => s === "slOpenGameCenter" ? l() : () => {
79
+ onEvent: ({ type: r }) => r === "slOpenGameCenter" ? i() : () => {
89
80
  },
90
- close: () => l()
81
+ close: () => i()
91
82
  }
92
83
  ),
93
- !r && /* @__PURE__ */ a(j, { sdk: e })
84
+ !n && /* @__PURE__ */ o(O, { sdk: e })
94
85
  ] });
95
86
  };
96
87
  export {
97
- oe as MastersApp,
98
- ae as StreamLayerMastersThemeProvider
88
+ k as MastersApp,
89
+ re as StreamLayerMastersThemeProvider
99
90
  };
@@ -10,8 +10,6 @@ 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;
15
13
  export type ResponsiveStore = MapStore<ResponsiveData>;
16
14
  export declare const useSdkResponsive: (appNode: AppNodeRef) => [ResponsiveStore];
17
15
  export {};
@@ -41,7 +41,5 @@ const d = Object.keys(r), i = () => {
41
41
  }, [e, n]), [e];
42
42
  };
43
43
  export {
44
- k as checkSdkInDesktopView,
45
- i as getScreenSize,
46
44
  v as useSdkResponsive
47
45
  };