@streamlayer/react-ui 0.91.1 → 0.92.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 (59) hide show
  1. package/lib/assets/style.css +1 -1
  2. package/lib/index-keh7OLCY.js +67 -0
  3. package/lib/ui/app/Features/Gamification/Friends.d.ts +2 -1
  4. package/lib/ui/app/Features/Gamification/Friends.js +6 -6
  5. package/lib/ui/app/Features/Gamification/Leaderboard.d.ts +3 -2
  6. package/lib/ui/app/Features/Gamification/Leaderboard.js +26 -24
  7. package/lib/ui/app/Features/Gamification/Question.js +1 -1
  8. package/lib/ui/app/Features/Gamification/Tabs.d.ts +7 -2
  9. package/lib/ui/app/Features/Gamification/Tabs.js +35 -28
  10. package/lib/ui/app/Features/Gamification/gamification-feature.js +1 -1
  11. package/lib/ui/app/Features/Gamification/index.d.ts +6 -2
  12. package/lib/ui/app/Features/Gamification/index.js +81 -44
  13. package/lib/ui/app/Features/index.d.ts +6 -2
  14. package/lib/ui/app/Features/index.js +13 -11
  15. package/lib/ui/app/Navigation/MastersNavigation/index.d.ts +3 -2
  16. package/lib/ui/app/Navigation/MastersNavigation/index.js +34 -30
  17. package/lib/ui/app/Navigation/index.js +6 -7
  18. package/lib/ui/app/Notifications/Onboarding/index.d.ts +2 -1
  19. package/lib/ui/app/Notifications/Onboarding/index.js +53 -46
  20. package/lib/ui/app/Notifications/index.d.ts +6 -2
  21. package/lib/ui/app/Notifications/index.js +114 -90
  22. package/lib/ui/app/masters.d.ts +7 -0
  23. package/lib/ui/app/masters.js +67 -51
  24. package/lib/ui/app/useClipboardCopy.d.ts +2 -1
  25. package/lib/ui/app/useMastersApp.js +15 -14
  26. package/lib/ui/app/useSdkResponsive.d.ts +14 -0
  27. package/lib/ui/app/useSdkResponsive.js +46 -0
  28. package/lib/ui/app/useSdkScroll.d.ts +3 -1
  29. package/lib/ui/app/useSdkScroll.js +28 -85
  30. package/lib/ui/gamification/leaderboard/static.d.ts +2 -1
  31. package/lib/ui/gamification/onboarding/index.d.ts +4 -0
  32. package/lib/ui/gamification/onboarding/index.js +56 -40
  33. package/lib/ui/gamification/onboarding/invitingUser/index.d.ts +7 -0
  34. package/lib/ui/gamification/onboarding/invitingUser/index.js +16 -0
  35. package/lib/ui/gamification/onboarding/invitingUser/styles.d.ts +5 -0
  36. package/lib/ui/gamification/onboarding/invitingUser/styles.js +24 -0
  37. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.d.ts +2 -1
  38. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +1 -1
  39. package/lib/ui/gamification/onboarding/slides/onboarding-rules/index.d.ts +2 -0
  40. package/lib/ui/gamification/onboarding/slides/onboarding-rules/index.js +18 -12
  41. package/lib/ui/gamification/onboarding/slides/onboarding-terms/index.d.ts +7 -0
  42. package/lib/ui/gamification/onboarding/slides/onboarding-terms/index.js +10 -0
  43. package/lib/ui/gamification/onboarding/slides/onboarding-terms/styles.d.ts +5 -0
  44. package/lib/ui/gamification/onboarding/slides/onboarding-terms/styles.js +24 -0
  45. package/lib/ui/gamification/vote/index.js +43 -43
  46. package/lib/ui/gamification/vote/styles.d.ts +1 -0
  47. package/lib/ui/gamification/vote/styles.js +17 -11
  48. package/lib/ui/gamification/vote/vote-option/index.js +20 -20
  49. package/lib/ui/navigation/button/LeaderBoard.js +5 -6
  50. package/lib/ui/navigation/index.js +6 -7
  51. package/lib/ui/navigation/masters.js +3 -5
  52. package/lib/ui/questions/insight/index.js +24 -25
  53. package/lib/utils/createDemo.js +12 -13
  54. package/lib/utils/debug/components/copyLogs.js +10 -9
  55. package/package.json +11 -11
  56. package/lib/LeaderBoard_fzzlxb-w40geAFS.js +0 -1
  57. package/lib/index_ej4hfx-w40geAFS.js +0 -1
  58. package/lib/masters_m6itlr-w40geAFS.js +0 -1
  59. package/lib/utils/useStreamLayerApp.js +0 -25
