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