@streamlayer/react-ui 0.96.1 → 0.96.3

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 (32) hide show
  1. package/lib/assets/style.css +1 -1
  2. package/lib/ui/app/Features/FeatureProvider.d.ts +1 -0
  3. package/lib/ui/app/Features/FeatureProvider.js +34 -6
  4. package/lib/ui/app/Features/Gamification/Friends.js +24 -21
  5. package/lib/ui/app/Features/Gamification/gamification-feature.js +1 -1
  6. package/lib/ui/app/Features/Gamification/index.d.ts +10 -0
  7. package/lib/ui/app/Features/Gamification/index.js +68 -67
  8. package/lib/ui/app/Features/index.d.ts +8 -0
  9. package/lib/ui/app/Features/index.js +112 -19
  10. package/lib/ui/app/Navigation/MastersNavigation/index.js +5 -4
  11. package/lib/ui/app/Navigation/index.js +7 -6
  12. package/lib/ui/app/masters.js +153 -83
  13. package/lib/ui/app/useMastersApp.js +3 -2
  14. package/lib/ui/gamification/question/list/index.js +45 -32
  15. package/lib/ui/gamification/question/notification/index.js +19 -22
  16. package/lib/ui/gamification/question/twitter/index.js +3 -3
  17. package/lib/ui/gamification/vote/feedback/index.js +29 -26
  18. package/lib/ui/gamification/vote/feedback/styles.d.ts +1 -0
  19. package/lib/ui/gamification/vote/feedback/styles.js +9 -4
  20. package/lib/ui/gamification/vote/index.js +52 -45
  21. package/lib/ui/icons/index.js +90 -25
  22. package/lib/ui/navigation/button/Channels.js +6 -5
  23. package/lib/ui/navigation/button/FeaturedGroups.js +4 -3
  24. package/lib/ui/navigation/button/LeaderBoard.js +6 -5
  25. package/lib/ui/navigation/button/index.js +20 -7
  26. package/lib/ui/navigation/button/styles.d.ts +3 -0
  27. package/lib/ui/navigation/button/styles.js +9 -6
  28. package/lib/ui/questions/insight/index.js +15 -16
  29. package/lib/ui/video-player/index.d.ts +1 -0
  30. package/lib/ui/video-player/index.js +44 -37
  31. package/lib/utils/createDemo.js +6 -1
  32. package/package.json +14 -14
@@ -3,24 +3,25 @@ import { styled as e } from "@linaria/react";
3
3
  import { SvgIcon as a } from "../../icons/index.js";
4
4
  import { Button as d } from "./index.js";
5
5
  import "react";
6
+ import "@linaria/core";
6
7
  import "./styles.js";
