@betorigami/game-ui-shared 4.1.1 → 6.0.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/dist/components/shared/GameComponent.d.ts +18 -9
- package/dist/components/shared/GameLayout/GameLayout.d.ts +4 -0
- package/dist/components/shared/GameProviderWrapper.d.ts +1 -0
- package/dist/components/shared/GenericAutobet/GenericAutobet.d.ts +1 -0
- package/dist/components/shared/context/slices/services.context.d.ts +2 -0
- package/dist/controllers/alert.controller.d.ts +14 -0
- package/dist/controllers/drag-select.controller.d.ts +34 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.mjs +2786 -2983
- package/dist/shared/bet.types.d.ts +2 -6
- package/dist/shared/event-map.d.ts +3 -9
- package/dist/shared/icons/uiIcons.d.ts +12 -0
- package/dist/shared/provider-api/bet-result.d.ts +4 -0
- package/dist/shared/provider-api/error-codes.d.ts +0 -2
- package/dist/shared/provider-api/error-message.d.ts +3 -0
- package/dist/shared/provider-api/testing.d.ts +32 -0
- package/dist/translations/ar.json.d.ts +0 -1
- package/dist/translations/de.json.d.ts +0 -1
- package/dist/translations/en-soc.json.d.ts +0 -1
- package/dist/translations/en.json.d.ts +0 -1
- package/dist/translations/es.json.d.ts +0 -1
- package/dist/translations/fi.json.d.ts +0 -1
- package/dist/translations/fr.json.d.ts +0 -1
- package/dist/translations/hi.json.d.ts +0 -1
- package/dist/translations/id.json.d.ts +0 -1
- package/dist/translations/index.d.ts +0 -17
- package/dist/translations/ja.json.d.ts +0 -1
- package/dist/translations/ko.json.d.ts +0 -1
- package/dist/translations/pl.json.d.ts +0 -1
- package/dist/translations/pt.json.d.ts +0 -1
- package/dist/translations/ru.json.d.ts +0 -1
- package/dist/translations/tr.json.d.ts +0 -1
- package/dist/translations/vi.json.d.ts +0 -1
- package/dist/translations/zh.json.d.ts +0 -1
- package/dist/utils/animate.d.ts +2 -2
- package/package.json +1 -2
- package/dist/components/shared/LottieIcon/LottieIcon.d.ts +0 -24
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AutobetToggleEvent } from '../../shared/event-map';
|
|
2
|
+
import { AlertRequest } from '../../controllers/alert.controller';
|
|
2
3
|
import { ErrorCode } from '../../shared/provider-api/error-codes';
|
|
3
4
|
import { BetMode } from './GameSidebar/GameSidebar';
|
|
4
5
|
import { AutobetEventPayload } from './GenericAutobet/GenericAutobet';
|
|
@@ -14,14 +15,20 @@ export type AutobetSettingsWithId = AutobetEventPayload & {
|
|
|
14
15
|
betIndex: number;
|
|
15
16
|
pnlSinceStart: string;
|
|
16
17
|
};
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
export type GameOutcome = 'Win' | 'Loss' | 'Draw';
|
|
19
|
+
export type BetFailure = {
|
|
20
|
+
readonly errorCode: ErrorCode;
|
|
21
|
+
} | {
|
|
22
|
+
readonly validationMessage: string;
|
|
23
|
+
};
|
|
24
|
+
export type GameBetResult = {
|
|
25
|
+
readonly hasError: false;
|
|
26
|
+
readonly pnl: Big;
|
|
27
|
+
readonly gameOutcome: GameOutcome;
|
|
28
|
+
readonly afterBalance: Big | null;
|
|
29
|
+
} | ({
|
|
30
|
+
readonly hasError: true;
|
|
31
|
+
} & BetFailure);
|
|
25
32
|
export declare abstract class GameComponent extends OrigamiElement {
|
|
26
33
|
protected readonly locale: RequiredContext<{
|
|
27
34
|
__context__: import('../..').LocaleContextType;
|
|
@@ -95,12 +102,14 @@ export declare abstract class GameComponent extends OrigamiElement {
|
|
|
95
102
|
* unknown balance, or a demo session where no provider is involved, lets the round through.
|
|
96
103
|
*/
|
|
97
104
|
private canAffordAutobet;
|
|
98
|
-
protected adjustBetAmount(autobetSettings: AutobetSettingsWithId, gameOutcome:
|
|
105
|
+
protected adjustBetAmount(autobetSettings: AutobetSettingsWithId, gameOutcome: GameOutcome, originalBetAmount: string, currentBetAmount: string): string;
|
|
99
106
|
protected isPnLWithinLimits(autobetSettings: AutobetSettingsWithId, totalPnL: Big): boolean;
|
|
100
107
|
protected updateHistoryWithBet(betResult: NewBetItem): void;
|
|
101
108
|
protected setActiveBetNonce(nonce: number): void;
|
|
102
109
|
protected checkSessionExpired: (errorCode: ErrorCode) => void;
|
|
103
110
|
protected lockUi: (lock: UiLockContent) => void;
|
|
111
|
+
protected reportBetFailure(failure: BetFailure): void;
|
|
104
112
|
protected showError(message: string): void;
|
|
113
|
+
protected showAlert(alert: AlertRequest): void;
|
|
105
114
|
protected playWinFeedback(): void;
|
|
106
115
|
}
|
|
@@ -32,6 +32,10 @@ export declare class GameLayout extends OrigamiElement {
|
|
|
32
32
|
private previousHistoryController?;
|
|
33
33
|
private onHistoryDataChanged;
|
|
34
34
|
firstUpdated(): void;
|
|
35
|
+
private alerts?;
|
|
36
|
+
private listenForAlerts;
|
|
37
|
+
private stopListeningForAlerts;
|
|
38
|
+
private onAlertRequest;
|
|
35
39
|
connectedCallback(): void;
|
|
36
40
|
disconnectedCallback(): void;
|
|
37
41
|
private setModalContent;
|
|
@@ -13,6 +13,7 @@ export type AutobetEventPayload = AutobetValues;
|
|
|
13
13
|
export declare class GenericAutobet extends OrigamiElement {
|
|
14
14
|
private readonly locale;
|
|
15
15
|
private readonly wallet;
|
|
16
|
+
private readonly services;
|
|
16
17
|
inputsDisabled: boolean;
|
|
17
18
|
autobetSettings: AutobetValues;
|
|
18
19
|
autobetStopping: boolean;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { AlertController } from '../../../../controllers/alert.controller';
|
|
1
2
|
import { HapticsController } from '../../../../controllers/haptics.controller';
|
|
2
3
|
import { HistoryController } from '../../../../controllers/history.controller';
|
|
3
4
|
import { SoundEffectsController } from '../../../../controllers/sound/sound-effects.controller';
|
|
4
5
|
import { Client } from '../../../../shared/provider-api/generated/client';
|
|
5
6
|
export type ServicesContextType = {
|
|
7
|
+
alerts: AlertController;
|
|
6
8
|
soundEffects: SoundEffectsController;
|
|
7
9
|
haptics: HapticsController;
|
|
8
10
|
historyController: HistoryController;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AlertType } from '../components/shared/Alert/Alert';
|
|
2
|
+
export type AlertRequest = {
|
|
3
|
+
readonly id?: string;
|
|
4
|
+
readonly type: AlertType;
|
|
5
|
+
readonly message: string;
|
|
6
|
+
readonly autoCloseDelay?: number;
|
|
7
|
+
};
|
|
8
|
+
export declare class AlertRequestEvent extends Event {
|
|
9
|
+
readonly alert: AlertRequest;
|
|
10
|
+
constructor(alert: AlertRequest);
|
|
11
|
+
}
|
|
12
|
+
export declare class AlertController extends EventTarget {
|
|
13
|
+
show(alert: AlertRequest): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
type Point = {
|
|
3
|
+
readonly x: number;
|
|
4
|
+
readonly y: number;
|
|
5
|
+
};
|
|
6
|
+
/** The tile under the pointer: its id, and its width to space out samples along a fast drag. */
|
|
7
|
+
export type DragSelectTile = {
|
|
8
|
+
readonly id: number;
|
|
9
|
+
readonly width: number;
|
|
10
|
+
};
|
|
11
|
+
type DragSelectOptions = {
|
|
12
|
+
readonly isDisabled: () => boolean;
|
|
13
|
+
readonly isSelected: (id: number) => boolean;
|
|
14
|
+
readonly tileAt: (point: Point) => DragSelectTile | null;
|
|
15
|
+
readonly onPaint: (id: number, selected: boolean) => void;
|
|
16
|
+
};
|
|
17
|
+
/** Points from `from` (exclusive) to `to` (inclusive), no more than `step` apart. */
|
|
18
|
+
export declare const pointsAlong: (from: Point, to: Point, step: number) => Point[];
|
|
19
|
+
/**
|
|
20
|
+
* Paints tiles on or off as a pointer drags across them. Pressing an unselected tile selects every tile the pointer
|
|
21
|
+
* crosses; pressing a selected tile deselects them. Bind the handle* methods to the grid's pointer events.
|
|
22
|
+
*/
|
|
23
|
+
export declare class DragSelectController implements ReactiveController {
|
|
24
|
+
private readonly options;
|
|
25
|
+
private drag;
|
|
26
|
+
constructor(host: ReactiveControllerHost, options: DragSelectOptions);
|
|
27
|
+
hostConnected(): void;
|
|
28
|
+
hostDisconnected(): void;
|
|
29
|
+
readonly handlePointerDown: (event: PointerEvent) => void;
|
|
30
|
+
readonly handlePointerMove: (event: PointerEvent) => void;
|
|
31
|
+
readonly handlePointerEnd: (event: PointerEvent) => void;
|
|
32
|
+
private paint;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -50,7 +50,6 @@ export * from './components/shared/Inputs/CurrencyInput/RawCurrencyInput.styles'
|
|
|
50
50
|
export * from './components/shared/Inputs/CurrencyInput/RawCurrencyInput';
|
|
51
51
|
export * from './components/shared/Inputs/Input/Input.styles';
|
|
52
52
|
export * from './components/shared/Inputs/Input/Input';
|
|
53
|
-
export * from './components/shared/LottieIcon/LottieIcon';
|
|
54
53
|
export * from './components/shared/Modal/Modal.styles';
|
|
55
54
|
export { default as OrigamiModal } from './components/shared/Modal/Modal';
|
|
56
55
|
export * from './components/shared/Modal/Portal';
|
|
@@ -77,7 +76,9 @@ export * from './components/shared/context/slices/session.context';
|
|
|
77
76
|
export * from './components/shared/context/slices/skin.context';
|
|
78
77
|
export * from './components/shared/context/slices/wallet.context';
|
|
79
78
|
export * from './components/shared/types/chip.types';
|
|
79
|
+
export * from './controllers/alert.controller';
|
|
80
80
|
export * from './controllers/bet-result-cache.controller';
|
|
81
|
+
export * from './controllers/drag-select.controller';
|
|
81
82
|
export * from './controllers/haptics.controller';
|
|
82
83
|
export * from './controllers/history.controller';
|
|
83
84
|
export * from './controllers/hotkey.controller';
|
|
@@ -165,6 +166,7 @@ export * from './shared/icons/index';
|
|
|
165
166
|
export * from './shared/icons/kenoGemIcon';
|
|
166
167
|
export * from './shared/icons/minesBombIcon';
|
|
167
168
|
export * from './shared/icons/minesGemIcon';
|
|
169
|
+
export * from './shared/icons/uiIcons';
|
|
168
170
|
export * from './shared/mock-bridged-game-service';
|
|
169
171
|
export * from './shared/mock-rng-generator';
|
|
170
172
|
export * from './shared/origami-action.type';
|
|
@@ -176,6 +178,7 @@ export * from './shared/provider-api/bet-result';
|
|
|
176
178
|
export * from './shared/provider-api/error-codes';
|
|
177
179
|
export * from './shared/provider-api/request-timeout';
|
|
178
180
|
export * as ProviderApi from './shared/provider-api/provider-api-client';
|
|
181
|
+
export * from './shared/provider-api/testing';
|
|
179
182
|
export * from './shared/retry-once';
|
|
180
183
|
export * from './shared/sleep';
|
|
181
184
|
export * from './shared/utils/format-autobet-settings';
|