@streamlayer/react-ui 1.21.0 → 1.22.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/masters/BetPack/BetPackContent/EmergencyScreen/index.js +7 -7
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.d.ts +0 -1
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +18 -22
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.d.ts +0 -1
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +7 -7
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.d.ts +1 -2
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.js +16 -19
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.d.ts +0 -1
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +25 -24
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.js +14 -9
- package/lib/app/masters/BetPack/BetPackContent/index.js +64 -66
- package/lib/app/masters/BetPack/index.js +27 -27
- package/lib/app/masters/BetPack/utils.d.ts +1 -1
- package/lib/app/masters/BetPack/utils.js +8 -7
- package/lib/app/masters/Features/Gamification/index.d.ts +2 -0
- package/lib/app/masters/Features/Gamification/index.js +34 -29
- package/lib/app/masters/Features/index.d.ts +2 -0
- package/lib/app/masters/Features/index.js +12 -4
- package/lib/app/masters/Header/index.js +19 -23
- package/lib/app/masters/masters.js +68 -54
- package/lib/app/masters/useSdkResponsive.js +2 -2
- package/lib/app/masters/useSdkScroll.js +12 -12
- package/lib/app/useSdkResponsive.js +1 -1
- package/lib/app/useSdkScroll.js +1 -1
- package/lib/assets/style.css +1 -1
- package/lib/index-DSi8Qgfs.js +14 -0
- package/lib/index-DXvAPWiE.js +3743 -0
- package/lib/index-tnt2CtQe.js +55 -0
- package/lib/ui/advertisement/overlay/externalAd/index.d.ts +1 -1
- package/lib/ui/advertisement/overlay/externalAd/index.js +59 -40287
- package/lib/ui/advertisement/overlay/externalAd/styles.d.ts +2 -0
- package/lib/ui/advertisement/overlay/externalAd/styles.js +34 -24
- package/lib/ui/advertisement/overlay/externalAd/vast-player/module.d.js +1 -0
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.d.ts +19 -0
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.js +33199 -0
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useVastAds.d.ts +24 -0
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useVastAds.js +8 -0
- package/lib/ui/gamification/vote/feedback/index.d.ts +1 -0
- package/lib/ui/gamification/vote/feedback/index.js +83 -73
- package/lib/ui/gamification/vote/feedback/styles.d.ts +1 -0
- package/lib/ui/gamification/vote/feedback/styles.js +40 -39
- package/lib/ui/gamification/vote/index.js +94 -91
- package/lib/ui/icons/index.d.ts +1 -0
- package/lib/ui/icons/index.js +88 -79
- package/lib/ui/modal/index.js +31 -34
- package/lib/ui/theme/breakpoints.d.ts +1 -0
- package/lib/ui/theme/breakpoints.js +17 -9
- package/lib/ui/theme/masters-theme.js +1 -0
- package/lib/useVastAds-Dt_tRbpd.js +1284 -0
- package/package.json +18 -15
- package/lib/index-CLJzLXks.js +0 -64
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { jsxs as f, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { cx as y } from "@linaria/core";
|
|
3
3
|
import R from "lodash.throttle";
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { useStore as
|
|
4
|
+
import { forwardRef as b, useState as C, useCallback as N, useMemo as A, memo as z, useRef as L, useEffect as O } from "react";
|
|
5
|
+
import { useStore as H } from "@streamlayer/react-polyfills";
|
|
6
6
|
import { FeatureType as j } from "@streamlayer/sdk-web-types";
|
|
7
|
-
import { BetPackContent as
|
|
8
|
-
import { EmergencyScreen as
|
|
9
|
-
import { LoaderScreen as
|
|
10
|
-
import { BetPackContainer as
|
|
7
|
+
import { BetPackContent as G } from "./BetPackContent/index.js";
|
|
8
|
+
import { EmergencyScreen as T } from "./BetPackContent/EmergencyScreen/index.js";
|
|
9
|
+
import { LoaderScreen as E } from "./BetPackContent/LoaderScreen/index.js";
|
|
10
|
+
import { BetPackContainer as M } from "./styles.js";
|
|
11
11
|
import { defaultEventHandler as U } from "./utils.js";
|
|
12
12
|
import { useOrientation as Y } from "../useOrientation.js";
|
|
13
|
-
import { SvgIcon as
|
|
14
|
-
import { Container as q, Header as D, HeaderTitle as J, CloseButton as K, Main as Q, Footer as V, SlideSwitchButton as
|
|
15
|
-
const ur =
|
|
13
|
+
import { SvgIcon as k } 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 p, IconArrowPrev as W, buttonAvailable as B, IconArrowNext as X } from "./BetPackOverlay/styles.js";
|
|
15
|
+
const ur = b(
|
|
16
16
|
({ sdk: m, onEvent: o, close: u, isMobile: c }, h) => {
|
|
17
|
-
const [i, d] =
|
|
17
|
+
const [i, d] = C(), [r, t] = C(), { orientation: s } = Y(), l = N(
|
|
18
18
|
(a) => {
|
|
19
19
|
if (a.type === "slBetPackReady") {
|
|
20
|
-
const { next: P, prev: x, current:
|
|
20
|
+
const { next: P, prev: x, current: w, canNext: F, canPrev: I } = a.payload || {};
|
|
21
21
|
d({ next: P, prev: x }), t((n) => ({
|
|
22
|
-
current: n != null && n.current ? n == null ? void 0 : n.current :
|
|
23
|
-
canPrev: n != null && n.current ? n == null ? void 0 : n.canPrev :
|
|
24
|
-
canNext:
|
|
22
|
+
current: n != null && n.current ? n == null ? void 0 : n.current : w,
|
|
23
|
+
canPrev: n != null && n.current ? n == null ? void 0 : n.canPrev : I,
|
|
24
|
+
canNext: F
|
|
25
25
|
}));
|
|
26
26
|
}
|
|
27
27
|
if (a.type === "slBetPackChangeCard") {
|
|
28
|
-
const { current: P, canNext: x, canPrev:
|
|
29
|
-
t({ current: P, canNext: x, canPrev:
|
|
28
|
+
const { current: P, canNext: x, canPrev: w } = a.payload || {};
|
|
29
|
+
t({ current: P, canNext: x, canPrev: w });
|
|
30
30
|
}
|
|
31
31
|
o == null || o(a);
|
|
32
32
|
},
|
|
@@ -35,11 +35,11 @@ const ur = z(
|
|
|
35
35
|
return /* @__PURE__ */ f(q, { ref: h, children: [
|
|
36
36
|
/* @__PURE__ */ f(D, { children: [
|
|
37
37
|
/* @__PURE__ */ f(J, { children: [
|
|
38
|
-
/* @__PURE__ */ e(
|
|
39
|
-
"
|
|
38
|
+
/* @__PURE__ */ e(k, { name: "fgIcon" }),
|
|
39
|
+
"Featured Groups+",
|
|
40
40
|
" "
|
|
41
41
|
] }),
|
|
42
|
-
/* @__PURE__ */ e(K, { onClick: u, children: /* @__PURE__ */ e(
|
|
42
|
+
/* @__PURE__ */ e(K, { onClick: u, children: /* @__PURE__ */ e(k, { name: "icon-close-btn-gray" }) })
|
|
43
43
|
] }),
|
|
44
44
|
/* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(
|
|
45
45
|
Z,
|
|
@@ -52,13 +52,13 @@ const ur = z(
|
|
|
52
52
|
}
|
|
53
53
|
) }),
|
|
54
54
|
!c && /* @__PURE__ */ f(V, { children: [
|
|
55
|
-
/* @__PURE__ */ e(
|
|
56
|
-
/* @__PURE__ */ e(
|
|
55
|
+
/* @__PURE__ */ e(p, { 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(p, { 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
57
|
] })
|
|
58
58
|
] });
|
|
59
59
|
}
|
|
60
|
-
), Z =
|
|
61
|
-
const i =
|
|
60
|
+
), Z = z(({ sdk: m, swipeable: o = !0, heightOffset: u = 65, onEvent: c = U, centerPadding: h }) => {
|
|
61
|
+
const i = H(m.featuresList.getStore()), d = A(() => m.getFeature(j.GAMES), [i]), r = H(m.getUserStore()), t = L(null), [s, l] = C(), g = N(() => {
|
|
62
62
|
t.current && l(t.current.clientHeight);
|
|
63
63
|
}, []);
|
|
64
64
|
return O(() => {
|
|
@@ -68,8 +68,8 @@ const ur = z(
|
|
|
68
68
|
return window.addEventListener("resize", a), () => {
|
|
69
69
|
window.removeEventListener("resize", a);
|
|
70
70
|
};
|
|
71
|
-
}, []), r.data ? d ? /* @__PURE__ */ e(
|
|
72
|
-
|
|
71
|
+
}, []), r.data ? d ? /* @__PURE__ */ e(M, { ref: t, className: y("betPack", o && "isMobile"), children: /* @__PURE__ */ e(
|
|
72
|
+
G,
|
|
73
73
|
{
|
|
74
74
|
gamification: d,
|
|
75
75
|
onEvent: c,
|
|
@@ -79,7 +79,7 @@ const ur = z(
|
|
|
79
79
|
height: s ? s - u : void 0
|
|
80
80
|
}
|
|
81
81
|
) }) : /* @__PURE__ */ e("div", { children: "no gamification" }) : r.error && !r.loading ? /* @__PURE__ */ e(
|
|
82
|
-
|
|
82
|
+
T,
|
|
83
83
|
{
|
|
84
84
|
actionFn: () => c({ type: "slHardRefresh" }),
|
|
85
85
|
description: `You are not authorized to
|
|
@@ -87,7 +87,7 @@ view this resource.`,
|
|
|
87
87
|
isMobile: o,
|
|
88
88
|
height: s ? s - u : void 0
|
|
89
89
|
}
|
|
90
|
-
) : /* @__PURE__ */ e(
|
|
90
|
+
) : /* @__PURE__ */ e(E, {});
|
|
91
91
|
});
|
|
92
92
|
export {
|
|
93
93
|
Z as BetPack,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type AllowedMessageType = 'slBetPackReady' | 'slOpenGameCenter' | 'slHardRefresh' | 'slBetPackChangeCard';
|
|
1
|
+
export type AllowedMessageType = 'slBetPackReady' | 'slOpenGameCenter' | 'slHardRefresh' | 'slBetPackChangeCard' | 'slVoted';
|
|
2
2
|
declare global {
|
|
3
3
|
interface Window {
|
|
4
4
|
webkit?: {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { createLogger as
|
|
2
|
-
const o = "slBetPackCb",
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
}, a = (e)
|
|
6
|
-
|
|
1
|
+
import { createLogger as w } from "@streamlayer/sdk-web-logger";
|
|
2
|
+
const o = "slBetPackCb", g = w("betPack-ui"), r = (s, d = {}) => {
|
|
3
|
+
var a, t;
|
|
4
|
+
const { questionId: i, answerId: n } = d, e = { questionId: i, answerId: n };
|
|
5
|
+
g.debug({ id: o, type: s, ...e }), (a = window.top) == null || a.postMessage({ id: o, type: s, ...e }, "*"), window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers[o] && window.webkit.messageHandlers[o].postMessage({ type: s, ...e }), (t = window.slBetPackCb) != null && t.postMessage && window.slBetPackCb.postMessage(JSON.stringify({ type: s, ...e, from: "base" }));
|
|
6
|
+
}, c = (s) => {
|
|
7
|
+
r(s.type, s.payload);
|
|
7
8
|
};
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
+
c as defaultEventHandler
|
|
10
11
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AppNodeRef } from '../../..';
|
|
2
|
+
import { ResponsiveStore } from '../../useSdkResponsive';
|
|
2
3
|
import { Gamification as GamificationClass } from '@streamlayer/feature-gamification';
|
|
3
4
|
export declare const GamificationOverlay: React.FC<{
|
|
4
5
|
gamification: GamificationClass;
|
|
@@ -11,5 +12,6 @@ export declare const GamificationOverlay: React.FC<{
|
|
|
11
12
|
export declare const GamificationOverlayStandalone: React.FC<{
|
|
12
13
|
gamification: GamificationClass;
|
|
13
14
|
className?: string;
|
|
15
|
+
responsiveStore: ResponsiveStore;
|
|
14
16
|
appNode: AppNodeRef;
|
|
15
17
|
}>;
|
|
@@ -1,44 +1,49 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { styled as
|
|
3
|
-
import { useHideTransition as
|
|
4
|
-
import { useStore as
|
|
5
|
-
import { ModalPortal as
|
|
6
|
-
import { ShowIn as
|
|
7
|
-
import { Question as
|
|
8
|
-
import { Tabs as
|
|
9
|
-
const
|
|
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())({
|
|
10
10
|
name: "OpenedContainer",
|
|
11
11
|
class: "o1seszvt",
|
|
12
12
|
propsAsIs: !0
|
|
13
|
-
}),
|
|
13
|
+
}), A = ({
|
|
14
14
|
gamification: o,
|
|
15
|
-
className:
|
|
16
|
-
}) => /* @__PURE__ */ n(
|
|
17
|
-
className:
|
|
15
|
+
className: e
|
|
16
|
+
}) => /* @__PURE__ */ n(k, {
|
|
17
|
+
className: e,
|
|
18
18
|
gamification: o
|
|
19
|
-
}),
|
|
19
|
+
}), D = ({
|
|
20
20
|
gamification: o,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
responsiveStore: e,
|
|
22
|
+
className: i,
|
|
23
|
+
appNode: r
|
|
23
24
|
}) => {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
const s = t(o.openedQuestion.$store), {
|
|
26
|
+
sdkInDesktopView: m
|
|
27
|
+
} = t(e, {
|
|
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: i,
|
|
38
|
+
hiding: a,
|
|
39
|
+
onAnimationEnd: p,
|
|
40
|
+
children: /* @__PURE__ */ n(f, {
|
|
36
41
|
gamification: o
|
|
37
42
|
})
|
|
38
43
|
})
|
|
39
44
|
});
|
|
40
45
|
};
|
|
41
46
|
export {
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
A as GamificationOverlay,
|
|
48
|
+
D as GamificationOverlayStandalone
|
|
44
49
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AppNodeRef } from '../..';
|
|
2
2
|
import { Features } from '@streamlayer/sdk-web-features';
|
|
3
3
|
import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
4
|
+
import { ResponsiveStore } from '../useSdkResponsive';
|
|
4
5
|
/** render feature by type */
|
|
5
6
|
export declare const ActiveFeature: React.FC<{
|
|
6
7
|
sdk: StreamLayerSDK;
|
|
@@ -12,5 +13,6 @@ export declare const StandaloneFeature: React.FC<{
|
|
|
12
13
|
sdk: StreamLayerSDK;
|
|
13
14
|
feature: Features | null;
|
|
14
15
|
appNode: AppNodeRef;
|
|
16
|
+
responsiveStore: ResponsiveStore;
|
|
15
17
|
className?: string;
|
|
16
18
|
}>;
|
|
@@ -1,18 +1,26 @@
|
|
|
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
|
|
3
|
+
import { FeatureType as o } 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
|
|
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]);
|
|
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:
|
|
12
|
+
children: n
|
|
13
13
|
}
|
|
14
14
|
);
|
|
15
|
-
}, v = ({ feature: e, className: t, appNode: i }) => e && e.featureConfig.get().type ===
|
|
15
|
+
}, v = ({ feature: e, className: t, appNode: i, responsiveStore: n }) => e && e.featureConfig.get().type === o.GAMES ? /* @__PURE__ */ r(
|
|
16
|
+
f,
|
|
17
|
+
{
|
|
18
|
+
responsiveStore: n,
|
|
19
|
+
className: t,
|
|
20
|
+
appNode: i,
|
|
21
|
+
gamification: e
|
|
22
|
+
}
|
|
23
|
+
) : null;
|
|
16
24
|
export {
|
|
17
25
|
h as ActiveFeature,
|
|
18
26
|
v as StandaloneFeature
|
|
@@ -1,38 +1,34 @@
|
|
|
1
|
-
import { jsxs as r, jsx as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { styled as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { SvgIcon as
|
|
6
|
-
const
|
|
1
|
+
import { jsxs as r, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { cx as t } from "@linaria/core";
|
|
3
|
+
import { styled as o } from "@linaria/react";
|
|
4
|
+
import { forwardRef as a } from "react";
|
|
5
|
+
import { SvgIcon as i } from "../../../ui/icons/index.js";
|
|
6
|
+
const c = /* @__PURE__ */ o("div")({
|
|
7
7
|
name: "Navigation",
|
|
8
8
|
class: "n1o1tw60",
|
|
9
9
|
propsAsIs: !1
|
|
10
|
-
}), m = /* @__PURE__ */
|
|
10
|
+
}), m = /* @__PURE__ */ o("div")({
|
|
11
11
|
name: "Container",
|
|
12
12
|
class: "co2rstw",
|
|
13
13
|
propsAsIs: !1
|
|
14
|
-
}),
|
|
14
|
+
}), l = /* @__PURE__ */ o("div")({
|
|
15
15
|
name: "Title",
|
|
16
16
|
class: "t1bqnx9c",
|
|
17
17
|
propsAsIs: !1
|
|
18
|
-
}),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
children: /* @__PURE__ */ r(p, {
|
|
28
|
-
children: [/* @__PURE__ */ e(d, {
|
|
29
|
-
name: "icon-trivia-transparent"
|
|
30
|
-
}), "Game Center"]
|
|
18
|
+
}), p = "hlc2pcy", I = a(({
|
|
19
|
+
className: e
|
|
20
|
+
}, n) => /* @__PURE__ */ r(c, {
|
|
21
|
+
className: t(e, p),
|
|
22
|
+
children: [/* @__PURE__ */ s(m, {
|
|
23
|
+
children: /* @__PURE__ */ r(l, {
|
|
24
|
+
children: [/* @__PURE__ */ s(i, {
|
|
25
|
+
name: "fgIcon"
|
|
26
|
+
}), "FG+ Game Center", " "]
|
|
31
27
|
})
|
|
32
|
-
}), /* @__PURE__ */
|
|
28
|
+
}), /* @__PURE__ */ s("div", {
|
|
33
29
|
ref: n
|
|
34
30
|
})]
|
|
35
31
|
}));
|
|
36
32
|
export {
|
|
37
|
-
|
|
33
|
+
I as SDKHeader
|
|
38
34
|
};
|
|
@@ -1,85 +1,99 @@
|
|
|
1
1
|
import { jsxs as f, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { cx as
|
|
3
|
-
import { SDKContainer as
|
|
4
|
-
import { useSdkScroll as
|
|
5
|
-
import { useSdkFeature as
|
|
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
6
|
import { useAnalyticsListener as h, newTabLinkListener as F } from "../../hooks/analytics.js";
|
|
7
|
-
import
|
|
8
|
-
import { useState as b, useMemo as
|
|
9
|
-
import { useStore as
|
|
10
|
-
import { FeatureType as
|
|
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";
|
|
9
|
+
import { useStore as m } from "@streamlayer/react-polyfills";
|
|
10
|
+
import { FeatureType as w } from "@streamlayer/sdk-web-types";
|
|
11
11
|
import { resetCss as u } from "../../ui/theme/theme.js";
|
|
12
|
-
import { BetPackOverlay as
|
|
13
|
-
import { ActiveFeature as
|
|
14
|
-
import { SDKHeader as
|
|
15
|
-
import { SDKNotifications as
|
|
16
|
-
import { MastersContext as
|
|
17
|
-
import { checkSdkInDesktopView as
|
|
18
|
-
import { StreamLayerMastersThemeProvider as
|
|
19
|
-
const
|
|
20
|
-
const [, r] =
|
|
21
|
-
return /* @__PURE__ */ a(
|
|
22
|
-
},
|
|
23
|
-
const
|
|
24
|
-
return
|
|
25
|
-
const
|
|
26
|
-
return
|
|
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,
|
|
28
|
+
{
|
|
29
|
+
responsiveStore: i,
|
|
30
|
+
className: t,
|
|
31
|
+
appNode: r,
|
|
32
|
+
feature: c,
|
|
33
|
+
sdk: e
|
|
34
|
+
},
|
|
35
|
+
o
|
|
36
|
+
) : null;
|
|
27
37
|
}) : null;
|
|
28
|
-
},
|
|
29
|
-
const [t, r] = b(!
|
|
30
|
-
return
|
|
31
|
-
const n =
|
|
32
|
-
const
|
|
33
|
-
r(!
|
|
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));
|
|
34
44
|
}, 200);
|
|
35
45
|
return window.addEventListener("resize", n), () => {
|
|
36
46
|
window.removeEventListener("resize", n);
|
|
37
47
|
};
|
|
38
|
-
}, []), h(
|
|
39
|
-
},
|
|
40
|
-
const t =
|
|
41
|
-
return
|
|
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;
|
|
51
|
+
return S(() => {
|
|
42
52
|
window.requestAnimationFrame(() => {
|
|
43
53
|
e.initializeApp().then(() => {
|
|
44
|
-
e.openFeature(
|
|
54
|
+
e.openFeature(w.GAMES);
|
|
45
55
|
});
|
|
46
56
|
});
|
|
47
|
-
}, [e]), h(t, { enabled: !0, event: "click", listener: F }),
|
|
57
|
+
}, [e]), h(t, { enabled: !0, event: "click", listener: F }), S(() => {
|
|
48
58
|
import("./Features/Gamification/gamification-feature.js");
|
|
49
|
-
}, []), /* @__PURE__ */ f(
|
|
50
|
-
/* @__PURE__ */ a(
|
|
51
|
-
/* @__PURE__ */ f(
|
|
52
|
-
|
|
53
|
-
|
|
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,
|
|
54
64
|
{
|
|
55
65
|
sdk: e,
|
|
56
|
-
scrollNode:
|
|
66
|
+
scrollNode: c,
|
|
57
67
|
headerNode: n,
|
|
58
68
|
appNode: t,
|
|
59
69
|
scrollStore: l,
|
|
60
|
-
responsiveStore:
|
|
70
|
+
responsiveStore: o
|
|
61
71
|
}
|
|
62
72
|
),
|
|
63
|
-
|
|
64
|
-
|
|
73
|
+
s && /* @__PURE__ */ a(G, { className: u, sdk: e }),
|
|
74
|
+
s && /* @__PURE__ */ a(O, { responsiveStore: o, appNode: t, className: u, sdk: e })
|
|
65
75
|
] })
|
|
66
76
|
] });
|
|
67
|
-
},
|
|
68
|
-
const [r,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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();
|
|
82
|
+
}, [e]);
|
|
83
|
+
return /* @__PURE__ */ f(D.Provider, { value: c, children: [
|
|
84
|
+
r && o && /* @__PURE__ */ a(
|
|
85
|
+
R,
|
|
72
86
|
{
|
|
73
87
|
sdk: e,
|
|
74
|
-
onEvent: ({ type:
|
|
88
|
+
onEvent: ({ type: s }) => s === "slOpenGameCenter" ? l() : () => {
|
|
75
89
|
},
|
|
76
|
-
close: () =>
|
|
90
|
+
close: () => l()
|
|
77
91
|
}
|
|
78
92
|
),
|
|
79
|
-
!r && /* @__PURE__ */ a(
|
|
93
|
+
!r && /* @__PURE__ */ a(j, { sdk: e })
|
|
80
94
|
] });
|
|
81
95
|
};
|
|
82
96
|
export {
|
|
83
|
-
|
|
84
|
-
|
|
97
|
+
oe as MastersApp,
|
|
98
|
+
ae as StreamLayerMastersThemeProvider
|
|
85
99
|
};
|
|
@@ -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-DSi8Qgfs.js";
|
|
5
5
|
const d = Object.keys(r), i = () => {
|
|
6
6
|
const n = window.innerWidth;
|
|
7
7
|
let e = "sm";
|
|
@@ -19,7 +19,7 @@ const d = Object.keys(r), i = () => {
|
|
|
19
19
|
}, w = (n) => {
|
|
20
20
|
var e;
|
|
21
21
|
return (((e = n.current) == null ? void 0 : e.getBoundingClientRect().y) || 0) < -68;
|
|
22
|
-
}, k = (n) => n >= r.
|
|
22
|
+
}, k = (n) => n >= r.lg, v = (n) => {
|
|
23
23
|
const [e] = m(() => {
|
|
24
24
|
const t = i();
|
|
25
25
|
return l({
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import S from "lodash.throttle";
|
|
2
|
-
import { useRef as m, useState as
|
|
3
|
-
import { useStore as
|
|
2
|
+
import { useRef as m, useState as g, useEffect as h } from "react";
|
|
3
|
+
import { useStore as b } from "@streamlayer/react-polyfills";
|
|
4
4
|
import { BREAKPOINTS as c } from "../../ui/theme/constants.js";
|
|
5
|
-
import { m as v } from "../../index-
|
|
6
|
-
const
|
|
5
|
+
import { m as v } from "../../index-DSi8Qgfs.js";
|
|
6
|
+
const D = (o, e, n) => {
|
|
7
7
|
const t = e >= c.lg && e < c.xl ? 75 : 52;
|
|
8
8
|
o.current && window.scrollTo({
|
|
9
9
|
top: o.current.offsetTop - t,
|
|
10
10
|
...n
|
|
11
11
|
});
|
|
12
|
-
}, T = 15,
|
|
13
|
-
const n = m(null), t = m(0), [s] =
|
|
12
|
+
}, T = 15, L = (o, e) => {
|
|
13
|
+
const n = m(null), t = m(0), [s] = g(
|
|
14
14
|
v({
|
|
15
15
|
scrollPosition: 0,
|
|
16
16
|
tabsShown: !0,
|
|
17
17
|
scrollDirection: "forward"
|
|
18
18
|
})
|
|
19
|
-
), i =
|
|
20
|
-
return
|
|
21
|
-
const l = window.innerWidth < c.
|
|
19
|
+
), i = b(e);
|
|
20
|
+
return h(() => {
|
|
21
|
+
const l = window.innerWidth < c.lg ? window : n.current;
|
|
22
22
|
if (!l)
|
|
23
23
|
return () => {
|
|
24
24
|
};
|
|
@@ -28,7 +28,7 @@ const C = (o, e, n) => {
|
|
|
28
28
|
if (!u)
|
|
29
29
|
return;
|
|
30
30
|
let r = 0;
|
|
31
|
-
i.screen.size < c.
|
|
31
|
+
i.screen.size < c.lg ? r = ((a = o.current) == null ? void 0 : a.getBoundingClientRect().y) || 0 : r = u.scrollTop;
|
|
32
32
|
const w = t.current - r;
|
|
33
33
|
if (T > Math.abs(w))
|
|
34
34
|
return;
|
|
@@ -45,6 +45,6 @@ const C = (o, e, n) => {
|
|
|
45
45
|
}, [s, o, i.screen]), [n, s];
|
|
46
46
|
};
|
|
47
47
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
D as scrollIntoAppView,
|
|
49
|
+
L as useSdkScroll
|
|
50
50
|
};
|
|
@@ -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-DSi8Qgfs.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-DSi8Qgfs.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({
|