@streamlayer/react 1.24.7 → 1.24.8-pre.84ab1b9

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 (50) hide show
  1. package/lib/app/advertisement.d.ts +4 -0
  2. package/lib/app/pause-ad.d.ts +17 -0
  3. package/lib/cjs/advertisement.js +1491 -1441
  4. package/lib/cjs/auth.js +80 -80
  5. package/lib/cjs/bet-pack.js +279 -242
  6. package/lib/cjs/index.js +1828 -1770
  7. package/lib/cjs/insight.js +682 -620
  8. package/lib/cjs/masters.js +1401 -1362
  9. package/lib/cjs/notification.js +292 -261
  10. package/lib/cjs/pause-ad.js +592 -362
  11. package/lib/cjs/points.js +179 -148
  12. package/lib/cjs/polymarket.js +153 -152
  13. package/lib/cjs/style.css +1 -1
  14. package/lib/cjs/useStreamLayerApp.js +142 -148
  15. package/lib/dist/cjs/index.js +1401 -1362
  16. package/lib/dist/es/index.js +1401 -1362
  17. package/lib/es/Question.js +75 -72
  18. package/lib/es/advertisement.js +9236 -8213
  19. package/lib/es/analytics.js +35 -31
  20. package/lib/es/auth.js +1 -1
  21. package/lib/es/bet-pack.js +1 -1
  22. package/lib/es/{hooks-n9ax4LRT.js → hooks-DHRXtbBc.js} +35 -33
  23. package/lib/es/{index-D8wyDNJD.js → index-BW1YFKTb.js} +35 -35
  24. package/lib/es/index.js +2 -2
  25. package/lib/es/index10.js +6 -6
  26. package/lib/es/index12.js +116 -128
  27. package/lib/es/index13.js +100 -96
  28. package/lib/es/index14.js +15 -15
  29. package/lib/es/index16.js +382 -383
  30. package/lib/es/index2.js +55 -56
  31. package/lib/es/index4.js +3 -3
  32. package/lib/es/index5.js +275 -3
  33. package/lib/es/index6.js +4 -7
  34. package/lib/es/index7.js +5 -284
  35. package/lib/es/index8.js +8 -237
  36. package/lib/es/index9.js +237 -8
  37. package/lib/es/insight.js +3 -3
  38. package/lib/es/masters.js +1 -1
  39. package/lib/es/masters2.js +29 -29
  40. package/lib/es/notification.js +28 -28
  41. package/lib/es/pause-ad.js +362 -153
  42. package/lib/es/points.js +9 -9
  43. package/lib/es/polymarket.js +40 -40
  44. package/lib/es/storage.js +18 -18
  45. package/lib/es/style.css +1 -1
  46. package/lib/es/useStreamLayerApp.js +1 -1
  47. package/lib/es/useStreamLayerApp2.js +5169 -4933
  48. package/lib/es/utils.js +86 -41
  49. package/lib/source.css +1 -1
  50. package/package.json +14 -14
package/lib/es/utils.js CHANGED
@@ -1,22 +1,63 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { useState as d, useMemo as c, useEffect as p } from "react";
3
- const u = `
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { useState as m, useMemo as l, useEffect as u } from "react";
3
+ const f = `
4
4
  .sl-hide-on-modal {
5
5
  height: 0 !important;
6
6
  opacity: 0 !important;
7
7
  overflow: hidden !important;
8
8
  transition: none;
9
9
  }
