@streamlayer/react 1.24.7 → 1.24.8-pre.11da316

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 (49) hide show
  1. package/lib/app/advertisement.d.ts +5 -0
  2. package/lib/cjs/advertisement.js +1486 -1436
  3. package/lib/cjs/auth.js +33 -33
  4. package/lib/cjs/bet-pack.js +232 -195
  5. package/lib/cjs/index.js +1765 -1707
  6. package/lib/cjs/insight.js +631 -569
  7. package/lib/cjs/masters.js +1346 -1307
  8. package/lib/cjs/notification.js +237 -206
  9. package/lib/cjs/pause-ad.js +62 -62
  10. package/lib/cjs/points.js +128 -97
  11. package/lib/cjs/polymarket.js +98 -97
  12. package/lib/cjs/style.css +1 -1
  13. package/lib/cjs/useStreamLayerApp.js +95 -101
  14. package/lib/dist/cjs/index.js +1346 -1307
  15. package/lib/dist/es/index.js +1346 -1307
  16. package/lib/es/Question.js +75 -72
  17. package/lib/es/advertisement.js +9139 -8159
  18. package/lib/es/analytics.js +35 -31
  19. package/lib/es/auth.js +1 -1
  20. package/lib/es/bet-pack.js +1 -1
  21. package/lib/es/{hooks-n9ax4LRT.js → hooks-42q2i9Iw.js} +25 -23
  22. package/lib/es/{index-D8wyDNJD.js → index-sWgEw6jy.js} +1 -1
  23. package/lib/es/index.js +2 -2
  24. package/lib/es/index10.js +6 -6
  25. package/lib/es/index12.js +116 -128
  26. package/lib/es/index13.js +100 -96
  27. package/lib/es/index14.js +15 -15
  28. package/lib/es/index16.js +382 -383
  29. package/lib/es/index2.js +55 -56
  30. package/lib/es/index4.js +3 -3
  31. package/lib/es/index5.js +275 -3
  32. package/lib/es/index6.js +4 -7
  33. package/lib/es/index7.js +5 -284
  34. package/lib/es/index8.js +8 -237
  35. package/lib/es/index9.js +237 -8
  36. package/lib/es/insight.js +3 -3
  37. package/lib/es/masters.js +1 -1
  38. package/lib/es/masters2.js +29 -29
  39. package/lib/es/notification.js +28 -28
  40. package/lib/es/pause-ad.js +21 -21
  41. package/lib/es/points.js +9 -9
  42. package/lib/es/polymarket.js +40 -40
  43. package/lib/es/storage.js +18 -18
  44. package/lib/es/style.css +1 -1
  45. package/lib/es/useStreamLayerApp.js +1 -1
  46. package/lib/es/useStreamLayerApp2.js +5098 -4862
  47. package/lib/es/utils.js +86 -41
  48. package/lib/source.css +1 -1
  49. package/package.json +14 -14
