@wscsports/blaze-web-sdk 0.1.84 → 0.1.86
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 +2 -2
- package/publish/index.d.ts +98 -35
- package/publish/index.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wscsports/blaze-web-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.86",
|
|
4
4
|
"main": "publish/index",
|
|
5
5
|
"types": "publish/index",
|
|
6
6
|
"files": [
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"javascript-obfuscator": "^4.0.2",
|
|
24
24
|
"style-loader": "^3.3.3",
|
|
25
25
|
"ts-loader": "^9.4.4",
|
|
26
|
-
"typescript": "^5.
|
|
26
|
+
"typescript": "^5.4.2",
|
|
27
27
|
"typescript-declaration-webpack-plugin": "^0.3.0",
|
|
28
28
|
"webpack": "^5.88.1",
|
|
29
29
|
"webpack-cli": "^5.1.4",
|
package/publish/index.d.ts
CHANGED
|
@@ -104,6 +104,7 @@ export * from './long-press.handler';
|
|
|
104
104
|
export * from './singleton.class';
|
|
105
105
|
export * from './throttle';
|
|
106
106
|
export * from './url';
|
|
107
|
+
export * from './device-detector.class';
|
|
107
108
|
|
|
108
109
|
export interface ILongPressHandlerOptions {
|
|
109
110
|
onStart: () => void;
|
|
@@ -192,7 +193,7 @@ export declare class BlazeDrawer extends BaseWidget {
|
|
|
192
193
|
export declare class BlazeImage extends BaseWidget {
|
|
193
194
|
thumbnailElement: HTMLImageElement;
|
|
194
195
|
constructor();
|
|
195
|
-
load(src: string
|
|
196
|
+
load(src: string): void;
|
|
196
197
|
setRatio(ratio: string): void;
|
|
197
198
|
setBorderRadius(radius: string): void;
|
|
198
199
|
}
|
|
@@ -213,9 +214,12 @@ export declare class BlazeLoader extends HTMLElement {
|
|
|
213
214
|
connectedCallback(): void;
|
|
214
215
|
}
|
|
215
216
|
|
|
216
|
-
export declare class
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
export declare class BlazeWidgetItemSkeleton extends BaseWidget {
|
|
218
|
+
width: number;
|
|
219
|
+
thumbnailHeight: number | string;
|
|
220
|
+
layoutStyle: LayoutStyle;
|
|
221
|
+
labelHeight: number;
|
|
222
|
+
constructor(layoutStyle: LayoutStyle, width: number, thumbnailHeight: number, labelHeight: number);
|
|
219
223
|
connectedCallback(): void;
|
|
220
224
|
}
|
|
221
225
|
|
|
@@ -465,6 +469,11 @@ export interface IStory extends IContent {
|
|
|
465
469
|
pages: IPage[];
|
|
466
470
|
isAd: boolean;
|
|
467
471
|
adInfo?: IAdInfo;
|
|
472
|
+
entities?: {
|
|
473
|
+
gameId: string | null;
|
|
474
|
+
teamId: string | null;
|
|
475
|
+
playerId: string | null;
|
|
476
|
+
};
|
|
468
477
|
}
|
|
469
478
|
|
|
470
479
|
export interface IThumbnail {
|
|
@@ -525,7 +534,6 @@ export interface WidgetsTagNameMap {
|
|
|
525
534
|
'blaze-widget-moment-video': BlazeWidgetMomentVideo;
|
|
526
535
|
'blaze-widget-interaction': BlazeWidgetInteraction;
|
|
527
536
|
'blaze-loader': BlazeLoader;
|
|
528
|
-
'blaze-skeleton': BlazeSkeleton;
|
|
529
537
|
'blaze-chip': BlazeChip;
|
|
530
538
|
'blaze-image': BlazeImage;
|
|
531
539
|
'blaze-toast': BlazeToast;
|
|
@@ -556,7 +564,6 @@ interface WidgetsTagNameOptionsMap {
|
|
|
556
564
|
'blaze-widget-moment-video': {};
|
|
557
565
|
'blaze-widget-interaction': {};
|
|
558
566
|
'blaze-loader': {};
|
|
559
|
-
'blaze-skeleton': {};
|
|
560
567
|
'blaze-chip': {};
|
|
561
568
|
'blaze-image': {};
|
|
562
569
|
'blaze-toast': {};
|
|
@@ -674,6 +681,7 @@ export interface IDrawable {
|
|
|
674
681
|
|
|
675
682
|
export * from './blaze-sdk.interface';
|
|
676
683
|
export * from './database.interface';
|
|
684
|
+
export * from './device.interface';
|
|
677
685
|
export * from './drawable.interface';
|
|
678
686
|
export * from './response.interface';
|
|
679
687
|
export * from './service.interface';
|
|
@@ -710,6 +718,7 @@ export interface IWidgetViewOptionsBase {
|
|
|
710
718
|
theme?: IWidgetTheme | ThemeType;
|
|
711
719
|
delegates?: Record<Delegation, EventListenerOrEventListenerObject>;
|
|
712
720
|
labelsPriority?: string;
|
|
721
|
+
perItemStyleOverrides?: PerItemStyleOverrides;
|
|
713
722
|
}
|
|
714
723
|
export interface IWidgetViewOptionsWithLabels extends IWidgetViewOptionsBase {
|
|
715
724
|
labels: string | string[] | BlazeWidgetLabel;
|
|
@@ -728,8 +737,10 @@ export interface IWidgetView {
|
|
|
728
737
|
setLabelsPriority: (labelsPriority: string) => void;
|
|
729
738
|
setContentIds: (storyIds: string[]) => void;
|
|
730
739
|
reload: () => void;
|
|
740
|
+
updateWidgetUI: () => void;
|
|
731
741
|
setMaxItemsDisplaySize: (size: number) => void;
|
|
732
742
|
setDelegations: (delegates: Record<Delegation, EventListenerOrEventListenerObject>) => void;
|
|
743
|
+
updateOverrideStyles: (perItemStyleOverrides: PerItemStyleOverrides) => void;
|
|
733
744
|
}
|
|
734
745
|
|
|
735
746
|
declare const AdServiceClass_base: {
|
|
@@ -743,17 +754,6 @@ declare abstract class AdServiceClass extends AdServiceClass_base implements ISe
|
|
|
743
754
|
}
|
|
744
755
|
export declare const AdService: AdServiceClass;
|
|
745
756
|
|
|
746
|
-
declare const AlertServiceClass_base: {
|
|
747
|
-
new (): {};
|
|
748
|
-
_instance: AlertServiceClass;
|
|
749
|
-
getInstance(): AlertServiceClass;
|
|
750
|
-
};
|
|
751
|
-
declare abstract class AlertServiceClass extends AlertServiceClass_base implements IService {
|
|
752
|
-
init(): Promise<void>;
|
|
753
|
-
alert(): void;
|
|
754
|
-
}
|
|
755
|
-
export declare const AlertService: AlertServiceClass;
|
|
756
|
-
|
|
757
757
|
declare const AnalyticsServiceClass_base: {
|
|
758
758
|
new (): {};
|
|
759
759
|
_instance: AnalyticsServiceClass;
|
|
@@ -1109,7 +1109,6 @@ declare abstract class EventServiceClass extends EventServiceClass_base implemen
|
|
|
1109
1109
|
export declare const EventService: EventServiceClass;
|
|
1110
1110
|
|
|
1111
1111
|
export * from './ad.service';
|
|
1112
|
-
export * from './alert.ervice';
|
|
1113
1112
|
export * from './analytics.service';
|
|
1114
1113
|
export * from './api.service';
|
|
1115
1114
|
export * from './config.service';
|
|
@@ -1250,6 +1249,7 @@ export declare class Presets {
|
|
|
1250
1249
|
static StatusLiveUnreadStyle: IndicatorStyle;
|
|
1251
1250
|
static StatusReadStyle: IndicatorStyle;
|
|
1252
1251
|
static StatusUnreadStyle: IndicatorStyle;
|
|
1252
|
+
static BadgeStyle: IndicatorStyle;
|
|
1253
1253
|
static LabelStyle: LabelStyle;
|
|
1254
1254
|
static Grid2Column: LayoutStyle;
|
|
1255
1255
|
static Grid3Column: LayoutStyle;
|
|
@@ -1265,15 +1265,19 @@ export declare class Presets {
|
|
|
1265
1265
|
export interface IndicatorStyle {
|
|
1266
1266
|
backgroundColor: string;
|
|
1267
1267
|
backgroundImage: string;
|
|
1268
|
-
textColor: string;
|
|
1269
|
-
font: string;
|
|
1270
|
-
textSize: string;
|
|
1271
|
-
letterSpacing: string;
|
|
1272
1268
|
borderRadius: string;
|
|
1273
1269
|
borderColor: string;
|
|
1274
1270
|
borderWidth: number;
|
|
1275
1271
|
text: string;
|
|
1272
|
+
textColor: string;
|
|
1273
|
+
textSize: string;
|
|
1274
|
+
letterSpacing: string;
|
|
1275
|
+
font: string;
|
|
1276
1276
|
isVisible: boolean;
|
|
1277
|
+
width?: number;
|
|
1278
|
+
height?: number;
|
|
1279
|
+
padding: string;
|
|
1280
|
+
positionOffset?: PartialPositionOffset;
|
|
1277
1281
|
}
|
|
1278
1282
|
export interface LayoutStyle {
|
|
1279
1283
|
thumbnailShape: ThumbnailShape;
|
|
@@ -1293,7 +1297,9 @@ export interface LayoutStyle {
|
|
|
1293
1297
|
statusLiveUnreadStyle: IndicatorStyle;
|
|
1294
1298
|
statusReadStyle: IndicatorStyle;
|
|
1295
1299
|
statusUnreadStyle: IndicatorStyle;
|
|
1300
|
+
badgeIndicatorStyle: IndicatorStyle;
|
|
1296
1301
|
statusIndicatorPosition: PositionType;
|
|
1302
|
+
badgePosition: PositionType;
|
|
1297
1303
|
}
|
|
1298
1304
|
export interface LabelStyle {
|
|
1299
1305
|
isVisible: boolean;
|
|
@@ -1708,15 +1714,23 @@ export * from './client-platform.type';
|
|
|
1708
1714
|
export * from './direction.type';
|
|
1709
1715
|
export * from './element.type';
|
|
1710
1716
|
export * from './fetch-priority.type';
|
|
1717
|
+
export * from './item.type';
|
|
1711
1718
|
export * from './label.type';
|
|
1712
1719
|
export * from './order.type';
|
|
1713
1720
|
export * from './play.type';
|
|
1721
|
+
export * from './position.type';
|
|
1714
1722
|
export * from './severity.type';
|
|
1715
1723
|
export * from './size.type';
|
|
1716
1724
|
export * from './story-direction.type';
|
|
1717
1725
|
export * from './thumbnail.type';
|
|
1718
1726
|
export * from './widget.type';
|
|
1719
1727
|
|
|
1728
|
+
export type EntitiesType = 'playerId' | 'teamId' | 'gameId';
|
|
1729
|
+
export type PerItemStyleOverrides = Record<EntitiesType, Array<{
|
|
1730
|
+
name: string;
|
|
1731
|
+
theme: IWidgetTheme;
|
|
1732
|
+
}>>;
|
|
1733
|
+
|
|
1720
1734
|
export type labelType = string | string[] | BlazeWidgetLabel;
|
|
1721
1735
|
|
|
1722
1736
|
export type OrderType = 'Manual' | 'AtoZ' | 'ZtoA' | 'RecentlyUpdatedFirst' | 'RecentlyUpdatedLast' | 'RecentlyCreatedFirst' | 'RecentlyCreatedLast';
|
|
@@ -1725,8 +1739,15 @@ export declare const PlayTypeArray: readonly ["Widget", "Share", "SingleStory"];
|
|
|
1725
1739
|
export type PlayType = typeof PlayTypeArray[number];
|
|
1726
1740
|
|
|
1727
1741
|
export type PositionInsideType = 'insideTopLeft' | 'insideTopRight' | 'insideMiddleTop' | 'insideMiddle' | 'insideBottomRight' | 'insideBottomLeft' | 'insideBottomMiddle' | 'insideMiddleLeft' | 'insideMiddleRight';
|
|
1728
|
-
export type PositionOutsideType = '
|
|
1742
|
+
export type PositionOutsideType = 'outsideTop' | 'outsideTopLeft' | 'outsideTopRight' | 'outsideBottomLeft' | 'outsideBottomRight' | 'outsideBottom' | 'outsideRight' | 'outsideLeft';
|
|
1729
1743
|
export type PositionType = PositionInsideType | PositionOutsideType;
|
|
1744
|
+
export interface PositionOffset {
|
|
1745
|
+
top: string;
|
|
1746
|
+
left: string;
|
|
1747
|
+
right: string;
|
|
1748
|
+
bottom: string;
|
|
1749
|
+
}
|
|
1750
|
+
export type PartialPositionOffset = Partial<PositionOffset>;
|
|
1730
1751
|
|
|
1731
1752
|
export type SeverityType = 'error' | 'warning' | 'info' | 'success';
|
|
1732
1753
|
|
|
@@ -1748,8 +1769,9 @@ interface ChipSizeOptions {
|
|
|
1748
1769
|
statusUnreadStyle: IndicatorStyle;
|
|
1749
1770
|
}
|
|
1750
1771
|
export declare function getChipSize(options: ChipSizeOptions): DOMRect;
|
|
1751
|
-
export declare function
|
|
1752
|
-
export declare function
|
|
1772
|
+
export declare function createChip(indicatorSettings: IndicatorStyle): DOMRect;
|
|
1773
|
+
export declare function getMaxChipSize(type: 'chip' | 'badge', layout: LayoutStyle): DOMRect;
|
|
1774
|
+
export declare function calculateChipSize(type: 'chip' | 'badge', statusIndicatorPosition: PositionType, layoutStyle: LayoutStyle): {
|
|
1753
1775
|
chipHeight: number;
|
|
1754
1776
|
chipWidth: number;
|
|
1755
1777
|
};
|
|
@@ -1764,18 +1786,22 @@ export declare function GuardNullOrEmpty(name: string, value: any): void;
|
|
|
1764
1786
|
export declare function formatDuration(startDate: Date): string;
|
|
1765
1787
|
export declare function removeUndefined(value: any): object;
|
|
1766
1788
|
export declare function isCssPropertySupported(property: string): boolean;
|
|
1789
|
+
export declare function pixelsToNumber(pxString: string): number;
|
|
1767
1790
|
export declare function isObject(item: any): boolean;
|
|
1768
1791
|
export declare function mergeDeep(target: any, ...sources: any[]): any;
|
|
1769
1792
|
export declare function cloneDeep<T>(target: T): T;
|
|
1770
1793
|
export declare function formatDate(date: Date): string;
|
|
1771
1794
|
export declare function formatUTCDate(date: Date): string;
|
|
1795
|
+
export declare function calculatePercentage(value: number, element: BlazeDiv): string;
|
|
1772
1796
|
export declare function getRandomId(): string;
|
|
1797
|
+
export declare function isEmpty(obj: Record<string, any>): boolean;
|
|
1773
1798
|
export declare function setId(element: HTMLElement, prefix?: string, suffix?: string): void;
|
|
1774
1799
|
export type DeepPartial<T> = T extends object ? {
|
|
1775
1800
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
1776
1801
|
} : T;
|
|
1777
1802
|
export declare function flattenObject<T extends Record<string, any>>(obj: T): Record<string, any>;
|
|
1778
1803
|
export declare function mergeStyles(element: HTMLElement, styles: Partial<CSSStyleDeclaration>): object;
|
|
1804
|
+
export declare function getMaxValue(currentMax: string, newValue: string): string;
|
|
1779
1805
|
|
|
1780
1806
|
export * from './chip.utils';
|
|
1781
1807
|
export * from './common.utils';
|
|
@@ -1792,8 +1818,6 @@ export declare function calculatePosition(statusIndicatorPosition: PositionType)
|
|
|
1792
1818
|
isTop: boolean;
|
|
1793
1819
|
isMiddle: boolean;
|
|
1794
1820
|
isBottom: boolean;
|
|
1795
|
-
isBelow: boolean;
|
|
1796
|
-
isAbove: boolean;
|
|
1797
1821
|
isLeft: boolean;
|
|
1798
1822
|
isRight: boolean;
|
|
1799
1823
|
};
|
|
@@ -1888,12 +1912,11 @@ export declare class BlazeWidgetItem extends BaseWidget {
|
|
|
1888
1912
|
private labelBackground;
|
|
1889
1913
|
private theme;
|
|
1890
1914
|
private chip;
|
|
1915
|
+
private badge;
|
|
1891
1916
|
private isLive;
|
|
1892
|
-
private shouldDisplaySkeleton;
|
|
1893
|
-
private blazeSkeletonThumbnail;
|
|
1894
|
-
private blazeSkeletonLabel;
|
|
1895
1917
|
private analyticsCalls;
|
|
1896
1918
|
private statusIndicatorSettings;
|
|
1919
|
+
paddingItem: PositionOffset;
|
|
1897
1920
|
content: IStory;
|
|
1898
1921
|
onClick: (() => void) | undefined;
|
|
1899
1922
|
constructor(options: BlazeWidgetItemOptions);
|
|
@@ -1901,22 +1924,26 @@ export declare class BlazeWidgetItem extends BaseWidget {
|
|
|
1901
1924
|
connectedCallback(): void;
|
|
1902
1925
|
disconnectedCallback(): void;
|
|
1903
1926
|
updateWidget(): void;
|
|
1927
|
+
updateWidgetItemStyle(theme: IWidgetTheme): void;
|
|
1904
1928
|
private setupDOMElements;
|
|
1905
1929
|
private setupEventListeners;
|
|
1906
1930
|
private handleWidgetClick;
|
|
1907
1931
|
private setData;
|
|
1908
1932
|
getThumbnailUrl(): string;
|
|
1909
|
-
private removeSkeleton;
|
|
1910
|
-
handelOnCompleteLoadingThumbnail(): void;
|
|
1911
1933
|
private updateLabel;
|
|
1912
|
-
private
|
|
1934
|
+
private resetWidgetItemStyles;
|
|
1913
1935
|
private updateContainerStyles;
|
|
1914
1936
|
private updateLabelStyles;
|
|
1915
1937
|
private updateInsideLabelStyles;
|
|
1916
1938
|
private updateOutsideLabelStyles;
|
|
1917
1939
|
private updateThumbnailStyles;
|
|
1918
|
-
private
|
|
1940
|
+
private updateStatusIndicatorStyle;
|
|
1941
|
+
private handleOutsidePosition;
|
|
1942
|
+
private handleInsidePosition;
|
|
1943
|
+
private applyCommonStyles;
|
|
1919
1944
|
setTheme(theme: IWidgetTheme): void;
|
|
1945
|
+
getPaddingOnContainer(): PositionOffset;
|
|
1946
|
+
setPaddingOnContainer(padding: PositionOffset): void;
|
|
1920
1947
|
setChipStyle(): void;
|
|
1921
1948
|
event(action: WidgetAction, data: Partial<WidgetEvent>, label?: string | undefined): void;
|
|
1922
1949
|
render(): void;
|
|
@@ -1942,8 +1969,11 @@ export declare class BlazeWidgetLayout extends BlazeWidgetScrollable implements
|
|
|
1942
1969
|
modalMoments: BlazeWidgetMomentModal | undefined;
|
|
1943
1970
|
stories: IStory[];
|
|
1944
1971
|
moments: IMoment[];
|
|
1972
|
+
skeletonContainer: BlazeDiv | undefined;
|
|
1945
1973
|
widgetItems: BlazeWidgetItem[];
|
|
1946
1974
|
preset: IWidgetTheme | undefined;
|
|
1975
|
+
perItemStyleOverrides: PerItemStyleOverrides;
|
|
1976
|
+
activeOverridesLayoutThemes: PerItemStyleOverrides;
|
|
1947
1977
|
thumbnailWidth: number | undefined;
|
|
1948
1978
|
thumbnailHeight: number | undefined;
|
|
1949
1979
|
widgetHeight: number;
|
|
@@ -1960,10 +1990,10 @@ export declare class BlazeWidgetLayout extends BlazeWidgetScrollable implements
|
|
|
1960
1990
|
handleIntersection(entries: IntersectionObserverEntry[]): void;
|
|
1961
1991
|
connectedCallback(): void;
|
|
1962
1992
|
disconnectedCallback(): void;
|
|
1993
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
1963
1994
|
onKeyDown(e: KeyboardEvent): void;
|
|
1964
1995
|
onStoryChange(mode: StoryDirectionType): void;
|
|
1965
1996
|
getParentHeightWithoutPadding(): number | null;
|
|
1966
|
-
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
1967
1997
|
setId(id: string): void;
|
|
1968
1998
|
handlePopState(_event: Event): void;
|
|
1969
1999
|
addDelegateListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
@@ -1974,7 +2004,10 @@ export declare class BlazeWidgetLayout extends BlazeWidgetScrollable implements
|
|
|
1974
2004
|
getTheme(): IWidgetTheme;
|
|
1975
2005
|
setTheme(theme: IWidgetTheme | string): void;
|
|
1976
2006
|
private get theme();
|
|
2007
|
+
updateOverrideStyles(perItemStyleOverrides: PerItemStyleOverrides): void;
|
|
1977
2008
|
reload(): void;
|
|
2009
|
+
updateActiveLayoutThemesPerItemWithEntity(key: EntitiesType, value: string, theme: IWidgetTheme): void;
|
|
2010
|
+
updateWidgetUI(): void;
|
|
1978
2011
|
setDelegations(delegates: Record<Delegation, EventListenerOrEventListenerObject>): void;
|
|
1979
2012
|
setMaxItemsDisplaySize(maxSize: number): void;
|
|
1980
2013
|
setMaxItemsSize(maxItemsSize: number): void;
|
|
@@ -1983,7 +2016,37 @@ export declare class BlazeWidgetLayout extends BlazeWidgetScrollable implements
|
|
|
1983
2016
|
static get observedAttributes(): string[];
|
|
1984
2017
|
onItemClick(item: BlazeWidgetItem, i: number): void;
|
|
1985
2018
|
loadStories(): Promise<void>;
|
|
2019
|
+
processStoriesInWidget(): void;
|
|
2020
|
+
calculateChipSizes(theme: IWidgetTheme): {
|
|
2021
|
+
badge: {
|
|
2022
|
+
width: number;
|
|
2023
|
+
height: number;
|
|
2024
|
+
};
|
|
2025
|
+
chip: {
|
|
2026
|
+
width: number;
|
|
2027
|
+
height: number;
|
|
2028
|
+
};
|
|
2029
|
+
};
|
|
2030
|
+
getStatusIndicatorBadgeAndChipSizes(): {
|
|
2031
|
+
maxBadgeHeight: number;
|
|
2032
|
+
maxBadgeWidth: number;
|
|
2033
|
+
maxChipHeight: number;
|
|
2034
|
+
maxChipWidth: number;
|
|
2035
|
+
};
|
|
2036
|
+
getMaxSizes(badge: {
|
|
2037
|
+
height: number;
|
|
2038
|
+
width: number;
|
|
2039
|
+
}, chip: {
|
|
2040
|
+
height: number;
|
|
2041
|
+
width: number;
|
|
2042
|
+
}, badgePosition: string, statusIndicatorPosition: string): {
|
|
2043
|
+
maxBadgeHeight: number;
|
|
2044
|
+
maxBadgeWidth: number;
|
|
2045
|
+
maxChipHeight: number;
|
|
2046
|
+
maxChipWidth: number;
|
|
2047
|
+
};
|
|
1986
2048
|
render(): void;
|
|
2049
|
+
calculateWidthForRow(height: number, itemRatio: number, maxWidth: number, labelAdditionalWidth: number): number;
|
|
1987
2050
|
calculateLabelSizes(labelStyle: LabelStyle, lineNumber: number): {
|
|
1988
2051
|
labelWidth: number | "auto";
|
|
1989
2052
|
labelAdditionalWidth: number;
|