@streamlayer/react-ui 1.19.1 → 1.21.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 +2 -0
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.js +11 -10
- 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 +61 -49
- package/lib/app/masters/BetPack/BetPackOverlay/index.d.ts +1 -1
- package/lib/app/masters/BetPack/BetPackOverlay/index.js +3 -2
- package/lib/app/masters/BetPack/index.js +80 -75
- package/lib/app/masters/Features/Gamification/index.d.ts +0 -2
- package/lib/app/masters/Features/Gamification/index.js +29 -34
- package/lib/app/masters/Features/index.d.ts +0 -2
- package/lib/app/masters/Features/index.js +4 -12
- 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/Points/index.js +24 -18
- package/lib/app/masters/masters.js +70 -92
- package/lib/app/masters/useOrientation.d.ts +3 -0
- package/lib/app/masters/useOrientation.js +12 -0
- 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 +40310 -114
- package/lib/ui/advertisement/overlay/externalAd/styles.d.ts +8 -0
- package/lib/ui/advertisement/overlay/externalAd/styles.js +39 -0
- 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/index.js +43 -43
- 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
|
@@ -41,26 +41,26 @@ const R = "data:image/svg+xml,%3csvg%20width='92'%20height='19'%20viewBox='0%200
|
|
|
41
41
|
propsAsIs: !1
|
|
42
42
|
}), q = ({
|
|
43
43
|
deepLink: l,
|
|
44
|
-
onboardingOpts:
|
|
44
|
+
onboardingOpts: C,
|
|
45
45
|
notification: i,
|
|
46
|
-
gamification:
|
|
46
|
+
gamification: p,
|
|
47
47
|
loading: s,
|
|
48
48
|
sdk: a
|
|
49
49
|
}) => {
|
|
50
|
-
var
|
|
51
|
-
const
|
|
52
|
-
var
|
|
53
|
-
const
|
|
54
|
-
return
|
|
50
|
+
var o, m, h, g, V, L, n;
|
|
51
|
+
const d = x(p.friends.getStore()), [e, f] = I(void 0), u = S(() => {
|
|
52
|
+
var c, b;
|
|
53
|
+
const r = a.getInviter();
|
|
54
|
+
return r ? (b = (c = d.data) == null ? void 0 : c.find(({
|
|
55
55
|
slId: k
|
|
56
|
-
}) => k ===
|
|
57
|
-
}, [
|
|
56
|
+
}) => k === r)) == null ? void 0 : b.name : "";
|
|
57
|
+
}, [d.data, a]);
|
|
58
58
|
return B(() => {
|
|
59
|
-
const
|
|
60
|
-
|
|
59
|
+
const r = l.$store.subscribe((c) => {
|
|
60
|
+
c && f(c.data);
|
|
61
61
|
});
|
|
62
62
|
return () => {
|
|
63
|
-
|
|
63
|
+
r();
|
|
64
64
|
};
|
|
65
65
|
}, [l.$store]), /* @__PURE__ */ t(W, {
|
|
66
66
|
children: /* @__PURE__ */ t(E, {
|
|
@@ -75,45 +75,44 @@ const R = "data:image/svg+xml,%3csvg%20width='92'%20height='19'%20viewBox='0%200
|
|
|
75
75
|
label: "Top the leader board and best your friends.",
|
|
76
76
|
icon: "icon-trophy"
|
|
77
77
|
}],
|
|
78
|
-
rulesBtnLabel: (
|
|
79
|
-
rulesTitle: (
|
|
78
|
+
rulesBtnLabel: (o = C.rules) == null ? void 0 : o.buttonLabel,
|
|
79
|
+
rulesTitle: (m = C.rules) == null ? void 0 : m.heading,
|
|
80
80
|
termsTitle: "Terms and Conditions",
|
|
81
|
-
termsText: (
|
|
81
|
+
termsText: (h = C.rules) == null ? void 0 : h.terms,
|
|
82
82
|
steps: H,
|
|
83
|
-
primaryColor: (
|
|
84
|
-
inviteLink:
|
|
85
|
-
inviteCardTitle: (
|
|
86
|
-
inviteCardSubtext: (
|
|
87
|
-
inviteCardBtnLabel: (
|
|
83
|
+
primaryColor: (g = C.inviteCard) == null ? void 0 : g.iconColor,
|
|
84
|
+
inviteLink: e,
|
|
85
|
+
inviteCardTitle: (V = C.inviteCard) == null ? void 0 : V.heading,
|
|
86
|
+
inviteCardSubtext: (L = C.inviteCard) == null ? void 0 : L.subtext,
|
|
87
|
+
inviteCardBtnLabel: (n = C.inviteCard) == null ? void 0 : n.buttonLabel,
|
|
88
88
|
onClose: () => {
|
|
89
|
-
var
|
|
90
|
-
(
|
|
89
|
+
var r;
|
|
90
|
+
(r = i.close) == null || r.call(i);
|
|
91
91
|
},
|
|
92
|
-
gamification:
|
|
92
|
+
gamification: p,
|
|
93
93
|
sdk: a,
|
|
94
|
-
inviterName:
|
|
94
|
+
inviterName: u
|
|
95
95
|
})
|
|
96
96
|
});
|
|
97
97
|
}, r2 = ({
|
|
98
98
|
sdk: l,
|
|
99
|
-
notification:
|
|
99
|
+
notification: C,
|
|
100
100
|
saveHeight: i,
|
|
101
|
-
style:
|
|
101
|
+
style: p,
|
|
102
102
|
appNode: s,
|
|
103
|
-
|
|
104
|
-
responsiveStore: p
|
|
103
|
+
responsiveStore: a
|
|
105
104
|
}) => {
|
|
106
105
|
var L;
|
|
107
|
-
const
|
|
108
|
-
graphicSrc:
|
|
109
|
-
}) =>
|
|
106
|
+
const d = A(null), e = C.data.onboarding, [f, u] = I(e == null ? void 0 : e.instantOpen), o = l.getFeature(j.GAMES), m = S(() => H == null ? void 0 : H.map(({
|
|
107
|
+
graphicSrc: n
|
|
108
|
+
}) => n), []), {
|
|
110
109
|
screen: h
|
|
111
|
-
} = x(
|
|
110
|
+
} = x(a, {
|
|
112
111
|
keys: ["screen"]
|
|
113
112
|
});
|
|
114
113
|
(L = e == null ? void 0 : e.titleCard) != null && L.media && (e.titleCard.media.sponsorLogo = R), _(() => {
|
|
115
|
-
var
|
|
116
|
-
i(((
|
|
114
|
+
var n;
|
|
115
|
+
i(((n = d.current) == null ? void 0 : n.getBoundingClientRect().height) || 0);
|
|
117
116
|
}, [i]);
|
|
118
117
|
const {
|
|
119
118
|
loading: g,
|
|
@@ -121,10 +120,10 @@ const R = "data:image/svg+xml,%3csvg%20width='92'%20height='19'%20viewBox='0%200
|
|
|
121
120
|
} = T(m);
|
|
122
121
|
return f && o && e && s.current && !V ? /* @__PURE__ */ t(G, {
|
|
123
122
|
container: s,
|
|
124
|
-
useContainer: !
|
|
123
|
+
useContainer: !1,
|
|
125
124
|
children: /* @__PURE__ */ t(q, {
|
|
126
|
-
notification:
|
|
127
|
-
setOpened:
|
|
125
|
+
notification: C,
|
|
126
|
+
setOpened: u,
|
|
128
127
|
gamification: o,
|
|
129
128
|
onboardingOpts: e,
|
|
130
129
|
deepLink: o.deepLink,
|
|
@@ -133,7 +132,7 @@ const R = "data:image/svg+xml,%3csvg%20width='92'%20height='19'%20viewBox='0%200
|
|
|
133
132
|
})
|
|
134
133
|
}) : /* @__PURE__ */ Z(w, {
|
|
135
134
|
children: [/* @__PURE__ */ t(y, {
|
|
136
|
-
ref:
|
|
135
|
+
ref: d,
|
|
137
136
|
style: {
|
|
138
137
|
position: "absolute",
|
|
139
138
|
visibility: "hidden"
|
|
@@ -146,14 +145,14 @@ const R = "data:image/svg+xml,%3csvg%20width='92'%20height='19'%20viewBox='0%200
|
|
|
146
145
|
onboarding: e
|
|
147
146
|
})
|
|
148
147
|
}), /* @__PURE__ */ t(O, {
|
|
149
|
-
style:
|
|
150
|
-
hiding:
|
|
148
|
+
style: p,
|
|
149
|
+
hiding: C.hiding,
|
|
151
150
|
children: /* @__PURE__ */ t(y, {
|
|
152
151
|
children: /* @__PURE__ */ t(M, {
|
|
153
|
-
close:
|
|
152
|
+
close: C.close,
|
|
154
153
|
action: () => {
|
|
155
|
-
var
|
|
156
|
-
|
|
154
|
+
var r;
|
|
155
|
+
u(!0), (((r = s.current) == null ? void 0 : r.getBoundingClientRect().y) || 0) < 0 && F(s, h.size, {
|
|
157
156
|
behavior: "smooth"
|
|
158
157
|
});
|
|
159
158
|
},
|
|
@@ -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,28 +1,34 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useStore as
|
|
4
|
-
import { FeatureStatus as
|
|
5
|
-
import { FeatureType as
|
|
6
|
-
import { Points as
|
|
7
|
-
const
|
|
8
|
-
const s = e.userSummary.$store, [
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useState as a, useEffect as c } from "react";
|
|
3
|
+
import { useStore as l } from "@streamlayer/react-polyfills";
|
|
4
|
+
import { FeatureStatus as u, eventBus as n } from "@streamlayer/sdk-web-interfaces";
|
|
5
|
+
import { FeatureType as f } from "@streamlayer/sdk-web-types";
|
|
6
|
+
import { Points as S } from "../../../ui/gamification/points/index.js";
|
|
7
|
+
const y = ({ gamification: e }) => {
|
|
8
|
+
const s = e.userSummary.$store, [t, p] = a(0);
|
|
9
9
|
return c(() => {
|
|
10
|
-
const
|
|
10
|
+
const i = s.subscribe((r) => {
|
|
11
11
|
var o;
|
|
12
|
-
(o =
|
|
12
|
+
(o = r == null ? void 0 : r.summary) != null && o.points && p(r.summary.points);
|
|
13
13
|
});
|
|
14
14
|
return () => {
|
|
15
|
-
|
|
15
|
+
i();
|
|
16
16
|
};
|
|
17
|
-
}, [s]), /* @__PURE__ */
|
|
18
|
-
e.status.get() ===
|
|
17
|
+
}, [s]), /* @__PURE__ */ m(S, { points: t, onClick: () => {
|
|
18
|
+
e.status.get() === u.Suspended ? (e.openFeature(), n.emit("app", {
|
|
19
|
+
action: "open",
|
|
20
|
+
payload: {}
|
|
21
|
+
})) : e.status.get() === u.Ready && (e.closeFeature(!1), n.emit("app", {
|
|
22
|
+
action: "close",
|
|
23
|
+
payload: {}
|
|
24
|
+
}));
|
|
19
25
|
} });
|
|
20
|
-
},
|
|
21
|
-
if (!
|
|
26
|
+
}, k = ({ sdk: e }) => {
|
|
27
|
+
if (!l(e.featuresList.getStore()))
|
|
22
28
|
return null;
|
|
23
|
-
const
|
|
24
|
-
return
|
|
29
|
+
const t = e.getFeature(f.GAMES);
|
|
30
|
+
return t ? /* @__PURE__ */ m(y, { gamification: t }) : null;
|
|
25
31
|
};
|
|
26
32
|
export {
|
|
27
|
-
|
|
33
|
+
k as StreamLayerSDKPoints
|
|
28
34
|
};
|
|
@@ -1,107 +1,85 @@
|
|
|
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
|
-
|
|
27
|
-
{
|
|
28
|
-
className: o,
|
|
29
|
-
appNode: r,
|
|
30
|
-
feature: s,
|
|
31
|
-
responsiveStore: l,
|
|
32
|
-
sdk: e
|
|
33
|
-
},
|
|
34
|
-
a
|
|
35
|
-
) : null;
|
|
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 }) => {
|
|
23
|
+
const o = c(e.featuresList.getStore());
|
|
24
|
+
return o ? Array.from(o, (n) => {
|
|
25
|
+
const s = e.getFeature(n);
|
|
26
|
+
return s ? /* @__PURE__ */ a(z, { className: t, appNode: r, feature: s, sdk: e }, n) : null;
|
|
36
27
|
}) : null;
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
|
|
28
|
+
}, O = (e) => {
|
|
29
|
+
const [t, r] = b(!S(v().size)), o = d(null);
|
|
30
|
+
return p(() => {
|
|
31
|
+
const n = A(() => {
|
|
32
|
+
const s = v();
|
|
33
|
+
r(!S(s.size));
|
|
34
|
+
}, 200);
|
|
35
|
+
return window.addEventListener("resize", n), () => {
|
|
36
|
+
window.removeEventListener("resize", n);
|
|
37
|
+
};
|
|
38
|
+
}, []), h(o, { enabled: !0, event: "click", listener: F }), /* @__PURE__ */ a(M, { ref: o, ...e, isMobile: t });
|
|
39
|
+
}, R = ({ sdk: e }) => {
|
|
40
|
+
const t = d(null), r = c(e.status), o = c(e.sdkStore.slStreamId), n = d(null), [s] = D(t), [i, l] = x(t, s), m = r === "ready" && !!o.data;
|
|
41
|
+
return p(() => {
|
|
46
42
|
window.requestAnimationFrame(() => {
|
|
47
43
|
e.initializeApp().then(() => {
|
|
48
|
-
e.openFeature(
|
|
44
|
+
e.openFeature(I.GAMES);
|
|
49
45
|
});
|
|
50
46
|
});
|
|
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(() => {
|
|
47
|
+
}, [e]), h(t, { enabled: !0, event: "click", listener: F }), p(() => {
|
|
64
48
|
import("./Features/Gamification/gamification-feature.js");
|
|
65
|
-
}, []), /* @__PURE__ */
|
|
66
|
-
|
|
67
|
-
|
|
49
|
+
}, []), /* @__PURE__ */ f(L, { ref: t, children: [
|
|
50
|
+
/* @__PURE__ */ a(C, { className: w(u, "sl-hide-on-modal"), ref: n }),
|
|
51
|
+
/* @__PURE__ */ f(N, { "data-nav": !0, className: "sl-hide-on-modal", ref: i, children: [
|
|
52
|
+
m && /* @__PURE__ */ a(
|
|
53
|
+
P,
|
|
54
|
+
{
|
|
55
|
+
sdk: e,
|
|
56
|
+
scrollNode: i,
|
|
57
|
+
headerNode: n,
|
|
58
|
+
appNode: t,
|
|
59
|
+
scrollStore: l,
|
|
60
|
+
responsiveStore: s
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
m && /* @__PURE__ */ a(B, { className: u, sdk: e }),
|
|
64
|
+
m && /* @__PURE__ */ a(K, { appNode: t, className: u, sdk: e })
|
|
65
|
+
] })
|
|
66
|
+
] });
|
|
67
|
+
}, re = ({ sdk: e, betPack: t }) => {
|
|
68
|
+
const [r, o] = b(t), s = !!c(e.userId()), i = E(() => ({ sdk: e }), [e]);
|
|
69
|
+
return /* @__PURE__ */ f(g.Provider, { value: i, children: [
|
|
70
|
+
r && s && /* @__PURE__ */ a(
|
|
71
|
+
O,
|
|
68
72
|
{
|
|
69
73
|
sdk: e,
|
|
70
|
-
onEvent: ({ type:
|
|
74
|
+
onEvent: ({ type: l }) => l === "slOpenGameCenter" ? o(!1) : () => {
|
|
71
75
|
},
|
|
72
|
-
close: () =>
|
|
73
|
-
responsiveStore: s
|
|
76
|
+
close: () => o(!1)
|
|
74
77
|
}
|
|
75
78
|
),
|
|
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
|
-
] })
|
|
79
|
+
!r && /* @__PURE__ */ a(R, { sdk: e })
|
|
102
80
|
] });
|
|
103
81
|
};
|
|
104
82
|
export {
|
|
105
|
-
|
|
106
|
-
|
|
83
|
+
re as MastersApp,
|
|
84
|
+
se as StreamLayerMastersThemeProvider
|
|
107
85
|
};
|
|
@@ -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
|
+
};
|
|
@@ -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({
|