@streamlayer/react-ui 0.91.1 → 0.93.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 (94) hide show
  1. package/lib/assets/style.css +1 -1
  2. package/lib/index-keh7OLCY.js +67 -0
  3. package/lib/index.js +5 -4
  4. package/lib/ui/app/Features/Gamification/Friends.d.ts +2 -1
  5. package/lib/ui/app/Features/Gamification/Friends.js +6 -6
  6. package/lib/ui/app/Features/Gamification/Leaderboard.d.ts +3 -2
  7. package/lib/ui/app/Features/Gamification/Leaderboard.js +26 -24
  8. package/lib/ui/app/Features/Gamification/Question.js +1 -1
  9. package/lib/ui/app/Features/Gamification/Tabs.d.ts +7 -2
  10. package/lib/ui/app/Features/Gamification/Tabs.js +42 -31
  11. package/lib/ui/app/Features/Gamification/gamification-feature.js +5 -2
  12. package/lib/ui/app/Features/Gamification/index.d.ts +6 -2
  13. package/lib/ui/app/Features/Gamification/index.js +86 -45
  14. package/lib/ui/app/Features/index.d.ts +6 -2
  15. package/lib/ui/app/Features/index.js +13 -11
  16. package/lib/ui/app/Navigation/MastersNavigation/index.d.ts +3 -2
  17. package/lib/ui/app/Navigation/MastersNavigation/index.js +37 -31
  18. package/lib/ui/app/Navigation/index.js +6 -7
  19. package/lib/ui/app/Notifications/Onboarding/index.d.ts +2 -1
  20. package/lib/ui/app/Notifications/Onboarding/index.js +91 -73
  21. package/lib/ui/app/Notifications/index.d.ts +6 -2
  22. package/lib/ui/app/Notifications/index.js +120 -91
  23. package/lib/ui/app/Points/index.js +6 -5
  24. package/lib/ui/app/masters.d.ts +7 -0
  25. package/lib/ui/app/masters.js +73 -51
  26. package/lib/ui/app/styles.d.ts +1 -0
  27. package/lib/ui/app/styles.js +6 -1
  28. package/lib/ui/app/useClipboardCopy.d.ts +2 -1
  29. package/lib/ui/app/useImagesPreload.d.ts +4 -0
  30. package/lib/ui/app/useImagesPreload.js +23 -0
  31. package/lib/ui/app/useMastersApp.js +15 -14
  32. package/lib/ui/app/useSdkResponsive.d.ts +14 -0
  33. package/lib/ui/app/useSdkResponsive.js +46 -0
  34. package/lib/ui/app/useSdkScroll.d.ts +4 -1
  35. package/lib/ui/app/useSdkScroll.js +36 -85
  36. package/lib/ui/gamification/detail/header/index.js +11 -11
  37. package/lib/ui/gamification/detail/header/styles.d.ts +1 -1
  38. package/lib/ui/gamification/detail/header/styles.js +11 -11
  39. package/lib/ui/gamification/leaderboard/static.d.ts +2 -1
  40. package/lib/ui/gamification/onboarding/index.d.ts +5 -0
  41. package/lib/ui/gamification/onboarding/index.js +69 -42
  42. package/lib/ui/gamification/onboarding/invitingUser/index.d.ts +7 -0
  43. package/lib/ui/gamification/onboarding/invitingUser/index.js +16 -0
  44. package/lib/ui/gamification/onboarding/invitingUser/styles.d.ts +5 -0
  45. package/lib/ui/gamification/onboarding/invitingUser/styles.js +24 -0
  46. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +1 -1
  47. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.js +15 -13
  48. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.d.ts +1 -1
  49. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.js +9 -9
  50. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.d.ts +2 -1
  51. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +1 -1
  52. package/lib/ui/gamification/onboarding/slides/onboarding-rules/index.d.ts +2 -0
  53. package/lib/ui/gamification/onboarding/slides/onboarding-rules/index.js +18 -12
  54. package/lib/ui/gamification/onboarding/slides/onboarding-terms/index.d.ts +7 -0
  55. package/lib/ui/gamification/onboarding/slides/onboarding-terms/index.js +10 -0
  56. package/lib/ui/gamification/onboarding/slides/onboarding-terms/styles.d.ts +5 -0
  57. package/lib/ui/gamification/onboarding/slides/onboarding-terms/styles.js +24 -0
  58. package/lib/ui/gamification/points/index.js +5 -4
  59. package/lib/ui/gamification/question/insight/index.js +5 -5
  60. package/lib/ui/gamification/question/notification/prediction-result/animation-lines/index.js +17 -17
  61. package/lib/ui/gamification/question/notification/prediction-result/index.js +37 -39
  62. package/lib/ui/gamification/question/notification/prediction-result/styles.d.ts +1 -1
  63. package/lib/ui/gamification/question/notification/prediction-result/styles.js +12 -12
  64. package/lib/ui/gamification/vote/index.js +55 -54
  65. package/lib/ui/gamification/vote/insight-details/index.js +1 -1
  66. package/lib/ui/gamification/vote/styles.d.ts +1 -0
  67. package/lib/ui/gamification/vote/styles.js +17 -11
  68. package/lib/ui/gamification/vote/vote-option/index.js +62 -58
  69. package/lib/ui/gamification/vote/win-bar/index.d.ts +1 -0
  70. package/lib/ui/gamification/vote/win-bar/index.js +21 -20
  71. package/lib/ui/navigation/button/LeaderBoard.js +5 -6
  72. package/lib/ui/navigation/index.js +6 -7
  73. package/lib/ui/navigation/masters.d.ts +2 -1
  74. package/lib/ui/navigation/masters.js +9 -6
  75. package/lib/ui/questions/insight/index.d.ts +1 -1
  76. package/lib/ui/questions/insight/index.js +18 -25
  77. package/lib/ui/skeleton/index.d.ts +7 -0
  78. package/lib/ui/skeleton/index.js +7 -0
  79. package/lib/ui/skeleton/styles.d.ts +2 -0
  80. package/lib/ui/skeleton/styles.js +9 -0
  81. package/lib/ui/theme/breakpoints.d.ts +4 -1
  82. package/lib/ui/theme/breakpoints.js +24 -12
  83. package/lib/ui/theme/constants.d.ts +4 -0
  84. package/lib/ui/theme/constants.js +6 -2
  85. package/lib/ui/theme/index.js +4 -3
  86. package/lib/ui/theme/theme.js +29 -21
  87. package/lib/utils/createDemo.js +12 -13
  88. package/lib/utils/debug/components/copyLogs.js +10 -9
  89. package/lib/utils/decorators/container.js +4 -3
  90. package/package.json +18 -18
  91. package/lib/LeaderBoard_fzzlxb-w40geAFS.js +0 -1
  92. package/lib/index_ej4hfx-w40geAFS.js +0 -1
  93. package/lib/masters_m6itlr-w40geAFS.js +0 -1
  94. package/lib/utils/useStreamLayerApp.js +0 -25
