@streamlayer/react-ui 0.84.0 → 0.85.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 (40) hide show
  1. package/lib/assets/style.css +1 -1
  2. package/lib/index-39a0b9b6.js +1168 -0
  3. package/lib/index-ba93b6b2.js +19529 -0
  4. package/lib/styles_hxnaic-4ed993c7.js +1 -0
  5. package/lib/ui/app/Features/Gamification/Leaderboard.d.ts +3 -1
  6. package/lib/ui/app/Features/Gamification/Leaderboard.js +18 -21
  7. package/lib/ui/app/Features/Gamification/Tabs.d.ts +4 -0
  8. package/lib/ui/app/Features/Gamification/Tabs.js +40 -78
  9. package/lib/ui/app/Features/Gamification/gamification-feature.js +7 -5
  10. package/lib/ui/app/Features/Gamification/index.d.ts +4 -0
  11. package/lib/ui/app/Features/Gamification/index.js +44 -40
  12. package/lib/ui/app/Features/index.d.ts +4 -0
  13. package/lib/ui/app/Features/index.js +19 -14
  14. package/lib/ui/app/Navigation/MastersNavigation/index.js +1 -1
  15. package/lib/ui/app/Notifications/index.d.ts +4 -0
  16. package/lib/ui/app/Notifications/index.js +105 -53
  17. package/lib/ui/app/Notifications/styles.d.ts +1 -0
  18. package/lib/ui/app/Notifications/styles.js +17 -8
  19. package/lib/ui/app/masters.js +60 -47
  20. package/lib/ui/app/useMastersApp.js +1 -1
  21. package/lib/ui/app/useSdkScroll.d.ts +9 -0
  22. package/lib/ui/app/useSdkScroll.js +93 -0
  23. package/lib/ui/gamification/leaderboard/index.d.ts +1 -1
  24. package/lib/ui/gamification/leaderboard/index.js +24 -20
  25. package/lib/ui/gamification/leaderboard/static.d.ts +14 -0
  26. package/lib/ui/gamification/leaderboard/static.js +36 -0
  27. package/lib/ui/gamification/leaderboard/styles.js +3 -2
  28. package/lib/ui/gamification/question/notification/pill/index.d.ts +2 -0
  29. package/lib/ui/gamification/question/notification/pill/index.js +7 -7
  30. package/lib/ui/gamification/question/notification/prediction-result/index.d.ts +1 -1
  31. package/lib/ui/gamification/vote/index.js +22 -22
  32. package/lib/ui/gamification/vote/vote-option/index.js +18 -18
  33. package/lib/ui/gamification/vote/vote-option/styles.js +2 -2
  34. package/lib/ui/gamification/vote/win-bar/index.js +19 -19
  35. package/lib/ui/gamification/vote/win-bar/styles.js +6 -6
  36. package/lib/ui/navigation/masters.js +1 -1
  37. package/lib/ui/show-in/index.js +2 -2
  38. package/lib/ui/theme/theme.js +19 -18
  39. package/package.json +8 -6
  40. /package/lib/{masters_k70xsy-4ed993c7.js → masters_1wv7w2k-4ed993c7.js} +0 -0
@@ -1,13 +1,15 @@
1
- import { jsx as o, jsxs as h, Fragment as f } from "react/jsx-runtime";
2
- import { useStore as y } from "@nanostores/react";
3
- import { useState as d, useMemo as a, useRef as N, useCallback as l, useEffect as S } from "react";
4
- import { NotificationType as s } from "@streamlayer/sdk-web-notifications";
5
- import { Notification as c } from "../../gamification/question/notification/index.js";
6
- import { PredictionResult as O } from "../../gamification/question/notification/prediction-result/index.js";
7
- import { Onboarding as R } from "./Onboarding/index.js";
8
- import { InnerContainer as g, Container as v, NotificationRefreshing as E } from "./styles.js";
1
+ import { jsxs as h, Fragment as S, jsx as o } from "react/jsx-runtime";
2
+ import { useStore as b } from "@nanostores/react";
3
+ import { useState as a, useMemo as T, useEffect as d, useRef as x, useCallback as v } from "react";
4
+ import { r as D } from "../../../index-ba93b6b2.js";
5
+ import { NotificationType as c } from "@streamlayer/sdk-web-notifications";
6
+ import { QuestionTypeData as E } from "../../gamification/constants.js";
7
+ import { Notification as O } from "../../gamification/question/notification/index.js";
8
+ import { PredictionResult as P } from "../../gamification/question/notification/prediction-result/index.js";
9
+ import { Onboarding as C } from "./Onboarding/index.js";
10
+ import { Pill as I, InnerContainer as R, Container as q, NotificationRefreshing as B } from "./styles.js";
11
+ import "../../../index-39a0b9b6.js";
9
12
  import "@streamlayer/sdk-web-types";
