@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
|
@@ -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 h, useEffect as p } from "react";
|
|
2
|
+
const m = "16px", g = 17, f = 21, S = 24, w = (r) => r < 0.9 ? S : r < 1.17 ? f : g, C = (r, E) => {
|
|
3
|
+
const [v, a] = T(m), [_, u] = T(""), c = h(null), e = h();
|
|
4
|
+
return p(() => {
|
|
5
|
+
const t = c.current, n = () => {
|
|
6
|
+
e.current && (clearTimeout(e.current), e.current = void 0), e.current = setTimeout(() => {
|
|
7
|
+
if (t) {
|
|
8
|
+
const i = getComputedStyle(t), d = +i.width.replace("px", ""), O = +i.height.replace("px", "") / d, l = d / w(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") || Math.abs(window.orientation) === 90 ? u("landscape") : u("portrait");
|
|
15
|
+
}, o = () => {
|
|
16
|
+
s(), n();
|
|
14
17
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
return window.screen.orientation.addEventListener("change", o), window.addEventListener("orientationchange", o), window.addEventListener("resize", n), t == null || t.addEventListener("transitionend", n, !1), s(), n(), () => {
|
|
19
|
+
window.screen.orientation.removeEventListener("change", o), window.removeEventListener("orientationchange", o), window.removeEventListener("resize", n), t == null || t.removeEventListener("transitionend", n), e.current && clearTimeout(e.current);
|
|
20
|
+
};
|
|
21
|
+
}, []), p(() => (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", ""), o = +t.height.replace("px", "") / n, i = n / w(o);
|
|
24
|
+
a(`${i < 20 ? i : 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,38 +1,38 @@
|
|
|
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
|
|
3
|
+
import { cx as A } from "@linaria/core";
|
|
4
|
+
import { useCallback as P, 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
|
|
6
|
+
import { EndScreen as M } from "./EndScreen/index.js";
|
|
7
7
|
import { LoaderScreen as D } from "./LoaderScreen/index.js";
|
|
8
8
|
import { QuestionScreen as H } from "./QuestionScreen/index.js";
|
|
9
9
|
import { ScreenContainer as L } from "./ScreenContainer/index.js";
|
|
10
10
|
import { StartScreen as V } from "./StartScreen/index.js";
|
|
11
|
-
import { settings as
|
|
12
|
-
import { Carousel as K, desktopDots as
|
|
13
|
-
function
|
|
14
|
-
let a =
|
|
15
|
-
return t.listen((
|
|
16
|
-
a.has(p) &&
|
|
11
|
+
import { settings as x } from "./constants.js";
|
|
12
|
+
import { Carousel as K, desktopDots as q } from "./styles.js";
|
|
13
|
+
function z(t, s, r) {
|
|
14
|
+
let a = new Set(s).add(void 0);
|
|
15
|
+
return t.listen((o, c, p) => {
|
|
16
|
+
a.has(p) && r(o, c, p);
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
let
|
|
21
|
-
(
|
|
22
|
-
[
|
|
19
|
+
function E(t, s = {}) {
|
|
20
|
+
let r = P(
|
|
21
|
+
(o) => s.keys ? z(t, s.keys, o) : t.listen(o),
|
|
22
|
+
[s.keys, t]
|
|
23
23
|
), a = t.get.bind(t);
|
|
24
|
-
return
|
|
24
|
+
return F(r, a, a);
|
|
25
25
|
}
|
|
26
|
-
const re = ({ gamification: t, autoplay:
|
|
27
|
-
const
|
|
28
|
-
const e =
|
|
26
|
+
const re = ({ gamification: t, autoplay: s, swipeable: r, changeHeightOnInit: a, height: o, onEvent: c, centerPadding: p }) => {
|
|
27
|
+
const i = b(), l = b(null), [C, O] = I(!1), { data: n, error: f, loading: y } = E(t.betPack.getStore()), { listOfQuestions: m, countQuestionsAvailable: Q } = B(() => {
|
|
28
|
+
const e = n ? Object.values(n) : [];
|
|
29
29
|
return {
|
|
30
30
|
listOfQuestions: e,
|
|
31
31
|
countQuestionsAvailable: e.filter(({ marketClosed: d }) => !d).length
|
|
32
32
|
};
|
|
33
|
-
}, [
|
|
33
|
+
}, [n]);
|
|
34
34
|
v(() => {
|
|
35
|
-
!f && !y &&
|
|
35
|
+
!f && !y && n !== void 0 && !C && c({
|
|
36
36
|
type: "slBetPackReady",
|
|
37
37
|
payload: {
|
|
38
38
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -52,55 +52,59 @@ const re = ({ gamification: t, autoplay: n, swipeable: u, changeHeightOnInit: a,
|
|
|
52
52
|
canPrev: !1
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
|
-
}, [
|
|
56
|
-
const
|
|
55
|
+
}, [n, f, y, c]);
|
|
56
|
+
const h = P(
|
|
57
57
|
async (e, d) => {
|
|
58
58
|
try {
|
|
59
|
-
|
|
59
|
+
O(!0), await t.betPackVote(e, d);
|
|
60
60
|
} finally {
|
|
61
|
-
|
|
61
|
+
i.current && clearTimeout(i.current), s && (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, s]
|
|
68
68
|
);
|
|
69
69
|
if (v(() => () => {
|
|
70
|
-
|
|
70
|
+
i.current && clearTimeout(i.current);
|
|
71
71
|
}, []), y)
|
|
72
|
-
return /* @__PURE__ */
|
|
73
|
-
if (!f && (
|
|
74
|
-
return /* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ u(D, {});
|
|
73
|
+
if (!f && (n == null || !Object.keys(n).length))
|
|
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
|
-
load the questions
|
|
79
|
+
load the questions.`,
|
|
80
|
+
isMobile: r,
|
|
81
|
+
height: o
|
|
80
82
|
}
|
|
81
83
|
);
|
|
82
84
|
if (f)
|
|
83
|
-
return /* @__PURE__ */
|
|
85
|
+
return /* @__PURE__ */ u(
|
|
84
86
|
S,
|
|
85
87
|
{
|
|
86
|
-
actionFn: () =>
|
|
88
|
+
actionFn: () => c({ type: "slHardRefresh" }),
|
|
87
89
|
description: f instanceof T && f.code !== N.InvalidArgument ? `The event ID was not
|
|
88
90
|
specified or is invalid.` : `The server is unable to
|
|
89
|
-
handle this request
|
|
91
|
+
handle this request.`,
|
|
92
|
+
isMobile: r,
|
|
93
|
+
height: o
|
|
90
94
|
}
|
|
91
95
|
);
|
|
92
|
-
const
|
|
96
|
+
const j = (e) => {
|
|
93
97
|
var d;
|
|
94
|
-
if (
|
|
98
|
+
if (c({
|
|
95
99
|
type: "slBetPackChangeCard",
|
|
96
100
|
payload: {
|
|
97
101
|
current: e,
|
|
98
|
-
canNext: e < Object.keys(
|
|
102
|
+
canNext: e < Object.keys(n).length + 1,
|
|
99
103
|
canPrev: e >= 1
|
|
100
104
|
}
|
|
101
|
-
}), e !== 0 && e !== Object.keys(
|
|
105
|
+
}), e !== 0 && e !== Object.keys(n).length + 1 && ((d = m[e - 1]) != null && d.id)) {
|
|
102
106
|
t.openQuestion(m[e - 1].id, {
|
|
103
|
-
openedFrom: "
|
|
107
|
+
openedFrom: "bet-pack",
|
|
104
108
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
105
109
|
// @ts-expect-error
|
|
106
110
|
attributes: {
|
|
@@ -115,24 +119,32 @@ handle this request.`
|
|
|
115
119
|
return;
|
|
116
120
|
}
|
|
117
121
|
t.closeQuestion();
|
|
118
|
-
},
|
|
122
|
+
}, g = (e) => e ? /* @__PURE__ */ u(L, { height: o, swipeable: r, children: /* @__PURE__ */ u(H, { question: e, vote: h }) }, e.id) : null;
|
|
119
123
|
return /* @__PURE__ */ R(
|
|
120
124
|
K,
|
|
121
125
|
{
|
|
122
|
-
...
|
|
123
|
-
swipe:
|
|
126
|
+
...x,
|
|
127
|
+
swipe: r,
|
|
124
128
|
onInit: a,
|
|
125
|
-
centerPadding: p ||
|
|
126
|
-
afterChange:
|
|
129
|
+
centerPadding: p || x.centerPadding,
|
|
130
|
+
afterChange: j,
|
|
127
131
|
beforeChange: () => {
|
|
128
|
-
|
|
132
|
+
i.current && clearTimeout(i.current);
|
|
129
133
|
},
|
|
130
134
|
ref: l,
|
|
131
|
-
className:
|
|
135
|
+
className: A(!r && q),
|
|
132
136
|
children: [
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
|
|
135
|
-
|
|
137
|
+
/* @__PURE__ */ u(
|
|
138
|
+
V,
|
|
139
|
+
{
|
|
140
|
+
height: o,
|
|
141
|
+
sliderRef: l,
|
|
142
|
+
countQuestionsAvailable: Q,
|
|
143
|
+
swipeable: r
|
|
144
|
+
}
|
|
145
|
+
),
|
|
146
|
+
Object.values(n).map(g),
|
|
147
|
+
/* @__PURE__ */ u(M, { onEvent: c, height: o, swipeable: r })
|
|
136
148
|
]
|
|
137
149
|
}
|
|
138
150
|
);
|
|
@@ -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,9 +1,10 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "@linaria/core";
|
|
3
|
+
import "../../useOrientation.js";
|
|
3
4
|
import "react";
|
|
4
|
-
import { BetPackOverlay as
|
|
5
|
+
import { BetPackOverlay as c } from "../index.js";
|
|
5
6
|
import "../../../../ui/icons/index.js";
|
|
6
7
|
import "./styles.js";
|
|
7
8
|
export {
|
|
8
|
-
|
|
9
|
+
c as BetPackOverlay
|
|
9
10
|
};
|
|
@@ -1,90 +1,95 @@
|
|
|
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 {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
current:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
a
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
import { jsxs as f, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { cx as y } from "@linaria/core";
|
|
3
|
+
import R from "lodash.throttle";
|
|
4
|
+
import { forwardRef as z, useState as k, useCallback as N, useMemo as A, memo as F, useRef as I, useEffect as O } from "react";
|
|
5
|
+
import { useStore as w } from "@streamlayer/react-polyfills";
|
|
6
|
+
import { FeatureType as j } from "@streamlayer/sdk-web-types";
|
|
7
|
+
import { BetPackContent as E } from "./BetPackContent/index.js";
|
|
8
|
+
import { EmergencyScreen as M } from "./BetPackContent/EmergencyScreen/index.js";
|
|
9
|
+
import { LoaderScreen as T } from "./BetPackContent/LoaderScreen/index.js";
|
|
10
|
+
import { BetPackContainer as G } from "./styles.js";
|
|
11
|
+
import { defaultEventHandler as U } from "./utils.js";
|
|
12
|
+
import { useOrientation as Y } from "../useOrientation.js";
|
|
13
|
+
import { SvgIcon as C } 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 H, IconArrowPrev as W, buttonAvailable as B, IconArrowNext as X } from "./BetPackOverlay/styles.js";
|
|
15
|
+
const ur = z(
|
|
16
|
+
({ sdk: m, onEvent: o, close: u, isMobile: c }, h) => {
|
|
17
|
+
const [i, d] = k(), [r, t] = k(), { orientation: s } = Y(), l = N(
|
|
18
|
+
(a) => {
|
|
19
|
+
if (a.type === "slBetPackReady") {
|
|
20
|
+
const { next: P, prev: x, current: p, canNext: b, canPrev: L } = a.payload || {};
|
|
21
|
+
d({ next: P, prev: x }), t((n) => ({
|
|
22
|
+
current: n != null && n.current ? n == null ? void 0 : n.current : p,
|
|
23
|
+
canPrev: n != null && n.current ? n == null ? void 0 : n.canPrev : L,
|
|
24
|
+
canNext: b
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
if (a.type === "slBetPackChangeCard") {
|
|
28
|
+
const { current: P, canNext: x, canPrev: p } = a.payload || {};
|
|
29
|
+
t({ current: P, canNext: x, canPrev: p });
|
|
30
|
+
}
|
|
31
|
+
o == null || o(a);
|
|
32
|
+
},
|
|
33
|
+
[o]
|
|
34
|
+
), g = A(() => c ? s === "landscape" ? "60px" : "18px" : "30px", [c, s]);
|
|
35
|
+
return /* @__PURE__ */ f(q, { ref: h, children: [
|
|
36
|
+
/* @__PURE__ */ f(D, { children: [
|
|
37
|
+
/* @__PURE__ */ f(J, { children: [
|
|
38
|
+
/* @__PURE__ */ e(C, { name: "icon-trophy-bet-pack" }),
|
|
39
|
+
"LiveMatch Experience",
|
|
40
|
+
" "
|
|
41
|
+
] }),
|
|
42
|
+
/* @__PURE__ */ e(K, { onClick: u, children: /* @__PURE__ */ e(C, { name: "icon-close-btn-gray" }) })
|
|
39
43
|
] }),
|
|
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);
|
|
44
|
+
/* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(
|
|
45
|
+
Z,
|
|
46
|
+
{
|
|
47
|
+
sdk: m,
|
|
48
|
+
onEvent: l,
|
|
49
|
+
swipeable: !!c,
|
|
50
|
+
centerPadding: g,
|
|
51
|
+
heightOffset: c ? 0 : 48
|
|
52
|
+
}
|
|
53
|
+
) }),
|
|
54
|
+
!c && /* @__PURE__ */ f(V, { children: [
|
|
55
|
+
/* @__PURE__ */ e(H, { 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(H, { 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
|
+
] })
|
|
58
|
+
] });
|
|
59
|
+
}
|
|
60
|
+
), Z = F(({ sdk: m, swipeable: o = !0, heightOffset: u = 65, onEvent: c = U, centerPadding: h }) => {
|
|
61
|
+
const i = w(m.featuresList.getStore()), d = A(() => m.getFeature(j.GAMES), [i]), r = w(m.getUserStore()), t = I(null), [s, l] = k(), g = N(() => {
|
|
62
|
+
t.current && l(t.current.clientHeight);
|
|
60
63
|
}, []);
|
|
61
|
-
return
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
+
return O(() => {
|
|
65
|
+
const a = R(() => {
|
|
66
|
+
t.current && l(t.current.clientHeight);
|
|
64
67
|
}, 200);
|
|
65
|
-
return window.addEventListener("resize",
|
|
66
|
-
window.removeEventListener("resize",
|
|
68
|
+
return window.addEventListener("resize", a), () => {
|
|
69
|
+
window.removeEventListener("resize", a);
|
|
67
70
|
};
|
|
68
|
-
}, []),
|
|
69
|
-
|
|
71
|
+
}, []), r.data ? d ? /* @__PURE__ */ e(G, { ref: t, className: y("betPack", o && "isMobile"), children: /* @__PURE__ */ e(
|
|
72
|
+
E,
|
|
70
73
|
{
|
|
71
|
-
gamification:
|
|
74
|
+
gamification: d,
|
|
72
75
|
onEvent: c,
|
|
73
76
|
swipeable: o,
|
|
74
|
-
centerPadding:
|
|
75
|
-
changeHeightOnInit:
|
|
76
|
-
height:
|
|
77
|
+
centerPadding: h,
|
|
78
|
+
changeHeightOnInit: g,
|
|
79
|
+
height: s ? s - u : void 0
|
|
77
80
|
}
|
|
78
|
-
) }) : /* @__PURE__ */
|
|
79
|
-
|
|
81
|
+
) }) : /* @__PURE__ */ e("div", { children: "no gamification" }) : r.error && !r.loading ? /* @__PURE__ */ e(
|
|
82
|
+
M,
|
|
80
83
|
{
|
|
81
84
|
actionFn: () => c({ type: "slHardRefresh" }),
|
|
82
85
|
description: `You are not authorized to
|
|
83
|
-
view this resource
|
|
86
|
+
view this resource.`,
|
|
87
|
+
isMobile: o,
|
|
88
|
+
height: s ? s - u : void 0
|
|
84
89
|
}
|
|
85
|
-
) : /* @__PURE__ */
|
|
90
|
+
) : /* @__PURE__ */ e(T, {});
|
|
86
91
|
});
|
|
87
92
|
export {
|
|
88
|
-
|
|
89
|
-
|
|
93
|
+
Z as BetPack,
|
|
94
|
+
ur as BetPackOverlay
|
|
90
95
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AppNodeRef } from '../../..';
|
|
2
|
-
import { ResponsiveStore } from '../../useSdkResponsive';
|
|
3
2
|
import { Gamification as GamificationClass } from '@streamlayer/feature-gamification';
|
|
4
3
|
export declare const GamificationOverlay: React.FC<{
|
|
5
4
|
gamification: GamificationClass;
|
|
@@ -12,6 +11,5 @@ export declare const GamificationOverlay: React.FC<{
|
|
|
12
11
|
export declare const GamificationOverlayStandalone: React.FC<{
|
|
13
12
|
gamification: GamificationClass;
|
|
14
13
|
className?: string;
|
|
15
|
-
responsiveStore: ResponsiveStore;
|
|
16
14
|
appNode: AppNodeRef;
|
|
17
15
|
}>;
|
|
@@ -1,49 +1,44 @@
|
|
|
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 m } from "@linaria/react";
|
|
3
|
+
import { useHideTransition as a } from "../../../../hooks/showIn.js";
|
|
4
|
+
import { useStore as l } from "@streamlayer/react-polyfills";
|
|
5
|
+
import { ModalPortal as p } from "../../../../ui/modal/index.js";
|
|
6
|
+
import { ShowIn as u } from "../../../../ui/show-in/index.js";
|
|
7
|
+
import { Question as c } from "./Question.js";
|
|
8
|
+
import { Tabs as f } from "./Tabs.js";
|
|
9
|
+
const d = () => u, h = /* @__PURE__ */ m(d())({
|
|
10
10
|
name: "OpenedContainer",
|
|
11
11
|
class: "o1seszvt",
|
|
12
12
|
propsAsIs: !0
|
|
13
|
-
}),
|
|
13
|
+
}), G = ({
|
|
14
14
|
gamification: o,
|
|
15
|
-
className:
|
|
16
|
-
}) => /* @__PURE__ */ n(
|
|
17
|
-
className:
|
|
15
|
+
className: r
|
|
16
|
+
}) => /* @__PURE__ */ n(f, {
|
|
17
|
+
className: r,
|
|
18
18
|
gamification: o
|
|
19
|
-
}),
|
|
19
|
+
}), I = ({
|
|
20
20
|
gamification: o,
|
|
21
|
-
className:
|
|
22
|
-
appNode:
|
|
23
|
-
responsiveStore: i
|
|
21
|
+
className: r,
|
|
22
|
+
appNode: e
|
|
24
23
|
}) => {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
className: e,
|
|
38
|
-
hiding: a,
|
|
39
|
-
onAnimationEnd: p,
|
|
40
|
-
children: /* @__PURE__ */ n(f, {
|
|
24
|
+
const t = l(o.openedQuestion.$store), {
|
|
25
|
+
hiding: i,
|
|
26
|
+
onAnimationEnd: s
|
|
27
|
+
} = a();
|
|
28
|
+
return !e.current || !t ? null : /* @__PURE__ */ n(p, {
|
|
29
|
+
container: e,
|
|
30
|
+
useContainer: !1,
|
|
31
|
+
children: /* @__PURE__ */ n(h, {
|
|
32
|
+
className: r,
|
|
33
|
+
hiding: i,
|
|
34
|
+
onAnimationEnd: s,
|
|
35
|
+
children: /* @__PURE__ */ n(c, {
|
|
41
36
|
gamification: o
|
|
42
37
|
})
|
|
43
38
|
})
|
|
44
39
|
});
|
|
45
40
|
};
|
|
46
41
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
G as GamificationOverlay,
|
|
43
|
+
I as GamificationOverlayStandalone
|
|
49
44
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AppNodeRef } from '../..';
|
|
2
|
-
import { ResponsiveStore } from '../useSdkResponsive';
|
|
3
2
|
import { Features } from '@streamlayer/sdk-web-features';
|
|
4
3
|
import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
5
4
|
/** render feature by type */
|
|
@@ -12,7 +11,6 @@ export declare const ActiveFeature: React.FC<{
|
|
|
12
11
|
export declare const StandaloneFeature: React.FC<{
|
|
13
12
|
sdk: StreamLayerSDK;
|
|
14
13
|
feature: Features | null;
|
|
15
|
-
responsiveStore: ResponsiveStore;
|
|
16
14
|
appNode: AppNodeRef;
|
|
17
15
|
className?: string;
|
|
18
16
|
}>;
|
|
@@ -1,26 +1,18 @@
|
|
|
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 n } 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 o = a(() => t && t.featureConfig.get().type === n.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: o
|
|
13
13
|
}
|
|
14
14
|
);
|
|
15
|
-
}, v = ({ feature: e, className: t, appNode: i
|
|
16
|
-
f,
|
|
17
|
-
{
|
|
18
|
-
className: t,
|
|
19
|
-
appNode: i,
|
|
20
|
-
responsiveStore: n,
|
|
21
|
-
gamification: e
|
|
22
|
-
}
|
|
23
|
-
) : null;
|
|
15
|
+
}, v = ({ feature: e, className: t, appNode: i }) => e && e.featureConfig.get().type === n.GAMES ? /* @__PURE__ */ r(f, { className: t, appNode: i, gamification: e }) : null;
|
|
24
16
|
export {
|
|
25
17
|
h as ActiveFeature,
|
|
26
18
|
v as StandaloneFeature
|