@streamlayer/react 0.41.10 → 1.1.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 (40) hide show
  1. package/lib/app/advertisement.d.ts +1 -0
  2. package/lib/app/app.d.ts +5 -3
  3. package/lib/app/auth.d.ts +0 -1
  4. package/lib/app/masters.d.ts +2 -1
  5. package/lib/app/provider.d.ts +5 -4
  6. package/lib/app/useStreamLayerApp.d.ts +8 -7
  7. package/lib/cjs/app.js +1 -1
  8. package/lib/cjs/gamification-feature.js +1 -1
  9. package/lib/cjs/gamification-feature2.js +1 -0
  10. package/lib/cjs/index.js +1 -1
  11. package/lib/cjs/index2.js +182 -14
  12. package/lib/cjs/masters.js +1 -1
  13. package/lib/cjs/masters2.js +9 -164
  14. package/lib/cjs/points.js +1 -1
  15. package/lib/cjs/useStreamLayerApp.js +1 -1
  16. package/lib/cjs/useStreamLayerApp2.js +17 -0
  17. package/lib/dist/cjs/gamification-feature2.js +1 -0
  18. package/lib/dist/cjs/index.js +1 -1
  19. package/lib/dist/cjs/masters.js +92 -80
  20. package/lib/dist/es/gamification-feature2.js +115 -0
  21. package/lib/dist/es/index.js +7 -5
  22. package/lib/dist/es/masters.js +31532 -34905
  23. package/lib/dist/index.d.ts +234 -145
  24. package/lib/dist/style.css +1 -1
  25. package/lib/es/app.js +940 -11
  26. package/lib/es/gamification-feature.js +1 -1
  27. package/lib/es/gamification-feature2.js +4 -0
  28. package/lib/es/index.js +6 -14
  29. package/lib/es/index2.js +23159 -112
  30. package/lib/es/masters.js +1 -1
  31. package/lib/es/masters2.js +679 -23045
  32. package/lib/es/points.js +30 -33
  33. package/lib/es/useStreamLayerApp.js +3 -36
  34. package/lib/es/useStreamLayerApp2.js +17388 -0
  35. package/lib/index.d.ts +1 -1
  36. package/lib/masters.d.ts +2 -1
  37. package/lib/style.css +1 -1
  38. package/package.json +45 -40
  39. package/lib/cjs/index3.js +0 -1
  40. package/lib/es/index3.js +0 -246
package/lib/cjs/points.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("./index2.js"),d=require("@nanostores/react"),a=require("react"),p=require("@streamlayer/sdk-web-interfaces"),m=require("@streamlayer/sdk-web-types"),t=require("./index3.js"),y=require("./app.js"),S=t.styled_default("div")({name:"PointsContainer",class:"psiob9b",propsAsIs:!1}),f=t.styled_default("div")({name:"PointsIcon",class:"p1gqe4lh",propsAsIs:!1}),x=()=>t.r1,j=t.styled_default(x())({name:"PointsSvg",class:"p15syg2y",propsAsIs:!0}),v=t.styled_default("div")({name:"PointsBody",class:"p12n4f2h",propsAsIs:!1}),h=t.styled_default("div")({name:"PointsTitle",class:"poqmx89",propsAsIs:!1}),g=t.styled_default("div")({name:"PointsValue",class:"prj9b3v",propsAsIs:!1}),q=({points:e,onClick:r})=>s.jsxs(S,{className:o.p,onClick:r,children:[s.jsx(f,{children:s.jsx(j,{name:"icon-trophy"})}),s.jsxs(v,{children:[s.jsx(h,{children:"Total points"}),s.jsx(g,{children:s.jsx(t.d,{value:e})})]})]}),b=({gamification:e})=>{const r=e.userSummary.$store,[u,l]=a.useState(0);return a.useEffect(()=>{const c=r.subscribe(n=>{var i;(i=n==null?void 0:n.summary)!=null&&i.points&&l(n.summary.points)});return()=>{c()}},[r]),s.jsx(q,{points:u,onClick:()=>{e.status.get()===p.FeatureStatus.Suspended&&e.openFeature()}})},P=({sdk:e})=>{if(!d.useStore(e.featuresList.getStore()))return null;const r=e.getFeature(m.FeatureType.GAMES);return r?s.jsx(b,{gamification:r}):null},I=()=>{const e=y.useStreamLayer();return e?s.jsx("div",{className:"StreamLayerSDK",children:s.jsx(o.i,{children:s.jsx(P,{sdk:e})})}):null};exports.StreamLayerSDKPoints=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("react"),t=require("./index2.js"),o=require("./app.js"),d=require("./useStreamLayerApp2.js"),p=t.styled_default("div")({name:"PointsContainer",class:"psiob9b",propsAsIs:!1}),m=t.styled_default("div")({name:"PointsIcon",class:"p1gqe4lh",propsAsIs:!1}),y=()=>t.c1,S=t.styled_default(y())({name:"PointsSvg",class:"p15syg2y",propsAsIs:!0}),f=t.styled_default("div")({name:"PointsBody",class:"p12n4f2h",propsAsIs:!1}),j=t.styled_default("div")({name:"PointsTitle",class:"poqmx89",propsAsIs:!1}),x=t.styled_default("div")({name:"PointsValue",class:"prj9b3v",propsAsIs:!1}),v=({points:e,onClick:r})=>s.jsxs(p,{className:t.p,onClick:r,children:[s.jsx(m,{children:s.jsx(S,{name:"icon-trophy"})}),s.jsxs(f,{children:[s.jsx(j,{children:"Total points"}),s.jsx(x,{children:s.jsx(t.d,{value:e})})]})]}),h=({gamification:e})=>{const r=e.userSummary.$store,[l,u]=i.useState(0);return i.useEffect(()=>{const c=r.subscribe(n=>{var a;(a=n==null?void 0:n.summary)!=null&&a.points&&u(n.summary.points)});return()=>{c()}},[r]),s.jsx(v,{points:l,onClick:()=>{e.status.get()===t.FeatureStatus.Suspended&&e.openFeature()}})},g=({sdk:e})=>{if(!t.useStore(e.featuresList.getStore()))return null;const r=e.getFeature(d.SdkOverlayType.GAMES);return r?s.jsx(h,{gamification:r}):null},P=()=>{const e=o.useStreamLayer();return e?s.jsx("div",{className:"StreamLayerSDK",children:s.jsx(o.i,{children:s.jsx(g,{sdk:e})})}):null};exports.StreamLayerSDKPoints=P;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@streamlayer/sdk-web"),l=require("react"),p=({sdkKey:t,plugins:o,production:s,autoEnable:a,onDeepLinkHandled:i,videoPlayerController:c})=>{const[f,u]=l.useState(null);return l.useEffect(()=>{let r=!1;if(!t)return console.error("streamlayer sdk key should be provided"),u(e=>(e!==null&&typeof e.disableApp=="function"&&e.disableApp(),null)),()=>{r=!0};const n=d.StreamLayer(t,s,a,{version:"0.41.10",onDeepLinkHandled:i,videoPlayerController:c});if(o)for(const e of o)n.use(e);return n.ready().then(e=>{r||u(e.sdk)}).catch(e=>console.log(e)),()=>{r=!0,n.close(function(e){if(e)throw e})}},[t,s]),f};exports.useStreamLayerApp=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useStreamLayerApp2.js");require("react");exports.useStreamLayerApp=e.useStreamLayerApp;