@streamlayer/react 1.20.5 → 1.20.7

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 (49) hide show
  1. package/lib/cjs/advertisement.js +29 -29
  2. package/lib/cjs/index.js +1 -1
  3. package/lib/cjs/index2.js +4 -4
  4. package/lib/cjs/insight.js +1 -1
  5. package/lib/cjs/masters2.js +7 -7
  6. package/lib/cjs/notification.js +1 -1
  7. package/lib/cjs/pause-ad.js +1 -1
  8. package/lib/cjs/points.js +1 -1
  9. package/lib/cjs/provider.js +15 -39
  10. package/lib/cjs/useStreamLayerApp2.js +16 -17
  11. package/lib/classic/cjs/advertisement.js +29 -29
  12. package/lib/classic/cjs/bet-pack.js +4 -4
  13. package/lib/classic/cjs/index.js +1 -1
  14. package/lib/classic/cjs/insight.js +1 -1
  15. package/lib/classic/cjs/notification.js +1 -1
  16. package/lib/classic/cjs/pause-ad.js +1 -1
  17. package/lib/classic/cjs/points.js +1 -1
  18. package/lib/classic/cjs/provider.js +10 -34
  19. package/lib/classic/cjs/useStreamLayerApp2.js +16 -17
  20. package/lib/classic/es/advertisement.js +2193 -2265
  21. package/lib/classic/es/bet-pack.js +14 -12
  22. package/lib/classic/es/index.js +16 -11
  23. package/lib/classic/es/insight.js +35 -30
  24. package/lib/classic/es/notification.js +108 -103
  25. package/lib/classic/es/pause-ad.js +91 -87
  26. package/lib/classic/es/points.js +28 -23
  27. package/lib/classic/es/provider.js +4285 -10085
  28. package/lib/classic/es/useStreamLayerApp.js +1 -1
  29. package/lib/classic/es/useStreamLayerApp2.js +3111 -5772
  30. package/lib/dist/cjs/gamification-feature2.js +1 -1
  31. package/lib/dist/cjs/index.js +1 -1
  32. package/lib/dist/cjs/masters.js +35 -60
  33. package/lib/dist/es/gamification-feature2.js +112 -105
  34. package/lib/dist/es/index.js +12 -7
  35. package/lib/dist/es/masters.js +9909 -18734
  36. package/lib/dist/style.css +1 -1
  37. package/lib/es/advertisement.js +2193 -2265
  38. package/lib/es/index.js +16 -11
  39. package/lib/es/index2.js +12 -10
  40. package/lib/es/insight.js +35 -30
  41. package/lib/es/masters2.js +28 -25
  42. package/lib/es/notification.js +135 -130
  43. package/lib/es/pause-ad.js +91 -87
  44. package/lib/es/points.js +28 -23
  45. package/lib/es/provider.js +4302 -10466
  46. package/lib/es/useStreamLayerApp.js +1 -1
  47. package/lib/es/useStreamLayerApp2.js +3111 -5772
  48. package/lib/style.css +1 -1
  49. package/package.json +15 -15
@@ -1,7 +1,9 @@
1
1
  import { jsx as P, jsxs as F } from "react/jsx-runtime";
2
- import { s as _, B as te, k as vt, l as gt, a as Se, q as wt, c as bt, j as Ee, u as yt, e as St } from "./provider.js";
3
- import $, { forwardRef as Ae, useState as W, useRef as D, useEffect as Y, useLayoutEffect as Et, createContext as He, useMemo as Re, useCallback as qe, memo as xt } from "react";
4
- import { C as Tt, a as Ct, S as We } from "./useStreamLayerApp2.js";
2
+ import { s as _, B as te, o as vt, p as gt, e as Se, j as wt, n as Ee, u as bt, i as yt } from "./provider.js";
3
+ import $, { forwardRef as Ae, useState as W, useRef as D, useEffect as Y, useLayoutEffect as St, createContext as He, useMemo as Re, useCallback as qe, memo as Et } from "react";
4
+ import { ConnectError as xt, Code as Tt } from "@connectrpc/connect";
5
+ import Ct from "lodash.throttle";
6
+ import { S as We } from "./useStreamLayerApp2.js";
5
7
  function _e(t) {
6
8
  return t !== null && typeof t == "object" && "constructor" in t && t.constructor === Object;
7
9
  }
