@streamlayer/react 1.4.1 → 1.5.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/advertisement.d.ts +3 -0
- package/lib/app/app.d.ts +1 -0
- package/lib/app/event.d.ts +4 -0
- package/lib/app/insight.d.ts +3 -0
- package/lib/app/masters.d.ts +1 -1
- package/lib/app/provider.d.ts +4 -2
- package/lib/cjs/advertisement.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index2.js +188 -1
- package/lib/cjs/insight.js +1 -1
- package/lib/cjs/masters.js +1 -1
- package/lib/cjs/masters2.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/useStreamLayerApp2.js +12 -12
- package/lib/dist/cjs/masters.js +64 -64
- package/lib/dist/es/masters.js +11689 -11739
- package/lib/es/advertisement.js +199 -208
- package/lib/es/index.js +6 -6
- package/lib/es/index2.js +23919 -689
- package/lib/es/insight.js +39 -47
- package/lib/es/masters.js +1 -1
- package/lib/es/masters2.js +12 -12
- package/lib/es/points.js +26 -27
- package/lib/es/useStreamLayerApp2.js +2576 -2635
- package/lib/index.d.ts +1 -0
- package/package.json +13 -13
- package/lib/cjs/provider.js +0 -188
- package/lib/es/provider.js +0 -23232
package/lib/es/insight.js
CHANGED
|
@@ -1,69 +1,61 @@
|
|
|
1
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
const E = () => v, L = /* @__PURE__ */ S(E())({
|
|
1
|
+
import { jsx as n, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as m, useEffect as h } from "react";
|
|
3
|
+
import { a as u, x as l, s as f, b as p, u as S, d as I, S as g } from "./index2.js";
|
|
4
|
+
import { S as y } from "./useStreamLayerApp2.js";
|
|
5
|
+
const Q = () => p, v = /* @__PURE__ */ f(Q())({
|
|
7
6
|
name: "QuestionWrap",
|
|
8
7
|
class: "q10hhsxv",
|
|
9
8
|
propsAsIs: !0
|
|
10
|
-
}),
|
|
9
|
+
}), L = ({
|
|
11
10
|
gamification: e,
|
|
12
|
-
persistent:
|
|
13
|
-
hideHeader:
|
|
11
|
+
persistent: i,
|
|
12
|
+
hideHeader: a,
|
|
14
13
|
insightId: t
|
|
15
14
|
}) => {
|
|
16
|
-
const
|
|
17
|
-
return
|
|
18
|
-
|
|
15
|
+
const s = m(""), o = u(e.openedQuestion.$store);
|
|
16
|
+
return h(() => t ? (!i || e.isOpenedQuestion(t) || (s.current = t, e.getFeedItem(t).then((r) => {
|
|
17
|
+
s.current === t && e.openQuestion(t, r);
|
|
19
18
|
})), () => {
|
|
20
|
-
|
|
21
|
-
}) : e.
|
|
22
|
-
data:
|
|
19
|
+
s.current = "";
|
|
20
|
+
}) : (e.activeQuestionId.subscribe(({
|
|
21
|
+
data: r
|
|
23
22
|
}) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}) => m === "insight" && (c == null ? void 0 : c.status) === x.ACTIVE);
|
|
29
|
-
d && (!s || e.isOpenedQuestion(d.id) || e.openQuestion(d.id, d));
|
|
30
|
-
}
|
|
31
|
-
}), [e, s, t]), o ? /* @__PURE__ */ n(f, {
|
|
23
|
+
var d;
|
|
24
|
+
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 = "");
|
|
25
|
+
}), () => {
|
|
26
|
+
}), [e, i, t]), o ? /* @__PURE__ */ n(l, {
|
|
32
27
|
style: {
|
|
33
28
|
height: "100%"
|
|
34
29
|
},
|
|
35
|
-
children: /* @__PURE__ */ n(
|
|
36
|
-
hideHeader:
|
|
30
|
+
children: /* @__PURE__ */ n(v, {
|
|
31
|
+
hideHeader: a,
|
|
37
32
|
gamification: e,
|
|
38
33
|
hideSponsor: !0
|
|
39
34
|
})
|
|
40
35
|
}) : null;
|
|
41
|
-
},
|
|
36
|
+
}, x = ({
|
|
42
37
|
sdk: e,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
hideHeader: a
|
|
38
|
+
persistent: i,
|
|
39
|
+
insightId: a,
|
|
40
|
+
hideHeader: t
|
|
47
41
|
}) => {
|
|
48
|
-
|
|
49
|
-
deactivate: o
|
|
50
|
-
} = g(e);
|
|
51
|
-
if (l(() => {
|
|
52
|
-
s ? e.createEventSession(s) : o();
|
|
53
|
-
}, [s, o, e]), !p(e.featuresList.getStore()))
|
|
42
|
+
if (!u(e.featuresList.getStore()))
|
|
54
43
|
return null;
|
|
55
|
-
const
|
|
56
|
-
return
|
|
57
|
-
insightId:
|
|
58
|
-
persistent:
|
|
59
|
-
hideHeader:
|
|
60
|
-
gamification:
|
|
44
|
+
const s = e.getFeature(y.GAMES);
|
|
45
|
+
return s ? /* @__PURE__ */ n(L, {
|
|
46
|
+
insightId: a,
|
|
47
|
+
persistent: i,
|
|
48
|
+
hideHeader: t,
|
|
49
|
+
gamification: s
|
|
61
50
|
}) : null;
|
|
62
|
-
},
|
|
63
|
-
const t =
|
|
64
|
-
return t ? /* @__PURE__ */
|
|
51
|
+
}, b = ({ event: e, hideHeader: i, persistent: a }) => {
|
|
52
|
+
const t = S();
|
|
53
|
+
return t ? /* @__PURE__ */ c("div", { className: "StreamLayerSDK", children: [
|
|
54
|
+
/* @__PURE__ */ n(I, { children: /* @__PURE__ */ n(x, { sdk: t, event: e, hideHeader: i, persistent: a }) }),
|
|
55
|
+
e !== void 0 && /* @__PURE__ */ n(g, { event: e })
|
|
56
|
+
] }) : null;
|
|
65
57
|
};
|
|
66
58
|
export {
|
|
67
|
-
|
|
68
|
-
|
|
59
|
+
b as StreamLayerSDKInsight,
|
|
60
|
+
x as StreamLayerSDKInsightUI
|
|
69
61
|
};
|
package/lib/es/masters.js
CHANGED
package/lib/es/masters2.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as n, jsxs as L, Fragment as E } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { createContext as z2, useContext as s2, useRef as $, useState as b, useEffect as k, useTransition as q2, lazy as
|
|
4
|
-
import {
|
|
2
|
+
import { a as C, F as r2, s as u, T as j, i as i2, p as a2, h as l2, N as d2, k as c2, M as p2, j as u2, l as C2, C as v2, m as h2, O as K, n as x, o as m2, q as g2, r as L2, t as X, w as f2, y as S2, z as y2, A as U, B as k2, D as J, x as _, I as e2, c as P, G as N2, H as b2, J as z, K as A2, P as I2, R as $2, g as E2, U as T, V as q, W as V2, X as w2, Y as R2, f as H2, Z as Q, _ as T2, $ as x2, L as F, a0 as F2, a1 as D2, a2 as M2, a3 as O2, v as D, a4 as U2, a5 as _2, a6 as P2, a7 as B2, a8 as G2 } from "./index2.js";
|
|
3
|
+
import { createContext as z2, useContext as s2, useRef as $, useState as b, useEffect as k, useTransition as q2, lazy as Q2, useMemo as H, Suspense as Z2, forwardRef as Y2, useLayoutEffect as W2, useCallback as R, Component as j2 } from "react";
|
|
4
|
+
import { Q as K2, S as I } from "./useStreamLayerApp2.js";
|
|
5
5
|
const M = /* @__PURE__ */ u("div")({
|
|
6
6
|
name: "LoadingContainer",
|
|
7
7
|
class: "l7wseip",
|
|
@@ -183,7 +183,7 @@ const M = /* @__PURE__ */ u("div")({
|
|
|
183
183
|
] }),
|
|
184
184
|
d === x.LEADERBOARD && /* @__PURE__ */ n(y2, { children: /* @__PURE__ */ n(i0, { scrollStore: t, scrollNode: o, gamification: e }) })
|
|
185
185
|
] });
|
|
186
|
-
}, c0 = () => _,
|
|
186
|
+
}, c0 = () => _, Z = /* @__PURE__ */ u(c0())({
|
|
187
187
|
name: "OpenedContainer",
|
|
188
188
|
class: "o1seszvt",
|
|
189
189
|
propsAsIs: !0
|
|
@@ -227,14 +227,14 @@ const M = /* @__PURE__ */ u("div")({
|
|
|
227
227
|
} = k2();
|
|
228
228
|
if (!t.current || !i && !r)
|
|
229
229
|
return null;
|
|
230
|
-
const c = i ? /* @__PURE__ */ n(
|
|
230
|
+
const c = i ? /* @__PURE__ */ n(Z, {
|
|
231
231
|
className: s,
|
|
232
232
|
hiding: p,
|
|
233
233
|
onAnimationEnd: d,
|
|
234
234
|
children: /* @__PURE__ */ n(t0, {
|
|
235
235
|
gamification: e
|
|
236
236
|
})
|
|
237
|
-
}) : r ? /* @__PURE__ */ n(
|
|
237
|
+
}) : r ? /* @__PURE__ */ n(Z, {
|
|
238
238
|
className: s,
|
|
239
239
|
hiding: p,
|
|
240
240
|
onAnimationEnd: d,
|
|
@@ -255,7 +255,7 @@ const M = /* @__PURE__ */ u("div")({
|
|
|
255
255
|
useContainer: !a,
|
|
256
256
|
children: c
|
|
257
257
|
});
|
|
258
|
-
}, v0 =
|
|
258
|
+
}, v0 = Q2(() => import("./gamification-feature2.js")), h0 = ({ sdk: e, feature: s, className: t, scrollStore: o, appNode: i, scrollNode: r, responsiveStore: a }) => {
|
|
259
259
|
const p = H(() => s && s.featureConfig.get().type === I.GAMES ? /* @__PURE__ */ n(X2, { className: t, sdk: e, feature: s, children: /* @__PURE__ */ n(
|
|
260
260
|
v0,
|
|
261
261
|
{
|
|
@@ -268,7 +268,7 @@ const M = /* @__PURE__ */ u("div")({
|
|
|
268
268
|
}
|
|
269
269
|
) }) : null, [e, s, t, a, o, r, i]);
|
|
270
270
|
return /* @__PURE__ */ n(
|
|
271
|
-
|
|
271
|
+
Z2,
|
|
272
272
|
{
|
|
273
273
|
fallback: /* @__PURE__ */ n("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: "page loading..." }),
|
|
274
274
|
children: p
|
|
@@ -563,7 +563,7 @@ const M = /* @__PURE__ */ u("div")({
|
|
|
563
563
|
name: "NotificationRefreshing",
|
|
564
564
|
class: "n13rok4i",
|
|
565
565
|
propsAsIs: !1
|
|
566
|
-
}),
|
|
566
|
+
}), Q0 = () => $2, Z0 = /* @__PURE__ */ u(Q0())({
|
|
567
567
|
name: "Pill",
|
|
568
568
|
class: "pht79xf",
|
|
569
569
|
propsAsIs: !0
|
|
@@ -659,7 +659,7 @@ const M = /* @__PURE__ */ u("div")({
|
|
|
659
659
|
r.get().sdkInDesktopView ? h < 50 && s(null) : h > -50 && s(null);
|
|
660
660
|
}, [h, r, s]);
|
|
661
661
|
const f = r.get().sdkInDesktopView ? t : o;
|
|
662
|
-
return !e || !f.current ? null : w2.createPortal(/* @__PURE__ */ n(
|
|
662
|
+
return !e || !f.current ? null : w2.createPortal(/* @__PURE__ */ n(Z0, {
|
|
663
663
|
title: e.type === T.QUESTION_RESOLVED ? "Prediction result" : `New ${((d = R2[(p = e.data) == null ? void 0 : p.questionType]) == null ? void 0 : d.label) || "notification"}`,
|
|
664
664
|
onClick: () => {
|
|
665
665
|
var S;
|
|
@@ -805,10 +805,10 @@ const M = /* @__PURE__ */ u("div")({
|
|
|
805
805
|
${e}
|
|
806
806
|
--color-${s.toLowerCase().replaceAll("_", "-")}: ${t};
|
|
807
807
|
`, "");
|
|
808
|
-
`${s1}${w.REGULAR}${w.REGULAR}${w.COLOR}${w.SERIF}${w.WEIGHT_DEFAULT}${
|
|
808
|
+
`${s1}${w.REGULAR}${w.REGULAR}${w.COLOR}${w.SERIF}${w.WEIGHT_DEFAULT}${Q.down("xl")`
|
|
809
809
|
--header-offset: 56px;
|
|
810
810
|
--watch-live-header: 46px;
|
|
811
|
-
`}${
|
|
811
|
+
`}${Q.intermediate("xl", "lg")`
|
|
812
812
|
--header-offset: 76px;
|
|
813
813
|
`}`;
|
|
814
814
|
const t1 = "m1ojpy2l", n1 = ({ children: e, style: s }) => /* @__PURE__ */ n("div", { className: "StreamLayerSDKTheme", children: /* @__PURE__ */ n("div", { className: t1, style: s, children: e }) }), o1 = ({ sdk: e, className: s, scrollStore: t, appNode: o, scrollNode: i, responsiveStore: r }) => {
|
package/lib/es/points.js
CHANGED
|
@@ -1,60 +1,59 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { s as
|
|
4
|
-
import { u as y, d as h } from "./index2.js";
|
|
1
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as p, useEffect as u } from "react";
|
|
3
|
+
import { s as n, c as m, v as d, e as S, a as f, F as v, u as y, d as h } from "./index2.js";
|
|
5
4
|
import { S as g } from "./useStreamLayerApp2.js";
|
|
6
|
-
const A = /* @__PURE__ */
|
|
5
|
+
const A = /* @__PURE__ */ n("div")({
|
|
7
6
|
name: "PointsContainer",
|
|
8
7
|
class: "psiob9b",
|
|
9
8
|
propsAsIs: !1
|
|
10
|
-
}), I = /* @__PURE__ */
|
|
9
|
+
}), I = /* @__PURE__ */ n("div")({
|
|
11
10
|
name: "PointsIcon",
|
|
12
11
|
class: "p1gqe4lh",
|
|
13
12
|
propsAsIs: !1
|
|
14
|
-
}), P = () => m, k = /* @__PURE__ */
|
|
13
|
+
}), P = () => m, k = /* @__PURE__ */ n(P())({
|
|
15
14
|
name: "PointsSvg",
|
|
16
15
|
class: "p15syg2y",
|
|
17
16
|
propsAsIs: !0
|
|
18
|
-
}), b = /* @__PURE__ */
|
|
17
|
+
}), b = /* @__PURE__ */ n("div")({
|
|
19
18
|
name: "PointsBody",
|
|
20
19
|
class: "p12n4f2h",
|
|
21
20
|
propsAsIs: !1
|
|
22
|
-
}), x = /* @__PURE__ */
|
|
21
|
+
}), x = /* @__PURE__ */ n("div")({
|
|
23
22
|
name: "PointsTitle",
|
|
24
23
|
class: "poqmx89",
|
|
25
24
|
propsAsIs: !1
|
|
26
|
-
}), C = /* @__PURE__ */
|
|
25
|
+
}), C = /* @__PURE__ */ n("div")({
|
|
27
26
|
name: "PointsValue",
|
|
28
27
|
class: "prj9b3v",
|
|
29
28
|
propsAsIs: !1
|
|
30
|
-
}), F = ({ points: s, onClick:
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */
|
|
29
|
+
}), F = ({ points: s, onClick: r }) => /* @__PURE__ */ o(A, { className: d, onClick: r, children: [
|
|
30
|
+
/* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(k, { name: "icon-trophy" }) }),
|
|
31
|
+
/* @__PURE__ */ o(b, { children: [
|
|
32
|
+
/* @__PURE__ */ e(x, { children: "Total points" }),
|
|
33
|
+
/* @__PURE__ */ e(C, { children: /* @__PURE__ */ e(S, { value: s }) })
|
|
35
34
|
] })
|
|
36
35
|
] }), L = ({ gamification: s }) => {
|
|
37
|
-
const
|
|
38
|
-
return
|
|
39
|
-
const
|
|
40
|
-
var
|
|
41
|
-
(
|
|
36
|
+
const r = s.userSummary.$store, [i, l] = p(0);
|
|
37
|
+
return u(() => {
|
|
38
|
+
const c = r.subscribe((t) => {
|
|
39
|
+
var a;
|
|
40
|
+
(a = t == null ? void 0 : t.summary) != null && a.points && l(t.summary.points);
|
|
42
41
|
});
|
|
43
42
|
return () => {
|
|
44
|
-
|
|
43
|
+
c();
|
|
45
44
|
};
|
|
46
|
-
}, [
|
|
45
|
+
}, [r]), /* @__PURE__ */ e(F, { points: i, onClick: () => {
|
|
47
46
|
s.status.get() === v.Suspended && s.openFeature();
|
|
48
47
|
} });
|
|
49
48
|
}, $ = ({ sdk: s }) => {
|
|
50
49
|
if (!f(s.featuresList.getStore()))
|
|
51
50
|
return null;
|
|
52
|
-
const
|
|
53
|
-
return
|
|
54
|
-
},
|
|
51
|
+
const r = s.getFeature(g.GAMES);
|
|
52
|
+
return r ? /* @__PURE__ */ e(L, { gamification: r }) : null;
|
|
53
|
+
}, E = () => {
|
|
55
54
|
const s = y();
|
|
56
|
-
return s ? /* @__PURE__ */
|
|
55
|
+
return s ? /* @__PURE__ */ e("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e($, { sdk: s }) }) }) : null;
|
|
57
56
|
};
|
|
58
57
|
export {
|
|
59
|
-
|
|
58
|
+
E as StreamLayerSDKPoints
|
|
60
59
|
};
|