@wscsports/blaze-web-sdk 0.4.1 → 0.4.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wscsports/blaze-web-sdk",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "main": "publish/index",
5
5
  "types": "publish/index",
6
6
  "files": [
@@ -27,6 +27,7 @@ export declare function playStories(dataSource: BlazeDataSourceType, style?: Sto
27
27
  export declare function playContent(contentType: ContentType, options: PlayContentOptions): Promise<void>;
28
28
  export declare function setAbTestParams(abTestParams: BlazeAbTestType): void;
29
29
  export declare function getAppContextManager(): Record<string, any>;
30
+ export declare const pushConsentEvent: (action: string, body: Record<string, any>) => void;
30
31
  declare const _default: {
31
32
  Initialize: typeof Initialize;
32
33
  WidgetGridView: typeof WidgetGridView;
@@ -49,6 +50,7 @@ declare const _default: {
49
50
  playContent: typeof playContent;
50
51
  setAbTestParams: typeof setAbTestParams;
51
52
  getAppContextManager: typeof getAppContextManager;
53
+ pushConsentEvent: (action: string, body: Record<string, any>) => void;
52
54
  };
53
55
  export default _default;
54
56
 
@@ -80,7 +82,8 @@ export declare enum Category {
80
82
  Widget = "widget",
81
83
  Video = "video",
82
84
  Ad = "ad",
83
- Interaction = "interaction"
85
+ Interaction = "interaction",
86
+ Consent = "consent"
84
87
  }
85
88
  declare class UserEventInfo {
86
89
  'generated_user_id': string;
@@ -170,6 +173,7 @@ export declare class AnalyticsEvent {
170
173
  video: Partial<VideoEvent> | undefined;
171
174
  ad: Partial<AdEvent> | undefined;
172
175
  interaction: Partial<InteractionEvent> | undefined;
176
+ consent: Partial<ConsentEvent> | undefined;
173
177
  }
174
178
  export declare class StoryEvent {
175
179
  'story_start_id': string;
@@ -326,6 +330,8 @@ export declare class InteractionEvent {
326
330
  'audio_state': string;
327
331
  'content_extra_info': string;
328
332
  }
333
+ export declare class ConsentEvent {
334
+ }
329
335
 
330
336
  export declare abstract class BaseWidget extends HTMLElement {
331
337
  protected _animationDuration: number;
@@ -337,6 +343,7 @@ export declare abstract class BaseWidget extends HTMLElement {
337
343
  }
338
344
 
339
345
  type BlazeSourceType = 'labels' | 'ids';
346
+ export type AdvancedOrdering = 'LiveFirst';
340
347
  export interface BlazeDataSourceType {
341
348
  type: BlazeSourceType;
342
349
  labels?: string | string[] | BlazeWidgetLabel;
@@ -344,6 +351,7 @@ export interface BlazeDataSourceType {
344
351
  ids?: string[];
345
352
  orderType?: OrderType;
346
353
  maxItems?: number;
354
+ advancedOrdering?: AdvancedOrdering;
347
355
  }
348
356
  export declare const BlazeInternalError: {
349
357
  LabelExpressionMustNotBeEmpty: string;
@@ -655,7 +663,7 @@ export declare class BlazeButton extends BaseWidget {
655
663
  isAnimationOnDesktopInitialized: boolean;
656
664
  get refElement(): ShadowRoot | this;
657
665
  constructor();
658
- static get observedAttributes(): ("height" | "order" | "width" | "icon-color" | "disabled" | "blaze-btn-visible" | "blaze-btn-hidden" | "button-desktop-animation")[];
666
+ static get observedAttributes(): ("height" | "order" | "width" | "icon-color" | "disabled" | "blaze-btn-hidden" | "blaze-btn-visible" | "button-desktop-animation")[];
659
667
  private onMouseEnter;
660
668
  private onMouseLeave;
661
669
  private onClick;
@@ -823,7 +831,8 @@ export declare enum VideoAction {
823
831
  export declare enum WidgetAction {
824
832
  Load = "widget_load",
825
833
  Visible = "widget_visible",
826
- Click = "widget_click"
834
+ Click = "widget_click",
835
+ SDKInit = "sdk_init"
827
836
  }
828
837
  export declare enum AdAction {
829
838
  Requested = "ad_requested",
@@ -1004,7 +1013,7 @@ export type InteractionType = 'Poll' | 'Quiz' | 'Enrichment';
1004
1013
  type InteractionRelative = 'Player' | 'Screen';
1005
1014
  export type InteractionObjectYPosition = 'BottomToTop' | 'TopToTop' | 'BottomToBottom' | 'TopToBottom' | 'CenterToTop' | 'CenterToBottom' | 'CenterY';
1006
1015
  export type InteractionObjectXPosition = 'StartToStart' | 'EndToEnd' | 'StartToEnd' | 'EndToStart' | 'CenterToStart' | 'CenterToEnd' | 'CenterX';
1007
- type PositionType = {
1016
+ type InteractionPositionType = {
1008
1017
  xOffset?: number;
1009
1018
  xPosition?: InteractionObjectXPosition;
1010
1019
  xRelativeTo?: InteractionRelative;
@@ -1012,15 +1021,15 @@ type PositionType = {
1012
1021
  yPosition?: InteractionObjectYPosition;
1013
1022
  yRelativeTo?: InteractionRelative;
1014
1023
  };
1015
- type SizeType = {
1024
+ type InteractionSizeType = {
1016
1025
  absoluteHeight?: number;
1017
1026
  absoluteWidth?: number;
1018
1027
  heightRatio?: number;
1019
1028
  widthRatio?: number;
1020
1029
  };
1021
1030
  export type InteractionBounds = {
1022
- position?: PositionType;
1023
- size?: SizeType;
1031
+ position?: InteractionPositionType;
1032
+ size?: InteractionSizeType;
1024
1033
  };
1025
1034
  export type Interaction = {
1026
1035
  id: string;
@@ -1409,6 +1418,7 @@ export interface IBlazeSDKOptions {
1409
1418
  autoAdvanceUrl?: string;
1410
1419
  layoutDirection?: LocaleDirectionType;
1411
1420
  shouldAllowClosedCaptions?: boolean;
1421
+ disableAutoLoadingContent?: boolean;
1412
1422
  }
1413
1423
 
1414
1424
  export interface IButtonPlayerNavigationConfig {
@@ -1429,16 +1439,8 @@ export interface IDataSourceBuilder {
1429
1439
  labels: (params: LabelsDataSourceParams) => BlazeDataSourceType;
1430
1440
  ids: (params: IdsDataSourceParams) => BlazeDataSourceType;
1431
1441
  }
1432
- export interface LabelsDataSourceParams {
1433
- labels: string | string[] | BlazeWidgetLabel;
1434
- labelsPriority?: string | string[] | BlazeWidgetLabel[];
1435
- orderType?: OrderType;
1436
- maxItems?: number;
1437
- }
1438
- export interface IdsDataSourceParams {
1439
- ids: string[];
1440
- orderType?: OrderType;
1441
- }
1442
+ export type LabelsDataSourceParams = Omit<BlazeDataSourceType, 'type' | 'ids'>;
1443
+ export type IdsDataSourceParams = Omit<BlazeDataSourceType, 'type' | 'labels' | 'labelsPriority' | 'maxItems'>;
1442
1444
 
1443
1445
  export interface IDatabase {
1444
1446
  init: () => Promise<void>;
@@ -1653,6 +1655,7 @@ declare abstract class AnalyticsServiceClass extends AnalyticsServiceClass_base
1653
1655
  pushMomentEvent(action: MomentAction, body: Partial<MomentEvent>, label?: string | undefined, referrer?: ReferringEventInfo | undefined): void;
1654
1656
  pushVideoEvent(action: VideoAction, body: Partial<VideoEvent>, label?: string | undefined, referrer?: ReferringEventInfo | undefined): void;
1655
1657
  pushAdEvent(action: AdAction, body: Partial<AdEvent>, label?: string | undefined, referrer?: ReferringEventInfo | undefined): void;
1658
+ pushConsentEvent(action: string, body: Record<string, any>): void;
1656
1659
  pushImaAdEvent(action: ImaAdAction, body: Partial<ImaAdEvent>, label?: string | undefined, referrer?: ReferringEventInfo | undefined): void;
1657
1660
  pushInteractionEvent(action: InteractionAction, body: Partial<InteractionEvent>, label?: string | undefined, referrer?: ReferringEventInfo | undefined): void;
1658
1661
  pushWidgetEvent(action: WidgetAction, body: Partial<WidgetEvent>, label?: string | undefined, referrer?: ReferringEventInfo | undefined): void;
@@ -1678,13 +1681,23 @@ declare abstract class ApiServiceClass extends ApiServiceClass_base implements I
1678
1681
  api: API;
1679
1682
  init(): Promise<void>;
1680
1683
  private setAdsOnStories;
1681
- getStoriesByIds(storyIds: string[], orderType?: OrderType): Promise<{
1684
+ getStoriesByIds(options: {
1685
+ storyIds: string[];
1686
+ orderType?: OrderType;
1687
+ showLiveFirst?: boolean;
1688
+ }): Promise<{
1682
1689
  result: IStory[];
1683
1690
  httpStatus?: number | undefined;
1684
1691
  data?: StoriesResponse | undefined;
1685
1692
  error?: Error | undefined;
1686
1693
  }>;
1687
- getStoriesByLabels(labels: string, orderType?: OrderType, maxItems?: number, labelsPriority?: string): Promise<{
1694
+ getStoriesByLabels(options: {
1695
+ labels: string;
1696
+ orderType?: OrderType;
1697
+ maxItems?: number;
1698
+ labelsPriority?: string;
1699
+ showLiveFirst?: boolean;
1700
+ }): Promise<{
1688
1701
  result: IStory[];
1689
1702
  httpStatus?: number | undefined;
1690
1703
  data?: StoriesResponse | undefined;
@@ -1777,6 +1790,7 @@ declare abstract class ConfigServiceClass extends ConfigServiceClass_base implem
1777
1790
  private _layoutDirection;
1778
1791
  private _shouldAllowClosedCaptions;
1779
1792
  private _appContext;
1793
+ private _disableAutoLoadingContent;
1780
1794
  protected constructor();
1781
1795
  init(options: IBlazeSDKOptions): Promise<void>;
1782
1796
  private _urls;
@@ -1822,6 +1836,8 @@ declare abstract class ConfigServiceClass extends ConfigServiceClass_base implem
1822
1836
  get shouldAllowClosedCaptions(): boolean;
1823
1837
  get appContext(): Record<string, any>;
1824
1838
  set appContext(value: Record<string, any>);
1839
+ get disableAutoLoadingContent(): boolean;
1840
+ set disableAutoLoadingContent(value: boolean);
1825
1841
  }
1826
1842
  export declare const ConfigService: ConfigServiceClass;
1827
1843
 
@@ -3084,11 +3100,7 @@ export declare function flattenObject<T extends Record<string, any>>(obj: T): Re
3084
3100
  export declare function mergeStyles(element: HTMLElement, styles: Partial<CSSStyleDeclaration>): object;
3085
3101
  export declare function getMaxValue(currentMax: string, newValue: string): string;
3086
3102
  export declare function isReadByLastUnIgnoredPageStatus(story: IStory): boolean;
3087
- export declare function sortByHasViewed(a: {
3088
- hasViewed: boolean;
3089
- }, b: {
3090
- hasViewed: boolean;
3091
- }): number;
3103
+ export declare const getContentScore: (content: IContent) => 1 | 2;
3092
3104
  export declare function applyPlayerStyleChanges(defaultPlayerStyle: StoryPlayerStyle, mergedPlayerStyle: StoryPlayerStyle, themePlayerStyle: StoryPlayerStyle, playerStyleChanges: any): void;
3093
3105
  export declare function getChangedProperties(source: any, target: any, level: string, playerStyleChanges: any, parentKeys?: string): void;
3094
3106
  export declare function removeDuplicates(source: string[], checkAgainst: string[]): string[];
@@ -4066,6 +4078,7 @@ export declare class BlazeWidgetLayout extends BlazeWidgetScrollable implements
4066
4078
  constructor();
4067
4079
  connectedCallback(): void;
4068
4080
  disconnectedCallback(): void;
4081
+ private getContentType;
4069
4082
  onResizeEventDelay(): void;
4070
4083
  onResize(): void;
4071
4084
  handleHeightChangeMutation(mutationsList: MutationRecord[]): void;
@@ -4147,6 +4160,7 @@ export declare class BlazeWidgetLayout extends BlazeWidgetScrollable implements
4147
4160
  labelAdditionalHeight: number;
4148
4161
  };
4149
4162
  event(action: WidgetAction, data: Partial<WidgetEvent>, label?: string | undefined): void;
4163
+ private sortContent;
4150
4164
  private reorderWidgets;
4151
4165
  updateWidgetsData(): void;
4152
4166
  private updateWidgetDisplay;
@@ -4298,6 +4312,7 @@ export declare class BlazeWidgetSDK extends BaseWidget {
4298
4312
  private injectFontResource;
4299
4313
  private injectGoogleTag;
4300
4314
  private injectIma;
4315
+ private pushInitEvent;
4301
4316
  }
4302
4317
 
4303
4318
  export interface IShareButton {
@@ -4385,7 +4400,6 @@ export declare class BlazeWidgetVideo extends BlazeWidgetVideoBase {
4385
4400
  adDisplayContainer: any;
4386
4401
  adsManager: any;
4387
4402
  shouldShowImaAd: boolean;
4388
- googleIMA: any;
4389
4403
  isCurrentlyTryingToRunImaAd: boolean;
4390
4404
  hasPoster: boolean;
4391
4405
  static get observedAttributes(): string[];
@@ -4394,6 +4408,7 @@ export declare class BlazeWidgetVideo extends BlazeWidgetVideoBase {
4394
4408
  connectedCallback(): void;
4395
4409
  disconnectedCallback(): void;
4396
4410
  setData(data: IPage): void;
4411
+ getGoogleIMA(): any;
4397
4412
  private isEnableInteractions;
4398
4413
  loadClosedCaptions(): Promise<void>;
4399
4414
  getVideoDuration(existingVideo?: HTMLVideoElement): Promise<number>;
@@ -4448,7 +4463,6 @@ export declare class BlazeWidgetAd extends BlazeWidgetVideoBase {
4448
4463
  private isCurrentlyDisplay;
4449
4464
  private adContainer;
4450
4465
  private placeholderContainer;
4451
- private googletag;
4452
4466
  private failToLoadTimeout?;
4453
4467
  private onFail?;
4454
4468
  private isAdFailed;
@@ -4465,6 +4479,7 @@ export declare class BlazeWidgetAd extends BlazeWidgetVideoBase {
4465
4479
  get duration(): number;
4466
4480
  get progress(): number;
4467
4481
  set muted(isMuted: boolean);
4482
+ getGoogletag(): any;
4468
4483
  getAdIframeRef(): HTMLIFrameElement | null;
4469
4484
  changeAdMutedState(isMuted: boolean): void;
4470
4485
  setData(data: IPage): void;