@streamlayer/react-ui 1.19.1 → 1.20.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.
- package/lib/app/app/Advertisement/index.js +74 -72
- package/lib/app/app/Points/index.js +21 -14
- package/lib/app/app/index.js +79 -89
- package/lib/app/app/useApp.d.ts +2 -1
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.js +10 -9
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +22 -18
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +7 -7
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.d.ts +2 -1
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.js +31 -22
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +11 -11
- package/lib/app/masters/BetPack/BetPackContent/index.js +45 -37
- package/lib/app/masters/BetPack/BetPackOverlay/index.d.ts +1 -1
- package/lib/app/masters/BetPack/index.js +80 -77
- package/lib/app/masters/Points/index.js +24 -18
- package/lib/app/masters/masters.js +75 -87
- package/lib/app/masters/useSdkResponsive.d.ts +2 -0
- package/lib/app/masters/useSdkResponsive.js +3 -1
- package/lib/app/masters/useSdkScroll.js +1 -1
- package/lib/app/useSdkResponsive.js +1 -1
- package/lib/app/useSdkScroll.js +1 -1
- package/lib/assets/style.css +1 -1
- package/lib/hooks/analytics.js +17 -42
- package/lib/index-CLJzLXks.js +64 -0
- package/lib/reset.css +1 -1
- package/lib/ui/advertisement/notification/index.js +8 -8
- package/lib/ui/advertisement/overlay/externalAd/index.js +40306 -94
- package/lib/ui/close-btn/index.d.ts +2 -0
- package/lib/ui/close-btn/index.js +40 -32
- package/lib/ui/gamification/question/inapp/prediction-result/frames/content.js +48 -33
- package/lib/ui/gamification/vote/feedback/index.js +30 -30
- package/lib/ui/gamification/vote/vote-option/index.js +51 -53
- package/lib/ui/icons/index.d.ts +3 -0
- package/lib/ui/icons/index.js +75 -54
- package/lib/ui/modal/index.js +36 -32
- package/lib/ui/show-in/index.js +26 -26
- package/lib/ui/theme/masters-theme.js +12 -4
- package/lib/ui/theme/theme.js +9 -5
- package/package.json +22 -16
- package/lib/index-BEm7B1u1.js +0 -72
package/lib/hooks/analytics.js
CHANGED
|
@@ -1,50 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
t instanceof HTMLAnchorElement && t.target === "_blank" && t.getAttribute("data-analytics") === "web-link" && c.emit("poll", {
|
|
1
|
+
import { useEffect as c } from "react";
|
|
2
|
+
import { eventBus as i } from "@streamlayer/sdk-web-interfaces";
|
|
3
|
+
import { BREAKPOINTS as s } from "../ui/theme/constants.js";
|
|
4
|
+
const f = (t) => [(r) => (...n) => (t && i.emit(t == null ? void 0 : t.type, t), r ? r(n) : null)], v = (t) => {
|
|
5
|
+
const e = t.target;
|
|
6
|
+
e instanceof HTMLAnchorElement && e.target === "_blank" && e.getAttribute("data-analytics") === "web-link" && i.emit("poll", {
|
|
8
7
|
action: "navigated",
|
|
9
8
|
payload: {}
|
|
10
9
|
});
|
|
11
|
-
}, y =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
c.emit("interactions", {
|
|
19
|
-
action: "scroll",
|
|
20
|
-
payload: {}
|
|
21
|
-
});
|
|
22
|
-
}, 5e3), w = s((e, t) => {
|
|
23
|
-
var n;
|
|
24
|
-
if (e.target instanceof Document) {
|
|
25
|
-
const r = (n = t.current) == null ? void 0 : n.getBoundingClientRect(), a = r && r.top < 0 && r.bottom > window.innerHeight;
|
|
26
|
-
if (r && !a)
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
c.emit("interactions", {
|
|
30
|
-
action: "tap",
|
|
31
|
-
payload: {}
|
|
32
|
-
});
|
|
33
|
-
}, 5e3), L = (e, t) => {
|
|
34
|
-
const i = window.innerWidth < o.xl;
|
|
35
|
-
l(() => {
|
|
36
|
-
const n = i && t.useDomNode ? document : e.current, r = (a) => {
|
|
37
|
-
t.listener(a, e);
|
|
10
|
+
}, y = (t, e) => {
|
|
11
|
+
const r = window.innerWidth < s.xl;
|
|
12
|
+
c(() => {
|
|
13
|
+
const n = r && e.useDomNode ? document : t.current, a = (l) => {
|
|
14
|
+
e.listener(l, t);
|
|
38
15
|
};
|
|
39
|
-
return
|
|
40
|
-
n == null || n.removeEventListener(
|
|
16
|
+
return e.enabled && (n == null || n.addEventListener(e.event, a)), () => {
|
|
17
|
+
n == null || n.removeEventListener(e.event, a);
|
|
41
18
|
};
|
|
42
|
-
}, [
|
|
19
|
+
}, [r, e.enabled, e.listener]);
|
|
43
20
|
};
|
|
44
21
|
export {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
g as useAnalyticsHandle,
|
|
49
|
-
L as useAnalyticsListener
|
|
22
|
+
v as newTabLinkListener,
|
|
23
|
+
f as useAnalyticsHandle,
|
|
24
|
+
y as useAnalyticsListener
|
|
50
25
|
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
let u = [], i = 0;
|
|
2
|
+
const a = 4;
|
|
3
|
+
let s = (o) => {
|
|
4
|
+
let l = [], e = {
|
|
5
|
+
get() {
|
|
6
|
+
return e.lc || e.listen(() => {
|
|
7
|
+
})(), e.value;
|
|
8
|
+
},
|
|
9
|
+
lc: 0,
|
|
10
|
+
listen(t) {
|
|
11
|
+
return e.lc = l.push(t), () => {
|
|
12
|
+
for (let f = i + a; f < u.length; )
|
|
13
|
+
u[f] === t ? u.splice(f, a) : f += a;
|
|
14
|
+
let n = l.indexOf(t);
|
|
15
|
+
~n && (l.splice(n, 1), --e.lc || e.off());
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
notify(t, n) {
|
|
19
|
+
let f = !u.length;
|
|
20
|
+
for (let r of l)
|
|
21
|
+
u.push(
|
|
22
|
+
r,
|
|
23
|
+
e.value,
|
|
24
|
+
t,
|
|
25
|
+
n
|
|
26
|
+
);
|
|
27
|
+
if (f) {
|
|
28
|
+
for (i = 0; i < u.length; i += a)
|
|
29
|
+
u[i](
|
|
30
|
+
u[i + 1],
|
|
31
|
+
u[i + 2],
|
|
32
|
+
u[i + 3]
|
|
33
|
+
);
|
|
34
|
+
u.length = 0;
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
/* It will be called on last listener unsubscribing.
|
|
38
|
+
We will redefine it in onMount and onStop. */
|
|
39
|
+
off() {
|
|
40
|
+
},
|
|
41
|
+
set(t) {
|
|
42
|
+
let n = e.value;
|
|
43
|
+
n !== t && (e.value = t, e.notify(n));
|
|
44
|
+
},
|
|
45
|
+
subscribe(t) {
|
|
46
|
+
let n = e.listen(t);
|
|
47
|
+
return t(e.value), n;
|
|
48
|
+
},
|
|
49
|
+
value: o
|
|
50
|
+
};
|
|
51
|
+
return e;
|
|
52
|
+
}, v = (o = {}) => {
|
|
53
|
+
let l = s(o);
|
|
54
|
+
return l.setKey = function(e, t) {
|
|
55
|
+
let n = l.value;
|
|
56
|
+
typeof t > "u" && e in l.value ? (l.value = { ...l.value }, delete l.value[e], l.notify(n, e)) : l.value[e] !== t && (l.value = {
|
|
57
|
+
...l.value,
|
|
58
|
+
[e]: t
|
|
59
|
+
}, l.notify(n, e));
|
|
60
|
+
}, l;
|
|
61
|
+
};
|
|
62
|
+
export {
|
|
63
|
+
v as m
|
|
64
|
+
};
|
package/lib/reset.css
CHANGED
|
@@ -2,10 +2,10 @@ import { jsx as i, jsxs as d } from "react/jsx-runtime";
|
|
|
2
2
|
import { NotificationPromotionImagePosition as r, NotificationEnabled as T, NotificationPromotionMode as h, NotificationSponsorLogoMode as C, CtaIconMode as O } from "@streamlayer/sdk-web-types";
|
|
3
3
|
import { SlideIn as f } from "../../slide-in/index.js";
|
|
4
4
|
import { LowerThirdNotification as E } from "./lower-third/index.js";
|
|
5
|
-
import { MediaImgFit as
|
|
5
|
+
import { MediaImgFit as I, MediaImgCentered as L, MediaImgBottom as S, MediaImgSolid as _, MediaImgMiddle as R, NotificationContainer as P, Logo as b, NotificationContent as A, Body as D, Title as x, Text as y, Button as F, CtaIcon as j, StyledChevronRight as k } from "./styles.js";
|
|
6
6
|
const v = {
|
|
7
|
-
[r.UNSET]:
|
|
8
|
-
[r.FIT]:
|
|
7
|
+
[r.UNSET]: I,
|
|
8
|
+
[r.FIT]: I,
|
|
9
9
|
[r.CENTERED]: L,
|
|
10
10
|
[r.BOTTOM]: S,
|
|
11
11
|
[r.SOLID]: _,
|
|
@@ -13,16 +13,16 @@ const v = {
|
|
|
13
13
|
}, w = ({ src: e, imagePosition: n }) => {
|
|
14
14
|
const m = v[n];
|
|
15
15
|
return /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i("img", { src: e, alt: "" }) });
|
|
16
|
-
}, z = ({ notification: e, open: n, promotionId: m, hiding:
|
|
16
|
+
}, z = ({ notification: e, open: n, promotionId: m, hiding: N, direction: a = "left" }) => {
|
|
17
17
|
if (!e || !e.promotion || e.enabled !== T.NOTIFICATION_ENABLED)
|
|
18
18
|
return null;
|
|
19
19
|
if (e.promotion.mode === h.LOWER_THIRD)
|
|
20
20
|
return /* @__PURE__ */ i(E, { notification: e, open: n });
|
|
21
|
-
const { title: t, body: l, image:
|
|
22
|
-
return /* @__PURE__ */ i(f, { className: "SL_Rich_Notification", direction:
|
|
23
|
-
p !== C.NOTIFICATION_SPONSOR_LOGO_NONE && /* @__PURE__ */ i(b, { children: /* @__PURE__ */ i("img", { src:
|
|
21
|
+
const { title: t, body: l, image: s, promotion: g } = e, { sponsorLogo: c, sponsorLogoMode: p, imagePosition: M, ctaButton: o } = g;
|
|
22
|
+
return /* @__PURE__ */ i(f, { className: "SL_Rich_Notification", direction: a, hiding: N, children: /* @__PURE__ */ d(P, { onClick: n, children: [
|
|
23
|
+
p !== C.NOTIFICATION_SPONSOR_LOGO_NONE && c && /* @__PURE__ */ i(b, { children: /* @__PURE__ */ i("img", { src: c, alt: t }) }),
|
|
24
24
|
/* @__PURE__ */ d(A, { children: [
|
|
25
|
-
/* @__PURE__ */ i(w, { src:
|
|
25
|
+
/* @__PURE__ */ i(w, { src: s, imagePosition: M }),
|
|
26
26
|
/* @__PURE__ */ d(D, { children: [
|
|
27
27
|
t && /* @__PURE__ */ i(x, { children: t }),
|
|
28
28
|
l && /* @__PURE__ */ i(y, { children: l })
|