@streamlayer/react 0.41.10 → 1.0.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/es/points.js CHANGED
@@ -1,63 +1,60 @@
1
- import { jsxs as i, jsx as r } from "react/jsx-runtime";
2
- import { p as l, i as u } from "./index2.js";
3
- import { useStore as c } from "@nanostores/react";
4
- import { useState as d, useEffect as f } from "react";
5
- import { FeatureStatus as S } from "@streamlayer/sdk-web-interfaces";
6
- import { FeatureType as y } from "@streamlayer/sdk-web-types";
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 { s as t, r as u, p as c, d as m, u as d, F as S } from "./index2.js";
3
+ import { useState as f, useEffect as y } from "react";
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__ */ e("div")({
10
+ }), I = /* @__PURE__ */ t("div")({
14
11
  name: "PointsIcon",
15
12
  class: "p1gqe4lh",
16
13
  propsAsIs: !1
17
- }), P = () => h, b = /* @__PURE__ */ e(P())({
14
+ }), P = () => u, k = /* @__PURE__ */ t(P())({
18
15
  name: "PointsSvg",
19
16
  class: "p15syg2y",
20
17
  propsAsIs: !0
21
- }), k = /* @__PURE__ */ e("div")({
18
+ }), b = /* @__PURE__ */ t("div")({
22
19
  name: "PointsBody",
23
20
  class: "p12n4f2h",
24
21
  propsAsIs: !1
25
- }), x = /* @__PURE__ */ e("div")({
22
+ }), x = /* @__PURE__ */ t("div")({
26
23
  name: "PointsTitle",
27
24
  class: "poqmx89",
28
25
  propsAsIs: !1
29
- }), C = /* @__PURE__ */ e("div")({
26
+ }), C = /* @__PURE__ */ t("div")({
30
27
  name: "PointsValue",
31
28
  class: "prj9b3v",
32
29
  propsAsIs: !1
33
- }), F = ({ points: s, onClick: t }) => /* @__PURE__ */ i(A, { className: l, onClick: t, children: [
34
- /* @__PURE__ */ r(I, { children: /* @__PURE__ */ r(b, { name: "icon-trophy" }) }),
35
- /* @__PURE__ */ i(k, { children: [
30
+ }), F = ({ points: s, onClick: e }) => /* @__PURE__ */ a(A, { className: c, 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(v, { value: s }) })
34
+ /* @__PURE__ */ r(C, { children: /* @__PURE__ */ r(m, { value: s }) })
38
35
  ] })
39
36
  ] }), L = ({ gamification: s }) => {
40
- const t = s.userSummary.$store, [a, p] = d(0);
41
- return f(() => {
42
- const m = t.subscribe((o) => {
43
- var n;
44
- (n = o == null ? void 0 : o.summary) != null && n.points && p(o.summary.points);
37
+ const e = s.userSummary.$store, [i, l] = f(0);
38
+ return y(() => {
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
- m();
44
+ p();
48
45
  };
49
- }, [t]), /* @__PURE__ */ r(F, { points: a, onClick: () => {
46
+ }, [e]), /* @__PURE__ */ r(F, { points: i, onClick: () => {
50
47
  s.status.get() === S.Suspended && s.openFeature();
51
48
  } });
52
49
  }, $ = ({ sdk: s }) => {
53
- if (!c(s.featuresList.getStore()))
50
+ if (!d(s.featuresList.getStore()))
54
51
  return null;
55
- const t = s.getFeature(y.GAMES);
56
- return t ? /* @__PURE__ */ r(L, { gamification: t }) : null;
57
- }, G = () => {
58
- const s = g();
59
- return s ? /* @__PURE__ */ r("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ r(u, { children: /* @__PURE__ */ r($, { sdk: s }) }) }) : null;
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
- G as StreamLayerSDKPoints
59
+ K as StreamLayerSDKPoints
63
60
  };
@@ -1,38 +1,5 @@
1
- import { StreamLayer as c } from "@streamlayer/sdk-web";
2
- import { useState as p, useEffect as d } from "react";
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
- y as useStreamLayerApp
4
+ a as useStreamLayerApp
38
5
  };