@streamlayer/react 1.21.0 → 1.21.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.
- package/lib/cjs/advertisement.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/insight.js +1 -1
- 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 +14 -14
- package/lib/cjs/useStreamLayerApp2.js +1 -1
- package/lib/classic/cjs/advertisement.js +1 -1
- 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 +9 -9
- package/lib/classic/cjs/useStreamLayerApp2.js +1 -1
- package/lib/classic/es/advertisement.js +2 -3
- package/lib/classic/es/index.js +9 -10
- package/lib/classic/es/insight.js +6 -7
- package/lib/classic/es/notification.js +2 -3
- package/lib/classic/es/pause-ad.js +117 -124
- package/lib/classic/es/points.js +2 -3
- package/lib/classic/es/provider.js +2066 -2062
- package/lib/classic/es/useStreamLayerApp2.js +1 -1
- package/lib/dist/cjs/gamification-feature2.js +1 -1
- package/lib/dist/cjs/index.js +1 -1
- package/lib/dist/cjs/masters.js +22 -22
- package/lib/dist/es/gamification-feature2.js +71 -72
- package/lib/dist/es/index.js +6 -7
- package/lib/dist/es/masters.js +3089 -3074
- package/lib/dist/style.css +1 -1
- package/lib/es/advertisement.js +2 -3
- package/lib/es/index.js +9 -10
- package/lib/es/insight.js +6 -7
- package/lib/es/notification.js +2 -3
- package/lib/es/pause-ad.js +113 -120
- package/lib/es/points.js +2 -3
- package/lib/es/provider.js +2035 -2020
- package/lib/es/useStreamLayerApp2.js +1 -1
- package/lib/style.css +1 -1
- package/package.json +14 -15
package/lib/es/advertisement.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as Y, jsxs as pe, Fragment as to } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect as It, useState as Lo, useRef as wi, useCallback as nn } from "react";
|
|
3
|
-
import "@nanostores/react";
|
|
4
3
|
import "nanostores";
|
|
5
4
|
import { n as ai, s as J, e as Ht, O as Fr, B as gm, q as fm, k as mm, f as bs, y as io, E as ym, r as _m, t as bm, u as Tm, c as vm, d as Sm, a as Ni, h as Em } from "./provider.js";
|
|
6
5
|
import "lodash.throttle";
|
|
@@ -34371,7 +34370,7 @@ const l2 = (i) => {
|
|
|
34371
34370
|
containerId: A.containerId,
|
|
34372
34371
|
muted: m
|
|
34373
34372
|
});
|
|
34374
|
-
},
|
|
34373
|
+
}, L2 = ({
|
|
34375
34374
|
event: i,
|
|
34376
34375
|
sidebar: e,
|
|
34377
34376
|
banner: t,
|
|
@@ -34406,6 +34405,6 @@ const l2 = (i) => {
|
|
|
34406
34405
|
] }) : null;
|
|
34407
34406
|
};
|
|
34408
34407
|
export {
|
|
34409
|
-
|
|
34408
|
+
L2 as StreamLayerSDKAdvertisement,
|
|
34410
34409
|
_2 as StreamLayerSDKAdvertisementUI
|
|
34411
34410
|
};
|
package/lib/es/index.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { S as
|
|
1
|
+
import { S as s, a as y, b as L, h as p, u as c, d as f, c as u } from "./provider.js";
|
|
2
2
|
import "nanostores";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import "@nanostores/react";
|
|
6
5
|
import "lodash.throttle";
|
|
7
6
|
import "react-dom";
|
|
8
7
|
import "react-countup";
|
|
9
|
-
import { StreamLayerSDKNotification as
|
|
8
|
+
import { StreamLayerSDKNotification as K, StreamLayerSDKNotificationUI as d } from "./notification.js";
|
|
10
9
|
export {
|
|
11
|
-
|
|
10
|
+
s as StreamLayerProvider,
|
|
12
11
|
y as StreamLayerSDKEvent,
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
K as StreamLayerSDKNotification,
|
|
13
|
+
d as StreamLayerSDKNotificationUI,
|
|
15
14
|
L as StreamLayerSDKReact,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
p as StreamLayerThemeProvider,
|
|
16
|
+
c as useStreamLayer,
|
|
17
|
+
f as useStreamLayerTheme,
|
|
18
|
+
u as useStreamLayerUI
|
|
20
19
|
};
|
package/lib/es/insight.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx as u, jsxs as
|
|
1
|
+
import { jsx as u, jsxs as p } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as l, useEffect as h } from "react";
|
|
3
|
-
import "@nanostores/react";
|
|
4
3
|
import "nanostores";
|
|
5
4
|
import { f as m, s as f, T as S, u as I, d as g, h as v, a as k } from "./provider.js";
|
|
6
5
|
import "lodash.throttle";
|
|
@@ -19,7 +18,7 @@ const Q = () => S, L = /* @__PURE__ */ f(Q())({
|
|
|
19
18
|
hideHeader: a,
|
|
20
19
|
insightId: t
|
|
21
20
|
}) => {
|
|
22
|
-
const s = l(""),
|
|
21
|
+
const s = l(""), c = m(e.openedQuestion.$store);
|
|
23
22
|
return h(() => t ? (!i || e.isOpenedQuestion(t) || (s.current = t, e.getFeedItem(t).then((r) => {
|
|
24
23
|
var d;
|
|
25
24
|
s.current === t && ((d = r == null ? void 0 : r.attributes) == null ? void 0 : d.attributes.case) === "insight" && e.openQuestion(t, r);
|
|
@@ -31,7 +30,7 @@ const Q = () => S, L = /* @__PURE__ */ f(Q())({
|
|
|
31
30
|
var d;
|
|
32
31
|
r && ((d = r.feedItem) == null ? void 0 : d.type) === "insight" && (!i || e.isOpenedQuestion(r.feedItem.id) || (s.current = r.feedItem.id, e.openQuestion(r.feedItem.id, r.feedItem))), !r && s.current && (e.closeQuestion(s.current), s.current = "");
|
|
33
32
|
}), () => {
|
|
34
|
-
}), [e, i, t]),
|
|
33
|
+
}), [e, i, t]), c ? /* @__PURE__ */ u(L, {
|
|
35
34
|
sdk: n,
|
|
36
35
|
skipAutoClose: o,
|
|
37
36
|
hideHeader: a,
|
|
@@ -56,7 +55,7 @@ const Q = () => S, L = /* @__PURE__ */ f(Q())({
|
|
|
56
55
|
gamification: t,
|
|
57
56
|
skipAutoClose: i
|
|
58
57
|
}) : null;
|
|
59
|
-
},
|
|
58
|
+
}, O = ({
|
|
60
59
|
event: e,
|
|
61
60
|
theme: n,
|
|
62
61
|
hideHeader: i,
|
|
@@ -64,7 +63,7 @@ const Q = () => S, L = /* @__PURE__ */ f(Q())({
|
|
|
64
63
|
persistent: a
|
|
65
64
|
}) => {
|
|
66
65
|
const t = I(), s = g();
|
|
67
|
-
return t ? /* @__PURE__ */
|
|
66
|
+
return t ? /* @__PURE__ */ p("div", { className: "StreamLayerSDK", children: [
|
|
68
67
|
/* @__PURE__ */ u(v, { customTheme: n ?? s.theme, themeMode: s.themeMode, children: /* @__PURE__ */ u(
|
|
69
68
|
A,
|
|
70
69
|
{
|
|
@@ -78,6 +77,6 @@ const Q = () => S, L = /* @__PURE__ */ f(Q())({
|
|
|
78
77
|
] }) : null;
|
|
79
78
|
};
|
|
80
79
|
export {
|
|
81
|
-
|
|
80
|
+
O as StreamLayerSDKInsight,
|
|
82
81
|
A as StreamLayerSDKInsightUI
|
|
83
82
|
};
|
package/lib/es/notification.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsxs as l, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { useState as w, useRef as _, useEffect as y, useCallback as As, useMemo as hs } from "react";
|
|
3
|
-
import "@nanostores/react";
|
|
4
3
|
import "nanostores";
|
|
5
4
|
import { s as n, B as A, $ as Is, a0 as $s, a1 as K, R as G, a2 as gs, E as ws, O as x, y as ys, i as Ts, f as bs, e as Cs, N as R, u as fs, d as ks, c as Ns, h as qs } from "./provider.js";
|
|
6
5
|
import "lodash.throttle";
|
|
@@ -999,11 +998,11 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
999
998
|
webos: i
|
|
1000
999
|
}
|
|
1001
1000
|
) : c && /* @__PURE__ */ s(se, { ...c.data, action: c.action });
|
|
1002
|
-
},
|
|
1001
|
+
}, Mo = ({ theme: e }) => {
|
|
1003
1002
|
const i = fs(), t = ks(), o = Ns();
|
|
1004
1003
|
return i && (o.appNotification || o.onboardingNotification) ? o.app && !o.onboardingNotification ? null : /* @__PURE__ */ s("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ s(qs, { customTheme: e ?? t.theme, themeMode: t.themeMode, children: /* @__PURE__ */ s(fo, { sdk: i }) }) }) : null;
|
|
1005
1004
|
};
|
|
1006
1005
|
export {
|
|
1007
|
-
|
|
1006
|
+
Mo as StreamLayerSDKNotification,
|
|
1008
1007
|
fo as StreamLayerSDKNotificationUI
|
|
1009
1008
|
};
|
package/lib/es/pause-ad.js
CHANGED
|
@@ -1,63 +1,62 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { j as K, k as
|
|
1
|
+
import { jsx as l, jsxs as L } from "react/jsx-runtime";
|
|
2
|
+
import { j as K, k as M, e as k, s as m, l as _, n as $, f as F, u as N, d as j, h as q } from "./provider.js";
|
|
3
3
|
import "nanostores";
|
|
4
|
-
import { useRef as D, useCallback as
|
|
5
|
-
import "@nanostores/react";
|
|
4
|
+
import { useRef as D, useCallback as I, useState as R, useEffect as T, Component as O } from "react";
|
|
6
5
|
import "lodash.throttle";
|
|
7
6
|
import "react-dom";
|
|
8
7
|
import "react-countup";
|
|
9
8
|
import { c as z } from "./vast-client.min-B0NUra1B.js";
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
9
|
+
const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Promise((s, t) => {
|
|
10
|
+
const o = new Image();
|
|
11
|
+
o.onload = () => s(e), o.onerror = () => t(), o.src = e;
|
|
13
12
|
}), V = () => {
|
|
14
13
|
const e = D(0);
|
|
15
|
-
return [
|
|
16
|
-
var t,
|
|
17
|
-
if ((t =
|
|
14
|
+
return [I(async (s) => {
|
|
15
|
+
var t, o, r, c, d, n, h, i, f, g, y;
|
|
16
|
+
if ((t = w.get()[s]) != null && t.imageSrc)
|
|
18
17
|
return { success: !0 };
|
|
19
18
|
const v = Date.now();
|
|
20
|
-
e.current = v,
|
|
19
|
+
e.current = v, w.setKey(s, { id: "", url: s });
|
|
21
20
|
try {
|
|
22
21
|
k.emit("exposedPauseAd", {
|
|
23
22
|
action: "load",
|
|
24
23
|
payload: {}
|
|
25
24
|
});
|
|
26
|
-
const u = await
|
|
27
|
-
if (E.debug(u, "parsedVAST"), e.current === v &&
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
E.debug(
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
33
|
-
E.debug(
|
|
34
|
-
const A = (r = (
|
|
25
|
+
const u = await J.get(s);
|
|
26
|
+
if (E.debug(u, "parsedVAST"), e.current === v && w.get()[s].url) {
|
|
27
|
+
const a = u.ads.find((p) => p.creatives.length > 0);
|
|
28
|
+
if (a) {
|
|
29
|
+
E.debug(a, "validAd");
|
|
30
|
+
const p = a.creatives.find((A) => A.type === "nonlinear");
|
|
31
|
+
if (p) {
|
|
32
|
+
E.debug(p, "nonlinear");
|
|
33
|
+
const A = (r = (o = p.variations) == null ? void 0 : o[0]) == null ? void 0 : r.staticResource, C = (d = (c = p.variations) == null ? void 0 : c[0]) == null ? void 0 : d.nonlinearClickThroughURLTemplate;
|
|
35
34
|
if (A)
|
|
36
|
-
return await U(A),
|
|
37
|
-
id:
|
|
35
|
+
return await U(A), w.setKey(s, {
|
|
36
|
+
id: a.id || "",
|
|
38
37
|
url: s,
|
|
39
38
|
imageSrc: A,
|
|
40
39
|
adUrl: C
|
|
41
40
|
}), k.emit("exposedPauseAd", {
|
|
42
41
|
action: "loaded",
|
|
43
42
|
payload: {
|
|
44
|
-
id:
|
|
43
|
+
id: a.id || ""
|
|
45
44
|
}
|
|
46
45
|
}), { success: !0 };
|
|
47
46
|
}
|
|
48
|
-
const P =
|
|
47
|
+
const P = a.creatives.find((A) => A.type === "companion");
|
|
49
48
|
E.debug(P, "companion");
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
return await U(
|
|
53
|
-
id:
|
|
49
|
+
const b = (f = (i = (h = (n = P == null ? void 0 : P.variations) == null ? void 0 : n[0]) == null ? void 0 : h.staticResources) == null ? void 0 : i[0]) == null ? void 0 : f.url, S = (y = (g = P == null ? void 0 : P.variations) == null ? void 0 : g[0]) == null ? void 0 : y.companionClickThroughURLTemplate;
|
|
50
|
+
if (b)
|
|
51
|
+
return await U(b), w.setKey(s, {
|
|
52
|
+
id: a.id || "",
|
|
54
53
|
url: s,
|
|
55
|
-
imageSrc:
|
|
54
|
+
imageSrc: b,
|
|
56
55
|
adUrl: S
|
|
57
56
|
}), k.emit("exposedPauseAd", {
|
|
58
57
|
action: "loaded",
|
|
59
58
|
payload: {
|
|
60
|
-
id:
|
|
59
|
+
id: a.id || ""
|
|
61
60
|
}
|
|
62
61
|
}), { success: !0 };
|
|
63
62
|
}
|
|
@@ -66,58 +65,54 @@ const O = {}, W = new z(), b = F(O), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
66
65
|
console.error("Error parsing VAST", u);
|
|
67
66
|
}
|
|
68
67
|
return { success: !1 };
|
|
69
|
-
}, []),
|
|
70
|
-
},
|
|
68
|
+
}, []), w];
|
|
69
|
+
}, Q = /* @__PURE__ */ m("div")({
|
|
71
70
|
name: "PauseAdOverlay",
|
|
72
71
|
class: "pw9gih8",
|
|
73
72
|
propsAsIs: !1
|
|
74
|
-
}), H = /* @__PURE__ */
|
|
73
|
+
}), H = /* @__PURE__ */ m("div")({
|
|
75
74
|
name: "PauseAdContent",
|
|
76
75
|
class: "p8lpomy",
|
|
77
76
|
propsAsIs: !1
|
|
78
|
-
}),
|
|
79
|
-
name: "
|
|
77
|
+
}), W = /* @__PURE__ */ m("div")({
|
|
78
|
+
name: "PauseAdTopLeft",
|
|
80
79
|
class: "pv7u167",
|
|
81
80
|
propsAsIs: !1
|
|
82
|
-
}),
|
|
83
|
-
name: "
|
|
81
|
+
}), X = /* @__PURE__ */ m("h2")({
|
|
82
|
+
name: "PauseAdTitle",
|
|
84
83
|
class: "p1kh2yb0",
|
|
85
84
|
propsAsIs: !1
|
|
86
|
-
}), Y = /* @__PURE__ */
|
|
87
|
-
name: "
|
|
85
|
+
}), Y = /* @__PURE__ */ m("p")({
|
|
86
|
+
name: "PauseAdCaption",
|
|
88
87
|
class: "pl8f94x",
|
|
89
88
|
propsAsIs: !1
|
|
90
|
-
}), Z = /* @__PURE__ */
|
|
91
|
-
name: "
|
|
89
|
+
}), Z = /* @__PURE__ */ m("div")({
|
|
90
|
+
name: "PauseAdBottomLeft",
|
|
92
91
|
class: "p1m6zmrt",
|
|
93
92
|
propsAsIs: !1
|
|
94
|
-
}), ee = /* @__PURE__ */
|
|
95
|
-
name: "
|
|
93
|
+
}), ee = /* @__PURE__ */ m("button")({
|
|
94
|
+
name: "PauseAdPlayButton",
|
|
96
95
|
class: "pm3vwfa",
|
|
97
96
|
propsAsIs: !1
|
|
98
|
-
}), se = /* @__PURE__ */
|
|
99
|
-
name: "
|
|
97
|
+
}), se = /* @__PURE__ */ m("div")({
|
|
98
|
+
name: "PauseAdSidebarGradient",
|
|
100
99
|
class: "p1tibuhw",
|
|
101
100
|
propsAsIs: !1
|
|
102
|
-
}), re = /* @__PURE__ */
|
|
103
|
-
name: "PauseAdPlayButton",
|
|
104
|
-
class: "ptqqrqd",
|
|
105
|
-
propsAsIs: !1
|
|
106
|
-
}), te = /* @__PURE__ */ p("div")({
|
|
101
|
+
}), re = /* @__PURE__ */ m("div")({
|
|
107
102
|
name: "PauseAdSidebar",
|
|
108
|
-
class: "
|
|
103
|
+
class: "ptqqrqd",
|
|
109
104
|
propsAsIs: !1
|
|
110
|
-
}),
|
|
105
|
+
}), te = /* @__PURE__ */ m("span")({
|
|
111
106
|
name: "PauseAdTitleDescription",
|
|
112
|
-
class: "
|
|
107
|
+
class: "p14estxv",
|
|
113
108
|
propsAsIs: !1
|
|
114
|
-
}), B = /* @__PURE__ */
|
|
109
|
+
}), B = /* @__PURE__ */ m("img")({
|
|
115
110
|
name: "ExternalAdContainer",
|
|
116
|
-
class: "
|
|
111
|
+
class: "e1dpvfl1",
|
|
117
112
|
propsAsIs: !1
|
|
118
113
|
}), ae = ({ vastUrl: e, isDesktop: s }) => {
|
|
119
114
|
var t;
|
|
120
|
-
const [,
|
|
115
|
+
const [, o] = V(), r = F(o, { keys: [e] });
|
|
121
116
|
return T(() => {
|
|
122
117
|
r && r[e] && r[e].imageSrc && r[e].id && k.emit("exposedPauseAd", {
|
|
123
118
|
action: "rendered",
|
|
@@ -125,7 +120,7 @@ const O = {}, W = new z(), b = F(O), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
125
120
|
id: r[e].id
|
|
126
121
|
}
|
|
127
122
|
});
|
|
128
|
-
}, [r, e]), (t = r == null ? void 0 : r[e]) != null && t.imageSrc ? !r[e].adUrl || !s ? /* @__PURE__ */
|
|
123
|
+
}, [r, e]), (t = r == null ? void 0 : r[e]) != null && t.imageSrc ? !r[e].adUrl || !s ? /* @__PURE__ */ l(B, { src: r[e].imageSrc }) : /* @__PURE__ */ l(
|
|
129
124
|
"a",
|
|
130
125
|
{
|
|
131
126
|
onClick: () => {
|
|
@@ -139,19 +134,19 @@ const O = {}, W = new z(), b = F(O), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
139
134
|
href: r[e].adUrl,
|
|
140
135
|
target: "_blank",
|
|
141
136
|
rel: "noopener noreferrer",
|
|
142
|
-
children: /* @__PURE__ */
|
|
137
|
+
children: /* @__PURE__ */ l(B, { src: r[e].imageSrc })
|
|
143
138
|
}
|
|
144
139
|
) : null;
|
|
145
|
-
},
|
|
146
|
-
const h = (
|
|
140
|
+
}, oe = ({ isClosing: e, title: s, caption: t, onPlay: o, onClose: r, vastUrl: c, options: d, isDesktop: n }) => {
|
|
141
|
+
const h = (d == null ? void 0 : d.showPauseButton) ?? !0, { ref: i, focusSelf: f } = _.useFocusable({
|
|
147
142
|
focusKey: "sl-pause-ad-play",
|
|
148
|
-
onEnterRelease:
|
|
143
|
+
onEnterRelease: o,
|
|
149
144
|
isFocusBoundary: !0,
|
|
150
145
|
forceFocus: !0
|
|
151
146
|
});
|
|
152
147
|
return T(() => {
|
|
153
|
-
|
|
154
|
-
}, [
|
|
148
|
+
i.current && f();
|
|
149
|
+
}, [i, f]), T(() => {
|
|
155
150
|
if (!r)
|
|
156
151
|
return () => {
|
|
157
152
|
};
|
|
@@ -163,57 +158,55 @@ const O = {}, W = new z(), b = F(O), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
163
158
|
}
|
|
164
159
|
};
|
|
165
160
|
return window.addEventListener("keydown", g, { capture: !0 }), () => window.removeEventListener("keydown", g, { capture: !0 });
|
|
166
|
-
}, [r]), /* @__PURE__ */
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
/* @__PURE__ */ a(Z, { children: s }),
|
|
171
|
-
/* @__PURE__ */ a(ee, { children: t })
|
|
161
|
+
}, [r]), /* @__PURE__ */ l(Q, { className: $("SL_PauseAdOverlay", e && "pause-ad-closing"), children: /* @__PURE__ */ L(H, { children: [
|
|
162
|
+
/* @__PURE__ */ L(W, { children: [
|
|
163
|
+
/* @__PURE__ */ l(X, { children: s }),
|
|
164
|
+
/* @__PURE__ */ l(Y, { children: t })
|
|
172
165
|
] }),
|
|
173
|
-
h && /* @__PURE__ */
|
|
174
|
-
|
|
166
|
+
h && /* @__PURE__ */ l(Z, { children: /* @__PURE__ */ l(
|
|
167
|
+
ee,
|
|
175
168
|
{
|
|
176
|
-
ref:
|
|
177
|
-
onClick:
|
|
178
|
-
onMouseEnter: () =>
|
|
169
|
+
ref: i,
|
|
170
|
+
onClick: o,
|
|
171
|
+
onMouseEnter: () => i.current.focus(),
|
|
179
172
|
"aria-label": "Resume playback"
|
|
180
173
|
}
|
|
181
174
|
) }),
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
] })
|
|
175
|
+
/* @__PURE__ */ l(se, { className: "SL_PauseAdSidebar", children: /* @__PURE__ */ L(re, { children: [
|
|
176
|
+
c && /* @__PURE__ */ l(ae, { isDesktop: n, vastUrl: c }),
|
|
177
|
+
/* @__PURE__ */ l(te, { children: "ADVERTISEMENT" })
|
|
178
|
+
] }) })
|
|
186
179
|
] }) });
|
|
187
|
-
},
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
const [P,
|
|
191
|
-
|
|
180
|
+
}, ne = ({ showPauseAd: e, vastUrls: s, title: t, caption: o, sdk: r, onClose: c, onRender: d, options: n, isDesktop: h }) => {
|
|
181
|
+
const i = (n == null ? void 0 : n.pauseAdDelay) ?? 5e3, [f, g] = R(!1), [y, v] = R(!1), u = D(), a = s == null ? void 0 : s[0].url, p = D(a);
|
|
182
|
+
p.current = a;
|
|
183
|
+
const [P, b] = V(), S = I(() => {
|
|
184
|
+
c && (k.emit("exposedPauseAd", {
|
|
192
185
|
action: "closed",
|
|
193
186
|
payload: {}
|
|
194
|
-
}),
|
|
195
|
-
}, [
|
|
187
|
+
}), c());
|
|
188
|
+
}, [c]), A = I(() => {
|
|
196
189
|
r.controlVideoPlayer({ play: !0 });
|
|
197
190
|
}, [r]);
|
|
198
191
|
return T(() => {
|
|
199
|
-
if (e &&
|
|
192
|
+
if (e && a) {
|
|
200
193
|
k.emit("exposedPauseAd", {
|
|
201
194
|
action: "enabled",
|
|
202
195
|
payload: {}
|
|
203
|
-
}), P(
|
|
204
|
-
|
|
196
|
+
}), P(a).then((x) => {
|
|
197
|
+
p.current === a && (x == null ? void 0 : x.success) !== !0 && (clearTimeout(u.current), S == null || S());
|
|
205
198
|
}).catch(() => {
|
|
206
|
-
|
|
199
|
+
p.current === a && (clearTimeout(u.current), S == null || S());
|
|
207
200
|
});
|
|
208
201
|
const C = () => {
|
|
209
|
-
const x =
|
|
202
|
+
const x = b.get()[p.current];
|
|
210
203
|
x != null && x.imageSrc ? (clearTimeout(u.current), v(!1), g(!0)) : u.current = setTimeout(() => {
|
|
211
204
|
C();
|
|
212
205
|
}, 200);
|
|
213
206
|
};
|
|
214
207
|
u.current = setTimeout(() => {
|
|
215
208
|
C();
|
|
216
|
-
},
|
|
209
|
+
}, i);
|
|
217
210
|
} else
|
|
218
211
|
k.emit("exposedPauseAd", {
|
|
219
212
|
action: "disabled",
|
|
@@ -224,61 +217,61 @@ const O = {}, W = new z(), b = F(O), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
224
217
|
return () => {
|
|
225
218
|
u.current && clearTimeout(u.current);
|
|
226
219
|
};
|
|
227
|
-
}, [
|
|
228
|
-
|
|
229
|
-
}, [f,
|
|
230
|
-
|
|
231
|
-
}, [
|
|
232
|
-
|
|
220
|
+
}, [b, P, S, i, e, a]), T(() => {
|
|
221
|
+
d == null || d({ rendered: f });
|
|
222
|
+
}, [f, d]), T(() => () => {
|
|
223
|
+
d == null || d({ rendered: !1 });
|
|
224
|
+
}, [d]), f ? /* @__PURE__ */ l(
|
|
225
|
+
oe,
|
|
233
226
|
{
|
|
234
227
|
onClose: S,
|
|
235
228
|
isClosing: y,
|
|
236
229
|
title: t,
|
|
237
|
-
caption:
|
|
230
|
+
caption: o,
|
|
238
231
|
onPlay: A,
|
|
239
|
-
vastUrl:
|
|
240
|
-
options:
|
|
232
|
+
vastUrl: a,
|
|
233
|
+
options: n,
|
|
241
234
|
isDesktop: h
|
|
242
235
|
}
|
|
243
236
|
) : null;
|
|
244
|
-
},
|
|
237
|
+
}, ie = ({
|
|
245
238
|
showPauseAd: e,
|
|
246
239
|
pauseAdVastUrl: s,
|
|
247
240
|
videoPlayerController: t,
|
|
248
|
-
onRenderPauseAd:
|
|
241
|
+
onRenderPauseAd: o,
|
|
249
242
|
onClosePauseAd: r,
|
|
250
|
-
children:
|
|
251
|
-
options:
|
|
243
|
+
children: c,
|
|
244
|
+
options: d
|
|
252
245
|
}) => {
|
|
253
|
-
const
|
|
254
|
-
return T(() =>
|
|
255
|
-
|
|
246
|
+
const n = N(), h = j(), i = D();
|
|
247
|
+
return T(() => n ? (t && (i.current = t, n.addVideoPlayerController(i.current)), () => {
|
|
248
|
+
i.current && n.removeVideoPlayerController(i.current);
|
|
256
249
|
}) : () => {
|
|
257
|
-
}, [
|
|
258
|
-
|
|
250
|
+
}, [n, t]), n ? /* @__PURE__ */ l("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ L(
|
|
251
|
+
q,
|
|
259
252
|
{
|
|
260
|
-
style:
|
|
253
|
+
style: c ? { position: "relative" } : {},
|
|
261
254
|
customTheme: h.theme,
|
|
262
255
|
themeMode: h.themeMode,
|
|
263
256
|
children: [
|
|
264
|
-
|
|
265
|
-
s && /* @__PURE__ */
|
|
266
|
-
|
|
257
|
+
c,
|
|
258
|
+
s && /* @__PURE__ */ l(
|
|
259
|
+
ne,
|
|
267
260
|
{
|
|
268
|
-
sdk:
|
|
261
|
+
sdk: n,
|
|
269
262
|
showPauseAd: e,
|
|
270
263
|
vastUrls: s,
|
|
271
264
|
onClose: r,
|
|
272
|
-
onRender:
|
|
273
|
-
options:
|
|
265
|
+
onRender: o,
|
|
266
|
+
options: d,
|
|
274
267
|
isDesktop: !0
|
|
275
268
|
}
|
|
276
269
|
)
|
|
277
270
|
]
|
|
278
271
|
}
|
|
279
|
-
) }) :
|
|
272
|
+
) }) : c;
|
|
280
273
|
};
|
|
281
|
-
class
|
|
274
|
+
class fe extends O {
|
|
282
275
|
constructor(s) {
|
|
283
276
|
super(s), this.state = { hasError: !1 };
|
|
284
277
|
}
|
|
@@ -289,9 +282,9 @@ class Ae extends $ {
|
|
|
289
282
|
console.error(s, t.componentStack);
|
|
290
283
|
}
|
|
291
284
|
render() {
|
|
292
|
-
return this.state.hasError ? this.props.children : /* @__PURE__ */
|
|
285
|
+
return this.state.hasError ? this.props.children : /* @__PURE__ */ l(ie, { ...this.props });
|
|
293
286
|
}
|
|
294
287
|
}
|
|
295
288
|
export {
|
|
296
|
-
|
|
289
|
+
fe as StreamLayerPauseAd
|
|
297
290
|
};
|
package/lib/es/points.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
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 "@nanostores/react";
|
|
4
3
|
import "nanostores";
|
|
5
4
|
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
5
|
import "lodash.throttle";
|
|
@@ -68,10 +67,10 @@ const I = /* @__PURE__ */ a("div")({
|
|
|
68
67
|
return null;
|
|
69
68
|
const e = s.getFeature(A.GAMES);
|
|
70
69
|
return e ? /* @__PURE__ */ t(C, { gamification: e }) : null;
|
|
71
|
-
},
|
|
70
|
+
}, R = ({ theme: s }) => {
|
|
72
71
|
const e = v(), o = g();
|
|
73
72
|
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;
|
|
74
73
|
};
|
|
75
74
|
export {
|
|
76
|
-
|
|
75
|
+
R as StreamLayerSDKPoints
|
|
77
76
|
};
|