@streamlayer/react-ui 1.11.4 → 1.12.1
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 +86 -67
- package/lib/app/app/Features/Gamification/Tabs.js +13 -13
- package/lib/app/app/Navigation/index.js +70 -64
- package/lib/app/app/Notifications/Onboarding/index.js +66 -72
- package/lib/app/app/Notifications/index.d.ts +1 -0
- package/lib/app/app/Notifications/index.js +76 -72
- package/lib/app/app/index.js +28 -27
- package/lib/app/app/story/index.d.ts +3 -1
- package/lib/app/app/story/index.js +29 -26
- package/lib/app/app/story/promotion/video.js +34 -34
- package/lib/app/app/styles.d.ts +5 -0
- package/lib/app/app/styles.js +25 -20
- package/lib/assets/style.css +1 -1
- package/lib/ui/advertisement/index.d.ts +3 -0
- package/lib/ui/advertisement/index.js +25 -19
- package/lib/ui/advertisement/mock.d.ts +1 -0
- package/lib/ui/advertisement/mock.js +39 -5
- package/lib/ui/advertisement/overlay/externalAd/controls.d.ts +5 -0
- package/lib/ui/advertisement/overlay/externalAd/controls.js +33 -0
- package/lib/ui/advertisement/overlay/externalAd/index.d.ts +2 -0
- package/lib/ui/advertisement/overlay/externalAd/index.js +121 -0
- package/lib/ui/advertisement/overlay/index.d.ts +7 -2
- package/lib/ui/advertisement/overlay/index.js +67 -58
- package/lib/ui/close-btn/index.d.ts +1 -0
- package/lib/ui/close-btn/index.js +25 -23
- package/lib/ui/gamification/question/insight/styles.d.ts +10 -2
- package/lib/ui/gamification/question/insight/styles.js +8 -7
- package/lib/ui/gamification/question/notification/prediction-result/index.js +84 -64
- package/lib/ui/gamification/question/notification/prediction-result/styles.d.ts +2 -0
- package/lib/ui/gamification/question/notification/prediction-result/styles.js +36 -26
- package/lib/ui/gamification/question/twitter/styles.d.ts +5 -1
- package/lib/ui/gamification/question/twitter/styles.js +9 -8
- package/lib/ui/gamification/vote/alert/index.js +7 -8
- package/lib/ui/gamification/vote/alert/styles.d.ts +1 -0
- package/lib/ui/gamification/vote/alert/styles.js +12 -6
- package/lib/ui/gamification/vote/vote-option/index.js +59 -58
- package/lib/ui/icons/index.d.ts +1 -0
- package/lib/ui/icons/index.js +45 -44
- package/lib/ui/skeleton/index.d.ts +1 -1
- package/lib/ui/theme/constants.d.ts +32 -1
- package/lib/ui/theme/constants.js +50 -17
- package/lib/ui/theme/masters-theme.js +9 -4
- package/lib/ui/theme/theme.js +16 -9
- package/lib/ui/video-player/index.d.ts +2 -0
- package/lib/ui/video-player/index.js +57 -56
- package/package.json +14 -14
|
@@ -1,70 +1,64 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { styled as
|
|
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
|
|
5
|
-
import { scrollIntoAppView as
|
|
6
|
-
import { useRef as E, useState as A, useMemo as
|
|
7
|
-
import { FeatureType as
|
|
8
|
-
import { OnboardingUI as
|
|
9
|
-
import { ModalPortal as
|
|
10
|
-
import { ShowIn as
|
|
11
|
-
import { Onboarding as
|
|
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/
|
|
13
|
+
graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/dark/step_1.png",
|
|
14
14
|
tagline: "",
|
|
15
|
-
headline: /* @__PURE__ */ x
|
|
16
|
-
children: ["Welcome to ", /* @__PURE__ */ r("br", {}), "
|
|
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: "
|
|
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: "
|
|
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
|
-
}),
|
|
28
|
+
}), q = () => j, z = /* @__PURE__ */ I(q())({
|
|
35
29
|
name: "OnboardingNotificationContainer",
|
|
36
30
|
class: "o1vnouv7",
|
|
37
31
|
propsAsIs: !0
|
|
38
|
-
}),
|
|
32
|
+
}), S = /* @__PURE__ */ I("div")({
|
|
39
33
|
name: "InnerContainer",
|
|
40
34
|
class: "i59uefw",
|
|
41
35
|
propsAsIs: !1
|
|
42
|
-
}),
|
|
36
|
+
}), D = ({
|
|
43
37
|
deepLink: l,
|
|
44
38
|
onboardingOpts: e,
|
|
45
39
|
notification: o,
|
|
46
|
-
gamification:
|
|
47
|
-
loading:
|
|
40
|
+
gamification: m,
|
|
41
|
+
loading: s,
|
|
48
42
|
sdk: d
|
|
49
43
|
}) => {
|
|
50
|
-
var c, a,
|
|
51
|
-
const
|
|
52
|
-
var
|
|
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 ? (
|
|
55
|
-
slId:
|
|
56
|
-
}) =>
|
|
57
|
-
}, [
|
|
58
|
-
return
|
|
59
|
-
const n = l.$store.subscribe((
|
|
60
|
-
|
|
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(
|
|
66
|
-
children: /* @__PURE__ */ r(
|
|
67
|
-
loading:
|
|
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: (
|
|
75
|
+
termsText: (b = e.rules) == null ? void 0 : b.terms,
|
|
82
76
|
steps: C,
|
|
83
|
-
primaryColor: (
|
|
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: (
|
|
87
|
-
inviteCardBtnLabel: (
|
|
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:
|
|
86
|
+
gamification: m,
|
|
93
87
|
sdk: d,
|
|
94
|
-
inviterName:
|
|
88
|
+
inviterName: y
|
|
95
89
|
})
|
|
96
90
|
});
|
|
97
91
|
}, ne = ({
|
|
98
92
|
sdk: l,
|
|
99
93
|
notification: e,
|
|
100
94
|
saveHeight: o,
|
|
101
|
-
style:
|
|
102
|
-
appNode:
|
|
95
|
+
style: m,
|
|
96
|
+
appNode: s,
|
|
103
97
|
sdkInDesktopView: d,
|
|
104
|
-
responsiveStore:
|
|
98
|
+
responsiveStore: p
|
|
105
99
|
}) => {
|
|
106
|
-
const g = E(null), t = e.data.onboarding, [
|
|
107
|
-
graphicSrc:
|
|
108
|
-
}) =>
|
|
109
|
-
screen:
|
|
110
|
-
} = T(
|
|
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
|
|
115
|
-
o(((
|
|
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:
|
|
120
|
-
} =
|
|
121
|
-
return
|
|
122
|
-
container:
|
|
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(
|
|
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:
|
|
125
|
+
renderToNode: s,
|
|
132
126
|
sdk: l
|
|
133
127
|
})
|
|
134
|
-
}) : /* @__PURE__ */ x
|
|
135
|
-
children: [/* @__PURE__ */ r(
|
|
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(
|
|
135
|
+
children: /* @__PURE__ */ r(w, {
|
|
142
136
|
close: () => {
|
|
143
137
|
},
|
|
144
138
|
action: () => {
|
|
145
139
|
},
|
|
146
140
|
onboarding: t
|
|
147
141
|
})
|
|
148
|
-
}), /* @__PURE__ */ r(
|
|
149
|
-
style:
|
|
142
|
+
}), /* @__PURE__ */ r(z, {
|
|
143
|
+
style: m,
|
|
150
144
|
hiding: e.hiding,
|
|
151
|
-
children: /* @__PURE__ */ r(
|
|
152
|
-
children: /* @__PURE__ */ r(
|
|
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 =
|
|
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
|
},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
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
|
|
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
|
|
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
|
|
15
|
-
const
|
|
16
|
-
const [e, d] =
|
|
17
|
-
var
|
|
18
|
-
for (const
|
|
19
|
-
if (
|
|
20
|
-
const
|
|
21
|
-
|
|
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
|
-
}), []),
|
|
24
|
-
|
|
23
|
+
}), []), s = w((o) => {
|
|
24
|
+
i.current = o;
|
|
25
25
|
}, []), f = w((o) => {
|
|
26
26
|
d(o);
|
|
27
27
|
}, []);
|
|
28
|
-
return
|
|
29
|
-
const o =
|
|
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
|
-
}, [
|
|
34
|
+
}, [r]), a(() => () => {
|
|
35
35
|
l.disconnect();
|
|
36
|
-
}), [
|
|
36
|
+
}), [s, e, f];
|
|
37
37
|
}, Q = ({
|
|
38
|
-
sdk:
|
|
38
|
+
sdk: r,
|
|
39
39
|
notification: e,
|
|
40
40
|
appNode: d,
|
|
41
|
-
responsiveStore:
|
|
41
|
+
responsiveStore: i,
|
|
42
|
+
hasActiveFeature: l
|
|
42
43
|
}) => {
|
|
43
|
-
var
|
|
44
|
+
var t, m;
|
|
44
45
|
const {
|
|
45
|
-
sdkInDesktopView:
|
|
46
|
-
} =
|
|
46
|
+
sdkInDesktopView: s
|
|
47
|
+
} = y(i, {
|
|
47
48
|
keys: ["sdkInDesktopView"]
|
|
48
49
|
}), {
|
|
49
|
-
sdk:
|
|
50
|
-
} = O(), [
|
|
51
|
-
|
|
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:
|
|
55
|
+
ref: o,
|
|
54
56
|
children: /* @__PURE__ */ u(N, {
|
|
55
57
|
...e
|
|
56
58
|
})
|
|
57
|
-
}), /* @__PURE__ */
|
|
59
|
+
}), /* @__PURE__ */ k(A, {
|
|
58
60
|
style: {
|
|
59
|
-
height: e.hiding ? 0 :
|
|
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:
|
|
70
|
+
controlVideo: f == null ? void 0 : f.controlVideoPlayer
|
|
69
71
|
})
|
|
70
|
-
}), /* @__PURE__ */ u(
|
|
72
|
+
}), /* @__PURE__ */ u(H, {}, e.id)]
|
|
71
73
|
})]
|
|
72
|
-
}) : e.type === p.QUESTION_RESOLVED && ((
|
|
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 :
|
|
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 :
|
|
84
|
+
height: e.hiding ? 0 : n
|
|
83
85
|
},
|
|
84
86
|
saveHeight: c,
|
|
85
|
-
sdk:
|
|
87
|
+
sdk: r,
|
|
86
88
|
notification: e,
|
|
87
|
-
sdkInDesktopView:
|
|
89
|
+
sdkInDesktopView: s,
|
|
88
90
|
appNode: d,
|
|
89
|
-
responsiveStore:
|
|
91
|
+
responsiveStore: i
|
|
90
92
|
}) : null;
|
|
91
93
|
}, U = "p7vfi6t", j = ({
|
|
92
|
-
pill:
|
|
94
|
+
pill: r,
|
|
93
95
|
setPill: e,
|
|
94
96
|
appNode: d,
|
|
95
|
-
headerNode:
|
|
97
|
+
headerNode: i,
|
|
96
98
|
scrollNode: l,
|
|
97
|
-
responsiveStore:
|
|
99
|
+
responsiveStore: s,
|
|
98
100
|
scrollStore: f
|
|
99
101
|
}) => {
|
|
100
|
-
var
|
|
102
|
+
var t, m;
|
|
101
103
|
const {
|
|
102
104
|
screen: o
|
|
103
|
-
} =
|
|
105
|
+
} = y(s, {
|
|
104
106
|
keys: ["screen"]
|
|
105
107
|
}), {
|
|
106
|
-
tabsShown:
|
|
107
|
-
scrollPosition:
|
|
108
|
-
} =
|
|
108
|
+
tabsShown: h,
|
|
109
|
+
scrollPosition: c
|
|
110
|
+
} = y(f, {
|
|
109
111
|
keys: ["tabsShown", "scrollPosition"]
|
|
110
112
|
});
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}, [
|
|
114
|
-
const
|
|
115
|
-
return !
|
|
116
|
-
title:
|
|
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
|
|
119
|
-
|
|
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(
|
|
127
|
-
}),
|
|
128
|
+
className: V(h && U, "sl-pill-button")
|
|
129
|
+
}), n.current);
|
|
128
130
|
}, oe = ({
|
|
129
|
-
sdk:
|
|
131
|
+
sdk: r,
|
|
130
132
|
headerNode: e,
|
|
131
133
|
scrollNode: d,
|
|
132
|
-
responsiveStore:
|
|
134
|
+
responsiveStore: i,
|
|
133
135
|
appNode: l,
|
|
134
|
-
scrollStore:
|
|
136
|
+
scrollStore: s,
|
|
137
|
+
hasActiveFeature: f
|
|
135
138
|
}) => {
|
|
136
|
-
const [
|
|
137
|
-
return
|
|
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]),
|
|
148
|
+
}, [t]), a(() => {
|
|
146
149
|
const {
|
|
147
150
|
sdkInDesktopView: m,
|
|
148
|
-
sdkInView:
|
|
149
|
-
} =
|
|
150
|
-
t && (m ||
|
|
151
|
-
|
|
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]),
|
|
154
|
-
t ||
|
|
155
|
-
}, [t]), /* @__PURE__ */
|
|
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:
|
|
161
|
+
sdk: r,
|
|
162
|
+
hasActiveFeature: f,
|
|
159
163
|
notification: t,
|
|
160
|
-
responsiveStore:
|
|
164
|
+
responsiveStore: i
|
|
161
165
|
}), c && /* @__PURE__ */ u(j, {
|
|
162
166
|
pill: c,
|
|
163
|
-
setPill:
|
|
167
|
+
setPill: n,
|
|
164
168
|
appNode: l,
|
|
165
169
|
notification: t,
|
|
166
170
|
headerNode: e,
|
|
167
171
|
scrollNode: d,
|
|
168
|
-
scrollStore:
|
|
169
|
-
responsiveStore:
|
|
172
|
+
scrollStore: s,
|
|
173
|
+
responsiveStore: i
|
|
170
174
|
})]
|
|
171
175
|
});
|
|
172
176
|
};
|
package/lib/app/app/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { useStore as
|
|
4
|
-
import { SDKContainer as
|
|
5
|
-
import { useSdkFeature as
|
|
6
|
-
import { useSdkResponsive as
|
|
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
|
|
9
|
-
import { useRef as
|
|
10
|
-
import { resetCss as
|
|
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] =
|
|
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 =
|
|
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 =
|
|
56
|
-
sdkReady:
|
|
57
|
-
activeFeature:
|
|
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 = !!
|
|
60
|
-
|
|
59
|
+
} = H(e), o = !!d;
|
|
60
|
+
u(r, {
|
|
61
61
|
enabled: o,
|
|
62
62
|
event: "click",
|
|
63
63
|
listener: g
|
|
64
|
-
}),
|
|
64
|
+
}), u(t, {
|
|
65
65
|
enabled: o,
|
|
66
66
|
event: "scrollend",
|
|
67
67
|
listener: C,
|
|
68
68
|
useDomNode: !0
|
|
69
|
-
}),
|
|
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__ */
|
|
83
|
+
children: /* @__PURE__ */ f(A, {
|
|
84
84
|
ref: r,
|
|
85
85
|
className: n ? "" : "c10llmat",
|
|
86
86
|
children: [o && n && /* @__PURE__ */ l(w, {
|
|
87
|
-
className:
|
|
87
|
+
className: c,
|
|
88
88
|
sdk: e,
|
|
89
89
|
ref: i
|
|
90
|
-
}), o && !n && !!
|
|
91
|
-
className:
|
|
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__ */
|
|
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:
|
|
111
|
+
className: c,
|
|
111
112
|
sdk: e
|
|
112
113
|
}), o && /* @__PURE__ */ l(P, {
|
|
113
114
|
responsiveStore: s,
|
|
114
115
|
appNode: r,
|
|
115
|
-
className:
|
|
116
|
+
className: c,
|
|
116
117
|
sdk: e
|
|
117
118
|
})]
|
|
118
119
|
}), o && !S && /* @__PURE__ */ l("div", {
|