@streamlayer/react-ui 0.27.2 → 0.28.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/fedex-a8dcc7b2.js +4 -0
- package/lib/index.js +30 -29
- package/lib/ui/app/Features/FeatureProvider.js +14 -0
- package/lib/ui/app/Features/Gamification/Leaderboard.js +48 -0
- package/lib/ui/app/Features/Gamification/Question.js +102 -0
- package/lib/ui/app/Features/Gamification/QuestionsList.js +16 -0
- package/lib/ui/app/Features/Gamification/Tabs.js +47 -0
- package/lib/ui/app/Features/Gamification/UserSummary.js +17 -0
- package/lib/ui/app/Features/Gamification/index.js +67 -0
- package/lib/ui/app/Features/Highlights/Insight.js +31 -0
- package/lib/ui/app/Features/Highlights/Insights.js +16 -0
- package/lib/ui/app/Features/Highlights/index.js +33 -0
- package/lib/ui/app/Features/index.js +64 -0
- package/lib/ui/app/Navigation/index.js +31 -0
- package/lib/ui/app/Notifications/index.js +18 -0
- package/lib/ui/app/index.js +88 -0
- package/lib/ui/app/styles.js +8 -0
- package/lib/ui/app/useSdkFeature.js +24 -0
- package/lib/ui/demo/DemoPoints.js +14 -14
- package/lib/ui/demo/Gamification.js +3 -2
- package/lib/ui/demo/Highlights.js +3 -2
- package/lib/ui/demo/components/Question.js +50 -49
- package/lib/ui/demo/components/index.js +15 -14
- package/lib/ui/demo/index.js +3 -2
- package/lib/ui/navigation/index.js +13 -0
- package/lib/ui/navigation/styles.js +46 -0
- package/lib/utils/components/developer.js +30 -24
- package/lib/utils/components/envToggle.js +4 -4
- package/lib/utils/components/eventInput.js +10 -10
- package/lib/utils/components/sdkKey.js +10 -3
- package/lib/utils/createDemo.js +33 -20
- package/lib/utils/decorators/styles.js +3 -7
- package/package.json +6 -6
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsxs as p, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { ActiveFeature as e } from "./Features/index.js";
|
|
3
|
+
import { SDKNavigation as a } from "./Navigation/index.js";
|
|
4
|
+
import { SDKNotifications as c } from "./Notifications/index.js";
|
|
5
|
+
import { useSdkFeature as n } from "./useSdkFeature.js";
|
|
6
|
+
import { SDKContainer as f } from "./styles.js";
|
|
7
|
+
import "@streamlayer/sdk-web-types";
|
|
8
|
+
import "react";
|
|
9
|
+
import "./Features/Gamification/index.js";
|
|
10
|
+
import "@nanostores/react";
|
|
11
|
+
import "./Features/Gamification/Tabs.js";
|
|
12
|
+
import "../gamification/navigation/index.js";
|
|
13
|
+
import "../gamification/navigation/styles.js";
|
|
14
|
+
import "@linaria/react";
|
|
15
|
+
import "./Features/Gamification/UserSummary.js";
|
|
16
|
+
import "../gamification/user-statistics/index.js";
|
|
17
|
+
import "../../utils/common.js";
|
|
18
|
+
import "../gamification/user-statistics/components/statistics/index.js";
|
|
19
|
+
import "../gamification/user-statistics/components/statistics/styles.js";
|
|
20
|
+
import "../gamification/user-statistics/components/rank/index.js";
|
|
21
|
+
import "../gamification/user-statistics/components/rank/styles.js";
|
|
22
|
+
import "../gamification/user-statistics/styles.js";
|
|
23
|
+
import "./Features/Gamification/QuestionsList.js";
|
|
24
|
+
import "../gamification/question-list/index.js";
|
|
25
|
+
import "../gamification/question/index.js";
|
|
26
|
+
import "../../icon-chevron-138a557c.js";
|
|
27
|
+
import "../gamification/question/styles.js";
|
|
28
|
+
import "../gamification/question-list/styles.js";
|
|
29
|
+
import "./Features/Gamification/Leaderboard.js";
|
|
30
|
+
import "../gamification/leaderboard-item-detail/index.js";
|
|
31
|
+
import "../gamification/common-header/index.js";
|
|
32
|
+
import "../../icon-exit-6a55bb8f.js";
|
|
33
|
+
import "../gamification/common-header/styles.js";
|
|
34
|
+
import "../gamification/leaderboard-item-detail/styles.js";
|
|
35
|
+
import "../gamification/leaderboard-list/index.js";
|
|
36
|
+
import "../gamification/leaderboard-invite-link/index.js";
|
|
37
|
+
import "../gamification/leaderboard-invite-link/styles.js";
|
|
38
|
+
import "../gamification/leaderboard-item/index.js";
|
|
39
|
+
import "../gamification/leaderboard-item/styles.js";
|
|
40
|
+
import "../gamification/leaderboard-list/styles.js";
|
|
41
|
+
import "./Features/Gamification/Question.js";
|
|
42
|
+
import "../gamification/vote/index.js";
|
|
43
|
+
import "../../index-7045fbb2.js";
|
|
44
|
+
import "../gamification/vote/components/voting-option/styles.js";
|
|
45
|
+
import "../gamification/vote/styles.js";
|
|
46
|
+
import "../gamification/vote/components/voting-header/index.js";
|
|
47
|
+
import "../gamification/vote/components/voting-header/components/timer/index.js";
|
|
48
|
+
import "react-countdown-circle-timer";
|
|
49
|
+
import "../theme/constants.js";
|
|
50
|
+
import "../gamification/vote/components/voting-header/components/timer/styles.js";
|
|
51
|
+
import "../gamification/vote/components/voting-header/styles.js";
|
|
52
|
+
import "../gamification/vote/components/voting-header/components/points/index.js";
|
|
53
|
+
import "../gamification/vote/components/voting-header/components/points/styles.js";
|
|
54
|
+
import "../../fedex-a8dcc7b2.js";
|
|
55
|
+
import "./Features/Highlights/index.js";
|
|
56
|
+
import "../demo/components/Insight.js";
|
|
57
|
+
import "../gamification/detailed-insight/index.js";
|
|
58
|
+
import "../gamification/detailed-insight/styles.js";
|
|
59
|
+
import "../demo/components/Insights.js";
|
|
60
|
+
import "../gamification/insight-list/index.js";
|
|
61
|
+
import "../gamification/insight/index.js";
|
|
62
|
+
import "../gamification/insight/styles.js";
|
|
63
|
+
import "../gamification/insight-list/styles.js";
|
|
64
|
+
import "./Features/FeatureProvider.js";
|
|
65
|
+
import "@streamlayer/sdk-web-interfaces";
|
|
66
|
+
import "@streamlayer/sdk-web-features";
|
|
67
|
+
import "../navigation/index.js";
|
|
68
|
+
import "../navigation/styles.js";
|
|
69
|
+
import "../notifications/index.js";
|
|
70
|
+
import "../notifications/notification/index.js";
|
|
71
|
+
import "@streamlayer/sdk-web-notifications";
|
|
72
|
+
import "../notifications/notification/onboarding-inapp/index.js";
|
|
73
|
+
import "../notifications/notification/onboarding-inapp/styles.js";
|
|
74
|
+
import "../notifications/notification/question-inapp/index.js";
|
|
75
|
+
import "../notifications/notification/question-inapp/styles.js";
|
|
76
|
+
import "../notifications/notification/styles.js";
|
|
77
|
+
import "../notifications/styles.js";
|
|
78
|
+
const Et = ({ sdk: t, overlays: o = {} }) => {
|
|
79
|
+
const [i, m] = n(t);
|
|
80
|
+
return /* @__PURE__ */ p(f, { className: "StreamLayerSDK", children: [
|
|
81
|
+
/* @__PURE__ */ r(a, { sdk: t, customOverlays: o, activeButton: i }),
|
|
82
|
+
/* @__PURE__ */ r(c, { sdk: t }),
|
|
83
|
+
/* @__PURE__ */ r(e, { feature: m, sdk: t })
|
|
84
|
+
] });
|
|
85
|
+
};
|
|
86
|
+
export {
|
|
87
|
+
Et as App
|
|
88
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FeatureStatus as s } from "@streamlayer/sdk-web-interfaces";
|
|
2
|
+
import { useState as i, useEffect as n } from "react";
|
|
3
|
+
import { useStore as c } from "@nanostores/react";
|
|
4
|
+
const m = (a) => {
|
|
5
|
+
const r = c(a.getActiveFeature()), [o, f] = i(null);
|
|
6
|
+
return n(() => {
|
|
7
|
+
const u = a.getFeatures();
|
|
8
|
+
if (r)
|
|
9
|
+
for (const [e, t] of u)
|
|
10
|
+
e === r ? t.status.get() === s.Suspended && (t.enable(), f(t)) : t.status.get() === s.Ready && t.disable();
|
|
11
|
+
else {
|
|
12
|
+
for (const [, e] of u)
|
|
13
|
+
e.status.get() === s.Ready && e.disable();
|
|
14
|
+
f(null);
|
|
15
|
+
}
|
|
16
|
+
return () => {
|
|
17
|
+
for (const [, e] of u)
|
|
18
|
+
e.status.get() === s.Ready && e.disable();
|
|
19
|
+
};
|
|
20
|
+
}, [r, a]), [r, o];
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
m as useSdkFeature
|
|
24
|
+
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { FeatureType as
|
|
3
|
-
import { useStore as
|
|
4
|
-
import { styled as
|
|
5
|
-
import { Points as
|
|
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
6
|
import "../gamification/points/styles.js";
|
|
7
7
|
import "../icons/index.js";
|
|
8
8
|
import "react";
|
|
9
|
-
const
|
|
9
|
+
const d = u.div`
|
|
10
10
|
position: fixed;
|
|
11
11
|
top: 0;
|
|
12
12
|
right: 0;
|
|
13
|
-
`,
|
|
14
|
-
var
|
|
15
|
-
const t =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
return
|
|
13
|
+
`, f = ({ store: o }) => {
|
|
14
|
+
var e, m, n, i;
|
|
15
|
+
const t = p(o);
|
|
16
|
+
return ((m = (e = t.data) == null ? void 0 : e.summary) == null ? void 0 : m.points) === void 0 ? null : /* @__PURE__ */ r(d, { children: ((i = (n = t.data) == null ? void 0 : n.summary) == null ? void 0 : i.points) && /* @__PURE__ */ r(a, { points: t.data.summary.points }) });
|
|
17
|
+
}, v = ({ sdk: o }) => {
|
|
18
|
+
const t = o.getFeature(s.GAMES);
|
|
19
|
+
return t != null && t.userSummary ? /* @__PURE__ */ r(f, { store: t.userSummary.getStore() }) : null;
|
|
20
20
|
};
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
v as DemoPoints
|
|
23
23
|
};
|
|
@@ -41,6 +41,7 @@ import "../gamification/vote/components/voting-header/components/timer/styles.js
|
|
|
41
41
|
import "../gamification/vote/components/voting-header/styles.js";
|
|
42
42
|
import "../gamification/vote/components/voting-header/components/points/index.js";
|
|
43
43
|
import "../gamification/vote/components/voting-header/components/points/styles.js";
|
|
44
|
+
import "../../fedex-a8dcc7b2.js";
|
|
44
45
|
import "../gamification/onboarding/styles.js";
|
|
45
46
|
import "../gamification/onboarding/components/onboarding-slides/onboarding-instructions/index.js";
|
|
46
47
|
import "../gamification/onboarding/components/onboarding-slides/onboarding-instructions/styles.js";
|
|
@@ -57,7 +58,7 @@ import "../gamification/leaderboard-invite-link/styles.js";
|
|
|
57
58
|
import "../gamification/leaderboard-item/index.js";
|
|
58
59
|
import "../gamification/leaderboard-item/styles.js";
|
|
59
60
|
import "../gamification/leaderboard-list/styles.js";
|
|
60
|
-
const
|
|
61
|
+
const mr = ({
|
|
61
62
|
gamification: t,
|
|
62
63
|
sdk: u
|
|
63
64
|
}) => {
|
|
@@ -109,5 +110,5 @@ const pr = ({
|
|
|
109
110
|
] });
|
|
110
111
|
};
|
|
111
112
|
export {
|
|
112
|
-
|
|
113
|
+
mr as GamificationComponent
|
|
113
114
|
};
|
|
@@ -37,6 +37,7 @@ import "../gamification/vote/components/voting-header/components/timer/styles.js
|
|
|
37
37
|
import "../gamification/vote/components/voting-header/styles.js";
|
|
38
38
|
import "../gamification/vote/components/voting-header/components/points/index.js";
|
|
39
39
|
import "../gamification/vote/components/voting-header/components/points/styles.js";
|
|
40
|
+
import "../../fedex-a8dcc7b2.js";
|
|
40
41
|
import "../gamification/insight-list/index.js";
|
|
41
42
|
import "../gamification/insight/index.js";
|
|
42
43
|
import "../gamification/insight/styles.js";
|
|
@@ -44,7 +45,7 @@ import "../gamification/insight-list/styles.js";
|
|
|
44
45
|
import "../gamification/detailed-insight/index.js";
|
|
45
46
|
import "../gamification/common-header/index.js";
|
|
46
47
|
import "../gamification/detailed-insight/styles.js";
|
|
47
|
-
const
|
|
48
|
+
const pt = ({ highlights: i, sdk: e }) => {
|
|
48
49
|
const n = m(i.status), r = m(i.openedInsight), { slStreamId: o } = m(e.sdkStore);
|
|
49
50
|
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: [
|
|
50
51
|
!r && /* @__PURE__ */ t(c, { highlights: i, store: i.insights.getStore() }),
|
|
@@ -59,5 +60,5 @@ const mt = ({ highlights: i, sdk: e }) => {
|
|
|
59
60
|
] }) : /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t("div", { children: "Event is forbidden" }) });
|
|
60
61
|
};
|
|
61
62
|
export {
|
|
62
|
-
|
|
63
|
+
pt as HighlightsComponent
|
|
63
64
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
2
2
|
import { styled as y } from "@linaria/react";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { Vote as
|
|
5
|
-
import { VotingHeader as
|
|
3
|
+
import { useState as d, useCallback as x, useMemo as c } from "react";
|
|
4
|
+
import { Vote as g } from "../../gamification/vote/index.js";
|
|
5
|
+
import { VotingHeader as h } from "../../gamification/vote/components/voting-header/index.js";
|
|
6
|
+
import { i as b } from "../../../fedex-a8dcc7b2.js";
|
|
6
7
|
import "@streamlayer/sdk-web-types";
|
|
7
8
|
import "../../../index-7045fbb2.js";
|
|
8
9
|
import "../../gamification/vote/components/voting-option/styles.js";
|
|
@@ -15,7 +16,7 @@ import "../../gamification/vote/components/voting-header/components/timer/styles
|
|
|
15
16
|
import "../../gamification/vote/components/voting-header/styles.js";
|
|
16
17
|
import "../../gamification/vote/components/voting-header/components/points/index.js";
|
|
17
18
|
import "../../gamification/vote/components/voting-header/components/points/styles.js";
|
|
18
|
-
const
|
|
19
|
+
const k = y.div`
|
|
19
20
|
position: absolute;
|
|
20
21
|
top: 0;
|
|
21
22
|
background: var(--color-transparent-item);
|
|
@@ -42,60 +43,60 @@ const O = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjgiIGhlaWdodD0iMjIiIHZpZXd
|
|
|
42
43
|
transform: translateX(0);
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
|
-
`,
|
|
46
|
-
var
|
|
47
|
-
const [
|
|
48
|
-
(
|
|
49
|
-
|
|
46
|
+
`, F = ({ openedQuestion: t, closeQuestion: a, vote: e }) => {
|
|
47
|
+
var s;
|
|
48
|
+
const [l, m] = d(!1), p = x(
|
|
49
|
+
(i) => {
|
|
50
|
+
m(i);
|
|
50
51
|
},
|
|
51
|
-
[
|
|
52
|
-
),
|
|
53
|
-
() =>
|
|
54
|
-
[
|
|
55
|
-
),
|
|
56
|
-
() => !!(
|
|
57
|
-
[
|
|
52
|
+
[m]
|
|
53
|
+
), r = c(
|
|
54
|
+
() => t == null ? void 0 : t.answers.find((i) => i.youVoted === !0),
|
|
55
|
+
[t]
|
|
56
|
+
), f = c(
|
|
57
|
+
() => !!(t != null && t.answers.find((i) => i.correct === !0)),
|
|
58
|
+
[t]
|
|
58
59
|
);
|
|
59
|
-
return
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
|
|
60
|
+
return t ? /* @__PURE__ */ o(k, { children: /* @__PURE__ */ n("div", { children: [
|
|
61
|
+
/* @__PURE__ */ o(
|
|
62
|
+
h,
|
|
62
63
|
{
|
|
63
|
-
points: (
|
|
64
|
-
questionAnswered: !!
|
|
65
|
-
questionAnsweredCorrectly:
|
|
66
|
-
logo:
|
|
67
|
-
closeQuestion:
|
|
68
|
-
setTimeToExpire:
|
|
69
|
-
questionType:
|
|
64
|
+
points: (r == null ? void 0 : r.points) || 0,
|
|
65
|
+
questionAnswered: !!r,
|
|
66
|
+
questionAnsweredCorrectly: r == null ? void 0 : r.correct,
|
|
67
|
+
logo: b,
|
|
68
|
+
closeQuestion: a,
|
|
69
|
+
setTimeToExpire: p,
|
|
70
|
+
questionType: t.type
|
|
70
71
|
}
|
|
71
72
|
),
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
|
|
73
|
+
/* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
|
|
74
|
+
g,
|
|
74
75
|
{
|
|
75
|
-
title:
|
|
76
|
-
feedbackMessages: (
|
|
77
|
-
questionType:
|
|
78
|
-
questionId:
|
|
79
|
-
questionAnswered: !!
|
|
80
|
-
questionAnsweredCorrectly:
|
|
81
|
-
options:
|
|
82
|
-
id:
|
|
83
|
-
title:
|
|
84
|
-
icon:
|
|
85
|
-
type:
|
|
86
|
-
correct:
|
|
87
|
-
percentage:
|
|
88
|
-
answered:
|
|
89
|
-
disabled: !!
|
|
90
|
-
questionAnswered: !!
|
|
91
|
-
hasCorrectAnswer:
|
|
92
|
-
points:
|
|
93
|
-
onVote:
|
|
76
|
+
title: t.subject,
|
|
77
|
+
feedbackMessages: (s = t.options) == null ? void 0 : s.options.value,
|
|
78
|
+
questionType: t.type,
|
|
79
|
+
questionId: t.id,
|
|
80
|
+
questionAnswered: !!r,
|
|
81
|
+
questionAnsweredCorrectly: r == null ? void 0 : r.correct,
|
|
82
|
+
options: t.answers.map((i) => ({
|
|
83
|
+
id: i.id,
|
|
84
|
+
title: i.text,
|
|
85
|
+
icon: i.icon,
|
|
86
|
+
type: t.type,
|
|
87
|
+
correct: i.correct,
|
|
88
|
+
percentage: i.percentage,
|
|
89
|
+
answered: i.youVoted,
|
|
90
|
+
disabled: !!r || t.marketClosed || l,
|
|
91
|
+
questionAnswered: !!r,
|
|
92
|
+
hasCorrectAnswer: f,
|
|
93
|
+
points: i.points,
|
|
94
|
+
onVote: e
|
|
94
95
|
}))
|
|
95
96
|
}
|
|
96
97
|
) })
|
|
97
98
|
] }) }) : null;
|
|
98
99
|
};
|
|
99
100
|
export {
|
|
100
|
-
|
|
101
|
+
F as Question
|
|
101
102
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { UserSummary as
|
|
2
|
-
import { QuestionsList as
|
|
3
|
-
import { Question as
|
|
4
|
-
import { Onboarding as
|
|
5
|
-
import { Insights as
|
|
6
|
-
import { Insight as
|
|
7
|
-
import { Leaderboard as
|
|
1
|
+
import { UserSummary as tr } from "./UserSummary.js";
|
|
2
|
+
import { QuestionsList as pr } from "./QuestionsList.js";
|
|
3
|
+
import { Question as er } from "./Question.js";
|
|
4
|
+
import { Onboarding as fr } from "../../gamification/onboarding/index.js";
|
|
5
|
+
import { Insights as nr } from "./Insights.js";
|
|
6
|
+
import { Insight as dr } from "./Insight.js";
|
|
7
|
+
import { Leaderboard as ur } from "./Leaderboard.js";
|
|
8
8
|
import "react/jsx-runtime";
|
|
9
9
|
import "@nanostores/react";
|
|
10
10
|
import "../../gamification/user-statistics/index.js";
|
|
@@ -35,6 +35,7 @@ import "../../gamification/vote/components/voting-header/components/timer/styles
|
|
|
35
35
|
import "../../gamification/vote/components/voting-header/styles.js";
|
|
36
36
|
import "../../gamification/vote/components/voting-header/components/points/index.js";
|
|
37
37
|
import "../../gamification/vote/components/voting-header/components/points/styles.js";
|
|
38
|
+
import "../../../fedex-a8dcc7b2.js";
|
|
38
39
|
import "../../gamification/onboarding/styles.js";
|
|
39
40
|
import "../../gamification/onboarding/components/onboarding-slides/onboarding-instructions/index.js";
|
|
40
41
|
import "../../gamification/onboarding/components/onboarding-slides/onboarding-instructions/styles.js";
|
|
@@ -59,11 +60,11 @@ import "../../gamification/leaderboard-item/index.js";
|
|
|
59
60
|
import "../../gamification/leaderboard-item/styles.js";
|
|
60
61
|
import "../../gamification/leaderboard-list/styles.js";
|
|
61
62
|
export {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
dr as Insight,
|
|
64
|
+
nr as Insights,
|
|
65
|
+
ur as Leaderboard,
|
|
66
|
+
fr as Onboarding,
|
|
67
|
+
er as Question,
|
|
68
|
+
pr as QuestionsList,
|
|
69
|
+
tr as UserSummary
|
|
69
70
|
};
|
package/lib/ui/demo/index.js
CHANGED
|
@@ -48,6 +48,7 @@ import "../gamification/vote/components/voting-header/components/timer/styles.js
|
|
|
48
48
|
import "../gamification/vote/components/voting-header/styles.js";
|
|
49
49
|
import "../gamification/vote/components/voting-header/components/points/index.js";
|
|
50
50
|
import "../gamification/vote/components/voting-header/components/points/styles.js";
|
|
51
|
+
import "../../fedex-a8dcc7b2.js";
|
|
51
52
|
import "../gamification/onboarding/index.js";
|
|
52
53
|
import "../gamification/onboarding/styles.js";
|
|
53
54
|
import "../gamification/onboarding/components/onboarding-slides/onboarding-instructions/index.js";
|
|
@@ -125,7 +126,7 @@ const A = ({ activeFeature: r, sdk: o }) => {
|
|
|
125
126
|
] }),
|
|
126
127
|
d
|
|
127
128
|
] });
|
|
128
|
-
},
|
|
129
|
+
}, pi = ({ sdk: r }) => {
|
|
129
130
|
const o = c(r.organizationStore()), e = c(r.getUserStore()), n = c(r.getActiveFeature());
|
|
130
131
|
return o.loading ? /* @__PURE__ */ i("div", { children: "authentication..." }) : o.data ? e.loading ? /* @__PURE__ */ i("div", { children: "authentication..." }) : e.data ? /* @__PURE__ */ f(v, { children: [
|
|
131
132
|
/* @__PURE__ */ i(F, { notificationsStore: r.getNotificationsStore() }),
|
|
@@ -133,5 +134,5 @@ const A = ({ activeFeature: r, sdk: o }) => {
|
|
|
133
134
|
] }) : /* @__PURE__ */ i(H, { sdk: r }) : /* @__PURE__ */ i("div", { children: "wrong sdk key..." });
|
|
134
135
|
};
|
|
135
136
|
export {
|
|
136
|
-
|
|
137
|
+
pi as Demo
|
|
137
138
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as l, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { Buttons as c, Button as d } from "./styles.js";
|
|
3
|
+
import "@linaria/react";
|
|
4
|
+
const s = ({ button: i, active: e }) => /* @__PURE__ */ a(d, { onClick: i.onClick, disabled: i.disabled, "data-selected": e, children: [
|
|
5
|
+
i.icon && /* @__PURE__ */ l("img", { src: i.icon, alt: i.label || i.icon }),
|
|
6
|
+
e && i.label && /* @__PURE__ */ l("span", { children: i.label })
|
|
7
|
+
] }), p = ({
|
|
8
|
+
buttons: i,
|
|
9
|
+
activeButton: e
|
|
10
|
+
}) => /* @__PURE__ */ l(c, { children: i.map((r) => /* @__PURE__ */ l(s, { button: r, active: r.id === e }, r.id)) });
|
|
11
|
+
export {
|
|
12
|
+
p as Navigation
|
|
13
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { styled as o } from "@linaria/react";
|
|
2
|
+
const e = o.div`
|
|
3
|
+
display: flex;
|
|
4
|
+
margin-bottom: 10px;
|
|
5
|
+
`, r = o.button`
|
|
6
|
+
background: rgb(29, 123, 255);
|
|
7
|
+
border: none;
|
|
8
|
+
color: #fff;
|
|
9
|
+
padding: 5px 6px;
|
|
10
|
+
border-radius: 3px;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
margin-right: 5px;
|
|
13
|
+
transition: all 0.3s ease-in;
|
|
14
|
+
|
|
15
|
+
& > img {
|
|
16
|
+
max-width: 10px;
|
|
17
|
+
max-height: 10px;
|
|
18
|
+
margin-right: 5px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&:enabled:hover {
|
|
22
|
+
box-shadow: inset 0 0 0 2em rgb(2, 88, 208);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&[data-selected='true'] {
|
|
26
|
+
box-shadow: inset 0 0 0 2em rgb(0, 60, 145);
|
|
27
|
+
|
|
28
|
+
&:enabled:hover {
|
|
29
|
+
box-shadow: inset 0 0 0 2em rgb(0, 60, 145);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&:disabled {
|
|
34
|
+
opacity: 0.5;
|
|
35
|
+
background-color: gray;
|
|
36
|
+
cursor: default;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&[data-enable_sdk_button='false'] {
|
|
40
|
+
opacity: 0.7;
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
export {
|
|
44
|
+
r as Button,
|
|
45
|
+
e as Buttons
|
|
46
|
+
};
|
|
@@ -1,32 +1,38 @@
|
|
|
1
1
|
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { styled as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
2
|
+
import { useMemo as x, useState as g } from "react";
|
|
3
|
+
import { styled as i } from "@linaria/react";
|
|
4
|
+
import { DeveloperStorage as h } from "../storage.js";
|
|
5
|
+
import { EventInput as u } from "./eventInput.js";
|
|
6
|
+
import { BypassLogin as b } from "./bypassLogin.js";
|
|
7
|
+
import { SdkKey as v } from "./sdkKey.js";
|
|
8
|
+
import { EnvToggle as y } from "./envToggle.js";
|
|
9
|
+
import "@streamlayer/sdk-web-storage";
|
|
9
10
|
import "@streamlayer/sdk-web-core";
|
|
10
11
|
import "@nanostores/react";
|
|
11
12
|
import "./styles.js";
|
|
12
|
-
|
|
13
|
-
const v = n.div`
|
|
13
|
+
const w = i.div`
|
|
14
14
|
position: fixed;
|
|
15
15
|
bottom: 0;
|
|
16
16
|
right: 0;
|
|
17
17
|
max-width: 600px;
|
|
18
|
-
`,
|
|
18
|
+
`, D = i.div`
|
|
19
19
|
flex-direction: column;
|
|
20
20
|
gap: 10px;
|
|
21
21
|
margin-right: 60px;
|
|
22
22
|
display: flex;
|
|
23
|
-
|
|
23
|
+
animation: show-dev-items 0.3s ease-in-out;
|
|
24
24
|
transform-origin: bottom right;
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
@keyframes show-dev-items {
|
|
27
|
+
from {
|
|
28
|
+
transform: scale(0);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
to {
|
|
32
|
+
transform: scale(1);
|
|
33
|
+
}
|
|
28
34
|
}
|
|
29
|
-
`,
|
|
35
|
+
`, j = i.button`
|
|
30
36
|
position: absolute;
|
|
31
37
|
z-index: 10000;
|
|
32
38
|
bottom: 10px;
|
|
@@ -65,22 +71,22 @@ const v = n.div`
|
|
|
65
71
|
width: 100%;
|
|
66
72
|
height: 4px;
|
|
67
73
|
}
|
|
68
|
-
`,
|
|
69
|
-
const r =
|
|
70
|
-
return /* @__PURE__ */ e(
|
|
71
|
-
/* @__PURE__ */ e(
|
|
74
|
+
`, q = ({ sdk: t, sdkKey: s, setSdkKey: n, env: m, setEnv: p, event: d, setEvent: l }) => {
|
|
75
|
+
const r = x(() => new h(), []), [a, c] = g(!1);
|
|
76
|
+
return /* @__PURE__ */ e(w, { children: [
|
|
77
|
+
/* @__PURE__ */ e(j, { "data-opened": a.toString(), onClick: () => c((f) => !f), children: [
|
|
72
78
|
/* @__PURE__ */ o("span", {}),
|
|
73
79
|
/* @__PURE__ */ o("span", {}),
|
|
74
80
|
/* @__PURE__ */ o("span", {})
|
|
75
81
|
] }),
|
|
76
|
-
/* @__PURE__ */ e(
|
|
77
|
-
p && /* @__PURE__ */ o(
|
|
78
|
-
|
|
79
|
-
t && /* @__PURE__ */ o(
|
|
80
|
-
t && /* @__PURE__ */ o(
|
|
82
|
+
a && /* @__PURE__ */ e(D, { children: [
|
|
83
|
+
p && /* @__PURE__ */ o(y, { env: m, setEnv: p, storage: r }),
|
|
84
|
+
n && /* @__PURE__ */ o(v, { sdkKey: s, setSdkKey: n, storage: r }),
|
|
85
|
+
t && /* @__PURE__ */ o(u, { sdk: t, storage: r, event: d, setEvent: l }),
|
|
86
|
+
t && /* @__PURE__ */ o(b, { sdk: t, storage: r })
|
|
81
87
|
] })
|
|
82
88
|
] });
|
|
83
89
|
};
|
|
84
90
|
export {
|
|
85
|
-
|
|
91
|
+
q as Developer
|
|
86
92
|
};
|
|
@@ -38,13 +38,13 @@ const d = o.div`
|
|
|
38
38
|
width: 1rem;
|
|
39
39
|
border-radius: 1em;
|
|
40
40
|
background: gray;
|
|
41
|
-
box-shadow: 0 0.1em 0.3em rgba(0,0,0,0.3);
|
|
41
|
+
box-shadow: 0 0.1em 0.3em rgba(0, 0, 0, 0.3);
|
|
42
42
|
transition: all 300ms;
|
|
43
43
|
}
|
|
44
|
-
`,
|
|
44
|
+
`, u = ({ env: r, setEnv: i, storage: s }) => /* @__PURE__ */ t(d, { children: [
|
|
45
45
|
/* @__PURE__ */ e("label", { htmlFor: "slEnvCheckbox", children: "Production:" }),
|
|
46
46
|
/* @__PURE__ */ t(a, { children: [
|
|
47
|
-
/* @__PURE__ */ e("input", { id: "slEnvCheckbox", type: "checkbox", checked: r === "production", onChange: () => {
|
|
47
|
+
/* @__PURE__ */ e("input", { id: "slEnvCheckbox", type: "checkbox", checked: r === "production", onChange: (p) => {
|
|
48
48
|
i((c) => {
|
|
49
49
|
const n = c === "production" ? "development" : "production";
|
|
50
50
|
return s.setEnv(n), n;
|
|
@@ -54,5 +54,5 @@ const d = o.div`
|
|
|
54
54
|
] })
|
|
55
55
|
] });
|
|
56
56
|
export {
|
|
57
|
-
|
|
57
|
+
u as EnvToggle
|
|
58
58
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as t, jsxs as c } from "react/jsx-runtime";
|
|
2
2
|
import "@streamlayer/sdk-web-core";
|
|
3
|
-
import {
|
|
3
|
+
import { useEffect as d } from "react";
|
|
4
4
|
import { useStore as m } from "@nanostores/react";
|
|
5
5
|
import { InputField as u } from "./styles.js";
|
|
6
6
|
import "@linaria/react";
|
|
7
|
-
const
|
|
8
|
-
var
|
|
9
|
-
const { organizationSettings: r } = m(
|
|
10
|
-
|
|
7
|
+
const y = ({ sdk: o, storage: i, event: e, setEvent: l }) => {
|
|
8
|
+
var n;
|
|
9
|
+
const { organizationSettings: r } = m(o.sdkStore), a = !((n = r == null ? void 0 : r.data) != null && n.provider), s = () => {
|
|
10
|
+
o.createEventSession(e), i.setEvent(e);
|
|
11
11
|
};
|
|
12
12
|
return d(() => {
|
|
13
|
-
e &&
|
|
13
|
+
e && s();
|
|
14
14
|
}, []), /* @__PURE__ */ t("div", { children: /* @__PURE__ */ c(u, { children: [
|
|
15
|
-
/* @__PURE__ */ t("label", { children:
|
|
16
|
-
/* @__PURE__ */ t("input", { type: "text", value: e, onChange: (
|
|
17
|
-
/* @__PURE__ */ t("button", { onClick:
|
|
15
|
+
/* @__PURE__ */ t("label", { children: a ? "Use StreamLayer event ids" : "Use your provider event ids" }),
|
|
16
|
+
/* @__PURE__ */ t("input", { type: "text", value: e, onChange: (p) => l(p.target.value) }),
|
|
17
|
+
/* @__PURE__ */ t("button", { onClick: s, children: "set" })
|
|
18
18
|
] }) });
|
|
19
19
|
};
|
|
20
20
|
export {
|
|
21
|
-
|
|
21
|
+
y as EventInput
|
|
22
22
|
};
|
|
@@ -10,9 +10,16 @@ const b = ({
|
|
|
10
10
|
const [e, o] = u(r);
|
|
11
11
|
return /* @__PURE__ */ t("div", { children: /* @__PURE__ */ l(m, { children: [
|
|
12
12
|
/* @__PURE__ */ t("label", { children: "SDK Key" }),
|
|
13
|
-
/* @__PURE__ */ t(
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
/* @__PURE__ */ t(
|
|
14
|
+
"input",
|
|
15
|
+
{
|
|
16
|
+
type: "text",
|
|
17
|
+
value: e,
|
|
18
|
+
onChange: (s) => {
|
|
19
|
+
o(s.target.value);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
),
|
|
16
23
|
/* @__PURE__ */ t("button", { onClick: () => {
|
|
17
24
|
n.setSdkKey(e), i(e);
|
|
18
25
|
}, children: "set" })
|