@streamlayer/react 1.23.0 → 1.23.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.
Files changed (122) hide show
  1. package/lib/app/pause-ad.d.ts +2 -4
  2. package/lib/app/polymarket.d.ts +7 -0
  3. package/lib/cjs/Question.js +1 -1
  4. package/lib/cjs/advertisement.js +1 -1
  5. package/lib/cjs/auth.js +1 -1
  6. package/lib/cjs/bet-pack.js +1 -1
  7. package/lib/cjs/feature.js +1 -0
  8. package/lib/cjs/hooks-WfHlJH12.js +1 -0
  9. package/lib/cjs/index.js +1 -1
  10. package/lib/cjs/index10.js +1 -4
  11. package/lib/cjs/index11.js +4 -1
  12. package/lib/cjs/index12.js +1 -1
  13. package/lib/cjs/index13.js +1 -1
  14. package/lib/cjs/index14.js +1 -1
  15. package/lib/cjs/index15.js +1 -5
  16. package/lib/cjs/index16.js +5 -0
  17. package/lib/cjs/index2.js +1 -1
  18. package/lib/cjs/index3.js +1 -1
  19. package/lib/cjs/index4.js +1 -1
  20. package/lib/cjs/index7.js +1 -1
  21. package/lib/cjs/index8.js +1 -1
  22. package/lib/cjs/index9.js +1 -1
  23. package/lib/cjs/insight.js +1 -1
  24. package/lib/cjs/masters.js +1 -1
  25. package/lib/cjs/masters2.js +4 -4
  26. package/lib/cjs/notification.js +1 -1
  27. package/lib/cjs/pause-ad.js +1 -1
  28. package/lib/cjs/points.js +1 -1
  29. package/lib/cjs/polymarket.js +19 -0
  30. package/lib/cjs/storage.js +1 -1
  31. package/lib/cjs/useStreamLayerApp2.js +5 -5
  32. package/lib/classic/app/pause-ad.d.ts +2 -4
  33. package/lib/classic/app/polymarket.d.ts +7 -0
  34. package/lib/classic/cjs/Question.js +1 -1
  35. package/lib/classic/cjs/advertisement.js +1 -1
  36. package/lib/classic/cjs/analytics.js +1 -1
  37. package/lib/classic/cjs/auth.js +1 -1
  38. package/lib/classic/cjs/bet-pack.js +3 -3
  39. package/lib/classic/cjs/feature.js +1 -0
  40. package/lib/classic/cjs/hooks-WfHlJH12.js +1 -0
  41. package/lib/classic/cjs/index.js +1 -1
  42. package/lib/classic/cjs/index10.js +1 -1
  43. package/lib/classic/cjs/index11.js +1 -1
  44. package/lib/classic/cjs/index12.js +1 -4
  45. package/lib/classic/cjs/index13.js +4 -0
  46. package/lib/classic/cjs/index2.js +2 -2
  47. package/lib/classic/cjs/index5.js +1 -1
  48. package/lib/classic/cjs/index6.js +1 -1
  49. package/lib/classic/cjs/index7.js +1 -1
  50. package/lib/classic/cjs/index8.js +1 -1
  51. package/lib/classic/cjs/index9.js +1 -1
  52. package/lib/classic/cjs/insight.js +1 -1
  53. package/lib/classic/cjs/notification.js +1 -1
  54. package/lib/classic/cjs/notification2.js +1 -1
  55. package/lib/classic/cjs/pause-ad.js +1 -1
  56. package/lib/classic/cjs/points.js +1 -1
  57. package/lib/classic/cjs/polymarket.js +19 -0
  58. package/lib/classic/cjs/useStreamLayerApp2.js +5 -5
  59. package/lib/classic/es/Question.js +4 -4
  60. package/lib/classic/es/advertisement.js +6 -6
  61. package/lib/classic/es/analytics.js +1 -1
  62. package/lib/classic/es/auth.js +1 -1
  63. package/lib/classic/es/bet-pack.js +18 -17
  64. package/lib/classic/es/feature.js +63 -0
  65. package/lib/classic/es/hooks-WfHlJH12.js +98 -0
  66. package/lib/classic/es/index.js +2 -2
  67. package/lib/classic/es/index10.js +82 -2295
  68. package/lib/classic/es/index11.js +2351 -179
  69. package/lib/classic/es/index12.js +170 -822
  70. package/lib/classic/es/index13.js +835 -0
  71. package/lib/classic/es/index2.js +127 -126
  72. package/lib/classic/es/index5.js +4 -5
  73. package/lib/classic/es/index6.js +5 -11
  74. package/lib/classic/es/index7.js +5 -62
  75. package/lib/classic/es/index8.js +7 -315
  76. package/lib/classic/es/index9.js +313 -81
  77. package/lib/classic/es/insight.js +2 -2
  78. package/lib/classic/es/notification.js +2 -2
  79. package/lib/classic/es/notification2.js +14 -13
  80. package/lib/classic/es/pause-ad.js +20 -20
  81. package/lib/classic/es/points.js +15 -14
  82. package/lib/classic/es/polymarket.js +6670 -0
  83. package/lib/classic/es/useStreamLayerApp2.js +143 -119
  84. package/lib/dist/cjs/masters.js +23 -23
  85. package/lib/dist/es/masters.js +189 -165
  86. package/lib/dist/index.d.ts +17 -6
  87. package/lib/dist/style.css +1 -1
  88. package/lib/es/Question.js +2 -2
  89. package/lib/es/advertisement.js +5 -5
  90. package/lib/es/auth.js +1 -1
  91. package/lib/es/bet-pack.js +1 -1
  92. package/lib/es/feature.js +63 -0
  93. package/lib/es/hooks-WfHlJH12.js +98 -0
  94. package/lib/es/index.js +2 -2
  95. package/lib/es/index10.js +236 -804
  96. package/lib/es/index11.js +822 -170
  97. package/lib/es/index12.js +166 -302
  98. package/lib/es/index13.js +313 -81
  99. package/lib/es/index14.js +82 -2350
  100. package/lib/es/index15.js +2330 -1229
  101. package/lib/es/index16.js +1254 -0
  102. package/lib/es/index2.js +118 -117
  103. package/lib/es/index3.js +3 -61
  104. package/lib/es/index4.js +3 -3
  105. package/lib/es/index7.js +5 -7
  106. package/lib/es/index8.js +5 -9
  107. package/lib/es/index9.js +7 -263
  108. package/lib/es/insight.js +2 -2
  109. package/lib/es/masters.js +1 -1
  110. package/lib/es/masters2.js +25 -24
  111. package/lib/es/notification.js +8 -7
  112. package/lib/es/pause-ad.js +20 -20
  113. package/lib/es/points.js +6 -5
  114. package/lib/es/polymarket.js +6670 -0
  115. package/lib/es/storage.js +2 -2
  116. package/lib/es/useStreamLayerApp2.js +143 -119
  117. package/lib/style.css +1 -1
  118. package/package.json +24 -14
  119. package/lib/cjs/hooks-B0Qttldg.js +0 -1
  120. package/lib/classic/cjs/hooks-B0Qttldg.js +0 -1
  121. package/lib/classic/es/hooks-B0Qttldg.js +0 -98
  122. package/lib/es/hooks-B0Qttldg.js +0 -98
