@streamlayer/react-ui 0.51.0 → 0.52.1

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 (44) hide show
  1. package/lib/index.js +32 -30
  2. package/lib/ui/app/Features/FeatureProvider.d.ts +1 -0
  3. package/lib/ui/app/Features/FeatureProvider.js +6 -10
  4. package/lib/ui/app/Features/Gamification/Question.js +3 -2
  5. package/lib/ui/app/Features/Gamification/index.d.ts +1 -0
  6. package/lib/ui/app/Features/Gamification/index.js +16 -18
  7. package/lib/ui/app/Features/Highlights/index.d.ts +1 -0
  8. package/lib/ui/app/Features/Highlights/index.js +15 -11
  9. package/lib/ui/app/Features/index.d.ts +1 -0
  10. package/lib/ui/app/Features/index.js +12 -8
  11. package/lib/ui/app/Navigation/MastersNavigation/index.d.ts +1 -0
  12. package/lib/ui/app/Navigation/MastersNavigation/index.js +10 -10
  13. package/lib/ui/app/masters.d.ts +1 -2
  14. package/lib/ui/app/masters.js +30 -33
  15. package/lib/ui/app/styles.js +14 -7
  16. package/lib/ui/app/useMastersApp.d.ts +4 -4
  17. package/lib/ui/app/useMastersApp.js +17 -17
  18. package/lib/ui/demo/DemoPoints.js +5 -3
  19. package/lib/ui/demo/Gamification.js +16 -15
  20. package/lib/ui/demo/Highlights.js +3 -2
  21. package/lib/ui/demo/components/Insight.d.ts +1 -0
  22. package/lib/ui/demo/components/Insight.js +10 -9
  23. package/lib/ui/demo/components/Insights.d.ts +1 -0
  24. package/lib/ui/demo/components/Insights.js +7 -7
  25. package/lib/ui/demo/components/Question.js +8 -7
  26. package/lib/ui/demo/components/index.js +15 -14
  27. package/lib/ui/demo/index.js +3 -2
  28. package/lib/ui/gamification/detailed-insight/index.d.ts +1 -0
  29. package/lib/ui/gamification/detailed-insight/index.js +14 -13
  30. package/lib/ui/gamification/insight-list/index.d.ts +1 -0
  31. package/lib/ui/gamification/insight-list/index.js +4 -4
  32. package/lib/ui/gamification/points/index.js +11 -9
  33. package/lib/ui/gamification/vote/index.js +40 -40
  34. package/lib/ui/gamification/vote/styles.js +5 -5
  35. package/lib/ui/gamification/vote/vote-option/index.d.ts +3 -1
  36. package/lib/ui/gamification/vote/vote-option/index.js +57 -36
  37. package/lib/ui/gamification/vote/vote-option/styles.js +7 -5
  38. package/lib/ui/icons/index.d.ts +1 -0
  39. package/lib/ui/icons/index.js +13 -12
  40. package/lib/ui/theme/index.js +2 -2
  41. package/lib/ui/theme/masters.js +3 -2
  42. package/lib/ui/theme/theme.d.ts +4 -0
  43. package/lib/ui/theme/theme.js +24 -19
  44. package/package.json +13 -13
@@ -32,6 +32,7 @@ import "../gamification/question/styles.js";
32
32
  import "../icons/index.js";
33
33
  import "../gamification/question/list/styles.js";
34
34
  import "../gamification/vote/index.js";
35
+ import "../app/styles.js";
35
36
  import "../gamification/vote/feedback/index.js";
36
37
  import "../gamification/vote/feedback/styles.js";
37
38
  import "../gamification/vote/styles.js";
@@ -59,17 +60,17 @@ import "react-window";
59
60
  import "react-window-infinite-loader";
60
61
  import "../gamification/leaderboard-item/index.js";
61
62
  import "../gamification/leaderboard-item/styles.js";
62
- const nt = ({
63
+ const st = ({
63
64
  gamification: r,
64
65
  sdk: u
65
66
  }) => {
66
67
  var d, v, c, b, y, g, S, h, C, G, L, Q, A, E, f, w, x, P, F, O, B, D, R;
67
- const T = p(r.status), j = p(r.onboardingStatus), l = p(r.openedQuestion), { slStreamId: o } = p(u.sdkStore), e = p(r.featureSettings), [n, q] = K(a.HOME);
68
+ 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);
68
69
  if (T !== J.Ready)
69
70
  return /* @__PURE__ */ t("div", { children: "wait..." });
70
- if (o != null && o.loading)
71
+ if (e != null && e.loading)
71
72
  return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t("div", { children: "Event is loading" }) });
