@streamlayer/react 1.24.7 → 1.24.8-pre.84ab1b9

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 (50) hide show
  1. package/lib/app/advertisement.d.ts +4 -0
  2. package/lib/app/pause-ad.d.ts +17 -0
  3. package/lib/cjs/advertisement.js +1491 -1441
  4. package/lib/cjs/auth.js +80 -80
  5. package/lib/cjs/bet-pack.js +279 -242
  6. package/lib/cjs/index.js +1828 -1770
  7. package/lib/cjs/insight.js +682 -620
  8. package/lib/cjs/masters.js +1401 -1362
  9. package/lib/cjs/notification.js +292 -261
  10. package/lib/cjs/pause-ad.js +592 -362
  11. package/lib/cjs/points.js +179 -148
  12. package/lib/cjs/polymarket.js +153 -152
  13. package/lib/cjs/style.css +1 -1
  14. package/lib/cjs/useStreamLayerApp.js +142 -148
  15. package/lib/dist/cjs/index.js +1401 -1362
  16. package/lib/dist/es/index.js +1401 -1362
  17. package/lib/es/Question.js +75 -72
  18. package/lib/es/advertisement.js +9236 -8213
  19. package/lib/es/analytics.js +35 -31
  20. package/lib/es/auth.js +1 -1
  21. package/lib/es/bet-pack.js +1 -1
  22. package/lib/es/{hooks-n9ax4LRT.js → hooks-DHRXtbBc.js} +35 -33
  23. package/lib/es/{index-D8wyDNJD.js → index-BW1YFKTb.js} +35 -35
  24. package/lib/es/index.js +2 -2
  25. package/lib/es/index10.js +6 -6
  26. package/lib/es/index12.js +116 -128
  27. package/lib/es/index13.js +100 -96
  28. package/lib/es/index14.js +15 -15
  29. package/lib/es/index16.js +382 -383
  30. package/lib/es/index2.js +55 -56
  31. package/lib/es/index4.js +3 -3
  32. package/lib/es/index5.js +275 -3
  33. package/lib/es/index6.js +4 -7
  34. package/lib/es/index7.js +5 -284
  35. package/lib/es/index8.js +8 -237
  36. package/lib/es/index9.js +237 -8
  37. package/lib/es/insight.js +3 -3
  38. package/lib/es/masters.js +1 -1
  39. package/lib/es/masters2.js +29 -29
  40. package/lib/es/notification.js +28 -28
  41. package/lib/es/pause-ad.js +362 -153
  42. package/lib/es/points.js +9 -9
  43. package/lib/es/polymarket.js +40 -40
  44. package/lib/es/storage.js +18 -18
  45. package/lib/es/style.css +1 -1
  46. package/lib/es/useStreamLayerApp.js +1 -1
  47. package/lib/es/useStreamLayerApp2.js +5169 -4933
  48. package/lib/es/utils.js +86 -41
  49. package/lib/source.css +1 -1
  50. package/package.json +14 -14
@@ -1,135 +1,138 @@
1
1
  import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
- import { s as l, u as p } from "./feature.js";
3
- import { createContext as E, useContext as N, useRef as k, useEffect as q, useState as $ } from "react";
4
- import { O as C, d as D, f as L, a as R } from "./index12.js";
2
+ import { s as u, u as c } from "./feature.js";
3
+ import { createContext as E, useContext as N, useRef as $, useEffect as q, useState as C } from "react";
4
+ import { O as D, d as L, f as O, a as R } from "./index12.js";
5
5
  import { Q as V, Z as F } from "./index13.js";
