@streamlayer/react 0.34.2 → 0.34.3

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.
@@ -1371,14 +1371,22 @@ declare module "../../feature-gamification/src/queries/deepLink" {
1371
1371
  import { DeepLink } from '@streamlayer/sl-eslib/sdkSettings/client/client_pb';
1372
1372
  type EventId = ReadableAtom<string | undefined>;
1373
1373
  export const $deepLink: (transport: Transport, params: [EventId]) => import("@nanostores/query").FetcherStore<DeepLink | undefined, any>;
1374
+ export const generateShortLink: (transport: Transport, { web, mobile }: {
1375
+ web: string;
1376
+ mobile: string;
1377
+ }) => Promise<import("@streamlayer/sl-eslib/shortLinks/client_pb").GenerateResponse>;
1374
1378
  }
1375
1379
  declare module "../../feature-gamification/src/deepLink" {
1376
1380
  import type { Transport } from '../../sdk-web-api/src/index.ts';
1377
1381
  import { ReadableAtom } from 'nanostores';
1382
+ type DeepLinkData = {
1383
+ data?: string;
1384
+ loading?: boolean;
1385
+ error?: string;
1386
+ };
1378
1387
  export const deepLink: (transport: Transport, $eventId: ReadableAtom<string | undefined>, $userId: ReadableAtom<string | undefined>) => {
1379
- $store: import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/sdkSettings/client/client_pb").DeepLink | undefined, any>;
1388
+ $store: import("nanostores").MapStore<DeepLinkData>;
1380
1389
  fetch: typeof fetch;
1381
- desktopLink: string;
1382
1390
  };
1383
1391
  }
