@streamlayer/react-ui 1.9.0 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/lib/app/app/Advertisement/index.d.ts +1 -0
  2. package/lib/app/app/Advertisement/index.js +78 -67
  3. package/lib/app/app/Features/Gamification/Question.d.ts +1 -0
  4. package/lib/app/app/Features/Gamification/Question.js +43 -41
  5. package/lib/app/app/Features/Gamification/Tabs.js +22 -21
  6. package/lib/app/app/Features/Gamification/index.js +66 -62
  7. package/lib/app/app/Insight/index.d.ts +2 -0
  8. package/lib/app/app/Insight/index.js +28 -24
  9. package/lib/app/app/Navigation/index.d.ts +4 -0
  10. package/lib/app/app/Navigation/index.js +88 -48
  11. package/lib/app/app/Notifications/index.js +125 -113
  12. package/lib/app/app/Points/index.js +16 -16
  13. package/lib/app/app/index.d.ts +1 -0
  14. package/lib/app/app/index.js +84 -83
  15. package/lib/app/app/story/index.js +27 -24
  16. package/lib/app/app/story/insight/index.d.ts +1 -0
  17. package/lib/app/app/story/insight/index.js +29 -26
  18. package/lib/app/app/story/insight/video.d.ts +1 -0
  19. package/lib/app/app/story/insight/video.js +13 -13
  20. package/lib/app/app/story/promotion/content.d.ts +3 -1
  21. package/lib/app/app/story/promotion/content.js +13 -10
  22. package/lib/app/app/story/promotion/index.d.ts +1 -0
  23. package/lib/app/app/story/promotion/index.js +34 -30
  24. package/lib/app/app/story/promotion/video.d.ts +1 -0
  25. package/lib/app/app/story/promotion/video.js +34 -31
  26. package/lib/app/app/styles.js +44 -0
  27. package/lib/app/app/useApp.d.ts +2 -14
  28. package/lib/app/app/useApp.js +14 -43
  29. package/lib/app/app/useAppContext.d.ts +2 -0
  30. package/lib/app/app/useAppContext.js +6 -5
  31. package/lib/app/masters/Features/Gamification/Leaderboard.d.ts +1 -1
  32. package/lib/app/masters/Features/Gamification/Tabs.d.ts +2 -2
  33. package/lib/app/masters/Features/Gamification/Tabs.js +2 -2
  34. package/lib/app/masters/Features/Gamification/index.d.ts +2 -2
  35. package/lib/app/masters/Features/Gamification/index.js +1 -1
  36. package/lib/app/masters/Features/index.d.ts +2 -2
  37. package/lib/app/masters/Navigation/MastersNavigation/index.d.ts +1 -1
  38. package/lib/app/masters/Notifications/Onboarding/index.d.ts +1 -1
  39. package/lib/app/masters/Notifications/Onboarding/index.js +4 -4
  40. package/lib/app/masters/Notifications/index.d.ts +2 -2
  41. package/lib/app/masters/Notifications/index.js +1 -1
  42. package/lib/app/masters/masters.js +23 -23
  43. package/lib/app/masters/styles.d.ts +20 -0
  44. package/lib/app/{styles.js → masters/styles.js} +15 -15
  45. package/lib/app/masters/useSdkResponsive.d.ts +15 -0
  46. package/lib/app/masters/useSdkResponsive.js +45 -0
  47. package/lib/app/masters/useSdkScroll.d.ts +12 -0
  48. package/lib/app/masters/useSdkScroll.js +50 -0
  49. package/lib/app/useSdkResponsive.d.ts +1 -0
  50. package/lib/app/useSdkResponsive.js +27 -29
  51. package/lib/app/useSdkScroll.js +25 -24
  52. package/lib/assets/style.css +1 -1
  53. package/lib/ui/advertisement/banner/index.js +14 -11
  54. package/lib/ui/advertisement/index.d.ts +3 -0
  55. package/lib/ui/advertisement/index.js +31 -10
  56. package/lib/ui/advertisement/notification/index.d.ts +1 -0
  57. package/lib/ui/advertisement/notification/index.js +30 -27
  58. package/lib/ui/advertisement/notification/lower-third/index.d.ts +9 -0
  59. package/lib/ui/advertisement/notification/lower-third/index.js +37 -0
  60. package/lib/ui/advertisement/notification/lower-third/styles.d.ts +16 -0
  61. package/lib/ui/advertisement/notification/lower-third/styles.js +64 -0
  62. package/lib/ui/advertisement/overlay/index.d.ts +2 -0
  63. package/lib/ui/advertisement/overlay/index.js +58 -43
  64. package/lib/ui/advertisement/overlay/styles.d.ts +0 -2
  65. package/lib/ui/advertisement/overlay/styles.js +41 -52
  66. package/lib/ui/close-btn/index.d.ts +7 -0
  67. package/lib/ui/close-btn/index.js +47 -0
  68. package/lib/ui/gamification/detail/header/index.d.ts +2 -1
  69. package/lib/ui/gamification/detail/header/index.js +16 -15
  70. package/lib/ui/gamification/vote/styles.js +1 -1
  71. package/lib/ui/navigation/button/FeaturedGroups.d.ts +1 -1
  72. package/lib/ui/navigation/index.d.ts +5 -3
  73. package/lib/ui/navigation/index.js +11 -12
  74. package/lib/ui/navigation/masters.js +1 -1
  75. package/lib/ui/navigation/styles.d.ts +5 -0
  76. package/lib/ui/navigation/styles.js +16 -0
  77. package/lib/ui/questions/insight/index.js +21 -20
  78. package/lib/ui/theme/masters-theme.js +36 -13
  79. package/lib/ui/theme/theme.js +25 -26
  80. package/lib/ui/timer/index.d.ts +3 -1
  81. package/lib/ui/timer/index.js +54 -32
  82. package/lib/ui/video-player/index.d.ts +2 -0
  83. package/lib/ui/video-player/index.js +62 -51
  84. package/lib/ui/video-player/styles.d.ts +1 -0
  85. package/lib/ui/video-player/styles.js +7 -6
  86. package/package.json +15 -15
  87. /package/lib/app/{styles.d.ts → app/styles.d.ts} +0 -0
