@streamlayer/react-ui 0.98.1 → 0.100.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 (129) hide show
  1. package/lib/assets/style.css +1 -1
  2. package/lib/hooks/showIn.js +45 -0
  3. package/lib/{index-jRXrW6ie.js → index-Bicco-Aq.js} +1 -1
  4. package/lib/{index-z0QjLiEL.js → index-CZvwzN5o.js} +1 -1
  5. package/lib/index.js +4 -8
  6. package/lib/ui/app/Features/Gamification/Friends.js +10 -23
  7. package/lib/ui/app/Features/Gamification/Leaderboard.d.ts +1 -2
  8. package/lib/ui/app/Features/Gamification/Leaderboard.js +37 -54
  9. package/lib/ui/app/Features/Gamification/Question.js +33 -65
  10. package/lib/ui/app/Features/Gamification/QuestionsList.js +8 -34
  11. package/lib/ui/app/Features/Gamification/Tabs.d.ts +1 -2
  12. package/lib/ui/app/Features/Gamification/Tabs.js +30 -97
  13. package/lib/ui/app/Features/Gamification/UserSummary.js +12 -21
  14. package/lib/ui/app/Features/Gamification/gamification-feature.js +2 -93
  15. package/lib/ui/app/Features/Gamification/index.d.ts +1 -2
  16. package/lib/ui/app/Features/Gamification/index.js +68 -143
  17. package/lib/ui/app/Features/index.d.ts +1 -2
  18. package/lib/ui/app/Features/index.js +20 -109
  19. package/lib/ui/app/Navigation/MastersNavigation/index.js +16 -22
  20. package/lib/ui/app/Navigation/index.js +9 -12
  21. package/lib/ui/app/Notifications/Onboarding/Notification/index.js +13 -16
  22. package/lib/ui/app/Notifications/Onboarding/Notification/styles.js +18 -20
  23. package/lib/ui/app/Notifications/Onboarding/index.js +45 -72
  24. package/lib/ui/app/Notifications/index.js +96 -148
  25. package/lib/ui/app/Notifications/styles.js +10 -15
  26. package/lib/ui/app/Points/index.js +18 -26
  27. package/lib/ui/app/masters.js +71 -190
  28. package/lib/ui/app/useClipboardCopy.js +11 -15
  29. package/lib/ui/app/useMastersApp.js +34 -44
  30. package/lib/ui/app/useSdkResponsive.js +18 -19
  31. package/lib/ui/app/useSdkScroll.js +28 -26
  32. package/lib/ui/button/index.js +3 -4
  33. package/lib/ui/gamification/copyNotification/index.js +5 -7
  34. package/lib/ui/gamification/detail/header/index.js +15 -18
  35. package/lib/ui/gamification/detail/header/styles.js +12 -14
  36. package/lib/ui/gamification/detail/sponsor/index.js +2 -3
  37. package/lib/ui/gamification/insight/index.js +5 -6
  38. package/lib/ui/gamification/insight-list/index.js +3 -6
  39. package/lib/ui/gamification/invite-link/index.js +11 -17
  40. package/lib/ui/gamification/invite-link/styles.js +13 -15
  41. package/lib/ui/gamification/leaderboard/index.js +21 -28
  42. package/lib/ui/gamification/leaderboard/list-item/index.d.ts +0 -1
  43. package/lib/ui/gamification/leaderboard/list-item/index.js +17 -20
  44. package/lib/ui/gamification/leaderboard/list-item/styles.js +16 -18
  45. package/lib/ui/gamification/leaderboard/static.js +34 -31
  46. package/lib/ui/gamification/leaderboard/styles.js +1 -1
  47. package/lib/ui/gamification/onboarding/index.js +51 -73
  48. package/lib/ui/gamification/onboarding/invitingUser/index.js +10 -11
  49. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +3 -2
  50. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.js +17 -20
  51. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.d.ts +2 -0
  52. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.js +21 -11
  53. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +21 -30
  54. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/styles.js +22 -24
  55. package/lib/ui/gamification/onboarding/slides/onboarding-rules/index.js +5 -7
  56. package/lib/ui/gamification/onboarding/slides/onboarding-terms/index.js +2 -3
  57. package/lib/ui/gamification/onboarding/styles.js +14 -17
  58. package/lib/ui/gamification/points/index.js +9 -15
  59. package/lib/ui/gamification/points/styles.js +12 -14
  60. package/lib/ui/gamification/question/index.d.ts +1 -3
  61. package/lib/ui/gamification/question/index.js +29 -34
  62. package/lib/ui/gamification/question/insight/index.d.ts +0 -1
  63. package/lib/ui/gamification/question/insight/index.js +7 -15
  64. package/lib/ui/gamification/question/list/index.js +20 -57
  65. package/lib/ui/gamification/question/notification/index.js +22 -35
  66. package/lib/ui/gamification/question/notification/insight/index.js +12 -17
  67. package/lib/ui/gamification/question/notification/pill/index.js +7 -9
  68. package/lib/ui/gamification/question/notification/prediction-result/animation-lines/index.js +11 -12
  69. package/lib/ui/gamification/question/notification/prediction-result/index.js +45 -51
  70. package/lib/ui/gamification/question/notification/prediction-result/styles.js +23 -26
  71. package/lib/ui/gamification/question/notification/styles.js +17 -19
  72. package/lib/ui/gamification/question/notification/tweet/index.js +8 -18
  73. package/lib/ui/gamification/question/styles.js +32 -34
  74. package/lib/ui/gamification/question/twitter/index.d.ts +0 -1
  75. package/lib/ui/gamification/question/twitter/index.js +8 -20
  76. package/lib/ui/gamification/question/twitter/styles.js +4 -6
  77. package/lib/ui/gamification/tabs/index.js +6 -7
  78. package/lib/ui/gamification/user-statistics/components/rank/index.js +4 -5
  79. package/lib/ui/gamification/user-statistics/components/statistic/index.js +0 -1
  80. package/lib/ui/gamification/user-statistics/index.js +2 -6
  81. package/lib/ui/gamification/vote/alert/index.d.ts +8 -0
  82. package/lib/ui/gamification/vote/alert/index.js +11 -0
  83. package/lib/ui/gamification/vote/{expired-alert → alert}/styles.js +7 -7
  84. package/lib/ui/gamification/vote/feedback/index.js +29 -33
  85. package/lib/ui/gamification/vote/feedback/styles.js +20 -23
  86. package/lib/ui/gamification/vote/index.d.ts +1 -0
  87. package/lib/ui/gamification/vote/index.js +123 -117
  88. package/lib/ui/gamification/vote/insight-details/index.js +9 -16
  89. package/lib/ui/gamification/vote/styles.d.ts +1 -0
  90. package/lib/ui/gamification/vote/styles.js +14 -8
  91. package/lib/ui/gamification/vote/twitter-details/index.js +7 -17
  92. package/lib/ui/gamification/vote/vote-option/index.js +38 -41
  93. package/lib/ui/gamification/vote/vote-option/styles.d.ts +1 -0
  94. package/lib/ui/gamification/vote/vote-option/styles.js +35 -32
  95. package/lib/ui/gamification/vote/win-bar/index.js +29 -37
  96. package/lib/ui/gamification/vote/win-bar/styles.js +16 -19
  97. package/lib/ui/login/demo.d.ts +1 -0
  98. package/lib/ui/login/demo.js +5 -17
  99. package/lib/ui/login/index.js +29 -35
  100. package/lib/ui/modal/index.js +31 -32
  101. package/lib/ui/navigation/button/Channels.js +5 -8
  102. package/lib/ui/navigation/button/FeaturedGroups.js +3 -6
  103. package/lib/ui/navigation/button/LeaderBoard.js +8 -11
  104. package/lib/ui/navigation/button/index.js +10 -11
  105. package/lib/ui/navigation/masters.js +2 -3
  106. package/lib/ui/questions/insight/index.js +14 -19
  107. package/lib/ui/questions/twitter/account/index.js +13 -15
  108. package/lib/ui/questions/twitter/account/styles.js +14 -16
  109. package/lib/ui/questions/twitter/index.js +31 -38
  110. package/lib/ui/show-in/index.d.ts +1 -0
  111. package/lib/ui/show-in/index.js +12 -10
  112. package/lib/ui/skeleton/index.js +3 -4
  113. package/lib/ui/theme/index.js +3 -5
  114. package/lib/ui/video-player/index.js +44 -38
  115. package/lib/utils/createDemo.js +18 -28
  116. package/lib/utils/debug/components/copyLogs.js +2 -3
  117. package/lib/utils/debug/components/developer.js +20 -24
  118. package/lib/utils/debug/components/eventInput.js +9 -10
  119. package/lib/utils/debug/components/sdkKey.js +9 -10
  120. package/lib/utils/debug/index.js +17 -28
  121. package/lib/utils/debug/storage.js +32 -14
  122. package/lib/utils/decorators/container.js +5 -9
  123. package/lib/utils/storage.js +32 -14
  124. package/package.json +25 -26
  125. package/lib/ui/gamification/vote/expired-alert/index.d.ts +0 -7
  126. package/lib/ui/gamification/vote/expired-alert/index.js +0 -13
  127. /package/lib/{index-uEuzH3jr.js → index-xuotMAFm.js} +0 -0
  128. /package/lib/{styles_z07sl8-w40geAFS.js → styles_z07sl8-l0sNRNKZ.js} +0 -0
  129. /package/lib/ui/gamification/vote/{expired-alert → alert}/styles.d.ts +0 -0
