@streamlayer/react-ui 1.20.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.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.js +11 -11
- 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 +68 -66
- package/lib/app/masters/BetPack/BetPackOverlay/index.js +3 -2
- package/lib/app/masters/BetPack/index.js +64 -62
- 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.js +5 -5
- package/lib/app/masters/Features/index.d.ts +2 -2
- package/lib/app/masters/Features/index.js +1 -1
- package/lib/app/masters/Header/index.js +19 -23
- package/lib/app/masters/Notifications/Onboarding/index.d.ts +0 -1
- package/lib/app/masters/Notifications/Onboarding/index.js +42 -43
- package/lib/app/masters/Notifications/index.js +50 -55
- package/lib/app/masters/masters.js +60 -56
- package/lib/app/masters/useOrientation.d.ts +3 -0
- package/lib/app/masters/useOrientation.js +12 -0
- 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 +79 -40323
- package/lib/ui/advertisement/overlay/externalAd/styles.d.ts +10 -0
- package/lib/ui/advertisement/overlay/externalAd/styles.js +49 -0
- 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 +98 -95
- 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,82 +1,77 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cx as
|
|
1
|
+
import { jsxs as g, Fragment as V, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { cx as D } from "@linaria/core";
|
|
3
3
|
import { useMastersContext as T } from "../useMastersContext.js";
|
|
4
4
|
import { scrollIntoAppView as q } from "../useSdkScroll.js";
|
|
5
|
-
import { useState as
|
|
5
|
+
import { useState as f, useMemo as E, useEffect as h, useRef as O, useCallback as w } from "react";
|
|
6
6
|
import { r as b } from "../../../index-DALxy-8N.js";
|
|
7
|
-
import { useStore as
|
|
7
|
+
import { useStore as p } from "@streamlayer/react-polyfills";
|
|
8
8
|
import { eventBus as C } from "@streamlayer/sdk-web-interfaces";
|
|
9
9
|
import { NotificationType as a } from "@streamlayer/sdk-web-notifications";
|
|
10
10
|
import { QuestionTypeData as R } from "../../../ui/gamification/constants.js";
|
|
11
|
-
import { Notification as
|
|
11
|
+
import { Notification as N } from "../../../ui/gamification/question/notification/index.js";
|
|
12
12
|
import { PredictionResult as P } from "../../../ui/gamification/question/notification/prediction-result/index.js";
|
|
13
13
|
import { Onboarding as x } from "./Onboarding/index.js";
|
|
14
14
|
import { HiddenContainer as A, Container as B, InnerContainer as H, NotificationRefreshing as Q, Pill as U } from "./styles.js";
|
|
15
15
|
const j = (n) => {
|
|
16
|
-
const [t, u] =
|
|
17
|
-
i.current =
|
|
16
|
+
const [t, u] = f(0), i = O(null), l = w((o) => {
|
|
17
|
+
i.current = o;
|
|
18
18
|
}, []);
|
|
19
19
|
h(() => {
|
|
20
|
-
var
|
|
21
|
-
const
|
|
22
|
-
|
|
20
|
+
var d;
|
|
21
|
+
const o = (d = i.current) == null ? void 0 : d.getBoundingClientRect();
|
|
22
|
+
o && u(o.height);
|
|
23
23
|
}, [n]);
|
|
24
|
-
const
|
|
25
|
-
u(
|
|
24
|
+
const r = w((o) => {
|
|
25
|
+
u(o);
|
|
26
26
|
}, []);
|
|
27
|
-
return [
|
|
27
|
+
return [l, t, r];
|
|
28
28
|
}, z = ({
|
|
29
29
|
sdk: n,
|
|
30
30
|
notification: t,
|
|
31
31
|
appNode: u,
|
|
32
32
|
responsiveStore: i
|
|
33
33
|
}) => {
|
|
34
|
-
var
|
|
34
|
+
var m, s;
|
|
35
35
|
const {
|
|
36
|
-
|
|
37
|
-
} =
|
|
38
|
-
|
|
39
|
-
}), {
|
|
40
|
-
sdk: o
|
|
41
|
-
} = T(), [r, l, m] = j(t.id);
|
|
42
|
-
return t.type === a.QUESTION ? /* @__PURE__ */ f(D, {
|
|
36
|
+
sdk: l
|
|
37
|
+
} = T(), [r, o, d] = j(t.id);
|
|
38
|
+
return t.type === a.QUESTION ? /* @__PURE__ */ g(V, {
|
|
43
39
|
children: [/* @__PURE__ */ c(A, {
|
|
44
40
|
ref: r,
|
|
45
|
-
children: /* @__PURE__ */ c(
|
|
41
|
+
children: /* @__PURE__ */ c(N, {
|
|
46
42
|
...t
|
|
47
43
|
})
|
|
48
|
-
}), /* @__PURE__ */
|
|
44
|
+
}), /* @__PURE__ */ g(B, {
|
|
49
45
|
style: {
|
|
50
|
-
height: t.hiding ? 0 :
|
|
46
|
+
height: t.hiding ? 0 : o
|
|
51
47
|
},
|
|
52
48
|
hiding: t.hiding,
|
|
53
49
|
children: [/* @__PURE__ */ c(H, {
|
|
54
50
|
style: {
|
|
55
51
|
height: "100%"
|
|
56
52
|
},
|
|
57
|
-
children: /* @__PURE__ */ c(
|
|
53
|
+
children: /* @__PURE__ */ c(N, {
|
|
58
54
|
...t,
|
|
59
|
-
controlVideo:
|
|
55
|
+
controlVideo: l == null ? void 0 : l.controlVideoPlayer
|
|
60
56
|
})
|
|
61
57
|
}), /* @__PURE__ */ c(Q, {}, t.id)]
|
|
62
58
|
})]
|
|
63
|
-
}) : t.type === a.QUESTION_RESOLVED && ((
|
|
59
|
+
}) : t.type === a.QUESTION_RESOLVED && ((s = (m = t.data) == null ? void 0 : m.question) != null && s.predictionResult) ? /* @__PURE__ */ c(P, {
|
|
64
60
|
style: {
|
|
65
|
-
height: t.hiding ? 0 :
|
|
61
|
+
height: t.hiding ? 0 : o
|
|
66
62
|
},
|
|
67
|
-
saveHeight:
|
|
63
|
+
saveHeight: d,
|
|
68
64
|
close: t.close,
|
|
69
65
|
hiding: t.hiding,
|
|
70
66
|
...t.data.question,
|
|
71
67
|
mastersApp: !0
|
|
72
68
|
}) : t.type === a.ONBOARDING ? /* @__PURE__ */ c(x, {
|
|
73
69
|
style: {
|
|
74
|
-
height: t.hiding ? 0 :
|
|
70
|
+
height: t.hiding ? 0 : o
|
|
75
71
|
},
|
|
76
|
-
saveHeight:
|
|
72
|
+
saveHeight: d,
|
|
77
73
|
sdk: n,
|
|
78
74
|
notification: t,
|
|
79
|
-
sdkInDesktopView: d,
|
|
80
75
|
appNode: u,
|
|
81
76
|
responsiveStore: i
|
|
82
77
|
}) : null;
|
|
@@ -85,47 +80,47 @@ const j = (n) => {
|
|
|
85
80
|
setPill: t,
|
|
86
81
|
appNode: u,
|
|
87
82
|
headerNode: i,
|
|
88
|
-
scrollNode:
|
|
89
|
-
responsiveStore:
|
|
90
|
-
scrollStore:
|
|
83
|
+
scrollNode: l,
|
|
84
|
+
responsiveStore: r,
|
|
85
|
+
scrollStore: o
|
|
91
86
|
}) => {
|
|
92
|
-
var
|
|
87
|
+
var y, I;
|
|
93
88
|
const {
|
|
94
|
-
screen:
|
|
95
|
-
} =
|
|
89
|
+
screen: d
|
|
90
|
+
} = p(r, {
|
|
96
91
|
keys: ["screen"]
|
|
97
92
|
}), {
|
|
98
93
|
tabsShown: m,
|
|
99
94
|
scrollPosition: s
|
|
100
|
-
} =
|
|
95
|
+
} = p(o, {
|
|
101
96
|
keys: ["tabsShown", "scrollPosition"]
|
|
102
97
|
});
|
|
103
98
|
h(() => {
|
|
104
|
-
|
|
105
|
-
}, [s,
|
|
106
|
-
const e =
|
|
99
|
+
r.get().sdkInDesktopView ? s < 50 && t(null) : s > -50 && t(null);
|
|
100
|
+
}, [s, r, t]);
|
|
101
|
+
const e = r.get().sdkInDesktopView ? u : i;
|
|
107
102
|
return !n || !e.current ? null : b.createPortal(/* @__PURE__ */ c(U, {
|
|
108
|
-
title: n.type === a.QUESTION_RESOLVED ? "Prediction result" : `New ${((
|
|
103
|
+
title: n.type === a.QUESTION_RESOLVED ? "Prediction result" : `New ${((I = R[(y = n.data) == null ? void 0 : y.questionType]) == null ? void 0 : I.label) || "notification"}`,
|
|
109
104
|
onClick: () => {
|
|
110
|
-
var
|
|
111
|
-
|
|
105
|
+
var k;
|
|
106
|
+
r.get().sdkInDesktopView ? (k = l.current) == null || k.scrollTo({
|
|
112
107
|
top: 0,
|
|
113
108
|
behavior: "smooth"
|
|
114
|
-
}) : q(u,
|
|
109
|
+
}) : q(u, d.size, {
|
|
115
110
|
behavior: "smooth"
|
|
116
111
|
}), t(null);
|
|
117
112
|
},
|
|
118
|
-
className:
|
|
113
|
+
className: D(m && F, "sl-pill-button")
|
|
119
114
|
}), e.current);
|
|
120
115
|
}, it = ({
|
|
121
116
|
sdk: n,
|
|
122
117
|
headerNode: t,
|
|
123
118
|
scrollNode: u,
|
|
124
119
|
responsiveStore: i,
|
|
125
|
-
appNode:
|
|
126
|
-
scrollStore:
|
|
120
|
+
appNode: l,
|
|
121
|
+
scrollStore: r
|
|
127
122
|
}) => {
|
|
128
|
-
const [
|
|
123
|
+
const [o] = f(n.getNotificationsStore()), d = p(o), [m, s] = f(null), e = E(() => n.getActiveNotification(), [n, d]);
|
|
129
124
|
return h(() => {
|
|
130
125
|
e && C.emit("notification", {
|
|
131
126
|
action: "rendered",
|
|
@@ -136,25 +131,25 @@ const j = (n) => {
|
|
|
136
131
|
});
|
|
137
132
|
}, [e]), h(() => {
|
|
138
133
|
e && (i.get().sdkInDesktopView || i.get().sdkInView) && (!i.get().sdkInDesktopView && i.get().sdkInView && s(e), i.get().sdkInDesktopView && window.requestAnimationFrame(() => {
|
|
139
|
-
|
|
134
|
+
r.get().scrollPosition !== 0 && s(e);
|
|
140
135
|
}));
|
|
141
136
|
}, [e]), h(() => {
|
|
142
137
|
e || s(null);
|
|
143
|
-
}, [e]), /* @__PURE__ */
|
|
138
|
+
}, [e]), /* @__PURE__ */ g(V, {
|
|
144
139
|
children: [!m && e && /* @__PURE__ */ c(z, {
|
|
145
140
|
headerNode: t,
|
|
146
|
-
appNode:
|
|
141
|
+
appNode: l,
|
|
147
142
|
sdk: n,
|
|
148
143
|
notification: e,
|
|
149
144
|
responsiveStore: i
|
|
150
145
|
}), m && /* @__PURE__ */ c(L, {
|
|
151
146
|
pill: m,
|
|
152
147
|
setPill: s,
|
|
153
|
-
appNode:
|
|
148
|
+
appNode: l,
|
|
154
149
|
notification: e,
|
|
155
150
|
headerNode: t,
|
|
156
151
|
scrollNode: u,
|
|
157
|
-
scrollStore:
|
|
152
|
+
scrollStore: r,
|
|
158
153
|
responsiveStore: i
|
|
159
154
|
})]
|
|
160
155
|
});
|
|
@@ -1,95 +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
27
|
z,
|
|
28
28
|
{
|
|
29
|
+
responsiveStore: i,
|
|
29
30
|
className: t,
|
|
30
31
|
appNode: r,
|
|
31
|
-
feature:
|
|
32
|
-
responsiveStore: n,
|
|
32
|
+
feature: c,
|
|
33
33
|
sdk: e
|
|
34
34
|
},
|
|
35
35
|
o
|
|
36
36
|
) : null;
|
|
37
37
|
}) : null;
|
|
38
|
-
},
|
|
39
|
-
const [t, r] = b(!
|
|
40
|
-
return
|
|
41
|
-
const
|
|
38
|
+
}, R = (e) => {
|
|
39
|
+
const [t, r] = b(!d(v().size)), i = p(null);
|
|
40
|
+
return S(() => {
|
|
41
|
+
const n = x(() => {
|
|
42
42
|
const o = v();
|
|
43
|
-
r(!
|
|
43
|
+
r(!d(o.size));
|
|
44
44
|
}, 200);
|
|
45
|
-
return window.addEventListener("resize",
|
|
46
|
-
window.removeEventListener("resize",
|
|
45
|
+
return window.addEventListener("resize", n), () => {
|
|
46
|
+
window.removeEventListener("resize", n);
|
|
47
47
|
};
|
|
48
|
-
}, []), h(
|
|
49
|
-
},
|
|
50
|
-
const t =
|
|
51
|
-
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(() => {
|
|
52
52
|
window.requestAnimationFrame(() => {
|
|
53
53
|
e.initializeApp().then(() => {
|
|
54
|
-
e.openFeature(
|
|
54
|
+
e.openFeature(w.GAMES);
|
|
55
55
|
});
|
|
56
56
|
});
|
|
57
|
-
}, [e]), h(t, { enabled: !0, event: "click", listener: F }),
|
|
57
|
+
}, [e]), h(t, { enabled: !0, event: "click", listener: F }), S(() => {
|
|
58
58
|
import("./Features/Gamification/gamification-feature.js");
|
|
59
|
-
}, []), /* @__PURE__ */ f(
|
|
60
|
-
/* @__PURE__ */ a(
|
|
61
|
-
/* @__PURE__ */ f(
|
|
62
|
-
|
|
63
|
-
|
|
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,
|
|
64
64
|
{
|
|
65
65
|
sdk: e,
|
|
66
|
-
scrollNode:
|
|
67
|
-
headerNode:
|
|
66
|
+
scrollNode: c,
|
|
67
|
+
headerNode: n,
|
|
68
68
|
appNode: t,
|
|
69
69
|
scrollStore: l,
|
|
70
70
|
responsiveStore: o
|
|
71
71
|
}
|
|
72
72
|
),
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
s && /* @__PURE__ */ a(G, { className: u, sdk: e }),
|
|
74
|
+
s && /* @__PURE__ */ a(O, { responsiveStore: o, appNode: t, className: u, sdk: e })
|
|
75
75
|
] })
|
|
76
76
|
] });
|
|
77
|
-
},
|
|
78
|
-
const [r,
|
|
79
|
-
|
|
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: [
|
|
80
84
|
r && o && /* @__PURE__ */ a(
|
|
81
|
-
|
|
85
|
+
R,
|
|
82
86
|
{
|
|
83
87
|
sdk: e,
|
|
84
|
-
onEvent: ({ type:
|
|
88
|
+
onEvent: ({ type: s }) => s === "slOpenGameCenter" ? l() : () => {
|
|
85
89
|
},
|
|
86
|
-
close: () =>
|
|
90
|
+
close: () => l()
|
|
87
91
|
}
|
|
88
92
|
),
|
|
89
|
-
!r && /* @__PURE__ */ a(
|
|
93
|
+
!r && /* @__PURE__ */ a(j, { sdk: e })
|
|
90
94
|
] });
|
|
91
95
|
};
|
|
92
96
|
export {
|
|
93
|
-
|
|
94
|
-
|
|
97
|
+
oe as MastersApp,
|
|
98
|
+
ae as StreamLayerMastersThemeProvider
|
|
95
99
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useState as i, useEffect as o } from "react";
|
|
2
|
+
const a = () => {
|
|
3
|
+
const [t, n] = i(""), e = () => {
|
|
4
|
+
window.screen.orientation.type.includes("landscape") || Math.abs(window.orientation) === 90 ? n("landscape") : n("portrait");
|
|
5
|
+
};
|
|
6
|
+
return o(() => (window.screen.orientation.addEventListener("change", e), window.addEventListener("orientationchange", e), e(), () => {
|
|
7
|
+
window.screen.orientation.removeEventListener("change", e), window.removeEventListener("orientationchange", e);
|
|
8
|
+
}), []), { orientation: t };
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
a as useOrientation
|
|
12
|
+
};
|
|
@@ -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({
|