@streamlayer/react-ui 0.34.0 → 0.36.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 (119) hide show
  1. package/lib/index.d.ts +13 -0
  2. package/lib/ui/app/Features/FeatureProvider.d.ts +9 -0
  3. package/lib/ui/app/Features/Gamification/Leaderboard.d.ts +5 -0
  4. package/lib/ui/app/Features/Gamification/Question.d.ts +7 -0
  5. package/lib/ui/app/Features/Gamification/QuestionsList.d.ts +6 -0
  6. package/lib/ui/app/Features/Gamification/Tabs.d.ts +5 -0
  7. package/lib/ui/app/Features/Gamification/UserSummary.d.ts +5 -0
  8. package/lib/ui/app/Features/Gamification/index.d.ts +7 -0
  9. package/lib/ui/app/Features/Highlights/Insight.d.ts +7 -0
  10. package/lib/ui/app/Features/Highlights/Insights.d.ts +6 -0
  11. package/lib/ui/app/Features/Highlights/index.d.ts +7 -0
  12. package/lib/ui/app/Features/index.d.ts +8 -0
  13. package/lib/ui/app/Navigation/MastersNavigation/index.d.ts +11 -0
  14. package/lib/ui/app/Navigation/MastersNavigation/index.js +11 -10
  15. package/lib/ui/app/Navigation/index.d.ts +9 -0
  16. package/lib/ui/app/Notifications/index.d.ts +5 -0
  17. package/lib/ui/app/masters.d.ts +14 -0
  18. package/lib/ui/app/{index.js → masters.js} +52 -24
  19. package/lib/ui/app/styles.d.ts +3 -0
  20. package/lib/ui/app/useSdkFeature.d.ts +4 -0
  21. package/lib/ui/demo/DemoPoints.d.ts +5 -0
  22. package/lib/ui/demo/Gamification.d.ts +7 -0
  23. package/lib/ui/demo/Highlights.d.ts +7 -0
  24. package/lib/ui/demo/Login.d.ts +5 -0
  25. package/lib/ui/demo/Login.js +6 -5
  26. package/lib/ui/demo/components/EventProvider.d.ts +2 -0
  27. package/lib/ui/demo/components/Insight.d.ts +7 -0
  28. package/lib/ui/demo/components/Insights.d.ts +6 -0
  29. package/lib/ui/demo/components/Leaderboard.d.ts +5 -0
  30. package/lib/ui/demo/components/Question.d.ts +7 -0
  31. package/lib/ui/demo/components/QuestionsList.d.ts +6 -0
  32. package/lib/ui/demo/components/UserSummary.d.ts +5 -0
  33. package/lib/ui/demo/components/index.d.ts +7 -0
  34. package/lib/ui/demo/index.d.ts +5 -0
  35. package/lib/ui/demo/index.js +43 -51
  36. package/lib/ui/demo/styles.d.ts +6 -0
  37. package/lib/ui/gamification/common-header/index.d.ts +8 -0
  38. package/lib/ui/gamification/common-header/styles.d.ts +4 -0
  39. package/lib/ui/gamification/detailed-insight/index.d.ts +12 -0
  40. package/lib/ui/gamification/detailed-insight/styles.d.ts +8 -0
  41. package/lib/ui/gamification/insight/index.d.ts +11 -0
  42. package/lib/ui/gamification/insight/styles.d.ts +9 -0
  43. package/lib/ui/gamification/insight-list/index.d.ts +13 -0
  44. package/lib/ui/gamification/insight-list/styles.d.ts +3 -0
  45. package/lib/ui/gamification/leaderboard-invite-link/index.d.ts +8 -0
  46. package/lib/ui/gamification/leaderboard-invite-link/styles.d.ts +8 -0
  47. package/lib/ui/gamification/leaderboard-item/index.d.ts +7 -0
  48. package/lib/ui/gamification/leaderboard-item/styles.d.ts +10 -0
  49. package/lib/ui/gamification/leaderboard-item-detail/index.d.ts +7 -0
  50. package/lib/ui/gamification/leaderboard-item-detail/styles.d.ts +2 -0
  51. package/lib/ui/gamification/leaderboard-list/index.d.ts +8 -0
  52. package/lib/ui/gamification/leaderboard-list/styles.d.ts +2 -0
  53. package/lib/ui/gamification/onboarding/components/onboarding-slides/onboarding-instructions/index.d.ts +7 -0
  54. package/lib/ui/gamification/onboarding/components/onboarding-slides/onboarding-instructions/styles.d.ts +5 -0
  55. package/lib/ui/gamification/onboarding/components/onboarding-slides/onboarding-invite-card/index.d.ts +8 -0
  56. package/lib/ui/gamification/onboarding/components/onboarding-slides/onboarding-invite-card/styles.d.ts +8 -0
  57. package/lib/ui/gamification/onboarding/components/onboarding-slides/onboarding-rules/index.d.ts +8 -0
  58. package/lib/ui/gamification/onboarding/components/onboarding-slides/onboarding-rules/styles.d.ts +7 -0
  59. package/lib/ui/gamification/onboarding/index.d.ts +21 -0
  60. package/lib/ui/gamification/onboarding/styles.d.ts +11 -0
  61. package/lib/ui/gamification/points/index.d.ts +4 -0
  62. package/lib/ui/gamification/points/styles.d.ts +7 -0
  63. package/lib/ui/gamification/question/index.d.ts +5 -0
  64. package/lib/ui/gamification/question/styles.d.ts +12 -0
  65. package/lib/ui/gamification/question-list/index.d.ts +8 -0
  66. package/lib/ui/gamification/question-list/styles.d.ts +4 -0
  67. package/lib/ui/gamification/tabs/index.d.ts +17 -0
  68. package/lib/ui/gamification/tabs/styles.d.ts +5 -0
  69. package/lib/ui/gamification/user-statistics/components/rank/index.d.ts +7 -0
  70. package/lib/ui/gamification/user-statistics/components/rank/styles.d.ts +4 -0
  71. package/lib/ui/gamification/user-statistics/components/statistics/index.d.ts +7 -0
  72. package/lib/ui/gamification/user-statistics/components/statistics/styles.d.ts +3 -0
  73. package/lib/ui/gamification/user-statistics/index.d.ts +14 -0
  74. package/lib/ui/gamification/user-statistics/styles.d.ts +16 -0
  75. package/lib/ui/gamification/vote/components/voting-header/components/points/index.d.ts +6 -0
  76. package/lib/ui/gamification/vote/components/voting-header/components/points/styles.d.ts +6 -0
  77. package/lib/ui/gamification/vote/components/voting-header/components/timer/index.d.ts +8 -0
  78. package/lib/ui/gamification/vote/components/voting-header/components/timer/styles.d.ts +2 -0
  79. package/lib/ui/gamification/vote/components/voting-header/index.d.ts +12 -0
  80. package/lib/ui/gamification/vote/components/voting-header/styles.d.ts +11 -0
  81. package/lib/ui/gamification/vote/components/voting-option/index.d.ts +20 -0
  82. package/lib/ui/gamification/vote/components/voting-option/styles.d.ts +13 -0
  83. package/lib/ui/gamification/vote/index.d.ts +13 -0
  84. package/lib/ui/gamification/vote/styles.d.ts +9 -0
  85. package/lib/ui/icons/index.d.ts +43 -0
  86. package/lib/ui/login/index.d.ts +6 -0
  87. package/lib/ui/login/styles.d.ts +8 -0
  88. package/lib/ui/navigation/button/Channels.d.ts +4 -0
  89. package/lib/ui/navigation/button/FeaturedGroups.d.ts +4 -0
  90. package/lib/ui/navigation/button/LeaderBoard.d.ts +4 -0
  91. package/lib/ui/navigation/button/index.d.ts +12 -0
  92. package/lib/ui/navigation/button/styles.d.ts +3 -0
  93. package/lib/ui/navigation/index.d.ts +6 -0
  94. package/lib/ui/navigation/masters.d.ts +5 -0
  95. package/lib/ui/notifications/decorator.d.ts +4 -0
  96. package/lib/ui/notifications/index.d.ts +5 -0
  97. package/lib/ui/notifications/notification/index.d.ts +6 -0
  98. package/lib/ui/notifications/notification/onboarding-inapp/index.d.ts +3 -0
  99. package/lib/ui/notifications/notification/onboarding-inapp/styles.d.ts +12 -0
  100. package/lib/ui/notifications/notification/question-inapp/index.d.ts +3 -0
  101. package/lib/ui/notifications/notification/question-inapp/styles.d.ts +10 -0
  102. package/lib/ui/notifications/notification/styles.d.ts +2 -0
  103. package/lib/ui/notifications/styles.d.ts +2 -0
  104. package/lib/ui/theme/ThemeColors.d.ts +1 -0
  105. package/lib/ui/theme/Typography.d.ts +2 -0
  106. package/lib/ui/theme/constants.d.ts +79 -0
  107. package/lib/ui/theme/index.d.ts +5 -0
  108. package/lib/ui/theme/masters.d.ts +1 -0
  109. package/lib/ui/theme/theme.d.ts +3 -0
  110. package/lib/utils/createDemo.js +6 -6
  111. package/lib/utils/{components → debug/components}/developer.js +1 -1
  112. package/lib/utils/debug/index.js +33 -0
  113. package/lib/utils/debug/storage.js +52 -0
  114. package/package.json +23 -12
  115. /package/lib/utils/{components → debug/components}/bypassLogin.js +0 -0
  116. /package/lib/utils/{components → debug/components}/envToggle.js +0 -0
  117. /package/lib/utils/{components → debug/components}/eventInput.js +0 -0
  118. /package/lib/utils/{components → debug/components}/sdkKey.js +0 -0
  119. /package/lib/utils/{components → debug/components}/styles.js +0 -0
