@streamlayer/react-ui 1.23.2 → 1.23.4

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,9 +1,10 @@
1
1
  import "react/jsx-runtime";
2
2
  import "@linaria/core";
3
3
  import "react";
4
- import { BetPackOverlay as a } from "../index.js";
4
+ import "@streamlayer/sdk-web-types";
5
+ import { BetPackOverlay as c } from "../index.js";
5
6
  import "../../../../ui/icons/index.js";
6
7
  import "./styles.js";
7
8
  export {
8
- a as BetPackOverlay
9
+ c as BetPackOverlay
9
10
  };
@@ -1,65 +1,69 @@
1
1
  import { jsxs as d, jsx as r } from "react/jsx-runtime";
2
2
  import { cx as P } from "@linaria/core";
3
- import { forwardRef as b, useState as y, useCallback as I, memo as F, useMemo as H, useEffect as L } from "react";
3
+ import { forwardRef as I, useState as y, useCallback as H, useEffect as w, memo as L, useMemo as p } from "react";
4
4
  import { useStore as B } from "@streamlayer/react-polyfills";
5
- import { FeatureType as p } from "@streamlayer/sdk-web-types";
5
+ import { FeatureType as A } from "@streamlayer/sdk-web-types";
6
6
  import { BetPackContent as M } from "./BetPackContent/index.js";