@@ -1,8 +1,11 @@
1
- import { useEffect as c } from "react";
2
- import { e as s } from "./index3.js";
3
- import { A as v } from "./index8.js";
4
- let i = [], r = 0;
5
- const u = 4, d = /* @__NO_SIDE_EFFECTS__ */ (a) => {
1
+ import "./feature.js";
2
+ import { a as c } from "./useStreamLayerApp2.js";
3
+ import { useEffect as v } from "react";
4
+ import { e as u } from "./index3.js";
5
+ import { A as m } from "./index9.js";
6
+ const A = (a) => c(a);
7
+ let o = [], r = 0;
8
+ const s = 4, p = /* @__NO_SIDE_EFFECTS__ */ (a) => {
6
9
  let e = [], t = {
7
10
  get() {
8
11
  return t.lc || t.listen(() => {
@@ -11,24 +14,24 @@ const u = 4, d = /* @__NO_SIDE_EFFECTS__ */ (a) => {
11
14
  lc: 0,
12
15
  listen(n) {
13
16
  return t.lc = e.push(n), () => {
14
- for (let o = r + u; o < i.length; )
15
- i[o] === n ? i.splice(o, u) : o += u;
17
+ for (let i = r + s; i < o.length; )
18
+ o[i] === n ? o.splice(i, s) : i += s;
16
19
  let l = e.indexOf(n);
17
20
  ~l && (e.splice(l, 1), --t.lc || t.off());
18
21
  };
19
22
  },
20
23
  notify(n, l) {
21
- let o = !i.length;
24
+ let i = !o.length;
22
25
  for (let f of e)
23
- i.push(f, t.value, n, l);
24
- if (o) {
25
- for (r = 0; r < i.length; r += u)
26
- i[r](
27
- i[r + 1],
28
- i[r + 2],
29
- i[r + 3]
26
+ o.push(f, t.value, n, l);
27
+ if (i) {
28
+ for (r = 0; r < o.length; r += s)
29
+ o[r](
30
+ o[r + 1],
31
+ o[r + 2],
32
+ o[r + 3]
30
33
  );
31
- i.length = 0;
34
+ o.length = 0;
32
35
  }
33
36
  },
34
37
  /* It will be called on last listener unsubscribing.
@@ -46,8 +49,8 @@ const u = 4, d = /* @__NO_SIDE_EFFECTS__ */ (a) => {
46
49
  value: a
47
50
  };
48
51
  return t;
49
- }, b = /* @__NO_SIDE_EFFECTS__ */ (a = {}) => {
50
- let e = /* @__PURE__ */ d(a);
52
+ }, E = /* @__NO_SIDE_EFFECTS__ */ (a = {}) => {
53
+ let e = /* @__PURE__ */ p(a);
51
54
  return e.setKey = function(t, n) {
52
55
  let l = e.value;
53
56
  typeof n > "u" && t in e.value ? (e.value = { ...e.value }, delete e.value[t], e.notify(l, t)) : e.value[t] !== n && (e.value = {
@@ -55,20 +58,20 @@ const u = 4, d = /* @__NO_SIDE_EFFECTS__ */ (a) => {
55
58
  [t]: n
56
59
  }, e.notify(l, t));
57
60
  }, e;
58
- }, y = (a) => [(e) => (...t) => (a && s.emit(a?.type, a), e ? e(t) : null)], h = (a) => {
61
+ }, w = (a) => [(e) => (...t) => (a && u.emit(a?.type, a), e ? e(t) : null)], x = (a) => {
59
62
  const e = a.target;
60
- e instanceof HTMLAnchorElement && e.target === "_blank" && e.getAttribute("data-a") === "web-link" && s.emit("poll", {
63
+ e instanceof HTMLAnchorElement && e.target === "_blank" && e.getAttribute("data-a") === "web-link" && u.emit("poll", {
61
64
  action: "navigated",
62
65
  payload: {}
63
- }), e instanceof Element && e.getAttribute("data-a") === "intr" && s.emit("interactions", {
66
+ }), e instanceof Element && e.getAttribute("data-a") === "intr" && u.emit("interactions", {
64
67
  action: "tap",
65
68
  payload: {}
66
69
  });
67
- }, A = (a, e) => {
68
- const t = window.innerWidth < v.xl;
69
- c(() => {
70
- const n = t && e.useDomNode ? document : a.current, l = (o) => {
71
- e.listener(o, a);
70
+ }, L = (a, e) => {
71
+ const t = window.innerWidth < m.xl;
72
+ v(() => {
73
+ const n = t && e.useDomNode ? document : a.current, l = (i) => {
74
+ e.listener(i, a);
72
75
  };
73
76
  return e.enabled && n?.addEventListener(e.event, l), () => {
74
77
  n?.removeEventListener(e.event, l);
@@ -76,9 +79,10 @@ const u = 4, d = /* @__NO_SIDE_EFFECTS__ */ (a) => {
76
79
  }, [t, e.enabled, e.listener]);
77
80
  };
78
81
  export {
79
- A,
80
- h as a,
81
- d as b,
82
- b as f,
83
- y as u
82
+ L as A,
83
+ x as a,
84
+ p as b,
85
+ A as c,
86
+ E as f,
87
+ w as u
84
88
  };
package/lib/es/auth.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useEffect as o } from "react";
2
- import { Y as f } from "./hooks-n9ax4LRT.js";
2
+ import { w as f } from "./hooks-42q2i9Iw.js";
3
3
  const p = ({ token: t, schema: i }) => {
4
4
  const r = f();
5
5
  return o(() => {
@@ -3,7 +3,7 @@ import { e as i } from "./index3.js";
3
3
  import { useEffect as n } from "react";
4
4
  import "./feature.js";
5
5
  import { D as c } from "./index4.js";
6
- import { Y as m } from "./hooks-n9ax4LRT.js";
6
+ import { w as m } from "./hooks-42q2i9Iw.js";
7
7
  const r = (t) => {
8
8
  const e = t.target;
9
9
  e instanceof Element && e.getAttribute("data-a") === "intr" && i.emit("interactions", {
@@ -1,6 +1,6 @@
1
- import { useRef as w, useMemo as A, useEffect as r, useContext as l, useState as b, createContext as N } from "react";
1
+ import { useRef as A, useMemo as N, useEffect as r, useContext as l, useState as b, createContext as L } from "react";
2
2
  import { jsxs as O, jsx as T } from "react/jsx-runtime";
3
- import { z as L } from "./useStreamLayerApp2.js";
3
+ import { B } from "./useStreamLayerApp2.js";
4
4
  const x = ({
5
5
  event: e,
6
6
  internal: i
@@ -14,13 +14,13 @@ var M = /* @__PURE__ */ ((e) => (e[e.UNSET = 0] = "UNSET", e[e.CONNECTED = 1] =
14
14
  const H = {
15
15
  status: 0,
16
16
  sdk: null
17
- }, d = N(H), F = ({
17
+ }, d = L(H), F = ({
18
18
  sdkKey: e,
19
19
  theme: i,
20
20
  themeMode: o,
21
21
  plugins: n,
22
22
  children: h,
23
- event: v,
23
+ event: k,
24
24
  production: y = !0,
25
25
  autoEnable: f = !0,
26
26
  withAdNotification: C,
@@ -32,11 +32,12 @@ const H = {
32
32
  onDeepLinkHandled: s,
33
33
  videoPlayerController: a,
34
34
  onContentActivate: g,
35
- containerId: k,
36
- webOS: D,
37
- gamification: K
35
+ mobileBreakpoint: D,
36
+ containerId: m,
37
+ webOS: K,
38
+ gamification: P
38
39
  }) => {
39
- const t = L({
40
+ const t = B({
40
41
  sdkKey: e,
41
42
  plugins: n,
42
43
  production: y,
@@ -50,12 +51,13 @@ const H = {
50
51
  withAd: E,
51
52
  friendsTab: p,
52
53
  betPack: u,
53
- webOS: D,
54
- gamification: K
55
- }), m = w(""), P = A(() => t ? { sdk: t, status: 2, event: m } : { status: 1, sdk: null, event: m }, [t]);
54
+ webOS: K,
55
+ gamification: P,
56
+ mobileBreakpoint: D
57
+ }), v = A(""), w = N(() => t ? { sdk: t, status: 2, event: v } : { status: 1, sdk: null, event: v }, [t]);
56
58
  return r(() => {
57
- t && (t.options.setKey("friendsTab", p), t.options.setKey("theme", i), t.options.setKey("themeMode", o), t.options.setKey("skipOnboarding", c), t.options.setKey("betPack", u), t.options.setKey("containerId", k));
58
- }, [t, p, i, o, c, u, k]), r(() => () => {
59
+ t && (t.options.setKey("friendsTab", p), t.options.setKey("theme", i), t.options.setKey("themeMode", o), t.options.setKey("skipOnboarding", c), t.options.setKey("betPack", u), t.options.setKey("containerId", m));
60
+ }, [t, p, i, o, c, u, m]), r(() => () => {
59
61
  s && t?.removeDeepLinkHandler(s), a && t?.removeVideoPlayerController(a);
60
62
  }, [t]), r(() => {
61
63
  localStorage.getItem("SL_DEBUG") && console.log("StreamLayerProvider mounted with props:", {
@@ -63,8 +65,8 @@ const H = {
63
65
  onDeepLinkHandled: !!s,
64
66
  videoPlayerController: !!a
65
67
  });
66
- }, [e, s, a]), /* @__PURE__ */ O(d.Provider, { value: P, children: [
67
- v !== void 0 && /* @__PURE__ */ T(x, { event: v }),
68
+ }, [e, s, a]), /* @__PURE__ */ O(d.Provider, { value: w, children: [
69
+ k !== void 0 && /* @__PURE__ */ T(x, { event: k }),
68
70
  h
69
71
  ] });
70
72
  }, j = () => {
@@ -73,13 +75,13 @@ const H = {
73
75
  }, I = () => {
74
76
  const { event: e } = l(d);
75
77
  return e;
76
- }, V = () => {
78
+ }, _ = () => {
77
79
  const { sdk: e } = l(d), [i, o] = b({});
78
80
  return r(() => e?.options ? e?.options?.subscribe((n) => {
79
81
  o({ theme: n.theme, themeMode: n.themeMode });
80
82
  }) : () => {
81
83
  }, [e?.options]), i;
82
- }, _ = () => {
84
+ }, q = () => {
83
85
  const { sdk: e } = l(d), [i, o] = b({});
84
86
  return r(() => e?.uiState ? e?.uiState.subscribe((n) => {
85
87
  o({ ...n });
@@ -87,11 +89,11 @@ const H = {
87
89
  }, [e?.uiState]), i;
88
90
  };
89
91
  export {
90
- F as V,
91
- j as Y,
92
- V as _,
93
- x as g,
92
+ F as _,
94
93
  d as i,
95
- M as j,
96
- _ as q
94
+ x as j,
95
+ M as k,
96
+ _ as q,
97
+ j as w,
98
+ q as z
97
99
  };
@@ -1,4 +1,4 @@
1
- import { u as ir } from "./useStreamLayerApp2.js";
1
+ import { T as ir } from "./useStreamLayerApp2.js";
2
2
  function sr(A, S) {
3
3
  for (var G = 0; G < S.length; G++) {
4
4
  const X = S[G];
package/lib/es/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { h as a } from "./index6.js";
1
+ import { h as a } from "./index7.js";
2
2
  import { D as m } from "./index2.js";
3
3
  import { StreamLayerSDKNotification as S, StreamLayerSDKNotificationUI as s } from "./notification.js";
4
- import { V as L, g as i, Y as f, _ as D, q as p } from "./hooks-n9ax4LRT.js";
4
+ import { _ as L, j as i, w as f, q as D, z as p } from "./hooks-42q2i9Iw.js";
5
5
  export {
6
6
  L as StreamLayerProvider,
7
7
  i as StreamLayerSDKEvent,
package/lib/es/index10.js CHANGED
@@ -3,7 +3,7 @@ import { Q as i } from "./useStreamLayerApp2.js";
3
3
  import { jsxs as t, jsx as s, Fragment as U } from "react/jsx-runtime";
4
4
  import { memo as $, useMemo as w } from "react";
5
5
  import { V as y } from "./index14.js";
6
- import { B as T } from "./index7.js";
6
+ import { M as T } from "./index5.js";
7
7
  const G = {
8
8
  [i.TWEET]: { label: "Insight", iconName: "icon-insight" },
9
9
  [i.PROMOTION]: { label: "Insight", iconName: "icon-insight" },
@@ -61,7 +61,7 @@ const G = {
61
61
  name: "UserNameAndDate",
62
62
  class: "u1p051g3",
63
63
  propsAsIs: !1
64
- }), P = ({ image: r, name: n, userName: c, verified: o, createdTweet: p }) => {
64
+ }), M = ({ image: r, name: n, userName: c, verified: o, createdTweet: p }) => {
65
65
  const m = p && L(p);
66
66
  return /* @__PURE__ */ t(D, { children: [
67
67
  r && /* @__PURE__ */ t(H, { children: [
@@ -82,7 +82,7 @@ const G = {
82
82
  ] })
83
83
  ] })
84
84
  ] });
85
- }, M = /* @__PURE__ */ a("div")({
85
+ }, P = /* @__PURE__ */ a("div")({
86
86
  name: "Container",
87
87
  class: "c1kzqw87",
88
88
  propsAsIs: !1
@@ -123,10 +123,10 @@ const G = {
123
123
  ({ contentType: I }) => I === "video/mp4"
124
124
  /* VIDEO */
125
125
  )?.url, [e]);
126
- return /* @__PURE__ */ t(M, { children: [
126
+ return /* @__PURE__ */ t(P, { children: [
127
127
  /* @__PURE__ */ t(R, { children: [
128
128
  /* @__PURE__ */ s(
129
- P,
129
+ M,
130
130
  {
131
131
  image: r,
132
132
  name: m?.meta?.accountName,
@@ -175,7 +175,7 @@ const G = {
175
175
  }
176
176
  );
177
177
  export {
178
- P as D,
178
+ M as D,
179
179
  K as I,
180
180
  Z as N,
181
181
  G as e,