@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.
Files changed (40) hide show
  1. package/lib/app/advertisement.d.ts +1 -0
  2. package/lib/app/app.d.ts +5 -3
  3. package/lib/app/auth.d.ts +0 -1
  4. package/lib/app/masters.d.ts +2 -1
  5. package/lib/app/provider.d.ts +5 -4
  6. package/lib/app/useStreamLayerApp.d.ts +8 -7
  7. package/lib/cjs/app.js +1 -1
  8. package/lib/cjs/gamification-feature.js +1 -1
  9. package/lib/cjs/gamification-feature2.js +1 -0
  10. package/lib/cjs/index.js +1 -1
  11. package/lib/cjs/index2.js +182 -14
  12. package/lib/cjs/masters.js +1 -1
  13. package/lib/cjs/masters2.js +9 -164
  14. package/lib/cjs/points.js +1 -1
  15. package/lib/cjs/useStreamLayerApp.js +1 -1
  16. package/lib/cjs/useStreamLayerApp2.js +17 -0
  17. package/lib/dist/cjs/gamification-feature2.js +1 -0
  18. package/lib/dist/cjs/index.js +1 -1
  19. package/lib/dist/cjs/masters.js +92 -80
  20. package/lib/dist/es/gamification-feature2.js +115 -0
  21. package/lib/dist/es/index.js +7 -5
  22. package/lib/dist/es/masters.js +31532 -34905
  23. package/lib/dist/index.d.ts +234 -145
  24. package/lib/dist/style.css +1 -1
  25. package/lib/es/app.js +940 -11
  26. package/lib/es/gamification-feature.js +1 -1
  27. package/lib/es/gamification-feature2.js +4 -0
  28. package/lib/es/index.js +6 -14
  29. package/lib/es/index2.js +23159 -112
  30. package/lib/es/masters.js +1 -1
  31. package/lib/es/masters2.js +679 -23045
  32. package/lib/es/points.js +30 -33
  33. package/lib/es/useStreamLayerApp.js +3 -36
  34. package/lib/es/useStreamLayerApp2.js +17388 -0
  35. package/lib/index.d.ts +1 -1
  36. package/lib/masters.d.ts +2 -1
  37. package/lib/style.css +1 -1
  38. package/package.json +45 -40
  39. package/lib/cjs/index3.js +0 -1
  40. package/lib/es/index3.js +0 -246
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 { 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__ */ 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 = () => m, 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: 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(v, { value: s }) })
34
+ /* @__PURE__ */ r(C, { children: /* @__PURE__ */ r(S, { 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] = 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
- m();
44
+ p();
48
45
  };
49
- }, [t]), /* @__PURE__ */ r(F, { points: a, onClick: () => {
50
- s.status.get() === S.Suspended && s.openFeature();
46
+ }, [e]), /* @__PURE__ */ r(F, { points: i, onClick: () => {
47
+ s.status.get() === y.Suspended && s.openFeature();
51
48
  } });
52
49
  }, $ = ({ sdk: s }) => {
53
- if (!c(s.featuresList.getStore()))
50
+ if (!f(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
  };