@streamlayer/react 1.21.3 → 1.21.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.
@@ -5,7 +5,7 @@ import "nanostores";
5
5
  import "lodash.throttle";
6
6
  import "react-dom";
7
7
  import "react-countup";
8
- import { A as Gh, N as vi, a as Xh, b as Kh, C as no, c as Yh, P as rs, d as Jt, e as wm, f as km, g as Cm, S as Im } from "./useStreamLayerApp2.js";
8
+ import { A as Gh, N as vi, b as Xh, c as Kh, d as no, e as Yh, P as rs, f as Jt, g as wm, h as km, i as Cm, S as Im } from "./useStreamLayerApp2.js";
9
9
  import { c as xm, u as Am } from "./vast-client.min-B0NUra1B.js";
10
10
  import { D as Pm } from "./index-l-eyvmpL.js";
11
11
  import { v4 as fu, validate as Lm, v5 as mu } from "uuid";
package/lib/es/index2.js CHANGED
@@ -1,9 +1,8 @@
1
1
  import { jsx as P, jsxs as F } from "react/jsx-runtime";
2
2
  import { s as _, B as te, o as ft, p as ht, f as Se, j as gt, n as Ee } from "./provider.js";
3
3
  import $, { forwardRef as Ae, useState as W, useRef as D, useEffect as X, useLayoutEffect as vt, createContext as Ve, useMemo as He, useCallback as Re, memo as wt } from "react";
4
- import { ConnectError as bt, Code as yt } from "@connectrpc/connect";
5
- import St from "lodash.throttle";
6
- import { S as qe } from "./useStreamLayerApp2.js";
4
+ import bt from "lodash.throttle";
5
+ import { C as yt, a as St, S as qe } from "./useStreamLayerApp2.js";
7
6
  function _e(t) {
8
7
  return t !== null && typeof t == "object" && "constructor" in t && t.constructor === Object;
9
8
  }
@@ -3239,7 +3238,7 @@ const yr = ({ data: t, gamification: e, onEvent: s, swipeable: r, autoplay: n })
3239
3238
  e.closeQuestion();
3240
3239
  }, [u, f] = W(1.1);
