@streamlayer/react-ui 0.55.0 → 0.57.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/index.d.ts +5 -12
- package/lib/index.js +6 -115
- package/lib/ui/app/Features/Gamification/index.d.ts +0 -2
- package/lib/ui/app/Features/Gamification/index.js +4 -3
- package/lib/ui/app/Notifications/index.js +21 -15
- package/lib/ui/app/Notifications/styles.d.ts +1 -0
- package/lib/ui/app/Notifications/styles.js +17 -0
- package/lib/ui/app/masters.js +43 -31
- package/lib/ui/gamification/question/insight/styles.js +5 -0
- package/lib/ui/gamification/question/notification/index.d.ts +3 -0
- package/lib/ui/gamification/question/notification/index.js +30 -0
- package/lib/ui/gamification/question/notification/insight/index.d.ts +6 -0
- package/lib/ui/gamification/question/notification/insight/index.js +23 -0
- package/lib/ui/gamification/question/notification/insight/styles.d.ts +6 -0
- package/lib/ui/gamification/question/notification/insight/styles.js +60 -0
- package/lib/ui/gamification/question/notification/prediction-result/index.d.ts +3 -0
- package/lib/ui/gamification/question/notification/prediction-result/index.js +7 -0
- package/lib/ui/gamification/question/notification/prediction-result/styles.d.ts +2 -0
- package/lib/ui/gamification/question/notification/prediction-result/styles.js +12 -0
- package/lib/ui/gamification/question/notification/styles.d.ts +9 -0
- package/lib/ui/gamification/question/notification/styles.js +87 -0
- package/lib/ui/show-in/index.d.ts +1 -0
- package/lib/ui/show-in/index.js +35 -6
- package/package.json +15 -10
- package/lib/ui/demo/DemoPoints.d.ts +0 -5
- package/lib/ui/demo/DemoPoints.js +0 -28
- package/lib/ui/demo/Gamification.d.ts +0 -7
- package/lib/ui/demo/Gamification.js +0 -117
- package/lib/ui/demo/Highlights.d.ts +0 -7
- package/lib/ui/demo/Highlights.js +0 -68
- package/lib/ui/demo/Login.d.ts +0 -5
- package/lib/ui/demo/Login.js +0 -26
- package/lib/ui/demo/components/EventProvider.d.ts +0 -2
- package/lib/ui/demo/components/EventProvider.js +0 -5
- package/lib/ui/demo/components/Insight.d.ts +0 -8
- package/lib/ui/demo/components/Insight.js +0 -32
- package/lib/ui/demo/components/Insights.d.ts +0 -7
- package/lib/ui/demo/components/Insights.js +0 -15
- package/lib/ui/demo/components/Leaderboard.d.ts +0 -5
- package/lib/ui/demo/components/Leaderboard.js +0 -35
- package/lib/ui/demo/components/Question.d.ts +0 -7
- package/lib/ui/demo/components/Question.js +0 -89
- package/lib/ui/demo/components/QuestionsList.d.ts +0 -6
- package/lib/ui/demo/components/QuestionsList.js +0 -24
- package/lib/ui/demo/components/UserSummary.d.ts +0 -5
- package/lib/ui/demo/components/UserSummary.js +0 -17
- package/lib/ui/demo/components/index.d.ts +0 -7
- package/lib/ui/demo/components/index.js +0 -74
- package/lib/ui/demo/index.d.ts +0 -5
- package/lib/ui/demo/index.js +0 -184
- package/lib/ui/demo/styles.d.ts +0 -6
- package/lib/ui/demo/styles.js +0 -58
- package/lib/ui/notifications/decorator.d.ts +0 -4
- package/lib/ui/notifications/decorator.js +0 -64
- package/lib/ui/notifications/index.d.ts +0 -5
- package/lib/ui/notifications/index.js +0 -28
- package/lib/ui/notifications/notification/index.d.ts +0 -6
- package/lib/ui/notifications/notification/index.js +0 -36
- package/lib/ui/notifications/notification/onboarding-inapp/index.d.ts +0 -3
- package/lib/ui/notifications/notification/onboarding-inapp/index.js +0 -25
- package/lib/ui/notifications/notification/onboarding-inapp/styles.d.ts +0 -12
- package/lib/ui/notifications/notification/onboarding-inapp/styles.js +0 -77
- package/lib/ui/notifications/notification/question-inapp/index.d.ts +0 -3
- package/lib/ui/notifications/notification/question-inapp/index.js +0 -23
- package/lib/ui/notifications/notification/question-inapp/styles.d.ts +0 -10
- package/lib/ui/notifications/notification/question-inapp/styles.js +0 -61
- package/lib/ui/notifications/notification/styles.d.ts +0 -2
- package/lib/ui/notifications/notification/styles.js +0 -32
- package/lib/ui/notifications/styles.d.ts +0 -2
- package/lib/ui/notifications/styles.js +0 -15
package/lib/ui/show-in/index.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { css as r, cx as e } from "@linaria/core";
|
|
3
|
+
import { styled as m } from "@linaria/react";
|
|
4
|
+
const s = m.div`
|
|
4
5
|
overflow: hidden;
|
|
5
6
|
width: 100%;
|
|
6
7
|
transform: scale(1);
|
|
7
8
|
opacity: 1;
|
|
8
9
|
max-height: 500px;
|
|
9
10
|
|
|
10
|
-
animation: containerShowIn
|
|
11
|
+
animation: containerShowIn ease-out;
|
|
12
|
+
animation-duration: var(--animation-duration);
|
|
11
13
|
|
|
12
14
|
@keyframes containerShowIn {
|
|
13
15
|
0% {
|
|
@@ -30,7 +32,34 @@ const n = r.div`
|
|
|
30
32
|
max-height: 500px;
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
|
-
`,
|
|
35
|
+
`, c = r`
|
|
36
|
+
animation: containerHide ease-out;
|
|
37
|
+
animation-duration: var(--animation-duration);
|
|
38
|
+
animation-direction: reverse;
|
|
39
|
+
animation-fill-mode: forwards;
|
|
40
|
+
|
|
41
|
+
@keyframes containerHide {
|
|
42
|
+
0% {
|
|
43
|
+
transform: scale(0);
|
|
44
|
+
opacity: 0;
|
|
45
|
+
max-height: 0;
|
|
46
|
+
}
|
|
47
|
+
80% {
|
|
48
|
+
opacity: 0;
|
|
49
|
+
transform: scale(0.9);
|
|
50
|
+
max-height: 500px;
|
|
51
|
+
}
|
|
52
|
+
85% {
|
|
53
|
+
transform: scale(0.9);
|
|
54
|
+
max-height: 500px;
|
|
55
|
+
}
|
|
56
|
+
100% {
|
|
57
|
+
transform: scale(1);
|
|
58
|
+
opacity: 1;
|
|
59
|
+
max-height: 500px;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
`, f = ({ children: a, style: i, className: t, hiding: o }) => /* @__PURE__ */ n(s, { style: i, className: e(t, o && c), children: a });
|
|
34
63
|
export {
|
|
35
|
-
|
|
64
|
+
f as ShowIn
|
|
36
65
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -15,6 +15,11 @@
|
|
|
15
15
|
"default": "./lib/ui/app/masters.js",
|
|
16
16
|
"types": "./lib/ui/app/masters.d.js"
|
|
17
17
|
},
|
|
18
|
+
"./points": {
|
|
19
|
+
"import": "./lib/ui/gamification/points/index.js",
|
|
20
|
+
"default": "./lib/ui/gamification/points/index.js",
|
|
21
|
+
"types": "./lib/ui/gamification/points/index.d.js"
|
|
22
|
+
},
|
|
18
23
|
"./*": {
|
|
19
24
|
"import": "./lib/*/index.js",
|
|
20
25
|
"default": "./lib/*/index.js",
|
|
@@ -30,16 +35,16 @@
|
|
|
30
35
|
"react-virtualized-auto-sizer": "^1.0.20",
|
|
31
36
|
"react-window": "^1.8.9",
|
|
32
37
|
"react-window-infinite-loader": "^1.0.9",
|
|
33
|
-
"@streamlayer/feature-gamification": "^0.
|
|
34
|
-
"@streamlayer/sdk-web": "^0.28.
|
|
35
|
-
"@streamlayer/sdk-web-anonymous-auth": "^0.11.
|
|
38
|
+
"@streamlayer/feature-gamification": "^0.22.0",
|
|
39
|
+
"@streamlayer/sdk-web": "^0.28.17",
|
|
40
|
+
"@streamlayer/sdk-web-anonymous-auth": "^0.11.12",
|
|
36
41
|
"@streamlayer/sdk-web-api": "^0.0.1",
|
|
37
|
-
"@streamlayer/sdk-web-core": "^0.17.
|
|
38
|
-
"@streamlayer/sdk-web-features": "^0.10.
|
|
39
|
-
"@streamlayer/sdk-web-interfaces": "^0.18.
|
|
40
|
-
"@streamlayer/sdk-web-notifications": "^0.
|
|
42
|
+
"@streamlayer/sdk-web-core": "^0.17.6",
|
|
43
|
+
"@streamlayer/sdk-web-features": "^0.10.20",
|
|
44
|
+
"@streamlayer/sdk-web-interfaces": "^0.18.13",
|
|
45
|
+
"@streamlayer/sdk-web-notifications": "^0.11.0",
|
|
41
46
|
"@streamlayer/sdk-web-storage": "^0.0.2",
|
|
42
|
-
"@streamlayer/sdk-web-types": "^0.
|
|
47
|
+
"@streamlayer/sdk-web-types": "^0.19.0"
|
|
43
48
|
},
|
|
44
49
|
"nx": {
|
|
45
50
|
"implicitDependencies": [
|
|
@@ -78,6 +83,6 @@
|
|
|
78
83
|
"vite-plugin-svgr": "^4.1.0",
|
|
79
84
|
"vite-svg-loader": "^4.0.0",
|
|
80
85
|
"vite-tsconfig-paths": "^4.2.1",
|
|
81
|
-
"@streamlayer/react": "^0.
|
|
86
|
+
"@streamlayer/react": "^0.28.1"
|
|
82
87
|
}
|
|
83
88
|
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { FeatureType as s } from "@streamlayer/sdk-web-types";
|
|
3
|
-
import { useStore as p } from "@nanostores/react";
|
|
4
|
-
import { styled as u } from "@linaria/react";
|
|
5
|
-
import { Points as a } from "../gamification/points/index.js";
|
|
6
|
-
import "../theme/theme.js";
|
|
7
|
-
import "@linaria/core";
|
|
8
|
-
import "../theme/constants.js";
|
|
9
|
-
import "../../utils/common.js";
|
|
10
|
-
import "../gamification/points/styles.js";
|
|
11
|
-
import "../icons/index.js";
|
|
12
|
-
import "react";
|
|
13
|
-
import "../theme/breakpoints.js";
|
|
14
|
-
const d = u.div`
|
|
15
|
-
position: fixed;
|
|
16
|
-
top: 0;
|
|
17
|
-
right: 0;
|
|
18
|
-
`, f = ({ store: o }) => {
|
|
19
|
-
var m, i, e, n;
|
|
20
|
-
const t = p(o);
|
|
21
|
-
return ((i = (m = t.data) == null ? void 0 : m.summary) == null ? void 0 : i.points) === void 0 ? null : /* @__PURE__ */ r(d, { children: ((n = (e = t.data) == null ? void 0 : e.summary) == null ? void 0 : n.points) && /* @__PURE__ */ r(a, { points: t.data.summary.points }) });
|
|
22
|
-
}, A = ({ sdk: o }) => {
|
|
23
|
-
const t = o.getFeature(s.GAMES);
|
|
24
|
-
return t != null && t.userSummary ? /* @__PURE__ */ r(f, { store: t.userSummary.getStore() }) : null;
|
|
25
|
-
};
|
|
26
|
-
export {
|
|
27
|
-
A as DemoPoints
|
|
28
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
3
|
-
import type { Gamification } from '@streamlayer/feature-gamification';
|
|
4
|
-
export declare const GamificationComponent: React.FC<{
|
|
5
|
-
gamification: Gamification;
|
|
6
|
-
sdk: StreamLayerSDK;
|
|
7
|
-
}>;
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { jsx as t, jsxs as s, Fragment as z } from "react/jsx-runtime";
|
|
2
|
-
import { FeatureStatus as J } from "@streamlayer/sdk-web-interfaces";
|
|
3
|
-
import { useStore as p } from "@nanostores/react";
|
|
4
|
-
import { useState as K } from "react";
|
|
5
|
-
import { ActivePages as a, Tabs as N } from "../gamification/tabs/index.js";
|
|
6
|
-
import { UserSummary as V } from "./components/UserSummary.js";
|
|
7
|
-
import { QuestionsList as W } from "./components/QuestionsList.js";
|
|
8
|
-
import { Question as X } from "./components/Question.js";
|
|
9
|
-
import { Onboarding as Y } from "../gamification/onboarding/index.js";
|
|
10
|
-
import "@streamlayer/sdk-web-types";
|
|
11
|
-
import "../gamification/insight/styles.js";
|
|
12
|
-
import "../gamification/insight-list/styles.js";
|
|
13
|
-
import "../gamification/common-header/styles.js";
|
|
14
|
-
import "../gamification/detailed-insight/styles.js";
|
|
15
|
-
import { Leaderboard as Z } from "./components/Leaderboard.js";
|
|
16
|
-
import { DemoContainer as m, UserStatisticsContainer as _, QuestionsContainer as $ } from "./styles.js";
|
|
17
|
-
import "../gamification/tabs/styles.js";
|
|
18
|
-
import "@linaria/react";
|
|
19
|
-
import "../gamification/user-statistics/index.js";
|
|
20
|
-
import "../../utils/common.js";
|
|
21
|
-
import "../gamification/user-statistics/components/rank/index.js";
|
|
22
|
-
import "../gamification/user-statistics/components/rank/styles.js";
|
|
23
|
-
import "../gamification/user-statistics/components/statistic/index.js";
|
|
24
|
-
import "../gamification/user-statistics/components/statistic/styles.js";
|
|
25
|
-
import "../gamification/user-statistics/styles.js";
|
|
26
|
-
import "../gamification/question/list/index.js";
|
|
27
|
-
import "../gamification/question/index.js";
|
|
28
|
-
import "../button/index.js";
|
|
29
|
-
import "../button/styles.js";
|
|
30
|
-
import "../gamification/constants.js";
|
|
31
|
-
import "../gamification/question/styles.js";
|
|
32
|
-
import "../icons/index.js";
|
|
33
|
-
import "../gamification/question/insight/index.js";
|
|
34
|
-
import "../video-player/index.js";
|
|
35
|
-
import "../video-player/styles.js";
|
|
36
|
-
import "../gamification/question/insight/styles.js";
|
|
37
|
-
import "../gamification/question/list/styles.js";
|
|
38
|
-
import "../gamification/vote/index.js";
|
|
39
|
-
import "../app/styles.js";
|
|
40
|
-
import "../gamification/vote/feedback/index.js";
|
|
41
|
-
import "../gamification/vote/feedback/styles.js";
|
|
42
|
-
import "../gamification/vote/styles.js";
|
|
43
|
-
import "../gamification/vote/vote-option/index.js";
|
|
44
|
-
import "../gamification/vote/vote-option/styles.js";
|
|
45
|
-
import "../gamification/vote/win-bar/index.js";
|
|
46
|
-
import "../timer/index.js";
|
|
47
|
-
import "react-countdown-circle-timer";
|
|
48
|
-
import "../theme/constants.js";
|
|
49
|
-
import "../gamification/vote/win-bar/styles.js";
|
|
50
|
-
import "../../icon-exit-d3f9fc80.js";
|
|
51
|
-
import "../gamification/onboarding/components/onboarding-slides/onboarding-instructions/index.js";
|
|
52
|
-
import "../gamification/onboarding/components/onboarding-slides/onboarding-instructions/styles.js";
|
|
53
|
-
import "../gamification/onboarding/components/onboarding-slides/onboarding-invite-card/index.js";
|
|
54
|
-
import "../gamification/onboarding/components/onboarding-slides/onboarding-invite-card/styles.js";
|
|
55
|
-
import "../gamification/onboarding/components/onboarding-slides/onboarding-rules/index.js";
|
|
56
|
-
import "../gamification/onboarding/components/onboarding-slides/onboarding-rules/styles.js";
|
|
57
|
-
import "../gamification/onboarding/styles.js";
|
|
58
|
-
import "../gamification/leaderboard/index.js";
|
|
59
|
-
import "react-virtualized-auto-sizer";
|
|
60
|
-
import "react-window";
|
|
61
|
-
import "react-window-infinite-loader";
|
|
62
|
-
import "../gamification/leaderboard/list-item/index.js";
|
|
63
|
-
import "../gamification/leaderboard/list-item/styles.js";
|
|
64
|
-
const at = ({
|
|
65
|
-
gamification: r,
|
|
66
|
-
sdk: u
|
|
67
|
-
}) => {
|
|
68
|
-
var d, v, c, b, y, g, S, h, C, G, L, Q, A, E, f, w, x, P, F, O, B, D, R;
|
|
69
|
-
const T = p(r.status), j = p(r.onboardingStatus), l = p(r.openedQuestion), { slStreamId: e } = p(u.sdkStore), o = p(r.featureSettings), [n, q] = K(a.HOME);
|
|
70
|
-
if (T !== J.Ready)
|
|
71
|
-
return /* @__PURE__ */ t("div", { children: "wait..." });
|
|
72
|
-
if (e != null && e.loading)
|
|
73
|
-
return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t("div", { children: "Event is loading" }) });
|
|
74
|
-
if (!(e != null && e.data))
|
|
75
|
-
return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t("div", { children: "Event is forbidden" }) });
|
|
76
|
-
if (!j)
|
|
77
|
-
return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(
|
|
78
|
-
Y,
|
|
79
|
-
{
|
|
80
|
-
closeFeature: u.closeFeature,
|
|
81
|
-
gamification: r,
|
|
82
|
-
steps: (v = (d = o.inplayGame) == null ? void 0 : d.onboarding) == null ? void 0 : v.steps,
|
|
83
|
-
gameIcon: (y = (b = (c = o.inplayGame) == null ? void 0 : c.overview) == null ? void 0 : b.media) == null ? void 0 : y.gameIcon,
|
|
84
|
-
sponsorLogo: (h = (S = (g = o.inplayGame) == null ? void 0 : g.overview) == null ? void 0 : S.media) == null ? void 0 : h.sponsorLogo,
|
|
85
|
-
rules: (G = (C = o.inplayGame) == null ? void 0 : C.rules) == null ? void 0 : G.rules,
|
|
86
|
-
rulesBtnLabel: (Q = (L = o.inplayGame) == null ? void 0 : L.rules) == null ? void 0 : Q.buttonLabel,
|
|
87
|
-
rulesTitle: (E = (A = o.inplayGame) == null ? void 0 : A.rules) == null ? void 0 : E.heading,
|
|
88
|
-
primaryColor: (x = (w = (f = o.inplayGame) == null ? void 0 : f.overview) == null ? void 0 : w.appearance) == null ? void 0 : x.primaryColor,
|
|
89
|
-
inviteCardTitle: (F = (P = o.inplayGame) == null ? void 0 : P.inviteCard) == null ? void 0 : F.heading,
|
|
90
|
-
inviteCardSubtext: (B = (O = o.inplayGame) == null ? void 0 : O.inviteCard) == null ? void 0 : B.subtext,
|
|
91
|
-
inviteCardBtnLabel: (R = (D = o.inplayGame) == null ? void 0 : D.inviteCard) == null ? void 0 : R.buttonLabel
|
|
92
|
-
}
|
|
93
|
-
) });
|
|
94
|
-
const H = (i) => {
|
|
95
|
-
r.openQuestion(i);
|
|
96
|
-
}, M = () => {
|
|
97
|
-
r.closeQuestion();
|
|
98
|
-
}, U = (i, k) => {
|
|
99
|
-
r.submitAnswer(i, k);
|
|
100
|
-
};
|
|
101
|
-
return /* @__PURE__ */ s(m, { children: [
|
|
102
|
-
/* @__PURE__ */ t(N, { activePage: n, toggleActivePage: (i) => {
|
|
103
|
-
q(i);
|
|
104
|
-
} }),
|
|
105
|
-
n === a.HOME && /* @__PURE__ */ s(z, { children: [
|
|
106
|
-
/* @__PURE__ */ t(_, { children: r.userSummary && /* @__PURE__ */ t(V, { store: r.userSummary.getStore() }) }),
|
|
107
|
-
/* @__PURE__ */ s($, { children: [
|
|
108
|
-
r.questions && /* @__PURE__ */ t(W, { openQuestion: H, store: r.questions.getStore() }),
|
|
109
|
-
l && /* @__PURE__ */ t(X, { closeQuestion: M, vote: U, openedQuestion: l })
|
|
110
|
-
] })
|
|
111
|
-
] }),
|
|
112
|
-
n === a.LEADERBOARD && r.leaderboardList && /* @__PURE__ */ t(Z, { store: r.leaderboardList.getStore() })
|
|
113
|
-
] });
|
|
114
|
-
};
|
|
115
|
-
export {
|
|
116
|
-
at as GamificationComponent
|
|
117
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
3
|
-
import type { Highlights } from '@streamlayer/feature-gamification';
|
|
4
|
-
export declare const HighlightsComponent: React.FC<{
|
|
5
|
-
highlights: Highlights;
|
|
6
|
-
sdk: StreamLayerSDK;
|
|
7
|
-
}>;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import { FeatureStatus as d } from "@streamlayer/sdk-web-interfaces";
|
|
3
|
-
import { useStore as m } from "@nanostores/react";
|
|
4
|
-
import { DemoContainer as p } from "./styles.js";
|
|
5
|
-
import "../gamification/user-statistics/components/rank/styles.js";
|
|
6
|
-
import "../gamification/user-statistics/components/statistic/styles.js";
|
|
7
|
-
import "../gamification/user-statistics/styles.js";
|
|
8
|
-
import "../gamification/question/index.js";
|
|
9
|
-
import "react";
|
|
10
|
-
import "../icons/index.js";
|
|
11
|
-
import "../video-player/styles.js";
|
|
12
|
-
import "../gamification/question/insight/styles.js";
|
|
13
|
-
import "../gamification/question/list/styles.js";
|
|
14
|
-
import "./components/Question.js";
|
|
15
|
-
import "../gamification/onboarding/components/onboarding-slides/onboarding-instructions/styles.js";
|
|
16
|
-
import "../gamification/onboarding/components/onboarding-slides/onboarding-invite-card/styles.js";
|
|
17
|
-
import "../gamification/onboarding/components/onboarding-slides/onboarding-rules/styles.js";
|
|
18
|
-
import "../gamification/onboarding/styles.js";
|
|
19
|
-
import { Insights as c } from "./components/Insights.js";
|
|
20
|
-
import { Insight as f } from "./components/Insight.js";
|
|
21
|
-
import "react-virtualized-auto-sizer";
|
|
22
|
-
import "react-window";
|
|
23
|
-
import "react-window-infinite-loader";
|
|
24
|
-
import "../gamification/leaderboard/list-item/styles.js";
|
|
25
|
-
import "@linaria/react";
|
|
26
|
-
import "@streamlayer/sdk-web-types";
|
|
27
|
-
import "../button/index.js";
|
|
28
|
-
import "../button/styles.js";
|
|
29
|
-
import "../gamification/constants.js";
|
|
30
|
-
import "../gamification/question/styles.js";
|
|
31
|
-
import "../gamification/vote/index.js";
|
|
32
|
-
import "../app/styles.js";
|
|
33
|
-
import "../gamification/vote/feedback/index.js";
|
|
34
|
-
import "../gamification/vote/feedback/styles.js";
|
|
35
|
-
import "../gamification/vote/styles.js";
|
|
36
|
-
import "../gamification/vote/vote-option/index.js";
|
|
37
|
-
import "../gamification/vote/vote-option/styles.js";
|
|
38
|
-
import "../gamification/vote/win-bar/index.js";
|
|
39
|
-
import "../timer/index.js";
|
|
40
|
-
import "react-countdown-circle-timer";
|
|
41
|
-
import "../theme/constants.js";
|
|
42
|
-
import "../gamification/vote/win-bar/styles.js";
|
|
43
|
-
import "../gamification/insight-list/index.js";
|
|
44
|
-
import "../gamification/insight/index.js";
|
|
45
|
-
import "../gamification/insight/styles.js";
|
|
46
|
-
import "../gamification/insight-list/styles.js";
|
|
47
|
-
import "../gamification/detailed-insight/index.js";
|
|
48
|
-
import "../gamification/common-header/index.js";
|
|
49
|
-
import "../../icon-exit-d3f9fc80.js";
|
|
50
|
-
import "../gamification/common-header/styles.js";
|
|
51
|
-
import "../gamification/detailed-insight/styles.js";
|
|
52
|
-
const dt = ({ highlights: i, sdk: e }) => {
|
|
53
|
-
const n = m(i.status), r = m(i.openedInsight), { slStreamId: o } = m(e.sdkStore);
|
|
54
|
-
return n !== d.Ready ? /* @__PURE__ */ t("div", { children: "wait..." }) : o != null && o.loading ? /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t("div", { children: "Event is loading" }) }) : o != null && o.data ? i.insights === void 0 ? /* @__PURE__ */ t("div", { children: "wait insights..." }) : /* @__PURE__ */ s(p, { children: [
|
|
55
|
-
!r && /* @__PURE__ */ t(c, { highlights: i, store: i.insights.getStore() }),
|
|
56
|
-
r && /* @__PURE__ */ t(
|
|
57
|
-
f,
|
|
58
|
-
{
|
|
59
|
-
openedInsight: r,
|
|
60
|
-
closeHighlights: i.closeFeature,
|
|
61
|
-
closeInsight: i.closeHighlight
|
|
62
|
-
}
|
|
63
|
-
)
|
|
64
|
-
] }) : /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t("div", { children: "Event is forbidden" }) });
|
|
65
|
-
};
|
|
66
|
-
export {
|
|
67
|
-
dt as HighlightsComponent
|
|
68
|
-
};
|
package/lib/ui/demo/Login.d.ts
DELETED
package/lib/ui/demo/Login.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import "@streamlayer/sdk-web-anonymous-auth";
|
|
3
|
-
import { Login as m } from "../login/index.js";
|
|
4
|
-
import { useStore as n } from "@nanostores/react";
|
|
5
|
-
import "react";
|
|
6
|
-
import "react-auth-code-input";
|
|
7
|
-
import "react-phone-number-input";
|
|
8
|
-
import "../timer/index.js";
|
|
9
|
-
import "@linaria/react";
|
|
10
|
-
import "react-countdown-circle-timer";
|
|
11
|
-
import "../theme/constants.js";
|
|
12
|
-
import "../../utils/login.js";
|
|
13
|
-
import "@connectrpc/connect";
|
|
14
|
-
import "@connectrpc/connect-web";
|
|
15
|
-
import "@streamlayer/sl-eslib/users/users_connect";
|
|
16
|
-
import "../login/styles.js";
|
|
17
|
-
const j = ({ sdk: o }) => n(o.getUserStore()).data ? /* @__PURE__ */ r("button", { onClick: o.logout, children: "logout" }) : /* @__PURE__ */ r(m, { login: async (i) => {
|
|
18
|
-
try {
|
|
19
|
-
await o.authorizationBypass("streamlayer:streamlayer", i);
|
|
20
|
-
} catch (t) {
|
|
21
|
-
throw console.log("login err", t), t;
|
|
22
|
-
}
|
|
23
|
-
}, anonymousLogin: o.anonymousAuthorization, host: o.host });
|
|
24
|
-
export {
|
|
25
|
-
j as LoginComponent
|
|
26
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Highlights } from '@streamlayer/feature-gamification';
|
|
3
|
-
export declare const Insight: React.FC<{
|
|
4
|
-
openedInsight: Exclude<Highlights['openedInsight']['value'], undefined>;
|
|
5
|
-
closeHighlights: () => void;
|
|
6
|
-
closeInsight: () => void;
|
|
7
|
-
className?: string;
|
|
8
|
-
}>;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { jsx as L } from "react/jsx-runtime";
|
|
2
|
-
import { DetailedInsight as c } from "../../gamification/detailed-insight/index.js";
|
|
3
|
-
import "../../gamification/common-header/index.js";
|
|
4
|
-
import "../../../icon-exit-d3f9fc80.js";
|
|
5
|
-
import "../../gamification/common-header/styles.js";
|
|
6
|
-
import "@linaria/react";
|
|
7
|
-
import "../../gamification/detailed-insight/styles.js";
|
|
8
|
-
const x = ({ openedInsight: o, closeHighlights: r, closeInsight: s, className: l }) => {
|
|
9
|
-
var t, a, b, n, e;
|
|
10
|
-
const i = ((t = o.options) == null ? void 0 : t.options.case) === "factoid" ? {
|
|
11
|
-
image: o.options.options.value.image,
|
|
12
|
-
body: o.options.options.value.body,
|
|
13
|
-
webLink: (a = o.options.options.value.webLink) == null ? void 0 : a.url,
|
|
14
|
-
webLinkLabel: (b = o.options.options.value.webLink) == null ? void 0 : b.label
|
|
15
|
-
} : {}, m = o.subject || ((n = o.notification) == null ? void 0 : n.title), p = i.body || ((e = o.notification) == null ? void 0 : e.body);
|
|
16
|
-
return /* @__PURE__ */ L(
|
|
17
|
-
c,
|
|
18
|
-
{
|
|
19
|
-
className: l,
|
|
20
|
-
image: i.image,
|
|
21
|
-
title: m,
|
|
22
|
-
description: p,
|
|
23
|
-
webLink: i.webLink,
|
|
24
|
-
webLinkLabel: i.webLinkLabel,
|
|
25
|
-
closeInsight: s,
|
|
26
|
-
closeHighlights: r
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
};
|
|
30
|
-
export {
|
|
31
|
-
x as Insight
|
|
32
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { Highlights } from '@streamlayer/feature-gamification';
|
|
3
|
-
export declare const Insights: React.FC<{
|
|
4
|
-
highlights: Highlights;
|
|
5
|
-
store: ReturnType<Exclude<Highlights['insights'], undefined>['getStore']>;
|
|
6
|
-
className?: string;
|
|
7
|
-
}>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useStore as p } from "@nanostores/react";
|
|
3
|
-
import { InsightList as s } from "../../gamification/insight-list/index.js";
|
|
4
|
-
import "../../gamification/insight/index.js";
|
|
5
|
-
import "@streamlayer/sdk-web-types";
|
|
6
|
-
import "../../gamification/insight/styles.js";
|
|
7
|
-
import "@linaria/react";
|
|
8
|
-
import "../../gamification/insight-list/styles.js";
|
|
9
|
-
const c = ({ highlights: o, store: n, className: t }) => {
|
|
10
|
-
const { data: i } = p(n);
|
|
11
|
-
return i ? /* @__PURE__ */ r(s, { className: t, insights: i, openInsight: o.openHighlight }) : /* @__PURE__ */ r("div", { className: t, children: "wait insights..." });
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
c as Insights
|
|
15
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as e, Fragment as c } from "react/jsx-runtime";
|
|
2
|
-
import { useStore as u } from "@nanostores/react";
|
|
3
|
-
import { useState as b } from "react";
|
|
4
|
-
import { LeaderboardList as l } from "../../gamification/leaderboard/index.js";
|
|
5
|
-
import "react-virtualized-auto-sizer";
|
|
6
|
-
import "react-window";
|
|
7
|
-
import "react-window-infinite-loader";
|
|
8
|
-
import "../../gamification/leaderboard/list-item/index.js";
|
|
9
|
-
import "../../../utils/common.js";
|
|
10
|
-
import "../../gamification/leaderboard/list-item/styles.js";
|
|
11
|
-
import "@linaria/react";
|
|
12
|
-
import "../../icons/index.js";
|
|
13
|
-
const F = ({ store: a }) => {
|
|
14
|
-
const { data: r } = u(a), [m, s] = b(void 0);
|
|
15
|
-
if (!r)
|
|
16
|
-
return /* @__PURE__ */ e("div", { children: "wait leader board..." });
|
|
17
|
-
const d = (t) => {
|
|
18
|
-
var i;
|
|
19
|
-
const p = (i = r.find((n) => {
|
|
20
|
-
var o;
|
|
21
|
-
return ((o = n.attributes) == null ? void 0 : o.userId) === t;
|
|
22
|
-
})) == null ? void 0 : i.attributes;
|
|
23
|
-
s(p);
|
|
24
|
-
};
|
|
25
|
-
return /* @__PURE__ */ e(c, { children: !m && /* @__PURE__ */ e(
|
|
26
|
-
l,
|
|
27
|
-
{
|
|
28
|
-
items: r.filter((t) => t.attributes).map((t) => t.attributes),
|
|
29
|
-
openItemDetail: d
|
|
30
|
-
}
|
|
31
|
-
) });
|
|
32
|
-
};
|
|
33
|
-
export {
|
|
34
|
-
F as Leaderboard
|
|
35
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { GamificationBackground } from '@streamlayer/feature-gamification';
|
|
3
|
-
export declare const Question: React.FC<{
|
|
4
|
-
openedQuestion: Awaited<ReturnType<GamificationBackground['openedQuestion']['getValue']>>;
|
|
5
|
-
closeQuestion: () => void;
|
|
6
|
-
vote: (questionId: string, answerId: string) => void;
|
|
7
|
-
}>;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { styled as f } from "@linaria/react";
|
|
3
|
-
import { useState as p, useCallback as n, useMemo as s } from "react";
|
|
4
|
-
import { Vote as d } from "../../gamification/vote/index.js";
|
|
5
|
-
import "../../app/styles.js";
|
|
6
|
-
import "../../gamification/vote/feedback/index.js";
|
|
7
|
-
import "@streamlayer/sdk-web-types";
|
|
8
|
-
import "../../icons/index.js";
|
|
9
|
-
import "../../gamification/vote/feedback/styles.js";
|
|
10
|
-
import "../../gamification/vote/styles.js";
|
|
11
|
-
import "../../gamification/vote/vote-option/index.js";
|
|
12
|
-
import "../../gamification/vote/vote-option/styles.js";
|
|
13
|
-
import "../../gamification/vote/win-bar/index.js";
|
|
14
|
-
import "../../timer/index.js";
|
|
15
|
-
import "react-countdown-circle-timer";
|
|
16
|
-
import "../../theme/constants.js";
|
|
17
|
-
import "../../gamification/vote/win-bar/styles.js";
|
|
18
|
-
const y = f.div`
|
|
19
|
-
position: absolute;
|
|
20
|
-
top: 0;
|
|
21
|
-
background: var(--color-transparent-item);
|
|
22
|
-
width: 100%;
|
|
23
|
-
height: 100%;
|
|
24
|
-
|
|
25
|
-
display: flex;
|
|
26
|
-
align-items: center;
|
|
27
|
-
justify-content: flex-start;
|
|
28
|
-
flex-direction: column;
|
|
29
|
-
|
|
30
|
-
> div {
|
|
31
|
-
width: 100%;
|
|
32
|
-
background: #000;
|
|
33
|
-
animation: slide-in 0.3s ease-in;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@keyframes slide-in {
|
|
37
|
-
from {
|
|
38
|
-
transform: translateX(-100%);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
to {
|
|
42
|
-
transform: translateX(0);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
`, S = ({ openedQuestion: t, closeQuestion: h, vote: a }) => {
|
|
46
|
-
var c;
|
|
47
|
-
const [e, m] = p(!1);
|
|
48
|
-
n(
|
|
49
|
-
(r) => {
|
|
50
|
-
m(r);
|
|
51
|
-
},
|
|
52
|
-
[m]
|
|
53
|
-
);
|
|
54
|
-
const i = s(
|
|
55
|
-
() => t == null ? void 0 : t.answers.find((r) => r.youVoted === !0),
|
|
56
|
-
[t]
|
|
57
|
-
), l = s(
|
|
58
|
-
() => !!(t != null && t.answers.find((r) => r.correct === !0)),
|
|
59
|
-
[t]
|
|
60
|
-
);
|
|
61
|
-
return t ? /* @__PURE__ */ o(y, { children: /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
|
|
62
|
-
d,
|
|
63
|
-
{
|
|
64
|
-
title: t.subject,
|
|
65
|
-
feedbackMessages: (c = t.options) == null ? void 0 : c.options.value,
|
|
66
|
-
questionType: t.type,
|
|
67
|
-
questionId: t.id,
|
|
68
|
-
questionVoted: !!i,
|
|
69
|
-
questionVotedCorrectly: i == null ? void 0 : i.correct,
|
|
70
|
-
options: t.answers.map((r) => ({
|
|
71
|
-
id: r.id,
|
|
72
|
-
title: r.text,
|
|
73
|
-
icon: r.icon,
|
|
74
|
-
type: t.type,
|
|
75
|
-
correct: r.correct,
|
|
76
|
-
percentage: r.percentage,
|
|
77
|
-
answered: r.youVoted,
|
|
78
|
-
disabled: !!i || t.marketClosed || e,
|
|
79
|
-
questionVoted: !!i,
|
|
80
|
-
hasCorrectAnswer: l,
|
|
81
|
-
points: r.points,
|
|
82
|
-
onVote: a
|
|
83
|
-
}))
|
|
84
|
-
}
|
|
85
|
-
) }) }) }) : null;
|
|
86
|
-
};
|
|
87
|
-
export {
|
|
88
|
-
S as Question
|
|
89
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { Gamification } from '@streamlayer/feature-gamification';
|
|
3
|
-
export declare const QuestionsList: React.FC<{
|
|
4
|
-
store: ReturnType<Exclude<Gamification['questions'], undefined>['getStore']>;
|
|
5
|
-
openQuestion: (questionId: string) => void;
|
|
6
|
-
}>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { useStore as m } from "@nanostores/react";
|
|
3
|
-
import { QuestionList as p } from "../../gamification/question/list/index.js";
|
|
4
|
-
import "../../gamification/question/index.js";
|
|
5
|
-
import "@streamlayer/sdk-web-types";
|
|
6
|
-
import "../../button/index.js";
|
|
7
|
-
import "../../button/styles.js";
|
|
8
|
-
import "@linaria/react";
|
|
9
|
-
import "../../gamification/constants.js";
|
|
10
|
-
import "../../gamification/question/styles.js";
|
|
11
|
-
import "../../icons/index.js";
|
|
12
|
-
import "react";
|
|
13
|
-
import "../../gamification/question/insight/index.js";
|
|
14
|
-
import "../../video-player/index.js";
|
|
15
|
-
import "../../video-player/styles.js";
|
|
16
|
-
import "../../gamification/question/insight/styles.js";
|
|
17
|
-
import "../../gamification/question/list/styles.js";
|
|
18
|
-
const S = ({ store: r, openQuestion: i }) => {
|
|
19
|
-
const t = m(r);
|
|
20
|
-
return t != null && t.data ? /* @__PURE__ */ o(p, { openQuestion: i, questions: t.data }) : /* @__PURE__ */ o("div", { children: "wait questions..." });
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
S as QuestionsList
|
|
24
|
-
};
|