@streamlayer/react-ui 1.9.0 → 1.10.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 (78) 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 +23 -22
  6. package/lib/app/app/Features/Gamification/index.js +1 -1
  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/SDKPillNode.d.ts +1 -0
  10. package/lib/app/app/Navigation/SDKPillNode.js +9 -0
  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 -86
  15. package/lib/app/app/story/insight/index.d.ts +1 -0
  16. package/lib/app/app/story/insight/index.js +29 -26
  17. package/lib/app/app/story/insight/video.d.ts +1 -0
  18. package/lib/app/app/story/insight/video.js +13 -13
  19. package/lib/app/app/story/promotion/content.d.ts +3 -1
  20. package/lib/app/app/story/promotion/content.js +13 -10
  21. package/lib/app/app/story/promotion/index.d.ts +1 -0
  22. package/lib/app/app/story/promotion/index.js +34 -30
  23. package/lib/app/app/story/promotion/video.d.ts +1 -0
  24. package/lib/app/app/story/promotion/video.js +34 -31
  25. package/lib/app/app/styles.js +44 -0
  26. package/lib/app/app/useApp.d.ts +0 -14
  27. package/lib/app/app/useApp.js +14 -44
  28. package/lib/app/masters/Features/Gamification/Leaderboard.d.ts +1 -1
  29. package/lib/app/masters/Features/Gamification/Tabs.d.ts +2 -2
  30. package/lib/app/masters/Features/Gamification/Tabs.js +2 -2
  31. package/lib/app/masters/Features/Gamification/index.d.ts +2 -2
  32. package/lib/app/masters/Features/Gamification/index.js +1 -1
  33. package/lib/app/masters/Features/index.d.ts +2 -2
  34. package/lib/app/masters/Navigation/MastersNavigation/index.d.ts +1 -1
  35. package/lib/app/masters/Notifications/Onboarding/index.d.ts +1 -1
  36. package/lib/app/masters/Notifications/Onboarding/index.js +4 -4
  37. package/lib/app/masters/Notifications/index.d.ts +2 -2
  38. package/lib/app/masters/Notifications/index.js +1 -1
  39. package/lib/app/masters/masters.js +23 -23
  40. package/lib/app/masters/styles.d.ts +20 -0
  41. package/lib/app/{styles.js → masters/styles.js} +15 -15
  42. package/lib/app/masters/useSdkResponsive.d.ts +15 -0
  43. package/lib/app/masters/useSdkResponsive.js +45 -0
  44. package/lib/app/masters/useSdkScroll.d.ts +12 -0
  45. package/lib/app/masters/useSdkScroll.js +50 -0
  46. package/lib/app/useSdkResponsive.d.ts +1 -0
  47. package/lib/app/useSdkResponsive.js +27 -29
  48. package/lib/app/useSdkScroll.js +25 -24
  49. package/lib/assets/style.css +1 -1
  50. package/lib/ui/advertisement/banner/index.js +14 -11
  51. package/lib/ui/advertisement/index.d.ts +3 -0
  52. package/lib/ui/advertisement/index.js +31 -10
  53. package/lib/ui/advertisement/notification/index.d.ts +1 -0
  54. package/lib/ui/advertisement/notification/index.js +30 -27
  55. package/lib/ui/advertisement/notification/lower-third/index.d.ts +9 -0
  56. package/lib/ui/advertisement/notification/lower-third/index.js +37 -0
  57. package/lib/ui/advertisement/notification/lower-third/styles.d.ts +16 -0
  58. package/lib/ui/advertisement/notification/lower-third/styles.js +64 -0
  59. package/lib/ui/advertisement/overlay/index.d.ts +2 -0
  60. package/lib/ui/advertisement/overlay/index.js +58 -43
  61. package/lib/ui/advertisement/overlay/styles.d.ts +0 -2
  62. package/lib/ui/advertisement/overlay/styles.js +41 -52
  63. package/lib/ui/close-btn/index.d.ts +7 -0
  64. package/lib/ui/close-btn/index.js +47 -0
  65. package/lib/ui/gamification/detail/header/index.d.ts +2 -1
  66. package/lib/ui/gamification/detail/header/index.js +16 -15
  67. package/lib/ui/gamification/vote/styles.js +1 -1
  68. package/lib/ui/questions/insight/index.js +21 -20
  69. package/lib/ui/theme/masters-theme.js +36 -13
  70. package/lib/ui/theme/theme.js +22 -21
  71. package/lib/ui/timer/index.d.ts +3 -1
  72. package/lib/ui/timer/index.js +54 -32
  73. package/lib/ui/video-player/index.d.ts +2 -0
  74. package/lib/ui/video-player/index.js +62 -51
  75. package/lib/ui/video-player/styles.d.ts +1 -0
  76. package/lib/ui/video-player/styles.js +7 -6
  77. package/package.json +15 -15
  78. /package/lib/app/{styles.d.ts → app/styles.d.ts} +0 -0
