@streamlayer/react-ui 1.13.1 → 1.13.3
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/ui/advertisement/overlay/index.js +62 -60
- package/package.json +14 -14
|
@@ -1,79 +1,81 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
-
import { cx as
|
|
3
|
-
import { useEffect as
|
|
4
|
-
import { eventBus as
|
|
5
|
-
import { PromotionType as
|
|
6
|
-
import { CloseButton as
|
|
7
|
-
import { VideoPlayer as
|
|
8
|
-
import { ExternalAdOverlay as
|
|
9
|
-
import { PromoOverlay as
|
|
10
|
-
import { OverlayContainer as
|
|
11
|
-
const
|
|
12
|
-
var
|
|
2
|
+
import { cx as z } from "@linaria/core";
|
|
3
|
+
import { useEffect as y } from "react";
|
|
4
|
+
import { eventBus as oo } from "@streamlayer/sdk-web-interfaces";
|
|
5
|
+
import { PromotionType as J, PromotionLogoMode as s, 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 K, Sponsor as po, SponsorName as co, SponsorText as yo, ADLogo as uo, SponsoredText as fo, Media as bo, shiftMedia as ho, Content as Q, PromoImg as Ao, Title as To, hideOnMobile as vo, Description as No, ActionBtnWrap as Po, ActionButton as xo } from "./styles.js";
|
|
10
|
+
import { OverlayContainer as _o } from "./styles.js";
|
|
11
|
+
const Do = (u) => {
|
|
12
|
+
var h, A, T, v, N, P, x, B, C, g, E, O, M, L, S, I, D, R, U, _, k, F, V, j, G, H, w, W, $, q;
|
|
13
13
|
const {
|
|
14
14
|
promotion: o,
|
|
15
|
-
advertisementPaused:
|
|
15
|
+
advertisementPaused: X,
|
|
16
16
|
togglePause: r,
|
|
17
17
|
controlVideo: n,
|
|
18
|
-
skipAutoClose:
|
|
18
|
+
skipAutoClose: Y,
|
|
19
19
|
promotionId: l,
|
|
20
|
-
onClose:
|
|
21
|
-
markAsViewed:
|
|
22
|
-
externalAd:
|
|
23
|
-
} =
|
|
24
|
-
if (
|
|
25
|
-
r == null || r(
|
|
26
|
-
}, []),
|
|
27
|
-
l && o.type &&
|
|
28
|
-
}, [l, o.type,
|
|
20
|
+
onClose: Z,
|
|
21
|
+
markAsViewed: d,
|
|
22
|
+
externalAd: f
|
|
23
|
+
} = u, m = o.type === J.INGAME_IAB11_LBAR || o.type === J.INGAME_IAB11, p = ((h = o.sponsor) == null ? void 0 : h.logo) && o.logoMode === s.CENTER, b = !!((T = (A = o.banner) == null ? void 0 : A.video) != null && T.url), i = o.autoPlayVideo === eo.ENABLED;
|
|
24
|
+
if (y(() => {
|
|
25
|
+
r == null || r(b || i);
|
|
26
|
+
}, []), y(() => {
|
|
27
|
+
l && o.type && d && d();
|
|
28
|
+
}, [l, o.type, d]), y(() => () => {
|
|
29
29
|
n == null || n({ muted: !1 });
|
|
30
|
-
}, [n]),
|
|
31
|
-
return /* @__PURE__ */ e(
|
|
32
|
-
let a = (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
}, [n]), f)
|
|
31
|
+
return /* @__PURE__ */ e(ao, { ...u, externalAd: f });
|
|
32
|
+
let a = (v = o.banner) == null ? void 0 : v.url;
|
|
33
|
+
a && a.indexOf("http") !== 0 && (a = `https://${a}`);
|
|
34
|
+
let c = !0;
|
|
35
|
+
return b && (!X || !i ? c = !0 : c = !1), /* @__PURE__ */ t(lo, { className: "PromoOverlay", children: [
|
|
36
|
+
/* @__PURE__ */ t(io, { children: [
|
|
37
|
+
/* @__PURE__ */ t(so, { className: z(!p && mo), children: [
|
|
38
|
+
((N = o.sponsor) == null ? void 0 : N.logo) && o.logoMode === s.LEFT && /* @__PURE__ */ e(K, { src: (P = o.sponsor) == null ? void 0 : P.logo, alt: "promo" }),
|
|
37
39
|
/* @__PURE__ */ t(
|
|
38
|
-
|
|
40
|
+
po,
|
|
39
41
|
{
|
|
40
42
|
style: {
|
|
41
|
-
paddingLeft: (
|
|
43
|
+
paddingLeft: (x = o.sponsor) != null && x.logo && o.logoMode === s.LEFT ? "0px" : "8px"
|
|
42
44
|
},
|
|
43
45
|
children: [
|
|
44
|
-
((
|
|
45
|
-
/* @__PURE__ */ t(
|
|
46
|
-
/* @__PURE__ */ e(
|
|
47
|
-
/* @__PURE__ */ e(
|
|
46
|
+
((B = o.sponsor) == null ? void 0 : B.logo) && o.logoMode === s.LEFT && /* @__PURE__ */ e(co, { children: (C = o.sponsor) == null ? void 0 : C.name }),
|
|
47
|
+
/* @__PURE__ */ t(yo, { className: "SponsorText", children: [
|
|
48
|
+
/* @__PURE__ */ e(uo, { children: "AD" }),
|
|
49
|
+
/* @__PURE__ */ e(fo, { children: "SPONSORED" })
|
|
48
50
|
] })
|
|
49
51
|
]
|
|
50
52
|
}
|
|
51
53
|
)
|
|
52
54
|
] }),
|
|
53
55
|
/* @__PURE__ */ e(
|
|
54
|
-
|
|
56
|
+
to,
|
|
55
57
|
{
|
|
56
58
|
className: "ClosePromoIcon",
|
|
57
|
-
close:
|
|
58
|
-
autoClose: (
|
|
59
|
-
duration:
|
|
60
|
-
isPlaying:
|
|
59
|
+
close: Z,
|
|
60
|
+
autoClose: (g = o.closeTimer) == null ? void 0 : g.auto,
|
|
61
|
+
duration: Y ? 0 : (E = o.closeTimer) == null ? void 0 : E.seconds,
|
|
62
|
+
isPlaying: c
|
|
61
63
|
}
|
|
62
64
|
)
|
|
63
65
|
] }),
|
|
64
|
-
/* @__PURE__ */ t(
|
|
65
|
-
|
|
66
|
-
/* @__PURE__ */ e(
|
|
67
|
-
|
|
66
|
+
/* @__PURE__ */ t(bo, { children: [
|
|
67
|
+
p && /* @__PURE__ */ e(K, { className: ho, src: (O = o.sponsor) == null ? void 0 : O.logo, alt: "promo" }),
|
|
68
|
+
/* @__PURE__ */ e(Q, { children: (L = (M = o.banner) == null ? void 0 : M.video) != null && L.url ? /* @__PURE__ */ e(
|
|
69
|
+
no,
|
|
68
70
|
{
|
|
69
|
-
source: (
|
|
70
|
-
poster: (
|
|
71
|
-
aspectRatio:
|
|
71
|
+
source: (I = (S = o.banner) == null ? void 0 : S.video) == null ? void 0 : I.url,
|
|
72
|
+
poster: (R = (D = o.banner) == null ? void 0 : D.video) == null ? void 0 : R.thumbnailUrl,
|
|
73
|
+
aspectRatio: m ? "1/1" : "16/9",
|
|
72
74
|
onPause: () => {
|
|
73
|
-
|
|
75
|
+
i && (r == null || r(!0));
|
|
74
76
|
},
|
|
75
77
|
onPlay: () => {
|
|
76
|
-
|
|
78
|
+
oo.emit("advertisement", {
|
|
77
79
|
action: "videoPlay",
|
|
78
80
|
payload: {
|
|
79
81
|
id: l,
|
|
@@ -82,32 +84,32 @@ const Io = (y) => {
|
|
|
82
84
|
}), r == null || r(!1);
|
|
83
85
|
},
|
|
84
86
|
controlVideo: n,
|
|
85
|
-
autoPlay:
|
|
87
|
+
autoPlay: i
|
|
86
88
|
}
|
|
87
|
-
) : (
|
|
88
|
-
!
|
|
89
|
-
((
|
|
90
|
-
((
|
|
89
|
+
) : (U = o.banner) != null && U.imageUrl ? /* @__PURE__ */ e(Ao, { style: m ? { aspectRatio: "1/1" } : {}, src: (_ = o.banner) == null ? void 0 : _.imageUrl, alt: "promo" }) : null }),
|
|
90
|
+
!m && /* @__PURE__ */ t(Q, { children: [
|
|
91
|
+
((k = o.banner) == null ? void 0 : k.title) && /* @__PURE__ */ e(To, { className: z("AdvTitle", p && vo), children: (F = o.banner) == null ? void 0 : F.title }),
|
|
92
|
+
((V = o.banner) == null ? void 0 : V.body) && /* @__PURE__ */ e(No, { className: "AdvDescription", children: (j = o.banner) == null ? void 0 : j.body })
|
|
91
93
|
] })
|
|
92
94
|
] }),
|
|
93
|
-
o.buttonType !==
|
|
95
|
+
o.buttonType !== ro.NO_BUTTON && /* @__PURE__ */ e(Po, { children: /* @__PURE__ */ e(
|
|
94
96
|
xo,
|
|
95
97
|
{
|
|
96
98
|
href: a,
|
|
97
99
|
style: {
|
|
98
|
-
backgroundColor: ((
|
|
99
|
-
color: ((
|
|
100
|
+
backgroundColor: ((H = (G = o.banner) == null ? void 0 : G.ctaButton) == null ? void 0 : H.color) || "#009dc4",
|
|
101
|
+
color: ((W = (w = o.banner) == null ? void 0 : w.ctaButton) == null ? void 0 : W.textColor) || "#fff"
|
|
100
102
|
},
|
|
101
103
|
"data-analytics": "button",
|
|
102
104
|
"data-promo-id": l,
|
|
103
105
|
"data-promo-type": o.type,
|
|
104
106
|
target: "_blank",
|
|
105
|
-
children: (
|
|
107
|
+
children: (q = ($ = o.banner) == null ? void 0 : $.ctaButton) == null ? void 0 : q.label
|
|
106
108
|
}
|
|
107
109
|
) })
|
|
108
110
|
] });
|
|
109
111
|
};
|
|
110
112
|
export {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
+
Do as Overlay,
|
|
114
|
+
_o as OverlayContainer
|
|
113
115
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react-ui",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -59,18 +59,18 @@
|
|
|
59
59
|
"react-virtualized-auto-sizer": "^1.0.24",
|
|
60
60
|
"react-window": "^1.8.10",
|
|
61
61
|
"react-window-infinite-loader": "^1.0.9",
|
|
62
|
-
"@streamlayer/feature-gamification": "^1.
|
|
63
|
-
"@streamlayer/sdk-web": "^1.6.
|
|
64
|
-
"@streamlayer/sdk-web-analytics": "^1.4.
|
|
65
|
-
"@streamlayer/sdk-web-anonymous-auth": "^1.1.
|
|
66
|
-
"@streamlayer/sdk-web-api": "^1.6.
|
|
67
|
-
"@streamlayer/sdk-web-core": "^1.
|
|
68
|
-
"@streamlayer/sdk-web-features": "^1.0.
|
|
69
|
-
"@streamlayer/sdk-web-interfaces": "^1.
|
|
70
|
-
"@streamlayer/sdk-web-logger": "^1.0.
|
|
71
|
-
"@streamlayer/sdk-web-notifications": "^1.2.
|
|
72
|
-
"@streamlayer/sdk-web-storage": "^1.0.
|
|
73
|
-
"@streamlayer/sdk-web-types": "^1.8.
|
|
62
|
+
"@streamlayer/feature-gamification": "^1.11.0",
|
|
63
|
+
"@streamlayer/sdk-web": "^1.6.3",
|
|
64
|
+
"@streamlayer/sdk-web-analytics": "^1.4.11",
|
|
65
|
+
"@streamlayer/sdk-web-anonymous-auth": "^1.1.11",
|
|
66
|
+
"@streamlayer/sdk-web-api": "^1.6.11",
|
|
67
|
+
"@streamlayer/sdk-web-core": "^1.8.0",
|
|
68
|
+
"@streamlayer/sdk-web-features": "^1.0.32",
|
|
69
|
+
"@streamlayer/sdk-web-interfaces": "^1.3.0",
|
|
70
|
+
"@streamlayer/sdk-web-logger": "^1.0.32",
|
|
71
|
+
"@streamlayer/sdk-web-notifications": "^1.2.11",
|
|
72
|
+
"@streamlayer/sdk-web-storage": "^1.0.32",
|
|
73
|
+
"@streamlayer/sdk-web-types": "^1.8.5"
|
|
74
74
|
},
|
|
75
75
|
"nx": {
|
|
76
76
|
"implicitDependencies": [
|
|
@@ -111,6 +111,6 @@
|
|
|
111
111
|
"vite-plugin-svgr": "^4.2.0",
|
|
112
112
|
"vite-svg-loader": "^5.1.0",
|
|
113
113
|
"vite-tsconfig-paths": "^5.0.1",
|
|
114
|
-
"@streamlayer/react": "^1.9.
|
|
114
|
+
"@streamlayer/react": "^1.9.3"
|
|
115
115
|
}
|
|
116
116
|
}
|