@streamlayer/react 1.6.0 → 1.8.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 +2 -0
- package/lib/app/app.d.ts +11 -1
- package/lib/app/insight.d.ts +1 -0
- package/lib/app/points.d.ts +3 -1
- package/lib/app/provider.d.ts +4 -0
- package/lib/app/useStreamLayerApp.d.ts +3 -1
- package/lib/cjs/advertisement.js +1 -1
- package/lib/cjs/gamification-feature.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index2.js +52 -53
- package/lib/cjs/insight.js +1 -1
- package/lib/cjs/masters2.js +4 -4
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/useStreamLayerApp2.js +13 -13
- package/lib/dist/cjs/gamification-feature2.js +1 -1
- package/lib/dist/cjs/index.js +1 -1
- package/lib/dist/cjs/masters.js +73 -74
- package/lib/dist/es/gamification-feature2.js +42 -36
- package/lib/dist/es/index.js +1 -1
- package/lib/dist/es/masters.js +13572 -13238
- package/lib/dist/style.css +1 -1
- package/lib/es/advertisement.js +346 -224
- package/lib/es/gamification-feature.js +1 -1
- package/lib/es/index.js +5 -4
- package/lib/es/index2.js +7739 -7637
- package/lib/es/insight.js +49 -36
- package/lib/es/masters2.js +538 -419
- package/lib/es/points.js +31 -31
- package/lib/es/useStreamLayerApp2.js +3522 -3339
- package/lib/index.d.ts +1 -1
- package/lib/style.css +1 -1
- package/package.json +14 -14
package/lib/es/points.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { s as
|
|
4
|
-
import { S as
|
|
5
|
-
const
|
|
1
|
+
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as u, useEffect as p } from "react";
|
|
3
|
+
import { s as a, c as d, m as S, e as y, a as f, F as l, u as h, b as v, d as g } from "./index2.js";
|
|
4
|
+
import { S as b } from "./useStreamLayerApp2.js";
|
|
5
|
+
const k = /* @__PURE__ */ a("div")({
|
|
6
6
|
name: "PointsContainer",
|
|
7
7
|
class: "psiob9b",
|
|
8
8
|
propsAsIs: !1
|
|
9
|
-
}),
|
|
9
|
+
}), A = /* @__PURE__ */ a("div")({
|
|
10
10
|
name: "PointsIcon",
|
|
11
11
|
class: "p1gqe4lh",
|
|
12
12
|
propsAsIs: !1
|
|
13
|
-
}),
|
|
13
|
+
}), I = () => d, P = /* @__PURE__ */ a(I())({
|
|
14
14
|
name: "PointsSvg",
|
|
15
15
|
class: "p15syg2y",
|
|
16
16
|
propsAsIs: !0
|
|
17
|
-
}),
|
|
17
|
+
}), T = /* @__PURE__ */ a("div")({
|
|
18
18
|
name: "PointsBody",
|
|
19
19
|
class: "p12n4f2h",
|
|
20
20
|
propsAsIs: !1
|
|
21
|
-
}),
|
|
21
|
+
}), F = /* @__PURE__ */ a("div")({
|
|
22
22
|
name: "PointsTitle",
|
|
23
23
|
class: "poqmx89",
|
|
24
24
|
propsAsIs: !1
|
|
25
|
-
}),
|
|
25
|
+
}), L = /* @__PURE__ */ a("div")({
|
|
26
26
|
name: "PointsValue",
|
|
27
27
|
class: "prj9b3v",
|
|
28
28
|
propsAsIs: !1
|
|
29
|
-
}),
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
29
|
+
}), x = ({ points: s, onClick: e }) => /* @__PURE__ */ i(k, { className: S, onClick: e, children: [
|
|
30
|
+
/* @__PURE__ */ t(A, { children: /* @__PURE__ */ t(P, { name: "icon-trophy" }) }),
|
|
31
|
+
/* @__PURE__ */ i(T, { children: [
|
|
32
|
+
/* @__PURE__ */ t(F, { children: "Total points" }),
|
|
33
|
+
/* @__PURE__ */ t(L, { children: /* @__PURE__ */ t(y, { value: s }) })
|
|
34
34
|
] })
|
|
35
|
-
] }),
|
|
36
|
-
const
|
|
37
|
-
return
|
|
38
|
-
const
|
|
39
|
-
var
|
|
40
|
-
(
|
|
35
|
+
] }), C = ({ gamification: s }) => {
|
|
36
|
+
const e = s.userSummary.$store, [r, c] = u(0);
|
|
37
|
+
return p(() => {
|
|
38
|
+
const m = e.subscribe((n) => {
|
|
39
|
+
var o;
|
|
40
|
+
(o = n == null ? void 0 : n.summary) != null && o.points && c(n.summary.points);
|
|
41
41
|
});
|
|
42
42
|
return () => {
|
|
43
|
-
|
|
43
|
+
m();
|
|
44
44
|
};
|
|
45
|
-
}, [
|
|
46
|
-
s.status.get() ===
|
|
45
|
+
}, [e]), /* @__PURE__ */ t(x, { points: r, onClick: () => {
|
|
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 (!f(s.featuresList.getStore()))
|
|
50
50
|
return null;
|
|
51
|
-
const
|
|
52
|
-
return
|
|
53
|
-
},
|
|
54
|
-
const
|
|
55
|
-
return
|
|
51
|
+
const e = s.getFeature(b.GAMES);
|
|
52
|
+
return e ? /* @__PURE__ */ t(C, { gamification: e }) : null;
|
|
53
|
+
}, K = ({ theme: s }) => {
|
|
54
|
+
const e = h(), r = v();
|
|
55
|
+
return e ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(g, { customTheme: s ?? r, children: /* @__PURE__ */ t(j, { sdk: e }) }) }) : null;
|
|
56
56
|
};
|
|
57
57
|
export {
|
|
58
|
-
|
|
58
|
+
K as StreamLayerSDKPoints
|
|
59
59
|
};
|