@streamlayer/react-ui 1.17.0 → 1.18.1
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/story/settings/login.js +18 -14
- package/lib/app/login/demo.d.ts +1 -4
- package/lib/app/login/demo.js +38 -24
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.d.ts +4 -0
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.js +10 -0
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/styles.d.ts +4 -0
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/styles.js +25 -0
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.d.ts +5 -0
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +18 -0
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/styles.d.ts +7 -0
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/styles.js +41 -0
- package/lib/app/masters/BetPack/BetPackContent/LoaderScreen/index.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/LoaderScreen/index.js +13 -0
- package/lib/app/masters/BetPack/BetPackContent/QuestionScreen/index.d.ts +6 -0
- package/lib/app/masters/BetPack/BetPackContent/QuestionScreen/index.js +7 -0
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.d.ts +4 -0
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +6 -0
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/styles.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/styles.js +9 -0
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.d.ts +5 -0
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +33 -0
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.d.ts +7 -0
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.js +41 -0
- package/lib/app/masters/BetPack/BetPackContent/constants.d.ts +13 -0
- package/lib/app/masters/BetPack/BetPackContent/constants.js +22 -0
- package/lib/app/masters/BetPack/BetPackContent/index.d.ts +11 -0
- package/lib/app/masters/BetPack/BetPackContent/index.js +116 -0
- package/lib/app/masters/BetPack/BetPackContent/styles.d.ts +3 -0
- package/lib/app/masters/BetPack/BetPackContent/styles.js +20 -0
- package/lib/app/masters/BetPack/BetPackOverlay/index.d.ts +12 -0
- package/lib/app/masters/BetPack/BetPackOverlay/index.js +9 -0
- package/lib/app/masters/BetPack/BetPackOverlay/styles.d.ts +10 -0
- package/lib/app/masters/BetPack/BetPackOverlay/styles.js +51 -0
- package/lib/app/masters/BetPack/index.d.ts +14 -0
- package/lib/app/masters/BetPack/index.js +84 -0
- package/lib/app/masters/BetPack/styles.d.ts +4 -0
- package/lib/app/masters/BetPack/styles.js +24 -0
- package/lib/app/masters/BetPack/typings.d.js +1 -0
- package/lib/app/masters/BetPack/utils.d.ts +19 -0
- package/lib/app/masters/BetPack/utils.js +10 -0
- package/lib/app/masters/masters.d.ts +0 -2
- package/lib/app/masters/masters.js +89 -85
- package/lib/app/masters/story/components.d.ts +11 -0
- package/lib/app/masters/story/components.js +151 -0
- package/lib/app/masters/story/index.d.ts +3 -0
- package/lib/app/masters/story/index.js +53 -0
- package/lib/assets/style.css +1 -1
- package/lib/ui/gamification/vote/feedback/index.d.ts +3 -1
- package/lib/ui/gamification/vote/feedback/index.js +52 -50
- package/lib/ui/gamification/vote/feedback/styles.d.ts +1 -0
- package/lib/ui/gamification/vote/feedback/styles.js +5 -0
- package/lib/ui/gamification/vote/index.d.ts +1 -0
- package/lib/ui/gamification/vote/index.js +150 -126
- package/lib/ui/gamification/vote/styles.d.ts +5 -0
- package/lib/ui/gamification/vote/styles.js +40 -14
- package/lib/ui/gamification/vote/vote-option/index.js +43 -40
- package/lib/ui/icons/index.d.ts +5 -0
- package/lib/ui/icons/index.js +87 -66
- package/lib/ui/loader/index.d.ts +4 -0
- package/lib/ui/loader/index.js +5 -0
- package/lib/ui/theme/masters-theme.js +4 -4
- package/lib/ui/theme/masters.js +3 -2
- package/lib/utils/decorators/container.js +11 -9
- package/package.json +22 -16
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { styled as s } from "@linaria/react";
|
|
2
|
+
import { SvgIcon as o } from "../../../../ui/icons/index.js";
|
|
3
|
+
const c = /* @__PURE__ */ s("div")({
|
|
4
|
+
name: "Container",
|
|
5
|
+
class: "c1mj28sn",
|
|
6
|
+
propsAsIs: !1
|
|
7
|
+
}), l = /* @__PURE__ */ s("button")({
|
|
8
|
+
name: "CloseButton",
|
|
9
|
+
class: "coc9f01",
|
|
10
|
+
propsAsIs: !1
|
|
11
|
+
}), p = "b590k5k", e = () => o, t = /* @__PURE__ */ s(e())({
|
|
12
|
+
name: "IconArrowPrev",
|
|
13
|
+
class: "i1tkem14",
|
|
14
|
+
propsAsIs: !0
|
|
15
|
+
}), n = () => t, i = /* @__PURE__ */ s(n())({
|
|
16
|
+
name: "IconArrowNext",
|
|
17
|
+
class: "i175qlj5",
|
|
18
|
+
propsAsIs: !0
|
|
19
|
+
}), m = /* @__PURE__ */ s("div")({
|
|
20
|
+
name: "Header",
|
|
21
|
+
class: "h1foi3kz",
|
|
22
|
+
propsAsIs: !1
|
|
23
|
+
}), A = /* @__PURE__ */ s("div")({
|
|
24
|
+
name: "HeaderTitle",
|
|
25
|
+
class: "hc2d48a",
|
|
26
|
+
propsAsIs: !1
|
|
27
|
+
}), I = /* @__PURE__ */ s("div")({
|
|
28
|
+
name: "Main",
|
|
29
|
+
class: "mgfyjlp",
|
|
30
|
+
propsAsIs: !1
|
|
31
|
+
}), d = /* @__PURE__ */ s("div")({
|
|
32
|
+
name: "Footer",
|
|
33
|
+
class: "f1vakhu9",
|
|
34
|
+
propsAsIs: !1
|
|
35
|
+
}), f = /* @__PURE__ */ s("button")({
|
|
36
|
+
name: "SlideSwitchButton",
|
|
37
|
+
class: "spp13y7",
|
|
38
|
+
propsAsIs: !1
|
|
39
|
+
});
|
|
40
|
+
export {
|
|
41
|
+
l as CloseButton,
|
|
42
|
+
c as Container,
|
|
43
|
+
d as Footer,
|
|
44
|
+
m as Header,
|
|
45
|
+
A as HeaderTitle,
|
|
46
|
+
i as IconArrowNext,
|
|
47
|
+
t as IconArrowPrev,
|
|
48
|
+
I as Main,
|
|
49
|
+
f as SlideSwitchButton,
|
|
50
|
+
p as buttonAvailable
|
|
51
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
2
|
+
import { AllowedMessageType } from './utils';
|
|
3
|
+
export { BetPackOverlay, type BetPackOverlayProps } from './BetPackOverlay';
|
|
4
|
+
export type BetPackEventCb = (event: {
|
|
5
|
+
type: AllowedMessageType;
|
|
6
|
+
payload?: unknown;
|
|
7
|
+
}) => void;
|
|
8
|
+
export declare const BetPack: React.FC<{
|
|
9
|
+
sdk: StreamLayerSDK;
|
|
10
|
+
heightOffset?: number;
|
|
11
|
+
onEvent?: BetPackEventCb;
|
|
12
|
+
swipeable?: boolean;
|
|
13
|
+
centerPadding?: string;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { jsxs as u, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as p, useCallback as y, memo as H, useMemo as k, useRef as B, useEffect as A } from "react";
|
|
3
|
+
import { useStore as g } from "@streamlayer/react-polyfills";
|
|
4
|
+
import { FeatureType as N } from "@streamlayer/sdk-web-types";
|
|
5
|
+
import { BetPackContent as b } from "./BetPackContent/index.js";
|
|
6
|
+
import { EmergencyScreen as L } from "./BetPackContent/EmergencyScreen/index.js";
|
|
7
|
+
import { LoaderScreen as z } from "./BetPackContent/LoaderScreen/index.js";
|
|
8
|
+
import { BetPackContainer as F } from "./styles.js";
|
|
9
|
+
import { defaultEventHandler as I } from "./utils.js";
|
|
10
|
+
import { cx as x } from "@linaria/core";
|
|
11
|
+
import { SvgIcon as P } from "../../../ui/icons/index.js";
|
|
12
|
+
import { Container as O, Header as R, HeaderTitle as j, CloseButton as E, Main as T, Footer as G, SlideSwitchButton as v, IconArrowPrev as M, buttonAvailable as w, IconArrowNext as U } from "./BetPackOverlay/styles.js";
|
|
13
|
+
const re = ({ sdk: m, onEvent: i, close: f, isMobile: o }) => {
|
|
14
|
+
const [t, h] = p(), [e, a] = p(), c = y(
|
|
15
|
+
(n) => {
|
|
16
|
+
if (n.type === "slBetPackReady") {
|
|
17
|
+
const { next: s, prev: d, current: l, canNext: S, canPrev: C } = n.payload || {};
|
|
18
|
+
h({ next: s, prev: d }), a({ current: l, canNext: S, canPrev: C });
|
|
19
|
+
}
|
|
20
|
+
if (n.type === "slBetPackChangeCard") {
|
|
21
|
+
const { current: s, canNext: d, canPrev: l } = n.payload || {};
|
|
22
|
+
a({ current: s, canNext: d, canPrev: l });
|
|
23
|
+
}
|
|
24
|
+
i == null || i(n);
|
|
25
|
+
},
|
|
26
|
+
[i]
|
|
27
|
+
);
|
|
28
|
+
return /* @__PURE__ */ u(O, { children: [
|
|
29
|
+
/* @__PURE__ */ u(R, { children: [
|
|
30
|
+
/* @__PURE__ */ u(j, { children: [
|
|
31
|
+
/* @__PURE__ */ r(P, { name: "icon-trophy-bet-pack" }),
|
|
32
|
+
"LiveMatch Experience",
|
|
33
|
+
" "
|
|
34
|
+
] }),
|
|
35
|
+
/* @__PURE__ */ r(E, { onClick: f, children: /* @__PURE__ */ r(P, { name: "icon-close-btn-gray" }) })
|
|
36
|
+
] }),
|
|
37
|
+
/* @__PURE__ */ r(T, { children: /* @__PURE__ */ r(
|
|
38
|
+
Y,
|
|
39
|
+
{
|
|
40
|
+
sdk: m,
|
|
41
|
+
onEvent: c,
|
|
42
|
+
swipeable: !!o,
|
|
43
|
+
centerPadding: o ? "18px" : "50px",
|
|
44
|
+
heightOffset: o ? 0 : 35
|
|
45
|
+
}
|
|
46
|
+
) }),
|
|
47
|
+
!o && /* @__PURE__ */ u(G, { children: [
|
|
48
|
+
/* @__PURE__ */ r(v, { onClick: t == null ? void 0 : t.prev, disabled: !(e != null && e.canPrev), children: /* @__PURE__ */ r(M, { name: "iconArrowPrev", className: x((e == null ? void 0 : e.canPrev) && w) }) }),
|
|
49
|
+
/* @__PURE__ */ r(v, { onClick: t == null ? void 0 : t.next, disabled: !(e != null && e.canNext), children: /* @__PURE__ */ r(U, { name: "iconArrowPrev", className: x((e == null ? void 0 : e.canNext) && w) }) })
|
|
50
|
+
] })
|
|
51
|
+
] });
|
|
52
|
+
}, Y = H(({ sdk: m, swipeable: i = !0, heightOffset: f = 65, onEvent: o = I, centerPadding: t }) => {
|
|
53
|
+
const h = g(m.featuresList.getStore()), e = k(() => m.getFeature(N.GAMES), [h]), a = g(m.getUserStore()), c = B(null), [n, s] = p(), d = y(() => {
|
|
54
|
+
c.current && s(c.current.clientHeight);
|
|
55
|
+
}, []);
|
|
56
|
+
return A(() => {
|
|
57
|
+
const l = () => {
|
|
58
|
+
c.current && s(c.current.clientHeight);
|
|
59
|
+
};
|
|
60
|
+
return window.addEventListener("resize", l), () => {
|
|
61
|
+
window.removeEventListener("resize", l);
|
|
62
|
+
};
|
|
63
|
+
}, []), a.data ? e ? /* @__PURE__ */ r(F, { ref: c, children: /* @__PURE__ */ r(
|
|
64
|
+
b,
|
|
65
|
+
{
|
|
66
|
+
gamification: e,
|
|
67
|
+
onEvent: o,
|
|
68
|
+
swipeable: i,
|
|
69
|
+
centerPadding: t,
|
|
70
|
+
changeHeightOnInit: d,
|
|
71
|
+
height: n ? n - f : void 0
|
|
72
|
+
}
|
|
73
|
+
) }) : /* @__PURE__ */ r("div", { children: "no gamification" }) : a.error && !a.loading ? /* @__PURE__ */ r(
|
|
74
|
+
L,
|
|
75
|
+
{
|
|
76
|
+
actionFn: () => o({ type: "slHardRefresh" }),
|
|
77
|
+
description: "You are not authorized to view this resource."
|
|
78
|
+
}
|
|
79
|
+
) : /* @__PURE__ */ r(z, {});
|
|
80
|
+
});
|
|
81
|
+
export {
|
|
82
|
+
Y as BetPack,
|
|
83
|
+
re as BetPackOverlay
|
|
84
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const ScreenButton: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
|
|
2
|
+
export declare const ScreenTitle: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
3
|
+
export declare const ScreenDescription: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
4
|
+
export declare const BetPackContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { styled as s } from "@linaria/react";
|
|
2
|
+
const n = /* @__PURE__ */ s("button")({
|
|
3
|
+
name: "ScreenButton",
|
|
4
|
+
class: "s1pdy82n",
|
|
5
|
+
propsAsIs: !1
|
|
6
|
+
}), t = /* @__PURE__ */ s("div")({
|
|
7
|
+
name: "ScreenTitle",
|
|
8
|
+
class: "spc0iwi",
|
|
9
|
+
propsAsIs: !1
|
|
10
|
+
}), c = /* @__PURE__ */ s("div")({
|
|
11
|
+
name: "ScreenDescription",
|
|
12
|
+
class: "s18vssq2",
|
|
13
|
+
propsAsIs: !1
|
|
14
|
+
}), o = /* @__PURE__ */ s("div")({
|
|
15
|
+
name: "BetPackContainer",
|
|
16
|
+
class: "blelwov",
|
|
17
|
+
propsAsIs: !1
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
o as BetPackContainer,
|
|
21
|
+
n as ScreenButton,
|
|
22
|
+
c as ScreenDescription,
|
|
23
|
+
t as ScreenTitle
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type AllowedMessageType = 'slBetPackReady' | 'slOpenGameCenter' | 'slHardRefresh' | 'slBetPackChangeCard';
|
|
2
|
+
declare global {
|
|
3
|
+
interface Window {
|
|
4
|
+
webkit?: {
|
|
5
|
+
messageHandlers: {
|
|
6
|
+
[x: string]: {
|
|
7
|
+
postMessage: (args: unknown) => void;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
slBetPackCb?: {
|
|
12
|
+
postMessage: (data: string) => void;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export declare const defaultEventHandler: (event: {
|
|
17
|
+
type: AllowedMessageType;
|
|
18
|
+
payload?: unknown;
|
|
19
|
+
}) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createLogger as n } from "@streamlayer/sdk-web-logger";
|
|
2
|
+
const o = "slBetPackCb", w = n("betPack-ui"), d = (e, s = {}) => {
|
|
3
|
+
var t, i;
|
|
4
|
+
w.debug({ id: o, type: e, ...s }), (t = window.top) == null || t.postMessage({ id: o, type: e, ...s }, "*"), window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers[o] && window.webkit.messageHandlers[o].postMessage({ type: e, ...s }), (i = window.slBetPackCb) != null && i.postMessage && window.slBetPackCb.postMessage(JSON.stringify({ type: e, ...s, from: "base" }));
|
|
5
|
+
}, a = (e) => {
|
|
6
|
+
d(e.type);
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
a as defaultEventHandler
|
|
10
|
+
};
|
|
@@ -1,120 +1,124 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SDKContainer as
|
|
3
|
-
import { useSdkScroll as
|
|
4
|
-
import { useSdkFeature as
|
|
5
|
-
import { useAnalyticsListener as
|
|
6
|
-
import { useRef as
|
|
7
|
-
import { useStore as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { MastersContext as
|
|
14
|
-
import { useSdkResponsive as
|
|
15
|
-
import { StreamLayerMastersThemeProvider as
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import { FeaturedGroupsButtonId as V } from "../../ui/navigation/button/FeaturedGroups.js";
|
|
19
|
-
const W = ({ sdk: e, className: i, scrollStore: l, appNode: t, scrollNode: s, responsiveStore: o }) => {
|
|
20
|
-
const [, r] = F(e);
|
|
1
|
+
import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { SDKContainer as b, SDKScrollContainer as g } from "./styles.js";
|
|
3
|
+
import { useSdkScroll as C } from "./useSdkScroll.js";
|
|
4
|
+
import { useSdkFeature as L } from "../useSdkFeature.js";
|
|
5
|
+
import { useAnalyticsListener as m, newTabLinkListener as x, appScrollListener as A, appClickListener as I } from "../../hooks/analytics.js";
|
|
6
|
+
import { useRef as f, useState as D, useEffect as S, useMemo as M } from "react";
|
|
7
|
+
import { useStore as l } from "@streamlayer/react-polyfills";
|
|
8
|
+
import { FeatureType as P } from "@streamlayer/sdk-web-types";
|
|
9
|
+
import { resetCss as v } from "../../ui/theme/theme.js";
|
|
10
|
+
import { BetPackOverlay as w } from "./BetPack/index.js";
|
|
11
|
+
import { ActiveFeature as E, StandaloneFeature as k } from "./Features/index.js";
|
|
12
|
+
import { SDKNotifications as j } from "./Notifications/index.js";
|
|
13
|
+
import { MastersContext as B } from "./useMastersContext.js";
|
|
14
|
+
import { useSdkResponsive as K } from "./useSdkResponsive.js";
|
|
15
|
+
import { StreamLayerMastersThemeProvider as ne } from "../../ui/theme/masters.js";
|
|
16
|
+
const O = ({ sdk: e, className: t, scrollStore: s, appNode: a, scrollNode: i, responsiveStore: r }) => {
|
|
17
|
+
const [, o] = L(e);
|
|
21
18
|
return /* @__PURE__ */ n(
|
|
22
|
-
|
|
19
|
+
E,
|
|
23
20
|
{
|
|
24
|
-
className:
|
|
25
|
-
scrollNode:
|
|
26
|
-
appNode:
|
|
27
|
-
scrollStore:
|
|
28
|
-
feature:
|
|
29
|
-
responsiveStore:
|
|
21
|
+
className: t,
|
|
22
|
+
scrollNode: i,
|
|
23
|
+
appNode: a,
|
|
24
|
+
scrollStore: s,
|
|
25
|
+
feature: o,
|
|
26
|
+
responsiveStore: r,
|
|
30
27
|
sdk: e
|
|
31
28
|
}
|
|
32
29
|
);
|
|
33
|
-
},
|
|
34
|
-
const
|
|
35
|
-
return
|
|
36
|
-
const
|
|
37
|
-
return
|
|
30
|
+
}, R = ({ sdk: e, className: t, appNode: s, responsiveStore: a }) => {
|
|
31
|
+
const i = l(e.featuresList.getStore());
|
|
32
|
+
return i ? Array.from(i, (r) => {
|
|
33
|
+
const o = e.getFeature(r);
|
|
34
|
+
return o ? /* @__PURE__ */ n(
|
|
38
35
|
k,
|
|
39
36
|
{
|
|
40
|
-
className:
|
|
41
|
-
appNode:
|
|
42
|
-
feature:
|
|
43
|
-
responsiveStore:
|
|
37
|
+
className: t,
|
|
38
|
+
appNode: s,
|
|
39
|
+
feature: o,
|
|
40
|
+
responsiveStore: a,
|
|
44
41
|
sdk: e
|
|
45
42
|
},
|
|
46
|
-
|
|
43
|
+
r
|
|
47
44
|
) : null;
|
|
48
45
|
}) : null;
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
}, G = ({
|
|
47
|
+
responsiveStore: e,
|
|
48
|
+
...t
|
|
49
|
+
}) => {
|
|
50
|
+
const { sdkInDesktopView: s } = l(e);
|
|
51
|
+
return /* @__PURE__ */ n(w, { ...t, isMobile: !s });
|
|
52
|
+
}, te = ({ sdk: e }) => {
|
|
53
|
+
const t = f(null), [s, a] = D(!0), i = f(null), [r] = K(t), [o, p] = C(t, r), h = l(e.status), y = l(e.sdkStore.slStreamId), u = !!l(e.userId()), c = h === "ready" && !!y.data;
|
|
54
|
+
S(() => {
|
|
55
|
+
window.requestAnimationFrame(() => {
|
|
56
|
+
e.initializeApp().then(() => {
|
|
57
|
+
e.openFeature(P.GAMES);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}, [e]), m(t, { enabled: !0, event: "click", listener: x }), m(o, {
|
|
61
|
+
enabled: !0,
|
|
53
62
|
event: "scrollend",
|
|
54
|
-
listener:
|
|
63
|
+
listener: A,
|
|
55
64
|
useDomNode: !0
|
|
56
|
-
}),
|
|
57
|
-
enabled:
|
|
65
|
+
}), m(o, {
|
|
66
|
+
enabled: !0,
|
|
58
67
|
event: "click",
|
|
59
|
-
listener:
|
|
68
|
+
listener: I,
|
|
60
69
|
useDomNode: !0
|
|
61
70
|
});
|
|
62
|
-
const
|
|
63
|
-
return
|
|
71
|
+
const F = M(() => ({ sdk: e }), [e]);
|
|
72
|
+
return S(() => {
|
|
64
73
|
import("./Features/Gamification/gamification-feature.js");
|
|
65
|
-
}, []), /* @__PURE__ */
|
|
66
|
-
|
|
67
|
-
|
|
74
|
+
}, []), /* @__PURE__ */ d(B.Provider, { value: F, children: [
|
|
75
|
+
s && u && /* @__PURE__ */ n(
|
|
76
|
+
G,
|
|
68
77
|
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
activeOverlay: m,
|
|
72
|
-
className: p,
|
|
73
|
-
setActiveOverlay: (u) => h("", u),
|
|
74
|
-
scrollToTop: () => {
|
|
75
|
-
var u;
|
|
76
|
-
return (u = r.current) == null ? void 0 : u.scrollTo(0, 0);
|
|
78
|
+
sdk: e,
|
|
79
|
+
onEvent: ({ type: N }) => N === "slOpenGameCenter" ? a(!1) : () => {
|
|
77
80
|
},
|
|
78
|
-
|
|
81
|
+
close: () => a(!1),
|
|
82
|
+
responsiveStore: r
|
|
79
83
|
}
|
|
80
84
|
),
|
|
81
|
-
/* @__PURE__ */
|
|
85
|
+
!s && u && /* @__PURE__ */ n(b, { ref: t, children: /* @__PURE__ */ d(g, { className: "sl-hide-on-modal", ref: o, children: [
|
|
82
86
|
c && /* @__PURE__ */ n(
|
|
83
|
-
|
|
87
|
+
j,
|
|
84
88
|
{
|
|
85
89
|
sdk: e,
|
|
86
|
-
scrollNode:
|
|
87
|
-
headerNode:
|
|
90
|
+
scrollNode: o,
|
|
91
|
+
headerNode: i,
|
|
88
92
|
appNode: t,
|
|
89
|
-
scrollStore:
|
|
90
|
-
responsiveStore:
|
|
93
|
+
scrollStore: p,
|
|
94
|
+
responsiveStore: r
|
|
91
95
|
}
|
|
92
96
|
),
|
|
93
|
-
/* @__PURE__ */ n(
|
|
94
|
-
|
|
95
|
-
c && m === V && /* @__PURE__ */ n(
|
|
96
|
-
W,
|
|
97
|
+
c && /* @__PURE__ */ n(
|
|
98
|
+
O,
|
|
97
99
|
{
|
|
98
|
-
scrollStore:
|
|
99
|
-
responsiveStore:
|
|
100
|
-
scrollNode:
|
|
100
|
+
scrollStore: p,
|
|
101
|
+
responsiveStore: r,
|
|
102
|
+
scrollNode: o,
|
|
101
103
|
appNode: t,
|
|
102
|
-
className:
|
|
104
|
+
className: v,
|
|
103
105
|
sdk: e
|
|
104
106
|
}
|
|
105
107
|
),
|
|
106
|
-
c && /* @__PURE__ */ n(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
108
|
+
c && /* @__PURE__ */ n(
|
|
109
|
+
R,
|
|
110
|
+
{
|
|
111
|
+
responsiveStore: r,
|
|
112
|
+
appNode: t,
|
|
113
|
+
className: v,
|
|
114
|
+
sdk: e
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
] }) }),
|
|
118
|
+
!u && /* @__PURE__ */ n("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: "You are not logged in." })
|
|
119
|
+
] });
|
|
116
120
|
};
|
|
117
121
|
export {
|
|
118
|
-
|
|
119
|
-
|
|
122
|
+
te as MastersApp,
|
|
123
|
+
ne as StreamLayerMastersThemeProvider
|
|
120
124
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const Container: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
2
|
+
export declare const HostAppContent: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
3
|
+
export declare const AppContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
4
|
+
export declare const MobileHeader: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
5
|
+
export declare const Body: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
6
|
+
export declare const BackToTop: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
|
|
7
|
+
export declare const BackToTopLink: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLAnchorElement> & import('react').AnchorHTMLAttributes<HTMLAnchorElement> & Record<never, unknown>>;
|
|
8
|
+
export declare const Video: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const MastersLogin: React.FC<{
|
|
10
|
+
hideUser?: boolean;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { styled as s } from "@linaria/react";
|
|
3
|
+
import { useState as d, useCallback as v, useEffect as b } from "react";
|
|
4
|
+
import { useStreamLayer as h } from "@streamlayer/react";
|
|
5
|
+
import { StreamLayerLogin as g } from "@streamlayer/react/auth";
|
|
6
|
+
import { storage as a } from "@streamlayer/sdk-web-core";
|
|
7
|
+
import { StreamLayerSDKPoints as y } from "../Points/index.js";
|
|
8
|
+
import { StreamLayerMastersThemeProvider as k } from "../../../ui/theme/masters.js";
|
|
9
|
+
const A = /* @__PURE__ */ s("div")({
|
|
10
|
+
name: "PointsContainer",
|
|
11
|
+
class: "p1ibyybw",
|
|
12
|
+
propsAsIs: !1
|
|
13
|
+
}), M = /* @__PURE__ */ s("div")({
|
|
14
|
+
name: "Container",
|
|
15
|
+
class: "cwn5esv",
|
|
16
|
+
propsAsIs: !1
|
|
17
|
+
}), H = /* @__PURE__ */ s("div")({
|
|
18
|
+
name: "HostAppContent",
|
|
19
|
+
class: "h1wlm0i9",
|
|
20
|
+
propsAsIs: !1
|
|
21
|
+
}), U = /* @__PURE__ */ s("div")({
|
|
22
|
+
name: "AppContainer",
|
|
23
|
+
class: "al0jzb8",
|
|
24
|
+
propsAsIs: !1
|
|
25
|
+
}), D = /* @__PURE__ */ s("div")({
|
|
26
|
+
name: "MobileHeader",
|
|
27
|
+
class: "m1pnv6pj",
|
|
28
|
+
propsAsIs: !1
|
|
29
|
+
}), E = /* @__PURE__ */ s("div")({
|
|
30
|
+
name: "Body",
|
|
31
|
+
class: "b1brtptg",
|
|
32
|
+
propsAsIs: !1
|
|
33
|
+
}), C = /* @__PURE__ */ s("div")({
|
|
34
|
+
name: "VideoFrame",
|
|
35
|
+
class: "v19mta0g",
|
|
36
|
+
propsAsIs: !1
|
|
37
|
+
}), T = /* @__PURE__ */ s("video")({
|
|
38
|
+
name: "VideoPlayer",
|
|
39
|
+
class: "v17i6v46",
|
|
40
|
+
propsAsIs: !1
|
|
41
|
+
}), I = /* @__PURE__ */ s("div")({
|
|
42
|
+
name: "LoginContainer",
|
|
43
|
+
class: "lf71eub",
|
|
44
|
+
propsAsIs: !1
|
|
45
|
+
}), z = /* @__PURE__ */ s("button")({
|
|
46
|
+
name: "BackToTop",
|
|
47
|
+
class: "b1xvh1fy",
|
|
48
|
+
propsAsIs: !1
|
|
49
|
+
}), K = /* @__PURE__ */ s("a")({
|
|
50
|
+
name: "BackToTopLink",
|
|
51
|
+
class: "b1jcte5i",
|
|
52
|
+
propsAsIs: !1
|
|
53
|
+
}), N = () => {
|
|
54
|
+
const o = h(), [r, i] = d(!1), t = v(({
|
|
55
|
+
muted: c
|
|
56
|
+
}) => {
|
|
57
|
+
i(c);
|
|
58
|
+
}, []);
|
|
59
|
+
return b(() => (o == null || o.addVideoPlayerController(t), () => {
|
|
60
|
+
o == null || o.removeVideoPlayerController(t);
|
|
61
|
+
}), [o, t]), /* @__PURE__ */ n(C, {
|
|
62
|
+
children: [o && /* @__PURE__ */ e(k, {
|
|
63
|
+
children: /* @__PURE__ */ e(A, {
|
|
64
|
+
children: /* @__PURE__ */ e(y, {
|
|
65
|
+
sdk: o
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
}), /* @__PURE__ */ e(I, {
|
|
69
|
+
children: /* @__PURE__ */ e(L, {
|
|
70
|
+
hideUser: !0
|
|
71
|
+
})
|
|
72
|
+
}), /* @__PURE__ */ e(T, {
|
|
73
|
+
src: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
|
|
74
|
+
muted: r,
|
|
75
|
+
controls: !0
|
|
76
|
+
})]
|
|
77
|
+
});
|
|
78
|
+
}, L = ({
|
|
79
|
+
hideUser: o
|
|
80
|
+
}) => {
|
|
81
|
+
var l;
|
|
82
|
+
const [r, i] = d({
|
|
83
|
+
token: a.getExternalToken(),
|
|
84
|
+
schema: a.getSchema()
|
|
85
|
+
}), t = h();
|
|
86
|
+
return /* @__PURE__ */ n("div", {
|
|
87
|
+
children: [/* @__PURE__ */ n("form", {
|
|
88
|
+
className: "auth-form",
|
|
89
|
+
onSubmit: (m) => {
|
|
90
|
+
m.preventDefault();
|
|
91
|
+
const p = new FormData(m.currentTarget), u = p.get("token"), f = p.get("schema");
|
|
92
|
+
i({
|
|
93
|
+
token: u,
|
|
94
|
+
schema: f
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
children: [/* @__PURE__ */ n("div", {
|
|
98
|
+
children: [/* @__PURE__ */ e("label", {
|
|
99
|
+
htmlFor: "token",
|
|
100
|
+
children: "token"
|
|
101
|
+
}), /* @__PURE__ */ e("input", {
|
|
102
|
+
type: "text",
|
|
103
|
+
id: "token",
|
|
104
|
+
name: "token",
|
|
105
|
+
placeholder: "..." + ((l = a.getExternalToken()) == null ? void 0 : l.slice(-8))
|
|
106
|
+
})]
|
|
107
|
+
}), /* @__PURE__ */ n("div", {
|
|
108
|
+
children: [/* @__PURE__ */ e("label", {
|
|
109
|
+
htmlFor: "schema",
|
|
110
|
+
children: "schema"
|
|
111
|
+
}), /* @__PURE__ */ e("input", {
|
|
112
|
+
type: "text",
|
|
113
|
+
id: "schema",
|
|
114
|
+
name: "schema",
|
|
115
|
+
placeholder: a.getSchema()
|
|
116
|
+
})]
|
|
117
|
+
}), /* @__PURE__ */ e("div", {
|
|
118
|
+
children: /* @__PURE__ */ e("button", {
|
|
119
|
+
type: "submit",
|
|
120
|
+
children: "submit"
|
|
121
|
+
})
|
|
122
|
+
})]
|
|
123
|
+
}), /* @__PURE__ */ e(g, {
|
|
124
|
+
token: r.token,
|
|
125
|
+
schema: r.schema
|
|
126
|
+
}), /* @__PURE__ */ e("button", {
|
|
127
|
+
onClick: () => t == null ? void 0 : t.logout(),
|
|
128
|
+
children: "logout"
|
|
129
|
+
}), !o && /* @__PURE__ */ n("div", {
|
|
130
|
+
children: [/* @__PURE__ */ e("div", {
|
|
131
|
+
children: "user"
|
|
132
|
+
}), /* @__PURE__ */ e("textarea", {
|
|
133
|
+
value: r.token,
|
|
134
|
+
rows: 6,
|
|
135
|
+
cols: 70,
|
|
136
|
+
readonly: !0
|
|
137
|
+
})]
|
|
138
|
+
})]
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
export {
|
|
142
|
+
U as AppContainer,
|
|
143
|
+
z as BackToTop,
|
|
144
|
+
K as BackToTopLink,
|
|
145
|
+
E as Body,
|
|
146
|
+
M as Container,
|
|
147
|
+
H as HostAppContent,
|
|
148
|
+
L as MastersLogin,
|
|
149
|
+
D as MobileHeader,
|
|
150
|
+
N as Video
|
|
151
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { StreamLayerProvider as t, StreamLayerSDKEvent as l, useStreamLayer as c } from "@streamlayer/react";
|
|
3
|
+
import { MastersApp as s } from "../masters.js";
|
|
4
|
+
import { StreamLayerMastersThemeProvider as p } from "../../../ui/theme/masters.js";
|
|
5
|
+
import { useStreamLayerDebug as m, StreamLayerDebug as h } from "../../../utils/debug/index.js";
|
|
6
|
+
import { MastersLogin as u, MobileHeader as y, HostAppContent as d, Body as k, Video as v, Container as L, AppContainer as f, BackToTop as S, BackToTopLink as T } from "./components.js";
|
|
7
|
+
const C = () => {
|
|
8
|
+
const o = c();
|
|
9
|
+
return o ? /* @__PURE__ */ e(p, { style: { height: "100%" }, children: /* @__PURE__ */ e(s, { sdk: o }) }) : null;
|
|
10
|
+
}, a = () => {
|
|
11
|
+
console.log("deep link handled cb");
|
|
12
|
+
}, i = () => {
|
|
13
|
+
console.log("video player handled cb");
|
|
14
|
+
}, D = ({ settings: o }) => {
|
|
15
|
+
const r = m();
|
|
16
|
+
return o ? /* @__PURE__ */ n(
|
|
17
|
+
t,
|
|
18
|
+
{
|
|
19
|
+
sdkKey: r.sdkKey,
|
|
20
|
+
production: r.env === "production",
|
|
21
|
+
onDeepLinkHandled: a,
|
|
22
|
+
videoPlayerController: i,
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ e(u, {}),
|
|
25
|
+
/* @__PURE__ */ e(h, { ...r, standalone: !0, hideAuth: !0 })
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
) : /* @__PURE__ */ n(
|
|
29
|
+
t,
|
|
30
|
+
{
|
|
31
|
+
sdkKey: r.sdkKey,
|
|
32
|
+
production: r.env === "production",
|
|
33
|
+
autoEnable: !1,
|
|
34
|
+
onDeepLinkHandled: a,
|
|
35
|
+
videoPlayerController: i,
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ e(l, { event: r.event }),
|
|
38
|
+
/* @__PURE__ */ e(y, { children: "header" }),
|
|
39
|
+
/* @__PURE__ */ e(d, { children: "...host app content..." }),
|
|
40
|
+
/* @__PURE__ */ n(k, { children: [
|
|
41
|
+
/* @__PURE__ */ e(v, {}),
|
|
42
|
+
/* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(f, { className: "StreamLayerSDK", children: /* @__PURE__ */ e(C, {}) }) })
|
|
43
|
+
] }),
|
|
44
|
+
/* @__PURE__ */ e(d, { children: "...host app content..." }),
|
|
45
|
+
/* @__PURE__ */ e(S, { onClick: () => document.documentElement.scrollTop = 0, children: "BackToTop" }),
|
|
46
|
+
/* @__PURE__ */ e(T, { href: "#", children: "BackToTop Link" })
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
D as MastersStory
|
|
53
|
+
};
|