@streamlayer/react-ui 0.95.0 → 0.96.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 (41) hide show
  1. package/lib/assets/style.css +1 -1
  2. package/lib/ui/app/Features/Gamification/Question.js +38 -32
  3. package/lib/ui/app/Features/Gamification/QuestionsList.js +9 -8
  4. package/lib/ui/app/Features/Gamification/Tabs.js +3 -2
  5. package/lib/ui/app/Features/Gamification/gamification-feature.js +1 -0
  6. package/lib/ui/app/Features/Gamification/index.js +26 -25
  7. package/lib/ui/app/Notifications/Onboarding/index.js +90 -77
  8. package/lib/ui/app/Notifications/index.js +80 -74
  9. package/lib/ui/app/masters.js +59 -48
  10. package/lib/ui/app/useMastersApp.js +39 -38
  11. package/lib/ui/app/useMastersContext.d.ts +8 -0
  12. package/lib/ui/app/useMastersContext.js +8 -0
  13. package/lib/ui/app/useSdkResponsive.d.ts +2 -2
  14. package/lib/ui/gamification/onboarding/index.d.ts +4 -1
  15. package/lib/ui/gamification/onboarding/index.js +56 -48
  16. package/lib/ui/gamification/onboarding/invitingUser/index.js +10 -8
  17. package/lib/ui/gamification/onboarding/invitingUser/styles.d.ts +1 -0
  18. package/lib/ui/gamification/onboarding/invitingUser/styles.js +12 -7
  19. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +1 -0
  20. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.js +21 -16
  21. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.d.ts +1 -0
  22. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.js +11 -6
  23. package/lib/ui/gamification/question/insight/index.d.ts +6 -2
  24. package/lib/ui/gamification/question/insight/index.js +1 -5
  25. package/lib/ui/gamification/question/list/index.d.ts +2 -0
  26. package/lib/ui/gamification/question/list/index.js +22 -13
  27. package/lib/ui/gamification/question/notification/index.d.ts +2 -1
  28. package/lib/ui/gamification/question/notification/index.js +20 -19
  29. package/lib/ui/gamification/question/notification/insight/index.d.ts +3 -1
  30. package/lib/ui/gamification/question/notification/insight/index.js +11 -11
  31. package/lib/ui/gamification/question/twitter/index.d.ts +6 -2
  32. package/lib/ui/gamification/question/twitter/index.js +1 -4
  33. package/lib/ui/modal/index.d.ts +7 -2
  34. package/lib/ui/modal/index.js +32 -22
  35. package/lib/ui/questions/insight/index.d.ts +2 -0
  36. package/lib/ui/questions/insight/index.js +23 -11
  37. package/lib/ui/questions/twitter/index.d.ts +2 -0
  38. package/lib/ui/questions/twitter/index.js +14 -13
  39. package/lib/ui/video-player/index.d.ts +5 -0
  40. package/lib/ui/video-player/index.js +43 -35
  41. package/package.json +14 -13
@@ -1,14 +1,15 @@
1
- import { jsx as e, jsxs as k, Fragment as b } from "react/jsx-runtime";
2
- import { useStore as a } from "@nanostores/react";
3
- import { useState as w, useMemo as O, useEffect as I, useRef as x, useCallback as R } from "react";
1
+ import { jsx as m, jsxs as w, Fragment as b } from "react/jsx-runtime";
2
+ import { useStore as k } from "@nanostores/react";
3
+ import { useState as y, useMemo as O, useEffect as I, useRef as E, useCallback as R } from "react";
4
4
  import { r as P } from "../../../index-jRXrW6ie.js";
5
- import { NotificationType as d } from "@streamlayer/sdk-web-notifications";
6
- import { scrollIntoAppView as q } from "../useSdkScroll.js";
7
- import { QuestionTypeData as A } from "../../gamification/constants.js";
5
+ import { NotificationType as g } from "@streamlayer/sdk-web-notifications";
6
+ import { useMastersContext as q } from "../useMastersContext.js";
7
+ import { scrollIntoAppView as A } from "../useSdkScroll.js";
8
+ import { QuestionTypeData as B } from "../../gamification/constants.js";
8
9
  import { Notification as T } from "../../gamification/question/notification/index.js";