10
- `, m = ({
11
- containerId: o = "SlLayoutContainer",
12
- url: e
13
- }) => `
14
- #${o || "SlLayoutContainer"},
15
- #${o || "SlLayoutContainer"} .StreamLayerSDK>.StreamLayerSDKTheme > * {
10
+ `, g = ({
11
+ containerId: r = "SlLayoutContainer",
12
+ url: i,
13
+ isOverlay: s = !1,
14
+ hiding: e = !1
15
+ }) => {
16
+ const t = r || "SlLayoutContainer", a = e ? "fade-sl-bg-out 750ms cubic-bezier(0.66, 0, 0.34, 1) forwards" : "fade-sl-bg-in 750ms cubic-bezier(0.66, 0, 0.34, 1) forwards";
17
+ return s ? `
18
+ .PromoOverlayContainer {
19
+ position: relative;
20
+ }
21
+
22
+ .PromoOverlayContainer::before {
23
+ content: '';
24
+ display: block;
25
+ position: absolute;
26
+ inset: 0;
27
+ width: 100%;
28
+ height: 100%;
29
+ background-color: #1a1a1a;
30
+ background-size: cover !important;
31
+ background-position: center !important;
32
+ background-repeat: no-repeat !important;
33
+ background-image: ${i} !important;
34
+ z-index: 0;
35
+
36
+ opacity: ${e ? 1 : 0};
37
+ animation: ${a};
38
+ }
39
+
40
+ .PromoOverlayContainer > div {
41
+ position: relative;
42
+ z-index: 1;
43
+ }
44
+
45
+ @keyframes fade-sl-bg-in {
46
+ from { opacity: 0; }
47
+ to { opacity: 1; }
48
+ }
49
+
50
+ @keyframes fade-sl-bg-out {
51
+ from { opacity: 1; }
52
+ to { opacity: 0; }
53
+ }
54
+ ` : `
55
+ #${t},
56
+ #${t} .StreamLayerSDK>.StreamLayerSDKTheme > * {
16
57
  --color-sdk-container-bg: transparent !important;
17
58
  }
18
59
 
19
- #${o || "SlLayoutContainer"}::before {
60
+ #${t}::before {
20
61
  content: '';
21
62
  display: block;
22
63
  position: absolute;
@@ -27,50 +68,54 @@ const u = `
27
68
  background-size: cover !important;
28
69
  background-position: center !important;
29
70
  background-repeat: no-repeat !important;
30
- background-image: ${e} !important;
71
+ background-image: ${i} !important;
31
72
  z-index: 0;
32
73
 
33
- opacity: 0;
34
- animation: fade-sl-bg-in 0.3s linear forwards;
74
+ opacity: ${e ? 1 : 0};
75
+ animation: ${a};
35
76
  }
36
77
 
37
- #${o || "SlLayoutContainer"} > div {
78
+ #${t} > div {
38
79
  position: relative;
39
80
  z-index: 1;
40
81
  }
41
82
 
42
83
  @keyframes fade-sl-bg-in {
43
- from {
44
- opacity: 0;
45
- }
46
- to {
47
- opacity: 1;
48
- }
84
+ from { opacity: 0; }
85
+ to { opacity: 1; }
49
86
  }
50
87
 
51
- ${u}
52
- `, g = ({
53
- containerId: o,
54
- landscapeUrl: e,
55
- portraitUrl: r
88
+ @keyframes fade-sl-bg-out {
89
+ from { opacity: 1; }
90
+ to { opacity: 0; }
91
+ }
92
+
93
+ ${f}
94
+ `;
95
+ }, k = ({
96
+ containerId: r,
97
+ landscapeUrl: i,
98
+ portraitUrl: s,
99
+ isOverlay: e = !1,
100
+ hiding: t = !1
56
101
  }) => {
57
- const [a, i] = d(!1), t = c(() => {
58
- const n = window.innerWidth, l = window.innerHeight;
59
- return i(!1), n > l ? e : r;
60
- }, [e, r]);
61
- return p(() => {
62
- if (t) {
63
- const n = new Image();
64
- n.src = t, n.onload = function() {
65
- i(!0);
66
- };
102
+ const [a, c] = m(!1), n = l(() => {
103
+ const o = window.innerWidth, d = window.innerHeight;
104
+ return c(!1), o > d ? i : s;
105
+ }, [i, s]);
106
+ return u(() => {
107
+ if (n) {
108
+ const o = new Image();
109
+ o.onload = function() {
110
+ c(!0);
111
+ }, o.src = n;
67
112
  }
68
- }, [t]), c(() => {
69
- const n = t ? `url("${t}")` : void 0;
70
- return n && a ? /* @__PURE__ */ s("style", { children: m({ containerId: o, url: n }) }) : null;
71
- }, [o, t, a]);
113
+ }, [n]), l(() => {
114
+ const o = n ? `url("${n}")` : void 0;
115
+ return o && a ? /* @__PURE__ */ p("style", { children: g({ containerId: r, url: o, hiding: t, isOverlay: e }) }) : (console.log("bg empty", { url: o, loaded: a }), null);
116
+ }, [r, n, a, t, e]);
72
117
  };
73
118
  export {
74
- u,
75
- g as y
119
+ f,
120
+ k
76
121
  };