7
- const n = () => a, c = /* @__PURE__ */ e(n())({
8
+ const n = () => a, m = /* @__PURE__ */ e(n())({
8
9
  name: "ButtonIcon",
9
10
  class: "b180jd7l",
10
11
  propsAsIs: !0
11
- }), b = "leaderboard", u = (o) => {
12
+ }), u = "leaderboard", I = (o) => {
12
13
  var t;
13
14
  return /* @__PURE__ */ r(d, {
14
15
  ...o,
15
16
  label: "Leader Board",
16
17
  id: "leaderboard",
17
- icon: /* @__PURE__ */ r(c, {
18
+ icon: /* @__PURE__ */ r(m, {
18
19
  name: "icon-btn-leaderboard",
19
20
  "data-selected": (t = o.active) == null ? void 0 : t.toString()
20
21
  })
21
22
  });
22
23
  };
23
24
  export {
24
- u as LeaderBoardButton,
25
- b as LeaderBoardButtonId
25
+ I as LeaderBoardButton,
26
+ u as LeaderBoardButtonId
26
27
  };
@@ -1,10 +1,23 @@
1
- import { jsx as t, jsxs as d, Fragment as i } from "react/jsx-runtime";
2
- import { SButton as l, ButtonIcon as m, ButtonLabel as s } from "./styles.js";
1
+ import { jsx as e, jsxs as l, Fragment as m } from "react/jsx-runtime";
2
+ import { cx as d } from "@linaria/core";
3
+ import { SButton as s, SelectedButton as u, HoverIconState as p, HoverIconLeaderboardState as h, ButtonIcon as B, ButtonLabel as f } from "./styles.js";
3
4
  import "@linaria/react";
4
- const p = ({ disabled: e, active: n, onClick: o, label: c, icon: r }) => /* @__PURE__ */ t(l, { onClick: o, disabled: e, "data-selected": n, children: /* @__PURE__ */ d(i, { children: [
5
- r && /* @__PURE__ */ t(m, { children: r }),
6
- /* @__PURE__ */ t(s, { children: c })
7
- ] }) });
5
+ const I = ({ disabled: n, active: r, onClick: a, label: c, icon: o, id: t }) => /* @__PURE__ */ e(
6
+ s,
7
+ {
8
+ onClick: a,
9
+ disabled: n,
10
+ className: d(
11
+ r && u,
12
+ !r && (t === "channels" || t === "featuredGroups") && p,
13
+ !r && t === "leaderboard" && h
14
+ ),
15
+ children: /* @__PURE__ */ l(m, { children: [
16
+ o && /* @__PURE__ */ e(B, { children: o }),
17
+ /* @__PURE__ */ e(f, { children: c })
18
+ ] })
19
+ }
20
+ );
8
21
  export {
9
- p as Button
22
+ I as Button
10
23
  };
@@ -2,3 +2,6 @@
2
2
  export declare const SButton: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
3
3
  export declare const ButtonIcon: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
4
4
  export declare const ButtonLabel: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
5
+ export declare const SelectedButton: import("@linaria/core").LinariaClassName;
6
+ export declare const HoverIconState: import("@linaria/core").LinariaClassName;
7
+ export declare const HoverIconLeaderboardState: import("@linaria/core").LinariaClassName;
@@ -1,19 +1,22 @@
1
- import { styled as s } from "@linaria/react";
2
- const o = /* @__PURE__ */ s("button")({
1
+ import { styled as t } from "@linaria/react";
2
+ const o = /* @__PURE__ */ t("button")({
3
3
  name: "SButton",
4
4
  class: "sxxa0c",
5
5
  propsAsIs: !1
6
- }), n = /* @__PURE__ */ s("span")({
6
+ }), n = /* @__PURE__ */ t("span")({
7
7
  name: "ButtonIcon",
8
8
  class: "b193dcyu",
9
9
  propsAsIs: !1
10
- }), a = /* @__PURE__ */ s("span")({
10
+ }), a = /* @__PURE__ */ t("span")({
11
11
  name: "ButtonLabel",
12
12
  class: "b40tuix",
13
13
  propsAsIs: !1
14
- });
14
+ }), e = "s14xk0af", c = "ha3mg7c", r = "h103yr45";
15
15
  export {
16
16
  n as ButtonIcon,
17
17
  a as ButtonLabel,
18
- o as SButton
18
+ r as HoverIconLeaderboardState,
19
+ c as HoverIconState,
20
+ o as SButton,
21
+ e as SelectedButton
19
22
  };
@@ -1,35 +1,34 @@
1
- import { jsxs as c, jsx as d } from "react/jsx-runtime";
2
- import { QuestionImages as v } from "@streamlayer/sdk-web-types";
3
- import { VideoPlayer as C } from "../../video-player/index.js";
4
- import { Container as b, ImageContainer as e, Image as x, Content as D, Title as T, Description as j } from "./styles.js";
1
+ import { jsxs as g, jsx as d } from "react/jsx-runtime";
2
+ import { QuestionImages as I } from "@streamlayer/sdk-web-types";
3
+ import { VideoPlayer as e } from "../../video-player/index.js";
4
+ import { Container as v, ImageContainer as C, Image as b, Content as x, Title as D, Description as T } 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 k = ({
10
- imageMode: g,
9
+ const Q = ({
11
10
  instantView: r,
12
11
  isDetail: m,
13
12
  notification: o,
14
- controlVideo: u
13
+ controlVideo: c
15
14
  }) => {
16
- const l = r == null ? void 0 : r.heading, p = r == null ? void 0 : r.body, h = l || p, y = o == null ? void 0 : o.title, I = o == null ? void 0 : o.body;
17
- return /* @__PURE__ */ c(b, { children: [
15
+ const l = r == null ? void 0 : r.heading, p = r == null ? void 0 : r.body, h = l || p, u = o == null ? void 0 : o.title, y = o == null ? void 0 : o.body;
16
+ return /* @__PURE__ */ g(v, { children: [
18
17
  (r == null ? void 0 : r.video) && /* @__PURE__ */ d(
19
- C,
18
+ e,
20
19
  {
21
20
  source: r.video.url,
22
21
  poster: r.video.thumbnailUrl,
23
- controlVideo: u
22
+ controlVideo: c
24
23
  }
25
24
  ),
26
- (r == null ? void 0 : r.image) && !(r != null && r.video) && /* @__PURE__ */ d(e, { "data-rounded": g === v.ROUNDED, children: /* @__PURE__ */ d(x, { src: r == null ? void 0 : r.image }) }),
27
- /* @__PURE__ */ c(D, { children: [
28
- /* @__PURE__ */ d(T, { children: m && h ? l : y }),
29
- /* @__PURE__ */ d(j, { children: m && h ? p : I })
25
+ (r == null ? void 0 : r.image) && !(r != null && r.video) && /* @__PURE__ */ d(C, { "data-rounded": r.imageMode === I.ROUNDED, children: /* @__PURE__ */ d(b, { src: r == null ? void 0 : r.image }) }),
26
+ /* @__PURE__ */ g(x, { children: [
27
+ /* @__PURE__ */ d(D, { children: m && h ? l : u }),
28
+ /* @__PURE__ */ d(T, { children: m && h ? p : y })
30
29
  ] })
31
30
  ] });
32
31
  };
33
32
  export {
34
- k as InsightContent
33
+ Q as InsightContent
35
34
  };
@@ -7,6 +7,7 @@ export type VideoPlayerProps = {
7
7
  source?: string;
8
8
  controlVideo?: (props: ControlVideoProps) => void;
9
9
  };
10
+ export declare const pauseAllVideos: () => void;
10
11
  /**
11
12
  * VideoPlayer component for playing videos with a poster image.
12
13
  *
@@ -1,62 +1,69 @@
1
- import { jsxs as h, jsx as o } from "react/jsx-runtime";
2
- import { useRef as O, useState as d, useEffect as w } from "react";
1
+ import { jsxs as w, jsx as i } from "react/jsx-runtime";
2
+ import { useRef as C, useState as v, useCallback as p, useEffect as d } from "react";
3
3
  import { SvgIcon as E } from "../icons/index.js";
4
- import { Container as I, Player as S, Poster as x, Control as C } from "./styles.js";
4
+ import { Container as I, Player as S, Poster as x, Control as L } from "./styles.js";
5
5
  import "@linaria/react";
6
- const L = (t, c) => {
7
- for (const s of t)
8
- s.isIntersecting || s.target instanceof HTMLVideoElement && !s.target.paused && (c.unobserve(s.target), s.target.pause());
9
- }, g = new IntersectionObserver(L, { threshold: 0.5 }), f = /* @__PURE__ */ new Set(), T = (t) => {
10
- g.observe(t), f.add(t);
11
- }, u = (t) => {
12
- g.unobserve(t), f.delete(t);
13
- }, q = ({ poster: t, source: c, controlVideo: s }) => {
14
- const e = O(null), [l, a] = d(!1), [b, m] = d(!0), p = () => {
15
- s == null || s({ muted: !0 });
16
- }, v = () => {
17
- s == null || s({ muted: !1 });
18
- }, y = () => {
19
- const n = e == null ? void 0 : e.current;
20
- if (n)
6
+ const T = (s, c) => {
7
+ for (const t of s)
8
+ t.isIntersecting || t.target instanceof HTMLVideoElement && !t.target.paused && (c.unobserve(t.target), t.target.pause());
9
+ }, g = new IntersectionObserver(T, { threshold: 0.5 }), f = /* @__PURE__ */ new Set(), j = (s) => {
10
+ g.observe(s), f.add(s);
11
+ }, n = (s) => {
12
+ g.unobserve(s), f.delete(s);
13
+ }, k = () => {
14
+ for (const s of f)
15
+ s instanceof HTMLVideoElement && !s.paused && (s.pause(), n(s));
16
+ }, z = ({ poster: s, source: c, controlVideo: t }) => {
17
+ const e = C(null), [l, o] = v(!1), [b, m] = v(!0), y = p(() => {
18
+ t == null || t({ muted: !0 });
19
+ }, [t]), u = p(() => {
20
+ t == null || t({ muted: !1 });
21
+ }, [t]), P = () => {
22
+ const r = e == null ? void 0 : e.current;
23
+ if (r)
21
24
  if (l)
22
- n.pause(), e.current && u(e.current);
25
+ r.pause(), e.current && n(e.current);
23
26
  else {
24
- const i = e == null ? void 0 : e.current;
25
- if (!i)
27
+ const a = e == null ? void 0 : e.current;
28
+ if (!a)
26
29
  return;
27
- for (const r of f)
28
- r !== i && r instanceof HTMLVideoElement && !r.paused && (r.pause(), u(r));
29
- T(i), i.play().catch((r) => console.log(r)), m(!1);
30
+ k(), j(a), a.play().catch((O) => console.log(O)), m(!1);
30
31
  }
31
- }, P = () => {
32
- var n;
33
- e.current && u(e.current), (n = e == null ? void 0 : e.current) == null || n.load(), m(!0);
32
+ }, h = () => {
33
+ var r;
34
+ e.current && n(e.current), (r = e == null ? void 0 : e.current) == null || r.load(), m(!0);
34
35
  };
35
- return w(() => {
36
- e.current && u(e.current);
37
- }, []), /* @__PURE__ */ h(I, { onClick: y, children: [
38
- /* @__PURE__ */ o(
36
+ return d(() => {
37
+ e.current && n(e.current);
38
+ }, []), d(() => {
39
+ const r = e == null ? void 0 : e.current;
40
+ return () => {
41
+ r && (r.paused || u(), n(r));
42
+ };
43
+ }, [u]), /* @__PURE__ */ w(I, { onClick: P, children: [
44
+ /* @__PURE__ */ i(
39
45
  S,
40
46
  {
41
47
  ref: e,
42
48
  src: c,
43
49
  onPlay: () => {
44
- p(), a(!0);
50
+ y(), o(!0);
45
51
  },
46
52
  onPause: () => {
47
- v(), a(!1);
53
+ u(), o(!1);
48
54
  },
49
55
  onEnded: () => {
50
- v(), a(!1), P();
56
+ u(), o(!1), h();
51
57
  },
52
58
  style: { visibility: b ? "hidden" : "visible" },
53
59
  playsInline: !0
54
60
  }
55
61
  ),
56
- /* @__PURE__ */ o(x, { src: t, style: { visibility: b ? "visible" : "hidden" } }),
57
- /* @__PURE__ */ o(C, { children: !l && /* @__PURE__ */ o(E, { name: "icon-play" }) })
62
+ /* @__PURE__ */ i(x, { src: s, style: { visibility: b ? "visible" : "hidden" } }),
63
+ /* @__PURE__ */ i(L, { children: !l && /* @__PURE__ */ i(E, { name: "icon-play" }) })
58
64
  ] });
59
65
  };
60
66
  export {
61
- q as VideoPlayer
67
+ z as VideoPlayer,
68
+ k as pauseAllVideos
62
69
  };
@@ -23,7 +23,12 @@ function K({
23
23
  const s = u(() => new x(), []), [p, f] = i(s.getEnv()), [c, v] = i(s.getSdkKey() || "set-sdk-key"), [m, k] = i(s.getEvent() || ""), S = u(() => {
24
24
  const d = /* @__PURE__ */ new Set();
25
25
  return d.add(D), d;
26
- }, []), t = l(c, S, p === "production", a);
26
+ }, []), t = l({
27
+ sdkKey: c,
28
+ plugins: S,
29
+ production: p === "production",
30
+ autoEnable: a
31
+ });
27
32
  return E(() => {
28
33
  m && t && t.createEventSession(m);
29
34
  }, [t]), /* @__PURE__ */ g(y, { children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react-ui",
3
- "version": "0.96.1",
3
+ "version": "0.96.3",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./lib/index.d.ts",
@@ -36,7 +36,7 @@
36
36
  ],
37
37
  "peerDependencies": {
38
38
  "@lottiefiles/react-lottie-player": "*",
39
- "@streamlayer/sl-eslib": "^5.67.0",
39
+ "@streamlayer/sl-eslib": "^5.79.3",
40
40
  "nanoid": "3.3.7",
41
41
  "@types/lodash.throttle": "^4.1.9",
42
42
  "lodash.throttle": "^4.1.1",
@@ -44,17 +44,17 @@
44
44
  "react-virtualized-auto-sizer": "^1.0.21",
45
45
  "react-window": "^1.8.10",
46
46
  "react-window-infinite-loader": "^1.0.9",
47
- "@streamlayer/feature-gamification": "^0.37.3",
48
- "@streamlayer/sdk-web-anonymous-auth": "^0.11.39",
49
- "@streamlayer/sdk-web-api": "^0.22.0",
50
- "@streamlayer/sdk-web": "^0.32.1",
51
- "@streamlayer/sdk-web-core": "^0.21.1",
52
- "@streamlayer/sdk-web-features": "^0.11.21",
53
- "@streamlayer/sdk-web-notifications": "^0.14.1",
54
- "@streamlayer/sdk-web-interfaces": "^0.20.5",
55
- "@streamlayer/sdk-web-storage": "^0.4.3",
56
- "@streamlayer/sdk-web-logger": "^0.5.16",
57
- "@streamlayer/sdk-web-types": "^0.22.3"
47
+ "@streamlayer/feature-gamification": "^0.38.0",
48
+ "@streamlayer/sdk-web": "^0.32.3",
49
+ "@streamlayer/sdk-web-anonymous-auth": "^0.11.41",
50
+ "@streamlayer/sdk-web-api": "^0.23.0",
51
+ "@streamlayer/sdk-web-core": "^0.21.3",
52
+ "@streamlayer/sdk-web-features": "^0.11.23",
53
+ "@streamlayer/sdk-web-interfaces": "^0.20.6",
54
+ "@streamlayer/sdk-web-notifications": "^0.14.2",
55
+ "@streamlayer/sdk-web-logger": "^0.5.17",
56
+ "@streamlayer/sdk-web-storage": "^0.4.4",
57
+ "@streamlayer/sdk-web-types": "^0.22.4"
58
58
  },
59
59
  "nx": {
60
60
  "implicitDependencies": [
@@ -95,6 +95,6 @@
95
95
  "vite-plugin-svgr": "^4.2.0",
96
96
  "vite-svg-loader": "^5.1.0",
97
97
  "vite-tsconfig-paths": "^4.3.1",
98
- "@streamlayer/react": "^0.40.1"
98
+ "@streamlayer/react": "^0.40.3"
99
99
  }
100
100
  }