@wscsports/blaze-web-sdk 0.11.1 → 0.13.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wscsports/blaze-web-sdk",
3
- "version": "0.11.1",
3
+ "version": "0.13.0",
4
4
  "main": "publish/index",
5
5
  "types": "publish/index",
6
6
  "files": [
@@ -209,6 +209,7 @@ export declare class StoryEvent {
209
209
  'player_orientation': ContentAspectRatio;
210
210
  'cc_state': string;
211
211
  'content_extra_info': string;
212
+ 'story_page_content_extra_info': string;
212
213
  'custom_action_button_name': string;
213
214
  'enrichment_layer_id': string;
214
215
  'enrichment_layer_url': string;
@@ -287,6 +288,8 @@ export declare class AdEvent {
287
288
  'ad_server': string;
288
289
  'story_id': string;
289
290
  'story_title': string;
291
+ 'story_page_id': string;
292
+ 'story_page_index': number;
290
293
  'ad_insertion_logic': string;
291
294
  'ad_index': string;
292
295
  'ad_start_trigger': string;
@@ -467,7 +470,15 @@ export * from './data-source.class';
467
470
  export * from './fullscreen-manager.class';
468
471
  export * from './visiblity-manager.class';
469
472
 
470
- export declare class BlazeWidgetLabel {
473
+ export interface IBlazeWidgetLabel {
474
+ readonly _type: 'BlazeWidgetLabel';
475
+ value: string;
476
+ mustInclude(...labels: Array<string | BlazeWidgetLabel>): BlazeWidgetLabel;
477
+ atLeastOneOf(...labels: Array<string | BlazeWidgetLabel>): BlazeWidgetLabel;
478
+ toString(): string;
479
+ }
480
+ export declare class BlazeWidgetLabel implements IBlazeWidgetLabel {
481
+ readonly _type: 'BlazeWidgetLabel';
471
482
  value: string;
472
483
  constructor(value: string);
473
484
  static singleLabel(label: string): BlazeWidgetLabel;
@@ -833,6 +844,7 @@ export declare const IMA_RATIOS: {
833
844
  readonly horizontal: "640x480";
834
845
  readonly vertical: "1080x1920";
835
846
  };
847
+ export declare const BANNER_REFRESH_INTERVAL: number;
836
848
 
837
849
  export declare enum StoryAction {
838
850
  Start = "story_start",
@@ -1036,6 +1048,13 @@ export interface AppConfiguration {
1036
1048
  };
1037
1049
  }
1038
1050
 
1051
+ export type ContentExtraInfo = {
1052
+ previous?: ExtraInfo;
1053
+ current?: ExtraInfo;
1054
+ next?: ExtraInfo;
1055
+ };
1056
+ export type ExtraInfo = Record<string, string>;
1057
+
1039
1058
  export type ContentEntities = {
1040
1059
  gameId: string | null;
1041
1060
  teamId: string | null;
@@ -1053,6 +1072,7 @@ export interface IContent {
1053
1072
  entities?: ContentEntities;
1054
1073
  bannerAdInfo?: IBannerAdInfo;
1055
1074
  closedCaptions?: IClosedCaption[];
1075
+ extraInfo: ExtraInfo;
1056
1076
  }
1057
1077
 
1058
1078
  export interface ICta {
@@ -1085,6 +1105,7 @@ export * from './thumbnail.interface';
1085
1105
  export * from './video.interface';
1086
1106
  export * from './entity.interface';
1087
1107
  export * from './app-configuration';
1108
+ export * from './content-extra-info';
1088
1109
 
1089
1110
  export type InteractionType = 'Poll' | 'Quiz' | 'Enrichment';
1090
1111
  type InteractionRelative = 'Player' | 'Screen';
@@ -1209,6 +1230,7 @@ interface IBasePage {
1209
1230
  hasViewed: boolean;
1210
1231
  ignoreReadStatusForStory: boolean;
1211
1232
  createTime: string;
1233
+ extraInfo?: Record<string, string>;
1212
1234
  }
1213
1235
  export interface IContentPage extends IBasePage {
1214
1236
  type: 'Content';
@@ -1445,7 +1467,15 @@ export declare abstract class WidgetsFactory {
1445
1467
 
1446
1468
  export * from './elements.factory';
1447
1469
 
1470
+ export declare function isValidIds(ids: unknown): ids is string[];
1471
+ export declare function hasValidIds(...sources: Array<string[] | undefined>): boolean;
1472
+
1448
1473
  export * from './widget-theme.guard';
1474
+ export * from './labels.guard';
1475
+ export * from './ids.guard';
1476
+
1477
+ export declare function isValidLabels(labels: unknown): labels is string | string[] | IBlazeWidgetLabel;
1478
+ export declare function hasValidLabels(...sources: Array<string | string[] | IBlazeWidgetLabel | undefined>): boolean;
1449
1479
 
1450
1480
  export declare function isWidgetTheme(theme: any): theme is IWidgetTheme;
1451
1481
 
@@ -1487,11 +1517,11 @@ type CustomNativeArgs = {
1487
1517
  path: string;
1488
1518
  };
1489
1519
  export interface CustomNativeAdHandler {
1490
- provideAdExtraParams?: (args: CustomNativeArgs) => CustomNativeTargeting;
1520
+ provideAdExtraParams?: (args: CustomNativeArgs, contentExtraInfo?: ContentExtraInfo) => CustomNativeTargeting;
1491
1521
  }
1492
1522
  type ImaExtraParams = Record<string, string>;
1493
1523
  export interface ImaAdHandler {
1494
- provideAdExtraParams?: () => ImaExtraParams;
1524
+ provideAdExtraParams?: (contentExtraInfo?: ContentExtraInfo) => ImaExtraParams;
1495
1525
  }
1496
1526
 
1497
1527
  export interface ISmoothOpenCloseModal {
@@ -4172,6 +4202,7 @@ export declare abstract class BlazeWidgetContent extends HTMLElement {
4172
4202
  isNavigationPending: boolean;
4173
4203
  isPausedManually: boolean;
4174
4204
  resumeAfterfocus: boolean;
4205
+ contentExtraInfo?: ContentExtraInfo;
4175
4206
  boundOnFocusEvent: () => void;
4176
4207
  boundOnBlurEvent: () => void;
4177
4208
  boundOnVisibilityChangeEvent: () => void;
@@ -4186,6 +4217,7 @@ export declare abstract class BlazeWidgetContent extends HTMLElement {
4186
4217
  setWidgetItemParent(item: BlazeWidgetItem): void;
4187
4218
  updateWidgetStatusReadUnread(): void;
4188
4219
  getRefferingObject(): ReferringEventInfo;
4220
+ setContentExtraInfo(contentExtraInfo: ContentExtraInfo): void;
4189
4221
  render(): void;
4190
4222
  }
4191
4223
 
@@ -4600,6 +4632,7 @@ export declare abstract class WidgetAbstractPlayer extends BaseWidget {
4600
4632
  isBlazeWidgetStory(content: BlazeWidgetContent[]): content is BlazeWidgetStory[];
4601
4633
  isBlazeWidgetMoment(content: BlazeWidgetContent[]): content is BlazeWidgetMoment[];
4602
4634
  isBlazeWidgetVideo(content: BlazeWidgetContent[]): content is BlazeVideoElement[];
4635
+ getContentExtraInfo(contents: BlazeWidgetContent[], index: number): ContentExtraInfo;
4603
4636
  }
4604
4637
 
4605
4638
  export declare class BlazeWidgetScrollable extends BaseWidget {
@@ -4776,7 +4809,7 @@ export declare class BlazeWidgetVideo extends BlazeWidgetVideoBase {
4776
4809
  render(): void;
4777
4810
  restartVideo(): void;
4778
4811
  initializeIMA(): Promise<void>;
4779
- buildImaUrl(iamData: IImaAdInfo, pageIndex?: number): Promise<string>;
4812
+ buildImaUrl(iamData: IImaAdInfo, pageIndex?: number, contentExtraInfo?: ContentExtraInfo): Promise<string>;
4780
4813
  buildAndSetCustParams(iamData: IImaAdInfo, newUrl: URL, pageIndex?: number): void;
4781
4814
  setSearchParamIfNotNullOrZero(newUrl: URL, key: string, value?: string | number): void;
4782
4815
  addAniviewMacrosToUrl(newUrl: URL): void;
@@ -4841,13 +4874,19 @@ export declare class BlazeWidgetAd extends BlazeWidgetVideoBase {
4841
4874
  }
4842
4875
 
4843
4876
  export declare class BlazeWidgetBannerAd extends HTMLElement {
4877
+ parentContnet: BlazeWidgetContent;
4878
+ constructor(parentContent: BlazeWidgetContent);
4844
4879
  private adContainer;
4880
+ private bannerAdInfo;
4881
+ private isActive;
4845
4882
  private get googletag();
4846
4883
  connectedCallback(): void;
4884
+ disconnectedCallback(): void;
4847
4885
  show(bannerAdInfo?: IBannerAdInfo): void;
4848
4886
  private setInitialStyles;
4849
4887
  private setAdContainer;
4850
4888
  private raiseAnalyticsEventToParent;
4889
+ raiseAnalyticsViewBannerAd(): void;
4851
4890
  }
4852
4891
 
4853
4892
  export declare class BlazeWidgetVastAd extends HTMLElement {
@@ -4869,7 +4908,7 @@ export declare class BlazeWidgetVastAd extends HTMLElement {
4869
4908
  constructor(contentType: ContentType, getReferringObject?: (() => ReferringEventInfo) | undefined);
4870
4909
  private initializeGoogleIma;
4871
4910
  private buildImaUrl;
4872
- startAd(videoElement: HTMLVideoElement, tag: string): Boolean;
4911
+ startAd(videoElement: HTMLVideoElement, tag: string, contentExtraInfo: ContentExtraInfo): Boolean;
4873
4912
  private onAdsManagerLoaded;
4874
4913
  private loadAds;
4875
4914
  private onAdEvent;
@@ -5134,6 +5173,7 @@ export declare class BlazeWidgetMoment extends BlazeWidgetContent {
5134
5173
  data: IMoment;
5135
5174
  shouldShowImaAdOnStart: boolean;
5136
5175
  adInfo?: IAdInfo;
5176
+ contentExtraInfo?: ContentExtraInfo;
5137
5177
  }): Promise<void>;
5138
5178
  updateContent(momentContentData: MomentContentParams): void;
5139
5179
  updateLikeCount(likes?: number): Promise<void>;
@@ -5189,7 +5229,7 @@ export declare class BlazeWidgetStoryPlayer extends WidgetAbstractPlayer {
5189
5229
  applyStyles(): void;
5190
5230
  updateContentConfig(stories: IStory[]): void;
5191
5231
  attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
5192
- setContent(content: BlazeWidgetStory[]): void;
5232
+ setContent(contents: BlazeWidgetStory[]): void;
5193
5233
  navigateContent(direction: ContentDirection): void;
5194
5234
  onFocus(): void;
5195
5235
  handleMoveSwipe(ev: HammerInput): void;
@@ -5273,6 +5313,7 @@ export declare class BlazeWidgetStory extends BlazeWidgetContent {
5273
5313
  requestAnimationId: number | null;
5274
5314
  shouldShowImaAdOnStart: boolean;
5275
5315
  bannerAdElement?: BlazeWidgetBannerAd;
5316
+ lastBannerRefreshInWatchTimeMS: number;
5276
5317
  boundOnResumeEvent: () => void;
5277
5318
  boundOnPauseEvent: () => void;
5278
5319
  boundOnNextPageEvent: () => void;
@@ -5382,6 +5423,7 @@ export declare class BlazeWidgetStory extends BlazeWidgetContent {
5382
5423
  private onPauseEvent;
5383
5424
  private onNextPageEvent;
5384
5425
  private onPrevPageEvent;
5426
+ private getPagesContentExtraInfo;
5385
5427
  }
5386
5428
 
5387
5429
  export declare const ElementId: {