@@ -1,16 +1,17 @@
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";
1
+ import { jsxs as c, jsx as o } from "react/jsx-runtime";
2
+ import { useRef as f, useEffect as N } from "react";
3
+ import { resetCss as u } from "../theme/theme.js";
4
+ import { ActiveFeature as A } from "./Features/index.js";
5
+ import { MastersNavigation as C } from "./Navigation/MastersNavigation/index.js";
6
+ import { SDKNotifications as I } from "./Notifications/index.js";
7
+ import { SDKContainer as x, SDKScrollContainer as B } from "./styles.js";
8
+ import { useMastersApp as F } from "./useMastersApp.js";
9
+ import { useSdkFeature as j } from "./useSdkFeature.js";
10
+ import { useSdkResponsive as k } from "./useSdkResponsive.js";
11
+ import { useSdkScroll as D } from "./useSdkScroll.js";
12
+ import { ChannelsButtonId as E } from "../navigation/button/Channels.js";
13
+ import { LeaderBoardButtonId as K } from "../navigation/button/LeaderBoard.js";
14
+ import { FeaturedGroupsButtonId as L } from "../navigation/button/FeaturedGroups.js";
14
15
  import "../theme/constants.js";
15
16
  import "@streamlayer/sdk-web-types";
16
17
  import "./Features/FeatureProvider.js";
@@ -19,12 +20,12 @@ import "@streamlayer/sdk-web-interfaces";
19
20
  import "../navigation/masters.js";
20
21
  import "@linaria/react";
21
22
  import "../navigation/index.js";
22
- import "../../index_ej4hfx-w40geAFS.js";
23
- import "../../masters_m6itlr-w40geAFS.js";
23
+ import "../icons/index.js";
24
+ import "../navigation/button/index.js";
25
+ import "../navigation/button/styles.js";
24
26
  import "../../useClipboardCopy-E5rEe6It.js";
25
27
  import "../../index-uEuzH3jr.js";
26
28
  import "../gamification/copyNotification/index.js";
27
- import "../icons/index.js";
28
29
  import "../gamification/copyNotification/styles.js";
29
30
  import "@streamlayer/sdk-web-notifications";
30
31
  import "../gamification/constants.js";
@@ -55,6 +56,8 @@ import "../gamification/onboarding/slides/onboarding-invite-card/index.js";
55
56
  import "../gamification/onboarding/slides/onboarding-invite-card/styles.js";
56
57
  import "../gamification/onboarding/slides/onboarding-rules/index.js";
57
58
  import "../gamification/onboarding/slides/onboarding-rules/styles.js";
59
+ import "../gamification/onboarding/slides/onboarding-terms/index.js";
60
+ import "../gamification/onboarding/slides/onboarding-terms/styles.js";
58
61
  import "../gamification/onboarding/styles.js";
59
62
  import "../button/index.js";
60
63
  import "../button/styles.js";
@@ -63,55 +66,68 @@ import "./Notifications/Onboarding/Notification/styles.js";
63
66
  import "./Notifications/styles.js";
64
67
  import "../gamification/question/notification/pill/index.js";
65
68
  import "../gamification/question/notification/pill/styles.js";
66
- import "../navigation/button/styles.js";
67
- import "../../LeaderBoard_fzzlxb-w40geAFS.js";
68
- import "../navigation/button/index.js";
69
69
  import "lodash.throttle";
