@streamlayer/react 1.14.1 → 1.14.3

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 (45) hide show
  1. package/lib/cjs/advertisement.js +45 -45
  2. package/lib/cjs/gamification-feature2.js +1 -1
  3. package/lib/cjs/index2.js +5 -5
  4. package/lib/cjs/masters2.js +2 -2
  5. package/lib/cjs/notification.js +1 -1
  6. package/lib/cjs/points.js +1 -1
  7. package/lib/cjs/provider.js +13 -13
  8. package/lib/cjs/useStreamLayerApp2.js +7 -7
  9. package/lib/classic/cjs/advertisement.js +45 -45
  10. package/lib/classic/cjs/gamification-feature2.js +1 -1
  11. package/lib/classic/cjs/index2.js +5 -5
  12. package/lib/classic/cjs/masters2.js +2 -2
  13. package/lib/classic/cjs/notification.js +1 -1
  14. package/lib/classic/cjs/points.js +1 -1
  15. package/lib/classic/cjs/provider.js +13 -13
  16. package/lib/classic/cjs/useStreamLayerApp2.js +7 -7
  17. package/lib/classic/es/advertisement.js +37691 -39689
  18. package/lib/classic/es/gamification-feature2.js +1 -1
  19. package/lib/classic/es/index.js +1 -1
  20. package/lib/classic/es/index2.js +899 -902
  21. package/lib/classic/es/masters2.js +264 -241
  22. package/lib/classic/es/notification.js +40 -40
  23. package/lib/classic/es/points.js +5 -5
  24. package/lib/classic/es/provider.js +2406 -2387
  25. package/lib/classic/es/useStreamLayerApp2.js +1448 -1446
  26. package/lib/classic/style.css +1 -1
  27. package/lib/dist/cjs/gamification-feature.js +1 -1
  28. package/lib/dist/cjs/gamification-feature2.js +1 -1
  29. package/lib/dist/cjs/masters.js +29 -29
  30. package/lib/dist/es/gamification-feature.js +1 -1
  31. package/lib/dist/es/gamification-feature2.js +45 -45
  32. package/lib/dist/es/index.js +3 -3
  33. package/lib/dist/es/masters.js +5393 -5353
  34. package/lib/dist/style.css +1 -1
  35. package/lib/es/advertisement.js +37691 -39689
  36. package/lib/es/gamification-feature2.js +1 -1
  37. package/lib/es/index.js +1 -1
  38. package/lib/es/index2.js +899 -902
  39. package/lib/es/masters2.js +264 -241
  40. package/lib/es/notification.js +40 -40
  41. package/lib/es/points.js +5 -5
  42. package/lib/es/provider.js +2404 -2385
  43. package/lib/es/useStreamLayerApp2.js +1448 -1446
  44. package/lib/style.css +1 -1
  45. package/package.json +14 -14
@@ -1,16 +1,16 @@
1
- import { c as u, s, X as L, Z as O, _ as R, C as B, $ as P, O as Q, e as U, a as V, f as F, N as C, u as W, b as _, Q as G, h as K } from "./provider.js";
2
- import { k as m, Q as A, l as Y, S as X } from "./useStreamLayerApp2.js";
1
+ import { k as u, s, Z as L, _ as R, $ as B, C as O, a0 as P, Q, d as U, a as V, e as F, N as k, u as W, b as _, T as G, h as K } from "./provider.js";
2
+ import { k as m, Q as A, l as Y, S as Z } from "./useStreamLayerApp2.js";
3
3
  import { jsxs as c, jsx as e } from "react/jsx-runtime";
