@streamlayer/react 1.1.6 → 1.2.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.
- package/lib/app/provider.d.ts +3 -2
- package/lib/app/useStreamLayerApp.d.ts +3 -2
- package/lib/cjs/advertisement.js +1 -1
- package/lib/cjs/index2.js +20 -20
- package/lib/cjs/useStreamLayerApp2.js +11 -11
- package/lib/dist/cjs/masters.js +49 -49
- package/lib/dist/es/masters.js +4848 -4771
- package/lib/es/advertisement.js +6 -6
- package/lib/es/index2.js +286 -284
- package/lib/es/useStreamLayerApp2.js +2039 -1964
- package/package.json +13 -13
package/lib/app/provider.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StreamLayerSDK, StreamLayerPlugin } from '@streamlayer/sdk-web-interfaces';
|
|
2
|
-
import { DeepLinkCallback, VideoPlayerCallback } from '@streamlayer/sdk-web-core';
|
|
3
|
-
export type { DeepLinkCallback, VideoPlayerCallback } from '@streamlayer/sdk-web-core';
|
|
2
|
+
import { DeepLinkCallback, VideoPlayerCallback, OnContentActivateCallback } from '@streamlayer/sdk-web-core';
|
|
3
|
+
export type { DeepLinkCallback, VideoPlayerCallback, OnContentActivateCallback } from '@streamlayer/sdk-web-core';
|
|
4
4
|
export declare enum StreamLayerStatus {
|
|
5
5
|
UNSET = 0,
|
|
6
6
|
CONNECTED = 1,
|
|
@@ -17,6 +17,7 @@ export type StreamLayerProps = {
|
|
|
17
17
|
autoEnable?: boolean;
|
|
18
18
|
onDeepLinkHandled?: DeepLinkCallback;
|
|
19
19
|
videoPlayerController?: VideoPlayerCallback;
|
|
20
|
+
onContentActivate?: OnContentActivateCallback;
|
|
20
21
|
};
|
|
21
22
|
export declare const StreamLayerProvider: React.FC<StreamLayerProps & {
|
|
22
23
|
children: React.ReactNode;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { StreamLayerSDK, StreamLayerPlugin } from '@streamlayer/sdk-web-interfaces';
|
|
2
|
-
import { DeepLinkCallback, VideoPlayerCallback } from '@streamlayer/sdk-web-core';
|
|
2
|
+
import { DeepLinkCallback, VideoPlayerCallback, OnContentActivateCallback } from '@streamlayer/sdk-web-core';
|
|
3
3
|
declare global {
|
|
4
4
|
interface Window {
|
|
5
5
|
sl: unknown;
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
export declare const useStreamLayerApp: ({ sdkKey, plugins, production, autoEnable, onDeepLinkHandled, videoPlayerController, }: {
|
|
8
|
+
export declare const useStreamLayerApp: ({ sdkKey, plugins, production, autoEnable, onDeepLinkHandled, videoPlayerController, onContentActivate, }: {
|
|
9
9
|
sdkKey: string;
|
|
10
10
|
plugins?: Set<StreamLayerPlugin>;
|
|
11
11
|
production?: boolean;
|
|
12
12
|
autoEnable?: boolean;
|
|
13
13
|
onDeepLinkHandled?: DeepLinkCallback;
|
|
14
14
|
videoPlayerController?: VideoPlayerCallback;
|
|
15
|
+
onContentActivate?: OnContentActivateCallback;
|
|
15
16
|
}) => StreamLayerSDK | null;
|
package/lib/cjs/advertisement.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),v=require("react"),o=require("./index2.js"),b=require("./app.js"),i=require("./useStreamLayerApp2.js"),D=o.styled_default("div")({name:"Container",class:"c5b6wdg",propsAsIs:!1}),G="a1rlj479",U="s35f1di",F="sj4471g",z="b12050d8",H="b1d5ybek",K=e=>e==="left"||e==="right"?U:z,W=e=>e==="left"||e==="right"?F:H,Q=e=>e==="left"?"avdxyl3":e==="right"?"a1bisd08":e==="top"?"a1u9y2aj":"a1qqaks",w=({children:e,style:l,className:a,enabled:n=!0,hiding:t,direction:d="left",onAnimationEnd:r})=>s.jsx(D,{style:l,className:o.cx_default(a,G,Q(d),n&&!t&&K(d),n&&t&&W(d)),onAnimationEnd:r,children:e}),J=o.styled_default("a")({name:"Link",class:"l1sgte8c",propsAsIs:!1}),V=o.styled_default("div")({name:"BannerContainer",class:"b7yfc72",propsAsIs:!1}),X=()=>J,Y=o.styled_default(X())({name:"BannerLink",class:"bejjq94",propsAsIs:!0}),Z=o.styled_default("img")({name:"BannerImg",class:"b1j94hdr",propsAsIs:!1}),ee=({promotion:e,promotionId:l,hiding:a,direction:n="bottom"})=>{var t;return(t=e.additionalBanner)!=null&&t.imageUrl?s.jsx(w,{direction:n,hiding:a,children:s.jsx(V,{children:s.jsx(Y,{href:e.additionalBanner.url,"data-promo-id":l,"data-promo-type":e.type,"data-analytics":"banner",target:"_blank",children:s.jsx(Z,{src:e.additionalBanner.imageUrl,alt:"promo"})})})}):null},se=o.styled_default("div")({name:"OverlayContainer",class:"okzhq2w",propsAsIs:!1}),oe=o.styled_default("div")({name:"PromoOverlay",class:"pmgz5i",propsAsIs:!1}),te=o.styled_default("div")({name:"Header",class:"hyxi3jt",propsAsIs:!1}),ne=o.styled_default("div")({name:"HeaderContent",class:"h149e3gp",propsAsIs:!1}),le="h10toh7",q=o.styled_default("img")({name:"SponsorLogo",class:"s1jyea6t",propsAsIs:!1}),ae=o.styled_default("div")({name:"SponsorName",class:"szpfa3h",propsAsIs:!1}),de=o.styled_default("div")({name:"Media",class:"m1crmu01",propsAsIs:!1}),ie=o.styled_default("img")({name:"PromoImg",class:"p1l37r8s",propsAsIs:!1}),re="s1nmch9k",O=o.styled_default("div")({name:"Content",class:"c1er0ljd",propsAsIs:!1}),ce=o.styled_default("div")({name:"Description",class:"dydopmr",propsAsIs:!1}),pe=o.styled_default("div")({name:"Sponsor",class:"s1w6nt04",propsAsIs:!1}),ue=o.styled_default("div")({name:"SponsorText",class:"s1evcmtq",propsAsIs:!1}),me=o.styled_default("div")({name:"ADLogo",class:"awodx0x",propsAsIs:!1}),ye=o.styled_default("span")({name:"SponsoredText",class:"s1q3n6oi",propsAsIs:!1}),ve=o.styled_default("div")({name:"CloseIconWrap",class:"c8d4xfk",propsAsIs:!1}),be=()=>o.c1,he=o.styled_default(be())({name:"CloseIcon",class:"ct6oobh",propsAsIs:!0}),ge=o.styled_default("div")({name:"ActionBtnWrap",class:"a1gyg7tt",propsAsIs:!1}),fe=o.styled_default("a")({name:"ActionButton",class:"a17rwbtk",propsAsIs:!1}),xe=o.styled_default("div")({name:"Title",class:"t3vxzaw",propsAsIs:!1}),Ae="h10f3u0j",R=({promotion:e,promotionId:l,onClose:a})=>{var n,t,d,r,p,c,u,h,g,f,x,A,j,I,_,$,S,M,L,B,T,E,k,N,C
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),v=require("react"),o=require("./index2.js"),b=require("./app.js"),i=require("./useStreamLayerApp2.js"),D=o.styled_default("div")({name:"Container",class:"c5b6wdg",propsAsIs:!1}),G="a1rlj479",U="s35f1di",F="sj4471g",z="b12050d8",H="b1d5ybek",K=e=>e==="left"||e==="right"?U:z,W=e=>e==="left"||e==="right"?F:H,Q=e=>e==="left"?"avdxyl3":e==="right"?"a1bisd08":e==="top"?"a1u9y2aj":"a1qqaks",w=({children:e,style:l,className:a,enabled:n=!0,hiding:t,direction:d="left",onAnimationEnd:r})=>s.jsx(D,{style:l,className:o.cx_default(a,G,Q(d),n&&!t&&K(d),n&&t&&W(d)),onAnimationEnd:r,children:e}),J=o.styled_default("a")({name:"Link",class:"l1sgte8c",propsAsIs:!1}),V=o.styled_default("div")({name:"BannerContainer",class:"b7yfc72",propsAsIs:!1}),X=()=>J,Y=o.styled_default(X())({name:"BannerLink",class:"bejjq94",propsAsIs:!0}),Z=o.styled_default("img")({name:"BannerImg",class:"b1j94hdr",propsAsIs:!1}),ee=({promotion:e,promotionId:l,hiding:a,direction:n="bottom"})=>{var t;return(t=e.additionalBanner)!=null&&t.imageUrl?s.jsx(w,{direction:n,hiding:a,children:s.jsx(V,{children:s.jsx(Y,{href:e.additionalBanner.url,"data-promo-id":l,"data-promo-type":e.type,"data-analytics":"banner",target:"_blank",children:s.jsx(Z,{src:e.additionalBanner.imageUrl,alt:"promo"})})})}):null},se=o.styled_default("div")({name:"OverlayContainer",class:"okzhq2w",propsAsIs:!1}),oe=o.styled_default("div")({name:"PromoOverlay",class:"pmgz5i",propsAsIs:!1}),te=o.styled_default("div")({name:"Header",class:"hyxi3jt",propsAsIs:!1}),ne=o.styled_default("div")({name:"HeaderContent",class:"h149e3gp",propsAsIs:!1}),le="h10toh7",q=o.styled_default("img")({name:"SponsorLogo",class:"s1jyea6t",propsAsIs:!1}),ae=o.styled_default("div")({name:"SponsorName",class:"szpfa3h",propsAsIs:!1}),de=o.styled_default("div")({name:"Media",class:"m1crmu01",propsAsIs:!1}),ie=o.styled_default("img")({name:"PromoImg",class:"p1l37r8s",propsAsIs:!1}),re="s1nmch9k",O=o.styled_default("div")({name:"Content",class:"c1er0ljd",propsAsIs:!1}),ce=o.styled_default("div")({name:"Description",class:"dydopmr",propsAsIs:!1}),pe=o.styled_default("div")({name:"Sponsor",class:"s1w6nt04",propsAsIs:!1}),ue=o.styled_default("div")({name:"SponsorText",class:"s1evcmtq",propsAsIs:!1}),me=o.styled_default("div")({name:"ADLogo",class:"awodx0x",propsAsIs:!1}),ye=o.styled_default("span")({name:"SponsoredText",class:"s1q3n6oi",propsAsIs:!1}),ve=o.styled_default("div")({name:"CloseIconWrap",class:"c8d4xfk",propsAsIs:!1}),be=()=>o.c1,he=o.styled_default(be())({name:"CloseIcon",class:"ct6oobh",propsAsIs:!0}),ge=o.styled_default("div")({name:"ActionBtnWrap",class:"a1gyg7tt",propsAsIs:!1}),fe=o.styled_default("a")({name:"ActionButton",class:"a17rwbtk",propsAsIs:!1}),xe=o.styled_default("div")({name:"Title",class:"t3vxzaw",propsAsIs:!1}),Ae="h10f3u0j",R=({promotion:e,promotionId:l,onClose:a})=>{var n,t,d,r,p,c,u,h,g,f,x,A,j,I,_,$,S,M,L,B,T,E,k,N,P,C;const m=e.type===i.PromotionType.INGAME_IAB11_LBAR||e.type===i.PromotionType.INGAME_IAB11,y=((n=e.sponsor)==null?void 0:n.logo)&&e.logoMode===i.PromotionLogoMode.CENTER;return s.jsxs(oe,{className:"PromoOverlay",children:[s.jsxs(te,{children:[s.jsxs(ne,{className:o.cx_default(!y&&le),children:[((t=e.sponsor)==null?void 0:t.logo)&&e.logoMode===i.PromotionLogoMode.LEFT&&s.jsx(q,{src:(d=e.sponsor)==null?void 0:d.logo,alt:"promo"}),s.jsxs(pe,{style:{paddingLeft:(r=e.sponsor)!=null&&r.logo&&e.logoMode===i.PromotionLogoMode.LEFT?"0px":"8px"},children:[((p=e.sponsor)==null?void 0:p.logo)&&e.logoMode===i.PromotionLogoMode.LEFT&&s.jsx(ae,{children:(c=e.sponsor)==null?void 0:c.name}),s.jsxs(ue,{children:[s.jsx(me,{children:"AD"}),s.jsx(ye,{children:"SPONSORED"})]})]})]}),s.jsx(ve,{onClick:a,children:s.jsx(he,{name:"icon-cross"})})]}),s.jsxs(de,{children:[y&&s.jsx(q,{className:re,src:(u=e.sponsor)==null?void 0:u.logo,alt:"promo"}),s.jsx(O,{children:(g=(h=e.banner)==null?void 0:h.video)!=null&&g.url?s.jsx(o.Q,{source:(x=(f=e.banner)==null?void 0:f.video)==null?void 0:x.url,poster:(j=(A=e.banner)==null?void 0:A.video)==null?void 0:j.thumbnailUrl,aspectRatio:m?"1/1":"16/9",onPlay:()=>{o.eventBus.emit("advertisement",{action:"videoPlay",payload:{advertisementId:l,advertisementType:e.type}})}}):(I=e.banner)!=null&&I.imageUrl?s.jsx(ie,{style:m?{aspectRatio:"1/1"}:{},src:(_=e.banner)==null?void 0:_.imageUrl,alt:"promo"}):null}),!m&&s.jsxs(O,{children:[(($=e.banner)==null?void 0:$.title)&&s.jsx(xe,{className:o.cx_default(y&&Ae),children:(S=e.banner)==null?void 0:S.title}),((M=e.banner)==null?void 0:M.body)&&s.jsx(ce,{children:(L=e.banner)==null?void 0:L.body})]})]}),s.jsx(ge,{children:s.jsx(fe,{href:(B=e.banner)==null?void 0:B.url,style:{backgroundColor:((E=(T=e.banner)==null?void 0:T.ctaButton)==null?void 0:E.color)||"#009dc4",color:((N=(k=e.banner)==null?void 0:k.ctaButton)==null?void 0:N.textColor)||"#fff"},"data-analytics":"button","data-promo-id":l,"data-promo-type":e.type,target:"_blank",children:(C=(P=e.banner)==null?void 0:P.ctaButton)==null?void 0:C.label})})]})},je=o.styled_default("div")({name:"SidebarContainer",class:"s1abskp8",propsAsIs:!1}),Ie=({children:e,direction:l,style:a,className:n,hiding:t})=>s.jsx(w,{direction:l,style:a,hiding:t,className:n,children:s.jsx(je,{children:e})}),_e=e=>(e==null?void 0:e.type)===i.PromotionType.INGAME_IAB11_LBAR||(e==null?void 0:e.type)===i.PromotionType.INGAME_IAB21_LBAR,$e=e=>(e==null?void 0:e.type)===i.PromotionType.INGAME_IAB11||(e==null?void 0:e.type)===i.PromotionType.INGAME_IAB21,Se=({advertisement:e,layoutMode:l="side-by-side",sidebar:a,banner:n})=>{const t=o.useStore(e.data);return!t.data&&t.loading?null:t.error?s.jsxs("div",{children:["error ",s.jsx("button",{onClick:e.close,children:"close"})]}):t.data?!a&&!n&&$e(t.data)?s.jsx(se,{children:s.jsx(R,{promotionId:e.id,promotion:t.data,onClose:e.close})}):a&&_e(t.data)?s.jsx(Ie,{direction:a,hiding:e.hiding,children:s.jsx(R,{promotionId:e.id,promotion:t.data,onClose:e.close})}):n?s.jsx(ee,{promotionId:e.id,hiding:e.hiding,promotion:t.data,direction:n}):null:s.jsxs("div",{children:["empty promo ",s.jsx("button",{onClick:e.close,children:"close"})]})},Me=o.styled_default("div")({name:"AdvertisementUIWrap",class:"aa6pjif",propsAsIs:!1}),Le=e=>{const l=e.target;if(l instanceof HTMLAnchorElement&&l.target==="_blank"){const a=l.getAttribute("data-promo-id")||"",n=l.getAttribute("data-promo-type")||i.PromotionType.UNSET;l.getAttribute("data-analytics")==="button"&&o.eventBus.emit("advertisement",{action:"buttonSelect",payload:{advertisementId:a,advertisementType:n}}),l.getAttribute("data-analytics")==="banner"&&o.eventBus.emit("advertisement",{action:"bannerSelect",payload:{advertisementId:a,advertisementType:n}})}},Be=({gamification:e,layoutMode:l,sidebar:a,banner:n,isMobileScreen:t,persistent:d})=>{const r=v.useRef(null),p=o.useStore(e.advertisement.$list),c=v.useMemo(()=>e.advertisement.getActiveAdvertisement(d),[p,d]);o.L(r,{enabled:!!c,event:"click",listener:Le});const u=!n&&!a;return c?s.jsx(Me,{ref:r,style:{height:u?"auto":"100%"},className:t?"mobile-view":"",children:s.jsx(Se,{sidebar:a,banner:n,advertisement:c,layoutMode:l})}):null},Te=({sdk:e,sidebar:l,banner:a,event:n,layoutMode:t,isMobileScreen:d,persistent:r})=>{const{deactivate:p}=b.F(e);v.useEffect(()=>{n?e.createEventSession(n):p()},[n,p,e]);const c=o.useStore(e.featuresList.getStore());if(l&&a)return s.jsx("div",{style:{color:"red"},children:"define either sidebar or banner, not both."});if(!c)return null;const u=e.getFeature(i.SdkOverlayType.GAMES);return u?s.jsx(Be,{gamification:u,sidebar:l,banner:a,layoutMode:t,isMobileScreen:d,persistent:r}):null},Ee=({event:e,sidebar:l,banner:a,isMobileScreen:n,persistent:t})=>{const d=b.useStreamLayer();return d?s.jsx("div",{className:"StreamLayerSDK",children:s.jsx(b.d,{children:s.jsx(Te,{sdk:d,event:e,sidebar:l,banner:a,isMobileScreen:n,persistent:t,layoutMode:"side-by-side"})})}):null};exports.StreamLayerSDKAdvertisement=Ee;
|