@streamlayer/react-ui 1.13.1 → 1.13.2

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.
@@ -1,79 +1,81 @@
1
1
  import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
- import { cx as $ } from "@linaria/core";
3
- import { useEffect as c } from "react";
4
- import { eventBus as Z } from "@streamlayer/sdk-web-interfaces";
5
- import { PromotionType as q, PromotionLogoMode as i, AutoPlayVideo as oo, PromotionButtonType as eo } from "@streamlayer/sdk-web-types";
6
- import { CloseButton as ro } from "../../close-btn/index.js";
7
- import { VideoPlayer as to } from "../../video-player/index.js";
8
- import { ExternalAdOverlay as no } from "./externalAd/index.js";
9
- import { PromoOverlay as ao, Header as lo, HeaderContent as io, headerContentShift as so, SponsorLogo as z, Sponsor as mo, SponsorName as po, SponsorText as co, ADLogo as yo, SponsoredText as uo, Media as fo, shiftMedia as bo, Content as J, PromoImg as ho, Title as Ao, hideOnMobile as To, Description as vo, ActionBtnWrap as No, ActionButton as xo } from "./styles.js";
10
- import { OverlayContainer as Uo } from "./styles.js";
11
- const Io = (y) => {
12
- var f, b, h, A, T, v, N, x, P, B, C, E, g, O, M, L, S, I, D, R, U, _, k, F, V, j, G, H, w, W;
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: K,
15
+ advertisementPaused: X,
16
16
  togglePause: r,
17
17
  controlVideo: n,
18
- skipAutoClose: Q,
18
+ skipAutoClose: Y,
19
19
  promotionId: l,
20
- onClose: X,
21
- markAsViewed: s,
22
- externalAd: u
23
- } = y, d = o.type === q.INGAME_IAB11_LBAR || o.type === q.INGAME_IAB11, m = ((f = o.sponsor) == null ? void 0 : f.logo) && o.logoMode === i.CENTER, Y = !!((h = (b = o.banner) == null ? void 0 : b.video) != null && h.url), p = o.autoPlayVideo === oo.ENABLED;
24
- if (c(() => {
25
- r == null || r(Y || p);
26
- }, []), c(() => {
27
- l && o.type && s && s();
28
- }, [l, o.type, s]), c(() => () => {
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]), u)
31
- return /* @__PURE__ */ e(no, { ...y, externalAd: u });
32
- let a = (A = o.banner) == null ? void 0 : A.url;
33
- return a && a.indexOf("http") !== 0 && (a = `https://${a}`), /* @__PURE__ */ t(ao, { className: "PromoOverlay", children: [
34
- /* @__PURE__ */ t(lo, { children: [
35
- /* @__PURE__ */ t(io, { className: $(!m && so), children: [
36
- ((T = o.sponsor) == null ? void 0 : T.logo) && o.logoMode === i.LEFT && /* @__PURE__ */ e(z, { src: (v = o.sponsor) == null ? void 0 : v.logo, alt: "promo" }),
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
- mo,
40
+ po,
39
41
  {
40
42
  style: {
41
- paddingLeft: (N = o.sponsor) != null && N.logo && o.logoMode === i.LEFT ? "0px" : "8px"
43
+ paddingLeft: (x = o.sponsor) != null && x.logo && o.logoMode === s.LEFT ? "0px" : "8px"
42
44
  },
43
45
  children: [
44
- ((x = o.sponsor) == null ? void 0 : x.logo) && o.logoMode === i.LEFT && /* @__PURE__ */ e(po, { children: (P = o.sponsor) == null ? void 0 : P.name }),
45
- /* @__PURE__ */ t(co, { className: "SponsorText", children: [
46
- /* @__PURE__ */ e(yo, { children: "AD" }),
47
- /* @__PURE__ */ e(uo, { children: "SPONSORED" })
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
- ro,
56
+ to,
55
57
  {
56
58
  className: "ClosePromoIcon",
57
- close: X,
58
- autoClose: (B = o.closeTimer) == null ? void 0 : B.auto,
59
- duration: Q ? 0 : (C = o.closeTimer) == null ? void 0 : C.seconds,
60
- isPlaying: !K
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(fo, { children: [
65
- m && /* @__PURE__ */ e(z, { className: bo, src: (E = o.sponsor) == null ? void 0 : E.logo, alt: "promo" }),
66
- /* @__PURE__ */ e(J, { children: (O = (g = o.banner) == null ? void 0 : g.video) != null && O.url ? /* @__PURE__ */ e(
67
- to,
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: (L = (M = o.banner) == null ? void 0 : M.video) == null ? void 0 : L.url,
70
- poster: (I = (S = o.banner) == null ? void 0 : S.video) == null ? void 0 : I.thumbnailUrl,
71
- aspectRatio: d ? "1/1" : "16/9",
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
- p && (r == null || r(!0));
75
+ i && (r == null || r(!0));
74
76
  },
75
77
  onPlay: () => {
76
- Z.emit("advertisement", {
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: p
87
+ autoPlay: i
86
88
  }
87
- ) : (D = o.banner) != null && D.imageUrl ? /* @__PURE__ */ e(ho, { style: d ? { aspectRatio: "1/1" } : {}, src: (R = o.banner) == null ? void 0 : R.imageUrl, alt: "promo" }) : null }),
88
- !d && /* @__PURE__ */ t(J, { children: [
89
- ((U = o.banner) == null ? void 0 : U.title) && /* @__PURE__ */ e(Ao, { className: $("AdvTitle", m && To), children: (_ = o.banner) == null ? void 0 : _.title }),
90
- ((k = o.banner) == null ? void 0 : k.body) && /* @__PURE__ */ e(vo, { className: "AdvDescription", children: (F = o.banner) == null ? void 0 : F.body })
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 !== eo.NO_BUTTON && /* @__PURE__ */ e(No, { children: /* @__PURE__ */ e(
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: ((j = (V = o.banner) == null ? void 0 : V.ctaButton) == null ? void 0 : j.color) || "#009dc4",
99
- color: ((H = (G = o.banner) == null ? void 0 : G.ctaButton) == null ? void 0 : H.textColor) || "#fff"
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: (W = (w = o.banner) == null ? void 0 : w.ctaButton) == null ? void 0 : W.label
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
- Io as Overlay,
112
- Uo as OverlayContainer
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.1",
3
+ "version": "1.13.2",
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.10.0",
63
- "@streamlayer/sdk-web": "^1.6.1",
64
- "@streamlayer/sdk-web-analytics": "^1.4.9",
65
- "@streamlayer/sdk-web-anonymous-auth": "^1.1.9",
66
- "@streamlayer/sdk-web-api": "^1.6.9",
67
- "@streamlayer/sdk-web-core": "^1.7.1",
68
- "@streamlayer/sdk-web-features": "^1.0.30",
69
- "@streamlayer/sdk-web-interfaces": "^1.2.9",
70
- "@streamlayer/sdk-web-logger": "^1.0.30",
71
- "@streamlayer/sdk-web-notifications": "^1.2.9",
72
- "@streamlayer/sdk-web-storage": "^1.0.30",
73
- "@streamlayer/sdk-web-types": "^1.8.3"
62
+ "@streamlayer/feature-gamification": "^1.10.1",
63
+ "@streamlayer/sdk-web": "^1.6.2",
64
+ "@streamlayer/sdk-web-analytics": "^1.4.10",
65
+ "@streamlayer/sdk-web-anonymous-auth": "^1.1.10",
66
+ "@streamlayer/sdk-web-api": "^1.6.10",
67
+ "@streamlayer/sdk-web-core": "^1.7.2",
68
+ "@streamlayer/sdk-web-features": "^1.0.31",
69
+ "@streamlayer/sdk-web-interfaces": "^1.2.10",
70
+ "@streamlayer/sdk-web-logger": "^1.0.31",
71
+ "@streamlayer/sdk-web-notifications": "^1.2.10",
72
+ "@streamlayer/sdk-web-storage": "^1.0.31",
73
+ "@streamlayer/sdk-web-types": "^1.8.4"
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.1"
114
+ "@streamlayer/react": "^1.9.2"
115
115
  }
116
116
  }