72
- if (!(o != null && o.data))
73
+ if (!(e != null && e.data))
73
74
  return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t("div", { children: "Event is forbidden" }) });
74
75
  if (!j)
75
76
  return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(
@@ -77,16 +78,16 @@ const nt = ({
77
78
  {
78
79
  closeFeature: u.closeFeature,
79
80
  gamification: r,
80
- steps: (v = (d = e.inplayGame) == null ? void 0 : d.onboarding) == null ? void 0 : v.steps,
81
- gameIcon: (y = (b = (c = e.inplayGame) == null ? void 0 : c.overview) == null ? void 0 : b.media) == null ? void 0 : y.gameIcon,
82
- sponsorLogo: (h = (S = (g = e.inplayGame) == null ? void 0 : g.overview) == null ? void 0 : S.media) == null ? void 0 : h.sponsorLogo,
83
- rules: (G = (C = e.inplayGame) == null ? void 0 : C.rules) == null ? void 0 : G.rules,
84
- rulesBtnLabel: (Q = (L = e.inplayGame) == null ? void 0 : L.rules) == null ? void 0 : Q.buttonLabel,
85
- rulesTitle: (E = (A = e.inplayGame) == null ? void 0 : A.rules) == null ? void 0 : E.heading,
86
- primaryColor: (x = (w = (f = e.inplayGame) == null ? void 0 : f.overview) == null ? void 0 : w.appearance) == null ? void 0 : x.primaryColor,
87
- inviteCardTitle: (F = (P = e.inplayGame) == null ? void 0 : P.inviteCard) == null ? void 0 : F.heading,
88
- inviteCardSubtext: (B = (O = e.inplayGame) == null ? void 0 : O.inviteCard) == null ? void 0 : B.subtext,
89
- inviteCardBtnLabel: (R = (D = e.inplayGame) == null ? void 0 : D.inviteCard) == null ? void 0 : R.buttonLabel
81
+ steps: (v = (d = o.inplayGame) == null ? void 0 : d.onboarding) == null ? void 0 : v.steps,
82
+ gameIcon: (y = (b = (c = o.inplayGame) == null ? void 0 : c.overview) == null ? void 0 : b.media) == null ? void 0 : y.gameIcon,
83
+ sponsorLogo: (h = (S = (g = o.inplayGame) == null ? void 0 : g.overview) == null ? void 0 : S.media) == null ? void 0 : h.sponsorLogo,
84
+ rules: (G = (C = o.inplayGame) == null ? void 0 : C.rules) == null ? void 0 : G.rules,
85
+ rulesBtnLabel: (Q = (L = o.inplayGame) == null ? void 0 : L.rules) == null ? void 0 : Q.buttonLabel,
86
+ rulesTitle: (E = (A = o.inplayGame) == null ? void 0 : A.rules) == null ? void 0 : E.heading,
87
+ primaryColor: (x = (w = (f = o.inplayGame) == null ? void 0 : f.overview) == null ? void 0 : w.appearance) == null ? void 0 : x.primaryColor,
88
+ inviteCardTitle: (F = (P = o.inplayGame) == null ? void 0 : P.inviteCard) == null ? void 0 : F.heading,
89
+ inviteCardSubtext: (B = (O = o.inplayGame) == null ? void 0 : O.inviteCard) == null ? void 0 : B.subtext,
90
+ inviteCardBtnLabel: (R = (D = o.inplayGame) == null ? void 0 : D.inviteCard) == null ? void 0 : R.buttonLabel
90
91
  }
91
92
  ) });
92
93
  const H = (i) => {
@@ -111,5 +112,5 @@ const nt = ({
111
112
  ] });
112
113
  };
113
114
  export {
114
- nt as GamificationComponent
115
+ st as GamificationComponent
115
116
  };
@@ -29,6 +29,7 @@ import "../gamification/constants.js";
29
29
  import "../gamification/question/styles.js";
30
30
  import "../icons/index.js";
31
31
  import "../gamification/vote/index.js";
32
+ import "../app/styles.js";
32
33
  import "../gamification/vote/feedback/index.js";