10
- import "../../gamification/constants.js";
11
13
  import "../../gamification/question/notification/insight/index.js";
12
14
  import "../../video-player/index.js";
13
15
  import "../../icons/index.js";
@@ -39,57 +41,107 @@ import "../../button/index.js";
39
41
  import "../../button/styles.js";
40
42
  import "./Onboarding/Notification/index.js";
41
43
  import "./Onboarding/Notification/styles.js";
42
- const I = (p) => {
43
- const [t, r] = d(0), e = N(null), n = l((i) => {
44
- e.current = i;
44
+ import "../../gamification/question/notification/pill/index.js";
45
+ import "../../gamification/question/notification/pill/styles.js";
46
+ const w = (s) => {
47
+ const [t, n] = a(0), i = x(null), m = v((e) => {
48
+ i.current = e;
45
49
  }, []);
46
- S(() => {
47
- var u;
48
- const i = (u = e.current) == null ? void 0 : u.getBoundingClientRect();
49
- i && r(i.height);
50
- }, [p]);
51
- const m = l((i) => {
52
- r(i);
50
+ d(() => {
51
+ var p;
52
+ const e = (p = i.current) == null ? void 0 : p.getBoundingClientRect();
53
+ e && n(e.height);
54
+ }, [s]);
55
+ const r = v((e) => {
56
+ n(e);
53
57
  }, []);
54
- return [n, t, m];
55
- }, b = ({ sdk: p, notification: t }) => {
56
- var m, i;
57
- const [r, e, n] = I(t.id);
58
- return t.type === s.QUESTION ? /* @__PURE__ */ h(f, { children: [
59
- /* @__PURE__ */ o(g, { ref: r, style: { position: "absolute", visibility: "hidden" }, children: /* @__PURE__ */ o(c, { ...t }) }),
60
- /* @__PURE__ */ h(v, { style: { height: t.hiding ? 0 : e }, hiding: t.hiding, children: [
61
- /* @__PURE__ */ o(g, { style: { height: "100%" }, children: /* @__PURE__ */ o(c, { ...t }) }),
62
- /* @__PURE__ */ o(E, {}, t.id)
63
- ] })
64
- ] }) : t.type === s.QUESTION_RESOLVED && ((i = (m = t.data) == null ? void 0 : m.question) != null && i.predictionResult) ? /* @__PURE__ */ o(
65
- O,
66
- {
67
- style: { height: t.hiding ? 0 : e },
68
- saveHeight: n,
69
- close: t.close,
58
+ return [m, t, r];
59
+ }, H = ({
60
+ sdk: s,
61
+ notification: t
62
+ }) => {
63
+ var r, e;
64
+ const [n, i, m] = w(t.id);
65
+ return t.type === c.QUESTION ? /* @__PURE__ */ h(S, {
66
+ children: [/* @__PURE__ */ o(R, {
67
+ ref: n,
68
+ style: {
69
+ position: "absolute",
70
+ visibility: "hidden"
71
+ },
72
+ children: /* @__PURE__ */ o(O, {
73
+ ...t
74
+ })
75
+ }), /* @__PURE__ */ h(q, {
76
+ style: {
77
+ height: t.hiding ? 0 : i
78
+ },
70
79
  hiding: t.hiding,
71
- ...t.data.question
72
- }
73
- ) : t.type === s.ONBOARDING ? /* @__PURE__ */ o(
74
- R,
75
- {
76
- style: { height: t.hiding ? 0 : e },
77
- saveHeight: n,
78
- sdk: p,
79
- notification: t
80
- }
81
- ) : null;
82
- }, gt = ({ sdk: p }) => {
83
- const [t] = d(p.getNotificationsStore()), r = y(t), e = a(() => {
80
+ children: [/* @__PURE__ */ o(R, {
81
+ style: {
82
+ height: "100%"
83
+ },
84
+ children: /* @__PURE__ */ o(O, {
85
+ ...t
86
+ })
87
+ }), /* @__PURE__ */ o(B, {}, t.id)]
88
+ })]
89
+ }) : t.type === c.QUESTION_RESOLVED && ((e = (r = t.data) == null ? void 0 : r.question) != null && e.predictionResult) ? /* @__PURE__ */ o(P, {
90
+ style: {
91
+ height: t.hiding ? 0 : i
92
+ },
93
+ saveHeight: m,
94
+ close: t.close,
95
+ hiding: t.hiding,
96
+ ...t.data.question
97
+ }) : t.type === c.ONBOARDING ? /* @__PURE__ */ o(C, {
98
+ style: {
99
+ height: t.hiding ? 0 : i
100
+ },
101
+ saveHeight: m,
102
+ sdk: s,
103
+ notification: t
104
+ }) : null;
105
+ }, Dt = ({
106
+ sdk: s,
107
+ scrollNode: t,
108
+ appNode: n,
109
+ scrollStore: i
110
+ }) => {
111
+ var f, y;
112
+ const [m] = a(s.getNotificationsStore()), r = b(m), {
113
+ tabsShown: e
114
+ } = b(i, {
115
+ keys: ["tabsShown"]
116
+ }), [p, g] = a(null), l = T(() => {
84
117
  if (!(r != null && r.size))
85
118
  return null;
86
- for (const m of r.values())
87
- if (m.type === s.ONBOARDING)
88
- return m;
119
+ for (const N of r.values())
120
+ if (N.type === c.ONBOARDING)
121
+ return N;
89
122
  return r.values().next().value;
90
123
  }, [r]);
91
- return e ? /* @__PURE__ */ o(b, { sdk: p, notification: e }) : null;
124
+ return d(() => {
125
+ l && i.get().scrollPosition > 0 && g(l);
126
+ }, [l, i]), d(() => i.listen((u) => {
127
+ u.scrollPosition === 0 && g(null);
128
+ }), [i]), /* @__PURE__ */ h(S, {
129
+ children: [!p && l && /* @__PURE__ */ o(H, {
130
+ sdk: s,
131
+ notification: l
132
+ }), p && n.current && D.createPortal(/* @__PURE__ */ o(I, {
133
+ title: `New ${((y = E[(f = p.data) == null ? void 0 : f.questionType]) == null ? void 0 : y.label) || "notification"}`,
134
+ onClick: () => {
135
+ var u;
136
+ (u = t.current) == null || u.scrollTo({
137
+ top: 0,
138
+ behavior: "smooth"
139
+ });
140
+ },
141
+ className: e ? "c1d7yse1" : void 0
142
+ }), n.current)]
143
+ });
92
144
  };
93
145
  export {
94
- gt as SDKNotifications
146
+ Dt as SDKNotifications
95
147
  };
@@ -2,3 +2,4 @@
2
2
  export declare const Container: any;
3
3
  export declare const InnerContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
4
  export declare const NotificationRefreshing: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
5
+ export declare const Pill: any;
@@ -1,22 +1,31 @@
1
- import { styled as n } from "@linaria/react";
2
- import { ShowIn as s } from "../../show-in/index.js";
1
+ import { styled as s } from "@linaria/react";
2
+ import { Pill as o } from "../../gamification/question/notification/pill/index.js";
3
+ import { ShowIn as n } from "../../show-in/index.js";
3
4
  import "react/jsx-runtime";
5
+ import "../../icons/index.js";
6
+ import "react";
7
+ import "../../gamification/question/notification/pill/styles.js";
4
8
  import "@linaria/core";
5
- const o = () => s, a = /* @__PURE__ */ n(o())({
9
+ const r = () => n, I = /* @__PURE__ */ s(r())({
6
10
  name: "Container",
7
11
  class: "ctckejh",
8
12
  propsAsIs: !0
9
- }), c = /* @__PURE__ */ n("div")({
13
+ }), h = /* @__PURE__ */ s("div")({
10
14
  name: "InnerContainer",
11
15
  class: "i1ri7tzr",
12
16
  propsAsIs: !1
13
- }), p = /* @__PURE__ */ n("div")({
17
+ }), A = /* @__PURE__ */ s("div")({
14
18
  name: "NotificationRefreshing",
15
19
  class: "n1ng1qh5",
16
20
  propsAsIs: !1
21
+ }), t = () => o, C = /* @__PURE__ */ s(t())({
22
+ name: "Pill",
23
+ class: "pruq6ik",
24
+ propsAsIs: !0
17
25
  });
18
26
  export {
19
- a as Container,
20
- c as InnerContainer,
21
- p as NotificationRefreshing
27
+ I as Container,
28
+ h as InnerContainer,
29
+ A as NotificationRefreshing,
30
+ C as Pill
22
31
  };
@@ -1,15 +1,16 @@
1
- import { jsxs as v, jsx as t } from "react/jsx-runtime";
2
- import { useEffect as y } from "react";
3
- import { resetCss as a } from "../theme/theme.js";
4
- import { ActiveFeature as g } from "./Features/index.js";
5
- import { MastersNavigation as h } from "./Navigation/MastersNavigation/index.js";
6
- import { SDKNotifications as S } from "./Notifications/index.js";
7
- import { SDKContainer as A, SDKScrollContainer as n } from "./styles.js";
8
- import { useMastersApp as C } from "./useMastersApp.js";
9
- import { useSdkFeature as I } from "./useSdkFeature.js";
10
- import { ChannelsButtonId as x } from "../navigation/button/Channels.js";
11
- import { LeaderBoardButtonId as s } from "../navigation/button/LeaderBoard.js";
12
- import { FeaturedGroupsButtonId as B } from "../navigation/button/FeaturedGroups.js";
1
+ import { jsxs as c, jsx as m } from "react/jsx-runtime";
2
+ import { useRef as g, useEffect as h } from "react";
3
+ import { resetCss as d } from "../theme/theme.js";
4
+ import { ActiveFeature as y } from "./Features/index.js";
5
+ import { MastersNavigation as N } from "./Navigation/MastersNavigation/index.js";
6
+ import { SDKNotifications as A } from "./Notifications/index.js";
7
+ import { SDKContainer as C, SDKScrollContainer as I } from "./styles.js";
8
+ import { useMastersApp as x } from "./useMastersApp.js";
9
+ import { useSdkFeature as B } from "./useSdkFeature.js";
10
+ import { useSdkScroll as F } from "./useSdkScroll.js";
11
+ import { ChannelsButtonId as j } from "../navigation/button/Channels.js";
12
+ import { LeaderBoardButtonId as D } from "../navigation/button/LeaderBoard.js";
13
+ import { FeaturedGroupsButtonId as E } from "../navigation/button/FeaturedGroups.js";
13
14
  import "../theme/constants.js";
14
15
  import "@streamlayer/sdk-web-types";
15
16
  import "./Features/FeatureProvider.js";
@@ -19,10 +20,12 @@ import "../navigation/masters.js";
19
20
  import "@linaria/react";
20
21
  import "../navigation/index.js";
21
22
  import "../../index_4nhkck-4ed993c7.js";
22
- import "../../masters_k70xsy-4ed993c7.js";
23
+ import "../../masters_1wv7w2k-4ed993c7.js";
24
+ import "../../index-ba93b6b2.js";
25
+ import "../../index-39a0b9b6.js";
23
26
  import "@streamlayer/sdk-web-notifications";
24
- import "../gamification/question/notification/index.js";
25
27
  import "../gamification/constants.js";
28
+ import "../gamification/question/notification/index.js";
26
29
  import "../gamification/question/notification/insight/index.js";
27
30
  import "../video-player/index.js";
28
31
  import "../icons/index.js";
@@ -56,47 +59,57 @@ import "../button/styles.js";
56
59
  import "./Notifications/Onboarding/Notification/index.js";
57
60
  import "./Notifications/Onboarding/Notification/styles.js";
58
61
  import "./Notifications/styles.js";
62
+ import "../gamification/question/notification/pill/index.js";
63
+ import "../gamification/question/notification/pill/styles.js";
59
64
  import "../navigation/button/styles.js";
60
65
  import "../../LeaderBoard_16p26hz-4ed993c7.js";
61
66
  import "../navigation/button/index.js";
62
- const F = ({ sdk: r, className: i }) => {
63
- const [, m] = I(r);
64
- return /* @__PURE__ */ t(g, { className: i, feature: m, sdk: r });
65
- }, Lt = ({ sdk: r, overlays: i, children: m }) => {
66
- const { sdkEnabled: p, sdkReady: e, activeOverlay: o, activateAndLoadOverlay: d, activateEventWithId: c, deactivate: l, isLogged: f } = C(r);
67
- return y(() => {
67
+ import "lodash.throttle";
68
+ const K = ({ sdk: t, className: p, scrollStore: e, appNode: r, scrollNode: a }) => {
69
+ const [, o] = B(t);
70
+ return /* @__PURE__ */ m(
71
+ y,
72
+ {
73
+ className: p,
74
+ scrollNode: a,
75
+ appNode: r,
76
+ scrollStore: e,
77
+ feature: o,
78
+ sdk: t
79
+ }
80
+ );
81
+ }, Jt = ({ sdk: t, overlays: p, children: e }) => {
82
+ const [r, a] = F(), o = g(null), { sdkEnabled: s, sdkReady: n, activeOverlay: i, activateAndLoadOverlay: l, activateEventWithId: f, deactivate: u, isLogged: v } = x(t);
83
+ return h(() => {
68
84
  import("./Features/Gamification/gamification-feature.js");
69
- }, []), /* @__PURE__ */ v(A, { children: [
70
- p && /* @__PURE__ */ t(
71
- h,
72
- {
73
- sdkReady: e,
74
- activeOverlay: o,
75
- className: a,
76
- setActiveOverlay: (u) => d("", u)
77
- }
78
- ),
79
- e && /* @__PURE__ */ t(S, { sdk: r }),
80
- /* @__PURE__ */ t(
81
- n,
82
- {
83
- "data-nav": p.toString(),
84
- style: { display: !p || o === x ? "block" : "none" },
85
- children: m && m({ activateEventWithId: c, deactivate: l })
86
- }
87
- ),
88
- /* @__PURE__ */ t(
89
- n,
85
+ }, []), /* @__PURE__ */ c(C, { ref: o, children: [
86
+ s && /* @__PURE__ */ m(
87
+ N,
90
88
  {
91
- "data-nav": p.toString(),
92
- style: { display: o === s ? "block" : "none" },
93
- children: i && o === s && i[o]
89
+ sdkReady: n,
90
+ activeOverlay: i,
91
+ className: d,
92
+ setActiveOverlay: (S) => l("", S)
94
93
  }
95
94
  ),
96
- e && o === B && /* @__PURE__ */ t(F, { className: a, sdk: r }),
97
- !f && /* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: "You are not logged in." })
95
+ /* @__PURE__ */ c(I, { ref: r, "data-nav": s.toString(), children: [
96
+ n && /* @__PURE__ */ m(A, { sdk: t, scrollNode: r, appNode: o, scrollStore: a }),
97
+ (!s || i === j) && e && e({ activateEventWithId: f, deactivate: u }),
98
+ p && i === D && p[i],
99
+ n && i === E && /* @__PURE__ */ m(
100
+ K,
101
+ {
102
+ scrollStore: a,
103
+ scrollNode: r,
104
+ appNode: o,
105
+ className: d,
106
+ sdk: t
107
+ }
108
+ )
109
+ ] }),
110
+ !v && /* @__PURE__ */ m("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: "You are not logged in." })
98
111
  ] });
99
112
  };
100
113
  export {
101
- Lt as MastersApp
114
+ Jt as MastersApp
102
115
  };
@@ -9,7 +9,7 @@ import "../icons/index.js";
9
9
  import "../navigation/button/styles.js";
10
10
  import "../../LeaderBoard_16p26hz-4ed993c7.js";
11
11
  import "../../index_4nhkck-4ed993c7.js";
12
- import "../../masters_k70xsy-4ed993c7.js";
12
+ import "../../masters_1wv7w2k-4ed993c7.js";
13
13
  import "../navigation/button/index.js";
14
14
  const U = (t) => {
15
15
  const a = h(""), [f, l] = d(!1), A = m(t.status), r = m(t.userId()), i = A === "ready", [s, u] = d(n), p = F(
@@ -0,0 +1,9 @@
1
+ import { MapStore } from 'nanostores';
2
+ type ScrollData = {
3
+ scrollPosition: number;
4
+ tabsShown?: boolean;
5
+ scrollDirection: 'forward' | 'backward';
6
+ };
7
+ export type ScrollStore = MapStore<ScrollData>;
8
+ export declare const useSdkScroll: () => [React.MutableRefObject<HTMLDivElement | null>, ScrollStore];
9
+ export {};
@@ -0,0 +1,93 @@
1
+ import a from "lodash.throttle";
2
+ import { useRef as f, useState as v, useCallback as d, useEffect as p } from "react";
3
+ import { d as m } from "../../index-39a0b9b6.js";
4
+ let h = Symbol("clean"), n = [], b = (i, r) => {
5
+ let l = [], e = {
6
+ get() {
7
+ return e.lc || e.listen(() => {
8
+ })(), e.value;
9
+ },
10
+ l: r || 0,
11
+ lc: 0,
12
+ listen(o, s) {
13
+ return e.lc = l.push(o, s || e.l) / 2, () => {
14
+ let t = l.indexOf(o);
15
+ ~t && (l.splice(t, 2), --e.lc || e.off());
16
+ };
17
+ },
18
+ notify(o) {
19
+ let s = !n.length;
20
+ for (let t = 0; t < l.length; t += 2)
21
+ n.push(
22
+ l[t],
23
+ l[t + 1],
24
+ e.value,
25
+ o
26
+ );
27
+ if (s) {
28
+ for (let t = 0; t < n.length; t += 4) {
29
+ let c;
30
+ for (let u = t + 1; !c && (u += 4) < n.length; )
31
+ n[u] < n[t + 1] && (c = n.push(
32
+ n[t],
33
+ n[t + 1],
34
+ n[t + 2],
35
+ n[t + 3]
36
+ ));
37
+ c || n[t](n[t + 2], n[t + 3]);
38
+ }
39
+ n.length = 0;
40
+ }
41
+ },
42
+ off() {
43
+ },
44
+ /* It will be called on last listener unsubscribing.
45
+ We will redefine it in onMount and onStop. */
46
+ set(o) {
47
+ e.value !== o && (e.value = o, e.notify());
48
+ },
49
+ subscribe(o, s) {
50
+ let t = e.listen(o, s);
51
+ return o(e.value), t;
52
+ },
53
+ value: i
54
+ };
55
+ return m.process.env.NODE_ENV !== "production" && (e[h] = () => {
56
+ l = [], e.lc = 0, e.off();
57
+ }), e;
58
+ }, g = (i = {}) => {
59
+ let r = b(i);
60
+ return r.setKey = function(l, e) {
61
+ typeof e > "u" ? l in r.value && (r.value = { ...r.value }, delete r.value[l], r.notify(l)) : r.value[l] !== e && (r.value = {
62
+ ...r.value,
63
+ [l]: e
64
+ }, r.notify(l));
65
+ }, r;
66
+ };
67
+ const w = () => {
68
+ const i = f(null), r = f(0), [l] = v(
69
+ g({
70
+ scrollPosition: 0,
71
+ scrollDirection: "forward"
72
+ })
73
+ ), e = d(
74
+ a((o) => {
75
+ const s = o.target;
76
+ if (!s)
77
+ return;
78
+ const { scrollTop: t } = s, c = r.current < t ? "forward" : "backward";
79
+ r.current = t, l.set({ scrollPosition: t, scrollDirection: c, tabsShown: l.get().tabsShown });
80
+ }, 200),
81
+ []
82
+ );
83
+ return p(() => {
84
+ const o = i.current;
85
+ return o ? (o.addEventListener("scroll", e), () => {
86
+ o.removeEventListener("scroll", e);
87
+ }) : () => {
88
+ };
89
+ }, [e]), [i, l];
90
+ };
91
+ export {
92
+ w as useSdkScroll
93
+ };
@@ -8,5 +8,5 @@ type LeaderboardListProps = {
8
8
  fetchMore: () => void;
9
9
  onScroll?: ListProps['onScroll'];
10
10
  };
11
+ export { LeaderboardStaticList } from './static';
11
12
  export declare const LeaderboardList: React.FC<LeaderboardListProps>;
12
- export {};
@@ -1,40 +1,43 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import u from "react-virtualized-auto-sizer";
3
- import { FixedSizeList as f } from "react-window";
4
- import I from "react-window-infinite-loader";
5
- import { LeaderboardItem as L } from "./list-item/index.js";
2
+ import h from "react-virtualized-auto-sizer";
3
+ import { FixedSizeList as u } from "react-window";
4
+ import L from "react-window-infinite-loader";
5
+ import { LeaderboardItem as I } from "./list-item/index.js";
6
6
  import { ScrollContainer as c } from "./styles.js";
7
+ import { LeaderboardStaticList as v } from "./static.js";
7
8
  import "../../../utils/common.js";
8
9
  import "./list-item/styles.js";
9
10
  import "@linaria/react";
10
11
  import "../../icons/index.js";
11
12
  import "react";
12
- const F = ({
13
+ import "../../../styles_hxnaic-4ed993c7.js";
14
+ import "react-infinite-scroller";
15
+ const M = ({
13
16
  items: r,
14
17
  currentUserId: i,
15
18
  openItemDetail: m,
16
- fetchMore: n,
17
- onScroll: p
18
- }) => /* @__PURE__ */ o(u, { children: ({ width: d, height: l }) => /* @__PURE__ */ o(
19
- I,
19
+ fetchMore: p,
20
+ onScroll: d
21
+ }) => /* @__PURE__ */ o(h, { children: ({ width: n, height: a }) => /* @__PURE__ */ o(
22
+ L,
20
23
  {
21
24
  isItemLoaded: (e) => e < r.length,
22
25
  itemCount: r.length + 1,
23
- loadMoreItems: n,
24
- children: ({ onItemsRendered: e, ref: a }) => /* @__PURE__ */ o(c, { children: /* @__PURE__ */ o(
25
- f,
26
+ loadMoreItems: p,
27
+ children: ({ onItemsRendered: e, ref: l }) => /* @__PURE__ */ o(c, { children: /* @__PURE__ */ o(
28
+ u,
26
29
  {
27
30
  itemSize: 56,
28
- onScroll: p,
31
+ onScroll: d,
29
32
  onItemsRendered: e,
30
- ref: a,
33
+ ref: l,
31
34
  itemCount: r.length,
32
- width: d,
33
- height: l,
34
- children: ({ index: t, style: h }) => /* @__PURE__ */ o(
35
- L,
35
+ width: n,
36
+ height: a,
37
+ children: ({ index: t, style: f }) => /* @__PURE__ */ o(
38
+ I,
36
39
  {
37
- style: { ...h, maxHeight: 48 },
40
+ style: { ...f, maxHeight: 48 },
38
41
  ...r[t],
39
42
  openItemDetail: () => m(r[t].userId),
40
43
  isCurrentUser: !!i && i === r[t].userId
@@ -46,5 +49,6 @@ const F = ({
46
49
  }
47
50
  ) });
48
51
  export {
49
- F as LeaderboardList
52
+ M as LeaderboardList,
53
+ v as LeaderboardStaticList
50
54
  };
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { ScrollStore } from '../../app/useSdkScroll';
3
+ import { LeaderboardItemProps } from '../../gamification/leaderboard/list-item';
4
+ type LeaderboardListProps = {
5
+ items: Omit<LeaderboardItemProps, 'openItemDetail'>[];
6
+ currentUserId?: string;
7
+ openItemDetail: (id: string) => void;
8
+ fetchMore: () => void;
9
+ scrollNode: React.MutableRefObject<HTMLDivElement | null>;
10
+ scrollStore: ScrollStore;
11
+ hasMore: boolean;
12
+ };
13
+ export declare const LeaderboardStaticList: React.FC<LeaderboardListProps>;
14
+ export {};
@@ -0,0 +1,36 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { styled as l } from "@linaria/react";
3
+ import p from "react-infinite-scroller";
4
+ import { LeaderboardItem as d } from "./list-item/index.js";
5
+ import "../../../utils/common.js";
6
+ import "./list-item/styles.js";
7
+ import "../../icons/index.js";
8
+ import "react";
9
+ const m = /* @__PURE__ */ l("div")({
10
+ name: "Container",
11
+ class: "c16btbfp",
12
+ propsAsIs: !1
13
+ }), h = ({
14
+ items: e,
15
+ currentUserId: t,
16
+ openItemDetail: i,
17
+ fetchMore: s,
18
+ scrollNode: a,
19
+ hasMore: n
20
+ }) => /* @__PURE__ */ o(p, {
21
+ loadMore: s,
22
+ initialLoad: !1,
23
+ hasMore: n,
24
+ useWindow: !1,
25
+ getScrollParent: () => a.current,
26
+ children: /* @__PURE__ */ o(m, {
27
+ children: e.map((r) => /* @__PURE__ */ o(d, {
28
+ ...r,
29
+ openItemDetail: () => i(r.userId),
30
+ isCurrentUser: !!t && t === r.userId
31
+ }, r.userId))
32
+ })
33
+ });
34
+ export {
35
+ h as LeaderboardStaticList
36
+ };
@@ -1,5 +1,6 @@
1
- import { styled as s } from "@linaria/react";
2
- const l = /* @__PURE__ */ s("div")({
1
+ import { styled as o } from "@linaria/react";
2
+ import "../../../styles_hxnaic-4ed993c7.js";
3
+ const l = /* @__PURE__ */ o("div")({
3
4
  name: "ScrollContainer",
4
5
  class: "s13d8sg6",
5
6
  propsAsIs: !1
@@ -2,6 +2,8 @@
2
2
  type PillProps = {
3
3
  title?: string;
4
4
  onClick: () => void;
5
+ className?: string;
6
+ style?: React.CSSProperties;
5
7
  };
6
8
  export declare const Pill: React.FC<PillProps>;
7
9
  export {};
@@ -1,12 +1,12 @@
1
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
- import { SvgIcon as t } from "../../../../icons/index.js";
3
- import { Container as m, Content as e, Title as p } from "./styles.js";
1
+ import { jsx as r, jsxs as m } from "react/jsx-runtime";
2
+ import { SvgIcon as e } from "../../../../icons/index.js";
3
+ import { Container as p, Content as c, Title as l } from "./styles.js";
4
4
  import "@linaria/react";
5
5
  import "react";
6
- const h = ({ title: o, onClick: n }) => /* @__PURE__ */ r(m, { onClick: n, children: /* @__PURE__ */ i(e, { children: [
7
- /* @__PURE__ */ r(t, { name: "iconUp" }),
8
- o && /* @__PURE__ */ r(p, { children: o })
6
+ const a = ({ title: o, onClick: n, className: i, style: t }) => /* @__PURE__ */ r(p, { onClick: n, className: i, style: t, children: /* @__PURE__ */ m(c, { children: [
7
+ /* @__PURE__ */ r(e, { name: "iconUp" }),
8
+ o && /* @__PURE__ */ r(l, { children: o })
9
9
  ] }) });
10
10
  export {
11
- h as Pill
11
+ a as Pill
12
12
  };
@@ -4,5 +4,5 @@ export declare const PredictionResult: React.FC<NotificationData['question'] & {
4
4
  close?: () => void;
5
5
  saveHeight: (h: number) => void;
6
6
  style: React.CSSProperties;
7
- hiding: boolean;
7
+ hiding?: boolean;
8
8
  }>;