@streamlayer/react 1.17.1 → 1.18.0

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 (54) hide show
  1. package/lib/app/advertisement.d.ts +1 -0
  2. package/lib/app/app.d.ts +3 -0
  3. package/lib/app/provider.d.ts +4 -1
  4. package/lib/app/useStreamLayerApp.d.ts +2 -1
  5. package/lib/cjs/advertisement.js +36 -36
  6. package/lib/cjs/gamification-feature.js +1 -1
  7. package/lib/cjs/index2.js +2 -2
  8. package/lib/cjs/insight.js +1 -1
  9. package/lib/cjs/masters2.js +3 -3
  10. package/lib/cjs/notification.js +1 -1
  11. package/lib/cjs/points.js +1 -1
  12. package/lib/cjs/provider.js +62 -19
  13. package/lib/cjs/useStreamLayerApp2.js +15 -15
  14. package/lib/classic/app/advertisement.d.ts +1 -0
  15. package/lib/classic/app/app.d.ts +3 -0
  16. package/lib/classic/app/provider.d.ts +4 -1
  17. package/lib/classic/app/useStreamLayerApp.d.ts +2 -1
  18. package/lib/classic/cjs/advertisement.js +36 -36
  19. package/lib/classic/cjs/bet-pack.js +2 -2
  20. package/lib/classic/cjs/gamification-feature.js +1 -1
  21. package/lib/classic/cjs/insight.js +1 -1
  22. package/lib/classic/cjs/notification.js +1 -1
  23. package/lib/classic/cjs/points.js +1 -1
  24. package/lib/classic/cjs/provider.js +57 -14
  25. package/lib/classic/cjs/useStreamLayerApp2.js +15 -15
  26. package/lib/classic/es/advertisement.js +6778 -6620
  27. package/lib/classic/es/bet-pack.js +245 -245
  28. package/lib/classic/es/gamification-feature.js +1 -1
  29. package/lib/classic/es/index.js +3 -3
  30. package/lib/classic/es/insight.js +41 -38
  31. package/lib/classic/es/notification.js +739 -230
  32. package/lib/classic/es/points.js +10 -10
  33. package/lib/classic/es/provider.js +7285 -4829
  34. package/lib/classic/es/useStreamLayerApp.js +1 -1
  35. package/lib/classic/es/useStreamLayerApp2.js +4007 -3787
  36. package/lib/dist/cjs/gamification-feature2.js +1 -1
  37. package/lib/dist/cjs/masters.js +47 -43
  38. package/lib/dist/es/gamification-feature2.js +15 -15
  39. package/lib/dist/es/index.js +3 -3
  40. package/lib/dist/es/masters.js +14631 -12156
  41. package/lib/dist/style.css +1 -1
  42. package/lib/es/advertisement.js +6778 -6620
  43. package/lib/es/gamification-feature.js +1 -1
  44. package/lib/es/index.js +1 -1
  45. package/lib/es/index2.js +362 -362
  46. package/lib/es/insight.js +41 -38
  47. package/lib/es/masters2.js +28 -26
  48. package/lib/es/notification.js +739 -230
  49. package/lib/es/points.js +10 -10
  50. package/lib/es/provider.js +7162 -4706
  51. package/lib/es/useStreamLayerApp.js +1 -1
  52. package/lib/es/useStreamLayerApp2.js +4007 -3787
  53. package/lib/style.css +1 -1
  54. package/package.json +14 -14
@@ -1,4 +1,4 @@
1
- import { P as f } from "./provider.js";
1
+ import { g as f } from "./provider.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,11 +1,11 @@
1
- import { r as m, S, t as o, h as i, u as s, b as y, o as L } from "./provider.js";
1
+ import { v as m, S, w as o, h as i, u as s, b as y, p as L } from "./provider.js";
2
2
  import "react/jsx-runtime";
3
3
  import "react";