@@ -1,10 +1,15 @@
1
1
  /// <reference types="react" />
2
2
  import { type Gamification } from '@streamlayer/feature-gamification';
3
+ import type { AppNodeRef, HeaderNodeRef, ScrollNodeRef } from '../../masters';
4
+ import { ResponsiveStore } from '../../useSdkResponsive';
3
5
  import { ScrollStore } from '../../useSdkScroll';
4
6
  export declare const Tabs: React.FC<{
5
- appNode: React.MutableRefObject<HTMLDivElement | null>;
7
+ appNode: AppNodeRef;
6
8
  gamification: Gamification;
7
9
  scrollStore: ScrollStore;
8
- scrollNode: React.MutableRefObject<HTMLDivElement | null>;
10
+ scrollNode: ScrollNodeRef;
11
+ headerNode: HeaderNodeRef;
12
+ responsiveStore: ResponsiveStore;
9
13
  className?: string;
14
+ style?: React.CSSProperties;
10
15
  }>;
@@ -1,15 +1,19 @@
1
- import { jsxs as n, jsx as t, Fragment as T } from "react/jsx-runtime";
2
- import { useState as a, useTransition as g, useEffect as y } from "react";
3
- import { TabsContainer as x, TabsNavContainer as C, SDKWhiteContainer as D, SDKContentContainer as v, LeaderboardContainer as A } from "../../styles.js";
4
- import { ActivePages as p, Tabs as E } from "../../../gamification/tabs/index.js";
5
- import { Leaderboard as L } from "./Leaderboard.js";
6
- import { QuestionsList as P } from "./QuestionsList.js";
7
- import { UserSummary as S } from "./UserSummary.js";
1
+ import { jsxs as f, jsx as r, Fragment as S } from "react/jsx-runtime";
2
+ import { useStore as A } from "@nanostores/react";
3
+ import { useState as h, useTransition as D, useEffect as P } from "react";
4
+ import { TabsContainer as k, TabsNavContainer as E, SDKWhiteContainer as I, UserSummaryContainer as L, SDKContentContainer as V, LeaderboardContainer as K } from "../../styles.js";
5
+ import { scrollIntoAppView as B } from "../../useSdkScroll.js";
6
+ import { ActivePages as n, Tabs as F } from "../../../gamification/tabs/index.js";
7
+ import { Leaderboard as O } from "./Leaderboard.js";
8
+ import { QuestionsList as Q } from "./QuestionsList.js";
9
+ import { UserSummary as R } from "./UserSummary.js";
8
10
  import "@linaria/react";
