@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,19 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { styled as i } from "@linaria/react";
|
|
3
|
+
import { OnboardingInviteCard as n } from "../../../../gamification/onboarding/slides/onboarding-invite-card/index.js";
|
|
4
|
+
const r = /* @__PURE__ */ i("div")({
|
|
5
|
+
name: "InviteFriendsContainer",
|
|
6
|
+
class: "ibtkwty",
|
|
7
|
+
propsAsIs: !1
|
|
8
|
+
}), a = ({
|
|
9
|
+
deepLink: e
|
|
10
|
+
}) => /* @__PURE__ */ t(r, {
|
|
11
|
+
children: /* @__PURE__ */ t(n, {
|
|
12
|
+
inviteLink: e,
|
|
13
|
+
inviteCardTitle: "It’s More Fun With Friends",
|
|
14
|
+
inviteCardSubtext: "Invite and compete against your friends for the top spot on the leaderboard."
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
export {
|
|
18
|
+
a as Friends
|
|
19
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Gamification } from '@streamlayer/feature-gamification';
|
|
3
|
+
import type { ScrollNodeRef } from '../../..';
|
|
4
|
+
import { ScrollStore } from '../../../useSdkScroll';
|
|
5
|
+
export declare const Leaderboard: React.FC<{
|
|
6
|
+
gamification: Gamification;
|
|
7
|
+
scrollNode: ScrollNodeRef;
|
|
8
|
+
scrollStore: ScrollStore;
|
|
9
|
+
}>;
|
|
@@ -2,19 +2,19 @@ import { jsx as r, jsxs as f, Fragment as L } from "react/jsx-runtime";
|
|
|
2
2
|
import { styled as h } from "@linaria/react";
|
|
3
3
|
import { useStore as i } from "@nanostores/react";
|
|
4
4
|
import { useRef as k } from "react";
|
|
5
|
-
import { useClipboardCopy as u } from "
|
|
6
|
-
import { InviteLink as I } from "
|
|
5
|
+
import { useClipboardCopy as u } from "../../../useClipboardCopy.js";
|
|
6
|
+
import { InviteLink as I } from "../../../../gamification/invite-link/index.js";
|
|
7
7
|
import "react-virtualized-auto-sizer";
|
|
8
8
|
import "react-window";
|
|
9
9
|
import "react-window-infinite-loader";
|
|
10
|
-
import "
|
|
11
|
-
import "
|
|
12
|
-
import "
|
|
13
|
-
import { LeaderboardStaticList as y } from "
|
|
10
|
+
import "../../../../icons/index.js";
|
|
11
|
+
import "../../../../gamification/leaderboard/list-item/styles.js";
|
|
12
|
+
import "../../../../../styles_z07sl8-l0sNRNKZ.js";
|
|
13
|
+
import { LeaderboardStaticList as y } from "../../../../gamification/leaderboard/static.js";
|
|
14
14
|
import { Friends as C } from "./Friends.js";
|
|
15
15
|
const b = /* @__PURE__ */ h("div")({
|
|
16
16
|
name: "InviteLinkContainer",
|
|
17
|
-
class: "
|
|
17
|
+
class: "i15y1ll1",
|
|
18
18
|
propsAsIs: !1
|
|
19
19
|
}), q = ({
|
|
20
20
|
gamification: e,
|
|
@@ -3,14 +3,14 @@ import { styled as l } from "@linaria/react";
|
|
|
3
3
|
import { useStore as n } from "@nanostores/react";
|
|
4
4
|
import { QuestionType as a } from "@streamlayer/sdk-web-types";
|
|
5
5
|
import { useMastersContext as m } from "../../useMastersContext.js";
|
|
6
|
-
import { VoteHeader as c } from "
|
|
7
|
-
import { Sponsor as p } from "
|
|
8
|
-
import { Vote as f, VoteSkeleton as b } from "
|
|
9
|
-
import { InsightDetails as y } from "
|
|
10
|
-
import { TwitterDetails as V } from "
|
|
11
|
-
const
|
|
6
|
+
import { VoteHeader as c } from "../../../../gamification/detail/header/index.js";
|
|
7
|
+
import { Sponsor as p } from "../../../../gamification/detail/sponsor/index.js";
|
|
8
|
+
import { Vote as f, VoteSkeleton as b } from "../../../../gamification/vote/index.js";
|
|
9
|
+
import { InsightDetails as y } from "../../../../gamification/vote/insight-details/index.js";
|
|
10
|
+
import { TwitterDetails as V } from "../../../../gamification/vote/twitter-details/index.js";
|
|
11
|
+
const h = /* @__PURE__ */ l("div")({
|
|
12
12
|
name: "QuestionContainer",
|
|
13
|
-
class: "
|
|
13
|
+
class: "q142mohu",
|
|
14
14
|
propsAsIs: !1
|
|
15
15
|
}), x = ({
|
|
16
16
|
openedQuestion: t
|
|
@@ -26,7 +26,7 @@ const d = /* @__PURE__ */ l("div")({
|
|
|
26
26
|
...t.attributes.attributes.value,
|
|
27
27
|
controlVideo: r == null ? void 0 : r.controlVideoPlayer
|
|
28
28
|
}) : null;
|
|
29
|
-
},
|
|
29
|
+
}, d = ({
|
|
30
30
|
extendedQuestion: t,
|
|
31
31
|
vote: r,
|
|
32
32
|
close: s
|
|
@@ -49,11 +49,11 @@ const d = /* @__PURE__ */ l("div")({
|
|
|
49
49
|
if (!r)
|
|
50
50
|
return null;
|
|
51
51
|
const o = r.type;
|
|
52
|
-
return /* @__PURE__ */ u(
|
|
52
|
+
return /* @__PURE__ */ u(h, {
|
|
53
53
|
children: [/* @__PURE__ */ e(c, {
|
|
54
54
|
close: t.closeQuestion,
|
|
55
55
|
type: ((i = r.attributes) == null ? void 0 : i.type) || a.UNSET
|
|
56
|
-
}), o === "question" && /* @__PURE__ */ e(
|
|
56
|
+
}), o === "question" && /* @__PURE__ */ e(d, {
|
|
57
57
|
vote: t.submitAnswer,
|
|
58
58
|
close: t.closeQuestion,
|
|
59
59
|
extendedQuestion: s
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Gamification } from '@streamlayer/feature-gamification';
|
|
3
|
+
export declare const QuestionsList: React.FC<{
|
|
4
|
+
store: ReturnType<Exclude<Gamification['feedList'], undefined>['getStore']>;
|
|
5
|
+
openQuestion: (questionId: string) => void;
|
|
6
|
+
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { useStore as i } from "@nanostores/react";
|
|
3
3
|
import { useMastersContext as n } from "../../useMastersContext.js";
|
|
4
|
-
import { QuestionList as m } from "
|
|
4
|
+
import { QuestionList as m } from "../../../../gamification/question/list/index.js";
|
|
5
5
|
const a = ({ store: t, openQuestion: r }) => {
|
|
6
6
|
const { sdk: o } = n(), e = i(t);
|
|
7
7
|
return /* @__PURE__ */ s(m, { openQuestion: r, questions: e.data, controlVideo: o == null ? void 0 : o.controlVideoPlayer });
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type Gamification } from '@streamlayer/feature-gamification';
|
|
3
|
+
import type { AppNodeRef, ScrollNodeRef } from '../../..';
|
|
4
|
+
import { ResponsiveStore } from '../../../useSdkResponsive';
|
|
5
|
+
import { ScrollStore } from '../../../useSdkScroll';
|
|
6
|
+
export declare const Tabs: React.FC<{
|
|
7
|
+
appNode: AppNodeRef;
|
|
8
|
+
gamification: Gamification;
|
|
9
|
+
scrollStore: ScrollStore;
|
|
10
|
+
scrollNode: ScrollNodeRef;
|
|
11
|
+
responsiveStore: ResponsiveStore;
|
|
12
|
+
className?: string;
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsxs as h, jsx as e, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import { useStore as u } from "@nanostores/react";
|
|
3
|
+
import { useState as D, useTransition as T, useEffect as v } from "react";
|
|
4
|
+
import { TabsContainer as C, TabsNavContainer as A, SDKWhiteContainer as I, UserSummaryContainer as P, SDKContentContainer as S, LeaderboardContainer as V } from "../../../styles.js";
|
|
5
|
+
import { scrollIntoAppView as E } from "../../../useSdkScroll.js";
|
|
6
|
+
import { ActivePages as a, Tabs as K } from "../../../../gamification/tabs/index.js";
|
|
7
|
+
import { Leaderboard as L } from "./Leaderboard.js";
|
|
8
|
+
import { QuestionsList as F } from "./QuestionsList.js";
|
|
9
|
+
import { UserSummary as O } from "./UserSummary.js";
|
|
10
|
+
const q = ({ gamification: s, className: f, scrollStore: t, scrollNode: l, appNode: c, style: b, responsiveStore: n }) => {
|
|
11
|
+
const { tabsShown: d } = u(t, { keys: ["tabsShown"] }), [i, w] = D(a.HOME), [, y] = T(), { sdkInDesktopView: m, screen: g } = u(n, { keys: ["sdkInDesktopView"] }), k = (r) => {
|
|
12
|
+
y(() => {
|
|
13
|
+
var p;
|
|
14
|
+
w(r), m === !1 && (((p = c.current) == null ? void 0 : p.getBoundingClientRect().y) || 0) < 0 && E(c, g.size, { behavior: "instant" });
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
v(() => t.subscribe((r) => {
|
|
18
|
+
if (r.scrollPosition === 0) {
|
|
19
|
+
t.setKey("tabsShown", !0);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
n.get().sdkInDesktopView ? t.setKey("tabsShown", r.scrollDirection === "backward") : t.setKey("tabsShown", r.scrollDirection === "forward");
|
|
23
|
+
}), [t, n]);
|
|
24
|
+
let o = "0px";
|
|
25
|
+
return m ? o = d ? "0px" : "calc(8px - var(--header-height) - var(--header-offset))" : o = d ? "calc(var(--header-height) + var(--header-offset) - 2px)" : "0px", /* @__PURE__ */ h(C, { className: f, style: b, children: [
|
|
26
|
+
/* @__PURE__ */ e(
|
|
27
|
+
A,
|
|
28
|
+
{
|
|
29
|
+
style: {
|
|
30
|
+
top: o
|
|
31
|
+
},
|
|
32
|
+
children: /* @__PURE__ */ e(K, { activePage: i, toggleActivePage: k })
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
i === a.HOME && /* @__PURE__ */ h(x, { children: [
|
|
36
|
+
/* @__PURE__ */ e(I, { style: { paddingTop: "8px" }, children: /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(O, { userSummary: s.userSummary }) }) }),
|
|
37
|
+
/* @__PURE__ */ e(S, { style: { flex: 1 }, children: /* @__PURE__ */ e(F, { openQuestion: s.openQuestion, store: s.feedList.getStore() }) })
|
|
38
|
+
] }),
|
|
39
|
+
i === a.LEADERBOARD && /* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(L, { scrollStore: t, scrollNode: l, gamification: s }) })
|
|
40
|
+
] });
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
q as Tabs
|
|
44
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useState as i, useEffect as n } from "react";
|
|
3
|
+
import { UserStatistics as a } from "../../../../gamification/user-statistics/index.js";
|
|
4
|
+
const b = ({ userSummary: r }) => {
|
|
5
|
+
var e;
|
|
6
|
+
const [t, s] = i(void 0);
|
|
7
|
+
return n(() => {
|
|
8
|
+
const c = r.$store.subscribe((o) => {
|
|
9
|
+
o && s(o);
|
|
10
|
+
});
|
|
11
|
+
return () => {
|
|
12
|
+
c();
|
|
13
|
+
};
|
|
14
|
+
}, [r]), /* @__PURE__ */ m(a, { loading: !(t != null && t.summary), ...t == null ? void 0 : t.summary, successRate: (e = t == null ? void 0 : t.percentage) == null ? void 0 : e.correct });
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
b as UserSummary
|
|
18
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type Gamification as GamificationClass } from '@streamlayer/feature-gamification';
|
|
3
|
+
import type { AppNodeRef, ScrollNodeRef } from '../../..';
|
|
4
|
+
import { ResponsiveStore } from '../../../useSdkResponsive';
|
|
5
|
+
import { ScrollStore } from '../../../useSdkScroll';
|
|
6
|
+
export declare const GamificationOverlay: React.FC<{
|
|
7
|
+
gamification: GamificationClass;
|
|
8
|
+
className?: string;
|
|
9
|
+
scrollStore: ScrollStore;
|
|
10
|
+
responsiveStore: ResponsiveStore;
|
|
11
|
+
appNode: AppNodeRef;
|
|
12
|
+
scrollNode: ScrollNodeRef;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* Standalone version of the gamification overlay
|
|
16
|
+
* includes the question and user details, which are shown in a modal and should be available on any overlay
|
|
17
|
+
*/
|
|
18
|
+
export declare const GamificationOverlayStandalone: React.FC<{
|
|
19
|
+
gamification: GamificationClass;
|
|
20
|
+
className?: string;
|
|
21
|
+
responsiveStore: ResponsiveStore;
|
|
22
|
+
appNode: AppNodeRef;
|
|
23
|
+
}>;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsx as n, jsxs as f } from "react/jsx-runtime";
|
|
2
2
|
import { styled as p } from "@linaria/react";
|
|
3
3
|
import { useStore as a } from "@nanostores/react";
|
|
4
|
-
import { useHideTransition as h } from "
|
|
5
|
-
import { SDKWhiteContainer as
|
|
6
|
-
import { VoteHeader as
|
|
7
|
-
import { UserStatistics as S } from "
|
|
8
|
-
import { ModalPortal as U } from "
|
|
9
|
-
import { ShowIn as I } from "
|
|
10
|
-
import { Question as
|
|
11
|
-
import { Tabs as
|
|
12
|
-
const
|
|
4
|
+
import { useHideTransition as h } from "../../../../../hooks/showIn.js";
|
|
5
|
+
import { SDKWhiteContainer as k } from "../../../styles.js";
|
|
6
|
+
import { VoteHeader as C } from "../../../../gamification/detail/header/index.js";
|
|
7
|
+
import { UserStatistics as S } from "../../../../gamification/user-statistics/index.js";
|
|
8
|
+
import { ModalPortal as U } from "../../../../modal/index.js";
|
|
9
|
+
import { ShowIn as I } from "../../../../show-in/index.js";
|
|
10
|
+
import { Question as v } from "./Question.js";
|
|
11
|
+
import { Tabs as x } from "./Tabs.js";
|
|
12
|
+
const y = () => I, m = /* @__PURE__ */ p(y())({
|
|
13
13
|
name: "OpenedContainer",
|
|
14
|
-
class: "
|
|
14
|
+
class: "o11khimm",
|
|
15
15
|
propsAsIs: !0
|
|
16
|
-
}),
|
|
16
|
+
}), O = /* @__PURE__ */ p("div")({
|
|
17
17
|
name: "UserContainer",
|
|
18
|
-
class: "
|
|
18
|
+
class: "u1u71vrh",
|
|
19
19
|
propsAsIs: !1
|
|
20
20
|
}), w = ({
|
|
21
21
|
correct: e,
|
|
@@ -23,52 +23,52 @@ const O = () => I, m = /* @__PURE__ */ p(O())({
|
|
|
23
23
|
}) => {
|
|
24
24
|
const o = e + r;
|
|
25
25
|
return o === 0 ? 0 : Math.round(e / o * 100);
|
|
26
|
-
},
|
|
26
|
+
}, E = ({
|
|
27
27
|
gamification: e,
|
|
28
28
|
scrollStore: r,
|
|
29
29
|
className: o,
|
|
30
30
|
appNode: i,
|
|
31
31
|
scrollNode: s,
|
|
32
32
|
responsiveStore: t
|
|
33
|
-
}) => /* @__PURE__ */ n(
|
|
33
|
+
}) => /* @__PURE__ */ n(x, {
|
|
34
34
|
appNode: i,
|
|
35
35
|
scrollStore: r,
|
|
36
36
|
scrollNode: s,
|
|
37
37
|
className: o,
|
|
38
38
|
gamification: e,
|
|
39
39
|
responsiveStore: t
|
|
40
|
-
}),
|
|
40
|
+
}), F = ({
|
|
41
41
|
gamification: e,
|
|
42
42
|
className: r,
|
|
43
43
|
appNode: o,
|
|
44
44
|
responsiveStore: i
|
|
45
45
|
}) => {
|
|
46
46
|
const s = a(e.openedQuestion.$store), t = a(e.openedUser), {
|
|
47
|
-
sdkInDesktopView:
|
|
47
|
+
sdkInDesktopView: u
|
|
48
48
|
} = a(i, {
|
|
49
49
|
keys: ["sdkInDesktopView"]
|
|
50
50
|
}), {
|
|
51
|
-
hiding:
|
|
52
|
-
onAnimationEnd:
|
|
51
|
+
hiding: c,
|
|
52
|
+
onAnimationEnd: l
|
|
53
53
|
} = h();
|
|
54
54
|
if (!o.current || !s && !t)
|
|
55
55
|
return null;
|
|
56
|
-
const
|
|
56
|
+
const d = s ? /* @__PURE__ */ n(m, {
|
|
57
57
|
className: r,
|
|
58
|
-
hiding:
|
|
59
|
-
onAnimationEnd:
|
|
60
|
-
children: /* @__PURE__ */ n(
|
|
58
|
+
hiding: c,
|
|
59
|
+
onAnimationEnd: l,
|
|
60
|
+
children: /* @__PURE__ */ n(v, {
|
|
61
61
|
gamification: e
|
|
62
62
|
})
|
|
63
63
|
}) : t ? /* @__PURE__ */ n(m, {
|
|
64
64
|
className: r,
|
|
65
|
-
hiding:
|
|
66
|
-
onAnimationEnd:
|
|
67
|
-
children: /* @__PURE__ */ f(
|
|
68
|
-
children: [/* @__PURE__ */ n(
|
|
65
|
+
hiding: c,
|
|
66
|
+
onAnimationEnd: l,
|
|
67
|
+
children: /* @__PURE__ */ f(O, {
|
|
68
|
+
children: [/* @__PURE__ */ n(C, {
|
|
69
69
|
label: "Friend's Rank",
|
|
70
70
|
close: e.closeUser
|
|
71
|
-
}), /* @__PURE__ */ n(
|
|
71
|
+
}), /* @__PURE__ */ n(k, {
|
|
72
72
|
children: /* @__PURE__ */ n(S, {
|
|
73
73
|
...t,
|
|
74
74
|
successRate: w(t)
|
|
@@ -78,11 +78,11 @@ const O = () => I, m = /* @__PURE__ */ p(O())({
|
|
|
78
78
|
}) : null;
|
|
79
79
|
return /* @__PURE__ */ n(U, {
|
|
80
80
|
container: o,
|
|
81
|
-
useContainer: !
|
|
82
|
-
children:
|
|
81
|
+
useContainer: !u,
|
|
82
|
+
children: d
|
|
83
83
|
});
|
|
84
84
|
};
|
|
85
85
|
export {
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
E as GamificationOverlay,
|
|
87
|
+
F as GamificationOverlayStandalone
|
|
88
88
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Features } from '@streamlayer/sdk-web-features';
|
|
3
|
+
import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
4
|
+
import type { AppNodeRef, ScrollNodeRef } from '../..';
|
|
5
|
+
import { ResponsiveStore } from '../../useSdkResponsive';
|
|
6
|
+
import { ScrollStore } from '../../useSdkScroll';
|
|
7
|
+
/** render feature by type */
|
|
8
|
+
export declare const ActiveFeature: React.FC<{
|
|
9
|
+
sdk: StreamLayerSDK;
|
|
10
|
+
feature: Features | null;
|
|
11
|
+
scrollStore: ScrollStore;
|
|
12
|
+
responsiveStore: ResponsiveStore;
|
|
13
|
+
appNode: AppNodeRef;
|
|
14
|
+
scrollNode: ScrollNodeRef;
|
|
15
|
+
className?: string;
|
|
16
|
+
}>;
|
|
17
|
+
/** render feature by type */
|
|
18
|
+
export declare const StandaloneFeature: React.FC<{
|
|
19
|
+
sdk: StreamLayerSDK;
|
|
20
|
+
feature: Features | null;
|
|
21
|
+
responsiveStore: ResponsiveStore;
|
|
22
|
+
appNode: AppNodeRef;
|
|
23
|
+
className?: string;
|
|
24
|
+
}>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { lazy as f, useMemo as c, Suspense as g } from "react";
|
|
3
|
+
import { FeatureType as m } from "@streamlayer/sdk-web-types";
|
|
4
|
+
import { FeatureProvider as p } from "./FeatureProvider.js";
|
|
5
|
+
import { GamificationOverlayStandalone as y } from "./Gamification/index.js";
|
|
6
|
+
const d = f(() => import("./Gamification/gamification-feature.js")), x = ({ sdk: i, feature: t, className: n, scrollStore: e, appNode: o, scrollNode: a, responsiveStore: l }) => {
|
|
7
|
+
const u = c(() => t && t.featureConfig.get().type === m.GAMES ? /* @__PURE__ */ r(p, { className: n, sdk: i, feature: t, children: /* @__PURE__ */ r(
|
|
8
|
+
d,
|
|
9
|
+
{
|
|
10
|
+
appNode: o,
|
|
11
|
+
scrollStore: e,
|
|
12
|
+
scrollNode: a,
|
|
13
|
+
className: n,
|
|
14
|
+
responsiveStore: l,
|
|
15
|
+
gamification: t
|
|
16
|
+
}
|
|
17
|
+
) }) : null, [i, t, n, l, e, a, o]);
|
|
18
|
+
return /* @__PURE__ */ r(
|
|
19
|
+
g,
|
|
20
|
+
{
|
|
21
|
+
fallback: /* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: "page loading..." }),
|
|
22
|
+
children: u
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}, A = ({ feature: i, className: t, appNode: n, responsiveStore: e }) => i && i.featureConfig.get().type === m.GAMES ? /* @__PURE__ */ r(
|
|
26
|
+
y,
|
|
27
|
+
{
|
|
28
|
+
className: t,
|
|
29
|
+
appNode: n,
|
|
30
|
+
responsiveStore: e,
|
|
31
|
+
gamification: i
|
|
32
|
+
}
|
|
33
|
+
) : null;
|
|
34
|
+
export {
|
|
35
|
+
x as ActiveFeature,
|
|
36
|
+
A as StandaloneFeature
|
|
37
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ResponsiveStore } from '
|
|
3
|
-
import { ChannelsButtonId } from '
|
|
4
|
-
import { FeaturedGroupsButtonId } from '
|
|
5
|
-
import { LeaderBoardButtonId } from '
|
|
2
|
+
import { ResponsiveStore } from '../../../useSdkResponsive';
|
|
3
|
+
import { ChannelsButtonId } from '../../../../navigation/button/Channels';
|
|
4
|
+
import { FeaturedGroupsButtonId } from '../../../../navigation/button/FeaturedGroups';
|
|
5
|
+
import { LeaderBoardButtonId } from '../../../../navigation/button/LeaderBoard';
|
|
6
6
|
export { ChannelsButtonId, LeaderBoardButtonId, FeaturedGroupsButtonId };
|
|
7
7
|
export type AvailableOverlays = typeof ChannelsButtonId | typeof LeaderBoardButtonId | typeof FeaturedGroupsButtonId;
|
|
8
8
|
type MastersNavigationProps = {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as s, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useStore as B } from "@nanostores/react";
|
|
3
3
|
import { forwardRef as l } from "react";
|
|
4
|
-
import { ChannelsButton as c, ChannelsButtonId as t } from "
|
|
5
|
-
import { FeaturedGroupsButton as x, FeaturedGroupsButtonId as n } from "
|
|
6
|
-
import { LeaderBoardButtonId as S } from "
|
|
7
|
-
import { Navigation as I, NavigationItems as h } from "
|
|
8
|
-
import { BREAKPOINTS as d } from "
|
|
4
|
+
import { ChannelsButton as c, ChannelsButtonId as t } from "../../../../navigation/button/Channels.js";
|
|
5
|
+
import { FeaturedGroupsButton as x, FeaturedGroupsButtonId as n } from "../../../../navigation/button/FeaturedGroups.js";
|
|
6
|
+
import { LeaderBoardButtonId as S } from "../../../../navigation/button/LeaderBoard.js";
|
|
7
|
+
import { Navigation as I, NavigationItems as h } from "../../../../navigation/masters.js";
|
|
8
|
+
import { BREAKPOINTS as d } from "../../../../theme/constants.js";
|
|
9
9
|
const z = l(
|
|
10
10
|
({ activeOverlay: o, setActiveOverlay: e, scrollToTop: i, sdkReady: u, className: a, responsiveStore: f }, p) => {
|
|
11
11
|
const { screen: m } = B(f, { keys: ["screen"] });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
3
|
-
import { Overlays } from '
|
|
4
|
-
import { ButtonProps } from '
|
|
3
|
+
import { Overlays } from '..';
|
|
4
|
+
import { ButtonProps } from '../../../navigation/button';
|
|
5
5
|
export declare const SDKNavigation: React.FC<{
|
|
6
6
|
customOverlays: Overlays;
|
|
7
7
|
activeButton?: ButtonProps['id'];
|
|
@@ -2,8 +2,8 @@ import { jsx as n } from "react/jsx-runtime";
|
|
|
2
2
|
import { useStore as s } from "@nanostores/react";
|
|
3
3
|
import { useMemo as e } from "react";
|
|
4
4
|
import { AvailableFeatures as d } from "@streamlayer/sdk-web-features";
|
|
5
|
-
import { Navigation as v } from "
|
|
6
|
-
import { Button as b } from "
|
|
5
|
+
import { Navigation as v } from "../../../navigation/index.js";
|
|
6
|
+
import { Button as b } from "../../../navigation/button/index.js";
|
|
7
7
|
const x = ({ customOverlays: a, activeButton: c, sdk: i }) => {
|
|
8
8
|
const t = s(i.sdkStore.organizationSettings), r = s(i.sdkStore.streamSettings), p = e(() => {
|
|
9
9
|
const o = (r == null ? void 0 : r.data) || (t == null ? void 0 : t.data);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Notification } from '@streamlayer/sdk-web-notifications';
|
|
3
|
+
import { GameSettings } from '@streamlayer/sdk-web-types';
|
|
4
|
+
export declare const Onboarding: React.FC<{
|
|
5
|
+
close: Notification['close'];
|
|
6
|
+
action: Notification['action'];
|
|
7
|
+
onboarding?: GameSettings;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsxs as S, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Container as L, CloseIconWrap as P, CloseIcon as T, Title as f, SponsorLogo as j, PresentsTitle as k, Subtitle as r, Description as E, ActionButton as I } from "./styles.js";
|
|
3
|
+
const y = ({ close: i, action: x, onboarding: t }) => {
|
|
4
|
+
var l, s, c, C, p, h, m, u;
|
|
5
|
+
return /* @__PURE__ */ S(L, { children: [
|
|
6
|
+
/* @__PURE__ */ e(P, { onClick: i, children: /* @__PURE__ */ e(T, { name: "icon-cross" }) }),
|
|
7
|
+
((s = (l = t == null ? void 0 : t.titleCard) == null ? void 0 : l.media) == null ? void 0 : s.sponsorLogo) && /* @__PURE__ */ S(f, { children: [
|
|
8
|
+
/* @__PURE__ */ e(j, { alt: "sponsor-logo", src: (C = (c = t == null ? void 0 : t.titleCard) == null ? void 0 : c.media) == null ? void 0 : C.sponsorLogo }),
|
|
9
|
+
/* @__PURE__ */ e(k, { children: "PRESENTS" })
|
|
10
|
+
] }),
|
|
11
|
+
((p = t == null ? void 0 : t.titleCard) == null ? void 0 : p.title) && /* @__PURE__ */ e(r, { children: (h = t == null ? void 0 : t.titleCard) == null ? void 0 : h.title }),
|
|
12
|
+
((m = t == null ? void 0 : t.titleCard) == null ? void 0 : m.subtitle) && /* @__PURE__ */ e(E, { children: (u = t == null ? void 0 : t.titleCard) == null ? void 0 : u.subtitle }),
|
|
13
|
+
/* @__PURE__ */ e(I, { onClick: x, children: "Play Now" })
|
|
14
|
+
] });
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
y as Onboarding
|
|
18
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
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 CloseIconWrap: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
4
|
+
export declare const CloseIcon: any;
|
|
5
|
+
export declare const Title: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
6
|
+
export declare const SponsorLogo: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown>>;
|
|
7
|
+
export declare const PresentsTitle: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
8
|
+
export declare const Subtitle: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
9
|
+
export declare const Description: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
10
|
+
export declare const ActionButton: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
|
package/lib/ui/app/{Notifications → masters/Notifications}/Onboarding/Notification/styles.js
RENAMED
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
|
-
import { SvgIcon as o } from "
|
|
2
|
+
import { SvgIcon as o } from "../../../../../icons/index.js";
|
|
3
3
|
const c = /* @__PURE__ */ s("div")({
|
|
4
4
|
name: "Container",
|
|
5
|
-
class: "
|
|
5
|
+
class: "cy1ghlr",
|
|
6
6
|
propsAsIs: !1
|
|
7
7
|
}), a = /* @__PURE__ */ s("div")({
|
|
8
8
|
name: "CloseIconWrap",
|
|
9
|
-
class: "
|
|
9
|
+
class: "cg5f18y",
|
|
10
10
|
propsAsIs: !1
|
|
11
11
|
}), n = () => o, l = /* @__PURE__ */ s(n())({
|
|
12
12
|
name: "CloseIcon",
|
|
13
|
-
class: "
|
|
13
|
+
class: "c19va0ky",
|
|
14
14
|
propsAsIs: !0
|
|
15
15
|
}), p = /* @__PURE__ */ s("div")({
|
|
16
16
|
name: "Title",
|
|
17
|
-
class: "
|
|
17
|
+
class: "tnfu29o",
|
|
18
18
|
propsAsIs: !1
|
|
19
19
|
}), r = /* @__PURE__ */ s("img")({
|
|
20
20
|
name: "SponsorLogo",
|
|
21
|
-
class: "
|
|
21
|
+
class: "svw1c58",
|
|
22
22
|
propsAsIs: !1
|
|
23
23
|
}), i = /* @__PURE__ */ s("div")({
|
|
24
24
|
name: "PresentsTitle",
|
|
25
|
-
class: "
|
|
25
|
+
class: "pqfs3yj",
|
|
26
26
|
propsAsIs: !1
|
|
27
|
-
}),
|
|
27
|
+
}), f = /* @__PURE__ */ s("div")({
|
|
28
28
|
name: "Subtitle",
|
|
29
|
-
class: "
|
|
29
|
+
class: "s1fma09t",
|
|
30
30
|
propsAsIs: !1
|
|
31
|
-
}),
|
|
31
|
+
}), m = /* @__PURE__ */ s("div")({
|
|
32
32
|
name: "Description",
|
|
33
|
-
class: "
|
|
33
|
+
class: "dcghfqc",
|
|
34
34
|
propsAsIs: !1
|
|
35
|
-
}),
|
|
35
|
+
}), I = /* @__PURE__ */ s("button")({
|
|
36
36
|
name: "ActionButton",
|
|
37
|
-
class: "
|
|
37
|
+
class: "a1v24usc",
|
|
38
38
|
propsAsIs: !1
|
|
39
39
|
});
|
|
40
40
|
export {
|
|
41
|
-
|
|
41
|
+
I as ActionButton,
|
|
42
42
|
l as CloseIcon,
|
|
43
43
|
a as CloseIconWrap,
|
|
44
44
|
c as Container,
|
|
45
|
-
|
|
45
|
+
m as Description,
|
|
46
46
|
i as PresentsTitle,
|
|
47
47
|
r as SponsorLogo,
|
|
48
|
-
|
|
48
|
+
f as Subtitle,
|
|
49
49
|
p as Title
|
|
50
50
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
3
|
+
import { type Notification } from '@streamlayer/sdk-web-notifications';
|
|
4
|
+
import { type AppNodeRef } from '../..';
|
|
5
|
+
import { ResponsiveStore } from '../../../useSdkResponsive';
|
|
6
|
+
export declare const Onboarding: React.FC<{
|
|
7
|
+
sdk: StreamLayerSDK;
|
|
8
|
+
notification: Notification;
|
|
9
|
+
saveHeight: (height: number) => void;
|
|
10
|
+
appNode: AppNodeRef;
|
|
11
|
+
sdkInDesktopView?: boolean;
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
responsiveStore: ResponsiveStore;
|
|
14
|
+
}>;
|