@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.
Files changed (33) hide show
  1. package/lib/fedex-a8dcc7b2.js +4 -0
  2. package/lib/index.js +30 -29
  3. package/lib/ui/app/Features/FeatureProvider.js +14 -0
  4. package/lib/ui/app/Features/Gamification/Leaderboard.js +48 -0
  5. package/lib/ui/app/Features/Gamification/Question.js +102 -0
  6. package/lib/ui/app/Features/Gamification/QuestionsList.js +16 -0
  7. package/lib/ui/app/Features/Gamification/Tabs.js +47 -0
  8. package/lib/ui/app/Features/Gamification/UserSummary.js +17 -0
  9. package/lib/ui/app/Features/Gamification/index.js +67 -0
  10. package/lib/ui/app/Features/Highlights/Insight.js +31 -0
  11. package/lib/ui/app/Features/Highlights/Insights.js +16 -0
  12. package/lib/ui/app/Features/Highlights/index.js +33 -0
  13. package/lib/ui/app/Features/index.js +64 -0
  14. package/lib/ui/app/Navigation/index.js +31 -0
  15. package/lib/ui/app/Notifications/index.js +18 -0
  16. package/lib/ui/app/index.js +88 -0
  17. package/lib/ui/app/styles.js +8 -0
  18. package/lib/ui/app/useSdkFeature.js +24 -0
  19. package/lib/ui/demo/DemoPoints.js +14 -14
  20. package/lib/ui/demo/Gamification.js +3 -2
  21. package/lib/ui/demo/Highlights.js +3 -2
  22. package/lib/ui/demo/components/Question.js +50 -49
  23. package/lib/ui/demo/components/index.js +15 -14
  24. package/lib/ui/demo/index.js +3 -2
  25. package/lib/ui/navigation/index.js +13 -0
  26. package/lib/ui/navigation/styles.js +46 -0
  27. package/lib/utils/components/developer.js +30 -24
  28. package/lib/utils/components/envToggle.js +4 -4
  29. package/lib/utils/components/eventInput.js +10 -10
  30. package/lib/utils/components/sdkKey.js +10 -3
  31. package/lib/utils/createDemo.js +33 -20
  32. package/lib/utils/decorators/styles.js +3 -7
  33. 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,8 @@
1
+ import { styled as o } from "@linaria/react";
2
+ const r = o.div`
3
+ height: 100%;
4
+ background: #fff;
5
+ `;
6
+ export {
7
+ r as SDKContainer
8
+ };
@@ -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 e } from "react/jsx-runtime";
2
- import { FeatureType as n } from "@streamlayer/sdk-web-types";
3
- import { useStore as s } from "@nanostores/react";
4
- import { styled as p } from "@linaria/react";
5
- import { Points as u } from "../gamification/points/index.js";
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 a = p.div`
9
+ const d = u.div`
10
10
  position: fixed;
11
11
  top: 0;
12
12
  right: 0;