1384
1392
  declare module "../../feature-gamification/src/gamification" {
@@ -1,7 +1,7 @@
1
- import { jsxs as a, jsx as s, Fragment as k } from "react/jsx-runtime";
1
+ import { jsxs as a, jsx as s, Fragment as z } from "react/jsx-runtime";
2
2
  import { s as i, c as A } from "./index4.js";
3
3
  import { useStore as w } from "@nanostores/react";
4
- import { o as Ie, r as je, w as ke, u as me, O as ze, c as Ee, a as Z, n as Se, P as re, x as Oe } from "./masters2.js";
4
+ import { o as Ie, r as je, w as ze, u as me, O as ke, c as Ee, a as Z, n as Se, P as re, x as Oe } from "./masters2.js";
5
5
  import { QuestionType as p, QuestionStatus as S, QuestionImages as Y, PickHistoryStatus as B } from "@streamlayer/sdk-web-types";
6
6
  import { useState as E, useCallback as V, useEffect as ee, useMemo as j, PureComponent as Ce, useTransition as be } from "react";
7
7
  import { d as X } from "./index3.js";
@@ -280,50 +280,50 @@ const $e = /* @__PURE__ */ i("div")({
280
280
  const N = t && (r === p.TRIVIA || r === p.PREDICTION) && d && u !== S.RESOLVED, D = r === p.PREDICTION && !o, O = M && r === p.PREDICTION && !t && !m || r === p.PREDICTION && I && d && m, v = N && D, C = N && o, y = r === p.PREDICTION && t && d && o, $ = t && r === p.POLL && d;
281
281
  if (!c && !l && !v && !C && !O && !$ && !y)
282
282
  return null;
283
- const z = n ? "correct" : "incorrect", x = n ? e == null ? void 0 : e.correctFeedback : e == null ? void 0 : e.incorrectFeedback;
283
+ const k = n ? "correct" : "incorrect", x = n ? e == null ? void 0 : e.correctFeedback : e == null ? void 0 : e.incorrectFeedback;
284
284
  return /* @__PURE__ */ a(vs, { "data-isPrediction": D, children: [
285
- c && /* @__PURE__ */ a(k, { children: [
285
+ c && /* @__PURE__ */ a(z, { children: [
286
286
  /* @__PURE__ */ s(P, { children: /* @__PURE__ */ s(A, { name: "questionExpired" }) }),
287
287
  /* @__PURE__ */ a("div", { children: [
288
288
  /* @__PURE__ */ s(F, { children: /* @__PURE__ */ s(U, { children: "Question Expired" }) }),
289
289
  /* @__PURE__ */ s(K, { children: "You can still answer to see if you're correct, but no points are awarded for expired questions." })
290
290
  ] })
291
291
  ] }),
292
- l && /* @__PURE__ */ a(k, { children: [
292
+ l && /* @__PURE__ */ a(z, { children: [
293
293
  /* @__PURE__ */ s(P, { children: /* @__PURE__ */ s(A, { name: "questionExpired" }) }),
294
294
  /* @__PURE__ */ a("div", { children: [
295
295
  /* @__PURE__ */ s(F, { children: /* @__PURE__ */ s(U, { children: "Question Closed" }) }),
296
296
  /* @__PURE__ */ s(K, { children: "This question was answered after the moderator closed the question. So the points for this answer won’t tally." })
297
297
  ] })
298
298
  ] }),
299
- O && /* @__PURE__ */ a(k, { children: [
299
+ O && /* @__PURE__ */ a(z, { children: [
300
300
  /* @__PURE__ */ s(P, { children: /* @__PURE__ */ s(A, { name: "questionExpired" }) }),
301
301
  /* @__PURE__ */ a("div", { children: [
302
302
  /* @__PURE__ */ s(F, { children: /* @__PURE__ */ s(U, { children: "Question Closed" }) }),
303
303
  /* @__PURE__ */ s(K, { children: "This event has already taken place, so the ability to make a prediction on its outcome is no longer available." })
304
304
  ] })
305
305
  ] }),
306
- v && /* @__PURE__ */ a(k, { children: [
306
+ v && /* @__PURE__ */ a(z, { children: [
307
307
  /* @__PURE__ */ s(fs, { name: "icon-prediction" }),
308
308
  /* @__PURE__ */ s(U, { children: "Stay tuned to see if your prediction was correct." })
309
309
  ] }),
310
- $ && /* @__PURE__ */ a(k, { children: [
310
+ $ && /* @__PURE__ */ a(z, { children: [
311
311
  /* @__PURE__ */ s(P, { "data-feedbackType": "correct", children: /* @__PURE__ */ s(A, { name: "correct" }) }),
312
312
  /* @__PURE__ */ s(U, { children: "That's for answering. Please stay tuned for the next question." })
313
313
  ] }),
314
- (C || y) && /* @__PURE__ */ a(k, { children: [
315
- /* @__PURE__ */ s(P, { "data-feedbackType": z, children: /* @__PURE__ */ s(A, { name: z }) }),
314
+ (C || y) && /* @__PURE__ */ a(z, { children: [
315
+ /* @__PURE__ */ s(P, { "data-feedbackType": k, children: /* @__PURE__ */ s(A, { name: k }) }),
316
316
  /* @__PURE__ */ s("div", { children: /* @__PURE__ */ a(F, { children: [
317
- /* @__PURE__ */ s(xs, { "data-feedbackType": z, children: x == null ? void 0 : x.title }),
317
+ /* @__PURE__ */ s(xs, { "data-feedbackType": k, children: x == null ? void 0 : x.title }),
318
318
  /* @__PURE__ */ s(U, { children: x == null ? void 0 : x.description })
319
319
  ] }) })
320
320
  ] })
321
321
  ] });
322
- }, ks = /* @__PURE__ */ i("div")({
322
+ }, zs = /* @__PURE__ */ i("div")({
323
323
  name: "Container",
324
324
  class: "c14ielyq",
325
325
  propsAsIs: !1
326
- }), zs = /* @__PURE__ */ i("div")({
326
+ }), ks = /* @__PURE__ */ i("div")({
327
327
  name: "Content",
328
328
  class: "c1tlqx57",
329
329
  propsAsIs: !1
@@ -431,7 +431,7 @@ const $e = /* @__PURE__ */ i("div")({
431
431
  correct: C,
432
432
  hasCorrectAnswer: y,
433
433
  votedAfterQuestionClosed: $,
434
- enteredAnActiveQuestion: z,
434
+ enteredAnActiveQuestion: k,
435
435
  marketClosed: x
436
436
  } = e, b = Ws(e), J = Fs({ questionType: v, questionVoted: m, correct: C, hasCorrectAnswer: y, questionStatus: D }), Q = x && v === p.PREDICTION, _ = m || Q, h = v === p.PREDICTION && !m && D !== S.RESOLVED;
437
437
  return /* @__PURE__ */ a(
@@ -440,7 +440,7 @@ const $e = /* @__PURE__ */ i("div")({
440
440
  value: t,
441
441
  "data-selected": I,
442
442
  "data-answer-state": b,
443
- disabled: m || O || N || Q && !z || Q && z && $,
443
+ disabled: m || O || N || Q && !k || Q && k && $,
444
444
  "data-is-not-checked": m && !I && b !== "incorrect",
445
445
  onClick: (T) => {
446
446
  d(
@@ -534,7 +534,7 @@ const $e = /* @__PURE__ */ i("div")({
534
534
  }) => /* @__PURE__ */ a(sn, { style: { justifyContent: o === p.PREDICTION ? "center" : "space-between" }, children: [
535
535
  /* @__PURE__ */ a(nn, { children: [
536
536
  e && /* @__PURE__ */ s(tn, { children: e }),
537
- n !== void 0 && o !== p.POLL && /* @__PURE__ */ a(k, { children: [
537
+ n !== void 0 && o !== p.POLL && /* @__PURE__ */ a(z, { children: [
538
538
  /* @__PURE__ */ s(rn, { name: "icon-trophy" }),
539
539
  /* @__PURE__ */ a(an, { children: [
540
540
  /* @__PURE__ */ s(cn, { children: /* @__PURE__ */ s(X, { value: n }) }),
@@ -545,7 +545,7 @@ const $e = /* @__PURE__ */ i("div")({
545
545
  r && o !== p.PREDICTION && /* @__PURE__ */ s(en, { isPlaying: t, onTimerExpired: c, duration: u })
546
546
  ] }), un = ({ openedQuestion: e, isLoading: n, vote: t, close: r }) => {
547
547
  var o, u;
548
- const c = e.subject, l = e.type, d = e.status, I = (o = e.options) == null ? void 0 : o.options, m = e.marketClosed, [M, N] = E(!1), [D, O] = E(!1), [v, C] = E(!0), [y, $] = E(!1), [z, x] = E(""), b = e == null ? void 0 : e.id;
548
+ const c = e.subject, l = e.type, d = e.status, I = (o = e.options) == null ? void 0 : o.options, m = e.marketClosed, [M, N] = E(!1), [D, O] = E(!1), [v, C] = E(!0), [y, $] = E(!1), [k, x] = E(""), b = e == null ? void 0 : e.id;
549
549
  ee(() => {
550
550
  l === p.PREDICTION ? m && C(!1) : d === S.RESOLVED && C(!1);
551
551
  }, []);
@@ -575,7 +575,7 @@ const $e = /* @__PURE__ */ i("div")({
575
575
  return {
576
576
  ...g,
577
577
  questionVoted: !!h,
578
- youSelected: z === g.id,
578
+ youSelected: k === g.id,
579
579
  isLoading: n,
580
580
  hasCorrectAnswer: T,
581
581
  questionType: e.type,
@@ -592,7 +592,7 @@ const $e = /* @__PURE__ */ i("div")({
592
592
  h,
593
593
  d,
594
594
  Q,
595
- z
595
+ k
596
596
  ]), ve = I && (I.case === "trivia" || I.case === "prediction") ? I.value : void 0, R = d === S.RESOLVED && l === p.TRIVIA && !h && !v, ie = l === p.TRIVIA && D && M && v, oe = j(() => l === p.PREDICTION ? !!(h && !T || h && T && f != null && f.youVoted) : !0, [l, h, T, f]), ye = j(() => {
597
597
  if (l === p.PREDICTION && h && (!T || T && f != null && f.youVoted))
598
598
  return h.points;
@@ -607,7 +607,7 @@ const $e = /* @__PURE__ */ i("div")({
607
607
  l,
608
608
  T
609
609
  ]), fe = j(() => l === p.PREDICTION && h ? T ? T && f != null && f.youVoted ? "You won" : "" : "To win" : R || y ? "Time expired" : l === p.POLL ? "Time remaining" : h ? "You won" : "To win", [y, l, h, R, T, f]), xe = h || R || ie || l === p.TRIVIA && d === S.RESOLVED && v;
610
- return /* @__PURE__ */ s(je, { "data-question-header": "true", children: /* @__PURE__ */ s(ks, { children: /* @__PURE__ */ a(zs, { children: [
610
+ return /* @__PURE__ */ s(je, { "data-question-header": "true", children: /* @__PURE__ */ s(zs, { children: /* @__PURE__ */ a(ks, { children: [
611
611
  /* @__PURE__ */ s(
612
612
  js,
613
613
  {
@@ -643,7 +643,7 @@ const $e = /* @__PURE__ */ i("div")({
643
643
  title: "More to come...",
644
644
  description: "Watch for additional enhanced stream interactive experience."
645
645
  }
646
- ) : /* @__PURE__ */ a(k, { children: [
646
+ ) : /* @__PURE__ */ a(z, { children: [
647
647
  /* @__PURE__ */ s(Es, { style: oe ? {} : { marginTop: 0 }, children: c }),
648
648
  /* @__PURE__ */ s(Ss, { children: Te.map((g) => /* @__PURE__ */ s(
649
649
  Gs,
@@ -707,7 +707,7 @@ const $e = /* @__PURE__ */ i("div")({
707
707
  " · ",
708
708
  c.time
709
709
  ] }),
710
- (o == null ? void 0 : o.video) && /* @__PURE__ */ s(ke, { source: o.video.url, poster: o.video.thumbnailUrl }),
710
+ (o == null ? void 0 : o.video) && /* @__PURE__ */ s(ze, { source: o.video.url, poster: o.video.thumbnailUrl }),
711
711
  l && !(o != null && o.video) && /* @__PURE__ */ s(Nn, { src: l }),
712
712
  /* @__PURE__ */ a(In, { children: [
713
713
  /* @__PURE__ */ s(mn, { children: r ? t : o == null ? void 0 : o.heading }),
@@ -776,7 +776,7 @@ const $e = /* @__PURE__ */ i("div")({
776
776
  created: e.attributes.created,
777
777
  ...e.attributes.attributes.value
778
778
  }) : null;
779
- }, kn = ({
779
+ }, zn = ({
780
780
  extendedQuestion: e,
781
781
  vote: n,
782
782
  close: t
@@ -791,7 +791,7 @@ const $e = /* @__PURE__ */ i("div")({
791
791
  openedQuestion: o,
792
792
  isLoading: !!r
793
793
  }) : null;
794
- }, zn = ({
794
+ }, kn = ({
795
795
  gamification: e
796
796
  }) => {
797
797
  var n;
@@ -803,7 +803,7 @@ const $e = /* @__PURE__ */ i("div")({
803
803
  children: [/* @__PURE__ */ s(Me, {
804
804
  close: e.closeQuestion,
805
805
  type: ((n = t.attributes) == null ? void 0 : n.type) || p.UNSET
806
- }), o === "question" && /* @__PURE__ */ s(kn, {
806
+ }), o === "question" && /* @__PURE__ */ s(zn, {
807
807
  vote: e.submitAnswer,
808
808
  close: e.closeQuestion,
809
809
  extendedQuestion: r
@@ -1045,11 +1045,11 @@ const Un = /* @__PURE__ */ i("div")({
1045
1045
  }, c.userId))
1046
1046
  })
1047
1047
  }), Jn = ({ deepLink: e }) => {
1048
- const { data: n } = w(e.$store), t = n == null ? void 0 : n.url, r = e.desktopLink;
1048
+ const { data: n } = w(e.$store);
1049
1049
  return /* @__PURE__ */ s(
1050
- ze,
1050
+ ke,
1051
1051
  {
1052
- inviteLink: t || r,
1052
+ inviteLink: n,
1053
1053
  socialLinks: [
1054
1054
  {
1055
1055
  icon: "icon-facebook",
@@ -1266,7 +1266,7 @@ const Un = /* @__PURE__ */ i("div")({
1266
1266
  children: /* @__PURE__ */ s(bn, { activePage: c, toggleActivePage: I })
1267
1267
  }
1268
1268
  ),
1269
- c === H.HOME && /* @__PURE__ */ a(k, { children: [
1269
+ c === H.HOME && /* @__PURE__ */ a(z, { children: [
1270
1270
  /* @__PURE__ */ s(Z, { style: { paddingTop: "8px" }, children: /* @__PURE__ */ s(yt, { userSummary: e.userSummary }) }),
1271
1271
  /* @__PURE__ */ s(Se, { children: /* @__PURE__ */ s(vt, { openQuestion: e.openQuestion, store: e.feedList.getStore() }) })
1272
1272
  ] }),
@@ -1280,7 +1280,7 @@ const Un = /* @__PURE__ */ i("div")({
1280
1280
  name: "UserContainer",
1281
1281
  class: "u14zaal4",
1282
1282
  propsAsIs: !1
1283
- }), kt = ({
1283
+ }), zt = ({
1284
1284
  correct: e,
1285
1285
  incorrect: n
1286
1286
  }) => {
@@ -1294,10 +1294,10 @@ const Un = /* @__PURE__ */ i("div")({
1294
1294
  scrollNode: o
1295
1295
  }) => {
1296
1296
  const u = w(e.openedQuestion.$store), c = w(e.openedUser);
1297
- return /* @__PURE__ */ a(k, {
1297
+ return /* @__PURE__ */ a(z, {
1298
1298
  children: [u && r.current && re.createPortal(/* @__PURE__ */ s(pe, {
1299
1299
  className: t,
1300
- children: /* @__PURE__ */ s(zn, {
1300
+ children: /* @__PURE__ */ s(kn, {
1301
1301
  gamification: e
1302
1302
  })
1303
1303
  }), r.current), c && r.current && re.createPortal(/* @__PURE__ */ s(pe, {
@@ -1309,7 +1309,7 @@ const Un = /* @__PURE__ */ i("div")({
1309
1309
  }), /* @__PURE__ */ s(Z, {
1310
1310
  children: /* @__PURE__ */ s(Ae, {
1311
1311
  ...c,
1312
- successRate: kt(c)
1312
+ successRate: zt(c)
1313
1313
  })
1314
1314
  })]
1315
1315
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react",
3
- "version": "0.34.2",
3
+ "version": "0.34.3",
4
4
  "type": "module",
5
5
  "author": "StreamLayer, Inc (https://streamlayer.io)",
6
6
  "maintainers": [
@@ -54,14 +54,14 @@
54
54
  }
55
55
  ],
56
56
  "dependencies": {
57
- "@streamlayer/feature-gamification": "^0.31.0",
57
+ "@streamlayer/feature-gamification": "^0.32.0",
58
+ "@streamlayer/sdk-web-api": "^0.0.1",
58
59
  "@streamlayer/sdk-web": "^0.29.5",
59
- "@streamlayer/sdk-web-api": "^0.1.0",
60
- "@streamlayer/sdk-web-core": "^0.1.0",
61
- "@streamlayer/sdk-web-features": "^0.11.4",
60
+ "@streamlayer/sdk-web-core": "^0.0.1",
61
+ "@streamlayer/sdk-web-features": "^0.11.5",
62
+ "@streamlayer/sdk-web-interfaces": "^0.18.21",
62
63
  "@streamlayer/sdk-web-logger": "^0.0.1",
63
- "@streamlayer/sdk-web-interfaces": "^0.18.20",
64
- "@streamlayer/sdk-web-notifications": "^0.0.4",
64
+ "@streamlayer/sdk-web-notifications": "^0.0.5",
65
65
  "@streamlayer/sdk-web-storage": "^0.0.4",
66
66
  "@streamlayer/sdk-web-types": "^0.1.0"
67
67
  },
@@ -119,7 +119,7 @@
119
119
  "size-limit": "^11.0.0",
120
120
  "url-loader": "^4.1.1",
121
121
  "vite-plugin-dts": "^3.6.3",
122
- "@streamlayer/react-ui": "^0.86.1"
122
+ "@streamlayer/react-ui": "^0.87.0"
123
123
  },
124
124
  "scripts": {
125
125
  "size-limit": "size-limit"