@streamlayer/react 1.21.3 → 1.21.4
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/index2.js +4 -4
- package/lib/cjs/provider.js +15 -15
- package/lib/cjs/useStreamLayerApp2.js +17 -16
- package/lib/classic/cjs/bet-pack.js +4 -4
- package/lib/classic/cjs/provider.js +10 -10
- package/lib/classic/cjs/useStreamLayerApp2.js +17 -16
- package/lib/classic/es/advertisement.js +1 -1
- package/lib/classic/es/bet-pack.js +6 -7
- package/lib/classic/es/notification.js +29 -29
- package/lib/classic/es/provider.js +9 -11
- package/lib/classic/es/useStreamLayerApp2.js +4651 -2705
- package/lib/dist/cjs/masters.js +34 -33
- package/lib/dist/es/masters.js +9557 -7614
- package/lib/es/advertisement.js +1 -1
- package/lib/es/index2.js +6 -7
- package/lib/es/notification.js +29 -29
- package/lib/es/provider.js +9 -11
- package/lib/es/useStreamLayerApp2.js +4651 -2705
- package/package.json +17 -17
|
@@ -5,7 +5,7 @@ import "nanostores";
|
|
|
5
5
|
import "lodash.throttle";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
import "react-countup";
|
|
8
|
-
import { A as Gh, N as vi,
|
|
8
|
+
import { A as Gh, N as vi, b as Xh, c as Kh, d as no, e as Yh, P as rs, f as Jt, g as wm, h as km, i as Cm, S as Im } from "./useStreamLayerApp2.js";
|
|
9
9
|
import { c as xm, u as Am } from "./vast-client.min-B0NUra1B.js";
|
|
10
10
|
import { D as Pm } from "./index-l-eyvmpL.js";
|
|
11
11
|
import { v4 as fu, validate as Lm, v5 as mu } from "uuid";
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
2
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
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
|
|
5
|
-
import Ct from "
|
|
6
|
-
import { S as We } from "./useStreamLayerApp2.js";
|
|
4
|
+
import xt from "lodash.throttle";
|
|
5
|
+
import { C as Tt, a as Ct, S as We } from "./useStreamLayerApp2.js";
|
|
7
6
|
function _e(t) {
|
|
8
7
|
return t !== null && typeof t == "object" && "constructor" in t && t.constructor === Object;
|
|
9
8
|
}
|
|
@@ -3239,7 +3238,7 @@ const Tr = ({ data: t, gamification: e, onEvent: s, swipeable: r, autoplay: n })
|
|
|
3239
3238
|
e.closeQuestion();
|
|
3240
3239
|
}, [u, f] = W(1.1);
|
|
3241
3240
|
return Y(() => {
|
|
3242
|
-
const v =
|
|
3241
|
+
const v = xt(() => {
|
|
3243
3242
|
var h;
|
|
3244
3243
|
const b = (h = l.current) == null ? void 0 : h.size;
|
|
3245
3244
|
if (!b)
|
|
@@ -3283,7 +3282,7 @@ const Tr = ({ data: t, gamification: e, onEvent: s, swipeable: r, autoplay: n })
|
|
|
3283
3282
|
{
|
|
3284
3283
|
onEvent: n,
|
|
3285
3284
|
actionFn: () => n({ type: "slHardRefresh" }),
|
|
3286
|
-
description: l instanceof
|
|
3285
|
+
description: l instanceof Tt && l.code !== Ct.InvalidArgument ? `The event ID was not
|
|
3287
3286
|
specified or is invalid.` : `The server is unable to
|
|
3288
3287
|
handle this request.`
|
|
3289
3288
|
}
|
|
@@ -3416,12 +3415,12 @@ view this resource.`
|
|
|
3416
3415
|
action: "tap",
|
|
3417
3416
|
payload: {}
|
|
3418
3417
|
});
|
|
3419
|
-
},
|
|
3418
|
+
}, qr = () => {
|
|
3420
3419
|
const t = bt();
|
|
3421
3420
|
return Y(() => (document == null || document.addEventListener("click", Ve), () => {
|
|
3422
3421
|
document == null || document.removeEventListener("click", Ve);
|
|
3423
3422
|
}), []), t ? /* @__PURE__ */ P(mt, { sdk: t }) : null;
|
|
3424
3423
|
};
|
|
3425
3424
|
export {
|
|
3426
|
-
|
|
3425
|
+
qr as BetPackProvider
|
|
3427
3426
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as l, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { useState as w, useRef as _, useEffect as y, useCallback as As, useMemo as
|
|
3
|
-
import { s as n, B as A, D as
|
|
2
|
+
import { useState as w, useRef as _, useEffect as y, useCallback as As, useMemo as Is } from "react";
|
|
3
|
+
import { s as n, B as A, D as hs, v as $s, x as K, w as G, z as gs, E as ws, O as x, y as ys, f as Ts, e as bs, i as Cs, N as O, u as fs, d as ks, c as Ns, h as qs } from "./provider.js";
|
|
4
4
|
import "nanostores";
|
|
5
5
|
import "lodash.throttle";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
import "react-countup";
|
|
8
|
-
import { Q as v,
|
|
8
|
+
import { Q as v, j as h, k as H, l as L, S as Es, A as R } from "./useStreamLayerApp2.js";
|
|
9
9
|
const b = /* @__PURE__ */ n("div")({
|
|
10
10
|
name: "Media",
|
|
11
11
|
class: "m1bcvojl",
|
|
@@ -105,7 +105,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
105
105
|
return /* @__PURE__ */ l(Hs, { children: [
|
|
106
106
|
p && /* @__PURE__ */ s(_s, { children: /* @__PURE__ */ s(Ks, { children: p }) }),
|
|
107
107
|
/* @__PURE__ */ s(
|
|
108
|
-
|
|
108
|
+
hs,
|
|
109
109
|
{
|
|
110
110
|
image: e,
|
|
111
111
|
name: (d = i == null ? void 0 : i.meta) == null ? void 0 : d.accountName,
|
|
@@ -133,13 +133,13 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
133
133
|
if (!d || !t || !t.notification)
|
|
134
134
|
return null;
|
|
135
135
|
const { title: m, image: u, imageMode: $ } = t.notification;
|
|
136
|
-
let
|
|
137
|
-
i ===
|
|
138
|
-
const g = t.useMediaFromContent && (o == null ? void 0 : o.image), c = i ===
|
|
139
|
-
return /* @__PURE__ */ s(Vs, { "data-a": "intr", className: "SL_InApp", onClick: e, children: /* @__PURE__ */ l(Us, { style:
|
|
140
|
-
|
|
136
|
+
let I = u;
|
|
137
|
+
i === h.TWEET && a != null && a.tweetMedia && (I = a.tweetMedia.image), $ === v.NONE && (I = "");
|
|
138
|
+
const g = t.useMediaFromContent && (o == null ? void 0 : o.image), c = i === h.TWEET && ((p = a == null ? void 0 : a.tweetMedia) == null ? void 0 : p.video) || i === h.FACTOID && (o == null ? void 0 : o.video);
|
|
139
|
+
return /* @__PURE__ */ s(Vs, { "data-a": "intr", className: "SL_InApp", onClick: e, children: /* @__PURE__ */ l(Us, { style: I ? {} : { paddingLeft: "1.5rem" }, children: [
|
|
140
|
+
I && !g && /* @__PURE__ */ s(j, { src: I, imageMode: $, withVideo: !!c }),
|
|
141
141
|
g && /* @__PURE__ */ s(j, { src: g, fromInsight: !0, withVideo: !!c }),
|
|
142
|
-
i ===
|
|
142
|
+
i === h.TWEET ? /* @__PURE__ */ s(Zs, { tweet: a }) : /* @__PURE__ */ s(Xs, { questionTypeData: d, questionType: i, title: m }),
|
|
143
143
|
/* @__PURE__ */ s(Qs, { name: "inapp-button", children: r || "Open" }),
|
|
144
144
|
/* @__PURE__ */ s(Ys, { name: "chevronRight" })
|
|
145
145
|
] }) });
|
|
@@ -184,7 +184,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
184
184
|
name: "MediaNone",
|
|
185
185
|
class: "mqfzyyr",
|
|
186
186
|
propsAsIs: !0
|
|
187
|
-
}), Ae = "v170mtgf",
|
|
187
|
+
}), Ae = "v170mtgf", Ie = {
|
|
188
188
|
[v.UNSET]: S,
|
|
189
189
|
[v.NONE]: S,
|
|
190
190
|
[v.ROUNDED]: pe,
|
|
@@ -204,7 +204,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
204
204
|
color: o,
|
|
205
205
|
children: /* @__PURE__ */ s(S, {})
|
|
206
206
|
});
|
|
207
|
-
const d = a === L.ENABLED ? re :
|
|
207
|
+
const d = a === L.ENABLED ? re : Ie[i];
|
|
208
208
|
return /* @__PURE__ */ s(B, {
|
|
209
209
|
color: o,
|
|
210
210
|
children: t ? /* @__PURE__ */ s(te, {
|
|
@@ -220,14 +220,14 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
220
220
|
})
|
|
221
221
|
})
|
|
222
222
|
});
|
|
223
|
-
},
|
|
223
|
+
}, he = () => ({
|
|
224
224
|
withoutPadding: e
|
|
225
225
|
}) => e ? "0px" : "1rem", X = /* @__PURE__ */ n("div")({
|
|
226
226
|
name: "NotificationContent",
|
|
227
227
|
class: "n1p3bk1c",
|
|
228
228
|
propsAsIs: !1,
|
|
229
229
|
vars: {
|
|
230
|
-
"n1p3bk1c-0": [
|
|
230
|
+
"n1p3bk1c-0": [he()]
|
|
231
231
|
}
|
|
232
232
|
}), $e = /* @__PURE__ */ n("div")({
|
|
233
233
|
name: "MainContent",
|
|
@@ -243,7 +243,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
243
243
|
propsAsIs: !1
|
|
244
244
|
}), ye = () => ({
|
|
245
245
|
questionType: e
|
|
246
|
-
}) => e ===
|
|
246
|
+
}) => e === h.FACTOID ? "7.3rem" : "4.5rem", Te = () => ({
|
|
247
247
|
webos: e
|
|
248
248
|
}) => e ? "11px 0px 8px 0px" : "11px 0px", be = () => ({
|
|
249
249
|
imageMode: e,
|
|
@@ -332,20 +332,20 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
332
332
|
webos: d
|
|
333
333
|
}) => {
|
|
334
334
|
var r, m, u;
|
|
335
|
-
const [$,
|
|
336
|
-
y(() => (o != null && o.sponsorLogo && (
|
|
337
|
-
|
|
335
|
+
const [$, I] = w(!1), g = _();
|
|
336
|
+
y(() => (o != null && o.sponsorLogo && (I(!0), g.current = setTimeout(() => {
|
|
337
|
+
I(!1);
|
|
338
338
|
}, 5e3)), () => clearTimeout(g.current)), [o == null ? void 0 : o.sponsorLogo]);
|
|
339
339
|
const c = G[t];
|
|
340
340
|
if (!c || !o || !o.notification)
|
|
341
341
|
return null;
|
|
342
|
-
const { title: ds, image: ps, imageMode: f, useContentMedia: k } = o.notification, ms = t ===
|
|
342
|
+
const { title: ds, image: ps, imageMode: f, useContentMedia: k } = o.notification, ms = t === h.FACTOID ? a == null ? void 0 : a.heading : ds, us = t === h.FACTOID ? a == null ? void 0 : a.body : "", vs = ps, N = t === h.FACTOID && ((r = a == null ? void 0 : a.video) == null ? void 0 : r.url) && (o == null ? void 0 : o.isVideo) && k === L.ENABLED, q = k === L.ENABLED ? N ? (m = a == null ? void 0 : a.video) == null ? void 0 : m.url : a == null ? void 0 : a.image : "";
|
|
343
343
|
return o != null && o.sponsorLogo && $ ? /* @__PURE__ */ s(
|
|
344
344
|
Fe,
|
|
345
345
|
{
|
|
346
346
|
sponsorLogo: o == null ? void 0 : o.sponsorLogo,
|
|
347
347
|
webos: d,
|
|
348
|
-
onClick: () =>
|
|
348
|
+
onClick: () => I(!1)
|
|
349
349
|
}
|
|
350
350
|
) : /* @__PURE__ */ l(
|
|
351
351
|
Z,
|
|
@@ -355,7 +355,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
355
355
|
onClick: (C) => {
|
|
356
356
|
d || e == null || e(C);
|
|
357
357
|
},
|
|
358
|
-
"data-is-insight": t ===
|
|
358
|
+
"data-is-insight": t === h.FACTOID,
|
|
359
359
|
"data-webos": d,
|
|
360
360
|
children: [
|
|
361
361
|
(o == null ? void 0 : o.sponsorLogo) && /* @__PURE__ */ s(Se, { children: /* @__PURE__ */ s(ss, { src: o == null ? void 0 : o.sponsorLogo }) }),
|
|
@@ -563,7 +563,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
563
563
|
name: "Line1",
|
|
564
564
|
class: "le78kvg",
|
|
565
565
|
propsAsIs: !0
|
|
566
|
-
}),
|
|
566
|
+
}), In = () => D, hn = /* @__PURE__ */ n(In())({
|
|
567
567
|
name: "Line2",
|
|
568
568
|
class: "l1o7966d",
|
|
569
569
|
propsAsIs: !0
|
|
@@ -574,7 +574,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
574
574
|
}), wn = () => /* @__PURE__ */ l(un, {
|
|
575
575
|
children: [/* @__PURE__ */ s(An, {
|
|
576
576
|
children: /* @__PURE__ */ s("div", {})
|
|
577
|
-
}), /* @__PURE__ */ s(
|
|
577
|
+
}), /* @__PURE__ */ s(hn, {
|
|
578
578
|
children: /* @__PURE__ */ s("div", {})
|
|
579
579
|
}), /* @__PURE__ */ s(gn, {
|
|
580
580
|
children: /* @__PURE__ */ s("div", {})
|
|
@@ -879,7 +879,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
879
879
|
1: 3e3,
|
|
880
880
|
2: 4e3,
|
|
881
881
|
3: 4e3
|
|
882
|
-
},
|
|
882
|
+
}, Io = ({ close: e, action: i, setStep: t, votedAnswer: o, correct: a, correctAnswerTitle: p, questionTitle: d, step: r }) => {
|
|
883
883
|
if (y(() => {
|
|
884
884
|
if (t) {
|
|
885
885
|
const u = setTimeout(() => {
|
|
@@ -902,10 +902,10 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
902
902
|
r === 3 && !a && /* @__PURE__ */ s(Ao, { title: p || "unknown", answer: (o == null ? void 0 : o.title) || "unknown" })
|
|
903
903
|
] })
|
|
904
904
|
] }) });
|
|
905
|
-
},
|
|
905
|
+
}, ho = ({ close: e, action: i, votedAnswer: t, correct: o, correctAnswerTitle: a, questionTitle: p }) => {
|
|
906
906
|
const [d, r] = w(1);
|
|
907
907
|
return /* @__PURE__ */ s(
|
|
908
|
-
|
|
908
|
+
Io,
|
|
909
909
|
{
|
|
910
910
|
close: e,
|
|
911
911
|
action: i,
|
|
@@ -953,11 +953,11 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
953
953
|
}, 5e3)), () => clearTimeout(m.current);
|
|
954
954
|
}, [(i = e == null ? void 0 : e.inApp) == null ? void 0 : i.sponsorLogo]), (t = e == null ? void 0 : e.inApp) != null && t.sponsorLogo && d ? /* @__PURE__ */ s(bo, { sponsorLogo: (o = e.inApp) == null ? void 0 : o.sponsorLogo, onClick: () => r(!1) }) : /* @__PURE__ */ s(cs, { children: /* @__PURE__ */ l("div", { children: [
|
|
955
955
|
((a = e == null ? void 0 : e.inApp) == null ? void 0 : a.sponsorLogo) && /* @__PURE__ */ s(To, { children: /* @__PURE__ */ s(ls, { src: (p = e == null ? void 0 : e.inApp) == null ? void 0 : p.sponsorLogo }) }),
|
|
956
|
-
/* @__PURE__ */ s(
|
|
956
|
+
/* @__PURE__ */ s(ho, { ...e })
|
|
957
957
|
] }) });
|
|
958
958
|
}, fo = ({ sdk: e, webos: i }) => {
|
|
959
959
|
var t, o, a, p, d, r, m, u;
|
|
960
|
-
const [$] = w(e.getNotificationsStore()),
|
|
960
|
+
const [$] = w(e.getNotificationsStore()), I = bs($), g = e.getFeature(Es.GAMES), c = Is(() => e.getActiveNotification(), [e, I]);
|
|
961
961
|
return y(() => {
|
|
962
962
|
c && Cs.emit("notification", {
|
|
963
963
|
action: "rendered",
|
|
@@ -966,7 +966,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
966
966
|
questionType: c.data.questionType
|
|
967
967
|
}
|
|
968
968
|
});
|
|
969
|
-
}, [c]), c && c.type === O.QUESTION_RESOLVED ? c.data.question && c.data.questionType ===
|
|
969
|
+
}, [c]), c && c.type === O.QUESTION_RESOLVED ? c.data.question && c.data.questionType === h.PREDICTION ? c && ((t = c.data.inApp) == null ? void 0 : t.adUnit) === R.STANDART ? /* @__PURE__ */ s(
|
|
970
970
|
Co,
|
|
971
971
|
{
|
|
972
972
|
action: c.action,
|
|
@@ -4,7 +4,7 @@ var p1 = (e, t, n) => M7(e, typeof t != "symbol" ? t + "" : t, n);
|
|
|
4
4
|
import { jsx as a, jsxs as g, Fragment as d1 } from "react/jsx-runtime";
|
|
5
5
|
import * as d from "react";
|
|
6
6
|
import F1, { useState as Z, useEffect as j, useRef as l1, createContext as E6, useContext as Q1, useCallback as o1, useMemo as f1, useLayoutEffect as A6, forwardRef as k3, memo as V7, Component as F7, createElement as O7, PureComponent as N7, lazy as H7, Suspense as D7 } from "react";
|
|
7
|
-
import { S as E1,
|
|
7
|
+
import { S as E1, a as U1, m as ot, j as S, n as q7, Q as K1, k as r2, A as T6, h as B7, g as w3, I as R6, o as P7, p as A2, u as Z7 } from "./useStreamLayerApp2.js";
|
|
8
8
|
import { listenKeys as K7 } from "nanostores";
|
|
9
9
|
import { pino as U7 } from "pino";
|
|
10
10
|
import b3 from "lodash.throttle";
|
|
@@ -13,8 +13,6 @@ import { createPortal as F2 } from "react-dom";
|
|
|
13
13
|
import j7 from "react-countup";
|
|
14
14
|
import z7 from "react-infinite-scroller";
|
|
15
15
|
import "uuid";
|
|
16
|
-
import { Code as U1, createContextKey as ot } from "@connectrpc/connect";
|
|
17
|
-
import "@connectrpc/connect-web";
|
|
18
16
|
import "@nanostores/query";
|
|
19
17
|
const G7 = U7({
|
|
20
18
|
level: "trace",
|
|
@@ -3435,7 +3433,7 @@ const us = (e) => /* @__PURE__ */ d.createElement("svg", { width: 24, height: 24
|
|
|
3435
3433
|
[S.POLL]: { label: "Poll", iconName: "icon-poll" },
|
|
3436
3434
|
[S.TRIVIA]: { label: "Trivia", iconName: "icon-trivia" },
|
|
3437
3435
|
[S.PREDICTION]: { label: "Prediction", iconName: "icon-prediction" }
|
|
3438
|
-
},
|
|
3436
|
+
}, If = {
|
|
3439
3437
|
[S.TWEET]: "Learn more",
|
|
3440
3438
|
[S.FACTOID]: "Learn more",
|
|
3441
3439
|
[S.POLL]: "Answer",
|
|
@@ -6069,7 +6067,7 @@ const Pd = /* @__PURE__ */ c("div")({
|
|
|
6069
6067
|
}) => {
|
|
6070
6068
|
const n = e + t;
|
|
6071
6069
|
return n === 0 ? 0 : Math.round(e / n * 100);
|
|
6072
|
-
},
|
|
6070
|
+
}, _f = ({
|
|
6073
6071
|
gamification: e,
|
|
6074
6072
|
scrollStore: t,
|
|
6075
6073
|
className: n,
|
|
@@ -7511,7 +7509,7 @@ const Pd = /* @__PURE__ */ c("div")({
|
|
|
7511
7509
|
n({ ...r });
|
|
7512
7510
|
}) : () => {
|
|
7513
7511
|
}, [e == null ? void 0 : e.uiState]), t;
|
|
7514
|
-
},
|
|
7512
|
+
}, Ef = ({ event: e, topNavigation: t, theme: n, muted: r, withSidebarNotification: i = !0 }) => {
|
|
7515
7513
|
const { sdk: s, status: o } = Q1(Y1), l = af(), u = sf(), { event: p } = Q1(Y1);
|
|
7516
7514
|
if (o === S3.UNSET)
|
|
7517
7515
|
throw new Error("Wrap app in `StreamLayerProvider`");
|
|
@@ -7529,7 +7527,7 @@ var S3 = /* @__PURE__ */ ((e) => (e[e.UNSET = 0] = "UNSET", e[e.CONNECTED = 1] =
|
|
|
7529
7527
|
const lf = {
|
|
7530
7528
|
status: 0,
|
|
7531
7529
|
sdk: null
|
|
7532
|
-
}, Y1 = E6(lf),
|
|
7530
|
+
}, Y1 = E6(lf), Af = ({
|
|
7533
7531
|
sdkKey: e,
|
|
7534
7532
|
theme: t,
|
|
7535
7533
|
themeMode: n,
|
|
@@ -7588,15 +7586,15 @@ export {
|
|
|
7588
7586
|
s2 as F,
|
|
7589
7587
|
i2 as N,
|
|
7590
7588
|
Y3 as O,
|
|
7591
|
-
|
|
7589
|
+
Af as S,
|
|
7592
7590
|
vd as T,
|
|
7593
7591
|
of as a,
|
|
7594
|
-
|
|
7592
|
+
Ef as b,
|
|
7595
7593
|
af as c,
|
|
7596
7594
|
sf as d,
|
|
7597
7595
|
J as e,
|
|
7598
7596
|
J3 as f,
|
|
7599
|
-
|
|
7597
|
+
_f as g,
|
|
7600
7598
|
tf as h,
|
|
7601
7599
|
w2 as i,
|
|
7602
7600
|
o2 as j,
|
|
@@ -7615,5 +7613,5 @@ export {
|
|
|
7615
7613
|
j2 as w,
|
|
7616
7614
|
ku as x,
|
|
7617
7615
|
Ma as y,
|
|
7618
|
-
|
|
7616
|
+
If as z
|
|
7619
7617
|
};
|