@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
@@ -1,72 +1,112 @@
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
- import { AvailableFeatures as S } from "@streamlayer/sdk-web-features";
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())({
1
+ import { jsxs as v, jsx as o } from "react/jsx-runtime";
2
+ import { cx as S } from "@linaria/core";
3
+ import { styled as n } from "@linaria/react";
4
+ import { useStore as m } from "@nanostores/react";
5
+ import { forwardRef as y, useMemo as h } from "react";
6
+ import { AvailableFeatures as I } from "@streamlayer/sdk-web-features";
7
+ import { FeatureType as u } from "@streamlayer/sdk-web-types";
8
+ import { SvgIcon as g } from "../../../ui/icons/index.js";
9
+ import { Navigation as A, NavigationItems as C } from "../../../ui/navigation/index.js";
10
+ import { Button as t } from "../../../ui/navigation/button/index.js";
11
+ const F = () => g, x = /* @__PURE__ */ n(F())({
11
12
  name: "ButtonIcon",
12
13
  class: "b11wpe79",
13
14
  propsAsIs: !0
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
- return o != null && o.overlays ? o.overlays : [];
21
- }, [t, r]), s = m(() => [...p.filter(({
22
- enableSdkButton: o,
23
- type: c
24
- }) => c === d.GAMES || o).map((o) => ({
25
- id: o.type,
26
- onClick: () => i.openFeature(o.type),
27
- disabled: !(o.type in S),
28
- label: o.name,
29
- icon: /* @__PURE__ */ e("img", {
30
- src: o.icon,
15
+ }), N = /* @__PURE__ */ n("div")({
16
+ name: "Container",
17
+ class: "calnblm",
18
+ propsAsIs: !1
19
+ }), b = /* @__PURE__ */ n("div")({
20
+ name: "Title",
21
+ class: "t1438p52",
22
+ propsAsIs: !1
23
+ }), B = /* @__PURE__ */ n("div")({
24
+ name: "CloseIconWrap",
25
+ class: "c17srj38",
26
+ propsAsIs: !1
27
+ }), j = () => g, w = /* @__PURE__ */ n(j())({
28
+ name: "CloseIcon",
29
+ class: "clqia8k",
30
+ propsAsIs: !0
31
+ }), G = "hf5w958", H = y(({
32
+ sdk: s,
33
+ className: c
34
+ }, l) => {
35
+ const i = () => {
36
+ s.closeFeature();
37
+ };
38
+ return /* @__PURE__ */ v(A, {
39
+ className: S(c, G),
40
+ children: [/* @__PURE__ */ v(N, {
41
+ children: [/* @__PURE__ */ o(b, {
42
+ children: "Live Challenge"
43
+ }), /* @__PURE__ */ o(B, {
44
+ onClick: i,
45
+ children: /* @__PURE__ */ o(w, {
46
+ name: "icon-cross"
47
+ })
48
+ })]
49
+ }), /* @__PURE__ */ o("div", {
50
+ ref: l
51
+ })]
52
+ });
53
+ }), R = y(({
54
+ sdk: s,
55
+ className: c
56
+ }, l) => {
57
+ const i = m(s.sdkStore.organizationSettings), r = m(s.sdkStore.streamSettings), a = m(s.getActiveFeature()), f = h(() => {
58
+ const e = (r == null ? void 0 : r.data) || (i == null ? void 0 : i.data);
59
+ return e != null && e.overlays ? e.overlays : [];
60
+ }, [i, r]), p = h(() => [...f.filter(({
61
+ enableSdkButton: e,
62
+ type: d
63
+ }) => d === u.GAMES || e).map((e) => ({
64
+ id: e.type,
65
+ onClick: () => s.openFeature(e.type),
66
+ disabled: !(e.type in I),
67
+ label: e.name,
68
+ icon: /* @__PURE__ */ o("img", {
69
+ src: e.icon,
31
70
  alt: ""
32
71
  }),
33
72
  /** multiplied by 10 to add the ability to insert custom buttons between our buttons */
34
- position: o.position * 10
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, {
73
+ position: e.position * 10
74
+ }))].sort((e, d) => e.position - d.position), [f, s]);
75
+ return /* @__PURE__ */ v(A, {
76
+ className: c,
77
+ children: [p.length !== 0 && /* @__PURE__ */ o(C, {
78
+ children: [/* @__PURE__ */ o(t, {
40
79
  id: "Channels",
41
- onClick: () => i.closeFeature(),
80
+ onClick: () => s.closeFeature(),
42
81
  label: "Channels",
43
82
  active: a === 0
44
- }, "Channels"), ...s.map((o) => o.id === d.GAMES ? /* @__PURE__ */ e(n, {
45
- ...o,
46
- active: o.id === a,
83
+ }, "Channels"), ...p.map((e) => e.id === u.GAMES ? /* @__PURE__ */ o(t, {
84
+ ...e,
85
+ active: e.id === a,
47
86
  label: "StreamLayer +",
48
87
  id: "featuredGroups",
49
- icon: /* @__PURE__ */ e(x, {
88
+ icon: /* @__PURE__ */ o(x, {
50
89
  name: "icon-btn-feature-groups",
51
- "data-selected": o.id === a
90
+ "data-selected": e.id === a
52
91
  })
53
- }, o.id) : /* @__PURE__ */ e(n, {
54
- ...o,
92
+ }, e.id) : /* @__PURE__ */ o(t, {
93
+ ...e,
55
94
  icon: void 0,
56
- active: o.id === a
57
- }, o.id))]
58
- }), !s.length && /* @__PURE__ */ e(v, {
59
- children: [/* @__PURE__ */ e(n, {
95
+ active: e.id === a
96
+ }, e.id))]
97
+ }), !p.length && /* @__PURE__ */ o(C, {
98
+ children: [/* @__PURE__ */ o(t, {
60
99
  id: "empty",
61
100
  label: "No Features...",
62
101
  active: !1,
63
102
  disabled: !0
64
103
  }, "empty")]
65
- }), /* @__PURE__ */ e("div", {
66
- ref: u
104
+ }), /* @__PURE__ */ o("div", {
105
+ ref: l
67
106
  })]
68
107
  });
69
108
  });
70
109
  export {
71
- K as SDKNavigation
110
+ H as SDKHeader,
111
+ R as SDKNavigation
72
112
  };
@@ -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>;