@streamlayer/react-ui 1.2.1 → 1.3.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 (142) hide show
  1. package/lib/app/app/Advertisement/index.d.ts +2 -1
  2. package/lib/app/app/Advertisement/index.js +73 -61
  3. package/lib/app/app/Features/FeatureProvider.d.ts +0 -1
  4. package/lib/app/app/Features/Gamification/Leaderboard.d.ts +0 -1
  5. package/lib/app/app/Features/Gamification/Question.d.ts +3 -1
  6. package/lib/app/app/Features/Gamification/Question.js +45 -41
  7. package/lib/app/app/Features/Gamification/QuestionsList.d.ts +0 -1
  8. package/lib/app/app/Features/Gamification/Tabs.d.ts +0 -1
  9. package/lib/app/app/Features/Gamification/UserSummary.d.ts +0 -1
  10. package/lib/app/app/Features/Gamification/gamification-feature.d.ts +0 -1
  11. package/lib/app/app/Features/Gamification/index.d.ts +0 -1
  12. package/lib/app/app/Features/index.d.ts +0 -1
  13. package/lib/app/app/Insight/index.d.ts +18 -0
  14. package/lib/app/app/Insight/index.js +62 -0
  15. package/lib/app/app/Navigation/index.d.ts +0 -1
  16. package/lib/app/app/Navigation/index.js +39 -31
  17. package/lib/app/app/Notifications/Onboarding/Notification/index.d.ts +0 -1
  18. package/lib/app/app/Notifications/Onboarding/index.d.ts +0 -1
  19. package/lib/app/app/Notifications/index.d.ts +0 -1
  20. package/lib/app/app/Notifications/styles.d.ts +1 -1
  21. package/lib/app/app/Points/index.d.ts +0 -1
  22. package/lib/app/app/index.d.ts +0 -1
  23. package/lib/app/app/story/index.d.ts +2 -10
  24. package/lib/app/app/story/index.js +44 -89
  25. package/lib/app/app/story/insight/index.d.ts +8 -0
  26. package/lib/app/app/story/insight/index.js +57 -0
  27. package/lib/app/app/story/insight/styles.d.ts +6 -0
  28. package/lib/app/app/story/insight/styles.js +30 -0
  29. package/lib/app/app/story/insight/video.d.ts +4 -0
  30. package/lib/app/app/story/insight/video.js +30 -0
  31. package/lib/app/app/story/promotion/content.d.ts +3 -0
  32. package/lib/app/app/story/{content.js → promotion/content.js} +22 -18
  33. package/lib/app/app/story/promotion/index.d.ts +9 -0
  34. package/lib/app/app/story/promotion/index.js +54 -0
  35. package/lib/app/app/story/promotion/styles.d.ts +6 -0
  36. package/lib/app/app/story/promotion/styles.js +35 -0
  37. package/lib/app/app/story/promotion/video.d.ts +8 -0
  38. package/lib/app/app/story/promotion/video.js +98 -0
  39. package/lib/app/app/story/settings/index.d.ts +1 -0
  40. package/lib/app/app/story/settings/index.js +14 -0
  41. package/lib/app/app/story/styles.d.ts +1 -6
  42. package/lib/app/app/story/styles.js +9 -34
  43. package/lib/app/app/story/video.d.ts +1 -10
  44. package/lib/app/app/story/video.js +35 -62
  45. package/lib/app/app/useApp.d.ts +0 -1
  46. package/lib/app/app/useAppContext.d.ts +0 -1
  47. package/lib/app/login/demo.d.ts +0 -1
  48. package/lib/app/login/demo.js +23 -9
  49. package/lib/app/masters/Features/FeatureProvider.d.ts +0 -1
  50. package/lib/app/masters/Features/Gamification/Leaderboard.d.ts +0 -1
  51. package/lib/app/masters/Features/Gamification/Question.d.ts +0 -1
  52. package/lib/app/masters/Features/Gamification/QuestionsList.d.ts +0 -1
  53. package/lib/app/masters/Features/Gamification/Tabs.d.ts +0 -1
  54. package/lib/app/masters/Features/Gamification/UserSummary.d.ts +0 -1
  55. package/lib/app/masters/Features/Gamification/gamification-feature.d.ts +0 -1
  56. package/lib/app/masters/Features/Gamification/index.d.ts +0 -1
  57. package/lib/app/masters/Features/index.d.ts +0 -1
  58. package/lib/app/masters/Navigation/MastersNavigation/index.d.ts +0 -1
  59. package/lib/app/masters/Notifications/Onboarding/Notification/index.d.ts +0 -1
  60. package/lib/app/masters/Notifications/Onboarding/index.d.ts +0 -1
  61. package/lib/app/masters/Notifications/index.d.ts +0 -1
  62. package/lib/app/masters/Notifications/styles.d.ts +1 -1
  63. package/lib/app/masters/Points/index.d.ts +0 -1
  64. package/lib/app/masters/masters.d.ts +0 -1
  65. package/lib/app/masters/useMastersApp.d.ts +0 -1
  66. package/lib/app/masters/useMastersContext.d.ts +0 -1
  67. package/lib/app/styles.d.ts +3 -3
  68. package/lib/app/useClipboardCopy.d.ts +0 -1
  69. package/lib/app/useSdkFeature.d.ts +0 -1
  70. package/lib/app/useSdkResponsive.d.ts +0 -1
  71. package/lib/app/useSdkScroll.d.ts +0 -1
  72. package/lib/assets/style.css +1 -1
  73. package/lib/ui/advertisement/banner/index.d.ts +1 -2
  74. package/lib/ui/advertisement/banner/index.js +16 -28
  75. package/lib/ui/advertisement/banner/styles.d.ts +3 -0
  76. package/lib/ui/advertisement/banner/styles.js +20 -0
  77. package/lib/ui/advertisement/index.d.ts +0 -1
  78. package/lib/ui/advertisement/index.js +13 -12
  79. package/lib/ui/advertisement/mock.d.ts +0 -1
  80. package/lib/ui/advertisement/overlay/index.d.ts +2 -1
  81. package/lib/ui/advertisement/overlay/index.js +61 -58
  82. package/lib/ui/advertisement/overlay/styles.d.ts +8 -4
  83. package/lib/ui/advertisement/overlay/styles.js +70 -62
  84. package/lib/ui/animated-counter/index.d.ts +0 -1
  85. package/lib/ui/gamification/constants.d.ts +0 -1
  86. package/lib/ui/gamification/detail/header/index.d.ts +0 -1
  87. package/lib/ui/gamification/insight/index.d.ts +0 -1
  88. package/lib/ui/gamification/insight-list/index.d.ts +0 -1
  89. package/lib/ui/gamification/leaderboard/index.d.ts +0 -1
  90. package/lib/ui/gamification/leaderboard/list-item/index.d.ts +0 -1
  91. package/lib/ui/gamification/leaderboard/static.d.ts +0 -1
  92. package/lib/ui/gamification/onboarding/index.d.ts +0 -1
  93. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +0 -1
  94. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.d.ts +0 -1
  95. package/lib/ui/gamification/onboarding/slides/onboarding-rules/index.d.ts +0 -1
  96. package/lib/ui/gamification/question/index.d.ts +0 -1
  97. package/lib/ui/gamification/question/insight/index.d.ts +0 -1
  98. package/lib/ui/gamification/question/list/index.d.ts +0 -1
  99. package/lib/ui/gamification/question/notification/index.d.ts +0 -1
  100. package/lib/ui/gamification/question/notification/insight/index.d.ts +0 -1
  101. package/lib/ui/gamification/question/notification/prediction-result/animation-lines/styles.d.ts +14 -14
  102. package/lib/ui/gamification/question/notification/prediction-result/index.d.ts +0 -1
  103. package/lib/ui/gamification/question/notification/prediction-result/styles.d.ts +1 -1
  104. package/lib/ui/gamification/question/notification/tweet/index.d.ts +0 -1
  105. package/lib/ui/gamification/question/twitter/index.d.ts +0 -1
  106. package/lib/ui/gamification/vote/alert/index.d.ts +0 -1
  107. package/lib/ui/gamification/vote/feedback/index.d.ts +0 -1
  108. package/lib/ui/gamification/vote/index.d.ts +0 -1
  109. package/lib/ui/gamification/vote/insight-details/index.d.ts +0 -1
  110. package/lib/ui/gamification/vote/insight-details/index.js +7 -8
  111. package/lib/ui/gamification/vote/insight-details/styles.d.ts +1 -0
  112. package/lib/ui/gamification/vote/insight-details/styles.js +10 -4
  113. package/lib/ui/gamification/vote/twitter-details/index.d.ts +0 -1
  114. package/lib/ui/gamification/vote/vote-option/index.d.ts +0 -1
  115. package/lib/ui/gamification/vote/vote-option/styles.d.ts +2 -2
  116. package/lib/ui/gamification/vote/win-bar/index.d.ts +0 -1
  117. package/lib/ui/link/index.d.ts +1 -0
  118. package/lib/ui/link/index.js +9 -0
  119. package/lib/ui/navigation/button/Channels.d.ts +0 -1
  120. package/lib/ui/navigation/button/FeaturedGroups.d.ts +0 -1
  121. package/lib/ui/navigation/button/LeaderBoard.d.ts +0 -1
  122. package/lib/ui/navigation/button/index.d.ts +0 -1
  123. package/lib/ui/navigation/index.d.ts +0 -1
  124. package/lib/ui/questions/insight/index.d.ts +0 -1
  125. package/lib/ui/questions/twitter/index.d.ts +0 -1
  126. package/lib/ui/questions/twitter/styles.d.ts +2 -2
  127. package/lib/ui/show-in/index.d.ts +0 -1
  128. package/lib/ui/theme/breakpoints.d.ts +0 -1
  129. package/lib/ui/theme/index.d.ts +1 -0
  130. package/lib/ui/theme/index.js +4 -3
  131. package/lib/ui/theme/masters-theme.d.ts +0 -1
  132. package/lib/ui/theme/theme.js +42 -16
  133. package/lib/ui/timer/index.d.ts +0 -1
  134. package/lib/ui/video-player/index.d.ts +1 -0
  135. package/lib/ui/video-player/index.js +43 -43
  136. package/lib/utils/debug/index.js +45 -19
  137. package/package.json +26 -26
  138. package/lib/app/app/story/content.d.ts +0 -4
  139. package/lib/app/app/story/useResponsive.d.ts +0 -1
  140. package/lib/app/app/story/useResponsive.js +0 -15
  141. /package/lib/app/app/story/{login.d.ts → settings/login.d.ts} +0 -0
  142. /package/lib/app/app/story/{login.js → settings/login.js} +0 -0
