@streamlayer/react-ui 0.27.3 → 0.28.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 (33) hide show
  1. package/lib/fedex-a8dcc7b2.js +4 -0
  2. package/lib/index.js +30 -29
  3. package/lib/ui/app/Features/FeatureProvider.js +14 -0
  4. package/lib/ui/app/Features/Gamification/Leaderboard.js +48 -0
  5. package/lib/ui/app/Features/Gamification/Question.js +102 -0
  6. package/lib/ui/app/Features/Gamification/QuestionsList.js +16 -0
  7. package/lib/ui/app/Features/Gamification/Tabs.js +47 -0
  8. package/lib/ui/app/Features/Gamification/UserSummary.js +17 -0
  9. package/lib/ui/app/Features/Gamification/index.js +67 -0
  10. package/lib/ui/app/Features/Highlights/Insight.js +31 -0
  11. package/lib/ui/app/Features/Highlights/Insights.js +16 -0
  12. package/lib/ui/app/Features/Highlights/index.js +33 -0
  13. package/lib/ui/app/Features/index.js +64 -0
  14. package/lib/ui/app/Navigation/index.js +31 -0
  15. package/lib/ui/app/Notifications/index.js +18 -0
  16. package/lib/ui/app/index.js +88 -0
  17. package/lib/ui/app/styles.js +8 -0
  18. package/lib/ui/app/useSdkFeature.js +24 -0
  19. package/lib/ui/demo/DemoPoints.js +14 -14
  20. package/lib/ui/demo/Gamification.js +3 -2
  21. package/lib/ui/demo/Highlights.js +3 -2
  22. package/lib/ui/demo/components/Question.js +50 -49
  23. package/lib/ui/demo/components/index.js +15 -14
  24. package/lib/ui/demo/index.js +3 -2
  25. package/lib/ui/navigation/index.js +13 -0
  26. package/lib/ui/navigation/styles.js +46 -0
  27. package/lib/utils/components/developer.js +19 -19
  28. package/lib/utils/components/envToggle.js +4 -4
  29. package/lib/utils/components/eventInput.js +10 -10
  30. package/lib/utils/components/sdkKey.js +10 -3
  31. package/lib/utils/createDemo.js +33 -20
  32. package/lib/utils/decorators/styles.js +3 -7
  33. package/package.json +6 -6
@@ -1,9 +1,9 @@
1
- import { jsx as t, jsxs as f, Fragment as k } from "react/jsx-runtime";
2
- import { anonymous as g } from "@streamlayer/sdk-web-anonymous-auth";
3
- import { useMemo as p, useState as d } from "react";
4
- import { Developer as S } from "./components/developer.js";
5
- import { useStreamLayerApp as v } from "./useStreamLayerApp.js";
6
- import { DeveloperStorage as y } from "./storage.js";
1
+ import { jsx as e, jsxs as S, Fragment as g } from "react/jsx-runtime";
2
+ import { anonymous as y } from "@streamlayer/sdk-web-anonymous-auth";
3
+ import { useMemo as d, useState as m, useEffect as E } from "react";
4
+ import { Developer as l } from "./components/developer.js";
5
+ import { useStreamLayerApp as D } from "./useStreamLayerApp.js";
6
+ import { DeveloperStorage as w } from "./storage.js";
7
7
  import "@linaria/react";
8
8
  import "./components/eventInput.js";
9
9
  import "@streamlayer/sdk-web-core";
@@ -14,27 +14,40 @@ import "./components/sdkKey.js";
14
14
  import "./components/envToggle.js";
15
15
  import "@streamlayer/sdk-web";
16
16
  import "@streamlayer/sdk-web-storage";
17
- function l({
18
- Component: r,
19
- Story: o,
20
- args: D
17
+ function x({
18
+ Component: o,
19
+ Story: r,
20
+ args: u
21
21
  }) {
22
- const m = p(() => new y(), []), [n, c] = d(m.getEnv()), [s, a] = d(m.getSdkKey() || "set-sdk-key"), u = p(() => {
23
- const i = /* @__PURE__ */ new Set();
24
- return i.add(g), i;
25
- }, []), e = v(s, u, n === "production");
26
- return /* @__PURE__ */ f(k, { children: [
27
- e ? /* @__PURE__ */ t(r, { Story: o, sdk: e }) : /* @__PURE__ */ t("div", { children: "wait sdk..." }),
28
- /* @__PURE__ */ t(S, { sdk: e, sdkKey: s, setSdkKey: a, env: n, setEnv: c })
22
+ const n = d(() => new w(), []), [i, a] = m(n.getEnv()), [p, f] = m(n.getSdkKey() || "set-sdk-key"), [s, v] = m(n.getEvent() || ""), k = d(() => {
23
+ const c = /* @__PURE__ */ new Set();
24
+ return c.add(y), c;
25
+ }, []), t = D(p, k, i === "production");
26
+ return E(() => {
27
+ s && t && t.createEventSession(s);
28
+ }, [t]), /* @__PURE__ */ S(g, { children: [
29
+ t ? /* @__PURE__ */ e(o, { Story: r, sdk: t, args: u }) : /* @__PURE__ */ e("div", { children: "wait sdk..." }),
30
+ /* @__PURE__ */ e(
31
+ l,
32
+ {
33
+ sdk: t,
34
+ sdkKey: p,
35
+ setSdkKey: f,
36
+ env: i,
37
+ setEnv: a,
38
+ event: s,
39
+ setEvent: v
40
+ }
41
+ )
29
42
  ] });
30
43
  }
31
- function H(r) {
44
+ function N(o) {
32
45
  return {
33
46
  decorators: [
34
- (o) => /* @__PURE__ */ t(l, { Story: o, Component: r })
47
+ (r) => /* @__PURE__ */ e(x, { Story: r, Component: o })
35
48
  ]
36
49
  };
37
50
  }
38
51
  export {
39
- H as createDemo
52
+ N as createDemo
40
53
  };