@streamlayer/react-ui 0.95.1 → 0.96.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 (41) hide show
  1. package/lib/assets/style.css +1 -1
  2. package/lib/ui/app/Features/Gamification/Question.js +38 -32
  3. package/lib/ui/app/Features/Gamification/QuestionsList.js +9 -8
  4. package/lib/ui/app/Features/Gamification/Tabs.js +3 -2
  5. package/lib/ui/app/Features/Gamification/gamification-feature.js +1 -0
  6. package/lib/ui/app/Features/Gamification/index.js +26 -25
  7. package/lib/ui/app/Notifications/Onboarding/index.js +90 -77
  8. package/lib/ui/app/Notifications/index.js +80 -74
  9. package/lib/ui/app/masters.js +59 -48
  10. package/lib/ui/app/useMastersApp.js +44 -40
  11. package/lib/ui/app/useMastersContext.d.ts +8 -0
  12. package/lib/ui/app/useMastersContext.js +8 -0
  13. package/lib/ui/app/useSdkResponsive.d.ts +2 -2
  14. package/lib/ui/gamification/onboarding/index.d.ts +4 -1
  15. package/lib/ui/gamification/onboarding/index.js +56 -48
  16. package/lib/ui/gamification/onboarding/invitingUser/index.js +10 -8
  17. package/lib/ui/gamification/onboarding/invitingUser/styles.d.ts +1 -0
  18. package/lib/ui/gamification/onboarding/invitingUser/styles.js +12 -7
  19. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +1 -0
  20. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.js +21 -16
  21. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.d.ts +1 -0
  22. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.js +11 -6
  23. package/lib/ui/gamification/question/insight/index.d.ts +6 -2
  24. package/lib/ui/gamification/question/insight/index.js +1 -5
  25. package/lib/ui/gamification/question/list/index.d.ts +2 -0
  26. package/lib/ui/gamification/question/list/index.js +22 -13
  27. package/lib/ui/gamification/question/notification/index.d.ts +2 -1
  28. package/lib/ui/gamification/question/notification/index.js +20 -19
  29. package/lib/ui/gamification/question/notification/insight/index.d.ts +3 -1
  30. package/lib/ui/gamification/question/notification/insight/index.js +11 -11
  31. package/lib/ui/gamification/question/twitter/index.d.ts +6 -2
  32. package/lib/ui/gamification/question/twitter/index.js +1 -4
  33. package/lib/ui/modal/index.d.ts +7 -2
  34. package/lib/ui/modal/index.js +32 -22
  35. package/lib/ui/questions/insight/index.d.ts +2 -0
  36. package/lib/ui/questions/insight/index.js +23 -11
  37. package/lib/ui/questions/twitter/index.d.ts +2 -0
  38. package/lib/ui/questions/twitter/index.js +14 -13
  39. package/lib/ui/video-player/index.d.ts +5 -0
  40. package/lib/ui/video-player/index.js +43 -35
  41. package/package.json +14 -13
