@streamlayer/react-ui 1.11.4 → 1.12.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 (47) hide show
  1. package/lib/app/app/Advertisement/index.d.ts +1 -0
  2. package/lib/app/app/Advertisement/index.js +86 -67
  3. package/lib/app/app/Features/Gamification/Tabs.js +13 -13
  4. package/lib/app/app/Navigation/index.js +70 -64
  5. package/lib/app/app/Notifications/Onboarding/index.js +66 -72
  6. package/lib/app/app/Notifications/index.d.ts +1 -0
  7. package/lib/app/app/Notifications/index.js +76 -72
  8. package/lib/app/app/index.js +28 -27
  9. package/lib/app/app/story/index.d.ts +3 -1
  10. package/lib/app/app/story/index.js +29 -26
  11. package/lib/app/app/story/promotion/video.js +34 -34
  12. package/lib/app/app/styles.d.ts +5 -0
  13. package/lib/app/app/styles.js +25 -20
  14. package/lib/assets/style.css +1 -1
  15. package/lib/ui/advertisement/index.d.ts +3 -0
  16. package/lib/ui/advertisement/index.js +25 -19
  17. package/lib/ui/advertisement/mock.d.ts +1 -0
  18. package/lib/ui/advertisement/mock.js +39 -5
  19. package/lib/ui/advertisement/overlay/externalAd/controls.d.ts +5 -0
  20. package/lib/ui/advertisement/overlay/externalAd/controls.js +33 -0
  21. package/lib/ui/advertisement/overlay/externalAd/index.d.ts +2 -0
  22. package/lib/ui/advertisement/overlay/externalAd/index.js +121 -0
  23. package/lib/ui/advertisement/overlay/index.d.ts +7 -2
  24. package/lib/ui/advertisement/overlay/index.js +67 -58
  25. package/lib/ui/close-btn/index.d.ts +1 -0
  26. package/lib/ui/close-btn/index.js +25 -23
  27. package/lib/ui/gamification/question/insight/styles.d.ts +10 -2
  28. package/lib/ui/gamification/question/insight/styles.js +8 -7
  29. package/lib/ui/gamification/question/notification/prediction-result/index.js +84 -64
  30. package/lib/ui/gamification/question/notification/prediction-result/styles.d.ts +2 -0
  31. package/lib/ui/gamification/question/notification/prediction-result/styles.js +36 -26
  32. package/lib/ui/gamification/question/twitter/styles.d.ts +5 -1
  33. package/lib/ui/gamification/question/twitter/styles.js +9 -8
  34. package/lib/ui/gamification/vote/alert/index.js +7 -8
  35. package/lib/ui/gamification/vote/alert/styles.d.ts +1 -0
  36. package/lib/ui/gamification/vote/alert/styles.js +12 -6
  37. package/lib/ui/gamification/vote/vote-option/index.js +59 -58
  38. package/lib/ui/icons/index.d.ts +1 -0
  39. package/lib/ui/icons/index.js +45 -44
  40. package/lib/ui/skeleton/index.d.ts +1 -1
  41. package/lib/ui/theme/constants.d.ts +32 -1
  42. package/lib/ui/theme/constants.js +50 -17
  43. package/lib/ui/theme/masters-theme.js +9 -4
  44. package/lib/ui/theme/theme.js +16 -9
  45. package/lib/ui/video-player/index.d.ts +2 -0
  46. package/lib/ui/video-player/index.js +57 -56
  47. package/package.json +14 -14
@@ -1,70 +1,64 @@
1
- import { jsx as r, jsxs as x, Fragment as L } from "react/jsx-runtime";
2
- import { styled as w } from "@linaria/react";
1
+ import { jsx as r, jsxs as L, Fragment as x } from "react/jsx-runtime";
2
+ import { styled as I } from "@linaria/react";
3
3
  import { useStore as T } from "@nanostores/react";
