@streamlayer/react-ui 1.11.4 → 1.12.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 +1 -0
- package/lib/app/app/Advertisement/index.js +86 -67
- package/lib/app/app/Features/Gamification/Tabs.js +13 -13
- package/lib/app/app/Navigation/index.js +70 -64
- package/lib/app/app/Notifications/Onboarding/index.js +66 -72
- package/lib/app/app/Notifications/index.d.ts +1 -0
- package/lib/app/app/Notifications/index.js +76 -72
- package/lib/app/app/index.js +28 -27
- package/lib/app/app/story/index.d.ts +3 -1
- package/lib/app/app/story/index.js +29 -26
- package/lib/app/app/story/promotion/video.js +34 -34
- package/lib/app/app/styles.d.ts +5 -0
- package/lib/app/app/styles.js +25 -20
- package/lib/assets/style.css +1 -1
- package/lib/ui/advertisement/index.d.ts +3 -0
- package/lib/ui/advertisement/index.js +25 -19
- package/lib/ui/advertisement/mock.d.ts +1 -0
- package/lib/ui/advertisement/mock.js +39 -5
- package/lib/ui/advertisement/overlay/externalAd/controls.d.ts +5 -0
- package/lib/ui/advertisement/overlay/externalAd/controls.js +33 -0
- package/lib/ui/advertisement/overlay/externalAd/index.d.ts +2 -0
- package/lib/ui/advertisement/overlay/externalAd/index.js +121 -0
- package/lib/ui/advertisement/overlay/index.d.ts +7 -2
- package/lib/ui/advertisement/overlay/index.js +67 -58
- package/lib/ui/close-btn/index.d.ts +1 -0
- package/lib/ui/close-btn/index.js +25 -23
- package/lib/ui/gamification/question/insight/styles.d.ts +10 -2
- package/lib/ui/gamification/question/insight/styles.js +8 -7
- package/lib/ui/gamification/question/notification/prediction-result/index.js +84 -64
- package/lib/ui/gamification/question/notification/prediction-result/styles.d.ts +2 -0
- package/lib/ui/gamification/question/notification/prediction-result/styles.js +36 -26
- package/lib/ui/gamification/question/twitter/styles.d.ts +5 -1
- package/lib/ui/gamification/question/twitter/styles.js +9 -8
- package/lib/ui/gamification/vote/alert/index.js +7 -8
- package/lib/ui/gamification/vote/alert/styles.d.ts +1 -0
- package/lib/ui/gamification/vote/alert/styles.js +12 -6
- package/lib/ui/gamification/vote/vote-option/index.js +59 -58
- package/lib/ui/icons/index.d.ts +1 -0
- package/lib/ui/icons/index.js +45 -44
- package/lib/ui/skeleton/index.d.ts +1 -1
- package/lib/ui/theme/constants.d.ts +32 -1
- package/lib/ui/theme/constants.js +50 -17
- package/lib/ui/theme/masters-theme.js +9 -4
- package/lib/ui/theme/theme.js +16 -9
- package/lib/ui/video-player/index.d.ts +2 -0
- package/lib/ui/video-player/index.js +57 -56
- package/package.json +14 -14
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Advertisement } from '@streamlayer/feature-gamification';
|
|
2
|
+
import { ControlVideoCb } from '../video-player';
|
|
2
3
|
export declare const AdvertisementUI: React.FC<{
|
|
3
4
|
advertisement: Exclude<Advertisement['data'], undefined>;
|
|
4
5
|
layoutMode?: 'cover' | 'side-by-side';
|
|
@@ -10,4 +11,6 @@ export declare const AdvertisementUI: React.FC<{
|
|
|
10
11
|
isNotification?: boolean;
|
|
11
12
|
skipTypeCheck?: boolean;
|
|
12
13
|
skipAutoClose?: boolean;
|
|
14
|
+
externalAd?: Advertisement['externalAd'];
|
|
15
|
+
controlVideo: ControlVideoCb;
|
|
13
16
|
}>;
|
|
@@ -1,41 +1,47 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { PromotionType as r } from "@streamlayer/sdk-web-types";
|
|
3
|
-
import { Banner as
|
|
4
|
-
import { Notification as
|
|
5
|
-
import { Overlay as
|
|
6
|
-
import { Sidebar as
|
|
7
|
-
import { OverlayContainer as
|
|
8
|
-
const
|
|
3
|
+
import { Banner as _ } from "./banner/index.js";
|
|
4
|
+
import { Notification as a } from "./notification/index.js";
|
|
5
|
+
import { Overlay as A } from "./overlay/index.js";
|
|
6
|
+
import { Sidebar as M } from "./sidebar/index.js";
|
|
7
|
+
import { OverlayContainer as d } from "./overlay/styles.js";
|
|
8
|
+
const p = (i) => (i == null ? void 0 : i.type) === r.INGAME_IAB11_LBAR || (i == null ? void 0 : i.type) === r.INGAME_IAB21_LBAR, q = (i) => (i == null ? void 0 : i.type) === r.INGAME_IAB11 || (i == null ? void 0 : i.type) === r.INGAME_IAB21, P = ({
|
|
9
9
|
advertisement: i,
|
|
10
10
|
close: t,
|
|
11
|
-
skipTypeCheck:
|
|
12
|
-
skipAutoClose:
|
|
13
|
-
layoutMode:
|
|
11
|
+
skipTypeCheck: u,
|
|
12
|
+
skipAutoClose: l,
|
|
13
|
+
layoutMode: E = "side-by-side",
|
|
14
14
|
sidebar: n,
|
|
15
|
-
isNotification:
|
|
15
|
+
isNotification: B,
|
|
16
16
|
banner: f,
|
|
17
17
|
markAsViewed: I,
|
|
18
|
-
open:
|
|
19
|
-
|
|
20
|
-
c
|
|
18
|
+
open: N,
|
|
19
|
+
externalAd: y,
|
|
20
|
+
controlVideo: c
|
|
21
|
+
}) => i.promotion ? B && i.notification ? /* @__PURE__ */ o(a, { open: N, notification: i.notification, promotionId: i.question.id }) : !n && !f && (u || q(i.promotion)) ? /* @__PURE__ */ o(d, { className: "PromoOverlayContainer", children: /* @__PURE__ */ o(
|
|
22
|
+
A,
|
|
21
23
|
{
|
|
22
24
|
markAsViewed: I,
|
|
23
25
|
promotionId: i.question.id,
|
|
24
26
|
promotion: i.promotion,
|
|
25
27
|
onClose: t,
|
|
26
|
-
skipAutoClose:
|
|
28
|
+
skipAutoClose: l,
|
|
29
|
+
externalAd: y,
|
|
30
|
+
controlVideo: c
|
|
27
31
|
}
|
|
28
|
-
) }) : n && (
|
|
29
|
-
|
|
32
|
+
) }) : n && (u || p(i.promotion)) ? /* @__PURE__ */ o(M, { className: "PromoSidebarContainer", direction: n, hiding: !1, children: /* @__PURE__ */ o(
|
|
33
|
+
A,
|
|
30
34
|
{
|
|
31
35
|
markAsViewed: I,
|
|
32
36
|
promotionId: i.question.id,
|
|
33
37
|
promotion: i.promotion,
|
|
38
|
+
externalAd: y,
|
|
34
39
|
onClose: t,
|
|
35
|
-
|
|
40
|
+
controlVideo: c,
|
|
41
|
+
skipAutoClose: l
|
|
36
42
|
}
|
|
37
43
|
) }) : f ? /* @__PURE__ */ o(
|
|
38
|
-
|
|
44
|
+
_,
|
|
39
45
|
{
|
|
40
46
|
promotionId: i.question.id,
|
|
41
47
|
hiding: !1,
|
|
@@ -44,5 +50,5 @@ const _ = (i) => (i == null ? void 0 : i.type) === r.INGAME_IAB11_LBAR || (i ==
|
|
|
44
50
|
}
|
|
45
51
|
) : null : null;
|
|
46
52
|
export {
|
|
47
|
-
|
|
53
|
+
P as AdvertisementUI
|
|
48
54
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PromotionType as
|
|
1
|
+
import { PromotionType as e, PromotionWallet as o, PromotionLogoMode as a, CtaIconMode as c } from "@streamlayer/sdk-web-types";
|
|
2
2
|
const d = {
|
|
3
|
-
type:
|
|
4
|
-
enableWallet:
|
|
3
|
+
type: e.INGAME_IAB21_LBAR,
|
|
4
|
+
enableWallet: o.DISABLED,
|
|
5
5
|
coupon: "",
|
|
6
6
|
logoMode: a.LEFT,
|
|
7
7
|
couponZip: "",
|
|
@@ -28,8 +28,41 @@ const d = {
|
|
|
28
28
|
url: "google.com"
|
|
29
29
|
}
|
|
30
30
|
}, r = {
|
|
31
|
-
type:
|
|
32
|
-
enableWallet:
|
|
31
|
+
type: e.INGAME_IAB21_LBAR,
|
|
32
|
+
enableWallet: o.DISABLED,
|
|
33
|
+
coupon: "",
|
|
34
|
+
logoMode: a.LEFT,
|
|
35
|
+
couponZip: "",
|
|
36
|
+
couponBarcodeUrl: "",
|
|
37
|
+
sponsor: {
|
|
38
|
+
logo: "https://static-next.streamlayer.io/a8b6c1738a31dd0076a01c8807253533/f1de6799-4502-4423-9cbe-4804cd0ba769/c911da1a-e4a1-4e9a-8eb2-d1a6aa17e05d.png",
|
|
39
|
+
name: "Lorem ipsum dolor sit 4434, co"
|
|
40
|
+
},
|
|
41
|
+
banner: {
|
|
42
|
+
imageUrl: "",
|
|
43
|
+
url: "",
|
|
44
|
+
video: {
|
|
45
|
+
id: "1",
|
|
46
|
+
thumbnailUrl: "https://www.figma.com/file/8XscgUSGOMU6rCYDLBgrAc/image/58f7c29647f7ad5bd447f76534af79609bedc74f",
|
|
47
|
+
url: "https://static-next.streamlayer.io/2e8700993dd42a9b3283ef7f1b4bddc0/aa7a51c8-b8fb-4e8c-97bd-eebf649fd04d/36163fdd-3d41-447c-a3b2-3faf35ae9235.mp4"
|
|
48
|
+
},
|
|
49
|
+
ctaButton: {
|
|
50
|
+
label: "Lorem ipsum dol",
|
|
51
|
+
color: "#1d7bff",
|
|
52
|
+
ctaIcon: "",
|
|
53
|
+
ctaIconMode: c.CTA_ICON_UNSET,
|
|
54
|
+
textColor: "#fff"
|
|
55
|
+
},
|
|
56
|
+
body: "Lorem ipsum dolor sit 4434, consectetur 1111192392 3333, sed do 4434343 342343 545454344 ut 234323 ",
|
|
57
|
+
title: "Lorem ipsum dolor sit 4434, co"
|
|
58
|
+
},
|
|
59
|
+
additionalBanner: {
|
|
60
|
+
imageUrl: "https://static-next.streamlayer.io/a8b6c1738a31dd0076a01c8807253533/42b6d84a-3cca-4eed-98ed-195706b47882/fce903c3-9781-4613-ae1e-4cce7e8cde90.png",
|
|
61
|
+
url: "google.com"
|
|
62
|
+
}
|
|
63
|
+
}, l = {
|
|
64
|
+
type: e.EXTERNAL_AD,
|
|
65
|
+
enableWallet: o.DISABLED,
|
|
33
66
|
coupon: "",
|
|
34
67
|
logoMode: a.LEFT,
|
|
35
68
|
couponZip: "",
|
|
@@ -63,5 +96,6 @@ const d = {
|
|
|
63
96
|
};
|
|
64
97
|
export {
|
|
65
98
|
d as promotionMock,
|
|
99
|
+
l as promotionMockWithGAM,
|
|
66
100
|
r as promotionMockWithVideo
|
|
67
101
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsxs as e, Fragment as a, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { styled as o } from "@linaria/react";
|
|
3
|
+
const m = /* @__PURE__ */ o("div")({
|
|
4
|
+
name: "Container",
|
|
5
|
+
class: "c10m2bce",
|
|
6
|
+
propsAsIs: !1
|
|
7
|
+
}), l = /* @__PURE__ */ o("div")({
|
|
8
|
+
name: "Item",
|
|
9
|
+
class: "ig23yq5",
|
|
10
|
+
propsAsIs: !1
|
|
11
|
+
}), f = /* @__PURE__ */ o("div")({
|
|
12
|
+
name: "Dot",
|
|
13
|
+
class: "d1f6aqua",
|
|
14
|
+
propsAsIs: !1
|
|
15
|
+
}), h = ({
|
|
16
|
+
time: t,
|
|
17
|
+
adCount: n,
|
|
18
|
+
adPosition: c
|
|
19
|
+
}) => {
|
|
20
|
+
const r = Math.floor(t / 60), s = t - r * 60;
|
|
21
|
+
return r === 0 && s === 0 && n === c ? null : /* @__PURE__ */ e(m, {
|
|
22
|
+
children: [n > 1 && /* @__PURE__ */ e(a, {
|
|
23
|
+
children: [/* @__PURE__ */ e(l, {
|
|
24
|
+
children: [c, " of ", n]
|
|
25
|
+
}), /* @__PURE__ */ i(f, {})]
|
|
26
|
+
}), /* @__PURE__ */ e(l, {
|
|
27
|
+
children: [r, ":", s < 10 ? `0${s}` : s]
|
|
28
|
+
})]
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
h as Controls
|
|
33
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { jsxs as h, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { cx as P } from "@linaria/core";
|
|
3
|
+
import { styled as D } from "@linaria/react";
|
|
4
|
+
import { useRef as M, useState as E, useCallback as N, useEffect as H } from "react";
|
|
5
|
+
import { eventBus as w } from "@streamlayer/sdk-web-interfaces";
|
|
6
|
+
import { PromotionLogoMode as q } from "@streamlayer/sdk-web-types";
|
|
7
|
+
import { PromoOverlay as _, Header as b, HeaderContent as I, headerContentShift as W, ADLogo as j, Media as B } from "../styles.js";
|
|
8
|
+
import { CloseButton as C } from "../../../close-btn/index.js";
|
|
9
|
+
import { Controls as G } from "./controls.js";
|
|
10
|
+
const k = (s, i, { onPlay: u, onStop: e, onProgress: a }) => {
|
|
11
|
+
const r = google.ima;
|
|
12
|
+
let n = new r.AdDisplayContainer(s), d = new r.AdsLoader(n), c = new r.AdsRequest(), t;
|
|
13
|
+
d.addEventListener(
|
|
14
|
+
r.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
|
|
15
|
+
(m) => {
|
|
16
|
+
t = m.getAdsManager(s), u && t.addEventListener(r.AdEvent.Type.STARTED, u), e && t.addEventListener(r.AdEvent.Type.COMPLETE, e), a && t.addEventListener(r.AdEvent.Type.AD_PROGRESS, (A) => a(A.getAdData())), t.init(s.clientWidth, s.clientHeight, r.ViewMode.NORMAL), t.start();
|
|
17
|
+
},
|
|
18
|
+
!1
|
|
19
|
+
), d.addEventListener(
|
|
20
|
+
r.AdErrorEvent.Type.AD_ERROR,
|
|
21
|
+
() => {
|
|
22
|
+
console.log("ad error"), e == null || e();
|
|
23
|
+
},
|
|
24
|
+
!1
|
|
25
|
+
), c.linearAdSlotWidth = s.clientWidth, c.linearAdSlotHeight = s.clientHeight, c.adTagUrl = i, d.requestAds(c);
|
|
26
|
+
const y = () => {
|
|
27
|
+
t == null || t.destroy(), d == null || d.destroy(), n == null || n.destroy(), n = void 0, d = void 0, c = void 0, t = void 0;
|
|
28
|
+
};
|
|
29
|
+
return () => {
|
|
30
|
+
try {
|
|
31
|
+
n.initialize();
|
|
32
|
+
} catch (m) {
|
|
33
|
+
e == null || e(), console.log("AdsManager could not be started", m);
|
|
34
|
+
}
|
|
35
|
+
return y;
|
|
36
|
+
};
|
|
37
|
+
}, z = /* @__PURE__ */ D("div")({
|
|
38
|
+
name: "Container",
|
|
39
|
+
class: "c4q6dw1",
|
|
40
|
+
propsAsIs: !1
|
|
41
|
+
}), U = /* @__PURE__ */ D("div")({
|
|
42
|
+
name: "ControlsContainer",
|
|
43
|
+
class: "c1la67r",
|
|
44
|
+
propsAsIs: !1
|
|
45
|
+
}), F = "m3guev", J = "m7099mt", K = "mmm6o5s", te = ({
|
|
46
|
+
promotion: s,
|
|
47
|
+
controlVideo: i,
|
|
48
|
+
promotionId: u,
|
|
49
|
+
onClose: e,
|
|
50
|
+
externalAd: a,
|
|
51
|
+
skipAutoClose: r
|
|
52
|
+
}) => {
|
|
53
|
+
var T;
|
|
54
|
+
const n = M(null), [d, c] = E(!1), [t, y] = E(0), [p, m] = E(0), [A, R] = E(0), o = M(), f = N(() => {
|
|
55
|
+
y(0), m(0), R(0), c(!1), i == null || i({
|
|
56
|
+
muted: !1
|
|
57
|
+
});
|
|
58
|
+
}, [i]);
|
|
59
|
+
H(() => {
|
|
60
|
+
if (a != null && a.url && n.current) {
|
|
61
|
+
f();
|
|
62
|
+
const L = k(n.current, a.url, {
|
|
63
|
+
onPlay: () => {
|
|
64
|
+
w.emit("advertisement", {
|
|
65
|
+
action: "videoPlay",
|
|
66
|
+
payload: {
|
|
67
|
+
id: u,
|
|
68
|
+
type: s.type
|
|
69
|
+
}
|
|
70
|
+
}), i == null || i({
|
|
71
|
+
muted: !0
|
|
72
|
+
}), c(!0);
|
|
73
|
+
},
|
|
74
|
+
onStop: () => {
|
|
75
|
+
e == null || e(), f();
|
|
76
|
+
},
|
|
77
|
+
onProgress: (v) => {
|
|
78
|
+
y(Math.round(v.duration - v.currentTime)), m(v.totalAds), R(v.adPosition);
|
|
79
|
+
}
|
|
80
|
+
})();
|
|
81
|
+
return o.current = L, () => {
|
|
82
|
+
o.current = void 0, L();
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}, [a == null ? void 0 : a.url, i, f, u, s.type, e]);
|
|
86
|
+
const O = ((T = s.sponsor) == null ? void 0 : T.logo) && s.logoMode === q.CENTER;
|
|
87
|
+
return /* @__PURE__ */ h(_, {
|
|
88
|
+
className: "PromoOverlay",
|
|
89
|
+
children: [/* @__PURE__ */ h(b, {
|
|
90
|
+
children: [/* @__PURE__ */ l(I, {
|
|
91
|
+
className: P(!O && W),
|
|
92
|
+
children: /* @__PURE__ */ l(j, {
|
|
93
|
+
style: {
|
|
94
|
+
transform: "scale(1.5)"
|
|
95
|
+
},
|
|
96
|
+
children: "Ad"
|
|
97
|
+
})
|
|
98
|
+
}), /* @__PURE__ */ h(U, {
|
|
99
|
+
children: [/* @__PURE__ */ l(G, {
|
|
100
|
+
time: t,
|
|
101
|
+
adCount: p,
|
|
102
|
+
adPosition: A
|
|
103
|
+
}), r && /* @__PURE__ */ l(C, {
|
|
104
|
+
className: "ClosePromoIcon",
|
|
105
|
+
close: () => {
|
|
106
|
+
var g;
|
|
107
|
+
(g = o.current) == null || g.call(o), e == null || e(), f();
|
|
108
|
+
}
|
|
109
|
+
})]
|
|
110
|
+
})]
|
|
111
|
+
}), /* @__PURE__ */ l(B, {
|
|
112
|
+
className: P(F, d && J, !d && K),
|
|
113
|
+
children: /* @__PURE__ */ l(z, {
|
|
114
|
+
ref: n
|
|
115
|
+
})
|
|
116
|
+
})]
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
export {
|
|
120
|
+
te as ExternalAdOverlay
|
|
121
|
+
};
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import { Advertisement } from '@streamlayer/feature-gamification';
|
|
1
2
|
import { PromotionOptions } from '@streamlayer/sdk-web-types';
|
|
3
|
+
import { ControlVideoCb } from '../../video-player';
|
|
2
4
|
export { OverlayContainer } from './styles';
|
|
3
|
-
export
|
|
5
|
+
export type OverlayProps = {
|
|
4
6
|
promotionId: string;
|
|
5
7
|
promotion: PromotionOptions;
|
|
6
8
|
onClose?: () => void;
|
|
7
9
|
markAsViewed?: () => void;
|
|
8
10
|
skipAutoClose?: boolean;
|
|
9
11
|
inSidebar?: boolean;
|
|
10
|
-
|
|
12
|
+
externalAd?: Advertisement['externalAd'];
|
|
13
|
+
controlVideo: ControlVideoCb;
|
|
14
|
+
};
|
|
15
|
+
export declare const Overlay: React.FC<OverlayProps>;
|
|
@@ -1,92 +1,101 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { cx as
|
|
3
|
-
import { useEffect as $ } from "react";
|
|
4
|
-
import { eventBus as
|
|
5
|
-
import { PromotionType as
|
|
6
|
-
import { CloseButton as
|
|
7
|
-
import { VideoPlayer as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { cx as W } from "@linaria/core";
|
|
3
|
+
import { useState as Z, useEffect as $ } from "react";
|
|
4
|
+
import { eventBus as oo } from "@streamlayer/sdk-web-interfaces";
|
|
5
|
+
import { PromotionType as q, PromotionLogoMode as l, AutoPlayVideo as eo, PromotionButtonType as ro } from "@streamlayer/sdk-web-types";
|
|
6
|
+
import { CloseButton as to } from "../../close-btn/index.js";
|
|
7
|
+
import { VideoPlayer as no } from "../../video-player/index.js";
|
|
8
|
+
import { ExternalAdOverlay as ao } from "./externalAd/index.js";
|
|
9
|
+
import { PromoOverlay as lo, Header as io, HeaderContent as so, headerContentShift as mo, SponsorLogo as z, Sponsor as co, SponsorName as po, SponsorText as uo, ADLogo as yo, SponsoredText as fo, Media as bo, shiftMedia as go, Content as J, PromoImg as ho, Title as Po, hideOnMobile as Ao, Description as To, ActionBtnWrap as No, ActionButton as vo } from "./styles.js";
|
|
10
|
+
import { OverlayContainer as _o } from "./styles.js";
|
|
11
|
+
const Do = (c) => {
|
|
12
|
+
var y, f, b, g, h, P, A, T, N, v, x, B, C, E, O, M, S, L, I, D, R, U, _, k, F, V, j, G, H, w;
|
|
13
|
+
const { promotion: o, controlVideo: t, skipAutoClose: K, promotionId: a, onClose: Q, markAsViewed: i, externalAd: p } = c, s = o.type === q.INGAME_IAB11_LBAR || o.type === q.INGAME_IAB11, d = ((y = o.sponsor) == null ? void 0 : y.logo) && o.logoMode === l.CENTER, X = !!((b = (f = o.banner) == null ? void 0 : f.video) != null && b.url), m = o.autoPlayVideo === eo.ENABLED, [Y, u] = Z(!X || !m);
|
|
14
|
+
if ($(() => {
|
|
15
|
+
a && o.type && i && i();
|
|
16
|
+
}, [a, o.type, i]), $(() => () => {
|
|
17
|
+
t == null || t({ muted: !1 });
|
|
18
|
+
}, [t]), p)
|
|
19
|
+
return /* @__PURE__ */ e(ao, { ...c, externalAd: p });
|
|
20
|
+
let n = (g = o.banner) == null ? void 0 : g.url;
|
|
21
|
+
return n && n.indexOf("http") !== 0 && (n = `https://${n}`), /* @__PURE__ */ r(lo, { className: "PromoOverlay", children: [
|
|
22
|
+
/* @__PURE__ */ r(io, { children: [
|
|
23
|
+
/* @__PURE__ */ r(so, { className: W(!d && mo), children: [
|
|
24
|
+
((h = o.sponsor) == null ? void 0 : h.logo) && o.logoMode === l.LEFT && /* @__PURE__ */ e(z, { src: (P = o.sponsor) == null ? void 0 : P.logo, alt: "promo" }),
|
|
25
|
+
/* @__PURE__ */ r(
|
|
26
|
+
co,
|
|
23
27
|
{
|
|
24
28
|
style: {
|
|
25
|
-
paddingLeft: (
|
|
29
|
+
paddingLeft: (A = o.sponsor) != null && A.logo && o.logoMode === l.LEFT ? "0px" : "8px"
|
|
26
30
|
},
|
|
27
31
|
children: [
|
|
28
|
-
((
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
+
((T = o.sponsor) == null ? void 0 : T.logo) && o.logoMode === l.LEFT && /* @__PURE__ */ e(po, { children: (N = o.sponsor) == null ? void 0 : N.name }),
|
|
33
|
+
/* @__PURE__ */ r(uo, { className: "SponsorText", children: [
|
|
34
|
+
/* @__PURE__ */ e(yo, { children: "AD" }),
|
|
35
|
+
/* @__PURE__ */ e(fo, { children: "SPONSORED" })
|
|
32
36
|
] })
|
|
33
37
|
]
|
|
34
38
|
}
|
|
35
39
|
)
|
|
36
40
|
] }),
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
|
|
41
|
+
/* @__PURE__ */ e(
|
|
42
|
+
to,
|
|
39
43
|
{
|
|
40
44
|
className: "ClosePromoIcon",
|
|
41
|
-
close:
|
|
42
|
-
autoClose: (
|
|
43
|
-
duration:
|
|
45
|
+
close: Q,
|
|
46
|
+
autoClose: (v = o.closeTimer) == null ? void 0 : v.auto,
|
|
47
|
+
duration: K ? 0 : (x = o.closeTimer) == null ? void 0 : x.seconds,
|
|
48
|
+
isPlaying: Y
|
|
44
49
|
}
|
|
45
50
|
)
|
|
46
51
|
] }),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
|
|
52
|
+
/* @__PURE__ */ r(bo, { children: [
|
|
53
|
+
d && /* @__PURE__ */ e(z, { className: go, src: (B = o.sponsor) == null ? void 0 : B.logo, alt: "promo" }),
|
|
54
|
+
/* @__PURE__ */ e(J, { children: (E = (C = o.banner) == null ? void 0 : C.video) != null && E.url ? /* @__PURE__ */ e(
|
|
55
|
+
no,
|
|
51
56
|
{
|
|
52
|
-
source: (
|
|
53
|
-
poster: (
|
|
54
|
-
aspectRatio:
|
|
57
|
+
source: (M = (O = o.banner) == null ? void 0 : O.video) == null ? void 0 : M.url,
|
|
58
|
+
poster: (L = (S = o.banner) == null ? void 0 : S.video) == null ? void 0 : L.thumbnailUrl,
|
|
59
|
+
aspectRatio: s ? "1/1" : "16/9",
|
|
60
|
+
onPause: () => {
|
|
61
|
+
m && u(!1);
|
|
62
|
+
},
|
|
55
63
|
onPlay: () => {
|
|
56
|
-
|
|
64
|
+
oo.emit("advertisement", {
|
|
57
65
|
action: "videoPlay",
|
|
58
66
|
payload: {
|
|
59
|
-
id:
|
|
60
|
-
type:
|
|
67
|
+
id: a,
|
|
68
|
+
type: o.type
|
|
61
69
|
}
|
|
62
|
-
});
|
|
70
|
+
}), u(!0);
|
|
63
71
|
},
|
|
64
|
-
|
|
72
|
+
controlVideo: t,
|
|
73
|
+
autoPlay: m
|
|
65
74
|
}
|
|
66
|
-
) : (
|
|
67
|
-
!
|
|
68
|
-
((
|
|
69
|
-
((
|
|
75
|
+
) : (I = o.banner) != null && I.imageUrl ? /* @__PURE__ */ e(ho, { style: s ? { aspectRatio: "1/1" } : {}, src: (D = o.banner) == null ? void 0 : D.imageUrl, alt: "promo" }) : null }),
|
|
76
|
+
!s && /* @__PURE__ */ r(J, { children: [
|
|
77
|
+
((R = o.banner) == null ? void 0 : R.title) && /* @__PURE__ */ e(Po, { className: W("AdvTitle", d && Ao), children: (U = o.banner) == null ? void 0 : U.title }),
|
|
78
|
+
((_ = o.banner) == null ? void 0 : _.body) && /* @__PURE__ */ e(To, { className: "AdvDescription", children: (k = o.banner) == null ? void 0 : k.body })
|
|
70
79
|
] })
|
|
71
80
|
] }),
|
|
72
|
-
|
|
73
|
-
|
|
81
|
+
o.buttonType !== ro.NO_BUTTON && /* @__PURE__ */ e(No, { children: /* @__PURE__ */ e(
|
|
82
|
+
vo,
|
|
74
83
|
{
|
|
75
|
-
href:
|
|
84
|
+
href: n,
|
|
76
85
|
style: {
|
|
77
|
-
backgroundColor: ((
|
|
78
|
-
color: ((
|
|
86
|
+
backgroundColor: ((V = (F = o.banner) == null ? void 0 : F.ctaButton) == null ? void 0 : V.color) || "#009dc4",
|
|
87
|
+
color: ((G = (j = o.banner) == null ? void 0 : j.ctaButton) == null ? void 0 : G.textColor) || "#fff"
|
|
79
88
|
},
|
|
80
89
|
"data-analytics": "button",
|
|
81
|
-
"data-promo-id":
|
|
82
|
-
"data-promo-type":
|
|
90
|
+
"data-promo-id": a,
|
|
91
|
+
"data-promo-type": o.type,
|
|
83
92
|
target: "_blank",
|
|
84
|
-
children: (
|
|
93
|
+
children: (w = (H = o.banner) == null ? void 0 : H.ctaButton) == null ? void 0 : w.label
|
|
85
94
|
}
|
|
86
95
|
) })
|
|
87
96
|
] });
|
|
88
97
|
};
|
|
89
98
|
export {
|
|
90
|
-
|
|
91
|
-
|
|
99
|
+
Do as Overlay,
|
|
100
|
+
_o as OverlayContainer
|
|
92
101
|
};
|
|
@@ -1,47 +1,49 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { styled as s } from "@linaria/react";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { CloseTimerAuto as
|
|
5
|
-
import { SvgIcon as
|
|
6
|
-
import { SimpleTimer as
|
|
7
|
-
const
|
|
3
|
+
import { useState as f, useEffect as l, useCallback as a } from "react";
|
|
4
|
+
import { CloseTimerAuto as I } from "@streamlayer/sdk-web-types";
|
|
5
|
+
import { SvgIcon as u } from "../icons/index.js";
|
|
6
|
+
import { SimpleTimer as v } from "../timer/index.js";
|
|
7
|
+
const T = /* @__PURE__ */ s("div")({
|
|
8
8
|
name: "CloseIconWrap",
|
|
9
9
|
class: "c3v6bv6",
|
|
10
10
|
propsAsIs: !1
|
|
11
|
-
}),
|
|
11
|
+
}), g = /* @__PURE__ */ s("div")({
|
|
12
12
|
name: "TimerWrap",
|
|
13
13
|
class: "teuhmro",
|
|
14
14
|
propsAsIs: !1
|
|
15
|
-
}),
|
|
15
|
+
}), x = () => u, A = /* @__PURE__ */ s(x())({
|
|
16
16
|
name: "Icon",
|
|
17
17
|
class: "i17rfxv5",
|
|
18
18
|
propsAsIs: !0
|
|
19
|
-
}),
|
|
19
|
+
}), b = ({
|
|
20
20
|
close: r,
|
|
21
|
-
className:
|
|
21
|
+
className: n,
|
|
22
|
+
isPlaying: c = !0,
|
|
22
23
|
duration: o = 0,
|
|
23
|
-
autoClose:
|
|
24
|
+
autoClose: t
|
|
24
25
|
}) => {
|
|
25
|
-
const [
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
const [i, m] = f(o === 0);
|
|
27
|
+
l(() => {
|
|
28
|
+
m(!o);
|
|
28
29
|
}, [o]);
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
}, [
|
|
32
|
-
return
|
|
30
|
+
const p = a(() => {
|
|
31
|
+
t === I.ENABLED ? r == null || r() : m(!0);
|
|
32
|
+
}, [t, r]);
|
|
33
|
+
return i ? /* @__PURE__ */ e(T, {
|
|
33
34
|
onClick: r,
|
|
34
|
-
className:
|
|
35
|
-
children: /* @__PURE__ */ e(
|
|
35
|
+
className: n,
|
|
36
|
+
children: /* @__PURE__ */ e(A, {
|
|
36
37
|
name: "icon-cross"
|
|
37
38
|
})
|
|
38
|
-
}) : /* @__PURE__ */ e(
|
|
39
|
-
children: /* @__PURE__ */ e(
|
|
39
|
+
}) : /* @__PURE__ */ e(g, {
|
|
40
|
+
children: /* @__PURE__ */ e(v, {
|
|
41
|
+
isPlaying: c,
|
|
40
42
|
duration: o,
|
|
41
|
-
onTimerExpired:
|
|
43
|
+
onTimerExpired: p
|
|
42
44
|
})
|
|
43
45
|
});
|
|
44
46
|
};
|
|
45
47
|
export {
|
|
46
|
-
|
|
48
|
+
b as CloseButton
|
|
47
49
|
};
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
export declare const Container:
|
|
2
|
-
|
|
1
|
+
export declare const Container: {
|
|
2
|
+
__wyw_meta: unknown;
|
|
3
|
+
} & import('react').FunctionComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
|
|
4
|
+
as?: React.ElementType;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const ActionBtn: {
|
|
7
|
+
__wyw_meta: unknown;
|
|
8
|
+
} & import('react').FunctionComponent<import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown> & {
|
|
9
|
+
as?: React.ElementType;
|
|
10
|
+
}>;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { styled as
|
|
2
|
-
|
|
1
|
+
import { styled as t } from "@linaria/react";
|
|
2
|
+
import { QuestionItem as o, PlayButton as n } from "../styles.js";
|
|
3
|
+
const s = () => o, i = /* @__PURE__ */ t(s())({
|
|
3
4
|
name: "Container",
|
|
4
5
|
class: "cll3md7",
|
|
5
|
-
propsAsIs: !
|
|
6
|
-
}),
|
|
6
|
+
propsAsIs: !0
|
|
7
|
+
}), e = () => n, p = /* @__PURE__ */ t(e())({
|
|
7
8
|
name: "ActionBtn",
|
|
8
9
|
class: "a10g1iik",
|
|
9
|
-
propsAsIs: !
|
|
10
|
+
propsAsIs: !0
|
|
10
11
|
});
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
p as ActionBtn,
|
|
14
|
+
i as Container
|
|
14
15
|
};
|