@wscsports/blaze-web-sdk 0.5.0 → 0.6.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.5.0",
3
+ "version": "0.6.0",
4
4
  "main": "publish/index",
5
5
  "types": "publish/index",
6
6
  "files": [
@@ -2,6 +2,7 @@ type PlayContentOptions = {
2
2
  dataSource: BlazeDataSourceType;
3
3
  actionHandlers?: ActionHandler[];
4
4
  style?: StoryPlayerStyle | VideoPlayerStyle | MomentPlayerStyle;
5
+ shouldOrderContentByReadStatus?: boolean;
5
6
  };
6
7
  export declare function setDoNotTrack(value: boolean): void;
7
8
  export declare function setGeoLocation(value: string): void;
@@ -330,6 +331,7 @@ export declare class InteractionEvent {
330
331
  'playback_action_method': string;
331
332
  'audio_state': string;
332
333
  'content_extra_info': string;
334
+ 'client_enrichment_url': string;
333
335
  }
334
336
  export declare class ConsentEvent {
335
337
  }
@@ -897,6 +899,12 @@ export declare const CountryCodes: readonly ["AF", "AX", "AL", "DZ", "AS", "AD",
897
899
 
898
900
  export declare const DEFAULT_CTA_HEIGHT = 40;
899
901
  export declare const MIN_PADDING_BOTTOM = 10;
902
+ export declare const Z_INDEX: {
903
+ readonly base: "0";
904
+ readonly player: "1";
905
+ readonly interaction: "2";
906
+ readonly onTopOfPlayer: "3";
907
+ };
900
908
 
901
909
  export declare const ONE_SECOND = 1000;
902
910
  export declare const ONE_AND_HALF_SECOND = 1500;
@@ -1043,6 +1051,7 @@ export type Interaction = {
1043
1051
  initData: string;
1044
1052
  designOverridesStr: string;
1045
1053
  bounds?: InteractionBounds;
1054
+ clientEnrichmentUrl?: string;
1046
1055
  };
1047
1056
  export type InteractionDB = Pick<Interaction, 'id' | 'initData'> & {
1048
1057
  userResponse?: string;
@@ -1065,7 +1074,33 @@ export type InteractionIframeVibrate = {
1065
1074
  type: keyof typeof ANSWER_FEEDBACK_VIBRATE_PATTERNS;
1066
1075
  };
1067
1076
  };
1068
- export type InteractionIframeCustomEvent = InteractionIframeResponse | InteractionIframeVibrate;
1077
+ export type EnrichmentIframeTriggerHaptic = {
1078
+ type: 'hapticFeedback';
1079
+ data: {
1080
+ type: keyof typeof ANSWER_FEEDBACK_VIBRATE_PATTERNS;
1081
+ };
1082
+ };
1083
+ export type EnrichmentIframePlay = {
1084
+ type: 'play';
1085
+ data: undefined;
1086
+ };
1087
+ export type EnrichmentIframePause = {
1088
+ type: 'pause';
1089
+ data: undefined;
1090
+ };
1091
+ export type EnrichmentIframeNextPage = {
1092
+ type: 'goToNextPage';
1093
+ data: undefined;
1094
+ };
1095
+ export type EnrichmentIframePreviousPage = {
1096
+ type: 'goToPreviousPage';
1097
+ data: undefined;
1098
+ };
1099
+ export type EnrichmentIframeSetAppContext = {
1100
+ type: 'setAppContext';
1101
+ data: Record<string, any>;
1102
+ };
1103
+ export type InteractionIframeCustomEvent = InteractionIframeResponse | InteractionIframeVibrate | EnrichmentIframePlay | EnrichmentIframePause | EnrichmentIframePreviousPage | EnrichmentIframeNextPage | EnrichmentIframeSetAppContext | EnrichmentIframeTriggerHaptic;
1069
1104
  export declare const INTERACTION_ANALYTICS = "INTERACTION_ANALYTICS";
1070
1105
 
1071
1106
  export interface ILayerContent {
@@ -1218,7 +1253,11 @@ export declare enum InternalEvent {
1218
1253
  AD_ENDED = "ad_ended",
1219
1254
  AD_RESUMED = "ad_resumed",
1220
1255
  AD_STARTED = "ad_started",
1221
- BANNER_ANALYTICS = "banner_analytics"
1256
+ BANNER_ANALYTICS = "banner_analytics",
1257
+ PAUSE = "pause",
1258
+ RESUME = "resume",
1259
+ NEXT_PAGE = "next_page",
1260
+ PREVIOUS_PAGE = "previous_page"
1222
1261
  }
1223
1262
  export interface InternalEventDetails {
1224
1263
  [InternalEvent.BANNER_ANALYTICS]: {
@@ -2179,6 +2218,7 @@ export declare class PlayerViewTemplate {
2179
2218
  static display(type: ContentType, dataSource: BlazeDataSourceType, options: {
2180
2219
  style: StoryPlayerStyle | VideoPlayerStyle | MomentPlayerStyle;
2181
2220
  actionHandlers?: ActionHandler[];
2221
+ orderByReadStatus: boolean;
2182
2222
  }): Promise<void>;
2183
2223
  private static validateStyleType;
2184
2224
  }
@@ -2209,7 +2249,7 @@ export interface ContentResponse<T> {
2209
2249
  defaultAdsInfo?: IAdInfo;
2210
2250
  }
2211
2251
  export declare abstract class BaseModalTemplate<M extends BlazeWidgetModal, C extends IContent, S> {
2212
- render(dataSource: BlazeDataSourceType, options: ModalTemplateOptions<S>): Promise<void>;
2252
+ render(dataSource: BlazeDataSourceType, options: ModalTemplateOptions<S>, orderByReadStatus: boolean): Promise<void>;
2213
2253
  protected validateRequirements(dataSource: BlazeDataSourceType): {
2214
2254
  isValid: boolean;
2215
2255
  blazeSdk: null;
@@ -2229,7 +2269,6 @@ export declare abstract class BaseModalTemplate<M extends BlazeWidgetModal, C ex
2229
2269
  protected handleError(error: unknown, blazeSdk: BlazeWidgetSDK, dataSourceStringRep: string): void;
2230
2270
  protected fetchContent(dataSource: BlazeDataSourceType): Promise<ContentResponse<C>>;
2231
2271
  protected abstract createModal(parent: HTMLElement, style: S, actionHandlers?: ActionHandler[]): M;
2232
- protected abstract prepareContent(content: C[], service: ContentService<C>): Promise<C[]>;
2233
2272
  protected abstract configureModal(modal: M, content: C[]): void;
2234
2273
  protected abstract getService(): ContentService<C>;
2235
2274
  protected abstract getErrorCode(): ErrorCode;
@@ -2242,7 +2281,6 @@ export * from './moment.template';
2242
2281
 
2243
2282
  export declare class MomentModalTemplate extends BaseModalTemplate<BlazeWidgetMomentModal, IMoment, MomentPlayerStyle> {
2244
2283
  protected createModal(parent: HTMLElement, style: MomentPlayerStyle, actionHandlers?: ActionHandler[]): BlazeWidgetMomentModal;
2245
- protected prepareContent(content: IMoment[], service: ContentService<IMoment>): Promise<IMoment[]>;
2246
2284
  protected configureModal(modal: BlazeWidgetMomentModal, content: IMoment[]): void;
2247
2285
  protected getService(): ContentService<IMoment>;
2248
2286
  protected getErrorCode(): ErrorCode;
@@ -2250,7 +2288,6 @@ export declare class MomentModalTemplate extends BaseModalTemplate<BlazeWidgetMo
2250
2288
 
2251
2289
  export declare class StoryModalTemplate extends BaseModalTemplate<BlazeWidgetStoryModal, IStory, StoryPlayerStyle> {
2252
2290
  protected createModal(parent: HTMLElement, style: StoryPlayerStyle, actionHandlers?: ActionHandler[]): BlazeWidgetStoryModal;
2253
- protected prepareContent(content: IStory[], service: ContentService<IStory>): Promise<IStory[]>;
2254
2291
  protected configureModal(modal: BlazeWidgetStoryModal, content: IStory[]): void;
2255
2292
  protected getService(): ContentService<IStory>;
2256
2293
  protected getErrorCode(): ErrorCode;
@@ -2258,7 +2295,6 @@ export declare class StoryModalTemplate extends BaseModalTemplate<BlazeWidgetSto
2258
2295
 
2259
2296
  export declare class VideoModalTemplate extends BaseModalTemplate<BlazeWidgetVideoModal, IVideo, VideoPlayerStyle> {
2260
2297
  protected createModal(parent: HTMLElement, style: VideoPlayerStyle): BlazeWidgetVideoModal;
2261
- protected prepareContent(content: IVideo[], service: ContentService<IVideo>): Promise<IVideo[]>;
2262
2298
  protected configureModal(modal: BlazeWidgetVideoModal, content: IVideo[]): void;
2263
2299
  protected getService(): ContentService<IVideo>;
2264
2300
  protected getErrorCode(): ErrorCode;
@@ -2269,9 +2305,7 @@ export declare function getDataSourceStringRep(dataSource: BlazeDataSourceType):
2269
2305
  export * from './data-source.utils';
2270
2306
  export * from './sort.utils';
2271
2307
 
2272
- export declare function sortVideosByViewedStatus(a: IVideo, b: IVideo): number;
2273
- export declare function sortStoriesByViewedStatus(a: IStory, b: IStory): number;
2274
- export declare function sortMomentsByViewedStatus(a: IMoment, b: IMoment): number;
2308
+ export declare function sortContentByViewedStatus<T extends IContent>(a: T, b: T): number;
2275
2309
 
2276
2310
  export * from './preset';
2277
2311
  export * from './theme';
@@ -3172,6 +3206,7 @@ type CountryCode = typeof CountryCodes[number];
3172
3206
  export declare function isValidCountryCode(countryCode: string): countryCode is CountryCode;
3173
3207
 
3174
3208
  export declare function GuardNullOrEmpty(name: string, value: any): void;
3209
+ export declare function isStory(content: IContent): content is IStory;
3175
3210
 
3176
3211
  export declare function formatDuration(startDate: Date): string;
3177
3212
  export declare function isCssPropertySupported(property: string): boolean;
@@ -4063,6 +4098,8 @@ export declare class BlazeWidgetEmbeddedStory extends BaseWidget implements IWid
4063
4098
  export declare class BlazeWidgetInteraction extends BaseWidget {
4064
4099
  private iframe;
4065
4100
  private interaction?;
4101
+ private isIframeLoaded;
4102
+ private isInitialized;
4066
4103
  private isActive;
4067
4104
  private shouldForceHide;
4068
4105
  private responseHandler;
@@ -5032,6 +5069,10 @@ export declare class BlazeWidgetStory extends BlazeWidgetContent {
5032
5069
  requestAnimationId: number | null;
5033
5070
  shouldShowImaAdOnStart: boolean;
5034
5071
  bannerAdElement?: BlazeWidgetBannerAd;
5072
+ boundOnResumeEvent: () => void;
5073
+ boundOnPauseEvent: () => void;
5074
+ boundOnNextPageEvent: () => void;
5075
+ boundOnPrevPageEvent: () => void;
5035
5076
  get currentPageIndexWithoutCustomAds(): number;
5036
5077
  constructor(playerStyle: StoryPlayerStyle, mode: ScreenMode, actionHandlers?: ActionHandler[]);
5037
5078
  isButtonVisible(iconName: IconButtonType | StoryDirectionType): boolean | undefined;
@@ -5083,6 +5124,7 @@ export declare class BlazeWidgetStory extends BlazeWidgetContent {
5083
5124
  bannerAdEvent(detail: InternalEventDetails[InternalEvent.BANNER_ANALYTICS]): void;
5084
5125
  event(action: StoryAction, storyData: Partial<StoryEvent>, label?: string | undefined): Promise<void>;
5085
5126
  updateContainerLayout(): void;
5127
+ private addOrRemoveEventListeners;
5086
5128
  connectedCallback(): void;
5087
5129
  onShareModalClose(): void;
5088
5130
  updateStoryProgress(): void;
@@ -5126,6 +5168,10 @@ export declare class BlazeWidgetStory extends BlazeWidgetContent {
5126
5168
  resetLayout(): void;
5127
5169
  render(): void;
5128
5170
  onExpandClick(): void;
5171
+ private onResumeEvent;
5172
+ private onPauseEvent;
5173
+ private onNextPageEvent;
5174
+ private onPrevPageEvent;
5129
5175
  }
5130
5176
 
5131
5177
  export declare const ElementId: {