4
- import { useState as y, useCallback as Z, useMemo as E, useEffect as x } from "react";
4
+ import { useState as y, useCallback as H, useMemo as E, useEffect as x } from "react";
5
5
  const $ = /* @__PURE__ */ s("div")({
6
6
  name: "Media",
7
7
  class: "m1bcvojl",
8
8
  propsAsIs: !1
9
- }), H = () => $, J = /* @__PURE__ */ s(H())({
9
+ }), J = () => $, X = /* @__PURE__ */ s(J())({
10
10
  name: "MediaImgBottom",
11
11
  class: "m58gin0",
12
12
  propsAsIs: !0
13
- }), ee = () => $, N = /* @__PURE__ */ s(ee())({
13
+ }), ee = () => $, C = /* @__PURE__ */ s(ee())({
14
14
  name: "MediaImgSolid",
15
15
  class: "m1atm8do",
16
16
  propsAsIs: !0
@@ -31,12 +31,12 @@ const $ = /* @__PURE__ */ s("div")({
31
31
  class: "v1kofb47",
32
32
  propsAsIs: !1
33
33
  }), re = {
34
- [m.UNSET]: N,
35
- [m.NONE]: N,
34
+ [m.UNSET]: C,
35
+ [m.NONE]: C,
36
36
  [m.ROUNDED]: ne,
37
37
  [m.CENTERED]: oe,
38
- [m.TRANSPARENT]: J
39
- }, b = ({
38
+ [m.TRANSPARENT]: X
39
+ }, N = ({
40
40
  src: t,
41
41
  imageMode: o = m.UNSET,
42
42
  withVideo: i,
@@ -109,11 +109,11 @@ const $ = /* @__PURE__ */ s("div")({
109
109
  createdTweet: o == null ? void 0 : o.date
110
110
  }
111
111
  ),
112
- /* @__PURE__ */ e(Ae, { children: O(n) })
112
+ /* @__PURE__ */ e(Ae, { children: R(n) })
113
113
  ] });
114
114
  }, fe = ({ title: t, questionType: o, questionTypeData: i }) => /* @__PURE__ */ c(M, { children: [
115
115
  /* @__PURE__ */ e(
116
- R,
116
+ B,
117
117
  {
118
118
  questionTypeData: i,
119
119
  questionType: o,
@@ -124,7 +124,7 @@ const $ = /* @__PURE__ */ s("div")({
124
124
  ] }), ge = ({ tweet: t }) => t ? /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(ye, { ...t, controlVideo: () => {
125
125
  } }) }) : null, Te = ({ action: t, questionType: o, inApp: i, insight: a, tweet: n }) => {
126
126
  var d;
127
- const l = B[o], r = P[o];
127
+ const l = O[o], r = P[o];
128
128
  if (!l || !i || !i.notification)
129
129
  return null;
130
130
  const { title: p, image: I, imageMode: v } = i.notification;
@@ -132,25 +132,25 @@ const $ = /* @__PURE__ */ s("div")({
132
132
  o === A.TWEET && n != null && n.tweetMedia && (h = n.tweetMedia.image), v === m.NONE && (h = "");
133
133
  const f = i.useMediaFromContent && (a == null ? void 0 : a.image), T = o === A.TWEET && ((d = n == null ? void 0 : n.tweetMedia) == null ? void 0 : d.video) || o === A.FACTOID && (a == null ? void 0 : a.video);
134
134
  return /* @__PURE__ */ e(de, { className: "SL_InApp", onClick: t, children: /* @__PURE__ */ c(le, { style: h ? {} : { paddingLeft: "1.5rem" }, children: [
135
- h && !f && /* @__PURE__ */ e(b, { src: h, imageMode: v, withVideo: !!T }),
136
- f && /* @__PURE__ */ e(b, { src: f, fromInsight: !0, withVideo: !!T }),
135
+ h && !f && /* @__PURE__ */ e(N, { src: h, imageMode: v, withVideo: !!T }),
136
+ f && /* @__PURE__ */ e(N, { src: f, fromInsight: !0, withVideo: !!T }),
137
137
  o === A.TWEET ? /* @__PURE__ */ e(ge, { tweet: n }) : /* @__PURE__ */ e(fe, { questionTypeData: l, questionType: o, title: p }),
138
138
  /* @__PURE__ */ e(me, { name: "inapp-button", children: r || "Open" }),
139
139
  /* @__PURE__ */ e(Ie, { name: "chevronRight" })
140
140
  ] }) });
141
- }, Ce = /* @__PURE__ */ s("div")({
141
+ }, ke = /* @__PURE__ */ s("div")({
142
142
  name: "NotificationContainer",
143
143
  class: "n11jcrxe",
144
144
  propsAsIs: !1
145
- }), k = /* @__PURE__ */ s("img")({
145
+ }), b = /* @__PURE__ */ s("img")({
146
146
  name: "Icon",
147
147
  class: "i1vmpt6u",
148
148
  propsAsIs: !1
149
- }), Ne = /* @__PURE__ */ s("div")({
149
+ }), Ce = /* @__PURE__ */ s("div")({
150
150
  name: "IconContainer",
151
151
  class: "i180665s",
152
152
  propsAsIs: !1
153
- }), be = () => u, ke = /* @__PURE__ */ s(be())({
153
+ }), Ne = () => u, be = /* @__PURE__ */ s(Ne())({
154
154
  name: "TitleIcon",
155
155
  class: "t16zzzei",
156
156
  propsAsIs: !0
@@ -181,16 +181,16 @@ const $ = /* @__PURE__ */ s("div")({
181
181
  }) => {
182
182
  var a, n;
183
183
  return /* @__PURE__ */ c(
184
- Ce,
184
+ ke,
185
185
  {
186
186
  onClick: () => {
187
187
  t == null || t(), i && (i.instantOpen = !0);
188
188
  },
189
189
  children: [
190
- /* @__PURE__ */ c(Ne, { children: [
191
- /* @__PURE__ */ e(k, { className: "on-light", src: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification.png" }),
190
+ /* @__PURE__ */ c(Ce, { children: [
191
+ /* @__PURE__ */ e(b, { className: "on-light", src: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification.png" }),
192
192
  /* @__PURE__ */ e(
193
- k,
193
+ b,
194
194
  {
195
195
  className: "on-dark",
196
196
  src: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification-dark.png"
@@ -199,7 +199,7 @@ const $ = /* @__PURE__ */ s("div")({
199
199
  ] }),
200
200
  /* @__PURE__ */ c(qe, { children: [
201
201
  /* @__PURE__ */ c(Ee, { children: [
202
- /* @__PURE__ */ e(ke, { name: "icon-trophy-solid" }),
202
+ /* @__PURE__ */ e(be, { name: "icon-trophy-solid" }),
203
203
  (a = i == null ? void 0 : i.titleCard) == null ? void 0 : a.title
204
204
  ] }),
205
205
  /* @__PURE__ */ c(xe, { children: [
@@ -226,11 +226,11 @@ const $ = /* @__PURE__ */ s("div")({
226
226
  name: "CheckIcon",
227
227
  class: "c1mo15kk",
228
228
  propsAsIs: !0
229
- }), Oe = () => u, Re = /* @__PURE__ */ s(Oe())({
229
+ }), Re = () => u, Be = /* @__PURE__ */ s(Re())({
230
230
  name: "PredictionIcon",
231
231
  class: "p16zkqnm",
232
232
  propsAsIs: !0
233
- }), Be = /* @__PURE__ */ s("div")({
233
+ }), Oe = /* @__PURE__ */ s("div")({
234
234
  name: "PredictionIconContainer",
235
235
  class: "pjszi7a",
236
236
  propsAsIs: !1
@@ -255,14 +255,14 @@ const $ = /* @__PURE__ */ s("div")({
255
255
  const [n, d] = y(0), [l] = y(() => new ResizeObserver((p) => {
256
256
  var I, v;
257
257
  d((v = (I = p == null ? void 0 : p[0]) == null ? void 0 : I.contentRect) == null ? void 0 : v.width);
258
- })), r = Z((p) => {
258
+ })), r = H((p) => {
259
259
  p || l.disconnect(), l.observe(p);
260
260
  }, [l]);
261
261
  return E(() => () => {
262
262
  l.disconnect();
263
263
  }, [l]), /* @__PURE__ */ c(ze, {
264
- children: [/* @__PURE__ */ e(Be, {
265
- children: /* @__PURE__ */ e(Re, {
264
+ children: [/* @__PURE__ */ e(Oe, {
265
+ children: /* @__PURE__ */ e(Be, {
266
266
  name: "icon-prediction"
267
267
  })
268
268
  }), /* @__PURE__ */ e(Pe, {
@@ -298,27 +298,27 @@ const $ = /* @__PURE__ */ s("div")({
298
298
  name: "Line2",
299
299
  class: "l1o7966d",
300
300
  propsAsIs: !0
301
- }), Ye = () => g, Xe = /* @__PURE__ */ s(Ye())({
301
+ }), Ye = () => g, Ze = /* @__PURE__ */ s(Ye())({
302
302
  name: "Line3",
303
303
  class: "lu9lyxq",
304
304
  propsAsIs: !0
305
- }), Ze = () => /* @__PURE__ */ c(Fe, {
305
+ }), He = () => /* @__PURE__ */ c(Fe, {
306
306
  children: [/* @__PURE__ */ e(_e, {
307
307
  children: /* @__PURE__ */ e("div", {})
308
308
  }), /* @__PURE__ */ e(Ke, {
309
309
  children: /* @__PURE__ */ e("div", {})
310
- }), /* @__PURE__ */ e(Xe, {
310
+ }), /* @__PURE__ */ e(Ze, {
311
311
  children: /* @__PURE__ */ e("div", {})
312
312
  })]
313
- }), He = /* @__PURE__ */ s("div")({
313
+ }), Je = /* @__PURE__ */ s("div")({
314
314
  name: "Container",
315
315
  class: "c10jy6zf",
316
316
  propsAsIs: !1
317
- }), Je = () => u, es = /* @__PURE__ */ s(Je())({
317
+ }), Xe = () => u, es = /* @__PURE__ */ s(Xe())({
318
318
  name: "CheckIcon",
319
319
  class: "c1c7scay",
320
320
  propsAsIs: !0
321
- }), ss = () => /* @__PURE__ */ c(He, {
321
+ }), ss = () => /* @__PURE__ */ c(Je, {
322
322
  children: [/* @__PURE__ */ e(es, {
323
323
  name: "icon-check"
324
324
  }), " Prediction results are in!"]
@@ -426,7 +426,7 @@ const $ = /* @__PURE__ */ s("div")({
426
426
  return /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(S, { children: /* @__PURE__ */ e(ss, {}) }) });
427
427
  let p = "pending";
428
428
  return (r === 3 || r === 4) && (p = n ? "correct" : "incorrect"), /* @__PURE__ */ e(w, { onClick: () => o == null ? void 0 : o(), children: /* @__PURE__ */ c(S, { children: [
429
- r !== 1 && /* @__PURE__ */ e(Ze, {}, r),
429
+ r !== 1 && /* @__PURE__ */ e(He, {}, r),
430
430
  /* @__PURE__ */ c(Ve, { state: p, step: r, answer: (a == null ? void 0 : a.title) || "unknown", children: [
431
431
  r === 2 && /* @__PURE__ */ e(is, { title: l || "unknown" }),
432
432
  r === 3 && n && /* @__PURE__ */ e(ls, {}),
@@ -455,7 +455,7 @@ const $ = /* @__PURE__ */ s("div")({
455
455
  class: "n1i4h28u",
456
456
  propsAsIs: !1
457
457
  }), ys = (t) => /* @__PURE__ */ e($s, { children: /* @__PURE__ */ e(As, { ...t }) }), fs = ({ sdk: t }) => {
458
- const [o] = y(t.getNotificationsStore()), i = V(o), a = t.getFeature(X.GAMES), n = E(() => t.getActiveNotification(), [t, i]);
458
+ const [o] = y(t.getNotificationsStore()), i = V(o), a = t.getFeature(Z.GAMES), n = E(() => t.getActiveNotification(), [t, i]);
459
459
  return x(() => {
460
460
  n && F.emit("notification", {
461
461
  action: "rendered",
@@ -464,19 +464,19 @@ const $ = /* @__PURE__ */ s("div")({
464
464
  questionType: n.data.questionType
465
465
  }
466
466
  });
467
- }, [n]), n && n.type === C.QUESTION_RESOLVED ? n.data.question && n.data.questionType === A.PREDICTION ? /* @__PURE__ */ e(
467
+ }, [n]), n && n.type === k.QUESTION_RESOLVED ? n.data.question && n.data.questionType === A.PREDICTION ? /* @__PURE__ */ e(
468
468
  ys,
469
469
  {
470
470
  action: n.action,
471
471
  close: n.close,
472
472
  ...n.data.question
473
473
  }
474
- ) : null : n && n.type === C.ONBOARDING ? n.data.onboarding ? /* @__PURE__ */ e(je, { open: a == null ? void 0 : a.openFeature, close: n.close, ...n.data.onboarding }) : null : n && /* @__PURE__ */ e(Te, { ...n.data, action: n.action });
475
- }, bs = ({ theme: t }) => {
474
+ ) : null : n && n.type === k.ONBOARDING ? n.data.onboarding ? /* @__PURE__ */ e(je, { open: a == null ? void 0 : a.openFeature, close: n.close, ...n.data.onboarding }) : null : n && /* @__PURE__ */ e(Te, { ...n.data, action: n.action });
475
+ }, Ns = ({ theme: t }) => {
476
476
  const o = W(), i = _(), a = G();
477
477
  return o && (a.appNotification || a.onboardingNotification) ? a.app && !a.onboardingNotification ? null : /* @__PURE__ */ e("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ e(K, { customTheme: t ?? i.theme, themeMode: i.themeMode, children: /* @__PURE__ */ e(fs, { sdk: o }) }) }) : null;
478
478
  };
479
479
  export {
480
- bs as StreamLayerSDKNotification,
480
+ Ns as StreamLayerSDKNotification,
481
481
  fs as StreamLayerSDKNotificationUI
482
482
  };
@@ -1,7 +1,7 @@
1
1
  import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
2
  import { useState as u, useEffect as d } from "react";
3
- import { s as a, c as h, d as y, e as S, a as f, F as c, f as p, u as v, b as g, h as b } from "./provider.js";
4
- import { S as k } from "./useStreamLayerApp2.js";
3
+ import { s as a, k as h, c as y, d as S, a as f, F as c, e as p, u as v, b as k, h as g } from "./provider.js";
4
+ import { S as b } from "./useStreamLayerApp2.js";
5
5
  const A = /* @__PURE__ */ a("div")({
6
6
  name: "PointsContainer",
7
7
  class: "psiob9b",
@@ -55,11 +55,11 @@ const A = /* @__PURE__ */ a("div")({
55
55
  }, M = ({ sdk: s }) => {
56
56
  if (!f(s.featuresList.getStore()))
57
57
  return null;
58
- const e = s.getFeature(k.GAMES);
58
+ const e = s.getFeature(b.GAMES);
59
59
  return e ? /* @__PURE__ */ t(j, { gamification: e }) : null;
60
60
  }, K = ({ theme: s }) => {
61
- const e = v(), o = g();
62
- return e ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(b, { customTheme: s ?? o.theme, themeMode: o.themeMode, children: /* @__PURE__ */ t(M, { sdk: e }) }) }) : null;
61
+ const e = v(), o = k();
62
+ return e ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(g, { customTheme: s ?? o.theme, themeMode: o.themeMode, children: /* @__PURE__ */ t(M, { sdk: e }) }) }) : null;
63
63
  };
64
64
  export {
65
65
  K as StreamLayerSDKPoints