@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.
Files changed (33) hide show
  1. package/lib/app/masters/Features/Gamification/index.d.ts +1 -0
  2. package/lib/app/masters/Features/Gamification/index.js +36 -30
  3. package/lib/app/masters/Features/index.d.ts +1 -0
  4. package/lib/app/masters/Features/index.js +13 -12
  5. package/lib/app/masters/Notifications/index.d.ts +1 -0
  6. package/lib/app/masters/Notifications/index.js +97 -94
  7. package/lib/app/masters/Points/index.js +16 -25
  8. package/lib/app/masters/masters.d.ts +1 -0
  9. package/lib/app/masters/masters.js +71 -60
  10. package/lib/app/masters/story/index.d.ts +0 -1
  11. package/lib/app/masters/story/index.js +25 -37
  12. package/lib/app/masters/styles.d.ts +1 -0
  13. package/lib/app/masters/styles.js +16 -15
  14. package/lib/app/masters/useSdkResponsive.js +20 -19
  15. package/lib/app/masters/useSdkScroll.d.ts +1 -1
  16. package/lib/app/masters/useSdkScroll.js +33 -33
  17. package/lib/assets/style.css +1 -1
  18. package/lib/ui/advertisement/overlay/externalAd/index.js +49 -41
  19. package/lib/ui/advertisement/overlay/externalAd/styles.d.ts +11 -2
  20. package/lib/ui/advertisement/overlay/externalAd/styles.js +55 -38
  21. package/lib/ui/gamification/question/notification/prediction-result/index.js +43 -43
  22. package/lib/ui/modal/index.d.ts +1 -0
  23. package/lib/ui/modal/index.js +36 -31
  24. package/lib/ui/questions/insight/index.js +24 -16
  25. package/lib/ui/questions/insight/styles.d.ts +1 -0
  26. package/lib/ui/questions/insight/styles.js +14 -13
  27. package/lib/ui/theme/constants.d.ts +2 -0
  28. package/lib/ui/theme/constants.js +6 -4
  29. package/lib/ui/theme/masters-theme.js +6 -2
  30. package/lib/ui/theme/theme.js +3 -0
  31. package/lib/ui/video-player/index.d.ts +1 -0
  32. package/lib/ui/video-player/index.js +29 -28
  33. package/package.json +15 -15
