@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.
- package/lib/app/app/Advertisement/index.d.ts +1 -0
- package/lib/app/app/Advertisement/index.js +78 -67
- package/lib/app/app/Features/Gamification/Question.d.ts +1 -0
- package/lib/app/app/Features/Gamification/Question.js +43 -41
- package/lib/app/app/Features/Gamification/Tabs.js +22 -21
- package/lib/app/app/Features/Gamification/index.js +66 -62
- package/lib/app/app/Insight/index.d.ts +2 -0
- package/lib/app/app/Insight/index.js +28 -24
- package/lib/app/app/Navigation/index.d.ts +4 -0
- package/lib/app/app/Navigation/index.js +88 -48
- package/lib/app/app/Notifications/index.js +125 -113
- package/lib/app/app/Points/index.js +16 -16
- package/lib/app/app/index.d.ts +1 -0
- package/lib/app/app/index.js +84 -83
- package/lib/app/app/story/index.js +27 -24
- package/lib/app/app/story/insight/index.d.ts +1 -0
- package/lib/app/app/story/insight/index.js +29 -26
- package/lib/app/app/story/insight/video.d.ts +1 -0
- package/lib/app/app/story/insight/video.js +13 -13
- package/lib/app/app/story/promotion/content.d.ts +3 -1
- package/lib/app/app/story/promotion/content.js +13 -10
- package/lib/app/app/story/promotion/index.d.ts +1 -0
- package/lib/app/app/story/promotion/index.js +34 -30
- package/lib/app/app/story/promotion/video.d.ts +1 -0
- package/lib/app/app/story/promotion/video.js +34 -31
- package/lib/app/app/styles.js +44 -0
- package/lib/app/app/useApp.d.ts +2 -14
- package/lib/app/app/useApp.js +14 -43
- package/lib/app/app/useAppContext.d.ts +2 -0
- package/lib/app/app/useAppContext.js +6 -5
- package/lib/app/masters/Features/Gamification/Leaderboard.d.ts +1 -1
- package/lib/app/masters/Features/Gamification/Tabs.d.ts +2 -2
- package/lib/app/masters/Features/Gamification/Tabs.js +2 -2
- package/lib/app/masters/Features/Gamification/index.d.ts +2 -2
- package/lib/app/masters/Features/Gamification/index.js +1 -1
- package/lib/app/masters/Features/index.d.ts +2 -2
- package/lib/app/masters/Navigation/MastersNavigation/index.d.ts +1 -1
- package/lib/app/masters/Notifications/Onboarding/index.d.ts +1 -1
- package/lib/app/masters/Notifications/Onboarding/index.js +4 -4
- package/lib/app/masters/Notifications/index.d.ts +2 -2
- package/lib/app/masters/Notifications/index.js +1 -1
- package/lib/app/masters/masters.js +23 -23
- package/lib/app/masters/styles.d.ts +20 -0
- package/lib/app/{styles.js → masters/styles.js} +15 -15
- package/lib/app/masters/useSdkResponsive.d.ts +15 -0
- package/lib/app/masters/useSdkResponsive.js +45 -0
- package/lib/app/masters/useSdkScroll.d.ts +12 -0
- package/lib/app/masters/useSdkScroll.js +50 -0
- package/lib/app/useSdkResponsive.d.ts +1 -0
- package/lib/app/useSdkResponsive.js +27 -29
- package/lib/app/useSdkScroll.js +25 -24
- package/lib/assets/style.css +1 -1
- package/lib/ui/advertisement/banner/index.js +14 -11
- package/lib/ui/advertisement/index.d.ts +3 -0
- package/lib/ui/advertisement/index.js +31 -10
- package/lib/ui/advertisement/notification/index.d.ts +1 -0
- package/lib/ui/advertisement/notification/index.js +30 -27
- package/lib/ui/advertisement/notification/lower-third/index.d.ts +9 -0
- package/lib/ui/advertisement/notification/lower-third/index.js +37 -0
- package/lib/ui/advertisement/notification/lower-third/styles.d.ts +16 -0
- package/lib/ui/advertisement/notification/lower-third/styles.js +64 -0
- package/lib/ui/advertisement/overlay/index.d.ts +2 -0
- package/lib/ui/advertisement/overlay/index.js +58 -43
- package/lib/ui/advertisement/overlay/styles.d.ts +0 -2
- package/lib/ui/advertisement/overlay/styles.js +41 -52
- package/lib/ui/close-btn/index.d.ts +7 -0
- package/lib/ui/close-btn/index.js +47 -0
- package/lib/ui/gamification/detail/header/index.d.ts +2 -1
- package/lib/ui/gamification/detail/header/index.js +16 -15
- package/lib/ui/gamification/vote/styles.js +1 -1
- package/lib/ui/navigation/button/FeaturedGroups.d.ts +1 -1
- package/lib/ui/navigation/index.d.ts +5 -3
- package/lib/ui/navigation/index.js +11 -12
- package/lib/ui/navigation/masters.js +1 -1
- package/lib/ui/navigation/styles.d.ts +5 -0
- package/lib/ui/navigation/styles.js +16 -0
- package/lib/ui/questions/insight/index.js +21 -20
- package/lib/ui/theme/masters-theme.js +36 -13
- package/lib/ui/theme/theme.js +25 -26
- package/lib/ui/timer/index.d.ts +3 -1
- package/lib/ui/timer/index.js +54 -32
- package/lib/ui/video-player/index.d.ts +2 -0
- package/lib/ui/video-player/index.js +62 -51
- package/lib/ui/video-player/styles.d.ts +1 -0
- package/lib/ui/video-player/styles.js +7 -6
- package/package.json +15 -15
- /package/lib/app/{styles.d.ts → app/styles.d.ts} +0 -0
|
@@ -1,72 +1,112 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { Navigation as A, NavigationItems as
|
|
10
|
-
|
|
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
|
-
}),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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:
|
|
35
|
-
}))].sort((
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
className:
|
|
38
|
-
children: [
|
|
39
|
-
children: [/* @__PURE__ */
|
|
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: () =>
|
|
80
|
+
onClick: () => s.closeFeature(),
|
|
42
81
|
label: "Channels",
|
|
43
82
|
active: a === 0
|
|
44
|
-
}, "Channels"), ...
|
|
45
|
-
...
|
|
46
|
-
active:
|
|
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__ */
|
|
88
|
+
icon: /* @__PURE__ */ o(x, {
|
|
50
89
|
name: "icon-btn-feature-groups",
|
|
51
|
-
"data-selected":
|
|
90
|
+
"data-selected": e.id === a
|
|
52
91
|
})
|
|
53
|
-
},
|
|
54
|
-
...
|
|
92
|
+
}, e.id) : /* @__PURE__ */ o(t, {
|
|
93
|
+
...e,
|
|
55
94
|
icon: void 0,
|
|
56
|
-
active:
|
|
57
|
-
},
|
|
58
|
-
}), !
|
|
59
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
66
|
-
ref:
|
|
104
|
+
}), /* @__PURE__ */ o("div", {
|
|
105
|
+
ref: l
|
|
67
106
|
})]
|
|
68
107
|
});
|
|
69
108
|
});
|
|
70
109
|
export {
|
|
71
|
-
|
|
110
|
+
H as SDKHeader,
|
|
111
|
+
R as SDKNavigation
|
|
72
112
|
};
|
|
@@ -1,163 +1,175 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cx as
|
|
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
|
|
5
|
-
import { scrollIntoAppView as
|
|
6
|
-
import { useState as
|
|
7
|
-
import { r as
|
|
8
|
-
import { eventBus as
|
|
9
|
-
import { NotificationType as
|
|
10
|
-
import { QuestionTypeData as
|
|
11
|
-
import { Notification as
|
|
12
|
-
import { PredictionResult as
|
|
13
|
-
import { Onboarding as
|
|
14
|
-
import { HiddenContainer as
|
|
15
|
-
const
|
|
16
|
-
const [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}, [
|
|
24
|
-
|
|
25
|
-
|
|
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
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
|
43
|
+
var r, t;
|
|
35
44
|
const {
|
|
36
|
-
sdkInDesktopView:
|
|
37
|
-
} = g(
|
|
45
|
+
sdkInDesktopView: l
|
|
46
|
+
} = g(s, {
|
|
38
47
|
keys: ["sdkInDesktopView"]
|
|
39
48
|
}), {
|
|
40
49
|
sdk: n
|
|
41
|
-
} =
|
|
42
|
-
return
|
|
43
|
-
children: [/* @__PURE__ */
|
|
44
|
-
ref:
|
|
45
|
-
children: /* @__PURE__ */
|
|
46
|
-
...
|
|
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__ */
|
|
57
|
+
}), /* @__PURE__ */ y(A, {
|
|
49
58
|
style: {
|
|
50
|
-
height:
|
|
59
|
+
height: e.hiding ? 0 : o
|
|
51
60
|
},
|
|
52
|
-
hiding:
|
|
53
|
-
children: [/* @__PURE__ */
|
|
61
|
+
hiding: e.hiding,
|
|
62
|
+
children: [/* @__PURE__ */ u(B, {
|
|
54
63
|
style: {
|
|
55
64
|
height: "100%"
|
|
56
65
|
},
|
|
57
|
-
children: /* @__PURE__ */
|
|
58
|
-
...
|
|
66
|
+
children: /* @__PURE__ */ u(N, {
|
|
67
|
+
...e,
|
|
59
68
|
controlVideo: n == null ? void 0 : n.controlVideoPlayer
|
|
60
69
|
})
|
|
61
|
-
}), /* @__PURE__ */
|
|
70
|
+
}), /* @__PURE__ */ u(S, {}, e.id)]
|
|
62
71
|
})]
|
|
63
|
-
}) :
|
|
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:
|
|
74
|
+
height: e.hiding ? 0 : o
|
|
66
75
|
},
|
|
67
|
-
saveHeight:
|
|
68
|
-
close:
|
|
69
|
-
hiding:
|
|
70
|
-
...
|
|
71
|
-
}) :
|
|
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:
|
|
82
|
+
height: e.hiding ? 0 : o
|
|
74
83
|
},
|
|
75
|
-
saveHeight:
|
|
76
|
-
sdk:
|
|
77
|
-
notification:
|
|
78
|
-
sdkInDesktopView:
|
|
79
|
-
appNode:
|
|
80
|
-
responsiveStore:
|
|
84
|
+
saveHeight: c,
|
|
85
|
+
sdk: i,
|
|
86
|
+
notification: e,
|
|
87
|
+
sdkInDesktopView: l,
|
|
88
|
+
appNode: d,
|
|
89
|
+
responsiveStore: s
|
|
81
90
|
}) : null;
|
|
82
|
-
},
|
|
83
|
-
pill:
|
|
84
|
-
setPill:
|
|
85
|
-
appNode:
|
|
86
|
-
headerNode:
|
|
87
|
-
scrollNode:
|
|
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:
|
|
98
|
+
scrollStore: f
|
|
90
99
|
}) => {
|
|
91
|
-
var
|
|
100
|
+
var m, a;
|
|
92
101
|
const {
|
|
93
|
-
screen:
|
|
102
|
+
screen: o
|
|
94
103
|
} = g(n, {
|
|
95
104
|
keys: ["screen"]
|
|
96
105
|
}), {
|
|
97
|
-
tabsShown:
|
|
98
|
-
scrollPosition:
|
|
99
|
-
} = g(
|
|
106
|
+
tabsShown: c,
|
|
107
|
+
scrollPosition: r
|
|
108
|
+
} = g(f, {
|
|
100
109
|
keys: ["tabsShown", "scrollPosition"]
|
|
101
110
|
});
|
|
102
111
|
h(() => {
|
|
103
|
-
n.get().sdkInDesktopView ?
|
|
104
|
-
}, [
|
|
105
|
-
const
|
|
106
|
-
return !
|
|
107
|
-
title:
|
|
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 =
|
|
119
|
+
n.get().sdkInDesktopView ? (I = l.current) == null || I.scrollTo({
|
|
111
120
|
top: 0,
|
|
112
121
|
behavior: "smooth"
|
|
113
|
-
}) :
|
|
122
|
+
}) : T(d, o.size, {
|
|
114
123
|
behavior: "smooth"
|
|
115
|
-
}),
|
|
124
|
+
}), e(null);
|
|
116
125
|
},
|
|
117
|
-
className:
|
|
118
|
-
}),
|
|
119
|
-
},
|
|
120
|
-
sdk:
|
|
121
|
-
headerNode:
|
|
122
|
-
scrollNode:
|
|
123
|
-
responsiveStore:
|
|
124
|
-
appNode:
|
|
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 [
|
|
136
|
+
const [f] = k(i.getNotificationsStore()), o = g(f), [c, r] = k(null), t = D(() => i.getActiveNotification(), [i, o]);
|
|
128
137
|
return h(() => {
|
|
129
|
-
|
|
138
|
+
t && q.emit("notification", {
|
|
130
139
|
action: "rendered",
|
|
131
140
|
payload: {
|
|
132
|
-
questionId:
|
|
133
|
-
questionType:
|
|
141
|
+
questionId: t.data.questionId,
|
|
142
|
+
questionType: t.data.questionType
|
|
134
143
|
}
|
|
135
144
|
});
|
|
136
|
-
}, [
|
|
137
|
-
|
|
138
|
-
|
|
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
|
-
}, [
|
|
141
|
-
|
|
142
|
-
}, [
|
|
143
|
-
children: [!
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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:
|
|
169
|
+
responsiveStore: s
|
|
158
170
|
})]
|
|
159
171
|
});
|
|
160
172
|
};
|
|
161
173
|
export {
|
|
162
|
-
|
|
174
|
+
oe as SDKNotifications
|
|
163
175
|
};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { useStore as
|
|
3
|
-
import { useState as c, useEffect as
|
|
4
|
-
import { FeatureStatus as
|
|
5
|
-
import { FeatureType as
|
|
6
|
-
import { Points as
|
|
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,
|
|
9
|
-
return
|
|
10
|
-
const
|
|
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 &&
|
|
12
|
+
(o = t == null ? void 0 : t.summary) != null && o.points && m(t.summary.points);
|
|
13
13
|
});
|
|
14
14
|
return () => {
|
|
15
|
-
|
|
15
|
+
i();
|
|
16
16
|
};
|
|
17
|
-
}, [s]), /* @__PURE__ */ n(
|
|
18
|
-
e.status.get() ===
|
|
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
|
-
},
|
|
21
|
-
if (!
|
|
20
|
+
}, k = ({ sdk: e }) => {
|
|
21
|
+
if (!f(e.featuresList.getStore()))
|
|
22
22
|
return null;
|
|
23
|
-
const r = e.getFeature(
|
|
23
|
+
const r = e.getFeature(p.GAMES);
|
|
24
24
|
return r ? /* @__PURE__ */ n(a, { gamification: r }) : null;
|
|
25
25
|
};
|
|
26
26
|
export {
|
|
27
|
-
|
|
27
|
+
k as StreamLayerSDKPoints
|
|
28
28
|
};
|