@wscsports/blaze-web-sdk 0.1.51 → 0.1.54
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 +73 -24
- 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.54",
|
|
4
4
|
"main": "publish/index",
|
|
5
5
|
"types": "publish/index",
|
|
6
6
|
"files": [
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"build:dev": "webpack --config webpack.config.dev.js",
|
|
12
12
|
"build:prod": "webpack --config webpack.config.prod.js",
|
|
13
13
|
"publish:latest": "npm run build:prod && npm publish --access public --tag latest",
|
|
14
|
-
"publish:
|
|
14
|
+
"publish:beta": "npm run build:prod && npm publish --access public --tag beta"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/animejs": "^3.1.7",
|
package/publish/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare function WidgetGridView(containerId: string, options: IWidgetView
|
|
|
5
5
|
export declare function Theme(theme: ThemeType): IWidgetTheme;
|
|
6
6
|
export declare function addDelegateListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
7
7
|
export declare const Delegations: typeof Delegation;
|
|
8
|
+
export declare function LabelBuilder(): IWidgetLabelBuilder;
|
|
8
9
|
declare const _default: {
|
|
9
10
|
Initialize: typeof Initialize;
|
|
10
11
|
WidgetGridView: typeof WidgetGridView;
|
|
@@ -12,6 +13,7 @@ declare const _default: {
|
|
|
12
13
|
Theme: typeof Theme;
|
|
13
14
|
addDelegateListener: typeof addDelegateListener;
|
|
14
15
|
setDoNotTrack: typeof setDoNotTrack;
|
|
16
|
+
LabelBuilder: typeof LabelBuilder;
|
|
15
17
|
Delegations: typeof Delegation;
|
|
16
18
|
};
|
|
17
19
|
export default _default;
|
|
@@ -103,7 +105,6 @@ export declare class URLManager {
|
|
|
103
105
|
static isBackWasCalled: boolean;
|
|
104
106
|
static resetLocation(): void;
|
|
105
107
|
static updateLocationStoryHash(story?: IStory): void;
|
|
106
|
-
static removePlayerTypeFromUrl(): void;
|
|
107
108
|
static getPlayerTypeFromUrl(): "Widget" | "Share" | "SingleStory" | undefined;
|
|
108
109
|
}
|
|
109
110
|
|
|
@@ -171,9 +172,11 @@ export declare class BlazeImage extends BaseWidget {
|
|
|
171
172
|
export * from './alert';
|
|
172
173
|
export * from './buttons';
|
|
173
174
|
export * from './chip';
|
|
175
|
+
export * from './div';
|
|
174
176
|
export * from './drawer';
|
|
175
177
|
export * from './image';
|
|
176
178
|
export * from './loader';
|
|
179
|
+
export * from './skeleton';
|
|
177
180
|
export * from './toast';
|
|
178
181
|
export * from './typography';
|
|
179
182
|
|
|
@@ -182,6 +185,12 @@ export declare class BlazeLoader extends HTMLElement {
|
|
|
182
185
|
connectedCallback(): void;
|
|
183
186
|
}
|
|
184
187
|
|
|
188
|
+
export declare class BlazeSkeleton extends BaseWidget {
|
|
189
|
+
borderRadius: string;
|
|
190
|
+
constructor(elementStyle?: ShapeType);
|
|
191
|
+
connectedCallback(): void;
|
|
192
|
+
}
|
|
193
|
+
|
|
185
194
|
export declare class BlazeToast extends BaseWidget {
|
|
186
195
|
constructor();
|
|
187
196
|
static get observedAttributes(): string[];
|
|
@@ -394,6 +403,7 @@ export interface WidgetsTagNameMap {
|
|
|
394
403
|
'blaze-widget-image': BlazeWidgetStoryImage;
|
|
395
404
|
'blaze-widget-video': BlazeWidgetStoryVideo;
|
|
396
405
|
'blaze-loader': BlazeLoader;
|
|
406
|
+
'blaze-skeleton': BlazeSkeleton;
|
|
397
407
|
'blaze-chip': BlazeChip;
|
|
398
408
|
'blaze-image': BlazeImage;
|
|
399
409
|
'blaze-toast': BlazeToast;
|
|
@@ -420,6 +430,7 @@ interface WidgetsTagNameOptionsMap {
|
|
|
420
430
|
'blaze-widget-image': {};
|
|
421
431
|
'blaze-widget-video': {};
|
|
422
432
|
'blaze-loader': {};
|
|
433
|
+
'blaze-skeleton': {};
|
|
423
434
|
'blaze-chip': {};
|
|
424
435
|
'blaze-image': {};
|
|
425
436
|
'blaze-toast': {};
|
|
@@ -437,6 +448,10 @@ export declare abstract class WidgetsFactory {
|
|
|
437
448
|
|
|
438
449
|
export * from './elements.factory';
|
|
439
450
|
|
|
451
|
+
export * from './widget-theme.guard';
|
|
452
|
+
|
|
453
|
+
export declare function isWidgetTheme(theme: any): theme is IWidgetTheme;
|
|
454
|
+
|
|
440
455
|
export * from './svgs';
|
|
441
456
|
|
|
442
457
|
export declare const playSvg = "data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" fill=\"none\"><path stroke=\"%23fff\" stroke-linecap=\"round\" stroke-width=\"1.9\" d=\"M17.74 30.34V18.53a1.8 1.8 0 0 1 2.77-1.52l9.23 5.92a1.8 1.8 0 0 1 0 3.03l-9.23 5.9a1.8 1.8 0 0 1-2.77-1.52z\"/></svg>";
|
|
@@ -491,11 +506,12 @@ export interface IDrawable {
|
|
|
491
506
|
|
|
492
507
|
export * from './blaze-sdk.interface';
|
|
493
508
|
export * from './database.interface';
|
|
509
|
+
export * from './drawable.interface';
|
|
494
510
|
export * from './response.interface';
|
|
495
511
|
export * from './service.interface';
|
|
512
|
+
export * from './widget-label-builder.interface';
|
|
496
513
|
export * from './widget-options.interface';
|
|
497
514
|
export * from './widget-view.interface';
|
|
498
|
-
export * from './drawable.interface';
|
|
499
515
|
|
|
500
516
|
export default interface IntersectionObservable {
|
|
501
517
|
intersectionObserver: IntersectionObserver;
|
|
@@ -511,24 +527,37 @@ export interface IService {
|
|
|
511
527
|
init: (...args: any[]) => void;
|
|
512
528
|
}
|
|
513
529
|
|
|
530
|
+
export interface IWidgetLabelBuilder {
|
|
531
|
+
singleLabel(label: string): BlazeWidgetLabel;
|
|
532
|
+
mustInclude(...labels: Array<string | BlazeWidgetLabel>): BlazeWidgetLabel;
|
|
533
|
+
atLeastOneOf(...labels: Array<string | BlazeWidgetLabel>): BlazeWidgetLabel;
|
|
534
|
+
}
|
|
535
|
+
|
|
514
536
|
export type ContentType = 'story';
|
|
515
|
-
export interface
|
|
516
|
-
labels: string[];
|
|
537
|
+
export interface IWidgetViewOptionsBase {
|
|
517
538
|
orderType: OrderType;
|
|
518
|
-
storyIds?: string[];
|
|
519
539
|
maxItemsCount?: number;
|
|
520
540
|
maxDisplayItemsCount?: number;
|
|
521
|
-
contentType
|
|
541
|
+
contentType?: ContentType;
|
|
522
542
|
theme?: IWidgetTheme | ThemeType;
|
|
523
543
|
delegates?: Record<Delegation, EventListenerOrEventListenerObject>;
|
|
524
544
|
}
|
|
545
|
+
export interface IWidgetViewOptionsWithLabels extends IWidgetViewOptionsBase {
|
|
546
|
+
labels: string | string[] | BlazeWidgetLabel;
|
|
547
|
+
storyIds?: never;
|
|
548
|
+
}
|
|
549
|
+
export interface IWidgetViewOptionsWithStoryIds extends IWidgetViewOptionsBase {
|
|
550
|
+
storyIds: string[];
|
|
551
|
+
labels?: never;
|
|
552
|
+
}
|
|
553
|
+
export type IWidgetViewOptions = IWidgetViewOptionsWithLabels | IWidgetViewOptionsWithStoryIds;
|
|
525
554
|
|
|
526
555
|
export interface IWidgetView {
|
|
527
556
|
setTheme: (theme: IWidgetTheme) => void;
|
|
528
557
|
getTheme: () => IWidgetTheme;
|
|
529
558
|
setLabels: (labels: string[]) => void;
|
|
530
|
-
reload: (
|
|
531
|
-
|
|
559
|
+
reload: () => void;
|
|
560
|
+
setDelegations: (delegates: Record<Delegation, EventListenerOrEventListenerObject>) => void;
|
|
532
561
|
}
|
|
533
562
|
|
|
534
563
|
declare const AlertServiceClass_base: {
|
|
@@ -956,8 +985,11 @@ export declare class Presets {
|
|
|
956
985
|
static LabelStyle: LabelStyle;
|
|
957
986
|
static Grid2Column: LayoutStyle;
|
|
958
987
|
static Grid3Column: LayoutStyle;
|
|
988
|
+
static Grid2ColumnHorizontal: LayoutStyle;
|
|
989
|
+
static Grid3ColumnHorizontal: LayoutStyle;
|
|
959
990
|
static RowCircle: LayoutStyle;
|
|
960
991
|
static RowRectangle: LayoutStyle;
|
|
992
|
+
static RowHorizontalRectangle: LayoutStyle;
|
|
961
993
|
static Default: LayoutStyle;
|
|
962
994
|
static DefaultStoryStyle: StoryPlayerStyle;
|
|
963
995
|
}
|
|
@@ -975,7 +1007,8 @@ export interface IndicatorStyle {
|
|
|
975
1007
|
text: string;
|
|
976
1008
|
}
|
|
977
1009
|
export interface LayoutStyle {
|
|
978
|
-
shape:
|
|
1010
|
+
shape: ShapeType;
|
|
1011
|
+
thumbnailType: ThumbnailType;
|
|
979
1012
|
rows: number;
|
|
980
1013
|
columns: number;
|
|
981
1014
|
itemRatio: number;
|
|
@@ -990,7 +1023,7 @@ export interface LayoutStyle {
|
|
|
990
1023
|
statusLiveUnreadStyle: IndicatorStyle;
|
|
991
1024
|
statusReadStyle: IndicatorStyle;
|
|
992
1025
|
statusUnreadStyle: IndicatorStyle;
|
|
993
|
-
statusIndicatorPosition:
|
|
1026
|
+
statusIndicatorPosition: PositionType;
|
|
994
1027
|
}
|
|
995
1028
|
export interface LabelStyle {
|
|
996
1029
|
visible: boolean;
|
|
@@ -1001,7 +1034,7 @@ export interface LabelStyle {
|
|
|
1001
1034
|
padding: string;
|
|
1002
1035
|
font: string;
|
|
1003
1036
|
fontSize: string;
|
|
1004
|
-
position:
|
|
1037
|
+
position: PositionType;
|
|
1005
1038
|
}
|
|
1006
1039
|
export interface StoryPlayerStyle {
|
|
1007
1040
|
titleVisible: boolean;
|
|
@@ -1032,7 +1065,7 @@ export declare const Colors: {
|
|
|
1032
1065
|
readonly TimeColor: "#7F7F7F";
|
|
1033
1066
|
};
|
|
1034
1067
|
|
|
1035
|
-
export type ThemeType = '
|
|
1068
|
+
export type ThemeType = 'grid-2-columns' | 'grid-3-columns' | 'row-circle' | 'row-rectangle' | 'row-rectangle-horizontal' | 'grid-2-columns-horizontal' | 'grid-3-columns-horizontal' | 'default';
|
|
1036
1069
|
export declare class ThemeFactory {
|
|
1037
1070
|
static create(name?: ThemeType): IWidgetTheme;
|
|
1038
1071
|
}
|
|
@@ -1390,25 +1423,30 @@ export * from './client-platform.type';
|
|
|
1390
1423
|
export * from './direction.type';
|
|
1391
1424
|
export * from './element.type';
|
|
1392
1425
|
export * from './fetch-priority.type';
|
|
1426
|
+
export * from './label.type';
|
|
1393
1427
|
export * from './order.type';
|
|
1428
|
+
export * from './play.type';
|
|
1394
1429
|
export * from './severity.type';
|
|
1395
1430
|
export * from './shape.type';
|
|
1396
1431
|
export * from './size.type';
|
|
1397
1432
|
export * from './thumbnail.type';
|
|
1398
|
-
|
|
1433
|
+
|
|
1434
|
+
export type labelType = string | string[] | BlazeWidgetLabel;
|
|
1399
1435
|
|
|
1400
1436
|
export type OrderType = 'Manual' | 'AtoZ' | 'ZtoA' | 'RecentlyUpdatedFirst' | 'RecentlyUpdatedLast' | 'RecentlyCreatedFirst' | 'RecentlyCreatedLast';
|
|
1401
1437
|
|
|
1402
1438
|
export declare const PlayTypeArray: readonly ["Widget", "Share", "SingleStory"];
|
|
1403
1439
|
export type PlayType = typeof PlayTypeArray[number];
|
|
1404
1440
|
|
|
1441
|
+
export type PositionType = 'insideTopLeft' | 'insideTopRight' | 'insideMiddle' | 'insideBottomRight' | 'insideBottomLeft' | 'insideBottomMiddle' | 'insideMiddleLeft' | 'insideMiddleRight' | 'outsideUnder' | 'outsideAbove' | 'outsideTop' | 'outsideTopLeft' | 'outsideTopRight' | 'outsideBottomLeft' | 'outsideBottomRight' | 'outsideBottom' | 'outsideRight' | 'outsideLeft';
|
|
1442
|
+
|
|
1405
1443
|
export type SeverityType = 'error' | 'warning' | 'info' | 'success';
|
|
1406
1444
|
|
|
1407
1445
|
export type ShapeType = 'rectangle' | 'custom' | 'circle';
|
|
1408
1446
|
|
|
1409
1447
|
export type SizeType = 'small' | 'medium' | 'large';
|
|
1410
1448
|
|
|
1411
|
-
export type ThumbnailType = 'SquareIcon' | 'VerticalTwoByThree';
|
|
1449
|
+
export type ThumbnailType = 'SquareIcon' | 'VerticalTwoByThree' | 'MainThumbnail';
|
|
1412
1450
|
|
|
1413
1451
|
interface ChipSizeOptions {
|
|
1414
1452
|
statusLiveStyle: IndicatorStyle;
|
|
@@ -1485,8 +1523,8 @@ export * from './widget-story-video';
|
|
|
1485
1523
|
export interface BlazeWidgetItemOptions {
|
|
1486
1524
|
theme: IWidgetTheme;
|
|
1487
1525
|
story: IStory;
|
|
1488
|
-
thumbnailType: string;
|
|
1489
1526
|
}
|
|
1527
|
+
export type itemStateType = 'loading' | 'done' | 'failed';
|
|
1490
1528
|
export declare class BlazeWidgetItem extends BaseWidget {
|
|
1491
1529
|
protected options: BlazeWidgetItemOptions;
|
|
1492
1530
|
wrapper: HTMLElement;
|
|
@@ -1502,13 +1540,15 @@ export declare class BlazeWidgetItem extends BaseWidget {
|
|
|
1502
1540
|
onClick: (() => void) | undefined;
|
|
1503
1541
|
chip: HTMLElement;
|
|
1504
1542
|
newChip: HTMLElement | undefined;
|
|
1505
|
-
state:
|
|
1543
|
+
state: itemStateType;
|
|
1506
1544
|
isLive: boolean | undefined;
|
|
1545
|
+
blazeSkeletonThumbnail: BlazeSkeleton;
|
|
1546
|
+
blazeSkeletonLabel: BlazeSkeleton;
|
|
1507
1547
|
statusIndicatorSettings: IndicatorStyle;
|
|
1508
1548
|
constructor(options: BlazeWidgetItemOptions);
|
|
1509
1549
|
setTheme(theme: IWidgetTheme): void;
|
|
1510
1550
|
setLive(): void;
|
|
1511
|
-
setData(data: IStory
|
|
1551
|
+
setData(data: IStory): void;
|
|
1512
1552
|
analyticsCalls: any;
|
|
1513
1553
|
event(action: WidgetAction, data: Partial<WidgetEvent>, label?: string | undefined): void;
|
|
1514
1554
|
get chipDimenssions(): {
|
|
@@ -1547,6 +1587,7 @@ export declare class BlazeWidgetLayout extends BlazeWidgetScrollable implements
|
|
|
1547
1587
|
reloadTimeout: NodeJS.Timeout | undefined;
|
|
1548
1588
|
analyticsStack: Record<WidgetAction, boolean>;
|
|
1549
1589
|
intersectionObserver: IntersectionObserver;
|
|
1590
|
+
isVisibleEventSent: boolean;
|
|
1550
1591
|
onResizeEvent: (this: Window, ev: UIEvent) => void;
|
|
1551
1592
|
constructor();
|
|
1552
1593
|
connectedCallback(): void;
|
|
@@ -1557,12 +1598,11 @@ export declare class BlazeWidgetLayout extends BlazeWidgetScrollable implements
|
|
|
1557
1598
|
onResize(): void;
|
|
1558
1599
|
handlePopState(_event: Event): void;
|
|
1559
1600
|
addDelegateListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
1560
|
-
setLabels(labels:
|
|
1601
|
+
setLabels(labels: labelType): void;
|
|
1561
1602
|
getTheme(): IWidgetTheme;
|
|
1562
|
-
setTheme(theme: IWidgetTheme): void;
|
|
1563
|
-
reload(
|
|
1564
|
-
|
|
1565
|
-
set delegates(delegates: Record<Delegation, EventListenerOrEventListenerObject>);
|
|
1603
|
+
setTheme(theme: IWidgetTheme | string): void;
|
|
1604
|
+
reload(): void;
|
|
1605
|
+
setDelegations(delegates: Record<Delegation, EventListenerOrEventListenerObject>): void;
|
|
1566
1606
|
setMaxSize(maxSize: number): void;
|
|
1567
1607
|
setMaxItemsSize(maxItemsSize: number): void;
|
|
1568
1608
|
handleIntersection(entries: IntersectionObserverEntry[]): void;
|
|
@@ -1574,7 +1614,6 @@ export declare class BlazeWidgetLayout extends BlazeWidgetScrollable implements
|
|
|
1574
1614
|
private get theme();
|
|
1575
1615
|
render(): void;
|
|
1576
1616
|
maxSize(): number;
|
|
1577
|
-
loadMoments(): Promise<void>;
|
|
1578
1617
|
event(action: WidgetAction, data: Partial<WidgetEvent>, label?: string | undefined): void;
|
|
1579
1618
|
updateWidgetsData(): void;
|
|
1580
1619
|
reorderWidgets(): void;
|
|
@@ -1749,11 +1788,16 @@ export declare class BlazeWidgetSDK extends BaseWidget {
|
|
|
1749
1788
|
private injectFontResource;
|
|
1750
1789
|
}
|
|
1751
1790
|
|
|
1791
|
+
export interface IShareButton {
|
|
1792
|
+
type: ShareButtonType;
|
|
1793
|
+
onClick: (e: MouseEvent) => void;
|
|
1794
|
+
}
|
|
1752
1795
|
export declare class BlazeWidgetShareModal extends BaseWidget {
|
|
1753
1796
|
shareContainer: BlazeDiv;
|
|
1754
1797
|
shareDrawer: BlazeDrawer;
|
|
1755
1798
|
onOpen: (() => void) | undefined;
|
|
1756
1799
|
onClose: (() => void) | undefined;
|
|
1800
|
+
onClick?: ((button: BlazeShareButton) => void);
|
|
1757
1801
|
constructor();
|
|
1758
1802
|
connectedCallback(): Promise<void>;
|
|
1759
1803
|
disconnectedCallback(): void;
|
|
@@ -1866,6 +1910,7 @@ export declare class BlazeWidgetStoryPlayer extends BaseWidget {
|
|
|
1866
1910
|
overlay: any;
|
|
1867
1911
|
constructor();
|
|
1868
1912
|
connectedCallback(): void;
|
|
1913
|
+
onFocus(): void;
|
|
1869
1914
|
disconnectedCallback(): void;
|
|
1870
1915
|
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
1871
1916
|
private setupHammer;
|
|
@@ -2004,6 +2049,8 @@ export declare class BlazeWidgetStory extends HTMLElement {
|
|
|
2004
2049
|
data: IStory;
|
|
2005
2050
|
shareModal: BlazeWidgetShareModal | undefined;
|
|
2006
2051
|
isStoryLoadCompletedTriggered: boolean;
|
|
2052
|
+
isStoryActive: boolean;
|
|
2053
|
+
isResumeOnFocusExecuted: boolean;
|
|
2007
2054
|
pageIndex: number;
|
|
2008
2055
|
container: HTMLElement;
|
|
2009
2056
|
progress: HTMLElement;
|
|
@@ -2031,7 +2078,7 @@ export declare class BlazeWidgetStory extends HTMLElement {
|
|
|
2031
2078
|
navigationType: 'Automatic' | 'Manual' | undefined;
|
|
2032
2079
|
navigationDirection: 'Forwards' | 'Backwards' | undefined;
|
|
2033
2080
|
referring: ReferringEventInfo | undefined;
|
|
2034
|
-
|
|
2081
|
+
resumeAfterfocus: boolean;
|
|
2035
2082
|
totalPlayStopwatch: Stopwatch;
|
|
2036
2083
|
playerStyle: StoryPlayerStyle;
|
|
2037
2084
|
listeners: EventsListener;
|
|
@@ -2039,6 +2086,7 @@ export declare class BlazeWidgetStory extends HTMLElement {
|
|
|
2039
2086
|
shadow: HTMLDivElement;
|
|
2040
2087
|
isNavigationPending: boolean;
|
|
2041
2088
|
navigationTimeout: NodeJS.Timeout | null;
|
|
2089
|
+
lastPageIndexToResume: number;
|
|
2042
2090
|
constructor();
|
|
2043
2091
|
onShareClick(): Promise<void>;
|
|
2044
2092
|
updateChip(): void;
|
|
@@ -2068,6 +2116,7 @@ export declare class BlazeWidgetStory extends HTMLElement {
|
|
|
2068
2116
|
event(action: StoryAction, data: Partial<StoryEvent>, label?: string | undefined): void;
|
|
2069
2117
|
connectedCallback(): void;
|
|
2070
2118
|
onShareModalClose(): void;
|
|
2119
|
+
onShareModalButtonClick(shareButton: BlazeShareButton): Promise<void>;
|
|
2071
2120
|
onVisibilityChange(): void;
|
|
2072
2121
|
onBlur(): void;
|
|
2073
2122
|
onFocus(): void;
|