@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.
- package/lib/app/app/Advertisement/index.js +74 -72
- package/lib/app/app/Points/index.js +21 -14
- package/lib/app/app/index.js +79 -89
- package/lib/app/app/useApp.d.ts +2 -1
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.js +10 -9
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +22 -18
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +7 -7
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.d.ts +2 -1
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.js +31 -22
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +11 -11
- package/lib/app/masters/BetPack/BetPackContent/index.js +45 -37
- package/lib/app/masters/BetPack/BetPackOverlay/index.d.ts +1 -1
- package/lib/app/masters/BetPack/index.js +80 -77
- package/lib/app/masters/Points/index.js +24 -18
- package/lib/app/masters/masters.js +75 -87
- package/lib/app/masters/useSdkResponsive.d.ts +2 -0
- package/lib/app/masters/useSdkResponsive.js +3 -1
- package/lib/app/masters/useSdkScroll.js +1 -1
- package/lib/app/useSdkResponsive.js +1 -1
- package/lib/app/useSdkScroll.js +1 -1
- package/lib/assets/style.css +1 -1
- package/lib/hooks/analytics.js +17 -42
- package/lib/index-CLJzLXks.js +64 -0
- package/lib/reset.css +1 -1
- package/lib/ui/advertisement/notification/index.js +8 -8
- package/lib/ui/advertisement/overlay/externalAd/index.js +40306 -94
- package/lib/ui/close-btn/index.d.ts +2 -0
- package/lib/ui/close-btn/index.js +40 -32
- package/lib/ui/gamification/question/inapp/prediction-result/frames/content.js +48 -33
- package/lib/ui/gamification/vote/feedback/index.js +30 -30
- package/lib/ui/gamification/vote/vote-option/index.js +51 -53
- package/lib/ui/icons/index.d.ts +3 -0
- package/lib/ui/icons/index.js +75 -54
- package/lib/ui/modal/index.js +36 -32
- package/lib/ui/show-in/index.js +26 -26
- package/lib/ui/theme/masters-theme.js +12 -4
- package/lib/ui/theme/theme.js +9 -5
- package/package.json +22 -16
- package/lib/index-BEm7B1u1.js +0 -72
|
@@ -1,107 +1,95 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { SDKContainer as
|
|
4
|
-
import { useSdkScroll as
|
|
5
|
-
import { useSdkFeature as
|
|
6
|
-
import { useAnalyticsListener as
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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:
|
|
29
|
+
className: t,
|
|
29
30
|
appNode: r,
|
|
30
|
-
feature:
|
|
31
|
-
responsiveStore:
|
|
31
|
+
feature: i,
|
|
32
|
+
responsiveStore: n,
|
|
32
33
|
sdk: e
|
|
33
34
|
},
|
|
34
|
-
|
|
35
|
+
o
|
|
35
36
|
) : null;
|
|
36
37
|
}) : null;
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
|
|
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(
|
|
54
|
+
e.openFeature(I.GAMES);
|
|
49
55
|
});
|
|
50
56
|
});
|
|
51
|
-
}, [e]),
|
|
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__ */
|
|
66
|
-
|
|
67
|
-
|
|
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:
|
|
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
|
-
!
|
|
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
|
-
|
|
106
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
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";
|
package/lib/app/useSdkScroll.js
CHANGED
|
@@ -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-
|
|
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({
|