@@ -1,14 +1,17 @@
1
- import { jsx as t, jsxs as O } from "react/jsx-runtime";
2
- import { useState as c, useEffect as j, useMemo as H, useCallback as z } from "react";
3
- import E from "react-virtualized-auto-sizer";
4
- import { Skeleton as F } from "../../skeleton/index.js";
5
- import { OnboardingInstructions as G } from "./slides/onboarding-instructions/index.js";
6
- import { OnboardingInviteCard as M } from "./slides/onboarding-invite-card/index.js";
7
- import { OnboardingRules as P } from "./slides/onboarding-rules/index.js";
8
- import { OnboardingTerms as R } from "./slides/onboarding-terms/index.js";
9
- import { Container as q, OnboardingHeader as J, CloseBtn as K, IconClose as Q, Content as U, OnboardingFooter as V, OnboardingActionBtn as W } from "./styles.js";
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
- }, bi = ({
29
- gamification: S,
31
+ }, si = ({
32
+ gamification: v,
30
33
  steps: i,
31
34
  rules: r,
32
- rulesBtnLabel: a,
33
- rulesTitle: y,
34
- termsTitle: s,
35
- termsText: f,
36
- primaryColor: g,
37
- inviteLink: v,
38
- socialLinks: T,
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: x,
41
- inviteCardBtnLabel: h,
42
- loading: u,
43
- renderToNode: I,
44
- onClose: N
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, p] = c(0), [l, b] = c(!1), [n, e] = c(m);
47
- j(() => {
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 w = H(() => n.steps && o === 0 ? "Continue" : n.rules ? l || !a ? "Got it" : a : n.inviteCard ? h || "Play Now" : "Next", [n, o, l, a, h]), A = z(() => {
51
- i != null && i.length && o < i.length - 1 ? p((d) => ++d) : r != null && r.length && n.steps ? e({ ...m, rules: !0 }) : n.rules && e({ ...m, inviteCard: !0 });
52
- }, [o, i == null ? void 0 : i.length, r == null ? void 0 : r.length, n, p, e]), D = async () => {
53
- n.inviteCard ? await S.onboardingStatus.submitInplay() : n.rules && l ? b(!1) : A();
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 /* @__PURE__ */ t(E, { children: ({ width: d, height: C }) => /* @__PURE__ */ O(q, { style: { width: d, height: C, maxHeight: C }, children: [
56
- /* @__PURE__ */ t(J, { children: /* @__PURE__ */ t(K, { onClick: N, children: /* @__PURE__ */ t(Q, { name: "icon-close-btn-gray" }) }) }),
57
- /* @__PURE__ */ O(U, { children: [
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
- G,
66
+ P,
60
67
  {
61
- loading: u,
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
- P,
76
+ U,
69
77
  {
70
78
  rules: r,
71
- rulesTitle: y,
72
- termsText: f,
73
- primaryColor: g,
74
- openTerms: () => b(!0)
79
+ rulesTitle: I,
80
+ termsText: p,
81
+ primaryColor: u,
82
+ openTerms: () => O(!0)
75
83
  }
76
84
  ),
77
- n.rules && l && /* @__PURE__ */ t(R, { termsTitle: s, termsText: f }),
85
+ n.rules && l && /* @__PURE__ */ t(q, { termsTitle: T, termsText: p }),
78
86
  n.inviteCard && /* @__PURE__ */ t(
79
- M,
87
+ R,
80
88
  {
81
- inviteLink: v,
89
+ inviteLink: x,
82
90
  inviteCardTitle: k,
83
- inviteCardSubtext: x,
84
- primaryColor: g,
85
- socialLinks: T,
86
- renderToNode: I
91
+ inviteCardSubtext: w,
92
+ primaryColor: u,
93
+ socialLinks: D,
94
+ renderToNode: A
87
95
  }
88
96
  )
89
97
  ] }),
90
- /* @__PURE__ */ t(V, { children: /* @__PURE__ */ t(F, { loading: u, style: { width: "100%" }, children: /* @__PURE__ */ t(W, { onClick: D, children: w }) }) })
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
- bi as Onboarding
102
+ si as OnboardingUI
95
103
  };
@@ -1,16 +1,18 @@
1
- import { jsxs as r, jsx as o } from "react/jsx-runtime";
2
- import { Container as t, Avatar as e, Content as s, Name as m } from "./styles.js";
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 f = ({ avatar: i, name: n }) => /* @__PURE__ */ r(t, { children: [
5
- i && /* @__PURE__ */ o(e, { src: i }),
6
- /* @__PURE__ */ r(s, { children: [
7
- /* @__PURE__ */ r(m, { children: [
8
- n,
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
- f as InvitingUser
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 n = /* @__PURE__ */ s("div")({
2
+ const e = /* @__PURE__ */ s("div")({
3
3
  name: "Container",
4
4
  class: "cl51m2q",
5
5
  propsAsIs: !1
6
- }), e = /* @__PURE__ */ s("img")({
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: "c1dtxxlr",
16
+ class: "c12clm3w",
13
17
  propsAsIs: !1
14
18
  }), o = /* @__PURE__ */ s("span")({
15
19
  name: "Name",
16
- class: "n12clm3w",
20
+ class: "n14lctn7",
17
21
  propsAsIs: !1
18
22
  });
19
23
  export {
20
- e as Avatar,
21
- n as Container,
22
- t as Content,
24
+ n as Avatar,
25
+ t as AvatarPlaceholder,
26
+ e as Container,
27
+ l as Content,
23
28
  o as Name
24
29
  };
@@ -3,6 +3,7 @@ type OnboardingInstructionsProps = OnboardingStep & {
3
3
  loading: boolean;
4
4
  stepsCount: number;
5
5
  currentStep: number;
6
+ inviterName?: string;
6
7
  };
7
8
  export type OnboardingStep = {
8
9
  graphicSrc: string;
@@ -1,21 +1,26 @@
1
- import { jsxs as o, jsx as r } from "react/jsx-runtime";
2
- import { Skeleton as c } from "../../../../skeleton/index.js";
3
- import { Container as m, Content as p, Graphic as s, Headline as a, StepsContainer as l, StepIndicator as x } from "./styles.js";
4
- import "../../../../skeleton/styles.js";
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
- const v = ({
7
- loading: t,
8
- graphicSrc: d,
9
- headline: i,
10
- stepsCount: h,
11
- currentStep: e
12
- }) => /* @__PURE__ */ o(m, { children: [
13
- /* @__PURE__ */ o(p, { "data-centered": e === 0, children: [
14
- /* @__PURE__ */ r(s, { children: /* @__PURE__ */ r(c, { loading: t, style: { width: "80px", height: "80px" }, children: /* @__PURE__ */ r("img", { src: d, alt: i }) }) }),
15
- i && /* @__PURE__ */ r(c, { loading: t, children: /* @__PURE__ */ r(a, { children: i }) })
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(l, { style: t ? { visibility: "hidden" } : {}, children: Array.from({ length: h }).map((f, n) => /* @__PURE__ */ r(x, { "data-active": e === n }, n)) })
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
- v as OnboardingInstructions
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
- }), o = /* @__PURE__ */ s("div")({
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
- }), p = /* @__PURE__ */ s("div")({
18
+ }), o = /* @__PURE__ */ s("div")({
19
19
  name: "StepsContainer",
20
20
  class: "smm7qmo",
21
21
  propsAsIs: !1
22
- }), c = /* @__PURE__ */ s("span")({
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
- o as Headline,
32
- c as StepIndicator,
33
- p as StepsContainer
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
- export declare const Insight: React.FC<{
3
+ import { VideoPlayerProps } from '../../../video-player';
4
+ type InsightProps = InsightContentProps & {
4
5
  openInsight?: (questionId: string) => void;
5
- } & InsightContentProps>;
6
+ controlVideo: VideoPlayerProps['controlVideo'];
7
+ };
8
+ export declare const Insight: React.FC<InsightProps>;
9
+ export {};
@@ -7,11 +7,7 @@ import "../../../icons/index.js";
7
7
  import "@linaria/react";
8
8
  import "../../../video-player/styles.js";
9
9
  import "../../../questions/insight/styles.js";
10
- const a = ({
11
- openInsight: r,
12
- questionId: t,
13
- ...o
14
- }) => /* @__PURE__ */ m(p, { children: [
10
+ const a = ({ openInsight: r, questionId: t, ...o }) => /* @__PURE__ */ m(p, { children: [
15
11
  /* @__PURE__ */ i(n, { questionId: t, ...o }),
16
12
  r && /* @__PURE__ */ i(c, { onClick: () => r(t), children: "View Insight" })
17
13
  ] });
@@ -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 s } from "../index.js";
3
- import { Insight as b } from "../insight/index.js";
4
- import { Twitter as p } from "../twitter/index.js";
5
- import { QuestionsContainer as c } from "./styles.js";
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 H = ({ questions: e, openQuestion: m }) => /* @__PURE__ */ r(c, { children: e == null ? void 0 : e.map((t) => {
26
- var o, u, n;
27
- if (t.type === "question" && ((o = t.attributes) == null ? void 0 : o.attributes.case) === "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(s, { openQuestion: m, ...i }, i.questionId);
29
+ return /* @__PURE__ */ r(b, { openQuestion: m, ...i }, i.questionId);
30
30
  }
31
- if (t.type === "insight" && ((u = t.attributes) == null ? void 0 : u.attributes.case) === "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(b, { openInsight: m, ...i }, i.questionId);
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, a = t.attributes.id;
37
- return /* @__PURE__ */ r(p, { openTweet: m, ...i, tweetId: a }, a);
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
- H as QuestionList
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
- export declare const Notification: React.FC<NotificationProps>;
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 c } from "react/jsx-runtime";
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 d } from "../../constants.js";
4
- import { Insight as T } from "./insight/index.js";
5
- import { Container as f, CloseIconWrap as h, CloseIcon as E, Header as I, TypeIcon as C, TypeName as s, Question as A, AnswerButton as W } from "./styles.js";
6
- import { Tweet as x } from "./tweet/index.js";
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 z = ({
19
+ const G = ({
20
20
  close: n,
21
21
  action: i,
22
- data: { questionType: r, question: m, insight: l, tweet: e }
22
+ controlVideo: l,
23
+ data: { questionType: r, question: m, insight: e, tweet: c }
23
24
  }) => {
24
- const p = d[r];
25
- return p ? /* @__PURE__ */ a(f, { style: r === t.TWEET ? { paddingTop: "12px" } : {}, children: [
26
- /* @__PURE__ */ o(h, { onClick: n, children: /* @__PURE__ */ o(E, { name: "icon-cross" }) }),
27
- r !== t.TWEET && /* @__PURE__ */ a(I, { children: [
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
- C,
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(s, { children: p.label })
37
+ /* @__PURE__ */ o(A, { children: p.label })
37
38
  ] }),
38
- r === t.FACTOID && /* @__PURE__ */ o(T, { ...l, action: i }),
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(x, { ...e, action: i }),
43
- r !== t.FACTOID && r !== t.TWEET && /* @__PURE__ */ a(c, { children: [
44
- /* @__PURE__ */ o(A, { children: m == null ? void 0 : m.title }),
45
- /* @__PURE__ */ o(W, { onClick: i, children: "Answer" })
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
- z as Notification
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: InsightHistory['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 c } from "@streamlayer/sdk-web-types";
3
- import { VideoPlayer as p } from "../../../../video-player/index.js";
4
- import { InsightContainer as e, ImageContainer as h, Image as u, InsightContent as a, Title as I, Description as g, ActionBtn as f } from "./styles.js";
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 w = ({ video: r, image: n, imageMode: s, heading: i, body: o, action: l }) => /* @__PURE__ */ m(e, { children: [
10
- (r == null ? void 0 : r.url) && /* @__PURE__ */ t(p, { source: r.url, poster: r.thumbnailUrl }),
11
- n && !(r != null && r.url) && /* @__PURE__ */ t(h, { "data-rounded": s === c.ROUNDED, children: /* @__PURE__ */ t(u, { src: n, alt: i }) }),
12
- /* @__PURE__ */ m(a, { children: [
13
- /* @__PURE__ */ t(I, { children: i }),
14
- /* @__PURE__ */ t(g, { children: o }),
15
- l && /* @__PURE__ */ t(f, { onClick: l, children: "View Insight" })
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
- w as Insight
19
+ y as Insight
20
20
  };
@@ -1,5 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { type TwitterContentProps } from '../../../questions/twitter';
3
- export declare const Twitter: React.FC<TwitterContentProps & {
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,9 +1,14 @@
1
1
  /// <reference types="react" />
2
2
  type ModalProps = {
3
- Modal: React.ReactNode;
3
+ children: React.ReactNode;
4
4
  container: React.MutableRefObject<HTMLDivElement | null>;
5
5
  fixedView: boolean;
6
6
  useContainer: boolean;
7
7
  };
8
- export declare const createModal: ({ Modal, container, fixedView, useContainer }: ModalProps) => import("react").ReactPortal | null;
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 {};