@streamlayer/react-ui 1.9.0 → 1.11.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 (87) hide show
  1. package/lib/app/app/Advertisement/index.d.ts +1 -0
  2. package/lib/app/app/Advertisement/index.js +78 -67
  3. package/lib/app/app/Features/Gamification/Question.d.ts +1 -0
  4. package/lib/app/app/Features/Gamification/Question.js +43 -41
  5. package/lib/app/app/Features/Gamification/Tabs.js +22 -21
  6. package/lib/app/app/Features/Gamification/index.js +66 -62
  7. package/lib/app/app/Insight/index.d.ts +2 -0
  8. package/lib/app/app/Insight/index.js +28 -24
  9. package/lib/app/app/Navigation/index.d.ts +4 -0
  10. package/lib/app/app/Navigation/index.js +88 -48
  11. package/lib/app/app/Notifications/index.js +125 -113
  12. package/lib/app/app/Points/index.js +16 -16
  13. package/lib/app/app/index.d.ts +1 -0
  14. package/lib/app/app/index.js +84 -83
  15. package/lib/app/app/story/index.js +27 -24
  16. package/lib/app/app/story/insight/index.d.ts +1 -0
  17. package/lib/app/app/story/insight/index.js +29 -26
  18. package/lib/app/app/story/insight/video.d.ts +1 -0
  19. package/lib/app/app/story/insight/video.js +13 -13
  20. package/lib/app/app/story/promotion/content.d.ts +3 -1
  21. package/lib/app/app/story/promotion/content.js +13 -10
  22. package/lib/app/app/story/promotion/index.d.ts +1 -0
  23. package/lib/app/app/story/promotion/index.js +34 -30
  24. package/lib/app/app/story/promotion/video.d.ts +1 -0
  25. package/lib/app/app/story/promotion/video.js +34 -31
  26. package/lib/app/app/styles.js +44 -0
  27. package/lib/app/app/useApp.d.ts +2 -14
  28. package/lib/app/app/useApp.js +14 -43
  29. package/lib/app/app/useAppContext.d.ts +2 -0
  30. package/lib/app/app/useAppContext.js +6 -5
  31. package/lib/app/masters/Features/Gamification/Leaderboard.d.ts +1 -1
  32. package/lib/app/masters/Features/Gamification/Tabs.d.ts +2 -2
  33. package/lib/app/masters/Features/Gamification/Tabs.js +2 -2
  34. package/lib/app/masters/Features/Gamification/index.d.ts +2 -2
  35. package/lib/app/masters/Features/Gamification/index.js +1 -1
  36. package/lib/app/masters/Features/index.d.ts +2 -2
  37. package/lib/app/masters/Navigation/MastersNavigation/index.d.ts +1 -1
  38. package/lib/app/masters/Notifications/Onboarding/index.d.ts +1 -1
  39. package/lib/app/masters/Notifications/Onboarding/index.js +4 -4
  40. package/lib/app/masters/Notifications/index.d.ts +2 -2
  41. package/lib/app/masters/Notifications/index.js +1 -1
  42. package/lib/app/masters/masters.js +23 -23
  43. package/lib/app/masters/styles.d.ts +20 -0
  44. package/lib/app/{styles.js → masters/styles.js} +15 -15
  45. package/lib/app/masters/useSdkResponsive.d.ts +15 -0
  46. package/lib/app/masters/useSdkResponsive.js +45 -0
  47. package/lib/app/masters/useSdkScroll.d.ts +12 -0
  48. package/lib/app/masters/useSdkScroll.js +50 -0
  49. package/lib/app/useSdkResponsive.d.ts +1 -0
  50. package/lib/app/useSdkResponsive.js +27 -29
  51. package/lib/app/useSdkScroll.js +25 -24
  52. package/lib/assets/style.css +1 -1
  53. package/lib/ui/advertisement/banner/index.js +14 -11
  54. package/lib/ui/advertisement/index.d.ts +3 -0
  55. package/lib/ui/advertisement/index.js +31 -10
  56. package/lib/ui/advertisement/notification/index.d.ts +1 -0
  57. package/lib/ui/advertisement/notification/index.js +30 -27
  58. package/lib/ui/advertisement/notification/lower-third/index.d.ts +9 -0
  59. package/lib/ui/advertisement/notification/lower-third/index.js +37 -0
  60. package/lib/ui/advertisement/notification/lower-third/styles.d.ts +16 -0
  61. package/lib/ui/advertisement/notification/lower-third/styles.js +64 -0
  62. package/lib/ui/advertisement/overlay/index.d.ts +2 -0
  63. package/lib/ui/advertisement/overlay/index.js +58 -43
  64. package/lib/ui/advertisement/overlay/styles.d.ts +0 -2
  65. package/lib/ui/advertisement/overlay/styles.js +41 -52
  66. package/lib/ui/close-btn/index.d.ts +7 -0
  67. package/lib/ui/close-btn/index.js +47 -0
  68. package/lib/ui/gamification/detail/header/index.d.ts +2 -1
  69. package/lib/ui/gamification/detail/header/index.js +16 -15
  70. package/lib/ui/gamification/vote/styles.js +1 -1
  71. package/lib/ui/navigation/button/FeaturedGroups.d.ts +1 -1
  72. package/lib/ui/navigation/index.d.ts +5 -3
  73. package/lib/ui/navigation/index.js +11 -12
  74. package/lib/ui/navigation/masters.js +1 -1
  75. package/lib/ui/navigation/styles.d.ts +5 -0
  76. package/lib/ui/navigation/styles.js +16 -0
  77. package/lib/ui/questions/insight/index.js +21 -20
  78. package/lib/ui/theme/masters-theme.js +36 -13
  79. package/lib/ui/theme/theme.js +25 -26
  80. package/lib/ui/timer/index.d.ts +3 -1
  81. package/lib/ui/timer/index.js +54 -32
  82. package/lib/ui/video-player/index.d.ts +2 -0
  83. package/lib/ui/video-player/index.js +62 -51
  84. package/lib/ui/video-player/styles.d.ts +1 -0
  85. package/lib/ui/video-player/styles.js +7 -6
  86. package/package.json +15 -15
  87. /package/lib/app/{styles.d.ts → app/styles.d.ts} +0 -0