@@ -1,71 +1,77 @@
1
- import { jsxs as w, jsx as n } from "react/jsx-runtime";
2
- import { cx as x } from "@linaria/core";
3
- import { useRef as C, useState as p, useCallback as g, useEffect as v } from "react";
4
- import { SvgIcon as d } from "../icons/index.js";
5
- import { Container as E, ToggleIconPause as S, Player as T, Poster as L, Control as j } from "./styles.js";
6
- import "@linaria/react";
7
- const k = (s, o) => {
1
+ import { jsxs as x, jsx as n } from "react/jsx-runtime";
2
+ import { cx as C } from "@linaria/core";
3
+ import { useRef as E, useState as g, useCallback as v, useEffect as d } from "react";
4
+ import { eventBus as S } from "@streamlayer/sdk-web-interfaces";
5
+ import { SvgIcon as y } from "../icons/index.js";
6
+ import { Container as T, ToggleIconPause as L, Player as j, Poster as k, Control as H } from "./styles.js";
7
+ const M = (s, a) => {
8
8
  for (const t of s)
9
- t.isIntersecting || t.target instanceof HTMLVideoElement && !t.target.paused && (o.unobserve(t.target), t.target.pause());
10
- }, y = new IntersectionObserver(k, { threshold: 0.5 }), f = /* @__PURE__ */ new Set(), H = (s) => {
11
- y.observe(s), f.add(s);
12
- }, u = (s) => {
13
- y.unobserve(s), f.delete(s);
14
- }, M = () => {
9
+ t.isIntersecting || t.target instanceof HTMLVideoElement && !t.target.paused && (a.unobserve(t.target), t.target.pause());
10
+ }, P = new IntersectionObserver(M, { threshold: 0.5 }), f = /* @__PURE__ */ new Set(), A = (s) => {
11
+ P.observe(s), f.add(s);
12
+ }, o = (s) => {
13
+ P.unobserve(s), f.delete(s);
14
+ }, B = () => {
15
15
  for (const s of f)
16
- s instanceof HTMLVideoElement && !s.paused && (s.pause(), u(s));
17
- }, D = ({ poster: s, source: o, controlVideo: t }) => {
18
- const e = C(null), [a, c] = p(!1), [m, b] = p(!0), P = g(() => {
16
+ s instanceof HTMLVideoElement && !s.paused && (s.pause(), o(s));
17
+ }, J = ({ poster: s, source: a, controlVideo: t }) => {
18
+ const e = E(null), [u, c] = g(!1), [m, p] = g(!0), h = v(() => {
19
19
  t == null || t({ muted: !0 });
20
- }, [t]), i = g(() => {
20
+ }, [t]), i = v(() => {
21
21
  t == null || t({ muted: !1 });
22
- }, [t]), h = () => {
23
- const r = e == null ? void 0 : e.current;
24
- if (r)
25
- if (a)
26
- r.pause(), e.current && u(e.current);
22
+ }, [t]), I = (r) => {
23
+ r.stopPropagation();
24
+ const b = e == null ? void 0 : e.current;
25
+ if (b) {
26
+ if (u)
27
+ b.pause(), e.current && o(e.current);
27
28
  else {
28
29
  const l = e == null ? void 0 : e.current;
29
30
  if (!l)
30
31
  return;
31
- M(), H(l), l.play().catch((O) => console.log(O)), b(!1);
32
+ B(), A(l), l.play().catch((w) => console.log(w)), p(!1);
32
33
  }
33
- }, I = () => {
34
+ S.emit("interactions", {
35
+ action: "tap",
36
+ payload: {}
37
+ });
38
+ }
39
+ }, O = () => {
34
40
  var r;
35
- e.current && u(e.current), (r = e == null ? void 0 : e.current) == null || r.load(), b(!0);
41
+ e.current && o(e.current), (r = e == null ? void 0 : e.current) == null || r.load(), p(!0);
36
42
  };
37
- return v(() => {
38
- e.current && u(e.current);
39
- }, []), v(() => {
43
+ return d(() => {
44
+ e.current && o(e.current);
45
+ }, []), d(() => {
40
46
  const r = e == null ? void 0 : e.current;
41
47
  return () => {
42
- r && (r.paused || i(), u(r));
48
+ r && (r.paused || i(), o(r));
43
49
  };
44
- }, [i]), /* @__PURE__ */ w(E, { onClick: h, className: x(a && S), children: [
50
+ }, [i]), /* @__PURE__ */ x(T, { onClick: I, className: C(u && L), children: [
45
51
  /* @__PURE__ */ n(
46
- T,
52
+ j,
47
53
  {
48
54
  ref: e,
49
- src: o,
55
+ src: a,
50
56
  onPlay: () => {
51
- P(), c(!0);
57
+ h(), c(!0);
52
58
  },
53
59
  onPause: () => {
54
60
  i(), c(!1);
55
61
  },
56
62
  onEnded: () => {
57
- i(), c(!1), I();
63
+ i(), c(!1), O();
58
64
  },
59
65
  style: { visibility: m ? "hidden" : "visible" },
60
66
  controls: !1,
61
67
  playsInline: !0
62
68
  }
63
69
  ),
64
- /* @__PURE__ */ n(L, { src: s, style: { visibility: m ? "visible" : "hidden" } }),
65
- /* @__PURE__ */ n(j, { children: a ? /* @__PURE__ */ n(d, { name: "icon-pause" }) : /* @__PURE__ */ n(d, { name: "icon-play" }) })
70
+ /* @__PURE__ */ n(k, { src: s, style: { visibility: m ? "visible" : "hidden" } }),
71
+ /* @__PURE__ */ n(H, { children: u ? /* @__PURE__ */ n(y, { name: "icon-pause" }) : /* @__PURE__ */ n(y, { name: "icon-play" }) })
66
72
  ] });
67
73
  };
68
74
  export {
69
- D as VideoPlayer,
70
- M as pauseAllVideos
75
+ J as VideoPlayer,
76
+ B as pauseAllVideos
71
77
  };
@@ -1,45 +1,35 @@
1
- import { jsx as e, jsxs as g, Fragment as y } from "react/jsx-runtime";
2
- import { useMemo as u, useState as i, useEffect as E } from "react";
1
+ import { jsx as t, jsxs as g, Fragment as y } from "react/jsx-runtime";
2
+ import { useMemo as p, useState as c, useEffect as E } from "react";
3
3
  import { useStreamLayerApp as l } from "@streamlayer/react/useStreamLayerApp";
4
4
  import { anonymous as D } from "@streamlayer/sdk-web-anonymous-auth";
5
5
  import { Developer as w } from "./debug/components/developer.js";
6
6
  import { DeveloperStorage as x } from "./storage.js";
7
- import "@linaria/react";
8
- import "./debug/components/bypassLogin.js";
9
- import "./debug/components/copyLogs.js";
10
- import "./debug/components/styles.js";
11
- import "./debug/components/envToggle.js";
12
- import "./debug/components/eventInput.js";
13
- import "@nanostores/react";
14
- import "@streamlayer/sdk-web-core";
15
- import "./debug/components/sdkKey.js";
16
- import "@streamlayer/sdk-web-storage";
17
7
  function K({
18
8
  Component: o,
19
9
  Story: r,
20
10
  args: n,
21
11
  autoEnable: a
22
12
  }) {
23
- const s = u(() => new x(), []), [p, f] = i(s.getEnv()), [c, v] = i(s.getSdkKey() || "set-sdk-key"), [m, k] = i(s.getEvent() || ""), S = u(() => {
24
- const d = /* @__PURE__ */ new Set();
25
- return d.add(D), d;
26
- }, []), t = l({
27
- sdkKey: c,
13
+ const s = p(() => new x(), []), [i, f] = c(s.getEnv()), [d, v] = c(s.getSdkKey() || "set-sdk-key"), [m, k] = c(s.getEvent() || ""), S = p(() => {
14
+ const u = /* @__PURE__ */ new Set();
15
+ return u.add(D), u;
16
+ }, []), e = l({
17
+ sdkKey: d,
28
18
  plugins: S,
29
- production: p === "production",
19
+ production: i === "production",
30
20
  autoEnable: a
31
21
  });
32
22
  return E(() => {
33
- m && t && t.createEventSession(m);
34
- }, [t]), /* @__PURE__ */ g(y, { children: [
35
- t ? /* @__PURE__ */ e(o, { Story: r, sdk: t, args: n }) : /* @__PURE__ */ e("div", { children: "wait sdk..." }),
36
- /* @__PURE__ */ e(
23
+ m && e && e.createEventSession(m);
24
+ }, [e]), /* @__PURE__ */ g(y, { children: [
25
+ e ? /* @__PURE__ */ t(o, { Story: r, sdk: e, args: n }) : /* @__PURE__ */ t("div", { children: "wait sdk..." }),
26
+ /* @__PURE__ */ t(
37
27
  w,
38
28
  {
39
- sdk: t,
40
- sdkKey: c,
29
+ sdk: e,
30
+ sdkKey: d,
41
31
  setSdkKey: v,
42
- env: p,
32
+ env: i,
43
33
  setEnv: f,
44
34
  event: m,
45
35
  setEvent: k
@@ -47,13 +37,13 @@ function K({
47
37
  )
48
38
  ] });
49
39
  }
50
- function O(o, r = !0) {
40
+ function b(o, r = !0) {
51
41
  return {
52
42
  decorators: [
53
- (n) => /* @__PURE__ */ e(K, { Story: n, Component: o, autoEnable: r })
43
+ (n) => /* @__PURE__ */ t(K, { Story: n, Component: o, autoEnable: r })
54
44
  ]
55
45
  };
56
46
  }
57
47
  export {
58
- O as createDemo
48
+ b as createDemo
59
49
  };
@@ -1,7 +1,6 @@
1
1
  import { jsxs as t, jsx as o } from "react/jsx-runtime";
2
2
  import { InputField as r } from "./styles.js";
3
- import "@linaria/react";
4
- const p = () => /* @__PURE__ */ t(r, { children: [
3
+ const n = () => /* @__PURE__ */ t(r, { children: [
5
4
  /* @__PURE__ */ o("label", { children: "Subscription Logs" }),
6
5
  /* @__PURE__ */ o("button", { onClick: () => {
7
6
  navigator.clipboard.writeText(sessionStorage.getItem("slstreamlogs") || "").then(() => {
@@ -10,5 +9,5 @@ const p = () => /* @__PURE__ */ t(r, { children: [
10
9
  }, children: "Copy" })
11
10
  ] });
12
11
  export {
13
- p as CopyLogs
12
+ n as CopyLogs
14
13
  };
@@ -1,5 +1,5 @@
1
- import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
- import { styled as n } from "@linaria/react";
1
+ import { jsxs as n, jsx as o } from "react/jsx-runtime";
2
+ import { styled as s } from "@linaria/react";
3
3
  import { useMemo as b, useState as h } from "react";
4
4
  import { DeveloperStorage as q } from "../../storage.js";
5
5
  import { BypassLogin as u } from "./bypassLogin.js";
@@ -7,70 +7,66 @@ import { CopyLogs as D } from "./copyLogs.js";
7
7
  import { EnvToggle as I } from "./envToggle.js";
8
8
  import { EventInput as B } from "./eventInput.js";
9
9
  import { SdkKey as v } from "./sdkKey.js";
10
- import "@streamlayer/sdk-web-storage";
11
- import "./styles.js";
12
- import "@nanostores/react";
13
- import "@streamlayer/sdk-web-core";
14
- const A = /* @__PURE__ */ n("div")({
10
+ const A = /* @__PURE__ */ s("div")({
15
11
  name: "DeveloperContainer",
16
12
  class: "d1sqxt7l",
17
13
  propsAsIs: !1
18
- }), x = /* @__PURE__ */ n("div")({
14
+ }), x = /* @__PURE__ */ s("div")({
19
15
  name: "DeveloperItems",
20
16
  class: "d1a3478s",
21
17
  propsAsIs: !1
22
- }), L = /* @__PURE__ */ n("button")({
18
+ }), L = /* @__PURE__ */ s("button")({
23
19
  name: "BurgerBtn",
24
20
  class: "butjcq8",
25
21
  propsAsIs: !1
26
- }), P = ({
22
+ }), G = ({
27
23
  sdk: r,
28
- sdkKey: s,
24
+ sdkKey: m,
29
25
  setSdkKey: p,
30
- env: i,
26
+ env: a,
31
27
  setEnv: t,
32
- event: a,
28
+ event: i,
33
29
  setEvent: l,
34
30
  hideAuth: c,
35
31
  standalone: f = !1
36
32
  }) => {
37
33
  const e = b(() => new q(), []), [g, C] = h(f);
38
- return f ? /* @__PURE__ */ m(x, {
34
+ return f ? /* @__PURE__ */ n(x, {
39
35
  children: [t && /* @__PURE__ */ o(I, {
40
- env: i,
36
+ env: a,
41
37
  setEnv: t,
42
38
  storage: e
43
39
  }), p && /* @__PURE__ */ o(v, {
44
- sdkKey: s,
40
+ sdkKey: m,
45
41
  setSdkKey: p,
46
42
  storage: e
47
43
  }), r && /* @__PURE__ */ o(B, {
48
44
  sdk: r,
49
45
  storage: e,
50
- event: a,
46
+ event: i,
51
47
  setEvent: l
52
48
  }), !c && r && /* @__PURE__ */ o(u, {
53
49
  sdk: r,
54
50
  storage: e
55
51
  }), /* @__PURE__ */ o(D, {})]
56
- }) : /* @__PURE__ */ m(A, {
57
- children: [/* @__PURE__ */ m(L, {
52
+ }) : /* @__PURE__ */ n(A, {
53
+ children: [/* @__PURE__ */ n(L, {
58
54
  "data-opened": g.toString(),
59
55
  onClick: () => C((j) => !j),
60
56
  children: [/* @__PURE__ */ o("span", {}), /* @__PURE__ */ o("span", {}), /* @__PURE__ */ o("span", {})]
61
- }), g && /* @__PURE__ */ m(x, {
57
+ }), g && /* @__PURE__ */ n(x, {
62
58
  children: [t && /* @__PURE__ */ o(I, {
63
- env: i,
59
+ env: a,
64
60
  setEnv: t,
65
61
  storage: e
66
62
  }), p && /* @__PURE__ */ o(v, {
67
- sdkKey: s,
63
+ sdkKey: m,
68
64
  setSdkKey: p,
69
65
  storage: e
70
66
  }), r && /* @__PURE__ */ o(B, {
71
67
  sdk: r,
72
68
  storage: e,
73
- event: a,
69
+ event: i,
74
70
  setEvent: l
75
71
  }), !c && r && /* @__PURE__ */ o(u, {
76
72
  sdk: r,
@@ -80,5 +76,5 @@ const A = /* @__PURE__ */ n("div")({
80
76
  });
81
77
  };
82
78
  export {
83
- P as Developer
79
+ G as Developer
84
80
  };
@@ -1,27 +1,26 @@
1
- import { jsx as o, jsxs as n } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as o } from "react/jsx-runtime";
2
2
  import { useStore as d } from "@nanostores/react";
3
3
  import "@streamlayer/sdk-web-core";
4
- import { InputField as m } from "./styles.js";
5
- import "@linaria/react";
6
- const I = ({ sdk: t, storage: a, event: e, setEvent: l }) => {
4
+ import { InputField as u } from "./styles.js";
5
+ const y = ({ sdk: t, storage: a, event: e, setEvent: l }) => {
7
6
  var i;
8
7
  const s = d(t.sdkStore.providerStreamId), r = d(t.sdkStore.organizationSettings), c = !((i = r == null ? void 0 : r.data) != null && i.provider);
9
- return /* @__PURE__ */ o("div", { children: /* @__PURE__ */ n(m, { children: [
10
- /* @__PURE__ */ n("label", { children: [
8
+ return /* @__PURE__ */ n("div", { children: /* @__PURE__ */ o(u, { children: [
9
+ /* @__PURE__ */ o("label", { children: [
11
10
  c ? "Use StreamLayer event ids" : "Use your provider event ids",
12
11
  ", ",
13
- /* @__PURE__ */ n("b", { children: [
12
+ /* @__PURE__ */ o("b", { children: [
14
13
  "currently configured (",
15
14
  s,
16
15
  ")"
17
16
  ] })
18
17
  ] }),
19
- /* @__PURE__ */ o("input", { type: "text", value: e, onChange: (p) => l(p.target.value) }),
20
- /* @__PURE__ */ o("button", { onClick: () => {
18
+ /* @__PURE__ */ n("input", { type: "text", value: e, onChange: (p) => l(p.target.value) }),
19
+ /* @__PURE__ */ n("button", { onClick: () => {
21
20
  t.createEventSession(e), a.setEvent(e);
22
21
  }, disabled: s === e, children: "set" })
23
22
  ] }) });
24
23
  };
25
24
  export {
26
- I as EventInput
25
+ y as EventInput
27
26
  };
@@ -1,14 +1,13 @@
1
1
  import { jsx as t, jsxs as l } from "react/jsx-runtime";
2
2
  import { useState as u } from "react";
3
- import { InputField as m } from "./styles.js";
4
- import "@linaria/react";
5
- const b = ({
6
- sdkKey: r,
7
- setSdkKey: i,
8
- storage: n
3
+ import { InputField as c } from "./styles.js";
4
+ const h = ({
5
+ sdkKey: n,
6
+ setSdkKey: r,
7
+ storage: i
9
8
  }) => {
10
- const [e, o] = u(r);
11
- return /* @__PURE__ */ t("div", { children: /* @__PURE__ */ l(m, { children: [
9
+ const [e, o] = u(n);
10
+ return /* @__PURE__ */ t("div", { children: /* @__PURE__ */ l(c, { children: [
12
11
  /* @__PURE__ */ t("label", { children: "SDK Key" }),
13
12
  /* @__PURE__ */ t(
14
13
  "input",
@@ -21,10 +20,10 @@ const b = ({
21
20
  }
22
21
  ),
23
22
  /* @__PURE__ */ t("button", { onClick: () => {
24
- n.setSdkKey(e), i(e);
23
+ i.setSdkKey(e), r(e);
25
24
  }, children: "set" })
26
25
  ] }) });
27
26
  };
28
27
  export {
29
- b as SdkKey
28
+ h as SdkKey
30
29
  };
@@ -1,34 +1,23 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { useMemo as a, useState as r } from "react";
3
- import { useStreamLayer as u } from "@streamlayer/react";
4
- import { Developer as v } from "./components/developer.js";
5
- import { DeveloperStorage as c } from "./storage.js";
6
- import "@linaria/react";
7
- import "../storage.js";
8
- import "@streamlayer/sdk-web-storage";
9
- import "./components/bypassLogin.js";
10
- import "./components/copyLogs.js";
11
- import "./components/styles.js";
12
- import "./components/envToggle.js";
13
- import "./components/eventInput.js";
14
- import "@nanostores/react";
15
- import "@streamlayer/sdk-web-core";
16
- import "./components/sdkKey.js";
17
- const h = () => {
18
- const t = a(() => new c(), []), [e, o] = r(t.getEnv()), [m, s] = r(t.getSdkKey() || "set-sdk-key"), [p, i] = r(t.getEvent() || "");
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { useMemo as u, useState as r } from "react";
3
+ import { useStreamLayer as v } from "@streamlayer/react";
4
+ import { Developer as c } from "./components/developer.js";
5
+ import { DeveloperStorage as g } from "./storage.js";
6
+ const i = () => {
7
+ const e = u(() => new g(), []), [t, o] = r(e.getEnv()), [s, n] = r(e.getSdkKey() || "set-sdk-key"), [m, a] = r(e.getEvent() || "");
19
8
  return {
20
- env: e,
9
+ env: t,
21
10
  setEnv: o,
22
- sdkKey: m,
23
- setSdkKey: s,
24
- event: p,
25
- setEvent: i
11
+ sdkKey: s,
12
+ setSdkKey: n,
13
+ event: m,
14
+ setEvent: a
26
15
  };
27
- }, q = (t) => {
28
- const e = u();
29
- return /* @__PURE__ */ n(v, { sdk: e, ...t });
16
+ }, D = (e) => {
17
+ const t = v();
18
+ return /* @__PURE__ */ p(c, { sdk: t, ...e });
30
19
  };
31
20
  export {
32
- q as StreamLayerDebug,
33
- h as useStreamLayerDebug
21
+ D as StreamLayerDebug,
22
+ i as useStreamLayerDebug
34
23
  };
@@ -1,34 +1,52 @@
1
- import { Storage as t } from "@streamlayer/sdk-web-storage";
2
- class i extends t {
1
+ var n = Object.defineProperty;
2
+ var i = (s, r, e) => r in s ? n(s, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[r] = e;
3
+ var t = (s, r, e) => (i(s, typeof r != "symbol" ? r + "" : r, e), e);
4
+ import { Storage as h } from "@streamlayer/sdk-web-storage";
5
+ class d extends h {
3
6
  constructor() {
4
- super("dev"), this.setSchema = (e) => {
7
+ super("dev");
8
+ // Schema
9
+ t(this, "setSchema", (e) => {
5
10
  this.write("schema", e);
6
- }, this.getSchema = () => this.read(
11
+ });
12
+ t(this, "getSchema", () => this.read(
7
13
  "schema"
8
14
  /* SCHEMA */
9
- ), this.setToken = (e) => {
15
+ ));
16
+ // Token
17
+ t(this, "setToken", (e) => {
10
18
  this.write("token", e);
11
- }, this.getToken = () => this.read(
19
+ });
20
+ t(this, "getToken", () => this.read(
12
21
  "token"
13
22
  /* TOKEN */
14
- ), this.setEvent = (e) => {
23
+ ));
24
+ // Event
25
+ t(this, "setEvent", (e) => {
15
26
  this.write("event", e);
16
- }, this.getEvent = () => this.read(
27
+ });
28
+ t(this, "getEvent", () => this.read(
17
29
  "event"
18
30
  /* EVENT */
19
- ), this.setSdkKey = (e) => {
31
+ ));
32
+ // SDK_KEY
33
+ t(this, "setSdkKey", (e) => {
20
34
  this.write("sdkKey", e);
21
- }, this.getSdkKey = () => this.read(
35
+ });
36
+ t(this, "getSdkKey", () => this.read(
22
37
  "sdkKey"
23
38
  /* SDK_KEY */
24
- ), this.setEnv = (e) => {
39
+ ));
40
+ // ENV
41
+ t(this, "setEnv", (e) => {
25
42
  this.write("env", e);
26
- }, this.getEnv = () => this.read(
43
+ });
44
+ t(this, "getEnv", () => this.read(
27
45
  "env"
28
46
  /* ENV */
29
- ) || "production";
47
+ ) || "production");
30
48
  }
31
49
  }
32
50
  export {
33
- i as DeveloperStorage
51
+ d as DeveloperStorage
34
52
  };
@@ -1,12 +1,8 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { StreamLayerThemeProvider as o } from "../../ui/theme/index.js";
3
- import { AppContainer as t } from "./styles.js";
4
- import "../../ui/theme/theme.js";
5
- import "../../ui/theme/breakpoints.js";
6
- import "../../ui/theme/constants.js";
7
- import "@linaria/react";
8
- const a = (e) => /* @__PURE__ */ r(o, { children: /* @__PURE__ */ r(e, {}) }), l = (e) => /* @__PURE__ */ r(o, { children: /* @__PURE__ */ r(t, { children: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(e, {}) }) }) });
2
+ import { StreamLayerThemeProvider as n } from "../../ui/theme/index.js";
3
+ import { AppContainer as o } from "./styles.js";
4
+ const c = (e) => /* @__PURE__ */ r(n, { children: /* @__PURE__ */ r(e, {}) }), d = (e) => /* @__PURE__ */ r(n, { children: /* @__PURE__ */ r(o, { children: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(e, {}) }) }) });
9
5
  export {
10
- l as container,
11
- a as theme
6
+ d as container,
7
+ c as theme
12
8
  };
@@ -1,34 +1,52 @@
1
- import { Storage as t } from "@streamlayer/sdk-web-storage";
2
- class i extends t {
1
+ var n = Object.defineProperty;
2
+ var i = (s, r, e) => r in s ? n(s, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[r] = e;
3
+ var t = (s, r, e) => (i(s, typeof r != "symbol" ? r + "" : r, e), e);
4
+ import { Storage as h } from "@streamlayer/sdk-web-storage";
5
+ class d extends h {
3
6
  constructor() {
4
- super("dev"), this.setSchema = (e) => {
7
+ super("dev");
8
+ // Schema
9
+ t(this, "setSchema", (e) => {
5
10
  this.write("schema", e);
6
- }, this.getSchema = () => this.read(
11
+ });
12
+ t(this, "getSchema", () => this.read(
7
13
  "schema"
8
14
  /* SCHEMA */
9
- ), this.setToken = (e) => {
15
+ ));
16
+ // Token
17
+ t(this, "setToken", (e) => {
10
18
  this.write("token", e);
11
- }, this.getToken = () => this.read(
19
+ });
20
+ t(this, "getToken", () => this.read(
12
21
  "token"
13
22
  /* TOKEN */
14
- ), this.setEvent = (e) => {
23
+ ));
24
+ // Event
25
+ t(this, "setEvent", (e) => {
15
26
  this.write("event", e);
16
- }, this.getEvent = () => this.read(
27
+ });
28
+ t(this, "getEvent", () => this.read(
17
29
  "event"
18
30
  /* EVENT */
19
- ), this.setSdkKey = (e) => {
31
+ ));
32
+ // SDK_KEY
33
+ t(this, "setSdkKey", (e) => {
20
34
  this.write("sdkKey", e);
21
- }, this.getSdkKey = () => this.read(
35
+ });
36
+ t(this, "getSdkKey", () => this.read(
22
37
  "sdkKey"
23
38
  /* SDK_KEY */
24
- ), this.setEnv = (e) => {
39
+ ));
40
+ // ENV
41
+ t(this, "setEnv", (e) => {
25
42
  this.write("env", e);
26
- }, this.getEnv = () => this.read(
43
+ });
44
+ t(this, "getEnv", () => this.read(
27
45
  "env"
28
46
  /* ENV */
29
- ) || "production";
47
+ ) || "production");
30
48
  }
31
49
  }
32
50
  export {
33
- i as DeveloperStorage
51
+ d as DeveloperStorage
34
52
  };