6
- import { y as P } from "./utils.js";
7
- import { Q as A, A as Q } from "./useStreamLayerApp2.js";
6
+ import { k as P } from "./utils.js";
7
+ import { Q, A as T } from "./useStreamLayerApp2.js";
8
8
  const j = E({
9
9
  sdk: null,
10
10
  topNavigation: !1
11
- }), H = () => N(j), O = /* @__PURE__ */ l("div")({
11
+ }), M = () => N(j), Z = /* @__PURE__ */ u("div")({
12
12
  name: "QuestionAdvertisementContainer",
13
13
  class: "qwludgs",
14
14
  propsAsIs: !1
15
- }), Z = /* @__PURE__ */ l("div")({
15
+ }), B = /* @__PURE__ */ u("div")({
16
16
  name: "QuestionAdvertisementText",
17
17
  class: "qvce6pv",
18
18
  propsAsIs: !1
19
- }), _ = /* @__PURE__ */ l("div")({
19
+ }), H = /* @__PURE__ */ u("div")({
20
20
  name: "QuestionAdvertisementImage",
21
21
  class: "qsid7hx",
22
22
  propsAsIs: !1
23
- }), B = ({
23
+ }), Y = ({
24
24
  sponsorLogo: e,
25
- id: a,
26
- setAdShowed: n
25
+ id: s,
26
+ setAdShowed: a
27
27
  }) => {
28
- const s = k();
29
- return q(() => (s.current = setTimeout(() => {
30
- n(!0);
28
+ const i = $();
29
+ return q(() => (i.current = setTimeout(() => {
30
+ a(!0);
31
31
  }, 5e3), () => {
32
- clearTimeout(s.current);
33
- }), [n, a]), /* @__PURE__ */ m(O, {
34
- children: [/* @__PURE__ */ t(Z, {
32
+ clearTimeout(i.current);
33
+ }), [a, s]), /* @__PURE__ */ m(Z, {
34
+ children: [/* @__PURE__ */ t(B, {
35
35
  children: "PRESENTED BY"
36
- }), /* @__PURE__ */ t(_, {
36
+ }), /* @__PURE__ */ t(H, {
37
37
  children: /* @__PURE__ */ t("img", {
38
38
  src: e,
39
39
  alt: "ad-sponsor-logo"
40
40
  })
41
41
  })]
42
42
  });
43
- }, h = /* @__PURE__ */ l("div")({
43
+ }, h = /* @__PURE__ */ u("div")({
44
44
  name: "QuestionContainer",
45
45
  class: "q14ckf9e",
46
46
  propsAsIs: !1
47
- }), Y = ({
47
+ }), _ = ({
48
48
  openedQuestion: e,
49
- muted: a,
50
- webos: n
49
+ muted: s,
50
+ webos: a,
51
+ factoidMode: i
51
52
  }) => {
52
53
  const {
53
- sdk: s
54
- } = H();
55
- return e?.attributes?.attributes.case === "insight" ? /* @__PURE__ */ t(L, {
54
+ sdk: n
55
+ } = M();
56
+ return e?.attributes?.attributes.case === "insight" ? /* @__PURE__ */ t(O, {
56
57
  ...e.attributes.attributes.value,
57
- muted: a,
58
- controlVideo: s?.controlVideoPlayer,
59
- webos: n,
58
+ muted: s,
59
+ controlVideo: n?.controlVideoPlayer,
60
+ webos: a,
60
61
  questionId: e.id,
61
62
  fireEvent: e.fireEvent,
62
- isEventFired: e.isEventFired
63
+ isEventFired: e.isEventFired,
64
+ mode: i
63
65
  }) : e?.attributes?.attributes.case === "tweet" ? /* @__PURE__ */ t(R, {
64
66
  ...e.attributes.attributes.value,
65
- muted: a,
66
- controlVideo: s?.controlVideoPlayer
67
+ muted: s,
68
+ controlVideo: n?.controlVideoPlayer
67
69
  }) : null;
68
70
  }, z = ({
69
71
  extendedQuestion: e,
70
- vote: a,
71
- close: n,
72
- webos: s
72
+ vote: s,
73
+ close: a,
74
+ webos: i
73
75
  }) => {
74
76
  const {
75
- loading: u,
76
- data: r
77
+ loading: n,
78
+ data: d
77
79
  } = e;
78
- return r ? /* @__PURE__ */ t(V, {
79
- webos: s,
80
- vote: a,
81
- close: n,
82
- openedQuestion: r,
83
- isLoading: !!u
80
+ return d ? /* @__PURE__ */ t(V, {
81
+ webos: i,
82
+ vote: s,
83
+ close: a,
84
+ openedQuestion: d,
85
+ isLoading: !!n
84
86
  }) : /* @__PURE__ */ t(F, {});
85
- }, oe = ({
87
+ }, te = ({
86
88
  gamification: e,
87
- sdk: a,
88
- muted: n,
89
- skipAutoClose: s,
90
- hideSponsor: u,
91
- className: r,
89
+ sdk: s,
90
+ muted: a,
91
+ skipAutoClose: i,
92
+ hideSponsor: n,
93
+ className: d,
92
94
  hideHeader: w,
93
- webos: c
95
+ webos: p
94
96
  }) => {
95
- const i = p(e.openedQuestion.$store), o = p(e.openedQuestion.$extendedStore), [T, I] = $(!1), U = p(a.options), f = i?.attributes?.type === A.FACTOID, b = i?.attributes?.backgroundImage, d = o.data?.backgroundImage, S = f ? b?.landscapeUrl ?? d?.landscapeUrl : d?.landscapeUrl, x = f ? b?.portraitUrl ?? d?.portraitUrl : d?.portraitUrl, v = P({
96
- containerId: U.containerId,
97
- landscapeUrl: S,
98
- portraitUrl: x
97
+ const r = c(e.openedQuestion.$store), o = c(e.openedQuestion.$extendedStore), [I, U] = C(!1), S = c(s.options), f = r?.attributes?.type === Q.FACTOID, b = r?.attributes?.backgroundImage, l = o.data?.backgroundImage, x = f ? b?.landscapeUrl ?? l?.landscapeUrl : l?.landscapeUrl, k = f ? b?.portraitUrl ?? l?.portraitUrl : l?.portraitUrl, v = P({
98
+ containerId: S.containerId,
99
+ landscapeUrl: x,
100
+ portraitUrl: k
99
101
  });
100
- if (!i || !o.data)
102
+ if (!r || !o.data)
101
103
  return null;
102
- const g = i.type, y = o.data?.options?.options.case === "factoid" ? o.data.options.options.value.closeTimer : void 0;
103
- return o.data && (o.data.adUnit === Q.STANDART || o.data.promotion?.adUnit === Q.STANDART) && !T ? /* @__PURE__ */ m(h, {
104
- className: r,
105
- children: [v, /* @__PURE__ */ t(B, {
104
+ const g = r.type, A = o.data?.options?.options.case === "factoid" ? o.data.options.options.value : void 0, y = A?.closeTimer;
105
+ return o.data && (o.data.adUnit === T.STANDART || o.data.promotion?.adUnit === T.STANDART) && !I ? /* @__PURE__ */ m(h, {
106
+ className: d,
107
+ children: [v, /* @__PURE__ */ t(Y, {
106
108
  id: o.data.id,
107
- setAdShowed: I,
109
+ setAdShowed: U,
108
110
  sponsorLogo: o.data.promotion?.sponsor?.logo || o.data.sponsorship?.logo || ""
109
111
  })]
110
112
  }) : /* @__PURE__ */ m(h, {
111
- className: r,
112
- children: [v, !w && /* @__PURE__ */ t(C, {
113
- closeTimer: s ? void 0 : y,
113
+ className: d,
114
+ children: [v, !w && /* @__PURE__ */ t(D, {
115
+ closeTimer: i ? void 0 : y,
114
116
  close: e.closeQuestion,
115
- type: i.attributes?.type || A.UNSET,
116
- webos: c
117
+ type: r.attributes?.type || Q.UNSET,
118
+ webos: p
117
119
  }), g === "question" && /* @__PURE__ */ t(z, {
118
- webos: c,
120
+ webos: p,
119
121
  vote: e.submitAnswer,
120
122
  close: e.closeQuestion,
121
123
  extendedQuestion: o
122
- }), g !== "question" && /* @__PURE__ */ t(Y, {
123
- muted: n,
124
- openedQuestion: i,
125
- webos: c
126
- }), !u && /* @__PURE__ */ t(D, {
124
+ }), g !== "question" && /* @__PURE__ */ t(_, {
125
+ muted: a,
126
+ openedQuestion: r,
127
+ webos: p,
128
+ factoidMode: A?.mode
129
+ }), !n && /* @__PURE__ */ t(L, {
127
130
  sponsorLogo: o.data?.promotion?.sponsor?.logo || o.data?.sponsorship?.logo
128
131
  })]
129
132
  });
130
133
  };
131
134
  export {
132
- oe as _,
133
135
  j as e,
134
- H as p
136
+ M as p,
137
+ te as t
135
138
  };