@streamlayer/react 0.36.2 → 0.37.1
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/masters.d.ts +1 -1
- package/lib/cjs/app.js +1 -1
- package/lib/cjs/gamification-feature.js +5 -1
- package/lib/cjs/index2.js +13 -3
- package/lib/cjs/masters.js +1 -1
- package/lib/cjs/masters2.js +34 -34
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/useSdkFeature.js +1 -1
- package/lib/cjs/useStreamLayerApp.js +1 -1
- package/lib/dist/cjs/gamification-feature.js +5 -1
- package/lib/dist/cjs/masters.js +76 -64
- package/lib/dist/es/gamification-feature.js +645 -595
- package/lib/dist/es/index.js +1 -1
- package/lib/dist/es/masters.js +24025 -21191
- package/lib/dist/index.d.ts +91 -61
- package/lib/dist/style.css +1 -1
- package/lib/es/app.js +5 -5
- package/lib/es/gamification-feature.js +716 -667
- package/lib/es/index2.js +64 -22
- package/lib/es/masters.js +4 -3
- package/lib/es/masters2.js +7553 -7392
- package/lib/es/points.js +21 -22
- package/lib/es/useSdkFeature.js +112 -97
- package/lib/es/useStreamLayerApp.js +1 -1
- package/lib/style.css +1 -1
- package/package.json +14 -14
- package/lib/cjs/index3.js +0 -1
- package/lib/es/index3.js +0 -19
package/lib/es/points.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs as i, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { m as l, p as c } from "./index2.js";
|
|
3
3
|
import { useState as u, useEffect as d } from "react";
|
|
4
4
|
import { FeatureType as y } from "@streamlayer/sdk-web-types";
|
|
5
|
-
import { s as o, c as S, d as f } from "./useSdkFeature.js";
|
|
6
|
-
import { d as v } from "./index3.js";
|
|
5
|
+
import { s as o, c as S, d as f, a as v } from "./useSdkFeature.js";
|
|
7
6
|
import "react-countup";
|
|
8
7
|
import "@nanostores/react";
|
|
9
8
|
import "@streamlayer/sdk-web-interfaces";
|
|
10
9
|
import { u as h } from "./app.js";
|
|
11
10
|
import "./useStreamLayerApp.js";
|
|
12
11
|
import "@streamlayer/sdk-web";
|
|
13
|
-
const
|
|
12
|
+
const A = /* @__PURE__ */ o("div")({
|
|
14
13
|
name: "PointsContainer",
|
|
15
14
|
class: "psiob9b",
|
|
16
15
|
propsAsIs: !1
|
|
17
|
-
}),
|
|
16
|
+
}), P = /* @__PURE__ */ o("div")({
|
|
18
17
|
name: "PointsIcon",
|
|
19
18
|
class: "p1gqe4lh",
|
|
20
19
|
propsAsIs: !1
|
|
@@ -34,30 +33,30 @@ const P = /* @__PURE__ */ o("div")({
|
|
|
34
33
|
name: "PointsValue",
|
|
35
34
|
class: "prj9b3v",
|
|
36
35
|
propsAsIs: !1
|
|
37
|
-
}),
|
|
38
|
-
/* @__PURE__ */ s(
|
|
39
|
-
/* @__PURE__ */
|
|
36
|
+
}), L = ({ points: r }) => /* @__PURE__ */ i(A, { className: l, children: [
|
|
37
|
+
/* @__PURE__ */ s(P, { children: /* @__PURE__ */ s(b, { name: "icon-trophy" }) }),
|
|
38
|
+
/* @__PURE__ */ i(g, { children: [
|
|
40
39
|
/* @__PURE__ */ s(x, { children: "Total points" }),
|
|
41
|
-
/* @__PURE__ */ s(j, { children: /* @__PURE__ */ s(
|
|
40
|
+
/* @__PURE__ */ s(j, { children: /* @__PURE__ */ s(f, { value: r }) })
|
|
42
41
|
] })
|
|
43
|
-
] }),
|
|
44
|
-
const [
|
|
42
|
+
] }), T = ({ userSummary: r }) => {
|
|
43
|
+
const [e, t] = u(0);
|
|
45
44
|
return d(() => {
|
|
46
|
-
const p = r.subscribe((
|
|
47
|
-
var a,
|
|
48
|
-
(
|
|
45
|
+
const p = r.subscribe((n) => {
|
|
46
|
+
var a, m;
|
|
47
|
+
(m = (a = n.data) == null ? void 0 : a.summary) != null && m.points && t(n.data.summary.points);
|
|
49
48
|
});
|
|
50
49
|
return () => {
|
|
51
50
|
p();
|
|
52
51
|
};
|
|
53
|
-
}, [r]), /* @__PURE__ */ s(
|
|
54
|
-
},
|
|
55
|
-
const [
|
|
56
|
-
return
|
|
57
|
-
},
|
|
52
|
+
}, [r]), /* @__PURE__ */ s(L, { points: e });
|
|
53
|
+
}, k = ({ sdk: r }) => {
|
|
54
|
+
const [e, t] = v(r);
|
|
55
|
+
return e !== y.GAMES || !t ? null : /* @__PURE__ */ s(T, { userSummary: t.userSummary.getStore() });
|
|
56
|
+
}, V = () => {
|
|
58
57
|
const r = h();
|
|
59
|
-
return r ? /* @__PURE__ */ s("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ s(
|
|
58
|
+
return r ? /* @__PURE__ */ s("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ s(c, { children: /* @__PURE__ */ s(k, { sdk: r }) }) }) : null;
|
|
60
59
|
};
|
|
61
60
|
export {
|
|
62
|
-
|
|
61
|
+
V as StreamLayerSDKPoints
|
|
63
62
|
};
|