@streamlayer/react-ui 1.9.0 → 1.10.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.
Files changed (78) hide show
  1. package/lib/app/app/Advertisement/index.d.ts +1 -0
  2. package/lib/app/app/Advertisement/index.js +78 -67
  3. package/lib/app/app/Features/Gamification/Question.d.ts +1 -0
  4. package/lib/app/app/Features/Gamification/Question.js +43 -41
  5. package/lib/app/app/Features/Gamification/Tabs.js +23 -22
  6. package/lib/app/app/Features/Gamification/index.js +1 -1
  7. package/lib/app/app/Insight/index.d.ts +2 -0
  8. package/lib/app/app/Insight/index.js +28 -24
  9. package/lib/app/app/Navigation/SDKPillNode.d.ts +1 -0
  10. package/lib/app/app/Navigation/SDKPillNode.js +9 -0
  11. package/lib/app/app/Notifications/index.js +125 -113
  12. package/lib/app/app/Points/index.js +16 -16
  13. package/lib/app/app/index.d.ts +1 -0
  14. package/lib/app/app/index.js +84 -86
  15. package/lib/app/app/story/insight/index.d.ts +1 -0
  16. package/lib/app/app/story/insight/index.js +29 -26
  17. package/lib/app/app/story/insight/video.d.ts +1 -0
  18. package/lib/app/app/story/insight/video.js +13 -13
  19. package/lib/app/app/story/promotion/content.d.ts +3 -1
  20. package/lib/app/app/story/promotion/content.js +13 -10
  21. package/lib/app/app/story/promotion/index.d.ts +1 -0
  22. package/lib/app/app/story/promotion/index.js +34 -30
  23. package/lib/app/app/story/promotion/video.d.ts +1 -0
  24. package/lib/app/app/story/promotion/video.js +34 -31
  25. package/lib/app/app/styles.js +44 -0
  26. package/lib/app/app/useApp.d.ts +0 -14
  27. package/lib/app/app/useApp.js +14 -44
  28. package/lib/app/masters/Features/Gamification/Leaderboard.d.ts +1 -1
  29. package/lib/app/masters/Features/Gamification/Tabs.d.ts +2 -2
  30. package/lib/app/masters/Features/Gamification/Tabs.js +2 -2
  31. package/lib/app/masters/Features/Gamification/index.d.ts +2 -2
  32. package/lib/app/masters/Features/Gamification/index.js +1 -1
  33. package/lib/app/masters/Features/index.d.ts +2 -2
  34. package/lib/app/masters/Navigation/MastersNavigation/index.d.ts +1 -1
  35. package/lib/app/masters/Notifications/Onboarding/index.d.ts +1 -1
  36. package/lib/app/masters/Notifications/Onboarding/index.js +4 -4
  37. package/lib/app/masters/Notifications/index.d.ts +2 -2
  38. package/lib/app/masters/Notifications/index.js +1 -1
  39. package/lib/app/masters/masters.js +23 -23
  40. package/lib/app/masters/styles.d.ts +20 -0
  41. package/lib/app/{styles.js → masters/styles.js} +15 -15
  42. package/lib/app/masters/useSdkResponsive.d.ts +15 -0
  43. package/lib/app/masters/useSdkResponsive.js +45 -0
  44. package/lib/app/masters/useSdkScroll.d.ts +12 -0
  45. package/lib/app/masters/useSdkScroll.js +50 -0
  46. package/lib/app/useSdkResponsive.d.ts +1 -0
  47. package/lib/app/useSdkResponsive.js +27 -29
  48. package/lib/app/useSdkScroll.js +25 -24
  49. package/lib/assets/style.css +1 -1
  50. package/lib/ui/advertisement/banner/index.js +14 -11
  51. package/lib/ui/advertisement/index.d.ts +3 -0
  52. package/lib/ui/advertisement/index.js +31 -10
  53. package/lib/ui/advertisement/notification/index.d.ts +1 -0
  54. package/lib/ui/advertisement/notification/index.js +30 -27
  55. package/lib/ui/advertisement/notification/lower-third/index.d.ts +9 -0
  56. package/lib/ui/advertisement/notification/lower-third/index.js +37 -0
  57. package/lib/ui/advertisement/notification/lower-third/styles.d.ts +16 -0
  58. package/lib/ui/advertisement/notification/lower-third/styles.js +64 -0
  59. package/lib/ui/advertisement/overlay/index.d.ts +2 -0
  60. package/lib/ui/advertisement/overlay/index.js +58 -43
  61. package/lib/ui/advertisement/overlay/styles.d.ts +0 -2
  62. package/lib/ui/advertisement/overlay/styles.js +41 -52
  63. package/lib/ui/close-btn/index.d.ts +7 -0
  64. package/lib/ui/close-btn/index.js +47 -0
  65. package/lib/ui/gamification/detail/header/index.d.ts +2 -1
  66. package/lib/ui/gamification/detail/header/index.js +16 -15
  67. package/lib/ui/gamification/vote/styles.js +1 -1
  68. package/lib/ui/questions/insight/index.js +21 -20
  69. package/lib/ui/theme/masters-theme.js +36 -13
  70. package/lib/ui/theme/theme.js +22 -21
  71. package/lib/ui/timer/index.d.ts +3 -1
  72. package/lib/ui/timer/index.js +54 -32
  73. package/lib/ui/video-player/index.d.ts +2 -0
  74. package/lib/ui/video-player/index.js +62 -51
  75. package/lib/ui/video-player/styles.d.ts +1 -0
  76. package/lib/ui/video-player/styles.js +7 -6
  77. package/package.json +15 -15
  78. /package/lib/app/{styles.d.ts → app/styles.d.ts} +0 -0
