@streamlayer/react 1.5.0 → 1.5.2

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.
package/lib/es/insight.js CHANGED
@@ -1,61 +1,62 @@
1
- import { jsx as n, jsxs as c } from "react/jsx-runtime";
2
- import { useRef as m, useEffect as h } from "react";
3
- import { a as u, x as l, s as f, b as p, u as S, d as I, S as g } from "./index2.js";
4
- import { S as y } from "./useStreamLayerApp2.js";
5
- const Q = () => p, v = /* @__PURE__ */ f(Q())({
1
+ import { jsx as d, jsxs as m } from "react/jsx-runtime";
2
+ import { useRef as c, useEffect as l } from "react";
3
+ import { a as o, s as f, b as h, u as p, d as S, S as I } from "./index2.js";
4
+ import { S as g } from "./useStreamLayerApp2.js";
5
+ const v = () => h, y = /* @__PURE__ */ f(v())({
6
6
  name: "QuestionWrap",
7
7
  class: "q10hhsxv",
8
8
  propsAsIs: !0
9
- }), L = ({
9
+ }), Q = ({
10
10
  gamification: e,
11
- persistent: i,
12
- hideHeader: a,
13
- insightId: t
11
+ persistent: s,
12
+ hideHeader: n,
13
+ insightId: i
14
14
  }) => {
15
- const s = m(""), o = u(e.openedQuestion.$store);
16
- return h(() => t ? (!i || e.isOpenedQuestion(t) || (s.current = t, e.getFeedItem(t).then((r) => {
17
- s.current === t && e.openQuestion(t, r);
15
+ const t = c(""), u = o(e.openedQuestion.$store);
16
+ return l(() => i ? (!s || e.isOpenedQuestion(i) || (t.current = i, e.getFeedItem(i).then((r) => {
17
+ var a;
18
+ t.current === i && ((a = r == null ? void 0 : r.attributes) == null ? void 0 : a.attributes.case) === "insight" && e.openQuestion(i, r);
18
19
  })), () => {
19
- s.current = "";
20
+ t.current = "";
20
21
  }) : (e.activeQuestionId.subscribe(({
21
22
  data: r
22
23
  }) => {
23
- var d;
24
- 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 = "");
24
+ var a;
25
+ r && ((a = r.feedItem) == null ? void 0 : a.type) === "insight" && (!s || e.isOpenedQuestion(r.feedItem.id) || (t.current = r.feedItem.id, e.openQuestion(r.feedItem.id, r.feedItem))), !r && t.current && (e.closeQuestion(t.current), t.current = "");
25
26
  }), () => {
26
- }), [e, i, t]), o ? /* @__PURE__ */ n(l, {
27
- style: {
28
- height: "100%"
29
- },
30
- children: /* @__PURE__ */ n(v, {
31
- hideHeader: a,
32
- gamification: e,
33
- hideSponsor: !0
34
- })
27
+ }), [e, s, i]), u ? /* @__PURE__ */ d(y, {
28
+ hideHeader: n,
29
+ gamification: e,
30
+ hideSponsor: !0
35
31
  }) : null;
36
- }, x = ({
32
+ }, b = ({
37
33
  sdk: e,
38
- persistent: i,
39
- insightId: a,
40
- hideHeader: t
34
+ persistent: s,
35
+ insightId: n,
36
+ hideHeader: i
41
37
  }) => {
42
- if (!u(e.featuresList.getStore()))
38
+ if (!o(e.featuresList.getStore()))
43
39
  return null;
44
- const s = e.getFeature(y.GAMES);
45
- return s ? /* @__PURE__ */ n(L, {
46
- insightId: a,
47
- persistent: i,
48
- hideHeader: t,
49
- gamification: s
40
+ const t = e.getFeature(g.GAMES);
41
+ return t ? /* @__PURE__ */ d(Q, {
42
+ insightId: n,
43
+ persistent: s,
44
+ hideHeader: i,
45
+ gamification: t
50
46
  }) : null;
51
- }, b = ({ event: e, hideHeader: i, persistent: a }) => {
52
- const t = S();
53
- return t ? /* @__PURE__ */ c("div", { className: "StreamLayerSDK", children: [
54
- /* @__PURE__ */ n(I, { children: /* @__PURE__ */ n(x, { sdk: t, event: e, hideHeader: i, persistent: a }) }),
55
- e !== void 0 && /* @__PURE__ */ n(g, { event: e })
47
+ }, H = ({
48
+ event: e,
49
+ theme: s,
50
+ hideHeader: n,
51
+ persistent: i
52
+ }) => {
53
+ const t = p();
54
+ return t ? /* @__PURE__ */ m("div", { className: "StreamLayerSDK", children: [
55
+ /* @__PURE__ */ d(S, { customTheme: s, children: /* @__PURE__ */ d(b, { sdk: t, hideHeader: n, persistent: i }) }),
56
+ e !== void 0 && /* @__PURE__ */ d(I, { event: e })
56
57
  ] }) : null;
57
58
  };
58
59
  export {
59
- b as StreamLayerSDKInsight,
60
- x as StreamLayerSDKInsightUI
60
+ H as StreamLayerSDKInsight,
61
+ b as StreamLayerSDKInsightUI
61
62
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as n, jsxs as L, Fragment as E } from "react/jsx-runtime";
2
- import { a as C, F as r2, s as u, T as j, i as i2, p as a2, h as l2, N as d2, k as c2, M as p2, j as u2, l as C2, C as v2, m as h2, O as K, n as x, o as m2, q as g2, r as L2, t as X, w as f2, y as S2, z as y2, A as U, B as k2, D as J, x as _, I as e2, c as P, G as N2, H as b2, J as z, K as A2, P as I2, R as $2, g as E2, U as T, V as q, W as V2, X as w2, Y as R2, f as H2, Z as Q, _ as T2, $ as x2, L as F, a0 as F2, a1 as D2, a2 as M2, a3 as O2, v as D, a4 as U2, a5 as _2, a6 as P2, a7 as B2, a8 as G2 } from "./index2.js";
2
+ import { a as C, F as r2, s as u, T as j, i as i2, p as a2, h as l2, N as d2, k as c2, M as p2, j as u2, l as C2, C as v2, n as h2, O as K, o as x, q as m2, r as g2, t as L2, v as X, w as f2, x as S2, y as y2, z as U, A as k2, B as J, D as _, I as e2, c as P, G as N2, H as b2, J as z, K as A2, P as I2, R as $2, g as E2, U as T, V as q, W as V2, X as w2, Y as R2, f as H2, Z as Q, _ as T2, $ as x2, L as F, a0 as F2, a1 as D2, a2 as M2, a3 as O2, m as D, a4 as U2, a5 as _2, a6 as P2, a7 as B2, a8 as G2 } from "./index2.js";
3
3
  import { createContext as z2, useContext as s2, useRef as $, useState as b, useEffect as k, useTransition as q2, lazy as Q2, useMemo as H, Suspense as Z2, forwardRef as Y2, useLayoutEffect as W2, useCallback as R, Component as j2 } from "react";
4
4
  import { Q as K2, S as I } from "./useStreamLayerApp2.js";
5
5
  const M = /* @__PURE__ */ u("div")({
package/lib/es/points.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
2
  import { useState as p, useEffect as u } from "react";
3
- import { s as n, c as m, v as d, e as S, a as f, F as v, u as y, d as h } from "./index2.js";
3
+ import { s as n, c as m, m as d, e as S, a as f, F as y, u as v, d as h } from "./index2.js";
4
4
  import { S as g } from "./useStreamLayerApp2.js";
5
5
  const A = /* @__PURE__ */ n("div")({
6
6
  name: "PointsContainer",
@@ -43,7 +43,7 @@ const A = /* @__PURE__ */ n("div")({
43
43
  c();
44
44
  };
45
45
  }, [r]), /* @__PURE__ */ e(F, { points: i, onClick: () => {
46
- s.status.get() === v.Suspended && s.openFeature();
46
+ s.status.get() === y.Suspended && s.openFeature();
47
47
  } });
48
48
  }, $ = ({ sdk: s }) => {
49
49
  if (!f(s.featuresList.getStore()))
@@ -51,7 +51,7 @@ const A = /* @__PURE__ */ n("div")({
51
51
  const r = s.getFeature(g.GAMES);
52
52
  return r ? /* @__PURE__ */ e(L, { gamification: r }) : null;
53
53
  }, E = () => {
54
- const s = y();
54
+ const s = v();
55
55
  return s ? /* @__PURE__ */ e("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e($, { sdk: s }) }) }) : null;
56
56
  };
57
57
  export {
@@ -13395,7 +13395,7 @@ const Tk = (e, t, n) => {
13395
13395
  if (!((l = a.data) != null && l.attributes))
13396
13396
  return;
13397
13397
  const { options: s, notification: r, ...o } = a.data.attributes, c = (s == null ? void 0 : s.options.case) === "promotion" ? s == null ? void 0 : s.options.value : void 0;
13398
- return c ? { id: o.id, question: o, promotion: c, notification: r } : void 0;
13398
+ return { id: o.id, question: o, promotion: c, notification: r };
13399
13399
  }, Ek = (e, t, n) => {
13400
13400
  const { client: a, queryKey: s } = n.createPromiseClient(Ne, {
13401
13401
  method: "list",
@@ -13486,18 +13486,17 @@ class Nk extends Bt {
13486
13486
  }
13487
13487
  }
13488
13488
  const Ok = (e) => {
13489
- var o, c, l, m, u, d, y;
13489
+ var o, c, l, m, u;
13490
13490
  const t = (c = (o = e.data) == null ? void 0 : o.attributes) == null ? void 0 : c.question;
13491
- if ((((y = (d = (u = (m = (l = e.data) == null ? void 0 : l.attributes) == null ? void 0 : m.feedItem) == null ? void 0 : u.attributes) == null ? void 0 : d.attributes) == null ? void 0 : y.case) === "promotion" ? e.data.attributes.feedItem.attributes : void 0) === void 0 || !t)
13491
+ if ((((u = (m = (l = e.data) == null ? void 0 : l.attributes) == null ? void 0 : m.feedItem) == null ? void 0 : u.type) === "promotion" ? e.data.attributes.feedItem : void 0) === void 0 || !t)
13492
13492
  return;
13493
13493
  const { options: n, notification: a, ...s } = t, r = (n == null ? void 0 : n.options.case) === "promotion" ? n.options.value : void 0;
13494
- if (r)
13495
- return {
13496
- id: s.id,
13497
- question: s,
13498
- notification: a,
13499
- promotion: r
13500
- };
13494
+ return {
13495
+ id: s.id,
13496
+ question: s,
13497
+ notification: a,
13498
+ promotion: r
13499
+ };
13501
13500
  }, vk = (e, t, n) => {
13502
13501
  const a = n.transport, s = We("advertisement"), r = new Nk(), o = Ie({}), c = bk(e, a), l = (d, y) => {
13503
13502
  y ? o.set({
@@ -13519,16 +13518,16 @@ const Ok = (e) => {
13519
13518
  })));
13520
13519
  };
13521
13520
  c.subscribe((d, y) => {
13522
- var T;
13521
+ var T, f;
13523
13522
  d.data && (Ee.emit("advertisement", {
13524
13523
  action: "received",
13525
13524
  payload: {
13526
13525
  advertisementId: d.data.question.id,
13527
- advertisementType: (T = d.data) == null ? void 0 : T.promotion.type
13526
+ advertisementType: (f = (T = d.data) == null ? void 0 : T.promotion) == null ? void 0 : f.type
13528
13527
  }
13529
13528
  }), (!(y != null && y.data) || d.data.id !== y.data.id) && l(d.data.question.id, d.data));
13530
13529
  }), o.subscribe((d, y) => {
13531
- var T, f;
13530
+ var T, f, _;
13532
13531
  d.data && (n.sdk.onAdvertisementActivate({
13533
13532
  stage: "activate",
13534
13533
  id: d.data.question.id,
@@ -13538,7 +13537,7 @@ const Ok = (e) => {
13538
13537
  action: "opened",
13539
13538
  payload: {
13540
13539
  advertisementId: d.data.question.id,
13541
- advertisementType: (f = d.data) == null ? void 0 : f.promotion.type
13540
+ advertisementType: (_ = (f = d.data) == null ? void 0 : f.promotion) == null ? void 0 : _.type
13542
13541
  }
13543
13542
  })), !(d != null && d.data) && (y != null && y.data) && n.sdk.onAdvertisementActivate({
13544
13543
  stage: "deactivate",
@@ -17649,7 +17648,7 @@ const W_ = ({
17649
17648
  m = !0;
17650
17649
  };
17651
17650
  const u = j_(e, n, a, {
17652
- version: "1.5.0",
17651
+ version: "1.5.2",
17653
17652
  onDeepLinkHandled: s,
17654
17653
  videoPlayerController: r,
17655
17654
  onContentActivate: o
@@ -17676,12 +17675,13 @@ export {
17676
17675
  Jo as a,
17677
17676
  dm as b,
17678
17677
  gm as c,
17679
- P as d,
17680
- ur as e,
17681
- ft as f,
17682
- me as g,
17683
- Yr as h,
17684
- Qt as i,
17678
+ ym as d,
17679
+ P as e,
17680
+ ur as f,
17681
+ ft as g,
17682
+ me as h,
17683
+ Yr as i,
17684
+ Qt as j,
17685
17685
  nl as p,
17686
17686
  W_ as u
17687
17687
  };