33
34
  import "../gamification/vote/feedback/styles.js";
34
35
  import "../gamification/vote/styles.js";
@@ -47,7 +48,7 @@ import "../gamification/detailed-insight/index.js";
47
48
  import "../gamification/common-header/index.js";
48
49
  import "../../icon-exit-d3f9fc80.js";
49
50
  import "../gamification/detailed-insight/styles.js";
50
- const nt = ({ highlights: i, sdk: e }) => {
51
+ const st = ({ highlights: i, sdk: e }) => {
51
52
  const n = m(i.status), r = m(i.openedInsight), { slStreamId: o } = m(e.sdkStore);
52
53
  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: [
53
54
  !r && /* @__PURE__ */ t(c, { highlights: i, store: i.insights.getStore() }),
@@ -62,5 +63,5 @@ const nt = ({ highlights: i, sdk: e }) => {
62
63
  ] }) : /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t("div", { children: "Event is forbidden" }) });
63
64
  };
64
65
  export {
65
- nt as HighlightsComponent
66
+ st as HighlightsComponent
66
67
  };
@@ -4,4 +4,5 @@ export declare const Insight: React.FC<{
4
4
  openedInsight: Exclude<Highlights['openedInsight']['value'], undefined>;
5
5
  closeHighlights: () => void;
6
6
  closeInsight: () => void;
7
+ className?: string;
7
8
  }>;
@@ -1,24 +1,25 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { DetailedInsight as L } from "../../gamification/detailed-insight/index.js";
1
+ import { jsx as L } from "react/jsx-runtime";
2
+ import { DetailedInsight as c } from "../../gamification/detailed-insight/index.js";
3
3
  import "../../gamification/common-header/index.js";
4
4
  import "../../../icon-exit-d3f9fc80.js";
5
5
  import "../../gamification/common-header/styles.js";
6
6
  import "@linaria/react";
7
7
  import "../../gamification/detailed-insight/styles.js";
