@streamlayer/react 1.3.0 → 1.3.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.
@@ -1,6 +1,6 @@
1
1
  import { jsx as o, jsxs as d } from "react/jsx-runtime";
2
2
  import { useEffect as F, useRef as z, useMemo as W } from "react";
3
- import { a as A, s as n, c as H, Q as K, e as g, u as I, L as Q } from "./provider.js";
3
+ import { a as g, s as n, c as H, Q as K, e as A, u as I, L as Q } from "./provider.js";
4
4
  import { F as J, u as V, d as X } from "./index2.js";
5
5
  import { P as u, a as h, S as Y } from "./useStreamLayerApp2.js";
6
6
  const Z = /* @__PURE__ */ n("div")({
@@ -17,7 +17,7 @@ const Z = /* @__PURE__ */ n("div")({
17
17
  onAnimationEnd: l
18
18
  }) => /* @__PURE__ */ o(Z, {
19
19
  style: s,
20
- className: A(r, ee, re(i), a && !t && te(i), a && t && ie(i)),
20
+ className: g(r, ee, re(i), a && !t && te(i), a && t && ie(i)),
21
21
  onAnimationEnd: l,
22
22
  children: e
23
23
  }), le = /* @__PURE__ */ n("a")({
@@ -38,10 +38,12 @@ const Z = /* @__PURE__ */ n("div")({
38
38
  propsAsIs: !1
39
39
  }), ue = ({ promotion: e, promotionId: s, hiding: r, direction: a = "bottom" }) => {
40
40
  var t;
41
- return (t = e.additionalBanner) != null && t.imageUrl ? /* @__PURE__ */ o(q, { direction: a, hiding: r, children: /* @__PURE__ */ o(de, { children: /* @__PURE__ */ o(
41
+ return (t = e.additionalBanner) != null && t.imageUrl ? /* @__PURE__ */ o(q, { direction: a, hiding: r, children: /* @__PURE__ */ o(de, { className: "BannerContainer", children: /* @__PURE__ */ o(
42
42
  pe,
43
43
  {
44
+ className: "BannerLink",
44
45
  href: e.additionalBanner.url,
46
+ style: { backgroundImage: `url(${e.additionalBanner.imageUrl})` },
45
47
  "data-promo-id": s,
46
48
  "data-promo-type": e.type,
47
49
  "data-analytics": "banner",
@@ -65,11 +67,11 @@ const Z = /* @__PURE__ */ n("div")({
65
67
  name: "HeaderContent",
66
68
  class: "h149e3gp",
67
69
  propsAsIs: !1
68
- }), Ae = "h10toh7", U = /* @__PURE__ */ n("img")({
70
+ }), ge = "h10toh7", D = /* @__PURE__ */ n("img")({
69
71
  name: "SponsorLogo",
70
72
  class: "s1jyea6t",
71
73
  propsAsIs: !1
72
- }), ge = /* @__PURE__ */ n("div")({
74
+ }), Ae = /* @__PURE__ */ n("div")({
73
75
  name: "SponsorName",
74
76
  class: "szpfa3h",
75
77
  propsAsIs: !1
@@ -81,7 +83,7 @@ const Z = /* @__PURE__ */ n("div")({
81
83
  name: "PromoImg",
82
84
  class: "p1l37r8s",
83
85
  propsAsIs: !1
84
- }), $e = "s1nmch9k", D = /* @__PURE__ */ n("div")({
86
+ }), $e = "s1nmch9k", R = /* @__PURE__ */ n("div")({
85
87
  name: "Content",
86
88
  class: "c1er0ljd",
87
89
  propsAsIs: !1
@@ -97,19 +99,19 @@ const Z = /* @__PURE__ */ n("div")({
97
99
  name: "SponsorText",
98
100
  class: "s1evcmtq",
99
101
  propsAsIs: !1
100
- }), Me = /* @__PURE__ */ n("div")({
102
+ }), Ne = /* @__PURE__ */ n("div")({
101
103
  name: "ADLogo",
102
104
  class: "awodx0x",
103
105
  propsAsIs: !1
104
- }), Ne = /* @__PURE__ */ n("span")({
106
+ }), Be = /* @__PURE__ */ n("span")({
105
107
  name: "SponsoredText",
106
108
  class: "s1q3n6oi",
107
109
  propsAsIs: !1
108
- }), Be = /* @__PURE__ */ n("div")({
110
+ }), Me = /* @__PURE__ */ n("div")({
109
111
  name: "CloseIconWrap",
110
112
  class: "c8d4xfk",
111
113
  propsAsIs: !1
112
- }), Ee = () => H, Te = /* @__PURE__ */ n(Ee())({
114
+ }), Te = () => H, Ee = /* @__PURE__ */ n(Te())({
113
115
  name: "CloseIcon",
114
116
  class: "ct6oobh",
115
117
  propsAsIs: !0
@@ -126,12 +128,12 @@ const Z = /* @__PURE__ */ n("div")({
126
128
  class: "t3vxzaw",
127
129
  propsAsIs: !1
128
130
  }), je = "h10f3u0j", G = ({ promotion: e, promotionId: s, onClose: r }) => {
129
- var a, t, i, l, p, m, c, v, f, $, k, S, C, M, N, B, E, T, L, x, _, j, P, O, w, R;
131
+ var a, t, i, l, p, m, c, v, f, $, k, S, C, N, B, M, T, E, L, x, _, j, P, O, U, w;
130
132
  const y = e.type === u.INGAME_IAB11_LBAR || e.type === u.INGAME_IAB11, b = ((a = e.sponsor) == null ? void 0 : a.logo) && e.logoMode === h.CENTER;
131
133
  return /* @__PURE__ */ d(he, { className: "PromoOverlay", children: [
132
134
  /* @__PURE__ */ d(ye, { children: [
133
- /* @__PURE__ */ d(be, { className: A(!b && Ae), children: [
134
- ((t = e.sponsor) == null ? void 0 : t.logo) && e.logoMode === h.LEFT && /* @__PURE__ */ o(U, { src: (i = e.sponsor) == null ? void 0 : i.logo, alt: "promo" }),
135
+ /* @__PURE__ */ d(be, { className: g(!b && ge), children: [
136
+ ((t = e.sponsor) == null ? void 0 : t.logo) && e.logoMode === h.LEFT && /* @__PURE__ */ o(D, { src: (i = e.sponsor) == null ? void 0 : i.logo, alt: "promo" }),
135
137
  /* @__PURE__ */ d(
136
138
  Se,
137
139
  {
@@ -139,27 +141,27 @@ const Z = /* @__PURE__ */ n("div")({
139
141
  paddingLeft: (l = e.sponsor) != null && l.logo && e.logoMode === h.LEFT ? "0px" : "8px"
140
142
  },
141
143
  children: [
142
- ((p = e.sponsor) == null ? void 0 : p.logo) && e.logoMode === h.LEFT && /* @__PURE__ */ o(ge, { children: (m = e.sponsor) == null ? void 0 : m.name }),
143
- /* @__PURE__ */ d(Ce, { children: [
144
- /* @__PURE__ */ o(Me, { children: "AD" }),
145
- /* @__PURE__ */ o(Ne, { children: "SPONSORED" })
144
+ ((p = e.sponsor) == null ? void 0 : p.logo) && e.logoMode === h.LEFT && /* @__PURE__ */ o(Ae, { children: (m = e.sponsor) == null ? void 0 : m.name }),
145
+ /* @__PURE__ */ d(Ce, { className: "SponsorText", children: [
146
+ /* @__PURE__ */ o(Ne, { children: "AD" }),
147
+ /* @__PURE__ */ o(Be, { children: "SPONSORED" })
146
148
  ] })
147
149
  ]
148
150
  }
149
151
  )
150
152
  ] }),
151
- /* @__PURE__ */ o(Be, { onClick: r, children: /* @__PURE__ */ o(Te, { name: "icon-cross" }) })
153
+ /* @__PURE__ */ o(Me, { className: "ClosePromoIcon", onClick: r, children: /* @__PURE__ */ o(Ee, { name: "icon-cross" }) })
152
154
  ] }),
153
155
  /* @__PURE__ */ d(Ie, { children: [
154
- b && /* @__PURE__ */ o(U, { className: $e, src: (c = e.sponsor) == null ? void 0 : c.logo, alt: "promo" }),
155
- /* @__PURE__ */ o(D, { children: (f = (v = e.banner) == null ? void 0 : v.video) != null && f.url ? /* @__PURE__ */ o(
156
+ b && /* @__PURE__ */ o(D, { className: $e, src: (c = e.sponsor) == null ? void 0 : c.logo, alt: "promo" }),
157
+ /* @__PURE__ */ o(R, { children: (f = (v = e.banner) == null ? void 0 : v.video) != null && f.url ? /* @__PURE__ */ o(
156
158
  K,
157
159
  {
158
160
  source: (k = ($ = e.banner) == null ? void 0 : $.video) == null ? void 0 : k.url,
159
161
  poster: (C = (S = e.banner) == null ? void 0 : S.video) == null ? void 0 : C.thumbnailUrl,
160
162
  aspectRatio: y ? "1/1" : "16/9",
161
163
  onPlay: () => {
162
- g.emit("advertisement", {
164
+ A.emit("advertisement", {
163
165
  action: "videoPlay",
164
166
  payload: {
165
167
  advertisementId: s,
@@ -168,10 +170,10 @@ const Z = /* @__PURE__ */ n("div")({
168
170
  });
169
171
  }
170
172
  }
171
- ) : (M = e.banner) != null && M.imageUrl ? /* @__PURE__ */ o(fe, { style: y ? { aspectRatio: "1/1" } : {}, src: (N = e.banner) == null ? void 0 : N.imageUrl, alt: "promo" }) : null }),
172
- !y && /* @__PURE__ */ d(D, { children: [
173
- ((B = e.banner) == null ? void 0 : B.title) && /* @__PURE__ */ o(_e, { className: A(b && je), children: (E = e.banner) == null ? void 0 : E.title }),
174
- ((T = e.banner) == null ? void 0 : T.body) && /* @__PURE__ */ o(ke, { children: (L = e.banner) == null ? void 0 : L.body })
173
+ ) : (N = e.banner) != null && N.imageUrl ? /* @__PURE__ */ o(fe, { style: y ? { aspectRatio: "1/1" } : {}, src: (B = e.banner) == null ? void 0 : B.imageUrl, alt: "promo" }) : null }),
174
+ !y && /* @__PURE__ */ d(R, { children: [
175
+ ((M = e.banner) == null ? void 0 : M.title) && /* @__PURE__ */ o(_e, { className: g("AdvTitle", b && je), children: (T = e.banner) == null ? void 0 : T.title }),
176
+ ((E = e.banner) == null ? void 0 : E.body) && /* @__PURE__ */ o(ke, { className: "AdvDescription", children: (L = e.banner) == null ? void 0 : L.body })
175
177
  ] })
176
178
  ] }),
177
179
  /* @__PURE__ */ o(Le, { children: /* @__PURE__ */ o(
@@ -186,7 +188,7 @@ const Z = /* @__PURE__ */ n("div")({
186
188
  "data-promo-id": s,
187
189
  "data-promo-type": e.type,
188
190
  target: "_blank",
189
- children: (R = (w = e.banner) == null ? void 0 : w.ctaButton) == null ? void 0 : R.label
191
+ children: (w = (U = e.banner) == null ? void 0 : U.ctaButton) == null ? void 0 : w.label
190
192
  }
191
193
  ) })
192
194
  ] });
@@ -208,16 +210,16 @@ const Z = /* @__PURE__ */ n("div")({
208
210
  children: /* @__PURE__ */ o(Pe, {
209
211
  children: e
210
212
  })
211
- }), we = (e) => (e == null ? void 0 : e.type) === u.INGAME_IAB11_LBAR || (e == null ? void 0 : e.type) === u.INGAME_IAB21_LBAR, Re = (e) => (e == null ? void 0 : e.type) === u.INGAME_IAB11 || (e == null ? void 0 : e.type) === u.INGAME_IAB21, Ue = ({ advertisement: e, skipTypeCheck: s, layoutMode: r = "side-by-side", sidebar: a, banner: t }) => {
213
+ }), Ue = (e) => (e == null ? void 0 : e.type) === u.INGAME_IAB11_LBAR || (e == null ? void 0 : e.type) === u.INGAME_IAB21_LBAR, we = (e) => (e == null ? void 0 : e.type) === u.INGAME_IAB11 || (e == null ? void 0 : e.type) === u.INGAME_IAB21, De = ({ advertisement: e, skipTypeCheck: s, layoutMode: r = "side-by-side", sidebar: a, banner: t }) => {
212
214
  const i = I(e.data);
213
215
  return !i.data && i.loading ? null : i.error ? /* @__PURE__ */ d("div", { children: [
214
216
  "error ",
215
217
  /* @__PURE__ */ o("button", { onClick: e.close, children: "close" })
216
- ] }) : i.data ? !a && !t && (s || Re(i.data)) ? /* @__PURE__ */ o(ve, { className: "PromoOverlayContainer", children: /* @__PURE__ */ o(G, { promotionId: e.id, promotion: i.data, onClose: e.close }) }) : a && (s || we(i.data)) ? /* @__PURE__ */ o(Oe, { className: "PromoSidebarContainer", direction: a, hiding: e.hiding, children: /* @__PURE__ */ o(G, { promotionId: e.id, promotion: i.data, onClose: e.close }) }) : t ? /* @__PURE__ */ o(ue, { promotionId: e.id, hiding: e.hiding, promotion: i.data, direction: t }) : null : /* @__PURE__ */ d("div", { children: [
218
+ ] }) : i.data ? !a && !t && (s || we(i.data)) ? /* @__PURE__ */ o(ve, { className: "PromoOverlayContainer", children: /* @__PURE__ */ o(G, { promotionId: e.id, promotion: i.data, onClose: e.close }) }) : a && (s || Ue(i.data)) ? /* @__PURE__ */ o(Oe, { className: "PromoSidebarContainer", direction: a, hiding: e.hiding, children: /* @__PURE__ */ o(G, { promotionId: e.id, promotion: i.data, onClose: e.close }) }) : t ? /* @__PURE__ */ o(ue, { promotionId: e.id, hiding: e.hiding, promotion: i.data, direction: t }) : null : /* @__PURE__ */ d("div", { children: [
217
219
  "empty promo ",
218
220
  /* @__PURE__ */ o("button", { onClick: e.close, children: "close" })
219
221
  ] });
220
- }, De = /* @__PURE__ */ n("div")({
222
+ }, Re = /* @__PURE__ */ n("div")({
221
223
  name: "AdvertisementUIWrap",
222
224
  class: "aa6pjif",
223
225
  propsAsIs: !1
@@ -225,13 +227,13 @@ const Z = /* @__PURE__ */ n("div")({
225
227
  const s = e.target;
226
228
  if (s instanceof HTMLAnchorElement && s.target === "_blank") {
227
229
  const r = s.getAttribute("data-promo-id") || "", a = s.getAttribute("data-promo-type") || u.UNSET;
228
- s.getAttribute("data-analytics") === "button" && g.emit("advertisement", {
230
+ s.getAttribute("data-analytics") === "button" && A.emit("advertisement", {
229
231
  action: "buttonSelect",
230
232
  payload: {
231
233
  advertisementId: r,
232
234
  advertisementType: a
233
235
  }
234
- }), s.getAttribute("data-analytics") === "banner" && g.emit("advertisement", {
236
+ }), s.getAttribute("data-analytics") === "banner" && A.emit("advertisement", {
235
237
  action: "bannerSelect",
236
238
  payload: {
237
239
  advertisementId: r,
@@ -258,13 +260,13 @@ const Z = /* @__PURE__ */ n("div")({
258
260
  enabled: !!c,
259
261
  event: "click",
260
262
  listener: Ge
261
- }), c ? /* @__PURE__ */ o(De, {
263
+ }), c ? /* @__PURE__ */ o(Re, {
262
264
  ref: p,
263
265
  style: {
264
266
  height: !t && !a ? "auto" : "100%"
265
267
  },
266
268
  className: i ? "mobile-view" : "",
267
- children: /* @__PURE__ */ o(Ue, {
269
+ children: /* @__PURE__ */ o(De, {
268
270
  skipTypeCheck: r,
269
271
  sidebar: a,
270
272
  banner: t,