@streamlayer/react-ui 1.19.0 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/app/Advertisement/index.js +74 -72
- package/lib/app/app/Points/index.js +21 -14
- package/lib/app/app/index.js +79 -89
- package/lib/app/app/useApp.d.ts +2 -1
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.js +10 -9
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +22 -18
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +7 -7
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.d.ts +2 -1
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.js +31 -22
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +11 -11
- package/lib/app/masters/BetPack/BetPackContent/index.js +45 -37
- package/lib/app/masters/BetPack/BetPackOverlay/index.d.ts +1 -1
- package/lib/app/masters/BetPack/index.js +80 -77
- package/lib/app/masters/Points/index.js +24 -18
- package/lib/app/masters/masters.js +75 -87
- package/lib/app/masters/useSdkResponsive.d.ts +2 -0
- package/lib/app/masters/useSdkResponsive.js +3 -1
- package/lib/app/masters/useSdkScroll.js +1 -1
- package/lib/app/useSdkResponsive.js +1 -1
- package/lib/app/useSdkScroll.js +1 -1
- package/lib/assets/style.css +1 -1
- package/lib/hooks/analytics.js +17 -42
- package/lib/index-CLJzLXks.js +64 -0
- package/lib/reset.css +1 -1
- package/lib/ui/advertisement/notification/index.js +8 -8
- package/lib/ui/advertisement/overlay/externalAd/index.js +40306 -94
- package/lib/ui/close-btn/index.d.ts +2 -0
- package/lib/ui/close-btn/index.js +40 -32
- package/lib/ui/gamification/question/inapp/prediction-result/frames/content.js +48 -33
- package/lib/ui/gamification/vote/feedback/index.js +30 -30
- package/lib/ui/gamification/vote/vote-option/index.js +51 -53
- package/lib/ui/icons/index.d.ts +3 -0
- package/lib/ui/icons/index.js +75 -54
- package/lib/ui/modal/index.js +36 -32
- package/lib/ui/show-in/index.js +26 -26
- package/lib/ui/theme/masters-theme.js +12 -4
- package/lib/ui/theme/theme.js +9 -5
- package/package.json +22 -16
- package/lib/index-BEm7B1u1.js +0 -72
|
@@ -1,27 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { useState as T, useRef as p, useEffect as w } from "react";
|
|
2
|
+
const g = "16px", m = 17, S = 21, f = 24, h = (r) => r < 0.9 ? f : r < 1.17 ? S : m, C = (r, E) => {
|
|
3
|
+
const [v, a] = T(g), [_, u] = T(""), c = p(null), e = p();
|
|
4
|
+
return w(() => {
|
|
5
|
+
const t = c.current, n = () => {
|
|
6
|
+
e.current && (clearTimeout(e.current), e.current = void 0), e.current = setTimeout(() => {
|
|
7
|
+
if (t) {
|
|
8
|
+
const o = getComputedStyle(t), d = +o.width.replace("px", ""), O = +o.height.replace("px", "") / d, l = d / h(O);
|
|
9
|
+
a(`${l < 20 ? l : 20}px`);
|
|
10
|
+
}
|
|
11
|
+
e.current = void 0;
|
|
12
|
+
}, 200);
|
|
13
|
+
}, s = () => {
|
|
14
|
+
window.screen.orientation.type.includes("landscape") || String(window.orientation).includes("90") ? u("landscape") : u("portrait");
|
|
15
|
+
}, i = () => {
|
|
16
|
+
s(), n();
|
|
14
17
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
return window.screen.orientation.addEventListener("change", i), window.addEventListener("orientationchange", i), window.addEventListener("resize", n), t == null || t.addEventListener("transitionend", n, !1), s(), n(), () => {
|
|
19
|
+
window.screen.orientation.removeEventListener("change", i), window.removeEventListener("orientationchange", i), window.removeEventListener("resize", n), t == null || t.removeEventListener("transitionend", n), e.current && clearTimeout(e.current);
|
|
20
|
+
};
|
|
21
|
+
}, []), w(() => (e.current && (clearTimeout(e.current), e.current = void 0), e.current = setTimeout(() => {
|
|
22
|
+
if (c.current) {
|
|
23
|
+
const t = getComputedStyle(c.current), n = +t.width.replace("px", ""), i = +t.height.replace("px", "") / n, o = n / h(i);
|
|
24
|
+
a(`${o < 20 ? o : 20}px`), e.current = void 0;
|
|
25
|
+
}
|
|
26
|
+
}, 200), () => {
|
|
27
|
+
e.current && clearTimeout(e.current);
|
|
28
|
+
}), [r]), {
|
|
29
|
+
container: c,
|
|
30
|
+
fontSize: v,
|
|
31
|
+
calcHeight: _ === "landscape" && r !== void 0 && E ? r + 30 : r
|
|
23
32
|
};
|
|
24
33
|
};
|
|
25
34
|
export {
|
|
26
|
-
|
|
35
|
+
C as useDynamicParentFont
|
|
27
36
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { jsx as r, jsxs as e } from "react/jsx-runtime";
|
|
2
|
-
import { ScreenContainer as
|
|
3
|
-
import { ScreenWrap as
|
|
4
|
-
const
|
|
5
|
-
/* @__PURE__ */ e(
|
|
6
|
-
/* @__PURE__ */ r(
|
|
7
|
-
/* @__PURE__ */ r(
|
|
8
|
-
/* @__PURE__ */ e(
|
|
2
|
+
import { ScreenContainer as s } from "../ScreenContainer/index.js";
|
|
3
|
+
import { ScreenWrap as S, Main as a, SponsorIcon as l, StartScreenSponsor as p, StartScreenTitle as d, StartScreenDescription as h, StartScreenButton as m, IconArrowRight as x } from "./styles.js";
|
|
4
|
+
const T = ({ height: o, countQuestionsAvailable: n, sliderRef: i, swipeable: c }) => /* @__PURE__ */ r(s, { height: o, swipeable: c, children: /* @__PURE__ */ e(S, { children: [
|
|
5
|
+
/* @__PURE__ */ e(a, { children: [
|
|
6
|
+
/* @__PURE__ */ r(l, { name: "icon-masters-logo" }),
|
|
7
|
+
/* @__PURE__ */ r(p, { children: "MASTERS PRESENTS" }),
|
|
8
|
+
/* @__PURE__ */ e(d, { children: [
|
|
9
9
|
"Tee time predictions:",
|
|
10
10
|
/* @__PURE__ */ r("br", {}),
|
|
11
11
|
"share your expertise"
|
|
12
12
|
] }),
|
|
13
|
-
/* @__PURE__ */ e(
|
|
13
|
+
/* @__PURE__ */ e(h, { children: [
|
|
14
14
|
"Swipe to answer today’s",
|
|
15
15
|
/* @__PURE__ */ r("br", {}),
|
|
16
16
|
"question cards."
|
|
17
17
|
] })
|
|
18
18
|
] }),
|
|
19
19
|
/* @__PURE__ */ e(
|
|
20
|
-
|
|
20
|
+
m,
|
|
21
21
|
{
|
|
22
22
|
onClick: () => {
|
|
23
23
|
var t;
|
|
@@ -25,11 +25,11 @@ const R = ({ height: o, countQuestionsAvailable: n, sliderRef: i }) => /* @__PUR
|
|
|
25
25
|
},
|
|
26
26
|
children: [
|
|
27
27
|
n ? `${n} questions available` : "See all questions",
|
|
28
|
-
/* @__PURE__ */ r(
|
|
28
|
+
/* @__PURE__ */ r(x, { name: "iconArrowRight" })
|
|
29
29
|
]
|
|
30
30
|
}
|
|
31
31
|
)
|
|
32
32
|
] }) }, "start");
|
|
33
33
|
export {
|
|
34
|
-
|
|
34
|
+
T as StartScreen
|
|
35
35
|
};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as u, jsxs as R } from "react/jsx-runtime";
|
|
2
2
|
import { ConnectError as T, Code as N } from "@connectrpc/connect";
|
|
3
|
-
import { cx as
|
|
4
|
-
import { useCallback as x, useSyncExternalStore as
|
|
3
|
+
import { cx as A } from "@linaria/core";
|
|
4
|
+
import { useCallback as x, useSyncExternalStore as F, useRef as b, useState as I, useMemo as B, useEffect as v } from "react";
|
|
5
5
|
import { EmergencyScreen as S } from "./EmergencyScreen/index.js";
|
|
6
|
-
import { EndScreen as
|
|
7
|
-
import { LoaderScreen as
|
|
8
|
-
import { QuestionScreen as
|
|
9
|
-
import { ScreenContainer as
|
|
10
|
-
import { StartScreen as
|
|
6
|
+
import { EndScreen as D } from "./EndScreen/index.js";
|
|
7
|
+
import { LoaderScreen as H } from "./LoaderScreen/index.js";
|
|
8
|
+
import { QuestionScreen as L } from "./QuestionScreen/index.js";
|
|
9
|
+
import { ScreenContainer as V } from "./ScreenContainer/index.js";
|
|
10
|
+
import { StartScreen as w } from "./StartScreen/index.js";
|
|
11
11
|
import { settings as h } from "./constants.js";
|
|
12
12
|
import { Carousel as K, desktopDots as M } from "./styles.js";
|
|
13
|
-
function q(t,
|
|
14
|
-
let a =
|
|
15
|
-
return t.listen((s,
|
|
16
|
-
a.has(p) &&
|
|
13
|
+
function q(t, o, n) {
|
|
14
|
+
let a = new Set(o).add(void 0);
|
|
15
|
+
return t.listen((s, c, p) => {
|
|
16
|
+
a.has(p) && n(s, c, p);
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
function z(t,
|
|
20
|
-
let
|
|
21
|
-
(s) =>
|
|
22
|
-
[
|
|
19
|
+
function z(t, o = {}) {
|
|
20
|
+
let n = x(
|
|
21
|
+
(s) => o.keys ? q(t, o.keys, s) : t.listen(s),
|
|
22
|
+
[o.keys, t]
|
|
23
23
|
), a = t.get.bind(t);
|
|
24
|
-
return
|
|
24
|
+
return F(n, a, a);
|
|
25
25
|
}
|
|
26
|
-
const re = ({ gamification: t, autoplay:
|
|
27
|
-
const
|
|
26
|
+
const re = ({ gamification: t, autoplay: o, swipeable: n, changeHeightOnInit: a, height: s, onEvent: c, centerPadding: p }) => {
|
|
27
|
+
const i = b(), l = b(null), [P, C] = I(!1), { data: r, error: f, loading: y } = z(t.betPack.getStore()), { listOfQuestions: m, countQuestionsAvailable: O } = B(() => {
|
|
28
28
|
const e = r ? Object.values(r) : [];
|
|
29
29
|
return {
|
|
30
30
|
listOfQuestions: e,
|
|
@@ -32,7 +32,7 @@ const re = ({ gamification: t, autoplay: n, swipeable: u, changeHeightOnInit: a,
|
|
|
32
32
|
};
|
|
33
33
|
}, [r]);
|
|
34
34
|
v(() => {
|
|
35
|
-
!f && !y && r !== void 0 && !P &&
|
|
35
|
+
!f && !y && r !== void 0 && !P && c({
|
|
36
36
|
type: "slBetPackReady",
|
|
37
37
|
payload: {
|
|
38
38
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -52,38 +52,38 @@ const re = ({ gamification: t, autoplay: n, swipeable: u, changeHeightOnInit: a,
|
|
|
52
52
|
canPrev: !1
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
|
-
}, [r, f, y,
|
|
55
|
+
}, [r, f, y, c]);
|
|
56
56
|
const Q = x(
|
|
57
57
|
async (e, d) => {
|
|
58
58
|
try {
|
|
59
59
|
C(!0), await t.betPackVote(e, d);
|
|
60
60
|
} finally {
|
|
61
|
-
|
|
61
|
+
i.current && clearTimeout(i.current), o && (i.current = setTimeout(() => {
|
|
62
62
|
var k;
|
|
63
63
|
(k = l.current) == null || k.slickNext();
|
|
64
64
|
}, 2e3));
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
-
[t, l,
|
|
67
|
+
[t, l, o]
|
|
68
68
|
);
|
|
69
69
|
if (v(() => () => {
|
|
70
|
-
|
|
70
|
+
i.current && clearTimeout(i.current);
|
|
71
71
|
}, []), y)
|
|
72
|
-
return /* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ u(H, {});
|
|
73
73
|
if (!f && (r == null || !Object.keys(r).length))
|
|
74
|
-
return /* @__PURE__ */
|
|
74
|
+
return /* @__PURE__ */ u(
|
|
75
75
|
S,
|
|
76
76
|
{
|
|
77
|
-
actionFn: () =>
|
|
77
|
+
actionFn: () => c({ type: "slHardRefresh" }),
|
|
78
78
|
description: `It looks like we couldn't
|
|
79
79
|
load the questions.`
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
82
|
if (f)
|
|
83
|
-
return /* @__PURE__ */
|
|
83
|
+
return /* @__PURE__ */ u(
|
|
84
84
|
S,
|
|
85
85
|
{
|
|
86
|
-
actionFn: () =>
|
|
86
|
+
actionFn: () => c({ type: "slHardRefresh" }),
|
|
87
87
|
description: f instanceof T && f.code !== N.InvalidArgument ? `The event ID was not
|
|
88
88
|
specified or is invalid.` : `The server is unable to
|
|
89
89
|
handle this request.`
|
|
@@ -91,7 +91,7 @@ handle this request.`
|
|
|
91
91
|
);
|
|
92
92
|
const g = (e) => {
|
|
93
93
|
var d;
|
|
94
|
-
if (
|
|
94
|
+
if (c({
|
|
95
95
|
type: "slBetPackChangeCard",
|
|
96
96
|
payload: {
|
|
97
97
|
current: e,
|
|
@@ -100,7 +100,7 @@ handle this request.`
|
|
|
100
100
|
}
|
|
101
101
|
}), e !== 0 && e !== Object.keys(r).length + 1 && ((d = m[e - 1]) != null && d.id)) {
|
|
102
102
|
t.openQuestion(m[e - 1].id, {
|
|
103
|
-
openedFrom: "
|
|
103
|
+
openedFrom: "bet-pack",
|
|
104
104
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
105
105
|
// @ts-expect-error
|
|
106
106
|
attributes: {
|
|
@@ -115,24 +115,32 @@ handle this request.`
|
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
t.closeQuestion();
|
|
118
|
-
}, j = (e) => e ? /* @__PURE__ */
|
|
118
|
+
}, j = (e) => e ? /* @__PURE__ */ u(V, { height: s, swipeable: n, children: /* @__PURE__ */ u(L, { question: e, vote: Q }) }, e.id) : null;
|
|
119
119
|
return /* @__PURE__ */ R(
|
|
120
120
|
K,
|
|
121
121
|
{
|
|
122
122
|
...h,
|
|
123
|
-
swipe:
|
|
123
|
+
swipe: n,
|
|
124
124
|
onInit: a,
|
|
125
125
|
centerPadding: p || h.centerPadding,
|
|
126
126
|
afterChange: g,
|
|
127
127
|
beforeChange: () => {
|
|
128
|
-
|
|
128
|
+
i.current && clearTimeout(i.current);
|
|
129
129
|
},
|
|
130
130
|
ref: l,
|
|
131
|
-
className:
|
|
131
|
+
className: A(!n && M),
|
|
132
132
|
children: [
|
|
133
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ u(
|
|
134
|
+
w,
|
|
135
|
+
{
|
|
136
|
+
height: s,
|
|
137
|
+
sliderRef: l,
|
|
138
|
+
countQuestionsAvailable: O,
|
|
139
|
+
swipeable: n
|
|
140
|
+
}
|
|
141
|
+
),
|
|
134
142
|
Object.values(r).map(j),
|
|
135
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ u(D, { onEvent: c, height: s, swipeable: n })
|
|
136
144
|
]
|
|
137
145
|
}
|
|
138
146
|
);
|
|
@@ -9,4 +9,4 @@ export type BetPackOverlayProps = {
|
|
|
9
9
|
payload?: unknown;
|
|
10
10
|
}) => void;
|
|
11
11
|
};
|
|
12
|
-
export declare const BetPackOverlay:
|
|
12
|
+
export declare const BetPackOverlay: import('react').ForwardRefExoticComponent<BetPackOverlayProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,90 +1,93 @@
|
|
|
1
|
-
import { jsxs as f, jsx as
|
|
2
|
-
import { cx as
|
|
3
|
-
import
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useStore as
|
|
6
|
-
import { FeatureType as
|
|
7
|
-
import { BetPackContent as
|
|
8
|
-
import { EmergencyScreen as
|
|
9
|
-
import { LoaderScreen as
|
|
10
|
-
import { BetPackContainer as
|
|
11
|
-
import { defaultEventHandler as
|
|
12
|
-
import { SvgIcon as
|
|
13
|
-
import { Container as
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
/* @__PURE__ */ f(
|
|
35
|
-
/* @__PURE__ */ f(
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
import { jsxs as f, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { cx as x } from "@linaria/core";
|
|
3
|
+
import A from "lodash.throttle";
|
|
4
|
+
import { forwardRef as b, useState as y, useCallback as p, memo as L, useMemo as R, useRef as z, useEffect as F } from "react";
|
|
5
|
+
import { useStore as k } from "@streamlayer/react-polyfills";
|
|
6
|
+
import { FeatureType as I } from "@streamlayer/sdk-web-types";
|
|
7
|
+
import { BetPackContent as O } from "./BetPackContent/index.js";
|
|
8
|
+
import { EmergencyScreen as M } from "./BetPackContent/EmergencyScreen/index.js";
|
|
9
|
+
import { LoaderScreen as j } from "./BetPackContent/LoaderScreen/index.js";
|
|
10
|
+
import { BetPackContainer as E } from "./styles.js";
|
|
11
|
+
import { defaultEventHandler as T } from "./utils.js";
|
|
12
|
+
import { SvgIcon as w } from "../../../ui/icons/index.js";
|
|
13
|
+
import { Container as G, Header as U, HeaderTitle as Y, CloseButton as q, Main as D, Footer as J, SlideSwitchButton as C, IconArrowPrev as K, buttonAvailable as H, IconArrowNext as Q } from "./BetPackOverlay/styles.js";
|
|
14
|
+
const tr = b(
|
|
15
|
+
({ sdk: m, onEvent: o, close: h, isMobile: a }, g) => {
|
|
16
|
+
const [c, d] = y(), [r, i] = y(), u = p(
|
|
17
|
+
(t) => {
|
|
18
|
+
if (t.type === "slBetPackReady") {
|
|
19
|
+
const { next: l, prev: s, current: P, canNext: B, canPrev: N } = t.payload || {};
|
|
20
|
+
d({ next: l, prev: s }), i((n) => ({
|
|
21
|
+
current: n != null && n.current ? n == null ? void 0 : n.current : P,
|
|
22
|
+
canPrev: n != null && n.current ? n == null ? void 0 : n.canPrev : N,
|
|
23
|
+
canNext: B
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
if (t.type === "slBetPackChangeCard") {
|
|
27
|
+
const { current: l, canNext: s, canPrev: P } = t.payload || {};
|
|
28
|
+
i({ current: l, canNext: s, canPrev: P });
|
|
29
|
+
}
|
|
30
|
+
o == null || o(t);
|
|
31
|
+
},
|
|
32
|
+
[o]
|
|
33
|
+
);
|
|
34
|
+
return /* @__PURE__ */ f(G, { ref: g, children: [
|
|
35
|
+
/* @__PURE__ */ f(U, { children: [
|
|
36
|
+
/* @__PURE__ */ f(Y, { children: [
|
|
37
|
+
/* @__PURE__ */ e(w, { name: "icon-trophy-bet-pack" }),
|
|
38
|
+
"LiveMatch Experience",
|
|
39
|
+
" "
|
|
40
|
+
] }),
|
|
41
|
+
/* @__PURE__ */ e(q, { onClick: h, children: /* @__PURE__ */ e(w, { name: "icon-close-btn-gray" }) })
|
|
39
42
|
] }),
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
i.current && s(i.current.clientHeight);
|
|
43
|
+
/* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(
|
|
44
|
+
V,
|
|
45
|
+
{
|
|
46
|
+
sdk: m,
|
|
47
|
+
onEvent: u,
|
|
48
|
+
swipeable: !!a,
|
|
49
|
+
centerPadding: a ? "18px" : "30px",
|
|
50
|
+
heightOffset: a ? 0 : 48
|
|
51
|
+
}
|
|
52
|
+
) }),
|
|
53
|
+
!a && /* @__PURE__ */ f(J, { children: [
|
|
54
|
+
/* @__PURE__ */ e(C, { onClick: c == null ? void 0 : c.prev, disabled: !(r != null && r.canPrev), children: /* @__PURE__ */ e(K, { name: "iconArrowPrev", className: x((r == null ? void 0 : r.canPrev) && H) }) }),
|
|
55
|
+
/* @__PURE__ */ e(C, { onClick: c == null ? void 0 : c.next, disabled: !(r != null && r.canNext), children: /* @__PURE__ */ e(Q, { name: "iconArrowPrev", className: x((r == null ? void 0 : r.canNext) && H) }) })
|
|
56
|
+
] })
|
|
57
|
+
] });
|
|
58
|
+
}
|
|
59
|
+
), V = L(({ sdk: m, swipeable: o = !0, heightOffset: h = 65, onEvent: a = T, centerPadding: g }) => {
|
|
60
|
+
const c = k(m.featuresList.getStore()), d = R(() => m.getFeature(I.GAMES), [c]), r = k(m.getUserStore()), i = z(null), [u, t] = y(), l = p(() => {
|
|
61
|
+
i.current && t(i.current.clientHeight);
|
|
60
62
|
}, []);
|
|
61
|
-
return
|
|
62
|
-
const
|
|
63
|
-
i.current &&
|
|
63
|
+
return F(() => {
|
|
64
|
+
const s = A(() => {
|
|
65
|
+
i.current && t(i.current.clientHeight);
|
|
64
66
|
}, 200);
|
|
65
|
-
return window.addEventListener("resize",
|
|
66
|
-
window.removeEventListener("resize",
|
|
67
|
+
return window.addEventListener("resize", s), () => {
|
|
68
|
+
window.removeEventListener("resize", s);
|
|
67
69
|
};
|
|
68
|
-
}, []),
|
|
69
|
-
|
|
70
|
+
}, []), r.data ? d ? /* @__PURE__ */ e(E, { ref: i, className: x("betPack", o && "isMobile"), children: /* @__PURE__ */ e(
|
|
71
|
+
O,
|
|
70
72
|
{
|
|
71
|
-
gamification:
|
|
72
|
-
onEvent:
|
|
73
|
+
gamification: d,
|
|
74
|
+
onEvent: a,
|
|
73
75
|
swipeable: o,
|
|
74
|
-
centerPadding:
|
|
75
|
-
changeHeightOnInit:
|
|
76
|
-
height:
|
|
76
|
+
centerPadding: g,
|
|
77
|
+
changeHeightOnInit: l,
|
|
78
|
+
height: u ? u - h : void 0
|
|
77
79
|
}
|
|
78
|
-
) }) : /* @__PURE__ */
|
|
79
|
-
|
|
80
|
+
) }) : /* @__PURE__ */ e("div", { children: "no gamification" }) : r.error && !r.loading ? /* @__PURE__ */ e(
|
|
81
|
+
M,
|
|
80
82
|
{
|
|
81
|
-
actionFn: () =>
|
|
83
|
+
actionFn: () => a({ type: "slHardRefresh" }),
|
|
82
84
|
description: `You are not authorized to
|
|
83
|
-
view this resource
|
|
85
|
+
view this resource.`,
|
|
86
|
+
isMobile: o
|
|
84
87
|
}
|
|
85
|
-
) : /* @__PURE__ */
|
|
88
|
+
) : /* @__PURE__ */ e(j, {});
|
|
86
89
|
});
|
|
87
90
|
export {
|
|
88
|
-
|
|
89
|
-
|
|
91
|
+
V as BetPack,
|
|
92
|
+
tr as BetPackOverlay
|
|
90
93
|
};
|
|
@@ -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
|
};
|