3241
3240
  return X(() => {
3242
- const g = St(() => {
3241
+ const g = bt(() => {
3243
3242
  var h;
3244
3243
  const b = (h = l.current) == null ? void 0 : h.size;
3245
3244
  if (!b)
@@ -3283,7 +3282,7 @@ const yr = ({ data: t, gamification: e, onEvent: s, swipeable: r, autoplay: n })
3283
3282
  {
3284
3283
  onEvent: n,
3285
3284
  actionFn: () => n({ type: "slHardRefresh" }),
3286
- description: l instanceof bt && l.code !== yt.InvalidArgument ? `The event ID was not
3285
+ description: l instanceof yt && l.code !== St.InvalidArgument ? `The event ID was not
3287
3286
  specified or is invalid.` : `The server is unable to
3288
3287
  handle this request.`
3289
3288
  }
@@ -3352,7 +3351,7 @@ handle this request.`
3352
3351
  name: "SlideSwitchButton",
3353
3352
  class: "spp13y7",
3354
3353
  propsAsIs: !1
3355
- }), Hr = Ae(({ sdk: t, onEvent: e, close: s }, r) => {
3354
+ }), Vr = Ae(({ sdk: t, onEvent: e, close: s }, r) => {
3356
3355
  const [n, i] = W(), [l, a] = W(), o = Re(
3357
3356
  (c) => {
3358
3357
  if (c.type === "slBetPackReady") {
@@ -3411,5 +3410,5 @@ view this resource.`
3411
3410
  });
3412
3411
  export {
3413
3412
  Gr as Q,
3414
- Hr as n
3413
+ Vr as n
3415
3414
  };
@@ -1,11 +1,11 @@
1
1
  import { jsxs as l, jsx as s } from "react/jsx-runtime";
2
- import { useState as w, useRef as _, useEffect as y, useCallback as As, useMemo as hs } from "react";
3
- import { s as n, B as A, $ as Is, a0 as $s, a1 as K, R as G, a2 as gs, E as ws, O as x, y as ys, i as Ts, f as bs, e as Cs, N as R, u as fs, d as ks, c as Ns, h as qs } from "./provider.js";
2
+ import { useState as w, useRef as _, useEffect as y, useCallback as As, useMemo as Is } from "react";
3
+ import { s as n, B as A, $ as hs, a0 as $s, a1 as K, R as G, a2 as gs, E as ws, O as x, y as ys, i as Ts, f as bs, e as Cs, N as R, u as fs, d as ks, c as Ns, h as qs } from "./provider.js";
4
4
  import "nanostores";
5
5
  import "lodash.throttle";
6
6
  import "react-dom";
7
7
  import "react-countup";
8
- import { h as v, Q as I, i as H, j as L, S as Es, A as O } from "./useStreamLayerApp2.js";
8
+ import { j as v, Q as h, k as H, l as L, S as Es, A as O } from "./useStreamLayerApp2.js";
9
9
  const b = /* @__PURE__ */ n("div")({
10
10
  name: "Media",
11
11
  class: "m1bcvojl",
@@ -105,7 +105,7 @@ const b = /* @__PURE__ */ n("div")({
105
105
  return /* @__PURE__ */ l(Hs, { children: [
106
106
  p && /* @__PURE__ */ s(_s, { children: /* @__PURE__ */ s(Ks, { children: p }) }),
107
107
  /* @__PURE__ */ s(
108
- Is,
108
+ hs,
109
109
  {
110
110
  image: e,
111
111
  name: (d = i == null ? void 0 : i.meta) == null ? void 0 : d.accountName,
@@ -133,13 +133,13 @@ const b = /* @__PURE__ */ n("div")({
133
133
  if (!d || !t || !t.notification)
134
134
  return null;
135
135
  const { title: m, image: u, imageMode: $ } = t.notification;
136
- let h = u;
137
- i === I.TWEET && a != null && a.tweetMedia && (h = a.tweetMedia.image), $ === v.NONE && (h = "");
138
- const g = t.useMediaFromContent && (o == null ? void 0 : o.image), c = i === I.TWEET && ((p = a == null ? void 0 : a.tweetMedia) == null ? void 0 : p.video) || i === I.FACTOID && (o == null ? void 0 : o.video);
139
- return /* @__PURE__ */ s(Vs, { "data-a": "intr", className: "SL_InApp", onClick: e, children: /* @__PURE__ */ l(zs, { style: h ? {} : { paddingLeft: "1.5rem" }, children: [
140
- h && !g && /* @__PURE__ */ s(j, { src: h, imageMode: $, withVideo: !!c }),
136
+ let I = u;
137
+ i === h.TWEET && a != null && a.tweetMedia && (I = a.tweetMedia.image), $ === v.NONE && (I = "");
138
+ const g = t.useMediaFromContent && (o == null ? void 0 : o.image), c = i === h.TWEET && ((p = a == null ? void 0 : a.tweetMedia) == null ? void 0 : p.video) || i === h.FACTOID && (o == null ? void 0 : o.video);
139
+ return /* @__PURE__ */ s(Vs, { "data-a": "intr", className: "SL_InApp", onClick: e, children: /* @__PURE__ */ l(zs, { style: I ? {} : { paddingLeft: "1.5rem" }, children: [
140
+ I && !g && /* @__PURE__ */ s(j, { src: I, imageMode: $, withVideo: !!c }),
141
141
  g && /* @__PURE__ */ s(j, { src: g, fromInsight: !0, withVideo: !!c }),
142
- i === I.TWEET ? /* @__PURE__ */ s(Zs, { tweet: a }) : /* @__PURE__ */ s(Xs, { questionTypeData: d, questionType: i, title: m }),
142
+ i === h.TWEET ? /* @__PURE__ */ s(Zs, { tweet: a }) : /* @__PURE__ */ s(Xs, { questionTypeData: d, questionType: i, title: m }),
143
143
  /* @__PURE__ */ s(Qs, { name: "inapp-button", children: r || "Open" }),
144
144
  /* @__PURE__ */ s(Ys, { name: "chevronRight" })
145
145
  ] }) });
@@ -184,7 +184,7 @@ const b = /* @__PURE__ */ n("div")({
184
184
  name: "MediaNone",
185
185
  class: "mqfzyyr",
186
186
  propsAsIs: !0
187
- }), Ae = "v170mtgf", he = {
187
+ }), Ae = "v170mtgf", Ie = {
188
188
  [v.UNSET]: S,
189
189
  [v.NONE]: S,
190
190
  [v.ROUNDED]: pe,
@@ -204,7 +204,7 @@ const b = /* @__PURE__ */ n("div")({
204
204
  color: o,
205
205
  children: /* @__PURE__ */ s(S, {})
206
206
  });
207
- const d = a === L.ENABLED ? re : he[i];
207
+ const d = a === L.ENABLED ? re : Ie[i];
208
208
  return /* @__PURE__ */ s(B, {
209
209
  color: o,
210
210
  children: t ? /* @__PURE__ */ s(te, {
@@ -220,14 +220,14 @@ const b = /* @__PURE__ */ n("div")({
220
220
  })
221
221
  })
222
222
  });
223
- }, Ie = () => ({
223
+ }, he = () => ({
224
224
  withoutPadding: e
225
225
  }) => e ? "0px" : "1rem", X = /* @__PURE__ */ n("div")({
226
226
  name: "NotificationContent",
227
227
  class: "n1p3bk1c",
228
228
  propsAsIs: !1,
229
229
  vars: {
230
- "n1p3bk1c-0": [Ie()]
230
+ "n1p3bk1c-0": [he()]
231
231
  }
232
232
  }), $e = /* @__PURE__ */ n("div")({
233
233
  name: "MainContent",
@@ -243,7 +243,7 @@ const b = /* @__PURE__ */ n("div")({
243
243
  propsAsIs: !1
244
244
  }), ye = () => ({
245
245
  questionType: e
246
- }) => e === I.FACTOID ? "7.3rem" : "4.5rem", Te = () => ({
246
+ }) => e === h.FACTOID ? "7.3rem" : "4.5rem", Te = () => ({
247
247
  webos: e
248
248
  }) => e ? "11px 0px 8px 0px" : "11px 0px", be = () => ({
249
249
  imageMode: e,
@@ -332,20 +332,20 @@ const b = /* @__PURE__ */ n("div")({
332
332
  webos: d
333
333
  }) => {
334
334
  var r, m, u;
335
- const [$, h] = w(!1), g = _();
336
- y(() => (o != null && o.sponsorLogo && (h(!0), g.current = setTimeout(() => {
337
- h(!1);
335
+ const [$, I] = w(!1), g = _();
336
+ y(() => (o != null && o.sponsorLogo && (I(!0), g.current = setTimeout(() => {
337
+ I(!1);
338
338
  }, 5e3)), () => clearTimeout(g.current)), [o == null ? void 0 : o.sponsorLogo]);
339
339
  const c = G[t];
340
340
  if (!c || !o || !o.notification)
341
341
  return null;
342
- const { title: ds, image: ps, imageMode: f, useContentMedia: k } = o.notification, ms = t === I.FACTOID ? a == null ? void 0 : a.heading : ds, us = t === I.FACTOID ? a == null ? void 0 : a.body : "", vs = ps, N = t === I.FACTOID && ((r = a == null ? void 0 : a.video) == null ? void 0 : r.url) && (o == null ? void 0 : o.isVideo) && k === L.ENABLED, q = k === L.ENABLED ? N ? (m = a == null ? void 0 : a.video) == null ? void 0 : m.url : a == null ? void 0 : a.image : "";
342
+ const { title: ds, image: ps, imageMode: f, useContentMedia: k } = o.notification, ms = t === h.FACTOID ? a == null ? void 0 : a.heading : ds, us = t === h.FACTOID ? a == null ? void 0 : a.body : "", vs = ps, N = t === h.FACTOID && ((r = a == null ? void 0 : a.video) == null ? void 0 : r.url) && (o == null ? void 0 : o.isVideo) && k === L.ENABLED, q = k === L.ENABLED ? N ? (m = a == null ? void 0 : a.video) == null ? void 0 : m.url : a == null ? void 0 : a.image : "";
343
343
  return o != null && o.sponsorLogo && $ ? /* @__PURE__ */ s(
344
344
  Fe,
345
345
  {
346
346
  sponsorLogo: o == null ? void 0 : o.sponsorLogo,
347
347
  webos: d,
348
- onClick: () => h(!1)
348
+ onClick: () => I(!1)
349
349
  }
350
350
  ) : /* @__PURE__ */ l(
351
351
  Z,
@@ -355,7 +355,7 @@ const b = /* @__PURE__ */ n("div")({
355
355
  onClick: (C) => {
356
356
  d || e == null || e(C);
357
357
  },
358
- "data-is-insight": t === I.FACTOID,
358
+ "data-is-insight": t === h.FACTOID,
359
359
  "data-webos": d,
360
360
  children: [
361
361
  (o == null ? void 0 : o.sponsorLogo) && /* @__PURE__ */ s(Se, { children: /* @__PURE__ */ s(ss, { src: o == null ? void 0 : o.sponsorLogo }) }),
@@ -563,7 +563,7 @@ const b = /* @__PURE__ */ n("div")({
563
563
  name: "Line1",
564
564
  class: "le78kvg",
565
565
  propsAsIs: !0
566
- }), hn = () => D, In = /* @__PURE__ */ n(hn())({
566
+ }), In = () => D, hn = /* @__PURE__ */ n(In())({
567
567
  name: "Line2",
568
568
  class: "l1o7966d",
569
569
  propsAsIs: !0
@@ -574,7 +574,7 @@ const b = /* @__PURE__ */ n("div")({
574
574
  }), wn = () => /* @__PURE__ */ l(un, {
575
575
  children: [/* @__PURE__ */ s(An, {
576
576
  children: /* @__PURE__ */ s("div", {})
577
- }), /* @__PURE__ */ s(In, {
577
+ }), /* @__PURE__ */ s(hn, {
578
578
  children: /* @__PURE__ */ s("div", {})
579
579
  }), /* @__PURE__ */ s(gn, {
580
580
  children: /* @__PURE__ */ s("div", {})
@@ -879,7 +879,7 @@ const b = /* @__PURE__ */ n("div")({
879
879
  1: 3e3,
880
880
  2: 4e3,
881
881
  3: 4e3
882
- }, ho = ({ close: e, action: i, setStep: t, votedAnswer: o, correct: a, correctAnswerTitle: p, questionTitle: d, step: r }) => {
882
+ }, Io = ({ close: e, action: i, setStep: t, votedAnswer: o, correct: a, correctAnswerTitle: p, questionTitle: d, step: r }) => {
883
883
  if (y(() => {
884
884
  if (t) {
885
885
  const u = setTimeout(() => {
@@ -902,10 +902,10 @@ const b = /* @__PURE__ */ n("div")({
902
902
  r === 3 && !a && /* @__PURE__ */ s(Ao, { title: p || "unknown", answer: (o == null ? void 0 : o.title) || "unknown" })
903
903
  ] })
904
904
  ] }) });
905
- }, Io = ({ close: e, action: i, votedAnswer: t, correct: o, correctAnswerTitle: a, questionTitle: p }) => {
905
+ }, ho = ({ close: e, action: i, votedAnswer: t, correct: o, correctAnswerTitle: a, questionTitle: p }) => {
906
906
  const [d, r] = w(1);
907
907
  return /* @__PURE__ */ s(
908
- ho,
908
+ Io,
909
909
  {
910
910
  close: e,
911
911
  action: i,
@@ -953,11 +953,11 @@ const b = /* @__PURE__ */ n("div")({
953
953
  }, 5e3)), () => clearTimeout(m.current);
954
954
  }, [(i = e == null ? void 0 : e.inApp) == null ? void 0 : i.sponsorLogo]), (t = e == null ? void 0 : e.inApp) != null && t.sponsorLogo && d ? /* @__PURE__ */ s(bo, { sponsorLogo: (o = e.inApp) == null ? void 0 : o.sponsorLogo, onClick: () => r(!1) }) : /* @__PURE__ */ s(cs, { children: /* @__PURE__ */ l("div", { children: [
955
955
  ((a = e == null ? void 0 : e.inApp) == null ? void 0 : a.sponsorLogo) && /* @__PURE__ */ s(To, { children: /* @__PURE__ */ s(ls, { src: (p = e == null ? void 0 : e.inApp) == null ? void 0 : p.sponsorLogo }) }),
956
- /* @__PURE__ */ s(Io, { ...e })
956
+ /* @__PURE__ */ s(ho, { ...e })
957
957
  ] }) });
958
958
  }, fo = ({ sdk: e, webos: i }) => {
959
959
  var t, o, a, p, d, r, m, u;
960
- const [$] = w(e.getNotificationsStore()), h = bs($), g = e.getFeature(Es.GAMES), c = hs(() => e.getActiveNotification(), [e, h]);
960
+ const [$] = w(e.getNotificationsStore()), I = bs($), g = e.getFeature(Es.GAMES), c = Is(() => e.getActiveNotification(), [e, I]);
961
961
  return y(() => {
962
962
  c && Cs.emit("notification", {
963
963
  action: "rendered",
@@ -966,7 +966,7 @@ const b = /* @__PURE__ */ n("div")({
966
966
  questionType: c.data.questionType
967
967
  }
968
968
  });
969
- }, [c]), c && c.type === R.QUESTION_RESOLVED ? c.data.question && c.data.questionType === I.PREDICTION ? c && ((t = c.data.inApp) == null ? void 0 : t.adUnit) === O.STANDART ? /* @__PURE__ */ s(
969
+ }, [c]), c && c.type === R.QUESTION_RESOLVED ? c.data.question && c.data.questionType === h.PREDICTION ? c && ((t = c.data.inApp) == null ? void 0 : t.adUnit) === O.STANDART ? /* @__PURE__ */ s(
970
970
  Co,
971
971
  {
972
972
  action: c.action,
@@ -4,7 +4,7 @@ var p1 = (e, t, n) => Nn(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import { jsx as a, jsxs as g, Fragment as d1 } from "react/jsx-runtime";
5
5
  import * as d from "react";
6
6
  import H1, { useState as Z, useEffect as j, useRef as l1, createContext as R6, useContext as Y1, useCallback as o1, useMemo as f1, useLayoutEffect as $6, forwardRef as F3, memo as Dn, Component as qn, createElement as Bn, PureComponent as Pn, lazy as Zn, Suspense as Kn } from "react";
7
- import { S as A1, Q as S, k as Un, h as U1, i as i2, A as S6, f as jn, e as L3, I as k6, l as zn, m as x2, u as Gn } from "./useStreamLayerApp2.js";
7
+ import { S as A1, a as j1, m as ct, Q as S, n as Un, j as U1, k as i2, A as S6, h as jn, g as L3, I as k6, o as zn, p as x2, u as Gn } from "./useStreamLayerApp2.js";
8
8
  import { listenKeys as Wn } from "nanostores";
9
9
  import { pino as Qn } from "pino";
10
10
  import I3 from "lodash.throttle";
@@ -13,8 +13,6 @@ import { createPortal as O2 } from "react-dom";
13
13
  import Yn from "react-countup";
14
14
  import Xn from "react-infinite-scroller";
15
15
  import "uuid";
16
- import { Code as j1, createContextKey as ct } from "@connectrpc/connect";
17
- import "@connectrpc/connect-web";
18
16
  import "@nanostores/query";
19
17
  const Jn = Qn({
20
18
  level: "trace",
@@ -3488,7 +3486,7 @@ const ys = (e) => /* @__PURE__ */ d.createElement("svg", { width: 24, height: 24
3488
3486
  [S.POLL]: { label: "Poll", iconName: "icon-poll" },
3489
3487
  [S.TRIVIA]: { label: "Trivia", iconName: "icon-trivia" },
3490
3488
  [S.PREDICTION]: { label: "Prediction", iconName: "icon-prediction" }
3491
- }, Mf = {
3489
+ }, Sf = {
3492
3490
  [S.TWEET]: "Learn more",
3493
3491
  [S.FACTOID]: "Learn more",
3494
3492
  [S.POLL]: "Answer",
@@ -6122,7 +6120,7 @@ const Qd = /* @__PURE__ */ c("div")({
6122
6120
  }) => {
6123
6121
  const n = e + t;
6124
6122
  return n === 0 ? 0 : Math.round(e / n * 100);
6125
- }, Ff = ({
6123
+ }, kf = ({
6126
6124
  gamification: e,
6127
6125
  scrollStore: t,
6128
6126
  className: n,
@@ -7564,7 +7562,7 @@ const Qd = /* @__PURE__ */ c("div")({
7564
7562
  n({ ...r });
7565
7563
  }) : () => {
7566
7564
  }, [e == null ? void 0 : e.uiState]), t;
7567
- }, Vf = ({ event: e, topNavigation: t, theme: n, muted: r, withSidebarNotification: i = !0 }) => {
7565
+ }, Mf = ({ event: e, topNavigation: t, theme: n, muted: r, withSidebarNotification: i = !0 }) => {
7568
7566
  const { sdk: s, status: o } = Y1(X1), l = hf(), u = Cf(), { event: p } = Y1(X1);
7569
7567
  if (o === M3.UNSET)
7570
7568
  throw new Error("Wrap app in `StreamLayerProvider`");
@@ -7582,7 +7580,7 @@ var M3 = /* @__PURE__ */ ((e) => (e[e.UNSET = 0] = "UNSET", e[e.CONNECTED = 1] =
7582
7580
  const vf = {
7583
7581
  status: 0,
7584
7582
  sdk: null
7585
- }, X1 = R6(vf), Of = ({
7583
+ }, X1 = R6(vf), Ff = ({
7586
7584
  sdkKey: e,
7587
7585
  theme: t,
7588
7586
  themeMode: n,
@@ -7654,7 +7652,7 @@ export {
7654
7652
  f6 as P,
7655
7653
  VC as Q,
7656
7654
  z2 as R,
7657
- Of as S,
7655
+ Ff as S,
7658
7656
  Ed as T,
7659
7657
  D7 as U,
7660
7658
  T1 as V,
@@ -7666,13 +7664,13 @@ export {
7666
7664
  ff as a,
7667
7665
  hd as a0,
7668
7666
  qu as a1,
7669
- Mf as a2,
7670
- Vf as b,
7667
+ Sf as a2,
7668
+ Mf as b,
7671
7669
  hf as c,
7672
7670
  Cf as d,
7673
7671
  b2 as e,
7674
7672
  J as f,
7675
- Ff as g,
7673
+ kf as g,
7676
7674
  df as h,
7677
7675
  tt as i,
7678
7676
  l2 as j,