@@ -1,52 +1,40 @@
1
- import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
- import { MastersStreamLayerProvider as d, useStreamLayer as c } from "@streamlayer/react/masters";
3
- import { MastersApp as s } from "../masters.js";
4
- import { StreamLayerMastersThemeProvider as p } from "../../../ui/theme/masters.js";
5
- import { useStreamLayerDebug as m, StreamLayerDebug as h } from "../../../utils/debug/index.js";
6
- import { MastersLogin as u, MobileHeader as y, HostAppContent as i, Body as k, Video as v, Container as L, AppContainer as T, BackToTop as f, BackToTopLink as C } from "./components.js";
7
- const S = ({ betPack: n }) => {
8
- const o = c();
9
- return o ? /* @__PURE__ */ e(p, { style: { height: "100%" }, children: /* @__PURE__ */ e(s, { sdk: o, betPack: n }) }) : null;
10
- }, a = () => {
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
- }, l = () => {
12
+ }, f = () => {
13
13
  console.log("video player handled cb");
14
- }, K = ({ settings: n, betPack: o }) => {
15
- const r = m();
16
- return n ? /* @__PURE__ */ t(
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: a,
22
- videoPlayerController: l,
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(y, { children: "header" }),
38
- /* @__PURE__ */ e(i, { children: "...host app content..." }),
39
- /* @__PURE__ */ t(k, { children: [
40
- /* @__PURE__ */ e(v, {}),
41
- /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(T, { className: "StreamLayerSDK", children: /* @__PURE__ */ e(S, { betPack: o }) }) })
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(i, { children: "...host app content..." }),
44
- /* @__PURE__ */ e(f, { onClick: () => document.documentElement.scrollTop = 0, children: "BackToTop" }),
45
- /* @__PURE__ */ e(C, { href: "#", children: "BackToTop Link" })
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
- K as MastersStory
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 t = /* @__PURE__ */ s("div")({
2
+ const o = /* @__PURE__ */ s("div")({
3
3
  name: "SDKContainer",
4
4
  class: "s8zgqze",
5
5
  propsAsIs: !1
6
- }), o = /* @__PURE__ */ s("div")({
6
+ }), t = "m6t897k", r = /* @__PURE__ */ s("div")({
7
7
  name: "SDKScrollContainer",
8
- class: "s6t897k",
8
+ class: "sw7pkvp",
9
9
  propsAsIs: !1
10
10
  }), n = /* @__PURE__ */ s("div")({
11
11
  name: "SDKContentContainer",
12
- class: "sw7pkvp",
12
+ class: "s14gkn7u",
13
13
  propsAsIs: !1
14
- }), e = () => n, r = /* @__PURE__ */ s(e())({
14
+ }), e = () => n, i = /* @__PURE__ */ s(e())({
15
15
  name: "SDKWhiteContainer",
16
- class: "s14gkn7u",
16
+ class: "s1yxstm9",
17
17
  propsAsIs: !0
18
- }), i = /* @__PURE__ */ s("div")({
18
+ }), p = /* @__PURE__ */ s("div")({
19
19
  name: "TabsContainer",
20
- class: "t1yxstm9",
20
+ class: "tdpty1s",
21
21
  propsAsIs: !1
22
- }), p = /* @__PURE__ */ s("div")({
22
+ }), l = /* @__PURE__ */ s("div")({
23
23
  name: "UserSummaryContainer",
24
- class: "udpty1s",
24
+ class: "u136a59y",
25
25
  propsAsIs: !1
26
26
  });
27
27
  export {
28
- t as SDKContainer,
28
+ o as SDKContainer,
29
29
  n as SDKContentContainer,
30
- o as SDKScrollContainer,
31
- r as SDKWhiteContainer,
32
- i as TabsContainer,
33
- p as UserSummaryContainer
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 l } from "../../index-DSi8Qgfs.js";
4
+ import { m as p } from "../../index-DSi8Qgfs.js";
5
5
  const d = Object.keys(r), i = () => {
6
- const n = window.innerWidth;
6
+ const t = window.innerWidth;
7
7
  let e = "sm";
8
- for (let t = d.length - 1; t > 0; t--) {
9
- const s = d[t];
10
- if (!(n < r[s]) && n >= r[s]) {
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 = (n) => {
20
- var e;
21
- return (((e = n.current) == null ? void 0 : e.getBoundingClientRect().y) || 0) < -68;
22
- }, k = (n) => n >= r.lg, v = (n) => {
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 t = i();
25
- return l({
25
+ const n = i();
26
+ return p({
26
27
  screen: i(),
27
- sdkInView: w(n),
28
- sdkInDesktopView: k(t.size)
28
+ sdkInView: w(t),
29
+ sdkInDesktopView: k(n.size)
29
30
  });
30
31
  });
31
32
  return u(() => {
32
- const t = c(() => {
33
- e.setKey("sdkInView", w(n));
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", t), window.addEventListener("resize", s), () => {
39
- window.removeEventListener("scroll", t), window.removeEventListener("resize", s);
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, n]), [e];
42
+ }, [e, t]), [e];
42
43
  };
43
44
  export {
44
- v as useSdkResponsive
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 S from "lodash.throttle";
2
- import { useRef as m, useState as g, useEffect as h } from "react";
3
- import { useStore as b } from "@streamlayer/react-polyfills";
4
- import { BREAKPOINTS as c } from "../../ui/theme/constants.js";
5
- import { m as v } from "../../index-DSi8Qgfs.js";
6
- const D = (o, e, n) => {
7
- const t = e >= c.lg && e < c.xl ? 75 : 52;
8
- o.current && window.scrollTo({
9
- top: o.current.offsetTop - t,
10
- ...n
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
- }, T = 15, L = (o, e) => {
13
- const n = m(null), t = m(0), [s] = g(
14
- v({
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: !0,
16
+ tabsShown: !1,
17
17
  scrollDirection: "forward"
18
18
  })
19
- ), i = b(e);
20
- return h(() => {
21
- const l = window.innerWidth < c.lg ? window : n.current;
22
- if (!l)
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 f = S((d) => {
26
- var a;
27
- const u = d.target;
28
- if (!u)
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
- i.screen.size < c.lg ? r = ((a = o.current) == null ? void 0 : a.getBoundingClientRect().y) || 0 : r = u.scrollTop;
32
- const w = t.current - r;
33
- if (T > Math.abs(w))
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 p = t.current < r ? "forward" : "backward";
36
- t.current = r, s.set({
35
+ const S = c.current < r ? "forward" : "backward";
36
+ c.current = r, s.set({
37
37
  scrollPosition: Math.round(r),
38
- scrollDirection: p,
38
+ scrollDirection: S,
39
39
  tabsShown: s.get().tabsShown
40
40
  });
41
41
  }, 200);
42
- return l.addEventListener("scroll", f), () => {
43
- l.removeEventListener("scroll", f);
42
+ return l({ target: n }), n.addEventListener("scroll", l), () => {
43
+ n.removeEventListener("scroll", l);
44
44
  };
45
- }, [s, o, i.screen]), [n, s];
45
+ }, [s, e, a.screen, o]), [t, s];
46
46
  };
47
47
  export {
48
- D as scrollIntoAppView,
49
- L as useSdkScroll
48
+ y as scrollIntoAppView,
49
+ z as useSdkScroll
50
50
  };