@@ -1,8 +1,8 @@
1
1
  import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
2
  import { s as p, u as v } from "./sl-types.js";
3
3
  import { createContext as z, useContext as F, useRef as Y, useEffect as _, useState as G } from "react";
4
- import { y as J, d as K, u as M, a as W } from "./index9.js";
5
- import { e as X, t as Z } from "./index10.js";
4
+ import { y as J, d as K, u as M, a as W } from "./index10.js";
5
+ import { e as X, t as Z } from "./index11.js";
6
6
  import { y as oo } from "./utils.js";
7
7
  import { Q as L, A as eo } from "./useStreamLayerApp2.js";
8
8
  const to = z({
@@ -1,17 +1,17 @@
1
1
  import { jsx as Q, jsxs as ye, Fragment as el } from "react/jsx-runtime";
2
- import { h as By } from "./index7.js";
2
+ import { h as By } from "./index8.js";
3
3
  import { c as Ti, s as te, u as Qs } from "./sl-types.js";
4
4
  import { c as My, f as Uy, b as Fy } from "./analytics.js";
5
5
  import { useEffect as Bt, useState as Ol, useRef as qi, useCallback as vr } from "react";
6
6
  import { e as ei } from "./index3.js";
7
7
  import { A as kh, i as Nt, j as Ph, k as Lh, l as tl, m as Rh, g as sa, n as Ms, o as li, c as $y, b as Vy, p as qy, S as jy } from "./useStreamLayerApp2.js";
8
- import { O as Ra } from "./index13.js";
8
+ import { O as Ra } from "./index14.js";
9
9
  import { B as Hy } from "./index6.js";
10
- import { y as il, E as zy } from "./index12.js";
11
- import { g as ln, c as na, a as Wy } from "./index14.js";
10
+ import { y as il, E as zy } from "./index13.js";
11
+ import { g as ln, c as na, a as Wy } from "./index15.js";
12
12
  import { v4 as wc, validate as Gy, v5 as Dc } from "uuid";
13
13
  import { y as Ky } from "./utils.js";
14
- import { B as Xy, F as Yy, z as Qy, j as er } from "./hooks-B0Qttldg.js";
14
+ import { B as Xy, F as Yy, z as Qy, j as er } from "./hooks-WfHlJH12.js";
15
15
  function Ge() {
16
16
  return Ge = Object.assign ? Object.assign.bind() : function(i) {
17
17
  for (var e = 1; e < arguments.length; e++) {
package/lib/es/auth.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useEffect as o } from "react";
2
- import { B as f } from "./hooks-B0Qttldg.js";
2
+ import { B as f } from "./hooks-WfHlJH12.js";
3
3
  const p = ({ token: t, schema: i }) => {
4
4
  const r = f();
5
5
  return o(() => {
@@ -2,7 +2,7 @@ import { jsx as n } from "react/jsx-runtime";
2
2
  import { e as o } from "./index3.js";
3
3
  import { Q as i } from "./index4.js";
4
4
  import { useEffect as c } from "react";
5
- import { B as m } from "./hooks-B0Qttldg.js";
5
+ import { B as m } from "./hooks-WfHlJH12.js";
6
6
  const r = (t) => {
7
7
  const e = t.target;
8
8
  e instanceof Element && e.getAttribute("data-a") === "intr" && o.emit("interactions", {
@@ -0,0 +1,63 @@
1
+ var d = Object.defineProperty;
2
+ var l = (t, e, s) => e in t ? d(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
3
+ var n = (t, e, s) => l(t, typeof e != "symbol" ? e + "" : e, s);
4
+ import { pino as c } from "pino";
5
+ import "./sl-types.js";
6
+ import "nanostores";
7
+ import { S as o } from "./useStreamLayerApp2.js";
8
+ const v = c({
9
+ level: "trace",
10
+ enabled: typeof window < "u" && !!window.localStorage.getItem("SL_DEBUG"),
11
+ browser: {
12
+ write: (t) => {
13
+ console.log(t);
14
+ }
15
+ }
16
+ }), w = (t, e) => v.child({ name: t }, e);
17
+ class E extends Event {
18
+ constructor(s, i) {
19
+ super(s);
20
+ n(this, "slEventBus");
21
+ this.slEventBus = i;
22
+ }
23
+ }
24
+ const m = w("event-bus");
25
+ class T {
26
+ constructor(e = "sl-event-bus") {
27
+ n(this, "name");
28
+ n(this, "listeners");
29
+ n(this, "emit", (e, s) => {
30
+ const i = new E(this.name, { ...s, type: e });
31
+ m.debug(i, "Emitting event"), window.dispatchEvent(i);
32
+ });
33
+ n(this, "destroy", () => {
34
+ this.listeners.forEach((e) => {
35
+ window.removeEventListener(this.name, e), this.listeners.delete(e);
36
+ }), this.listeners.clear();
37
+ });
38
+ this.name = e, this.listeners = /* @__PURE__ */ new Set();
39
+ }
40
+ listen(e) {
41
+ return window.addEventListener(this.name, e), this.listeners.add(e), () => {
42
+ this.off(e);
43
+ };
44
+ }
45
+ off(e) {
46
+ window.removeEventListener(this.name, e), this.listeners.delete(e);
47
+ }
48
+ }
49
+ window.slStore = /* @__PURE__ */ Object.create(null);
50
+ var r;
51
+ (function(t) {
52
+ t.ORGANIZATION = "ORGANIZATION", t.STREAM = "STREAM";
53
+ })(r || (r = {}));
54
+ o.BETTING + "", o.GAMES + "", o.PUBLIC_CHAT + "", o.TWITTER + "";
55
+ var a;
56
+ (function(t) {
57
+ t.Ready = "ready", t.Suspended = "suspended";
58
+ })(a || (a = {}));
59
+ export {
60
+ T as E,
61
+ a as F,
62
+ w as c
63
+ };
@@ -0,0 +1,98 @@
1
+ import { createContext as g, useEffect as i, useRef as w, useMemo as A, useContext as u, useState as h } from "react";
2
+ import { jsxs as N, jsx as O } from "react/jsx-runtime";
3
+ import { $ as T } from "./useStreamLayerApp2.js";
4
+ const L = ({
5
+ event: e,
6
+ internal: r
7
+ }) => {
8
+ const o = H(), n = j();
9
+ return i(() => {
10
+ o && (e && (o.createEventSession(e, r), n && (n.current = e)), !e && n != null && n.current && (o.createEventSession("", r), n.current = ""));
11
+ }, [e, r, n, o]), null;
12
+ };
13
+ var x = /* @__PURE__ */ ((e) => (e[e.UNSET = 0] = "UNSET", e[e.CONNECTED = 1] = "CONNECTED", e[e.READY = 2] = "READY", e))(x || {});
14
+ const M = {
15
+ status: 0,
16
+ sdk: null
17
+ }, d = g(M), U = ({
18
+ sdkKey: e,
19
+ theme: r,
20
+ themeMode: o,
21
+ plugins: n,
22
+ children: a,
23
+ event: m,
24
+ production: y = !0,
25
+ autoEnable: C = !0,
26
+ withAdNotification: E,
27
+ withAd: S = !0,
28
+ betPack: c = !1,
29
+ hideFriends: f,
30
+ skipOnboarding: v,
31
+ friendsTab: p = "enabled",
32
+ onDeepLinkHandled: s,
33
+ videoPlayerController: l,
34
+ onContentActivate: D,
35
+ containerId: k,
36
+ webOS: K
37
+ }) => {
38
+ const t = T({
39
+ sdkKey: e,
40
+ plugins: n,
41
+ production: y,
42
+ autoEnable: C,
43
+ onDeepLinkHandled: s,
44
+ videoPlayerController: l,
45
+ onContentActivate: D,
46
+ hideFriends: f,
47
+ skipOnboarding: v,
48
+ withAdNotification: E,
49
+ withAd: S,
50
+ friendsTab: p,
51
+ betPack: c,
52
+ webOS: K
53
+ }), b = w(""), P = A(() => t ? { sdk: t, status: 2, event: b } : { status: 1, sdk: null, event: b }, [t]);
54
+ return i(() => {
55
+ t && (t.options.setKey("friendsTab", p), t.options.setKey("theme", r), t.options.setKey("themeMode", o), t.options.setKey("skipOnboarding", v), t.options.setKey("betPack", c), t.options.setKey("containerId", k));
56
+ }, [t, p, r, o, v, c, k]), i(() => () => {
57
+ s && (t == null || t.removeDeepLinkHandler(s)), l && (t == null || t.removeVideoPlayerController(l));
58
+ }, [t]), i(() => {
59
+ localStorage.getItem("SL_DEBUG") && console.log("StreamLayerProvider mounted with props:", {
60
+ sdkKey: !!e,
61
+ onDeepLinkHandled: !!s,
62
+ videoPlayerController: !!l
63
+ });
64
+ }, [e, s, l]), /* @__PURE__ */ N(d.Provider, { value: P, children: [
65
+ m !== void 0 && /* @__PURE__ */ O(L, { event: m }),
66
+ a
67
+ ] });
68
+ }, H = () => {
69
+ const { sdk: e } = u(d);
70
+ return e;
71
+ }, j = () => {
72
+ const { event: e } = u(d);
73
+ return e;
74
+ }, Y = () => {
75
+ const { sdk: e } = u(d), [r, o] = h({});
76
+ return i(() => {
77
+ var n;
78
+ return e != null && e.options ? (n = e == null ? void 0 : e.options) == null ? void 0 : n.subscribe((a) => {
79
+ o({ theme: a.theme, themeMode: a.themeMode });
80
+ }) : () => {
81
+ };
82
+ }, [e == null ? void 0 : e.options]), r;
83
+ }, B = () => {
84
+ const { sdk: e } = u(d), [r, o] = h({});
85
+ return i(() => e != null && e.uiState ? e == null ? void 0 : e.uiState.subscribe((n) => {
86
+ o({ ...n });
87
+ }) : () => {
88
+ }, [e == null ? void 0 : e.uiState]), r;
89
+ };
90
+ export {
91
+ H as B,
92
+ B as F,
93
+ x as Y,
94
+ d as i,
95
+ L as j,
96
+ U as q,
97
+ Y as z
98
+ };
package/lib/es/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import "react";
2
- import { q as o, j as S, B as i, z as s, F as y } from "./hooks-B0Qttldg.js";
2
+ import { q as o, j as S, B as i, z as s, F as y } from "./hooks-WfHlJH12.js";
3
3
  import "react/jsx-runtime";
4
4
  import "./useStreamLayerApp2.js";
5
- import { h as p } from "./index7.js";
5
+ import { h as p } from "./index8.js";
6
6
  import { b as x } from "./index2.js";
7
7
  import { StreamLayerSDKNotification as K, StreamLayerSDKNotificationUI as c } from "./notification.js";
8
8
  export {