70
- const K = ({ sdk: t, className: p, scrollStore: e, appNode: r, scrollNode: a }) => {
71
- const [, o] = B(t);
72
- return /* @__PURE__ */ m(
73
- y,
70
+ import "../../index-keh7OLCY.js";
71
+ const M = ({ sdk: r, className: s, scrollStore: n, appNode: t, scrollNode: i, headerNode: m, responsiveStore: p }) => {
72
+ const [, a] = j(r);
73
+ return /* @__PURE__ */ o(
74
+ A,
74
75
  {
75
- className: p,
76
- scrollNode: a,
77
- appNode: r,
78
- scrollStore: e,
79
- feature: o,
80
- sdk: t
76
+ className: s,
77
+ scrollNode: i,
78
+ appNode: t,
79
+ scrollStore: n,
80
+ feature: a,
81
+ headerNode: m,
82
+ responsiveStore: p,
83
+ sdk: r
81
84
  }
82
85
  );
83
- }, Qt = ({ sdk: t, overlays: p, children: e }) => {
84
- const [r, a] = F(), o = g(null), { sdkEnabled: s, sdkReady: n, activeOverlay: i, activateAndLoadOverlay: l, activateEventWithId: f, deactivate: u, isLogged: v } = x(t);
85
- return h(() => {
86
+ }, Xt = ({ sdk: r, overlays: s, children: n }) => {
87
+ const t = f(null), i = f(null), [m] = k(t), [p, a] = D(t, m), { sdkEnabled: d, sdkReady: l, activeOverlay: e, activateAndLoadOverlay: v, activateEventWithId: S, deactivate: h, isLogged: g } = F(r);
88
+ return N(() => {
86
89
  import("./Features/Gamification/gamification-feature.js");
87
- }, []), /* @__PURE__ */ c(C, { ref: o, children: [
88
- s && /* @__PURE__ */ m(
89
- N,
90
+ }, []), /* @__PURE__ */ c(x, { ref: t, children: [
91
+ d && /* @__PURE__ */ o(
92
+ C,
90
93
  {
91
- sdkReady: n,
92
- activeOverlay: i,
93
- className: d,
94
- setActiveOverlay: (S) => l("", S)
94
+ ref: i,
95
+ sdkReady: l,
96
+ activeOverlay: e,
97
+ className: u,
98
+ setActiveOverlay: (y) => v("", y)
95
99
  }
96
100
  ),
97
- /* @__PURE__ */ c(I, { ref: r, "data-nav": s.toString(), children: [
98
- n && /* @__PURE__ */ m(A, { sdk: t, scrollNode: r, appNode: o, scrollStore: a }),
99
- (!s || i === j) && e && e({ activateEventWithId: f, deactivate: u }),
100
- p && i === D && p[i],
101
- n && i === E && /* @__PURE__ */ m(
102
- K,
101
+ /* @__PURE__ */ c(B, { ref: p, "data-nav": d.toString(), children: [
102
+ l && /* @__PURE__ */ o(
103
+ I,
104
+ {
105
+ sdk: r,
106
+ scrollNode: p,
107
+ headerNode: i,
108
+ appNode: t,
109
+ scrollStore: a,
110
+ responsiveStore: m
111
+ }
112
+ ),
113
+ /* @__PURE__ */ o("div", { style: !d || e === E ? {} : { display: "none" }, children: n && n({ activateEventWithId: S, deactivate: h }) }),
114
+ s && e === K && s[e],
115
+ l && e === L && /* @__PURE__ */ o(
116
+ M,
103
117
  {
104
118
  scrollStore: a,
105
- scrollNode: r,
106
- appNode: o,
107
- className: d,
108
- sdk: t
119
+ responsiveStore: m,
120
+ scrollNode: p,
121
+ appNode: t,
122
+ headerNode: i,
123
+ className: u,
124
+ sdk: r
109
125
  }
110
126
  )
111
127
  ] }),
112
- !v && /* @__PURE__ */ m("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: "You are not logged in." })
128
+ d && !g && /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: "You are not logged in." })
113
129
  ] });
114
130
  };
115
131
  export {
116
- Qt as MastersApp
132
+ Xt as MastersApp
117
133
  };
@@ -1,2 +1,3 @@
1
1
  /// <reference types="react" />
2
- export declare const useClipboardCopy: (appNode: React.MutableRefObject<HTMLDivElement | null>) => [(link: string | undefined) => Promise<void>, import("react").ReactPortal | null];
2
+ import { HeaderNodeRef, type AppNodeRef } from './masters';
3
+ export declare const useClipboardCopy: (renderToNode: AppNodeRef | HeaderNodeRef) => [(link: string | undefined) => Promise<void>, import("react").ReactPortal | null];
@@ -1,18 +1,19 @@
1
- import { useStore as m } from "@nanostores/react";
1
+ import { useStore as l } from "@nanostores/react";
2
2
  import { useRef as h, useState as d, useCallback as F, useEffect as v } from "react";
3
3
  import { FeatureType as y } from "@streamlayer/sdk-web-types";
4
- import "react/jsx-runtime";
5
- import { ChannelsButtonId as c } from "../navigation/button/Channels.js";
4
+ import "./Navigation/MastersNavigation/index.js";
6
5
  import { FeaturedGroupsButtonId as n } from "../navigation/button/FeaturedGroups.js";
6
+ import { ChannelsButtonId as c } from "../navigation/button/Channels.js";
7
+ import "react/jsx-runtime";
8
+ import "../navigation/button/LeaderBoard.js";
7
9
  import "@linaria/react";
8
10
  import "../icons/index.js";
9
- import "../navigation/button/styles.js";
10
- import "../../LeaderBoard_fzzlxb-w40geAFS.js";
11
- import "../../index_ej4hfx-w40geAFS.js";
12
- import "../../masters_m6itlr-w40geAFS.js";
13
11
  import "../navigation/button/index.js";
14
- const U = (t) => {
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(
12
+ import "../navigation/button/styles.js";
13
+ import "../navigation/masters.js";
14
+ import "../navigation/index.js";
15
+ const W = (t) => {
16
+ const a = h(""), [m, f] = d(!1), A = l(t.status), r = l(t.userId()), i = A === "ready", [s, u] = d(n), p = F(
16
17
  (e, o) => {
17
18
  u(o), o === n ? (e && t.createEventSession(e), window.requestAnimationFrame(() => {
18
19
  t.openFeature(y.GAMES);
@@ -24,7 +25,7 @@ const U = (t) => {
24
25
  !i && s === n && (u(c), t.closeFeature(!0));
25
26
  }, [i, s, t]);
26
27
  const S = (e) => {
27
- a.current = e, l(!0), t.initializeApp({ skipOrganizationSettings: !0 }).then(({ enabled: o, err: b }) => {
28
+ a.current = e, f(!0), t.initializeApp({ skipOrganizationSettings: !0 }).then(({ enabled: o, err: b }) => {
28
29
  if (b) {
29
30
  p(e, c);
30
31
  return;
@@ -41,18 +42,18 @@ const U = (t) => {
41
42
  }
42
43
  });
43
44
  }, E = () => {
44
- l(!1), t.disableApp();
45
+ f(!1), t.disableApp();
45
46
  };
46
47
  return v(() => {
47
48
  if (!r) {
48
49
  i && (u(c), t.disableApp());
49
50
  return;
50
51
  }
51
- r && a.current && f && t.initializeApp({ skipOrganizationSettings: !0 }).then(() => {
52
+ r && a.current && m && t.initializeApp({ skipOrganizationSettings: !0 }).then(() => {
52
53
  t.createEventSession(a.current);
53
54
  });
54
55
  }, [r]), {
55
- sdkEnabled: f,
56
+ sdkEnabled: m,
56
57
  sdkReady: i,
57
58
  activeOverlay: s,
58
59
  activateAndLoadOverlay: p,
@@ -62,5 +63,5 @@ const U = (t) => {
62
63
  };
63
64
  };
64
65
  export {
65
- U as useMastersApp
66
+ W as useMastersApp
66
67
  };
@@ -0,0 +1,14 @@
1
+ import { MapStore } from 'nanostores';
2
+ import { BREAKPOINTS } from '../theme/constants';
3
+ type BREAKPOINTS_KEYS = keyof typeof BREAKPOINTS;
4
+ type ResponsiveData = {
5
+ screen: {
6
+ name: BREAKPOINTS_KEYS;
7
+ size: (typeof BREAKPOINTS)[BREAKPOINTS_KEYS];
8
+ };
9
+ sdkInView?: boolean;
10
+ sdkInScrollView?: boolean;
11
+ };
12
+ export type ResponsiveStore = MapStore<ResponsiveData>;
13
+ export declare const useSdkResponsive: (appNode: AppNodeRef) => [ResponsiveStore];
14
+ export {};
@@ -0,0 +1,46 @@
1
+ import c from "lodash.throttle";
2
+ import { useState as m, useEffect as u } from "react";
3
+ import { BREAKPOINTS as s } from "../theme/constants.js";
4
+ import { m as k } from "../../index-keh7OLCY.js";
5
+ import "../../index-uEuzH3jr.js";
6
+ const d = Object.keys(s), i = () => {
7
+ const n = window.innerWidth;
8
+ let e = "sm";
9
+ for (let t = d.length - 1; t > 0; t--) {
10
+ const r = d[t];
11
+ if (!(n < s[r]) && n >= s[r]) {
12
+ e = r;
13
+ break;
14
+ }
15
+ }
16
+ return {
17
+ name: e,
18
+ size: s[e]
19
+ };
20
+ }, l = (n) => {
21
+ var e;
22
+ return (((e = n.current) == null ? void 0 : e.getBoundingClientRect().y) || 0) < -68;
23
+ }, w = (n) => n >= s.xl, I = (n) => {
24
+ const [e] = m(() => {
25
+ const t = i();
26
+ return k({
27
+ screen: i(),
28
+ sdkInView: l(n),
29
+ sdkInScrollView: w(t.size)
30
+ });
31
+ });
32
+ return u(() => {
33
+ const t = c(() => {
34
+ e.setKey("sdkInView", l(n));
35
+ }, 200), r = c(() => {
36
+ const o = i();
37
+ e.setKey("screen", o), e.setKey("sdkInScrollView", w(o.size));
38
+ }, 200);
39
+ return window.addEventListener("scroll", t), window.addEventListener("resize", r), e.subscribe((o) => console.log(o)), () => {
40
+ window.removeEventListener("scroll", t), window.removeEventListener("resize", r);
41
+ };
42
+ }, [e, n]), [e];
43
+ };
44
+ export {
45
+ I as useSdkResponsive
46
+ };
@@ -1,9 +1,11 @@
1
1
  import { MapStore } from 'nanostores';
2
+ import { type ScrollNodeRef } from './masters';
3
+ import { type ResponsiveStore } from './useSdkResponsive';
2
4
  type ScrollData = {
3
5
  scrollPosition: number;
4
6
  tabsShown?: boolean;
5
7
  scrollDirection: 'forward' | 'backward';
6
8
  };
7
9
  export type ScrollStore = MapStore<ScrollData>;
8
- export declare const useSdkScroll: () => [React.MutableRefObject<HTMLDivElement | null>, ScrollStore];
10
+ export declare const useSdkScroll: (appNode: AppNodeRef, responsiveStore: ResponsiveStore) => [ScrollNodeRef, ScrollStore];
9
11
  export {};
@@ -1,93 +1,36 @@
1
- import a from "lodash.throttle";
2
- import { useRef as f, useState as v, useCallback as p, useEffect as d } from "react";
3
- import { p as m } from "../../index-uEuzH3jr.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.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({
1
+ import { useStore as p } from "@nanostores/react";
2
+ import w from "lodash.throttle";
3
+ import { useRef as a, useState as S, useEffect as g } from "react";
4
+ import { BREAKPOINTS as h } from "../theme/constants.js";
5
+ import { m as v } from "../../index-keh7OLCY.js";
6
+ import "../../index-uEuzH3jr.js";
7
+ const L = (e, f) => {
8
+ const n = a(null), s = a(0), [o] = S(
9
+ v({
70
10
  scrollPosition: 0,
71
11
  scrollDirection: "forward"
72
12
  })
73
- ), e = p(
74
- a((o) => {
75
- const s = o.target;
76
- if (!s)
13
+ ), l = p(f);
14
+ return g(() => {
15
+ const t = window.innerWidth < 1200 ? window : n.current;
16
+ if (!t)
17
+ return () => {
18
+ };
19
+ const c = w((m) => {
20
+ var u;
21
+ const i = m.target;
22
+ if (!i)
77
23
  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 d(() => {
84
- const o = i.current;
85
- return o ? (o.addEventListener("scroll", e), () => {
86
- o.removeEventListener("scroll", e);
87
- }) : () => {
24
+ let r = 0;
25
+ l.screen.size <= h.xl ? r = ((u = e.current) == null ? void 0 : u.getBoundingClientRect().y) || 0 : r = i.scrollTop;
26
+ const d = s.current < r ? "forward" : "backward";
27
+ s.current = r, o.set({ scrollPosition: r, scrollDirection: d, tabsShown: o.get().tabsShown });
28
+ }, 200);
29
+ return t.addEventListener("scroll", c), () => {
30
+ t.removeEventListener("scroll", c);
88
31
  };
89
- }, [e]), [i, l];
32
+ }, [o, e, l.screen]), [n, o];
90
33
  };
91
34
  export {
92
- w as useSdkScroll
35
+ L as useSdkScroll
93
36
  };
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { type ScrollNodeRef } from '../../app/masters';
2
3
  import { ScrollStore } from '../../app/useSdkScroll';
3
4
  import { LeaderboardItemProps } from './list-item';
4
5
  type LeaderboardListProps = {
@@ -6,7 +7,7 @@ type LeaderboardListProps = {
6
7
  currentUserId?: string;
7
8
  openItemDetail: (id: string) => void;
8
9
  fetchMore: () => void;
9
- scrollNode: React.MutableRefObject<HTMLDivElement | null>;
10
+ scrollNode: ScrollNodeRef;
10
11
  scrollStore: ScrollStore;
11
12
  hasMore: boolean;
12
13
  };
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { Gamification } from '@streamlayer/feature-gamification';
3
+ import { HeaderNodeRef, type AppNodeRef } from '../../app/masters';
3
4
  import { OnboardingStep } from './slides/onboarding-instructions';
4
5
  import { OnboardingInviteCardProps } from './slides/onboarding-invite-card';
5
6
  import { OnboardingRule } from './slides/onboarding-rules';
@@ -9,8 +10,11 @@ type OnboardingType = OnboardingInviteCardProps & {
9
10
  rules?: OnboardingRule[];
10
11
  rulesBtnLabel?: string;
11
12
  rulesTitle?: string;
13
+ termsTitle?: string;
14
+ termsText?: string;
12
15
  primaryColor?: string;
13
16
  inviteCardBtnLabel?: string;
17
+ renderToNode: AppNodeRef | HeaderNodeRef;
14
18
  onClose: () => void;
15
19
  };
16
20
  export declare const Onboarding: React.FC<OnboardingType>;
@@ -1,10 +1,11 @@
1
- import { jsx as o, jsxs as g } from "react/jsx-runtime";
2
- import { useState as h, useEffect as k, useMemo as D, useCallback as T } from "react";
3
- import j from "react-virtualized-auto-sizer";
4
- import { OnboardingInstructions as w } from "./slides/onboarding-instructions/index.js";
5
- import { OnboardingInviteCard as A } from "./slides/onboarding-invite-card/index.js";
6
- import { OnboardingRules as z } from "./slides/onboarding-rules/index.js";
7
- import { Container as E, OnboardingHeader as F, CloseBtn as G, IconClose as H, Content as M, OnboardingFooter as P, OnboardingActionBtn as R } from "./styles.js";
1
+ import { jsx as t, jsxs as C } from "react/jsx-runtime";
2
+ import { useState as c, useEffect as j, useMemo as w, useCallback as z } from "react";
3
+ import E from "react-virtualized-auto-sizer";
4
+ import { OnboardingInstructions as F } from "./slides/onboarding-instructions/index.js";
5
+ import { OnboardingInviteCard as G } from "./slides/onboarding-invite-card/index.js";
6
+ import { OnboardingRules as H } from "./slides/onboarding-rules/index.js";
7
+ import { OnboardingTerms as M } from "./slides/onboarding-terms/index.js";
8
+ import { Container as P, OnboardingHeader as R, CloseBtn as q, IconClose as J, Content as K, OnboardingFooter as Q, OnboardingActionBtn as U } from "./styles.js";
8
9
  import "./slides/onboarding-instructions/styles.js";
9
10
  import "@linaria/react";
10
11
  import "../../../useClipboardCopy-E5rEe6It.js";
@@ -14,54 +15,69 @@ import "../../icons/index.js";
14
15
  import "../copyNotification/styles.js";
15
16
  import "./slides/onboarding-invite-card/styles.js";
16
17
  import "./slides/onboarding-rules/styles.js";
18
+ import "./slides/onboarding-terms/styles.js";
17
19
  import "../../button/index.js";
18
20
  import "../../button/styles.js";
19
21
  const a = {
20
22
  steps: !1,
21
23
  rules: !1,
22
24
  inviteCard: !1
23
- }, oi = ({
24
- gamification: u,
25
- steps: i,
26
- rules: t,
25
+ }, gn = ({
26
+ gamification: p,
27
+ steps: n,
28
+ rules: r,
27
29
  rulesBtnLabel: m,
28
- rulesTitle: b,
29
- primaryColor: d,
30
- inviteLink: C,
31
- socialLinks: S,
32
- inviteCardTitle: p,
33
- inviteCardSubtext: y,
34
- inviteCardBtnLabel: c,
35
- onClose: O
30
+ rulesTitle: O,
31
+ termsTitle: S,
32
+ termsText: f,
33
+ primaryColor: g,
34
+ inviteLink: y,
35
+ socialLinks: v,
36
+ inviteCardTitle: s,
37
+ inviteCardSubtext: T,
38
+ inviteCardBtnLabel: u,
39
+ renderToNode: I,
40
+ onClose: N
36
41
  }) => {
37
- const [r, f] = h(0), [n, e] = h(a);
38
- k(() => {
39
- i != null && i.length ? e({ ...a, steps: !0 }) : t != null && t.length ? e({ ...a, rules: !0 }) : e({ ...a, inviteCard: !0 });
42
+ const [o, h] = c(0), [l, b] = c(!1), [i, e] = c(a);
43
+ j(() => {
44
+ n != null && n.length ? e({ ...a, steps: !0 }) : r != null && r.length ? e({ ...a, rules: !0 }) : e({ ...a, inviteCard: !0 });
40
45
  }, []);
41
- const v = D(() => n.steps && r === 0 ? "Continue" : n.rules ? m || "Got it" : n.inviteCard ? c || "Play Now" : "Next", [n, r, m, c]), I = T(() => {
42
- i != null && i.length && r < i.length - 1 ? f((l) => ++l) : t != null && t.length && n.steps ? e({ ...a, rules: !0 }) : n.rules && e({ ...a, inviteCard: !0 });
43
- }, [r, i == null ? void 0 : i.length, t == null ? void 0 : t.length, n, f, e]), x = async () => {
44
- await u.onboardingStatus.submitInplay();
46
+ const k = w(() => i.steps && o === 0 ? "Continue" : i.rules ? l || !m ? "Got it" : m : i.inviteCard ? u || "Play Now" : "Next", [i, o, l, m, u]), x = z(() => {
47
+ n != null && n.length && o < n.length - 1 ? h((d) => ++d) : r != null && r.length && i.steps ? e({ ...a, rules: !0 }) : i.rules && e({ ...a, inviteCard: !0 });
48
+ }, [o, n == null ? void 0 : n.length, r == null ? void 0 : r.length, i, h, e]), A = async () => {
49
+ i.inviteCard ? await p.onboardingStatus.submitInplay() : i.rules && l ? b(!1) : x();
45
50
  };
46
- return /* @__PURE__ */ o(j, { children: ({ width: l, height: N }) => /* @__PURE__ */ g(E, { style: { width: l, height: N }, children: [
47
- /* @__PURE__ */ o(F, { children: /* @__PURE__ */ o(G, { onClick: O, children: /* @__PURE__ */ o(H, { name: "icon-close-btn-gray" }) }) }),
48
- /* @__PURE__ */ g(M, { children: [
49
- n.steps && (i == null ? void 0 : i.length) && /* @__PURE__ */ o(w, { stepsCount: i.length, currentStep: r, ...i[r] }),
50
- n.rules && /* @__PURE__ */ o(z, { rules: t, rulesTitle: b, primaryColor: d }),
51
- n.inviteCard && /* @__PURE__ */ o(
52
- A,
51
+ return /* @__PURE__ */ t(E, { children: ({ width: d, height: D }) => /* @__PURE__ */ C(P, { style: { width: d, height: D }, children: [
52
+ /* @__PURE__ */ t(R, { children: /* @__PURE__ */ t(q, { onClick: N, children: /* @__PURE__ */ t(J, { name: "icon-close-btn-gray" }) }) }),
53
+ /* @__PURE__ */ C(K, { children: [
54
+ i.steps && (n == null ? void 0 : n.length) && /* @__PURE__ */ t(F, { stepsCount: n.length, currentStep: o, ...n[o] }),
55
+ i.rules && !l && /* @__PURE__ */ t(
56
+ H,
53
57
  {
54
- inviteLink: C,
55
- inviteCardTitle: p,
56
- inviteCardSubtext: y,
57
- primaryColor: d,
58
- socialLinks: S
58
+ rules: r,
59
+ rulesTitle: O,
60
+ termsText: f,
61
+ primaryColor: g,
62
+ openTerms: () => b(!0)
63
+ }
64
+ ),
65
+ i.rules && l && /* @__PURE__ */ t(M, { termsTitle: S, termsText: f }),
66
+ i.inviteCard && /* @__PURE__ */ t(
67
+ G,
68
+ {
69
+ inviteLink: y,
70
+ inviteCardTitle: s,
71
+ inviteCardSubtext: T,
72
+ primaryColor: g,
73
+ socialLinks: v,
74
+ renderToNode: I
59
75
  }
60
76
  )
61
77
  ] }),
62
- /* @__PURE__ */ o(P, { children: /* @__PURE__ */ o(R, { onClick: n.inviteCard ? x : I, children: v }) })
78
+ /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(U, { onClick: A, children: k }) })
63
79
  ] }) });
64
80
  };
65
81
  export {
66
- oi as Onboarding
82
+ gn as Onboarding
67
83
  };
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ type InvitingUserType = {
3
+ avatar?: string;
4
+ name?: string;
5
+ };
6
+ export declare const InvitingUser: React.FC<InvitingUserType>;
7
+ export {};
@@ -0,0 +1,16 @@
1
+ import { jsxs as r, jsx as o } from "react/jsx-runtime";
2
+ import { Container as t, Avatar as e, Content as s, Name as m } from "./styles.js";
3
+ import "@linaria/react";
4
+ const f = ({ avatar: i, name: n }) => /* @__PURE__ */ r(t, { children: [
5
+ i && /* @__PURE__ */ o(e, { src: i }),
6
+ /* @__PURE__ */ r(s, { children: [
7
+ /* @__PURE__ */ r(m, { children: [
8
+ n,
9
+ " "
10
+ ] }),
11
+ "is waiting for you!"
12
+ ] })
13
+ ] });
14
+ export {
15
+ f as InvitingUser
16
+ };
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare const Container: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
+ export declare const Avatar: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown>>;
4
+ export declare const Content: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
5
+ export declare const Name: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
@@ -0,0 +1,24 @@
1
+ import { styled as s } from "@linaria/react";
2
+ const n = /* @__PURE__ */ s("div")({
3
+ name: "Container",
4
+ class: "cl51m2q",
5
+ propsAsIs: !1
6
+ }), e = /* @__PURE__ */ s("img")({
7
+ name: "Avatar",
8
+ class: "a2yhhhr",
9
+ propsAsIs: !1
10
+ }), t = /* @__PURE__ */ s("div")({
11
+ name: "Content",
12
+ class: "c1dtxxlr",
13
+ propsAsIs: !1
14
+ }), o = /* @__PURE__ */ s("span")({
15
+ name: "Name",
16
+ class: "n12clm3w",
17
+ propsAsIs: !1
18
+ });
19
+ export {
20
+ e as Avatar,
21
+ n as Container,
22
+ t as Content,
23
+ o as Name
24
+ };