@@ -1,8 +1,9 @@
1
1
  import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
2
-
3
2
  export declare const AdvertisementUIWrap: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
3
  export type StreamLayerSDKAdvertisementProps = {
5
4
  event?: string;
5
+ isMobileScreen?: boolean;
6
+ persistent?: boolean;
6
7
  sidebar?: 'left' | 'right';
7
8
  banner?: 'top' | 'bottom';
8
9
  layoutMode?: 'cover' | 'side-by-side';
@@ -1,89 +1,101 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { styled as c } from "@linaria/react";
3
- import { useStore as m } from "@nanostores/react";
4
- import { useAnalyticsListener as f } from "../../../hooks/analytics.js";
5
- import { useEffect as u, useRef as v, useMemo as d } from "react";
6
- import { eventBus as p } from "@streamlayer/sdk-web-interfaces";
7
- import { FeatureType as A } from "@streamlayer/sdk-web-types";
8
- import { useAppApp as y } from "../useApp.js";
9
- import { AdvertisementUI as g } from "../../../ui/advertisement/index.js";
10
- const h = /* @__PURE__ */ c("div")({
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { styled as u } from "@linaria/react";
3
+ import { useStore as f } from "@nanostores/react";
4
+ import { useAnalyticsListener as p } from "../../../hooks/analytics.js";
5
+ import { useEffect as v, useRef as A, useMemo as y } from "react";
6
+ import { eventBus as d } from "@streamlayer/sdk-web-interfaces";
7
+ import { FeatureType as g, PromotionType as S } from "@streamlayer/sdk-web-types";
8
+ import { useAppApp as b } from "../useApp.js";
9
+ import { AdvertisementUI as h } from "../../../ui/advertisement/index.js";
10
+ const L = /* @__PURE__ */ u("div")({
11
11
  name: "AdvertisementUIWrap",
12
12
  class: "aa6pjif",
13
13
  propsAsIs: !1
14
- }), S = (e) => {
15
- const t = e.target;
16
- t instanceof HTMLAnchorElement && t.target === "_blank" && t.getAttribute("data-analytics") === "web-link" && p.emit("poll", {
17
- action: "navigated",
18
- payload: {}
19
- });
20
- }, L = ({
21
- gamification: e,
22
- layoutMode: t,
23
- sidebar: r,
24
- banner: i
14
+ }), E = (t) => {
15
+ const e = t.target;
16
+ if (e instanceof HTMLAnchorElement && e.target === "_blank") {
17
+ const i = e.getAttribute("data-promo-id") || "", r = e.getAttribute("data-promo-type") || S.UNSET;
18
+ e.getAttribute("data-analytics") === "button" && d.emit("advertisement", {
19
+ action: "buttonSelect",
20
+ payload: {
21
+ advertisementId: i,
22
+ advertisementType: r
23
+ }
24
+ }), e.getAttribute("data-analytics") === "banner" && d.emit("advertisement", {
25
+ action: "bannerSelect",
26
+ payload: {
27
+ advertisementId: i,
28
+ advertisementType: r
29
+ }
30
+ });
31
+ }
32
+ }, I = ({
33
+ gamification: t,
34
+ layoutMode: e,
35
+ sidebar: i,
36
+ banner: r,
37
+ isMobileScreen: c,
38
+ persistent: o
25
39
  }) => {
26
- const o = v(null), a = m(e.advertisement.$list), n = d(
27
- () => e.advertisement.getActiveAdvertisement(),
40
+ const a = A(null), s = f(t.advertisement.$list), n = y(
41
+ () => t.advertisement.getActiveAdvertisement(o),
28
42
  // fire getActiveNotification when notifications were updated
29
43
  // eslint-disable-next-line react-hooks/exhaustive-deps
30
- [a]
44
+ [s, o]
31
45
  );
32
- return f(o, {
46
+ return p(a, {
33
47
  enabled: !!n,
34
48
  event: "click",
35
- listener: S
36
- }), n ? /* @__PURE__ */ s(h, {
37
- ref: o,
49
+ listener: E
50
+ }), n ? /* @__PURE__ */ m(L, {
51
+ ref: a,
38
52
  style: {
39
- height: !i && !r ? "auto" : "100%"
53
+ height: !r && !i ? "auto" : "100%"
40
54
  },
41
- children: /* @__PURE__ */ s(g, {
42
- sidebar: r,
43
- banner: i,
55
+ className: c ? "mobile-view" : "",
56
+ children: /* @__PURE__ */ m(h, {
57
+ sidebar: i,
58
+ banner: r,
44
59
  advertisement: n,
45
- layoutMode: t
60
+ layoutMode: e
46
61
  })
47
62
  }) : null;
48
- }, K = ({
49
- sdk: e,
50
- sidebar: t,
51
- banner: r,
52
- event: i,
53
- layoutMode: o
63
+ }, O = ({
64
+ sdk: t,
65
+ sidebar: e,
66
+ banner: i,
67
+ event: r,
68
+ layoutMode: c,
69
+ isMobileScreen: o,
70
+ persistent: a
54
71
  }) => {
55
72
  const {
56
- deactivate: a
57
- } = y(e);
58
- u(() => {
59
- i ? e.createEventSession(i) : a();
60
- }, [i, a, e]);
61
- const n = m(e.featuresList.getStore());
62
- if (t && r)
63
- return /* @__PURE__ */ s("div", {
73
+ deactivate: s
74
+ } = b(t);
75
+ v(() => {
76
+ r ? t.createEventSession(r) : s();
77
+ }, [r, s, t]);
78
+ const n = f(t.featuresList.getStore());
79
+ if (e && i)
80
+ return /* @__PURE__ */ m("div", {
64
81
  style: {
65
82
  color: "red"
66
83
  },
67
84
  children: "define either sidebar or banner, not both."
68
85
  });
69
- if (!t && !r && o)
70
- return /* @__PURE__ */ s("div", {
71
- style: {
72
- color: "red"
73
- },
74
- children: "layoutMode property unavailable for the overlay mode."
75
- });
76
86
  if (!n)
77
87
  return null;
78
- const l = e.getFeature(A.GAMES);
79
- return l ? /* @__PURE__ */ s(L, {
88
+ const l = t.getFeature(g.GAMES);
89
+ return l ? /* @__PURE__ */ m(I, {
80
90
  gamification: l,
81
- sidebar: t,
82
- banner: r,
83
- layoutMode: o
91
+ sidebar: e,
92
+ banner: i,
93
+ layoutMode: c,
94
+ isMobileScreen: o,
95
+ persistent: a
84
96
  }) : null;
85
97
  };
86
98
  export {
87
- h as AdvertisementUIWrap,
88
- K as StreamLayerSDKAdvertisement
99
+ L as AdvertisementUIWrap,
100
+ O as StreamLayerSDKAdvertisement
89
101
  };
@@ -1,6 +1,5 @@
1
1
  import { Features } from '@streamlayer/sdk-web-features';
2
2
  import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
3
-
4
3
  /** Here we check data, render loaders, load data and perform some side effects for the active feature */
5
4
  export declare const FeatureProvider: React.FC<{
6
5
  feature: Features;
@@ -1,7 +1,6 @@
1
1
  import { ScrollNodeRef } from '../../..';
2
2
  import { ScrollStore } from '../../../useSdkScroll';
3
3
  import { Gamification } from '@streamlayer/feature-gamification';
4
-
5
4
  export declare const Leaderboard: React.FC<{
6
5
  gamification: Gamification;
7
6
  scrollNode: ScrollNodeRef;
@@ -1,5 +1,7 @@
1
1
  import { Gamification } from '@streamlayer/feature-gamification';
2
-
3
2
  export declare const Question: React.FC<{
4
3
  gamification: Gamification;
4
+ hideSponsor?: boolean;
5
+ className?: string;
6
+ hideHeader?: boolean;
5
7
  }>;
@@ -1,69 +1,73 @@
1
- import { jsxs as a, jsx as r } from "react/jsx-runtime";
2
- import { styled as c } from "@linaria/react";
3
- import { useStore as u } from "@nanostores/react";
4
- import { useAppContext as m } from "../../useAppContext.js";
5
- import { QuestionType as p } from "@streamlayer/sdk-web-types";
6
- import { VoteHeader as f } from "../../../../ui/gamification/detail/header/index.js";
7
- import { Sponsor as b } from "../../../../ui/gamification/detail/sponsor/index.js";
8
- import { Vote as y, VoteSkeleton as V } from "../../../../ui/gamification/vote/index.js";
9
- import { InsightDetails as d } from "../../../../ui/gamification/vote/insight-details/index.js";
10
- import { TwitterDetails as h } from "../../../../ui/gamification/vote/twitter-details/index.js";
11
- const x = /* @__PURE__ */ c("div")({
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")({
12
12
  name: "QuestionContainer",
13
13
  class: "q14ckf9e",
14
14
  propsAsIs: !1
15
- }), S = ({
15
+ }), v = ({
16
16
  openedQuestion: t
17
17
  }) => {
18
- var e, s;
18
+ var s, i;
19
19
  const {
20
20
  sdk: o
21
- } = m();
22
- return ((e = t == null ? void 0 : t.attributes) == null ? void 0 : e.attributes.case) === "insight" ? /* @__PURE__ */ r(d, {
21
+ } = b();
22
+ return ((s = t == null ? void 0 : t.attributes) == null ? void 0 : s.attributes.case) === "insight" ? /* @__PURE__ */ r(S, {
23
23
  ...t.attributes.attributes.value,
24
24
  controlVideo: o == null ? void 0 : o.controlVideoPlayer
25
- }) : ((s = t == null ? void 0 : t.attributes) == null ? void 0 : s.attributes.case) === "tweet" ? /* @__PURE__ */ r(h, {
25
+ }) : ((i = t == null ? void 0 : t.attributes) == null ? void 0 : i.attributes.case) === "tweet" ? /* @__PURE__ */ r(g, {
26
26
  ...t.attributes.attributes.value,
27
27
  controlVideo: o == null ? void 0 : o.controlVideoPlayer
28
28
  }) : null;
29
- }, g = ({
29
+ }, D = ({
30
30
  extendedQuestion: t,
31
31
  vote: o,
32
- close: e
32
+ close: s
33
33
  }) => {
34
34
  const {
35
- loading: s,
36
- data: i
35
+ loading: i,
36
+ data: e
37
37
  } = t;
38
- return i ? /* @__PURE__ */ r(y, {
38
+ return e ? /* @__PURE__ */ r(h, {
39
39
  vote: o,
40
- close: e,
41
- openedQuestion: i,
42
- isLoading: !!s
43
- }) : /* @__PURE__ */ r(V, {});
44
- }, I = ({
45
- gamification: t
40
+ close: s,
41
+ openedQuestion: e,
42
+ isLoading: !!i
43
+ }) : /* @__PURE__ */ r(x, {});
44
+ }, E = ({
45
+ gamification: t,
46
+ hideSponsor: o,
47
+ className: s,
48
+ hideHeader: i
46
49
  }) => {
47
- var i, n, l;
48
- const o = u(t.openedQuestion.$store), e = u(t.openedQuestion.$extendedStore);
49
- if (!o)
50
+ var u, a, c;
51
+ const e = m(t.openedQuestion.$store), n = m(t.openedQuestion.$extendedStore);
52
+ if (!e)
50
53
  return null;
51
- const s = o.type;
52
- return /* @__PURE__ */ a(x, {
53
- children: [/* @__PURE__ */ r(f, {
54
+ const l = e.type;
55
+ return /* @__PURE__ */ p(q, {
56
+ className: s,
57
+ children: [!i && /* @__PURE__ */ r(V, {
54
58
  close: t.closeQuestion,
55
- type: ((i = o.attributes) == null ? void 0 : i.type) || p.UNSET
56
- }), s === "question" && /* @__PURE__ */ r(g, {
59
+ type: ((u = e.attributes) == null ? void 0 : u.type) || y.UNSET
60
+ }), l === "question" && /* @__PURE__ */ r(D, {
57
61
  vote: t.submitAnswer,
58
62
  close: t.closeQuestion,
59
- extendedQuestion: e
60
- }), s !== "question" && /* @__PURE__ */ r(S, {
61
- openedQuestion: o
62
- }), /* @__PURE__ */ r(b, {
63
- sponsorLogo: (l = (n = e.data) == null ? void 0 : n.sponsorship) == null ? void 0 : l.logo
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
64
68
  })]
65
69
  });
66
70
  };
67
71
  export {
68
- I as Question
72
+ E as Question
69
73
  };
@@ -1,5 +1,4 @@
1
1
  import { Gamification } from '@streamlayer/feature-gamification';
2
-
3
2
  export declare const QuestionsList: React.FC<{
4
3
  store: ReturnType<Exclude<Gamification['feedList'], undefined>['getStore']>;
5
4
  openQuestion: (questionId: string) => void;
@@ -2,7 +2,6 @@ import { AppNodeRef, ScrollNodeRef } from '../../..';
2
2
  import { ResponsiveStore } from '../../../useSdkResponsive';
3
3
  import { ScrollStore } from '../../../useSdkScroll';
4
4
  import { Gamification } from '@streamlayer/feature-gamification';
5
-
6
5
  export declare const Tabs: React.FC<{
7
6
  appNode: AppNodeRef;
8
7
  gamification: Gamification;
@@ -1,5 +1,4 @@
1
1
  import { Gamification } from '@streamlayer/feature-gamification';
2
-
3
2
  export declare const UserSummary: React.FC<{
4
3
  userSummary: Exclude<Gamification['userSummary'], undefined>;
5
4
  }>;
@@ -1,3 +1,2 @@
1
1
  import { GamificationOverlay } from './';
2
-
3
2
  export default GamificationOverlay;
@@ -2,7 +2,6 @@ import { AppNodeRef, ScrollNodeRef } from '../../..';
2
2
  import { ResponsiveStore } from '../../../useSdkResponsive';
3
3
  import { ScrollStore } from '../../../useSdkScroll';
4
4
  import { Gamification as GamificationClass } from '@streamlayer/feature-gamification';
5
-
6
5
  export declare const GamificationOverlay: React.FC<{
7
6
  gamification: GamificationClass;
8
7
  className?: string;
@@ -3,7 +3,6 @@ import { ResponsiveStore } from '../../useSdkResponsive';
3
3
  import { ScrollStore } from '../../useSdkScroll';
4
4
  import { Features } from '@streamlayer/sdk-web-features';
5
5
  import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
6
-
7
6
  /** render feature by type */
8
7
  export declare const ActiveFeature: React.FC<{
9
8
  sdk: StreamLayerSDK;
@@ -0,0 +1,18 @@
1
+ import { Gamification } from '@streamlayer/feature-gamification';
2
+ import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
3
+ export declare const QuestionWrap: {
4
+ __wyw_meta: unknown;
5
+ } & import('react').FC<{
6
+ gamification: Gamification;
7
+ hideSponsor?: boolean;
8
+ className?: string;
9
+ hideHeader?: boolean;
10
+ }>;
11
+ export type StreamLayerSDKInsightProps = {
12
+ event?: string;
13
+ hideHeader?: boolean;
14
+ persistent?: boolean;
15
+ };
16
+ export declare const StreamLayerSDKInsight: React.FC<StreamLayerSDKInsightProps & {
17
+ sdk: StreamLayerSDK;
18
+ }>;
@@ -0,0 +1,62 @@
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { styled as S } from "@linaria/react";
3
+ import { useStore as m } from "@nanostores/react";
4
+ import { useEffect as c } from "react";
5
+ import { FeatureType as h, QuestionStatus as l } from "@streamlayer/sdk-web-types";
6
+ import { Question as d } from "../Features/Gamification/Question.js";
7
+ import { useAppApp as Q } from "../useApp.js";
8
+ import { ShowIn as I } from "../../../ui/show-in/index.js";
9
+ const a = () => d, y = /* @__PURE__ */ S(a())({
10
+ name: "QuestionWrap",
11
+ class: "q10hhsxv",
12
+ propsAsIs: !0
13
+ }), A = ({
14
+ gamification: e,
15
+ persistent: t,
16
+ hideHeader: n
17
+ }) => {
18
+ const i = m(e.openedQuestion.$store);
19
+ return c(() => e.feedList.getStore().subscribe(({
20
+ data: o
21
+ }) => {
22
+ if (o) {
23
+ const s = o, r = s == null ? void 0 : s.find(({
24
+ type: f,
25
+ attributes: u
26
+ }) => f === "insight" && (u == null ? void 0 : u.status) === l.ACTIVE);
27
+ r && (!t || e.isOpenedQuestion(r.id) || e.openQuestion(r.id, r));
28
+ }
29
+ }), [e, t]), i ? /* @__PURE__ */ p(I, {
30
+ style: {
31
+ height: "100%"
32
+ },
33
+ children: /* @__PURE__ */ p(y, {
34
+ hideHeader: n,
35
+ gamification: e,
36
+ hideSponsor: !0
37
+ })
38
+ }) : null;
39
+ }, F = ({
40
+ sdk: e,
41
+ event: t,
42
+ persistent: n,
43
+ hideHeader: i
44
+ }) => {
45
+ const {
46
+ deactivate: o
47
+ } = Q(e);
48
+ if (c(() => {
49
+ t ? e.createEventSession(t) : o();
50
+ }, [t, o, e]), !m(e.featuresList.getStore()))
51
+ return null;
52
+ const r = e.getFeature(h.GAMES);
53
+ return r ? /* @__PURE__ */ p(A, {
54
+ persistent: n,
55
+ hideHeader: i,
56
+ gamification: r
57
+ }) : null;
58
+ };
59
+ export {
60
+ y as QuestionWrap,
61
+ F as StreamLayerSDKInsight
62
+ };
@@ -1,5 +1,4 @@
1
1
  import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
2
-
3
2
  export declare const SDKNavigation: import('react').ForwardRefExoticComponent<{
4
3
  sdk: StreamLayerSDK;
5
4
  className?: string;
@@ -1,61 +1,69 @@
1
- import { jsx as i, jsxs as f } from "react/jsx-runtime";
2
- import { styled as u } from "@linaria/react";
3
- import { useStore as n } from "@nanostores/react";
4
- import { forwardRef as y, useMemo as p } from "react";
1
+ import { jsx as e, jsxs as y } from "react/jsx-runtime";
2
+ import { styled as g } from "@linaria/react";
3
+ import { useStore as l } from "@nanostores/react";
4
+ import { forwardRef as h, useMemo as m } from "react";
5
5
  import { AvailableFeatures as S } from "@streamlayer/sdk-web-features";
6
- import { FeatureType as g } from "@streamlayer/sdk-web-types";
7
- import { SvgIcon as h } from "../../../ui/icons/index.js";
8
- import { Button as s } from "../../../ui/navigation/button/index.js";
9
- import { Navigation as C, NavigationItems as F } from "../../../ui/navigation/masters.js";
10
- const x = () => h, A = /* @__PURE__ */ u(x())({
6
+ import { FeatureType as d } from "@streamlayer/sdk-web-types";
7
+ import { SvgIcon as F } from "../../../ui/icons/index.js";
8
+ import { Button as n } from "../../../ui/navigation/button/index.js";
9
+ import { Navigation as A, NavigationItems as v } from "../../../ui/navigation/masters.js";
10
+ const C = () => F, x = /* @__PURE__ */ g(C())({
11
11
  name: "ButtonIcon",
12
12
  class: "b11wpe79",
13
13
  propsAsIs: !0
14
- }), K = y(({
15
- sdk: e,
16
- className: l
17
- }, m) => {
18
- const r = n(e.sdkStore.organizationSettings), t = n(e.sdkStore.streamSettings), a = n(e.getActiveFeature()), c = p(() => {
19
- const o = (t == null ? void 0 : t.data) || (r == null ? void 0 : r.data);
14
+ }), K = h(({
15
+ sdk: i,
16
+ className: f
17
+ }, u) => {
18
+ const t = l(i.sdkStore.organizationSettings), r = l(i.sdkStore.streamSettings), a = l(i.getActiveFeature()), p = m(() => {
19
+ const o = (r == null ? void 0 : r.data) || (t == null ? void 0 : t.data);
20
20
  return o != null && o.overlays ? o.overlays : [];
21
- }, [r, t]), d = p(() => [...c.filter(({
22
- enableSdkButton: o
23
- }) => o).map((o) => ({
21
+ }, [t, r]), s = m(() => [...p.filter(({
22
+ enableSdkButton: o,
23
+ type: c
24
+ }) => c === d.GAMES || o).map((o) => ({
24
25
  id: o.type,
25
- onClick: () => e.openFeature(o.type),
26
+ onClick: () => i.openFeature(o.type),
26
27
  disabled: !(o.type in S),
27
28
  label: o.name,
28
- icon: /* @__PURE__ */ i("img", {
29
+ icon: /* @__PURE__ */ e("img", {
29
30
  src: o.icon,
30
31
  alt: ""
31
32
  }),
32
33
  /** multiplied by 10 to add the ability to insert custom buttons between our buttons */
33
34
  position: o.position * 10
34
- }))].sort((o, v) => o.position - v.position), [c, e]);
35
- return /* @__PURE__ */ f(C, {
36
- className: l,
37
- children: [/* @__PURE__ */ i(F, {
38
- children: [/* @__PURE__ */ i(s, {
35
+ }))].sort((o, c) => o.position - c.position), [p, i]);
36
+ return /* @__PURE__ */ y(A, {
37
+ className: f,
38
+ children: [s.length !== 0 && /* @__PURE__ */ e(v, {
39
+ children: [/* @__PURE__ */ e(n, {
39
40
  id: "Channels",
40
- onClick: () => e.closeFeature(),
41
+ onClick: () => i.closeFeature(),
41
42
  label: "Channels",
42
43
  active: a === 0
43
- }, "Channels"), ...d.map((o) => o.id === g.GAMES ? /* @__PURE__ */ i(s, {
44
+ }, "Channels"), ...s.map((o) => o.id === d.GAMES ? /* @__PURE__ */ e(n, {
44
45
  ...o,
45
46
  active: o.id === a,
46
47
  label: "StreamLayer +",
47
48
  id: "featuredGroups",
48
- icon: /* @__PURE__ */ i(A, {
49
+ icon: /* @__PURE__ */ e(x, {
49
50
  name: "icon-btn-feature-groups",
50
51
  "data-selected": o.id === a
51
52
  })
52
- }, o.id) : /* @__PURE__ */ i(s, {
53
+ }, o.id) : /* @__PURE__ */ e(n, {
53
54
  ...o,
54
55
  icon: void 0,
55
56
  active: o.id === a
56
57
  }, o.id))]
57
- }), /* @__PURE__ */ i("div", {
58
- ref: m
58
+ }), !s.length && /* @__PURE__ */ e(v, {
59
+ children: [/* @__PURE__ */ e(n, {
60
+ id: "empty",
61
+ label: "No Features...",
62
+ active: !1,
63
+ disabled: !0
64
+ }, "empty")]
65
+ }), /* @__PURE__ */ e("div", {
66
+ ref: u
59
67
  })]
60
68
  });
61
69
  });
@@ -1,6 +1,5 @@
1
1
  import { Notification } from '@streamlayer/sdk-web-notifications';
2
2
  import { GameSettings } from '@streamlayer/sdk-web-types';
3
-
4
3
  export declare const Onboarding: React.FC<{
5
4
  close: Notification['close'];
6
5
  action: Notification['action'];
@@ -2,7 +2,6 @@ import { AppNodeRef } from '../../..';
2
2
  import { ResponsiveStore } from '../../../useSdkResponsive';
3
3
  import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
4
4
  import { Notification } from '@streamlayer/sdk-web-notifications';
5
-
6
5
  export declare const Onboarding: React.FC<{
7
6
  sdk: StreamLayerSDK;
8
7
  notification: Notification;
@@ -2,7 +2,6 @@ import { AppNodeRef, ScrollNodeRef, HeaderNodeRef } from '../..';
2
2
  import { ResponsiveStore } from '../../useSdkResponsive';
3
3
  import { ScrollStore } from '../../useSdkScroll';
4
4
  import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
5
-
6
5
  export declare const SDKNotifications: React.FC<{
7
6
  sdk: StreamLayerSDK;
8
7
  scrollNode: ScrollNodeRef;
@@ -3,7 +3,7 @@ export declare const InnerContainer: import('@linaria/react').StyledComponent<im
3
3
  export declare const HiddenContainer: {
4
4
  __wyw_meta: unknown;
5
5
  } & import('react').FunctionComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
6
- as?: import('react').ElementType;
6
+ as?: React.ElementType;
7
7
  }>;
8
8
  export declare const NotificationRefreshing: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
9
9
  export declare const Pill: any;
@@ -1,5 +1,4 @@
1
1
  import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
2
-
3
2
  export declare const StreamLayerSDKPoints: React.FC<{
4
3
  sdk: StreamLayerSDK;
5
4
  }>;
@@ -1,5 +1,4 @@
1
1
  import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
2
-
3
2
  export type AppAppChildrenProps = {
4
3
  activateEventWithId: (event: string) => void;
5
4
  deactivate: () => void;
@@ -1,10 +1,2 @@
1
- export declare const AppStory: React.FC<{
2
- hideSdk?: boolean;
3
- hideLogin?: boolean;
4
- hidePoints?: boolean;
5
- settings?: boolean;
6
- promotionId?: string;
7
- sidebar: 'left' | 'right';
8
- banner: 'top' | 'bottom';
9
- layoutMode: 'cover' | 'side-by-side';
10
- }>;
1
+ import { DebugProps } from '../../../utils/debug';
2
+ export declare const AppStory: React.FC<DebugProps>;