4
- import { StreamLayerSDKNotification as p, StreamLayerSDKNotificationUI as u } from "./notification.js";
4
+ import { StreamLayerSDKNotification as f, StreamLayerSDKNotificationUI as u } from "./notification.js";
5
5
  export {
6
6
  m as StreamLayerProvider,
7
7
  S as StreamLayerSDKEvent,
8
- p as StreamLayerSDKNotification,
8
+ f as StreamLayerSDKNotification,
9
9
  u as StreamLayerSDKNotificationUI,
10
10
  o as StreamLayerSDKReact,
11
11
  i as StreamLayerThemeProvider,
@@ -1,72 +1,75 @@
1
- import { jsx as u, jsxs as c } from "react/jsx-runtime";
2
- import { useRef as l, useEffect as h } from "react";
3
- import { a as m, s as p, z as f, u as S, b as I, h as g, S as v } from "./provider.js";
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";
4
4
  import { S as y } from "./useStreamLayerApp2.js";
5
- const Q = () => f, b = /* @__PURE__ */ p(Q())({
5
+ const Q = () => S, b = /* @__PURE__ */ f(Q())({
6
6
  name: "QuestionWrap",
7
7
  class: "q10hhsxv",
8
8
  propsAsIs: !0
9
- }), k = ({
9
+ }), L = ({
10
10
  gamification: e,
11
- persistent: r,
12
- skipAutoClose: n,
11
+ sdk: n,
12
+ persistent: i,
13
+ skipAutoClose: a,
13
14
  hideHeader: o,
14
- insightId: s
15
+ insightId: t
15
16
  }) => {
16
- const t = l(""), d = m(e.openedQuestion.$store);
17
- return h(() => s ? (!r || e.isOpenedQuestion(s) || (t.current = s, e.getFeedItem(s).then((i) => {
18
- var a;
19
- t.current === s && ((a = i == null ? void 0 : i.attributes) == null ? void 0 : a.attributes.case) === "insight" && e.openQuestion(s, i);
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) => {
19
+ var d;
20
+ r.current === t && ((d = s == null ? void 0 : s.attributes) == null ? void 0 : d.attributes.case) === "insight" && e.openQuestion(t, s);
20
21
  })), () => {
21
- t.current = "";
22
+ r.current = "";
22
23
  }) : (e.activeQuestionId.subscribe(({
23
- data: i
24
+ data: s
24
25
  }) => {
25
- var a;
26
- i && ((a = i.feedItem) == null ? void 0 : a.type) === "insight" && (!r || e.isOpenedQuestion(i.feedItem.id) || (t.current = i.feedItem.id, e.openQuestion(i.feedItem.id, i.feedItem))), !i && t.current && (e.closeQuestion(t.current), t.current = "");
26
+ 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 = "");
27
28
  }), () => {
28
- }), [e, r, s]), d ? /* @__PURE__ */ u(b, {
29
- skipAutoClose: n,
29
+ }), [e, i, t]), c ? /* @__PURE__ */ u(b, {
30
+ sdk: n,
31
+ skipAutoClose: a,
30
32
  hideHeader: o,
31
33
  gamification: e,
32
34
  hideSponsor: !0
33
35
  }) : null;
34
36
  }, A = ({
35
37
  sdk: e,
36
- persistent: r,
37
- skipAutoClose: n,
38
- insightId: o,
39
- hideHeader: s
38
+ persistent: n,
39
+ skipAutoClose: i,
40
+ insightId: a,
41
+ hideHeader: o
40
42
  }) => {
41
43
  if (!m(e.featuresList.getStore()))
42
44
  return null;
43
45
  const t = e.getFeature(y.GAMES);
44
- return t ? /* @__PURE__ */ u(k, {
45
- insightId: o,
46
- persistent: r,
47
- hideHeader: s,
46
+ return t ? /* @__PURE__ */ u(L, {
47
+ insightId: a,
48
+ sdk: e,
49
+ persistent: n,
50
+ hideHeader: o,
48
51
  gamification: t,
49
- skipAutoClose: n
52
+ skipAutoClose: i
50
53
  }) : null;
51
54
  }, H = ({
52
55
  event: e,
53
- theme: r,
54
- hideHeader: n,
55
- skipAutoClose: o,
56
- persistent: s
56
+ theme: n,
57
+ hideHeader: i,
58
+ skipAutoClose: a,
59
+ persistent: o
57
60
  }) => {
58
- const t = S(), d = I();
59
- return t ? /* @__PURE__ */ c("div", { className: "StreamLayerSDK", children: [
60
- /* @__PURE__ */ u(g, { customTheme: r ?? d.theme, themeMode: d.themeMode, children: /* @__PURE__ */ u(
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(
61
64
  A,
62
65
  {
63
- skipAutoClose: o,
66
+ skipAutoClose: a,
64
67
  sdk: t,
65
- hideHeader: n,
66
- persistent: s
68
+ hideHeader: i,
69
+ persistent: o
67
70
  }
68
71
  ) }),
69
- e !== void 0 && /* @__PURE__ */ u(v, { event: e })
72
+ e !== void 0 && /* @__PURE__ */ u(k, { event: e })
70
73
  ] }) : null;
71
74
  };
72
75
  export {