@streamlayer/react 1.12.1 → 1.13.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/app.d.ts +1 -0
- package/lib/app/masters.d.ts +11 -18
- package/lib/app/provider.d.ts +2 -0
- package/lib/app/useStreamLayerApp.d.ts +3 -1
- package/lib/cjs/advertisement.js +1 -1
- package/lib/cjs/bet-pack.js +1 -1
- package/lib/cjs/gamification-feature2.js +1 -1
- package/lib/cjs/index2.js +6 -2
- package/lib/cjs/masters.js +1 -1
- package/lib/cjs/masters2.js +3 -3
- package/lib/cjs/notification.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/provider.js +28 -162
- package/lib/cjs/useStreamLayerApp2.js +9 -9
- package/lib/classic/app/app.d.ts +1 -0
- package/lib/classic/app/masters.d.ts +11 -18
- package/lib/classic/app/provider.d.ts +2 -0
- package/lib/classic/app/useStreamLayerApp.d.ts +3 -1
- package/lib/classic/cjs/advertisement.js +1 -1
- package/lib/classic/cjs/bet-pack.js +1 -1
- package/lib/classic/cjs/gamification-feature2.js +1 -1
- package/lib/classic/cjs/index2.js +6 -2
- package/lib/classic/cjs/masters.js +1 -1
- package/lib/classic/cjs/masters2.js +3 -3
- package/lib/classic/cjs/notification.js +1 -1
- package/lib/classic/cjs/points.js +1 -1
- package/lib/classic/cjs/provider.js +28 -162
- package/lib/classic/cjs/useStreamLayerApp2.js +9 -9
- package/lib/classic/es/advertisement.js +30 -30
- package/lib/classic/es/bet-pack.js +1 -1
- package/lib/classic/es/gamification-feature2.js +1 -1
- package/lib/classic/es/index.js +1 -1
- package/lib/classic/es/index2.js +1160 -1055
- package/lib/classic/es/masters.js +5 -4
- package/lib/classic/es/masters2.js +467 -580
- package/lib/classic/es/notification.js +42 -42
- package/lib/classic/es/points.js +5 -5
- package/lib/classic/es/provider.js +8535 -22157
- package/lib/classic/es/useStreamLayerApp2.js +2321 -2232
- package/lib/classic/style.css +1 -1
- package/lib/dist/cjs/gamification-feature.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 +53 -183
- package/lib/dist/es/gamification-feature.js +1 -1
- package/lib/dist/es/gamification-feature2.js +231 -77
- package/lib/dist/es/index.js +3 -2
- package/lib/dist/es/masters.js +19314 -32998
- package/lib/dist/style.css +1 -1
- package/lib/es/advertisement.js +30 -30
- package/lib/es/bet-pack.js +1 -1
- package/lib/es/gamification-feature2.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/index2.js +1160 -1055
- package/lib/es/masters.js +5 -4
- package/lib/es/masters2.js +467 -580
- package/lib/es/notification.js +42 -42
- package/lib/es/points.js +5 -5
- package/lib/es/provider.js +8524 -22146
- package/lib/es/useStreamLayerApp2.js +2321 -2232
- package/lib/style.css +1 -1
- package/package.json +17 -15
package/lib/es/notification.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Z as m, s as e, a0 as L, a1 as z, a2 as B, E as O, a3 as R, f as P, d as Q, a as U, g as V, N as T, u as F, b as W, i as G, h as K } from "./provider.js";
|
|
2
|
+
import { k as p, Q as I, l as Y, S as _ } from "./useStreamLayerApp2.js";
|
|
3
3
|
import { jsxs as c, jsx as s } from "react/jsx-runtime";
|
|
4
|
-
import { useState as q, useEffect as E, useMemo as
|
|
4
|
+
import { useState as q, useEffect as E, useMemo as Z } from "react";
|
|
5
5
|
const h = /* @__PURE__ */ e("div")({
|
|
6
6
|
name: "Media",
|
|
7
7
|
class: "m1bcvojl",
|
|
8
8
|
propsAsIs: !1
|
|
9
|
-
}),
|
|
9
|
+
}), H = () => h, J = /* @__PURE__ */ e(H())({
|
|
10
10
|
name: "MediaImgBottom",
|
|
11
11
|
class: "m58gin0",
|
|
12
12
|
propsAsIs: !0
|
|
13
|
-
}),
|
|
13
|
+
}), X = () => h, N = /* @__PURE__ */ e(X())({
|
|
14
14
|
name: "MediaImgSolid",
|
|
15
15
|
class: "m1atm8do",
|
|
16
16
|
propsAsIs: !0
|
|
@@ -31,12 +31,12 @@ const h = /* @__PURE__ */ e("div")({
|
|
|
31
31
|
class: "v1kofb47",
|
|
32
32
|
propsAsIs: !1
|
|
33
33
|
}), cs = {
|
|
34
|
-
[p.UNSET]:
|
|
35
|
-
[p.NONE]:
|
|
34
|
+
[p.UNSET]: N,
|
|
35
|
+
[p.NONE]: N,
|
|
36
36
|
[p.ROUNDED]: es,
|
|
37
37
|
[p.CENTERED]: ts,
|
|
38
|
-
[p.TRANSPARENT]:
|
|
39
|
-
},
|
|
38
|
+
[p.TRANSPARENT]: J
|
|
39
|
+
}, C = ({
|
|
40
40
|
src: t,
|
|
41
41
|
imageMode: o = p.UNSET,
|
|
42
42
|
withVideo: i,
|
|
@@ -132,8 +132,8 @@ const h = /* @__PURE__ */ e("div")({
|
|
|
132
132
|
o === I.TWEET && n != null && n.tweetMedia && (u = n.tweetMedia.image), f === p.NONE && (u = "");
|
|
133
133
|
const $ = i.useMediaFromContent && (a == null ? void 0 : a.image), g = o === I.TWEET && ((l = n == null ? void 0 : n.tweetMedia) == null ? void 0 : l.video) || o === I.FACTOID && (a == null ? void 0 : a.video);
|
|
134
134
|
return /* @__PURE__ */ s(ls, { className: "SL_InApp", onClick: t, children: /* @__PURE__ */ c(rs, { style: u ? {} : { paddingLeft: "1.5rem" }, children: [
|
|
135
|
-
u && !$ && /* @__PURE__ */ s(
|
|
136
|
-
$ && /* @__PURE__ */ s(
|
|
135
|
+
u && !$ && /* @__PURE__ */ s(C, { src: u, imageMode: f, withVideo: !!g }),
|
|
136
|
+
$ && /* @__PURE__ */ s(C, { src: $, fromInsight: !0, withVideo: !!g }),
|
|
137
137
|
o === I.TWEET ? /* @__PURE__ */ s(fs, { tweet: n }) : /* @__PURE__ */ s(ys, { questionTypeData: d, questionType: o, title: v }),
|
|
138
138
|
/* @__PURE__ */ s(ps, { name: "inapp-button", children: r || "Open" }),
|
|
139
139
|
/* @__PURE__ */ s(us, { name: "chevronRight" })
|
|
@@ -142,19 +142,19 @@ const h = /* @__PURE__ */ e("div")({
|
|
|
142
142
|
name: "NotificationContainer",
|
|
143
143
|
class: "n11jcrxe",
|
|
144
144
|
propsAsIs: !1
|
|
145
|
-
}),
|
|
145
|
+
}), b = /* @__PURE__ */ e("img")({
|
|
146
146
|
name: "Icon",
|
|
147
147
|
class: "i1vmpt6u",
|
|
148
148
|
propsAsIs: !1
|
|
149
|
-
}),
|
|
149
|
+
}), Ns = /* @__PURE__ */ e("div")({
|
|
150
150
|
name: "IconContainer",
|
|
151
151
|
class: "i180665s",
|
|
152
152
|
propsAsIs: !1
|
|
153
|
-
}),
|
|
153
|
+
}), Cs = () => m, bs = /* @__PURE__ */ e(Cs())({
|
|
154
154
|
name: "TitleIcon",
|
|
155
155
|
class: "t16zzzei",
|
|
156
156
|
propsAsIs: !0
|
|
157
|
-
}),
|
|
157
|
+
}), ks = () => P, ws = /* @__PURE__ */ e(ks())({
|
|
158
158
|
name: "Close",
|
|
159
159
|
class: "c1sur0q2",
|
|
160
160
|
propsAsIs: !0
|
|
@@ -174,7 +174,7 @@ const h = /* @__PURE__ */ e("div")({
|
|
|
174
174
|
name: "Button",
|
|
175
175
|
class: "b1ubkw1q",
|
|
176
176
|
propsAsIs: !1
|
|
177
|
-
}),
|
|
177
|
+
}), xs = ({
|
|
178
178
|
open: t,
|
|
179
179
|
close: o,
|
|
180
180
|
...i
|
|
@@ -187,10 +187,10 @@ const h = /* @__PURE__ */ e("div")({
|
|
|
187
187
|
t == null || t(), i && (i.instantOpen = !0);
|
|
188
188
|
},
|
|
189
189
|
children: [
|
|
190
|
-
/* @__PURE__ */ c(
|
|
191
|
-
/* @__PURE__ */ s(
|
|
190
|
+
/* @__PURE__ */ c(Ns, { children: [
|
|
191
|
+
/* @__PURE__ */ s(b, { className: "on-light", src: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification.png" }),
|
|
192
192
|
/* @__PURE__ */ s(
|
|
193
|
-
|
|
193
|
+
b,
|
|
194
194
|
{
|
|
195
195
|
className: "on-dark",
|
|
196
196
|
src: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification-dark.png"
|
|
@@ -199,7 +199,7 @@ const h = /* @__PURE__ */ e("div")({
|
|
|
199
199
|
] }),
|
|
200
200
|
/* @__PURE__ */ c(Ss, { children: [
|
|
201
201
|
/* @__PURE__ */ c(qs, { children: [
|
|
202
|
-
/* @__PURE__ */ s(
|
|
202
|
+
/* @__PURE__ */ s(bs, { name: "icon-trophy-solid" }),
|
|
203
203
|
(a = i == null ? void 0 : i.titleCard) == null ? void 0 : a.title
|
|
204
204
|
] }),
|
|
205
205
|
/* @__PURE__ */ c(Es, { children: [
|
|
@@ -218,7 +218,7 @@ const h = /* @__PURE__ */ e("div")({
|
|
|
218
218
|
]
|
|
219
219
|
}
|
|
220
220
|
);
|
|
221
|
-
},
|
|
221
|
+
}, js = /* @__PURE__ */ e("div")({
|
|
222
222
|
name: "Container",
|
|
223
223
|
class: "cef8huz",
|
|
224
224
|
propsAsIs: !1
|
|
@@ -251,7 +251,7 @@ const h = /* @__PURE__ */ e("div")({
|
|
|
251
251
|
children: o,
|
|
252
252
|
answer: i,
|
|
253
253
|
state: a = "pending"
|
|
254
|
-
}) => /* @__PURE__ */ c(
|
|
254
|
+
}) => /* @__PURE__ */ c(js, {
|
|
255
255
|
children: [/* @__PURE__ */ s(Os, {
|
|
256
256
|
children: /* @__PURE__ */ s(Bs, {
|
|
257
257
|
name: "icon-prediction"
|
|
@@ -288,7 +288,7 @@ const h = /* @__PURE__ */ e("div")({
|
|
|
288
288
|
name: "Line3",
|
|
289
289
|
class: "lu9lyxq",
|
|
290
290
|
propsAsIs: !0
|
|
291
|
-
}),
|
|
291
|
+
}), Zs = () => /* @__PURE__ */ c(Vs, {
|
|
292
292
|
children: [/* @__PURE__ */ s(Ws, {
|
|
293
293
|
children: /* @__PURE__ */ s("div", {})
|
|
294
294
|
}), /* @__PURE__ */ s(Ks, {
|
|
@@ -296,16 +296,16 @@ const h = /* @__PURE__ */ e("div")({
|
|
|
296
296
|
}), /* @__PURE__ */ s(_s, {
|
|
297
297
|
children: /* @__PURE__ */ s("div", {})
|
|
298
298
|
})]
|
|
299
|
-
}),
|
|
299
|
+
}), Hs = /* @__PURE__ */ e("div")({
|
|
300
300
|
name: "Container",
|
|
301
301
|
class: "c10jy6zf",
|
|
302
302
|
propsAsIs: !1
|
|
303
|
-
}),
|
|
303
|
+
}), Js = () => m, Xs = /* @__PURE__ */ e(Js())({
|
|
304
304
|
name: "CheckIcon",
|
|
305
305
|
class: "c1c7scay",
|
|
306
306
|
propsAsIs: !0
|
|
307
|
-
}), se = () => /* @__PURE__ */ c(
|
|
308
|
-
children: [/* @__PURE__ */ s(
|
|
307
|
+
}), se = () => /* @__PURE__ */ c(Hs, {
|
|
308
|
+
children: [/* @__PURE__ */ s(Xs, {
|
|
309
309
|
name: "icon-check"
|
|
310
310
|
}), " Prediction results are in!"]
|
|
311
311
|
}), ee = /* @__PURE__ */ e("div")({
|
|
@@ -328,11 +328,11 @@ const h = /* @__PURE__ */ e("div")({
|
|
|
328
328
|
}), /* @__PURE__ */ s(te, {
|
|
329
329
|
children: t
|
|
330
330
|
})]
|
|
331
|
-
}),
|
|
331
|
+
}), x = /* @__PURE__ */ e("div")({
|
|
332
332
|
name: "Container",
|
|
333
333
|
class: "c181a1as",
|
|
334
334
|
propsAsIs: !1
|
|
335
|
-
}),
|
|
335
|
+
}), j = /* @__PURE__ */ e("div")({
|
|
336
336
|
name: "Title",
|
|
337
337
|
class: "t1cduox6",
|
|
338
338
|
propsAsIs: !1
|
|
@@ -344,16 +344,16 @@ const h = /* @__PURE__ */ e("div")({
|
|
|
344
344
|
name: "InCorrectIcon",
|
|
345
345
|
class: "i17n9o7e",
|
|
346
346
|
propsAsIs: !0
|
|
347
|
-
}), re = () => /* @__PURE__ */ c(
|
|
348
|
-
children: [/* @__PURE__ */ c(
|
|
347
|
+
}), re = () => /* @__PURE__ */ c(x, {
|
|
348
|
+
children: [/* @__PURE__ */ c(j, {
|
|
349
349
|
children: ["Congratulations!", /* @__PURE__ */ s("br", {}), "You answered correctly."]
|
|
350
350
|
}), /* @__PURE__ */ s(D, {
|
|
351
351
|
name: "icon-check"
|
|
352
352
|
})]
|
|
353
353
|
}), le = ({
|
|
354
354
|
title: t
|
|
355
|
-
}) => /* @__PURE__ */ c(
|
|
356
|
-
children: [/* @__PURE__ */ c(
|
|
355
|
+
}) => /* @__PURE__ */ c(x, {
|
|
356
|
+
children: [/* @__PURE__ */ c(j, {
|
|
357
357
|
children: ["Better luck next time!", /* @__PURE__ */ s("br", {}), "Correct: ", t]
|
|
358
358
|
}), /* @__PURE__ */ s(ce, {
|
|
359
359
|
name: "icon-cross"
|
|
@@ -383,7 +383,7 @@ const h = /* @__PURE__ */ e("div")({
|
|
|
383
383
|
}), /* @__PURE__ */ s(ue, {
|
|
384
384
|
name: "icon-trophy-solid"
|
|
385
385
|
})]
|
|
386
|
-
}),
|
|
386
|
+
}), k = /* @__PURE__ */ e("div")({
|
|
387
387
|
name: "Container",
|
|
388
388
|
class: "cq3agu2",
|
|
389
389
|
propsAsIs: !1
|
|
@@ -409,10 +409,10 @@ const h = /* @__PURE__ */ e("div")({
|
|
|
409
409
|
return () => {
|
|
410
410
|
};
|
|
411
411
|
}, [i, r, t, n]), r === 1)
|
|
412
|
-
return /* @__PURE__ */ s(
|
|
412
|
+
return /* @__PURE__ */ s(k, { children: /* @__PURE__ */ s(w, { children: /* @__PURE__ */ s(se, {}) }) });
|
|
413
413
|
let v = "pending";
|
|
414
|
-
return (r === 3 || r === 4) && (v = n ? "correct" : "incorrect"), /* @__PURE__ */ s(
|
|
415
|
-
r !== 1 && /* @__PURE__ */ s(
|
|
414
|
+
return (r === 3 || r === 4) && (v = n ? "correct" : "incorrect"), /* @__PURE__ */ s(k, { onClick: () => o == null ? void 0 : o(), children: /* @__PURE__ */ c(w, { children: [
|
|
415
|
+
r !== 1 && /* @__PURE__ */ s(Zs, {}, r),
|
|
416
416
|
/* @__PURE__ */ c(Us, { state: v, step: r, answer: (a == null ? void 0 : a.title) || "unknown", children: [
|
|
417
417
|
r === 2 && /* @__PURE__ */ s(oe, { title: d || "unknown" }),
|
|
418
418
|
r === 3 && n && /* @__PURE__ */ s(re, {}),
|
|
@@ -441,7 +441,7 @@ const h = /* @__PURE__ */ e("div")({
|
|
|
441
441
|
class: "n1i4h28u",
|
|
442
442
|
propsAsIs: !1
|
|
443
443
|
}), $e = (t) => /* @__PURE__ */ s(Ae, { children: /* @__PURE__ */ s(ve, { ...t }) }), ye = ({ sdk: t }) => {
|
|
444
|
-
const [o] = q(t.getNotificationsStore()), i = U(o), a = t.getFeature(_.GAMES), n =
|
|
444
|
+
const [o] = q(t.getNotificationsStore()), i = U(o), a = t.getFeature(_.GAMES), n = Z(() => t.getActiveNotification(), [t, i]);
|
|
445
445
|
return E(() => {
|
|
446
446
|
n && V.emit("notification", {
|
|
447
447
|
action: "rendered",
|
|
@@ -457,12 +457,12 @@ const h = /* @__PURE__ */ e("div")({
|
|
|
457
457
|
close: n.close,
|
|
458
458
|
...n.data.question
|
|
459
459
|
}
|
|
460
|
-
) : null : n && n.type === T.ONBOARDING ? n.data.onboarding ? /* @__PURE__ */ s(
|
|
461
|
-
},
|
|
460
|
+
) : null : n && n.type === T.ONBOARDING ? n.data.onboarding ? /* @__PURE__ */ s(xs, { open: a == null ? void 0 : a.openFeature, close: n.close, ...n.data.onboarding }) : null : n && /* @__PURE__ */ s(gs, { ...n.data, action: n.action });
|
|
461
|
+
}, Ce = ({ theme: t }) => {
|
|
462
462
|
const o = F(), i = W(), a = G();
|
|
463
|
-
return o && a.appNotification ? a.app ? null : /* @__PURE__ */ s("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ s(K, { customTheme: t ?? i.theme, themeMode: i.themeMode, children: /* @__PURE__ */ s(ye, { sdk: o }) }) }) : null;
|
|
463
|
+
return o && (a.appNotification || a.onboardingNotification) ? a.app && !a.onboardingNotification ? null : /* @__PURE__ */ s("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ s(K, { customTheme: t ?? i.theme, themeMode: i.themeMode, children: /* @__PURE__ */ s(ye, { sdk: o }) }) }) : null;
|
|
464
464
|
};
|
|
465
465
|
export {
|
|
466
|
-
|
|
466
|
+
Ce as StreamLayerSDKNotification,
|
|
467
467
|
ye as StreamLayerSDKNotificationUI
|
|
468
468
|
};
|
package/lib/es/points.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useState as u, useEffect as p } from "react";
|
|
3
|
-
import { s as r,
|
|
3
|
+
import { s as r, Z as d, c as h, d as S, a as y, F as l, u as f, b as v, h as g } from "./provider.js";
|
|
4
4
|
import { S as b } from "./useStreamLayerApp2.js";
|
|
5
5
|
const k = /* @__PURE__ */ r("div")({
|
|
6
6
|
name: "PointsContainer",
|
|
@@ -45,15 +45,15 @@ const k = /* @__PURE__ */ r("div")({
|
|
|
45
45
|
}, [e]), /* @__PURE__ */ t(x, { points: a, onClick: () => {
|
|
46
46
|
s.status.get() === l.Suspended ? s.openFeature() : s.status.get() === l.Ready && s.closeFeature(!1);
|
|
47
47
|
} });
|
|
48
|
-
},
|
|
48
|
+
}, j = ({ sdk: s }) => {
|
|
49
49
|
if (!y(s.featuresList.getStore()))
|
|
50
50
|
return null;
|
|
51
51
|
const e = s.getFeature(b.GAMES);
|
|
52
52
|
return e ? /* @__PURE__ */ t(C, { gamification: e }) : null;
|
|
53
|
-
},
|
|
53
|
+
}, E = ({ theme: s }) => {
|
|
54
54
|
const e = f(), a = v();
|
|
55
|
-
return e ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(g, { customTheme: s ?? a.theme, themeMode: a.themeMode, children: /* @__PURE__ */ t(
|
|
55
|
+
return e ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(g, { customTheme: s ?? a.theme, themeMode: a.themeMode, children: /* @__PURE__ */ t(j, { sdk: e }) }) }) : null;
|
|
56
56
|
};
|
|
57
57
|
export {
|
|
58
|
-
|
|
58
|
+
E as StreamLayerSDKPoints
|
|
59
59
|
};
|