9
- import { PredictionResult as B } from "../../gamification/question/notification/prediction-result/index.js";
10
- import { Onboarding as H } from "./Onboarding/index.js";
11
- import { Pill as Q, HiddenContainer as j, Container as z, InnerContainer as F, NotificationRefreshing as G } from "./styles.js";
10
+ import { PredictionResult as H } from "../../gamification/question/notification/prediction-result/index.js";
11
+ import { Onboarding as Q } from "./Onboarding/index.js";
12
+ import { Pill as j, HiddenContainer as z, Container as F, InnerContainer as G, NotificationRefreshing as M } from "./styles.js";
12
13
  import "../../../index-uEuzH3jr.js";
13
14
  import "lodash.throttle";
14
15
  import "../../theme/constants.js";
@@ -41,6 +42,8 @@ import "react-virtualized-auto-sizer";
41
42
  import "../../skeleton/index.js";
42
43
  import "../../skeleton/styles.js";
43
44
  import "../../gamification/onboarding/slides/onboarding-instructions/index.js";
45
+ import "../../gamification/onboarding/invitingUser/index.js";
46
+ import "../../gamification/onboarding/invitingUser/styles.js";
44
47
  import "../../gamification/onboarding/slides/onboarding-instructions/styles.js";
45
48
  import "../../gamification/onboarding/slides/onboarding-invite-card/index.js";
46
49
  import "../useClipboardCopy.js";
@@ -59,124 +62,127 @@ import "./Onboarding/Notification/index.js";
59
62
  import "./Onboarding/Notification/styles.js";
60
63
  import "../../gamification/question/notification/pill/index.js";
61
64
  import "../../gamification/question/notification/pill/styles.js";
