@streamlayer/react 1.20.6 → 1.20.7
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/cjs/advertisement.js +29 -29
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index2.js +4 -4
- package/lib/cjs/insight.js +1 -1
- package/lib/cjs/masters2.js +7 -7
- package/lib/cjs/notification.js +1 -1
- package/lib/cjs/pause-ad.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/provider.js +15 -39
- package/lib/cjs/useStreamLayerApp2.js +16 -17
- package/lib/classic/cjs/advertisement.js +29 -29
- package/lib/classic/cjs/bet-pack.js +4 -4
- package/lib/classic/cjs/index.js +1 -1
- package/lib/classic/cjs/insight.js +1 -1
- package/lib/classic/cjs/notification.js +1 -1
- package/lib/classic/cjs/pause-ad.js +1 -1
- package/lib/classic/cjs/points.js +1 -1
- package/lib/classic/cjs/provider.js +10 -34
- package/lib/classic/cjs/useStreamLayerApp2.js +16 -17
- package/lib/classic/es/advertisement.js +2193 -2265
- package/lib/classic/es/bet-pack.js +14 -12
- package/lib/classic/es/index.js +16 -11
- package/lib/classic/es/insight.js +35 -30
- package/lib/classic/es/notification.js +108 -103
- package/lib/classic/es/pause-ad.js +63 -58
- package/lib/classic/es/points.js +28 -23
- package/lib/classic/es/provider.js +4290 -10434
- package/lib/classic/es/useStreamLayerApp.js +1 -1
- package/lib/classic/es/useStreamLayerApp2.js +3111 -5772
- package/lib/dist/cjs/gamification-feature2.js +1 -1
- package/lib/dist/cjs/index.js +1 -1
- package/lib/dist/cjs/masters.js +35 -60
- package/lib/dist/es/gamification-feature2.js +112 -105
- package/lib/dist/es/index.js +12 -7
- package/lib/dist/es/masters.js +9909 -18734
- package/lib/es/advertisement.js +2193 -2265
- package/lib/es/index.js +16 -11
- package/lib/es/index2.js +12 -10
- package/lib/es/insight.js +35 -30
- package/lib/es/masters2.js +28 -25
- package/lib/es/notification.js +135 -130
- package/lib/es/pause-ad.js +63 -58
- package/lib/es/points.js +28 -23
- package/lib/es/provider.js +4317 -10469
- package/lib/es/useStreamLayerApp.js +1 -1
- package/lib/es/useStreamLayerApp2.js +3111 -5772
- package/package.json +15 -15
package/lib/es/pause-ad.js
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { jsx as o, jsxs as I } from "react/jsx-runtime";
|
|
2
|
+
import { j as K, k as V, s as p, e as L, l as F, n as M, f as _, u as $, d as j, h as q } from "./provider.js";
|
|
3
|
+
import "nanostores";
|
|
4
|
+
import { useRef as x, useCallback as k, useState as C, useEffect as b, Component as z } from "react";
|
|
5
|
+
import "@nanostores/react";
|
|
6
|
+
import "lodash.throttle";
|
|
7
|
+
import "react-dom";
|
|
8
|
+
import "react-countup";
|
|
4
9
|
import { c as N } from "./vast-client.min-B0NUra1B.js";
|
|
5
|
-
const G = {}, H = new N(), w = V(G), E = K("ui:gam-static"),
|
|
10
|
+
const G = {}, H = new N(), w = V(G), E = K("ui:gam-static"), R = (r) => new Promise((e, n) => {
|
|
6
11
|
const s = new Image();
|
|
7
|
-
s.onload = () => e(r), s.onerror = () =>
|
|
12
|
+
s.onload = () => e(r), s.onerror = () => n(), s.src = r;
|
|
8
13
|
}), D = () => {
|
|
9
14
|
const r = x(0);
|
|
10
|
-
return [
|
|
11
|
-
var
|
|
12
|
-
if ((
|
|
15
|
+
return [k(async (e) => {
|
|
16
|
+
var n, s, c, a, l, t, u, i, h, m, f;
|
|
17
|
+
if ((n = w.get()[e]) != null && n.imageSrc)
|
|
13
18
|
return { success: !0 };
|
|
14
19
|
const v = Date.now();
|
|
15
20
|
r.current = v, w.setKey(e, { url: e });
|
|
@@ -22,15 +27,15 @@ const G = {}, H = new N(), w = V(G), E = K("ui:gam-static"), U = (r) => new Prom
|
|
|
22
27
|
const g = y.creatives.find((S) => S.type === "nonlinear");
|
|
23
28
|
if (g) {
|
|
24
29
|
E.debug(g, "nonlinear");
|
|
25
|
-
const S = (c = (s = g.variations) == null ? void 0 : s[0]) == null ? void 0 : c.staticResource, B = (l = (
|
|
30
|
+
const S = (c = (s = g.variations) == null ? void 0 : s[0]) == null ? void 0 : c.staticResource, B = (l = (a = g.variations) == null ? void 0 : a[0]) == null ? void 0 : l.nonlinearClickThroughURLTemplate;
|
|
26
31
|
if (S)
|
|
27
|
-
return await
|
|
32
|
+
return await R(S), w.setKey(e, { url: e, imageSrc: S, adUrl: B }), { success: !0 };
|
|
28
33
|
}
|
|
29
34
|
const A = y.creatives.find((S) => S.type === "companion");
|
|
30
35
|
E.debug(A, "companion");
|
|
31
|
-
const T = (h = (i = (u = (
|
|
36
|
+
const T = (h = (i = (u = (t = A == null ? void 0 : A.variations) == null ? void 0 : t[0]) == null ? void 0 : u.staticResources) == null ? void 0 : i[0]) == null ? void 0 : h.url, P = (f = (m = A == null ? void 0 : A.variations) == null ? void 0 : m[0]) == null ? void 0 : f.companionClickThroughURLTemplate;
|
|
32
37
|
if (T)
|
|
33
|
-
return await
|
|
38
|
+
return await R(T), w.setKey(e, { url: e, imageSrc: T, adUrl: P }), { success: !0 };
|
|
34
39
|
}
|
|
35
40
|
}
|
|
36
41
|
} catch (d) {
|
|
@@ -78,20 +83,20 @@ const G = {}, H = new N(), w = V(G), E = K("ui:gam-static"), U = (r) => new Prom
|
|
|
78
83
|
name: "PauseAdSidebar",
|
|
79
84
|
class: "p14estxv",
|
|
80
85
|
propsAsIs: !1
|
|
81
|
-
}),
|
|
86
|
+
}), te = /* @__PURE__ */ p("span")({
|
|
82
87
|
name: "PauseAdTitleDescription",
|
|
83
88
|
class: "p1dpvfl1",
|
|
84
89
|
propsAsIs: !1
|
|
85
|
-
}),
|
|
90
|
+
}), U = /* @__PURE__ */ p("img")({
|
|
86
91
|
name: "ExternalAdContainer",
|
|
87
92
|
class: "ezfmabr",
|
|
88
93
|
propsAsIs: !1
|
|
89
|
-
}),
|
|
94
|
+
}), ne = ({ vastUrl: r }) => {
|
|
90
95
|
var e;
|
|
91
|
-
const [,
|
|
92
|
-
return (e = s == null ? void 0 : s[r]) != null && e.imageSrc ? s[r].adUrl ? /* @__PURE__ */
|
|
93
|
-
},
|
|
94
|
-
const
|
|
96
|
+
const [, n] = D(), s = _(n, { keys: [r] });
|
|
97
|
+
return (e = s == null ? void 0 : s[r]) != null && e.imageSrc ? s[r].adUrl ? /* @__PURE__ */ o("a", { href: s[r].adUrl, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ o(U, { src: s[r].imageSrc }) }) : /* @__PURE__ */ o(U, { src: s[r].imageSrc }) : null;
|
|
98
|
+
}, oe = ({ isClosing: r, title: e, caption: n, onPlay: s, onClose: c, vastUrl: a, options: l }) => {
|
|
99
|
+
const t = (l == null ? void 0 : l.showPauseButton) ?? !0, { ref: u, focusSelf: i } = F.useFocusable({
|
|
95
100
|
focusKey: "sl-pause-ad-play",
|
|
96
101
|
onEnterRelease: s,
|
|
97
102
|
isFocusBoundary: !0,
|
|
@@ -108,14 +113,14 @@ const G = {}, H = new N(), w = V(G), E = K("ui:gam-static"), U = (r) => new Prom
|
|
|
108
113
|
}
|
|
109
114
|
};
|
|
110
115
|
return window.addEventListener("keydown", h, { capture: !0 }), () => window.removeEventListener("keydown", h, { capture: !0 });
|
|
111
|
-
}, [c]), /* @__PURE__ */
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */
|
|
116
|
+
}, [c]), /* @__PURE__ */ o(O, { className: M(r && "pause-ad-closing"), children: /* @__PURE__ */ I(J, { children: [
|
|
117
|
+
/* @__PURE__ */ o(Q, {}),
|
|
118
|
+
/* @__PURE__ */ o(W, {}),
|
|
114
119
|
/* @__PURE__ */ I(X, { children: [
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ o(Y, { children: e }),
|
|
121
|
+
/* @__PURE__ */ o(Z, { children: n })
|
|
117
122
|
] }),
|
|
118
|
-
|
|
123
|
+
t && /* @__PURE__ */ o(ee, { children: /* @__PURE__ */ o(
|
|
119
124
|
re,
|
|
120
125
|
{
|
|
121
126
|
ref: u,
|
|
@@ -125,21 +130,21 @@ const G = {}, H = new N(), w = V(G), E = K("ui:gam-static"), U = (r) => new Prom
|
|
|
125
130
|
}
|
|
126
131
|
) }),
|
|
127
132
|
/* @__PURE__ */ I(se, { children: [
|
|
128
|
-
|
|
129
|
-
/* @__PURE__ */
|
|
133
|
+
a && /* @__PURE__ */ o(ne, { vastUrl: a }),
|
|
134
|
+
/* @__PURE__ */ o(te, { children: "ADVERTISEMENT" })
|
|
130
135
|
] })
|
|
131
136
|
] }) });
|
|
132
|
-
},
|
|
137
|
+
}, ae = ({
|
|
133
138
|
showPauseAd: r,
|
|
134
139
|
vastUrls: e,
|
|
135
|
-
title:
|
|
140
|
+
title: n,
|
|
136
141
|
caption: s,
|
|
137
142
|
onPlay: c,
|
|
138
|
-
onClose:
|
|
143
|
+
onClose: a,
|
|
139
144
|
onRender: l,
|
|
140
|
-
options:
|
|
145
|
+
options: t
|
|
141
146
|
}) => {
|
|
142
|
-
const u = (
|
|
147
|
+
const u = (t == null ? void 0 : t.pauseAdDelay) ?? 5e3, [i, h] = C(!1), [m, f] = C(!1), v = x(), d = e == null ? void 0 : e[0].url, y = x(d);
|
|
143
148
|
y.current = d;
|
|
144
149
|
const [g, A] = D();
|
|
145
150
|
return b(() => {
|
|
@@ -148,9 +153,9 @@ const G = {}, H = new N(), w = V(G), E = K("ui:gam-static"), U = (r) => new Prom
|
|
|
148
153
|
action: "enabled",
|
|
149
154
|
payload: {}
|
|
150
155
|
}), g(d).then((P) => {
|
|
151
|
-
y.current === d && (P == null ? void 0 : P.success) !== !0 && (clearTimeout(v.current),
|
|
156
|
+
y.current === d && (P == null ? void 0 : P.success) !== !0 && (clearTimeout(v.current), a == null || a());
|
|
152
157
|
}).catch(() => {
|
|
153
|
-
y.current === d && (clearTimeout(v.current),
|
|
158
|
+
y.current === d && (clearTimeout(v.current), a == null || a());
|
|
154
159
|
});
|
|
155
160
|
const T = () => {
|
|
156
161
|
var P;
|
|
@@ -174,49 +179,49 @@ const G = {}, H = new N(), w = V(G), E = K("ui:gam-static"), U = (r) => new Prom
|
|
|
174
179
|
return () => {
|
|
175
180
|
v.current && clearTimeout(v.current);
|
|
176
181
|
};
|
|
177
|
-
}, [A, g,
|
|
182
|
+
}, [A, g, a, u, r, d]), b(() => {
|
|
178
183
|
l == null || l({ rendered: i });
|
|
179
184
|
}, [i, l]), b(() => () => {
|
|
180
185
|
l == null || l({ rendered: !1 });
|
|
181
|
-
}, [l]), i ? /* @__PURE__ */
|
|
182
|
-
|
|
186
|
+
}, [l]), i ? /* @__PURE__ */ o(
|
|
187
|
+
oe,
|
|
183
188
|
{
|
|
184
|
-
onClose:
|
|
189
|
+
onClose: a,
|
|
185
190
|
isClosing: m,
|
|
186
|
-
title:
|
|
191
|
+
title: n,
|
|
187
192
|
caption: s,
|
|
188
193
|
onPlay: c,
|
|
189
194
|
vastUrl: d,
|
|
190
|
-
options:
|
|
195
|
+
options: t
|
|
191
196
|
}
|
|
192
197
|
) : null;
|
|
193
198
|
}, le = ({
|
|
194
199
|
showPauseAd: r,
|
|
195
200
|
pauseAdVastUrl: e,
|
|
196
|
-
videoPlayerController:
|
|
201
|
+
videoPlayerController: n,
|
|
197
202
|
onRenderPauseAd: s,
|
|
198
203
|
onClosePauseAd: c,
|
|
199
|
-
children:
|
|
204
|
+
children: a,
|
|
200
205
|
options: l
|
|
201
206
|
}) => {
|
|
202
|
-
const
|
|
207
|
+
const t = $(), u = j(), i = x(), h = k(() => {
|
|
203
208
|
c == null || c();
|
|
204
|
-
}, [c]), m =
|
|
205
|
-
|
|
206
|
-
}, [
|
|
207
|
-
return b(() =>
|
|
208
|
-
i.current &&
|
|
209
|
+
}, [c]), m = k(() => {
|
|
210
|
+
t == null || t.controlVideoPlayer({ play: !0 });
|
|
211
|
+
}, [t]);
|
|
212
|
+
return b(() => t ? (n && (i.current = n, t.addVideoPlayerController(i.current)), () => {
|
|
213
|
+
i.current && t.removeVideoPlayerController(i.current);
|
|
209
214
|
}) : () => {
|
|
210
|
-
}, [
|
|
215
|
+
}, [t, n]), t ? /* @__PURE__ */ o("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ I(
|
|
211
216
|
q,
|
|
212
217
|
{
|
|
213
218
|
style: { position: "relative" },
|
|
214
219
|
customTheme: u.theme,
|
|
215
220
|
themeMode: u.themeMode,
|
|
216
221
|
children: [
|
|
217
|
-
|
|
218
|
-
e && /* @__PURE__ */
|
|
219
|
-
|
|
222
|
+
a,
|
|
223
|
+
e && /* @__PURE__ */ o(
|
|
224
|
+
ae,
|
|
220
225
|
{
|
|
221
226
|
showPauseAd: r,
|
|
222
227
|
vastUrls: e,
|
|
@@ -228,22 +233,22 @@ const G = {}, H = new N(), w = V(G), E = K("ui:gam-static"), U = (r) => new Prom
|
|
|
228
233
|
)
|
|
229
234
|
]
|
|
230
235
|
}
|
|
231
|
-
) }) :
|
|
236
|
+
) }) : a;
|
|
232
237
|
};
|
|
233
|
-
class
|
|
238
|
+
class ye extends z {
|
|
234
239
|
constructor(e) {
|
|
235
240
|
super(e), this.state = { hasError: !1 };
|
|
236
241
|
}
|
|
237
242
|
static getDerivedStateFromError() {
|
|
238
243
|
return { hasError: !0 };
|
|
239
244
|
}
|
|
240
|
-
componentDidCatch(e,
|
|
241
|
-
console.error(e,
|
|
245
|
+
componentDidCatch(e, n) {
|
|
246
|
+
console.error(e, n.componentStack);
|
|
242
247
|
}
|
|
243
248
|
render() {
|
|
244
|
-
return this.state.hasError ? this.props.children : /* @__PURE__ */
|
|
249
|
+
return this.state.hasError ? this.props.children : /* @__PURE__ */ o(le, { ...this.props });
|
|
245
250
|
}
|
|
246
251
|
}
|
|
247
252
|
export {
|
|
248
|
-
|
|
253
|
+
ye as StreamLayerPauseAd
|
|
249
254
|
};
|
package/lib/es/points.js
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useState as u, useEffect as d } from "react";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
3
|
+
import "@nanostores/react";
|
|
4
|
+
import "nanostores";
|
|
5
|
+
import { s as a, B as y, m as h, i as S, f, F as c, e as r, u as v, d as g, h as k } from "./provider.js";
|
|
6
|
+
import "lodash.throttle";
|
|
7
|
+
import "react-dom";
|
|
8
|
+
import "react-countup";
|
|
9
|
+
import { S as A } from "./useStreamLayerApp2.js";
|
|
10
|
+
const I = /* @__PURE__ */ a("div")({
|
|
6
11
|
name: "PointsContainer",
|
|
7
12
|
class: "psiob9b",
|
|
8
13
|
propsAsIs: !1
|
|
9
|
-
}),
|
|
14
|
+
}), P = /* @__PURE__ */ a("div")({
|
|
10
15
|
name: "PointsIcon",
|
|
11
16
|
class: "p1gqe4lh",
|
|
12
17
|
propsAsIs: !1
|
|
13
|
-
}),
|
|
18
|
+
}), b = () => y, T = /* @__PURE__ */ a(b())({
|
|
14
19
|
name: "PointsSvg",
|
|
15
20
|
class: "p15syg2y",
|
|
16
21
|
propsAsIs: !0
|
|
@@ -26,31 +31,31 @@ const A = /* @__PURE__ */ a("div")({
|
|
|
26
31
|
name: "PointsValue",
|
|
27
32
|
class: "prj9b3v",
|
|
28
33
|
propsAsIs: !1
|
|
29
|
-
}), B = ({ points: s, onClick: e }) => /* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */ t(
|
|
31
|
-
/* @__PURE__ */
|
|
34
|
+
}), B = ({ points: s, onClick: e }) => /* @__PURE__ */ m(I, { className: h, onClick: e, children: [
|
|
35
|
+
/* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(T, { name: "icon-trophy-solid" }) }),
|
|
36
|
+
/* @__PURE__ */ m(F, { children: [
|
|
32
37
|
/* @__PURE__ */ t(L, { children: "Total points" }),
|
|
33
38
|
/* @__PURE__ */ t(x, { children: /* @__PURE__ */ t(S, { value: s }) })
|
|
34
39
|
] })
|
|
35
40
|
] }), C = ({ gamification: s }) => {
|
|
36
|
-
const e = s.userSummary.$store, [
|
|
41
|
+
const e = s.userSummary.$store, [o, l] = u(0);
|
|
37
42
|
return d(() => {
|
|
38
|
-
const
|
|
39
|
-
var
|
|
40
|
-
(
|
|
43
|
+
const n = e.subscribe((i) => {
|
|
44
|
+
var p;
|
|
45
|
+
(p = i == null ? void 0 : i.summary) != null && p.points && l(i.summary.points);
|
|
41
46
|
});
|
|
42
47
|
return () => {
|
|
43
|
-
|
|
48
|
+
n();
|
|
44
49
|
};
|
|
45
|
-
}, [e]), /* @__PURE__ */ t(B, { points:
|
|
46
|
-
const
|
|
47
|
-
|
|
50
|
+
}, [e]), /* @__PURE__ */ t(B, { points: o, onClick: () => {
|
|
51
|
+
const n = s.status.get();
|
|
52
|
+
n === c.Suspended ? (s.openFeature(), r.emit("app", {
|
|
48
53
|
action: "open",
|
|
49
54
|
payload: {}
|
|
50
55
|
}), r.emit("interactions", {
|
|
51
56
|
action: "tap",
|
|
52
57
|
payload: {}
|
|
53
|
-
})) :
|
|
58
|
+
})) : n === c.Ready && (s.closeFeature(!1), r.emit("app", {
|
|
54
59
|
action: "close",
|
|
55
60
|
payload: {}
|
|
56
61
|
}), r.emit("interactions", {
|
|
@@ -61,12 +66,12 @@ const A = /* @__PURE__ */ a("div")({
|
|
|
61
66
|
}, j = ({ sdk: s }) => {
|
|
62
67
|
if (!f(s.featuresList.getStore()))
|
|
63
68
|
return null;
|
|
64
|
-
const e = s.getFeature(
|
|
69
|
+
const e = s.getFeature(A.GAMES);
|
|
65
70
|
return e ? /* @__PURE__ */ t(C, { gamification: e }) : null;
|
|
66
|
-
},
|
|
67
|
-
const e = v(),
|
|
68
|
-
return e ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(
|
|
71
|
+
}, V = ({ theme: s }) => {
|
|
72
|
+
const e = v(), o = g();
|
|
73
|
+
return e ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(k, { customTheme: s ?? o.theme, themeMode: o.themeMode, children: /* @__PURE__ */ t(j, { sdk: e }) }) }) : null;
|
|
69
74
|
};
|
|
70
75
|
export {
|
|
71
|
-
|
|
76
|
+
V as StreamLayerSDKPoints
|
|
72
77
|
};
|