@streamlayer/react 0.41.10 → 1.1.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 +1 -0
- package/lib/app/app.d.ts +5 -3
- package/lib/app/auth.d.ts +0 -1
- package/lib/app/masters.d.ts +2 -1
- package/lib/app/provider.d.ts +5 -4
- package/lib/app/useStreamLayerApp.d.ts +8 -7
- package/lib/cjs/app.js +1 -1
- package/lib/cjs/gamification-feature.js +1 -1
- package/lib/cjs/gamification-feature2.js +1 -0
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index2.js +182 -14
- package/lib/cjs/masters.js +1 -1
- package/lib/cjs/masters2.js +9 -164
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/useStreamLayerApp.js +1 -1
- package/lib/cjs/useStreamLayerApp2.js +17 -0
- package/lib/dist/cjs/gamification-feature2.js +1 -0
- package/lib/dist/cjs/index.js +1 -1
- package/lib/dist/cjs/masters.js +92 -80
- package/lib/dist/es/gamification-feature2.js +115 -0
- package/lib/dist/es/index.js +7 -5
- package/lib/dist/es/masters.js +31532 -34905
- package/lib/dist/index.d.ts +234 -145
- package/lib/dist/style.css +1 -1
- package/lib/es/app.js +940 -11
- package/lib/es/gamification-feature.js +1 -1
- package/lib/es/gamification-feature2.js +4 -0
- package/lib/es/index.js +6 -14
- package/lib/es/index2.js +23159 -112
- package/lib/es/masters.js +1 -1
- package/lib/es/masters2.js +679 -23045
- package/lib/es/points.js +30 -33
- package/lib/es/useStreamLayerApp.js +3 -36
- package/lib/es/useStreamLayerApp2.js +17388 -0
- package/lib/index.d.ts +1 -1
- package/lib/masters.d.ts +2 -1
- package/lib/style.css +1 -1
- package/package.json +45 -40
- package/lib/cjs/index3.js +0 -1
- package/lib/es/index3.js +0 -246
package/lib/es/points.js
CHANGED
|
@@ -1,63 +1,60 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { s as e, r as h, d as v } from "./index3.js";
|
|
8
|
-
import { u as g } from "./app.js";
|
|
9
|
-
const A = /* @__PURE__ */ e("div")({
|
|
1
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as c, useEffect as u } from "react";
|
|
3
|
+
import { s as t, c as m, p as d, d as S, u as f, F as y } from "./index2.js";
|
|
4
|
+
import { u as v, i as h } from "./app.js";
|
|
5
|
+
import { S as g } from "./useStreamLayerApp2.js";
|
|
6
|
+
const A = /* @__PURE__ */ t("div")({
|
|
10
7
|
name: "PointsContainer",
|
|
11
8
|
class: "psiob9b",
|
|
12
9
|
propsAsIs: !1
|
|
13
|
-
}), I = /* @__PURE__ */
|
|
10
|
+
}), I = /* @__PURE__ */ t("div")({
|
|
14
11
|
name: "PointsIcon",
|
|
15
12
|
class: "p1gqe4lh",
|
|
16
13
|
propsAsIs: !1
|
|
17
|
-
}), P = () =>
|
|
14
|
+
}), P = () => m, k = /* @__PURE__ */ t(P())({
|
|
18
15
|
name: "PointsSvg",
|
|
19
16
|
class: "p15syg2y",
|
|
20
17
|
propsAsIs: !0
|
|
21
|
-
}),
|
|
18
|
+
}), b = /* @__PURE__ */ t("div")({
|
|
22
19
|
name: "PointsBody",
|
|
23
20
|
class: "p12n4f2h",
|
|
24
21
|
propsAsIs: !1
|
|
25
|
-
}), x = /* @__PURE__ */
|
|
22
|
+
}), x = /* @__PURE__ */ t("div")({
|
|
26
23
|
name: "PointsTitle",
|
|
27
24
|
class: "poqmx89",
|
|
28
25
|
propsAsIs: !1
|
|
29
|
-
}), C = /* @__PURE__ */
|
|
26
|
+
}), C = /* @__PURE__ */ t("div")({
|
|
30
27
|
name: "PointsValue",
|
|
31
28
|
class: "prj9b3v",
|
|
32
29
|
propsAsIs: !1
|
|
33
|
-
}), F = ({ points: s, onClick:
|
|
34
|
-
/* @__PURE__ */ r(I, { children: /* @__PURE__ */ r(
|
|
35
|
-
/* @__PURE__ */
|
|
30
|
+
}), F = ({ points: s, onClick: e }) => /* @__PURE__ */ a(A, { className: d, onClick: e, children: [
|
|
31
|
+
/* @__PURE__ */ r(I, { children: /* @__PURE__ */ r(k, { name: "icon-trophy" }) }),
|
|
32
|
+
/* @__PURE__ */ a(b, { children: [
|
|
36
33
|
/* @__PURE__ */ r(x, { children: "Total points" }),
|
|
37
|
-
/* @__PURE__ */ r(C, { children: /* @__PURE__ */ r(
|
|
34
|
+
/* @__PURE__ */ r(C, { children: /* @__PURE__ */ r(S, { value: s }) })
|
|
38
35
|
] })
|
|
39
36
|
] }), L = ({ gamification: s }) => {
|
|
40
|
-
const
|
|
41
|
-
return
|
|
42
|
-
const
|
|
43
|
-
var
|
|
44
|
-
(
|
|
37
|
+
const e = s.userSummary.$store, [i, l] = c(0);
|
|
38
|
+
return u(() => {
|
|
39
|
+
const p = e.subscribe((n) => {
|
|
40
|
+
var o;
|
|
41
|
+
(o = n == null ? void 0 : n.summary) != null && o.points && l(n.summary.points);
|
|
45
42
|
});
|
|
46
43
|
return () => {
|
|
47
|
-
|
|
44
|
+
p();
|
|
48
45
|
};
|
|
49
|
-
}, [
|
|
50
|
-
s.status.get() ===
|
|
46
|
+
}, [e]), /* @__PURE__ */ r(F, { points: i, onClick: () => {
|
|
47
|
+
s.status.get() === y.Suspended && s.openFeature();
|
|
51
48
|
} });
|
|
52
49
|
}, $ = ({ sdk: s }) => {
|
|
53
|
-
if (!
|
|
50
|
+
if (!f(s.featuresList.getStore()))
|
|
54
51
|
return null;
|
|
55
|
-
const
|
|
56
|
-
return
|
|
57
|
-
},
|
|
58
|
-
const s =
|
|
59
|
-
return s ? /* @__PURE__ */ r("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ r(
|
|
52
|
+
const e = s.getFeature(g.GAMES);
|
|
53
|
+
return e ? /* @__PURE__ */ r(L, { gamification: e }) : null;
|
|
54
|
+
}, K = () => {
|
|
55
|
+
const s = v();
|
|
56
|
+
return s ? /* @__PURE__ */ r("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ r(h, { children: /* @__PURE__ */ r($, { sdk: s }) }) }) : null;
|
|
60
57
|
};
|
|
61
58
|
export {
|
|
62
|
-
|
|
59
|
+
K as StreamLayerSDKPoints
|
|
63
60
|
};
|
|
@@ -1,38 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
const y = ({
|
|
4
|
-
sdkKey: t,
|
|
5
|
-
plugins: n,
|
|
6
|
-
production: s,
|
|
7
|
-
autoEnable: f,
|
|
8
|
-
onDeepLinkHandled: u,
|
|
9
|
-
videoPlayerController: i
|
|
10
|
-
}) => {
|
|
11
|
-
const [a, l] = p(null);
|
|
12
|
-
return d(() => {
|
|
13
|
-
let r = !1;
|
|
14
|
-
if (!t)
|
|
15
|
-
return console.error("streamlayer sdk key should be provided"), l((e) => (e !== null && typeof e.disableApp == "function" && e.disableApp(), null)), () => {
|
|
16
|
-
r = !0;
|
|
17
|
-
};
|
|
18
|
-
const o = c(t, s, f, {
|
|
19
|
-
version: "0.41.10",
|
|
20
|
-
onDeepLinkHandled: u,
|
|
21
|
-
videoPlayerController: i
|
|
22
|
-
});
|
|
23
|
-
if (n)
|
|
24
|
-
for (const e of n)
|
|
25
|
-
o.use(e);
|
|
26
|
-
return o.ready().then((e) => {
|
|
27
|
-
r || l(e.sdk);
|
|
28
|
-
}).catch((e) => console.log(e)), () => {
|
|
29
|
-
r = !0, o.close(function(e) {
|
|
30
|
-
if (e)
|
|
31
|
-
throw e;
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
}, [t, s]), a;
|
|
35
|
-
};
|
|
1
|
+
import { u as a } from "./useStreamLayerApp2.js";
|
|
2
|
+
import "react";
|
|
36
3
|
export {
|
|
37
|
-
|
|
4
|
+
a as useStreamLayerApp
|
|
38
5
|
};
|