13
- `, g = ({ sdk: m }) => {
14
- var o, i;
15
- const t = m.getFeature(n.GAMES);
16
- if (!(t != null && t.userSummary))
17
- return null;
18
- const r = s(t.userSummary.getStore());
19
- return ((i = (o = r.data) == null ? void 0 : o.summary) == null ? void 0 : i.points) === void 0 ? null : /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e(u, { points: r.data.summary.points }) });
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
- g as DemoPoints
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 pr = ({
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
- pr as GamificationComponent
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 mt = ({ highlights: i, sdk: e }) => {
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
- mt as HighlightsComponent
63
+ pt as HighlightsComponent
63
64
  };
@@ -1,8 +1,9 @@
1
- import { jsx as D, jsxs as t } from "react/jsx-runtime";
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 r, useCallback as u, useMemo as i } from "react";
4
- import { Vote as L } from "../../gamification/vote/index.js";
5
- import { VotingHeader as E } from "../../gamification/vote/components/voting-header/index.js";
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 O = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjgiIGhlaWdodD0iMjIiIHZpZXdCb3g9IjAgMCA2OCAyMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlZlY3RvciI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNTYuNjE1NSA3LjQ0MTQ2SDUwLjcwNjZMNTYuMzA3MiAxMy44NjE1TDUwLjcwNjYgMjAuMjgwNUg1Ni40MzU3TDU5LjE1ODcgMTcuMTM3TDYxLjkwNjggMjAuMjgwNUg2Ny44NEw2Mi4xOSAxMy44MzQ4TDY3Ljc2MzYgNy40NDE0Nkg2Mi4wNjA2TDU5LjM4OTcgMTAuNTYwMkw1Ni42MTU1IDcuNDQxNDZaTTYyLjI3MjEgNy45MTY1OUw1OS4zOTY0IDExLjI3NDdMNTYuNDA5MiA3LjkxNjU5SDUxLjc0NDZMNTYuOTMwNyAxMy44NjE1TDUxLjc0NDcgMTkuODA1NEg1Ni4yMjU3TDU5LjE1NzEgMTYuNDIxM0w2Mi4xMTU2IDE5LjgwNTRINjYuNzk4N0w2MS41NjYgMTMuODM1N0w2Ni43MjYxIDcuOTE2NTlINjIuMjcyMVoiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDQuMzYzNSA3LjQ0MTQ2VjQuNTY0MDZINTAuNzA2NlYwLjA1NTk5OThIMzkuNzAyVjIwLjI4MDVINTAuNzA2NlYxNS43NjAxSDQ0LjM2MzVWMTEuNzc5NEg1MC43MDY2VjcuNDQxNDZINDQuMzYzNVpNNTAuMjQwOCA3LjkxNjU5SDQzLjg5NzhWNC4wODg5M0g1MC4yNDA4VjAuNTMxMTMySDQwLjE2NzhWMTkuODA1NEg1MC4yNDA4VjE2LjIzNTJINDMuODk3OFYxMS4zMDQzSDUwLjI0MDhWNy45MTY1OVoiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik0zNS4wNiAwLjA1NTk5OThWOC4zMzI4MUgzNS4wMDg3QzMzLjk4MDMgNy4xMjc4NyAzMi42OTY2IDYuNzA4ODEgMzEuMjA3IDYuNzA4ODFDMjguMTU1MiA2LjcwODgxIDI1Ljg1NjEgOC44MjYgMjUuMDQ5MyAxMS42MjM2QzI0LjEyOCA4LjU0MDkyIDIxLjc1NDQgNi42NTA4NCAxOC4yMzQ5IDYuNjUwODRDMTUuMzc2OSA2LjY1MDg0IDEzLjExOTcgNy45NTkzNiAxMS45NDIyIDEwLjA5MThWNy40NDE0Nkg2LjAzNDE2VjQuNTY0MDZIMTIuNDgxNVYwLjA1NTk5OThIMC43NjgwMDVWMjAuMjgwNUg2LjAzNDE2VjExLjc3OTRIMTEuMjgzNkMxMS4xMjcgMTIuNDAzNyAxMS4wNDMyIDEzLjA3MjcgMTEuMDQzMiAxMy43Nzg4QzExLjA0MzIgMTcuOTk3IDE0LjIwMzEgMjAuOTU4IDE4LjIzNDkgMjAuOTU4QzIxLjYyNTggMjAuOTU4IDIzLjg2MDcgMTkuMzM0IDI1LjA0MTkgMTYuMzc0SDIwLjUyODRDMTkuOTE4MyAxNy4yNjQ0IDE5LjQ1NTMgMTcuNTI3NiAxOC4yMzQ5IDE3LjUyNzZDMTYuODE5OSAxNy41Mjc2IDE1LjU5OTUgMTYuMjY4NSAxNS41OTk1IDE0Ljc3NTZIMjQuNzg5NEMyNS4xODgxIDE4LjEyNjIgMjcuNzQ3MiAyMS4wMTYgMzEuMjU4MiAyMS4wMTZDMzIuNzczIDIxLjAxNiAzNC4xNjAxIDIwLjI1NTggMzUuMDA3OCAxOC45NzI5SDM1LjA1OVYyMC4yODI0SDM5LjcwMUwzOS43MDIgMC4wNTU5OTk4SDM1LjA2Wk0xNS43NDY3IDExLjgzOTNDMTYuMDM5MiAxMC41NTQ1IDE3LjAxNjQgOS43MTU0NSAxOC4yMzU4IDkuNzE1NDVDMTkuNTc4MiA5LjcxNTQ1IDIwLjUwNTEgMTAuNTI4OSAyMC43NDkyIDExLjgzOTNDMjAuODUxNyAxMS44MzkzIDE1Ljc0NjcgMTEuODM5MyAxNS43NDY3IDExLjgzOTNaTTMyLjI0MiAxNy4yMDE2QzMwLjUzMDcgMTcuMjAxNiAyOS40NjY4IDE1LjU3NDggMjkuNDY2OCAxMy44NzY3QzI5LjQ2NjggMTIuMDYxNyAzMC4zOTE5IDEwLjMxNiAzMi4yNDIgMTAuMzE2QzM0LjE2MDEgMTAuMzE2IDM0LjkyNCAxMi4wNjE3IDM0LjkyNCAxMy44NzY3QzM0LjkyNCAxNS41OTc2IDM0LjExNDQgMTcuMjAxNiAzMi4yNDIgMTcuMjAxNloiIGZpbGw9IndoaXRlIi8+CjwvZz4KPC9zdmc+Cg==", w = y.div`
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
- `, Q = ({ openedQuestion: M, closeQuestion: A, vote: g }) => {
46
- var I;
47
- const [z, T] = r(!1), c = u(
48
- (j) => {
49
- T(j);
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
- [T]
52
- ), N = i(
53
- () => M == null ? void 0 : M.answers.find((j) => j.youVoted === !0),
54
- [M]
55
- ), x = i(
56
- () => !!(M != null && M.answers.find((j) => j.correct === !0)),
57
- [M]
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 M ? /* @__PURE__ */ D(w, { children: /* @__PURE__ */ t("div", { children: [
60
- /* @__PURE__ */ D(
61
- E,
60
+ return t ? /* @__PURE__ */ o(k, { children: /* @__PURE__ */ n("div", { children: [
61
+ /* @__PURE__ */ o(
62
+ h,
62
63
  {
63
- points: (N == null ? void 0 : N.points) || 0,
64
- questionAnswered: !!N,
65
- questionAnsweredCorrectly: N == null ? void 0 : N.correct,
66
- logo: O,
67
- closeQuestion: A,
68
- setTimeToExpire: c,
69
- questionType: M.type
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__ */ D("div", { children: /* @__PURE__ */ D(
73
- L,
73
+ /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
74
+ g,
74
75
  {
75
- title: M.subject,
76
- feedbackMessages: (I = M.options) == null ? void 0 : I.options.value,
77
- questionType: M.type,
78
- questionId: M.id,
79
- questionAnswered: !!N,
80
- questionAnsweredCorrectly: N == null ? void 0 : N.correct,
81
- options: M.answers.map((j) => ({
82
- id: j.id,
83
- title: j.text,
84
- icon: j.icon,
85
- type: M.type,
86
- correct: j.correct,
87
- percentage: j.percentage,
88
- answered: j.youVoted,
89
- disabled: !!N || M.marketClosed || z,
90
- questionAnswered: !!N,
91
- hasCorrectAnswer: x,
92
- points: j.points,
93
- onVote: g
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
- Q as Question
101
+ F as Question
101
102
  };
@@ -1,10 +1,10 @@
1
- import { UserSummary as or } from "./UserSummary.js";
2
- import { QuestionsList as mr } from "./QuestionsList.js";
3
- import { Question as ir } from "./Question.js";
4
- import { Onboarding as sr } from "../../gamification/onboarding/index.js";
5
- import { Insights as xr } from "./Insights.js";
6
- import { Insight as ar } from "./Insight.js";
7
- import { Leaderboard as gr } from "./Leaderboard.js";
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
- ar as Insight,
63
- xr as Insights,
64
- gr as Leaderboard,
65
- sr as Onboarding,
66
- ir as Question,
67
- mr as QuestionsList,
68
- or as UserSummary
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
  };
@@ -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
- }, mi = ({ sdk: r }) => {
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
- mi as Demo
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 c, useState as x } from "react";
3
- import { styled as n } from "@linaria/react";
4
- import { EventInput as g } from "./eventInput.js";
5
- import { BypassLogin as f } from "./bypassLogin.js";
6
- import { SdkKey as h } from "./sdkKey.js";
7
- import { EnvToggle as u } from "./envToggle.js";
8
- import { DeveloperStorage as b } from "../storage.js";
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
- import "@streamlayer/sdk-web-storage";
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
- `, y = n.div`
18
+ `, D = i.div`
19
19
  flex-direction: column;
20
20
  gap: 10px;
21
21
  margin-right: 60px;
22
22
  display: flex;
23
- transition: all .3s ease;
23
+ animation: show-dev-items 0.3s ease-in-out;
24
24
  transform-origin: bottom right;
25
25
 
26
- &[data-opened='false'] {
27
- transform: scale(0) translateY(-100%);
26
+ @keyframes show-dev-items {
27
+ from {
28
+ transform: scale(0);
29
+ }
30
+
31
+ to {
32
+ transform: scale(1);
33
+ }
28
34
  }
29
- `, w = n.button`
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
- `, O = ({ sdk: t, sdkKey: s, setSdkKey: i, env: d, setEnv: p }) => {
69
- const r = c(() => new b(), []), [a, m] = x(!1);
70
- return /* @__PURE__ */ e(v, { children: [
71
- /* @__PURE__ */ e(w, { "data-opened": a.toString(), onClick: () => m((l) => !l), children: [
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(y, { "data-opened": a.toString(), children: [
77
- p && /* @__PURE__ */ o(u, { env: d, setEnv: p, storage: r }),
78
- i && /* @__PURE__ */ o(h, { sdkKey: s, setSdkKey: i, storage: r }),
79
- t && /* @__PURE__ */ o(g, { sdk: t, storage: r }),
80
- t && /* @__PURE__ */ o(f, { sdk: t, storage: r })
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
- O as Developer
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
- `, m = ({ env: r, setEnv: i, storage: s }) => /* @__PURE__ */ t(d, { children: [
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
- m as EnvToggle
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 { useState as p, useEffect as d } from "react";
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 I = ({ sdk: n, storage: s }) => {
8
- var i;
9
- const { organizationSettings: r } = m(n.sdkStore), v = !((i = r == null ? void 0 : r.data) != null && i.provider), [e, l] = p(s.getEvent() || ""), o = () => {
10
- n.createEventSession(e), s.setEvent(e);
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 && o();
13
+ e && s();
14
14
  }, []), /* @__PURE__ */ t("div", { children: /* @__PURE__ */ c(u, { children: [
15
- /* @__PURE__ */ t("label", { children: v ? "Use StreamLayer event ids" : "Use your provider event ids" }),
16
- /* @__PURE__ */ t("input", { type: "text", value: e, onChange: (a) => l(a.target.value) }),
17
- /* @__PURE__ */ t("button", { onClick: o, children: "set" })
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
- I as EventInput
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("input", { type: "text", value: e, onChange: (s) => {
14
- o(s.target.value);
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" })