@streamlayer/react 1.11.3-rc.4 → 1.11.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.
Files changed (64) hide show
  1. package/lib/app/masters.d.ts +28 -0
  2. package/lib/cjs/advertisement.js +1 -1
  3. package/lib/cjs/gamification-feature.js +1 -1
  4. package/lib/cjs/gamification-feature2.js +1 -0
  5. package/lib/cjs/index.js +1 -1
  6. package/lib/cjs/insight.js +1 -1
  7. package/lib/cjs/masters.js +1 -0
  8. package/lib/cjs/masters2.js +9 -0
  9. package/lib/cjs/notification.js +1 -1
  10. package/lib/cjs/points.js +1 -1
  11. package/lib/cjs/provider.js +90 -78
  12. package/lib/cjs/useStreamLayerApp2.js +12 -12
  13. package/lib/classic/app/masters.d.ts +28 -0
  14. package/lib/classic/cjs/advertisement.js +1 -1
  15. package/lib/classic/cjs/gamification-feature.js +1 -1
  16. package/lib/classic/cjs/gamification-feature2.js +1 -0
  17. package/lib/classic/cjs/index.js +1 -1
  18. package/lib/classic/cjs/insight.js +1 -1
  19. package/lib/classic/cjs/masters.js +1 -0
  20. package/lib/classic/cjs/masters2.js +9 -0
  21. package/lib/classic/cjs/notification.js +1 -1
  22. package/lib/classic/cjs/points.js +1 -1
  23. package/lib/classic/cjs/provider.js +90 -78
  24. package/lib/classic/cjs/useStreamLayerApp2.js +12 -12
  25. package/lib/classic/es/advertisement.js +605 -704
  26. package/lib/classic/es/gamification-feature.js +1 -1
  27. package/lib/classic/es/gamification-feature2.js +4 -0
  28. package/lib/classic/es/index.js +14 -11
  29. package/lib/classic/es/insight.js +35 -34
  30. package/lib/classic/es/masters.js +8 -0
  31. package/lib/classic/es/masters2.js +1106 -0
  32. package/lib/classic/es/notification.js +378 -452
  33. package/lib/classic/es/points.js +44 -67
  34. package/lib/classic/es/provider.js +17477 -15544
  35. package/lib/classic/es/useStreamLayerApp2.js +2967 -3251
  36. package/lib/classic/index.d.ts +10 -1
  37. package/lib/classic/masters.d.ts +5 -0
  38. package/lib/classic/style.css +1 -455
  39. package/lib/dist/cjs/gamification-feature.js +1 -0
  40. package/lib/dist/cjs/gamification-feature2.js +1 -0
  41. package/lib/dist/cjs/index.js +1 -0
  42. package/lib/dist/cjs/masters.js +219 -0
  43. package/lib/dist/cjs/package.json +1 -0
  44. package/lib/dist/es/gamification-feature.js +4 -0
  45. package/lib/dist/es/gamification-feature2.js +123 -0
  46. package/lib/dist/es/index.js +9 -0
  47. package/lib/dist/es/masters.js +42736 -0
  48. package/lib/dist/es/package.json +1 -0
  49. package/lib/dist/style.css +1 -0
  50. package/lib/es/advertisement.js +605 -704
  51. package/lib/es/gamification-feature.js +1 -1
  52. package/lib/es/gamification-feature2.js +4 -0
  53. package/lib/es/index.js +14 -11
  54. package/lib/es/insight.js +35 -34
  55. package/lib/es/masters.js +8 -0
  56. package/lib/es/masters2.js +1106 -0
  57. package/lib/es/notification.js +378 -452
  58. package/lib/es/points.js +44 -67
  59. package/lib/es/provider.js +17477 -15545
  60. package/lib/es/useStreamLayerApp2.js +2967 -3251
  61. package/lib/index.d.ts +10 -1
  62. package/lib/masters.d.ts +5 -0
  63. package/lib/style.css +1 -1
  64. package/package.json +76 -1
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./masters.js");exports.default=e.z;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),e=require("./masters.js"),c=require("react"),j=(s,r,t)=>{const n=r>=e.A.lg&&r<e.A.xl?75:52;s.current&&window.scrollTo({top:s.current.offsetTop-n,...t})},y=e.styled_default("div")({name:"InviteFriendsContainer",class:"i1c9dygq",propsAsIs:!1}),k=({deepLink:s})=>o.jsx(y,{children:o.jsx(e.M,{inviteLink:s,inviteCardTitle:"It’s More Fun With Friends",inviteCardSubtext:"Invite and compete against your friends for the top spot on the leaderboard."})}),I=e.styled_default("div")({name:"InviteLinkContainer",class:"i1odbhm4",propsAsIs:!1}),w=({gamification:s,scrollNode:r,scrollStore:t})=>{const n=c.useRef(null),{data:i,hasMore:l,loading:d,key:m}=e.useStore(s.leaderboardList.$store),{data:a}=e.useStore(s.deepLink.$store),[u,h]=e.T(n);return!i.length&&!d?o.jsx(k,{deepLink:a}):o.jsxs(o.Fragment,{children:[o.jsx(e.S,{items:i,scrollNode:r,scrollStore:t,fetchMore:s.leaderboardList.fetchMore,hasMore:l,openItemDetail:s.openUser,currentUserId:s.currentUserId.get()},m),a&&o.jsx(I,{ref:n,children:o.jsx(e.C,{onClick:()=>u(a),title:"Invite Friends",description:"Challenge them now!"})}),h]})},N=({store:s,openQuestion:r})=>{const{sdk:t}=e.p(),n=e.useStore(s);return o.jsx(e.k,{openQuestion:r,questions:n.data,controlVideo:t==null?void 0:t.controlVideoPlayer})},C=({userSummary:s})=>{var r;const[t,n]=c.useState(void 0);return c.useEffect(()=>{const i=s.$store.subscribe(l=>{l&&n(l)});return()=>{i()}},[s]),o.jsx(e.O,{loading:!(t!=null&&t.summary),...t==null?void 0:t.summary,successRate:(r=t==null?void 0:t.percentage)==null?void 0:r.correct})},L=({gamification:s,className:r,scrollStore:t,scrollNode:n,appNode:i,style:l,responsiveStore:d})=>{const{tabsShown:m}=e.useStore(t,{keys:["tabsShown"]}),a=e.useStore(s.friendsTabEnabled),[u,h]=c.useState(e.m.HOME),[,g]=e.useTransition(),{sdkInDesktopView:x,screen:v}=e.useStore(d,{keys:["sdkInDesktopView"]}),b=p=>{g(()=>{var f;h(p),x===!1&&(((f=i.current)==null?void 0:f.getBoundingClientRect().y)||0)<0&&j(i,v.size,{behavior:"instant"})})};c.useEffect(()=>t.subscribe(p=>{if(p.scrollPosition===0){t.setKey("tabsShown",!0);return}d.get().sdkInDesktopView?t.setKey("tabsShown",p.scrollDirection==="backward"):t.setKey("tabsShown",p.scrollDirection==="forward")}),[t,d]),c.useEffect(()=>{a||h(e.m.HOME)},[a]);let S="0px";return x?S=m?"0px":"calc(0px - var(--header-height))":S=m?"var(--header-height)":"0px",o.jsxs(e.l,{className:e.cx_default(r,"SL-Tabs"),style:l,children:[a&&o.jsx(e.S$1,{style:{top:S},children:o.jsx(e.b,{activePage:u,toggleActivePage:b})}),u===e.m.HOME&&o.jsxs(o.Fragment,{children:[o.jsx(e.m$1,{children:o.jsx(e.d,{children:o.jsx(C,{userSummary:s.userSummary})})}),o.jsx(e.n,{style:{flex:1},children:o.jsx(N,{openQuestion:s.openQuestion,store:s.feedList.getStore()})})]}),u===e.m.LEADERBOARD&&o.jsx(e.C$1,{children:o.jsx(w,{scrollStore:t,scrollNode:n,gamification:s})})]})},M=({gamification:s,scrollStore:r,className:t,appNode:n,scrollNode:i,responsiveStore:l})=>o.jsx(L,{appNode:n,scrollStore:r,scrollNode:i,className:t,gamification:s,responsiveStore:l});exports.default=M;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");const e=require("./masters.js");require("react");exports.MastersStreamLayerProvider=e.MastersStreamLayerProvider;exports.MastersStreamLayerSDKReact=e.MastersStreamLayerSDKReact;exports.StreamLayerLogin=e.StreamLayerLogin;exports.StreamLayerSDKPoints=e.StreamLayerSDKPoints;