@streamlayer/react-ui 1.19.0 → 1.20.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 (43) 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 +1 -0
  6. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.js +10 -9
  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 +45 -37
  16. package/lib/app/masters/BetPack/BetPackOverlay/index.d.ts +1 -1
  17. package/lib/app/masters/BetPack/index.js +80 -77
  18. package/lib/app/masters/Points/index.js +24 -18
  19. package/lib/app/masters/masters.js +75 -87
  20. package/lib/app/masters/useSdkResponsive.d.ts +2 -0
  21. package/lib/app/masters/useSdkResponsive.js +3 -1
  22. package/lib/app/masters/useSdkScroll.js +1 -1
  23. package/lib/app/useSdkResponsive.js +1 -1
  24. package/lib/app/useSdkScroll.js +1 -1
  25. package/lib/assets/style.css +1 -1
  26. package/lib/hooks/analytics.js +17 -42
  27. package/lib/index-CLJzLXks.js +64 -0
  28. package/lib/reset.css +1 -1
  29. package/lib/ui/advertisement/notification/index.js +8 -8
  30. package/lib/ui/advertisement/overlay/externalAd/index.js +40306 -94
  31. package/lib/ui/close-btn/index.d.ts +2 -0
  32. package/lib/ui/close-btn/index.js +40 -32
  33. package/lib/ui/gamification/question/inapp/prediction-result/frames/content.js +48 -33
  34. package/lib/ui/gamification/vote/feedback/index.js +30 -30
  35. package/lib/ui/gamification/vote/vote-option/index.js +51 -53
  36. package/lib/ui/icons/index.d.ts +3 -0
  37. package/lib/ui/icons/index.js +75 -54
  38. package/lib/ui/modal/index.js +36 -32
  39. package/lib/ui/show-in/index.js +26 -26
  40. package/lib/ui/theme/masters-theme.js +12 -4
  41. package/lib/ui/theme/theme.js +9 -5
  42. package/package.json +22 -16
  43. package/lib/index-BEm7B1u1.js +0 -72
@@ -1,107 +1,95 @@
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,
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, responsiveStore: n }) => {
23
+ const s = c(e.featuresList.getStore());
24
+ return s ? Array.from(s, (o) => {
25
+ const i = e.getFeature(o);
26
+ return i ? /* @__PURE__ */ a(
27
+ z,
27
28
  {
28
- className: o,
29
+ className: t,
29
30
  appNode: r,
30
- feature: s,
31
- responsiveStore: l,
31
+ feature: i,
32
+ responsiveStore: n,
32
33
  sdk: e
33
34
  },
34
- a
35
+ o
35
36
  ) : null;
36
37
  }) : 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(() => {
38
+ }, O = (e) => {
39
+ const [t, r] = b(!S(v().size)), n = d(null);
40
+ return p(() => {
41
+ const s = A(() => {
42
+ const o = v();
43
+ r(!S(o.size));
44
+ }, 200);
45
+ return window.addEventListener("resize", s), () => {
46
+ window.removeEventListener("resize", s);
47
+ };
48
+ }, []), h(n, { enabled: !0, event: "click", listener: F }), /* @__PURE__ */ a(M, { ref: n, ...e, isMobile: t });
49
+ }, R = ({ sdk: e }) => {
50
+ const t = d(null), r = c(e.status), n = c(e.sdkStore.slStreamId), s = d(null), [o] = D(t), [i, l] = x(t, o), m = r === "ready" && !!n.data;
51
+ return p(() => {
46
52
  window.requestAnimationFrame(() => {
47
53
  e.initializeApp().then(() => {
48
- e.openFeature(k.GAMES);
54
+ e.openFeature(I.GAMES);
49
55
  });
50
56
  });
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(() => {
57
+ }, [e]), h(t, { enabled: !0, event: "click", listener: F }), p(() => {
64
58
  import("./Features/Gamification/gamification-feature.js");
65
- }, []), /* @__PURE__ */ u(j.Provider, { value: h, children: [
66
- l && b && /* @__PURE__ */ t(
67
- q,
59
+ }, []), /* @__PURE__ */ f(L, { ref: t, children: [
60
+ /* @__PURE__ */ a(C, { className: w(u, "sl-hide-on-modal"), ref: s }),
61
+ /* @__PURE__ */ f(N, { "data-nav": !0, className: "sl-hide-on-modal", ref: i, children: [
62
+ m && /* @__PURE__ */ a(
63
+ P,
64
+ {
65
+ sdk: e,
66
+ scrollNode: i,
67
+ headerNode: s,
68
+ appNode: t,
69
+ scrollStore: l,
70
+ responsiveStore: o
71
+ }
72
+ ),
73
+ m && /* @__PURE__ */ a(B, { className: u, sdk: e }),
74
+ m && /* @__PURE__ */ a(K, { responsiveStore: o, appNode: t, className: u, sdk: e })
75
+ ] })
76
+ ] });
77
+ }, re = ({ sdk: e, betPack: t }) => {
78
+ const [r, n] = b(t), o = !!c(e.userId()), i = E(() => ({ sdk: e }), [e]);
79
+ return /* @__PURE__ */ f(g.Provider, { value: i, children: [
80
+ r && o && /* @__PURE__ */ a(
81
+ O,
68
82
  {
69
83
  sdk: e,
70
- onEvent: ({ type: L }) => L === "slOpenGameCenter" ? n(!1) : () => {
84
+ onEvent: ({ type: l }) => l === "slOpenGameCenter" ? n(!1) : () => {
71
85
  },
72
- close: () => n(!1),
73
- responsiveStore: s
86
+ close: () => n(!1)
74
87
  }
75
88
  ),
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
- ] })
89
+ !r && /* @__PURE__ */ a(R, { sdk: e })
102
90
  ] });
103
91
  };
104
92
  export {
105
- ae as MastersApp,
106
- me as StreamLayerMastersThemeProvider
93
+ re as MastersApp,
94
+ se as StreamLayerMastersThemeProvider
107
95
  };
@@ -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({
@@ -1,7 +1,7 @@
1
1
  import i from "lodash.throttle";
2
2
  import { useState as m, useEffect as a } from "react";
3
3
  import { BREAKPOINTS as r } from "../ui/theme/constants.js";
4
- import { m as u } from "../index-BEm7B1u1.js";
4
+ import { m as u } from "../index-CLJzLXks.js";
5
5
  const o = Object.keys(r), c = () => {
6
6
  const t = window.innerWidth;
7
7
  let e = "sm";
@@ -3,7 +3,7 @@ import { useRef as u, useState as b, useEffect as g } from "react";
3
3
  import { useStore as k } from "@streamlayer/react-polyfills";
4
4
  import { BREAKPOINTS as a } from "../ui/theme/constants.js";
5
5
  import { checkSdkInDesktopView as m } from "./useSdkResponsive.js";
6
- import { m as v } from "../index-BEm7B1u1.js";
6
+ import { m as v } from "../index-CLJzLXks.js";
7
7
  const I = (o, e, n) => {
8
8
  const t = e >= a.lg && e < a.xl ? 75 : 52;
9
9
  o.current && window.scrollTo({