@streamlayer/react-ui
Advanced tools
@@ -1,14 +0,14 @@ | ||
import { QuestionInApp as Vo } from "./ui/notifications/notification/question-inapp/index.js"; | ||
import { Login as No } from "./ui/login/index.js"; | ||
import { Onboarding as Uo } from "./ui/gamification/onboarding/index.js"; | ||
import { ActivePages as ko, Navigation as qo } from "./ui/gamification/navigation/index.js"; | ||
import { LeaderboardItemDetail as zo } from "./ui/gamification/leaderboard-item-detail/index.js"; | ||
import { Question as Co } from "./ui/gamification/question/index.js"; | ||
import { QuestionList as Fo } from "./ui/gamification/question-list/index.js"; | ||
import { UserStatistics as Ho } from "./ui/gamification/user-statistics/index.js"; | ||
import { Vote as Ko } from "./ui/gamification/vote/index.js"; | ||
import { Demo as Ro } from "./ui/demo/index.js"; | ||
import { Points as Xo } from "./ui/gamification/points/index.js"; | ||
import { StreamLayerThemeProvider as Zo } from "./ui/theme/index.js"; | ||
import { ThemeVariables as $o, theme as or, themeStr as rr } from "./ui/theme/theme.js"; | ||
import { QuestionInApp as yo } from "./ui/notifications/notification/question-inapp/index.js"; | ||
import { Login as Oo } from "./ui/login/index.js"; | ||
import { Onboarding as jo } from "./ui/gamification/onboarding/index.js"; | ||
import { ActivePages as qo, Navigation as wo } from "./ui/gamification/navigation/index.js"; | ||
import { LeaderboardItemDetail as Bo } from "./ui/gamification/leaderboard-item-detail/index.js"; | ||
import { Question as Eo } from "./ui/gamification/question/index.js"; | ||
import { QuestionList as Go } from "./ui/gamification/question-list/index.js"; | ||
import { UserStatistics as Jo } from "./ui/gamification/user-statistics/index.js"; | ||
import { Vote as Mo } from "./ui/gamification/vote/index.js"; | ||
import { Demo as Wo } from "./ui/demo/index.js"; | ||
import { Points as Yo } from "./ui/gamification/points/index.js"; | ||
import { StreamLayerThemeProvider as _o } from "./ui/theme/index.js"; | ||
import { ThemeVariables as or, theme as rr, themeStr as tr } from "./ui/theme/theme.js"; | ||
import "react/jsx-runtime"; | ||
@@ -72,2 +72,3 @@ import "react"; | ||
import "./ui/gamification/vote/components/voting-header/components/points/styles.js"; | ||
import "./fedex-a8dcc7b2.js"; | ||
import "./ui/gamification/insight/styles.js"; | ||
@@ -95,18 +96,18 @@ import "./ui/gamification/insight-list/styles.js"; | ||
export { | ||
ko as ActivePages, | ||
Ro as Demo, | ||
zo as LeaderboardItemDetail, | ||
No as Login, | ||
qo as Navigation, | ||
Uo as Onboarding, | ||
Xo as Points, | ||
Co as Question, | ||
Vo as QuestionInApp, | ||
Fo as QuestionList, | ||
Zo as StreamLayerThemeProvider, | ||
$o as ThemeVariables, | ||
Ho as UserStatistics, | ||
Ko as Vote, | ||
or as theme, | ||
rr as themeStr | ||
qo as ActivePages, | ||
Wo as Demo, | ||
Bo as LeaderboardItemDetail, | ||
Oo as Login, | ||
wo as Navigation, | ||
jo as Onboarding, | ||
Yo as Points, | ||
Eo as Question, | ||
yo as QuestionInApp, | ||
Go as QuestionList, | ||
_o as StreamLayerThemeProvider, | ||
or as ThemeVariables, | ||
Jo as UserStatistics, | ||
Mo as Vote, | ||
rr as theme, | ||
tr as themeStr | ||
}; |
@@ -1,8 +0,8 @@ | ||
import { UserSummary as or } from "./UserSummary.js"; | ||
import { QuestionsList as mr } from "./QuestionsList.js"; | ||
import { Question as ir } from "./Question.js"; | ||
import { Onboarding as sr } from "../../gamification/onboarding/index.js"; | ||
import { Insights as xr } from "./Insights.js"; | ||
import { Insight as ar } from "./Insight.js"; | ||
import { Leaderboard as gr } from "./Leaderboard.js"; | ||
import { UserSummary as tr } from "./UserSummary.js"; | ||
import { QuestionsList as pr } from "./QuestionsList.js"; | ||
import { Question as er } from "./Question.js"; | ||
import { Onboarding as fr } from "../../gamification/onboarding/index.js"; | ||
import { Insights as nr } from "./Insights.js"; | ||
import { Insight as dr } from "./Insight.js"; | ||
import { Leaderboard as ur } from "./Leaderboard.js"; | ||
import "react/jsx-runtime"; | ||
@@ -38,2 +38,3 @@ import "@nanostores/react"; | ||
import "../../gamification/vote/components/voting-header/components/points/styles.js"; | ||
import "../../../fedex-a8dcc7b2.js"; | ||
import "../../gamification/onboarding/styles.js"; | ||
@@ -63,9 +64,9 @@ import "../../gamification/onboarding/components/onboarding-slides/onboarding-instructions/index.js"; | ||
export { | ||
ar as Insight, | ||
xr as Insights, | ||
gr as Leaderboard, | ||
sr as Onboarding, | ||
ir as Question, | ||
mr as QuestionsList, | ||
or as UserSummary | ||
dr as Insight, | ||
nr as Insights, | ||
ur as Leaderboard, | ||
fr as Onboarding, | ||
er as Question, | ||
pr as QuestionsList, | ||
tr as UserSummary | ||
}; |
@@ -1,6 +0,7 @@ | ||
import { jsx as D, jsxs as t } from "react/jsx-runtime"; | ||
import { jsx as o, jsxs as n } from "react/jsx-runtime"; | ||
import { styled as y } from "@linaria/react"; | ||
import { useState as r, useCallback as u, useMemo as i } from "react"; | ||
import { Vote as L } from "../../gamification/vote/index.js"; | ||
import { VotingHeader as E } from "../../gamification/vote/components/voting-header/index.js"; | ||
import { useState as d, useCallback as x, useMemo as c } from "react"; | ||
import { Vote as g } from "../../gamification/vote/index.js"; | ||
import { VotingHeader as h } from "../../gamification/vote/components/voting-header/index.js"; | ||
import { i as b } from "../../../fedex-a8dcc7b2.js"; | ||
import "@streamlayer/sdk-web-types"; | ||
@@ -18,3 +19,3 @@ import "../../../index-7045fbb2.js"; | ||
import "../../gamification/vote/components/voting-header/components/points/styles.js"; | ||
const O = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjgiIGhlaWdodD0iMjIiIHZpZXdCb3g9IjAgMCA2OCAyMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlZlY3RvciI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNTYuNjE1NSA3LjQ0MTQ2SDUwLjcwNjZMNTYuMzA3MiAxMy44NjE1TDUwLjcwNjYgMjAuMjgwNUg1Ni40MzU3TDU5LjE1ODcgMTcuMTM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kyNCAxMi4wNjE3IDM0LjkyNCAxMy44NzY3QzM0LjkyNCAxNS41OTc2IDM0LjExNDQgMTcuMjAxNiAzMi4yNDIgMTcuMjAxNloiIGZpbGw9IndoaXRlIi8+CjwvZz4KPC9zdmc+Cg==", w = y.div` | ||
const k = y.div` | ||
position: absolute; | ||
@@ -46,51 +47,51 @@ top: 0; | ||
} | ||
`, Q = ({ openedQuestion: M, closeQuestion: A, vote: g }) => { | ||
var I; | ||
const [z, T] = r(!1), c = u( | ||
(j) => { | ||
T(j); | ||
`, F = ({ openedQuestion: t, closeQuestion: a, vote: e }) => { | ||
var s; | ||
const [l, m] = d(!1), p = x( | ||
(i) => { | ||
m(i); | ||
}, | ||
[T] | ||
), N = i( | ||
() => M == null ? void 0 : M.answers.find((j) => j.youVoted === !0), | ||
[M] | ||
), x = i( | ||
() => !!(M != null && M.answers.find((j) => j.correct === !0)), | ||
[M] | ||
[m] | ||
), r = c( | ||
() => t == null ? void 0 : t.answers.find((i) => i.youVoted === !0), | ||
[t] | ||
), f = c( | ||
() => !!(t != null && t.answers.find((i) => i.correct === !0)), | ||
[t] | ||
); | ||
return M ? /* @__PURE__ */ D(w, { children: /* @__PURE__ */ t("div", { children: [ | ||
/* @__PURE__ */ D( | ||
E, | ||
return t ? /* @__PURE__ */ o(k, { children: /* @__PURE__ */ n("div", { children: [ | ||
/* @__PURE__ */ o( | ||
h, | ||
{ | ||
points: (N == null ? void 0 : N.points) || 0, | ||
questionAnswered: !!N, | ||
questionAnsweredCorrectly: N == null ? void 0 : N.correct, | ||
logo: O, | ||
closeQuestion: A, | ||
setTimeToExpire: c, | ||
questionType: M.type | ||
points: (r == null ? void 0 : r.points) || 0, | ||
questionAnswered: !!r, | ||
questionAnsweredCorrectly: r == null ? void 0 : r.correct, | ||
logo: b, | ||
closeQuestion: a, | ||
setTimeToExpire: p, | ||
questionType: t.type | ||
} | ||
), | ||
/* @__PURE__ */ D("div", { children: /* @__PURE__ */ D( | ||
L, | ||
/* @__PURE__ */ o("div", { children: /* @__PURE__ */ o( | ||
g, | ||
{ | ||
title: M.subject, | ||
feedbackMessages: (I = M.options) == null ? void 0 : I.options.value, | ||
questionType: M.type, | ||
questionId: M.id, | ||
questionAnswered: !!N, | ||
questionAnsweredCorrectly: N == null ? void 0 : N.correct, | ||
options: M.answers.map((j) => ({ | ||
id: j.id, | ||
title: j.text, | ||
icon: j.icon, | ||
type: M.type, | ||
correct: j.correct, | ||
percentage: j.percentage, | ||
answered: j.youVoted, | ||
disabled: !!N || M.marketClosed || z, | ||
questionAnswered: !!N, | ||
hasCorrectAnswer: x, | ||
points: j.points, | ||
onVote: g | ||
title: t.subject, | ||
feedbackMessages: (s = t.options) == null ? void 0 : s.options.value, | ||
questionType: t.type, | ||
questionId: t.id, | ||
questionAnswered: !!r, | ||
questionAnsweredCorrectly: r == null ? void 0 : r.correct, | ||
options: t.answers.map((i) => ({ | ||
id: i.id, | ||
title: i.text, | ||
icon: i.icon, | ||
type: t.type, | ||
correct: i.correct, | ||
percentage: i.percentage, | ||
answered: i.youVoted, | ||
disabled: !!r || t.marketClosed || l, | ||
questionAnswered: !!r, | ||
hasCorrectAnswer: f, | ||
points: i.points, | ||
onVote: e | ||
})) | ||
@@ -102,3 +103,3 @@ } | ||
export { | ||
Q as Question | ||
F as Question | ||
}; |
@@ -1,23 +0,23 @@ | ||
import { jsx as e } from "react/jsx-runtime"; | ||
import { FeatureType as n } from "@streamlayer/sdk-web-types"; | ||
import { useStore as s } from "@nanostores/react"; | ||
import { styled as p } from "@linaria/react"; | ||
import { Points as u } from "../gamification/points/index.js"; | ||
import { jsx as r } from "react/jsx-runtime"; | ||
import { FeatureType as s } from "@streamlayer/sdk-web-types"; | ||
import { useStore as p } from "@nanostores/react"; | ||
import { styled as u } from "@linaria/react"; | ||
import { Points as a } from "../gamification/points/index.js"; | ||
import "../gamification/points/styles.js"; | ||
import "../icons/index.js"; | ||
import "react"; | ||
const a = p.div` | ||
const d = u.div` | ||
position: fixed; | ||
top: 0; | ||
right: 0; | ||
`, g = ({ sdk: m }) => { | ||
var o, i; | ||
const t = m.getFeature(n.GAMES); | ||
if (!(t != null && t.userSummary)) | ||
return null; | ||
const r = s(t.userSummary.getStore()); | ||
return ((i = (o = r.data) == null ? void 0 : o.summary) == null ? void 0 : i.points) === void 0 ? null : /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e(u, { points: r.data.summary.points }) }); | ||
`, f = ({ store: o }) => { | ||
var e, m, n, i; | ||
const t = p(o); | ||
return ((m = (e = t.data) == null ? void 0 : e.summary) == null ? void 0 : m.points) === void 0 ? null : /* @__PURE__ */ r(d, { children: ((i = (n = t.data) == null ? void 0 : n.summary) == null ? void 0 : i.points) && /* @__PURE__ */ r(a, { points: t.data.summary.points }) }); | ||
}, v = ({ sdk: o }) => { | ||
const t = o.getFeature(s.GAMES); | ||
return t != null && t.userSummary ? /* @__PURE__ */ r(f, { store: t.userSummary.getStore() }) : null; | ||
}; | ||
export { | ||
g as DemoPoints | ||
v as DemoPoints | ||
}; |
@@ -44,2 +44,3 @@ import { jsx as r, jsxs as s, Fragment as k } from "react/jsx-runtime"; | ||
import "../gamification/vote/components/voting-header/components/points/styles.js"; | ||
import "../../fedex-a8dcc7b2.js"; | ||
import "../gamification/onboarding/styles.js"; | ||
@@ -61,3 +62,3 @@ import "../gamification/onboarding/components/onboarding-slides/onboarding-instructions/index.js"; | ||
import "../gamification/leaderboard-list/styles.js"; | ||
const pr = ({ | ||
const mr = ({ | ||
gamification: t, | ||
@@ -114,3 +115,3 @@ sdk: u | ||
export { | ||
pr as GamificationComponent | ||
mr as GamificationComponent | ||
}; |
@@ -40,2 +40,3 @@ import { jsx as t, jsxs as s } from "react/jsx-runtime"; | ||
import "../gamification/vote/components/voting-header/components/points/styles.js"; | ||
import "../../fedex-a8dcc7b2.js"; | ||
import "../gamification/insight-list/index.js"; | ||
@@ -48,3 +49,3 @@ import "../gamification/insight/index.js"; | ||
import "../gamification/detailed-insight/styles.js"; | ||
const mt = ({ highlights: i, sdk: e }) => { | ||
const pt = ({ highlights: i, sdk: e }) => { | ||
const n = m(i.status), r = m(i.openedInsight), { slStreamId: o } = m(e.sdkStore); | ||
@@ -64,3 +65,3 @@ return n !== d.Ready ? /* @__PURE__ */ t("div", { children: "wait..." }) : o != null && o.loading ? /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t("div", { children: "Event is loading" }) }) : o != null && o.data ? i.insights === void 0 ? /* @__PURE__ */ t("div", { children: "wait insights..." }) : /* @__PURE__ */ s(p, { children: [ | ||
export { | ||
mt as HighlightsComponent | ||
pt as HighlightsComponent | ||
}; |
@@ -51,2 +51,3 @@ import { jsx as i, jsxs as f, Fragment as v } from "react/jsx-runtime"; | ||
import "../gamification/vote/components/voting-header/components/points/styles.js"; | ||
import "../../fedex-a8dcc7b2.js"; | ||
import "../gamification/onboarding/index.js"; | ||
@@ -129,3 +130,3 @@ import "../gamification/onboarding/styles.js"; | ||
] }); | ||
}, mi = ({ sdk: r }) => { | ||
}, pi = ({ sdk: r }) => { | ||
const o = c(r.organizationStore()), e = c(r.getUserStore()), n = c(r.getActiveFeature()); | ||
@@ -138,3 +139,3 @@ return o.loading ? /* @__PURE__ */ i("div", { children: "authentication..." }) : o.data ? e.loading ? /* @__PURE__ */ i("div", { children: "authentication..." }) : e.data ? /* @__PURE__ */ f(v, { children: [ | ||
export { | ||
mi as Demo | ||
pi as Demo | ||
}; |
import { jsxs as e, jsx as o } from "react/jsx-runtime"; | ||
import { useMemo as c, useState as f } from "react"; | ||
import { useMemo as x, useState as g } from "react"; | ||
import { styled as i } from "@linaria/react"; | ||
import { DeveloperStorage as x } from "../storage.js"; | ||
import { EventInput as g } from "./eventInput.js"; | ||
import { BypassLogin as h } from "./bypassLogin.js"; | ||
import { SdkKey as u } from "./sdkKey.js"; | ||
import { EnvToggle as b } from "./envToggle.js"; | ||
import { DeveloperStorage as h } from "../storage.js"; | ||
import { EventInput as u } from "./eventInput.js"; | ||
import { BypassLogin as b } from "./bypassLogin.js"; | ||
import { SdkKey as v } from "./sdkKey.js"; | ||
import { EnvToggle as y } from "./envToggle.js"; | ||
import "@streamlayer/sdk-web-storage"; | ||
@@ -13,3 +13,3 @@ import "@streamlayer/sdk-web-core"; | ||
import "./styles.js"; | ||
const v = i.div` | ||
const w = i.div` | ||
position: fixed; | ||
@@ -19,3 +19,3 @@ bottom: 0; | ||
max-width: 600px; | ||
`, y = i.div` | ||
`, D = i.div` | ||
flex-direction: column; | ||
@@ -37,3 +37,3 @@ gap: 10px; | ||
} | ||
`, w = i.button` | ||
`, j = i.button` | ||
position: absolute; | ||
@@ -77,6 +77,6 @@ z-index: 10000; | ||
} | ||
`, T = ({ sdk: t, sdkKey: s, setSdkKey: n, env: m, setEnv: p }) => { | ||
const r = c(() => new x(), []), [a, d] = f(!1); | ||
return /* @__PURE__ */ e(v, { children: [ | ||
/* @__PURE__ */ e(w, { "data-opened": a.toString(), onClick: () => d((l) => !l), children: [ | ||
`, q = ({ sdk: t, sdkKey: s, setSdkKey: n, env: m, setEnv: p, event: d, setEvent: l }) => { | ||
const r = x(() => new h(), []), [a, c] = g(!1); | ||
return /* @__PURE__ */ e(w, { children: [ | ||
/* @__PURE__ */ e(j, { "data-opened": a.toString(), onClick: () => c((f) => !f), children: [ | ||
/* @__PURE__ */ o("span", {}), | ||
@@ -86,7 +86,7 @@ /* @__PURE__ */ o("span", {}), | ||
] }), | ||
a && /* @__PURE__ */ e(y, { children: [ | ||
p && /* @__PURE__ */ o(b, { env: m, setEnv: p, storage: r }), | ||
n && /* @__PURE__ */ o(u, { sdkKey: s, setSdkKey: n, storage: r }), | ||
t && /* @__PURE__ */ o(g, { sdk: t, storage: r }), | ||
t && /* @__PURE__ */ o(h, { sdk: t, storage: r }) | ||
a && /* @__PURE__ */ e(D, { children: [ | ||
p && /* @__PURE__ */ o(y, { env: m, setEnv: p, storage: r }), | ||
n && /* @__PURE__ */ o(v, { sdkKey: s, setSdkKey: n, storage: r }), | ||
t && /* @__PURE__ */ o(u, { sdk: t, storage: r, event: d, setEvent: l }), | ||
t && /* @__PURE__ */ o(b, { sdk: t, storage: r }) | ||
] }) | ||
@@ -96,3 +96,3 @@ ] }); | ||
export { | ||
T as Developer | ||
q as Developer | ||
}; |
@@ -41,9 +41,9 @@ import { jsxs as t, jsx as e } from "react/jsx-runtime"; | ||
background: gray; | ||
box-shadow: 0 0.1em 0.3em rgba(0,0,0,0.3); | ||
box-shadow: 0 0.1em 0.3em rgba(0, 0, 0, 0.3); | ||
transition: all 300ms; | ||
} | ||
`, m = ({ env: r, setEnv: i, storage: s }) => /* @__PURE__ */ t(d, { children: [ | ||
`, u = ({ env: r, setEnv: i, storage: s }) => /* @__PURE__ */ t(d, { children: [ | ||
/* @__PURE__ */ e("label", { htmlFor: "slEnvCheckbox", children: "Production:" }), | ||
/* @__PURE__ */ t(a, { children: [ | ||
/* @__PURE__ */ e("input", { id: "slEnvCheckbox", type: "checkbox", checked: r === "production", onChange: () => { | ||
/* @__PURE__ */ e("input", { id: "slEnvCheckbox", type: "checkbox", checked: r === "production", onChange: (p) => { | ||
i((c) => { | ||
@@ -58,3 +58,3 @@ const n = c === "production" ? "development" : "production"; | ||
export { | ||
m as EnvToggle | ||
u as EnvToggle | ||
}; |
import { jsx as t, jsxs as c } from "react/jsx-runtime"; | ||
import "@streamlayer/sdk-web-core"; | ||
import { useState as p, useEffect as d } from "react"; | ||
import { useEffect as d } from "react"; | ||
import { useStore as m } from "@nanostores/react"; | ||
import { InputField as u } from "./styles.js"; | ||
import "@linaria/react"; | ||
const I = ({ sdk: n, storage: s }) => { | ||
var i; | ||
const { organizationSettings: r } = m(n.sdkStore), v = !((i = r == null ? void 0 : r.data) != null && i.provider), [e, l] = p(s.getEvent() || ""), o = () => { | ||
n.createEventSession(e), s.setEvent(e); | ||
const y = ({ sdk: o, storage: i, event: e, setEvent: l }) => { | ||
var n; | ||
const { organizationSettings: r } = m(o.sdkStore), a = !((n = r == null ? void 0 : r.data) != null && n.provider), s = () => { | ||
o.createEventSession(e), i.setEvent(e); | ||
}; | ||
return d(() => { | ||
e && o(); | ||
e && s(); | ||
}, []), /* @__PURE__ */ t("div", { children: /* @__PURE__ */ c(u, { children: [ | ||
/* @__PURE__ */ t("label", { children: v ? "Use StreamLayer event ids" : "Use your provider event ids" }), | ||
/* @__PURE__ */ t("input", { type: "text", value: e, onChange: (a) => l(a.target.value) }), | ||
/* @__PURE__ */ t("button", { onClick: o, children: "set" }) | ||
/* @__PURE__ */ t("label", { children: a ? "Use StreamLayer event ids" : "Use your provider event ids" }), | ||
/* @__PURE__ */ t("input", { type: "text", value: e, onChange: (p) => l(p.target.value) }), | ||
/* @__PURE__ */ t("button", { onClick: s, children: "set" }) | ||
] }) }); | ||
}; | ||
export { | ||
I as EventInput | ||
y as EventInput | ||
}; |
@@ -13,5 +13,12 @@ import { jsx as t, jsxs as l } from "react/jsx-runtime"; | ||
/* @__PURE__ */ t("label", { children: "SDK Key" }), | ||
/* @__PURE__ */ t("input", { type: "text", value: e, onChange: (s) => { | ||
o(s.target.value); | ||
} }), | ||
/* @__PURE__ */ t( | ||
"input", | ||
{ | ||
type: "text", | ||
value: e, | ||
onChange: (s) => { | ||
o(s.target.value); | ||
} | ||
} | ||
), | ||
/* @__PURE__ */ t("button", { onClick: () => { | ||
@@ -18,0 +25,0 @@ n.setSdkKey(e), i(e); |
@@ -1,7 +0,7 @@ | ||
import { jsx as t, jsxs as f, Fragment as k } from "react/jsx-runtime"; | ||
import { anonymous as g } from "@streamlayer/sdk-web-anonymous-auth"; | ||
import { useMemo as p, useState as d } from "react"; | ||
import { Developer as S } from "./components/developer.js"; | ||
import { useStreamLayerApp as v } from "./useStreamLayerApp.js"; | ||
import { DeveloperStorage as y } from "./storage.js"; | ||
import { jsx as e, jsxs as S, Fragment as g } from "react/jsx-runtime"; | ||
import { anonymous as y } from "@streamlayer/sdk-web-anonymous-auth"; | ||
import { useMemo as d, useState as m, useEffect as E } from "react"; | ||
import { Developer as l } from "./components/developer.js"; | ||
import { useStreamLayerApp as D } from "./useStreamLayerApp.js"; | ||
import { DeveloperStorage as w } from "./storage.js"; | ||
import "@linaria/react"; | ||
@@ -17,20 +17,33 @@ import "./components/eventInput.js"; | ||
import "@streamlayer/sdk-web-storage"; | ||
function l({ | ||
Component: r, | ||
Story: o, | ||
args: D | ||
function x({ | ||
Component: o, | ||
Story: r, | ||
args: u | ||
}) { | ||
const m = p(() => new y(), []), [n, c] = d(m.getEnv()), [s, a] = d(m.getSdkKey() || "set-sdk-key"), u = p(() => { | ||
const i = /* @__PURE__ */ new Set(); | ||
return i.add(g), i; | ||
}, []), e = v(s, u, n === "production"); | ||
return /* @__PURE__ */ f(k, { children: [ | ||
e ? /* @__PURE__ */ t(r, { Story: o, sdk: e }) : /* @__PURE__ */ t("div", { children: "wait sdk..." }), | ||
/* @__PURE__ */ t(S, { sdk: e, sdkKey: s, setSdkKey: a, env: n, setEnv: c }) | ||
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(() => { | ||
const c = /* @__PURE__ */ new Set(); | ||
return c.add(y), c; | ||
}, []), t = D(p, k, i === "production"); | ||
return E(() => { | ||
s && t && t.createEventSession(s); | ||
}, [t]), /* @__PURE__ */ S(g, { children: [ | ||
t ? /* @__PURE__ */ e(o, { Story: r, sdk: t, args: u }) : /* @__PURE__ */ e("div", { children: "wait sdk..." }), | ||
/* @__PURE__ */ e( | ||
l, | ||
{ | ||
sdk: t, | ||
sdkKey: p, | ||
setSdkKey: f, | ||
env: i, | ||
setEnv: a, | ||
event: s, | ||
setEvent: v | ||
} | ||
) | ||
] }); | ||
} | ||
function H(r) { | ||
function N(o) { | ||
return { | ||
decorators: [ | ||
(o) => /* @__PURE__ */ t(l, { Story: o, Component: r }) | ||
(r) => /* @__PURE__ */ e(x, { Story: r, Component: o }) | ||
] | ||
@@ -40,3 +53,3 @@ }; | ||
export { | ||
H as createDemo | ||
N as createDemo | ||
}; |
{ | ||
"name": "@streamlayer/react-ui", | ||
"version": "0.27.3", | ||
"version": "0.28.0", | ||
"type": "module", | ||
@@ -25,10 +25,10 @@ "main": "./src/index.js", | ||
"@streamlayer/sl-eslib": "^5.45.1", | ||
"@streamlayer/feature-gamification": "^0.16.0", | ||
"@streamlayer/sdk-web": "^0.27.0", | ||
"@streamlayer/sdk-web-anonymous-auth": "^0.10.5", | ||
"@streamlayer/feature-gamification": "^0.17.0", | ||
"@streamlayer/sdk-web": "^0.27.1", | ||
"@streamlayer/sdk-web-anonymous-auth": "^0.10.6", | ||
"@streamlayer/sdk-web-api": "^0.0.2", | ||
"@streamlayer/sdk-web-core": "^0.12.0", | ||
"@streamlayer/sdk-web-features": "^0.9.5", | ||
"@streamlayer/sdk-web-core": "^0.13.0", | ||
"@streamlayer/sdk-web-interfaces": "^0.18.0", | ||
"@streamlayer/sdk-web-notifications": "^0.9.4", | ||
"@streamlayer/sdk-web-features": "^0.10.0", | ||
"@streamlayer/sdk-web-storage": "^0.3.2", | ||
@@ -35,0 +35,0 @@ "@streamlayer/sdk-web-types": "^0.16.0" |
Sorry, the diff of this file is too big to display
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
119
19%17
-10.53%217410
-46.41%4685
-3.04%