@wscsports/blaze-web-sdk 0.1.737 → 0.1.751
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/package.json +1 -1
- package/publish/index.d.ts +133 -26
- package/publish/index.js +1 -1
package/package.json
CHANGED
package/publish/index.d.ts
CHANGED
|
@@ -109,7 +109,6 @@ export declare class URLManager {
|
|
|
109
109
|
static isBackWasCalled: boolean;
|
|
110
110
|
static resetLocation(): void;
|
|
111
111
|
static updateLocationStoryHash(story?: IStory): void;
|
|
112
|
-
static getPlayerTypeFromUrl(): "Widget" | "Share" | "SingleStory" | undefined;
|
|
113
112
|
}
|
|
114
113
|
|
|
115
114
|
export declare class BlazeAlert extends BaseWidget {
|
|
@@ -263,8 +262,18 @@ export declare enum WidgetAction {
|
|
|
263
262
|
Visible = "widget_visible",
|
|
264
263
|
Click = "widget_click"
|
|
265
264
|
}
|
|
265
|
+
export declare enum AdAction {
|
|
266
|
+
View = "ad_view",
|
|
267
|
+
Exit = "ad_exit",
|
|
268
|
+
Click = "ad_click"
|
|
269
|
+
}
|
|
270
|
+
export declare const StoryToAdActionMapper: {
|
|
271
|
+
story_page_start: AdAction;
|
|
272
|
+
story_page_exit: AdAction;
|
|
273
|
+
cta_click: AdAction;
|
|
274
|
+
};
|
|
266
275
|
type ExposedFields = {
|
|
267
|
-
[key in StoryAction | WidgetAction]?: string[];
|
|
276
|
+
[key in StoryAction | WidgetAction | AdAction]?: string[];
|
|
268
277
|
};
|
|
269
278
|
export declare const exposedFieldsByAction: ExposedFields;
|
|
270
279
|
|
|
@@ -286,6 +295,16 @@ export declare class Database implements IDatabase {
|
|
|
286
295
|
|
|
287
296
|
export * from './database';
|
|
288
297
|
|
|
298
|
+
interface IAdInfoConfiguration {
|
|
299
|
+
adLocationsIndexes: Array<number>;
|
|
300
|
+
isActive: boolean;
|
|
301
|
+
}
|
|
302
|
+
export interface IAdInfo {
|
|
303
|
+
path: string;
|
|
304
|
+
type: string;
|
|
305
|
+
configuration: IAdInfoConfiguration;
|
|
306
|
+
}
|
|
307
|
+
|
|
289
308
|
export interface IContent {
|
|
290
309
|
id: string;
|
|
291
310
|
title: string;
|
|
@@ -333,7 +352,7 @@ export interface IMoment extends IContent {
|
|
|
333
352
|
};
|
|
334
353
|
}
|
|
335
354
|
|
|
336
|
-
export interface
|
|
355
|
+
export interface IContentPage {
|
|
337
356
|
id: string;
|
|
338
357
|
type: 'Content';
|
|
339
358
|
index: number;
|
|
@@ -346,6 +365,16 @@ export interface IPage {
|
|
|
346
365
|
ignoreReadStatusForStory: boolean;
|
|
347
366
|
createTime: string;
|
|
348
367
|
}
|
|
368
|
+
export interface IAdPage {
|
|
369
|
+
id: string;
|
|
370
|
+
type: 'Ad';
|
|
371
|
+
duration: number;
|
|
372
|
+
hasViewed: boolean;
|
|
373
|
+
ignoreReadStatusForStory: boolean;
|
|
374
|
+
createTime: string;
|
|
375
|
+
adPath: string;
|
|
376
|
+
}
|
|
377
|
+
export type IPage = IAdPage | IContentPage;
|
|
349
378
|
|
|
350
379
|
export interface IRendition {
|
|
351
380
|
url: string;
|
|
@@ -356,6 +385,7 @@ export interface IStory extends IContent {
|
|
|
356
385
|
isLive: boolean;
|
|
357
386
|
pages: IPage[];
|
|
358
387
|
isAd: boolean;
|
|
388
|
+
adInfo?: IAdInfo;
|
|
359
389
|
}
|
|
360
390
|
|
|
361
391
|
export interface IThumbnail {
|
|
@@ -398,6 +428,7 @@ export * from './event.enum';
|
|
|
398
428
|
|
|
399
429
|
export interface WidgetsTagNameMap {
|
|
400
430
|
'blaze-sdk': BlazeWidgetSDK;
|
|
431
|
+
'blaze-widget-ad': BlazeWidgetStoryAd;
|
|
401
432
|
'blaze-widget-modal': BlazeWidgetModal;
|
|
402
433
|
'blaze-widget-item': BlazeWidgetItem;
|
|
403
434
|
'blaze-widget-layout': BlazeWidgetLayout;
|
|
@@ -425,6 +456,7 @@ export interface WidgetsTagNameMap {
|
|
|
425
456
|
}
|
|
426
457
|
interface WidgetsTagNameOptionsMap {
|
|
427
458
|
'blaze-sdk': {};
|
|
459
|
+
'blaze-widget-ad': {};
|
|
428
460
|
'blaze-widget-modal': {};
|
|
429
461
|
'blaze-widget-item': {};
|
|
430
462
|
'blaze-widget-layout': {};
|
|
@@ -495,6 +527,7 @@ export interface IBlazeSDKOptions {
|
|
|
495
527
|
doNotTrack?: boolean;
|
|
496
528
|
externalUserId?: string;
|
|
497
529
|
geoLocation?: string;
|
|
530
|
+
loadByStaticContent?: boolean;
|
|
498
531
|
}
|
|
499
532
|
|
|
500
533
|
export interface IDatabase {
|
|
@@ -574,6 +607,17 @@ export interface IWidgetView {
|
|
|
574
607
|
setDelegations: (delegates: Record<Delegation, EventListenerOrEventListenerObject>) => void;
|
|
575
608
|
}
|
|
576
609
|
|
|
610
|
+
declare const AdServiceClass_base: {
|
|
611
|
+
new (): {};
|
|
612
|
+
_instance: AdServiceClass;
|
|
613
|
+
getInstance(): AdServiceClass;
|
|
614
|
+
};
|
|
615
|
+
declare abstract class AdServiceClass extends AdServiceClass_base implements IService {
|
|
616
|
+
canRunAds: boolean;
|
|
617
|
+
init(): Promise<void>;
|
|
618
|
+
}
|
|
619
|
+
export declare const AdService: AdServiceClass;
|
|
620
|
+
|
|
577
621
|
declare const AlertServiceClass_base: {
|
|
578
622
|
new (): {};
|
|
579
623
|
_instance: AlertServiceClass;
|
|
@@ -585,16 +629,6 @@ declare abstract class AlertServiceClass extends AlertServiceClass_base implemen
|
|
|
585
629
|
}
|
|
586
630
|
export declare const AlertService: AlertServiceClass;
|
|
587
631
|
|
|
588
|
-
export declare enum AdAction {
|
|
589
|
-
Request = "ad_request",
|
|
590
|
-
Load = "ad_load",
|
|
591
|
-
Insert = "ad_insert",
|
|
592
|
-
View = "ad_view",
|
|
593
|
-
Click = "ad_click",
|
|
594
|
-
Exit = "ad_exit",
|
|
595
|
-
Pause = "ad_playback_pause",
|
|
596
|
-
Play = "ad_playback_play"
|
|
597
|
-
}
|
|
598
632
|
export declare enum SessionAction {
|
|
599
633
|
Start = "start",
|
|
600
634
|
End = "end"
|
|
@@ -611,6 +645,7 @@ declare abstract class AnalyticsServiceClass extends AnalyticsServiceClass_base
|
|
|
611
645
|
bulkEvent(body: Partial<AnalyticsEvent>[]): Promise<any>;
|
|
612
646
|
pushSessionEvent(action: SessionAction, body: Partial<WidgetEvent>, label?: string | undefined): void;
|
|
613
647
|
pushStoryEvent(action: StoryAction, body: Partial<StoryEvent>, label?: string | undefined, referrer?: ReferringEventInfo | undefined): void;
|
|
648
|
+
pushAdEvent(action: AdAction, body: Partial<AdEvent>, label?: string | undefined, referrer?: ReferringEventInfo | undefined): void;
|
|
614
649
|
pushWidgetEvent(action: WidgetAction, body: Partial<WidgetEvent>, label?: string | undefined, referrer?: ReferringEventInfo | undefined): void;
|
|
615
650
|
setupEvent(category: Category, action: string, body: object, label?: string | undefined, referrer?: ReferringEventInfo | undefined): AnalyticsEvent;
|
|
616
651
|
}
|
|
@@ -618,6 +653,7 @@ export declare const AnalyticsService: AnalyticsServiceClass;
|
|
|
618
653
|
export declare enum Category {
|
|
619
654
|
Story = "story",
|
|
620
655
|
Widget = "widget",
|
|
656
|
+
Ad = "ad",
|
|
621
657
|
Session = "session"
|
|
622
658
|
}
|
|
623
659
|
declare class UserEventInfo {
|
|
@@ -700,6 +736,7 @@ export declare class AnalyticsEvent {
|
|
|
700
736
|
'referring': ReferringEventInfo;
|
|
701
737
|
story: Partial<StoryEvent> | undefined;
|
|
702
738
|
widget: Partial<WidgetEvent> | undefined;
|
|
739
|
+
ad: Partial<AdEvent> | undefined;
|
|
703
740
|
}
|
|
704
741
|
export declare class StoryEvent {
|
|
705
742
|
'story_start_id': string;
|
|
@@ -746,6 +783,26 @@ export declare class WidgetEvent {
|
|
|
746
783
|
'page_type': string;
|
|
747
784
|
'page_size': string;
|
|
748
785
|
}
|
|
786
|
+
export declare class AdEvent {
|
|
787
|
+
'advertiser_id': string;
|
|
788
|
+
'advertiser_name': string;
|
|
789
|
+
'campaign_id': string;
|
|
790
|
+
'campaign_name': string;
|
|
791
|
+
'ad_server': string;
|
|
792
|
+
'story_id': string;
|
|
793
|
+
'story_title': string;
|
|
794
|
+
'ad_insertion_logic': string;
|
|
795
|
+
'ad_index': string;
|
|
796
|
+
'ad_start_trigger': string;
|
|
797
|
+
'ad_exit_trigger': string;
|
|
798
|
+
'ad_duration': string;
|
|
799
|
+
'ad_duration_viewed_percent': string;
|
|
800
|
+
'playback_action_method': string;
|
|
801
|
+
'audio_state': string;
|
|
802
|
+
'skip_config': string;
|
|
803
|
+
'content_type': string;
|
|
804
|
+
'ad_path': string;
|
|
805
|
+
}
|
|
749
806
|
|
|
750
807
|
declare const ApiServiceClass_base: {
|
|
751
808
|
new (): {};
|
|
@@ -755,21 +812,31 @@ declare const ApiServiceClass_base: {
|
|
|
755
812
|
declare abstract class ApiServiceClass extends ApiServiceClass_base implements IService {
|
|
756
813
|
api: API;
|
|
757
814
|
init(): Promise<void>;
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
totalItems: number;
|
|
815
|
+
private setAdsOnStories;
|
|
816
|
+
getStoriesByIds(storyIds: string[], orderType?: OrderType): Promise<{
|
|
761
817
|
result: IStory[];
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
818
|
+
data: {
|
|
819
|
+
assetsExpiryTime: string;
|
|
820
|
+
totalItems: number;
|
|
821
|
+
result: IStory[];
|
|
822
|
+
};
|
|
823
|
+
error?: Error | undefined;
|
|
824
|
+
}>;
|
|
825
|
+
getStories(labels: string, orderType: OrderType, maxItemsSize?: number): Promise<{
|
|
766
826
|
result: IStory[];
|
|
767
|
-
|
|
827
|
+
data: {
|
|
828
|
+
assetsExpiryTime: string;
|
|
829
|
+
totalItems: number;
|
|
830
|
+
result: IStory[];
|
|
831
|
+
};
|
|
832
|
+
error?: Error | undefined;
|
|
833
|
+
}>;
|
|
768
834
|
getShorts(labels: string, orderType: OrderType, maxItemsSize?: number): Promise<IResponse<{
|
|
769
835
|
assetsExpiryTime: string;
|
|
770
836
|
totalItems: number;
|
|
771
837
|
result: IMoment[];
|
|
772
838
|
}>>;
|
|
839
|
+
getStaticStories(): Promise<IStory | null>;
|
|
773
840
|
preview(storyId: string, publishedOnly?: boolean): Promise<IResponse<IStory & {
|
|
774
841
|
status: number;
|
|
775
842
|
}>>;
|
|
@@ -794,6 +861,7 @@ declare abstract class ConfigServiceClass extends ConfigServiceClass_base implem
|
|
|
794
861
|
private _doNotTrack;
|
|
795
862
|
private _externalUserId;
|
|
796
863
|
private _geoLocation;
|
|
864
|
+
private _staticContent;
|
|
797
865
|
protected constructor();
|
|
798
866
|
init(options: IBlazeSDKOptions): Promise<void>;
|
|
799
867
|
private _urls;
|
|
@@ -809,6 +877,8 @@ declare abstract class ConfigServiceClass extends ConfigServiceClass_base implem
|
|
|
809
877
|
set doNotTrack(value: boolean);
|
|
810
878
|
get geoLocation(): string;
|
|
811
879
|
set geoLocation(value: string);
|
|
880
|
+
get staticContent(): boolean;
|
|
881
|
+
set staticContent(value: boolean);
|
|
812
882
|
get apiUrl(): string;
|
|
813
883
|
get apiKey(): string;
|
|
814
884
|
get previewUrl(): string;
|
|
@@ -1570,6 +1640,37 @@ export * from './widget-story-player';
|
|
|
1570
1640
|
export * from './widget-story-preview';
|
|
1571
1641
|
export * from './widget-story-video';
|
|
1572
1642
|
|
|
1643
|
+
export declare class BlazeWidgetStoryAd extends BlazeWidgetStoryBase {
|
|
1644
|
+
data: IPage | undefined;
|
|
1645
|
+
private isCurrectlyDisplay;
|
|
1646
|
+
private adContainer;
|
|
1647
|
+
private placeholderContainer;
|
|
1648
|
+
private googletag;
|
|
1649
|
+
private isMuted;
|
|
1650
|
+
private failToLoadTimeout?;
|
|
1651
|
+
constructor(storyParent: BlazeWidgetStory);
|
|
1652
|
+
connectedCallback(): void;
|
|
1653
|
+
disconnectedCallback(): void;
|
|
1654
|
+
render(): void;
|
|
1655
|
+
get currentTime(): number;
|
|
1656
|
+
set currentTime(value: number);
|
|
1657
|
+
get duration(): number;
|
|
1658
|
+
get progress(): number;
|
|
1659
|
+
set muted(isMuted: boolean);
|
|
1660
|
+
getAdIframeRef(): HTMLIFrameElement | null;
|
|
1661
|
+
changeAdMutedState(isMuted: boolean): void;
|
|
1662
|
+
setData(data: IPage): void;
|
|
1663
|
+
play(): void;
|
|
1664
|
+
get paused(): boolean;
|
|
1665
|
+
pause(): void;
|
|
1666
|
+
removeLoader(): void;
|
|
1667
|
+
loadPoster(): void;
|
|
1668
|
+
hide(): void;
|
|
1669
|
+
display(onFail?: () => void): void;
|
|
1670
|
+
mainElement(): CanvasImageSource;
|
|
1671
|
+
private initStyles;
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1573
1674
|
export interface BlazeWidgetItemOptions {
|
|
1574
1675
|
theme: IWidgetTheme;
|
|
1575
1676
|
content: IStory;
|
|
@@ -1843,7 +1944,7 @@ export declare class BlazeWidgetScrollable extends BaseWidget {
|
|
|
1843
1944
|
}
|
|
1844
1945
|
|
|
1845
1946
|
export declare class BlazeWidgetSDK extends BaseWidget {
|
|
1846
|
-
|
|
1947
|
+
modalStory: BlazeWidgetStoryModal | undefined;
|
|
1847
1948
|
onResizeEvent: (this: Window, ev: UIEvent) => void;
|
|
1848
1949
|
static get observedAttributes(): string[];
|
|
1849
1950
|
constructor();
|
|
@@ -1851,10 +1952,13 @@ export declare class BlazeWidgetSDK extends BaseWidget {
|
|
|
1851
1952
|
disconnectedCallback(): void;
|
|
1852
1953
|
onResize(): void;
|
|
1853
1954
|
loadStoriesByHash(storyIds: string): Promise<void>;
|
|
1955
|
+
loadStoriesByStaticContent(): Promise<void>;
|
|
1854
1956
|
attributeChangedCallback(name: string, oldValue: string, newValue: string): Promise<void>;
|
|
1855
1957
|
private getConfigAttributes;
|
|
1856
1958
|
private initialize;
|
|
1959
|
+
private injectToHead;
|
|
1857
1960
|
private injectFontResource;
|
|
1961
|
+
private injectGoogleTag;
|
|
1858
1962
|
}
|
|
1859
1963
|
|
|
1860
1964
|
export interface IShareButton {
|
|
@@ -1894,7 +1998,7 @@ export declare class BlazeWidgetStoryBase extends HTMLElement {
|
|
|
1894
1998
|
removeLoader(): any;
|
|
1895
1999
|
load(): void;
|
|
1896
2000
|
unload(): void;
|
|
1897
|
-
display(): void;
|
|
2001
|
+
display(onFail?: () => void): void;
|
|
1898
2002
|
hide(): void;
|
|
1899
2003
|
set muted(value: boolean);
|
|
1900
2004
|
get duration(): number;
|
|
@@ -2008,7 +2112,7 @@ export declare class BlazeWidgetStoryPlayer extends BaseWidget {
|
|
|
2008
2112
|
goNext(): void;
|
|
2009
2113
|
handleAnimation(distance: number, story: BlazeWidgetStory, currentAnimation?: AnimeInstance | null): void;
|
|
2010
2114
|
onSmallGestures(currentAnimation: AnimeInstance, currentStory: BlazeWidgetStory): void;
|
|
2011
|
-
onKeyDown(ev: KeyboardEvent):
|
|
2115
|
+
onKeyDown(ev: KeyboardEvent): false | undefined;
|
|
2012
2116
|
render(): void;
|
|
2013
2117
|
}
|
|
2014
2118
|
|
|
@@ -2142,7 +2246,7 @@ export declare class BlazeWidgetStory extends HTMLElement {
|
|
|
2142
2246
|
widgetParent: BlazeWidgetItem;
|
|
2143
2247
|
playCallback: any;
|
|
2144
2248
|
sessionId: string;
|
|
2145
|
-
startTrigger: 'Widget' | 'Deeplink' | 'Swipe' | 'Skip' | '';
|
|
2249
|
+
startTrigger: 'Widget' | 'Deeplink' | 'Swipe' | 'Skip' | 'Static Load' | '';
|
|
2146
2250
|
exitTrigger: 'Swipe' | 'Swipe Down' | 'Skip' | 'Close Button' | 'CTA Click' | 'Escape Button' | '';
|
|
2147
2251
|
navigationType: 'Automatic' | 'Manual' | undefined;
|
|
2148
2252
|
navigationDirection: 'Forwards' | 'Backwards' | undefined;
|
|
@@ -2156,10 +2260,13 @@ export declare class BlazeWidgetStory extends HTMLElement {
|
|
|
2156
2260
|
isNavigationPending: boolean;
|
|
2157
2261
|
navigationTimeout: NodeJS.Timeout | null;
|
|
2158
2262
|
lastPageIndexToResume: number;
|
|
2263
|
+
elementsToHideOnAds: HTMLElement[];
|
|
2264
|
+
muteStateBeforeAd: 'mute' | 'unmute' | 'no-ad';
|
|
2159
2265
|
constructor();
|
|
2160
2266
|
onShareClick(): Promise<void>;
|
|
2161
2267
|
updateChip(): void;
|
|
2162
2268
|
setTheme(storyPlayerStyle: StoryPlayerStyle): void;
|
|
2269
|
+
adjustAdView(): void;
|
|
2163
2270
|
updatePlayerButtonIcons(): void;
|
|
2164
2271
|
onCtaClick(event: Event): boolean;
|
|
2165
2272
|
playToggle(): void;
|
|
@@ -2181,7 +2288,7 @@ export declare class BlazeWidgetStory extends HTMLElement {
|
|
|
2181
2288
|
removeFromCache(): void;
|
|
2182
2289
|
load(): void;
|
|
2183
2290
|
play(): void;
|
|
2184
|
-
event(action: StoryAction,
|
|
2291
|
+
event(action: StoryAction, storyData: Partial<StoryEvent>, label?: string | undefined): void;
|
|
2185
2292
|
connectedCallback(): void;
|
|
2186
2293
|
onShareModalClose(): void;
|
|
2187
2294
|
onShareModalButtonClick(shareButton: BlazeShareButton): Promise<void>;
|