@streamlayer/react-ui 1.22.3 → 1.22.5
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/styles.js +1 -1
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +7 -7
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/styles.js +1 -1
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.d.ts +0 -1
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +3 -3
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.d.ts +4 -3
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +17 -18
- package/lib/app/masters/BetPack/BetPackContent/index.js +335 -87
- package/lib/app/masters/BetPack/BetPackContent/styles.d.ts +95 -3
- package/lib/app/masters/BetPack/BetPackContent/styles.js +11 -57
- package/lib/app/masters/Features/Gamification/index.d.ts +1 -0
- package/lib/app/masters/Features/Gamification/index.js +36 -30
- package/lib/app/masters/Features/index.d.ts +1 -0
- package/lib/app/masters/Features/index.js +13 -12
- package/lib/app/masters/Notifications/index.d.ts +1 -0
- package/lib/app/masters/Notifications/index.js +97 -94
- package/lib/app/masters/Points/index.js +16 -25
- package/lib/app/masters/masters.d.ts +1 -0
- package/lib/app/masters/masters.js +71 -60
- package/lib/app/masters/story/index.d.ts +0 -1
- package/lib/app/masters/story/index.js +25 -37
- package/lib/app/masters/styles.d.ts +1 -0
- package/lib/app/masters/styles.js +16 -15
- package/lib/app/masters/useSdkResponsive.js +20 -19
- package/lib/app/masters/useSdkScroll.d.ts +1 -1
- package/lib/app/masters/useSdkScroll.js +33 -33
- package/lib/assets/style.css +1 -1
- package/lib/styles-BfnMua4o.js +2841 -0
- package/lib/ui/advertisement/overlay/externalAd/index.js +49 -41
- package/lib/ui/advertisement/overlay/externalAd/styles.d.ts +11 -2
- package/lib/ui/advertisement/overlay/externalAd/styles.js +55 -38
- package/lib/ui/gamification/question/notification/prediction-result/index.js +43 -43
- package/lib/ui/modal/index.d.ts +1 -0
- package/lib/ui/modal/index.js +36 -31
- package/lib/ui/questions/insight/index.js +24 -16
- package/lib/ui/questions/insight/styles.d.ts +1 -0
- package/lib/ui/questions/insight/styles.js +14 -13
- package/lib/ui/theme/constants.d.ts +2 -0
- package/lib/ui/theme/constants.js +6 -4
- package/lib/ui/theme/masters-theme.js +7 -4
- package/lib/ui/theme/theme.js +3 -0
- package/lib/ui/video-player/index.d.ts +1 -0
- package/lib/ui/video-player/index.js +29 -28
- package/package.json +16 -17
- package/lib/app/masters/BetPack/BetPackContent/constants.d.ts +0 -13
- package/lib/app/masters/BetPack/BetPackContent/constants.js +0 -22
- package/lib/app/masters/BetPack/typings.d.js +0 -1
|
@@ -1,90 +1,101 @@
|
|
|
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 { useState as
|
|
8
|
-
import { useStore as
|
|
9
|
-
import { FeatureType as
|
|
10
|
-
import { resetCss as
|
|
11
|
-
import { BetPackOverlay as
|
|
12
|
-
import { ActiveFeature as
|
|
13
|
-
import { SDKHeader as
|
|
14
|
-
import { SDKNotifications as
|
|
1
|
+
import { jsxs as p, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { cx as d } from "@linaria/core";
|
|
3
|
+
import { SDKContainer as A, mobileSdkContainer as h, SDKScrollContainer as x } from "./styles.js";
|
|
4
|
+
import { useSdkScroll as y } from "./useSdkScroll.js";
|
|
5
|
+
import { useSdkFeature as P } from "../useSdkFeature.js";
|
|
6
|
+
import { useAnalyticsListener as F, newTabLinkListener as N } from "../../hooks/analytics.js";
|
|
7
|
+
import { useState as C, useMemo as E, useCallback as L, useRef as S, useEffect as v } from "react";
|
|
8
|
+
import { useStore as u } from "@streamlayer/react-polyfills";
|
|
9
|
+
import { FeatureType as b } from "@streamlayer/sdk-web-types";
|
|
10
|
+
import { resetCss as f } from "../../ui/theme/theme.js";
|
|
11
|
+
import { BetPackOverlay as M } from "./BetPack/index.js";
|
|
12
|
+
import { ActiveFeature as B, StandaloneFeature as D } from "./Features/index.js";
|
|
13
|
+
import { SDKHeader as I } from "./Header/index.js";
|
|
14
|
+
import { SDKNotifications as K } from "./Notifications/index.js";
|
|
15
15
|
import { MastersContext as g } from "./useMastersContext.js";
|
|
16
|
-
import { useSdkResponsive as
|
|
17
|
-
import { StreamLayerMastersThemeProvider as
|
|
18
|
-
const
|
|
19
|
-
const [,
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
},
|
|
22
|
-
const
|
|
23
|
-
return
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
|
|
16
|
+
import { useSdkResponsive as w } from "./useSdkResponsive.js";
|
|
17
|
+
import { StreamLayerMastersThemeProvider as ne } from "../../ui/theme/masters.js";
|
|
18
|
+
const G = ({ sdk: e, className: t }) => {
|
|
19
|
+
const [, r] = P(e);
|
|
20
|
+
return /* @__PURE__ */ n(B, { className: t, feature: r, sdk: e });
|
|
21
|
+
}, O = ({ sdk: e, className: t, appNode: r, responsiveStore: l, useContainer: m }) => {
|
|
22
|
+
const c = u(e.featuresList.getStore());
|
|
23
|
+
return c ? Array.from(c, (a) => {
|
|
24
|
+
const s = e.getFeature(a);
|
|
25
|
+
return s ? /* @__PURE__ */ n(
|
|
26
|
+
D,
|
|
27
27
|
{
|
|
28
|
-
|
|
28
|
+
useContainer: m,
|
|
29
|
+
responsiveStore: l,
|
|
29
30
|
className: t,
|
|
30
|
-
appNode:
|
|
31
|
-
feature:
|
|
31
|
+
appNode: r,
|
|
32
|
+
feature: s,
|
|
32
33
|
sdk: e
|
|
33
34
|
},
|
|
34
|
-
|
|
35
|
+
a
|
|
35
36
|
) : null;
|
|
36
37
|
}) : null;
|
|
37
|
-
},
|
|
38
|
-
const t =
|
|
39
|
-
return
|
|
40
|
-
},
|
|
41
|
-
const
|
|
42
|
-
return
|
|
38
|
+
}, R = (e) => {
|
|
39
|
+
const t = S(null);
|
|
40
|
+
return F(t, { enabled: !0, event: "click", listener: N }), /* @__PURE__ */ n(M, { ref: t, ...e });
|
|
41
|
+
}, j = ({ sdk: e, useContainer: t }) => {
|
|
42
|
+
const r = S(null), l = u(e.status), m = u(e.sdkStore.slStreamId), c = S(null), [a] = w(r), [s, i] = y(r, a, t), o = l === "ready" && !!m.data;
|
|
43
|
+
return v(() => {
|
|
43
44
|
window.requestAnimationFrame(() => {
|
|
44
45
|
e.initializeApp().then(() => {
|
|
45
|
-
e.openFeature(
|
|
46
|
+
e.openFeature(b.GAMES);
|
|
46
47
|
});
|
|
47
48
|
});
|
|
48
|
-
}, [e]),
|
|
49
|
+
}, [e]), F(r, { enabled: !0, event: "click", listener: N }), v(() => {
|
|
49
50
|
import("./Features/Gamification/gamification-feature.js");
|
|
50
|
-
}, []), /* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
}, []), /* @__PURE__ */ p(A, { className: d("SDKContainer", !t && h), ref: r, children: [
|
|
52
|
+
/* @__PURE__ */ n(I, { className: d(f), ref: c }),
|
|
53
|
+
/* @__PURE__ */ p(x, { className: "sl-hide-on-modal", ref: s, children: [
|
|
54
|
+
o && /* @__PURE__ */ n(
|
|
55
|
+
K,
|
|
55
56
|
{
|
|
56
57
|
sdk: e,
|
|
57
|
-
scrollNode:
|
|
58
|
-
headerNode:
|
|
59
|
-
appNode:
|
|
58
|
+
scrollNode: s,
|
|
59
|
+
headerNode: c,
|
|
60
|
+
appNode: r,
|
|
60
61
|
scrollStore: i,
|
|
61
|
-
responsiveStore:
|
|
62
|
+
responsiveStore: a,
|
|
63
|
+
useContainer: t
|
|
62
64
|
}
|
|
63
65
|
),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
o && /* @__PURE__ */ n(G, { className: f, sdk: e }),
|
|
67
|
+
o && /* @__PURE__ */ n(
|
|
68
|
+
O,
|
|
69
|
+
{
|
|
70
|
+
responsiveStore: a,
|
|
71
|
+
appNode: r,
|
|
72
|
+
className: f,
|
|
73
|
+
sdk: e,
|
|
74
|
+
useContainer: t
|
|
75
|
+
}
|
|
76
|
+
)
|
|
66
77
|
] })
|
|
67
78
|
] });
|
|
68
|
-
},
|
|
69
|
-
const [
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
79
|
+
}, te = ({ sdk: e, betPack: t, useContainer: r }) => {
|
|
80
|
+
const [l, m] = C(t), a = !!u(e.userId()), s = E(() => ({ sdk: e }), [e]), i = L(() => {
|
|
81
|
+
m(!1);
|
|
82
|
+
const o = e == null ? void 0 : e.getFeature(b.GAMES);
|
|
83
|
+
o == null || o.closeQuestion();
|
|
73
84
|
}, [e]);
|
|
74
|
-
return /* @__PURE__ */
|
|
75
|
-
|
|
76
|
-
|
|
85
|
+
return /* @__PURE__ */ p(g.Provider, { value: s, children: [
|
|
86
|
+
l && a && /* @__PURE__ */ n(
|
|
87
|
+
R,
|
|
77
88
|
{
|
|
78
89
|
sdk: e,
|
|
79
|
-
onEvent: ({ type:
|
|
90
|
+
onEvent: ({ type: o }) => o === "slOpenGameCenter" ? i() : () => {
|
|
80
91
|
},
|
|
81
92
|
close: () => i()
|
|
82
93
|
}
|
|
83
94
|
),
|
|
84
|
-
!
|
|
95
|
+
!l && /* @__PURE__ */ n(j, { sdk: e, useContainer: r })
|
|
85
96
|
] });
|
|
86
97
|
};
|
|
87
98
|
export {
|
|
88
|
-
|
|
89
|
-
|
|
99
|
+
te as MastersApp,
|
|
100
|
+
ne as StreamLayerMastersThemeProvider
|
|
90
101
|
};
|
|
@@ -1,52 +1,40 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { MastersStreamLayerProvider as d, useStreamLayer as
|
|
3
|
-
import { MastersApp as
|
|
4
|
-
import { StreamLayerMastersThemeProvider as
|
|
5
|
-
import { useStreamLayerDebug as
|
|
6
|
-
import {
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
return
|
|
10
|
-
},
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { MastersStreamLayerProvider as d, useStreamLayer as i } from "@streamlayer/react/masters";
|
|
3
|
+
import { MastersApp as l } from "../masters.js";
|
|
4
|
+
import { StreamLayerMastersThemeProvider as a } from "../../../ui/theme/masters.js";
|
|
5
|
+
import { useStreamLayerDebug as c } from "../../../utils/debug/index.js";
|
|
6
|
+
import { MobileHeader as s, HostAppContent as t, Body as p, Video as h, Container as m, AppContainer as u, BackToTop as y, BackToTopLink as k } from "./components.js";
|
|
7
|
+
const T = ({ betPack: o }) => {
|
|
8
|
+
const r = i();
|
|
9
|
+
return r ? /* @__PURE__ */ e(a, { style: { height: "100%" }, children: /* @__PURE__ */ e(l, { sdk: r, betPack: o, useContainer: !0 }) }) : null;
|
|
10
|
+
}, v = () => {
|
|
11
11
|
console.log("deep link handled cb");
|
|
12
|
-
},
|
|
12
|
+
}, f = () => {
|
|
13
13
|
console.log("video player handled cb");
|
|
14
|
-
},
|
|
15
|
-
const r =
|
|
16
|
-
return
|
|
14
|
+
}, M = ({ betPack: o }) => {
|
|
15
|
+
const r = c();
|
|
16
|
+
return /* @__PURE__ */ n(
|
|
17
17
|
d,
|
|
18
18
|
{
|
|
19
19
|
sdkKey: r.sdkKey,
|
|
20
20
|
production: r.env === "production",
|
|
21
|
-
onDeepLinkHandled:
|
|
22
|
-
videoPlayerController:
|
|
23
|
-
children: [
|
|
24
|
-
/* @__PURE__ */ e(u, {}),
|
|
25
|
-
/* @__PURE__ */ e(h, { ...r, standalone: !0, hideAuth: !0 })
|
|
26
|
-
]
|
|
27
|
-
}
|
|
28
|
-
) : /* @__PURE__ */ t(
|
|
29
|
-
d,
|
|
30
|
-
{
|
|
31
|
-
sdkKey: r.sdkKey,
|
|
32
|
-
production: r.env === "production",
|
|
33
|
-
onDeepLinkHandled: a,
|
|
34
|
-
videoPlayerController: l,
|
|
21
|
+
onDeepLinkHandled: v,
|
|
22
|
+
videoPlayerController: f,
|
|
35
23
|
event: r.event,
|
|
36
24
|
children: [
|
|
37
|
-
/* @__PURE__ */ e(
|
|
38
|
-
/* @__PURE__ */ e(
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */ e(
|
|
41
|
-
/* @__PURE__ */ e(
|
|
25
|
+
/* @__PURE__ */ e(s, { children: "header" }),
|
|
26
|
+
/* @__PURE__ */ e(t, { children: "...host app content..." }),
|
|
27
|
+
/* @__PURE__ */ n(p, { children: [
|
|
28
|
+
/* @__PURE__ */ e(h, {}),
|
|
29
|
+
/* @__PURE__ */ e(m, { children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(u, { className: "StreamLayerSDK", children: /* @__PURE__ */ e(T, { betPack: o }) }) }) })
|
|
42
30
|
] }),
|
|
43
|
-
/* @__PURE__ */ e(
|
|
44
|
-
/* @__PURE__ */ e(
|
|
45
|
-
/* @__PURE__ */ e(
|
|
31
|
+
/* @__PURE__ */ e(t, { style: { height: 3e3 }, children: "...host app content..." }),
|
|
32
|
+
/* @__PURE__ */ e(y, { onClick: () => document.documentElement.scrollTop = 0, children: "BackToTop" }),
|
|
33
|
+
/* @__PURE__ */ e(k, { href: "#", children: "BackToTop Link" })
|
|
46
34
|
]
|
|
47
35
|
}
|
|
48
36
|
);
|
|
49
37
|
};
|
|
50
38
|
export {
|
|
51
|
-
|
|
39
|
+
M as MastersStory
|
|
52
40
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const SDKContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
2
|
+
export declare const mobileSdkContainer: import('@linaria/core').LinariaClassName;
|
|
2
3
|
export declare const SDKScrollContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
3
4
|
export declare const SDKContentContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
4
5
|
export declare const SDKWhiteContainer: {
|
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
|
-
const
|
|
2
|
+
const o = /* @__PURE__ */ s("div")({
|
|
3
3
|
name: "SDKContainer",
|
|
4
4
|
class: "s8zgqze",
|
|
5
5
|
propsAsIs: !1
|
|
6
|
-
}),
|
|
6
|
+
}), t = "m6t897k", r = /* @__PURE__ */ s("div")({
|
|
7
7
|
name: "SDKScrollContainer",
|
|
8
|
-
class: "
|
|
8
|
+
class: "sw7pkvp",
|
|
9
9
|
propsAsIs: !1
|
|
10
10
|
}), n = /* @__PURE__ */ s("div")({
|
|
11
11
|
name: "SDKContentContainer",
|
|
12
|
-
class: "
|
|
12
|
+
class: "s14gkn7u",
|
|
13
13
|
propsAsIs: !1
|
|
14
|
-
}), e = () => n,
|
|
14
|
+
}), e = () => n, i = /* @__PURE__ */ s(e())({
|
|
15
15
|
name: "SDKWhiteContainer",
|
|
16
|
-
class: "
|
|
16
|
+
class: "s1yxstm9",
|
|
17
17
|
propsAsIs: !0
|
|
18
|
-
}),
|
|
18
|
+
}), p = /* @__PURE__ */ s("div")({
|
|
19
19
|
name: "TabsContainer",
|
|
20
|
-
class: "
|
|
20
|
+
class: "tdpty1s",
|
|
21
21
|
propsAsIs: !1
|
|
22
|
-
}),
|
|
22
|
+
}), l = /* @__PURE__ */ s("div")({
|
|
23
23
|
name: "UserSummaryContainer",
|
|
24
|
-
class: "
|
|
24
|
+
class: "u136a59y",
|
|
25
25
|
propsAsIs: !1
|
|
26
26
|
});
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
o as SDKContainer,
|
|
29
29
|
n as SDKContentContainer,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
r as SDKScrollContainer,
|
|
31
|
+
i as SDKWhiteContainer,
|
|
32
|
+
p as TabsContainer,
|
|
33
|
+
l as UserSummaryContainer,
|
|
34
|
+
t as mobileSdkContainer
|
|
34
35
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
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
|
|
4
|
+
import { m as p } from "../../index-DSi8Qgfs.js";
|
|
5
5
|
const d = Object.keys(r), i = () => {
|
|
6
|
-
const
|
|
6
|
+
const t = window.innerWidth;
|
|
7
7
|
let e = "sm";
|
|
8
|
-
for (let
|
|
9
|
-
const s = d[
|
|
10
|
-
if (!(
|
|
8
|
+
for (let n = d.length - 1; n > 0; n--) {
|
|
9
|
+
const s = d[n];
|
|
10
|
+
if (!(t < r[s]) && t >= r[s]) {
|
|
11
11
|
e = s;
|
|
12
12
|
break;
|
|
13
13
|
}
|
|
@@ -16,30 +16,31 @@ const d = Object.keys(r), i = () => {
|
|
|
16
16
|
name: e,
|
|
17
17
|
size: r[e]
|
|
18
18
|
};
|
|
19
|
-
}, w = (
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
}, w = (t) => {
|
|
20
|
+
var n;
|
|
21
|
+
const e = (n = t.current) == null ? void 0 : n.getBoundingClientRect();
|
|
22
|
+
return e ? e.y > -e.height && e.y < window.innerHeight : !1;
|
|
23
|
+
}, k = (t) => t >= r.lg, h = (t) => {
|
|
23
24
|
const [e] = m(() => {
|
|
24
|
-
const
|
|
25
|
-
return
|
|
25
|
+
const n = i();
|
|
26
|
+
return p({
|
|
26
27
|
screen: i(),
|
|
27
|
-
sdkInView: w(
|
|
28
|
-
sdkInDesktopView: k(
|
|
28
|
+
sdkInView: w(t),
|
|
29
|
+
sdkInDesktopView: k(n.size)
|
|
29
30
|
});
|
|
30
31
|
});
|
|
31
32
|
return u(() => {
|
|
32
|
-
const
|
|
33
|
-
e.setKey("sdkInView", w(
|
|
33
|
+
const n = c(() => {
|
|
34
|
+
e.setKey("sdkInView", w(t));
|
|
34
35
|
}, 200), s = c(() => {
|
|
35
36
|
const o = i();
|
|
36
37
|
e.setKey("screen", o), e.setKey("sdkInDesktopView", k(o.size));
|
|
37
38
|
}, 200);
|
|
38
|
-
return window.addEventListener("scroll",
|
|
39
|
-
window.removeEventListener("scroll",
|
|
39
|
+
return n(), s(), window.addEventListener("scroll", n), window.addEventListener("resize", s), () => {
|
|
40
|
+
window.removeEventListener("scroll", n), window.removeEventListener("resize", s);
|
|
40
41
|
};
|
|
41
|
-
}, [e,
|
|
42
|
+
}, [e, t]), [e];
|
|
42
43
|
};
|
|
43
44
|
export {
|
|
44
|
-
|
|
45
|
+
h as useSdkResponsive
|
|
45
46
|
};
|
|
@@ -8,5 +8,5 @@ type ScrollData = {
|
|
|
8
8
|
};
|
|
9
9
|
export type ScrollStore = MapStore<ScrollData>;
|
|
10
10
|
export declare const scrollIntoAppView: (appNode: AppNodeRef, screenSize: number, options?: ScrollIntoViewOptions) => void;
|
|
11
|
-
export declare const useSdkScroll: (appNode: AppNodeRef, responsiveStore: ResponsiveStore) => [ScrollNodeRef, ScrollStore];
|
|
11
|
+
export declare const useSdkScroll: (appNode: AppNodeRef, responsiveStore: ResponsiveStore, useContainer?: boolean) => [ScrollNodeRef, ScrollStore];
|
|
12
12
|
export {};
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useRef as m, useState as
|
|
3
|
-
import { useStore as
|
|
4
|
-
import { BREAKPOINTS as
|
|
5
|
-
import { m as
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
top:
|
|
10
|
-
...
|
|
1
|
+
import g from "lodash.throttle";
|
|
2
|
+
import { useRef as m, useState as h, useEffect as b } from "react";
|
|
3
|
+
import { useStore as v } from "@streamlayer/react-polyfills";
|
|
4
|
+
import { BREAKPOINTS as d } from "../../ui/theme/constants.js";
|
|
5
|
+
import { m as E } from "../../index-DSi8Qgfs.js";
|
|
6
|
+
const y = (e, i, o) => {
|
|
7
|
+
var t;
|
|
8
|
+
(t = e.current) == null || t.scrollTo({
|
|
9
|
+
top: 0,
|
|
10
|
+
...o
|
|
11
11
|
});
|
|
12
|
-
},
|
|
13
|
-
const
|
|
14
|
-
|
|
12
|
+
}, P = 15, z = (e, i, o) => {
|
|
13
|
+
const t = m(null), c = m(0), [s] = h(
|
|
14
|
+
E({
|
|
15
15
|
scrollPosition: 0,
|
|
16
|
-
tabsShown: !
|
|
16
|
+
tabsShown: !1,
|
|
17
17
|
scrollDirection: "forward"
|
|
18
18
|
})
|
|
19
|
-
),
|
|
20
|
-
return
|
|
21
|
-
const
|
|
22
|
-
if (!
|
|
19
|
+
), a = v(i);
|
|
20
|
+
return b(() => {
|
|
21
|
+
const n = window.innerWidth < d.lg && !o ? window : t.current;
|
|
22
|
+
if (!n)
|
|
23
23
|
return () => {
|
|
24
24
|
};
|
|
25
|
-
const
|
|
26
|
-
var
|
|
27
|
-
const
|
|
28
|
-
if (!
|
|
25
|
+
const l = g((p) => {
|
|
26
|
+
var u;
|
|
27
|
+
const f = p.target;
|
|
28
|
+
if (!f)
|
|
29
29
|
return;
|
|
30
30
|
let r = 0;
|
|
31
|
-
|
|
32
|
-
const w =
|
|
33
|
-
if (
|
|
31
|
+
a.screen.size < d.lg && !o ? r = ((u = e.current) == null ? void 0 : u.getBoundingClientRect().y) || 0 : r = f.scrollTop;
|
|
32
|
+
const w = c.current - r;
|
|
33
|
+
if (P > Math.abs(w))
|
|
34
34
|
return;
|
|
35
|
-
const
|
|
36
|
-
|
|
35
|
+
const S = c.current < r ? "forward" : "backward";
|
|
36
|
+
c.current = r, s.set({
|
|
37
37
|
scrollPosition: Math.round(r),
|
|
38
|
-
scrollDirection:
|
|
38
|
+
scrollDirection: S,
|
|
39
39
|
tabsShown: s.get().tabsShown
|
|
40
40
|
});
|
|
41
41
|
}, 200);
|
|
42
|
-
return l.addEventListener("scroll",
|
|
43
|
-
|
|
42
|
+
return l({ target: n }), n.addEventListener("scroll", l), () => {
|
|
43
|
+
n.removeEventListener("scroll", l);
|
|
44
44
|
};
|
|
45
|
-
}, [s,
|
|
45
|
+
}, [s, e, a.screen, o]), [t, s];
|
|
46
46
|
};
|
|
47
47
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
y as scrollIntoAppView,
|
|
49
|
+
z as useSdkScroll
|
|
50
50
|
};
|