@@ -1,163 +1,175 @@
1
- import { jsxs as a, Fragment as D, jsx as c } from "react/jsx-runtime";
2
- import { cx as N } from "@linaria/core";
1
+ import { jsxs as y, Fragment as b, jsx as u } from "react/jsx-runtime";
2
+ import { cx as V } from "@linaria/core";
3
3
  import { useStore as g } from "@nanostores/react";
4
- import { useAppContext as T } from "../useAppContext.js";
5
- import { scrollIntoAppView as E } from "../../useSdkScroll.js";
6
- import { useState as p, useMemo as O, useEffect as h, useRef as b, useCallback as w } from "react";
7
- import { r as q } from "../../../index-B1QdimmR.js";
8
- import { eventBus as C } from "@streamlayer/sdk-web-interfaces";
9
- import { NotificationType as f } from "@streamlayer/sdk-web-notifications";
10
- import { QuestionTypeData as R } from "../../../ui/gamification/constants.js";
11
- import { Notification as V } from "../../../ui/gamification/question/notification/index.js";
12
- import { PredictionResult as P } from "../../../ui/gamification/question/notification/prediction-result/index.js";
13
- import { Onboarding as x } from "./Onboarding/index.js";
14
- import { HiddenContainer as A, Container as B, InnerContainer as H, NotificationRefreshing as Q, Pill as U } from "./styles.js";
15
- const j = (o) => {
16
- const [t, u] = p(0), i = b(null), d = w((r) => {
17
- i.current = r;
18
- }, []);
19
- h(() => {
20
- var l;
21
- const r = (l = i.current) == null ? void 0 : l.getBoundingClientRect();
22
- r && u(r.height);
23
- }, [o]);
24
- const n = w((r) => {
25
- u(r);
4
+ import { useAppContext as O } from "../useAppContext.js";
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";
7
+ import { r as R } from "../../../index-B1QdimmR.js";
8
+ import { eventBus as q } from "@streamlayer/sdk-web-interfaces";
9
+ import { NotificationType as p } from "@streamlayer/sdk-web-notifications";
10
+ import { QuestionTypeData as C } from "../../../ui/gamification/constants.js";
11
+ import { Notification as N } from "../../../ui/gamification/question/notification/index.js";
12
+ import { PredictionResult as x } from "../../../ui/gamification/question/notification/prediction-result/index.js";
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);
22
+ }
23
+ }), []), n = w((o) => {
24
+ s.current = o;
25
+ }, []), f = w((o) => {
26
+ d(o);
26
27
  }, []);
