@streamlayer/react-ui 1.9.0 → 1.11.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/app/app/Advertisement/index.d.ts +1 -0
- package/lib/app/app/Advertisement/index.js +78 -67
- package/lib/app/app/Features/Gamification/Question.d.ts +1 -0
- package/lib/app/app/Features/Gamification/Question.js +43 -41
- package/lib/app/app/Features/Gamification/Tabs.js +22 -21
- package/lib/app/app/Features/Gamification/index.js +66 -62
- package/lib/app/app/Insight/index.d.ts +2 -0
- package/lib/app/app/Insight/index.js +28 -24
- package/lib/app/app/Navigation/index.d.ts +4 -0
- package/lib/app/app/Navigation/index.js +88 -48
- package/lib/app/app/Notifications/index.js +125 -113
- package/lib/app/app/Points/index.js +16 -16
- package/lib/app/app/index.d.ts +1 -0
- package/lib/app/app/index.js +84 -83
- package/lib/app/app/story/index.js +27 -24
- package/lib/app/app/story/insight/index.d.ts +1 -0
- package/lib/app/app/story/insight/index.js +29 -26
- package/lib/app/app/story/insight/video.d.ts +1 -0
- package/lib/app/app/story/insight/video.js +13 -13
- package/lib/app/app/story/promotion/content.d.ts +3 -1
- package/lib/app/app/story/promotion/content.js +13 -10
- package/lib/app/app/story/promotion/index.d.ts +1 -0
- package/lib/app/app/story/promotion/index.js +34 -30
- package/lib/app/app/story/promotion/video.d.ts +1 -0
- package/lib/app/app/story/promotion/video.js +34 -31
- package/lib/app/app/styles.js +44 -0
- package/lib/app/app/useApp.d.ts +2 -14
- package/lib/app/app/useApp.js +14 -43
- package/lib/app/app/useAppContext.d.ts +2 -0
- package/lib/app/app/useAppContext.js +6 -5
- package/lib/app/masters/Features/Gamification/Leaderboard.d.ts +1 -1
- package/lib/app/masters/Features/Gamification/Tabs.d.ts +2 -2
- package/lib/app/masters/Features/Gamification/Tabs.js +2 -2
- package/lib/app/masters/Features/Gamification/index.d.ts +2 -2
- package/lib/app/masters/Features/Gamification/index.js +1 -1
- package/lib/app/masters/Features/index.d.ts +2 -2
- package/lib/app/masters/Navigation/MastersNavigation/index.d.ts +1 -1
- package/lib/app/masters/Notifications/Onboarding/index.d.ts +1 -1
- package/lib/app/masters/Notifications/Onboarding/index.js +4 -4
- package/lib/app/masters/Notifications/index.d.ts +2 -2
- package/lib/app/masters/Notifications/index.js +1 -1
- package/lib/app/masters/masters.js +23 -23
- package/lib/app/masters/styles.d.ts +20 -0
- package/lib/app/{styles.js → masters/styles.js} +15 -15
- package/lib/app/masters/useSdkResponsive.d.ts +15 -0
- package/lib/app/masters/useSdkResponsive.js +45 -0
- package/lib/app/masters/useSdkScroll.d.ts +12 -0
- package/lib/app/masters/useSdkScroll.js +50 -0
- package/lib/app/useSdkResponsive.d.ts +1 -0
- package/lib/app/useSdkResponsive.js +27 -29
- package/lib/app/useSdkScroll.js +25 -24
- package/lib/assets/style.css +1 -1
- package/lib/ui/advertisement/banner/index.js +14 -11
- package/lib/ui/advertisement/index.d.ts +3 -0
- package/lib/ui/advertisement/index.js +31 -10
- package/lib/ui/advertisement/notification/index.d.ts +1 -0
- package/lib/ui/advertisement/notification/index.js +30 -27
- package/lib/ui/advertisement/notification/lower-third/index.d.ts +9 -0
- package/lib/ui/advertisement/notification/lower-third/index.js +37 -0
- package/lib/ui/advertisement/notification/lower-third/styles.d.ts +16 -0
- package/lib/ui/advertisement/notification/lower-third/styles.js +64 -0
- package/lib/ui/advertisement/overlay/index.d.ts +2 -0
- package/lib/ui/advertisement/overlay/index.js +58 -43
- package/lib/ui/advertisement/overlay/styles.d.ts +0 -2
- package/lib/ui/advertisement/overlay/styles.js +41 -52
- package/lib/ui/close-btn/index.d.ts +7 -0
- package/lib/ui/close-btn/index.js +47 -0
- package/lib/ui/gamification/detail/header/index.d.ts +2 -1
- package/lib/ui/gamification/detail/header/index.js +16 -15
- package/lib/ui/gamification/vote/styles.js +1 -1
- package/lib/ui/navigation/button/FeaturedGroups.d.ts +1 -1
- package/lib/ui/navigation/index.d.ts +5 -3
- package/lib/ui/navigation/index.js +11 -12
- package/lib/ui/navigation/masters.js +1 -1
- package/lib/ui/navigation/styles.d.ts +5 -0
- package/lib/ui/navigation/styles.js +16 -0
- package/lib/ui/questions/insight/index.js +21 -20
- package/lib/ui/theme/masters-theme.js +36 -13
- package/lib/ui/theme/theme.js +25 -26
- package/lib/ui/timer/index.d.ts +3 -1
- package/lib/ui/timer/index.js +54 -32
- package/lib/ui/video-player/index.d.ts +2 -0
- package/lib/ui/video-player/index.js +62 -51
- package/lib/ui/video-player/styles.d.ts +1 -0
- package/lib/ui/video-player/styles.js +7 -6
- package/package.json +15 -15
- /package/lib/app/{styles.d.ts → app/styles.d.ts} +0 -0
|
@@ -8,6 +8,7 @@ export type StreamLayerSDKAdvertisementProps = {
|
|
|
8
8
|
sidebar?: 'left' | 'right';
|
|
9
9
|
banner?: 'top' | 'bottom';
|
|
10
10
|
layoutMode?: 'cover' | 'side-by-side';
|
|
11
|
+
skipAutoClose?: boolean;
|
|
11
12
|
};
|
|
12
13
|
export declare const StreamLayerSDKAdvertisement: React.FC<StreamLayerSDKAdvertisementProps & {
|
|
13
14
|
sdk: StreamLayerSDK;
|
|
@@ -1,99 +1,110 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { cx as b } from "@linaria/core";
|
|
3
|
+
import { styled as g } from "@linaria/react";
|
|
4
|
+
import { useStore as A } from "@nanostores/react";
|
|
5
|
+
import { useAnalyticsListener as h } from "../../../hooks/analytics.js";
|
|
6
|
+
import { useRef as L } from "react";
|
|
7
|
+
import { eventBus as v } from "@streamlayer/sdk-web-interfaces";
|
|
8
|
+
import { FeatureType as I, NotificationPromotionMode as w, PromotionType as T } from "@streamlayer/sdk-web-types";
|
|
9
|
+
import { AdvertisementUI as U } from "../../../ui/advertisement/index.js";
|
|
10
|
+
const N = /* @__PURE__ */ g("div")({
|
|
10
11
|
name: "AdvertisementUIWrap",
|
|
11
12
|
class: "aa6pjif",
|
|
12
13
|
propsAsIs: !1
|
|
13
|
-
}),
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
16
|
-
const
|
|
17
|
-
|
|
14
|
+
}), W = (r) => {
|
|
15
|
+
const e = r.target;
|
|
16
|
+
if (e instanceof HTMLAnchorElement && e.target === "_blank") {
|
|
17
|
+
const o = e.getAttribute("data-promo-id") || "", i = e.getAttribute("data-promo-type") || T.UNSET;
|
|
18
|
+
e.getAttribute("data-analytics") === "button" && v.emit("advertisement", {
|
|
18
19
|
action: "buttonSelect",
|
|
19
20
|
payload: {
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
id: o,
|
|
22
|
+
type: i
|
|
22
23
|
}
|
|
23
|
-
}),
|
|
24
|
+
}), e.getAttribute("data-analytics") === "banner" && v.emit("advertisement", {
|
|
24
25
|
action: "bannerSelect",
|
|
25
26
|
payload: {
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
id: o,
|
|
28
|
+
type: i
|
|
28
29
|
}
|
|
29
30
|
});
|
|
30
31
|
}
|
|
31
|
-
},
|
|
32
|
-
gamification:
|
|
33
|
-
layoutMode:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
}, E = ({
|
|
33
|
+
gamification: r,
|
|
34
|
+
layoutMode: e,
|
|
35
|
+
skipAutoClose: o,
|
|
36
|
+
skipTypeCheck: i,
|
|
37
|
+
sidebar: n,
|
|
38
|
+
banner: a,
|
|
39
|
+
notification: d,
|
|
38
40
|
isMobileScreen: l,
|
|
39
|
-
persistent:
|
|
41
|
+
persistent: c
|
|
40
42
|
}) => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
var f, p, u;
|
|
44
|
+
const s = L(null), t = A(r.advertisement.$store);
|
|
45
|
+
h(s, {
|
|
46
|
+
enabled: !!t.data,
|
|
44
47
|
event: "click",
|
|
45
|
-
listener:
|
|
48
|
+
listener: W
|
|
46
49
|
});
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
const y = !a && !n;
|
|
51
|
+
if (t.data === void 0 || !c && t.isViewed)
|
|
52
|
+
return null;
|
|
53
|
+
const S = ((u = (p = (f = t == null ? void 0 : t.data) == null ? void 0 : f.notification) == null ? void 0 : p.promotion) == null ? void 0 : u.mode) === w.LOWER_THIRD;
|
|
54
|
+
return /* @__PURE__ */ m(N, {
|
|
55
|
+
ref: s,
|
|
50
56
|
style: {
|
|
51
|
-
height:
|
|
57
|
+
height: y ? "auto" : "100%"
|
|
52
58
|
},
|
|
53
|
-
className: l
|
|
54
|
-
children: /* @__PURE__ */
|
|
55
|
-
skipTypeCheck:
|
|
56
|
-
sidebar:
|
|
57
|
-
banner:
|
|
58
|
-
advertisement:
|
|
59
|
-
close:
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
className: b("SL-AdvertisementUIWrap", l && "mobile-view", S && "SL-AdvertisementUIWrap--lower-third"),
|
|
60
|
+
children: /* @__PURE__ */ m(U, {
|
|
61
|
+
skipTypeCheck: i,
|
|
62
|
+
sidebar: n,
|
|
63
|
+
banner: a,
|
|
64
|
+
advertisement: t.data,
|
|
65
|
+
close: t.close,
|
|
66
|
+
markAsViewed: r.advertisement.markAsViewed,
|
|
67
|
+
open: r.advertisement.open,
|
|
68
|
+
layoutMode: e,
|
|
69
|
+
isNotification: d,
|
|
70
|
+
skipAutoClose: o
|
|
62
71
|
})
|
|
63
72
|
});
|
|
64
|
-
},
|
|
65
|
-
sdk:
|
|
66
|
-
sidebar:
|
|
67
|
-
banner:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
}, H = ({
|
|
74
|
+
sdk: r,
|
|
75
|
+
sidebar: e,
|
|
76
|
+
banner: o,
|
|
77
|
+
skipAutoClose: i,
|
|
78
|
+
skipTypeCheck: n,
|
|
79
|
+
layoutMode: a,
|
|
80
|
+
isMobileScreen: d,
|
|
71
81
|
persistent: l,
|
|
72
|
-
notification:
|
|
82
|
+
notification: c
|
|
73
83
|
}) => {
|
|
74
|
-
const
|
|
75
|
-
if (
|
|
76
|
-
return /* @__PURE__ */
|
|
84
|
+
const s = A(r.featuresList.getStore());
|
|
85
|
+
if (e && o)
|
|
86
|
+
return /* @__PURE__ */ m("div", {
|
|
77
87
|
style: {
|
|
78
88
|
color: "red"
|
|
79
89
|
},
|
|
80
90
|
children: "define either sidebar or banner, not both."
|
|
81
91
|
});
|
|
82
|
-
if (!
|
|
92
|
+
if (!s)
|
|
83
93
|
return null;
|
|
84
|
-
const
|
|
85
|
-
return
|
|
86
|
-
gamification:
|
|
87
|
-
sidebar:
|
|
88
|
-
banner:
|
|
89
|
-
layoutMode:
|
|
90
|
-
isMobileScreen:
|
|
94
|
+
const t = r.getFeature(I.GAMES);
|
|
95
|
+
return t ? /* @__PURE__ */ m(E, {
|
|
96
|
+
gamification: t,
|
|
97
|
+
sidebar: e,
|
|
98
|
+
banner: o,
|
|
99
|
+
layoutMode: a,
|
|
100
|
+
isMobileScreen: d,
|
|
91
101
|
persistent: l,
|
|
92
|
-
notification:
|
|
93
|
-
skipTypeCheck:
|
|
102
|
+
notification: c,
|
|
103
|
+
skipTypeCheck: n,
|
|
104
|
+
skipAutoClose: i
|
|
94
105
|
}) : null;
|
|
95
106
|
};
|
|
96
107
|
export {
|
|
97
|
-
|
|
98
|
-
|
|
108
|
+
N as AdvertisementUIWrap,
|
|
109
|
+
H as StreamLayerSDKAdvertisement
|
|
99
110
|
};
|
|
@@ -1,73 +1,75 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { styled as
|
|
3
|
-
import { useStore as
|
|
4
|
-
import { useAppContext as
|
|
5
|
-
import { QuestionType as
|
|
6
|
-
import { VoteHeader as
|
|
7
|
-
import { Sponsor as
|
|
8
|
-
import { Vote as
|
|
9
|
-
import { InsightDetails as
|
|
10
|
-
import { TwitterDetails as
|
|
11
|
-
const
|
|
1
|
+
import { jsxs as y, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { styled as v } from "@linaria/react";
|
|
3
|
+
import { useStore as d } from "@nanostores/react";
|
|
4
|
+
import { useAppContext as T } from "../../useAppContext.js";
|
|
5
|
+
import { QuestionType as V } from "@streamlayer/sdk-web-types";
|
|
6
|
+
import { VoteHeader as h } from "../../../../ui/gamification/detail/header/index.js";
|
|
7
|
+
import { Sponsor as x } from "../../../../ui/gamification/detail/sponsor/index.js";
|
|
8
|
+
import { Vote as S, VoteSkeleton as g } from "../../../../ui/gamification/vote/index.js";
|
|
9
|
+
import { InsightDetails as q } from "../../../../ui/gamification/vote/insight-details/index.js";
|
|
10
|
+
import { TwitterDetails as D } from "../../../../ui/gamification/vote/twitter-details/index.js";
|
|
11
|
+
const w = /* @__PURE__ */ v("div")({
|
|
12
12
|
name: "QuestionContainer",
|
|
13
13
|
class: "q14ckf9e",
|
|
14
14
|
propsAsIs: !1
|
|
15
|
-
}),
|
|
15
|
+
}), A = ({
|
|
16
16
|
openedQuestion: t
|
|
17
17
|
}) => {
|
|
18
|
-
var
|
|
18
|
+
var r, s;
|
|
19
19
|
const {
|
|
20
20
|
sdk: o
|
|
21
|
-
} =
|
|
22
|
-
return ((
|
|
21
|
+
} = T();
|
|
22
|
+
return ((r = t == null ? void 0 : t.attributes) == null ? void 0 : r.attributes.case) === "insight" ? /* @__PURE__ */ e(q, {
|
|
23
23
|
...t.attributes.attributes.value,
|
|
24
24
|
controlVideo: o == null ? void 0 : o.controlVideoPlayer
|
|
25
|
-
}) : ((
|
|
25
|
+
}) : ((s = t == null ? void 0 : t.attributes) == null ? void 0 : s.attributes.case) === "tweet" ? /* @__PURE__ */ e(D, {
|
|
26
26
|
...t.attributes.attributes.value,
|
|
27
27
|
controlVideo: o == null ? void 0 : o.controlVideoPlayer
|
|
28
28
|
}) : null;
|
|
29
|
-
},
|
|
29
|
+
}, C = ({
|
|
30
30
|
extendedQuestion: t,
|
|
31
31
|
vote: o,
|
|
32
|
-
close:
|
|
32
|
+
close: r
|
|
33
33
|
}) => {
|
|
34
34
|
const {
|
|
35
|
-
loading:
|
|
36
|
-
data:
|
|
35
|
+
loading: s,
|
|
36
|
+
data: i
|
|
37
37
|
} = t;
|
|
38
|
-
return
|
|
38
|
+
return i ? /* @__PURE__ */ e(S, {
|
|
39
39
|
vote: o,
|
|
40
|
-
close:
|
|
41
|
-
openedQuestion:
|
|
42
|
-
isLoading: !!
|
|
43
|
-
}) : /* @__PURE__ */
|
|
44
|
-
},
|
|
40
|
+
close: r,
|
|
41
|
+
openedQuestion: i,
|
|
42
|
+
isLoading: !!s
|
|
43
|
+
}) : /* @__PURE__ */ e(g, {});
|
|
44
|
+
}, z = ({
|
|
45
45
|
gamification: t,
|
|
46
|
-
|
|
46
|
+
skipAutoClose: o,
|
|
47
|
+
hideSponsor: r,
|
|
47
48
|
className: s,
|
|
48
49
|
hideHeader: i
|
|
49
50
|
}) => {
|
|
50
|
-
var u,
|
|
51
|
-
const
|
|
52
|
-
if (!
|
|
51
|
+
var u, c, m, p, f;
|
|
52
|
+
const n = d(t.openedQuestion.$store), l = d(t.openedQuestion.$extendedStore);
|
|
53
|
+
if (!n)
|
|
53
54
|
return null;
|
|
54
|
-
const
|
|
55
|
-
return /* @__PURE__ */
|
|
55
|
+
const a = n.type, b = ((c = (u = l.data) == null ? void 0 : u.options) == null ? void 0 : c.options.case) === "factoid" ? l.data.options.options.value.closeTimer : void 0;
|
|
56
|
+
return /* @__PURE__ */ y(w, {
|
|
56
57
|
className: s,
|
|
57
|
-
children: [!i && /* @__PURE__ */
|
|
58
|
+
children: [!i && /* @__PURE__ */ e(h, {
|
|
59
|
+
closeTimer: o ? void 0 : b,
|
|
58
60
|
close: t.closeQuestion,
|
|
59
|
-
type: ((
|
|
60
|
-
}),
|
|
61
|
+
type: ((m = n.attributes) == null ? void 0 : m.type) || V.UNSET
|
|
62
|
+
}), a === "question" && /* @__PURE__ */ e(C, {
|
|
61
63
|
vote: t.submitAnswer,
|
|
62
64
|
close: t.closeQuestion,
|
|
63
|
-
extendedQuestion:
|
|
64
|
-
}),
|
|
65
|
-
openedQuestion:
|
|
66
|
-
}), !
|
|
67
|
-
sponsorLogo: (
|
|
65
|
+
extendedQuestion: l
|
|
66
|
+
}), a !== "question" && /* @__PURE__ */ e(A, {
|
|
67
|
+
openedQuestion: n
|
|
68
|
+
}), !r && /* @__PURE__ */ e(x, {
|
|
69
|
+
sponsorLogo: (f = (p = l.data) == null ? void 0 : p.sponsorship) == null ? void 0 : f.logo
|
|
68
70
|
})]
|
|
69
71
|
});
|
|
70
72
|
};
|
|
71
73
|
export {
|
|
72
|
-
|
|
74
|
+
z as Question
|
|
73
75
|
};
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { jsxs as u, jsx as e, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import { cx as T } from "@linaria/core";
|
|
3
|
+
import { useStore as h } from "@nanostores/react";
|
|
4
|
+
import { TabsContainer as D, TabsNavContainer as C, SDKWhiteContainer as S, UserSummaryContainer as v, SDKContentContainer as A, LeaderboardContainer as I } from "../../styles.js";
|
|
5
|
+
import { scrollIntoAppView as L } from "../../../useSdkScroll.js";
|
|
6
|
+
import { useState as P, useTransition as V, useEffect as E } from "react";
|
|
6
7
|
import { ActivePages as a, Tabs as K } from "../../../../ui/gamification/tabs/index.js";
|
|
7
|
-
import { Leaderboard as
|
|
8
|
-
import { QuestionsList as
|
|
9
|
-
import { UserSummary as
|
|
10
|
-
const
|
|
11
|
-
const { tabsShown:
|
|
8
|
+
import { Leaderboard as F } from "./Leaderboard.js";
|
|
9
|
+
import { QuestionsList as O } from "./QuestionsList.js";
|
|
10
|
+
import { UserSummary as Q } from "./UserSummary.js";
|
|
11
|
+
const G = ({ gamification: r, className: l, scrollStore: t, scrollNode: b, appNode: m, style: f, responsiveStore: n }) => {
|
|
12
|
+
const { tabsShown: c } = h(t, { keys: ["tabsShown"] }), [i, w] = P(a.HOME), [, y] = V(), { sdkInDesktopView: d, screen: g } = h(n, { keys: ["sdkInDesktopView"] }), k = (s) => {
|
|
12
13
|
y(() => {
|
|
13
14
|
var p;
|
|
14
|
-
w(
|
|
15
|
+
w(s), d === !1 && (((p = m.current) == null ? void 0 : p.getBoundingClientRect().y) || 0) < 0 && L(m, g.size, { behavior: "instant" });
|
|
15
16
|
});
|
|
16
17
|
};
|
|
17
|
-
E(() => t.subscribe((
|
|
18
|
-
if (
|
|
18
|
+
E(() => t.subscribe((s) => {
|
|
19
|
+
if (s.scrollPosition === 0) {
|
|
19
20
|
t.setKey("tabsShown", !0);
|
|
20
21
|
return;
|
|
21
22
|
}
|
|
22
|
-
n.get().sdkInDesktopView ? t.setKey("tabsShown",
|
|
23
|
+
n.get().sdkInDesktopView ? t.setKey("tabsShown", s.scrollDirection === "backward") : t.setKey("tabsShown", s.scrollDirection === "forward");
|
|
23
24
|
}), [t, n]);
|
|
24
25
|
let o = "0px";
|
|
25
|
-
return
|
|
26
|
+
return d ? o = c ? "0px" : "calc(0px - var(--header-height))" : o = c ? "var(--header-height)" : "0px", /* @__PURE__ */ u(D, { className: T(l, "SL-Tabs"), style: f, children: [
|
|
26
27
|
/* @__PURE__ */ e(
|
|
27
|
-
|
|
28
|
+
C,
|
|
28
29
|
{
|
|
29
30
|
style: {
|
|
30
31
|
top: o
|
|
@@ -32,13 +33,13 @@ const q = ({ gamification: s, className: f, scrollStore: t, scrollNode: l, appNo
|
|
|
32
33
|
children: /* @__PURE__ */ e(K, { activePage: i, toggleActivePage: k })
|
|
33
34
|
}
|
|
34
35
|
),
|
|
35
|
-
i === a.HOME && /* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */ e(
|
|
37
|
-
/* @__PURE__ */ e(A, { style: { flex: 1 }, children: /* @__PURE__ */ e(
|
|
36
|
+
i === a.HOME && /* @__PURE__ */ u(x, { children: [
|
|
37
|
+
/* @__PURE__ */ e(S, { style: { paddingTop: "8px" }, children: /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(Q, { userSummary: r.userSummary }) }) }),
|
|
38
|
+
/* @__PURE__ */ e(A, { style: { flex: 1 }, children: /* @__PURE__ */ e(O, { openQuestion: r.openQuestion, store: r.feedList.getStore() }) })
|
|
38
39
|
] }),
|
|
39
|
-
i === a.LEADERBOARD && /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(
|
|
40
|
+
i === a.LEADERBOARD && /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(F, { scrollStore: t, scrollNode: b, gamification: r }) })
|
|
40
41
|
] });
|
|
41
42
|
};
|
|
42
43
|
export {
|
|
43
|
-
|
|
44
|
+
G as Tabs
|
|
44
45
|
};
|
|
@@ -1,88 +1,92 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
1
|
+
import { jsx as o, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import { cx as l } from "@linaria/core";
|
|
3
|
+
import { styled as f } from "@linaria/react";
|
|
4
|
+
import { useStore as c } from "@nanostores/react";
|
|
5
|
+
import { SDKWhiteContainer as k } from "../../styles.js";
|
|
6
|
+
import { useAppContext as v } from "../../useAppContext.js";
|
|
7
|
+
import { useHideTransition as S } from "../../../../hooks/showIn.js";
|
|
8
|
+
import { VoteHeader as U } from "../../../../ui/gamification/detail/header/index.js";
|
|
9
|
+
import { UserStatistics as I } from "../../../../ui/gamification/user-statistics/index.js";
|
|
10
|
+
import { ModalPortal as y } from "../../../../ui/modal/index.js";
|
|
11
|
+
import { ShowIn as A } from "../../../../ui/show-in/index.js";
|
|
12
|
+
import { Question as O } from "./Question.js";
|
|
13
|
+
import { Tabs as b } from "./Tabs.js";
|
|
14
|
+
const w = () => A, u = /* @__PURE__ */ f(w())({
|
|
13
15
|
name: "OpenedContainer",
|
|
14
16
|
class: "ouvguos",
|
|
15
17
|
propsAsIs: !0
|
|
16
|
-
}),
|
|
18
|
+
}), d = "t1eu4lbg", D = /* @__PURE__ */ f("div")({
|
|
17
19
|
name: "UserContainer",
|
|
18
|
-
class: "
|
|
20
|
+
class: "uuv2xqo",
|
|
19
21
|
propsAsIs: !1
|
|
20
|
-
}),
|
|
22
|
+
}), H = ({
|
|
21
23
|
correct: e,
|
|
22
|
-
incorrect:
|
|
24
|
+
incorrect: t
|
|
23
25
|
}) => {
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
},
|
|
26
|
+
const n = e + t;
|
|
27
|
+
return n === 0 ? 0 : Math.round(e / n * 100);
|
|
28
|
+
}, P = ({
|
|
27
29
|
gamification: e,
|
|
28
|
-
scrollStore:
|
|
29
|
-
className:
|
|
30
|
-
appNode:
|
|
31
|
-
scrollNode:
|
|
32
|
-
responsiveStore:
|
|
33
|
-
}) => /* @__PURE__ */
|
|
34
|
-
appNode:
|
|
35
|
-
scrollStore:
|
|
36
|
-
scrollNode:
|
|
37
|
-
className:
|
|
30
|
+
scrollStore: t,
|
|
31
|
+
className: n,
|
|
32
|
+
appNode: a,
|
|
33
|
+
scrollNode: r,
|
|
34
|
+
responsiveStore: s
|
|
35
|
+
}) => /* @__PURE__ */ o(b, {
|
|
36
|
+
appNode: a,
|
|
37
|
+
scrollStore: t,
|
|
38
|
+
scrollNode: r,
|
|
39
|
+
className: n,
|
|
38
40
|
gamification: e,
|
|
39
|
-
responsiveStore:
|
|
40
|
-
}),
|
|
41
|
+
responsiveStore: s
|
|
42
|
+
}), W = ({
|
|
41
43
|
gamification: e,
|
|
42
|
-
className:
|
|
43
|
-
appNode:
|
|
44
|
-
responsiveStore:
|
|
44
|
+
className: t,
|
|
45
|
+
appNode: n,
|
|
46
|
+
responsiveStore: a
|
|
45
47
|
}) => {
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
} =
|
|
48
|
+
const {
|
|
49
|
+
topNavigation: r
|
|
50
|
+
} = v(), s = c(e.openedQuestion.$store), i = c(e.openedUser), {
|
|
51
|
+
sdkInDesktopView: h
|
|
52
|
+
} = c(a, {
|
|
49
53
|
keys: ["sdkInDesktopView"]
|
|
50
54
|
}), {
|
|
51
|
-
hiding:
|
|
52
|
-
onAnimationEnd:
|
|
53
|
-
} =
|
|
54
|
-
if (!
|
|
55
|
+
hiding: m,
|
|
56
|
+
onAnimationEnd: p
|
|
57
|
+
} = S();
|
|
58
|
+
if (!n.current || !s && !i)
|
|
55
59
|
return null;
|
|
56
|
-
const
|
|
57
|
-
className: r,
|
|
58
|
-
hiding:
|
|
59
|
-
onAnimationEnd:
|
|
60
|
-
children: /* @__PURE__ */
|
|
60
|
+
const C = s ? /* @__PURE__ */ o(u, {
|
|
61
|
+
className: l(t, !r && d),
|
|
62
|
+
hiding: m,
|
|
63
|
+
onAnimationEnd: p,
|
|
64
|
+
children: /* @__PURE__ */ o(O, {
|
|
61
65
|
gamification: e
|
|
62
66
|
})
|
|
63
|
-
}) :
|
|
64
|
-
className: r,
|
|
65
|
-
hiding:
|
|
66
|
-
onAnimationEnd:
|
|
67
|
-
children: /* @__PURE__ */
|
|
68
|
-
children: [/* @__PURE__ */
|
|
67
|
+
}) : i ? /* @__PURE__ */ o(u, {
|
|
68
|
+
className: l(t, !r && d),
|
|
69
|
+
hiding: m,
|
|
70
|
+
onAnimationEnd: p,
|
|
71
|
+
children: /* @__PURE__ */ x(D, {
|
|
72
|
+
children: [/* @__PURE__ */ o(U, {
|
|
69
73
|
label: "Friend's Rank",
|
|
70
74
|
close: e.closeUser
|
|
71
|
-
}), /* @__PURE__ */
|
|
72
|
-
children: /* @__PURE__ */
|
|
73
|
-
...
|
|
74
|
-
successRate:
|
|
75
|
+
}), /* @__PURE__ */ o(k, {
|
|
76
|
+
children: /* @__PURE__ */ o(I, {
|
|
77
|
+
...i,
|
|
78
|
+
successRate: H(i)
|
|
75
79
|
})
|
|
76
80
|
})]
|
|
77
81
|
})
|
|
78
82
|
}) : null;
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
-
container:
|
|
81
|
-
useContainer: !
|
|
82
|
-
children:
|
|
83
|
+
return /* @__PURE__ */ o(y, {
|
|
84
|
+
container: n,
|
|
85
|
+
useContainer: !h,
|
|
86
|
+
children: C
|
|
83
87
|
});
|
|
84
88
|
};
|
|
85
89
|
export {
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
P as GamificationOverlay,
|
|
91
|
+
W as GamificationOverlayStandalone
|
|
88
92
|
};
|
|
@@ -6,11 +6,13 @@ export declare const QuestionWrap: {
|
|
|
6
6
|
gamification: Gamification;
|
|
7
7
|
hideSponsor?: boolean;
|
|
8
8
|
className?: string;
|
|
9
|
+
skipAutoClose?: boolean;
|
|
9
10
|
hideHeader?: boolean;
|
|
10
11
|
}>;
|
|
11
12
|
export type StreamLayerSDKInsightProps = {
|
|
12
13
|
hideHeader?: boolean;
|
|
13
14
|
persistent?: boolean;
|
|
15
|
+
skipAutoClose?: boolean;
|
|
14
16
|
};
|
|
15
17
|
export declare const StreamLayerSDKInsight: React.FC<StreamLayerSDKInsightProps & {
|
|
16
18
|
sdk: StreamLayerSDK;
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { styled as
|
|
3
|
-
import { useStore as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { FeatureType as
|
|
6
|
-
import { Question as
|
|
7
|
-
const
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { styled as i } from "@linaria/react";
|
|
3
|
+
import { useStore as Q } from "@nanostores/react";
|
|
4
|
+
import { useRef as l, useEffect as m } from "react";
|
|
5
|
+
import { FeatureType as S } from "@streamlayer/sdk-web-types";
|
|
6
|
+
import { Question as y } from "../Features/Gamification/Question.js";
|
|
7
|
+
const I = () => y, b = /* @__PURE__ */ i(I())({
|
|
8
8
|
name: "QuestionWrap",
|
|
9
9
|
class: "q10hhsxv",
|
|
10
10
|
propsAsIs: !0
|
|
11
|
-
}),
|
|
11
|
+
}), v = ({
|
|
12
12
|
gamification: e,
|
|
13
13
|
persistent: o,
|
|
14
|
-
|
|
14
|
+
skipAutoClose: p,
|
|
15
|
+
hideHeader: f,
|
|
15
16
|
insightId: r
|
|
16
17
|
}) => {
|
|
17
|
-
const t =
|
|
18
|
-
return
|
|
19
|
-
var
|
|
20
|
-
t.current === r && ((
|
|
18
|
+
const t = l(""), n = Q(e.openedQuestion.$store);
|
|
19
|
+
return m(() => r ? (!o || e.isOpenedQuestion(r) || (t.current = r, e.getFeedItem(r).then((u) => {
|
|
20
|
+
var c;
|
|
21
|
+
t.current === r && ((c = u == null ? void 0 : u.attributes) == null ? void 0 : c.attributes.case) === "insight" && e.openQuestion(r, u);
|
|
21
22
|
})), () => {
|
|
22
23
|
t.current = "";
|
|
23
24
|
}) : (e.activeQuestionId.subscribe(({
|
|
@@ -26,28 +27,31 @@ const y = () => S, I = /* @__PURE__ */ Q(y())({
|
|
|
26
27
|
var u;
|
|
27
28
|
s && ((u = s.feedItem) == null ? void 0 : u.type) === "insight" && (!o || e.isOpenedQuestion(s.feedItem.id) || (t.current = s.feedItem.id, e.openQuestion(s.feedItem.id, s.feedItem))), !s && t.current && (e.closeQuestion(t.current), t.current = "");
|
|
28
29
|
}), () => {
|
|
29
|
-
}), [e, o, r]), n ? /* @__PURE__ */
|
|
30
|
-
|
|
30
|
+
}), [e, o, r]), n ? /* @__PURE__ */ d(b, {
|
|
31
|
+
skipAutoClose: p,
|
|
32
|
+
hideHeader: f,
|
|
31
33
|
gamification: e,
|
|
32
34
|
hideSponsor: !0
|
|
33
35
|
}) : null;
|
|
34
|
-
},
|
|
36
|
+
}, A = ({
|
|
35
37
|
sdk: e,
|
|
36
38
|
persistent: o,
|
|
37
|
-
|
|
39
|
+
skipAutoClose: p,
|
|
40
|
+
insightId: f,
|
|
38
41
|
hideHeader: r
|
|
39
42
|
}) => {
|
|
40
|
-
if (!
|
|
43
|
+
if (!Q(e.featuresList.getStore()))
|
|
41
44
|
return null;
|
|
42
|
-
const n = e.getFeature(
|
|
43
|
-
return n ? /* @__PURE__ */
|
|
44
|
-
insightId:
|
|
45
|
+
const n = e.getFeature(S.GAMES);
|
|
46
|
+
return n ? /* @__PURE__ */ d(v, {
|
|
47
|
+
insightId: f,
|
|
45
48
|
persistent: o,
|
|
46
49
|
hideHeader: r,
|
|
47
|
-
gamification: n
|
|
50
|
+
gamification: n,
|
|
51
|
+
skipAutoClose: p
|
|
48
52
|
}) : null;
|
|
49
53
|
};
|
|
50
54
|
export {
|
|
51
|
-
|
|
52
|
-
|
|
55
|
+
b as QuestionWrap,
|
|
56
|
+
A as StreamLayerSDKInsight
|
|
53
57
|
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
2
|
+
export declare const SDKHeader: import('react').ForwardRefExoticComponent<{
|
|
3
|
+
sdk: StreamLayerSDK;
|
|
4
|
+
className?: string;
|
|
5
|
+
} & import('react').RefAttributes<HTMLDivElement | null>>;
|
|
2
6
|
export declare const SDKNavigation: import('react').ForwardRefExoticComponent<{
|
|
3
7
|
sdk: StreamLayerSDK;
|
|
4
8
|
className?: string;
|