@streamlayer/react-ui 1.22.4 → 1.22.5
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/masters/Features/Gamification/index.d.ts +1 -0
- package/lib/app/masters/Features/Gamification/index.js +36 -30
- package/lib/app/masters/Features/index.d.ts +1 -0
- package/lib/app/masters/Features/index.js +13 -12
- package/lib/app/masters/Notifications/index.d.ts +1 -0
- package/lib/app/masters/Notifications/index.js +97 -94
- package/lib/app/masters/Points/index.js +16 -25
- package/lib/app/masters/masters.d.ts +1 -0
- package/lib/app/masters/masters.js +71 -60
- package/lib/app/masters/story/index.d.ts +0 -1
- package/lib/app/masters/story/index.js +25 -37
- package/lib/app/masters/styles.d.ts +1 -0
- package/lib/app/masters/styles.js +16 -15
- package/lib/app/masters/useSdkResponsive.js +20 -19
- package/lib/app/masters/useSdkScroll.d.ts +1 -1
- package/lib/app/masters/useSdkScroll.js +33 -33
- package/lib/assets/style.css +1 -1
- package/lib/ui/advertisement/overlay/externalAd/index.js +49 -41
- package/lib/ui/advertisement/overlay/externalAd/styles.d.ts +11 -2
- package/lib/ui/advertisement/overlay/externalAd/styles.js +55 -38
- package/lib/ui/gamification/question/notification/prediction-result/index.js +43 -43
- package/lib/ui/modal/index.d.ts +1 -0
- package/lib/ui/modal/index.js +36 -31
- package/lib/ui/questions/insight/index.js +24 -16
- package/lib/ui/questions/insight/styles.d.ts +1 -0
- package/lib/ui/questions/insight/styles.js +14 -13
- package/lib/ui/theme/constants.d.ts +2 -0
- package/lib/ui/theme/constants.js +6 -4
- package/lib/ui/theme/masters-theme.js +6 -2
- package/lib/ui/theme/theme.js +3 -0
- package/lib/ui/video-player/index.d.ts +1 -0
- package/lib/ui/video-player/index.js +29 -28
- package/package.json +15 -15
|
@@ -1,52 +1,40 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { MastersStreamLayerProvider as d, useStreamLayer as
|
|
3
|
-
import { MastersApp as
|
|
4
|
-
import { StreamLayerMastersThemeProvider as
|
|
5
|
-
import { useStreamLayerDebug as
|
|
6
|
-
import {
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
return
|
|
10
|
-
},
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { MastersStreamLayerProvider as d, useStreamLayer as i } from "@streamlayer/react/masters";
|
|
3
|
+
import { MastersApp as l } from "../masters.js";
|
|
4
|
+
import { StreamLayerMastersThemeProvider as a } from "../../../ui/theme/masters.js";
|
|
5
|
+
import { useStreamLayerDebug as c } from "../../../utils/debug/index.js";
|
|
6
|
+
import { MobileHeader as s, HostAppContent as t, Body as p, Video as h, Container as m, AppContainer as u, BackToTop as y, BackToTopLink as k } from "./components.js";
|
|
7
|
+
const T = ({ betPack: o }) => {
|
|
8
|
+
const r = i();
|
|
9
|
+
return r ? /* @__PURE__ */ e(a, { style: { height: "100%" }, children: /* @__PURE__ */ e(l, { sdk: r, betPack: o, useContainer: !0 }) }) : null;
|
|
10
|
+
}, v = () => {
|
|
11
11
|
console.log("deep link handled cb");
|
|
12
|
-
},
|
|
12
|
+
}, f = () => {
|
|
13
13
|
console.log("video player handled cb");
|
|
14
|
-
},
|
|
15
|
-
const r =
|
|
16
|
-
return
|
|
14
|
+
}, M = ({ betPack: o }) => {
|
|
15
|
+
const r = c();
|
|
16
|
+
return /* @__PURE__ */ n(
|
|
17
17
|
d,
|
|
18
18
|
{
|
|
19
19
|
sdkKey: r.sdkKey,
|
|
20
20
|
production: r.env === "production",
|
|
21
|
-
onDeepLinkHandled:
|
|
22
|
-
videoPlayerController:
|
|
23
|
-
children: [
|
|
24
|
-
/* @__PURE__ */ e(u, {}),
|
|
25
|
-
/* @__PURE__ */ e(h, { ...r, standalone: !0, hideAuth: !0 })
|
|
26
|
-
]
|
|
27
|
-
}
|
|
28
|
-
) : /* @__PURE__ */ t(
|
|
29
|
-
d,
|
|
30
|
-
{
|
|
31
|
-
sdkKey: r.sdkKey,
|
|
32
|
-
production: r.env === "production",
|
|
33
|
-
onDeepLinkHandled: a,
|
|
34
|
-
videoPlayerController: l,
|
|
21
|
+
onDeepLinkHandled: v,
|
|
22
|
+
videoPlayerController: f,
|
|
35
23
|
event: r.event,
|
|
36
24
|
children: [
|
|
37
|
-
/* @__PURE__ */ e(
|
|
38
|
-
/* @__PURE__ */ e(
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */ e(
|
|
41
|
-
/* @__PURE__ */ e(
|
|
25
|
+
/* @__PURE__ */ e(s, { children: "header" }),
|
|
26
|
+
/* @__PURE__ */ e(t, { children: "...host app content..." }),
|
|
27
|
+
/* @__PURE__ */ n(p, { children: [
|
|
28
|
+
/* @__PURE__ */ e(h, {}),
|
|
29
|
+
/* @__PURE__ */ e(m, { children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(u, { className: "StreamLayerSDK", children: /* @__PURE__ */ e(T, { betPack: o }) }) }) })
|
|
42
30
|
] }),
|
|
43
|
-
/* @__PURE__ */ e(
|
|
44
|
-
/* @__PURE__ */ e(
|
|
45
|
-
/* @__PURE__ */ e(
|
|
31
|
+
/* @__PURE__ */ e(t, { style: { height: 3e3 }, children: "...host app content..." }),
|
|
32
|
+
/* @__PURE__ */ e(y, { onClick: () => document.documentElement.scrollTop = 0, children: "BackToTop" }),
|
|
33
|
+
/* @__PURE__ */ e(k, { href: "#", children: "BackToTop Link" })
|
|
46
34
|
]
|
|
47
35
|
}
|
|
48
36
|
);
|
|
49
37
|
};
|
|
50
38
|
export {
|
|
51
|
-
|
|
39
|
+
M as MastersStory
|
|
52
40
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const SDKContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
2
|
+
export declare const mobileSdkContainer: import('@linaria/core').LinariaClassName;
|
|
2
3
|
export declare const SDKScrollContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
3
4
|
export declare const SDKContentContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
4
5
|
export declare const SDKWhiteContainer: {
|
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
|
-
const
|
|
2
|
+
const o = /* @__PURE__ */ s("div")({
|
|
3
3
|
name: "SDKContainer",
|
|
4
4
|
class: "s8zgqze",
|
|
5
5
|
propsAsIs: !1
|
|
6
|
-
}),
|
|
6
|
+
}), t = "m6t897k", r = /* @__PURE__ */ s("div")({
|
|
7
7
|
name: "SDKScrollContainer",
|
|
8
|
-
class: "
|
|
8
|
+
class: "sw7pkvp",
|
|
9
9
|
propsAsIs: !1
|
|
10
10
|
}), n = /* @__PURE__ */ s("div")({
|
|
11
11
|
name: "SDKContentContainer",
|
|
12
|
-
class: "
|
|
12
|
+
class: "s14gkn7u",
|
|
13
13
|
propsAsIs: !1
|
|
14
|
-
}), e = () => n,
|
|
14
|
+
}), e = () => n, i = /* @__PURE__ */ s(e())({
|
|
15
15
|
name: "SDKWhiteContainer",
|
|
16
|
-
class: "
|
|
16
|
+
class: "s1yxstm9",
|
|
17
17
|
propsAsIs: !0
|
|
18
|
-
}),
|
|
18
|
+
}), p = /* @__PURE__ */ s("div")({
|
|
19
19
|
name: "TabsContainer",
|
|
20
|
-
class: "
|
|
20
|
+
class: "tdpty1s",
|
|
21
21
|
propsAsIs: !1
|
|
22
|
-
}),
|
|
22
|
+
}), l = /* @__PURE__ */ s("div")({
|
|
23
23
|
name: "UserSummaryContainer",
|
|
24
|
-
class: "
|
|
24
|
+
class: "u136a59y",
|
|
25
25
|
propsAsIs: !1
|
|
26
26
|
});
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
o as SDKContainer,
|
|
29
29
|
n as SDKContentContainer,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
r as SDKScrollContainer,
|
|
31
|
+
i as SDKWhiteContainer,
|
|
32
|
+
p as TabsContainer,
|
|
33
|
+
l as UserSummaryContainer,
|
|
34
|
+
t as mobileSdkContainer
|
|
34
35
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import c from "lodash.throttle";
|
|
2
2
|
import { useState as m, useEffect as u } from "react";
|
|
3
3
|
import { BREAKPOINTS as r } from "../../ui/theme/constants.js";
|
|
4
|
-
import { m as
|
|
4
|
+
import { m as p } from "../../index-DSi8Qgfs.js";
|
|
5
5
|
const d = Object.keys(r), i = () => {
|
|
6
|
-
const
|
|
6
|
+
const t = window.innerWidth;
|
|
7
7
|
let e = "sm";
|
|
8
|
-
for (let
|
|
9
|
-
const s = d[
|
|
10
|
-
if (!(
|
|
8
|
+
for (let n = d.length - 1; n > 0; n--) {
|
|
9
|
+
const s = d[n];
|
|
10
|
+
if (!(t < r[s]) && t >= r[s]) {
|
|
11
11
|
e = s;
|
|
12
12
|
break;
|
|
13
13
|
}
|
|
@@ -16,30 +16,31 @@ const d = Object.keys(r), i = () => {
|
|
|
16
16
|
name: e,
|
|
17
17
|
size: r[e]
|
|
18
18
|
};
|
|
19
|
-
}, w = (
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
}, w = (t) => {
|
|
20
|
+
var n;
|
|
21
|
+
const e = (n = t.current) == null ? void 0 : n.getBoundingClientRect();
|
|
22
|
+
return e ? e.y > -e.height && e.y < window.innerHeight : !1;
|
|
23
|
+
}, k = (t) => t >= r.lg, h = (t) => {
|
|
23
24
|
const [e] = m(() => {
|
|
24
|
-
const
|
|
25
|
-
return
|
|
25
|
+
const n = i();
|
|
26
|
+
return p({
|
|
26
27
|
screen: i(),
|
|
27
|
-
sdkInView: w(
|
|
28
|
-
sdkInDesktopView: k(
|
|
28
|
+
sdkInView: w(t),
|
|
29
|
+
sdkInDesktopView: k(n.size)
|
|
29
30
|
});
|
|
30
31
|
});
|
|
31
32
|
return u(() => {
|
|
32
|
-
const
|
|
33
|
-
e.setKey("sdkInView", w(
|
|
33
|
+
const n = c(() => {
|
|
34
|
+
e.setKey("sdkInView", w(t));
|
|
34
35
|
}, 200), s = c(() => {
|
|
35
36
|
const o = i();
|
|
36
37
|
e.setKey("screen", o), e.setKey("sdkInDesktopView", k(o.size));
|
|
37
38
|
}, 200);
|
|
38
|
-
return window.addEventListener("scroll",
|
|
39
|
-
window.removeEventListener("scroll",
|
|
39
|
+
return n(), s(), window.addEventListener("scroll", n), window.addEventListener("resize", s), () => {
|
|
40
|
+
window.removeEventListener("scroll", n), window.removeEventListener("resize", s);
|
|
40
41
|
};
|
|
41
|
-
}, [e,
|
|
42
|
+
}, [e, t]), [e];
|
|
42
43
|
};
|
|
43
44
|
export {
|
|
44
|
-
|
|
45
|
+
h as useSdkResponsive
|
|
45
46
|
};
|
|
@@ -8,5 +8,5 @@ type ScrollData = {
|
|
|
8
8
|
};
|
|
9
9
|
export type ScrollStore = MapStore<ScrollData>;
|
|
10
10
|
export declare const scrollIntoAppView: (appNode: AppNodeRef, screenSize: number, options?: ScrollIntoViewOptions) => void;
|
|
11
|
-
export declare const useSdkScroll: (appNode: AppNodeRef, responsiveStore: ResponsiveStore) => [ScrollNodeRef, ScrollStore];
|
|
11
|
+
export declare const useSdkScroll: (appNode: AppNodeRef, responsiveStore: ResponsiveStore, useContainer?: boolean) => [ScrollNodeRef, ScrollStore];
|
|
12
12
|
export {};
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useRef as m, useState as
|
|
3
|
-
import { useStore as
|
|
4
|
-
import { BREAKPOINTS as
|
|
5
|
-
import { m as
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
top:
|
|
10
|
-
...
|
|
1
|
+
import g from "lodash.throttle";
|
|
2
|
+
import { useRef as m, useState as h, useEffect as b } from "react";
|
|
3
|
+
import { useStore as v } from "@streamlayer/react-polyfills";
|
|
4
|
+
import { BREAKPOINTS as d } from "../../ui/theme/constants.js";
|
|
5
|
+
import { m as E } from "../../index-DSi8Qgfs.js";
|
|
6
|
+
const y = (e, i, o) => {
|
|
7
|
+
var t;
|
|
8
|
+
(t = e.current) == null || t.scrollTo({
|
|
9
|
+
top: 0,
|
|
10
|
+
...o
|
|
11
11
|
});
|
|
12
|
-
},
|
|
13
|
-
const
|
|
14
|
-
|
|
12
|
+
}, P = 15, z = (e, i, o) => {
|
|
13
|
+
const t = m(null), c = m(0), [s] = h(
|
|
14
|
+
E({
|
|
15
15
|
scrollPosition: 0,
|
|
16
|
-
tabsShown: !
|
|
16
|
+
tabsShown: !1,
|
|
17
17
|
scrollDirection: "forward"
|
|
18
18
|
})
|
|
19
|
-
),
|
|
20
|
-
return
|
|
21
|
-
const
|
|
22
|
-
if (!
|
|
19
|
+
), a = v(i);
|
|
20
|
+
return b(() => {
|
|
21
|
+
const n = window.innerWidth < d.lg && !o ? window : t.current;
|
|
22
|
+
if (!n)
|
|
23
23
|
return () => {
|
|
24
24
|
};
|
|
25
|
-
const
|
|
26
|
-
var
|
|
27
|
-
const
|
|
28
|
-
if (!
|
|
25
|
+
const l = g((p) => {
|
|
26
|
+
var u;
|
|
27
|
+
const f = p.target;
|
|
28
|
+
if (!f)
|
|
29
29
|
return;
|
|
30
30
|
let r = 0;
|
|
31
|
-
|
|
32
|
-
const w =
|
|
33
|
-
if (
|
|
31
|
+
a.screen.size < d.lg && !o ? r = ((u = e.current) == null ? void 0 : u.getBoundingClientRect().y) || 0 : r = f.scrollTop;
|
|
32
|
+
const w = c.current - r;
|
|
33
|
+
if (P > Math.abs(w))
|
|
34
34
|
return;
|
|
35
|
-
const
|
|
36
|
-
|
|
35
|
+
const S = c.current < r ? "forward" : "backward";
|
|
36
|
+
c.current = r, s.set({
|
|
37
37
|
scrollPosition: Math.round(r),
|
|
38
|
-
scrollDirection:
|
|
38
|
+
scrollDirection: S,
|
|
39
39
|
tabsShown: s.get().tabsShown
|
|
40
40
|
});
|
|
41
41
|
}, 200);
|
|
42
|
-
return l.addEventListener("scroll",
|
|
43
|
-
|
|
42
|
+
return l({ target: n }), n.addEventListener("scroll", l), () => {
|
|
43
|
+
n.removeEventListener("scroll", l);
|
|
44
44
|
};
|
|
45
|
-
}, [s,
|
|
45
|
+
}, [s, e, a.screen, o]), [t, s];
|
|
46
46
|
};
|
|
47
47
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
y as scrollIntoAppView,
|
|
49
|
+
z as useSdkScroll
|
|
50
50
|
};
|