4
- import { useImagesPreload as B } from "../../../useImagesPreload.js";
5
- import { scrollIntoAppView as O } from "../../../useSdkScroll.js";
6
- import { useRef as E, useState as A, useMemo as _, useLayoutEffect as M, useEffect as P } from "react";
7
- import { FeatureType as R } from "@streamlayer/sdk-web-types";
8
- import { OnboardingUI as V } from "../../../../ui/gamification/onboarding/index.js";
9
- import { ModalPortal as W } from "../../../../ui/modal/index.js";
10
- import { ShowIn as $ } from "../../../../ui/show-in/index.js";
11
- import { Onboarding as S } from "./Notification/index.js";
4
+ import { useImagesPreload as O } from "../../../useImagesPreload.js";
5
+ import { scrollIntoAppView as _ } from "../../../useSdkScroll.js";
6
+ import { useRef as E, useState as A, useMemo as F, useLayoutEffect as M, useEffect as R } from "react";
7
+ import { FeatureType as V } from "@streamlayer/sdk-web-types";
8
+ import { OnboardingUI as W } from "../../../../ui/gamification/onboarding/index.js";
9
+ import { ModalPortal as $ } from "../../../../ui/modal/index.js";
10
+ import { ShowIn as j } from "../../../../ui/show-in/index.js";
11
+ import { Onboarding as w } from "./Notification/index.js";
12
12
  const C = [{
13
- graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_0.png",
13
+ graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/dark/step_1.png",
14
14
  tagline: "",
15
- headline: /* @__PURE__ */ x(L, {
16
- children: ["Welcome to ", /* @__PURE__ */ r("br", {}), " StreamLayer +"]
15
+ headline: /* @__PURE__ */ L(x, {
16
+ children: ["Welcome to ", /* @__PURE__ */ r("br", {}), " Live Challenge"]
17
17
  })
18
18
  }, {
19
- graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_2.png",
20
- headline: "Get real-time insights"
19
+ graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/dark/step_2.png",
20
+ headline: "Live insights, polls, trivia and predictions."
21
21
  }, {
22
- graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_3.png",
23
- headline: "Predictions, trivia & polls synced to match play"
24
- }, {
25
- graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_4.png",
26
- headline: "Win points for every answer you get right"
27
- }, {
28
- graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_5.png",
29
- headline: "Compete against friends on the leaderboard"
30
- }], j = /* @__PURE__ */ w("div")({
22
+ graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/dark/step_3.png",
23
+ headline: "Win points and play against friends."
24
+ }], P = /* @__PURE__ */ I("div")({
31
25
  name: "OnboardingContainer",
32
26
  class: "o1xni1kr",
33
27
  propsAsIs: !1
34
- }), G = () => $, q = /* @__PURE__ */ w(G())({
28
+ }), q = () => j, z = /* @__PURE__ */ I(q())({
35
29
  name: "OnboardingNotificationContainer",
36
30
  class: "o1vnouv7",
37
31
  propsAsIs: !0
38
- }), k = /* @__PURE__ */ w("div")({
32
+ }), S = /* @__PURE__ */ I("div")({
39
33
  name: "InnerContainer",
40
34
  class: "i59uefw",
41
35
  propsAsIs: !1
42
- }), z = ({
36
+ }), D = ({
43
37
  deepLink: l,
44
38
  onboardingOpts: e,
45
39
  notification: o,
46
- gamification: p,
47
- loading: i,
40
+ gamification: m,
41
+ loading: s,
48
42
  sdk: d
49
43
  }) => {
50
- var c, a, h, b, f, y, s;
51
- const u = T(p.friends.getStore()), [g, t] = A(void 0), v = _(() => {
52
- var m, I;
44
+ var c, a, b, h, f, v, i;
45
+ const p = T(m.friends.getStore()), [g, t] = A(void 0), y = F(() => {
46
+ var u, k;
53
47
  const n = d.getInviter();
54
- return n ? (I = (m = u.data) == null ? void 0 : m.find(({
55
- slId: F
56
- }) => F === n)) == null ? void 0 : I.name : "";
57
- }, [u.data, d]);
58
- return P(() => {
59
- const n = l.$store.subscribe((m) => {
60
- m && t(m.data);
48
+ return n ? (k = (u = p.data) == null ? void 0 : u.find(({
49
+ slId: B
50
+ }) => B === n)) == null ? void 0 : k.name : "";
51
+ }, [p.data, d]);
52
+ return R(() => {
53
+ const n = l.$store.subscribe((u) => {
54
+ u && t(u.data);
61
55
  });
62
56
  return () => {
63
57
  n();
64
58
  };
65
- }, [l.$store]), /* @__PURE__ */ r(j, {
66
- children: /* @__PURE__ */ r(V, {
67
- loading: i,
59
+ }, [l.$store]), /* @__PURE__ */ r(P, {
60
+ children: /* @__PURE__ */ r(W, {
61
+ loading: s,
68
62
  rules: [{
69
63
  label: "Answer as many questions as you like.",
70
64
  icon: "icon-btn-feature-groups"
@@ -78,82 +72,82 @@ const C = [{
78
72
  rulesBtnLabel: (c = e.rules) == null ? void 0 : c.buttonLabel,
79
73
  rulesTitle: (a = e.rules) == null ? void 0 : a.heading,
80
74
  termsTitle: "Terms and Conditions",
81
- termsText: (h = e.rules) == null ? void 0 : h.terms,
75
+ termsText: (b = e.rules) == null ? void 0 : b.terms,
82
76
  steps: C,
83
- primaryColor: (b = e.inviteCard) == null ? void 0 : b.iconColor,
77
+ primaryColor: (h = e.inviteCard) == null ? void 0 : h.iconColor,
84
78
  inviteLink: g,
85
79
  inviteCardTitle: (f = e.inviteCard) == null ? void 0 : f.heading,
86
- inviteCardSubtext: (y = e.inviteCard) == null ? void 0 : y.subtext,
87
- inviteCardBtnLabel: (s = e.inviteCard) == null ? void 0 : s.buttonLabel,
80
+ inviteCardSubtext: (v = e.inviteCard) == null ? void 0 : v.subtext,
81
+ inviteCardBtnLabel: (i = e.inviteCard) == null ? void 0 : i.buttonLabel,
88
82
  onClose: () => {
89
83
  var n;
90
84
  (n = o.close) == null || n.call(o);
91
85
  },
92
- gamification: p,
86
+ gamification: m,
93
87
  sdk: d,
94
- inviterName: v
88
+ inviterName: y
95
89
  })
96
90
  });
97
91
  }, ne = ({
98
92
  sdk: l,
99
93
  notification: e,
100
94
  saveHeight: o,
101
- style: p,
102
- appNode: i,
95
+ style: m,
96
+ appNode: s,
103
97
  sdkInDesktopView: d,
104
- responsiveStore: u
98
+ responsiveStore: p
105
99
  }) => {
106
- const g = E(null), t = e.data.onboarding, [v, c] = A(t == null ? void 0 : t.instantOpen), a = l.getFeature(R.GAMES), h = _(() => C == null ? void 0 : C.map(({
107
- graphicSrc: s
108
- }) => s), []), {
109
- screen: b
110
- } = T(u, {
100
+ const g = E(null), t = e.data.onboarding, [y, c] = A(t == null ? void 0 : t.instantOpen), a = l.getFeature(V.GAMES), b = F(() => C == null ? void 0 : C.map(({
101
+ graphicSrc: i
102
+ }) => i), []), {
103
+ screen: h
104
+ } = T(p, {
111
105
  keys: ["screen"]
112
106
  });
113
107
  M(() => {
114
- var s;
115
- o(((s = g.current) == null ? void 0 : s.getBoundingClientRect().height) || 0);
108
+ var i;
109
+ o(((i = g.current) == null ? void 0 : i.getBoundingClientRect().height) || 0);
116
110
  }, [o]);
117
111
  const {
118
112
  loading: f,
119
- throttled: y
120
- } = B(h);
121
- return v && a && t && i.current && !y ? /* @__PURE__ */ r(W, {
122
- container: i,
113
+ throttled: v
114
+ } = O(b);
115
+ return y && a && t && s.current && !v ? /* @__PURE__ */ r($, {
116
+ container: s,
123
117
  useContainer: !d,
124
- children: /* @__PURE__ */ r(z, {
118
+ children: /* @__PURE__ */ r(D, {
125
119
  notification: e,
126
120
  setOpened: c,
127
121
  gamification: a,
128
122
  onboardingOpts: t,
129
123
  deepLink: a.deepLink,
130
124
  loading: f,
131
- renderToNode: i,
125
+ renderToNode: s,
132
126
  sdk: l
133
127
  })
134
- }) : /* @__PURE__ */ x(L, {
135
- children: [/* @__PURE__ */ r(k, {
128
+ }) : /* @__PURE__ */ L(x, {
129
+ children: [/* @__PURE__ */ r(S, {
136
130
  ref: g,
137
131
  style: {
138
132
  position: "absolute",
139
133
  visibility: "hidden"
140
134
  },
141
- children: /* @__PURE__ */ r(S, {
135
+ children: /* @__PURE__ */ r(w, {
142
136
  close: () => {
143
137
  },
144
138
  action: () => {
145
139
  },
146
140
  onboarding: t
147
141
  })
148
- }), /* @__PURE__ */ r(q, {
149
- style: p,
142
+ }), /* @__PURE__ */ r(z, {
143
+ style: m,
150
144
  hiding: e.hiding,
151
- children: /* @__PURE__ */ r(k, {
152
- children: /* @__PURE__ */ r(S, {
145
+ children: /* @__PURE__ */ r(S, {
146
+ children: /* @__PURE__ */ r(w, {
153
147
  close: e.close,
154
148
  action: () => {
155
149
  var n;
156
- c(!0), (((n = i.current) == null ? void 0 : n.getBoundingClientRect().y) || 0) < 0 && O(i, b.size, {
150
+ c(!0), (((n = s.current) == null ? void 0 : n.getBoundingClientRect().y) || 0) < 0 && _(s, h.size, {
157
151
  behavior: "smooth"
158
152
  });
159
153
  },
@@ -9,4 +9,5 @@ export declare const SDKNotifications: React.FC<{
9
9
  headerNode: HeaderNodeRef;
10
10
  scrollStore: ScrollStore;
11
11
  responsiveStore: ResponsiveStore;
12
+ hasActiveFeature: boolean;
12
13
  }>;
@@ -1,9 +1,9 @@
1
- import { jsxs as y, Fragment as b, jsx as u } from "react/jsx-runtime";
1
+ import { jsxs as k, Fragment as b, jsx as u } from "react/jsx-runtime";
2
2
  import { cx as V } from "@linaria/core";
3
- import { useStore as g } from "@nanostores/react";
3
+ import { useStore as y } from "@nanostores/react";
4
4
  import { useAppContext as O } from "../useAppContext.js";
5
5
  import { scrollIntoAppView as T } from "../../useSdkScroll.js";
6
- import { useState as k, useMemo as D, useEffect as h, useRef as E, useCallback as w } from "react";
6
+ import { useState as I, useMemo as D, useEffect as a, useRef as E, useCallback as w } from "react";
7
7
  import { r as R } from "../../../index-B1QdimmR.js";
8
8
  import { eventBus as q } from "@streamlayer/sdk-web-interfaces";
9
9
  import { NotificationType as p } from "@streamlayer/sdk-web-notifications";
@@ -11,52 +11,54 @@ import { QuestionTypeData as C } from "../../../ui/gamification/constants.js";
11
11
  import { Notification as N } from "../../../ui/gamification/question/notification/index.js";
12
12
  import { PredictionResult as x } from "../../../ui/gamification/question/notification/prediction-result/index.js";
13
13
  import { Onboarding as P } from "./Onboarding/index.js";
14
- import { HiddenContainer as z, Container as A, InnerContainer as B, NotificationRefreshing as S, Pill as v } from "./styles.js";
15
- const H = (i) => {
16
- const [e, d] = k(0), s = E(null), l = D(() => new ResizeObserver((o) => {
17
- var c;
18
- for (const r of o)
19
- if (r.contentBoxSize) {
20
- const t = (c = s.current) == null ? void 0 : c.getBoundingClientRect();
21
- t && d(t.height);
14
+ import { HiddenContainer as z, Container as A, InnerContainer as B, NotificationRefreshing as H, Pill as S } from "./styles.js";
15
+ const v = (r) => {
16
+ const [e, d] = I(0), i = E(null), l = D(() => new ResizeObserver((o) => {
17
+ var h;
18
+ for (const c of o)
19
+ if (c.contentBoxSize) {
20
+ const n = (h = i.current) == null ? void 0 : h.getBoundingClientRect();
21
+ n && d(n.height);
22
22
  }
23
- }), []), n = w((o) => {
24
- s.current = o;
23
+ }), []), s = w((o) => {
24
+ i.current = o;
25
25
  }, []), f = w((o) => {
26
26
  d(o);
27
27
  }, []);
28
- return h(() => {
29
- const o = s.current;
28
+ return a(() => {
29
+ const o = i.current;
30
30
  return o ? (l.observe(o), () => {
31
31
  l.unobserve(o);
32
32
  }) : () => {
33
33
  };
34
- }, [i]), h(() => () => {
34
+ }, [r]), a(() => () => {
35
35
  l.disconnect();
36
- }), [n, e, f];
36
+ }), [s, e, f];
37
37
  }, Q = ({
38
- sdk: i,
38
+ sdk: r,
39
39
  notification: e,
40
40
  appNode: d,
41
- responsiveStore: s
41
+ responsiveStore: i,
42
+ hasActiveFeature: l
42
43
  }) => {
43
- var r, t;
44
+ var t, m;
44
45
  const {
45
- sdkInDesktopView: l
46
- } = g(s, {
46
+ sdkInDesktopView: s
47
+ } = y(i, {
47
48
  keys: ["sdkInDesktopView"]
48
49
  }), {
49
- sdk: n
50
- } = O(), [f, o, c] = H(e.id);
51
- return e.type === p.QUESTION ? /* @__PURE__ */ y(b, {
50
+ sdk: f
51
+ } = O(), [o, h, c] = v(e.id);
52
+ let n = h;
53
+ return l || (n = "auto"), e.type === p.QUESTION ? /* @__PURE__ */ k(b, {
52
54
  children: [/* @__PURE__ */ u(z, {
53
- ref: f,
55
+ ref: o,
54
56
  children: /* @__PURE__ */ u(N, {
55
57
  ...e
56
58
  })
57
- }), /* @__PURE__ */ y(A, {
59
+ }), /* @__PURE__ */ k(A, {
58
60
  style: {
59
- height: e.hiding ? 0 : o
61
+ height: e.hiding ? 0 : n
60
62
  },
61
63
  hiding: e.hiding,
62
64
  children: [/* @__PURE__ */ u(B, {
@@ -65,13 +67,13 @@ const H = (i) => {
65
67
  },
66
68
  children: /* @__PURE__ */ u(N, {
67
69
  ...e,
68
- controlVideo: n == null ? void 0 : n.controlVideoPlayer
70
+ controlVideo: f == null ? void 0 : f.controlVideoPlayer
69
71
  })
70
- }), /* @__PURE__ */ u(S, {}, e.id)]
72
+ }), /* @__PURE__ */ u(H, {}, e.id)]
71
73
  })]
72
- }) : e.type === p.QUESTION_RESOLVED && ((t = (r = e.data) == null ? void 0 : r.question) != null && t.predictionResult) ? /* @__PURE__ */ u(x, {
74
+ }) : e.type === p.QUESTION_RESOLVED && ((m = (t = e.data) == null ? void 0 : t.question) != null && m.predictionResult) ? /* @__PURE__ */ u(x, {
73
75
  style: {
74
- height: e.hiding ? 0 : o
76
+ height: e.hiding ? 0 : h
75
77
  },
76
78
  saveHeight: c,
77
79
  close: e.close,
@@ -79,62 +81,63 @@ const H = (i) => {
79
81
  ...e.data.question
80
82
  }) : e.type === p.ONBOARDING ? /* @__PURE__ */ u(P, {
81
83
  style: {
82
- height: e.hiding ? 0 : o
84
+ height: e.hiding ? 0 : n
83
85
  },
84
86
  saveHeight: c,
85
- sdk: i,
87
+ sdk: r,
86
88
  notification: e,
87
- sdkInDesktopView: l,
89
+ sdkInDesktopView: s,
88
90
  appNode: d,
89
- responsiveStore: s
91
+ responsiveStore: i
90
92
  }) : null;
91
93
  }, U = "p7vfi6t", j = ({
92
- pill: i,
94
+ pill: r,
93
95
  setPill: e,
94
96
  appNode: d,
95
- headerNode: s,
97
+ headerNode: i,
96
98
  scrollNode: l,
97
- responsiveStore: n,
99
+ responsiveStore: s,
98
100
  scrollStore: f
99
101
  }) => {
100
- var m, a;
102
+ var t, m;
101
103
  const {
102
104
  screen: o
103
- } = g(n, {
105
+ } = y(s, {
104
106
  keys: ["screen"]
105
107
  }), {
106
- tabsShown: c,
107
- scrollPosition: r
108
- } = g(f, {
108
+ tabsShown: h,
109
+ scrollPosition: c
110
+ } = y(f, {
109
111
  keys: ["tabsShown", "scrollPosition"]
110
112
  });
111
- h(() => {
112
- n.get().sdkInDesktopView ? r < 50 && e(null) : r > -50 && e(null);
113
- }, [r, n, e]);
114
- const t = n.get().sdkInDesktopView ? d : s;
115
- return !i || !t.current ? null : R.createPortal(/* @__PURE__ */ u(v, {
116
- title: i.type === p.QUESTION_RESOLVED ? "Prediction result" : `New ${((a = C[(m = i.data) == null ? void 0 : m.questionType]) == null ? void 0 : a.label) || "notification"}`,
113
+ a(() => {
114
+ s.get().sdkInDesktopView ? c < 50 && e(null) : c > -50 && e(null);
115
+ }, [c, s, e]);
116
+ const n = s.get().sdkInDesktopView ? d : i;
117
+ return !r || !n.current ? null : R.createPortal(/* @__PURE__ */ u(S, {
118
+ title: r.type === p.QUESTION_RESOLVED ? "Prediction result" : `New ${((m = C[(t = r.data) == null ? void 0 : t.questionType]) == null ? void 0 : m.label) || "notification"}`,
117
119
  onClick: () => {
118
- var I;
119
- n.get().sdkInDesktopView ? (I = l.current) == null || I.scrollTo({
120
+ var g;
121
+ s.get().sdkInDesktopView ? (g = l.current) == null || g.scrollTo({
120
122
  top: 0,
121
123
  behavior: "smooth"
122
124
  }) : T(d, o.size, {
123
125
  behavior: "smooth"
124
126
  }), e(null);
125
127
  },
126
- className: V(c && U, "sl-pill-button")
127
- }), t.current);
128
+ className: V(h && U, "sl-pill-button")
129
+ }), n.current);
128
130
  }, oe = ({
129
- sdk: i,
131
+ sdk: r,
130
132
  headerNode: e,
131
133
  scrollNode: d,
132
- responsiveStore: s,
134
+ responsiveStore: i,
133
135
  appNode: l,
134
- scrollStore: n
136
+ scrollStore: s,
137
+ hasActiveFeature: f
135
138
  }) => {
136
- const [f] = k(i.getNotificationsStore()), o = g(f), [c, r] = k(null), t = D(() => i.getActiveNotification(), [i, o]);
137
- return h(() => {
139
+ const [o] = I(r.getNotificationsStore()), h = y(o), [c, n] = I(null), t = D(() => r.getActiveNotification(), [r, h]);
140
+ return a(() => {
138
141
  t && q.emit("notification", {
139
142
  action: "rendered",
140
143
  payload: {
@@ -142,31 +145,32 @@ const H = (i) => {
142
145
  questionType: t.data.questionType
143
146
  }
144
147
  });
145
- }, [t]), h(() => {
148
+ }, [t]), a(() => {
146
149
  const {
147
150
  sdkInDesktopView: m,
148
- sdkInView: a
149
- } = s.get();
150
- t && (m || a) && (!m && a && r(t), m && window.requestAnimationFrame(() => {
151
- n.get().scrollPosition !== 0 && r(t);
151
+ sdkInView: g
152
+ } = i.get();
153
+ t && (m || g) && (!m && g && n(t), m && window.requestAnimationFrame(() => {
154
+ s.get().scrollPosition !== 0 && n(t);
152
155
  }));
153
- }, [t]), h(() => {
154
- t || r(null);
155
- }, [t]), /* @__PURE__ */ y(b, {
156
+ }, [t]), a(() => {
157
+ t || n(null);
158
+ }, [t]), /* @__PURE__ */ k(b, {
156
159
  children: [!c && t && /* @__PURE__ */ u(Q, {
157
160
  appNode: l,
158
- sdk: i,
161
+ sdk: r,
162
+ hasActiveFeature: f,
159
163
  notification: t,
160
- responsiveStore: s
164
+ responsiveStore: i
161
165
  }), c && /* @__PURE__ */ u(j, {
162
166
  pill: c,
163
- setPill: r,
167
+ setPill: n,
164
168
  appNode: l,
165
169
  notification: t,
166
170
  headerNode: e,
167
171
  scrollNode: d,
168
- scrollStore: n,
169
- responsiveStore: s
172
+ scrollStore: s,
173
+ responsiveStore: i
170
174
  })]
171
175
  });
172
176
  };
@@ -1,13 +1,13 @@
1
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
2
- import { cx as N } from "@linaria/core";
3
- import { useStore as v } from "@nanostores/react";
4
- import { SDKContainer as x, SDKScrollContainer as A } from "./styles.js";
5
- import { useSdkFeature as D } from "../useSdkFeature.js";
6
- import { useSdkResponsive as F } from "../useSdkResponsive.js";
1
+ import { jsx as l, jsxs as f } from "react/jsx-runtime";
2
+ import { cx as v } from "@linaria/core";
3
+ import { useStore as N } from "@nanostores/react";
4
+ import { SDKContainer as A, SDKScrollContainer as F } from "./styles.js";
5
+ import { useSdkFeature as x } from "../useSdkFeature.js";
6
+ import { useSdkResponsive as D } from "../useSdkResponsive.js";
7
7
  import { useSdkScroll as L } from "../useSdkScroll.js";
8
- import { useAnalyticsListener as c, newTabLinkListener as g, appScrollListener as C, appClickListener as b } from "../../hooks/analytics.js";
9
- import { useRef as f, useMemo as y, useEffect as K } from "react";
10
- import { resetCss as m } from "../../ui/theme/theme.js";
8
+ import { useAnalyticsListener as u, newTabLinkListener as g, appScrollListener as C, appClickListener as b } from "../../hooks/analytics.js";
9
+ import { useRef as p, useMemo as y, useEffect as K } from "react";
10
+ import { resetCss as c } from "../../ui/theme/theme.js";
11
11
  import { ActiveFeature as j, StandaloneFeature as R } from "./Features/index.js";
12
12
  import { SDKNavigation as w, SDKHeader as E } from "./Navigation/index.js";
13
13
  import { SDKNotifications as k } from "./Notifications/index.js";
@@ -21,7 +21,7 @@ const M = ({
21
21
  scrollNode: s,
22
22
  responsiveStore: t
23
23
  }) => {
24
- const [, a] = D(e);
24
+ const [, a] = x(e);
25
25
  return /* @__PURE__ */ l(j, {
26
26
  className: n,
27
27
  scrollNode: s,
@@ -37,7 +37,7 @@ const M = ({
37
37
  appNode: r,
38
38
  responsiveStore: i
39
39
  }) => {
40
- const s = v(e.featuresList.getStore());
40
+ const s = N(e.featuresList.getStore());
41
41
  return s ? Array.from(s, (t) => {
42
42
  const a = e.getFeature(t);
43
43
  return a ? /* @__PURE__ */ l(R, {
@@ -52,21 +52,21 @@ const M = ({
52
52
  sdk: e,
53
53
  topNavigation: n
54
54
  }) => {
55
- const r = f(null), i = f(null), [s] = F(r), [t, a] = L(r, s), {
56
- sdkReady: p,
57
- activeFeature: d,
55
+ const r = p(null), i = p(null), [s] = D(r), [t, a] = L(r, s), {
56
+ sdkReady: d,
57
+ activeFeature: m,
58
58
  isLogged: S
59
- } = H(e), o = !!p;
60
- c(r, {
59
+ } = H(e), o = !!d;
60
+ u(r, {
61
61
  enabled: o,
62
62
  event: "click",
63
63
  listener: g
64
- }), c(t, {
64
+ }), u(t, {
65
65
  enabled: o,
66
66
  event: "scrollend",
67
67
  listener: C,
68
68
  useDomNode: !0
69
- }), c(t, {
69
+ }), u(t, {
70
70
  enabled: o,
71
71
  event: "click",
72
72
  listener: b,
@@ -80,39 +80,40 @@ const M = ({
80
80
  import("./Features/Gamification/gamification-feature.js");
81
81
  }, []), /* @__PURE__ */ l(I.Provider, {
82
82
  value: h,
83
- children: /* @__PURE__ */ u(x, {
83
+ children: /* @__PURE__ */ f(A, {
84
84
  ref: r,
85
85
  className: n ? "" : "c10llmat",
86
86
  children: [o && n && /* @__PURE__ */ l(w, {
87
- className: m,
87
+ className: c,
88
88
  sdk: e,
89
89
  ref: i
90
- }), o && !n && !!d && /* @__PURE__ */ l(E, {
91
- className: N(m, "sl-hide-on-modal"),
90
+ }), o && !n && !!m && /* @__PURE__ */ l(E, {
91
+ className: v(c, "sl-hide-on-modal"),
92
92
  sdk: e,
93
93
  ref: i
94
- }), /* @__PURE__ */ u(A, {
94
+ }), /* @__PURE__ */ f(F, {
95
95
  className: "sl-hide-on-modal",
96
96
  ref: t,
97
- "data-nav": o.toString(),
97
+ "data-nav": (!!m && o).toString(),
98
98
  children: [o && /* @__PURE__ */ l(k, {
99
99
  sdk: e,
100
100
  scrollNode: t,
101
101
  headerNode: i,
102
102
  appNode: r,
103
103
  scrollStore: a,
104
- responsiveStore: s
104
+ responsiveStore: s,
105
+ hasActiveFeature: !!m
105
106
  }), o && /* @__PURE__ */ l(M, {
106
107
  scrollStore: a,
107
108
  responsiveStore: s,
108
109
  scrollNode: t,
109
110
  appNode: r,
110
- className: m,
111
+ className: c,
111
112
  sdk: e
112
113
  }), o && /* @__PURE__ */ l(P, {
113
114
  responsiveStore: s,
114
115
  appNode: r,
115
- className: m,
116
+ className: c,
116
117
  sdk: e
117
118
  })]
118
119
  }), o && !S && /* @__PURE__ */ l("div", {
@@ -1,2 +1,4 @@
1
1
  import { DebugProps } from '../../../utils/debug';
2
- export declare const AppStory: React.FC<DebugProps>;
2
+ export declare const AppStory: React.FC<DebugProps & {
3
+ darkMode?: boolean;
4
+ }>;