62
- const S = (s) => {
63
- const [t, p] = w(0), i = x(null), m = R((o) => {
64
- i.current = o;
65
+ const U = (p) => {
66
+ const [t, n] = y(0), i = E(null), e = R((r) => {
67
+ i.current = r;
65
68
  }, []);
66
69
  I(() => {
67
- var r;
68
- const o = (r = i.current) == null ? void 0 : r.getBoundingClientRect();
69
- o && p(o.height);
70
- }, [s]);
71
- const n = R((o) => {
72
- p(o);
70
+ var o;
71
+ const r = (o = i.current) == null ? void 0 : o.getBoundingClientRect();
72
+ r && n(r.height);
73
+ }, [p]);
74
+ const s = R((r) => {
75
+ n(r);
73
76
  }, []);
74
- return [m, t, n];
75
- }, U = ({
76
- sdk: s,
77
+ return [e, t, s];
78
+ }, K = ({
79
+ sdk: p,
77
80
  notification: t,
78
- appNode: p,
81
+ appNode: n,
79
82
  sdkInDesktopView: i
80
83
  }) => {
81
- var r, c;
82
- const [m, n, o] = S(t.id);
83
- return t.type === d.QUESTION ? /* @__PURE__ */ k(b, {
84
- children: [/* @__PURE__ */ e(j, {
85
- ref: m,
86
- children: /* @__PURE__ */ e(T, {
84
+ var c, u;
85
+ const {
86
+ sdk: e
87
+ } = q(), [s, r, o] = U(t.id);
88
+ return t.type === g.QUESTION ? /* @__PURE__ */ w(b, {
89
+ children: [/* @__PURE__ */ m(z, {
90
+ ref: s,
91
+ children: /* @__PURE__ */ m(T, {
87
92
  ...t
88
93
  })
89
- }), /* @__PURE__ */ k(z, {
94
+ }), /* @__PURE__ */ w(F, {
90
95
  style: {
91
- height: t.hiding ? 0 : n
96
+ height: t.hiding ? 0 : r
92
97
  },
93
98
  hiding: t.hiding,
94
- children: [/* @__PURE__ */ e(F, {
99
+ children: [/* @__PURE__ */ m(G, {
95
100
  style: {
96
101
  height: "100%"
97
102
  },
98
- children: /* @__PURE__ */ e(T, {
99
- ...t
103
+ children: /* @__PURE__ */ m(T, {
104
+ ...t,
105
+ controlVideo: e == null ? void 0 : e.controlVideoPlayer
100
106
  })
101
- }), /* @__PURE__ */ e(G, {}, t.id)]
107
+ }), /* @__PURE__ */ m(M, {}, t.id)]
102
108
  })]
103
- }) : t.type === d.QUESTION_RESOLVED && ((c = (r = t.data) == null ? void 0 : r.question) != null && c.predictionResult) ? /* @__PURE__ */ e(B, {
109
+ }) : t.type === g.QUESTION_RESOLVED && ((u = (c = t.data) == null ? void 0 : c.question) != null && u.predictionResult) ? /* @__PURE__ */ m(H, {
104
110
  style: {
105
- height: t.hiding ? 0 : n
111
+ height: t.hiding ? 0 : r
106
112
  },
107
113
  saveHeight: o,
108
114
  close: t.close,
109
115
  hiding: t.hiding,
110
116
  ...t.data.question
111
- }) : t.type === d.ONBOARDING ? /* @__PURE__ */ e(H, {
117
+ }) : t.type === g.ONBOARDING ? /* @__PURE__ */ m(Q, {
112
118
  style: {
113
- height: t.hiding ? 0 : n
119
+ height: t.hiding ? 0 : r
114
120
  },
115
121
  saveHeight: o,
116
- sdk: s,
122
+ sdk: p,
117
123
  notification: t,
118
124
  sdkInDesktopView: i,
119
- appNode: p
125
+ appNode: n
120
126
  }) : null;
121
- }, Wt = ({
122
- sdk: s,
127
+ }, ti = ({
128
+ sdk: p,
123
129
  headerNode: t,
124
- scrollNode: p,
130
+ scrollNode: n,
125
131
  responsiveStore: i,
126
- appNode: m,
127
- scrollStore: n
132
+ appNode: e,
133
+ scrollStore: s
128
134
  }) => {
129
- const [o] = w(s.getNotificationsStore()), r = a(o), {
135
+ const [r] = y(p.getNotificationsStore()), o = k(r), {
130
136
  tabsShown: c
131
- } = a(n, {
137
+ } = k(s, {
132
138
  keys: ["tabsShown"]
133
139
  }), {
134
- sdkInView: y,
140
+ sdkInView: u,
135
141
  sdkInDesktopView: C
136
- } = a(i, {
142
+ } = k(i, {
137
143
  keys: ["sdkInView", "sdkInDesktopView"]
138
- }), [u, h] = w(null), l = O(() => {
139
- if (!(r != null && r.size))
144
+ }), [d, h] = y(null), l = O(() => {
145
+ if (!(o != null && o.size))
140
146
  return null;
141
- for (const f of r.values())
142
- if (f.type === d.ONBOARDING)
143
- return f;
144
- return r.values().next().value;
145
- }, [r]);
147
+ for (const a of o.values())
148
+ if (a.type === g.ONBOARDING)
149
+ return a;
150
+ return o.values().next().value;
151
+ }, [o]);
146
152
  I(() => {
147
153
  l && (i.get().sdkInDesktopView || i.get().sdkInView) && (!i.get().sdkInDesktopView && i.get().sdkInView && h(l), i.get().sdkInDesktopView && window.requestAnimationFrame(() => {
148
- n.get().scrollPosition !== 0 && h(l);
154
+ s.get().scrollPosition !== 0 && h(l);
149
155
  }));
150
156
  }, [l]), I(() => {
151
- y || h(null);
152
- }, [y]);
153
- const E = O(() => {
154
- var D, V;
155
- const g = i.get().sdkInDesktopView ? m : t;
156
- return u && g.current && P.createPortal(/* @__PURE__ */ e(Q, {
157
- title: `New ${((V = A[(D = u.data) == null ? void 0 : D.questionType]) == null ? void 0 : V.label) || "notification"}`,
157
+ u || h(null);
158
+ }, [u]);
159
+ const x = O(() => {
160
+ var V, D;
161
+ const f = i.get().sdkInDesktopView ? e : t;
162
+ return d && f.current && P.createPortal(/* @__PURE__ */ m(j, {
163
+ title: `New ${((D = B[(V = d.data) == null ? void 0 : V.questionType]) == null ? void 0 : D.label) || "notification"}`,
158
164
  onClick: () => {
159
165
  var N;
160
- i.get().sdkInDesktopView ? (N = p.current) == null || N.scrollTo({
166
+ i.get().sdkInDesktopView ? (N = n.current) == null || N.scrollTo({
161
167
  top: 0,
162
168
  behavior: "smooth"
163
- }) : q(m, {
169
+ }) : A(e, {
164
170
  behavior: "smooth"
165
171
  }), h(null);
166
172
  },
167
173
  className: c ? "c1d7yse1" : void 0
168
- }), g.current) || null;
169
- }, [u, m, t, p, c, i]);
170
- return /* @__PURE__ */ k(b, {
171
- children: [!u && l && /* @__PURE__ */ e(U, {
174
+ }), f.current) || null;
175
+ }, [d, e, t, n, c, i]);
176
+ return /* @__PURE__ */ w(b, {
177
+ children: [!d && l && /* @__PURE__ */ m(K, {
172
178
  sdkInDesktopView: C,
173
179
  headerNode: t,
174
- appNode: m,
175
- sdk: s,
180
+ appNode: e,
181
+ sdk: p,
176
182
  notification: l
177
- }), E]
183
+ }), x]
178
184
  });
179
185
  };
180
186
  export {
181
- Wt as SDKNotifications
187
+ ti as SDKNotifications
182
188
  };
@@ -1,17 +1,18 @@
1
- import { jsxs as f, jsx as m } from "react/jsx-runtime";
2
- import { useRef as u, useEffect as N } from "react";
1
+ import { jsx as r, jsxs as f } from "react/jsx-runtime";
2
+ import { useRef as u, useEffect as C, useMemo as x } from "react";
3
3
  import { resetCss as v } from "../theme/theme.js";
4
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";
5
+ import { MastersNavigation as I } from "./Navigation/MastersNavigation/index.js";
6
+ import { SDKNotifications as M } from "./Notifications/index.js";
7
+ import { SDKContainer as B, SDKScrollContainer as F } from "./styles.js";
8
+ import { useMastersApp as j } from "./useMastersApp.js";
9
+ import { MastersContext as D } from "./useMastersContext.js";
10
+ import { useSdkFeature as E } from "./useSdkFeature.js";
11
+ import { useSdkResponsive as K } from "./useSdkResponsive.js";
12
+ import { useSdkScroll as L } from "./useSdkScroll.js";
13
+ import { ChannelsButtonId as O } from "../navigation/button/Channels.js";
14
+ import { LeaderBoardButtonId as R } from "../navigation/button/LeaderBoard.js";
15
+ import { FeaturedGroupsButtonId as T } from "../navigation/button/FeaturedGroups.js";
15
16
  import "../theme/breakpoints.js";
16
17
  import "../theme/constants.js";
17
18
  import "@streamlayer/sdk-web-types";
@@ -56,6 +57,8 @@ import "react-virtualized-auto-sizer";
56
57
  import "../skeleton/index.js";
57
58
  import "../skeleton/styles.js";
58
59
  import "../gamification/onboarding/slides/onboarding-instructions/index.js";
60
+ import "../gamification/onboarding/invitingUser/index.js";
61
+ import "../gamification/onboarding/invitingUser/styles.js";
59
62
  import "../gamification/onboarding/slides/onboarding-instructions/styles.js";
60
63
  import "../gamification/onboarding/slides/onboarding-invite-card/index.js";
61
64
  import "./useClipboardCopy.js";
@@ -77,71 +80,79 @@ import "../gamification/question/notification/pill/index.js";
77
80
  import "../gamification/question/notification/pill/styles.js";
78
81
  import "lodash.throttle";
79
82
  import "../../index-keh7OLCY.js";
80
- const M = ({ sdk: o, className: s, scrollStore: a, appNode: t, scrollNode: p, headerNode: r, responsiveStore: i }) => {
81
- const [, n] = j(o);
82
- return /* @__PURE__ */ m(
83
+ const b = ({ sdk: t, className: s, scrollStore: a, appNode: o, scrollNode: p, headerNode: i, responsiveStore: m }) => {
84
+ const [, n] = E(t);
85
+ return /* @__PURE__ */ r(
83
86
  A,
84
87
  {
85
88
  className: s,
86
89
  scrollNode: p,
87
- appNode: t,
90
+ appNode: o,
88
91
  scrollStore: a,
89
92
  feature: n,
90
- headerNode: r,
91
- responsiveStore: i,
92
- sdk: o
93
+ headerNode: i,
94
+ responsiveStore: m,
95
+ sdk: t
93
96
  }
94
97
  );
95
- }, po = ({ sdk: o, overlays: s, children: a }) => {
96
- const t = u(null), p = u(null), [r] = k(t), [i, n] = D(t, r), { sdkEnabled: l, sdkReady: c, activeOverlay: e, activateAndLoadOverlay: S, activateEventWithId: h, deactivate: g, isLogged: y } = F(o);
97
- return N(() => {
98
+ }, co = ({ sdk: t, overlays: s, children: a }) => {
99
+ const o = u(null), p = u(null), [i] = K(o), [m, n] = L(o, i), { sdkEnabled: l, sdkReady: d, activeOverlay: e, activateAndLoadOverlay: S, activateEventWithId: h, deactivate: g, isLogged: y } = j(t);
100
+ C(() => {
98
101
  import("./Features/Gamification/gamification-feature.js");
99
- }, []), /* @__PURE__ */ f(x, { ref: t, children: [
100
- l && /* @__PURE__ */ m(
101
- C,
102
+ }, []);
103
+ const N = x(() => ({ sdk: t }), [t]);
104
+ return /* @__PURE__ */ r(D.Provider, { value: N, children: /* @__PURE__ */ f(B, { ref: o, children: [
105
+ l && /* @__PURE__ */ r(
106
+ I,
102
107
  {
103
108
  ref: p,
104
- sdkReady: c,
109
+ sdkReady: d,
105
110
  activeOverlay: e,
106
111
  className: v,
107
- setActiveOverlay: (d) => S("", d),
112
+ setActiveOverlay: (c) => S("", c),
108
113
  scrollToTop: () => {
109
- var d;
110
- return (d = i.current) == null ? void 0 : d.scrollTo(0, 0);
114
+ var c;
115
+ return (c = m.current) == null ? void 0 : c.scrollTo(0, 0);
111
116
  },
112
- responsiveStore: r
117
+ responsiveStore: i
113
118
  }
114
119
  ),
115
- /* @__PURE__ */ f(B, { className: "sl-hide-on-modal", ref: i, "data-nav": l.toString(), children: [
116
- c && /* @__PURE__ */ m(
117
- I,
120
+ /* @__PURE__ */ f(F, { className: "sl-hide-on-modal", ref: m, "data-nav": l.toString(), children: [
121
+ d && /* @__PURE__ */ r(
122
+ M,
118
123
  {
119
- sdk: o,
120
- scrollNode: i,
124
+ sdk: t,
125
+ scrollNode: m,
121
126
  headerNode: p,
122
- appNode: t,
127
+ appNode: o,
123
128
  scrollStore: n,
124
- responsiveStore: r
129
+ responsiveStore: i
125
130
  }
126
131
  ),
127
- /* @__PURE__ */ m("div", { style: !l || e === E ? {} : { display: "none" }, children: a && a({ activateEventWithId: h, deactivate: g }) }),
128
- s && e === K && s[e],
129
- c && e === L && /* @__PURE__ */ m(
130
- M,
132
+ /* @__PURE__ */ r("div", { style: !l || e === O ? {} : { display: "none" }, children: a && a({ activateEventWithId: h, deactivate: g }) }),
133
+ s && e === R && s[e],
134
+ d && e === T && /* @__PURE__ */ r(
135
+ b,
131
136
  {
132
137
  scrollStore: n,
133
- responsiveStore: r,
134
- scrollNode: i,
135
- appNode: t,
138
+ responsiveStore: i,
139
+ scrollNode: m,
140
+ appNode: o,
136
141
  headerNode: p,
137
142
  className: v,
138
- sdk: o
143
+ sdk: t
139
144
  }
140
145
  )
141
146
  ] }),
142
- l && !y && /* @__PURE__ */ m("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: "You are not logged in." })
143
- ] });
147
+ l && !y && /* @__PURE__ */ r(
148
+ "div",
149
+ {
150
+ style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" },
151
+ children: "You are not logged in."
152
+ }
153
+ )
154
+ ] }) });
144
155
  };
145
156
  export {
146
- po as MastersApp
157
+ co as MastersApp
147
158
  };
@@ -1,9 +1,9 @@
1
- import { useStore as d } from "@nanostores/react";
2
- import { useRef as y, useState as v, useCallback as I, useEffect as c } from "react";
3
- import { FeatureType as h } from "@streamlayer/sdk-web-types";
1
+ import { useStore as A } from "@nanostores/react";
2
+ import { useRef as y, useState as d, useCallback as z, useEffect as u } from "react";
3
+ import { FeatureType as v } from "@streamlayer/sdk-web-types";
4
4
  import "./Navigation/MastersNavigation/index.js";
5
- import { FeaturedGroupsButtonId as n } from "../navigation/button/FeaturedGroups.js";
6
- import { ChannelsButtonId as l } from "../navigation/button/Channels.js";
5
+ import { FeaturedGroupsButtonId as i } from "../navigation/button/FeaturedGroups.js";
6
+ import { ChannelsButtonId as p } from "../navigation/button/Channels.js";
7
7
  import "react/jsx-runtime";
8
8
  import "../navigation/button/LeaderBoard.js";
9
9
  import "@linaria/react";
@@ -13,28 +13,30 @@ import "../navigation/button/styles.js";
13
13
  import "../navigation/masters.js";
14
14
  import "../navigation/index.js";
15
15
  import "../theme/constants.js";
16
- const W = (e) => {
17
- const a = y(""), [m, f] = v(!1), A = d(e.status), i = d(e.userId()), r = A === "ready", [s, u] = v(n), p = I(
18
- (t, o) => {
19
- u(o), o === n ? (t && e.createEventSession(t), window.requestAnimationFrame(() => {
20
- e.openFeature(h.GAMES);
16
+ const j = (e) => {
17
+ const c = y(""), [S, o] = d(!1), E = A(e.status), a = A(e.userId()), f = A(e.getActiveFeature()), n = E === "ready", [l, r] = d(i), m = z(
18
+ (t, s) => {
19
+ r(s), s === i ? (t && e.createEventSession(t), window.requestAnimationFrame(() => {
20
+ e.openFeature(v.GAMES);
21
21
  })) : e.closeFeature(!1);
22
22
  },
23
23
  [e]
24
24
  );
25
- c(() => {
26
- !r && s === n && (u(l), e.closeFeature(!0));
27
- }, [r, s, e]);
28
- const g = (t) => {
29
- a.current = t, f(!0), e.initializeApp({ skipOrganizationSettings: !0 }).then(({ enabled: o, err: S }) => {
30
- if (S) {
31
- p(t, l);
25
+ u(() => {
26
+ !n && l === i && (r(p), e.closeFeature(!0));
27
+ }, [n, l, e]), u(() => {
28
+ f === v.GAMES ? r(i) : f === v.UNSET && r(p);
29
+ }, [f]);
30
+ const F = (t) => {
31
+ c.current = t, o(!0), e.initializeApp({ skipOrganizationSettings: !0 }).then(({ enabled: s, err: g }) => {
32
+ if (g) {
33
+ m(t, p);
32
34
  return;
33
35
  }
34
- if (o) {
35
- e.isUserAuthorized().then((E) => {
36
- if (E) {
37
- p(t, n);
36
+ if (s) {
37
+ e.isUserAuthorized().then((h) => {
38
+ if (h) {
39
+ m(t, i);
38
40
  return;
39
41
  } else
40
42
  e.disableApp();
@@ -43,32 +45,31 @@ const W = (e) => {
43
45
  }
44
46
  });
45
47
  }, b = () => {
46
- f(!1), e.disableApp();
48
+ o(!1), e.disableApp();
47
49
  };
48
- return c(() => {
49
- if (!i) {
50
- r && (u(l), e.disableApp());
50
+ return u(() => {
51
+ if (!a) {
52
+ n && (r(p), e.disableApp());
51
53
  return;
52
54
  }
53
- if (i && a.current && m) {
55
+ if (a && c.current && S) {
54
56
  e.initializeApp({ skipOrganizationSettings: !0 }).then(() => {
55
- e.createEventSession(a.current);
57
+ e.createEventSession(c.current);
56
58
  });
57
59
  return;
58
60
  }
59
- }, [i]), c(() => {
60
- const t = e.getInviterId();
61
- console.log("you invited by", t), t && e.status.get() === "disabled" && (console.log("deep link cb called"), e.deepLinkHandled());
62
- }, [e]), {
63
- sdkEnabled: m,
64
- sdkReady: r,
65
- activeOverlay: s,
66
- activateAndLoadOverlay: p,
67
- activateEventWithId: g,
61
+ }, [a]), u(() => () => {
62
+ o(!1), e.disableApp();
63
+ }, [o, e]), {
64
+ sdkEnabled: S,
65
+ sdkReady: n,
66
+ activeOverlay: l,
67
+ activateAndLoadOverlay: m,
68
+ activateEventWithId: F,
68
69
  deactivate: b,
69
- isLogged: !!i
70
+ isLogged: !!a
70
71
  };
71
72
  };
72
73
  export {
73
- W as useMastersApp
74
+ j as useMastersApp
74
75
  };
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import type { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
3
+ export declare const MastersContext: import("react").Context<{
4
+ sdk: StreamLayerSDK | null;
5
+ }>;
6
+ export declare const useMastersContext: () => {
7
+ sdk: StreamLayerSDK | null;
8
+ };
@@ -0,0 +1,8 @@
1
+ import { createContext as t, useContext as e } from "react";
2
+ const o = t({
3
+ sdk: null
4
+ }), n = () => e(o);
5
+ export {
6
+ o as MastersContext,
7
+ n as useMastersContext
8
+ };
@@ -6,8 +6,8 @@ type ResponsiveData = {
6
6
  name: BREAKPOINTS_KEYS;
7
7
  size: (typeof BREAKPOINTS)[BREAKPOINTS_KEYS];
8
8
  };
9
- sdkInView?: boolean;
10
- sdkInDesktopView?: boolean;
9
+ sdkInView: boolean;
10
+ sdkInDesktopView: boolean;
11
11
  };
12
12
  export type ResponsiveStore = MapStore<ResponsiveData>;
13
13
  export declare const useSdkResponsive: (appNode: AppNodeRef) => [ResponsiveStore];
@@ -1,11 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  import type { Gamification } from '@streamlayer/feature-gamification';
3
+ import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
3
4
  import { HeaderNodeRef, type AppNodeRef } from '../../app/masters';
4
5
  import { OnboardingStep } from './slides/onboarding-instructions';
5
6
  import { OnboardingInviteCardProps } from './slides/onboarding-invite-card';
6
7
  import { OnboardingRule } from './slides/onboarding-rules';
7
8
  type OnboardingType = OnboardingInviteCardProps & {
8
9
  gamification: Gamification;
10
+ sdk: StreamLayerSDK;
9
11
  steps?: OnboardingStep[];
10
12
  rules?: OnboardingRule[];
11
13
  rulesBtnLabel?: string;
@@ -16,7 +18,8 @@ type OnboardingType = OnboardingInviteCardProps & {
16
18
  inviteCardBtnLabel?: string;
17
19
  loading: boolean;
18
20
  renderToNode?: AppNodeRef | HeaderNodeRef;
21
+ inviterName?: string;
19
22
  onClose: () => void;
20
23
  };
21
- export declare const Onboarding: React.FC<OnboardingType>;
24
+ export declare const OnboardingUI: React.FC<OnboardingType>;
22
25
  export {};