@streamlayer/react 1.20.6 → 1.21.0
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/app/pause-ad.d.ts +1 -1
- 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 +14 -15
- package/lib/classic/app/pause-ad.d.ts +1 -1
- 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 +14 -15
- 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 +196 -148
- 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 +3249 -5821
- package/lib/classic/index.d.ts +1 -1
- package/lib/classic/masters.d.ts +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 +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 +9837 -18573
- package/lib/dist/style.css +1 -1
- 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 +196 -148
- 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 +3249 -5821
- package/lib/index.d.ts +1 -1
- package/lib/masters.d.ts +1 -1
- package/lib/style.css +1 -1
- package/package.json +15 -15
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
2
|
-
import { s as _, B as te,
|
|
3
|
-
import $, { forwardRef as Ae, useState as W, useRef as D, useEffect as Y, useLayoutEffect as
|
|
4
|
-
import {
|
|
2
|
+
import { s as _, B as te, o as vt, p as gt, e as Se, j as wt, n as Ee, u as bt, i as yt } from "./provider.js";
|
|
3
|
+
import $, { forwardRef as Ae, useState as W, useRef as D, useEffect as Y, useLayoutEffect as St, createContext as He, useMemo as Re, useCallback as qe, memo as Et } from "react";
|
|
4
|
+
import { ConnectError as xt, Code as Tt } from "@connectrpc/connect";
|
|
5
|
+
import Ct from "lodash.throttle";
|
|
6
|
+
import { S as We } from "./useStreamLayerApp2.js";
|
|
5
7
|
function _e(t) {
|
|
6
8
|
return t !== null && typeof t == "object" && "constructor" in t && t.constructor === Object;
|
|
7
9
|
}
|
|
@@ -2613,7 +2615,7 @@ function Js(t, e, s) {
|
|
|
2613
2615
|
}));
|
|
2614
2616
|
}
|
|
2615
2617
|
function ee(t, e) {
|
|
2616
|
-
return typeof window > "u" ? Y(t, e) :
|
|
2618
|
+
return typeof window > "u" ? Y(t, e) : St(t, e);
|
|
2617
2619
|
}
|
|
2618
2620
|
const De = /* @__PURE__ */ He(null), Zs = /* @__PURE__ */ He(null), ot = /* @__PURE__ */ Ae(function(t, e) {
|
|
2619
2621
|
let {
|
|
@@ -3237,7 +3239,7 @@ const Tr = ({ data: t, gamification: e, onEvent: s, swipeable: r, autoplay: n })
|
|
|
3237
3239
|
e.closeQuestion();
|
|
3238
3240
|
}, [u, f] = W(1.1);
|
|
3239
3241
|
return Y(() => {
|
|
3240
|
-
const v =
|
|
3242
|
+
const v = Ct(() => {
|
|
3241
3243
|
var h;
|
|
3242
3244
|
const b = (h = l.current) == null ? void 0 : h.size;
|
|
3243
3245
|
if (!b)
|
|
@@ -3281,7 +3283,7 @@ const Tr = ({ data: t, gamification: e, onEvent: s, swipeable: r, autoplay: n })
|
|
|
3281
3283
|
{
|
|
3282
3284
|
onEvent: n,
|
|
3283
3285
|
actionFn: () => n({ type: "slHardRefresh" }),
|
|
3284
|
-
description: l instanceof
|
|
3286
|
+
description: l instanceof xt && l.code !== Tt.InvalidArgument ? `The event ID was not
|
|
3285
3287
|
specified or is invalid.` : `The server is unable to
|
|
3286
3288
|
handle this request.`
|
|
3287
3289
|
}
|
|
@@ -3308,7 +3310,7 @@ handle this request.`
|
|
|
3308
3310
|
name: "BetPackContainer",
|
|
3309
3311
|
class: "b18vssq2",
|
|
3310
3312
|
propsAsIs: !1
|
|
3311
|
-
}), ie = "slBetPackCb", Mr =
|
|
3313
|
+
}), ie = "slBetPackCb", Mr = wt("betPack-ui"), kr = (t, e = {}) => {
|
|
3312
3314
|
var s, r;
|
|
3313
3315
|
const { questionId: n, answerId: i } = e, l = { questionId: n, answerId: i };
|
|
3314
3316
|
Mr.debug({ id: ie, type: t, ...l }), (s = window.top) == null || s.postMessage({ id: ie, type: t, ...l }, "*"), window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers[ie] && window.webkit.messageHandlers[ie].postMessage({ type: t, ...l }), (r = window.slBetPackCb) != null && r.postMessage && window.slBetPackCb.postMessage(JSON.stringify({ type: t, ...l, from: "base" }));
|
|
@@ -3397,7 +3399,7 @@ const Dr = ({ user: t, gamification: e, overlay: s, swipeable: r, onEvent: n })
|
|
|
3397
3399
|
description: `You are not authorized to
|
|
3398
3400
|
view this resource.`
|
|
3399
3401
|
}
|
|
3400
|
-
) : /* @__PURE__ */ P(Le, {}), mt =
|
|
3402
|
+
) : /* @__PURE__ */ P(Le, {}), mt = Et(({ sdk: t, swipeable: e = !0, onEvent: s = Ir, overlay: r }) => {
|
|
3401
3403
|
const n = Se(t.featuresList.getStore()), i = Re(() => t.getFeature(We.GAMES), [n]), l = Se(t.getUserStore());
|
|
3402
3404
|
return Y(() => (t.writeOverlaySessionId(), () => {
|
|
3403
3405
|
t.writeOverlaySessionId("");
|
|
@@ -3410,16 +3412,16 @@ view this resource.`
|
|
|
3410
3412
|
);
|
|
3411
3413
|
}), Ve = (t) => {
|
|
3412
3414
|
const e = t.target;
|
|
3413
|
-
e instanceof Element && e.getAttribute("data-a") === "intr" &&
|
|
3415
|
+
e instanceof Element && e.getAttribute("data-a") === "intr" && yt.emit("interactions", {
|
|
3414
3416
|
action: "tap",
|
|
3415
3417
|
payload: {}
|
|
3416
3418
|
});
|
|
3417
|
-
},
|
|
3418
|
-
const t =
|
|
3419
|
+
}, Wr = () => {
|
|
3420
|
+
const t = bt();
|
|
3419
3421
|
return Y(() => (document == null || document.addEventListener("click", Ve), () => {
|
|
3420
3422
|
document == null || document.removeEventListener("click", Ve);
|
|
3421
3423
|
}), []), t ? /* @__PURE__ */ P(mt, { sdk: t }) : null;
|
|
3422
3424
|
};
|
|
3423
3425
|
export {
|
|
3424
|
-
|
|
3426
|
+
Wr as BetPackProvider
|
|
3425
3427
|
};
|
package/lib/classic/es/index.js
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as p, a as y, b as L, h as c, u as f, d as u, c as D } from "./provider.js";
|
|
2
|
+
import "nanostores";
|
|
2
3
|
import "react/jsx-runtime";
|
|
3
4
|
import "react";
|
|
4
|
-
import
|
|
5
|
+
import "@nanostores/react";
|
|
6
|
+
import "lodash.throttle";
|
|
7
|
+
import "react-dom";
|
|
8
|
+
import "react-countup";
|
|
9
|
+
import { StreamLayerSDKNotification as d, StreamLayerSDKNotificationUI as h } from "./notification.js";
|
|
5
10
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
p as StreamLayerProvider,
|
|
12
|
+
y as StreamLayerSDKEvent,
|
|
13
|
+
d as StreamLayerSDKNotification,
|
|
14
|
+
h as StreamLayerSDKNotificationUI,
|
|
15
|
+
L as StreamLayerSDKReact,
|
|
16
|
+
c as StreamLayerThemeProvider,
|
|
17
|
+
f as useStreamLayer,
|
|
18
|
+
u as useStreamLayerTheme,
|
|
19
|
+
D as useStreamLayerUI
|
|
15
20
|
};
|
|
@@ -1,35 +1,40 @@
|
|
|
1
|
-
import { jsx as u, jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
1
|
+
import { jsx as u, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as l, useEffect as h } from "react";
|
|
3
|
+
import "@nanostores/react";
|
|
4
|
+
import "nanostores";
|
|
5
|
+
import { e as m, s as f, T as S, u as I, d as g, h as v, a as k } from "./provider.js";
|
|
6
|
+
import "lodash.throttle";
|
|
7
|
+
import "react-dom";
|
|
8
|
+
import "react-countup";
|
|
4
9
|
import { S as y } from "./useStreamLayerApp2.js";
|
|
5
|
-
const Q = () => S,
|
|
10
|
+
const Q = () => S, L = /* @__PURE__ */ f(Q())({
|
|
6
11
|
name: "QuestionWrap",
|
|
7
12
|
class: "q10hhsxv",
|
|
8
13
|
propsAsIs: !0
|
|
9
|
-
}),
|
|
14
|
+
}), b = ({
|
|
10
15
|
gamification: e,
|
|
11
16
|
sdk: n,
|
|
12
17
|
persistent: i,
|
|
13
|
-
skipAutoClose:
|
|
14
|
-
hideHeader:
|
|
18
|
+
skipAutoClose: o,
|
|
19
|
+
hideHeader: a,
|
|
15
20
|
insightId: t
|
|
16
21
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
return
|
|
22
|
+
const s = l(""), p = m(e.openedQuestion.$store);
|
|
23
|
+
return h(() => t ? (!i || e.isOpenedQuestion(t) || (s.current = t, e.getFeedItem(t).then((r) => {
|
|
19
24
|
var d;
|
|
20
|
-
|
|
25
|
+
s.current === t && ((d = r == null ? void 0 : r.attributes) == null ? void 0 : d.attributes.case) === "insight" && e.openQuestion(t, r);
|
|
21
26
|
})), () => {
|
|
22
|
-
|
|
27
|
+
s.current = "";
|
|
23
28
|
}) : (e.activeQuestionId.subscribe(({
|
|
24
|
-
data:
|
|
29
|
+
data: r
|
|
25
30
|
}) => {
|
|
26
31
|
var d;
|
|
27
|
-
|
|
32
|
+
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 = "");
|
|
28
33
|
}), () => {
|
|
29
|
-
}), [e, i, t]),
|
|
34
|
+
}), [e, i, t]), p ? /* @__PURE__ */ u(L, {
|
|
30
35
|
sdk: n,
|
|
31
|
-
skipAutoClose:
|
|
32
|
-
hideHeader:
|
|
36
|
+
skipAutoClose: o,
|
|
37
|
+
hideHeader: a,
|
|
33
38
|
gamification: e,
|
|
34
39
|
hideSponsor: !0
|
|
35
40
|
}) : null;
|
|
@@ -37,42 +42,42 @@ const Q = () => S, b = /* @__PURE__ */ f(Q())({
|
|
|
37
42
|
sdk: e,
|
|
38
43
|
persistent: n,
|
|
39
44
|
skipAutoClose: i,
|
|
40
|
-
insightId:
|
|
41
|
-
hideHeader:
|
|
45
|
+
insightId: o,
|
|
46
|
+
hideHeader: a
|
|
42
47
|
}) => {
|
|
43
48
|
if (!m(e.featuresList.getStore()))
|
|
44
49
|
return null;
|
|
45
50
|
const t = e.getFeature(y.GAMES);
|
|
46
|
-
return t ? /* @__PURE__ */ u(
|
|
47
|
-
insightId:
|
|
51
|
+
return t ? /* @__PURE__ */ u(b, {
|
|
52
|
+
insightId: o,
|
|
48
53
|
sdk: e,
|
|
49
54
|
persistent: n,
|
|
50
|
-
hideHeader:
|
|
55
|
+
hideHeader: a,
|
|
51
56
|
gamification: t,
|
|
52
57
|
skipAutoClose: i
|
|
53
58
|
}) : null;
|
|
54
|
-
},
|
|
59
|
+
}, j = ({
|
|
55
60
|
event: e,
|
|
56
61
|
theme: n,
|
|
57
62
|
hideHeader: i,
|
|
58
|
-
skipAutoClose:
|
|
59
|
-
persistent:
|
|
63
|
+
skipAutoClose: o,
|
|
64
|
+
persistent: a
|
|
60
65
|
}) => {
|
|
61
|
-
const t = I(),
|
|
62
|
-
return t ? /* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */ u(v, { customTheme: n ??
|
|
66
|
+
const t = I(), s = g();
|
|
67
|
+
return t ? /* @__PURE__ */ c("div", { className: "StreamLayerSDK", children: [
|
|
68
|
+
/* @__PURE__ */ u(v, { customTheme: n ?? s.theme, themeMode: s.themeMode, children: /* @__PURE__ */ u(
|
|
64
69
|
A,
|
|
65
70
|
{
|
|
66
|
-
skipAutoClose:
|
|
71
|
+
skipAutoClose: o,
|
|
67
72
|
sdk: t,
|
|
68
73
|
hideHeader: i,
|
|
69
|
-
persistent:
|
|
74
|
+
persistent: a
|
|
70
75
|
}
|
|
71
76
|
) }),
|
|
72
77
|
e !== void 0 && /* @__PURE__ */ u(k, { event: e })
|
|
73
78
|
] }) : null;
|
|
74
79
|
};
|
|
75
80
|
export {
|
|
76
|
-
|
|
81
|
+
j as StreamLayerSDKInsight,
|
|
77
82
|
A as StreamLayerSDKInsightUI
|
|
78
83
|
};
|