@streamlayer/react 1.24.5 → 1.24.7

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 (166) hide show
  1. package/lib/cjs/advertisement.js +19607 -203
  2. package/lib/cjs/auth.js +4459 -1
  3. package/lib/cjs/bet-pack.js +15691 -1
  4. package/lib/cjs/index.js +19411 -1
  5. package/lib/cjs/insight.js +13509 -1
  6. package/lib/cjs/masters.js +20696 -1
  7. package/lib/cjs/notification.js +13087 -1
  8. package/lib/cjs/package.json +1 -0
  9. package/lib/cjs/pause-ad.js +8390 -1
  10. package/lib/cjs/points.js +7189 -1
  11. package/lib/cjs/polyfills.js +69 -0
  12. package/lib/cjs/polymarket.js +16394 -14
  13. package/lib/cjs/style.css +1 -0
  14. package/lib/cjs/useStreamLayerApp.js +4711 -1
  15. package/lib/dist/cjs/index.js +20696 -1
  16. package/lib/dist/es/index.js +20669 -10
  17. package/lib/dist/es/polyfills.js +92 -0
  18. package/lib/es/Question.js +66 -65
  19. package/lib/es/advertisement.js +3402 -3294
  20. package/lib/es/analytics.js +1 -1
  21. package/lib/es/bet-pack.js +1 -1
  22. package/lib/es/feature.js +192 -37
  23. package/lib/es/{index-DvqmgCor.js → index-D8wyDNJD.js} +1 -1
  24. package/lib/es/index.js +1 -1
  25. package/lib/es/index10.js +181 -7
  26. package/lib/es/index11.js +371 -181
  27. package/lib/es/index12.js +366 -2579
  28. package/lib/es/index13.js +789 -234
  29. package/lib/es/index14.js +293 -792
  30. package/lib/es/index15.js +2550 -305
  31. package/lib/es/index16.js +64 -66
  32. package/lib/es/index2.js +285 -279
  33. package/lib/es/index3.js +34 -4
  34. package/lib/es/index4.js +16 -17
  35. package/lib/es/index5.js +3 -19
  36. package/lib/es/index6.js +7 -5
  37. package/lib/es/index7.js +284 -5
  38. package/lib/es/index8.js +236 -281
  39. package/lib/es/index9.js +8 -179
  40. package/lib/es/insight.js +2 -2
  41. package/lib/es/masters2.js +199 -189
  42. package/lib/es/notification.js +27 -28
  43. package/lib/es/pause-ad.js +124 -149
  44. package/lib/es/points.js +23 -24
  45. package/lib/es/polymarket.js +3 -3
  46. package/lib/es/storage.js +4 -4
  47. package/lib/es/style.css +1 -0
  48. package/lib/es/useStreamLayerApp2.js +5579 -4475
  49. package/lib/source.css +1 -120
  50. package/package.json +126 -91
  51. package/lib/cjs/Question.js +0 -1
  52. package/lib/cjs/analytics.js +0 -1
  53. package/lib/cjs/feature.js +0 -1
  54. package/lib/cjs/gamification-feature.js +0 -1
  55. package/lib/cjs/gamification-feature2.js +0 -1
  56. package/lib/cjs/hooks-n9ax4LRT.js +0 -1
  57. package/lib/cjs/index-DvqmgCor.js +0 -5
  58. package/lib/cjs/index10.js +0 -1
  59. package/lib/cjs/index11.js +0 -1
  60. package/lib/cjs/index12.js +0 -1
  61. package/lib/cjs/index13.js +0 -1
  62. package/lib/cjs/index14.js +0 -4
  63. package/lib/cjs/index15.js +0 -1
  64. package/lib/cjs/index16.js +0 -5
  65. package/lib/cjs/index2.js +0 -1
  66. package/lib/cjs/index3.js +0 -1
  67. package/lib/cjs/index4.js +0 -5
  68. package/lib/cjs/index5.js +0 -1
  69. package/lib/cjs/index6.js +0 -1
  70. package/lib/cjs/index7.js +0 -1
  71. package/lib/cjs/index8.js +0 -1
  72. package/lib/cjs/index9.js +0 -7
  73. package/lib/cjs/masters2.js +0 -8
  74. package/lib/cjs/sl-types.js +0 -1
  75. package/lib/cjs/storage.js +0 -1
  76. package/lib/cjs/theme.js +0 -1
  77. package/lib/cjs/useStreamLayerApp2.js +0 -17
  78. package/lib/cjs/utils.js +0 -47
  79. package/lib/classic/app/advertisement.d.ts +0 -19
  80. package/lib/classic/app/app.d.ts +0 -23
  81. package/lib/classic/app/auth.d.ts +0 -4
  82. package/lib/classic/app/bet-pack.d.ts +0 -10
  83. package/lib/classic/app/insight.d.ts +0 -13
  84. package/lib/classic/app/masters.d.ts +0 -19
  85. package/lib/classic/app/notification.d.ts +0 -5
  86. package/lib/classic/app/pause-ad.d.ts +0 -27
  87. package/lib/classic/app/points.d.ts +0 -3
  88. package/lib/classic/app/polymarket.d.ts +0 -7
  89. package/lib/classic/app/useStreamLayerApp.d.ts +0 -1
  90. package/lib/classic/cjs/Question.js +0 -1
  91. package/lib/classic/cjs/advertisement.js +0 -203
  92. package/lib/classic/cjs/analytics.js +0 -1
  93. package/lib/classic/cjs/auth.js +0 -1
  94. package/lib/classic/cjs/bet-pack.js +0 -5
  95. package/lib/classic/cjs/feature.js +0 -1
  96. package/lib/classic/cjs/gamification-feature.js +0 -1
  97. package/lib/classic/cjs/hooks-n9ax4LRT.js +0 -1
  98. package/lib/classic/cjs/index-DvqmgCor.js +0 -5
  99. package/lib/classic/cjs/index.js +0 -1
  100. package/lib/classic/cjs/index10.js +0 -1
  101. package/lib/classic/cjs/index11.js +0 -1
  102. package/lib/classic/cjs/index12.js +0 -1
  103. package/lib/classic/cjs/index13.js +0 -4
  104. package/lib/classic/cjs/index2.js +0 -5
  105. package/lib/classic/cjs/index3.js +0 -1
  106. package/lib/classic/cjs/index4.js +0 -1
  107. package/lib/classic/cjs/index5.js +0 -1
  108. package/lib/classic/cjs/index6.js +0 -1
  109. package/lib/classic/cjs/index7.js +0 -7
  110. package/lib/classic/cjs/index8.js +0 -1
  111. package/lib/classic/cjs/index9.js +0 -1
  112. package/lib/classic/cjs/insight.js +0 -1
  113. package/lib/classic/cjs/notification.js +0 -1
  114. package/lib/classic/cjs/notification2.js +0 -1
  115. package/lib/classic/cjs/pause-ad.js +0 -1
  116. package/lib/classic/cjs/points.js +0 -1
  117. package/lib/classic/cjs/polymarket.js +0 -14
  118. package/lib/classic/cjs/sl-types.js +0 -1
  119. package/lib/classic/cjs/useStreamLayerApp.js +0 -1
  120. package/lib/classic/cjs/useStreamLayerApp2.js +0 -17
  121. package/lib/classic/cjs/utils.js +0 -47
  122. package/lib/classic/es/Question.js +0 -388
  123. package/lib/classic/es/advertisement.js +0 -38759
  124. package/lib/classic/es/analytics.js +0 -84
  125. package/lib/classic/es/auth.js +0 -11
  126. package/lib/classic/es/bet-pack.js +0 -3419
  127. package/lib/classic/es/feature.js +0 -59
  128. package/lib/classic/es/gamification-feature.js +0 -4
  129. package/lib/classic/es/hooks-n9ax4LRT.js +0 -97
  130. package/lib/classic/es/index-DvqmgCor.js +0 -3775
  131. package/lib/classic/es/index.js +0 -15
  132. package/lib/classic/es/index10.js +0 -2592
  133. package/lib/classic/es/index11.js +0 -317
  134. package/lib/classic/es/index12.js +0 -185
  135. package/lib/classic/es/index13.js +0 -820
  136. package/lib/classic/es/index2.js +0 -2597
  137. package/lib/classic/es/index3.js +0 -19
  138. package/lib/classic/es/index4.js +0 -6
  139. package/lib/classic/es/index5.js +0 -5
  140. package/lib/classic/es/index6.js +0 -285
  141. package/lib/classic/es/index7.js +0 -181
  142. package/lib/classic/es/index8.js +0 -7
  143. package/lib/classic/es/index9.js +0 -11
  144. package/lib/classic/es/insight.js +0 -79
  145. package/lib/classic/es/notification.js +0 -9
  146. package/lib/classic/es/notification2.js +0 -1127
  147. package/lib/classic/es/pause-ad.js +0 -257
  148. package/lib/classic/es/points.js +0 -77
  149. package/lib/classic/es/polymarket.js +0 -6617
  150. package/lib/classic/es/sl-types.js +0 -156
  151. package/lib/classic/es/useStreamLayerApp.js +0 -4
  152. package/lib/classic/es/useStreamLayerApp2.js +0 -11573
  153. package/lib/classic/es/utils.js +0 -76
  154. package/lib/classic/index.d.ts +0 -6
  155. package/lib/classic/masters.d.ts +0 -8
  156. package/lib/classic/source.css +0 -110
  157. package/lib/dist/cjs/gamification-feature.js +0 -1
  158. package/lib/dist/cjs/index-DvqmgCor.js +0 -5
  159. package/lib/dist/cjs/masters.js +0 -69
  160. package/lib/dist/es/gamification-feature.js +0 -4
  161. package/lib/dist/es/index-DvqmgCor.js +0 -3775
  162. package/lib/dist/es/masters.js +0 -22204
  163. package/lib/dist/index.d.ts +0 -1355
  164. package/lib/dist/source.css +0 -64
  165. package/lib/es/sl-types.js +0 -156
  166. package/lib/style.css +0 -1
