@streamlayer/react-ui 0.100.5 → 1.0.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.
- package/lib/assets/style.css +1 -1
- package/lib/index.d.ts +1 -4
- package/lib/index.js +4 -4
- package/lib/{ui/app/Notifications/Onboarding/index.js → mastersLogoSolid-B4Dz-vm1.js} +2 -169
- package/lib/ui/app/{Features → app/Features}/FeatureProvider.js +3 -3
- package/lib/ui/app/{Features → app/Features}/Gamification/Friends.js +2 -2
- package/lib/ui/app/{Features → app/Features}/Gamification/Leaderboard.d.ts +2 -2
- package/lib/ui/app/app/Features/Gamification/Leaderboard.js +55 -0
- package/lib/ui/app/app/Features/Gamification/Question.js +69 -0
- package/lib/ui/app/app/Features/Gamification/QuestionsList.js +11 -0
- package/lib/ui/app/{Features → app/Features}/Gamification/Tabs.d.ts +3 -3
- package/lib/ui/app/{Features → app/Features}/Gamification/Tabs.js +3 -3
- package/lib/ui/app/{Features → app/Features}/Gamification/UserSummary.js +1 -1
- package/lib/ui/app/{Features → app/Features}/Gamification/index.d.ts +3 -3
- package/lib/ui/app/app/Features/Gamification/index.js +88 -0
- package/lib/ui/app/{Features → app/Features}/index.d.ts +3 -3
- package/lib/ui/app/app/Navigation/index.d.ts +5 -0
- package/lib/ui/app/app/Navigation/index.js +42 -0
- package/lib/ui/app/app/Notifications/Onboarding/Notification/styles.js +50 -0
- package/lib/ui/app/{Notifications → app/Notifications}/Onboarding/index.d.ts +2 -2
- package/lib/ui/app/app/Notifications/Onboarding/index.js +172 -0
- package/lib/ui/app/{Notifications → app/Notifications}/index.d.ts +3 -3
- package/lib/ui/app/{Notifications → app/Notifications}/index.js +18 -18
- package/lib/ui/app/{Notifications → app/Notifications}/styles.js +9 -9
- package/lib/ui/app/{Points → app/Points}/index.js +1 -1
- package/lib/ui/app/app/index.d.ts +11 -0
- package/lib/ui/app/app/index.js +101 -0
- package/lib/ui/app/app/useApp.d.ts +19 -0
- package/lib/ui/app/app/useApp.js +45 -0
- package/lib/ui/app/app/useAppContext.d.ts +8 -0
- package/lib/ui/app/app/useAppContext.js +8 -0
- package/lib/ui/app/index.d.ts +7 -0
- package/lib/ui/app/index.js +1 -0
- package/lib/ui/app/masters/Features/FeatureProvider.d.ts +11 -0
- package/lib/ui/app/masters/Features/FeatureProvider.js +38 -0
- package/lib/ui/app/masters/Features/Gamification/Friends.d.ts +4 -0
- package/lib/ui/app/masters/Features/Gamification/Friends.js +19 -0
- package/lib/ui/app/masters/Features/Gamification/Leaderboard.d.ts +9 -0
- package/lib/ui/app/{Features → masters/Features}/Gamification/Leaderboard.js +7 -7
- package/lib/ui/app/masters/Features/Gamification/Question.d.ts +5 -0
- package/lib/ui/app/{Features → masters/Features}/Gamification/Question.js +10 -10
- package/lib/ui/app/masters/Features/Gamification/QuestionsList.d.ts +6 -0
- package/lib/ui/app/{Features → masters/Features}/Gamification/QuestionsList.js +1 -1
- package/lib/ui/app/masters/Features/Gamification/Tabs.d.ts +14 -0
- package/lib/ui/app/masters/Features/Gamification/Tabs.js +44 -0
- package/lib/ui/app/masters/Features/Gamification/UserSummary.d.ts +5 -0
- package/lib/ui/app/masters/Features/Gamification/UserSummary.js +18 -0
- package/lib/ui/app/masters/Features/Gamification/gamification-feature.d.ts +2 -0
- package/lib/ui/app/masters/Features/Gamification/gamification-feature.js +4 -0
- package/lib/ui/app/masters/Features/Gamification/index.d.ts +23 -0
- package/lib/ui/app/{Features → masters/Features}/Gamification/index.js +31 -31
- package/lib/ui/app/masters/Features/index.d.ts +24 -0
- package/lib/ui/app/masters/Features/index.js +37 -0
- package/lib/ui/app/{Navigation → masters/Navigation}/MastersNavigation/index.d.ts +4 -4
- package/lib/ui/app/{Navigation → masters/Navigation}/MastersNavigation/index.js +5 -5
- package/lib/ui/app/{Navigation → masters/Navigation}/index.d.ts +2 -2
- package/lib/ui/app/{Navigation → masters/Navigation}/index.js +2 -2
- package/lib/ui/app/masters/Notifications/Onboarding/Notification/index.d.ts +8 -0
- package/lib/ui/app/masters/Notifications/Onboarding/Notification/index.js +18 -0
- package/lib/ui/app/masters/Notifications/Onboarding/Notification/styles.d.ts +10 -0
- package/lib/ui/app/{Notifications → masters/Notifications}/Onboarding/Notification/styles.js +16 -16
- package/lib/ui/app/masters/Notifications/Onboarding/index.d.ts +14 -0
- package/lib/ui/app/masters/Notifications/Onboarding/index.js +172 -0
- package/lib/ui/app/masters/Notifications/index.d.ts +13 -0
- package/lib/ui/app/masters/Notifications/index.js +163 -0
- package/lib/ui/app/masters/Notifications/styles.d.ts +8 -0
- package/lib/ui/app/masters/Notifications/styles.js +31 -0
- package/lib/ui/app/masters/Points/index.d.ts +5 -0
- package/lib/ui/app/masters/Points/index.js +28 -0
- package/lib/ui/app/{masters.d.ts → masters/masters.d.ts} +1 -7
- package/lib/ui/app/{masters.js → masters/masters.js} +33 -31
- package/lib/ui/app/{useMastersApp.js → masters/useMastersApp.js} +2 -2
- package/lib/ui/app/useClipboardCopy.d.ts +1 -1
- package/lib/ui/app/useSdkScroll.d.ts +1 -1
- package/lib/ui/theme/MastersColors.d.ts +1 -0
- package/lib/ui/theme/MastersColors.js +15 -0
- package/lib/ui/theme/ThemeColors.js +1 -1
- package/lib/ui/theme/constants.d.ts +1 -1
- package/lib/ui/theme/constants.js +5 -5
- package/lib/ui/theme/masters-theme.d.ts +25 -0
- package/lib/ui/theme/masters-theme.js +96 -0
- package/lib/ui/theme/masters.d.ts +5 -0
- package/lib/ui/theme/masters.js +6 -0
- package/lib/ui/theme/theme.js +1 -1
- package/package.json +25 -20
- /package/lib/ui/app/{Features → app/Features}/FeatureProvider.d.ts +0 -0
- /package/lib/ui/app/{Features → app/Features}/Gamification/Friends.d.ts +0 -0
- /package/lib/ui/app/{Features → app/Features}/Gamification/Question.d.ts +0 -0
- /package/lib/ui/app/{Features → app/Features}/Gamification/QuestionsList.d.ts +0 -0
- /package/lib/ui/app/{Features → app/Features}/Gamification/UserSummary.d.ts +0 -0
- /package/lib/ui/app/{Features → app/Features}/Gamification/gamification-feature.d.ts +0 -0
- /package/lib/ui/app/{Features → app/Features}/Gamification/gamification-feature.js +0 -0
- /package/lib/ui/app/{Features → app/Features}/index.js +0 -0
- /package/lib/ui/app/{Notifications → app/Notifications}/Onboarding/Notification/index.d.ts +0 -0
- /package/lib/ui/app/{Notifications → app/Notifications}/Onboarding/Notification/index.js +0 -0
- /package/lib/ui/app/{Notifications → app/Notifications}/Onboarding/Notification/styles.d.ts +0 -0
- /package/lib/ui/app/{Notifications → app/Notifications}/styles.d.ts +0 -0
- /package/lib/ui/app/{Points → app/Points}/index.d.ts +0 -0
- /package/lib/ui/app/{useMastersApp.d.ts → masters/useMastersApp.d.ts} +0 -0
- /package/lib/ui/app/{useMastersContext.d.ts → masters/useMastersContext.d.ts} +0 -0
- /package/lib/ui/app/{useMastersContext.js → masters/useMastersContext.js} +0 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { jsx as n, jsxs as x, Fragment as T } from "react/jsx-runtime";
|
|
2
|
+
import { styled as S } from "@linaria/react";
|
|
3
|
+
import { useStore as F } from "@nanostores/react";
|
|
4
|
+
import { useRef as E, useState as A, useMemo as _, useLayoutEffect as G, useEffect as M } from "react";
|
|
5
|
+
import { FeatureType as P } from "@streamlayer/sdk-web-types";
|
|
6
|
+
import { useImagesPreload as R } from "../../../useImagesPreload.js";
|
|
7
|
+
import { scrollIntoAppView as V } from "../../../useSdkScroll.js";
|
|
8
|
+
import { OnboardingUI as W } from "../../../../gamification/onboarding/index.js";
|
|
9
|
+
import { ModalPortal as $ } from "../../../../modal/index.js";
|
|
10
|
+
import { ShowIn as j } from "../../../../show-in/index.js";
|
|
11
|
+
import { m as O } from "../../../../../mastersLogoSolid-B4Dz-vm1.js";
|
|
12
|
+
import { Onboarding as k } from "./Notification/index.js";
|
|
13
|
+
const y = [{
|
|
14
|
+
graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_1.png",
|
|
15
|
+
tagline: "Featured groups+ experience",
|
|
16
|
+
headline: /* @__PURE__ */ x(T, {
|
|
17
|
+
children: ["Welcome to ", /* @__PURE__ */ n("br", {}), " Featured Groups +"]
|
|
18
|
+
})
|
|
19
|
+
}, {
|
|
20
|
+
graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_2.png",
|
|
21
|
+
headline: "Get real-time insights"
|
|
22
|
+
}, {
|
|
23
|
+
graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_3.png",
|
|
24
|
+
headline: "Predictions, trivia & polls synced to match play"
|
|
25
|
+
}, {
|
|
26
|
+
graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_4.png",
|
|
27
|
+
headline: "Win points for every answer you get right"
|
|
28
|
+
}, {
|
|
29
|
+
graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_5.png",
|
|
30
|
+
headline: "Compete against friends on the leaderboard"
|
|
31
|
+
}], q = /* @__PURE__ */ S("div")({
|
|
32
|
+
name: "OnboardingContainer",
|
|
33
|
+
class: "o1s8kvh4",
|
|
34
|
+
propsAsIs: !1
|
|
35
|
+
}), z = () => j, D = /* @__PURE__ */ S(z())({
|
|
36
|
+
name: "OnboardingNotificationContainer",
|
|
37
|
+
class: "o1b0248i",
|
|
38
|
+
propsAsIs: !0
|
|
39
|
+
}), L = /* @__PURE__ */ S("div")({
|
|
40
|
+
name: "InnerContainer",
|
|
41
|
+
class: "ii6o0e",
|
|
42
|
+
propsAsIs: !1
|
|
43
|
+
}), U = ({
|
|
44
|
+
deepLink: d,
|
|
45
|
+
onboardingOpts: r,
|
|
46
|
+
notification: o,
|
|
47
|
+
gamification: u,
|
|
48
|
+
loading: i,
|
|
49
|
+
renderToNode: v,
|
|
50
|
+
sdk: l
|
|
51
|
+
}) => {
|
|
52
|
+
var a, h, b, f, C, m, s;
|
|
53
|
+
const c = F(u.friends.getStore()), [e, I] = A(void 0), g = _(() => {
|
|
54
|
+
var p, w;
|
|
55
|
+
const t = l.getInviter();
|
|
56
|
+
return t ? (w = (p = c.data) == null ? void 0 : p.find(({
|
|
57
|
+
slId: B
|
|
58
|
+
}) => B === t)) == null ? void 0 : w.name : "";
|
|
59
|
+
}, [c.data, l]);
|
|
60
|
+
return M(() => {
|
|
61
|
+
const t = d.$store.subscribe((p) => {
|
|
62
|
+
p && I(p.data);
|
|
63
|
+
});
|
|
64
|
+
return () => {
|
|
65
|
+
t();
|
|
66
|
+
};
|
|
67
|
+
}, [d.$store]), /* @__PURE__ */ n(q, {
|
|
68
|
+
children: /* @__PURE__ */ n(W, {
|
|
69
|
+
loading: i,
|
|
70
|
+
renderToNode: v,
|
|
71
|
+
rules: [{
|
|
72
|
+
label: "Answer as many questions as you like.",
|
|
73
|
+
icon: "icon-btn-feature-groups"
|
|
74
|
+
}, {
|
|
75
|
+
label: "Win points for each correct trivia or prediction answer.",
|
|
76
|
+
icon: "icon-thumb-up"
|
|
77
|
+
}, {
|
|
78
|
+
label: "Top the leader board and best your friends.",
|
|
79
|
+
icon: "icon-trophy"
|
|
80
|
+
}],
|
|
81
|
+
rulesBtnLabel: (a = r.rules) == null ? void 0 : a.buttonLabel,
|
|
82
|
+
rulesTitle: (h = r.rules) == null ? void 0 : h.heading,
|
|
83
|
+
termsTitle: "Terms and Conditions",
|
|
84
|
+
termsText: (b = r.rules) == null ? void 0 : b.terms,
|
|
85
|
+
steps: y,
|
|
86
|
+
primaryColor: (f = r.inviteCard) == null ? void 0 : f.iconColor,
|
|
87
|
+
inviteLink: e,
|
|
88
|
+
inviteCardTitle: (C = r.inviteCard) == null ? void 0 : C.heading,
|
|
89
|
+
inviteCardSubtext: (m = r.inviteCard) == null ? void 0 : m.subtext,
|
|
90
|
+
inviteCardBtnLabel: (s = r.inviteCard) == null ? void 0 : s.buttonLabel,
|
|
91
|
+
onClose: () => {
|
|
92
|
+
var t;
|
|
93
|
+
(t = o.close) == null || t.call(o);
|
|
94
|
+
},
|
|
95
|
+
gamification: u,
|
|
96
|
+
sdk: l,
|
|
97
|
+
inviterName: g
|
|
98
|
+
})
|
|
99
|
+
});
|
|
100
|
+
}, se = ({
|
|
101
|
+
sdk: d,
|
|
102
|
+
notification: r,
|
|
103
|
+
saveHeight: o,
|
|
104
|
+
style: u,
|
|
105
|
+
appNode: i,
|
|
106
|
+
sdkInDesktopView: v,
|
|
107
|
+
responsiveStore: l
|
|
108
|
+
}) => {
|
|
109
|
+
var m;
|
|
110
|
+
const c = E(null), e = r.data.onboarding, [I, g] = A(e == null ? void 0 : e.instantOpen), a = d.getFeature(P.GAMES), h = _(() => y == null ? void 0 : y.map(({
|
|
111
|
+
graphicSrc: s
|
|
112
|
+
}) => s), []), {
|
|
113
|
+
screen: b
|
|
114
|
+
} = F(l, {
|
|
115
|
+
keys: ["screen"]
|
|
116
|
+
});
|
|
117
|
+
(m = e == null ? void 0 : e.titleCard) != null && m.media && (e.titleCard.media.sponsorLogo = O), G(() => {
|
|
118
|
+
var s;
|
|
119
|
+
o(((s = c.current) == null ? void 0 : s.getBoundingClientRect().height) || 0);
|
|
120
|
+
}, [o]);
|
|
121
|
+
const {
|
|
122
|
+
loading: f,
|
|
123
|
+
throttled: C
|
|
124
|
+
} = R(h);
|
|
125
|
+
return I && a && e && i.current && !C ? /* @__PURE__ */ n($, {
|
|
126
|
+
container: i,
|
|
127
|
+
useContainer: !v,
|
|
128
|
+
children: /* @__PURE__ */ n(U, {
|
|
129
|
+
notification: r,
|
|
130
|
+
setOpened: g,
|
|
131
|
+
gamification: a,
|
|
132
|
+
onboardingOpts: e,
|
|
133
|
+
deepLink: a.deepLink,
|
|
134
|
+
loading: f,
|
|
135
|
+
renderToNode: i,
|
|
136
|
+
sdk: d
|
|
137
|
+
})
|
|
138
|
+
}) : /* @__PURE__ */ x(T, {
|
|
139
|
+
children: [/* @__PURE__ */ n(L, {
|
|
140
|
+
ref: c,
|
|
141
|
+
style: {
|
|
142
|
+
position: "absolute",
|
|
143
|
+
visibility: "hidden"
|
|
144
|
+
},
|
|
145
|
+
children: /* @__PURE__ */ n(k, {
|
|
146
|
+
close: () => {
|
|
147
|
+
},
|
|
148
|
+
action: () => {
|
|
149
|
+
},
|
|
150
|
+
onboarding: e
|
|
151
|
+
})
|
|
152
|
+
}), /* @__PURE__ */ n(D, {
|
|
153
|
+
style: u,
|
|
154
|
+
hiding: r.hiding,
|
|
155
|
+
children: /* @__PURE__ */ n(L, {
|
|
156
|
+
children: /* @__PURE__ */ n(k, {
|
|
157
|
+
close: r.close,
|
|
158
|
+
action: () => {
|
|
159
|
+
var t;
|
|
160
|
+
g(!0), (((t = i.current) == null ? void 0 : t.getBoundingClientRect().y) || 0) < 0 && V(i, b.size, {
|
|
161
|
+
behavior: "smooth"
|
|
162
|
+
});
|
|
163
|
+
},
|
|
164
|
+
onboarding: e
|
|
165
|
+
})
|
|
166
|
+
})
|
|
167
|
+
})]
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
export {
|
|
171
|
+
se as Onboarding
|
|
172
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
3
|
+
import type { AppNodeRef, ScrollNodeRef, HeaderNodeRef } from '../..';
|
|
4
|
+
import { ResponsiveStore } from '../../useSdkResponsive';
|
|
5
|
+
import { ScrollStore } from '../../useSdkScroll';
|
|
6
|
+
export declare const SDKNotifications: React.FC<{
|
|
7
|
+
sdk: StreamLayerSDK;
|
|
8
|
+
scrollNode: ScrollNodeRef;
|
|
9
|
+
appNode: AppNodeRef;
|
|
10
|
+
headerNode: HeaderNodeRef;
|
|
11
|
+
scrollStore: ScrollStore;
|
|
12
|
+
responsiveStore: ResponsiveStore;
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { jsxs as g, Fragment as D, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { cx as N } from "@linaria/core";
|
|
3
|
+
import { useStore as f } from "@nanostores/react";
|
|
4
|
+
import { useState as p, useMemo as T, useEffect as h, useRef as E, useCallback as w } from "react";
|
|
5
|
+
import { r as O } from "../../../../index-Bicco-Aq.js";
|
|
6
|
+
import { eventBus as b } from "@streamlayer/sdk-web-interfaces";
|
|
7
|
+
import { NotificationType as a } from "@streamlayer/sdk-web-notifications";
|
|
8
|
+
import { useMastersContext as q } from "../useMastersContext.js";
|
|
9
|
+
import { scrollIntoAppView as C } from "../../useSdkScroll.js";
|
|
10
|
+
import { QuestionTypeData as R } from "../../../gamification/constants.js";
|
|
11
|
+
import { Notification as V } from "../../../gamification/question/notification/index.js";
|
|
12
|
+
import { PredictionResult as P } from "../../../gamification/question/notification/prediction-result/index.js";
|
|
13
|
+
import { Onboarding as x } from "./Onboarding/index.js";
|
|
14
|
+
import { HiddenContainer as A, Container as B, InnerContainer as H, NotificationRefreshing as Q, Pill as z } from "./styles.js";
|
|
15
|
+
const U = (o) => {
|
|
16
|
+
const [t, u] = p(0), i = E(null), d = w((r) => {
|
|
17
|
+
i.current = r;
|
|
18
|
+
}, []);
|
|
19
|
+
h(() => {
|
|
20
|
+
var l;
|
|
21
|
+
const r = (l = i.current) == null ? void 0 : l.getBoundingClientRect();
|
|
22
|
+
r && u(r.height);
|
|
23
|
+
}, [o]);
|
|
24
|
+
const n = w((r) => {
|
|
25
|
+
u(r);
|
|
26
|
+
}, []);
|
|
27
|
+
return [d, t, n];
|
|
28
|
+
}, j = ({
|
|
29
|
+
sdk: o,
|
|
30
|
+
notification: t,
|
|
31
|
+
appNode: u,
|
|
32
|
+
responsiveStore: i
|
|
33
|
+
}) => {
|
|
34
|
+
var s, e;
|
|
35
|
+
const {
|
|
36
|
+
sdkInDesktopView: d
|
|
37
|
+
} = f(i, {
|
|
38
|
+
keys: ["sdkInDesktopView"]
|
|
39
|
+
}), {
|
|
40
|
+
sdk: n
|
|
41
|
+
} = q(), [r, l, m] = U(t.id);
|
|
42
|
+
return t.type === a.QUESTION ? /* @__PURE__ */ g(D, {
|
|
43
|
+
children: [/* @__PURE__ */ c(A, {
|
|
44
|
+
ref: r,
|
|
45
|
+
children: /* @__PURE__ */ c(V, {
|
|
46
|
+
...t
|
|
47
|
+
})
|
|
48
|
+
}), /* @__PURE__ */ g(B, {
|
|
49
|
+
style: {
|
|
50
|
+
height: t.hiding ? 0 : l
|
|
51
|
+
},
|
|
52
|
+
hiding: t.hiding,
|
|
53
|
+
children: [/* @__PURE__ */ c(H, {
|
|
54
|
+
style: {
|
|
55
|
+
height: "100%"
|
|
56
|
+
},
|
|
57
|
+
children: /* @__PURE__ */ c(V, {
|
|
58
|
+
...t,
|
|
59
|
+
controlVideo: n == null ? void 0 : n.controlVideoPlayer
|
|
60
|
+
})
|
|
61
|
+
}), /* @__PURE__ */ c(Q, {}, t.id)]
|
|
62
|
+
})]
|
|
63
|
+
}) : t.type === a.QUESTION_RESOLVED && ((e = (s = t.data) == null ? void 0 : s.question) != null && e.predictionResult) ? /* @__PURE__ */ c(P, {
|
|
64
|
+
style: {
|
|
65
|
+
height: t.hiding ? 0 : l
|
|
66
|
+
},
|
|
67
|
+
saveHeight: m,
|
|
68
|
+
close: t.close,
|
|
69
|
+
hiding: t.hiding,
|
|
70
|
+
...t.data.question
|
|
71
|
+
}) : t.type === a.ONBOARDING ? /* @__PURE__ */ c(x, {
|
|
72
|
+
style: {
|
|
73
|
+
height: t.hiding ? 0 : l
|
|
74
|
+
},
|
|
75
|
+
saveHeight: m,
|
|
76
|
+
sdk: o,
|
|
77
|
+
notification: t,
|
|
78
|
+
sdkInDesktopView: d,
|
|
79
|
+
appNode: u,
|
|
80
|
+
responsiveStore: i
|
|
81
|
+
}) : null;
|
|
82
|
+
}, F = "p1k96f2z", L = ({
|
|
83
|
+
pill: o,
|
|
84
|
+
setPill: t,
|
|
85
|
+
appNode: u,
|
|
86
|
+
headerNode: i,
|
|
87
|
+
scrollNode: d,
|
|
88
|
+
responsiveStore: n,
|
|
89
|
+
scrollStore: r
|
|
90
|
+
}) => {
|
|
91
|
+
var k, y;
|
|
92
|
+
const {
|
|
93
|
+
screen: l
|
|
94
|
+
} = f(n, {
|
|
95
|
+
keys: ["screen"]
|
|
96
|
+
}), {
|
|
97
|
+
tabsShown: m,
|
|
98
|
+
scrollPosition: s
|
|
99
|
+
} = f(r, {
|
|
100
|
+
keys: ["tabsShown", "scrollPosition"]
|
|
101
|
+
});
|
|
102
|
+
h(() => {
|
|
103
|
+
n.get().sdkInDesktopView ? s < 50 && t(null) : s > -50 && t(null);
|
|
104
|
+
}, [s, n, t]);
|
|
105
|
+
const e = n.get().sdkInDesktopView ? u : i;
|
|
106
|
+
return !o || !e.current ? null : O.createPortal(/* @__PURE__ */ c(z, {
|
|
107
|
+
title: o.type === a.QUESTION_RESOLVED ? "Prediction result" : `New ${((y = R[(k = o.data) == null ? void 0 : k.questionType]) == null ? void 0 : y.label) || "notification"}`,
|
|
108
|
+
onClick: () => {
|
|
109
|
+
var I;
|
|
110
|
+
n.get().sdkInDesktopView ? (I = d.current) == null || I.scrollTo({
|
|
111
|
+
top: 0,
|
|
112
|
+
behavior: "smooth"
|
|
113
|
+
}) : C(u, l.size, {
|
|
114
|
+
behavior: "smooth"
|
|
115
|
+
}), t(null);
|
|
116
|
+
},
|
|
117
|
+
className: N(m && F, "sl-pill-button")
|
|
118
|
+
}), e.current);
|
|
119
|
+
}, it = ({
|
|
120
|
+
sdk: o,
|
|
121
|
+
headerNode: t,
|
|
122
|
+
scrollNode: u,
|
|
123
|
+
responsiveStore: i,
|
|
124
|
+
appNode: d,
|
|
125
|
+
scrollStore: n
|
|
126
|
+
}) => {
|
|
127
|
+
const [r] = p(o.getNotificationsStore()), l = f(r), [m, s] = p(null), e = T(() => o.getActiveNotification(), [o, l]);
|
|
128
|
+
return h(() => {
|
|
129
|
+
e && b.emit("notification", {
|
|
130
|
+
action: "rendered",
|
|
131
|
+
payload: {
|
|
132
|
+
questionId: e.data.questionId,
|
|
133
|
+
questionType: e.data.questionType
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}, [e]), h(() => {
|
|
137
|
+
e && (i.get().sdkInDesktopView || i.get().sdkInView) && (!i.get().sdkInDesktopView && i.get().sdkInView && s(e), i.get().sdkInDesktopView && window.requestAnimationFrame(() => {
|
|
138
|
+
n.get().scrollPosition !== 0 && s(e);
|
|
139
|
+
}));
|
|
140
|
+
}, [e]), h(() => {
|
|
141
|
+
e || s(null);
|
|
142
|
+
}, [e]), /* @__PURE__ */ g(D, {
|
|
143
|
+
children: [!m && e && /* @__PURE__ */ c(j, {
|
|
144
|
+
headerNode: t,
|
|
145
|
+
appNode: d,
|
|
146
|
+
sdk: o,
|
|
147
|
+
notification: e,
|
|
148
|
+
responsiveStore: i
|
|
149
|
+
}), m && /* @__PURE__ */ c(L, {
|
|
150
|
+
pill: m,
|
|
151
|
+
setPill: s,
|
|
152
|
+
appNode: d,
|
|
153
|
+
notification: e,
|
|
154
|
+
headerNode: t,
|
|
155
|
+
scrollNode: u,
|
|
156
|
+
scrollStore: n,
|
|
157
|
+
responsiveStore: i
|
|
158
|
+
})]
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
export {
|
|
162
|
+
it as SDKNotifications
|
|
163
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Container: any;
|
|
3
|
+
export declare const InnerContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
4
|
+
export declare const HiddenContainer: import("@linaria/react").WYWEvalMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
|
|
5
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const NotificationRefreshing: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
8
|
+
export declare const Pill: any;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { styled as s } from "@linaria/react";
|
|
2
|
+
import { Pill as n } from "../../../gamification/question/notification/pill/index.js";
|
|
3
|
+
import { ShowIn as o } from "../../../show-in/index.js";
|
|
4
|
+
const e = () => o, l = /* @__PURE__ */ s(e())({
|
|
5
|
+
name: "Container",
|
|
6
|
+
class: "c1rc4ozt",
|
|
7
|
+
propsAsIs: !0
|
|
8
|
+
}), i = /* @__PURE__ */ s("div")({
|
|
9
|
+
name: "InnerContainer",
|
|
10
|
+
class: "i1ddmb3r",
|
|
11
|
+
propsAsIs: !1
|
|
12
|
+
}), t = () => i, m = /* @__PURE__ */ s(t())({
|
|
13
|
+
name: "HiddenContainer",
|
|
14
|
+
class: "htinjsj",
|
|
15
|
+
propsAsIs: !0
|
|
16
|
+
}), d = /* @__PURE__ */ s("div")({
|
|
17
|
+
name: "NotificationRefreshing",
|
|
18
|
+
class: "nig84ar",
|
|
19
|
+
propsAsIs: !1
|
|
20
|
+
}), r = () => n, f = /* @__PURE__ */ s(r())({
|
|
21
|
+
name: "Pill",
|
|
22
|
+
class: "pt3kgqi",
|
|
23
|
+
propsAsIs: !0
|
|
24
|
+
});
|
|
25
|
+
export {
|
|
26
|
+
l as Container,
|
|
27
|
+
m as HiddenContainer,
|
|
28
|
+
i as InnerContainer,
|
|
29
|
+
d as NotificationRefreshing,
|
|
30
|
+
f as Pill
|
|
31
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useStore as i } from "@nanostores/react";
|
|
3
|
+
import { useState as c, useEffect as f } from "react";
|
|
4
|
+
import { FeatureStatus as p } from "@streamlayer/sdk-web-interfaces";
|
|
5
|
+
import { FeatureType as S } from "@streamlayer/sdk-web-types";
|
|
6
|
+
import { Points as l } from "../../../gamification/points/index.js";
|
|
7
|
+
const a = ({ gamification: e }) => {
|
|
8
|
+
const s = e.userSummary.$store, [r, u] = c(0);
|
|
9
|
+
return f(() => {
|
|
10
|
+
const m = s.subscribe((t) => {
|
|
11
|
+
var o;
|
|
12
|
+
(o = t == null ? void 0 : t.summary) != null && o.points && u(t.summary.points);
|
|
13
|
+
});
|
|
14
|
+
return () => {
|
|
15
|
+
m();
|
|
16
|
+
};
|
|
17
|
+
}, [s]), /* @__PURE__ */ n(l, { points: r, onClick: () => {
|
|
18
|
+
e.status.get() === p.Suspended && e.openFeature();
|
|
19
|
+
} });
|
|
20
|
+
}, h = ({ sdk: e }) => {
|
|
21
|
+
if (!i(e.featuresList.getStore()))
|
|
22
|
+
return null;
|
|
23
|
+
const r = e.getFeature(S.GAMES);
|
|
24
|
+
return r ? /* @__PURE__ */ n(a, { gamification: r }) : null;
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
h as StreamLayerSDKPoints
|
|
28
|
+
};
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
3
|
+
export { StreamLayerMastersThemeProvider } from '../../theme/masters';
|
|
3
4
|
export type Overlays = {};
|
|
4
5
|
export type MastersAppChildrenProps = {
|
|
5
6
|
activateEventWithId: (event: string) => void;
|
|
6
7
|
deactivate: () => void;
|
|
7
8
|
};
|
|
8
|
-
type AppNode = HTMLDivElement | null;
|
|
9
|
-
export type AppNodeRef = React.MutableRefObject<AppNode>;
|
|
10
|
-
export type ScrollNode = HTMLDivElement | null;
|
|
11
|
-
export type ScrollNodeRef = React.MutableRefObject<ScrollNode>;
|
|
12
|
-
export type HeaderNode = HTMLDivElement | null;
|
|
13
|
-
export type HeaderNodeRef = React.MutableRefObject<HeaderNode>;
|
|
14
9
|
export type MastersAppProps = {
|
|
15
10
|
sdk: StreamLayerSDK;
|
|
16
11
|
overlays?: Overlays;
|
|
17
12
|
children: (methods: MastersAppChildrenProps) => React.ReactNode;
|
|
18
13
|
};
|
|
19
14
|
export declare const MastersApp: React.FC<MastersAppProps>;
|
|
20
|
-
export {};
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { jsx as n, jsxs as v } from "react/jsx-runtime";
|
|
2
2
|
import { useStore as C } from "@nanostores/react";
|
|
3
|
-
import { useAnalyticsListener as d, newTabLinkListener as
|
|
4
|
-
import { useRef as S, useMemo as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
3
|
+
import { useAnalyticsListener as d, newTabLinkListener as x, appScrollListener as A, appClickListener as F } from "../../../hooks/analytics.js";
|
|
4
|
+
import { useRef as S, useMemo as M, useEffect as b } from "react";
|
|
5
|
+
import { SDKContainer as D, SDKScrollContainer as I } from "../styles.js";
|
|
6
|
+
import { useSdkFeature as B } from "../useSdkFeature.js";
|
|
7
|
+
import { useSdkResponsive as T } from "../useSdkResponsive.js";
|
|
8
|
+
import { useSdkScroll as j } from "../useSdkScroll.js";
|
|
9
|
+
import { resetCss as p } from "../../theme/theme.js";
|
|
10
|
+
import { ActiveFeature as k, StandaloneFeature as E } from "./Features/index.js";
|
|
11
|
+
import { MastersNavigation as K } from "./Navigation/MastersNavigation/index.js";
|
|
12
|
+
import { SDKNotifications as O } from "./Notifications/index.js";
|
|
13
|
+
import { useMastersApp as R } from "./useMastersApp.js";
|
|
14
|
+
import { MastersContext as w } from "./useMastersContext.js";
|
|
15
|
+
import { StreamLayerMastersThemeProvider as ce } from "../../theme/masters.js";
|
|
16
|
+
import { ChannelsButtonId as P } from "../../navigation/button/Channels.js";
|
|
17
|
+
import { LeaderBoardButtonId as G } from "../../navigation/button/LeaderBoard.js";
|
|
18
|
+
import { FeaturedGroupsButtonId as V } from "../../navigation/button/FeaturedGroups.js";
|
|
18
19
|
const W = ({ sdk: e, className: i, scrollStore: l, appNode: t, scrollNode: s, responsiveStore: o }) => {
|
|
19
|
-
const [, r] =
|
|
20
|
+
const [, r] = B(e);
|
|
20
21
|
return /* @__PURE__ */ n(
|
|
21
|
-
|
|
22
|
+
k,
|
|
22
23
|
{
|
|
23
24
|
className: i,
|
|
24
25
|
scrollNode: s,
|
|
@@ -34,7 +35,7 @@ const W = ({ sdk: e, className: i, scrollStore: l, appNode: t, scrollNode: s, re
|
|
|
34
35
|
return s ? Array.from(s, (o) => {
|
|
35
36
|
const r = e.getFeature(o);
|
|
36
37
|
return r ? /* @__PURE__ */ n(
|
|
37
|
-
|
|
38
|
+
E,
|
|
38
39
|
{
|
|
39
40
|
className: i,
|
|
40
41
|
appNode: l,
|
|
@@ -46,24 +47,24 @@ const W = ({ sdk: e, className: i, scrollStore: l, appNode: t, scrollNode: s, re
|
|
|
46
47
|
) : null;
|
|
47
48
|
}) : null;
|
|
48
49
|
}, ie = ({ sdk: e, overlays: i, children: l }) => {
|
|
49
|
-
const t = S(null), s = S(null), [o] = T(t), [r, f] =
|
|
50
|
-
d(t, { enabled: a, event: "click", listener:
|
|
50
|
+
const t = S(null), s = S(null), [o] = T(t), [r, f] = j(t, o), { sdkEnabled: a, sdkReady: c, activeOverlay: m, activateAndLoadOverlay: h, activateEventWithId: N, deactivate: g, isLogged: y } = R(e);
|
|
51
|
+
d(t, { enabled: a, event: "click", listener: x }), d(r, {
|
|
51
52
|
enabled: a,
|
|
52
53
|
event: "scrollend",
|
|
53
|
-
listener:
|
|
54
|
+
listener: A,
|
|
54
55
|
useDomNode: !0
|
|
55
56
|
}), d(r, {
|
|
56
57
|
enabled: a,
|
|
57
58
|
event: "click",
|
|
58
|
-
listener:
|
|
59
|
+
listener: F,
|
|
59
60
|
useDomNode: !0
|
|
60
61
|
});
|
|
61
|
-
const L =
|
|
62
|
-
return
|
|
62
|
+
const L = M(() => ({ sdk: e }), [e]);
|
|
63
|
+
return b(() => {
|
|
63
64
|
import("./Features/Gamification/gamification-feature.js");
|
|
64
|
-
}, []), /* @__PURE__ */ n(
|
|
65
|
+
}, []), /* @__PURE__ */ n(w.Provider, { value: L, children: /* @__PURE__ */ v(D, { ref: t, children: [
|
|
65
66
|
a && /* @__PURE__ */ n(
|
|
66
|
-
|
|
67
|
+
K,
|
|
67
68
|
{
|
|
68
69
|
ref: s,
|
|
69
70
|
sdkReady: c,
|
|
@@ -77,9 +78,9 @@ const W = ({ sdk: e, className: i, scrollStore: l, appNode: t, scrollNode: s, re
|
|
|
77
78
|
responsiveStore: o
|
|
78
79
|
}
|
|
79
80
|
),
|
|
80
|
-
/* @__PURE__ */ v(
|
|
81
|
+
/* @__PURE__ */ v(I, { className: "sl-hide-on-modal", ref: r, "data-nav": a.toString(), children: [
|
|
81
82
|
c && /* @__PURE__ */ n(
|
|
82
|
-
|
|
83
|
+
O,
|
|
83
84
|
{
|
|
84
85
|
sdk: e,
|
|
85
86
|
scrollNode: r,
|
|
@@ -89,8 +90,8 @@ const W = ({ sdk: e, className: i, scrollStore: l, appNode: t, scrollNode: s, re
|
|
|
89
90
|
responsiveStore: o
|
|
90
91
|
}
|
|
91
92
|
),
|
|
92
|
-
/* @__PURE__ */ n("div", { style: !a || m ===
|
|
93
|
-
i && m ===
|
|
93
|
+
/* @__PURE__ */ n("div", { style: !a || m === P ? {} : { display: "none" }, children: l && l({ activateEventWithId: N, deactivate: g }) }),
|
|
94
|
+
i && m === G && i[m],
|
|
94
95
|
c && m === V && /* @__PURE__ */ n(
|
|
95
96
|
W,
|
|
96
97
|
{
|
|
@@ -114,5 +115,6 @@ const W = ({ sdk: e, className: i, scrollStore: l, appNode: t, scrollNode: s, re
|
|
|
114
115
|
] }) });
|
|
115
116
|
};
|
|
116
117
|
export {
|
|
117
|
-
ie as MastersApp
|
|
118
|
+
ie as MastersApp,
|
|
119
|
+
ce as StreamLayerMastersThemeProvider
|
|
118
120
|
};
|
|
@@ -2,8 +2,8 @@ import { useStore as u } from "@nanostores/react";
|
|
|
2
2
|
import { useRef as y, useState as d, useCallback as z, useEffect as c } from "react";
|
|
3
3
|
import { FeatureType as l } from "@streamlayer/sdk-web-types";
|
|
4
4
|
import "./Navigation/MastersNavigation/index.js";
|
|
5
|
-
import { FeaturedGroupsButtonId as p } from "
|
|
6
|
-
import { ChannelsButtonId as i } from "
|
|
5
|
+
import { FeaturedGroupsButtonId as p } from "../../navigation/button/FeaturedGroups.js";
|
|
6
|
+
import { ChannelsButtonId as i } from "../../navigation/button/Channels.js";
|
|
7
7
|
const C = (e) => {
|
|
8
8
|
const f = y(""), [v, a] = d(!1), E = u(e.status), g = u(e.sdkStore.slStreamId), n = u(e.userId()), m = u(e.getActiveFeature()), o = E === "ready" && !!g.data, [A, r] = d(p), S = z(
|
|
9
9
|
(t, s) => {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { HeaderNodeRef, type AppNodeRef } from '
|
|
2
|
+
import { HeaderNodeRef, type AppNodeRef } from '.';
|
|
3
3
|
export declare const useClipboardCopy: (renderToNode: AppNodeRef | HeaderNodeRef) => [(link: string | undefined) => Promise<void>, import("react").ReactPortal | null];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MastersColors: () => import("react/jsx-runtime").JSX.Element[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { ColorItem as s } from "@storybook/blocks";
|
|
3
|
+
import { MASTERS_COLORS as r } from "./masters-theme.js";
|
|
4
|
+
const l = Object.keys(r), i = () => l.map((o) => /* @__PURE__ */ t(
|
|
5
|
+
s,
|
|
6
|
+
{
|
|
7
|
+
title: o,
|
|
8
|
+
subtitle: `--color-${o.toLowerCase().replaceAll("_", "-")}`,
|
|
9
|
+
colors: [r[o]]
|
|
10
|
+
},
|
|
11
|
+
o
|
|
12
|
+
));
|
|
13
|
+
export {
|
|
14
|
+
i as MastersColors
|
|
15
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { ColorItem as e } from "@storybook/blocks";
|
|
3
|
-
import {
|
|
3
|
+
import { PALETTE_COLORS as r } from "./constants.js";
|
|
4
4
|
const l = Object.keys(r), p = () => l.map((o) => /* @__PURE__ */ t(
|
|
5
5
|
e,
|
|
6
6
|
{
|
|
@@ -28,10 +28,10 @@ const N = {
|
|
|
28
28
|
DIVIDER_COLOR_SECONDARY: "#53565a",
|
|
29
29
|
GREEN_PRIMARY_BTN: "#009B77"
|
|
30
30
|
}, T = {
|
|
31
|
-
PRIMARY_GREEN1: "#
|
|
32
|
-
PRIMARY_GREEN2: "#
|
|
33
|
-
PRIMARY_GREEN3: "#
|
|
34
|
-
PRIMARY_GREEN4: "#
|
|
31
|
+
PRIMARY_GREEN1: "#5088C1",
|
|
32
|
+
PRIMARY_GREEN2: "#3C6DB4",
|
|
33
|
+
PRIMARY_GREEN3: "#2653A2",
|
|
34
|
+
PRIMARY_GREEN4: "#1B3A73",
|
|
35
35
|
SECONDARY_RED1: "#DF2F3B",
|
|
36
36
|
SECONDARY_RED2: "#BA0C2F",
|
|
37
37
|
SECONDARY_RED3: "#f9d6d8",
|
|
@@ -75,7 +75,7 @@ export {
|
|
|
75
75
|
O as BREAKPOINTS,
|
|
76
76
|
E as COLORS,
|
|
77
77
|
S as FONT,
|
|
78
|
-
T as MASTERS_COLORS,
|
|
79
78
|
G as ORIENTATION,
|
|
79
|
+
T as PALETTE_COLORS,
|
|
80
80
|
B as colors
|
|
81
81
|
};
|