@wscsports/blaze-web-sdk 0.4.3 → 0.4.4-beta.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.4.3",
3
+ "version": "0.4.4-beta.0",
4
4
  "main": "publish/index",
5
5
  "types": "publish/index",
6
6
  "files": [
@@ -1,7 +1,7 @@
1
1
  type PlayContentOptions = {
2
2
  dataSource: BlazeDataSourceType;
3
3
  actionHandlers?: ActionHandler[];
4
- style?: StoryPlayerStyle | VideoPlayerStyle;
4
+ style?: StoryPlayerStyle | VideoPlayerStyle | MomentPlayerStyle;
5
5
  };
6
6
  export declare function setDoNotTrack(value: boolean): void;
7
7
  export declare function setGeoLocation(value: string): void;
@@ -663,7 +663,7 @@ export declare class BlazeButton extends BaseWidget {
663
663
  isAnimationOnDesktopInitialized: boolean;
664
664
  get refElement(): ShadowRoot | this;
665
665
  constructor();
666
- static get observedAttributes(): ("height" | "order" | "width" | "icon-color" | "disabled" | "blaze-btn-hidden" | "blaze-btn-visible" | "button-desktop-animation")[];
666
+ static get observedAttributes(): ("height" | "order" | "width" | "icon-color" | "disabled" | "blaze-btn-visible" | "blaze-btn-hidden" | "button-desktop-animation")[];
667
667
  private onMouseEnter;
668
668
  private onMouseLeave;
669
669
  private onClick;
@@ -1332,16 +1332,6 @@ export declare abstract class WidgetsFactory {
1332
1332
  }
1333
1333
 
1334
1334
  export * from './elements.factory';
1335
- export * from './player.factory';
1336
-
1337
- export declare class PlayerViewFactory {
1338
- static create(type: ContentType, dataSource: BlazeDataSourceType, options: {
1339
- style: StoryPlayerStyle | VideoPlayerStyle;
1340
- actionHandlers?: ActionHandler[];
1341
- }): Promise<void>;
1342
- static createStory(dataSource: BlazeDataSourceType, style: StoryPlayerStyle, actionHandlers?: ActionHandler[]): Promise<void>;
1343
- static createVideos(dataSource: BlazeDataSourceType, style: VideoPlayerStyle): Promise<void>;
1344
- }
1345
1335
 
1346
1336
  export * from './widget-theme.guard';
1347
1337
 
@@ -2020,7 +2010,7 @@ declare abstract class MomentServiceClass extends MomentServiceClass_base implem
2020
2010
  init(): void;
2021
2011
  fetchContent(dataSource: BlazeDataSourceType): Promise<MomentsResponse>;
2022
2012
  updateMomentReadStatusById(momentId: string): Promise<any>;
2023
- encrichMoment(moment: IMoment[]): Promise<IMoment[]>;
2013
+ enrichContent(moment: IMoment[]): Promise<IMoment[]>;
2024
2014
  }
2025
2015
  export declare const MomentService: MomentServiceClass;
2026
2016
 
@@ -2042,7 +2032,7 @@ declare const StoryServiceClass_base: {
2042
2032
  declare abstract class StoryServiceClass extends StoryServiceClass_base implements IService {
2043
2033
  init(): void;
2044
2034
  fetchContent(dataSource: BlazeDataSourceType): Promise<StoriesResponse>;
2045
- enrichStories(stories: IStory[]): Promise<IStory[]>;
2035
+ enrichContent(stories: IStory[]): Promise<IStory[]>;
2046
2036
  }
2047
2037
  export declare const StoryService: StoryServiceClass;
2048
2038
 
@@ -2160,7 +2150,7 @@ declare abstract class VideoServiceClass extends VideoServiceClass_base implemen
2160
2150
  init(): Promise<void>;
2161
2151
  private loadHlsScript;
2162
2152
  fetchContent(dataSource: BlazeDataSourceType): Promise<VideosResponse>;
2163
- enrichVideos(videos: IVideo[]): Promise<IVideo[]>;
2153
+ enrichContent(videos: IVideo[]): Promise<IVideo[]>;
2164
2154
  getVideoDataById(videoId: string): Promise<VideoDBData | null>;
2165
2155
  updateVideoDataById(videoId: string, data: Partial<VideoDBData>): Promise<void>;
2166
2156
  markVideoAsViewed(videoId: string, poster: string): Promise<void>;
@@ -2177,6 +2167,107 @@ declare abstract class WidgetsServiceClass extends WidgetsServiceClass_base impl
2177
2167
  }
2178
2168
  export declare const WidgetsService: WidgetsServiceClass;
2179
2169
 
2170
+ export * from './player.template';
2171
+
2172
+ export declare class PlayerViewTemplate {
2173
+ private static templates;
2174
+ static display(type: ContentType, dataSource: BlazeDataSourceType, options: {
2175
+ style: StoryPlayerStyle | VideoPlayerStyle | MomentPlayerStyle;
2176
+ actionHandlers?: ActionHandler[];
2177
+ }): Promise<void>;
2178
+ private static validateStyleType;
2179
+ }
2180
+
2181
+ export interface ContentResponse<T> {
2182
+ result: T[];
2183
+ defaultAdsInfo?: IAdInfo;
2184
+ }
2185
+
2186
+ export interface ContentService<T extends IContent> {
2187
+ fetchContent(dataSource: BlazeDataSourceType): Promise<ContentResponse<T>>;
2188
+ enrichContent?(content: T[]): Promise<T[]>;
2189
+ }
2190
+
2191
+ export * from './modal-options';
2192
+ export * from './content-service';
2193
+ export * from './content-response';
2194
+
2195
+ export interface ModalTemplateOptions<T> {
2196
+ style: T;
2197
+ actionHandlers?: ActionHandler[];
2198
+ }
2199
+
2200
+ export interface ModalTemplateOptions<T> {
2201
+ actionHandlers?: ActionHandler[];
2202
+ }
2203
+ export interface ContentResponse<T> {
2204
+ defaultAdsInfo?: IAdInfo;
2205
+ }
2206
+ export declare abstract class BaseModalTemplate<M extends BlazeWidgetModal, C extends IContent, S> {
2207
+ render(dataSource: BlazeDataSourceType, options: ModalTemplateOptions<S>): Promise<void>;
2208
+ protected validateRequirements(dataSource: BlazeDataSourceType): {
2209
+ isValid: boolean;
2210
+ blazeSdk: null;
2211
+ dataSourceStringRep: undefined;
2212
+ } | {
2213
+ isValid: boolean;
2214
+ blazeSdk: BlazeWidgetSDK;
2215
+ dataSourceStringRep: undefined;
2216
+ } | {
2217
+ isValid: boolean;
2218
+ blazeSdk: BlazeWidgetSDK;
2219
+ dataSourceStringRep: string;
2220
+ };
2221
+ protected filterContent(content: C[]): C[];
2222
+ protected validateContentResponse(data: ContentResponse<C>, blazeSdk: BlazeWidgetSDK, dataSourceStringRep: string): boolean;
2223
+ protected openModal(modal: M, blazeSdk: BlazeWidgetSDK): void;
2224
+ protected handleError(error: unknown, blazeSdk: BlazeWidgetSDK, dataSourceStringRep: string): void;
2225
+ protected fetchContent(dataSource: BlazeDataSourceType): Promise<ContentResponse<C>>;
2226
+ protected abstract createModal(parent: HTMLElement, style: S, actionHandlers?: ActionHandler[]): M;
2227
+ protected abstract prepareContent(content: C[], service: ContentService<C>): Promise<C[]>;
2228
+ protected abstract configureModal(modal: M, content: C[]): void;
2229
+ protected abstract getService(): ContentService<C>;
2230
+ protected abstract getErrorCode(): ErrorCode;
2231
+ }
2232
+
2233
+ export * from './base.template';
2234
+ export * from './story.template';
2235
+ export * from './video.template';
2236
+ export * from './moment.template';
2237
+
2238
+ export declare class MomentModalTemplate extends BaseModalTemplate<BlazeWidgetMomentModal, IMoment, MomentPlayerStyle> {
2239
+ protected createModal(parent: HTMLElement, style: MomentPlayerStyle, actionHandlers?: ActionHandler[]): BlazeWidgetMomentModal;
2240
+ protected prepareContent(content: IMoment[], service: ContentService<IMoment>): Promise<IMoment[]>;
2241
+ protected configureModal(modal: BlazeWidgetMomentModal, content: IMoment[]): void;
2242
+ protected getService(): ContentService<IMoment>;
2243
+ protected getErrorCode(): ErrorCode;
2244
+ }
2245
+
2246
+ export declare class StoryModalTemplate extends BaseModalTemplate<BlazeWidgetStoryModal, IStory, StoryPlayerStyle> {
2247
+ protected createModal(parent: HTMLElement, style: StoryPlayerStyle, actionHandlers?: ActionHandler[]): BlazeWidgetStoryModal;
2248
+ protected prepareContent(content: IStory[], service: ContentService<IStory>): Promise<IStory[]>;
2249
+ protected configureModal(modal: BlazeWidgetStoryModal, content: IStory[]): void;
2250
+ protected getService(): ContentService<IStory>;
2251
+ protected getErrorCode(): ErrorCode;
2252
+ }
2253
+
2254
+ export declare class VideoModalTemplate extends BaseModalTemplate<BlazeWidgetVideoModal, IVideo, VideoPlayerStyle> {
2255
+ protected createModal(parent: HTMLElement, style: VideoPlayerStyle): BlazeWidgetVideoModal;
2256
+ protected prepareContent(content: IVideo[], service: ContentService<IVideo>): Promise<IVideo[]>;
2257
+ protected configureModal(modal: BlazeWidgetVideoModal, content: IVideo[]): void;
2258
+ protected getService(): ContentService<IVideo>;
2259
+ protected getErrorCode(): ErrorCode;
2260
+ }
2261
+
2262
+ export declare function getDataSourceStringRep(dataSource: BlazeDataSourceType): string | undefined;
2263
+
2264
+ export * from './data-source.utils';
2265
+ export * from './sort.utils';
2266
+
2267
+ export declare function sortVideosByViewedStatus(a: IVideo, b: IVideo): number;
2268
+ export declare function sortStoriesByViewedStatus(a: IStory, b: IStory): number;
2269
+ export declare function sortMomentsByViewedStatus(a: IMoment, b: IMoment): number;
2270
+
2180
2271
  export * from './preset';
2181
2272
  export * from './theme';
2182
2273
  export * from './theme.interface';
@@ -3520,8 +3611,6 @@ export declare class BlazeWidgetVideoModal extends BlazeWidgetModal {
3520
3611
  parentWidget: HTMLElement;
3521
3612
  playerLayout: VideoPlayerStyle;
3522
3613
  data: IVideo[];
3523
- onClose: (() => void) | undefined;
3524
- onOpen: (() => void) | undefined;
3525
3614
  boundOnResizeEventDelay: (this: Window, ev: UIEvent) => void;
3526
3615
  boundOnKeyDown: (ev: KeyboardEvent) => void;
3527
3616
  boundOnBeforeUnload: () => void;
@@ -4181,6 +4270,8 @@ export declare class BlazeWidgetModal extends BaseWidget {
4181
4270
  boundOnResizeEvent: (this: Window, ev: UIEvent) => void;
4182
4271
  boundOnPopStateEvent: (ev: PopStateEvent) => void;
4183
4272
  onContentChange?: (mode: ContentDirection) => void;
4273
+ onClose: ((options?: ISmoothOpenCloseModal) => void) | undefined;
4274
+ onOpen: (() => void) | undefined;
4184
4275
  constructor(type: ContentType);
4185
4276
  connectedCallback(): void;
4186
4277
  disconnectedCallback(): void;
@@ -4553,8 +4644,6 @@ export declare class BlazeWidgetMomentModal extends BlazeWidgetModal {
4553
4644
  navigationButtonsContainerElement: BlazeDiv;
4554
4645
  nextContentButtonElement?: BlazeButton;
4555
4646
  prevContentButtonElement?: BlazeButton;
4556
- onClose: (() => void) | undefined;
4557
- onOpen: (() => void) | undefined;
4558
4647
  boundOnKeyDown: (ev: KeyboardEvent) => void;
4559
4648
  boundOnNavigationChange: (ev: Event) => void;
4560
4649
  boundOnResizeEventDelay: (this: Window, ev: UIEvent) => void;
@@ -4817,8 +4906,6 @@ export declare class BlazeWidgetStoryModal extends BlazeWidgetModal {
4817
4906
  parentWidget: HTMLElement;
4818
4907
  playerLayout: StoryPlayerStyle;
4819
4908
  actionHandlers?: ActionHandler[] | undefined;
4820
- onOpen?: () => void;
4821
- onClose?: (options?: ISmoothOpenCloseModal) => void;
4822
4909
  boundOnResizeEventDelay: (this: Window, ev: UIEvent) => void;
4823
4910
  boundOnKeyDown: (ev: KeyboardEvent) => void;
4824
4911
  boundOnBeforeUnload: () => void;