@streamlayer/react 1.4.0 → 1.5.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.
@@ -0,0 +1,61 @@
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())({
6
+ name: "QuestionWrap",
7
+ class: "q10hhsxv",
8
+ propsAsIs: !0
9
+ }), L = ({
10
+ gamification: e,
11
+ persistent: i,
12
+ hideHeader: a,
13
+ insightId: t
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);
18
+ })), () => {
19
+ s.current = "";
20
+ }) : (e.activeQuestionId.subscribe(({
21
+ data: r
22
+ }) => {
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 = "");
25
+ }), () => {
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
+ })
35
+ }) : null;
36
+ }, x = ({
37
+ sdk: e,
38
+ persistent: i,
39
+ insightId: a,
40
+ hideHeader: t
41
+ }) => {
42
+ if (!u(e.featuresList.getStore()))
43
+ 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
50
+ }) : 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 })
56
+ ] }) : null;
57
+ };
58
+ export {
59
+ b as StreamLayerSDKInsight,
60
+ x as StreamLayerSDKInsightUI
61
+ };
package/lib/es/masters.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import { M as o, a as s } from "./masters2.js";
3
3
  import "react";
4
- import "./provider.js";
4
+ import "./index2.js";
5
5
  export {
6
6
  o as MastersStreamLayerProvider,
7
7
  s as MastersStreamLayerSDKReact
@@ -1,5 +1,5 @@
1
1
  import { jsx as n, jsxs as L, Fragment as E } from "react/jsx-runtime";
2
- import { u as C, F as r2, s as u, T as j, i as i2, p as a2, b as l2, N as d2, k as c2, M as p2, f as u2, S as C2, C as v2, g as h2, O as K, m as x, l as m2, h as g2, j as L2, n as X, o as f2, q as S2, r as y2, t as U, w as k2, x as J, y as _, I as e2, a as P, z as N2, A as b2, B as z, D as A2, E as I2, G as $2, e as E2, H as T, J as q, K as V2, P as w2, R as R2, c as H2, U as Q, V as T2, W as x2, L as F, X as F2, Y as D2, Z as M2, _ as O2, v as D, $ as U2, a0 as _2, a1 as P2, a2 as B2, a3 as G2 } from "./provider.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, 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";
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,60 +1,59 @@
1
- import { jsxs as a, jsx as r } from "react/jsx-runtime";
2
- import { useState as u, useEffect as c } from "react";
3
- import { s as t, a as m, v as d, d as S, u as f, F as v } from "./provider.js";
4
- import { u as y, d as h } from "./index2.js";
1
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
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";
5
4
  import { S as g } from "./useStreamLayerApp2.js";
6
- const A = /* @__PURE__ */ t("div")({
5
+ const A = /* @__PURE__ */ n("div")({
7
6
  name: "PointsContainer",
8
7
  class: "psiob9b",
9
8
  propsAsIs: !1
10
- }), I = /* @__PURE__ */ t("div")({
9
+ }), I = /* @__PURE__ */ n("div")({
11
10
  name: "PointsIcon",
12
11
  class: "p1gqe4lh",
13
12
  propsAsIs: !1
14
- }), P = () => m, k = /* @__PURE__ */ t(P())({
13
+ }), P = () => m, k = /* @__PURE__ */ n(P())({
15
14
  name: "PointsSvg",
16
15
  class: "p15syg2y",
17
16
  propsAsIs: !0
18
- }), b = /* @__PURE__ */ t("div")({
17
+ }), b = /* @__PURE__ */ n("div")({
19
18
  name: "PointsBody",
20
19
  class: "p12n4f2h",
21
20
  propsAsIs: !1
22
- }), x = /* @__PURE__ */ t("div")({
21
+ }), x = /* @__PURE__ */ n("div")({
23
22
  name: "PointsTitle",
24
23
  class: "poqmx89",
25
24
  propsAsIs: !1
26
- }), C = /* @__PURE__ */ t("div")({
25
+ }), C = /* @__PURE__ */ n("div")({
27
26
  name: "PointsValue",
28
27
  class: "prj9b3v",
29
28
  propsAsIs: !1
30
- }), F = ({ points: s, onClick: e }) => /* @__PURE__ */ a(A, { className: d, onClick: e, children: [
31
- /* @__PURE__ */ r(I, { children: /* @__PURE__ */ r(k, { name: "icon-trophy" }) }),
32
- /* @__PURE__ */ a(b, { children: [
33
- /* @__PURE__ */ r(x, { children: "Total points" }),
34
- /* @__PURE__ */ r(C, { children: /* @__PURE__ */ r(S, { value: s }) })
29
+ }), F = ({ points: s, onClick: r }) => /* @__PURE__ */ o(A, { className: d, onClick: r, children: [
30
+ /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(k, { name: "icon-trophy" }) }),
31
+ /* @__PURE__ */ o(b, { children: [
32
+ /* @__PURE__ */ e(x, { children: "Total points" }),
33
+ /* @__PURE__ */ e(C, { children: /* @__PURE__ */ e(S, { value: s }) })
35
34
  ] })
36
35
  ] }), L = ({ gamification: s }) => {
37
- const e = s.userSummary.$store, [i, l] = u(0);
38
- return c(() => {
39
- const p = e.subscribe((n) => {
40
- var o;
41
- (o = n == null ? void 0 : n.summary) != null && o.points && l(n.summary.points);
36
+ const r = s.userSummary.$store, [i, l] = p(0);
37
+ return u(() => {
38
+ const c = r.subscribe((t) => {
39
+ var a;
40
+ (a = t == null ? void 0 : t.summary) != null && a.points && l(t.summary.points);
42
41
  });
43
42
  return () => {
44
- p();
43
+ c();
45
44
  };
46
- }, [e]), /* @__PURE__ */ r(F, { points: i, onClick: () => {
45
+ }, [r]), /* @__PURE__ */ e(F, { points: i, onClick: () => {
47
46
  s.status.get() === v.Suspended && s.openFeature();
48
47
  } });
49
48
  }, $ = ({ sdk: s }) => {
50
49
  if (!f(s.featuresList.getStore()))
51
50
  return null;
52
- const e = s.getFeature(g.GAMES);
53
- return e ? /* @__PURE__ */ r(L, { gamification: e }) : null;
54
- }, K = () => {
51
+ const r = s.getFeature(g.GAMES);
52
+ return r ? /* @__PURE__ */ e(L, { gamification: r }) : null;
53
+ }, E = () => {
55
54
  const s = y();
56
- return s ? /* @__PURE__ */ r("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ r(h, { children: /* @__PURE__ */ r($, { sdk: s }) }) }) : null;
55
+ return s ? /* @__PURE__ */ e("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e($, { sdk: s }) }) }) : null;
57
56
  };
58
57
  export {
59
- K as StreamLayerSDKPoints
58
+ E as StreamLayerSDKPoints
60
59
  };