@streamlayer/react-ui 1.11.0 → 1.11.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.
@@ -1,75 +1,75 @@
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 g, SDKScrollContainer as F } from "./styles.js";
5
- import { useSdkFeature as x } from "../useSdkFeature.js";
6
- import { useSdkResponsive as A } from "../useSdkResponsive.js";
7
- import { useSdkScroll as D } from "../useSdkScroll.js";
8
- import { useAnalyticsListener as m, newTabLinkListener as L, appScrollListener as b, appClickListener as C } from "../../hooks/analytics.js";
9
- import { useRef as d, useMemo as y, useEffect as K } from "react";
10
- import { resetCss as c } from "../../ui/theme/theme.js";
11
- import { ActiveFeature as j, StandaloneFeature as E } from "./Features/index.js";
12
- import { SDKNavigation as R, SDKHeader as k } from "./Navigation/index.js";
13
- import { SDKNotifications as w } from "./Notifications/index.js";
1
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
2
+ import { cx as N } from "@linaria/core";
3
+ import { useStore as v } from "@nanostores/react";
4
+ import { SDKContainer as x, SDKScrollContainer as A } from "./styles.js";
5
+ import { useSdkFeature as D } from "../useSdkFeature.js";
6
+ import { useSdkResponsive as F } from "../useSdkResponsive.js";
7
+ import { useSdkScroll as L } from "../useSdkScroll.js";
8
+ import { useAnalyticsListener as c, newTabLinkListener as g, appScrollListener as C, appClickListener as b } from "../../hooks/analytics.js";
9
+ import { useRef as f, useMemo as y, useEffect as K } from "react";
10
+ import { resetCss as m } from "../../ui/theme/theme.js";
11
+ import { ActiveFeature as j, StandaloneFeature as R } from "./Features/index.js";
12
+ import { SDKNavigation as w, SDKHeader as E } from "./Navigation/index.js";
13
+ import { SDKNotifications as k } from "./Notifications/index.js";
14
14
  import { useAppApp as H } from "./useApp.js";
15
15
  import { AppContext as I } from "./useAppContext.js";
