@streamlayer/react-ui 0.95.1 → 0.96.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/assets/style.css +1 -1
- package/lib/ui/app/Features/Gamification/Question.js +38 -32
- package/lib/ui/app/Features/Gamification/QuestionsList.js +9 -8
- package/lib/ui/app/Features/Gamification/Tabs.js +3 -2
- package/lib/ui/app/Features/Gamification/gamification-feature.js +1 -0
- package/lib/ui/app/Features/Gamification/index.js +26 -25
- package/lib/ui/app/Notifications/Onboarding/index.js +90 -77
- package/lib/ui/app/Notifications/index.js +80 -74
- package/lib/ui/app/masters.js +59 -48
- package/lib/ui/app/useMastersApp.js +44 -40
- package/lib/ui/app/useMastersContext.d.ts +8 -0
- package/lib/ui/app/useMastersContext.js +8 -0
- package/lib/ui/app/useSdkResponsive.d.ts +2 -2
- package/lib/ui/gamification/onboarding/index.d.ts +4 -1
- package/lib/ui/gamification/onboarding/index.js +56 -48
- package/lib/ui/gamification/onboarding/invitingUser/index.js +10 -8
- package/lib/ui/gamification/onboarding/invitingUser/styles.d.ts +1 -0
- package/lib/ui/gamification/onboarding/invitingUser/styles.js +12 -7
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +1 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.js +21 -16
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.d.ts +1 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.js +11 -6
- package/lib/ui/gamification/question/insight/index.d.ts +6 -2
- package/lib/ui/gamification/question/insight/index.js +3 -6
- package/lib/ui/gamification/question/list/index.d.ts +2 -0
- package/lib/ui/gamification/question/list/index.js +22 -13
- package/lib/ui/gamification/question/notification/index.d.ts +2 -1
- package/lib/ui/gamification/question/notification/index.js +20 -19
- package/lib/ui/gamification/question/notification/insight/index.d.ts +3 -1
- package/lib/ui/gamification/question/notification/insight/index.js +11 -11
- package/lib/ui/gamification/question/twitter/index.d.ts +6 -2
- package/lib/ui/gamification/question/twitter/index.js +1 -4
- package/lib/ui/gamification/vote/insight-details/index.js +6 -5
- package/lib/ui/modal/index.d.ts +7 -2
- package/lib/ui/modal/index.js +32 -22
- package/lib/ui/questions/insight/index.d.ts +2 -0
- package/lib/ui/questions/insight/index.js +25 -11
- package/lib/ui/questions/insight/styles.d.ts +1 -0
- package/lib/ui/questions/insight/styles.js +11 -6
- package/lib/ui/questions/twitter/index.d.ts +2 -0
- package/lib/ui/questions/twitter/index.js +14 -13
- package/lib/ui/video-player/index.d.ts +5 -0
- package/lib/ui/video-player/index.js +43 -35
- package/package.json +14 -13
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import { Skeleton as
|
|
5
|
-
import { OnboardingInstructions as
|
|
6
|
-
import { OnboardingInviteCard as
|
|
7
|
-
import { OnboardingRules as
|
|
8
|
-
import { OnboardingTerms as
|
|
9
|
-
import { Container as
|
|
1
|
+
import { jsx as t, jsxs as y } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useEffect as s, useMemo as E, useCallback as F } from "react";
|
|
3
|
+
import G from "react-virtualized-auto-sizer";
|
|
4
|
+
import { Skeleton as M } from "../../skeleton/index.js";
|
|
5
|
+
import { OnboardingInstructions as P } from "./slides/onboarding-instructions/index.js";
|
|
6
|
+
import { OnboardingInviteCard as R } from "./slides/onboarding-invite-card/index.js";
|
|
7
|
+
import { OnboardingRules as U } from "./slides/onboarding-rules/index.js";
|
|
8
|
+
import { OnboardingTerms as q } from "./slides/onboarding-terms/index.js";
|
|
9
|
+
import { Container as J, OnboardingHeader as K, CloseBtn as Q, IconClose as V, Content as W, OnboardingFooter as X, OnboardingActionBtn as Y } from "./styles.js";
|
|
10
10
|
import "../../skeleton/styles.js";
|
|
11
11
|
import "@linaria/react";
|
|
12
|
+
import "./invitingUser/index.js";
|
|
13
|
+
import "../../../utils/common.js";
|
|
14
|
+
import "./invitingUser/styles.js";
|
|
12
15
|
import "./slides/onboarding-instructions/styles.js";
|
|
13
16
|
import "../../app/useClipboardCopy.js";
|
|
14
17
|
import "../../../index-jRXrW6ie.js";
|
|
@@ -25,71 +28,76 @@ const m = {
|
|
|
25
28
|
steps: !1,
|
|
26
29
|
rules: !1,
|
|
27
30
|
inviteCard: !1
|
|
28
|
-
},
|
|
29
|
-
gamification:
|
|
31
|
+
}, si = ({
|
|
32
|
+
gamification: v,
|
|
30
33
|
steps: i,
|
|
31
34
|
rules: r,
|
|
32
|
-
rulesBtnLabel:
|
|
33
|
-
rulesTitle:
|
|
34
|
-
termsTitle:
|
|
35
|
-
termsText:
|
|
36
|
-
primaryColor:
|
|
37
|
-
inviteLink:
|
|
38
|
-
socialLinks:
|
|
35
|
+
rulesBtnLabel: d,
|
|
36
|
+
rulesTitle: I,
|
|
37
|
+
termsTitle: T,
|
|
38
|
+
termsText: p,
|
|
39
|
+
primaryColor: u,
|
|
40
|
+
inviteLink: x,
|
|
41
|
+
socialLinks: D,
|
|
39
42
|
inviteCardTitle: k,
|
|
40
|
-
inviteCardSubtext:
|
|
41
|
-
inviteCardBtnLabel:
|
|
42
|
-
loading:
|
|
43
|
-
renderToNode:
|
|
44
|
-
|
|
43
|
+
inviteCardSubtext: w,
|
|
44
|
+
inviteCardBtnLabel: g,
|
|
45
|
+
loading: a,
|
|
46
|
+
renderToNode: A,
|
|
47
|
+
inviterName: c,
|
|
48
|
+
sdk: b,
|
|
49
|
+
onClose: j
|
|
45
50
|
}) => {
|
|
46
|
-
const [o,
|
|
47
|
-
|
|
51
|
+
const [o, C] = h(0), [l, O] = h(!1), [n, e] = h(m);
|
|
52
|
+
s(() => {
|
|
48
53
|
i != null && i.length ? e({ ...m, steps: !0 }) : r != null && r.length ? e({ ...m, rules: !0 }) : e({ ...m, inviteCard: !0 });
|
|
49
54
|
}, []);
|
|
50
|
-
const
|
|
51
|
-
i != null && i.length && o < i.length - 1 ?
|
|
52
|
-
}, [o, i == null ? void 0 : i.length, r == null ? void 0 : r.length, n,
|
|
53
|
-
n.inviteCard ? await
|
|
55
|
+
const H = E(() => n.steps && o === 0 ? "Continue" : n.rules ? l || !d ? "Got it" : d : n.inviteCard ? g || "Play Now" : "Next", [n, o, l, d, g]), N = F(() => {
|
|
56
|
+
i != null && i.length && o < i.length - 1 ? C((f) => ++f) : r != null && r.length && n.steps ? e({ ...m, rules: !0 }) : n.rules && e({ ...m, inviteCard: !0 });
|
|
57
|
+
}, [o, i == null ? void 0 : i.length, r == null ? void 0 : r.length, n, C, e]), z = async () => {
|
|
58
|
+
n.inviteCard ? await v.onboardingStatus.submitInplay() : n.rules && l ? O(!1) : N();
|
|
54
59
|
};
|
|
55
|
-
return
|
|
56
|
-
|
|
57
|
-
|
|
60
|
+
return s(() => {
|
|
61
|
+
!a && c && b.inviteDisplayed();
|
|
62
|
+
}, [a, c, b]), /* @__PURE__ */ t(G, { children: ({ width: f, height: S }) => /* @__PURE__ */ y(J, { style: { width: f, height: S, maxHeight: S }, children: [
|
|
63
|
+
/* @__PURE__ */ t(K, { children: /* @__PURE__ */ t(Q, { onClick: j, children: /* @__PURE__ */ t(V, { name: "icon-close-btn-gray" }) }) }),
|
|
64
|
+
/* @__PURE__ */ y(W, { children: [
|
|
58
65
|
n.steps && (i == null ? void 0 : i.length) && /* @__PURE__ */ t(
|
|
59
|
-
|
|
66
|
+
P,
|
|
60
67
|
{
|
|
61
|
-
loading:
|
|
68
|
+
loading: a,
|
|
62
69
|
stepsCount: i.length,
|
|
63
70
|
currentStep: o,
|
|
71
|
+
inviterName: c,
|
|
64
72
|
...i[o]
|
|
65
73
|
}
|
|
66
74
|
),
|
|
67
75
|
n.rules && !l && /* @__PURE__ */ t(
|
|
68
|
-
|
|
76
|
+
U,
|
|
69
77
|
{
|
|
70
78
|
rules: r,
|
|
71
|
-
rulesTitle:
|
|
72
|
-
termsText:
|
|
73
|
-
primaryColor:
|
|
74
|
-
openTerms: () =>
|
|
79
|
+
rulesTitle: I,
|
|
80
|
+
termsText: p,
|
|
81
|
+
primaryColor: u,
|
|
82
|
+
openTerms: () => O(!0)
|
|
75
83
|
}
|
|
76
84
|
),
|
|
77
|
-
n.rules && l && /* @__PURE__ */ t(
|
|
85
|
+
n.rules && l && /* @__PURE__ */ t(q, { termsTitle: T, termsText: p }),
|
|
78
86
|
n.inviteCard && /* @__PURE__ */ t(
|
|
79
|
-
|
|
87
|
+
R,
|
|
80
88
|
{
|
|
81
|
-
inviteLink:
|
|
89
|
+
inviteLink: x,
|
|
82
90
|
inviteCardTitle: k,
|
|
83
|
-
inviteCardSubtext:
|
|
84
|
-
primaryColor:
|
|
85
|
-
socialLinks:
|
|
86
|
-
renderToNode:
|
|
91
|
+
inviteCardSubtext: w,
|
|
92
|
+
primaryColor: u,
|
|
93
|
+
socialLinks: D,
|
|
94
|
+
renderToNode: A
|
|
87
95
|
}
|
|
88
96
|
)
|
|
89
97
|
] }),
|
|
90
|
-
/* @__PURE__ */ t(
|
|
98
|
+
/* @__PURE__ */ t(X, { children: /* @__PURE__ */ t(M, { loading: a, style: { width: "100%" }, children: /* @__PURE__ */ t(Y, { onClick: z, children: H }) }) })
|
|
91
99
|
] }) });
|
|
92
100
|
};
|
|
93
101
|
export {
|
|
94
|
-
|
|
102
|
+
si as OnboardingUI
|
|
95
103
|
};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { abbreviate as t } from "../../../../utils/common.js";
|
|
3
|
+
import { Container as n, Avatar as c, AvatarPlaceholder as m, Content as s, Name as l } from "./styles.js";
|
|
3
4
|
import "@linaria/react";
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const a = ({ avatar: r, name: o }) => /* @__PURE__ */ i(n, { children: [
|
|
6
|
+
r && /* @__PURE__ */ e(c, { src: r }),
|
|
7
|
+
!r && /* @__PURE__ */ e(m, { children: t(o || "") }),
|
|
8
|
+
/* @__PURE__ */ i(s, { children: [
|
|
9
|
+
/* @__PURE__ */ i(l, { children: [
|
|
10
|
+
o,
|
|
9
11
|
" "
|
|
10
12
|
] }),
|
|
11
13
|
"is waiting for you!"
|
|
12
14
|
] })
|
|
13
15
|
] });
|
|
14
16
|
export {
|
|
15
|
-
|
|
17
|
+
a as InvitingUser
|
|
16
18
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const Container: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
3
3
|
export declare const Avatar: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown>>;
|
|
4
|
+
export declare const AvatarPlaceholder: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
4
5
|
export declare const Content: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
5
6
|
export declare const Name: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
|
-
const
|
|
2
|
+
const e = /* @__PURE__ */ s("div")({
|
|
3
3
|
name: "Container",
|
|
4
4
|
class: "cl51m2q",
|
|
5
5
|
propsAsIs: !1
|
|
6
|
-
}),
|
|
6
|
+
}), n = /* @__PURE__ */ s("img")({
|
|
7
7
|
name: "Avatar",
|
|
8
8
|
class: "a2yhhhr",
|
|
9
9
|
propsAsIs: !1
|
|
10
10
|
}), t = /* @__PURE__ */ s("div")({
|
|
11
|
+
name: "AvatarPlaceholder",
|
|
12
|
+
class: "a1dtxxlr",
|
|
13
|
+
propsAsIs: !1
|
|
14
|
+
}), l = /* @__PURE__ */ s("div")({
|
|
11
15
|
name: "Content",
|
|
12
|
-
class: "
|
|
16
|
+
class: "c12clm3w",
|
|
13
17
|
propsAsIs: !1
|
|
14
18
|
}), o = /* @__PURE__ */ s("span")({
|
|
15
19
|
name: "Name",
|
|
16
|
-
class: "
|
|
20
|
+
class: "n14lctn7",
|
|
17
21
|
propsAsIs: !1
|
|
18
22
|
});
|
|
19
23
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
n as Avatar,
|
|
25
|
+
t as AvatarPlaceholder,
|
|
26
|
+
e as Container,
|
|
27
|
+
l as Content,
|
|
23
28
|
o as Name
|
|
24
29
|
};
|
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import "
|
|
1
|
+
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { InvitingUser as s } from "../../invitingUser/index.js";
|
|
3
|
+
import { Skeleton as p } from "../../../../skeleton/index.js";
|
|
4
|
+
import { Container as h, Content as a, Graphic as l, Headline as f, InvitingUserWrap as x, StepsContainer as g, StepIndicator as y } from "./styles.js";
|
|
5
|
+
import "../../../../../utils/common.js";
|
|
6
|
+
import "../../invitingUser/styles.js";
|
|
5
7
|
import "@linaria/react";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
import "../../../../skeleton/styles.js";
|
|
9
|
+
const G = ({
|
|
10
|
+
loading: i,
|
|
11
|
+
graphicSrc: c,
|
|
12
|
+
headline: t,
|
|
13
|
+
stepsCount: d,
|
|
14
|
+
currentStep: n,
|
|
15
|
+
inviterName: e
|
|
16
|
+
}) => /* @__PURE__ */ m(h, { children: [
|
|
17
|
+
/* @__PURE__ */ m(a, { "data-centered": n === 0, children: [
|
|
18
|
+
/* @__PURE__ */ r(l, { children: /* @__PURE__ */ r(p, { loading: i, style: { width: "80px", height: "80px" }, children: /* @__PURE__ */ r("img", { src: c, alt: t }) }) }),
|
|
19
|
+
t && /* @__PURE__ */ r(p, { loading: i, children: /* @__PURE__ */ r(f, { children: t }) })
|
|
16
20
|
] }),
|
|
17
|
-
/* @__PURE__ */ r(
|
|
21
|
+
e && n === 0 && /* @__PURE__ */ r(x, { children: /* @__PURE__ */ r(s, { name: e }) }),
|
|
22
|
+
/* @__PURE__ */ r(g, { style: i ? { visibility: "hidden" } : {}, children: Array.from({ length: d }).map((I, o) => /* @__PURE__ */ r(y, { "data-active": n === o }, o)) })
|
|
18
23
|
] });
|
|
19
24
|
export {
|
|
20
|
-
|
|
25
|
+
G as OnboardingInstructions
|
|
21
26
|
};
|
|
@@ -5,3 +5,4 @@ export declare const Headline: import("@linaria/react").StyledComponent<import("
|
|
|
5
5
|
export declare const Content: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
6
6
|
export declare const StepsContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
7
7
|
export declare const StepIndicator: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
|
|
8
|
+
export declare const InvitingUserWrap: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
@@ -7,7 +7,7 @@ const a = /* @__PURE__ */ s("div")({
|
|
|
7
7
|
name: "Graphic",
|
|
8
8
|
class: "gjyzpp7",
|
|
9
9
|
propsAsIs: !1
|
|
10
|
-
}),
|
|
10
|
+
}), p = /* @__PURE__ */ s("div")({
|
|
11
11
|
name: "Headline",
|
|
12
12
|
class: "h16mldgz",
|
|
13
13
|
propsAsIs: !1
|
|
@@ -15,20 +15,25 @@ const a = /* @__PURE__ */ s("div")({
|
|
|
15
15
|
name: "Content",
|
|
16
16
|
class: "c69js65",
|
|
17
17
|
propsAsIs: !1
|
|
18
|
-
}),
|
|
18
|
+
}), o = /* @__PURE__ */ s("div")({
|
|
19
19
|
name: "StepsContainer",
|
|
20
20
|
class: "smm7qmo",
|
|
21
21
|
propsAsIs: !1
|
|
22
|
-
}),
|
|
22
|
+
}), i = /* @__PURE__ */ s("span")({
|
|
23
23
|
name: "StepIndicator",
|
|
24
24
|
class: "s17knuw2",
|
|
25
25
|
propsAsIs: !1
|
|
26
|
+
}), r = /* @__PURE__ */ s("div")({
|
|
27
|
+
name: "InvitingUserWrap",
|
|
28
|
+
class: "i1b74psg",
|
|
29
|
+
propsAsIs: !1
|
|
26
30
|
});
|
|
27
31
|
export {
|
|
28
32
|
a as Container,
|
|
29
33
|
t as Content,
|
|
30
34
|
e as Graphic,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
p as Headline,
|
|
36
|
+
r as InvitingUserWrap,
|
|
37
|
+
i as StepIndicator,
|
|
38
|
+
o as StepsContainer
|
|
34
39
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { InsightContentProps } from '../../../questions/insight';
|
|
3
|
-
|
|
3
|
+
import { VideoPlayerProps } from '../../../video-player';
|
|
4
|
+
type InsightProps = InsightContentProps & {
|
|
4
5
|
openInsight?: (questionId: string) => void;
|
|
5
|
-
|
|
6
|
+
controlVideo: VideoPlayerProps['controlVideo'];
|
|
7
|
+
};
|
|
8
|
+
export declare const Insight: React.FC<InsightProps>;
|
|
9
|
+
export {};
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import { jsxs as m, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { InsightContent as n } from "../../../questions/insight/index.js";
|
|
3
3
|
import { Container as p, ActionBtn as c } from "./styles.js";
|
|
4
|
+
import "@streamlayer/sdk-web-types";
|
|
4
5
|
import "../../../video-player/index.js";
|
|
5
6
|
import "react";
|
|
6
7
|
import "../../../icons/index.js";
|
|
7
8
|
import "@linaria/react";
|
|
8
9
|
import "../../../video-player/styles.js";
|
|
9
10
|
import "../../../questions/insight/styles.js";
|
|
10
|
-
const
|
|
11
|
-
openInsight: r,
|
|
12
|
-
questionId: t,
|
|
13
|
-
...o
|
|
14
|
-
}) => /* @__PURE__ */ m(p, { children: [
|
|
11
|
+
const d = ({ openInsight: r, questionId: t, ...o }) => /* @__PURE__ */ m(p, { children: [
|
|
15
12
|
/* @__PURE__ */ i(n, { questionId: t, ...o }),
|
|
16
13
|
r && /* @__PURE__ */ i(c, { onClick: () => r(t), children: "View Insight" })
|
|
17
14
|
] });
|
|
18
15
|
export {
|
|
19
|
-
|
|
16
|
+
d as Insight
|
|
20
17
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { Gamification } from '@streamlayer/feature-gamification';
|
|
3
|
+
import { VideoPlayerProps } from '../../../video-player';
|
|
3
4
|
type FeedItem = Exclude<Awaited<ReturnType<Exclude<Gamification['feedList'], undefined>['getValue']>>, undefined>;
|
|
4
5
|
interface QuestionListProps {
|
|
5
6
|
questions: FeedItem;
|
|
6
7
|
openQuestion: (questionId: string) => void;
|
|
8
|
+
controlVideo: VideoPlayerProps['controlVideo'];
|
|
7
9
|
}
|
|
8
10
|
export declare const QuestionList: React.FC<QuestionListProps>;
|
|
9
11
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { Question as
|
|
3
|
-
import { Insight as
|
|
4
|
-
import { Twitter as
|
|
5
|
-
import { QuestionsContainer as
|
|
2
|
+
import { Question as b } from "../index.js";
|
|
3
|
+
import { Insight as p } from "../insight/index.js";
|
|
4
|
+
import { Twitter as c } from "../twitter/index.js";
|
|
5
|
+
import { QuestionsContainer as f } from "./styles.js";
|
|
6
6
|
import "@streamlayer/sdk-web-types";
|
|
7
7
|
import "../../constants.js";
|
|
8
8
|
import "../styles.js";
|
|
@@ -22,22 +22,31 @@ import "../../../questions/twitter/styles.js";
|
|
|
22
22
|
import "../twitter/styles.js";
|
|
23
23
|
import "../../../button/index.js";
|
|
24
24
|
import "../../../button/styles.js";
|
|
25
|
-
const
|
|
26
|
-
var
|
|
27
|
-
if (t.type === "question" && ((
|
|
25
|
+
const J = ({ questions: e, openQuestion: m, controlVideo: o }) => /* @__PURE__ */ r(f, { children: e == null ? void 0 : e.map((t) => {
|
|
26
|
+
var u, a, n;
|
|
27
|
+
if (t.type === "question" && ((u = t.attributes) == null ? void 0 : u.attributes.case) === "question") {
|
|
28
28
|
const i = t.attributes.attributes.value;
|
|
29
|
-
return /* @__PURE__ */ r(
|
|
29
|
+
return /* @__PURE__ */ r(b, { openQuestion: m, ...i }, i.questionId);
|
|
30
30
|
}
|
|
31
|
-
if (t.type === "insight" && ((
|
|
31
|
+
if (t.type === "insight" && ((a = t.attributes) == null ? void 0 : a.attributes.case) === "insight") {
|
|
32
32
|
const i = t.attributes.attributes.value;
|
|
33
|
-
return /* @__PURE__ */ r(
|
|
33
|
+
return /* @__PURE__ */ r(p, { openInsight: m, controlVideo: o, ...i }, i.questionId);
|
|
34
34
|
}
|
|
35
35
|
if (t.type === "tweet" && ((n = t.attributes) == null ? void 0 : n.attributes.case) === "tweet") {
|
|
36
|
-
const i = t.attributes.attributes.value,
|
|
37
|
-
return /* @__PURE__ */ r(
|
|
36
|
+
const i = t.attributes.attributes.value, s = t.attributes.id;
|
|
37
|
+
return /* @__PURE__ */ r(
|
|
38
|
+
c,
|
|
39
|
+
{
|
|
40
|
+
openTweet: m,
|
|
41
|
+
controlVideo: o,
|
|
42
|
+
...i,
|
|
43
|
+
tweetId: s
|
|
44
|
+
},
|
|
45
|
+
s
|
|
46
|
+
);
|
|
38
47
|
}
|
|
39
48
|
return null;
|
|
40
49
|
}) });
|
|
41
50
|
export {
|
|
42
|
-
|
|
51
|
+
J as QuestionList
|
|
43
52
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { Notification as NotificationProps } from '@streamlayer/sdk-web-notifications';
|
|
3
|
-
|
|
3
|
+
import { VideoPlayerProps } from '../../../video-player';
|
|
4
|
+
export declare const Notification: React.FC<NotificationProps & Pick<VideoPlayerProps, 'controlVideo'>>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as a, jsx as o, Fragment as
|
|
1
|
+
import { jsxs as a, jsx as o, Fragment as d } from "react/jsx-runtime";
|
|
2
2
|
import { QuestionType as t } from "@streamlayer/sdk-web-types";
|
|
3
|
-
import { QuestionTypeData as
|
|
4
|
-
import { Insight as
|
|
5
|
-
import { Container as
|
|
6
|
-
import { Tweet as
|
|
3
|
+
import { QuestionTypeData as T } from "../../constants.js";
|
|
4
|
+
import { Insight as f } from "./insight/index.js";
|
|
5
|
+
import { Container as h, CloseIconWrap as E, CloseIcon as I, Header as C, TypeIcon as s, TypeName as A, Question as W, AnswerButton as x } from "./styles.js";
|
|
6
|
+
import { Tweet as D } from "./tweet/index.js";
|
|
7
7
|
import "../../../video-player/index.js";
|
|
8
8
|
import "react";
|
|
9
9
|
import "../../../icons/index.js";
|
|
@@ -16,36 +16,37 @@ import "../../../../utils/common.js";
|
|
|
16
16
|
import "../../../questions/twitter/account/styles.js";
|
|
17
17
|
import "../../../questions/twitter/styles.js";
|
|
18
18
|
import "./tweet/styles.js";
|
|
19
|
-
const
|
|
19
|
+
const G = ({
|
|
20
20
|
close: n,
|
|
21
21
|
action: i,
|
|
22
|
-
|
|
22
|
+
controlVideo: l,
|
|
23
|
+
data: { questionType: r, question: m, insight: e, tweet: c }
|
|
23
24
|
}) => {
|
|
24
|
-
const p =
|
|
25
|
-
return p ? /* @__PURE__ */ a(
|
|
26
|
-
/* @__PURE__ */ o(
|
|
27
|
-
r !== t.TWEET && /* @__PURE__ */ a(
|
|
25
|
+
const p = T[r];
|
|
26
|
+
return p ? /* @__PURE__ */ a(h, { style: r === t.TWEET ? { paddingTop: "12px" } : {}, children: [
|
|
27
|
+
/* @__PURE__ */ o(E, { onClick: n, children: /* @__PURE__ */ o(I, { name: "icon-cross" }) }),
|
|
28
|
+
r !== t.TWEET && /* @__PURE__ */ a(C, { children: [
|
|
28
29
|
/* @__PURE__ */ o(
|
|
29
|
-
|
|
30
|
+
s,
|
|
30
31
|
{
|
|
31
32
|
"data-type-trivia": r === t.TRIVIA,
|
|
32
33
|
"data-type-poll": r === t.POLL,
|
|
33
34
|
name: p.iconName
|
|
34
35
|
}
|
|
35
36
|
),
|
|
36
|
-
/* @__PURE__ */ o(
|
|
37
|
+
/* @__PURE__ */ o(A, { children: p.label })
|
|
37
38
|
] }),
|
|
38
|
-
r === t.FACTOID && /* @__PURE__ */ o(
|
|
39
|
+
r === t.FACTOID && /* @__PURE__ */ o(f, { ...e, action: i, controlVideo: l }),
|
|
39
40
|
r === t.TWEET && // ToDo: connect with real Api data
|
|
40
41
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
41
42
|
// @ts-ignore
|
|
42
|
-
/* @__PURE__ */ o(
|
|
43
|
-
r !== t.FACTOID && r !== t.TWEET && /* @__PURE__ */ a(
|
|
44
|
-
/* @__PURE__ */ o(
|
|
45
|
-
/* @__PURE__ */ o(
|
|
43
|
+
/* @__PURE__ */ o(D, { ...c, action: i }),
|
|
44
|
+
r !== t.FACTOID && r !== t.TWEET && /* @__PURE__ */ a(d, { children: [
|
|
45
|
+
/* @__PURE__ */ o(W, { children: m == null ? void 0 : m.title }),
|
|
46
|
+
/* @__PURE__ */ o(x, { onClick: i, children: "Answer" })
|
|
46
47
|
] })
|
|
47
48
|
] }) : null;
|
|
48
49
|
};
|
|
49
50
|
export {
|
|
50
|
-
|
|
51
|
+
G as Notification
|
|
51
52
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { Notification } from '@streamlayer/sdk-web-notifications';
|
|
3
3
|
import { InsightHistory, InstantView } from '@streamlayer/sdk-web-types';
|
|
4
|
+
import { VideoPlayerProps } from '../../../../video-player';
|
|
4
5
|
export type InsightProps = InstantView & {
|
|
5
|
-
imageMode
|
|
6
|
+
imageMode?: InsightHistory['imageMode'];
|
|
6
7
|
action: Notification['action'];
|
|
8
|
+
controlVideo: VideoPlayerProps['controlVideo'];
|
|
7
9
|
};
|
|
8
10
|
export declare const Insight: React.FC<InsightProps>;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { QuestionImages as
|
|
3
|
-
import { VideoPlayer as
|
|
4
|
-
import { InsightContainer as
|
|
2
|
+
import { QuestionImages as p } from "@streamlayer/sdk-web-types";
|
|
3
|
+
import { VideoPlayer as e } from "../../../../video-player/index.js";
|
|
4
|
+
import { InsightContainer as h, ImageContainer as u, Image as a, InsightContent as I, Title as g, Description as f, ActionBtn as C } from "./styles.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "../../../../icons/index.js";
|
|
7
7
|
import "@linaria/react";
|
|
8
8
|
import "../../../../video-player/styles.js";
|
|
9
|
-
const
|
|
10
|
-
(r == null ? void 0 : r.url) && /* @__PURE__ */ t(
|
|
11
|
-
n && !(r != null && r.url) && /* @__PURE__ */ t(
|
|
12
|
-
/* @__PURE__ */ m(
|
|
13
|
-
/* @__PURE__ */ t(
|
|
14
|
-
/* @__PURE__ */ t(
|
|
15
|
-
l && /* @__PURE__ */ t(
|
|
9
|
+
const y = ({ video: r, image: n, imageMode: s, heading: i, body: o, action: l, controlVideo: c }) => /* @__PURE__ */ m(h, { children: [
|
|
10
|
+
(r == null ? void 0 : r.url) && /* @__PURE__ */ t(e, { source: r.url, poster: r.thumbnailUrl, controlVideo: c }),
|
|
11
|
+
n && !(r != null && r.url) && /* @__PURE__ */ t(u, { "data-rounded": s === p.ROUNDED, children: /* @__PURE__ */ t(a, { src: n, alt: i }) }),
|
|
12
|
+
/* @__PURE__ */ m(I, { children: [
|
|
13
|
+
/* @__PURE__ */ t(g, { children: i }),
|
|
14
|
+
/* @__PURE__ */ t(f, { children: o }),
|
|
15
|
+
l && /* @__PURE__ */ t(C, { onClick: l, children: "View Insight" })
|
|
16
16
|
] })
|
|
17
17
|
] });
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
y as Insight
|
|
20
20
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type TwitterContentProps } from '../../../questions/twitter';
|
|
3
|
-
|
|
3
|
+
import { VideoPlayerProps } from '../../../video-player';
|
|
4
|
+
type TwitterProps = TwitterContentProps & {
|
|
4
5
|
openTweet?: (questionId: string) => void;
|
|
5
|
-
|
|
6
|
+
controlVideo: VideoPlayerProps['controlVideo'];
|
|
7
|
+
};
|
|
8
|
+
export declare const Twitter: React.FC<TwitterProps>;
|
|
9
|
+
export {};
|
|
@@ -12,10 +12,7 @@ import "../../../questions/twitter/account/styles.js";
|
|
|
12
12
|
import "../../../questions/twitter/styles.js";
|
|
13
13
|
import "../../../button/index.js";
|
|
14
14
|
import "../../../button/styles.js";
|
|
15
|
-
const k = ({
|
|
16
|
-
openTweet: o,
|
|
17
|
-
...t
|
|
18
|
-
}) => /* @__PURE__ */ r(e, { children: [
|
|
15
|
+
const k = ({ openTweet: o, ...t }) => /* @__PURE__ */ r(e, { children: [
|
|
19
16
|
t.title && /* @__PURE__ */ i(n, { children: t.title }),
|
|
20
17
|
/* @__PURE__ */ i(m, { ...t }),
|
|
21
18
|
o && /* @__PURE__ */ i(p, { onClick: () => o(t.tweetId), children: "View Insight" })
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { jsxs as o, jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import { SvgIcon as
|
|
2
|
+
import { SvgIcon as l } from "../../../icons/index.js";
|
|
3
3
|
import { InsightContent as b } from "../../../questions/insight/index.js";
|
|
4
4
|
import { Container as k, WebLinkBtn as c } from "./styles.js";
|
|
5
5
|
import "@linaria/react";
|
|
6
6
|
import "react";
|
|
7
|
+
import "@streamlayer/sdk-web-types";
|
|
7
8
|
import "../../../video-player/index.js";
|
|
8
9
|
import "../../../video-player/styles.js";
|
|
9
10
|
import "../../../questions/insight/styles.js";
|
|
10
|
-
const
|
|
11
|
-
/* @__PURE__ */ m(b, { instantView: r, ...
|
|
11
|
+
const C = ({ instantView: r, ...p }) => /* @__PURE__ */ o(k, { children: [
|
|
12
|
+
/* @__PURE__ */ m(b, { instantView: r, ...p, isDetail: !0 }),
|
|
12
13
|
(r == null ? void 0 : r.webLink) && /* @__PURE__ */ o(c, { href: r == null ? void 0 : r.webLink.url, target: "_blank", children: [
|
|
13
14
|
r == null ? void 0 : r.webLink.label,
|
|
14
|
-
/* @__PURE__ */ m(
|
|
15
|
+
/* @__PURE__ */ m(l, { name: "icon-external-link" })
|
|
15
16
|
] })
|
|
16
17
|
] });
|
|
17
18
|
export {
|
|
18
|
-
|
|
19
|
+
C as InsightDetails
|
|
19
20
|
};
|
package/lib/ui/modal/index.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
type ModalProps = {
|
|
3
|
-
|
|
3
|
+
children: React.ReactNode;
|
|
4
4
|
container: React.MutableRefObject<HTMLDivElement | null>;
|
|
5
5
|
fixedView: boolean;
|
|
6
6
|
useContainer: boolean;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* ModalPortal is a component that renders the Modal into the portal on the container provided in the props.
|
|
10
|
+
* It also handles the fixed view of the modal, when the modal is open in fullscreen view.
|
|
11
|
+
* the fixedView prop is used to initiate the fixed view of the modal.
|
|
12
|
+
*/
|
|
13
|
+
export declare const ModalPortal: React.FC<ModalProps>;
|
|
9
14
|
export {};
|