@streamlayer/react 1.21.1 → 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 +34 -35
- 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/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 +34 -35
- package/lib/es/points.js +2 -3
- package/lib/es/provider.js +2035 -2020
- package/lib/es/useStreamLayerApp2.js +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
|
@@ -2,18 +2,17 @@ import { jsx as l, jsxs as L } from "react/jsx-runtime";
|
|
|
2
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
4
|
import { useRef as D, useCallback as I, useState as R, useEffect as T, Component as O } from "react";
|
|
5
|
-
import "@nanostores/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
9
|
const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Promise((s, t) => {
|
|
11
|
-
const
|
|
12
|
-
|
|
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
14
|
return [I(async (s) => {
|
|
16
|
-
var t,
|
|
15
|
+
var t, o, r, c, d, n, h, i, f, g, y;
|
|
17
16
|
if ((t = w.get()[s]) != null && t.imageSrc)
|
|
18
17
|
return { success: !0 };
|
|
19
18
|
const v = Date.now();
|
|
@@ -25,39 +24,39 @@ const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
25
24
|
});
|
|
26
25
|
const u = await J.get(s);
|
|
27
26
|
if (E.debug(u, "parsedVAST"), e.current === v && w.get()[s].url) {
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
E.debug(
|
|
31
|
-
const p =
|
|
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");
|
|
32
31
|
if (p) {
|
|
33
32
|
E.debug(p, "nonlinear");
|
|
34
|
-
const A = (r = (
|
|
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
35
|
return await U(A), w.setKey(s, {
|
|
37
|
-
id:
|
|
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
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;
|
|
51
50
|
if (b)
|
|
52
51
|
return await U(b), w.setKey(s, {
|
|
53
|
-
id:
|
|
52
|
+
id: a.id || "",
|
|
54
53
|
url: s,
|
|
55
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
|
}
|
|
@@ -111,9 +110,9 @@ const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
111
110
|
name: "ExternalAdContainer",
|
|
112
111
|
class: "e1dpvfl1",
|
|
113
112
|
propsAsIs: !1
|
|
114
|
-
}),
|
|
113
|
+
}), ae = ({ vastUrl: e, isDesktop: s }) => {
|
|
115
114
|
var t;
|
|
116
|
-
const [,
|
|
115
|
+
const [, o] = V(), r = F(o, { keys: [e] });
|
|
117
116
|
return T(() => {
|
|
118
117
|
r && r[e] && r[e].imageSrc && r[e].id && k.emit("exposedPauseAd", {
|
|
119
118
|
action: "rendered",
|
|
@@ -138,10 +137,10 @@ const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
138
137
|
children: /* @__PURE__ */ l(B, { src: r[e].imageSrc })
|
|
139
138
|
}
|
|
140
139
|
) : null;
|
|
141
|
-
},
|
|
140
|
+
}, oe = ({ isClosing: e, title: s, caption: t, onPlay: o, onClose: r, vastUrl: c, options: d, isDesktop: n }) => {
|
|
142
141
|
const h = (d == null ? void 0 : d.showPauseButton) ?? !0, { ref: i, focusSelf: f } = _.useFocusable({
|
|
143
142
|
focusKey: "sl-pause-ad-play",
|
|
144
|
-
onEnterRelease:
|
|
143
|
+
onEnterRelease: o,
|
|
145
144
|
isFocusBoundary: !0,
|
|
146
145
|
forceFocus: !0
|
|
147
146
|
});
|
|
@@ -168,19 +167,19 @@ const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
168
167
|
ee,
|
|
169
168
|
{
|
|
170
169
|
ref: i,
|
|
171
|
-
onClick:
|
|
170
|
+
onClick: o,
|
|
172
171
|
onMouseEnter: () => i.current.focus(),
|
|
173
172
|
"aria-label": "Resume playback"
|
|
174
173
|
}
|
|
175
174
|
) }),
|
|
176
175
|
/* @__PURE__ */ l(se, { className: "SL_PauseAdSidebar", children: /* @__PURE__ */ L(re, { children: [
|
|
177
|
-
c && /* @__PURE__ */ l(
|
|
176
|
+
c && /* @__PURE__ */ l(ae, { isDesktop: n, vastUrl: c }),
|
|
178
177
|
/* @__PURE__ */ l(te, { children: "ADVERTISEMENT" })
|
|
179
178
|
] }) })
|
|
180
179
|
] }) });
|
|
181
|
-
}, ne = ({ showPauseAd: e, vastUrls: s, title: t, caption:
|
|
182
|
-
const i = (n == null ? void 0 : n.pauseAdDelay) ?? 5e3, [f, g] = R(!1), [y, v] = R(!1), u = D(),
|
|
183
|
-
p.current =
|
|
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;
|
|
184
183
|
const [P, b] = V(), S = I(() => {
|
|
185
184
|
c && (k.emit("exposedPauseAd", {
|
|
186
185
|
action: "closed",
|
|
@@ -190,14 +189,14 @@ const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
190
189
|
r.controlVideoPlayer({ play: !0 });
|
|
191
190
|
}, [r]);
|
|
192
191
|
return T(() => {
|
|
193
|
-
if (e &&
|
|
192
|
+
if (e && a) {
|
|
194
193
|
k.emit("exposedPauseAd", {
|
|
195
194
|
action: "enabled",
|
|
196
195
|
payload: {}
|
|
197
|
-
}), P(
|
|
198
|
-
p.current ===
|
|
196
|
+
}), P(a).then((x) => {
|
|
197
|
+
p.current === a && (x == null ? void 0 : x.success) !== !0 && (clearTimeout(u.current), S == null || S());
|
|
199
198
|
}).catch(() => {
|
|
200
|
-
p.current ===
|
|
199
|
+
p.current === a && (clearTimeout(u.current), S == null || S());
|
|
201
200
|
});
|
|
202
201
|
const C = () => {
|
|
203
202
|
const x = b.get()[p.current];
|
|
@@ -218,19 +217,19 @@ const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
218
217
|
return () => {
|
|
219
218
|
u.current && clearTimeout(u.current);
|
|
220
219
|
};
|
|
221
|
-
}, [b, P, S, i, e,
|
|
220
|
+
}, [b, P, S, i, e, a]), T(() => {
|
|
222
221
|
d == null || d({ rendered: f });
|
|
223
222
|
}, [f, d]), T(() => () => {
|
|
224
223
|
d == null || d({ rendered: !1 });
|
|
225
224
|
}, [d]), f ? /* @__PURE__ */ l(
|
|
226
|
-
|
|
225
|
+
oe,
|
|
227
226
|
{
|
|
228
227
|
onClose: S,
|
|
229
228
|
isClosing: y,
|
|
230
229
|
title: t,
|
|
231
|
-
caption:
|
|
230
|
+
caption: o,
|
|
232
231
|
onPlay: A,
|
|
233
|
-
vastUrl:
|
|
232
|
+
vastUrl: a,
|
|
234
233
|
options: n,
|
|
235
234
|
isDesktop: h
|
|
236
235
|
}
|
|
@@ -239,7 +238,7 @@ const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
239
238
|
showPauseAd: e,
|
|
240
239
|
pauseAdVastUrl: s,
|
|
241
240
|
videoPlayerController: t,
|
|
242
|
-
onRenderPauseAd:
|
|
241
|
+
onRenderPauseAd: o,
|
|
243
242
|
onClosePauseAd: r,
|
|
244
243
|
children: c,
|
|
245
244
|
options: d
|
|
@@ -263,7 +262,7 @@ const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
263
262
|
showPauseAd: e,
|
|
264
263
|
vastUrls: s,
|
|
265
264
|
onClose: r,
|
|
266
|
-
onRender:
|
|
265
|
+
onRender: o,
|
|
267
266
|
options: d,
|
|
268
267
|
isDesktop: !0
|
|
269
268
|
}
|
|
@@ -272,7 +271,7 @@ const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
272
271
|
}
|
|
273
272
|
) }) : c;
|
|
274
273
|
};
|
|
275
|
-
class
|
|
274
|
+
class fe extends O {
|
|
276
275
|
constructor(s) {
|
|
277
276
|
super(s), this.state = { hasError: !1 };
|
|
278
277
|
}
|
|
@@ -287,5 +286,5 @@ class ye extends O {
|
|
|
287
286
|
}
|
|
288
287
|
}
|
|
289
288
|
export {
|
|
290
|
-
|
|
289
|
+
fe as StreamLayerPauseAd
|
|
291
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
|
};
|