8
- const j = ({ openedInsight: o, closeHighlights: r, closeInsight: s }) => {
8
+ const x = ({ openedInsight: o, closeHighlights: r, closeInsight: s, className: l }) => {
9
9
  var t, a, b, n, e;
10
10
  const i = ((t = o.options) == null ? void 0 : t.options.case) === "factoid" ? {
11
11
  image: o.options.options.value.image,
12
12
  body: o.options.options.value.body,
13
13
  webLink: (a = o.options.options.value.webLink) == null ? void 0 : a.url,
14
14
  webLinkLabel: (b = o.options.options.value.webLink) == null ? void 0 : b.label
15
- } : {}, l = o.subject || ((n = o.notification) == null ? void 0 : n.title), m = i.body || ((e = o.notification) == null ? void 0 : e.body);
16
- return /* @__PURE__ */ p(
17
- L,
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
18
  {
19
+ className: l,
19
20
  image: i.image,
20
- title: l,
21
- description: m,
21
+ title: m,
22
+ description: p,
22
23
  webLink: i.webLink,
23
24
  webLinkLabel: i.webLinkLabel,
24
25
  closeInsight: s,
@@ -27,5 +28,5 @@ const j = ({ openedInsight: o, closeHighlights: r, closeInsight: s }) => {
27
28
  );
28
29
  };
29
30
  export {
30
- j as Insight
31
+ x as Insight
31
32
  };
@@ -3,4 +3,5 @@ import type { Highlights } from '@streamlayer/feature-gamification';
3
3
  export declare const Insights: React.FC<{
4
4
  highlights: Highlights;
5
5
  store: ReturnType<Exclude<Highlights['insights'], undefined>['getStore']>;
6
+ className?: string;
6
7
  }>;
@@ -1,15 +1,15 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { useStore as s } from "@nanostores/react";
3
- import { InsightList as n } from "../../gamification/insight-list/index.js";
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
4
  import "../../gamification/insight/index.js";
5
5
  import "@streamlayer/sdk-web-types";
6
6
  import "../../gamification/insight/styles.js";
7
7
  import "@linaria/react";
8
8
  import "../../gamification/insight-list/styles.js";
9
- const d = ({ highlights: r, store: o }) => {
10
- const { data: t } = s(o);
11
- return t ? /* @__PURE__ */ i(n, { insights: t, openInsight: r.openHighlight }) : /* @__PURE__ */ i("div", { children: "wait insights..." });
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
12
  };
13
13
  export {
14
- d as Insights
14
+ c as Insights
15
15
  };
@@ -2,6 +2,7 @@ import { jsx as o } from "react/jsx-runtime";
2
2
  import { styled as f } from "@linaria/react";
3
3
  import { useState as p, useCallback as n, useMemo as s } from "react";
4
4
  import { Vote as d } from "../../gamification/vote/index.js";
5
+ import "../../app/styles.js";
5
6
  import "../../gamification/vote/feedback/index.js";
6
7
  import "@streamlayer/sdk-web-types";
7
8
  import "../../icons/index.js";
@@ -41,14 +42,14 @@ const y = f.div`
41
42
  transform: translateX(0);
42
43
  }
43
44
  }
44
- `, I = ({ openedQuestion: t, closeQuestion: h, vote: a }) => {
45
- var m;
46
- const [e, c] = p(!1);
45
+ `, S = ({ openedQuestion: t, closeQuestion: h, vote: a }) => {
46
+ var c;
47
+ const [e, m] = p(!1);
47
48
  n(
48
49
  (r) => {
49
- c(r);
50
+ m(r);
50
51
  },
51
- [c]
52
+ [m]
52
53
  );
53
54
  const i = s(
54
55
  () => t == null ? void 0 : t.answers.find((r) => r.youVoted === !0),
@@ -61,7 +62,7 @@ const y = f.div`
61
62
  d,
62
63
  {
63
64
  title: t.subject,
64
- feedbackMessages: (m = t.options) == null ? void 0 : m.options.value,
65
+ feedbackMessages: (c = t.options) == null ? void 0 : c.options.value,
65
66
  questionType: t.type,
66
67
  questionId: t.id,
67
68
  questionVoted: !!i,
@@ -84,5 +85,5 @@ const y = f.div`
84
85
  ) }) }) }) : null;
85
86
  };
86
87
  export {
87
- I as Question
88
+ S as Question
88
89
  };
@@ -1,10 +1,10 @@
1
- import { UserSummary as mr } from "./UserSummary.js";
2
- import { QuestionsList as ir } from "./QuestionsList.js";
3
- import { Question as sr } from "./Question.js";
4
- import { Onboarding as xr } from "../../gamification/onboarding/index.js";
5
- import { Insights as ar } from "./Insights.js";
6
- import { Insight as gr } from "./Insight.js";
7
- import { Leaderboard as br } from "./Leaderboard.js";
1
+ import { UserSummary as pr } from "./UserSummary.js";
2
+ import { QuestionsList as er } from "./QuestionsList.js";
3
+ import { Question as fr } from "./Question.js";
4
+ import { Onboarding as nr } from "../../gamification/onboarding/index.js";
5
+ import { Insights as dr } from "./Insights.js";
6
+ import { Insight as ur } from "./Insight.js";
7
+ import { Leaderboard as hr } from "./Leaderboard.js";
8
8
  import "react/jsx-runtime";
9
9
  import "@nanostores/react";
10
10
  import "../../gamification/user-statistics/index.js";
@@ -26,6 +26,7 @@ import "../../icons/index.js";
26
26
  import "react";
27
27
  import "../../gamification/question/list/styles.js";
28
28
  import "../../gamification/vote/index.js";
29
+ import "../../app/styles.js";
29
30
  import "../../gamification/vote/feedback/index.js";
30
31
  import "../../gamification/vote/feedback/styles.js";
31
32
  import "../../gamification/vote/styles.js";
@@ -61,11 +62,11 @@ import "react-window-infinite-loader";
61
62
  import "../../gamification/leaderboard-item/index.js";
62
63
  import "../../gamification/leaderboard-item/styles.js";
63
64
  export {
64
- gr as Insight,
65
- ar as Insights,
66
- br as Leaderboard,
67
- xr as Onboarding,
68
- sr as Question,
69
- ir as QuestionsList,
70
- mr as UserSummary
65
+ ur as Insight,
66
+ dr as Insights,
67
+ hr as Leaderboard,
68
+ nr as Onboarding,
69
+ fr as Question,
70
+ er as QuestionsList,
71
+ pr as UserSummary
71
72
  };
@@ -45,6 +45,7 @@ import "../icons/index.js";
45
45
  import "../gamification/question/list/styles.js";
46
46
  import "./components/Question.js";
47
47
  import "../gamification/vote/index.js";
48
+ import "../app/styles.js";
48
49
  import "../gamification/vote/feedback/index.js";
49
50
  import "../gamification/vote/feedback/styles.js";
50
51
  import "../gamification/vote/styles.js";
@@ -169,7 +170,7 @@ const R = ({ activeFeature: o, sdk: r }) => {
169
170
  ] }),
170
171
  h
171
172
  ] });
172
- }, gr = ({ sdk: o }) => {
173
+ }, Sr = ({ sdk: o }) => {
173
174
  const r = f(o.organizationStore()), t = f(o.getUserStore()), a = f(o.getActiveFeature());
174
175
  return r.loading ? /* @__PURE__ */ e("div", { children: "authentication..." }) : r.data ? t.loading ? /* @__PURE__ */ e("div", { children: "authentication..." }) : t.data ? /* @__PURE__ */ l(T, { children: [
175
176
  /* @__PURE__ */ e(x, { notificationsStore: o.getNotificationsStore() }),
@@ -177,5 +178,5 @@ const R = ({ activeFeature: o, sdk: r }) => {
177
178
  ] }) : /* @__PURE__ */ e(H, { sdk: o }) : /* @__PURE__ */ e("div", { children: "wrong sdk key..." });
178
179
  };
179
180
  export {
180
- gr as Demo
181
+ Sr as Demo
181
182
  };
@@ -7,6 +7,7 @@ type DetailedInsightProps = {
7
7
  webLink?: string;
8
8
  closeHighlights: () => void;
9
9
  closeInsight: () => void;
10
+ className?: string;
10
11
  };
11
12
  export declare const DetailedInsight: React.FC<DetailedInsightProps>;
12
13
  export {};
@@ -1,29 +1,30 @@
1
1
  import { jsxs as I, jsx as M } from "react/jsx-runtime";
2
- import { CommonHeader as Z } from "../common-header/index.js";
3
- import { Container as g, Image as l, AdditionalContent as o, Title as n, Description as d, AdditionalBtn as r, LinkIcon as a } from "./styles.js";
2
+ import { CommonHeader as g } from "../common-header/index.js";
3
+ import { Container as l, Image as o, AdditionalContent as n, Title as d, Description as r, AdditionalBtn as a, LinkIcon as u } from "./styles.js";
4
4
  import "../../../icon-exit-d3f9fc80.js";
5
5
  import "../common-header/styles.js";
6
6
  import "@linaria/react";
7
- const u = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTciIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNyAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBjbGFzcz0ic2MtQU5kc04ga1RWV0pFIj48cGF0aCBkPSJNNi42NjY1IDMuMTY2NjlINC45OTk4NEM0LjI2MzQ2IDMuMTY2NjkgMy42NjY1IDMuNzYzNjQgMy42NjY1IDQuNTAwMDJWMTEuNUMzLjY2NjUgMTIuMjM2NCA0LjI2MzQ2IDEyLjgzMzQgNC45OTk4NCAxMi44MzM0SDExLjk5OThDMTIuNzM2MiAxMi44MzM0IDEzLjMzMzIgMTIuMjM2NCAxMy4zMzMyIDExLjVWOS44MzMzNSIgc3Ryb2tlPSIjZmZmZmZmIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48L3BhdGg+PHBhdGggZD0iTTEzLjMzMzUgNi4xNjY2OVYzLjE2NjY5SDEwLjMzMzUiIHN0cm9rZT0iI2ZmZmZmZiIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PC9wYXRoPjxwYXRoIGQ9Ik0xMy4xNjY4IDMuMzMzMzFMOC4zMzM1IDguMTY2NjUiIHN0cm9rZT0iI2ZmZmZmZiIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PC9wYXRoPjwvc3ZnPgo=", C = ({
7
+ const b = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTciIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNyAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBjbGFzcz0ic2MtQU5kc04ga1RWV0pFIj48cGF0aCBkPSJNNi42NjY1IDMuMTY2NjlINC45OTk4NEM0LjI2MzQ2IDMuMTY2NjkgMy42NjY1IDMuNzYzNjQgMy42NjY1IDQuNTAwMDJWMTEuNUMzLjY2NjUgMTIuMjM2NCA0LjI2MzQ2IDEyLjgzMzQgNC45OTk4NCAxMi44MzM0SDExLjk5OThDMTIuNzM2MiAxMi44MzM0IDEzLjMzMzIgMTIuMjM2NCAxMy4zMzMyIDExLjVWOS44MzMzNSIgc3Ryb2tlPSIjZmZmZmZmIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48L3BhdGg+PHBhdGggZD0iTTEzLjMzMzUgNi4xNjY2OVYzLjE2NjY5SDEwLjMzMzUiIHN0cm9rZT0iI2ZmZmZmZiIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PC9wYXRoPjxwYXRoIGQ9Ik0xMy4xNjY4IDMuMzMzMzFMOC4zMzM1IDguMTY2NjUiIHN0cm9rZT0iI2ZmZmZmZiIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PC9wYXRoPjwvc3ZnPgo=", L = ({
8
8
  image: i,
9
9
  title: j,
10
10
  description: m,
11
11
  webLinkLabel: z,
12
12
  webLink: c,
13
13
  closeHighlights: t,
14
- closeInsight: N
15
- }) => /* @__PURE__ */ I(g, { children: [
16
- /* @__PURE__ */ M(Z, { close: t, comeBack: N }),
17
- i && /* @__PURE__ */ M(l, { alt: "detail-insight-image", src: i }),
18
- /* @__PURE__ */ I(o, { children: [
19
- j && /* @__PURE__ */ M(n, { children: j }),
20
- m && /* @__PURE__ */ M(d, { children: m })
14
+ closeInsight: N,
15
+ className: Z
16
+ }) => /* @__PURE__ */ I(l, { className: Z, children: [
17
+ /* @__PURE__ */ M(g, { close: t, comeBack: N }),
18
+ i && /* @__PURE__ */ M(o, { alt: "detail-insight-image", src: i }),
19
+ /* @__PURE__ */ I(n, { children: [
20
+ j && /* @__PURE__ */ M(d, { children: j }),
21
+ m && /* @__PURE__ */ M(r, { children: m })
21
22
  ] }),
22
- c && z && /* @__PURE__ */ I(r, { href: c, target: "_blank", children: [
23
+ c && z && /* @__PURE__ */ I(a, { href: c, target: "_blank", children: [
23
24
  z,
24
- /* @__PURE__ */ M(a, { alt: "link-icon", src: u })
25
+ /* @__PURE__ */ M(u, { alt: "link-icon", src: b })
25
26
  ] })
26
27
  ] });
27
28
  export {
28
- C as DetailedInsight
29
+ L as DetailedInsight
29
30
  };
@@ -8,6 +8,7 @@ interface InsightListProps {
8
8
  title: string;
9
9
  }>;
10
10
  openInsight: (insightId: string) => void;
11
+ className?: string;
11
12
  }
12
13
  export declare const InsightList: React.FC<InsightListProps>;
13
14
  export {};
@@ -1,10 +1,10 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { Insight as e } from "../insight/index.js";
3
- import { Container as n, ItemsContainer as i } from "./styles.js";
2
+ import { Insight as n } from "../insight/index.js";
3
+ import { Container as i, ItemsContainer as p } from "./styles.js";
4
4
  import "@streamlayer/sdk-web-types";
5
5
  import "../insight/styles.js";
6
6
  import "@linaria/react";
7
- const l = ({ insights: r, openInsight: m }) => /* @__PURE__ */ o(n, { children: /* @__PURE__ */ o(i, { children: r == null ? void 0 : r.map((t) => /* @__PURE__ */ o(e, { openInsight: m, ...t }, t.questionId)) }) });
7
+ const u = ({ insights: r, openInsight: m, className: e }) => /* @__PURE__ */ o(i, { className: e, children: /* @__PURE__ */ o(p, { children: r == null ? void 0 : r.map((t) => /* @__PURE__ */ o(n, { openInsight: m, ...t }, t.questionId)) }) });
8
8
  export {
9
- l as InsightList
9
+ u as InsightList
10
10
  };
@@ -1,18 +1,20 @@
1
1
  import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
- import { formatDecimals as r } from "../../../utils/common.js";
3
- import { PointsContainer as n, PointsIcon as m, PointsSvg as s, PointsBody as e, PointsTitle as p, PointsValue as c } from "./styles.js";
2
+ import { resetCss as r } from "../../theme/theme.js";
3
+ import { formatDecimals as n } from "../../../utils/common.js";
4
+ import { PointsContainer as m, PointsIcon as s, PointsSvg as e, PointsBody as p, PointsTitle as c, PointsValue as l } from "./styles.js";
5
+ import "@linaria/core";
6
+ import "../../theme/constants.js";
4
7
  import "@linaria/react";
5
8
  import "../../icons/index.js";
6
9
  import "react";
7
10
  import "../../theme/breakpoints.js";
8
- import "../../theme/constants.js";
9
- const u = ({ points: t }) => /* @__PURE__ */ i(n, { children: [
10
- /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(s, { name: "icon-trophy" }) }),
11
- /* @__PURE__ */ i(e, { children: [
12
- /* @__PURE__ */ o(p, { children: "Total points" }),
13
- /* @__PURE__ */ o(c, { children: r(t) })
11
+ const T = ({ points: t }) => /* @__PURE__ */ i(m, { className: r, children: [
12
+ /* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(e, { name: "icon-trophy" }) }),
13
+ /* @__PURE__ */ i(p, { children: [
14
+ /* @__PURE__ */ o(c, { children: "Total points" }),
15
+ /* @__PURE__ */ o(l, { children: n(t) })
14
16
  ] })
15
17
  ] });
16
18
  export {
17
- u as Points
19
+ T as Points
18
20
  };
@@ -1,71 +1,71 @@
1
- import { jsx as s, jsxs as A } from "react/jsx-runtime";
2
- import { useState as e, useCallback as C, useMemo as l } from "react";
1
+ import { jsx as i, jsxs as g } from "react/jsx-runtime";
2
+ import { useState as e, useCallback as A, useMemo as l } from "react";
3
+ import { SDKScrollContainer as S } from "../../app/styles.js";
3
4
  import { Feedback as b } from "./feedback/index.js";
4
- import { Container as E, Content as M, Title as j, Options as k } from "./styles.js";
5
+ import { Container as E, Content as j, Title as k, Options as u } from "./styles.js";
5
6
  import { VotingOption as O } from "./vote-option/index.js";
6
7
  import { WinBar as I } from "./win-bar/index.js";
8
+ import "@linaria/react";
7
9
  import "@streamlayer/sdk-web-types";
8
10
  import "../../icons/index.js";
9
- import "@linaria/react";
10
11
  import "./feedback/styles.js";
11
12
  import "./vote-option/styles.js";
12
13
  import "../../timer/index.js";
13
14
  import "react-countdown-circle-timer";
14
15
  import "../../theme/constants.js";
15
16
  import "./win-bar/styles.js";
16
- const X = ({ openedQuestion: r, vote: f }) => {
17
- var V;
18
- const d = r.subject, q = r.type, a = (V = r.options) == null ? void 0 : V.options, [n, v] = e(!1), [w, T] = e(!1), [y, g] = e(""), m = r == null ? void 0 : r.id, p = C(
17
+ const Y = ({ openedQuestion: r, vote: n }) => {
18
+ var d;
19
+ const x = r.subject, V = r.type, a = (d = r.options) == null ? void 0 : d.options, [c, v] = e(!1), [f, w] = e(!1), [T, p] = e(""), o = r == null ? void 0 : r.id, q = A(
19
20
  async (t) => {
20
- if (m) {
21
- const c = t.currentTarget.value;
22
- g(c), T(!0), await f(m, c), T(!1);
21
+ if (o) {
22
+ const h = t.currentTarget.value;
23
+ p(h), w(!0), await n(o, h), w(!1);
23
24
  }
24
25
  },
25
- [m, g, f]
26
- ), i = l(
26
+ [o, p, n]
27
+ ), s = l(
27
28
  () => r == null ? void 0 : r.answers.find((t) => t.youVoted === !0),
28
29
  [r]
29
- ), o = l(
30
+ ), m = l(
30
31
  () => !!(r != null && r.answers.find((t) => t.correct === !0)),
31
32
  [r]
32
- ), h = l(() => r ? r.answers.map((t) => {
33
- var c;
34
- return {
35
- ...t,
36
- questionVoted: !!i,
37
- youSelected: y === t.id,
38
- isLoading: w,
39
- hasCorrectAnswer: o,
40
- questionType: r.type,
41
- imageMode: (c = r.notification) == null ? void 0 : c.imageMode,
42
- onVote: p
43
- };
44
- }) : [], [o, w, r, i, p, y]), x = a && (a.case === "trivia" || a.case === "prediction") ? a.value : void 0;
45
- return /* @__PURE__ */ s(E, { children: /* @__PURE__ */ A(M, { children: [
46
- x && /* @__PURE__ */ s(
33
+ ), C = l(() => r ? r.answers.map((t) => ({
34
+ ...t,
35
+ questionVoted: !!s,
36
+ youSelected: T === t.id,
37
+ isLoading: f,
38
+ hasCorrectAnswer: m,
39
+ questionType: r.type,
40
+ answerTimeExpired: c,
41
+ questionStatus: r.status,
42
+ // ToDo: Figure out why imageMode is not in the response
43
+ onVote: q
44
+ })) : [], [m, c, f, r, s, q, T]), y = a && (a.case === "trivia" || a.case === "prediction") ? a.value : void 0;
45
+ return /* @__PURE__ */ i(S, { "data-question-header": "true", children: /* @__PURE__ */ i(E, { children: /* @__PURE__ */ g(j, { children: [
46
+ y && /* @__PURE__ */ i(
47
47
  b,
48
48
  {
49
- feedbackMessages: x,
50
- questionVoted: !!i,
51
- questionVotedCorrectly: i == null ? void 0 : i.correct,
52
- questionType: q,
53
- hasCorrectAnswer: o
49
+ feedbackMessages: y,
50
+ questionVoted: !!s,
51
+ questionVotedCorrectly: s == null ? void 0 : s.correct,
52
+ questionType: V,
53
+ hasCorrectAnswer: m
54
54
  }
55
55
  ),
56
- /* @__PURE__ */ s(
56
+ /* @__PURE__ */ i(
57
57
  I,
58
58
  {
59
- title: n ? "Expired" : "To win",
60
- points: n ? void 0 : 100,
59
+ title: c ? "Expired" : "To win",
60
+ points: c ? void 0 : 100,
61
61
  onTimerExpired: () => v(!0),
62
62
  isTimer: !0
63
63
  }
64
64
  ),
65
- /* @__PURE__ */ s(j, { children: d }),
66
- /* @__PURE__ */ s(k, { children: h.map((t) => /* @__PURE__ */ s(O, { ...t }, t.id)) })
67
- ] }) });
65
+ /* @__PURE__ */ i(k, { children: x }),
66
+ /* @__PURE__ */ i(u, { children: C.map((t) => /* @__PURE__ */ i(O, { ...t }, t.id)) })
67
+ ] }) }) });
68
68
  };
69
69
  export {
70
- X as Vote
70
+ Y as Vote
71
71
  };
@@ -8,15 +8,15 @@ const o = t.div`
8
8
  }
9
9
  `, n = t.div`
10
10
  width: 100%;
11
- padding: 0px 16px;
12
- `, r = t.div`
11
+ padding: 16px 16px 0px 16px;
12
+ `, p = t.div`
13
13
  font-family: var(--font-serif);
14
14
  font-size: 16px;
15
15
  color: var(--color-primary-green2);
16
16
  font-weight: 400;
17
17
  margin: 16px 0px;
18
18
  margin-bottom: 16px;
19
- `, e = t.div`
19
+ `, r = t.div`
20
20
  position: relative;
21
21
  gap: 8px;
22
22
  display: flex;
@@ -25,6 +25,6 @@ const o = t.div`
25
25
  export {
26
26
  o as Container,
27
27
  n as Content,
28
- e as Options,
29
- r as Title
28
+ r as Options,
29
+ p as Title
30
30
  };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { QuestionType, QuestionImages, ExtendedQuestionAnswer } from '@streamlayer/sdk-web-types';
2
+ import { QuestionType, QuestionImages, QuestionStatus, ExtendedQuestionAnswer } from '@streamlayer/sdk-web-types';
3
3
  export type VotingOptionProps = ExtendedQuestionAnswer & {
4
4
  questionVoted: boolean;
5
5
  youSelected: boolean;
@@ -7,6 +7,8 @@ export type VotingOptionProps = ExtendedQuestionAnswer & {
7
7
  hasCorrectAnswer?: boolean;
8
8
  questionType: QuestionType;
9
9
  imageMode?: QuestionImages;
10
+ answerTimeExpired: boolean;
11
+ questionStatus: QuestionStatus;
10
12
  onVote: (e: React.MouseEvent<HTMLButtonElement>) => void;
11
13
  };
12
14
  export declare const VotingOption: React.FC<VotingOptionProps>;