27
- return [d, t, n];
28
- }, z = ({
29
- sdk: o,
30
- notification: t,
31
- appNode: u,
32
- responsiveStore: i
28
+ return h(() => {
29
+ const o = s.current;
30
+ return o ? (l.observe(o), () => {
31
+ l.unobserve(o);
32
+ }) : () => {
33
+ };
34
+ }, [i]), h(() => () => {
35
+ l.disconnect();
36
+ }), [n, e, f];
37
+ }, Q = ({
38
+ sdk: i,
39
+ notification: e,
40
+ appNode: d,
41
+ responsiveStore: s
33
42
  }) => {
34
- var s, e;
43
+ var r, t;
35
44
  const {
36
- sdkInDesktopView: d
37
- } = g(i, {
45
+ sdkInDesktopView: l
46
+ } = g(s, {
38
47
  keys: ["sdkInDesktopView"]
39
48
  }), {
40
49
  sdk: n
41
- } = T(), [r, l, m] = j(t.id);
42
- return t.type === f.QUESTION ? /* @__PURE__ */ a(D, {
43
- children: [/* @__PURE__ */ c(A, {
44
- ref: r,
45
- children: /* @__PURE__ */ c(V, {
46
- ...t
50
+ } = O(), [f, o, c] = H(e.id);
51
+ return e.type === p.QUESTION ? /* @__PURE__ */ y(b, {
52
+ children: [/* @__PURE__ */ u(z, {
53
+ ref: f,
54
+ children: /* @__PURE__ */ u(N, {
55
+ ...e
47
56
  })
48
- }), /* @__PURE__ */ a(B, {
57
+ }), /* @__PURE__ */ y(A, {
49
58
  style: {
50
- height: t.hiding ? 0 : l
59
+ height: e.hiding ? 0 : o
51
60
  },
52
- hiding: t.hiding,
53
- children: [/* @__PURE__ */ c(H, {
61
+ hiding: e.hiding,
62
+ children: [/* @__PURE__ */ u(B, {
54
63
  style: {
55
64
  height: "100%"
56
65
  },
57
- children: /* @__PURE__ */ c(V, {
58
- ...t,
66
+ children: /* @__PURE__ */ u(N, {
67
+ ...e,
59
68
  controlVideo: n == null ? void 0 : n.controlVideoPlayer
60
69
  })
61
- }), /* @__PURE__ */ c(Q, {}, t.id)]
70
+ }), /* @__PURE__ */ u(S, {}, e.id)]
62
71
  })]
63
- }) : t.type === f.QUESTION_RESOLVED && ((e = (s = t.data) == null ? void 0 : s.question) != null && e.predictionResult) ? /* @__PURE__ */ c(P, {
72
+ }) : e.type === p.QUESTION_RESOLVED && ((t = (r = e.data) == null ? void 0 : r.question) != null && t.predictionResult) ? /* @__PURE__ */ u(x, {
64
73
  style: {
65
- height: t.hiding ? 0 : l
74
+ height: e.hiding ? 0 : o
66
75
  },
67
- saveHeight: m,
68
- close: t.close,
69
- hiding: t.hiding,
70
- ...t.data.question
71
- }) : t.type === f.ONBOARDING ? /* @__PURE__ */ c(x, {
76
+ saveHeight: c,
77
+ close: e.close,
78
+ hiding: e.hiding,
79
+ ...e.data.question
80
+ }) : e.type === p.ONBOARDING ? /* @__PURE__ */ u(P, {
72
81
  style: {
73
- height: t.hiding ? 0 : l
82
+ height: e.hiding ? 0 : o
74
83
  },
75
- saveHeight: m,
76
- sdk: o,
77
- notification: t,
78
- sdkInDesktopView: d,
79
- appNode: u,
80
- responsiveStore: i
84
+ saveHeight: c,
85
+ sdk: i,
86
+ notification: e,
87
+ sdkInDesktopView: l,
88
+ appNode: d,
89
+ responsiveStore: s
81
90
  }) : null;
82
- }, F = "p7vfi6t", L = ({
83
- pill: o,
84
- setPill: t,
85
- appNode: u,
86
- headerNode: i,
87
- scrollNode: d,
91
+ }, U = "p7vfi6t", j = ({
92
+ pill: i,
93
+ setPill: e,
94
+ appNode: d,
95
+ headerNode: s,
96
+ scrollNode: l,
88
97
  responsiveStore: n,
89
- scrollStore: r
98
+ scrollStore: f
90
99
  }) => {
91
- var k, y;
100
+ var m, a;
92
101
  const {
93
- screen: l
102
+ screen: o
94
103
  } = g(n, {
95
104
  keys: ["screen"]
96
105
  }), {
97
- tabsShown: m,
98
- scrollPosition: s
99
- } = g(r, {
106
+ tabsShown: c,
107
+ scrollPosition: r
108
+ } = g(f, {
100
109
  keys: ["tabsShown", "scrollPosition"]
101
110
  });
102
111
  h(() => {
103
- n.get().sdkInDesktopView ? s < 50 && t(null) : s > -50 && t(null);
104
- }, [s, n, t]);
105
- const e = n.get().sdkInDesktopView ? u : i;
106
- return !o || !e.current ? null : q.createPortal(/* @__PURE__ */ c(U, {
107
- title: o.type === f.QUESTION_RESOLVED ? "Prediction result" : `New ${((y = R[(k = o.data) == null ? void 0 : k.questionType]) == null ? void 0 : y.label) || "notification"}`,
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"}`,
108
117
  onClick: () => {
109
118
  var I;
110
- n.get().sdkInDesktopView ? (I = d.current) == null || I.scrollTo({
119
+ n.get().sdkInDesktopView ? (I = l.current) == null || I.scrollTo({
111
120
  top: 0,
112
121
  behavior: "smooth"
113
- }) : E(u, l.size, {
122
+ }) : T(d, o.size, {
114
123
  behavior: "smooth"
115
- }), t(null);
124
+ }), e(null);
116
125
  },
117
- className: N(m && F, "sl-pill-button")
118
- }), e.current);
119
- }, it = ({
120
- sdk: o,
121
- headerNode: t,
122
- scrollNode: u,
123
- responsiveStore: i,
124
- appNode: d,
126
+ className: V(c && U, "sl-pill-button")
127
+ }), t.current);
128
+ }, oe = ({
129
+ sdk: i,
130
+ headerNode: e,
131
+ scrollNode: d,
132
+ responsiveStore: s,
133
+ appNode: l,
125
134
  scrollStore: n
126
135
  }) => {
127
- const [r] = p(o.getNotificationsStore()), l = g(r), [m, s] = p(null), e = O(() => o.getActiveNotification(), [o, l]);
136
+ const [f] = k(i.getNotificationsStore()), o = g(f), [c, r] = k(null), t = D(() => i.getActiveNotification(), [i, o]);
128
137
  return h(() => {
129
- e && C.emit("notification", {
138
+ t && q.emit("notification", {
130
139
  action: "rendered",
131
140
  payload: {
132
- questionId: e.data.questionId,
133
- questionType: e.data.questionType
141
+ questionId: t.data.questionId,
142
+ questionType: t.data.questionType
134
143
  }
135
144
  });
136
- }, [e]), h(() => {
137
- e && (i.get().sdkInDesktopView || i.get().sdkInView) && (!i.get().sdkInDesktopView && i.get().sdkInView && s(e), i.get().sdkInDesktopView && window.requestAnimationFrame(() => {
138
- n.get().scrollPosition !== 0 && s(e);
145
+ }, [t]), h(() => {
146
+ const {
147
+ 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);
139
152
  }));
140
- }, [e]), h(() => {
141
- e || s(null);
142
- }, [e]), /* @__PURE__ */ a(D, {
143
- children: [!m && e && /* @__PURE__ */ c(z, {
144
- headerNode: t,
145
- appNode: d,
146
- sdk: o,
147
- notification: e,
148
- responsiveStore: i
149
- }), m && /* @__PURE__ */ c(L, {
150
- pill: m,
151
- setPill: s,
152
- appNode: d,
153
- notification: e,
154
- headerNode: t,
155
- scrollNode: u,
153
+ }, [t]), h(() => {
154
+ t || r(null);
155
+ }, [t]), /* @__PURE__ */ y(b, {
156
+ children: [!c && t && /* @__PURE__ */ u(Q, {
157
+ appNode: l,
158
+ sdk: i,
159
+ notification: t,
160
+ responsiveStore: s
161
+ }), c && /* @__PURE__ */ u(j, {
162
+ pill: c,
163
+ setPill: r,
164
+ appNode: l,
165
+ notification: t,
166
+ headerNode: e,
167
+ scrollNode: d,
156
168
  scrollStore: n,
157
- responsiveStore: i
169
+ responsiveStore: s
158
170
  })]
159
171
  });
160
172
  };
161
173
  export {
162
- it as SDKNotifications
174
+ oe as SDKNotifications
163
175
  };
@@ -1,28 +1,28 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { useStore as i } from "@nanostores/react";
3
- import { useState as c, useEffect as f } from "react";
4
- import { FeatureStatus as p } from "@streamlayer/sdk-web-interfaces";
5
- import { FeatureType as S } from "@streamlayer/sdk-web-types";
6
- import { Points as l } from "../../../ui/gamification/points/index.js";
2
+ import { useStore as f } from "@nanostores/react";
3
+ import { useState as c, useEffect as l } from "react";
4
+ import { FeatureStatus as u } from "@streamlayer/sdk-web-interfaces";
5
+ import { FeatureType as p } from "@streamlayer/sdk-web-types";
6
+ import { Points as S } from "../../../ui/gamification/points/index.js";
7
7
  const a = ({ gamification: e }) => {
8
- const s = e.userSummary.$store, [r, u] = c(0);
9
- return f(() => {
10
- const m = s.subscribe((t) => {
8
+ const s = e.userSummary.$store, [r, m] = c(0);
9
+ return l(() => {
10
+ const i = s.subscribe((t) => {
11
11
  var o;
12
- (o = t == null ? void 0 : t.summary) != null && o.points && u(t.summary.points);
12
+ (o = t == null ? void 0 : t.summary) != null && o.points && m(t.summary.points);
13
13
  });
14
14
  return () => {
15
- m();
15
+ i();
16
16
  };
17
- }, [s]), /* @__PURE__ */ n(l, { points: r, onClick: () => {
18
- e.status.get() === p.Suspended && e.openFeature();
17
+ }, [s]), /* @__PURE__ */ n(S, { points: r, onClick: () => {
18
+ e.status.get() === u.Suspended ? e.openFeature() : e.status.get() === u.Ready && e.closeFeature(!1);
19
19
  } });
20
- }, h = ({ sdk: e }) => {
21
- if (!i(e.featuresList.getStore()))
20
+ }, k = ({ sdk: e }) => {
21
+ if (!f(e.featuresList.getStore()))
22
22
  return null;
23
- const r = e.getFeature(S.GAMES);
23
+ const r = e.getFeature(p.GAMES);
24
24
  return r ? /* @__PURE__ */ n(a, { gamification: r }) : null;
25
25
  };
26
26
  export {
27
- h as StreamLayerSDKPoints
27
+ k as StreamLayerSDKPoints
28
28
  };
@@ -7,5 +7,6 @@ export type AppAppProps = {
7
7
  sdk: StreamLayerSDK;
8
8
  event?: string;
9
9
  topNavigation?: boolean;
10
+ enabled?: boolean;
10
11
  };
11
12
  export declare const App: React.FC<AppAppProps>;
@@ -1,120 +1,118 @@
1
- import { jsx as s, jsxs as S } from "react/jsx-runtime";
2
- import { useStore as A } from "@nanostores/react";
3
- import { SDKContainer as C, SDKScrollContainer as L } from "../styles.js";
4
- import { useSdkFeature as x } from "../useSdkFeature.js";
5
- import { useSdkResponsive as D } from "../useSdkResponsive.js";
6
- import { useSdkScroll as F } from "../useSdkScroll.js";
7
- import { useAnalyticsListener as m, newTabLinkListener as b, appScrollListener as y, appClickListener as E } from "../../hooks/analytics.js";
8
- import { useRef as h, useEffect as v, useMemo as K } from "react";
9
- import { resetCss as u } from "../../ui/theme/theme.js";
10
- import { ActiveFeature as j, StandaloneFeature as R } from "./Features/index.js";
11
- import { SDKNavigation as w } from "./Navigation/index.js";
12
- import { SDKNotifications as I } from "./Notifications/index.js";
13
- import { useAppApp as M } from "./useApp.js";
14
- import { AppContext as P } from "./useAppContext.js";
15
- const V = ({
1
+ import { jsx as s, jsxs as u } from "react/jsx-runtime";
2
+ import { useStore as N } from "@nanostores/react";
3
+ import { SDKContainer as h, SDKScrollContainer as v } from "./styles.js";
4
+ import { useSdkFeature as g } from "../useSdkFeature.js";
5
+ import { useSdkResponsive as A } from "../useSdkResponsive.js";
6
+ import { useSdkScroll as D } from "../useSdkScroll.js";
7
+ import { useAnalyticsListener as c, newTabLinkListener as L, appScrollListener as x, appClickListener as C } from "../../hooks/analytics.js";
8
+ import { useRef as f, useMemo as F, useEffect as b } from "react";
9
+ import { resetCss as m } from "../../ui/theme/theme.js";
10
+ import { ActiveFeature as y, StandaloneFeature as K } from "./Features/index.js";
11
+ import { SDKNavigation as j } from "./Navigation/index.js";
12
+ import { SDKPillNode as R } from "./Navigation/SDKPillNode.js";
13
+ import { SDKNotifications as k } from "./Notifications/index.js";
14
+ import { useAppApp as w } from "./useApp.js";
15
+ import { AppContext as E } from "./useAppContext.js";
16
+ const P = ({
16
17
  sdk: e,
17
- className: n,
18
- scrollStore: i,
19
- appNode: r,
20
- scrollNode: l,
21
- responsiveStore: o
18
+ className: l,
19
+ scrollStore: r,
20
+ appNode: i,
21
+ scrollNode: n,
22
+ responsiveStore: t
22
23
  }) => {
23
- const [, t] = x(e);
24
- return /* @__PURE__ */ s(j, {
25
- className: n,
26
- scrollNode: l,
27
- appNode: r,
28
- scrollStore: i,
29
- feature: t,
30
- responsiveStore: o,
24
+ const [, a] = g(e);
25
+ return /* @__PURE__ */ s(y, {
26
+ className: l,
27
+ scrollNode: n,
28
+ appNode: i,
29
+ scrollStore: r,
30
+ feature: a,
31
+ responsiveStore: t,
31
32
  sdk: e
32
33
  });
33
- }, W = ({
34
+ }, I = ({
34
35
  sdk: e,
35
- className: n,
36
- appNode: i,
37
- responsiveStore: r
36
+ className: l,
37
+ appNode: r,
38
+ responsiveStore: i
38
39
  }) => {
39
- const l = A(e.featuresList.getStore());
40
- return l ? Array.from(l, (o) => {
41
- const t = e.getFeature(o);
42
- return t ? /* @__PURE__ */ s(R, {
43
- className: n,
44
- appNode: i,
45
- feature: t,
46
- responsiveStore: r,
40
+ const n = N(e.featuresList.getStore());
41
+ return n ? Array.from(n, (t) => {
42
+ const a = e.getFeature(t);
43
+ return a ? /* @__PURE__ */ s(K, {
44
+ className: l,
45
+ appNode: r,
46
+ feature: a,
47
+ responsiveStore: i,
47
48
  sdk: e
48
- }, o) : null;
49
+ }, t) : null;
49
50
  }) : null;
50
- }, _ = ({
51
+ }, Z = ({
51
52
  sdk: e,
52
- event: n,
53
- topNavigation: i
53
+ topNavigation: l
54
54
  }) => {
55
- const r = h(null), l = h(null), [o] = D(r), [t, f] = F(r, o), {
56
- sdkEnabled: a,
57
- sdkReady: c,
58
- activateEventWithId: p,
59
- deactivate: d,
60
- isLogged: N
61
- } = M(e);
62
- v(() => {
63
- n ? (e.createEventSession(n), p(n)) : d();
64
- }, [n, p, d, e]), m(r, {
65
- enabled: a,
55
+ const r = f(null), i = f(null), [n] = A(r), [t, a] = D(r, n), {
56
+ sdkReady: p,
57
+ isLogged: d
58
+ } = w(e), o = !!p;
59
+ c(r, {
60
+ enabled: o,
66
61
  event: "click",
67
- listener: b
68
- }), m(t, {
69
- enabled: a,
62
+ listener: L
63
+ }), c(t, {
64
+ enabled: o,
70
65
  event: "scrollend",
71
- listener: y,
66
+ listener: x,
72
67
  useDomNode: !0
73
- }), m(t, {
74
- enabled: a,
68
+ }), c(t, {
69
+ enabled: o,
75
70
  event: "click",
76
- listener: E,
71
+ listener: C,
77
72
  useDomNode: !0
78
73
  });
79
- const g = K(() => ({
74
+ const S = F(() => ({
80
75
  sdk: e
81
76
  }), [e]);
82
- return v(() => {
77
+ return b(() => {
83
78
  import("./Features/Gamification/gamification-feature.js");
84
- }, []), /* @__PURE__ */ s(P.Provider, {
85
- value: g,
86
- children: /* @__PURE__ */ S(C, {
79
+ }, []), /* @__PURE__ */ s(E.Provider, {
80
+ value: S,
81
+ children: /* @__PURE__ */ u(h, {
87
82
  ref: r,
88
- className: i ? "" : "c10llmat",
89
- children: [a && i && /* @__PURE__ */ s(w, {
90
- className: u,
83
+ className: l ? "" : "c10llmat",
84
+ children: [o && l && /* @__PURE__ */ s(j, {
85
+ className: m,
91
86
  sdk: e,
92
- ref: l
93
- }), /* @__PURE__ */ S(L, {
87
+ ref: i
88
+ }), o && !l && /* @__PURE__ */ s(R, {
89
+ className: m,
90
+ ref: i
91
+ }), /* @__PURE__ */ u(v, {
94
92
  className: "sl-hide-on-modal",
95
93
  ref: t,
96
- "data-nav": i && a.toString(),
97
- children: [c && /* @__PURE__ */ s(I, {
94
+ "data-nav": l && o.toString(),
95
+ children: [o && /* @__PURE__ */ s(k, {
98
96
  sdk: e,
99
97
  scrollNode: t,
100
- headerNode: l,
98
+ headerNode: i,
101
99
  appNode: r,
102
- scrollStore: f,
103
- responsiveStore: o
104
- }), c && /* @__PURE__ */ s(V, {
105
- scrollStore: f,
106
- responsiveStore: o,
100
+ scrollStore: a,
101
+ responsiveStore: n
102
+ }), o && /* @__PURE__ */ s(P, {
103
+ scrollStore: a,
104
+ responsiveStore: n,
107
105
  scrollNode: t,
108
106
  appNode: r,
109
- className: u,
107
+ className: m,
110
108
  sdk: e
111
- }), c && /* @__PURE__ */ s(W, {
112
- responsiveStore: o,
109
+ }), o && /* @__PURE__ */ s(I, {
110
+ responsiveStore: n,
113
111
  appNode: r,
114
- className: u,
112
+ className: m,
115
113
  sdk: e
116
114
  })]
117
- }), a && !N && /* @__PURE__ */ s("div", {
115
+ }), o && !d && /* @__PURE__ */ s("div", {
118
116
  style: {
119
117
  display: "flex",
120
118
  alignItems: "center",
@@ -128,5 +126,5 @@ const V = ({
128
126
  });
129
127
  };
130
128
  export {
131
- _ as App
129
+ Z as App
132
130
  };
@@ -4,6 +4,7 @@ export declare const InsightStory: React.FC<{
4
4
  insightId?: string;
5
5
  production?: boolean;
6
6
  onlyInsight?: boolean;
7
+ skipAutoClose?: boolean;
7
8
  hideHeader?: boolean;
8
9
  layoutMode?: 'side-by-side' | 'cover';
9
10
  }>;
@@ -1,59 +1,62 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { styled as d } from "@linaria/react";
3
- import { StreamLayerProvider as u, useStreamLayer as p } from "@streamlayer/react";
4
- import { StreamLayerSDKInsight as c } from "../../Insight/index.js";
5
- import { StreamLayerThemeProvider as y } from "../../../../ui/theme/index.js";
6
- import { useStreamLayerDebug as f } from "../../../../utils/debug/index.js";
2
+ import { styled as u } from "@linaria/react";
3
+ import { StreamLayerProvider as p, useStreamLayer as c } from "@streamlayer/react";
4
+ import { StreamLayerSDKInsight as y } from "../../Insight/index.js";
5
+ import { StreamLayerThemeProvider as f } from "../../../../ui/theme/index.js";
6
+ import { useStreamLayerDebug as h } from "../../../../utils/debug/index.js";
7
7
  import { customTheme as l } from "./styles.js";
8
- import { Video as h } from "./video.js";
9
- const v = /* @__PURE__ */ d("div")({
8
+ import { Video as v } from "./video.js";
9
+ const S = /* @__PURE__ */ u("div")({
10
10
  name: "Body",
11
11
  class: "buit6hv",
12
12
  propsAsIs: !1
13
- }), S = ({
13
+ }), L = ({
14
14
  hideHeader: t,
15
15
  insightId: o
16
16
  }) => {
17
- const e = p();
18
- return e ? /* @__PURE__ */ r(y, {
17
+ const e = c();
18
+ return e ? /* @__PURE__ */ r(f, {
19
19
  customTheme: l,
20
- children: /* @__PURE__ */ r(c, {
20
+ children: /* @__PURE__ */ r(y, {
21
21
  hideHeader: t,
22
22
  sdk: e,
23
23
  insightId: o,
24
24
  persistent: !0
25
25
  })
26
26
  }) : null;
27
- }, D = ({
27
+ }, P = ({
28
28
  sdkKey: t,
29
29
  eventId: o,
30
30
  layoutMode: e,
31
- insightId: s,
32
- production: n,
33
- onlyInsight: i,
34
- hideHeader: a
31
+ insightId: n,
32
+ production: i,
33
+ onlyInsight: a,
34
+ skipAutoClose: s,
35
+ hideHeader: d
35
36
  }) => {
36
- const m = f({
37
+ const m = h({
37
38
  sdkKey: t,
38
39
  eventId: o,
39
- production: n
40
+ production: i
40
41
  });
41
- return /* @__PURE__ */ r(u, {
42
+ return /* @__PURE__ */ r(p, {
42
43
  sdkKey: m.sdkKey,
43
44
  event: m.event,
44
45
  production: m.env === "production",
45
46
  autoEnable: !0,
46
- children: i ? /* @__PURE__ */ r(S, {
47
- insightId: s,
48
- hideHeader: a
49
- }) : /* @__PURE__ */ r(v, {
50
- children: /* @__PURE__ */ r(h, {
51
- insightId: s,
47
+ children: a ? /* @__PURE__ */ r(L, {
48
+ skipAutoClose: s,
49
+ insightId: n,
50
+ hideHeader: d
51
+ }) : /* @__PURE__ */ r(S, {
52
+ children: /* @__PURE__ */ r(v, {
53
+ skipAutoClose: s,
54
+ insightId: n,
52
55
  layoutMode: e
53
56
  })
54
57
  })
55
58
  });
56
59
  };
57
60
  export {
58
- D as InsightStory
61
+ P as InsightStory
59
62
  };