@splash-tech/jackpot-sdk 2.0.0 → 2.0.2

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/README.md CHANGED
@@ -53,9 +53,7 @@ splashJackpot.winWidget.launch({
53
53
  | data | object | null | Widget data from Splash backend |
54
54
  | container | string | document.body | CSS selector where widget will be injected |
55
55
  | mode | string | production | SDK environment (`local`, `dev`, `staging`, `production`) |
56
- | jackpotId | string | undefined | Jackpot identifier |
57
- | tag | string | undefined | Game tag |
58
- | brand | string | undefined | Operator brand |
56
+ | maxWidth | string | '1300px' | Maximum width of the footer widget |
59
57
 
60
58
  Example:
61
59
 
@@ -64,9 +62,7 @@ splashJackpot.footerWidget.launch({
64
62
  data: widgetData,
65
63
  container: '#game-container',
66
64
  mode: 'production',
67
- jackpotId: 'jackpot-id',
68
- tag: 'game-tag',
69
- brand: 'brand-name',
65
+ maxWidth: '100%',
70
66
  });
71
67
  ```
72
68
 
@@ -7,6 +7,7 @@ export declare abstract class BaseWidget {
7
7
  protected isLaunched: boolean;
8
8
  protected data: unknown;
9
9
  protected position: FooterWidgetParams['position'];
10
+ protected maxWidth: string;
10
11
  protected animation: WinWidgetParams['animation'];
11
12
  protected jackpotId: string | null;
12
13
  protected tag: string | null;
@@ -4,6 +4,7 @@ export class BaseWidget {
4
4
  this.childAppOrigin = null;
5
5
  this.isLaunched = false;
6
6
  this.position = 'bottom';
7
+ this.maxWidth = '1300px';
7
8
  this.animation = 'wheel';
8
9
  this.jackpotId = null;
9
10
  this.tag = null;
@@ -53,14 +54,15 @@ export class BaseWidget {
53
54
  this.isLaunched = false;
54
55
  }
55
56
  setParamsData(params) {
56
- const { mode, data, jackpotId, tag, brand, position, animation } = params;
57
+ const { mode, data, jackpotId, tag, brand, position, animation, maxWidth } = params;
57
58
  this.childAppOrigin = this.getBaseUrl(mode !== null && mode !== void 0 ? mode : 'production');
58
59
  this.data = data;
59
60
  this.jackpotId = jackpotId !== null && jackpotId !== void 0 ? jackpotId : null;
60
61
  this.tag = tag !== null && tag !== void 0 ? tag : null;
61
62
  this.brand = brand !== null && brand !== void 0 ? brand : null;
62
- this.position = position !== null && position !== void 0 ? position : 'bottom';
63
- this.animation = animation !== null && animation !== void 0 ? animation : 'wheel';
63
+ this.position = position !== null && position !== void 0 ? position : this.position;
64
+ this.animation = animation !== null && animation !== void 0 ? animation : this.animation;
65
+ this.maxWidth = maxWidth !== null && maxWidth !== void 0 ? maxWidth : this.maxWidth;
64
66
  }
65
67
  setLaunched(launched) {
66
68
  this.isLaunched = launched;
@@ -73,10 +75,10 @@ export class BaseWidget {
73
75
  if (((_a = this.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow) &&
74
76
  this.childAppOrigin &&
75
77
  message.data !== undefined) {
76
- const { data, jackpotId, tag, brand, position } = message;
78
+ const { data, jackpotId, tag, brand, position, maxWidth } = message;
77
79
  this.iframe.contentWindow.postMessage({
78
80
  type: message.type,
79
- payload: { data, jackpotId, tag, brand, position },
81
+ payload: { data, jackpotId, tag, brand, position, maxWidth },
80
82
  }, this.childAppOrigin);
81
83
  }
82
84
  }
@@ -19,6 +19,7 @@ export class FooterWidget extends BaseWidget {
19
19
  tag: this.tag,
20
20
  brand: this.brand,
21
21
  position: this.position,
22
+ maxWidth: this.maxWidth,
22
23
  });
23
24
  break;
24
25
  case FooterIframeIncomingEvent.showPopup: {
@@ -4,6 +4,7 @@ export interface FooterWidgetParams {
4
4
  mode?: SDKMode;
5
5
  position?: 'top' | 'bottom';
6
6
  animation?: 'wheel' | 'airplane';
7
+ maxWidth?: string;
7
8
  container?: string;
8
9
  jackpotId?: string;
9
10
  tag?: string;
@@ -11,6 +11,7 @@ export interface ChildMessage {
11
11
  data: unknown;
12
12
  position?: FooterWidgetParams['position'];
13
13
  animation?: WinWidgetParams['animation'];
14
+ maxWidth?: string;
14
15
  jackpotId?: string | null;
15
16
  tag?: string | null;
16
17
  brand?: string | null;
@@ -4,6 +4,7 @@ export interface WinWidgetParams {
4
4
  mode?: SDKMode;
5
5
  position?: 'top' | 'bottom';
6
6
  animation?: 'wheel' | 'airplane';
7
+ maxWidth?: string;
7
8
  container?: string;
8
9
  jackpotId?: string;
9
10
  tag?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splash-tech/jackpot-sdk",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "SDK for managing jackpot widgets in iframes",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",