@@ -1,25 +1,25 @@
1
1
  import { jsx as n, jsxs as v } from "react/jsx-runtime";
2
2
  import { useStore as C } from "@nanostores/react";
3
- import { SDKContainer as x, SDKScrollContainer as A } from "../styles.js";
4
- import { useSdkFeature as F } from "../useSdkFeature.js";
5
- import { useSdkResponsive as M } from "../useSdkResponsive.js";
6
- import { useSdkScroll as b } from "../useSdkScroll.js";
7
- import { useAnalyticsListener as d, newTabLinkListener as D, appScrollListener as I, appClickListener as B } from "../../hooks/analytics.js";
8
- import { useRef as S, useMemo as T, useEffect as j } from "react";
3
+ import { SDKContainer as x, SDKScrollContainer as A } from "./styles.js";
4
+ import { useSdkScroll as F } from "./useSdkScroll.js";
5
+ import { useSdkFeature as M } from "../useSdkFeature.js";
6
+ import { useAnalyticsListener as d, newTabLinkListener as b, appScrollListener as D, appClickListener as I } from "../../hooks/analytics.js";
7
+ import { useRef as S, useMemo as B, useEffect as T } from "react";
9
8
  import { resetCss as p } from "../../ui/theme/theme.js";
10
- import { ActiveFeature as k, StandaloneFeature as E } from "./Features/index.js";
11
- import { MastersNavigation as K } from "./Navigation/MastersNavigation/index.js";
12
- import { SDKNotifications as O } from "./Notifications/index.js";
13
- import { useMastersApp as R } from "./useMastersApp.js";
14
- import { MastersContext as w } from "./useMastersContext.js";
9
+ import { ActiveFeature as j, StandaloneFeature as k } from "./Features/index.js";
10
+ import { MastersNavigation as E } from "./Navigation/MastersNavigation/index.js";
11
+ import { SDKNotifications as K } from "./Notifications/index.js";
12
+ import { useMastersApp as O } from "./useMastersApp.js";
13
+ import { MastersContext as R } from "./useMastersContext.js";
14
+ import { useSdkResponsive as w } from "./useSdkResponsive.js";
15
15
  import { StreamLayerMastersThemeProvider as ce } from "../../ui/theme/masters.js";
16
16
  import { ChannelsButtonId as P } from "../../ui/navigation/button/Channels.js";
17
17
  import { LeaderBoardButtonId as G } from "../../ui/navigation/button/LeaderBoard.js";
18
18
  import { FeaturedGroupsButtonId as V } from "../../ui/navigation/button/FeaturedGroups.js";
