@streamlayer/react 1.14.3 → 1.14.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/advertisement.js +1 -1
- package/lib/cjs/bet-pack.js +1 -1
- package/lib/cjs/index2.js +5 -5
- package/lib/cjs/masters2.js +8 -3
- package/lib/cjs/notification.js +1 -1
- package/lib/cjs/provider.js +32 -16
- package/lib/cjs/useStreamLayerApp2.js +2 -2
- package/lib/classic/cjs/advertisement.js +1 -1
- package/lib/classic/cjs/bet-pack.js +1 -1
- package/lib/classic/cjs/index2.js +5 -5
- package/lib/classic/cjs/masters2.js +8 -3
- package/lib/classic/cjs/notification.js +1 -1
- package/lib/classic/cjs/provider.js +32 -16
- package/lib/classic/cjs/useStreamLayerApp2.js +2 -2
- package/lib/classic/es/advertisement.js +3 -3
- package/lib/classic/es/bet-pack.js +5 -5
- package/lib/classic/es/index.js +4 -4
- package/lib/classic/es/index2.js +1228 -1344
- package/lib/classic/es/masters2.js +404 -399
- package/lib/classic/es/notification.js +42 -40
- package/lib/classic/es/provider.js +3847 -3786
- package/lib/classic/es/useStreamLayerApp2.js +65 -49
- package/lib/classic/style.css +1 -1
- package/lib/dist/cjs/masters.js +48 -27
- package/lib/dist/es/masters.js +11377 -11416
- package/lib/dist/style.css +1 -1
- package/lib/es/advertisement.js +3 -3
- package/lib/es/bet-pack.js +5 -5
- package/lib/es/index.js +4 -4
- package/lib/es/index2.js +1228 -1344
- package/lib/es/masters2.js +404 -399
- package/lib/es/notification.js +42 -40
- package/lib/es/provider.js +3844 -3783
- package/lib/es/useStreamLayerApp2.js +65 -49
- package/lib/style.css +1 -1
- package/package.json +14 -14
package/lib/es/notification.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { k as u, s,
|
|
2
|
-
import { k as m, Q as A, l as
|
|
1
|
+
import { k as u, s, $ as L, a0 as O, a1 as R, C as B, a2 as P, U as Q, d as U, a as V, e as F, N as k, u as W, b as G, V as K, h as Y } from "./provider.js";
|
|
2
|
+
import { k as m, Q as A, l as _, S as H } from "./useStreamLayerApp2.js";
|
|
3
3
|
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
4
|
-
import { useState as y, useCallback as
|
|
4
|
+
import { useState as y, useCallback as J, useMemo as E, useEffect as x } from "react";
|
|
5
5
|
const $ = /* @__PURE__ */ s("div")({
|
|
6
6
|
name: "Media",
|
|
7
7
|
class: "m1bcvojl",
|
|
8
8
|
propsAsIs: !1
|
|
9
|
-
}),
|
|
9
|
+
}), X = () => $, Z = /* @__PURE__ */ s(X())({
|
|
10
10
|
name: "MediaImgBottom",
|
|
11
11
|
class: "m58gin0",
|
|
12
12
|
propsAsIs: !0
|
|
@@ -35,7 +35,7 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
35
35
|
[m.NONE]: C,
|
|
36
36
|
[m.ROUNDED]: ne,
|
|
37
37
|
[m.CENTERED]: oe,
|
|
38
|
-
[m.TRANSPARENT]:
|
|
38
|
+
[m.TRANSPARENT]: Z
|
|
39
39
|
}, N = ({
|
|
40
40
|
src: t,
|
|
41
41
|
imageMode: o = m.UNSET,
|
|
@@ -109,22 +109,22 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
109
109
|
createdTweet: o == null ? void 0 : o.date
|
|
110
110
|
}
|
|
111
111
|
),
|
|
112
|
-
/* @__PURE__ */ e(Ae, { children:
|
|
112
|
+
/* @__PURE__ */ e(Ae, { children: O(n) })
|
|
113
113
|
] });
|
|
114
114
|
}, fe = ({ title: t, questionType: o, questionTypeData: i }) => /* @__PURE__ */ c(M, { children: [
|
|
115
115
|
/* @__PURE__ */ e(
|
|
116
|
-
|
|
116
|
+
R,
|
|
117
117
|
{
|
|
118
118
|
questionTypeData: i,
|
|
119
119
|
questionType: o,
|
|
120
|
-
questionStatus:
|
|
120
|
+
questionStatus: _.UNSET
|
|
121
121
|
}
|
|
122
122
|
),
|
|
123
123
|
t && /* @__PURE__ */ e(pe, { children: t })
|
|
124
124
|
] }), ge = ({ tweet: t }) => t ? /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(ye, { ...t, controlVideo: () => {
|
|
125
125
|
} }) }) : null, Te = ({ action: t, questionType: o, inApp: i, insight: a, tweet: n }) => {
|
|
126
126
|
var d;
|
|
127
|
-
const l =
|
|
127
|
+
const l = B[o], r = P[o];
|
|
128
128
|
if (!l || !i || !i.notification)
|
|
129
129
|
return null;
|
|
130
130
|
const { title: p, image: I, imageMode: v } = i.notification;
|
|
@@ -154,11 +154,11 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
154
154
|
name: "TitleIcon",
|
|
155
155
|
class: "t16zzzei",
|
|
156
156
|
propsAsIs: !0
|
|
157
|
-
}), we = () => Q,
|
|
157
|
+
}), we = () => Q, qe = /* @__PURE__ */ s(we())({
|
|
158
158
|
name: "Close",
|
|
159
159
|
class: "c1sur0q2",
|
|
160
160
|
propsAsIs: !0
|
|
161
|
-
}),
|
|
161
|
+
}), Se = /* @__PURE__ */ s("div")({
|
|
162
162
|
name: "Body",
|
|
163
163
|
class: "bai9j52",
|
|
164
164
|
propsAsIs: !1
|
|
@@ -197,7 +197,7 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
197
197
|
}
|
|
198
198
|
)
|
|
199
199
|
] }),
|
|
200
|
-
/* @__PURE__ */ c(
|
|
200
|
+
/* @__PURE__ */ c(Se, { children: [
|
|
201
201
|
/* @__PURE__ */ c(Ee, { children: [
|
|
202
202
|
/* @__PURE__ */ e(be, { name: "icon-trophy-solid" }),
|
|
203
203
|
(a = i == null ? void 0 : i.titleCard) == null ? void 0 : a.title
|
|
@@ -208,7 +208,7 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
208
208
|
] })
|
|
209
209
|
] }),
|
|
210
210
|
/* @__PURE__ */ e(
|
|
211
|
-
|
|
211
|
+
qe,
|
|
212
212
|
{
|
|
213
213
|
close: (d) => {
|
|
214
214
|
d == null || d.stopPropagation(), o == null || o();
|
|
@@ -226,11 +226,11 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
226
226
|
name: "CheckIcon",
|
|
227
227
|
class: "c1mo15kk",
|
|
228
228
|
propsAsIs: !0
|
|
229
|
-
}),
|
|
229
|
+
}), Oe = () => u, Re = /* @__PURE__ */ s(Oe())({
|
|
230
230
|
name: "PredictionIcon",
|
|
231
231
|
class: "p16zkqnm",
|
|
232
232
|
propsAsIs: !0
|
|
233
|
-
}),
|
|
233
|
+
}), Be = /* @__PURE__ */ s("div")({
|
|
234
234
|
name: "PredictionIconContainer",
|
|
235
235
|
class: "pjszi7a",
|
|
236
236
|
propsAsIs: !1
|
|
@@ -253,16 +253,18 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
253
253
|
state: a = "pending"
|
|
254
254
|
}) => {
|
|
255
255
|
const [n, d] = y(0), [l] = y(() => new ResizeObserver((p) => {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
256
|
+
window.requestAnimationFrame(() => {
|
|
257
|
+
var I, v;
|
|
258
|
+
d((v = (I = p == null ? void 0 : p[0]) == null ? void 0 : I.contentRect) == null ? void 0 : v.width);
|
|
259
|
+
});
|
|
260
|
+
})), r = J((p) => {
|
|
259
261
|
p || l.disconnect(), l.observe(p);
|
|
260
262
|
}, [l]);
|
|
261
263
|
return E(() => () => {
|
|
262
264
|
l.disconnect();
|
|
263
265
|
}, [l]), /* @__PURE__ */ c(ze, {
|
|
264
|
-
children: [/* @__PURE__ */ e(
|
|
265
|
-
children: /* @__PURE__ */ e(
|
|
266
|
+
children: [/* @__PURE__ */ e(Be, {
|
|
267
|
+
children: /* @__PURE__ */ e(Re, {
|
|
266
268
|
name: "icon-prediction"
|
|
267
269
|
})
|
|
268
270
|
}), /* @__PURE__ */ e(Pe, {
|
|
@@ -290,35 +292,35 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
290
292
|
name: "Line",
|
|
291
293
|
class: "l16t1zr7",
|
|
292
294
|
propsAsIs: !1
|
|
293
|
-
}), We = () => g,
|
|
295
|
+
}), We = () => g, Ge = /* @__PURE__ */ s(We())({
|
|
294
296
|
name: "Line1",
|
|
295
297
|
class: "le78kvg",
|
|
296
298
|
propsAsIs: !0
|
|
297
|
-
}),
|
|
299
|
+
}), Ke = () => g, Ye = /* @__PURE__ */ s(Ke())({
|
|
298
300
|
name: "Line2",
|
|
299
301
|
class: "l1o7966d",
|
|
300
302
|
propsAsIs: !0
|
|
301
|
-
}),
|
|
303
|
+
}), _e = () => g, He = /* @__PURE__ */ s(_e())({
|
|
302
304
|
name: "Line3",
|
|
303
305
|
class: "lu9lyxq",
|
|
304
306
|
propsAsIs: !0
|
|
305
|
-
}),
|
|
306
|
-
children: [/* @__PURE__ */ e(
|
|
307
|
+
}), Je = () => /* @__PURE__ */ c(Fe, {
|
|
308
|
+
children: [/* @__PURE__ */ e(Ge, {
|
|
307
309
|
children: /* @__PURE__ */ e("div", {})
|
|
308
|
-
}), /* @__PURE__ */ e(
|
|
310
|
+
}), /* @__PURE__ */ e(Ye, {
|
|
309
311
|
children: /* @__PURE__ */ e("div", {})
|
|
310
|
-
}), /* @__PURE__ */ e(
|
|
312
|
+
}), /* @__PURE__ */ e(He, {
|
|
311
313
|
children: /* @__PURE__ */ e("div", {})
|
|
312
314
|
})]
|
|
313
|
-
}),
|
|
315
|
+
}), Xe = /* @__PURE__ */ s("div")({
|
|
314
316
|
name: "Container",
|
|
315
317
|
class: "c10jy6zf",
|
|
316
318
|
propsAsIs: !1
|
|
317
|
-
}),
|
|
319
|
+
}), Ze = () => u, es = /* @__PURE__ */ s(Ze())({
|
|
318
320
|
name: "CheckIcon",
|
|
319
321
|
class: "c1c7scay",
|
|
320
322
|
propsAsIs: !0
|
|
321
|
-
}), ss = () => /* @__PURE__ */ c(
|
|
323
|
+
}), ss = () => /* @__PURE__ */ c(Xe, {
|
|
322
324
|
children: [/* @__PURE__ */ e(es, {
|
|
323
325
|
name: "icon-check"
|
|
324
326
|
}), " Prediction results are in!"]
|
|
@@ -401,11 +403,11 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
401
403
|
name: "Container",
|
|
402
404
|
class: "cq3agu2",
|
|
403
405
|
propsAsIs: !1
|
|
404
|
-
}),
|
|
406
|
+
}), q = /* @__PURE__ */ s("div")({
|
|
405
407
|
name: "Body",
|
|
406
408
|
class: "b16qj0do",
|
|
407
409
|
propsAsIs: !1
|
|
408
|
-
}),
|
|
410
|
+
}), S = {
|
|
409
411
|
1: 3e3,
|
|
410
412
|
2: 4e3,
|
|
411
413
|
3: 4e3,
|
|
@@ -414,8 +416,8 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
414
416
|
if (x(() => {
|
|
415
417
|
if (i) {
|
|
416
418
|
const I = setTimeout(() => {
|
|
417
|
-
|
|
418
|
-
},
|
|
419
|
+
S[r + 1] && (n || r < 3) ? i(r + 1) : t == null || t();
|
|
420
|
+
}, S[r]);
|
|
419
421
|
return () => {
|
|
420
422
|
I && clearTimeout(I);
|
|
421
423
|
};
|
|
@@ -423,10 +425,10 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
423
425
|
return () => {
|
|
424
426
|
};
|
|
425
427
|
}, [i, r, t, n]), r === 1)
|
|
426
|
-
return /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(
|
|
428
|
+
return /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(q, { children: /* @__PURE__ */ e(ss, {}) }) });
|
|
427
429
|
let p = "pending";
|
|
428
|
-
return (r === 3 || r === 4) && (p = n ? "correct" : "incorrect"), /* @__PURE__ */ e(w, { onClick: () => o == null ? void 0 : o(), children: /* @__PURE__ */ c(
|
|
429
|
-
r !== 1 && /* @__PURE__ */ e(
|
|
430
|
+
return (r === 3 || r === 4) && (p = n ? "correct" : "incorrect"), /* @__PURE__ */ e(w, { onClick: () => o == null ? void 0 : o(), children: /* @__PURE__ */ c(q, { children: [
|
|
431
|
+
r !== 1 && /* @__PURE__ */ e(Je, {}, r),
|
|
430
432
|
/* @__PURE__ */ c(Ve, { state: p, step: r, answer: (a == null ? void 0 : a.title) || "unknown", children: [
|
|
431
433
|
r === 2 && /* @__PURE__ */ e(is, { title: l || "unknown" }),
|
|
432
434
|
r === 3 && n && /* @__PURE__ */ e(ls, {}),
|
|
@@ -455,7 +457,7 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
455
457
|
class: "n1i4h28u",
|
|
456
458
|
propsAsIs: !1
|
|
457
459
|
}), ys = (t) => /* @__PURE__ */ e($s, { children: /* @__PURE__ */ e(As, { ...t }) }), fs = ({ sdk: t }) => {
|
|
458
|
-
const [o] = y(t.getNotificationsStore()), i = V(o), a = t.getFeature(
|
|
460
|
+
const [o] = y(t.getNotificationsStore()), i = V(o), a = t.getFeature(H.GAMES), n = E(() => t.getActiveNotification(), [t, i]);
|
|
459
461
|
return x(() => {
|
|
460
462
|
n && F.emit("notification", {
|
|
461
463
|
action: "rendered",
|
|
@@ -473,8 +475,8 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
473
475
|
}
|
|
474
476
|
) : null : n && n.type === k.ONBOARDING ? n.data.onboarding ? /* @__PURE__ */ e(je, { open: a == null ? void 0 : a.openFeature, close: n.close, ...n.data.onboarding }) : null : n && /* @__PURE__ */ e(Te, { ...n.data, action: n.action });
|
|
475
477
|
}, Ns = ({ theme: t }) => {
|
|
476
|
-
const o = W(), i =
|
|
477
|
-
return o && (a.appNotification || a.onboardingNotification) ? a.app && !a.onboardingNotification ? null : /* @__PURE__ */ e("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ e(
|
|
478
|
+
const o = W(), i = G(), a = K();
|
|
479
|
+
return o && (a.appNotification || a.onboardingNotification) ? a.app && !a.onboardingNotification ? null : /* @__PURE__ */ e("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ e(Y, { customTheme: t ?? i.theme, themeMode: i.themeMode, children: /* @__PURE__ */ e(fs, { sdk: o }) }) }) : null;
|
|
478
480
|
};
|
|
479
481
|
export {
|
|
480
482
|
Ns as StreamLayerSDKNotification,
|