@streamlayer/react-ui 0.52.2 → 0.53.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.js CHANGED
@@ -43,6 +43,8 @@ import "./ui/button/styles.js";
43
43
  import "./ui/gamification/constants.js";
44
44
  import "./ui/gamification/question/styles.js";
45
45
  import "./ui/icons/index.js";
46
+ import "./ui/gamification/insight/index.js";
47
+ import "./ui/gamification/insight/styles.js";
46
48
  import "./ui/gamification/question/list/styles.js";
47
49
  import "./utils/common.js";
48
50
  import "./ui/gamification/user-statistics/components/rank/index.js";
@@ -74,7 +76,6 @@ import "./ui/demo/Gamification.js";
74
76
  import "./ui/demo/components/UserSummary.js";
75
77
  import "./ui/demo/components/QuestionsList.js";
76
78
  import "./ui/demo/components/Question.js";
77
- import "./ui/gamification/insight/styles.js";
78
79
  import "./ui/gamification/insight-list/styles.js";
79
80
  import "./ui/gamification/detailed-insight/styles.js";
80
81
  import "./ui/demo/components/Leaderboard.js";
@@ -88,7 +89,6 @@ import "./ui/demo/styles.js";
88
89
  import "./ui/demo/Highlights.js";
89
90
  import "./ui/demo/components/Insights.js";
90
91
  import "./ui/gamification/insight-list/index.js";
91
- import "./ui/gamification/insight/index.js";
92
92
  import "./ui/demo/components/Insight.js";
93
93
  import "./ui/gamification/detailed-insight/index.js";
94
94
  import "./ui/demo/Login.js";
@@ -1,7 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { GamificationBackground } from '@streamlayer/feature-gamification';
2
+ import { Gamification } from '@streamlayer/feature-gamification';
3
3
  export declare const Question: React.FC<{
4
- openedQuestion: Awaited<ReturnType<GamificationBackground['openedQuestion']['getValue']>>;
5
- closeQuestion: () => void;
6
- vote: (questionId: string, answerId: string) => void;
4
+ gamification: Gamification;
7
5
  }>;
@@ -1,9 +1,10 @@
1
- import { jsxs as p, jsx as t } from "react/jsx-runtime";
2
- import { styled as l } from "@linaria/react";
3
- import { QuestionType as c } from "@streamlayer/sdk-web-types";
4
- import { VoteHeader as f } from "../../../gamification/detail/header/index.js";
5
- import { Sponsor as s } from "../../../gamification/detail/sponsor/index.js";
1
+ import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
+ import { styled as p } from "@linaria/react";
3
+ import { useStore as n } from "@nanostores/react";
4
+ import { QuestionType as u } from "@streamlayer/sdk-web-types";
5
+ import { VoteHeader as l } from "../../../gamification/detail/header/index.js";
6
6
  import { Vote as a } from "../../../gamification/vote/index.js";
7
+ import { InsightDetails as c } from "../../../gamification/vote/insight-details/index.js";
7
8
  import "../../../gamification/constants.js";
8
9
  import "../../../gamification/detail/header/styles.js";
9
10
  import "../../../icons/index.js";
@@ -19,7 +20,10 @@ import "../../../timer/index.js";
19
20
  import "react-countdown-circle-timer";
20
21
  import "../../../theme/constants.js";
21
22
  import "../../../gamification/vote/win-bar/styles.js";
22
- const x = l.div`
23
+ import "../../../video-player/index.js";
24
+ import "../../../video-player/styles.js";
25
+ import "../../../gamification/vote/insight-details/styles.js";
26
+ const d = p.div`
23
27
  background: var(--color-transparent-item);
24
28
  width: 100%;
25
29
  height: 100%;