@@ -1,85 +1,96 @@
1
- import { jsxs as E, jsx as i } from "react/jsx-runtime";
2
- import { cx as S } from "@linaria/core";
3
- import { useRef as T, useState as d, useCallback as h, useEffect as y } from "react";
4
- import { eventBus as L } from "@streamlayer/sdk-web-interfaces";
5
- import { SvgIcon as P } from "../icons/index.js";
6
- import { Container as j, ToggleIconPause as k, Player as H, Poster as M, Control as A } from "./styles.js";
7
- const B = (s, a) => {
8
- for (const t of s)
9
- t.isIntersecting || t.target instanceof HTMLVideoElement && !t.target.paused && (a.unobserve(t.target), t.target.pause());
10
- }, I = new IntersectionObserver(B, { threshold: 0.5 }), p = /* @__PURE__ */ new Set(), F = (s) => {
11
- I.observe(s), p.add(s);
12
- }, u = (s) => {
13
- I.unobserve(s), p.delete(s);
14
- }, N = () => {
15
- for (const s of p)
16
- s instanceof HTMLVideoElement && !s.paused && (s.pause(), u(s));
17
- }, Q = ({ poster: s, source: a, aspectRatio: t, controlVideo: r, onPlay: c }) => {
18
- const e = T(null), [f, l] = d(!1), [b, g] = d(!0), O = h(() => {
1
+ import { jsxs as H, jsx as o } from "react/jsx-runtime";
2
+ import { cx as L } from "@linaria/core";
3
+ import { useRef as S, useState as d, useCallback as y, useEffect as P } from "react";
4
+ import { eventBus as C } from "@streamlayer/sdk-web-interfaces";
5
+ import { SvgIcon as h } from "../icons/index.js";
6
+ import { Container as M, ToggleIconPause as j, HideControls as k, Player as A, Poster as B, Control as F } from "./styles.js";
7
+ const N = (s) => {
8
+ for (const n of s)
9
+ n.isIntersecting ? n.target instanceof HTMLVideoElement && n.target.autoplay && n.target.play() : n.target instanceof HTMLVideoElement && !n.target.paused && n.target.pause();
10
+ }, E = new IntersectionObserver(N, { threshold: 0.5 }), m = /* @__PURE__ */ new Set(), q = (s) => {
11
+ E.observe(s), m.add(s);
12
+ }, z = (s) => {
13
+ E.unobserve(s), m.delete(s);
14
+ }, D = () => {
15
+ for (const s of m)
16
+ s instanceof HTMLVideoElement && !s.paused && s.pause();
17
+ }, X = ({
18
+ poster: s,
19
+ source: n,
20
+ aspectRatio: p,
21
+ controlVideo: r,
22
+ onPlay: i,
23
+ autoPlay: I,
24
+ hideControls: u
25
+ }) => {
26
+ const e = S(null), [c, l] = d(!1), [g, f] = d(!0), O = y(() => {
19
27
  r == null || r({ muted: !0 });
20
- }, [r]), o = h(() => {
28
+ }, [r]), a = y(() => {
21
29
  r == null || r({ muted: !1 });
22
- }, [r]), w = (n) => {
23
- n.stopPropagation();
30
+ }, [r]), T = (t) => {
31
+ t.stopPropagation();
24
32
  const v = e == null ? void 0 : e.current;
25
33
  if (v) {
26
- if (f)
27
- v.pause(), e.current && u(e.current);
34
+ if (c)
35
+ v.pause();
28
36
  else {
29
- const m = e == null ? void 0 : e.current;
30
- if (!m)
37
+ const b = e == null ? void 0 : e.current;
38
+ if (!b)
31
39
  return;
32
- N(), F(m), m.play().catch((C) => console.log(C)), g(!1);
40
+ D(), b.play().catch((x) => console.log(x)), f(!1);
33
41
  }
34
- L.emit("interactions", {
42
+ C.emit("interactions", {
35
43
  action: "tap",
36
44
  payload: {}
37
45
  });
38
46
  }
39
- }, x = () => {
40
- var n;
41
- e.current && u(e.current), (n = e == null ? void 0 : e.current) == null || n.load(), g(!0);
47
+ }, w = () => {
48
+ var t;
49
+ (t = e == null ? void 0 : e.current) == null || t.load(), f(!0);
42
50
  };
43
- return y(() => {
44
- e.current && u(e.current);
45
- }, []), y(() => {
46
- const n = e == null ? void 0 : e.current;
51
+ return P(() => {
52
+ const t = e == null ? void 0 : e.current;
47
53
  return () => {
48
- n && (n.paused || o(), u(n));
54
+ t && (t.paused || a());
49
55
  };
50
- }, [o]), /* @__PURE__ */ E(
51
- j,
56
+ }, [a]), P(() => {
57
+ const t = e.current;
58
+ return t ? (q(t), () => z(t)) : () => {
59
+ };
60
+ }, []), /* @__PURE__ */ H(
61
+ M,
52
62
  {
53
- onClick: w,
54
- className: S(f && k),
55
- style: t ? { aspectRatio: t } : {},
63
+ onClick: u ? void 0 : T,
64
+ className: L(c && j, u && k),
65
+ style: p ? { aspectRatio: p } : {},
56
66
  children: [
57
- /* @__PURE__ */ i(
58
- H,
67
+ /* @__PURE__ */ o(
68
+ A,
59
69
  {
60
70
  ref: e,
61
- src: a,
71
+ src: n,
72
+ autoPlay: I,
62
73
  onPlay: () => {
63
- O(), l(!0), c == null || c();
74
+ console.log("play"), O(), l(!0), f(!1), i == null || i();
64
75
  },
65
76
  onPause: () => {
66
- o(), l(!1);
77
+ a(), l(!1);
67
78
  },
68
79
  onEnded: () => {
69
- o(), l(!1), x();
80
+ a(), l(!1), w();
70
81
  },
71
- style: { visibility: b ? "hidden" : "visible" },
82
+ style: { visibility: g ? "hidden" : "visible" },
72
83
  controls: !1,
73
84
  playsInline: !0
74
85
  }
75
86
  ),
76
- /* @__PURE__ */ i(M, { src: s, style: { visibility: b ? "visible" : "hidden" } }),
77
- /* @__PURE__ */ i(A, { children: f ? /* @__PURE__ */ i(P, { name: "icon-pause" }) : /* @__PURE__ */ i(P, { name: "icon-play" }) })
87
+ /* @__PURE__ */ o(B, { src: s, style: { visibility: g ? "visible" : "hidden" } }),
88
+ !u && /* @__PURE__ */ o(F, { children: c ? /* @__PURE__ */ o(h, { name: "icon-pause" }) : /* @__PURE__ */ o(h, { name: "icon-play" }) })
78
89
  ]
79
90
  }
80
91
  );
81
92
  };
82
93
  export {
83
- Q as VideoPlayer,
84
- N as pauseAllVideos
94
+ X as VideoPlayer,
95
+ D as pauseAllVideos
85
96
  };
@@ -3,3 +3,4 @@ export declare const Player: import('@linaria/react').StyledComponent<import('re
3
3
  export declare const Poster: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLImageElement> & import('react').ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown>>;
4
4
  export declare const Control: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
5
5
  export declare const ToggleIconPause: import('@linaria/core').LinariaClassName;
6
+ export declare const HideControls: import('@linaria/core').LinariaClassName;
@@ -7,19 +7,20 @@ const e = /* @__PURE__ */ s("div")({
7
7
  name: "Player",
8
8
  class: "p6703cq",
9
9
  propsAsIs: !1
10
- }), l = /* @__PURE__ */ s("img")({
10
+ }), n = /* @__PURE__ */ s("img")({
11
11
  name: "Poster",
12
12
  class: "p12ow7zo",
13
13
  propsAsIs: !1
14
- }), n = /* @__PURE__ */ s("div")({
14
+ }), l = /* @__PURE__ */ s("div")({
15
15
  name: "Control",
16
16
  class: "cdpal9o",
17
17
  propsAsIs: !1
18
- }), r = "t1xke4ml";
18
+ }), t = "t1xke4ml", r = "h1yzxv57";
19
19
  export {
20
20
  e as Container,
21
- n as Control,
21
+ l as Control,
22
+ r as HideControls,
22
23
  a as Player,
23
- l as Poster,
24
- r as ToggleIconPause
24
+ n as Poster,
25
+ t as ToggleIconPause
25
26
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react-ui",
3
- "version": "1.9.0",
3
+ "version": "1.11.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./lib/index.d.ts",
@@ -51,7 +51,7 @@
51
51
  ],
52
52
  "peerDependencies": {
53
53
  "@lottiefiles/react-lottie-player": "^3.5.4",
54
- "@streamlayer/sl-eslib": "^5.123.1",
54
+ "@streamlayer/sl-eslib": "^5.130.0",
55
55
  "@types/lodash.throttle": "^4.1.9",
56
56
  "lodash.throttle": "^4.1.1",
57
57
  "nanoid": "3.3.7",
@@ -59,18 +59,18 @@
59
59
  "react-virtualized-auto-sizer": "^1.0.24",
60
60
  "react-window": "^1.8.10",
61
61
  "react-window-infinite-loader": "^1.0.9",
62
- "@streamlayer/feature-gamification": "^1.6.3",
63
- "@streamlayer/sdk-web": "^1.3.3",
64
- "@streamlayer/sdk-web-analytics": "^1.3.3",
65
- "@streamlayer/sdk-web-anonymous-auth": "^1.0.20",
66
- "@streamlayer/sdk-web-api": "^1.5.3",
67
- "@streamlayer/sdk-web-core": "^1.4.3",
68
- "@streamlayer/sdk-web-features": "^1.0.20",
69
- "@streamlayer/sdk-web-interfaces": "^1.1.15",
70
- "@streamlayer/sdk-web-logger": "^1.0.20",
71
- "@streamlayer/sdk-web-notifications": "^1.1.15",
72
- "@streamlayer/sdk-web-storage": "^1.0.20",
73
- "@streamlayer/sdk-web-types": "^1.6.3"
62
+ "@streamlayer/feature-gamification": "^1.8.0",
63
+ "@streamlayer/sdk-web": "^1.5.0",
64
+ "@streamlayer/sdk-web-analytics": "^1.4.1",
65
+ "@streamlayer/sdk-web-anonymous-auth": "^1.1.1",
66
+ "@streamlayer/sdk-web-api": "^1.6.1",
67
+ "@streamlayer/sdk-web-core": "^1.6.0",
68
+ "@streamlayer/sdk-web-features": "^1.0.22",
69
+ "@streamlayer/sdk-web-interfaces": "^1.2.1",
70
+ "@streamlayer/sdk-web-logger": "^1.0.22",
71
+ "@streamlayer/sdk-web-notifications": "^1.2.1",
72
+ "@streamlayer/sdk-web-storage": "^1.0.22",
73
+ "@streamlayer/sdk-web-types": "^1.7.1"
74
74
  },
75
75
  "nx": {
76
76
  "implicitDependencies": [
@@ -111,6 +111,6 @@
111
111
  "vite-plugin-svgr": "^4.2.0",
112
112
  "vite-svg-loader": "^5.1.0",
113
113
  "vite-tsconfig-paths": "^5.0.1",
114
- "@streamlayer/react": "^1.6.0"
114
+ "@streamlayer/react": "^1.8.0"
115
115
  }
116
116
  }
File without changes