16
16
  const M = ({
17
17
  sdk: e,
18
18
  className: n,
19
19
  scrollStore: r,
20
- appNode: a,
20
+ appNode: i,
21
21
  scrollNode: s,
22
- responsiveStore: o
22
+ responsiveStore: t
23
23
  }) => {
24
- const [, i] = x(e);
24
+ const [, a] = D(e);
25
25
  return /* @__PURE__ */ l(j, {
26
26
  className: n,
27
27
  scrollNode: s,
28
- appNode: a,
28
+ appNode: i,
29
29
  scrollStore: r,
30
- feature: i,
31
- responsiveStore: o,
30
+ feature: a,
31
+ responsiveStore: t,
32
32
  sdk: e
33
33
  });
34
34
  }, P = ({
35
35
  sdk: e,
36
36
  className: n,
37
37
  appNode: r,
38
- responsiveStore: a
38
+ responsiveStore: i
39
39
  }) => {
40
- const s = N(e.featuresList.getStore());
41
- return s ? Array.from(s, (o) => {
42
- const i = e.getFeature(o);
43
- return i ? /* @__PURE__ */ l(E, {
40
+ const s = v(e.featuresList.getStore());
41
+ return s ? Array.from(s, (t) => {
42
+ const a = e.getFeature(t);
43
+ return a ? /* @__PURE__ */ l(R, {
44
44
  className: n,
45
45
  appNode: r,
46
- feature: i,
47
- responsiveStore: a,
46
+ feature: a,
47
+ responsiveStore: i,
48
48
  sdk: e
49
- }, o) : null;
49
+ }, t) : null;
50
50
  }) : null;
51
51
  }, $ = ({
52
52
  sdk: e,
53
53
  topNavigation: n
54
54
  }) => {
55
- const r = d(null), a = d(null), [s] = A(r), [o, i] = D(r, s), {
55
+ const r = f(null), i = f(null), [s] = F(r), [t, a] = L(r, s), {
56
56
  sdkReady: p,
57
- activeFeature: u,
57
+ activeFeature: d,
58
58
  isLogged: S
59
- } = H(e), t = !!p;
60
- m(r, {
61
- enabled: t,
59
+ } = H(e), o = !!p;
60
+ c(r, {
61
+ enabled: o,
62
62
  event: "click",
63
- listener: L
64
- }), m(o, {
65
- enabled: t,
63
+ listener: g
64
+ }), c(t, {
65
+ enabled: o,
66
66
  event: "scrollend",
67
- listener: b,
67
+ listener: C,
68
68
  useDomNode: !0
69
- }), m(o, {
70
- enabled: t,
69
+ }), c(t, {
70
+ enabled: o,
71
71
  event: "click",
72
- listener: C,
72
+ listener: b,
73
73
  useDomNode: !0
74
74
  });
75
75
  const h = y(() => ({
@@ -78,44 +78,44 @@ const M = ({
78
78
  }), [e, n]);
79
79
  return K(() => {
80
80
  import("./Features/Gamification/gamification-feature.js");
81
- }, []), console.log("sdkEnabled", t), console.log("activeFeature", u), /* @__PURE__ */ l(I.Provider, {
81
+ }, []), /* @__PURE__ */ l(I.Provider, {
82
82
  value: h,
83
- children: /* @__PURE__ */ f(g, {
83
+ children: /* @__PURE__ */ u(x, {
84
84
  ref: r,
85
85
  className: n ? "" : "c10llmat",
86
- children: [t && n && /* @__PURE__ */ l(R, {
87
- className: c,
86
+ children: [o && n && /* @__PURE__ */ l(w, {
87
+ className: m,
88
88
  sdk: e,
89
- ref: a
90
- }), t && !n && !!u && /* @__PURE__ */ l(k, {
91
- className: v(c, "sl-hide-on-modal"),
89
+ ref: i
90
+ }), o && !n && !!d && /* @__PURE__ */ l(E, {
91
+ className: N(m, "sl-hide-on-modal"),
92
92
  sdk: e,
93
- ref: a
94
- }), /* @__PURE__ */ f(F, {
93
+ ref: i
94
+ }), /* @__PURE__ */ u(A, {
95
95
  className: "sl-hide-on-modal",
96
- ref: o,
97
- "data-nav": t.toString(),
98
- children: [t && /* @__PURE__ */ l(w, {
96
+ ref: t,
97
+ "data-nav": o.toString(),
98
+ children: [o && /* @__PURE__ */ l(k, {
99
99
  sdk: e,
100
- scrollNode: o,
101
- headerNode: a,
100
+ scrollNode: t,
101
+ headerNode: i,
102
102
  appNode: r,
103
- scrollStore: i,
103
+ scrollStore: a,
104
104
  responsiveStore: s
105
- }), t && /* @__PURE__ */ l(M, {
106
- scrollStore: i,
105
+ }), o && /* @__PURE__ */ l(M, {
106
+ scrollStore: a,
107
107
  responsiveStore: s,
108
- scrollNode: o,
108
+ scrollNode: t,
109
109
  appNode: r,
110
- className: c,
110
+ className: m,
111
111
  sdk: e
112
- }), t && /* @__PURE__ */ l(P, {
112
+ }), o && /* @__PURE__ */ l(P, {
113
113
  responsiveStore: s,
114
114
  appNode: r,
115
- className: c,
115
+ className: m,
116
116
  sdk: e
117
117
  })]
118
- }), t && !S && /* @__PURE__ */ l("div", {
118
+ }), o && !S && /* @__PURE__ */ l("div", {
119
119
  style: {
120
120
  display: "flex",
121
121
  alignItems: "center",
@@ -1,36 +1,36 @@
1
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
2
  import { useState as a } from "react";
3
3
  import w from "react-auth-code-input";
4
4
  import P, { isValidPhoneNumber as F, formatPhoneNumberIntl as v } from "react-phone-number-input";
5
5
  import { Timer as D } from "../../ui/timer/index.js";
6
- import { requestLoginCode as I, register as k, login as S } from "../../utils/login.js";
6
+ import { requestLoginCode as I, register as S, login as k } from "../../utils/login.js";
7
7
  import { Panel as q, Form as m, FormTitle as p, FormDescription as d, FormInputContainer as x, FormSubmit as s, Digits as E } from "./styles.js";
8
8
  const z = ({ login: h, anonymousLogin: u, host: c }) => {
9
9
  const [o, g] = a(""), [i, b] = a(""), [l, f] = a(""), y = async (t) => {
10
10
  t.preventDefault();
11
11
  try {
12
- const n = o.replaceAll("+", "");
12
+ const r = o.replaceAll("+", "");
13
13
  try {
14
- await I(c, n);
14
+ await I(c, r);
15
15
  } catch {
16
- await k(c, n);
16
+ await S(c, r);
17
17
  }
18
- b(n);
19
- } catch (n) {
20
- window.alert(n);
18
+ b(r);
19
+ } catch (r) {
20
+ window.alert(r);
21
21
  }
22
22
  }, C = async (t) => {
23
23
  if (t.preventDefault(), i && l)
24
24
  try {
25
- const n = await S(c, i, l);
26
- n && h ? await h(n) : console.log("token", n);
27
- } catch (n) {
28
- window.alert(n);
25
+ const r = await k(c, i, l);
26
+ r && h && await h(r);
27
+ } catch (r) {
28
+ window.alert(r);
29
29
  }
30
30
  };
31
- return /* @__PURE__ */ r(q, { children: [
32
- !i && /* @__PURE__ */ r("div", { children: [
33
- /* @__PURE__ */ r(m, { onSubmit: y, children: [
31
+ return /* @__PURE__ */ n(q, { children: [
32
+ !i && /* @__PURE__ */ n("div", { children: [
33
+ /* @__PURE__ */ n(m, { onSubmit: y, children: [
34
34
  /* @__PURE__ */ e(p, { children: "Enter your phone number" }),
35
35
  /* @__PURE__ */ e(d, { children: "Enter your phone up for number to log in or sign an account." }),
36
36
  /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(P, { value: o, onChange: (t) => g(`${t}`) }) }),
@@ -38,9 +38,9 @@ const z = ({ login: h, anonymousLogin: u, host: c }) => {
38
38
  ] }),
39
39
  u && /* @__PURE__ */ e(s, { style: { display: "block", margin: "auto" }, onClick: u, children: "anonymous login" })
40
40
  ] }),
41
- i && /* @__PURE__ */ r(m, { onSubmit: C, children: [
41
+ i && /* @__PURE__ */ n(m, { onSubmit: C, children: [
42
42
  /* @__PURE__ */ e(p, { children: "Enter Verification Code" }),
43
- /* @__PURE__ */ r(d, { children: [
43
+ /* @__PURE__ */ n(d, { children: [
44
44
  "Please enter the verification code ",
45
45
  /* @__PURE__ */ e("br", {}),
46
46
  "sent to ",
@@ -48,7 +48,7 @@ const z = ({ login: h, anonymousLogin: u, host: c }) => {
48
48
  ] }),
49
49
  /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(w, { autoFocus: !0, allowedCharacters: "numeric", length: 4, onChange: f }) }),
50
50
  /* @__PURE__ */ e(s, { disabled: l.length !== 4, type: "submit", children: "login" }),
51
- /* @__PURE__ */ r(d, { children: [
51
+ /* @__PURE__ */ n(d, { children: [
52
52
  "Didn't get 59 the code? ",
53
53
  /* @__PURE__ */ e("br", {}),
54
54
  "Resend Code in",
@@ -1,12 +1,12 @@
1
- import { jsxs as H, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as H, jsx as i } from "react/jsx-runtime";
2
2
  import { cx as L } from "@linaria/core";
3
3
  import { useRef as S, useState as d, useCallback as y, useEffect as P } from "react";
4
4
  import { eventBus as C } from "@streamlayer/sdk-web-interfaces";
5
5
  import { SvgIcon as h } from "../icons/index.js";
6
6
  import { Container as M, ToggleIconPause as j, HideControls as k, Player as A, Poster as B, Control as F } from "./styles.js";
7
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();
8
+ for (const r of s)
9
+ r.isIntersecting ? r.target instanceof HTMLVideoElement && r.target.autoplay && r.target.play() : r.target instanceof HTMLVideoElement && !r.target.paused && r.target.pause();
10
10
  }, E = new IntersectionObserver(N, { threshold: 0.5 }), m = /* @__PURE__ */ new Set(), q = (s) => {
11
11
  E.observe(s), m.add(s);
12
12
  }, z = (s) => {
@@ -16,18 +16,18 @@ const N = (s) => {
16
16
  s instanceof HTMLVideoElement && !s.paused && s.pause();
17
17
  }, X = ({
18
18
  poster: s,
19
- source: n,
19
+ source: r,
20
20
  aspectRatio: p,
21
- controlVideo: r,
22
- onPlay: i,
21
+ controlVideo: n,
22
+ onPlay: o,
23
23
  autoPlay: I,
24
24
  hideControls: u
25
25
  }) => {
26
26
  const e = S(null), [c, l] = d(!1), [g, f] = d(!0), O = y(() => {
27
- r == null || r({ muted: !0 });
28
- }, [r]), a = y(() => {
29
- r == null || r({ muted: !1 });
30
- }, [r]), T = (t) => {
27
+ n == null || n({ muted: !0 });
28
+ }, [n]), a = y(() => {
29
+ n == null || n({ muted: !1 });
30
+ }, [n]), T = (t) => {
31
31
  t.stopPropagation();
32
32
  const v = e == null ? void 0 : e.current;
33
33
  if (v) {
@@ -64,14 +64,14 @@ const N = (s) => {
64
64
  className: L(c && j, u && k),
65
65
  style: p ? { aspectRatio: p } : {},
66
66
  children: [
67
- /* @__PURE__ */ o(
67
+ /* @__PURE__ */ i(
68
68
  A,
69
69
  {
70
70
  ref: e,
71
- src: n,
71
+ src: r,
72
72
  autoPlay: I,
73
73
  onPlay: () => {
74
- console.log("play"), O(), l(!0), f(!1), i == null || i();
74
+ O(), l(!0), f(!1), o == null || o();
75
75
  },
76
76
  onPause: () => {
77
77
  a(), l(!1);
@@ -84,8 +84,8 @@ const N = (s) => {
84
84
  playsInline: !0
85
85
  }
86
86
  ),
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" }) })
87
+ /* @__PURE__ */ i(B, { src: s, style: { visibility: g ? "visible" : "hidden" } }),
88
+ !u && /* @__PURE__ */ i(F, { children: c ? /* @__PURE__ */ i(h, { name: "icon-pause" }) : /* @__PURE__ */ i(h, { name: "icon-play" }) })
89
89
  ]
90
90
  }
91
91
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react-ui",
3
- "version": "1.11.0",
3
+ "version": "1.11.1",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./lib/index.d.ts",
@@ -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.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"
62
+ "@streamlayer/feature-gamification": "^1.8.1",
63
+ "@streamlayer/sdk-web": "^1.5.1",
64
+ "@streamlayer/sdk-web-analytics": "^1.4.2",
65
+ "@streamlayer/sdk-web-anonymous-auth": "^1.1.2",
66
+ "@streamlayer/sdk-web-api": "^1.6.2",
67
+ "@streamlayer/sdk-web-core": "^1.6.1",
68
+ "@streamlayer/sdk-web-features": "^1.0.23",
69
+ "@streamlayer/sdk-web-interfaces": "^1.2.2",
70
+ "@streamlayer/sdk-web-logger": "^1.0.23",
71
+ "@streamlayer/sdk-web-notifications": "^1.2.2",
72
+ "@streamlayer/sdk-web-storage": "^1.0.23",
73
+ "@streamlayer/sdk-web-types": "^1.7.2"
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.8.0"
114
+ "@streamlayer/react": "^1.8.1"
115
115
  }
116
116
  }