@streamlayer/react-ui 1.1.0 → 1.2.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.d.ts +2 -0
- package/lib/app/app/Advertisement/index.js +75 -24
- package/lib/app/app/story/content.d.ts +1 -0
- package/lib/app/app/story/content.js +26 -10
- package/lib/app/app/story/index.d.ts +2 -0
- package/lib/app/app/story/index.js +75 -58
- package/lib/app/app/story/styles.d.ts +9 -0
- package/lib/app/app/story/styles.js +49 -0
- package/lib/app/app/story/useResponsive.d.ts +1 -0
- package/lib/app/app/story/useResponsive.js +15 -0
- package/lib/app/app/story/video.d.ts +3 -1
- package/lib/app/app/story/video.js +63 -92
- package/lib/assets/style.css +1 -1
- package/lib/ui/advertisement/banner/index.d.ts +2 -0
- package/lib/ui/advertisement/banner/index.js +17 -12
- package/lib/ui/advertisement/index.d.ts +1 -0
- package/lib/ui/advertisement/index.js +12 -24
- package/lib/ui/advertisement/mock.d.ts +1 -0
- package/lib/ui/advertisement/mock.js +38 -4
- package/lib/ui/advertisement/overlay/index.d.ts +2 -0
- package/lib/ui/advertisement/overlay/index.js +68 -15
- package/lib/ui/advertisement/overlay/styles.d.ts +18 -0
- package/lib/ui/advertisement/overlay/styles.js +95 -0
- package/lib/ui/advertisement/sidebar/index.d.ts +1 -0
- package/lib/ui/advertisement/sidebar/index.js +10 -8
- package/lib/ui/gamification/question/index.js +1 -0
- package/lib/ui/gamification/vote/vote-option/index.js +6 -6
- package/lib/ui/icons/index.js +1 -0
- package/lib/ui/slide-in/index.js +18 -23
- package/lib/ui/theme/ThemeColorsAdvertisement.d.ts +1 -0
- package/lib/ui/theme/ThemeColorsAdvertisement.js +15 -0
- package/lib/ui/theme/constants.d.ts +11 -0
- package/lib/ui/theme/constants.js +28 -14
- package/lib/ui/theme/theme.js +11 -8
- package/lib/ui/video-player/index.d.ts +1 -0
- package/lib/ui/video-player/index.js +70 -62
- package/package.json +15 -14
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
2
2
|
|
|
3
|
+
export declare const AdvertisementUIWrap: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
3
4
|
export declare const StreamLayerSDKAdvertisement: React.FC<{
|
|
4
5
|
sdk: StreamLayerSDK;
|
|
5
6
|
event?: string;
|
|
6
7
|
sidebar?: 'left' | 'right';
|
|
7
8
|
banner?: 'top' | 'bottom';
|
|
9
|
+
layoutMode?: 'cover' | 'side-by-side';
|
|
8
10
|
}>;
|
|
@@ -1,38 +1,89 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { styled as c } from "@linaria/react";
|
|
2
3
|
import { useStore as m } from "@nanostores/react";
|
|
3
|
-
import { useAnalyticsListener as
|
|
4
|
-
import { useEffect as
|
|
5
|
-
import { eventBus as
|
|
6
|
-
import { FeatureType as
|
|
7
|
-
import { useAppApp as
|
|
8
|
-
import { AdvertisementUI as
|
|
9
|
-
const
|
|
4
|
+
import { useAnalyticsListener as f } from "../../../hooks/analytics.js";
|
|
5
|
+
import { useEffect as u, useRef as v, useMemo as d } from "react";
|
|
6
|
+
import { eventBus as p } from "@streamlayer/sdk-web-interfaces";
|
|
7
|
+
import { FeatureType as A } from "@streamlayer/sdk-web-types";
|
|
8
|
+
import { useAppApp as y } from "../useApp.js";
|
|
9
|
+
import { AdvertisementUI as g } from "../../../ui/advertisement/index.js";
|
|
10
|
+
const h = /* @__PURE__ */ c("div")({
|
|
11
|
+
name: "AdvertisementUIWrap",
|
|
12
|
+
class: "aa6pjif",
|
|
13
|
+
propsAsIs: !1
|
|
14
|
+
}), S = (e) => {
|
|
10
15
|
const t = e.target;
|
|
11
|
-
t instanceof HTMLAnchorElement && t.target === "_blank" && t.getAttribute("data-analytics") === "web-link" &&
|
|
16
|
+
t instanceof HTMLAnchorElement && t.target === "_blank" && t.getAttribute("data-analytics") === "web-link" && p.emit("poll", {
|
|
12
17
|
action: "navigated",
|
|
13
18
|
payload: {}
|
|
14
19
|
});
|
|
15
|
-
},
|
|
16
|
-
|
|
20
|
+
}, L = ({
|
|
21
|
+
gamification: e,
|
|
22
|
+
layoutMode: t,
|
|
23
|
+
sidebar: r,
|
|
24
|
+
banner: i
|
|
25
|
+
}) => {
|
|
26
|
+
const o = v(null), a = m(e.advertisement.$list), n = d(
|
|
17
27
|
() => e.advertisement.getActiveAdvertisement(),
|
|
18
28
|
// fire getActiveNotification when notifications were updated
|
|
19
29
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
20
|
-
[
|
|
30
|
+
[a]
|
|
21
31
|
);
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
return f(o, {
|
|
33
|
+
enabled: !!n,
|
|
34
|
+
event: "click",
|
|
35
|
+
listener: S
|
|
36
|
+
}), n ? /* @__PURE__ */ s(h, {
|
|
37
|
+
ref: o,
|
|
38
|
+
style: {
|
|
39
|
+
height: !i && !r ? "auto" : "100%"
|
|
40
|
+
},
|
|
41
|
+
children: /* @__PURE__ */ s(g, {
|
|
42
|
+
sidebar: r,
|
|
43
|
+
banner: i,
|
|
44
|
+
advertisement: n,
|
|
45
|
+
layoutMode: t
|
|
46
|
+
})
|
|
47
|
+
}) : null;
|
|
48
|
+
}, K = ({
|
|
49
|
+
sdk: e,
|
|
50
|
+
sidebar: t,
|
|
51
|
+
banner: r,
|
|
52
|
+
event: i,
|
|
53
|
+
layoutMode: o
|
|
54
|
+
}) => {
|
|
55
|
+
const {
|
|
56
|
+
deactivate: a
|
|
57
|
+
} = y(e);
|
|
58
|
+
u(() => {
|
|
59
|
+
i ? e.createEventSession(i) : a();
|
|
60
|
+
}, [i, a, e]);
|
|
61
|
+
const n = m(e.featuresList.getStore());
|
|
62
|
+
if (t && r)
|
|
63
|
+
return /* @__PURE__ */ s("div", {
|
|
64
|
+
style: {
|
|
65
|
+
color: "red"
|
|
66
|
+
},
|
|
67
|
+
children: "define either sidebar or banner, not both."
|
|
68
|
+
});
|
|
69
|
+
if (!t && !r && o)
|
|
70
|
+
return /* @__PURE__ */ s("div", {
|
|
71
|
+
style: {
|
|
72
|
+
color: "red"
|
|
73
|
+
},
|
|
74
|
+
children: "layoutMode property unavailable for the overlay mode."
|
|
75
|
+
});
|
|
76
|
+
if (!n)
|
|
32
77
|
return null;
|
|
33
|
-
const
|
|
34
|
-
return
|
|
78
|
+
const l = e.getFeature(A.GAMES);
|
|
79
|
+
return l ? /* @__PURE__ */ s(L, {
|
|
80
|
+
gamification: l,
|
|
81
|
+
sidebar: t,
|
|
82
|
+
banner: r,
|
|
83
|
+
layoutMode: o
|
|
84
|
+
}) : null;
|
|
35
85
|
};
|
|
36
86
|
export {
|
|
37
|
-
|
|
87
|
+
h as AdvertisementUIWrap,
|
|
88
|
+
K as StreamLayerSDKAdvertisement
|
|
38
89
|
};
|
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { styled as s } from "@linaria/react";
|
|
3
|
+
import { useStreamLayer as m } from "@streamlayer/react";
|
|
4
|
+
import { StreamLayerSDKAdvertisement as o } from "../Advertisement/index.js";
|
|
5
|
+
import { theme as i } from "../../../ui/theme/theme.js";
|
|
6
|
+
const a = /* @__PURE__ */ s("div")({
|
|
7
|
+
name: "Container",
|
|
8
|
+
class: "c15py6sl",
|
|
9
|
+
propsAsIs: !1
|
|
10
|
+
}), c = ({
|
|
11
|
+
event: r
|
|
12
|
+
}) => {
|
|
13
|
+
const n = m();
|
|
14
|
+
return n ? /* @__PURE__ */ e(a, {
|
|
15
|
+
className: i,
|
|
16
|
+
"data-testid": "overlay",
|
|
17
|
+
children: [/* @__PURE__ */ e("div", {
|
|
18
|
+
children: ["Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. ", /* @__PURE__ */ t("br", {}), "-------------"]
|
|
19
|
+
}), /* @__PURE__ */ t(o, {
|
|
20
|
+
event: r,
|
|
21
|
+
sdk: n
|
|
22
|
+
}), /* @__PURE__ */ e("div", {
|
|
23
|
+
children: ["-------------", /* @__PURE__ */ t("br", {}), "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book."]
|
|
24
|
+
})]
|
|
25
|
+
}) : null;
|
|
11
26
|
};
|
|
12
27
|
export {
|
|
28
|
+
a as Container,
|
|
13
29
|
c as Content
|
|
14
30
|
};
|
|
@@ -1,96 +1,113 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { styled as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { styled as d } from "@linaria/react";
|
|
3
|
+
import { useRef as A, useState as L, useEffect as m } from "react";
|
|
4
|
+
import t from "screenfull";
|
|
5
|
+
import { StreamLayerProvider as u, useStreamLayer as C } from "@streamlayer/react";
|
|
5
6
|
import { App as S } from "../index.js";
|
|
6
|
-
import { StreamLayerThemeProvider as
|
|
7
|
-
import { useStreamLayerDebug as
|
|
8
|
-
import { Content as
|
|
9
|
-
import { AppLogin as
|
|
10
|
-
import { Video as
|
|
7
|
+
import { StreamLayerThemeProvider as E } from "../../../ui/theme/index.js";
|
|
8
|
+
import { useStreamLayerDebug as F, StreamLayerDebug as x } from "../../../utils/debug/index.js";
|
|
9
|
+
import { Content as P } from "./content.js";
|
|
10
|
+
import { AppLogin as K } from "./login.js";
|
|
11
|
+
import { Video as D } from "./video.js";
|
|
11
12
|
const l = () => {
|
|
12
13
|
console.log("deep link handled cb");
|
|
13
|
-
},
|
|
14
|
+
}, p = () => {
|
|
14
15
|
console.log("video player handled cb");
|
|
15
|
-
},
|
|
16
|
-
event:
|
|
16
|
+
}, I = ({
|
|
17
|
+
event: s
|
|
17
18
|
}) => {
|
|
18
|
-
const
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
}, [
|
|
19
|
+
const r = C();
|
|
20
|
+
return m(() => {
|
|
21
|
+
r && r.openFeature(12);
|
|
22
|
+
}, [r]), r ? /* @__PURE__ */ e(E, {
|
|
22
23
|
children: /* @__PURE__ */ e(S, {
|
|
23
|
-
sdk:
|
|
24
|
-
event:
|
|
24
|
+
sdk: r,
|
|
25
|
+
event: s,
|
|
25
26
|
onDeepLinkHandled: l
|
|
26
27
|
})
|
|
27
28
|
}) : null;
|
|
28
|
-
},
|
|
29
|
+
}, j = /* @__PURE__ */ d("div")({
|
|
29
30
|
name: "Container",
|
|
30
31
|
class: "c1a4qh28",
|
|
31
32
|
propsAsIs: !1
|
|
32
|
-
}),
|
|
33
|
+
}), T = /* @__PURE__ */ d("div")({
|
|
33
34
|
name: "Body",
|
|
34
35
|
class: "b9h8kuk",
|
|
35
36
|
propsAsIs: !1
|
|
36
|
-
}),
|
|
37
|
+
}), q = /* @__PURE__ */ d("div")({
|
|
37
38
|
name: "AppContainer",
|
|
38
39
|
class: "a1wkro2j",
|
|
39
40
|
propsAsIs: !1
|
|
40
|
-
}),
|
|
41
|
-
settings:
|
|
42
|
-
hideSdk:
|
|
43
|
-
hideLogin:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
}), Q = ({
|
|
42
|
+
settings: s,
|
|
43
|
+
hideSdk: r,
|
|
44
|
+
hideLogin: f,
|
|
45
|
+
promotionId: y,
|
|
46
|
+
hidePoints: v,
|
|
47
|
+
sidebar: h,
|
|
48
|
+
banner: b,
|
|
49
|
+
layoutMode: g
|
|
47
50
|
}) => {
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
const o = F(), a = A(), [w, c] = L(!1);
|
|
52
|
+
if (m(() => {
|
|
53
|
+
const n = () => {
|
|
54
|
+
window.orientation !== 0 ? (document.body.style.height = window.outerHeight + 50 + "px", document.body.style.overflow = "hidden", c(!0)) : (document.body.style.height = "auto", document.body.style.overflow = "auto", c(!1)), setTimeout(function() {
|
|
55
|
+
window.scrollTo(0, 0);
|
|
56
|
+
}, 1e3);
|
|
57
|
+
};
|
|
58
|
+
return t.isEnabled || window.addEventListener("orientationchange", n), () => {
|
|
59
|
+
t.isEnabled || window.removeEventListener("orientationchange", n);
|
|
60
|
+
};
|
|
61
|
+
}, []), s)
|
|
62
|
+
return /* @__PURE__ */ i(u, {
|
|
63
|
+
sdkKey: o.sdkKey,
|
|
64
|
+
production: o.env === "production",
|
|
53
65
|
autoEnable: !1,
|
|
54
66
|
onDeepLinkHandled: l,
|
|
55
|
-
videoPlayerController:
|
|
56
|
-
children: [/* @__PURE__ */ e(
|
|
57
|
-
...
|
|
67
|
+
videoPlayerController: p,
|
|
68
|
+
children: [/* @__PURE__ */ e(K, {}), /* @__PURE__ */ e(x, {
|
|
69
|
+
...o,
|
|
58
70
|
standalone: !0,
|
|
59
71
|
hideAuth: !0
|
|
60
72
|
})]
|
|
61
73
|
});
|
|
62
|
-
const
|
|
63
|
-
const n = a.current
|
|
64
|
-
|
|
74
|
+
const k = () => {
|
|
75
|
+
const n = a.current;
|
|
76
|
+
t.isEnabled || alert("Fullscreen is not supported in your browser, rotate your device to landscape mode"), t.isFullscreen ? t.exit() : t.request(n, {
|
|
77
|
+
navigationUI: "hide"
|
|
78
|
+
});
|
|
65
79
|
};
|
|
66
|
-
return /* @__PURE__ */
|
|
67
|
-
sdkKey:
|
|
68
|
-
production:
|
|
80
|
+
return /* @__PURE__ */ i(u, {
|
|
81
|
+
sdkKey: o.sdkKey,
|
|
82
|
+
production: o.env === "production",
|
|
69
83
|
autoEnable: !0,
|
|
70
84
|
onDeepLinkHandled: l,
|
|
71
|
-
videoPlayerController:
|
|
72
|
-
children: [/* @__PURE__ */
|
|
85
|
+
videoPlayerController: p,
|
|
86
|
+
children: [/* @__PURE__ */ i(T, {
|
|
73
87
|
ref: a,
|
|
74
|
-
children: [/* @__PURE__ */ e(
|
|
75
|
-
event:
|
|
76
|
-
hideLogin:
|
|
77
|
-
toggleFullscreen:
|
|
78
|
-
banner:
|
|
79
|
-
sidebar:
|
|
80
|
-
hidePoints:
|
|
81
|
-
|
|
82
|
-
|
|
88
|
+
children: [/* @__PURE__ */ e(D, {
|
|
89
|
+
event: o.event,
|
|
90
|
+
hideLogin: f,
|
|
91
|
+
toggleFullscreen: k,
|
|
92
|
+
banner: b,
|
|
93
|
+
sidebar: h,
|
|
94
|
+
hidePoints: v,
|
|
95
|
+
layoutMode: g,
|
|
96
|
+
promotionId: y,
|
|
97
|
+
fullscreen: w
|
|
98
|
+
}), !r && /* @__PURE__ */ e(j, {
|
|
99
|
+
children: /* @__PURE__ */ e(q, {
|
|
83
100
|
className: "StreamLayerSDK",
|
|
84
|
-
children: /* @__PURE__ */ e(
|
|
85
|
-
event:
|
|
101
|
+
children: /* @__PURE__ */ e(I, {
|
|
102
|
+
event: o.event
|
|
86
103
|
})
|
|
87
104
|
})
|
|
88
105
|
})]
|
|
89
|
-
}), /* @__PURE__ */ e(
|
|
90
|
-
event:
|
|
106
|
+
}), /* @__PURE__ */ e(P, {
|
|
107
|
+
event: o.event
|
|
91
108
|
})]
|
|
92
109
|
});
|
|
93
110
|
};
|
|
94
111
|
export {
|
|
95
|
-
|
|
112
|
+
Q as AppStory
|
|
96
113
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const PointsContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
2
|
+
export declare const VideoPlayerWrap: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
3
|
+
export declare const VideoFrame: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
4
|
+
export declare const LoginContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
5
|
+
export declare const FullscreenButton: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
|
|
6
|
+
export declare const AdvSidebar: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
7
|
+
export declare const AdvContent: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
8
|
+
export declare const AdvBanner: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
9
|
+
export declare const PromoButton: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { styled as s } from "@linaria/react";
|
|
2
|
+
const n = /* @__PURE__ */ s("div")({
|
|
3
|
+
name: "PointsContainer",
|
|
4
|
+
class: "p10yam33",
|
|
5
|
+
propsAsIs: !1
|
|
6
|
+
}), o = /* @__PURE__ */ s("div")({
|
|
7
|
+
name: "VideoPlayerWrap",
|
|
8
|
+
class: "v13be41a",
|
|
9
|
+
propsAsIs: !1
|
|
10
|
+
}), e = /* @__PURE__ */ s("div")({
|
|
11
|
+
name: "VideoFrame",
|
|
12
|
+
class: "v18d3gas",
|
|
13
|
+
propsAsIs: !1
|
|
14
|
+
}), t = /* @__PURE__ */ s("div")({
|
|
15
|
+
name: "LoginContainer",
|
|
16
|
+
class: "l1aq3x2u",
|
|
17
|
+
propsAsIs: !1
|
|
18
|
+
}), r = /* @__PURE__ */ s("button")({
|
|
19
|
+
name: "FullscreenButton",
|
|
20
|
+
class: "f6hlblg",
|
|
21
|
+
propsAsIs: !1
|
|
22
|
+
}), l = /* @__PURE__ */ s("div")({
|
|
23
|
+
name: "AdvSidebar",
|
|
24
|
+
class: "a1ir4g01",
|
|
25
|
+
propsAsIs: !1
|
|
26
|
+
}), p = /* @__PURE__ */ s("div")({
|
|
27
|
+
name: "AdvContent",
|
|
28
|
+
class: "aq35lm3",
|
|
29
|
+
propsAsIs: !1
|
|
30
|
+
}), i = /* @__PURE__ */ s("div")({
|
|
31
|
+
name: "AdvBanner",
|
|
32
|
+
class: "a1trv37l",
|
|
33
|
+
propsAsIs: !1
|
|
34
|
+
}), d = /* @__PURE__ */ s("button")({
|
|
35
|
+
name: "PromoButton",
|
|
36
|
+
class: "plx7e50",
|
|
37
|
+
propsAsIs: !1
|
|
38
|
+
});
|
|
39
|
+
export {
|
|
40
|
+
i as AdvBanner,
|
|
41
|
+
p as AdvContent,
|
|
42
|
+
l as AdvSidebar,
|
|
43
|
+
r as FullscreenButton,
|
|
44
|
+
t as LoginContainer,
|
|
45
|
+
n as PointsContainer,
|
|
46
|
+
d as PromoButton,
|
|
47
|
+
e as VideoFrame,
|
|
48
|
+
o as VideoPlayerWrap
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useResponsive: () => boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useState as s, useEffect as i } from "react";
|
|
2
|
+
const t = () => window.innerWidth < 768, c = () => {
|
|
3
|
+
const [e, r] = s(t());
|
|
4
|
+
return i(() => {
|
|
5
|
+
const n = () => {
|
|
6
|
+
r(t());
|
|
7
|
+
};
|
|
8
|
+
return window.addEventListener("resize", n), () => {
|
|
9
|
+
window.removeEventListener("resize", n);
|
|
10
|
+
};
|
|
11
|
+
}, []), e;
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
c as useResponsive
|
|
15
|
+
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
export declare const VideoPlayer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLVideoElement> & import('react').VideoHTMLAttributes<HTMLVideoElement> & Record<never, unknown>>;
|
|
2
1
|
export declare const Video: React.FC<{
|
|
3
2
|
sidebar: 'left' | 'right';
|
|
4
3
|
banner: 'top' | 'bottom';
|
|
4
|
+
layoutMode: 'cover' | 'side-by-side';
|
|
5
5
|
hidePoints?: boolean;
|
|
6
|
+
fullscreen?: boolean;
|
|
6
7
|
hideLogin?: boolean;
|
|
7
8
|
event?: string;
|
|
9
|
+
promotionId?: string;
|
|
8
10
|
}>;
|
|
@@ -1,96 +1,67 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}), V = /* @__PURE__ */ s("video")({
|
|
14
|
-
name: "VideoPlayer",
|
|
15
|
-
class: "v1jvtznw",
|
|
16
|
-
propsAsIs: !1
|
|
17
|
-
}), B = /* @__PURE__ */ s("div")({
|
|
18
|
-
name: "VideoFrame",
|
|
19
|
-
class: "v13gbl05",
|
|
20
|
-
propsAsIs: !1
|
|
21
|
-
}), I = /* @__PURE__ */ s("div")({
|
|
22
|
-
name: "LoginContainer",
|
|
23
|
-
class: "l65nrgs",
|
|
24
|
-
propsAsIs: !1
|
|
25
|
-
}), L = /* @__PURE__ */ s("button")({
|
|
26
|
-
name: "FullscreenButton",
|
|
27
|
-
class: "f1jxc34p",
|
|
28
|
-
propsAsIs: !1
|
|
29
|
-
}), b = /* @__PURE__ */ s("div")({
|
|
30
|
-
name: "AdvSidebar",
|
|
31
|
-
class: "ayq9x9m",
|
|
32
|
-
propsAsIs: !1
|
|
33
|
-
}), x = /* @__PURE__ */ s("div")({
|
|
34
|
-
name: "AdvBanner",
|
|
35
|
-
class: "am90851",
|
|
36
|
-
propsAsIs: !1
|
|
37
|
-
}), E = ({
|
|
38
|
-
toggleFullscreen: m,
|
|
39
|
-
hideLogin: c,
|
|
40
|
-
hidePoints: d,
|
|
41
|
-
sidebar: t,
|
|
42
|
-
banner: n,
|
|
43
|
-
event: a
|
|
44
|
-
}) => {
|
|
45
|
-
const e = g(), [p, f] = v(!1), r = y(({
|
|
46
|
-
muted: u
|
|
47
|
-
}) => {
|
|
48
|
-
f(u);
|
|
1
|
+
import { jsxs as m, Fragment as C, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as P, useCallback as L, useEffect as V } from "react";
|
|
3
|
+
import { useStreamLayer as b } from "@streamlayer/react";
|
|
4
|
+
import { StreamLayerSDKAdvertisement as s } from "../Advertisement/index.js";
|
|
5
|
+
import { StreamLayerSDKPoints as A } from "../Points/index.js";
|
|
6
|
+
import { StreamLayerThemeProvider as t } from "../../../ui/theme/index.js";
|
|
7
|
+
import { AppLogin as F } from "./login.js";
|
|
8
|
+
import { VideoFrame as w, PointsContainer as x, AdvSidebar as B, LoginContainer as j, VideoPlayerWrap as D, AdvBanner as K, PromoButton as R, FullscreenButton as T, AdvContent as E } from "./styles.js";
|
|
9
|
+
import { useResponsive as G } from "./useResponsive.js";
|
|
10
|
+
const Q = ({ toggleFullscreen: p, fullscreen: h, hideLogin: u, hidePoints: f, sidebar: i, banner: a, event: n, promotionId: c, layoutMode: o }) => {
|
|
11
|
+
const e = b(), [g, y] = P(!0), d = G(), l = L(({ muted: S }) => {
|
|
12
|
+
y(S);
|
|
49
13
|
}, []);
|
|
50
|
-
|
|
51
|
-
e == null || e.removeVideoPlayerController(
|
|
52
|
-
}), [e,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
sdk: e,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
14
|
+
V(() => (e == null || e.addVideoPlayerController(l), () => {
|
|
15
|
+
e == null || e.removeVideoPlayerController(l);
|
|
16
|
+
}), [e, l]);
|
|
17
|
+
const v = () => {
|
|
18
|
+
e == null || e.getFeature(12).background.advertisement.show(c, !0);
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ m(C, { children: [
|
|
21
|
+
/* @__PURE__ */ m(w, { "data-testid": "video-frame", style: h ? { position: "fixed", inset: 0 } : {}, children: [
|
|
22
|
+
e && /* @__PURE__ */ r(t, { children: !f && /* @__PURE__ */ r(x, { children: /* @__PURE__ */ r(A, { sdk: e }) }) }),
|
|
23
|
+
!d && /* @__PURE__ */ r(
|
|
24
|
+
B,
|
|
25
|
+
{
|
|
26
|
+
style: {
|
|
27
|
+
...o === "cover" ? { position: "absolute" } : {},
|
|
28
|
+
...i === "left" ? { left: 0 } : { right: 0, order: 3 }
|
|
29
|
+
},
|
|
30
|
+
children: e && /* @__PURE__ */ r(t, { children: /* @__PURE__ */ r(s, { event: n, sdk: e, sidebar: i, layoutMode: o }) })
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
!u && /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(F, {}) }),
|
|
34
|
+
/* @__PURE__ */ m(D, { children: [
|
|
35
|
+
/* @__PURE__ */ r(
|
|
36
|
+
"video",
|
|
37
|
+
{
|
|
38
|
+
src: "https://storage.googleapis.com/cdn.streamlayer.io/assets/sdk-web/Own%20The%20Game%201080p%20RF18.mp4",
|
|
39
|
+
muted: g,
|
|
40
|
+
width: "100%",
|
|
41
|
+
height: "100%",
|
|
42
|
+
autoplay: "autoplay",
|
|
43
|
+
loop: !0,
|
|
44
|
+
playsInline: !0,
|
|
45
|
+
playing: !0
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
/* @__PURE__ */ r(
|
|
49
|
+
K,
|
|
50
|
+
{
|
|
51
|
+
style: {
|
|
52
|
+
...o === "cover" ? { position: "absolute" } : {},
|
|
53
|
+
...a === "top" ? { top: 0, order: -1 } : { bottom: 0 }
|
|
54
|
+
},
|
|
55
|
+
children: e && /* @__PURE__ */ r(t, { children: /* @__PURE__ */ r(s, { event: n, sdk: e, banner: a, layoutMode: o }) })
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
] }),
|
|
59
|
+
c && /* @__PURE__ */ r(R, { onClick: v, children: "open promotion" }),
|
|
60
|
+
/* @__PURE__ */ r(T, { onClick: p, children: "fullscreen" })
|
|
61
|
+
] }),
|
|
62
|
+
d && /* @__PURE__ */ r(E, { children: e && /* @__PURE__ */ r(t, { children: /* @__PURE__ */ r(s, { event: n, sdk: e, sidebar: i, layoutMode: o }) }) })
|
|
63
|
+
] });
|
|
92
64
|
};
|
|
93
65
|
export {
|
|
94
|
-
|
|
95
|
-
V as VideoPlayer
|
|
66
|
+
Q as Video
|
|
96
67
|
};
|