@@ -28,14 +32,24 @@ const x = l.div`
28
32
  align-items: center;
29
33
  justify-content: flex-start;
30
34
  flex-direction: column;
31
- `, D = ({ openedQuestion: r, closeQuestion: m, vote: i }) => {
32
- var o;
33
- return /* @__PURE__ */ p(x, { children: [
34
- /* @__PURE__ */ t(f, { close: m, type: (r == null ? void 0 : r.type) || c.UNSET }),
35
- r && /* @__PURE__ */ t(a, { vote: i, openedQuestion: r }),
36
- /* @__PURE__ */ t(s, { sponsorLogo: (o = r == null ? void 0 : r.sponsorship) == null ? void 0 : o.logo })
35
+ `, f = ({ openedQuestion: t }) => {
36
+ var r;
37
+ return ((r = t == null ? void 0 : t.attributes) == null ? void 0 : r.attributes.case) === "insight" ? /* @__PURE__ */ e(c, { ...t.attributes.attributes.value }) : null;
38
+ }, h = ({ extendedQuestion: t, vote: r }) => {
39
+ const { loading: i, data: o } = t;
40
+ return !i && o ? /* @__PURE__ */ e(a, { vote: r, openedQuestion: o }) : null;
41
+ }, F = ({ gamification: t }) => {
42
+ var s;
43
+ const r = n(t.openedQuestion.$store), i = n(t.openedQuestion.$extendedStore);
44
+ if (!r)
45
+ return null;
46
+ const o = r.type;
47
+ return /* @__PURE__ */ m(d, { children: [
48
+ /* @__PURE__ */ e(l, { close: t.closeQuestion, type: ((s = r.attributes) == null ? void 0 : s.type) || u.UNSET }),
49
+ o === "question" && /* @__PURE__ */ e(h, { vote: t.submitAnswer, extendedQuestion: i }),
50
+ o !== "question" && /* @__PURE__ */ e(f, { openedQuestion: r })
37
51
  ] });
38
52
  };
39
53
  export {
40
- D as Question
54
+ F as Question
41
55
  };
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { Gamification } from '@streamlayer/feature-gamification';
3
3
  export declare const QuestionsList: React.FC<{
4
- store: ReturnType<Exclude<Gamification['questions'], undefined>['getStore']>;
4
+ store: ReturnType<Exclude<Gamification['feedList'], undefined>['getStore']>;
5
5
  openQuestion: (questionId: string) => void;
6
6
  }>;
@@ -1,20 +1,22 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { useStore as m } from "@nanostores/react";
3
3
  import { QuestionList as p } from "../../../gamification/question/list/index.js";
4
- import "../../../gamification/question/index.js";
4
+ import "../../../gamification/insight/index.js";
5
5
  import "@streamlayer/sdk-web-types";
6
+ import "../../../gamification/insight/styles.js";
7
+ import "@linaria/react";
8
+ import "../../../gamification/question/index.js";
6
9
  import "../../../button/index.js";
7
10
  import "../../../button/styles.js";
8
- import "@linaria/react";
9
11
  import "../../../gamification/constants.js";
10
12
  import "../../../gamification/question/styles.js";
11
13
  import "../../../icons/index.js";
12
14
  import "react";
13
15
  import "../../../gamification/question/list/styles.js";
14
- const l = ({ store: r, openQuestion: i }) => {
16
+ const w = ({ store: r, openQuestion: i }) => {
15
17
  const t = m(r);
16
18
  return t != null && t.data ? /* @__PURE__ */ o(p, { openQuestion: i, questions: t.data }) : /* @__PURE__ */ o("div", { children: "wait questions..." });
17
19
  };
18
20
  export {
19
- l as QuestionsList
21
+ w as QuestionsList
20
22
  };
@@ -1,10 +1,10 @@
1
- import { jsxs as m, Fragment as s, jsx as r } from "react/jsx-runtime";
2
- import { useState as n } from "react";
3
- import { SDKWhiteContainer as a, SDKContentContainer as e } from "../../styles.js";
4
- import { ActivePages as i, Tabs as d } from "../../../gamification/tabs/index.js";
5
- import { Leaderboard as u } from "./Leaderboard.js";
1
+ import { jsxs as e, jsx as t } from "react/jsx-runtime";
2
+ import { useState as s } from "react";
3
+ import { SDKWhiteContainer as n, SDKContentContainer as m } from "../../styles.js";
4
+ import { ActivePages as i, Tabs as a } from "../../../gamification/tabs/index.js";
5
+ import { Leaderboard as d } from "./Leaderboard.js";
6
6
  import { QuestionsList as l } from "./QuestionsList.js";
7
- import { UserSummary as c } from "./UserSummary.js";
7
+ import { UserSummary as u } from "./UserSummary.js";
8
8
  import "@linaria/react";
9
9
  import "../../../gamification/tabs/styles.js";
10
10
  import "@nanostores/react";
@@ -22,8 +22,10 @@ import "../../../../utils/common.js";
22
22
  import "../../../gamification/leaderboard-item/styles.js";
23
23
  import "../../../icons/index.js";
24
24
  import "../../../gamification/question/list/index.js";
25
- import "../../../gamification/question/index.js";
25
+ import "../../../gamification/insight/index.js";
26
26
  import "@streamlayer/sdk-web-types";
27
+ import "../../../gamification/insight/styles.js";
28
+ import "../../../gamification/question/index.js";
27
29
  import "../../../button/index.js";
28
30
  import "../../../button/styles.js";
29
31
  import "../../../gamification/constants.js";
@@ -35,17 +37,17 @@ import "../../../gamification/user-statistics/components/rank/styles.js";
35
37
  import "../../../gamification/user-statistics/components/statistic/index.js";
36
38
  import "../../../gamification/user-statistics/components/statistic/styles.js";
37
39
  import "../../../gamification/user-statistics/styles.js";
38
- const Y = ({ gamification: t }) => {
39
- const [o, p] = n(i.HOME);
40
- return /* @__PURE__ */ m(s, { children: [
41
- /* @__PURE__ */ m(a, { children: [
42
- /* @__PURE__ */ r(d, { activePage: o, toggleActivePage: p }),
43
- o === i.HOME && /* @__PURE__ */ r(c, { store: t.userSummary.getStore() })
40
+ const Z = ({ gamification: r }) => {
41
+ const [o, p] = s(i.HOME);
42
+ return /* @__PURE__ */ e("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
43
+ /* @__PURE__ */ e(n, { children: [
44
+ /* @__PURE__ */ t(a, { activePage: o, toggleActivePage: p }),
45
+ o === i.HOME && /* @__PURE__ */ t(u, { store: r.userSummary.getStore() })
44
46
  ] }),
45
- o === i.HOME && /* @__PURE__ */ r(e, { children: /* @__PURE__ */ r(l, { openQuestion: t.openQuestion, store: t.questions.getStore() }) }),
46
- o === i.LEADERBOARD && /* @__PURE__ */ r(e, { style: { flex: "1 1 auto" }, children: /* @__PURE__ */ r(u, { leaderboardList: t.leaderboardList }) })
47
+ o === i.HOME && /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(l, { openQuestion: r.openQuestion, store: r.feedList.getStore() }) }),
48
+ o === i.LEADERBOARD && /* @__PURE__ */ t(m, { style: { flex: "1 1 auto", paddingTop: 0, paddingBottom: 0 }, children: /* @__PURE__ */ t(d, { leaderboardList: r.leaderboardList }) })
47
49
  ] });
48
50
  };
49
51
  export {
50
- Y as Tabs
52
+ Z as Tabs
51
53
  };
@@ -1,17 +1,16 @@
1
- import { jsxs as p, Fragment as e, jsx as r } from "react/jsx-runtime";
2
- import { styled as n } from "@linaria/react";
3
- import { useStore as s } from "@nanostores/react";
4
- import { SDKScrollContainer as d } from "../../styles.js";
5
- import { ShowIn as u } from "../../../show-in/index.js";
6
- import { Question as l } from "./Question.js";
7
- import { Tabs as a } from "./Tabs.js";
1
+ import { jsxs as m, Fragment as p, jsx as o } from "react/jsx-runtime";
2
+ import { styled as e } from "@linaria/react";
3
+ import { useStore as n } from "@nanostores/react";
4
+ import { SDKScrollContainer as s } from "../../styles.js";
5
+ import { ShowIn as d } from "../../../show-in/index.js";
6
+ import { Question as a } from "./Question.js";
7
+ import { Tabs as u } from "./Tabs.js";
8
8
  import "@streamlayer/sdk-web-types";
9
9
  import "../../../gamification/detail/header/index.js";
10
10
  import "../../../gamification/constants.js";
11
11
  import "../../../gamification/detail/header/styles.js";
12
12
  import "../../../icons/index.js";
13
13
  import "react";
14
- import "../../../gamification/detail/sponsor/index.js";
15
14
  import "../../../gamification/vote/index.js";
16
15
  import "../../../gamification/vote/feedback/index.js";
17
16
  import "../../../gamification/vote/feedback/styles.js";
@@ -23,6 +22,10 @@ import "../../../timer/index.js";
23
22
  import "react-countdown-circle-timer";
24
23
  import "../../../theme/constants.js";
25
24
  import "../../../gamification/vote/win-bar/styles.js";
25
+ import "../../../gamification/vote/insight-details/index.js";
26
+ import "../../../video-player/index.js";
27
+ import "../../../video-player/styles.js";
28
+ import "../../../gamification/vote/insight-details/styles.js";
26
29
  import "../../../gamification/tabs/index.js";
27
30
  import "../../../gamification/tabs/styles.js";
28
31
  import "./Leaderboard.js";
@@ -40,6 +43,8 @@ import "../../../../utils/common.js";
40
43
  import "../../../gamification/leaderboard-item/styles.js";
41
44
  import "./QuestionsList.js";
42
45
  import "../../../gamification/question/list/index.js";
46
+ import "../../../gamification/insight/index.js";
47
+ import "../../../gamification/insight/styles.js";
43
48
  import "../../../gamification/question/index.js";
44
49
  import "../../../button/index.js";
45
50
  import "../../../button/styles.js";
@@ -52,26 +57,19 @@ import "../../../gamification/user-statistics/components/rank/styles.js";
52
57
  import "../../../gamification/user-statistics/components/statistic/index.js";
53
58
  import "../../../gamification/user-statistics/components/statistic/styles.js";
54
59
  import "../../../gamification/user-statistics/styles.js";
55
- const c = n(u)`
60
+ const l = e(d)`
56
61
  position: absolute;
57
62
  inset: 0;
58
63
  top: var(--header-height);
59
64
  background: var(--color-neutrals-white);
60
65
  z-index: 3;
61
- `, Qo = ({ gamification: o, className: t }) => {
62
- const { loading: m, data: i } = s(o.openedQuestion);
63
- return /* @__PURE__ */ p(e, { children: [
64
- (m || i) && /* @__PURE__ */ r(c, { className: t, children: /* @__PURE__ */ r(
65
- l,
66
- {
67
- closeQuestion: o.closeQuestion,
68
- vote: o.submitAnswer,
69
- openedQuestion: i
70
- }
71
- ) }),
72
- /* @__PURE__ */ r(d, { className: t, "data-nav": "true", children: /* @__PURE__ */ r(a, { gamification: o }) })
66
+ `, So = ({ gamification: r, className: t }) => {
67
+ const i = n(r.openedQuestion.$store);
68
+ return /* @__PURE__ */ m(p, { children: [
69
+ i && /* @__PURE__ */ o(l, { className: t, children: /* @__PURE__ */ o(a, { gamification: r }) }),
70
+ /* @__PURE__ */ o(s, { className: t, "data-nav": "true", children: /* @__PURE__ */ o(u, { gamification: r }) })
73
71
  ] });
74
72
  };
75
73
  export {
76
- Qo as GamificationOverlay
74
+ So as GamificationOverlay
77
75
  };
@@ -1,9 +1,8 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { useMemo as e } from "react";
3
- import { FeatureType as m } from "@streamlayer/sdk-web-types";
4
- import { FeatureProvider as p } from "./FeatureProvider.js";
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { useMemo as m } from "react";
3
+ import { FeatureType as p } from "@streamlayer/sdk-web-types";
4
+ import { FeatureProvider as e } from "./FeatureProvider.js";
5
5
  import { GamificationOverlay as n } from "./Gamification/index.js";
6
- import { HighlightsOverlay as g } from "./Highlights/index.js";
7
6
  import "@nanostores/react";
8
7
  import "@streamlayer/sdk-web-interfaces";
9
8
  import "@linaria/react";
@@ -14,7 +13,6 @@ import "../../gamification/detail/header/index.js";
14
13
  import "../../gamification/constants.js";
15
14
  import "../../gamification/detail/header/styles.js";
16
15
  import "../../icons/index.js";
17
- import "../../gamification/detail/sponsor/index.js";
18
16
  import "../../gamification/vote/index.js";
19
17
  import "../../gamification/vote/feedback/index.js";
20
18
  import "../../gamification/vote/feedback/styles.js";
@@ -26,6 +24,10 @@ import "../../timer/index.js";
26
24
  import "react-countdown-circle-timer";
27
25
  import "../../theme/constants.js";
28
26
  import "../../gamification/vote/win-bar/styles.js";
27
+ import "../../gamification/vote/insight-details/index.js";
28
+ import "../../video-player/index.js";
29
+ import "../../video-player/styles.js";
30
+ import "../../gamification/vote/insight-details/styles.js";
29
31
  import "./Gamification/Tabs.js";
30
32
  import "../../gamification/tabs/index.js";
31
33
  import "../../gamification/tabs/styles.js";
@@ -44,6 +46,8 @@ import "../../../utils/common.js";
44
46
  import "../../gamification/leaderboard-item/styles.js";
45
47
  import "./Gamification/QuestionsList.js";
46
48
  import "../../gamification/question/list/index.js";
49
+ import "../../gamification/insight/index.js";
50
+ import "../../gamification/insight/styles.js";
47
51
  import "../../gamification/question/index.js";
48
52
  import "../../button/index.js";
49
53
  import "../../button/styles.js";
@@ -56,19 +60,11 @@ import "../../gamification/user-statistics/components/rank/styles.js";
56
60
  import "../../gamification/user-statistics/components/statistic/index.js";
57
61
  import "../../gamification/user-statistics/components/statistic/styles.js";
58
62
  import "../../gamification/user-statistics/styles.js";
59
- import "../../demo/components/Insight.js";
60
- import "../../gamification/detailed-insight/index.js";
61
- import "../../gamification/detailed-insight/styles.js";
62
- import "../../demo/components/Insights.js";
63
- import "../../gamification/insight-list/index.js";
64
- import "../../gamification/insight/index.js";
65
- import "../../gamification/insight/styles.js";
66
- import "../../gamification/insight-list/styles.js";
67
- const Ir = ({
68
- sdk: i,
63
+ const xr = ({
64
+ sdk: t,
69
65
  feature: r,
70
- className: t
71
- }) => e(() => r ? r.featureConfig.get().type === m.GAMES ? /* @__PURE__ */ o(p, { className: t, sdk: i, feature: r, children: /* @__PURE__ */ o(n, { className: t, gamification: r, sdk: i }) }) : r.featureConfig.get().type === m.HIGHLIGHTS ? /* @__PURE__ */ o(p, { className: t, sdk: i, feature: r, children: /* @__PURE__ */ o(g, { className: t, highlights: r, sdk: i }) }) : null : null, [i, r]);
66
+ className: o
67
+ }) => m(() => r && r.featureConfig.get().type === p.GAMES ? /* @__PURE__ */ i(e, { className: o, sdk: t, feature: r, children: /* @__PURE__ */ i(n, { className: o, gamification: r, sdk: t }) }) : null, [t, r, o]);
72
68
  export {
73
- Ir as ActiveFeature
69
+ xr as ActiveFeature
74
70
  };
@@ -23,7 +23,6 @@ import "../gamification/detail/header/index.js";
23
23
  import "../gamification/constants.js";
24
24
  import "../gamification/detail/header/styles.js";
25
25
  import "../icons/index.js";
26
- import "../gamification/detail/sponsor/index.js";
27
26
  import "../gamification/vote/index.js";
28
27
  import "../gamification/vote/feedback/index.js";
29
28
  import "../gamification/vote/feedback/styles.js";
@@ -34,6 +33,10 @@ import "../gamification/vote/win-bar/index.js";
34
33
  import "../timer/index.js";
35
34
  import "react-countdown-circle-timer";
36
35
  import "../gamification/vote/win-bar/styles.js";
36
+ import "../gamification/vote/insight-details/index.js";
37
+ import "../video-player/index.js";
38
+ import "../video-player/styles.js";
39
+ import "../gamification/vote/insight-details/styles.js";
37
40
  import "./Features/Gamification/Tabs.js";
38
41
  import "../gamification/tabs/index.js";
39
42
  import "../gamification/tabs/styles.js";
@@ -52,6 +55,8 @@ import "../../utils/common.js";
52
55
  import "../gamification/leaderboard-item/styles.js";
53
56
  import "./Features/Gamification/QuestionsList.js";
54
57
  import "../gamification/question/list/index.js";
58
+ import "../gamification/insight/index.js";
59
+ import "../gamification/insight/styles.js";
55
60
  import "../gamification/question/index.js";
56
61
  import "../button/index.js";
57
62
  import "../button/styles.js";
@@ -64,15 +69,6 @@ import "../gamification/user-statistics/components/rank/styles.js";
64
69
  import "../gamification/user-statistics/components/statistic/index.js";
65
70
  import "../gamification/user-statistics/components/statistic/styles.js";
66
71
  import "../gamification/user-statistics/styles.js";
67
- import "./Features/Highlights/index.js";
68
- import "../demo/components/Insight.js";
69
- import "../gamification/detailed-insight/index.js";
70
- import "../gamification/detailed-insight/styles.js";
71
- import "../demo/components/Insights.js";
72
- import "../gamification/insight-list/index.js";
73
- import "../gamification/insight/index.js";
74
- import "../gamification/insight/styles.js";
75
- import "../gamification/insight-list/styles.js";
76
72
  import "../navigation/masters.js";
77
73
  import "../navigation/index.js";
78
74
  import "../navigation/button/index.js";
@@ -80,7 +76,7 @@ import "../navigation/button/styles.js";
80
76
  const C = ({ sdk: r, className: m }) => {
81
77
  const [, p] = b(r);
82
78
  return /* @__PURE__ */ i(v, { className: m, feature: p, sdk: r });
83
- }, Wt = ({ sdk: r, overlays: m, children: p }) => {
79
+ }, Qt = ({ sdk: r, overlays: m, children: p }) => {
84
80
  const { sdkEnabled: o, sdkReady: s, activeOverlay: t, activateAndLoadOverlay: d, enableSdk: l, disableSdk: c } = k(r);
85
81
  return /* @__PURE__ */ f(y, { children: [
86
82
  o && /* @__PURE__ */ i(
@@ -112,5 +108,5 @@ const C = ({ sdk: r, className: m }) => {
112
108
  ] });
113
109
  };
114
110
  export {
115
- Wt as MastersApp
111
+ Qt as MastersApp
116
112
  };
@@ -24,6 +24,7 @@ import "../gamification/user-statistics/components/statistic/index.js";
24
24
  import "../gamification/user-statistics/components/statistic/styles.js";
25
25
  import "../gamification/user-statistics/styles.js";
26
26
  import "../gamification/question/list/index.js";
27
+ import "../gamification/insight/index.js";
27
28
  import "../gamification/question/index.js";
28
29
  import "../button/index.js";
29
30
  import "../button/styles.js";
@@ -60,7 +61,7 @@ import "react-window";
60
61
  import "react-window-infinite-loader";
61
62
  import "../gamification/leaderboard-item/index.js";
62
63
  import "../gamification/leaderboard-item/styles.js";
63
- const st = ({
64
+ const at = ({
64
65
  gamification: r,
65
66
  sdk: u
66
67
  }) => {
@@ -112,5 +113,5 @@ const st = ({
112
113
  ] });
113
114
  };
114
115
  export {
115
- st as GamificationComponent
116
+ at as GamificationComponent
116
117
  };
@@ -5,6 +5,8 @@ import { DemoContainer as p } from "./styles.js";
5
5
  import "../gamification/user-statistics/components/rank/styles.js";
6
6
  import "../gamification/user-statistics/components/statistic/styles.js";
7
7
  import "../gamification/user-statistics/styles.js";
8
+ import "@streamlayer/sdk-web-types";
9
+ import "../gamification/insight/styles.js";
8
10
  import "../gamification/question/index.js";
9
11
  import "../gamification/question/list/styles.js";
10
12
  import "./components/Question.js";
@@ -22,7 +24,6 @@ import "react-window";
22
24
  import "react-window-infinite-loader";
23
25
  import "../gamification/leaderboard-item/styles.js";
24
26
  import "@linaria/react";
25
- import "@streamlayer/sdk-web-types";
26
27
  import "../button/index.js";
27
28
  import "../button/styles.js";
28
29
  import "../gamification/constants.js";
@@ -42,7 +43,6 @@ import "../theme/constants.js";
42
43
  import "../gamification/vote/win-bar/styles.js";
43
44
  import "../gamification/insight-list/index.js";
44
45
  import "../gamification/insight/index.js";
45
- import "../gamification/insight/styles.js";
46
46
  import "../gamification/insight-list/styles.js";
47
47
  import "../gamification/detailed-insight/index.js";
48
48
  import "../gamification/common-header/index.js";
@@ -1,20 +1,22 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { useStore as m } from "@nanostores/react";
3
3
  import { QuestionList as p } from "../../gamification/question/list/index.js";
4
- import "../../gamification/question/index.js";
4
+ import "../../gamification/insight/index.js";
5
5
  import "@streamlayer/sdk-web-types";
6
+ import "../../gamification/insight/styles.js";
7
+ import "@linaria/react";
8
+ import "../../gamification/question/index.js";
6
9
  import "../../button/index.js";
7
10
  import "../../button/styles.js";
8
- import "@linaria/react";
9
11
  import "../../gamification/constants.js";
10
12
  import "../../gamification/question/styles.js";
11
13
  import "../../icons/index.js";
12
14
  import "react";
13
15
  import "../../gamification/question/list/styles.js";
14
- const l = ({ store: r, openQuestion: i }) => {
16
+ const v = ({ store: r, openQuestion: i }) => {
15
17
  const t = m(r);
16
18
  return t != null && t.data ? /* @__PURE__ */ o(p, { openQuestion: i, questions: t.data }) : /* @__PURE__ */ o("div", { children: "wait questions..." });
17
19
  };
18
20
  export {
19
- l as QuestionsList
21
+ v as QuestionsList
20
22
  };
@@ -16,8 +16,10 @@ import "../../gamification/user-statistics/components/statistic/index.js";
16
16
  import "../../gamification/user-statistics/components/statistic/styles.js";
17
17
  import "../../gamification/user-statistics/styles.js";
18
18
  import "../../gamification/question/list/index.js";
19
- import "../../gamification/question/index.js";
19
+ import "../../gamification/insight/index.js";
20
20
  import "@streamlayer/sdk-web-types";
21
+ import "../../gamification/insight/styles.js";
22
+ import "../../gamification/question/index.js";
21
23
  import "../../button/index.js";
22
24
  import "../../button/styles.js";
23
25
  import "../../gamification/constants.js";
@@ -46,8 +48,6 @@ import "../../gamification/onboarding/components/onboarding-slides/onboarding-ru
46
48
  import "../../gamification/onboarding/components/onboarding-slides/onboarding-rules/styles.js";
47
49
  import "../../gamification/onboarding/styles.js";
48
50
  import "../../gamification/insight-list/index.js";
49
- import "../../gamification/insight/index.js";
50
- import "../../gamification/insight/styles.js";
51
51
  import "../../gamification/insight-list/styles.js";
52
52
  import "../../gamification/detailed-insight/index.js";
53
53
  import "../../gamification/common-header/index.js";
@@ -36,6 +36,8 @@ import "../gamification/user-statistics/components/statistic/styles.js";
36
36
  import "../gamification/user-statistics/styles.js";
37
37
  import "./components/QuestionsList.js";
38
38
  import "../gamification/question/list/index.js";
39
+ import "../gamification/insight/index.js";
40
+ import "../gamification/insight/styles.js";
39
41
  import "../gamification/question/index.js";
40
42
  import "../button/index.js";
41
43
  import "../button/styles.js";
@@ -64,7 +66,6 @@ import "../gamification/onboarding/components/onboarding-slides/onboarding-invit
64
66
  import "../gamification/onboarding/components/onboarding-slides/onboarding-rules/index.js";
65
67
  import "../gamification/onboarding/components/onboarding-slides/onboarding-rules/styles.js";
66
68
  import "../gamification/onboarding/styles.js";
67
- import "../gamification/insight/styles.js";
68
69
  import "../gamification/insight-list/styles.js";
69
70
  import "../gamification/common-header/styles.js";
70
71
  import "../gamification/detailed-insight/styles.js";
@@ -80,7 +81,6 @@ import "../gamification/leaderboard-item/index.js";
80
81
  import "../gamification/leaderboard-item/styles.js";
81
82
  import "./components/Insights.js";
82
83
  import "../gamification/insight-list/index.js";
83
- import "../gamification/insight/index.js";
84
84
  import "./components/Insight.js";
85
85
  import "../gamification/detailed-insight/index.js";
86
86
  import "@streamlayer/sdk-web-anonymous-auth";
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
- import type { PickHistory } from '@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb';
2
+ import type { Gamification } from '@streamlayer/feature-gamification';
3
+ type FeedItem = Exclude<Awaited<ReturnType<Exclude<Gamification['feedList'], undefined>['getValue']>>, undefined>;
3
4
  interface QuestionListProps {
4
- questions: PickHistory[];
5
+ questions: FeedItem;
5
6
  openQuestion: (questionId: string) => void;
6
7
  }
7
8
  export declare const QuestionList: React.FC<QuestionListProps>;
@@ -1,15 +1,28 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { Question as i } from "../index.js";
3
- import { QuestionsContainer as p } from "./styles.js";
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { Insight as u } from "../../insight/index.js";
3
+ import { Question as s } from "../index.js";
4
+ import { QuestionsContainer as a } from "./styles.js";
4
5
  import "@streamlayer/sdk-web-types";
6
+ import "../../insight/styles.js";
7
+ import "@linaria/react";
5
8
  import "../../../button/index.js";
6
9
  import "../../../button/styles.js";
7
- import "@linaria/react";
8
10
  import "../../constants.js";
9
11
  import "../styles.js";
10
12
  import "../../../icons/index.js";
11
13
  import "react";
12
- const u = ({ questions: r, openQuestion: m }) => /* @__PURE__ */ t(p, { children: r == null ? void 0 : r.map((o) => /* @__PURE__ */ t(i, { openQuestion: m, ...o }, o.questionId)) });
14
+ const j = ({ questions: r, openQuestion: o }) => /* @__PURE__ */ e(a, { children: r == null ? void 0 : r.map((t) => {
15
+ var n, m;
16
+ if (t.type === "question" && ((n = t.attributes) == null ? void 0 : n.attributes.case) === "question") {
17
+ const i = t.attributes.attributes.value;
18
+ return /* @__PURE__ */ e(s, { openQuestion: o, ...i }, i.questionId);
19
+ }
20
+ if (t.type === "insight" && ((m = t.attributes) == null ? void 0 : m.attributes.case) === "insight") {
21
+ const i = t.attributes.attributes.value;
22
+ return /* @__PURE__ */ e(u, { ...i, openInsight: o }, i.questionId);
23
+ }
24
+ return null;
25
+ }) });
13
26
  export {
14
- u as QuestionList
27
+ j as QuestionList
15
28
  };
@@ -1,10 +1,3 @@
1
1
  /// <reference types="react" />
2
- import { VideoPlayerProps } from '../../../video-player';
3
- export type InsightDetailsProps = {
4
- poster?: string;
5
- video?: VideoPlayerProps;
6
- title: string;
7
- description: string;
8
- webLink?: string;
9
- };
10
- export declare const InsightDetails: React.FC<InsightDetailsProps>;
2
+ import { InsightHistory } from '@streamlayer/sdk-web-types';
3
+ export declare const InsightDetails: React.FC<InsightHistory>;
@@ -1,21 +1,21 @@
1
- import { jsxs as e, jsx as r } from "react/jsx-runtime";
2
- import { SvgIcon as m } from "../../../icons/index.js";
3
- import { VideoPlayer as l } from "../../../video-player/index.js";
4
- import { Container as p, Content as s, Title as c, Description as a, WebLinkBtn as h } from "./styles.js";
1
+ import { jsxs as l, jsx as o } from "react/jsx-runtime";
2
+ import { SvgIcon as d } from "../../../icons/index.js";
3
+ import { VideoPlayer as e } from "../../../video-player/index.js";
4
+ import { Container as p, Content as c, Title as h, Description as b, WebLinkBtn as f } from "./styles.js";
5
5
  import "@linaria/react";
6
6
  import "react";
7
7
  import "../../../video-player/styles.js";
8
- const y = ({ video: t, title: i, description: n, webLink: o }) => /* @__PURE__ */ e(p, { children: [
9
- t && /* @__PURE__ */ r(l, { ...t }),
10
- /* @__PURE__ */ e(s, { children: [
11
- /* @__PURE__ */ r(c, { children: i }),
12
- /* @__PURE__ */ r(a, { children: n }),
13
- o && /* @__PURE__ */ e(h, { href: "webLink", target: "_blank", children: [
8
+ const j = ({ title: m, instantView: r }) => /* @__PURE__ */ l(p, { children: [
9
+ (r == null ? void 0 : r.video) && /* @__PURE__ */ o(e, { source: r.video.url, poster: r.video.thumbnailUrl }),
10
+ /* @__PURE__ */ l(c, { children: [
11
+ /* @__PURE__ */ o(h, { children: (r == null ? void 0 : r.heading) || m }),
12
+ /* @__PURE__ */ o(b, { children: r == null ? void 0 : r.body }),
13
+ (r == null ? void 0 : r.webLink) && /* @__PURE__ */ l(f, { href: "webLink", target: "_blank", children: [
14
14
  "Explore more of the Masters History",
15
- /* @__PURE__ */ r(m, { name: "icon-external-link" })
15
+ /* @__PURE__ */ o(d, { name: "icon-external-link" })
16
16
  ] })
17
17
  ] })
18
18
  ] });
19
19
  export {
20
- y as InsightDetails
20
+ j as InsightDetails
21
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react-ui",
3
- "version": "0.52.2",
3
+ "version": "0.53.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./lib/index.d.ts",
@@ -30,16 +30,16 @@
30
30
  "react-virtualized-auto-sizer": "^1.0.20",
31
31
  "react-window": "^1.8.9",
32
32
  "react-window-infinite-loader": "^1.0.9",
33
- "@streamlayer/sdk-web": "^0.28.12",
34
- "@streamlayer/feature-gamification": "^0.19.5",
35
- "@streamlayer/sdk-web-anonymous-auth": "^0.11.7",
33
+ "@streamlayer/feature-gamification": "^0.20.0",
34
+ "@streamlayer/sdk-web": "^0.28.13",
35
+ "@streamlayer/sdk-web-anonymous-auth": "^0.11.8",
36
36
  "@streamlayer/sdk-web-api": "^0.0.1",
37
- "@streamlayer/sdk-web-core": "^0.17.2",
38
- "@streamlayer/sdk-web-features": "^0.10.15",
39
- "@streamlayer/sdk-web-interfaces": "^0.18.9",
40
- "@streamlayer/sdk-web-notifications": "^0.10.8",
37
+ "@streamlayer/sdk-web-core": "^0.17.3",
38
+ "@streamlayer/sdk-web-features": "^0.10.16",
39
+ "@streamlayer/sdk-web-interfaces": "^0.18.10",
40
+ "@streamlayer/sdk-web-notifications": "^0.10.9",
41
41
  "@streamlayer/sdk-web-storage": "^0.3.10",
42
- "@streamlayer/sdk-web-types": "^0.17.1"
42
+ "@streamlayer/sdk-web-types": "^0.18.0"
43
43
  },
44
44
  "nx": {
45
45
  "implicitDependencies": [
@@ -78,6 +78,6 @@
78
78
  "vite-plugin-svgr": "^4.1.0",
79
79
  "vite-svg-loader": "^4.0.0",
80
80
  "vite-tsconfig-paths": "^4.2.1",
81
- "@streamlayer/react": "^0.26.2"
81
+ "@streamlayer/react": "^0.26.3"
82
82
  }
83
83
  }
@@ -1,7 +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
- }>;
@@ -1,31 +0,0 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { DetailedInsight as L } 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 j = ({ openedInsight: o, closeHighlights: r, closeInsight: s }) => {
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
- } : {}, 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,
18
- {
19
- image: i.image,
20
- title: l,
21
- description: m,
22
- webLink: i.webLink,
23
- webLinkLabel: i.webLinkLabel,
24
- closeInsight: s,
25
- closeHighlights: r
26
- }
27
- );
28
- };
29
- export {
30
- j as Insight
31
- };
@@ -1,6 +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
- }>;
@@ -1,15 +0,0 @@
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";
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 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..." });
12
- };
13
- export {
14
- d as Insights
15
- };
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- import type { Highlights } from '@streamlayer/feature-gamification';
3
- import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
4
- export declare const HighlightsOverlay: React.FC<{
5
- highlights: Highlights;
6
- sdk: StreamLayerSDK;
7
- className?: string;
8
- }>;
@@ -1,36 +0,0 @@
1
- import { jsxs as e, Fragment as m, jsx as i } from "react/jsx-runtime";
2
- import { useStore as p } from "@nanostores/react";
3
- import { Insight as s } from "../../../demo/components/Insight.js";
4
- import { Insights as n } from "../../../demo/components/Insights.js";
5
- import "../../../gamification/detailed-insight/index.js";
6
- import "../../../gamification/common-header/index.js";
7
- import "../../../../icon-exit-d3f9fc80.js";
8
- import "../../../gamification/common-header/styles.js";
9
- import "@linaria/react";
10
- import "../../../gamification/detailed-insight/styles.js";
11
- import "../../../gamification/insight-list/index.js";
12
- import "../../../gamification/insight/index.js";
13
- import "@streamlayer/sdk-web-types";
14
- import "../../../gamification/insight/styles.js";
15
- import "../../../gamification/insight-list/styles.js";
16
- const O = ({
17
- highlights: o,
18
- className: r
19
- }) => {
20
- const t = p(o.openedInsight);
21
- return /* @__PURE__ */ e(m, { children: [
22
- !t && o.insights && /* @__PURE__ */ i(n, { className: r, highlights: o, store: o.insights.getStore() }),
23
- t && /* @__PURE__ */ i(
24
- s,
25
- {
26
- className: r,
27
- openedInsight: t,
28
- closeHighlights: o.closeFeature,
29
- closeInsight: o.closeHighlight
30
- }
31
- )
32
- ] });
33
- };
34
- export {
35
- O as HighlightsOverlay
36
- };