7
- import { EmergencyScreen as O } from "./BetPackContent/EmergencyScreen/index.js";
8
- import { LoaderScreen as x } from "./BetPackContent/LoaderScreen/index.js";
9
- import { BetPackContainer as R } from "./styles.js";
10
- import { defaultEventHandler as j } from "./utils.js";
11
- import { SvgIcon as k } from "../../../ui/icons/index.js";
12
- import { Container as G, Header as T, HeaderTitle as z, CloseButton as U, Main as Y, Footer as q, SlideSwitchButton as C, IconArrowPrev as D, buttonAvailable as g, IconArrowNext as J } from "./BetPackOverlay/styles.js";
13
- const nr = b(({ sdk: c, onEvent: a, close: t }, i) => {
14
- const [o, m] = y(), [e, h] = y(), w = I(
15
- (l) => {
16
- if (l.type === "slBetPackReady") {
17
- const { next: s, prev: u, current: f, canNext: N, canPrev: A } = l.payload || {};
18
- m({ next: s, prev: u }), h((n) => ({
19
- current: n != null && n.current ? n == null ? void 0 : n.current : f,
20
- canPrev: n != null && n.current ? n == null ? void 0 : n.canPrev : A,
21
- canNext: N
7
+ import { EmergencyScreen as G } from "./BetPackContent/EmergencyScreen/index.js";
8
+ import { LoaderScreen as g } from "./BetPackContent/LoaderScreen/index.js";
9
+ import { BetPackContainer as O } from "./styles.js";
10
+ import { defaultEventHandler as R } from "./utils.js";
11
+ import { SvgIcon as x } from "../../../ui/icons/index.js";
12
+ import { Container as j, Header as T, HeaderTitle as z, CloseButton as U, Main as Y, Footer as q, SlideSwitchButton as C, IconArrowPrev as D, buttonAvailable as k, IconArrowNext as J } from "./BetPackOverlay/styles.js";
13
+ const nr = I(({ sdk: o, onEvent: a, close: m }, t) => {
14
+ const [n, u] = y(), [e, h] = y(), N = H(
15
+ (i) => {
16
+ if (i.type === "slBetPackReady") {
17
+ const { next: l, prev: s, current: f, canNext: b, canPrev: F } = i.payload || {};
18
+ u({ next: l, prev: s }), h((c) => ({
19
+ current: c != null && c.current ? c == null ? void 0 : c.current : f,
20
+ canPrev: c != null && c.current ? c == null ? void 0 : c.canPrev : F,
21
+ canNext: b
22
22
  }));
23
23
  }
24
- if (l.type === "slBetPackChangeCard") {
25
- const { current: s, canNext: u, canPrev: f } = l.payload || {};
26
- h({ current: s, canNext: u, canPrev: f });
24
+ if (i.type === "slBetPackChangeCard") {
25
+ const { current: l, canNext: s, canPrev: f } = i.payload || {};
26
+ h({ current: l, canNext: s, canPrev: f });
27
27
  }
28
- a == null || a(l);
28
+ a == null || a(i);
29
29
  },
30
30
  [a]
31
31
  );
32
- return /* @__PURE__ */ d(G, { ref: i, children: [
32
+ return w(() => () => {
33
+ var l;
34
+ const i = o.getFeature(A.GAMES);
35
+ i && ((l = i.betPack) == null || l.off());
36
+ }, [o]), /* @__PURE__ */ d(j, { ref: t, children: [
33
37
  /* @__PURE__ */ d(T, { children: [
34
38
  /* @__PURE__ */ d(z, { children: [
35
- /* @__PURE__ */ r(k, { name: "fgIcon" }),
39
+ /* @__PURE__ */ r(x, { name: "fgIcon" }),
36
40
  "Featured Groups+"
37
41
  ] }),
38
- /* @__PURE__ */ r(U, { "data-a": "intr", onClick: t, children: /* @__PURE__ */ r(k, { name: "icon-close-btn-gray" }) })
42
+ /* @__PURE__ */ r(U, { "data-a": "intr", onClick: m, children: /* @__PURE__ */ r(x, { name: "icon-close-btn-gray" }) })
39
43
  ] }),
40
- /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(Q, { sdk: c, onEvent: w, overlay: !0 }) }),
44
+ /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(Q, { sdk: o, onEvent: N, overlay: !0 }) }),
41
45
  /* @__PURE__ */ d(q, { children: [
42
- /* @__PURE__ */ r(C, { "data-a": "intr", onClick: o == null ? void 0 : o.prev, disabled: !(e != null && e.canPrev), children: /* @__PURE__ */ r(D, { "data-a": "intr", name: "iconArrowPrev", className: P((e == null ? void 0 : e.canPrev) && g) }) }),
43
- /* @__PURE__ */ r(C, { "data-a": "intr", onClick: o == null ? void 0 : o.next, disabled: !(e != null && e.canNext), children: /* @__PURE__ */ r(J, { "data-a": "intr", name: "iconArrowPrev", className: P((e == null ? void 0 : e.canNext) && g) }) })
46
+ /* @__PURE__ */ r(C, { "data-a": "intr", onClick: n == null ? void 0 : n.prev, disabled: !(e != null && e.canPrev), children: /* @__PURE__ */ r(D, { "data-a": "intr", name: "iconArrowPrev", className: P((e == null ? void 0 : e.canPrev) && k) }) }),
47
+ /* @__PURE__ */ r(C, { "data-a": "intr", onClick: n == null ? void 0 : n.next, disabled: !(e != null && e.canNext), children: /* @__PURE__ */ r(J, { "data-a": "intr", name: "iconArrowPrev", className: P((e == null ? void 0 : e.canNext) && k) }) })
44
48
  ] })
45
49
  ] });
46
- }), K = ({ user: c, gamification: a, overlay: t, swipeable: i, onEvent: o }) => c.data ? a ? /* @__PURE__ */ r(M, { overlay: t, gamification: a, onEvent: o, swipeable: i }) : /* @__PURE__ */ r(x, {}) : c.error && !c.loading ? /* @__PURE__ */ r(
47
- O,
50
+ }), K = ({ user: o, gamification: a, overlay: m, swipeable: t, onEvent: n }) => o.data ? a ? /* @__PURE__ */ r(M, { overlay: m, gamification: a, onEvent: n, swipeable: t }) : /* @__PURE__ */ r(g, {}) : o.error && !o.loading ? /* @__PURE__ */ r(
51
+ G,
48
52
  {
49
- onEvent: o,
50
- actionFn: () => o({ type: "slHardRefresh" }),
53
+ onEvent: n,
54
+ actionFn: () => n({ type: "slHardRefresh" }),
51
55
  description: `You are not authorized to
52
56
  view this resource.`
53
57
  }
54
- ) : /* @__PURE__ */ r(x, {}), Q = F(({ sdk: c, swipeable: a = !0, onEvent: t = j, overlay: i }) => {
55
- const o = B(c.featuresList.getStore()), m = H(() => c.getFeature(p.GAMES), [o]), e = B(c.getUserStore());
56
- return L(() => (c.writeOverlaySessionId(), () => {
57
- c.writeOverlaySessionId("");
58
+ ) : /* @__PURE__ */ r(g, {}), Q = L(({ sdk: o, swipeable: a = !0, onEvent: m = R, overlay: t }) => {
59
+ const n = B(o.featuresList.getStore()), u = p(() => o.getFeature(A.GAMES), [n]), e = B(o.getUserStore());
60
+ return w(() => (o.writeOverlaySessionId(), () => {
61
+ o.writeOverlaySessionId("");
58
62
  }), []), /* @__PURE__ */ r(
59
- R,
63
+ O,
60
64
  {
61
- className: P("SL-BetPack", i && "SL-BetPack--overlay", !i && "SL-BetPack--standalone"),
62
- children: /* @__PURE__ */ r(K, { overlay: i, user: e, gamification: m, onEvent: t, swipeable: a })
65
+ className: P("SL-BetPack", t && "SL-BetPack--overlay", !t && "SL-BetPack--standalone"),
66
+ children: /* @__PURE__ */ r(K, { overlay: t, user: e, gamification: u, onEvent: m, swipeable: a })
63
67
  }
64
68
  );
65
69
  });
@@ -1,69 +1,69 @@
1
- import { jsxs as u, jsx as e } from "react/jsx-runtime";
2
- import { styled as l } from "@linaria/react";
1
+ import { jsxs as n, jsx as r } from "react/jsx-runtime";
2
+ import { styled as u } from "@linaria/react";
3
3
  import { useMastersContext as a } from "../../useMastersContext.js";
4
- import { useStore as n } from "@streamlayer/react-polyfills";
4
+ import { useStore as l } from "@streamlayer/react-polyfills";
5
5
  import { QuestionType as m } from "@streamlayer/sdk-web-types";
6
6
  import { VoteHeader as c } from "../../../../ui/gamification/detail/header/index.js";
7
7
  import { Sponsor as p } from "../../../../ui/gamification/detail/sponsor/index.js";
8
8
  import { Vote as f, VoteSkeleton as b } from "../../../../ui/gamification/vote/index.js";
9
9
  import { InsightDetails as y } from "../../../../ui/gamification/vote/insight-details/index.js";
10
- import { TwitterDetails as V } from "../../../../ui/gamification/vote/twitter-details/index.js";
11
- const h = /* @__PURE__ */ l("div")({
10
+ import { TwitterDetails as S } from "../../../../ui/gamification/vote/twitter-details/index.js";
11
+ const V = /* @__PURE__ */ u("div")({
12
12
  name: "QuestionContainer",
13
13
  class: "qwgkhsv",
14
14
  propsAsIs: !1
15
- }), x = ({
15
+ }), g = ({
16
16
  openedQuestion: t
17
17
  }) => {
18
18
  var s, o;
19
19
  const {
20
- sdk: r
20
+ sdk: e
21
21
  } = a();
22
- return ((s = t == null ? void 0 : t.attributes) == null ? void 0 : s.attributes.case) === "insight" ? /* @__PURE__ */ e(y, {
22
+ return ((s = t == null ? void 0 : t.attributes) == null ? void 0 : s.attributes.case) === "insight" ? /* @__PURE__ */ r(y, {
23
23
  ...t.attributes.attributes.value,
24
- controlVideo: r == null ? void 0 : r.controlVideoPlayer
25
- }) : ((o = t == null ? void 0 : t.attributes) == null ? void 0 : o.attributes.case) === "tweet" ? /* @__PURE__ */ e(V, {
24
+ controlVideo: e == null ? void 0 : e.controlVideoPlayer
25
+ }) : ((o = t == null ? void 0 : t.attributes) == null ? void 0 : o.attributes.case) === "tweet" ? /* @__PURE__ */ r(S, {
26
26
  ...t.attributes.attributes.value,
27
- controlVideo: r == null ? void 0 : r.controlVideoPlayer
27
+ controlVideo: e == null ? void 0 : e.controlVideoPlayer
28
28
  }) : null;
29
- }, d = ({
29
+ }, h = ({
30
30
  extendedQuestion: t,
31
- vote: r,
31
+ vote: e,
32
32
  close: s
33
33
  }) => {
34
34
  const {
35
35
  loading: o,
36
36
  data: i
37
37
  } = t;
38
- return i ? /* @__PURE__ */ e(f, {
39
- vote: r,
38
+ return localStorage.getItem("SL_DEBUG") && console.log("QuestionDetail", t), i ? /* @__PURE__ */ r(f, {
39
+ vote: e,
40
40
  close: s,
41
41
  openedQuestion: i,
42
42
  isLoading: !!o
43
- }) : /* @__PURE__ */ e(b, {});
44
- }, H = ({
43
+ }) : /* @__PURE__ */ r(b, {});
44
+ }, L = ({
45
45
  gamification: t
46
46
  }) => {
47
47
  var i;
48
- const r = n(t.openedQuestion.$store), s = n(t.openedQuestion.$extendedStore);
49
- if (!r)
48
+ const e = l(t.openedQuestion.$store), s = l(t.openedQuestion.$extendedStore);
49
+ if (!e)
50
50
  return null;
51
- const o = r.type;
52
- return /* @__PURE__ */ u(h, {
53
- children: [/* @__PURE__ */ e(c, {
51
+ const o = e.type;
52
+ return /* @__PURE__ */ n(V, {
53
+ children: [/* @__PURE__ */ r(c, {
54
54
  close: t.closeQuestion,
55
- type: ((i = r.attributes) == null ? void 0 : i.type) || m.UNSET
56
- }), o === "question" && /* @__PURE__ */ e(d, {
55
+ type: ((i = e.attributes) == null ? void 0 : i.type) || m.UNSET
56
+ }), o === "question" && /* @__PURE__ */ r(h, {
57
57
  vote: t.submitAnswer,
58
58
  close: t.closeQuestion,
59
59
  extendedQuestion: s
60
- }), o !== "question" && /* @__PURE__ */ e(x, {
61
- openedQuestion: r
62
- }), /* @__PURE__ */ e(p, {
60
+ }), o !== "question" && /* @__PURE__ */ r(g, {
61
+ openedQuestion: e
62
+ }), /* @__PURE__ */ r(p, {
63
63
  mastersApp: !0
64
64
  })]
65
65
  });
66
66
  };
67
67
  export {
68
- H as Question
68
+ L as Question
69
69
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react-ui",
3
- "version": "1.23.2",
3
+ "version": "1.23.4",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./lib/index.d.ts",
@@ -69,19 +69,19 @@
69
69
  "react-window": "^1.8.10",
70
70
  "react-window-infinite-loader": "^1.0.9",
71
71
  "uuid": "^11.1.0",
72
- "@streamlayer/feature-gamification": "^1.16.11",
73
- "@streamlayer/react-polyfills": "^0.1.18",
74
- "@streamlayer/sdk-web": "^1.10.11",
75
- "@streamlayer/sdk-web-anonymous-auth": "^1.1.37",
76
- "@streamlayer/sdk-web-analytics": "^1.7.11",
77
- "@streamlayer/sdk-web-core": "^1.11.13",
78
- "@streamlayer/sdk-web-api": "^1.8.11",
79
- "@streamlayer/sdk-web-features": "^1.0.58",
80
- "@streamlayer/sdk-web-interfaces": "^1.5.2",
81
- "@streamlayer/sdk-web-logger": "^1.0.58",
82
- "@streamlayer/sdk-web-storage": "^1.0.58",
83
- "@streamlayer/sdk-web-notifications": "^1.3.20",
84
- "@streamlayer/sdk-web-types": "^1.10.15"
72
+ "@streamlayer/feature-gamification": "^1.16.13",
73
+ "@streamlayer/react-polyfills": "^0.1.20",
74
+ "@streamlayer/sdk-web": "^1.10.13",
75
+ "@streamlayer/sdk-web-analytics": "^1.7.13",
76
+ "@streamlayer/sdk-web-anonymous-auth": "^1.1.39",
77
+ "@streamlayer/sdk-web-api": "^1.8.13",
78
+ "@streamlayer/sdk-web-core": "^1.11.15",
79
+ "@streamlayer/sdk-web-features": "^1.0.60",
80
+ "@streamlayer/sdk-web-interfaces": "^1.5.4",
81
+ "@streamlayer/sdk-web-logger": "^1.0.60",
82
+ "@streamlayer/sdk-web-notifications": "^1.3.22",
83
+ "@streamlayer/sdk-web-storage": "^1.0.60",
84
+ "@streamlayer/sdk-web-types": "^1.10.17"
85
85
  },
86
86
  "nx": {
87
87
  "implicitDependencies": [
@@ -121,7 +121,7 @@
121
121
  "vite-plugin-svgr": "^4.2.0",
122
122
  "vite-svg-loader": "^5.1.0",
123
123
  "vite-tsconfig-paths": "^5.0.1",
124
- "@streamlayer/react": "^1.15.2"
124
+ "@streamlayer/react": "^1.15.4"
125
125
  },
126
126
  "dependencies": {
127
127
  "@dailymotion/vast-client": "^6.2.0",