@streamlayer/react-ui 1.24.0 → 1.25.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/promotion-notification/index.d.ts +7 -0
- package/lib/app/app/story/promotion-notification/index.js +44 -0
- package/lib/app/app/story/promotion-notification/styles.d.ts +4 -0
- package/lib/app/app/story/promotion-notification/styles.js +25 -0
- package/lib/app/app/story/promotion-notification/video.d.ts +5 -0
- package/lib/app/app/story/promotion-notification/video.js +52 -0
- package/lib/app/tvos/Advertisement.d.ts +10 -0
- package/lib/app/tvos/Advertisement.js +88 -0
- package/lib/app/tvos/AdvertisementUI.d.ts +16 -0
- package/lib/app/tvos/AdvertisementUI.js +40 -0
- package/lib/app/tvos/index.d.ts +16 -0
- package/lib/app/tvos/index.js +23 -0
- package/lib/app/tvos/story.d.ts +6 -0
- package/lib/app/tvos/story.js +34 -0
- package/lib/app/tvos/styles.d.ts +1 -0
- package/lib/app/tvos/styles.js +4 -0
- package/lib/app/tvos/ui/Layout/index.d.ts +21 -0
- package/lib/app/tvos/ui/Layout/index.js +76 -0
- package/lib/app/tvos/ui/Layout/styles.d.ts +11 -0
- package/lib/app/tvos/ui/Layout/styles.js +59 -0
- package/lib/app/tvos/ui/Sidebar/PromoAction.d.ts +2 -0
- package/lib/app/tvos/ui/Sidebar/PromoAction.js +62 -0
- package/lib/app/tvos/ui/Sidebar/index.d.ts +15 -0
- package/lib/app/tvos/ui/Sidebar/index.js +114 -0
- package/lib/app/tvos/ui/Sidebar/styles.d.ts +42 -0
- package/lib/app/tvos/ui/Sidebar/styles.js +1005 -0
- package/lib/assets/style.css +1 -1
- package/lib/ui/advertisement/index.js +44 -44
- package/lib/ui/advertisement/overlay/index.js +72 -70
- package/lib/ui/theme/theme.js +5 -3
- package/package.json +22 -16
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { styled as r } from "@linaria/react";
|
|
3
|
+
import { StreamLayerProvider as d } from "@streamlayer/react";
|
|
4
|
+
import { useStreamLayerDebug as a } from "../../../../utils/debug/index.js";
|
|
5
|
+
import { Video as p } from "./video.js";
|
|
6
|
+
const c = /* @__PURE__ */ r("div")({
|
|
7
|
+
name: "Body",
|
|
8
|
+
class: "b1ql7fnw",
|
|
9
|
+
propsAsIs: !1
|
|
10
|
+
}), l = /* @__PURE__ */ r("div")({
|
|
11
|
+
name: "Main",
|
|
12
|
+
class: "m18rqnzu",
|
|
13
|
+
propsAsIs: !1
|
|
14
|
+
}), h = ({
|
|
15
|
+
isMobileScreen: t,
|
|
16
|
+
promotionId: n,
|
|
17
|
+
sdkKey: s,
|
|
18
|
+
eventId: i,
|
|
19
|
+
production: m
|
|
20
|
+
}) => {
|
|
21
|
+
const e = a({
|
|
22
|
+
sdkKey: s,
|
|
23
|
+
eventId: i,
|
|
24
|
+
production: m
|
|
25
|
+
});
|
|
26
|
+
return /* @__PURE__ */ o(l, {
|
|
27
|
+
children: /* @__PURE__ */ o(d, {
|
|
28
|
+
sdkKey: e.sdkKey,
|
|
29
|
+
event: e.event,
|
|
30
|
+
production: e.env === "production",
|
|
31
|
+
autoEnable: !0,
|
|
32
|
+
children: /* @__PURE__ */ o(c, {
|
|
33
|
+
children: /* @__PURE__ */ o(p, {
|
|
34
|
+
event: e.event,
|
|
35
|
+
promotionId: n,
|
|
36
|
+
isMobileScreen: t
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
h as PromotionStory
|
|
44
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const VideoPlayerWrap: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
2
|
+
export declare const VideoFrame: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
3
|
+
export declare const AdvBanner: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
4
|
+
export declare const PromoButton: any;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { styled as s } from "@linaria/react";
|
|
2
|
+
import { Button as o } from "../../../../ui/button/index.js";
|
|
3
|
+
const n = /* @__PURE__ */ s("div")({
|
|
4
|
+
name: "VideoPlayerWrap",
|
|
5
|
+
class: "v1r07g6a",
|
|
6
|
+
propsAsIs: !1
|
|
7
|
+
}), t = /* @__PURE__ */ s("div")({
|
|
8
|
+
name: "VideoFrame",
|
|
9
|
+
class: "v12tn41r",
|
|
10
|
+
propsAsIs: !1
|
|
11
|
+
}), p = /* @__PURE__ */ s("div")({
|
|
12
|
+
name: "AdvBanner",
|
|
13
|
+
class: "anaa7x6",
|
|
14
|
+
propsAsIs: !1
|
|
15
|
+
}), a = () => o, d = /* @__PURE__ */ s(a())({
|
|
16
|
+
name: "PromoButton",
|
|
17
|
+
class: "pdzep3d",
|
|
18
|
+
propsAsIs: !0
|
|
19
|
+
});
|
|
20
|
+
export {
|
|
21
|
+
p as AdvBanner,
|
|
22
|
+
d as PromoButton,
|
|
23
|
+
t as VideoFrame,
|
|
24
|
+
n as VideoPlayerWrap
|
|
25
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsxs as a, Fragment as d, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as u, useState as h, useCallback as p, useEffect as f } from "react";
|
|
3
|
+
import { useStreamLayer as g } from "@streamlayer/react";
|
|
4
|
+
import { StreamLayerSDKAdvertisement as v } from "../../Advertisement/index.js";
|
|
5
|
+
import { StreamLayerThemeProvider as y } from "../../../../ui/theme/index.js";
|
|
6
|
+
import { PromoButton as P, VideoFrame as V, VideoPlayerWrap as S, AdvBanner as b } from "./styles.js";
|
|
7
|
+
const B = ({ isMobileScreen: l, event: m, promotionId: t }) => {
|
|
8
|
+
const e = g(), n = u(null), [s, c] = h(!1), i = p(({ muted: o }) => {
|
|
9
|
+
c(o);
|
|
10
|
+
}, []);
|
|
11
|
+
return f(() => (e == null || e.addVideoPlayerController(i), () => {
|
|
12
|
+
e == null || e.removeVideoPlayerController(i);
|
|
13
|
+
}), [e, i]), /* @__PURE__ */ a(d, { children: [
|
|
14
|
+
t && /* @__PURE__ */ a(P, { onClick: () => {
|
|
15
|
+
var o;
|
|
16
|
+
(o = n.current) == null || o.scrollIntoView({ behavior: "smooth" }), setTimeout(() => {
|
|
17
|
+
e == null || e.getFeature(12).background.advertisement.show(t);
|
|
18
|
+
}, 200);
|
|
19
|
+
}, children: [
|
|
20
|
+
"open promotion: ",
|
|
21
|
+
t
|
|
22
|
+
] }),
|
|
23
|
+
/* @__PURE__ */ r(V, { ref: n, "data-testid": "video-frame", children: /* @__PURE__ */ a(S, { children: [
|
|
24
|
+
/* @__PURE__ */ r("div", { className: "divAnchor", children: /* @__PURE__ */ r(
|
|
25
|
+
"video",
|
|
26
|
+
{
|
|
27
|
+
src: "https://storage.googleapis.com/gvabox/media/samples/stock.mp4",
|
|
28
|
+
muted: s,
|
|
29
|
+
width: "100%",
|
|
30
|
+
height: "100%",
|
|
31
|
+
autoplay: "autoplay",
|
|
32
|
+
loop: !0,
|
|
33
|
+
playsInline: !0,
|
|
34
|
+
controls: !0
|
|
35
|
+
}
|
|
36
|
+
) }),
|
|
37
|
+
/* @__PURE__ */ r(b, { children: e && /* @__PURE__ */ r(y, { children: /* @__PURE__ */ r(
|
|
38
|
+
v,
|
|
39
|
+
{
|
|
40
|
+
isMobileScreen: l,
|
|
41
|
+
event: m,
|
|
42
|
+
sdk: e,
|
|
43
|
+
notification: !0,
|
|
44
|
+
persistent: !0
|
|
45
|
+
}
|
|
46
|
+
) }) })
|
|
47
|
+
] }) })
|
|
48
|
+
] });
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
B as Video
|
|
52
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
2
|
+
export type StreamLayerSDKAdvertisementProps = {
|
|
3
|
+
persistent?: boolean;
|
|
4
|
+
sidebar?: 'left' | 'right';
|
|
5
|
+
banner?: 'top' | 'bottom';
|
|
6
|
+
skipAutoClose?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const StreamLayerSDKAdvertisementTVOs: React.FC<StreamLayerSDKAdvertisementProps & {
|
|
9
|
+
sdk: StreamLayerSDK;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { cx as c } from "@linaria/core";
|
|
3
|
+
import { styled as p } from "@linaria/react";
|
|
4
|
+
import { useAnalyticsListener as f } from "../../hooks/analytics.js";
|
|
5
|
+
import { useRef as v } from "react";
|
|
6
|
+
import { useStore as l } from "@streamlayer/react-polyfills";
|
|
7
|
+
import { eventBus as d } from "@streamlayer/sdk-web-interfaces";
|
|
8
|
+
import { FeatureType as A, PromotionType as y } from "@streamlayer/sdk-web-types";
|
|
9
|
+
import { AdvertisementUI as g } from "./AdvertisementUI.js";
|
|
10
|
+
const S = /* @__PURE__ */ p("div")({
|
|
11
|
+
name: "AdvertisementUIWrap",
|
|
12
|
+
class: "a3844y1",
|
|
13
|
+
propsAsIs: !1
|
|
14
|
+
}), b = (t) => {
|
|
15
|
+
const e = t.target;
|
|
16
|
+
if (e instanceof HTMLAnchorElement && e.target === "_blank") {
|
|
17
|
+
const r = e.getAttribute("data-promo-id") || "", o = e.getAttribute("data-promo-type") || y.UNSET;
|
|
18
|
+
e.getAttribute("data-a") === "button" && d.emit("advertisement", {
|
|
19
|
+
action: "buttonSelect",
|
|
20
|
+
payload: {
|
|
21
|
+
id: r,
|
|
22
|
+
type: o
|
|
23
|
+
}
|
|
24
|
+
}), e.getAttribute("data-a") === "banner" && d.emit("advertisement", {
|
|
25
|
+
action: "bannerSelect",
|
|
26
|
+
payload: {
|
|
27
|
+
id: r,
|
|
28
|
+
type: o
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}, L = ({
|
|
33
|
+
gamification: t,
|
|
34
|
+
skipAutoClose: e,
|
|
35
|
+
sidebar: r,
|
|
36
|
+
banner: o,
|
|
37
|
+
persistent: s,
|
|
38
|
+
controlVideo: m
|
|
39
|
+
}) => {
|
|
40
|
+
const n = v(null), a = l(t.advertisement.$store);
|
|
41
|
+
f(n, {
|
|
42
|
+
enabled: !!a.data,
|
|
43
|
+
event: "click",
|
|
44
|
+
listener: b
|
|
45
|
+
});
|
|
46
|
+
const u = !o && !r;
|
|
47
|
+
return a.data === void 0 || !s && a.isViewed ? null : /* @__PURE__ */ i(S, {
|
|
48
|
+
ref: n,
|
|
49
|
+
style: {
|
|
50
|
+
height: u ? "auto" : "100%"
|
|
51
|
+
},
|
|
52
|
+
className: c("SL-AdvertisementUIWrap", "SL-AdvertisementUIWrap--lower-third"),
|
|
53
|
+
children: /* @__PURE__ */ i(g, {
|
|
54
|
+
sidebar: r,
|
|
55
|
+
banner: o,
|
|
56
|
+
advertisement: a.data,
|
|
57
|
+
advertisementPaused: !!a.isPaused,
|
|
58
|
+
togglePause: a.togglePause || (() => {
|
|
59
|
+
}),
|
|
60
|
+
close: a.close,
|
|
61
|
+
markAsViewed: t.advertisement.markAsViewed,
|
|
62
|
+
open: t.advertisement.open,
|
|
63
|
+
skipAutoClose: e,
|
|
64
|
+
controlVideo: m
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
}, E = ({
|
|
68
|
+
sdk: t,
|
|
69
|
+
sidebar: e,
|
|
70
|
+
banner: r,
|
|
71
|
+
skipAutoClose: o,
|
|
72
|
+
persistent: s
|
|
73
|
+
}) => {
|
|
74
|
+
if (!l(t.featuresList.getStore()))
|
|
75
|
+
return null;
|
|
76
|
+
const n = t.getFeature(A.GAMES);
|
|
77
|
+
return n ? /* @__PURE__ */ i(L, {
|
|
78
|
+
gamification: n,
|
|
79
|
+
sidebar: e,
|
|
80
|
+
banner: r,
|
|
81
|
+
persistent: s,
|
|
82
|
+
skipAutoClose: o,
|
|
83
|
+
controlVideo: t.controlVideoPlayer
|
|
84
|
+
}) : null;
|
|
85
|
+
};
|
|
86
|
+
export {
|
|
87
|
+
E as StreamLayerSDKAdvertisementTVOs
|
|
88
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Advertisement } from '@streamlayer/feature-gamification';
|
|
2
|
+
import { ControlVideoCb } from '../../ui/video-player';
|
|
3
|
+
export declare const AdvertisementUI: React.FC<{
|
|
4
|
+
advertisement: Exclude<Advertisement['data'], undefined>;
|
|
5
|
+
sidebar?: 'left' | 'right';
|
|
6
|
+
banner?: 'top' | 'bottom';
|
|
7
|
+
open?: (options?: {
|
|
8
|
+
fromNotification?: boolean;
|
|
9
|
+
}) => void;
|
|
10
|
+
close?: () => void;
|
|
11
|
+
markAsViewed?: () => void;
|
|
12
|
+
skipAutoClose?: boolean;
|
|
13
|
+
controlVideo: ControlVideoCb;
|
|
14
|
+
advertisementPaused: boolean;
|
|
15
|
+
togglePause: (flag: boolean) => void;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Banner as u } from "../../ui/advertisement/banner/index.js";
|
|
3
|
+
import { Sidebar as c } from "../../ui/advertisement/sidebar/index.js";
|
|
4
|
+
import { TVSidebar as s } from "./ui/Sidebar/index.js";
|
|
5
|
+
const g = ({
|
|
6
|
+
advertisement: o,
|
|
7
|
+
close: t,
|
|
8
|
+
skipAutoClose: m,
|
|
9
|
+
sidebar: i,
|
|
10
|
+
banner: n,
|
|
11
|
+
markAsViewed: p,
|
|
12
|
+
open: f,
|
|
13
|
+
controlVideo: l,
|
|
14
|
+
advertisementPaused: d,
|
|
15
|
+
togglePause: e
|
|
16
|
+
}) => o.promotion ? i ? /* @__PURE__ */ r(c, { className: "PromoSidebarContainer", direction: i, hiding: !1, children: /* @__PURE__ */ r(
|
|
17
|
+
s,
|
|
18
|
+
{
|
|
19
|
+
markAsViewed: p,
|
|
20
|
+
promotionId: o.question.id,
|
|
21
|
+
promotion: o.promotion,
|
|
22
|
+
onClose: t,
|
|
23
|
+
open: f,
|
|
24
|
+
controlVideo: l,
|
|
25
|
+
skipAutoClose: m,
|
|
26
|
+
advertisementPaused: d,
|
|
27
|
+
togglePause: e
|
|
28
|
+
}
|
|
29
|
+
) }) : n ? /* @__PURE__ */ r(
|
|
30
|
+
u,
|
|
31
|
+
{
|
|
32
|
+
promotionId: o.question.id,
|
|
33
|
+
hiding: !1,
|
|
34
|
+
promotion: o.promotion,
|
|
35
|
+
direction: n
|
|
36
|
+
}
|
|
37
|
+
) : null : null;
|
|
38
|
+
export {
|
|
39
|
+
g as AdvertisementUI
|
|
40
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
2
|
+
export declare const StreamLayerSDKTv: React.FC<{
|
|
3
|
+
persistent?: boolean;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
sdk: StreamLayerSDK;
|
|
6
|
+
uiState: {
|
|
7
|
+
promotionExternalAd?: boolean;
|
|
8
|
+
promotionSidebar?: boolean;
|
|
9
|
+
promotionOverlay?: boolean;
|
|
10
|
+
promotionNotification?: boolean;
|
|
11
|
+
promotionBanner?: boolean;
|
|
12
|
+
app?: boolean;
|
|
13
|
+
appNotification?: boolean;
|
|
14
|
+
onboardingNotification?: boolean;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useStore as n } from "@streamlayer/react-polyfills";
|
|
3
|
+
import { FeatureType as u } from "@streamlayer/sdk-web-types";
|
|
4
|
+
import { StreamLayerSDKAdvertisementTVOs as a } from "./Advertisement.js";
|
|
5
|
+
import { SDKLayout as f } from "./ui/Layout/index.js";
|
|
6
|
+
const l = ({ persistent: t, children: i, sdk: r, uiState: m }) => {
|
|
7
|
+
if (!n(r.featuresList.getStore()))
|
|
8
|
+
return null;
|
|
9
|
+
const o = r.getFeature(u.GAMES);
|
|
10
|
+
return o ? /* @__PURE__ */ e(
|
|
11
|
+
f,
|
|
12
|
+
{
|
|
13
|
+
gamification: o,
|
|
14
|
+
sidebar: /* @__PURE__ */ e(a, { sdk: r, persistent: t, sidebar: "right" }),
|
|
15
|
+
banner: /* @__PURE__ */ e(a, { sdk: r, persistent: t, banner: "bottom" }),
|
|
16
|
+
video: i,
|
|
17
|
+
uiState: m
|
|
18
|
+
}
|
|
19
|
+
) : null;
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
l as StreamLayerSDKTv
|
|
23
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { StreamLayerProvider as n, useStreamLayer as u, useStreamLayerUI as i } from "@streamlayer/react";
|
|
3
|
+
import { useStreamLayerDebug as m } from "../../utils/debug/index.js";
|
|
4
|
+
import { StreamLayerSDKTv as d } from "./index.js";
|
|
5
|
+
const p = ({ persistent: t }) => {
|
|
6
|
+
const e = u(), o = i();
|
|
7
|
+
return e ? /* @__PURE__ */ r(d, { sdk: e, persistent: t, uiState: o, children: /* @__PURE__ */ r(
|
|
8
|
+
"video",
|
|
9
|
+
{
|
|
10
|
+
src: "https://storage.googleapis.com/cdn.streamlayer.io/assets/sdk-web/Own%20The%20Game%201080p%20RF18.mp4",
|
|
11
|
+
style: { width: "100%", height: "100%", borderRadius: 10 },
|
|
12
|
+
autoPlay: !0,
|
|
13
|
+
loop: !0,
|
|
14
|
+
playsInline: !0,
|
|
15
|
+
controls: !0
|
|
16
|
+
}
|
|
17
|
+
) }) : null;
|
|
18
|
+
}, S = ({ sdkKey: t, eventId: e, persistent: o, production: a }) => {
|
|
19
|
+
const s = m({ sdkKey: t, eventId: e, production: a });
|
|
20
|
+
return /* @__PURE__ */ r(
|
|
21
|
+
n,
|
|
22
|
+
{
|
|
23
|
+
event: s.event,
|
|
24
|
+
sdkKey: s.sdkKey,
|
|
25
|
+
production: s.env === "production",
|
|
26
|
+
autoEnable: !0,
|
|
27
|
+
withAd: !0,
|
|
28
|
+
children: /* @__PURE__ */ r(p, { persistent: o })
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
S as TVOsStory
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const customTheme: import('@linaria/core').LinariaClassName;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Gamification } from '@streamlayer/feature-gamification';
|
|
2
|
+
type SDKLayoutProps = {
|
|
3
|
+
gamification: Gamification & {
|
|
4
|
+
advertisement: Exclude<Gamification['advertisement'], undefined>;
|
|
5
|
+
};
|
|
6
|
+
sidebar?: React.ReactElement;
|
|
7
|
+
banner?: React.ReactNode;
|
|
8
|
+
video?: React.ReactNode;
|
|
9
|
+
uiState: {
|
|
10
|
+
promotionExternalAd?: boolean;
|
|
11
|
+
promotionSidebar?: boolean;
|
|
12
|
+
promotionOverlay?: boolean;
|
|
13
|
+
promotionNotification?: boolean;
|
|
14
|
+
promotionBanner?: boolean;
|
|
15
|
+
app?: boolean;
|
|
16
|
+
appNotification?: boolean;
|
|
17
|
+
onboardingNotification?: boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare const SDKLayout: React.FC<SDKLayoutProps>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsxs as d, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as f, useCallback as x, useEffect as g } from "react";
|
|
3
|
+
import { useStore as N } from "@streamlayer/react-polyfills";
|
|
4
|
+
import { Container as R, ContentContainer as S, VideoContainer as V, AdContainer as k, AdLabel as z, VideoBox as A, VideoPlayer as E, Banner as L, Sidebar as j } from "./styles.js";
|
|
5
|
+
const D = ({ gamification: b, sidebar: p, banner: y, video: C, uiState: l }) => {
|
|
6
|
+
var m, u;
|
|
7
|
+
const i = N(b.advertisement.$store), n = f(null), h = f(null), o = x(() => {
|
|
8
|
+
const e = h.current, r = n.current;
|
|
9
|
+
if (!e || !r)
|
|
10
|
+
return;
|
|
11
|
+
const { width: c, height: B } = e.getBoundingClientRect(), { width: v, height: w } = r.getBoundingClientRect();
|
|
12
|
+
(c > v || B > w) && (e.style.width === "100%" ? (e.style.height = "100%", e.style.width = "auto") : (e.style.width = "100%", e.style.height = "auto"));
|
|
13
|
+
}, []);
|
|
14
|
+
g(() => {
|
|
15
|
+
if (n.current) {
|
|
16
|
+
const e = new ResizeObserver((r) => {
|
|
17
|
+
for (const c of r)
|
|
18
|
+
c.contentBoxSize && o();
|
|
19
|
+
});
|
|
20
|
+
return e.observe(n.current), () => {
|
|
21
|
+
e.disconnect();
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return () => {
|
|
25
|
+
};
|
|
26
|
+
}, [o]), g(o);
|
|
27
|
+
const a = l.promotionSidebar, s = l.promotionBanner;
|
|
28
|
+
return /* @__PURE__ */ d(
|
|
29
|
+
R,
|
|
30
|
+
{
|
|
31
|
+
style: { backgroundImage: `url(${(u = (m = i == null ? void 0 : i.data) == null ? void 0 : m.promotion) == null ? void 0 : u.backgroundImageLandscapeUrl})` },
|
|
32
|
+
className: "Container",
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ d(
|
|
35
|
+
S,
|
|
36
|
+
{
|
|
37
|
+
className: "ContentContainer",
|
|
38
|
+
style: {
|
|
39
|
+
width: a ? "calc(100% - var(--sidebar-width))" : "100%"
|
|
40
|
+
},
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ d(
|
|
43
|
+
V,
|
|
44
|
+
{
|
|
45
|
+
className: "VideoContainer",
|
|
46
|
+
ref: n,
|
|
47
|
+
style: {
|
|
48
|
+
height: s ? "calc(100% - var(--banner-height))" : "100%"
|
|
49
|
+
},
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ t(k, { children: /* @__PURE__ */ t(z, { children: "Ad" }) }),
|
|
52
|
+
/* @__PURE__ */ t(A, { ref: h, className: "VideoBox", children: /* @__PURE__ */ t(E, { className: "VideoPlayer", children: C }) })
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
/* @__PURE__ */ t(
|
|
57
|
+
L,
|
|
58
|
+
{
|
|
59
|
+
className: "Banner",
|
|
60
|
+
style: {
|
|
61
|
+
height: s ? "var(--banner-height)" : "0px"
|
|
62
|
+
},
|
|
63
|
+
children: s && y
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ t(j, { style: { width: a ? "var(--sidebar-width)" : "0px" }, className: "Sidebar", children: a && p })
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
export {
|
|
75
|
+
D as SDKLayout
|
|
76
|
+
};
|
|
@@ -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 ContentContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
3
|
+
export declare const Sidebar: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
4
|
+
export declare const Banner: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
5
|
+
export declare const VideoContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
6
|
+
export declare const AdSquare: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
7
|
+
export declare const AdText: import('@linaria/react').StyledComponent<import('react').SVGTextElementAttributes<SVGTextElement> & Record<never, unknown>>;
|
|
8
|
+
export declare const VideoBox: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
9
|
+
export declare const VideoPlayer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
10
|
+
export declare const AdContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
11
|
+
export declare const AdLabel: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLSpanElement> & import('react').HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { styled as s } from "@linaria/react";
|
|
2
|
+
const a = /* @__PURE__ */ s("div")({
|
|
3
|
+
name: "Container",
|
|
4
|
+
class: "cheo2r6",
|
|
5
|
+
propsAsIs: !1
|
|
6
|
+
}), n = /* @__PURE__ */ s("div")({
|
|
7
|
+
name: "ContentContainer",
|
|
8
|
+
class: "c1pvfh8e",
|
|
9
|
+
propsAsIs: !1
|
|
10
|
+
}), o = /* @__PURE__ */ s("div")({
|
|
11
|
+
name: "Sidebar",
|
|
12
|
+
class: "s1ew4id0",
|
|
13
|
+
propsAsIs: !1
|
|
14
|
+
}), r = /* @__PURE__ */ s("div")({
|
|
15
|
+
name: "Banner",
|
|
16
|
+
class: "bci5mwc",
|
|
17
|
+
propsAsIs: !1
|
|
18
|
+
}), t = /* @__PURE__ */ s("div")({
|
|
19
|
+
name: "VideoContainer",
|
|
20
|
+
class: "v1y91bzn",
|
|
21
|
+
propsAsIs: !1
|
|
22
|
+
}), d = /* @__PURE__ */ s("div")({
|
|
23
|
+
name: "AdSquare",
|
|
24
|
+
class: "ak4hw4m",
|
|
25
|
+
propsAsIs: !1
|
|
26
|
+
}), i = /* @__PURE__ */ s("text")({
|
|
27
|
+
name: "AdText",
|
|
28
|
+
class: "a7w4ued",
|
|
29
|
+
propsAsIs: !0
|
|
30
|
+
}), c = /* @__PURE__ */ s("div")({
|
|
31
|
+
name: "VideoBox",
|
|
32
|
+
class: "vqmlsjk",
|
|
33
|
+
propsAsIs: !1
|
|
34
|
+
}), l = /* @__PURE__ */ s("div")({
|
|
35
|
+
name: "VideoPlayer",
|
|
36
|
+
class: "vyn4uy0",
|
|
37
|
+
propsAsIs: !1
|
|
38
|
+
}), p = /* @__PURE__ */ s("div")({
|
|
39
|
+
name: "AdContainer",
|
|
40
|
+
class: "a9sufrb",
|
|
41
|
+
propsAsIs: !1
|
|
42
|
+
}), A = /* @__PURE__ */ s("span")({
|
|
43
|
+
name: "AdLabel",
|
|
44
|
+
class: "acv3bdg",
|
|
45
|
+
propsAsIs: !1
|
|
46
|
+
});
|
|
47
|
+
export {
|
|
48
|
+
p as AdContainer,
|
|
49
|
+
A as AdLabel,
|
|
50
|
+
d as AdSquare,
|
|
51
|
+
i as AdText,
|
|
52
|
+
r as Banner,
|
|
53
|
+
a as Container,
|
|
54
|
+
n as ContentContainer,
|
|
55
|
+
o as Sidebar,
|
|
56
|
+
c as VideoBox,
|
|
57
|
+
t as VideoContainer,
|
|
58
|
+
l as VideoPlayer
|
|
59
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export declare const PromoAction: React.ForwardRefExoticComponent<Omit<import('@streamlayer/sdk-web-types').RecursiveOmitHelper<import('@streamlayer/sl-eslib/interactive/interactive.common_pb').QuestionOptions_PromotionOptions, "$typeName">, "$typeName"> & React.RefAttributes<HTMLDivElement | HTMLAnchorElement>>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsxs as c, jsx as n, Fragment as D } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as S } from "react";
|
|
3
|
+
import { QRBlock as t, QR as d, QRDescBlock as u, LearnMore as E, QRHint as A, SendToUserButton as O, EnvelopeIcon as f, SendToUserText as x } from "./styles.js";
|
|
4
|
+
const B = S(({ promotion: e }, r) => {
|
|
5
|
+
var R, C, s, T, N, i, I;
|
|
6
|
+
const l = e.buttonType, b = e.coupon, a = (R = e.banner) == null ? void 0 : R.url, h = e.type;
|
|
7
|
+
return l === 1 ? /* @__PURE__ */ c(t, { children: [
|
|
8
|
+
/* @__PURE__ */ n(d, { value: a, ref: r, tabIndex: 1 }),
|
|
9
|
+
/* @__PURE__ */ c(u, { children: [
|
|
10
|
+
/* @__PURE__ */ n(E, { children: "LEARN MORE" }),
|
|
11
|
+
/* @__PURE__ */ n(A, { children: "SCAN QR CODE WITH YOUR PHONE CAMERA" })
|
|
12
|
+
] })
|
|
13
|
+
] }) : l === 3 ? /* @__PURE__ */ c(t, { children: [
|
|
14
|
+
/* @__PURE__ */ n(d, { value: b, ref: r }),
|
|
15
|
+
/* @__PURE__ */ c(u, { children: [
|
|
16
|
+
/* @__PURE__ */ n(E, { style: { fontSize: 18, fontWeight: 400 }, children: "ADD TO APPLE WALLET" }),
|
|
17
|
+
/* @__PURE__ */ n(A, { style: { fontSize: 17 }, children: "SCAN QR CODE WITH YOUR PHONE CAMERA" })
|
|
18
|
+
] })
|
|
19
|
+
] }) : l === 6 && h !== 4 ? /* @__PURE__ */ c(D, { children: [
|
|
20
|
+
/* @__PURE__ */ c(
|
|
21
|
+
O,
|
|
22
|
+
{
|
|
23
|
+
ref: r,
|
|
24
|
+
tabIndex: 1,
|
|
25
|
+
focusColor: (s = (C = e == null ? void 0 : e.banner) == null ? void 0 : C.ctaButton) == null ? void 0 : s.color,
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ n(f, {}),
|
|
28
|
+
"SEND INFO TO ACCOUNT EMAIL"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
/* @__PURE__ */ c(t, { children: [
|
|
33
|
+
/* @__PURE__ */ n(d, { value: a }),
|
|
34
|
+
/* @__PURE__ */ c(u, { children: [
|
|
35
|
+
/* @__PURE__ */ n(E, { children: "LEARN MORE" }),
|
|
36
|
+
/* @__PURE__ */ n(A, { children: "SCAN QR CODE WITH YOUR PHONE CAMERA" })
|
|
37
|
+
] })
|
|
38
|
+
] })
|
|
39
|
+
] }) : l === 6 && h === 4 ? /* @__PURE__ */ c(
|
|
40
|
+
O,
|
|
41
|
+
{
|
|
42
|
+
ref: r,
|
|
43
|
+
tabIndex: 1,
|
|
44
|
+
focusColor: (N = (T = e == null ? void 0 : e.banner) == null ? void 0 : T.ctaButton) == null ? void 0 : N.color,
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ n(f, {}),
|
|
47
|
+
/* @__PURE__ */ n(x, { children: "SEND INFO TO ACCOUNT EMAIL" })
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
) : l === 4 ? /* @__PURE__ */ n(
|
|
51
|
+
O,
|
|
52
|
+
{
|
|
53
|
+
ref: r,
|
|
54
|
+
tabIndex: 1,
|
|
55
|
+
focusColor: (I = (i = e == null ? void 0 : e.banner) == null ? void 0 : i.ctaButton) == null ? void 0 : I.color,
|
|
56
|
+
children: "BACK TO VIDEO"
|
|
57
|
+
}
|
|
58
|
+
) : null;
|
|
59
|
+
});
|
|
60
|
+
export {
|
|
61
|
+
B as PromoAction
|
|
62
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PromotionOptions } from '@streamlayer/sdk-web-types';
|
|
2
|
+
import { ControlVideoCb } from '../../../../ui/video-player';
|
|
3
|
+
export type OverlayProps = {
|
|
4
|
+
promotionId: string;
|
|
5
|
+
open?: () => void;
|
|
6
|
+
promotion: PromotionOptions;
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
markAsViewed?: () => void;
|
|
9
|
+
skipAutoClose?: boolean;
|
|
10
|
+
inSidebar?: boolean;
|
|
11
|
+
controlVideo: ControlVideoCb;
|
|
12
|
+
advertisementPaused: boolean;
|
|
13
|
+
togglePause: (flag: boolean) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare const TVSidebar: React.FC<OverlayProps>;
|