11
+ import "lodash.throttle";
12
+ import "../../../theme/constants.js";
13
+ import "../../../../index-keh7OLCY.js";
14
+ import "../../../../index-uEuzH3jr.js";
9
15
  import "../../../gamification/tabs/styles.js";
10
- import "@nanostores/react";
11
16
  import "../../../../useClipboardCopy-E5rEe6It.js";
12
- import "../../../../index-uEuzH3jr.js";
13
17
  import "../../../gamification/copyNotification/index.js";
14
18
  import "../../../icons/index.js";
15
19
  import "../../../gamification/copyNotification/styles.js";
@@ -53,43 +57,50 @@ import "../../../gamification/user-statistics/components/rank/styles.js";
53
57
  import "../../../gamification/user-statistics/components/statistic/index.js";
54
58
  import "../../../gamification/user-statistics/components/statistic/styles.js";
55
59
  import "../../../gamification/user-statistics/styles.js";
56
- const Kt = ({ gamification: i, className: d, scrollStore: o, scrollNode: c, appNode: f }) => {
57
- const [l, u] = a(!1), [m, b] = a(p.HOME), [, e] = g(), h = (r) => {
58
- e(() => b(r));
59
- }, s = (r) => {
60
- e(() => u(r));
60
+ const qr = ({ gamification: i, className: u, scrollStore: o, scrollNode: b, appNode: e, style: g, responsiveStore: T, headerNode: y }) => {
61
+ const [a, v] = h(!1), [m, w] = h(n.HOME), [, l] = D(), { sdkInScrollView: p } = A(T, { keys: ["sdkInScrollView"] }), x = (t) => {
62
+ l(() => {
63
+ var c;
64
+ w(t), p === !1 && (((c = e.current) == null ? void 0 : c.getBoundingClientRect().y) || 0) < 0 && B(e, { behavior: "instant" });
65
+ });
66
+ }, d = (t) => {
67
+ l(() => v(t));
61
68
  };
62
- return y(() => o.listen((r) => {
63
- if (r.scrollPosition === 0) {
64
- s(!1), o.setKey("tabsShown", !1);
69
+ P(() => o.listen((t) => {
70
+ if (t.scrollPosition === 0) {
71
+ d(!1), o.setKey("tabsShown", !1);
65
72
  return;
66
73
  }
67
- s(r.scrollDirection === "forward"), o.setKey("tabsShown", r.scrollDirection !== "forward");
68
- }), [o]), /* @__PURE__ */ n(x, { className: d, children: [
69
- /* @__PURE__ */ t(
70
- C,
74
+ d(t.scrollDirection === "forward"), o.setKey("tabsShown", t.scrollDirection !== "forward");
75
+ }), [o]);
76
+ let s = "0px";
77
+ p ? s = a ? "calc(8px - var(--header-height) - var(--header-offset))" : "0px" : s = a ? "calc(var(--header-height) + var(--header-offset))" : "0px";
78
+ const C = p ? e : y;
79
+ return /* @__PURE__ */ f(k, { className: u, style: g, children: [
80
+ /* @__PURE__ */ r(
81
+ E,
71
82
  {
72
83
  style: {
73
- top: l ? "-60px" : "0px"
84
+ top: s
74
85
  },
75
- children: /* @__PURE__ */ t(E, { activePage: m, toggleActivePage: h })
86
+ children: /* @__PURE__ */ r(F, { activePage: m, toggleActivePage: x })
76
87
  }
77
88
  ),
78
- m === p.HOME && /* @__PURE__ */ n(T, { children: [
79
- /* @__PURE__ */ t(D, { style: { paddingTop: "8px" }, children: /* @__PURE__ */ t(S, { userSummary: i.userSummary }) }),
80
- /* @__PURE__ */ t(v, { style: { flex: 1 }, children: /* @__PURE__ */ t(P, { openQuestion: i.openQuestion, store: i.feedList.getStore() }) })
89
+ m === n.HOME && /* @__PURE__ */ f(S, { children: [
90
+ /* @__PURE__ */ r(I, { style: { paddingTop: "8px" }, children: /* @__PURE__ */ r(L, { children: /* @__PURE__ */ r(R, { userSummary: i.userSummary }) }) }),
91
+ /* @__PURE__ */ r(V, { style: { flex: 1 }, children: /* @__PURE__ */ r(Q, { openQuestion: i.openQuestion, store: i.feedList.getStore() }) })
81
92
  ] }),
82
- m === p.LEADERBOARD && /* @__PURE__ */ t(A, { children: /* @__PURE__ */ t(
83
- L,
93
+ m === n.LEADERBOARD && /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(
94
+ O,
84
95
  {
85
- appNode: f,
96
+ renderClipBoardNode: C,
86
97
  scrollStore: o,
87
- scrollNode: c,
98
+ scrollNode: b,
88
99
  gamification: i
89
100
  }
90
101
  ) })
91
102
  ] });
92
103
  };
93
104
  export {
94
- Kt as Tabs
105
+ qr as Tabs
95
106
  };
@@ -2,13 +2,17 @@ import { GamificationOverlay as o } from "./index.js";
2
2
  import "react/jsx-runtime";
3
3
  import "@linaria/react";
4
4
  import "@nanostores/react";
5
- import "../../../../useClipboardCopy-E5rEe6It.js";
6
5
  import "react";
6
+ import "../../../../useClipboardCopy-E5rEe6It.js";
7
7
  import "../../../../index-uEuzH3jr.js";
8
8
  import "../../../gamification/copyNotification/index.js";
9
9
  import "../../../icons/index.js";
10
10
  import "../../../gamification/copyNotification/styles.js";
11
11
  import "../../styles.js";
12
+ import "../../useSdkScroll.js";
13
+ import "lodash.throttle";
14
+ import "../../../theme/constants.js";
15
+ import "../../../../index-keh7OLCY.js";
12
16
  import "../../../gamification/detail/header/index.js";
13
17
  import "@streamlayer/sdk-web-types";
14
18
  import "../../../gamification/constants.js";
@@ -37,7 +41,6 @@ import "../../../gamification/vote/vote-option/styles.js";
37
41
  import "../../../gamification/vote/win-bar/index.js";
38
42
  import "../../../timer/index.js";
39
43
  import "react-countdown-circle-timer";
40
- import "../../../theme/constants.js";
41
44
  import "../../../gamification/vote/win-bar/styles.js";
42
45
  import "../../../gamification/vote/insight-details/index.js";
43
46
  import "../../../questions/insight/index.js";
@@ -1,10 +1,14 @@
1
1
  /// <reference types="react" />
2
2
  import { type Gamification as GamificationClass } from '@streamlayer/feature-gamification';
3
+ import type { AppNodeRef, ScrollNodeRef, HeaderNodeRef } from '../../masters';
4
+ import { ResponsiveStore } from '../../useSdkResponsive';
3
5
  import { ScrollStore } from '../../useSdkScroll';
4
6
  export declare const GamificationOverlay: React.FC<{
5
7
  gamification: GamificationClass;
6
8
  className?: string;
7
9
  scrollStore: ScrollStore;
8
- appNode: React.MutableRefObject<HTMLDivElement | null>;
9
- scrollNode: React.MutableRefObject<HTMLDivElement | null>;
10
+ responsiveStore: ResponsiveStore;
11
+ appNode: AppNodeRef;
12
+ scrollNode: ScrollNodeRef;
13
+ headerNode: HeaderNodeRef;
10
14
  }>;
@@ -1,18 +1,22 @@
1
- import { jsxs as e, Fragment as d, jsx as t } from "react/jsx-runtime";
2
- import { styled as l } from "@linaria/react";
3
- import { useStore as n } from "@nanostores/react";
4
- import { r as s } from "../../../../useClipboardCopy-E5rEe6It.js";
5
- import { SDKWhiteContainer as f } from "../../styles.js";
6
- import { VoteHeader as h } from "../../../gamification/detail/header/index.js";
7
- import { UserStatistics as U } from "../../../gamification/user-statistics/index.js";
8
- import { ShowIn as x } from "../../../show-in/index.js";
9
- import { Question as C } from "./Question.js";
10
- import { Tabs as S } from "./Tabs.js";
11
- import "react";
1
+ import { jsxs as d, jsx as t, Fragment as b } from "react/jsx-runtime";
2
+ import { styled as S } from "@linaria/react";
3
+ import { useStore as f } from "@nanostores/react";
4
+ import { useRef as v, useMemo as x, useEffect as R } from "react";
5
+ import { r as y } from "../../../../useClipboardCopy-E5rEe6It.js";
6
+ import { SDKWhiteContainer as F } from "../../styles.js";
7
+ import { scrollIntoAppView as O } from "../../useSdkScroll.js";
8
+ import { VoteHeader as T } from "../../../gamification/detail/header/index.js";
9
+ import { UserStatistics as A } from "../../../gamification/user-statistics/index.js";
10
+ import { ShowIn as P } from "../../../show-in/index.js";
11
+ import { Question as Q } from "./Question.js";
12
+ import { Tabs as j } from "./Tabs.js";
12
13
  import "../../../../index-uEuzH3jr.js";
13
14
  import "../../../gamification/copyNotification/index.js";
14
15
  import "../../../icons/index.js";
15
16
  import "../../../gamification/copyNotification/styles.js";
17
+ import "lodash.throttle";
18
+ import "../../../theme/constants.js";
19
+ import "../../../../index-keh7OLCY.js";
16
20
  import "@streamlayer/sdk-web-types";
17
21
  import "../../../gamification/constants.js";
18
22
  import "../../../gamification/detail/header/styles.js";
@@ -37,7 +41,6 @@ import "../../../gamification/vote/vote-option/styles.js";
37
41
  import "../../../gamification/vote/win-bar/index.js";
38
42
  import "../../../timer/index.js";
39
43
  import "react-countdown-circle-timer";
40
- import "../../../theme/constants.js";
41
44
  import "../../../gamification/vote/win-bar/styles.js";
42
45
  import "../../../gamification/vote/insight-details/index.js";
43
46
  import "../../../questions/insight/index.js";
@@ -79,56 +82,94 @@ import "../../../button/index.js";
79
82
  import "../../../button/styles.js";
80
83
  import "../../../gamification/question/list/styles.js";
81
84
  import "./UserSummary.js";
82
- const I = () => x, c = /* @__PURE__ */ l(I())({
85
+ const D = () => P, I = /* @__PURE__ */ S(D())({
83
86
  name: "OpenedContainer",
84
87
  class: "oar61gl",
85
88
  propsAsIs: !0
86
- }), O = /* @__PURE__ */ l("div")({
89
+ }), E = /* @__PURE__ */ S("div")({
87
90
  name: "UserContainer",
88
91
  class: "u14zaal4",
89
92
  propsAsIs: !1
90
- }), Q = ({
93
+ }), M = ({
91
94
  correct: r,
92
- incorrect: m
95
+ incorrect: s
93
96
  }) => {
94
- const o = r + m;
97
+ const o = r + s;
95
98
  return o === 0 ? 0 : Math.round(r / o * 100);
96
- }, Yr = ({
99
+ }, z = `
100
+ body {
101
+ overflow: hidden
102
+ }
103
+ `, wt = ({
97
104
  gamification: r,
98
- scrollStore: m,
105
+ scrollStore: s,
99
106
  className: o,
100
107
  appNode: i,
101
- scrollNode: a
108
+ scrollNode: k,
109
+ headerNode: l,
110
+ responsiveStore: a
102
111
  }) => {
103
- const u = n(r.openedQuestion.$store), p = n(r.openedUser);
104
- return /* @__PURE__ */ e(d, {
105
- children: [u && i.current && s.createPortal(/* @__PURE__ */ t(c, {
106
- className: o,
107
- children: /* @__PURE__ */ t(C, {
108
- gamification: r
109
- })
110
- }), i.current), p && i.current && s.createPortal(/* @__PURE__ */ t(c, {
111
- className: o,
112
- children: /* @__PURE__ */ e(O, {
113
- children: [/* @__PURE__ */ t(h, {
114
- label: "Friend's Rank",
115
- close: r.closeUser
116
- }), /* @__PURE__ */ t(f, {
117
- children: /* @__PURE__ */ t(U, {
118
- ...p,
119
- successRate: Q(p)
120
- })
121
- })]
122
- })
123
- }), i.current), /* @__PURE__ */ t(S, {
112
+ const c = f(r.openedQuestion.$store), m = f(r.openedUser), {
113
+ sdkInScrollView: e
114
+ } = f(a, {
115
+ keys: ["sdkInScrollView"]
116
+ }), p = v(0), [C, w] = x(() => {
117
+ var h;
118
+ const u = e ? i : l, n = (((h = i.current) == null ? void 0 : h.getBoundingClientRect().y) || 0) < 0;
119
+ if ((c || m) && u.current) {
120
+ n && (p.current = window.scrollY);
121
+ const U = () => (R(() => {
122
+ const V = setTimeout(() => {
123
+ O(i, {
124
+ behavior: "instant"
125
+ });
126
+ }, 1e3);
127
+ return () => {
128
+ clearTimeout(V), p.current !== 0 && (window.scroll({
129
+ top: p.current
130
+ }), p.current = 0);
131
+ };
132
+ }, []), /* @__PURE__ */ t("style", {
133
+ children: z
134
+ }));
135
+ return [n, c ? y.createPortal(/* @__PURE__ */ d(I, {
136
+ className: o,
137
+ children: [/* @__PURE__ */ t(Q, {
138
+ gamification: r
139
+ }), n && !e && /* @__PURE__ */ t(U, {})]
140
+ }), u.current) : m ? y.createPortal(/* @__PURE__ */ t(I, {
141
+ className: o,
142
+ children: /* @__PURE__ */ d(E, {
143
+ children: [/* @__PURE__ */ t(T, {
144
+ label: "Friend's Rank",
145
+ close: r.closeUser
146
+ }), /* @__PURE__ */ t(F, {
147
+ children: /* @__PURE__ */ t(A, {
148
+ ...m,
149
+ successRate: M(m)
150
+ })
151
+ })]
152
+ })
153
+ }), u.current) : null];
154
+ }
155
+ return [n, null];
156
+ }, [i, o, r, l, c, m, e]);
157
+ return /* @__PURE__ */ d(b, {
158
+ children: [w, /* @__PURE__ */ t(j, {
124
159
  appNode: i,
125
- scrollStore: m,
126
- scrollNode: a,
160
+ headerNode: l,
161
+ scrollStore: s,
162
+ scrollNode: k,
127
163
  className: o,
128
- gamification: r
164
+ gamification: r,
165
+ responsiveStore: a,
166
+ style: !e && !C && w !== null ? {
167
+ height: "0",
168
+ overflow: "hidden"
169
+ } : {}
129
170
  })]
130
171
  });
131
172
  };
132
173
  export {
133
- Yr as GamificationOverlay
174
+ wt as GamificationOverlay
134
175
  };
@@ -1,13 +1,17 @@
1
1
  /// <reference types="react" />
2
2
  import { Features } from '@streamlayer/sdk-web-features';
3
3
  import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
4
+ import type { AppNodeRef, ScrollNodeRef, HeaderNodeRef } from '../masters';
5
+ import { ResponsiveStore } from '../useSdkResponsive';
4
6
  import { ScrollStore } from '../useSdkScroll';
5
7
  /** render feature by type */
6
8
  export declare const ActiveFeature: React.FC<{
7
9
  sdk: StreamLayerSDK;
8
10
  feature: Features | null;
9
11
  scrollStore: ScrollStore;
10
- appNode: React.MutableRefObject<HTMLDivElement | null>;
11
- scrollNode: React.MutableRefObject<HTMLDivElement | null>;
12
+ responsiveStore: ResponsiveStore;
13
+ appNode: AppNodeRef;
14
+ scrollNode: ScrollNodeRef;
15
+ headerNode: HeaderNodeRef;
12
16
  className?: string;
13
17
  }>;
@@ -1,28 +1,30 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
- import { lazy as l, useMemo as u, Suspense as f } from "react";
3
- import { FeatureType as a } from "@streamlayer/sdk-web-types";
4
- import { FeatureProvider as c } from "./FeatureProvider.js";
2
+ import { lazy as f, useMemo as c, Suspense as a } from "react";
3
+ import { FeatureType as g } from "@streamlayer/sdk-web-types";
4
+ import { FeatureProvider as y } from "./FeatureProvider.js";
5
5
  import "@nanostores/react";
6
6
  import "@streamlayer/sdk-web-interfaces";
7
- const g = l(() => import("./Gamification/gamification-feature.js")), x = ({ sdk: e, feature: t, className: r, scrollStore: n, appNode: o, scrollNode: m }) => {
8
- const p = u(() => t && t.featureConfig.get().type === a.GAMES ? /* @__PURE__ */ i(c, { className: r, sdk: e, feature: t, children: /* @__PURE__ */ i(
9
- g,
7
+ const h = f(() => import("./Gamification/gamification-feature.js")), A = ({ sdk: n, feature: t, className: r, scrollStore: e, appNode: o, scrollNode: m, headerNode: l, responsiveStore: p }) => {
8
+ const u = c(() => t && t.featureConfig.get().type === g.GAMES ? /* @__PURE__ */ i(y, { className: r, sdk: n, feature: t, children: /* @__PURE__ */ i(
9
+ h,
10
10
  {
11
11
  appNode: o,
12
- scrollStore: n,
12
+ scrollStore: e,
13
13
  scrollNode: m,
14
+ headerNode: l,
14
15
  className: r,
16
+ responsiveStore: p,
15
17
  gamification: t
16
18
  }
17
- ) }) : null, [e, t, r, n, m, o]);
19
+ ) }) : null, [n, t, r, p, e, m, o, l]);
18
20
  return /* @__PURE__ */ i(
19
- f,
21
+ a,
20
22
  {
21
23
  fallback: /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: "page loading..." }),
22
- children: p
24
+ children: u
23
25
  }
24
26
  );
25
27
  };
26
28
  export {
27
- x as ActiveFeature
29
+ A as ActiveFeature
28
30
  };
@@ -4,9 +4,10 @@ import { FeaturedGroupsButtonId } from '../../../navigation/button/FeaturedGroup
4
4
  import { LeaderBoardButtonId } from '../../../navigation/button/LeaderBoard';
5
5
  export { ChannelsButtonId, LeaderBoardButtonId, FeaturedGroupsButtonId };
6
6
  export type AvailableOverlays = typeof ChannelsButtonId | typeof LeaderBoardButtonId | typeof FeaturedGroupsButtonId;
7
- export declare const MastersNavigation: React.FC<{
7
+ type MastersNavigationProps = {
8
8
  activeOverlay: AvailableOverlays;
9
9
  setActiveOverlay: (overlay: AvailableOverlays) => void;
10
10
  sdkReady: boolean;
11
11
  className?: string;
12
- }>;
12
+ };
13
+ export declare const MastersNavigation: import("react").ForwardRefExoticComponent<MastersNavigationProps & import("react").RefAttributes<HTMLDivElement | null>>;
@@ -1,40 +1,46 @@
1
- import { jsxs as a, jsx as r } from "react/jsx-runtime";
2
- import { ChannelsButton as u, ChannelsButtonId as i } from "../../../navigation/button/Channels.js";
3
- import { FeaturedGroupsButton as s, FeaturedGroupsButtonId as m } from "../../../navigation/button/FeaturedGroups.js";
4
- import { LeaderBoardButton as e, LeaderBoardButtonId as n } from "../../../navigation/button/LeaderBoard.js";
5
- import { Navigation as B } from "../../../navigation/masters.js";
1
+ import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
+ import { forwardRef as d } from "react";
3
+ import { ChannelsButton as s, ChannelsButtonId as n } from "../../../navigation/button/Channels.js";
4
+ import { FeaturedGroupsButton as u, FeaturedGroupsButtonId as m } from "../../../navigation/button/FeaturedGroups.js";
5
+ import { LeaderBoardButtonId as b } from "../../../navigation/button/LeaderBoard.js";
6
+ import { Navigation as f, NavigationItems as B } from "../../../navigation/masters.js";
6
7
  import "@linaria/react";
7
8
  import "../../../icons/index.js";
8
- import "react";
9
9
  import "../../../navigation/button/index.js";
10
10
  import "../../../navigation/button/styles.js";
11
- import "../../../../LeaderBoard_fzzlxb-w40geAFS.js";
12
11
  import "../../../navigation/index.js";
13
- import "../../../../index_ej4hfx-w40geAFS.js";
14
- import "../../../../masters_m6itlr-w40geAFS.js";
15
- const b = ({ activeOverlay: o, setActiveOverlay: t, sdkReady: p, className: d }) => /* @__PURE__ */ a(B, { className: d, children: [
16
- /* @__PURE__ */ r(u, { active: o === i, onClick: () => t(i) }),
17
- /* @__PURE__ */ r(
18
- s,
19
- {
20
- active: o === m,
21
- disabled: !p,
22
- onClick: () => {
23
- t(m);
12
+ const v = d(
13
+ ({ activeOverlay: t, setActiveOverlay: r, sdkReady: a, className: e }, p) => /* @__PURE__ */ i(f, { className: e, children: [
14
+ /* @__PURE__ */ i(B, { children: [
15
+ /* @__PURE__ */ o(
16
+ s,
17
+ {
18
+ active: t === n,
19
+ onClick: () => r(n)
20
+ }
21
+ ),
22
+ /* @__PURE__ */ o(
23
+ u,
24
+ {
25
+ active: t === m,
26
+ disabled: !a,
27
+ onClick: () => {
28
+ r(m);
29
+ }
30
+ }
31
+ )
32
+ ] }),
33
+ /* @__PURE__ */ o(
34
+ "div",
35
+ {
36
+ ref: p
24
37
  }
25
- }
26
- ),
27
- /* @__PURE__ */ r(
28
- e,
29
- {
30
- active: o === n,
31
- onClick: () => t(n)
32
- }
33
- )
34
- ] });
38
+ )
39
+ ] })
40
+ );
35
41
  export {
36
- i as ChannelsButtonId,
42
+ n as ChannelsButtonId,
37
43
  m as FeaturedGroupsButtonId,
38
- n as LeaderBoardButtonId,
39
- b as MastersNavigation
44
+ b as LeaderBoardButtonId,
45
+ v as MastersNavigation
40
46
  };
@@ -1,17 +1,16 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { useStore as s } from "@nanostores/react";
3
- import { useMemo as m } from "react";
3
+ import { useMemo as e } from "react";
4
4
  import { AvailableFeatures as d } from "@streamlayer/sdk-web-features";
5
5
  import { Navigation as v } from "../../navigation/index.js";
6
6
  import { Button as b } from "../../navigation/button/index.js";
7
7
  import "@linaria/react";
8
- import "../../../index_ej4hfx-w40geAFS.js";
9
8
  import "../../navigation/button/styles.js";
10
- const h = ({ customOverlays: p, activeButton: e, sdk: i }) => {
11
- const t = s(i.sdkStore.organizationSettings), r = s(i.sdkStore.streamSettings), a = m(() => {
9
+ const N = ({ customOverlays: p, activeButton: m, sdk: i }) => {
10
+ const t = s(i.sdkStore.organizationSettings), r = s(i.sdkStore.streamSettings), a = e(() => {
12
11
  const o = (r == null ? void 0 : r.data) || (t == null ? void 0 : t.data);
13
12
  return o != null && o.overlays ? o.overlays : [];
14
- }, [t, r]), c = m(
13
+ }, [t, r]), c = e(
15
14
  () => [
16
15
  ...a.filter(({ enableSdkButton: o }) => o).map((o) => ({
17
16
  id: o.type,
@@ -26,8 +25,8 @@ const h = ({ customOverlays: p, activeButton: e, sdk: i }) => {
26
25
  ].sort((o, l) => o.position - l.position),
27
26
  [a, i, p]
28
27
  );
29
- return /* @__PURE__ */ n(v, { children: c.map((o) => /* @__PURE__ */ n(b, { ...o, active: o.id === e })) });
28
+ return /* @__PURE__ */ n(v, { children: c.map((o) => /* @__PURE__ */ n(b, { ...o, active: o.id === m })) });
30
29
  };
31
30
  export {
32
- h as SDKNavigation
31
+ N as SDKNavigation
33
32
  };
@@ -1,10 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
3
3
  import { type Notification } from '@streamlayer/sdk-web-notifications';
4
+ import { HeaderNodeRef, type AppNodeRef } from '../../masters';
4
5
  export declare const Onboarding: React.FC<{
5
6
  sdk: StreamLayerSDK;
6
7
  notification: Notification;
7
8
  saveHeight: (height: number) => void;
8
- appNode: React.MutableRefObject<HTMLDivElement | null>;
9
+ renderToNode: AppNodeRef | HeaderNodeRef;
9
10
  style?: React.CSSProperties;
10
11
  }>;