@splash-tech/jackpot-sdk 3.1.4 → 3.1.5
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/dist/clients/x7k2m9qp/FooterWidget.js +8 -0
- package/dist/clients/x7k2m9qp/types.d.ts +9 -0
- package/dist/compat/v2/mapLaunchParams.js +3 -1
- package/dist/compat/v2/types.d.ts +1 -0
- package/dist/core/FooterWidgetBase.d.ts +1 -0
- package/dist/core/FooterWidgetBase.js +14 -10
- package/dist/core/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -4,6 +4,8 @@ var IncomingEvent;
|
|
|
4
4
|
IncomingEvent["footerWidgetLoaded"] = "jackpot-footer-widget-loaded";
|
|
5
5
|
IncomingEvent["ready"] = "jackpot-footer-widget-ready";
|
|
6
6
|
IncomingEvent["participateChange"] = "jackpot-footer-widget-participate-change";
|
|
7
|
+
IncomingEvent["multiplierMinus"] = "jackpot-footer-widget-multiplier-minus";
|
|
8
|
+
IncomingEvent["multiplierPlus"] = "jackpot-footer-widget-multiplier-plus";
|
|
7
9
|
IncomingEvent["showPopup"] = "jackpot-footer-widget-popup-show";
|
|
8
10
|
IncomingEvent["hidePopup"] = "jackpot-footer-widget-popup-hide";
|
|
9
11
|
})(IncomingEvent || (IncomingEvent = {}));
|
|
@@ -52,6 +54,12 @@ export class FooterWidget extends FooterWidgetBase {
|
|
|
52
54
|
case IncomingEvent.participateChange:
|
|
53
55
|
this.emit('participateChange');
|
|
54
56
|
return true;
|
|
57
|
+
case IncomingEvent.multiplierMinus:
|
|
58
|
+
this.emit('multiplierMinus');
|
|
59
|
+
return true;
|
|
60
|
+
case IncomingEvent.multiplierPlus:
|
|
61
|
+
this.emit('multiplierPlus');
|
|
62
|
+
return true;
|
|
55
63
|
default:
|
|
56
64
|
return false;
|
|
57
65
|
}
|
|
@@ -6,6 +6,8 @@ export interface WinWidgetConfig extends WinWidgetBaseConfig {
|
|
|
6
6
|
}
|
|
7
7
|
export interface FooterWidgetEvents {
|
|
8
8
|
participateChange: void;
|
|
9
|
+
multiplierMinus: void;
|
|
10
|
+
multiplierPlus: void;
|
|
9
11
|
showPopup: void;
|
|
10
12
|
hidePopup: void;
|
|
11
13
|
}
|
|
@@ -18,6 +20,12 @@ export interface LobbyWidgetConfig {
|
|
|
18
20
|
showOptInButton?: boolean;
|
|
19
21
|
showBanner?: boolean;
|
|
20
22
|
}
|
|
23
|
+
export interface Multipliers {
|
|
24
|
+
min: number;
|
|
25
|
+
max: number;
|
|
26
|
+
step: number;
|
|
27
|
+
value?: number;
|
|
28
|
+
}
|
|
21
29
|
export interface LobbyWidgetData {
|
|
22
30
|
themeUrl: string;
|
|
23
31
|
termsAndConditionsUrl: string;
|
|
@@ -44,6 +52,7 @@ export interface LobbyWidgetData {
|
|
|
44
52
|
currency: string;
|
|
45
53
|
};
|
|
46
54
|
};
|
|
55
|
+
multipliers: Multipliers;
|
|
47
56
|
}
|
|
48
57
|
export interface LobbyWidgetLaunchParams {
|
|
49
58
|
config: LobbyWidgetConfig;
|
|
@@ -2,12 +2,14 @@ export function mapV2FooterWidgetLaunchParams(params) {
|
|
|
2
2
|
return {
|
|
3
3
|
data: params.data,
|
|
4
4
|
onLoad: params.onLoad,
|
|
5
|
-
config: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (params.container !== undefined
|
|
5
|
+
config: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (params.container !== undefined
|
|
6
6
|
? { container: params.container }
|
|
7
7
|
: {})), (params.position !== undefined ? { position: params.position } : {})), (params.maxWidth !== undefined ? { maxWidth: params.maxWidth } : {})), (params.height !== undefined ? { height: params.height } : {})), (params.showLevelIcons !== undefined
|
|
8
8
|
? { showLevelIcons: params.showLevelIcons }
|
|
9
9
|
: {})), (params.showOptInButton !== undefined
|
|
10
10
|
? { showOptInButton: params.showOptInButton }
|
|
11
|
+
: {})), (params.multiplier !== undefined
|
|
12
|
+
? { multiplier: params.multiplier }
|
|
11
13
|
: {})), (params.popupTopOffset !== undefined
|
|
12
14
|
? { popupTopOffset: params.popupTopOffset }
|
|
13
15
|
: {})),
|
|
@@ -8,6 +8,7 @@ export declare abstract class FooterWidgetBase<TConfig extends FooterWidgetBaseC
|
|
|
8
8
|
protected height: string;
|
|
9
9
|
protected showLevelIcons: boolean;
|
|
10
10
|
protected showOptInButton: boolean;
|
|
11
|
+
protected multiplier: boolean;
|
|
11
12
|
private onLoadHandler?;
|
|
12
13
|
private onLoadCalled;
|
|
13
14
|
private popupTopOffset;
|
|
@@ -7,6 +7,7 @@ const defaults = {
|
|
|
7
7
|
height: '50px',
|
|
8
8
|
showLevelIcons: true,
|
|
9
9
|
showOptInButton: true,
|
|
10
|
+
multiplier: false,
|
|
10
11
|
popupTopOffset: 0,
|
|
11
12
|
};
|
|
12
13
|
export class FooterWidgetBase extends BaseWidget {
|
|
@@ -18,6 +19,7 @@ export class FooterWidgetBase extends BaseWidget {
|
|
|
18
19
|
this.height = defaults.height;
|
|
19
20
|
this.showLevelIcons = defaults.showLevelIcons;
|
|
20
21
|
this.showOptInButton = defaults.showOptInButton;
|
|
22
|
+
this.multiplier = defaults.multiplier;
|
|
21
23
|
this.onLoadCalled = false;
|
|
22
24
|
this.popupTopOffset = defaults.popupTopOffset;
|
|
23
25
|
this.popupExpanded = false;
|
|
@@ -32,26 +34,27 @@ export class FooterWidgetBase extends BaseWidget {
|
|
|
32
34
|
};
|
|
33
35
|
}
|
|
34
36
|
launch(params) {
|
|
35
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
37
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
36
38
|
if (this.isLaunched()) {
|
|
37
39
|
console.warn('Footer widget is already launched');
|
|
38
40
|
return;
|
|
39
41
|
}
|
|
40
|
-
|
|
42
|
+
const input = (_a = params.config) !== null && _a !== void 0 ? _a : {};
|
|
41
43
|
this.data = params.data;
|
|
42
44
|
this.onLoadHandler = params.onLoad;
|
|
43
45
|
this.onLoadCalled = false;
|
|
44
|
-
this.container = (_b =
|
|
45
|
-
this.position = (_c =
|
|
46
|
-
this.maxWidth = (_d =
|
|
47
|
-
this.height = (_e =
|
|
48
|
-
this.showLevelIcons = (_f =
|
|
49
|
-
this.showOptInButton =
|
|
50
|
-
|
|
51
|
-
const popupTopOffset = (
|
|
46
|
+
this.container = (_b = input.container) !== null && _b !== void 0 ? _b : defaults.container;
|
|
47
|
+
this.position = (_c = input.position) !== null && _c !== void 0 ? _c : defaults.position;
|
|
48
|
+
this.maxWidth = (_d = input.maxWidth) !== null && _d !== void 0 ? _d : defaults.maxWidth;
|
|
49
|
+
this.height = (_e = input.height) !== null && _e !== void 0 ? _e : defaults.height;
|
|
50
|
+
this.showLevelIcons = (_f = input.showLevelIcons) !== null && _f !== void 0 ? _f : defaults.showLevelIcons;
|
|
51
|
+
this.showOptInButton = (_g = input.showOptInButton) !== null && _g !== void 0 ? _g : defaults.showOptInButton;
|
|
52
|
+
this.multiplier = (_h = input.multiplier) !== null && _h !== void 0 ? _h : defaults.multiplier;
|
|
53
|
+
const popupTopOffset = (_j = input.popupTopOffset) !== null && _j !== void 0 ? _j : defaults.popupTopOffset;
|
|
52
54
|
this.popupTopOffset = Number.isFinite(popupTopOffset)
|
|
53
55
|
? Math.max(0, popupTopOffset)
|
|
54
56
|
: defaults.popupTopOffset;
|
|
57
|
+
this.config = Object.assign(Object.assign({}, input), { container: this.container, position: this.position, maxWidth: this.maxWidth, height: this.height, showLevelIcons: this.showLevelIcons, showOptInButton: this.showOptInButton, multiplier: this.multiplier, popupTopOffset: this.popupTopOffset });
|
|
55
58
|
this.iframe = this.createIframe();
|
|
56
59
|
this.iframe = this.styleIframe(this.iframe);
|
|
57
60
|
this.iframe.src = `${this.childAppOrigin}${this.route}`;
|
|
@@ -74,6 +77,7 @@ export class FooterWidgetBase extends BaseWidget {
|
|
|
74
77
|
this.height = defaults.height;
|
|
75
78
|
this.showLevelIcons = defaults.showLevelIcons;
|
|
76
79
|
this.showOptInButton = defaults.showOptInButton;
|
|
80
|
+
this.multiplier = defaults.multiplier;
|
|
77
81
|
this.stopListening();
|
|
78
82
|
this.removeIframe();
|
|
79
83
|
}
|
package/dist/core/types.d.ts
CHANGED