19
19
  const W = ({ sdk: e, className: i, scrollStore: l, appNode: t, scrollNode: s, responsiveStore: o }) => {
20
- const [, r] = F(e);
20
+ const [, r] = M(e);
21
21
  return /* @__PURE__ */ n(
22
- k,
22
+ j,
23
23
  {
24
24
  className: i,
25
25
  scrollNode: s,
@@ -35,7 +35,7 @@ const W = ({ sdk: e, className: i, scrollStore: l, appNode: t, scrollNode: s, re
35
35
  return s ? Array.from(s, (o) => {
36
36
  const r = e.getFeature(o);
37
37
  return r ? /* @__PURE__ */ n(
38
- E,
38
+ k,
39
39
  {
40
40
  className: i,
41
41
  appNode: l,
@@ -47,24 +47,24 @@ const W = ({ sdk: e, className: i, scrollStore: l, appNode: t, scrollNode: s, re
47
47
  ) : null;
48
48
  }) : null;
49
49
  }, ie = ({ sdk: e, overlays: i, children: l }) => {
50
- const t = S(null), s = S(null), [o] = M(t), [r, f] = b(t, o), { sdkEnabled: a, sdkReady: c, activeOverlay: m, activateAndLoadOverlay: h, activateEventWithId: N, deactivate: g, isLogged: y } = R(e);
51
- d(t, { enabled: a, event: "click", listener: D }), d(r, {
50
+ const t = S(null), s = S(null), [o] = w(t), [r, f] = F(t, o), { sdkEnabled: a, sdkReady: c, activeOverlay: m, activateAndLoadOverlay: h, activateEventWithId: N, deactivate: g, isLogged: y } = O(e);
51
+ d(t, { enabled: a, event: "click", listener: b }), d(r, {
52
52
  enabled: a,
53
53
  event: "scrollend",
54
- listener: I,
54
+ listener: D,
55
55
  useDomNode: !0
56
56
  }), d(r, {
57
57
  enabled: a,
58
58
  event: "click",
59
- listener: B,
59
+ listener: I,
60
60
  useDomNode: !0
61
61
  });
62
- const L = T(() => ({ sdk: e }), [e]);
63
- return j(() => {
62
+ const L = B(() => ({ sdk: e }), [e]);
63
+ return T(() => {
64
64
  import("./Features/Gamification/gamification-feature.js");
65
- }, []), /* @__PURE__ */ n(w.Provider, { value: L, children: /* @__PURE__ */ v(x, { ref: t, children: [
65
+ }, []), /* @__PURE__ */ n(R.Provider, { value: L, children: /* @__PURE__ */ v(x, { ref: t, children: [
66
66
  a && /* @__PURE__ */ n(
67
- K,
67
+ E,
68
68
  {
69
69
  ref: s,
70
70
  sdkReady: c,
@@ -80,7 +80,7 @@ const W = ({ sdk: e, className: i, scrollStore: l, appNode: t, scrollNode: s, re
80
80
  ),
81
81
  /* @__PURE__ */ v(A, { className: "sl-hide-on-modal", ref: r, "data-nav": a.toString(), children: [
82
82
  c && /* @__PURE__ */ n(
83
- O,
83
+ K,
84
84
  {
85
85
  sdk: e,
86
86
  scrollNode: r,
@@ -0,0 +1,20 @@
1
+ export declare const SDKContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
2
+ export declare const SDKScrollContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
+ export declare const SDKContentContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
+ export declare const SDKWhiteContainer: {
5
+ __wyw_meta: unknown;
6
+ } & import('react').FunctionComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
7
+ as?: React.ElementType;
8
+ }>;
9
+ export declare const TabsContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
10
+ export declare const LeaderboardContainer: {
11
+ __wyw_meta: unknown;
12
+ } & import('react').FunctionComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
13
+ as?: React.ElementType;
14
+ }>;
15
+ export declare const TabsNavContainer: {
16
+ __wyw_meta: unknown;
17
+ } & import('react').FunctionComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
18
+ as?: React.ElementType;
19
+ }>;
20
+ export declare const UserSummaryContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
@@ -1,44 +1,44 @@
1
1
  import { styled as s } from "@linaria/react";
2
2
  const i = /* @__PURE__ */ s("div")({
3
3
  name: "SDKContainer",
4
- class: "s2j5adf",
4
+ class: "s8zgqze",
5
5
  propsAsIs: !1
6
- }), c = /* @__PURE__ */ s("div")({
6
+ }), p = /* @__PURE__ */ s("div")({
7
7
  name: "SDKScrollContainer",
8
- class: "st9ayqn",
8
+ class: "s6t897k",
9
9
  propsAsIs: !1
10
10
  }), a = /* @__PURE__ */ s("div")({
11
11
  name: "SDKContentContainer",
12
- class: "s6rlym7",
12
+ class: "sw7pkvp",
13
13
  propsAsIs: !1
14
14
  }), e = () => a, n = /* @__PURE__ */ s(e())({
15
15
  name: "SDKWhiteContainer",
16
- class: "s1trfff0",
16
+ class: "s14gkn7u",
17
17
  propsAsIs: !0
18
- }), l = /* @__PURE__ */ s("div")({
18
+ }), c = /* @__PURE__ */ s("div")({
19
19
  name: "TabsContainer",
20
- class: "t87r8je",
20
+ class: "t1yxstm9",
21
21
  propsAsIs: !1
22
- }), o = () => n, p = /* @__PURE__ */ s(o())({
22
+ }), o = () => n, l = /* @__PURE__ */ s(o())({
23
23
  name: "LeaderboardContainer",
24
- class: "l1aiq1lq",
24
+ class: "ldpty1s",
25
25
  propsAsIs: !0
26
- }), r = () => n, C = /* @__PURE__ */ s(r())({
26
+ }), t = () => n, C = /* @__PURE__ */ s(t())({
27
27
  name: "TabsNavContainer",
28
- class: "t1o5m8d1",
28
+ class: "t136a59y",
29
29
  propsAsIs: !0
30
30
  }), m = /* @__PURE__ */ s("div")({
31
31
  name: "UserSummaryContainer",
32
- class: "uqh0y7s",
32
+ class: "u11vnm9m",
33
33
  propsAsIs: !1
34
34
  });
35
35
  export {
36
- p as LeaderboardContainer,
36
+ l as LeaderboardContainer,
37
37
  i as SDKContainer,
38
38
  a as SDKContentContainer,
39
- c as SDKScrollContainer,
39
+ p as SDKScrollContainer,
40
40
  n as SDKWhiteContainer,
41
- l as TabsContainer,
41
+ c as TabsContainer,
42
42
  C as TabsNavContainer,
43
43
  m as UserSummaryContainer
44
44
  };
@@ -0,0 +1,15 @@
1
+ import { AppNodeRef } from '..';
2
+ import { MapStore } from 'nanostores';
3
+ import { BREAKPOINTS } from '../../ui/theme/constants';
4
+ type BREAKPOINTS_KEYS = keyof typeof BREAKPOINTS;
5
+ type ResponsiveData = {
6
+ screen: {
7
+ name: BREAKPOINTS_KEYS;
8
+ size: (typeof BREAKPOINTS)[BREAKPOINTS_KEYS];
9
+ };
10
+ sdkInView: boolean;
11
+ sdkInDesktopView: boolean;
12
+ };
13
+ export type ResponsiveStore = MapStore<ResponsiveData>;
14
+ export declare const useSdkResponsive: (appNode: AppNodeRef) => [ResponsiveStore];
15
+ export {};
@@ -0,0 +1,45 @@
1
+ import c from "lodash.throttle";
2
+ import { useState as m, useEffect as u } from "react";
3
+ import { BREAKPOINTS as r } from "../../ui/theme/constants.js";
4
+ import { m as l } from "../../index-CZvwzN5o.js";
5
+ const d = Object.keys(r), i = () => {
6
+ const n = window.innerWidth;
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]) {
11
+ e = s;
12
+ break;
13
+ }
14
+ }
15
+ return {
16
+ name: e,
17
+ size: r[e]
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.xl, v = (n) => {
23
+ const [e] = m(() => {
24
+ const t = i();
25
+ return l({
26
+ screen: i(),
27
+ sdkInView: w(n),
28
+ sdkInDesktopView: k(t.size)
29
+ });
30
+ });
31
+ return u(() => {
32
+ const t = c(() => {
33
+ e.setKey("sdkInView", w(n));
34
+ }, 200), s = c(() => {
35
+ const o = i();
36
+ e.setKey("screen", o), e.setKey("sdkInDesktopView", k(o.size));
37
+ }, 200);
38
+ return window.addEventListener("scroll", t), window.addEventListener("resize", s), () => {
39
+ window.removeEventListener("scroll", t), window.removeEventListener("resize", s);
40
+ };
41
+ }, [e, n]), [e];
42
+ };
43
+ export {
44
+ v as useSdkResponsive
45
+ };
@@ -0,0 +1,12 @@
1
+ import { ScrollNodeRef, AppNodeRef } from '..';
2
+ import { MapStore } from 'nanostores';
3
+ import { ResponsiveStore } from './useSdkResponsive';
4
+ type ScrollData = {
5
+ scrollPosition: number;
6
+ tabsShown?: boolean;
7
+ scrollDirection: 'forward' | 'backward';
8
+ };
9
+ export type ScrollStore = MapStore<ScrollData>;
10
+ export declare const scrollIntoAppView: (appNode: AppNodeRef, screenSize: number, options?: ScrollIntoViewOptions) => void;
11
+ export declare const useSdkScroll: (appNode: AppNodeRef, responsiveStore: ResponsiveStore) => [ScrollNodeRef, ScrollStore];
12
+ export {};
@@ -0,0 +1,50 @@
1
+ import { useStore as S } from "@nanostores/react";
2
+ import h from "lodash.throttle";
3
+ import { useRef as m, useState as b, useEffect as g } from "react";
4
+ import { BREAKPOINTS as c } from "../../ui/theme/constants.js";
5
+ import { m as v } from "../../index-CZvwzN5o.js";
6
+ const C = (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
11
+ });
12
+ }, T = 15, D = (o, e) => {
13
+ const n = m(null), t = m(0), [s] = b(
14
+ v({
15
+ scrollPosition: 0,
16
+ tabsShown: !0,
17
+ scrollDirection: "forward"
18
+ })
19
+ ), i = S(e);
20
+ return g(() => {
21
+ const l = window.innerWidth < c.xl ? window : n.current;
22
+ if (!l)
23
+ return () => {
24
+ };
25
+ const f = h((d) => {
26
+ var a;
27
+ const u = d.target;
28
+ if (!u)
29
+ return;
30
+ let r = 0;
31
+ i.screen.size < c.xl ? 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))
34
+ return;
35
+ const p = t.current < r ? "forward" : "backward";
36
+ t.current = r, s.set({
37
+ scrollPosition: Math.round(r),
38
+ scrollDirection: p,
39
+ tabsShown: s.get().tabsShown
40
+ });
41
+ }, 200);
42
+ return l.addEventListener("scroll", f), () => {
43
+ l.removeEventListener("scroll", f);
44
+ };
45
+ }, [s, o, i.screen]), [n, s];
46
+ };
47
+ export {
48
+ C as scrollIntoAppView,
49
+ D as useSdkScroll
50
+ };
@@ -10,6 +10,7 @@ type ResponsiveData = {
10
10
  sdkInView: boolean;
11
11
  sdkInDesktopView: boolean;
12
12
  };
13
+ export declare const checkSdkInDesktopView: () => boolean;
13
14
  export type ResponsiveStore = MapStore<ResponsiveData>;
14
15
  export declare const useSdkResponsive: (appNode: AppNodeRef) => [ResponsiveStore];
15
16
  export {};
@@ -1,13 +1,13 @@
1
- import c from "lodash.throttle";
2
- import { useState as m, useEffect as u } from "react";
1
+ import i from "lodash.throttle";
2
+ import { useState as m, useEffect as a } from "react";
3
3
  import { BREAKPOINTS as r } from "../ui/theme/constants.js";
4
- import { m as l } from "../index-CZvwzN5o.js";
5
- const d = Object.keys(r), i = () => {
6
- const n = window.innerWidth;
4
+ import { m as u } from "../index-CZvwzN5o.js";
5
+ const o = Object.keys(r), c = () => {
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 = o.length - 1; n > 0; n--) {
9
+ const s = o[n];
10
+ if (!(t < r[s]) && t >= r[s]) {
11
11
  e = s;
12
12
  break;
13
13
  }
@@ -16,30 +16,28 @@ const d = Object.keys(r), i = () => {
16
16
  name: e,
17
17
  size: r[e]
18
18
  };
19
- }, w = (n) => {
19
+ }, d = (t) => {
20
20
  var e;
21
- return (((e = n.current) == null ? void 0 : e.getBoundingClientRect().y) || 0) < -68;
22
- }, k = (n) => n >= r.xl, v = (n) => {
23
- const [e] = m(() => {
24
- const t = i();
25
- return l({
26
- screen: i(),
27
- sdkInView: w(n),
28
- sdkInDesktopView: k(t.size)
29
- });
30
- });
31
- return u(() => {
32
- const t = c(() => {
33
- e.setKey("sdkInView", w(n));
34
- }, 200), s = c(() => {
35
- const o = i();
36
- e.setKey("screen", o), e.setKey("sdkInDesktopView", k(o.size));
21
+ return (((e = t.current) == null ? void 0 : e.getBoundingClientRect().y) || 0) < -68;
22
+ }, w = () => window.matchMedia("(orientation: landscape)").matches, h = (t) => {
23
+ const [e] = m(() => u({
24
+ screen: c(),
25
+ sdkInView: d(t),
26
+ sdkInDesktopView: w()
27
+ }));
28
+ return a(() => {
29
+ const n = i(() => {
30
+ e.setKey("sdkInView", d(t));
31
+ }, 200), s = i(() => {
32
+ const k = c();
33
+ e.setKey("screen", k), e.setKey("sdkInDesktopView", w());
37
34
  }, 200);
38
- return window.addEventListener("scroll", t), window.addEventListener("resize", s), () => {
39
- window.removeEventListener("scroll", t), window.removeEventListener("resize", s);
35
+ return window.addEventListener("scroll", n), window.addEventListener("resize", s), () => {
36
+ window.removeEventListener("scroll", n), window.removeEventListener("resize", s);
40
37
  };
41
- }, [e, n]), [e];
38
+ }, [e, t]), [e];
42
39
  };
43
40
  export {
44
- v as useSdkResponsive
41
+ w as checkSdkInDesktopView,
42
+ h as useSdkResponsive
45
43
  };
@@ -1,50 +1,51 @@
1
- import { useStore as S } from "@nanostores/react";
2
- import h from "lodash.throttle";
3
- import { useRef as m, useState as b, useEffect as g } from "react";
4
- import { BREAKPOINTS as c } from "../ui/theme/constants.js";
1
+ import { useStore as h } from "@nanostores/react";
2
+ import b from "lodash.throttle";
3
+ import { useRef as u, useState as g, useEffect as k } from "react";
4
+ import { BREAKPOINTS as a } from "../ui/theme/constants.js";
5
+ import { checkSdkInDesktopView as m } from "./useSdkResponsive.js";
5
6
  import { m as v } from "../index-CZvwzN5o.js";
6
- const C = (o, e, n) => {
7
- const t = e >= c.lg && e < c.xl ? 75 : 52;
7
+ const I = (o, e, n) => {
8
+ const t = e >= a.lg && e < a.xl ? 75 : 52;
8
9
  o.current && window.scrollTo({
9
10
  top: o.current.offsetTop - t,
10
11
  ...n
11
12
  });
12
- }, T = 15, D = (o, e) => {
13
- const n = m(null), t = m(0), [s] = b(
13
+ }, T = 15, L = (o, e) => {
14
+ const n = u(null), t = u(0), [s] = g(
14
15
  v({
15
16
  scrollPosition: 0,
16
17
  tabsShown: !0,
17
18
  scrollDirection: "forward"
18
19
  })
19
- ), i = S(e);
20
- return g(() => {
21
- const l = window.innerWidth < c.xl ? window : n.current;
22
- if (!l)
20
+ ), d = h(e);
21
+ return k(() => {
22
+ const c = m() ? n.current : window;
23
+ if (!c)
23
24
  return () => {
24
25
  };
25
- const f = h((d) => {
26
- var a;
27
- const u = d.target;
28
- if (!u)
26
+ const l = b((p) => {
27
+ var f;
28
+ const i = p.target;
29
+ if (!i)
29
30
  return;
30
31
  let r = 0;
31
- i.screen.size < c.xl ? r = ((a = o.current) == null ? void 0 : a.getBoundingClientRect().y) || 0 : r = u.scrollTop;
32
+ m() ? r = i.scrollTop : r = ((f = o.current) == null ? void 0 : f.getBoundingClientRect().y) || 0;
32
33
  const w = t.current - r;
33
34
  if (T > Math.abs(w))
34
35
  return;
35
- const p = t.current < r ? "forward" : "backward";
36
+ const S = t.current < r ? "forward" : "backward";
36
37
  t.current = r, s.set({
37
38
  scrollPosition: Math.round(r),
38
- scrollDirection: p,
39
+ scrollDirection: S,
39
40
  tabsShown: s.get().tabsShown
40
41
  });
41
42
  }, 200);
42
- return l.addEventListener("scroll", f), () => {
43
- l.removeEventListener("scroll", f);
43
+ return c.addEventListener("scroll", l), () => {
44
+ c.removeEventListener("scroll", l);
44
45
  };
45
- }, [s, o, i.screen]), [n, s];
46
+ }, [s, o, d.screen]), [n, s];
46
47
  };
47
48
  export {
48
- C as scrollIntoAppView,
49
- D as useSdkScroll
49
+ I as scrollIntoAppView,
50
+ L as useSdkScroll
50
51
  };