@streamlayer/react 1.4.0 → 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 -0
- 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/dist/style.css +1 -1
- package/lib/es/advertisement.js +199 -208
- package/lib/es/index.js +6 -6
- package/lib/es/index2.js +23919 -688
- package/lib/es/insight.js +61 -0
- package/lib/es/masters.js +1 -1
- package/lib/es/masters2.js +1 -1
- package/lib/es/points.js +26 -27
- package/lib/es/useStreamLayerApp2.js +2576 -2635
- package/lib/index.d.ts +1 -0
- package/lib/style.css +1 -1
- package/package.json +13 -13
- package/lib/cjs/provider.js +0 -188
- package/lib/es/provider.js +0 -23232
|
@@ -0,0 +1,61 @@
|
|
|
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())({
|
|
6
|
+
name: "QuestionWrap",
|
|
7
|
+
class: "q10hhsxv",
|
|
8
|
+
propsAsIs: !0
|
|
9
|
+
}), L = ({
|
|
10
|
+
gamification: e,
|
|
11
|
+
persistent: i,
|
|
12
|
+
hideHeader: a,
|
|
13
|
+
insightId: t
|
|
14
|
+
}) => {
|
|
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);
|
|
18
|
+
})), () => {
|
|
19
|
+
s.current = "";
|
|
20
|
+
}) : (e.activeQuestionId.subscribe(({
|
|
21
|
+
data: r
|
|
22
|
+
}) => {
|
|
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, {
|
|
27
|
+
style: {
|
|
28
|
+
height: "100%"
|
|
29
|
+
},
|
|
30
|
+
children: /* @__PURE__ */ n(v, {
|
|
31
|
+
hideHeader: a,
|
|
32
|
+
gamification: e,
|
|
33
|
+
hideSponsor: !0
|
|
34
|
+
})
|
|
35
|
+
}) : null;
|
|
36
|
+
}, x = ({
|
|
37
|
+
sdk: e,
|
|
38
|
+
persistent: i,
|
|
39
|
+
insightId: a,
|
|
40
|
+
hideHeader: t
|
|
41
|
+
}) => {
|
|
42
|
+
if (!u(e.featuresList.getStore()))
|
|
43
|
+
return null;
|
|
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
|
|
50
|
+
}) : null;
|
|
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;
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
b as StreamLayerSDKInsight,
|
|
60
|
+
x as StreamLayerSDKInsightUI
|
|
61
|
+
};
|
package/lib/es/masters.js
CHANGED
package/lib/es/masters2.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n, jsxs as L, Fragment as E } from "react/jsx-runtime";
|
|
2
|
-
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
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
4
|
import { Q as K2, S as I } from "./useStreamLayerApp2.js";
|
|
5
5
|
const M = /* @__PURE__ */ u("div")({
|
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
|
};
|