package/lib/index.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ export * from './ui/notifications/notification/question-inapp';
2
+ export * from './ui/login';
3
+ export * from './ui/gamification/onboarding';
4
+ export * from './ui/gamification/tabs';
5
+ export * from './ui/gamification/leaderboard-item-detail';
6
+ export * from './ui/gamification/question';
7
+ export * from './ui/gamification/question-list';
8
+ export * from './ui/gamification/user-statistics';
9
+ export * from './ui/gamification/vote';
10
+ export * from './ui/demo';
11
+ export * from './ui/gamification/points';
12
+ export * from './ui/theme';
13
+ export * from './ui/theme/theme';
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { Features } from '@streamlayer/sdk-web-features';
3
+ import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
4
+ /** Here we check data, render loaders, load data and perform some side effects for the active feature */
5
+ export declare const FeatureProvider: React.FC<{
6
+ feature: Features;
7
+ children: React.ReactNode;
8
+ sdk: StreamLayerSDK;
9
+ }>;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import type { Gamification } from '@streamlayer/feature-gamification';
3
+ export declare const Leaderboard: React.FC<{
4
+ store: ReturnType<Exclude<Gamification['leaderboardList'], undefined>['getStore']>;
5
+ }>;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { GamificationBackground } from '@streamlayer/feature-gamification';
3
+ export declare const Question: React.FC<{
4
+ openedQuestion: Awaited<ReturnType<GamificationBackground['openedQuestion']['getValue']>>;
5
+ closeQuestion: () => void;
6
+ vote: (questionId: string, answerId: string) => void;
7
+ }>;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import type { Gamification } from '@streamlayer/feature-gamification';
3
+ export declare const QuestionsList: React.FC<{
4
+ store: ReturnType<Exclude<Gamification['questions'], undefined>['getStore']>;
5
+ openQuestion: (questionId: string) => void;
6
+ }>;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { type Gamification } from '@streamlayer/feature-gamification';
3
+ export declare const Tabs: React.FC<{
4
+ gamification: Gamification;
5
+ }>;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import type { Gamification } from '@streamlayer/feature-gamification';
3
+ export declare const UserSummary: React.FC<{
4
+ store: ReturnType<Exclude<Gamification['userSummary'], undefined>['getStore']>;
5
+ }>;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { type Gamification as GamificationClass } from '@streamlayer/feature-gamification';
3
+ import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
4
+ export declare const GamificationOverlay: React.FC<{
5
+ gamification: GamificationClass;
6
+ sdk: StreamLayerSDK;
7
+ }>;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { Highlights } from '@streamlayer/feature-gamification';
3
+ export declare const Insight: React.FC<{
4
+ openedInsight: Exclude<Highlights['openedInsight']['value'], undefined>;
5
+ closeHighlights: () => void;
6
+ closeInsight: () => void;
7
+ }>;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import type { Highlights } from '@streamlayer/feature-gamification';
3
+ export declare const Insights: React.FC<{
4
+ highlights: Highlights;
5
+ store: ReturnType<Exclude<Highlights['insights'], undefined>['getStore']>;
6
+ }>;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import type { Highlights } from '@streamlayer/feature-gamification';
3
+ import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
4
+ export declare const HighlightsOverlay: React.FC<{
5
+ highlights: Highlights;
6
+ sdk: StreamLayerSDK;
7
+ }>;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { Features } from '@streamlayer/sdk-web-features';
3
+ import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
4
+ /** render feature by type */
5
+ export declare const ActiveFeature: React.FC<{
6
+ sdk: StreamLayerSDK;
7
+ feature: Features | null;
8
+ }>;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { ChannelsButtonId } from '../../../navigation/button/Channels';
3
+ import { FeaturedGroupsButtonId } from '../../../navigation/button/FeaturedGroups';
4
+ import { LeaderBoardButtonId } from '../../../navigation/button/LeaderBoard';
5
+ export { ChannelsButtonId, LeaderBoardButtonId, FeaturedGroupsButtonId };
6
+ export type AvailableOverlays = typeof ChannelsButtonId | typeof LeaderBoardButtonId | typeof FeaturedGroupsButtonId;
7
+ export declare const MastersNavigation: React.FC<{
8
+ activeOverlay: AvailableOverlays;
9
+ setActiveOverlay: (overlay: AvailableOverlays) => void;
10
+ sdkReady: boolean;
11
+ }>;
@@ -1,27 +1,28 @@
1
- import { jsxs as p, jsx as r } from "react/jsx-runtime";
2
- import { ChannelsButton as u, ChannelsButtonId as i } from "../../../navigation/button/Channels.js";
3
- import { FeaturedGroupsButton as a, FeaturedGroupsButtonId as n } from "../../../navigation/button/FeaturedGroups.js";
4
- import { LeaderBoardButton as d, LeaderBoardButtonId as m } from "../../../navigation/button/LeaderBoard.js";
5
- import { Navigation as s } from "../../../navigation/masters.js";
1
+ import { jsxs as d, jsx as r } from "react/jsx-runtime";
2
+ import { ChannelsButton as a, ChannelsButtonId as i } from "../../../navigation/button/Channels.js";
3
+ import { FeaturedGroupsButton as u, FeaturedGroupsButtonId as n } from "../../../navigation/button/FeaturedGroups.js";
4
+ import { LeaderBoardButton as s, LeaderBoardButtonId as m } from "../../../navigation/button/LeaderBoard.js";
5
+ import { Navigation as e } from "../../../navigation/masters.js";
6
6
  import "@linaria/react";