@@ -2613,7 +2615,7 @@ function Js(t, e, s) {
2613
2615
  }));
2614
2616
  }
2615
2617
  function ee(t, e) {
2616
- return typeof window > "u" ? Y(t, e) : Et(t, e);
2618
+ return typeof window > "u" ? Y(t, e) : St(t, e);
2617
2619
  }
2618
2620
  const De = /* @__PURE__ */ He(null), Zs = /* @__PURE__ */ He(null), ot = /* @__PURE__ */ Ae(function(t, e) {
2619
2621
  let {
@@ -3237,7 +3239,7 @@ const Tr = ({ data: t, gamification: e, onEvent: s, swipeable: r, autoplay: n })
3237
3239
  e.closeQuestion();
3238
3240
  }, [u, f] = W(1.1);
3239
3241
  return Y(() => {
3240
- const v = wt(() => {
3242
+ const v = Ct(() => {
3241
3243
  var h;
3242
3244
  const b = (h = l.current) == null ? void 0 : h.size;
3243
3245
  if (!b)
@@ -3281,7 +3283,7 @@ const Tr = ({ data: t, gamification: e, onEvent: s, swipeable: r, autoplay: n })
3281
3283
  {
3282
3284
  onEvent: n,
3283
3285
  actionFn: () => n({ type: "slHardRefresh" }),
3284
- description: l instanceof Tt && l.code !== Ct.InvalidArgument ? `The event ID was not
3286
+ description: l instanceof xt && l.code !== Tt.InvalidArgument ? `The event ID was not
3285
3287
  specified or is invalid.` : `The server is unable to
3286
3288
  handle this request.`
3287
3289
  }
@@ -3308,7 +3310,7 @@ handle this request.`
3308
3310
  name: "BetPackContainer",
3309
3311
  class: "b18vssq2",
3310
3312
  propsAsIs: !1
3311
- }), ie = "slBetPackCb", Mr = bt("betPack-ui"), kr = (t, e = {}) => {
3313
+ }), ie = "slBetPackCb", Mr = wt("betPack-ui"), kr = (t, e = {}) => {
3312
3314
  var s, r;
3313
3315
  const { questionId: n, answerId: i } = e, l = { questionId: n, answerId: i };
3314
3316
  Mr.debug({ id: ie, type: t, ...l }), (s = window.top) == null || s.postMessage({ id: ie, type: t, ...l }, "*"), window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers[ie] && window.webkit.messageHandlers[ie].postMessage({ type: t, ...l }), (r = window.slBetPackCb) != null && r.postMessage && window.slBetPackCb.postMessage(JSON.stringify({ type: t, ...l, from: "base" }));
@@ -3397,7 +3399,7 @@ const Dr = ({ user: t, gamification: e, overlay: s, swipeable: r, onEvent: n })
3397
3399
  description: `You are not authorized to
3398
3400
  view this resource.`
3399
3401
  }
3400
- ) : /* @__PURE__ */ P(Le, {}), mt = xt(({ sdk: t, swipeable: e = !0, onEvent: s = Ir, overlay: r }) => {
3402
+ ) : /* @__PURE__ */ P(Le, {}), mt = Et(({ sdk: t, swipeable: e = !0, onEvent: s = Ir, overlay: r }) => {
3401
3403
  const n = Se(t.featuresList.getStore()), i = Re(() => t.getFeature(We.GAMES), [n]), l = Se(t.getUserStore());
3402
3404
  return Y(() => (t.writeOverlaySessionId(), () => {
3403
3405
  t.writeOverlaySessionId("");
@@ -3410,16 +3412,16 @@ view this resource.`
3410
3412
  );
3411
3413
  }), Ve = (t) => {
3412
3414
  const e = t.target;
3413
- e instanceof Element && e.getAttribute("data-a") === "intr" && St.emit("interactions", {
3415
+ e instanceof Element && e.getAttribute("data-a") === "intr" && yt.emit("interactions", {
3414
3416
  action: "tap",
3415
3417
  payload: {}
3416
3418
  });
3417
- }, Rr = () => {
3418
- const t = yt();
3419
+ }, Wr = () => {
3420
+ const t = bt();
3419
3421
  return Y(() => (document == null || document.addEventListener("click", Ve), () => {
3420
3422
  document == null || document.removeEventListener("click", Ve);
3421
3423
  }), []), t ? /* @__PURE__ */ P(mt, { sdk: t }) : null;
3422
3424
  };
3423
3425
  export {
3424
- Rr as BetPackProvider
3426
+ Wr as BetPackProvider
3425
3427
  };
@@ -1,15 +1,20 @@
1
- import { z as m, S, A as o, h as i, u as s, b as y, r as L } from "./provider.js";
1
+ import { S as p, a as y, b as L, h as c, u as f, d as u, c as D } from "./provider.js";
2
+ import "nanostores";
2
3
  import "react/jsx-runtime";
3
4
  import "react";
4
- import { StreamLayerSDKNotification as p, StreamLayerSDKNotificationUI as u } from "./notification.js";
5
+ import "@nanostores/react";
6
+ import "lodash.throttle";
7
+ import "react-dom";
8
+ import "react-countup";
9
+ import { StreamLayerSDKNotification as d, StreamLayerSDKNotificationUI as h } from "./notification.js";
5
10
  export {
6
- m as StreamLayerProvider,
7
- S as StreamLayerSDKEvent,
8
- p as StreamLayerSDKNotification,
9
- u as StreamLayerSDKNotificationUI,
10
- o as StreamLayerSDKReact,
11
- i as StreamLayerThemeProvider,
12
- s as useStreamLayer,
13
- y as useStreamLayerTheme,
14
- L as useStreamLayerUI
11
+ p as StreamLayerProvider,
12
+ y as StreamLayerSDKEvent,
13
+ d as StreamLayerSDKNotification,
14
+ h as StreamLayerSDKNotificationUI,
15
+ L as StreamLayerSDKReact,
16
+ c as StreamLayerThemeProvider,
17
+ f as useStreamLayer,
18
+ u as useStreamLayerTheme,
19
+ D as useStreamLayerUI
15
20
  };
@@ -1,35 +1,40 @@
1
- import { jsx as u, jsxs as l } from "react/jsx-runtime";
2
- import { useRef as h, useEffect as p } from "react";
3
- import { a as m, s as f, T as S, u as I, b as g, h as v, S as k } from "./provider.js";
1
+ import { jsx as u, jsxs as c } from "react/jsx-runtime";
2
+ import { useRef as l, useEffect as h } from "react";
3
+ import "@nanostores/react";
4
+ import "nanostores";
5
+ import { e as m, s as f, T as S, u as I, d as g, h as v, a as k } from "./provider.js";
6
+ import "lodash.throttle";
7
+ import "react-dom";
8
+ import "react-countup";
4
9
  import { S as y } from "./useStreamLayerApp2.js";
5
- const Q = () => S, b = /* @__PURE__ */ f(Q())({
10
+ const Q = () => S, L = /* @__PURE__ */ f(Q())({
6
11
  name: "QuestionWrap",
7
12
  class: "q10hhsxv",
8
13
  propsAsIs: !0
9
- }), L = ({
14
+ }), b = ({
10
15
  gamification: e,
11
16
  sdk: n,
12
17
  persistent: i,
13
- skipAutoClose: a,
14
- hideHeader: o,
18
+ skipAutoClose: o,
19
+ hideHeader: a,
15
20
  insightId: t
16
21
  }) => {
17
- const r = h(""), c = m(e.openedQuestion.$store);
18
- return p(() => t ? (!i || e.isOpenedQuestion(t) || (r.current = t, e.getFeedItem(t).then((s) => {
22
+ const s = l(""), p = m(e.openedQuestion.$store);
23
+ return h(() => t ? (!i || e.isOpenedQuestion(t) || (s.current = t, e.getFeedItem(t).then((r) => {
19
24
  var d;
20
- r.current === t && ((d = s == null ? void 0 : s.attributes) == null ? void 0 : d.attributes.case) === "insight" && e.openQuestion(t, s);
25
+ s.current === t && ((d = r == null ? void 0 : r.attributes) == null ? void 0 : d.attributes.case) === "insight" && e.openQuestion(t, r);
21
26
  })), () => {
22
- r.current = "";
27
+ s.current = "";
23
28
  }) : (e.activeQuestionId.subscribe(({
24
- data: s
29
+ data: r
25
30
  }) => {
26
31
  var d;
27
- s && ((d = s.feedItem) == null ? void 0 : d.type) === "insight" && (!i || e.isOpenedQuestion(s.feedItem.id) || (r.current = s.feedItem.id, e.openQuestion(s.feedItem.id, s.feedItem))), !s && r.current && (e.closeQuestion(r.current), r.current = "");
32
+ r && ((d = r.feedItem) == null ? void 0 : d.type) === "insight" && (!i || e.isOpenedQuestion(r.feedItem.id) || (s.current = r.feedItem.id, e.openQuestion(r.feedItem.id, r.feedItem))), !r && s.current && (e.closeQuestion(s.current), s.current = "");
28
33
  }), () => {
29
- }), [e, i, t]), c ? /* @__PURE__ */ u(b, {
34
+ }), [e, i, t]), p ? /* @__PURE__ */ u(L, {
30
35
  sdk: n,
31
- skipAutoClose: a,
32
- hideHeader: o,
36
+ skipAutoClose: o,
37
+ hideHeader: a,
33
38
  gamification: e,
34
39
  hideSponsor: !0
35
40
  }) : null;
@@ -37,42 +42,42 @@ const Q = () => S, b = /* @__PURE__ */ f(Q())({
37
42
  sdk: e,
38
43
  persistent: n,
39
44
  skipAutoClose: i,
40
- insightId: a,
41
- hideHeader: o
45
+ insightId: o,
46
+ hideHeader: a
42
47
  }) => {
43
48
  if (!m(e.featuresList.getStore()))
44
49
  return null;
45
50
  const t = e.getFeature(y.GAMES);
46
- return t ? /* @__PURE__ */ u(L, {
47
- insightId: a,
51
+ return t ? /* @__PURE__ */ u(b, {
52
+ insightId: o,
48
53
  sdk: e,
49
54
  persistent: n,
50
- hideHeader: o,
55
+ hideHeader: a,
51
56
  gamification: t,
52
57
  skipAutoClose: i
53
58
  }) : null;
54
- }, H = ({
59
+ }, j = ({
55
60
  event: e,
56
61
  theme: n,
57
62
  hideHeader: i,
58
- skipAutoClose: a,
59
- persistent: o
63
+ skipAutoClose: o,
64
+ persistent: a
60
65
  }) => {
61
- const t = I(), r = g();
62
- return t ? /* @__PURE__ */ l("div", { className: "StreamLayerSDK", children: [
63
- /* @__PURE__ */ u(v, { customTheme: n ?? r.theme, themeMode: r.themeMode, children: /* @__PURE__ */ u(
66
+ const t = I(), s = g();
67
+ return t ? /* @__PURE__ */ c("div", { className: "StreamLayerSDK", children: [
68
+ /* @__PURE__ */ u(v, { customTheme: n ?? s.theme, themeMode: s.themeMode, children: /* @__PURE__ */ u(
64
69
  A,
65
70
  {
66
- skipAutoClose: a,
71
+ skipAutoClose: o,
67
72
  sdk: t,
68
73
  hideHeader: i,
69
- persistent: o
74
+ persistent: a
70
75
  }
71
76
  ) }),
72
77
  e !== void 0 && /* @__PURE__ */ u(k, { event: e })
73
78
  ] }) : null;
74
79
  };
75
80
  export {
76
- H as StreamLayerSDKInsight,
81
+ j as StreamLayerSDKInsight,
77
82
  A as StreamLayerSDKInsightUI
78
83
  };