@@ -8,6 +8,7 @@ export type StreamLayerSDKAdvertisementProps = {
8
8
  sidebar?: 'left' | 'right';
9
9
  banner?: 'top' | 'bottom';
10
10
  layoutMode?: 'cover' | 'side-by-side';
11
+ skipAutoClose?: boolean;
11
12
  };
12
13
  export declare const StreamLayerSDKAdvertisement: React.FC<StreamLayerSDKAdvertisementProps & {
13
14
  sdk: StreamLayerSDK;
@@ -1,99 +1,110 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { styled as p } from "@linaria/react";
3
- import { useStore as f } from "@nanostores/react";
4
- import { useAnalyticsListener as v } from "../../../hooks/analytics.js";
5
- import { useRef as y } from "react";
6
- import { eventBus as c } from "@streamlayer/sdk-web-interfaces";
7
- import { FeatureType as A, PromotionType as g } from "@streamlayer/sdk-web-types";
8
- import { AdvertisementUI as b } from "../../../ui/advertisement/index.js";
9
- const S = /* @__PURE__ */ p("div")({
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { cx as b } from "@linaria/core";
3
+ import { styled as g } from "@linaria/react";
4
+ import { useStore as A } from "@nanostores/react";
5
+ import { useAnalyticsListener as h } from "../../../hooks/analytics.js";
6
+ import { useRef as L } from "react";
7
+ import { eventBus as v } from "@streamlayer/sdk-web-interfaces";
8
+ import { FeatureType as I, NotificationPromotionMode as w, PromotionType as T } from "@streamlayer/sdk-web-types";
9
+ import { AdvertisementUI as U } from "../../../ui/advertisement/index.js";
10
+ const N = /* @__PURE__ */ g("div")({
10
11
  name: "AdvertisementUIWrap",
11
12
  class: "aa6pjif",
12
13
  propsAsIs: !1
13
- }), h = (n) => {
14
- const t = n.target;
15
- if (t instanceof HTMLAnchorElement && t.target === "_blank") {
16
- const r = t.getAttribute("data-promo-id") || "", i = t.getAttribute("data-promo-type") || g.UNSET;
17
- t.getAttribute("data-analytics") === "button" && c.emit("advertisement", {
14
+ }), W = (r) => {
15
+ const e = r.target;
16
+ if (e instanceof HTMLAnchorElement && e.target === "_blank") {
17
+ const o = e.getAttribute("data-promo-id") || "", i = e.getAttribute("data-promo-type") || T.UNSET;
18
+ e.getAttribute("data-analytics") === "button" && v.emit("advertisement", {
18
19
  action: "buttonSelect",
19
20
  payload: {
20
- advertisementId: r,
21
- advertisementType: i
21
+ id: o,
22
+ type: i
22
23
  }
23
- }), t.getAttribute("data-analytics") === "banner" && c.emit("advertisement", {
24
+ }), e.getAttribute("data-analytics") === "banner" && v.emit("advertisement", {
24
25
  action: "bannerSelect",
25
26
  payload: {
26
- advertisementId: r,
27
- advertisementType: i
27
+ id: o,
28
+ type: i
28
29
  }
29
30
  });
30
31
  }
31
- }, I = ({
32
- gamification: n,
33
- layoutMode: t,
34
- skipTypeCheck: r,
35
- sidebar: i,
36
- banner: o,
37
- notification: m,
32
+ }, E = ({
33
+ gamification: r,
34
+ layoutMode: e,
35
+ skipAutoClose: o,
36
+ skipTypeCheck: i,
37
+ sidebar: n,
38
+ banner: a,
39
+ notification: d,
38
40
  isMobileScreen: l,
39
- persistent: d
41
+ persistent: c
40
42
  }) => {
41
- const a = y(null), e = f(n.advertisement.$store);
42
- v(a, {
43
- enabled: !!e.data,
43
+ var f, p, u;
44
+ const s = L(null), t = A(r.advertisement.$store);
45
+ h(s, {
46
+ enabled: !!t.data,
44
47
  event: "click",
45
- listener: h
48
+ listener: W
46
49
  });
47
- const u = !o && !i;
48
- return e.data === void 0 || !d && e.isViewed ? null : /* @__PURE__ */ s(S, {
49
- ref: a,
50
+ const y = !a && !n;
51
+ if (t.data === void 0 || !c && t.isViewed)
52
+ return null;
53
+ const S = ((u = (p = (f = t == null ? void 0 : t.data) == null ? void 0 : f.notification) == null ? void 0 : p.promotion) == null ? void 0 : u.mode) === w.LOWER_THIRD;
54
+ return /* @__PURE__ */ m(N, {
55
+ ref: s,
50
56
  style: {
51
- height: u ? "auto" : "100%"
57
+ height: y ? "auto" : "100%"
52
58
  },
53
- className: l ? "mobile-view" : "",
54
- children: /* @__PURE__ */ s(b, {
55
- skipTypeCheck: r,
56
- sidebar: i,
57
- banner: o,
58
- advertisement: e.data,
59
- close: e.close,
60
- layoutMode: t,
61
- isNotification: m
59
+ className: b("SL-AdvertisementUIWrap", l && "mobile-view", S && "SL-AdvertisementUIWrap--lower-third"),
60
+ children: /* @__PURE__ */ m(U, {
61
+ skipTypeCheck: i,
62
+ sidebar: n,
63
+ banner: a,
64
+ advertisement: t.data,
65
+ close: t.close,
66
+ markAsViewed: r.advertisement.markAsViewed,
67
+ open: r.advertisement.open,
68
+ layoutMode: e,
69
+ isNotification: d,
70
+ skipAutoClose: o
62
71
  })
63
72
  });
64
- }, D = ({
65
- sdk: n,
66
- sidebar: t,
67
- banner: r,
68
- skipTypeCheck: i,
69
- layoutMode: o,
70
- isMobileScreen: m,
73
+ }, H = ({
74
+ sdk: r,
75
+ sidebar: e,
76
+ banner: o,
77
+ skipAutoClose: i,
78
+ skipTypeCheck: n,
79
+ layoutMode: a,
80
+ isMobileScreen: d,
71
81
  persistent: l,
72
- notification: d
82
+ notification: c
73
83
  }) => {
74
- const a = f(n.featuresList.getStore());
75
- if (t && r)
76
- return /* @__PURE__ */ s("div", {
84
+ const s = A(r.featuresList.getStore());
85
+ if (e && o)
86
+ return /* @__PURE__ */ m("div", {
77
87
  style: {
78
88
  color: "red"
79
89
  },
80
90
  children: "define either sidebar or banner, not both."
81
91
  });
82
- if (!a)
92
+ if (!s)
83
93
  return null;
84
- const e = n.getFeature(A.GAMES);
85
- return e ? /* @__PURE__ */ s(I, {
86
- gamification: e,
87
- sidebar: t,
88
- banner: r,
89
- layoutMode: o,
90
- isMobileScreen: m,
94
+ const t = r.getFeature(I.GAMES);
95
+ return t ? /* @__PURE__ */ m(E, {
96
+ gamification: t,
97
+ sidebar: e,
98
+ banner: o,
99
+ layoutMode: a,
100
+ isMobileScreen: d,
91
101
  persistent: l,
92
- notification: d,
93
- skipTypeCheck: i
102
+ notification: c,
103
+ skipTypeCheck: n,
104
+ skipAutoClose: i
94
105
  }) : null;
95
106
  };
96
107
  export {
97
- S as AdvertisementUIWrap,
98
- D as StreamLayerSDKAdvertisement
108
+ N as AdvertisementUIWrap,
109
+ H as StreamLayerSDKAdvertisement
99
110
  };
@@ -3,5 +3,6 @@ export declare const Question: React.FC<{
3
3
  gamification: Gamification;
4
4
  hideSponsor?: boolean;
5
5
  className?: string;
6
+ skipAutoClose?: boolean;
6
7
  hideHeader?: boolean;
7
8
  }>;
@@ -1,73 +1,75 @@
1
- import { jsxs as p, jsx as r } from "react/jsx-runtime";
2
- import { styled as f } from "@linaria/react";
3
- import { useStore as m } from "@nanostores/react";
4
- import { useAppContext as b } from "../../useAppContext.js";
5
- import { QuestionType as y } from "@streamlayer/sdk-web-types";
6
- import { VoteHeader as V } from "../../../../ui/gamification/detail/header/index.js";
7
- import { Sponsor as d } from "../../../../ui/gamification/detail/sponsor/index.js";
8
- import { Vote as h, VoteSkeleton as x } from "../../../../ui/gamification/vote/index.js";
9
- import { InsightDetails as S } from "../../../../ui/gamification/vote/insight-details/index.js";
10
- import { TwitterDetails as g } from "../../../../ui/gamification/vote/twitter-details/index.js";
11
- const q = /* @__PURE__ */ f("div")({
1
+ import { jsxs as y, jsx as e } from "react/jsx-runtime";
2
+ import { styled as v } from "@linaria/react";
3
+ import { useStore as d } from "@nanostores/react";
4
+ import { useAppContext as T } from "../../useAppContext.js";
5
+ import { QuestionType as V } from "@streamlayer/sdk-web-types";
6
+ import { VoteHeader as h } from "../../../../ui/gamification/detail/header/index.js";
7
+ import { Sponsor as x } from "../../../../ui/gamification/detail/sponsor/index.js";
8
+ import { Vote as S, VoteSkeleton as g } from "../../../../ui/gamification/vote/index.js";
9
+ import { InsightDetails as q } from "../../../../ui/gamification/vote/insight-details/index.js";
10
+ import { TwitterDetails as D } from "../../../../ui/gamification/vote/twitter-details/index.js";
11
+ const w = /* @__PURE__ */ v("div")({
12
12
  name: "QuestionContainer",
13
13
  class: "q14ckf9e",
14
14
  propsAsIs: !1
15
- }), v = ({
15
+ }), A = ({
16
16
  openedQuestion: t
17
17
  }) => {
18
- var s, i;
18
+ var r, s;
19
19
  const {
20
20
  sdk: o
21
- } = b();
22
- return ((s = t == null ? void 0 : t.attributes) == null ? void 0 : s.attributes.case) === "insight" ? /* @__PURE__ */ r(S, {
21
+ } = T();
22
+ return ((r = t == null ? void 0 : t.attributes) == null ? void 0 : r.attributes.case) === "insight" ? /* @__PURE__ */ e(q, {
23
23
  ...t.attributes.attributes.value,
24
24
  controlVideo: o == null ? void 0 : o.controlVideoPlayer
25
- }) : ((i = t == null ? void 0 : t.attributes) == null ? void 0 : i.attributes.case) === "tweet" ? /* @__PURE__ */ r(g, {
25
+ }) : ((s = t == null ? void 0 : t.attributes) == null ? void 0 : s.attributes.case) === "tweet" ? /* @__PURE__ */ e(D, {
26
26
  ...t.attributes.attributes.value,
27
27
  controlVideo: o == null ? void 0 : o.controlVideoPlayer
28
28
  }) : null;
29
- }, D = ({
29
+ }, C = ({
30
30
  extendedQuestion: t,
31
31
  vote: o,
32
- close: s
32
+ close: r
33
33
  }) => {
34
34
  const {
35
- loading: i,
36
- data: e
35
+ loading: s,
36
+ data: i
37
37
  } = t;
38
- return e ? /* @__PURE__ */ r(h, {
38
+ return i ? /* @__PURE__ */ e(S, {
39
39
  vote: o,
40
- close: s,
41
- openedQuestion: e,
42
- isLoading: !!i
43
- }) : /* @__PURE__ */ r(x, {});
44
- }, E = ({
40
+ close: r,
41
+ openedQuestion: i,
42
+ isLoading: !!s
43
+ }) : /* @__PURE__ */ e(g, {});
44
+ }, z = ({
45
45
  gamification: t,
46
- hideSponsor: o,
46
+ skipAutoClose: o,
47
+ hideSponsor: r,
47
48
  className: s,
48
49
  hideHeader: i
49
50
  }) => {
50
- var u, a, c;
51
- const e = m(t.openedQuestion.$store), n = m(t.openedQuestion.$extendedStore);
52
- if (!e)
51
+ var u, c, m, p, f;
52
+ const n = d(t.openedQuestion.$store), l = d(t.openedQuestion.$extendedStore);
53
+ if (!n)
53
54
  return null;
54
- const l = e.type;
55
- return /* @__PURE__ */ p(q, {
55
+ const a = n.type, b = ((c = (u = l.data) == null ? void 0 : u.options) == null ? void 0 : c.options.case) === "factoid" ? l.data.options.options.value.closeTimer : void 0;
56
+ return /* @__PURE__ */ y(w, {
56
57
  className: s,
57
- children: [!i && /* @__PURE__ */ r(V, {
58
+ children: [!i && /* @__PURE__ */ e(h, {
59
+ closeTimer: o ? void 0 : b,
58
60
  close: t.closeQuestion,
59
- type: ((u = e.attributes) == null ? void 0 : u.type) || y.UNSET
60
- }), l === "question" && /* @__PURE__ */ r(D, {
61
+ type: ((m = n.attributes) == null ? void 0 : m.type) || V.UNSET
62
+ }), a === "question" && /* @__PURE__ */ e(C, {
61
63
  vote: t.submitAnswer,
62
64
  close: t.closeQuestion,
63
- extendedQuestion: n
64
- }), l !== "question" && /* @__PURE__ */ r(v, {
65
- openedQuestion: e
66
- }), !o && /* @__PURE__ */ r(d, {
67
- sponsorLogo: (c = (a = n.data) == null ? void 0 : a.sponsorship) == null ? void 0 : c.logo
65
+ extendedQuestion: l
66
+ }), a !== "question" && /* @__PURE__ */ e(A, {
67
+ openedQuestion: n
68
+ }), !r && /* @__PURE__ */ e(x, {
69
+ sponsorLogo: (f = (p = l.data) == null ? void 0 : p.sponsorship) == null ? void 0 : f.logo
68
70
  })]
69
71
  });
70
72
  };
71
73
  export {
72
- E as Question
74
+ z as Question
73
75
  };
@@ -1,30 +1,31 @@
1
- import { jsxs as h, jsx as e, Fragment as x } from "react/jsx-runtime";
2
- import { useStore as u } from "@nanostores/react";
3
- import { TabsContainer as D, TabsNavContainer as T, SDKWhiteContainer as v, UserSummaryContainer as C, SDKContentContainer as A, LeaderboardContainer as I } from "../../../styles.js";
4
- import { scrollIntoAppView as P } from "../../../useSdkScroll.js";
5
- import { useState as S, useTransition as V, useEffect as E } from "react";
1
+ import { jsxs as u, jsx as e, Fragment as x } from "react/jsx-runtime";
2
+ import { cx as T } from "@linaria/core";
3
+ import { useStore as h } from "@nanostores/react";
4
+ import { TabsContainer as D, TabsNavContainer as C, SDKWhiteContainer as S, UserSummaryContainer as v, SDKContentContainer as A, LeaderboardContainer as I } from "../../styles.js";
5
+ import { scrollIntoAppView as L } from "../../../useSdkScroll.js";
6
+ import { useState as P, useTransition as V, useEffect as E } from "react";
6
7
  import { ActivePages as a, Tabs as K } from "../../../../ui/gamification/tabs/index.js";
7
- import { Leaderboard as L } from "./Leaderboard.js";
8
- import { QuestionsList as F } from "./QuestionsList.js";
9
- import { UserSummary as O } from "./UserSummary.js";
10
- const q = ({ gamification: s, className: f, scrollStore: t, scrollNode: l, appNode: c, style: b, responsiveStore: n }) => {
11
- const { tabsShown: d } = u(t, { keys: ["tabsShown"] }), [i, w] = S(a.HOME), [, y] = V(), { sdkInDesktopView: m, screen: g } = u(n, { keys: ["sdkInDesktopView"] }), k = (r) => {
8
+ import { Leaderboard as F } from "./Leaderboard.js";
9
+ import { QuestionsList as O } from "./QuestionsList.js";
10
+ import { UserSummary as Q } from "./UserSummary.js";
11
+ const G = ({ gamification: r, className: l, scrollStore: t, scrollNode: b, appNode: m, style: f, responsiveStore: n }) => {
12
+ const { tabsShown: c } = h(t, { keys: ["tabsShown"] }), [i, w] = P(a.HOME), [, y] = V(), { sdkInDesktopView: d, screen: g } = h(n, { keys: ["sdkInDesktopView"] }), k = (s) => {
12
13
  y(() => {
13
14
  var p;
14
- w(r), m === !1 && (((p = c.current) == null ? void 0 : p.getBoundingClientRect().y) || 0) < 0 && P(c, g.size, { behavior: "instant" });
15
+ w(s), d === !1 && (((p = m.current) == null ? void 0 : p.getBoundingClientRect().y) || 0) < 0 && L(m, g.size, { behavior: "instant" });
15
16
  });
16
17
  };
17
- E(() => t.subscribe((r) => {
18
- if (r.scrollPosition === 0) {
18
+ E(() => t.subscribe((s) => {
19
+ if (s.scrollPosition === 0) {
19
20
  t.setKey("tabsShown", !0);
20
21
  return;
21
22
  }
22
- n.get().sdkInDesktopView ? t.setKey("tabsShown", r.scrollDirection === "backward") : t.setKey("tabsShown", r.scrollDirection === "forward");
23
+ n.get().sdkInDesktopView ? t.setKey("tabsShown", s.scrollDirection === "backward") : t.setKey("tabsShown", s.scrollDirection === "forward");
23
24
  }), [t, n]);
24
25
  let o = "0px";
25
- return m ? o = d ? "0px" : "calc(8px - var(--header-height) - var(--header-offset))" : o = d ? "calc(var(--header-height) + var(--header-offset) - 2px)" : "0px", /* @__PURE__ */ h(D, { className: f, style: b, children: [
26
+ return d ? o = c ? "0px" : "calc(0px - var(--header-height))" : o = c ? "var(--header-height)" : "0px", /* @__PURE__ */ u(D, { className: T(l, "SL-Tabs"), style: f, children: [
26
27
  /* @__PURE__ */ e(
27
- T,
28
+ C,
28
29
  {
29
30
  style: {
30
31
  top: o
@@ -32,13 +33,13 @@ const q = ({ gamification: s, className: f, scrollStore: t, scrollNode: l, appNo
32
33
  children: /* @__PURE__ */ e(K, { activePage: i, toggleActivePage: k })
33
34
  }
34
35
  ),
35
- i === a.HOME && /* @__PURE__ */ h(x, { children: [
36
- /* @__PURE__ */ e(v, { style: { paddingTop: "8px" }, children: /* @__PURE__ */ e(C, { children: /* @__PURE__ */ e(O, { userSummary: s.userSummary }) }) }),
37
- /* @__PURE__ */ e(A, { style: { flex: 1 }, children: /* @__PURE__ */ e(F, { openQuestion: s.openQuestion, store: s.feedList.getStore() }) })
36
+ i === a.HOME && /* @__PURE__ */ u(x, { children: [
37
+ /* @__PURE__ */ e(S, { style: { paddingTop: "8px" }, children: /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(Q, { userSummary: r.userSummary }) }) }),
38
+ /* @__PURE__ */ e(A, { style: { flex: 1 }, children: /* @__PURE__ */ e(O, { openQuestion: r.openQuestion, store: r.feedList.getStore() }) })
38
39
  ] }),
39
- i === a.LEADERBOARD && /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(L, { scrollStore: t, scrollNode: l, gamification: s }) })
40
+ i === a.LEADERBOARD && /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(F, { scrollStore: t, scrollNode: b, gamification: r }) })
40
41
  ] });
41
42
  };
42
43
  export {
43
- q as Tabs
44
+ G as Tabs
44
45
  };
@@ -1,88 +1,92 @@
1
- import { jsx as n, jsxs as f } from "react/jsx-runtime";
2
- import { styled as m } from "@linaria/react";
3
- import { useStore as l } from "@nanostores/react";
4
- import { SDKWhiteContainer as h } from "../../../styles.js";
5
- import { useHideTransition as C } from "../../../../hooks/showIn.js";
6
- import { VoteHeader as k } from "../../../../ui/gamification/detail/header/index.js";
7
- import { UserStatistics as S } from "../../../../ui/gamification/user-statistics/index.js";
8
- import { ModalPortal as U } from "../../../../ui/modal/index.js";
9
- import { ShowIn as I } from "../../../../ui/show-in/index.js";
10
- import { Question as v } from "./Question.js";
11
- import { Tabs as x } from "./Tabs.js";
12
- const y = () => I, u = /* @__PURE__ */ m(y())({
1
+ import { jsx as o, jsxs as x } from "react/jsx-runtime";
2
+ import { cx as l } from "@linaria/core";
3
+ import { styled as f } from "@linaria/react";
4
+ import { useStore as c } from "@nanostores/react";
5
+ import { SDKWhiteContainer as k } from "../../styles.js";
6
+ import { useAppContext as v } from "../../useAppContext.js";
7
+ import { useHideTransition as S } from "../../../../hooks/showIn.js";
8
+ import { VoteHeader as U } from "../../../../ui/gamification/detail/header/index.js";
9
+ import { UserStatistics as I } from "../../../../ui/gamification/user-statistics/index.js";
10
+ import { ModalPortal as y } from "../../../../ui/modal/index.js";
11
+ import { ShowIn as A } from "../../../../ui/show-in/index.js";
12
+ import { Question as O } from "./Question.js";
13
+ import { Tabs as b } from "./Tabs.js";
14
+ const w = () => A, u = /* @__PURE__ */ f(w())({
13
15
  name: "OpenedContainer",
14
16
  class: "ouvguos",
15
17
  propsAsIs: !0
16
- }), O = /* @__PURE__ */ m("div")({
18
+ }), d = "t1eu4lbg", D = /* @__PURE__ */ f("div")({
17
19
  name: "UserContainer",
18
- class: "u1eu4lbg",
20
+ class: "uuv2xqo",
19
21
  propsAsIs: !1
20
- }), b = ({
22
+ }), H = ({
21
23
  correct: e,
22
- incorrect: r
24
+ incorrect: t
23
25
  }) => {
24
- const o = e + r;
25
- return o === 0 ? 0 : Math.round(e / o * 100);
26
- }, E = ({
26
+ const n = e + t;
27
+ return n === 0 ? 0 : Math.round(e / n * 100);
28
+ }, P = ({
27
29
  gamification: e,
28
- scrollStore: r,
29
- className: o,
30
- appNode: i,
31
- scrollNode: s,
32
- responsiveStore: t
33
- }) => /* @__PURE__ */ n(x, {
34
- appNode: i,
35
- scrollStore: r,
36
- scrollNode: s,
37
- className: o,
30
+ scrollStore: t,
31
+ className: n,
32
+ appNode: a,
33
+ scrollNode: r,
34
+ responsiveStore: s
35
+ }) => /* @__PURE__ */ o(b, {
36
+ appNode: a,
37
+ scrollStore: t,
38
+ scrollNode: r,
39
+ className: n,
38
40
  gamification: e,
39
- responsiveStore: t
40
- }), F = ({
41
+ responsiveStore: s
42
+ }), W = ({
41
43
  gamification: e,
42
- className: r,
43
- appNode: o,
44
- responsiveStore: i
44
+ className: t,
45
+ appNode: n,
46
+ responsiveStore: a
45
47
  }) => {
46
- const s = l(e.openedQuestion.$store), t = l(e.openedUser), {
47
- sdkInDesktopView: p
48
- } = l(i, {
48
+ const {
49
+ topNavigation: r
50
+ } = v(), s = c(e.openedQuestion.$store), i = c(e.openedUser), {
51
+ sdkInDesktopView: h
52
+ } = c(a, {
49
53
  keys: ["sdkInDesktopView"]
50
54
  }), {
51
- hiding: a,
52
- onAnimationEnd: c
53
- } = C();
54
- if (!o.current || !s && !t)
55
+ hiding: m,
56
+ onAnimationEnd: p
57
+ } = S();
58
+ if (!n.current || !s && !i)
55
59
  return null;
56
- const d = s ? /* @__PURE__ */ n(u, {
57
- className: r,
58
- hiding: a,
59
- onAnimationEnd: c,
60
- children: /* @__PURE__ */ n(v, {
60
+ const C = s ? /* @__PURE__ */ o(u, {
61
+ className: l(t, !r && d),
62
+ hiding: m,
63
+ onAnimationEnd: p,
64
+ children: /* @__PURE__ */ o(O, {
61
65
  gamification: e
62
66
  })
63
- }) : t ? /* @__PURE__ */ n(u, {
64
- className: r,
65
- hiding: a,
66
- onAnimationEnd: c,
67
- children: /* @__PURE__ */ f(O, {
68
- children: [/* @__PURE__ */ n(k, {
67
+ }) : i ? /* @__PURE__ */ o(u, {
68
+ className: l(t, !r && d),
69
+ hiding: m,
70
+ onAnimationEnd: p,
71
+ children: /* @__PURE__ */ x(D, {
72
+ children: [/* @__PURE__ */ o(U, {
69
73
  label: "Friend's Rank",
70
74
  close: e.closeUser
71
- }), /* @__PURE__ */ n(h, {
72
- children: /* @__PURE__ */ n(S, {
73
- ...t,
74
- successRate: b(t)
75
+ }), /* @__PURE__ */ o(k, {
76
+ children: /* @__PURE__ */ o(I, {
77
+ ...i,
78
+ successRate: H(i)
75
79
  })
76
80
  })]
77
81
  })
78
82
  }) : null;
79
- return /* @__PURE__ */ n(U, {
80
- container: o,
81
- useContainer: !p,
82
- children: d
83
+ return /* @__PURE__ */ o(y, {
84
+ container: n,
85
+ useContainer: !h,
86
+ children: C
83
87
  });
84
88
  };
85
89
  export {
86
- E as GamificationOverlay,
87
- F as GamificationOverlayStandalone
90
+ P as GamificationOverlay,
91
+ W as GamificationOverlayStandalone
88
92
  };
@@ -6,11 +6,13 @@ export declare const QuestionWrap: {
6
6
  gamification: Gamification;
7
7
  hideSponsor?: boolean;
8
8
  className?: string;
9
+ skipAutoClose?: boolean;
9
10
  hideHeader?: boolean;
10
11
  }>;
11
12
  export type StreamLayerSDKInsightProps = {
12
13
  hideHeader?: boolean;
13
14
  persistent?: boolean;
15
+ skipAutoClose?: boolean;
14
16
  };
15
17
  export declare const StreamLayerSDKInsight: React.FC<StreamLayerSDKInsightProps & {
16
18
  sdk: StreamLayerSDK;
@@ -1,23 +1,24 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { styled as Q } from "@linaria/react";
3
- import { useStore as d } from "@nanostores/react";
4
- import { useRef as i, useEffect as l } from "react";
5
- import { FeatureType as m } from "@streamlayer/sdk-web-types";
6
- import { Question as S } from "../Features/Gamification/Question.js";
7
- const y = () => S, I = /* @__PURE__ */ Q(y())({
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import { styled as i } from "@linaria/react";
3
+ import { useStore as Q } from "@nanostores/react";
4
+ import { useRef as l, useEffect as m } from "react";
5
+ import { FeatureType as S } from "@streamlayer/sdk-web-types";
6
+ import { Question as y } from "../Features/Gamification/Question.js";
7
+ const I = () => y, b = /* @__PURE__ */ i(I())({
8
8
  name: "QuestionWrap",
9
9
  class: "q10hhsxv",
10
10
  propsAsIs: !0
11
- }), b = ({
11
+ }), v = ({
12
12
  gamification: e,
13
13
  persistent: o,
14
- hideHeader: p,
14
+ skipAutoClose: p,
15
+ hideHeader: f,
15
16
  insightId: r
16
17
  }) => {
17
- const t = i(""), n = d(e.openedQuestion.$store);
18
- return l(() => r ? (!o || e.isOpenedQuestion(r) || (t.current = r, e.getFeedItem(r).then((u) => {
19
- var f;
20
- t.current === r && ((f = u == null ? void 0 : u.attributes) == null ? void 0 : f.attributes.case) === "insight" && e.openQuestion(r, u);
18
+ const t = l(""), n = Q(e.openedQuestion.$store);
19
+ return m(() => r ? (!o || e.isOpenedQuestion(r) || (t.current = r, e.getFeedItem(r).then((u) => {
20
+ var c;
21
+ t.current === r && ((c = u == null ? void 0 : u.attributes) == null ? void 0 : c.attributes.case) === "insight" && e.openQuestion(r, u);
21
22
  })), () => {
22
23
  t.current = "";
23
24
  }) : (e.activeQuestionId.subscribe(({
@@ -26,28 +27,31 @@ const y = () => S, I = /* @__PURE__ */ Q(y())({
26
27
  var u;
27
28
  s && ((u = s.feedItem) == null ? void 0 : u.type) === "insight" && (!o || e.isOpenedQuestion(s.feedItem.id) || (t.current = s.feedItem.id, e.openQuestion(s.feedItem.id, s.feedItem))), !s && t.current && (e.closeQuestion(t.current), t.current = "");
28
29
  }), () => {
29
- }), [e, o, r]), n ? /* @__PURE__ */ c(I, {
30
- hideHeader: p,
30
+ }), [e, o, r]), n ? /* @__PURE__ */ d(b, {
31
+ skipAutoClose: p,
32
+ hideHeader: f,
31
33
  gamification: e,
32
34
  hideSponsor: !0
33
35
  }) : null;
34
- }, h = ({
36
+ }, A = ({
35
37
  sdk: e,
36
38
  persistent: o,
37
- insightId: p,
39
+ skipAutoClose: p,
40
+ insightId: f,
38
41
  hideHeader: r
39
42
  }) => {
40
- if (!d(e.featuresList.getStore()))
43
+ if (!Q(e.featuresList.getStore()))
41
44
  return null;
42
- const n = e.getFeature(m.GAMES);
43
- return n ? /* @__PURE__ */ c(b, {
44
- insightId: p,
45
+ const n = e.getFeature(S.GAMES);
46
+ return n ? /* @__PURE__ */ d(v, {
47
+ insightId: f,
45
48
  persistent: o,
46
49
  hideHeader: r,
47
- gamification: n
50
+ gamification: n,
51
+ skipAutoClose: p
48
52
  }) : null;
49
53
  };
50
54
  export {
51
- I as QuestionWrap,
52
- h as StreamLayerSDKInsight
55
+ b as QuestionWrap,
56
+ A as StreamLayerSDKInsight
53
57
  };
@@ -1,4 +1,8 @@
1
1
  import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
2
+ export declare const SDKHeader: import('react').ForwardRefExoticComponent<{
3
+ sdk: StreamLayerSDK;
4
+ className?: string;
5
+ } & import('react').RefAttributes<HTMLDivElement | null>>;
2
6
  export declare const SDKNavigation: import('react').ForwardRefExoticComponent<{
3
7
  sdk: StreamLayerSDK;
4
8
  className?: string;