@@ -1,257 +0,0 @@
1
- import { jsx as r, jsxs as D } from "react/jsx-runtime";
2
- import { h as M } from "./index8.js";
3
- import { s as d, u as q, c as V } from "./sl-types.js";
4
- import { d as j } from "./index10.js";
5
- import { useState as B, useRef as x, useCallback as _, useEffect as c, Component as K } from "react";
6
- import { e as T } from "./index4.js";
7
- import { Y as z, _ as G } from "./hooks-n9ax4LRT.js";
8
- const O = /* @__PURE__ */ d("div")({
9
- name: "PauseAdOverlay",
10
- class: "pw9gih8",
11
- propsAsIs: !1
12
- }), W = /* @__PURE__ */ d("div")({
13
- name: "PauseAdContent",
14
- class: "p8lpomy",
15
- propsAsIs: !1
16
- }), X = /* @__PURE__ */ d("div")({
17
- name: "PauseAdTopLeft",
18
- class: "pv7u167",
19
- propsAsIs: !1
20
- }), Y = /* @__PURE__ */ d("h2")({
21
- name: "PauseAdTitle",
22
- class: "p1kh2yb0",
23
- propsAsIs: !1
24
- }), H = /* @__PURE__ */ d("p")({
25
- name: "PauseAdCaption",
26
- class: "pl8f94x",
27
- propsAsIs: !1
28
- }), J = /* @__PURE__ */ d("div")({
29
- name: "PauseAdBottomLeft",
30
- class: "p1m6zmrt",
31
- propsAsIs: !1
32
- }), Q = /* @__PURE__ */ d("button")({
33
- name: "PauseAdPlayButton",
34
- class: "pm3vwfa",
35
- propsAsIs: !1
36
- }), Z = /* @__PURE__ */ d("div")({
37
- name: "PauseAdSidebarGradient",
38
- class: "p1tibuhw",
39
- propsAsIs: !1
40
- }), $ = /* @__PURE__ */ d("div")({
41
- name: "PauseAdSidebar",
42
- class: "ptqqrqd",
43
- propsAsIs: !1
44
- }), ee = /* @__PURE__ */ d("span")({
45
- name: "PauseAdTitleDescription",
46
- class: "p14estxv",
47
- propsAsIs: !1
48
- }), N = /* @__PURE__ */ d("img")({
49
- name: "ExternalAdContainer",
50
- class: "e1dpvfl1",
51
- propsAsIs: !1
52
- }), re = ({
53
- vastUrl: i,
54
- isDesktop: a,
55
- content: e
56
- }) => (c(() => {
57
- e.imageSrc && e.id && T.emit("exposedPauseAd", {
58
- action: "rendered",
59
- payload: {
60
- id: e.id,
61
- parentId: e.parentId
62
- }
63
- });
64
- }, [e, i]), e?.imageSrc ? !e.adUrl || !a ? /* @__PURE__ */ r(N, { src: e.imageSrc }) : /* @__PURE__ */ r(
65
- "a",
66
- {
67
- onClick: () => {
68
- T.emit("exposedPauseAd", {
69
- action: "navigated",
70
- payload: {
71
- id: e.id,
72
- parentId: e.parentId
73
- }
74
- });
75
- },
76
- href: e.adUrl,
77
- target: "_blank",
78
- rel: "noopener noreferrer",
79
- children: /* @__PURE__ */ r(N, { src: e.imageSrc })
80
- }
81
- ) : null), te = ({ isClosing: i, content: a, externalPauseAdStore: e, title: y, caption: f, onPlay: l, onClose: u, vastUrl: t, options: h, isDesktop: n }) => {
82
- const b = h?.showPauseButton ?? !0, { ref: p, focusSelf: I } = j.useFocusable({
83
- focusKey: "sl-pause-ad-play",
84
- onEnterRelease: l,
85
- isFocusBoundary: !0,
86
- forceFocus: !0
87
- });
88
- return c(() => () => {
89
- e.revalidate();
90
- }, [e]), c(() => {
91
- p.current && I();
92
- }, [p, I]), c(() => {
93
- if (!u)
94
- return () => {
95
- };
96
- const C = (A) => {
97
- const s = A.keyCode;
98
- if (s === 461 || s === 10009 || s === 27 || s === 8) {
99
- A.preventDefault(), A.stopPropagation(), A.stopImmediatePropagation(), u();
100
- return;
101
- }
102
- };
103
- return window.addEventListener("keydown", C, { capture: !0 }), () => window.removeEventListener("keydown", C, { capture: !0 });
104
- }, [u]), /* @__PURE__ */ r(O, { className: V("SL_PauseAd", i && "pause-ad-closing"), children: /* @__PURE__ */ D(W, { children: [
105
- /* @__PURE__ */ D(X, { children: [
106
- /* @__PURE__ */ r(Y, { children: y }),
107
- /* @__PURE__ */ r(H, { children: f })
108
- ] }),
109
- b && /* @__PURE__ */ r(J, { children: /* @__PURE__ */ r(
110
- Q,
111
- {
112
- ref: p,
113
- onClick: l,
114
- onMouseEnter: () => p.current.focus(),
115
- "aria-label": "Resume playback"
116
- }
117
- ) }),
118
- /* @__PURE__ */ r(Z, { className: "SL_PauseAdSidebar", children: /* @__PURE__ */ D($, { children: [
119
- t && /* @__PURE__ */ r(re, { content: a, isDesktop: n, vastUrl: t }),
120
- /* @__PURE__ */ r(ee, { children: "ADVERTISEMENT" })
121
- ] }) })
122
- ] }) });
123
- }, se = ({ showPauseAd: i, vastUrls: a, title: e, caption: y, sdk: f, onClose: l, onRender: u, options: t, isDesktop: h }) => {
124
- const n = t?.pauseAdDelay ?? 0, b = t?.pauseAdRefetchInterval ?? 1e3 * 60 * 50, [p, I] = B(!1), [C, A] = B(!1), s = x(), v = a?.[0].url, P = x(v), g = x(""), S = x("");
125
- P.current = v;
126
- const [m, R] = f.advertisement.getExternalPauseAd(v, {
127
- refetchInterval: b,
128
- $enabled: n === 0 || !!i,
129
- prefetch: n === 0 && b > 0
130
- }), k = q(m), E = _(() => {
131
- if (l) {
132
- S.current = P.current;
133
- const o = m.get().data;
134
- T.emit("exposedPauseAd", {
135
- action: "closed",
136
- payload: o?.url === S.current ? {
137
- id: o?.id,
138
- parentId: o?.parentId
139
- } : {}
140
- }), l();
141
- }
142
- }, [l, m]), F = _(() => {
143
- f.controlVideoPlayer({ play: !0 });
144
- }, [f]);
145
- return c(() => {
146
- R === P.current && k.error && (console.log("error", k.error), clearTimeout(s.current), E?.());
147
- }, [k, E, R]), c(() => {
148
- if (i && v) {
149
- g.current = P.current, S.current = "";
150
- const o = m.get().data;
151
- T.emit("exposedPauseAd", {
152
- action: "enabled",
153
- payload: o?.url === g.current ? {
154
- id: o?.id,
155
- parentId: o?.parentId
156
- } : {}
157
- });
158
- const U = () => {
159
- const w = m.get(), L = w.data;
160
- (!L || L?.url === P.current) && (!w.loading && L?.imageSrc ? (clearTimeout(s.current), A(!1), I(!0)) : w.loading && (s.current = setTimeout(() => {
161
- U();
162
- }, 200)));
163
- };
164
- clearTimeout(s.current), s.current = setTimeout(() => {
165
- U();
166
- }, n);
167
- } else {
168
- if (S.current !== P.current) {
169
- const o = m.get().data;
170
- S.current = "", g.current !== "" && (T.emit("exposedPauseAd", {
171
- action: "disabled",
172
- payload: g.current === o?.url ? {
173
- id: o?.id,
174
- parentId: o?.parentId
175
- } : {}
176
- }), g.current = "");
177
- }
178
- A(!0), s.current = setTimeout(() => {
179
- I(!1);
180
- }, 400);
181
- }
182
- return () => {
183
- s.current && clearTimeout(s.current);
184
- };
185
- }, [m, E, n, i, v]), c(() => {
186
- u?.({ rendered: p });
187
- }, [p, u]), c(() => () => {
188
- u?.({ rendered: !1 });
189
- }, [u]), !p || !k.data ? null : /* @__PURE__ */ r(
190
- te,
191
- {
192
- onClose: E,
193
- isClosing: C,
194
- title: e,
195
- caption: y,
196
- onPlay: F,
197
- vastUrl: v,
198
- options: t,
199
- isDesktop: h,
200
- externalPauseAdStore: m,
201
- content: k.data
202
- }
203
- );
204
- }, ae = ({
205
- showPauseAd: i,
206
- pauseAdVastUrl: a,
207
- videoPlayerController: e,
208
- onRenderPauseAd: y,
209
- onClosePauseAd: f,
210
- children: l,
211
- options: u
212
- }) => {
213
- const t = z(), h = G(), n = x();
214
- return c(() => t ? (e && (n.current = e, t.addVideoPlayerController(n.current)), () => {
215
- n.current && t.removeVideoPlayerController(n.current);
216
- }) : () => {
217
- }, [t, e]), t ? /* @__PURE__ */ r("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ D(
218
- M,
219
- {
220
- style: l ? { position: "relative" } : {},
221
- customTheme: h.theme,
222
- themeMode: h.themeMode,
223
- children: [
224
- l,
225
- a && /* @__PURE__ */ r(
226
- se,
227
- {
228
- sdk: t,
229
- showPauseAd: i,
230
- vastUrls: a,
231
- onClose: f,
232
- onRender: y,
233
- options: u,
234
- isDesktop: !0
235
- }
236
- )
237
- ]
238
- }
239
- ) }) : l;
240
- };
241
- class pe extends K {
242
- constructor(a) {
243
- super(a), this.state = { hasError: !1 };
244
- }
245
- static getDerivedStateFromError() {
246
- return { hasError: !0 };
247
- }
248
- componentDidCatch(a, e) {
249
- console.error(a, e.componentStack);
250
- }
251
- render() {
252
- return this.state.hasError ? this.props.children : /* @__PURE__ */ r(ae, { ...this.props });
253
- }
254
- }
255
- export {
256
- pe as StreamLayerPauseAd
257
- };
@@ -1,77 +0,0 @@
1
- import { jsxs as p, jsx as t } from "react/jsx-runtime";
2
- import { m as c, h as u } from "./index8.js";
3
- import { useState as d, useEffect as f } from "react";
4
- import { s as o, u as h } from "./sl-types.js";
5
- import { e as n } from "./index4.js";
6
- import { p as y } from "./index3.js";
7
- import { B as S } from "./index6.js";
8
- import { F as m } from "./feature.js";
9
- import { S as v } from "./useStreamLayerApp2.js";
10
- import { Y as g, _ as A } from "./hooks-n9ax4LRT.js";
11
- const I = /* @__PURE__ */ o("div")({
12
- name: "PointsContainer",
13
- class: "psiob9b",
14
- propsAsIs: !1
15
- }), P = /* @__PURE__ */ o("div")({
16
- name: "PointsIcon",
17
- class: "p1gqe4lh",
18
- propsAsIs: !1
19
- }), b = () => S, k = /* @__PURE__ */ o(b())({
20
- name: "PointsSvg",
21
- class: "p15syg2y",
22
- propsAsIs: !0
23
- }), F = /* @__PURE__ */ o("div")({
24
- name: "PointsBody",
25
- class: "p12n4f2h",
26
- propsAsIs: !1
27
- }), T = /* @__PURE__ */ o("div")({
28
- name: "PointsTitle",
29
- class: "poqmx89",
30
- propsAsIs: !1
31
- }), x = /* @__PURE__ */ o("div")({
32
- name: "PointsValue",
33
- class: "prj9b3v",
34
- propsAsIs: !1
35
- }), B = ({ points: s, onClick: e }) => /* @__PURE__ */ p(I, { className: c, onClick: e, children: [
36
- /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(k, { name: "icon-trophy-solid" }) }),
37
- /* @__PURE__ */ p(F, { children: [
38
- /* @__PURE__ */ t(T, { children: "Total points" }),
39
- /* @__PURE__ */ t(x, { children: /* @__PURE__ */ t(y, { value: s }) })
40
- ] })
41
- ] }), C = ({ gamification: s }) => {
42
- const e = s.userSummary.$store, [a, l] = d(0);
43
- return f(() => {
44
- const r = e.subscribe((i) => {
45
- i?.summary?.points && l(i.summary.points);
46
- });
47
- return () => {
48
- r();
49
- };
50
- }, [e]), /* @__PURE__ */ t(B, { points: a, onClick: () => {
51
- const r = s.status.get();
52
- r === m.Suspended ? (s.openFeature(), n.emit("app", {
53
- action: "open",
54
- payload: {}
55
- }), n.emit("interactions", {
56
- action: "tap",
57
- payload: {}
58
- })) : r === m.Ready && (s.closeFeature(!1), n.emit("app", {
59
- action: "close",
60
- payload: {}
61
- }), n.emit("interactions", {
62
- action: "tap",
63
- payload: {}
64
- }));
65
- } });
66
- }, $ = ({ sdk: s }) => {
67
- if (!h(s.featuresList.getStore()))
68
- return null;
69
- const e = s.getFeature(v.GAMES);
70
- return e ? /* @__PURE__ */ t(C, { gamification: e }) : null;
71
- }, O = ({ theme: s }) => {
72
- const e = g(), a = A();
73
- return e ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(u, { customTheme: s ?? a.theme, themeMode: a.themeMode, children: /* @__PURE__ */ t($, { sdk: e }) }) }) : null;
74
- };
75
- export {
76
- O as StreamLayerSDKPoints
77
- };