7
7
  import "../../../icons/index.js";
8
8
  import "react";
9
9
  import "../../../navigation/button/index.js";
10
10
  import "../../../navigation/button/styles.js";
11
11
  import "../../../navigation/index.js";
12
- const l = ({ activeOverlay: o, setActiveOverlay: t }) => /* @__PURE__ */ p(s, { children: [
13
- /* @__PURE__ */ r(u, { active: o === i, onClick: () => t(i) }),
12
+ const F = ({ activeOverlay: o, setActiveOverlay: t, sdkReady: p }) => /* @__PURE__ */ d(e, { children: [
13
+ /* @__PURE__ */ r(a, { active: o === i, onClick: () => t(i) }),
14
14
  /* @__PURE__ */ r(
15
- a,
15
+ u,
16
16
  {
17
17
  active: o === n,
18
+ disabled: !p,
18
19
  onClick: () => {
19
20
  t(n);
20
21
  }
21
22
  }
22
23
  ),
23
24
  /* @__PURE__ */ r(
24
- d,
25
+ s,
25
26
  {
26
27
  active: o === m,
27
28
  onClick: () => t(m)
@@ -32,5 +33,5 @@ export {
32
33
  i as ChannelsButtonId,
33
34
  n as FeaturedGroupsButtonId,
34
35
  m as LeaderBoardButtonId,
35
- l as MastersNavigation
36
+ F as MastersNavigation
36
37
  };
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
3
+ import { Overlays } from '..';
4
+ import { ButtonProps } from '../../navigation/button';
5
+ export declare const SDKNavigation: React.FC<{
6
+ customOverlays: Overlays;
7
+ activeButton?: ButtonProps['id'];
8
+ sdk: StreamLayerSDK;
9
+ }>;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
3
+ export declare const SDKNotifications: React.FC<{
4
+ sdk: StreamLayerSDK;
5
+ }>;
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
3
+ export type Overlays = {};
4
+ export type AppChildrenProps = {
5
+ enableSdk: () => void;
6
+ disableSdk: () => void;
7
+ };
8
+ export type AppProps = {
9
+ sdk: StreamLayerSDK;
10
+ event: string;
11
+ overlays?: Overlays;
12
+ children?: (methods: AppChildrenProps) => React.ReactNode;
13
+ };
14
+ export declare const MastersApp: React.FC<AppProps>;
@@ -1,16 +1,16 @@
1
- import { jsx as o, jsxs as n } from "react/jsx-runtime";
2
- import { useStore as c } from "@nanostores/react";
3
- import { useState as f } from "react";
4
- import { FeatureType as u } from "@streamlayer/sdk-web-types";
5
- import { StreamLayerThemeProvider as S } from "../theme/index.js";
6
- import { mastersVariables as b } from "../theme/masters.js";
7
- import { ActiveFeature as v } from "./Features/index.js";
8
- import { MastersNavigation as h } from "./Navigation/MastersNavigation/index.js";
9
- import { SDKContainer as y, SDKScrollContainer as A } from "./styles.js";
10
- import { useSdkFeature as F } from "./useSdkFeature.js";
11
- import { FeaturedGroupsButtonId as m } from "../navigation/button/FeaturedGroups.js";
12
- import { ChannelsButtonId as B } from "../navigation/button/Channels.js";
13
- import { LeaderBoardButtonId as l } from "../navigation/button/LeaderBoard.js";
1
+ import { jsx as o, jsxs as f } from "react/jsx-runtime";
2
+ import { useStore as A } from "@nanostores/react";
3
+ import { useState as S, useCallback as F, useEffect as E } from "react";
4
+ import { FeatureType as B } from "@streamlayer/sdk-web-types";
5
+ import { StreamLayerThemeProvider as C } from "../theme/index.js";
6
+ import { mastersVariables as O } from "../theme/masters.js";
7
+ import { ActiveFeature as g } from "./Features/index.js";
8
+ import { MastersNavigation as x } from "./Navigation/MastersNavigation/index.js";
9
+ import { SDKContainer as I, SDKScrollContainer as L } from "./styles.js";
10
+ import { useSdkFeature as M } from "./useSdkFeature.js";
11
+ import { FeaturedGroupsButtonId as i } from "../navigation/button/FeaturedGroups.js";
12
+ import { ChannelsButtonId as s } from "../navigation/button/Channels.js";
13
+ import { LeaderBoardButtonId as v } from "../navigation/button/LeaderBoard.js";
14
14
  import "../theme/theme.js";
15
15
  import "@linaria/core";
16
16
  import "../theme/constants.js";
@@ -74,21 +74,49 @@ import "../navigation/index.js";
74
74
  import "../icons/index.js";
75
75
  import "../navigation/button/index.js";
76
76
  import "../navigation/button/styles.js";
77
- const Rr = ({ sdk: r, overlays: p, children: e }) => {
78
- const [t, a] = f(m), i = c(r.enabled) === "on", [, s] = F(r), d = () => {
79
- r.initializeApp().then(() => {
80
- a(m), r.openFeature(u.GAMES);
77
+ const j = ({ sdk: t }) => {
78
+ const [, m] = M(t);
79
+ return /* @__PURE__ */ o(g, { feature: m, sdk: t });
80
+ }, rr = ({ sdk: t, overlays: m, children: l, event: c }) => {
81
+ const [e, u] = S(!1), a = A(t.status) === "ready", [r, d] = S(i), n = F(
82
+ (p) => {
83
+ d(p), p === i ? (t.createEventSession(c), t.openFeature(B.GAMES)) : t.closeFeature();
84
+ },
85
+ [c, t]
86
+ );
87
+ E(() => {
88
+ !a && r === i && (d(s), t.closeFeature());
89
+ }, [a, r, t]);
90
+ const y = () => {
91
+ t.initializeApp().then(({ enabled: p, err: h }) => {
92
+ if (u(!0), h) {
93
+ n(s);
94
+ return;
95
+ }
96
+ if (p) {
97
+ n(i);
98
+ return;
99
+ }
81
100
  });
101
+ }, b = () => {
102
+ u(!1), t.disableApp();
82
103
  };
83
- return /* @__PURE__ */ o(S, { style: { height: "100%" }, children: /* @__PURE__ */ n(y, { className: b, children: [
84
- i && /* @__PURE__ */ o(h, { activeOverlay: t, setActiveOverlay: a }),
85
- /* @__PURE__ */ n(A, { "data-nav": i.toString(), children: [
86
- /* @__PURE__ */ o("div", { style: { display: !i || t === B ? "block" : "none" }, children: e && e({ enableSdk: d, disableSdk: r.disableApp }) }),
87
- /* @__PURE__ */ o("div", { style: { display: t === l ? "block" : "none" }, children: p && t === l && p[t] }),
88
- i && t === m && /* @__PURE__ */ o(v, { feature: s, sdk: r })
104
+ return /* @__PURE__ */ o(C, { style: { height: "100%" }, children: /* @__PURE__ */ f(I, { className: O, children: [
105
+ e && /* @__PURE__ */ o(
106
+ x,
107
+ {
108
+ sdkReady: a,
109
+ activeOverlay: r,
110
+ setActiveOverlay: n
111
+ }
112
+ ),
113
+ /* @__PURE__ */ f(L, { "data-nav": e.toString(), children: [
114
+ /* @__PURE__ */ o("div", { style: { display: !e || r === s ? "block" : "none" }, children: l && l({ enableSdk: y, disableSdk: b }) }),
115
+ /* @__PURE__ */ o("div", { style: { display: r === v ? "block" : "none" }, children: m && r === v && m[r] }),
116
+ e && r === i && /* @__PURE__ */ o(j, { sdk: t })
89
117
  ] })
90
118
  ] }) });
91
119
  };
92
120
  export {
93
- Rr as App
121
+ rr as MastersApp
94
122
  };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export declare const SDKContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
+ export declare const SDKScrollContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
@@ -0,0 +1,4 @@
1
+ import { Features } from '@streamlayer/sdk-web-features';
2
+ import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
3
+ import { FeatureType } from '@streamlayer/sdk-web-types';
4
+ export declare const useSdkFeature: (sdk: StreamLayerSDK) => [FeatureType, Features | null];
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
3
+ export declare const DemoPoints: React.FC<{
4
+ sdk: StreamLayerSDK;
5
+ }>;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
3
+ import type { Gamification } from '@streamlayer/feature-gamification';
4
+ export declare const GamificationComponent: React.FC<{
5
+ gamification: Gamification;
6
+ sdk: StreamLayerSDK;
7
+ }>;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
3
+ import type { Highlights } from '@streamlayer/feature-gamification';
4
+ export declare const HighlightsComponent: React.FC<{
5
+ highlights: Highlights;
6
+ sdk: StreamLayerSDK;
7
+ }>;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import type { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
3
+ export declare const LoginComponent: React.FC<{
4
+ sdk: StreamLayerSDK;
5
+ }>;
@@ -1,6 +1,7 @@
1
- import { jsx as i } from "react/jsx-runtime";
1
+ import { jsx as r } from "react/jsx-runtime";
2
2
  import "@streamlayer/sdk-web-anonymous-auth";
3
3
  import { Login as m } from "../login/index.js";
4
+ import { useStore as n } from "@nanostores/react";
4
5
  import "react";
5
6
  import "react-auth-code-input";
6
7
  import "react-phone-number-input";
@@ -14,11 +15,11 @@ import "@connectrpc/connect";
14
15
  import "@connectrpc/connect-web";
15
16
  import "@streamlayer/sl-eslib/users/users_connect";
16
17
  import "../login/styles.js";
17
- const A = ({ sdk: o }) => /* @__PURE__ */ i(m, { login: async (t) => {
18
+ const A = ({ sdk: o }) => n(o.getUserStore()).data ? /* @__PURE__ */ r("button", { onClick: o.logout, children: "logout" }) : /* @__PURE__ */ r(m, { login: async (i) => {
18
19
  try {
19
- await o.authorizationBypass("streamlayer:streamlayer", t);
20
- } catch (r) {
21
- throw console.log("login err", r), r;
20
+ await o.authorizationBypass("streamlayer:streamlayer", i);
21
+ } catch (t) {
22
+ throw console.log("login err", t), t;
22
23
  }
23
24
  }, anonymousLogin: o.anonymousAuthorization, host: o.host });
24
25
  export {
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const EventProvider: React.FC;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { Highlights } from '@streamlayer/feature-gamification';
3
+ export declare const Insight: React.FC<{
4
+ openedInsight: Exclude<Highlights['openedInsight']['value'], undefined>;
5
+ closeHighlights: () => void;
6
+ closeInsight: () => void;
7
+ }>;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import type { Highlights } from '@streamlayer/feature-gamification';
3
+ export declare const Insights: React.FC<{
4
+ highlights: Highlights;
5
+ store: ReturnType<Exclude<Highlights['insights'], undefined>['getStore']>;
6
+ }>;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import type { Gamification } from '@streamlayer/feature-gamification';
3
+ export declare const Leaderboard: React.FC<{
4
+ store: ReturnType<Exclude<Gamification['leaderboardList'], undefined>['getStore']>;
5
+ }>;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { GamificationBackground } from '@streamlayer/feature-gamification';
3
+ export declare const Question: React.FC<{
4
+ openedQuestion: Awaited<ReturnType<GamificationBackground['openedQuestion']['getValue']>>;
5
+ closeQuestion: () => void;
6
+ vote: (questionId: string, answerId: string) => void;
7
+ }>;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import type { Gamification } from '@streamlayer/feature-gamification';
3
+ export declare const QuestionsList: React.FC<{
4
+ store: ReturnType<Exclude<Gamification['questions'], undefined>['getStore']>;
5
+ openQuestion: (questionId: string) => void;
6
+ }>;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import type { Gamification } from '@streamlayer/feature-gamification';
3
+ export declare const UserSummary: React.FC<{
4
+ store: ReturnType<Exclude<Gamification['userSummary'], undefined>['getStore']>;
5
+ }>;
@@ -0,0 +1,7 @@
1
+ export { UserSummary } from './UserSummary';
2
+ export { QuestionsList } from './QuestionsList';
3
+ export { Question } from './Question';
4
+ export { Onboarding } from '../../gamification/onboarding';
5
+ export { Insights } from './Insights';
6
+ export { Insight } from './Insight';
7
+ export { Leaderboard } from './Leaderboard';
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
3
+ export declare const Demo: React.FC<{
4
+ sdk: StreamLayerSDK;
5
+ }>;
@@ -1,16 +1,16 @@
1
- import { jsx as o, jsxs as u, Fragment as b } from "react/jsx-runtime";
2
- import { FeatureStatus as f } from "@streamlayer/sdk-web-interfaces";
1
+ import { jsx as i, jsxs as f, Fragment as v } from "react/jsx-runtime";
2
+ import { FeatureStatus as l } from "@streamlayer/sdk-web-interfaces";
3
3
  import { FeatureType as g } from "@streamlayer/sdk-web-types";
4
- import { AvailableFeatures as A } from "@streamlayer/sdk-web-features";
5
- import { useState as E, useMemo as h, useEffect as F } from "react";
4
+ import { AvailableFeatures as S } from "@streamlayer/sdk-web-features";
5
+ import { useState as b, useMemo as h, useEffect as C } from "react";
6
6
  import "@streamlayer/sdk-web-storage";
7
7
  import "@streamlayer/sdk-web-api";
8
8
  import { useStore as c } from "@nanostores/react";
9
- import { Notifications as D } from "../notifications/index.js";
10
- import { GamificationComponent as C } from "./Gamification.js";
11
- import { HighlightsComponent as N } from "./Highlights.js";
12
- import { LoginComponent as T } from "./Login.js";
13
- import { Buttons as H, Button as s } from "./styles.js";
9
+ import { Notifications as F } from "../notifications/index.js";
10
+ import { GamificationComponent as w } from "./Gamification.js";
11
+ import { HighlightsComponent as G } from "./Highlights.js";
12
+ import { LoginComponent as H } from "./Login.js";
13
+ import { Buttons as x, Button as s } from "./styles.js";
14
14
  import "../notifications/notification/index.js";
15
15
  import "@streamlayer/sdk-web-notifications";
16
16
  import "../notifications/notification/onboarding-inapp/index.js";
@@ -87,62 +87,54 @@ import "@connectrpc/connect";
87
87
  import "@connectrpc/connect-web";
88
88
  import "@streamlayer/sl-eslib/users/users_connect";
89
89
  import "../login/styles.js";
90
- var y;
91
- (function(t) {
92
- t.SCHEMA = "schema", t.TOKEN = "token";
93
- })(y || (y = {}));
94
- var v;
95
- (function(t) {
96
- t.DISABLED = "disabled", t.INITIALIZATION = "initialization", t.READY = "ready", t.FAILED = "failed", t.SUSPENDED = "suspended";
97
- })(v || (v = {}));
98
- const L = ({ activeFeature: t, sdk: r }) => {
99
- const [e, n] = E(null), { organizationSettings: a, streamSettings: l } = c(r.sdkStore), S = h(() => {
100
- const i = (l == null ? void 0 : l.data) || (a == null ? void 0 : a.data);
101
- return i != null && i.overlays ? i.overlays : [];
102
- }, [a, l]);
103
- F(() => {
104
- const i = r.getFeatures();
105
- if (t)
106
- for (const [m, p] of i)
107
- m === t ? p.status.get() === f.Suspended && (p.enable(), n(p)) : p.status.get() === f.Ready && p.disable();
90
+ const A = ({ activeFeature: r, sdk: o }) => {
91
+ const [e, n] = b(null), { organizationSettings: a, streamSettings: u } = c(o.sdkStore), y = h(() => {
92
+ const t = (u == null ? void 0 : u.data) || (a == null ? void 0 : a.data);
93
+ return t != null && t.overlays ? t.overlays : [];
94
+ }, [a, u]);
95
+ C(() => {
96
+ const t = o.getFeatures();
97
+ if (r)
98
+ for (const [m, p] of t)
99
+ m === r ? p.status.get() === l.Suspended && (p.enable(), n(p)) : p.status.get() === l.Ready && p.disable();
108
100
  else {
109
- for (const [, m] of i)
110
- m.status.get() === f.Ready && m.disable();
101
+ for (const [, m] of t)
102
+ m.status.get() === l.Ready && m.disable();
111
103
  n(null);
112
104
  }
113
105
  return () => {
114
- for (const [, m] of i)
115
- m.status.get() === f.Ready && m.disable();
106
+ for (const [, m] of t)
107
+ m.status.get() === l.Ready && m.disable();
116
108
  };
117
- }, [t, r]);
118
- const d = h(() => e ? e.featureConfig.get().type === g.GAMES ? e ? /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(C, { gamification: e, sdk: r }) }) : /* @__PURE__ */ o("div", { children: "wait gamification..." }) : e.featureConfig.get().type === g.HIGHLIGHTS ? e ? /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(N, { highlights: e, sdk: r }) }) : /* @__PURE__ */ o("div", { children: "wait highlights..." }) : /* @__PURE__ */ o("div", { children: "unknown feature" }) : null, [r, e]);
119
- return /* @__PURE__ */ u("div", { children: [
120
- /* @__PURE__ */ u(H, { children: [
121
- /* @__PURE__ */ o(s, { onClick: () => r.closeFeature(), disabled: !d, children: "close" }),
122
- /* @__PURE__ */ o(s, { onClick: () => r.logout(), children: "logout" }),
123
- S.map((i) => /* @__PURE__ */ u(
109
+ }, [r, o]);
110
+ const d = h(() => e ? e.featureConfig.get().type === g.GAMES ? e ? /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(w, { gamification: e, sdk: o }) }) : /* @__PURE__ */ i("div", { children: "wait gamification..." }) : e.featureConfig.get().type === g.HIGHLIGHTS ? e ? /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(G, { highlights: e, sdk: o }) }) : /* @__PURE__ */ i("div", { children: "wait highlights..." }) : /* @__PURE__ */ i("div", { children: "unknown feature" }) : null, [o, e]);
111
+ return /* @__PURE__ */ f("div", { children: [
112
+ /* @__PURE__ */ f(x, { children: [
113
+ /* @__PURE__ */ i(s, { onClick: () => o.closeFeature(), disabled: !d, children: "close" }),
114
+ /* @__PURE__ */ i(s, { onClick: () => o.logout(), children: "logout" }),
115
+ y.map((t) => /* @__PURE__ */ f(
124
116
  s,
125
117
  {
126
- onClick: () => r.openFeature(i.type),
127
- disabled: !(i.type in A),
128
- "data-enable_sdk_button": i.enableSdkButton.toString(),
129
- "data-selected": i.type === t,
118
+ onClick: () => o.openFeature(t.type),
119
+ disabled: !(t.type in S),
120
+ "data-enable_sdk_button": t.enableSdkButton.toString(),
121
+ "data-selected": t.type === r,
130
122
  children: [
131
- /* @__PURE__ */ o("img", { src: i.icon, alt: "" }),
132
- i.name
123
+ /* @__PURE__ */ i("img", { src: t.icon, alt: "" }),
124
+ t.name
133
125
  ]
134
126
  },
135
- i.name
127
+ t.name
136
128
  ))
137
129
  ] }),
138
130
  d
139
131
  ] });
140
- }, ui = ({ sdk: t }) => {
141
- const r = c(t.organizationStore()), e = c(t.getUserStore()), n = c(t.getActiveFeature());
142
- return r.loading ? /* @__PURE__ */ o("div", { children: "authentication..." }) : r.data ? e.loading ? /* @__PURE__ */ o("div", { children: "authentication..." }) : e.data ? /* @__PURE__ */ u(b, { children: [
143
- /* @__PURE__ */ o(D, { notificationsStore: t.getNotificationsStore() }),
144
- /* @__PURE__ */ o(L, { sdk: t, activeFeature: n })
145
- ] }) : /* @__PURE__ */ o(T, { sdk: t }) : /* @__PURE__ */ o("div", { children: "wrong sdk key..." });
132
+ }, ui = ({ sdk: r }) => {
133
+ const o = c(r.organizationStore()), e = c(r.getUserStore()), n = c(r.getActiveFeature());
134
+ return o.loading ? /* @__PURE__ */ i("div", { children: "authentication..." }) : o.data ? e.loading ? /* @__PURE__ */ i("div", { children: "authentication..." }) : e.data ? /* @__PURE__ */ f(v, { children: [
135
+ /* @__PURE__ */ i(F, { notificationsStore: r.getNotificationsStore() }),
136
+ /* @__PURE__ */ i(A, { sdk: r, activeFeature: n })
137
+ ] }) : /* @__PURE__ */ i(H, { sdk: r }) : /* @__PURE__ */ i("div", { children: "wrong sdk key..." });
146
138
  };
147
139
  export {
148
140
  ui as Demo
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare const DemoContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
+ export declare const UserStatisticsContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
+ export declare const QuestionsContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
5
+ export declare const Buttons: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
6
+ export declare const Button: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ type CommonHeaderProps = {
3
+ icon?: string;
4
+ comeBack?: () => void;
5
+ close?: () => void;
6
+ };
7
+ export declare const CommonHeader: React.FC<CommonHeaderProps>;
8
+ export {};
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const Container: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
+ export declare const Button: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
4
+ export declare const HeaderIcon: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown>>;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ type DetailedInsightProps = {
3
+ image?: string;
4
+ title?: string;
5
+ description?: string;
6
+ webLinkLabel?: string;
7
+ webLink?: string;
8
+ closeHighlights: () => void;
9
+ closeInsight: () => void;
10
+ };
11
+ export declare const DetailedInsight: React.FC<DetailedInsightProps>;
12
+ export {};
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ export declare const Container: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
+ export declare const Image: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown>>;
4
+ export declare const AdditionalContent: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
5
+ export declare const Title: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
6
+ export declare const Description: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
7
+ export declare const AdditionalBtn: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLAnchorElement> & import("react").AnchorHTMLAttributes<HTMLAnchorElement> & Record<never, unknown>>;
8
+ export declare const LinkIcon: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown>>;