@betorigami/game-ui-shared 1.6.0 → 2.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.
Files changed (78) hide show
  1. package/README.md +3 -1
  2. package/dist/components/shared/Alert/Alert.d.ts +0 -2
  3. package/dist/components/shared/AlertManager/AlertManager.d.ts +1 -3
  4. package/dist/components/shared/BetResultModal/BetResultModal.d.ts +3 -4
  5. package/dist/components/shared/Button/Button.d.ts +3 -2
  6. package/dist/components/shared/Button/LinkButton.d.ts +3 -3
  7. package/dist/components/shared/ChipTableGameComponent.d.ts +5 -1
  8. package/dist/components/shared/DepositButton/DepositButton.d.ts +5 -3
  9. package/dist/components/shared/FairnessDetails/FairnessContent.d.ts +6 -3
  10. package/dist/components/shared/FairnessDetails/HistoryTable.d.ts +4 -1
  11. package/dist/components/shared/Footer/Footer.d.ts +4 -2
  12. package/dist/components/shared/GameComponent.d.ts +17 -4
  13. package/dist/components/shared/GameInfo/GameInfoModal.d.ts +5 -5
  14. package/dist/components/shared/GameInfo/gameInfoConfig.d.ts +2 -2
  15. package/dist/components/shared/GameLayout/GameLayout.d.ts +8 -4
  16. package/dist/components/shared/GameOutcomeDisplay/GameOutcomeDisplay.d.ts +4 -3
  17. package/dist/components/shared/GameProviderWrapper.d.ts +17 -9
  18. package/dist/components/shared/GameSidebar/GameSidebar.d.ts +1 -3
  19. package/dist/components/shared/GameWinPopup/GameWinPopup.d.ts +4 -3
  20. package/dist/components/shared/GenericAutobet/BetCountInput.d.ts +2 -2
  21. package/dist/components/shared/GenericAutobet/GenericAutobet.d.ts +3 -3
  22. package/dist/components/shared/HistoryPills/HistoryPills.d.ts +2 -1
  23. package/dist/components/shared/HotkeysModal/HotkeysModal.d.ts +1 -1
  24. package/dist/components/shared/Inputs/BetAmountInput/BetAmountInput.d.ts +6 -2
  25. package/dist/components/shared/Inputs/ChipInput/ChipInput.d.ts +3 -3
  26. package/dist/components/shared/Inputs/CurrencyInput/RawCurrencyInput.d.ts +2 -5
  27. package/dist/components/shared/Inputs/Input/Input.d.ts +1 -2
  28. package/dist/components/shared/Modal/Modal.d.ts +0 -2
  29. package/dist/components/shared/Select/Select.d.ts +1 -1
  30. package/dist/components/shared/Switch/Switch.d.ts +1 -1
  31. package/dist/components/shared/Toggle/Toggle.d.ts +1 -1
  32. package/dist/components/shared/UiLock/UiLockContent.d.ts +1 -0
  33. package/dist/components/shared/context/desktop-attribute.d.ts +2 -0
  34. package/dist/components/shared/context/provide-test-contexts.d.ts +24 -0
  35. package/dist/components/shared/context/required-context.d.ts +10 -0
  36. package/dist/components/shared/context/slices/layout.context.d.ts +9 -0
  37. package/dist/components/shared/context/slices/limits.context.d.ts +17 -0
  38. package/dist/components/shared/context/slices/locale.context.d.ts +13 -0
  39. package/dist/components/shared/context/slices/preferences.context.d.ts +15 -0
  40. package/dist/components/shared/context/slices/services.context.d.ts +11 -0
  41. package/dist/components/shared/context/slices/session.context.d.ts +12 -0
  42. package/dist/components/shared/context/slices/skin.context.d.ts +43 -0
  43. package/dist/components/shared/context/slices/wallet.context.d.ts +16 -0
  44. package/dist/controllers/history.controller.d.ts +3 -8
  45. package/dist/index.d.ts +13 -1
  46. package/dist/index.mjs +3242 -3206
  47. package/dist/shared/button-feedback.d.ts +5 -13
  48. package/dist/shared/cards/Card.d.ts +1 -1
  49. package/dist/shared/cards/CardStack.d.ts +0 -1
  50. package/dist/shared/create-api-factory.d.ts +2 -2
  51. package/dist/shared/game-ui-module.d.ts +2 -2
  52. package/dist/shared/mock-bridged-game-service.d.ts +5 -5
  53. package/dist/shared/number-attribute.d.ts +3 -0
  54. package/dist/shared/profit-on-win.d.ts +6 -0
  55. package/dist/shared/provider-api/error-codes.d.ts +2 -0
  56. package/dist/shared/retry-once.d.ts +1 -0
  57. package/dist/translations/ar.json.d.ts +1 -1
  58. package/dist/translations/de.json.d.ts +1 -1
  59. package/dist/translations/en-soc.json.d.ts +1 -1
  60. package/dist/translations/en.json.d.ts +1 -1
  61. package/dist/translations/es.json.d.ts +1 -1
  62. package/dist/translations/fi.json.d.ts +1 -1
  63. package/dist/translations/fr.json.d.ts +1 -1
  64. package/dist/translations/hi.json.d.ts +1 -1
  65. package/dist/translations/id.json.d.ts +1 -1
  66. package/dist/translations/index.d.ts +17 -17
  67. package/dist/translations/ja.json.d.ts +1 -1
  68. package/dist/translations/ko.json.d.ts +1 -1
  69. package/dist/translations/language.context.d.ts +0 -7
  70. package/dist/translations/pl.json.d.ts +1 -1
  71. package/dist/translations/pt.json.d.ts +1 -1
  72. package/dist/translations/ru.json.d.ts +1 -1
  73. package/dist/translations/tr.json.d.ts +1 -1
  74. package/dist/translations/vi.json.d.ts +1 -1
  75. package/dist/translations/zh.json.d.ts +1 -1
  76. package/dist/utils/game-layout-style.d.ts +4 -6
  77. package/package.json +3 -2
  78. package/dist/components/shared/context/game.context.d.ts +0 -93
@@ -0,0 +1,10 @@
1
+ import { Context, ContextType } from '@lit/context';
2
+ import { ReactiveControllerHost } from 'lit';
3
+ type Host = ReactiveControllerHost & HTMLElement;
4
+ export declare class RequiredContext<C extends Context<unknown, unknown>> {
5
+ readonly context: C;
6
+ private consumer;
7
+ constructor(host: Host, context: C, onChange?: (value: ContextType<C>) => void);
8
+ get value(): ContextType<C>;
9
+ }
10
+ export {};
@@ -0,0 +1,9 @@
1
+ export declare const DESKTOP_MIN_WIDTH = 768;
2
+ export type LayoutContextType = {
3
+ isDesktop: boolean;
4
+ scale: number;
5
+ };
6
+ export declare const DEFAULT_LAYOUT_CONTEXT: LayoutContextType;
7
+ export declare const layoutContext: {
8
+ __context__: LayoutContextType;
9
+ };
@@ -0,0 +1,17 @@
1
+ import { SupportedEdgePercentages } from '../../../../shared/constants';
2
+ export type LimitsContextType = {
3
+ minBet: number;
4
+ maxBet: number;
5
+ maxPayout: number;
6
+ edge: SupportedEdgePercentages;
7
+ diceMinMultiplier: number | null;
8
+ advancedDiceMinMultiplier: number | null;
9
+ blitzMinPickCount: number | null;
10
+ blitzMaxPickCount: number | null;
11
+ roulettePreventOppositeBets: boolean;
12
+ baccaratPreventOppositeBets: boolean;
13
+ };
14
+ export declare const DEFAULT_LIMITS_CONTEXT: LimitsContextType;
15
+ export declare const limitsContext: {
16
+ __context__: LimitsContextType;
17
+ };
@@ -0,0 +1,13 @@
1
+ import { Currency } from '../../../../shared/constants';
2
+ import { Language } from '../../../../translations';
3
+ export type LocaleContextType = {
4
+ language: Language;
5
+ currency: Currency;
6
+ currencyDecimals: number;
7
+ payoutDecimals: number;
8
+ showCurrencyAsText: boolean;
9
+ };
10
+ export declare const DEFAULT_LOCALE_CONTEXT: LocaleContextType;
11
+ export declare const localeContext: {
12
+ __context__: LocaleContextType;
13
+ };
@@ -0,0 +1,15 @@
1
+ export type PreferencesContextType = {
2
+ hotkeysOpenEnabled: boolean;
3
+ instantBetEnabled: boolean;
4
+ volume: number;
5
+ showMaxBetButton: boolean;
6
+ alwaysEnableMaxBetButton: boolean;
7
+ updateHotkeysOpenEnabled: (enabled: boolean) => void;
8
+ updateInstantBetEnabled: (enabled: boolean) => void;
9
+ updateVolume: (volume: number) => void;
10
+ updateShowMaxBetButton: (enabled: boolean) => void;
11
+ };
12
+ export declare const DEFAULT_PREFERENCES_CONTEXT: PreferencesContextType;
13
+ export declare const preferencesContext: {
14
+ __context__: PreferencesContextType;
15
+ };
@@ -0,0 +1,11 @@
1
+ import { HapticsController } from '../../../../controllers/haptics.controller';
2
+ import { HistoryController } from '../../../../controllers/history.controller';
3
+ import { SoundEffectsController } from '../../../../controllers/sound/sound-effects.controller';
4
+ export type ServicesContextType = {
5
+ soundEffects: SoundEffectsController;
6
+ haptics: HapticsController;
7
+ historyController: HistoryController;
8
+ };
9
+ export declare const servicesContext: {
10
+ __context__: ServicesContextType;
11
+ };
@@ -0,0 +1,12 @@
1
+ export type SessionContextType = {
2
+ baseUrl: string;
3
+ authToken: string;
4
+ isDemoMode: boolean;
5
+ publicKey: string;
6
+ lobbyUrl: string | null;
7
+ depositUrl: string | undefined;
8
+ };
9
+ export declare const DEFAULT_SESSION_CONTEXT: SessionContextType;
10
+ export declare const sessionContext: {
11
+ __context__: SessionContextType;
12
+ };
@@ -0,0 +1,43 @@
1
+ export type SkinContextType = {
2
+ footerPosition: 'ABOVE' | 'BELOW';
3
+ logoUrl: string | null;
4
+ gcCurrencyIconSvgUrl: string | null;
5
+ scCurrencyIconSvgUrl: string | null;
6
+ customMinesBackgroundSvgUrl: string | null;
7
+ customMinesGemSvgUrl: string | null;
8
+ customMinesBombSvgUrl: string | null;
9
+ customMinesTileSvgUrl: string | null;
10
+ customMinesAutobetSelectedTileSvgUrl: string | null;
11
+ customKenoBackgroundSvgUrl: string | null;
12
+ customKenoGemSvgUrl: string | null;
13
+ customKenoNonMatchTileSvgUrl: string | null;
14
+ customKenoTileSvgUrl: string | null;
15
+ customKenoSelectedTileSvgUrl: string | null;
16
+ customRouletteBackgroundSvgUrl: string | null;
17
+ customDiceBackgroundSvgUrl: string | null;
18
+ customAdvancedDiceBackgroundSvgUrl: string | null;
19
+ customPlinkoBackgroundSvgUrl: string | null;
20
+ customPlinkoEdgeColor: string | null;
21
+ customPlinkoCenterColor: string | null;
22
+ customBaccaratBackgroundSvgUrl: string | null;
23
+ customLimboBackgroundSvgUrl: string | null;
24
+ customWheelBackgroundSvgUrl: string | null;
25
+ customWheelCenterSvgUrl: string | null;
26
+ customWheelCenterPadding: number | null;
27
+ customDiamondsBackgroundSvgUrl: string | null;
28
+ customBlackjackBackgroundSvgUrl: string | null;
29
+ customBlitzBackgroundSvgUrl: string | null;
30
+ customCardBackSvgUrl: string | null;
31
+ customCardRedColor: string | null;
32
+ customCardBlackColor: string | null;
33
+ customFooterLobbySvgUrl: string | null;
34
+ customFooterVolumeSvgUrl: string | null;
35
+ customFooterGameInfoSvgUrl: string | null;
36
+ customFooterInstantBetSvgUrl: string | null;
37
+ customFooterHotkeysSvgUrl: string | null;
38
+ customFooterProvablyFairSvgUrl: string | null;
39
+ };
40
+ export declare const DEFAULT_SKIN_CONTEXT: SkinContextType;
41
+ export declare const skinContext: {
42
+ __context__: SkinContextType;
43
+ };
@@ -0,0 +1,16 @@
1
+ import { default as Big } from 'big.js';
2
+ import { UiLockContent } from '../../UiLock/UiLockContent';
3
+ export type WalletContextType = {
4
+ balance: number;
5
+ hasLoadedBalance: boolean;
6
+ betAmount: string;
7
+ uiLock: UiLockContent | null;
8
+ autobetNumberOfBets: number;
9
+ updateBalance: (newAmount: Big) => void;
10
+ updateBetAmount: (newAmount: Big) => void;
11
+ updateAutobetNumberOfBets: (numberOfBets: number) => void;
12
+ };
13
+ export declare const DEFAULT_WALLET_CONTEXT: WalletContextType;
14
+ export declare const walletContext: {
15
+ __context__: WalletContextType;
16
+ };
@@ -1,5 +1,5 @@
1
- import { gameContextType } from '../components/shared/context/game.context';
2
1
  import { Currency } from '../shared/constants';
2
+ import { ApiSession } from '../shared/create-api-factory';
3
3
  export interface HistoryItem {
4
4
  id: string;
5
5
  fullId: string;
@@ -8,10 +8,6 @@ export interface HistoryItem {
8
8
  bet: number;
9
9
  win: number;
10
10
  }
11
- interface GameHost {
12
- gameData: gameContextType;
13
- addController(controller: any): void;
14
- }
15
11
  export type NewBetItem = {
16
12
  readonly id: string;
17
13
  readonly amount: string | number;
@@ -25,7 +21,7 @@ export declare class NonceChangedEvent extends Event {
25
21
  constructor(nonce: number | null);
26
22
  }
27
23
  export declare class HistoryController extends EventTarget {
28
- private host;
24
+ private readonly getSession;
29
25
  private _historyData;
30
26
  private _hasData;
31
27
  private _isInitialized;
@@ -37,7 +33,7 @@ export declare class HistoryController extends EventTarget {
37
33
  private _activeBetNonce;
38
34
  private _hasLoadedClientSeed;
39
35
  private _provablyFairInfoAbortController;
40
- constructor(host: GameHost);
36
+ constructor(getSession: () => ApiSession | null);
41
37
  get historyData(): HistoryItem[];
42
38
  get hasData(): boolean | null;
43
39
  get isInitialized(): boolean;
@@ -67,4 +63,3 @@ export declare class HistoryController extends EventTarget {
67
63
  saveClientSeed(clientSeed: string): Promise<void>;
68
64
  private fetchProvablyFairInfo;
69
65
  }
70
- export {};
package/dist/index.d.ts CHANGED
@@ -67,7 +67,17 @@ export * from './components/shared/Toggle/Toggle.styles';
67
67
  export * from './components/shared/Toggle/Toggle';
68
68
  export * from './components/shared/Tooltip/Tooltip.styles';
69
69
  export * from './components/shared/Tooltip/Tooltip';
70
- export * from './components/shared/context/game.context';
70
+ export * from './components/shared/context/required-context';
71
+ export * from './components/shared/context/desktop-attribute';
72
+ export * from './components/shared/context/provide-test-contexts';
73
+ export * from './components/shared/context/slices/layout.context';
74
+ export * from './components/shared/context/slices/limits.context';
75
+ export * from './components/shared/context/slices/locale.context';
76
+ export * from './components/shared/context/slices/preferences.context';
77
+ export * from './components/shared/context/slices/services.context';
78
+ export * from './components/shared/context/slices/session.context';
79
+ export * from './components/shared/context/slices/skin.context';
80
+ export * from './components/shared/context/slices/wallet.context';
71
81
  export * from './components/shared/types/chip.types';
72
82
  export * from './controllers/bet-result-cache.controller';
73
83
  export * from './controllers/haptics.controller';
@@ -104,6 +114,7 @@ export * from './shared/create-api-factory';
104
114
  export * from './shared/event-map';
105
115
  export * from './shared/format-monetary-amount';
106
116
  export * from './shared/format-win-chance';
117
+ export * from './shared/profit-on-win';
107
118
  export * from './shared/game-registry';
108
119
  export * from './shared/game-ui-module';
109
120
  export * from './shared/get-correlation-id';
@@ -165,6 +176,7 @@ export * from './shared/provably-fair-verifier';
165
176
  export * from './shared/provider-api/bet-result';
166
177
  export * from './shared/provider-api/error-codes';
167
178
  export * from './shared/provider-api/request-timeout';
179
+ export * from './shared/retry-once';
168
180
  export * from './shared/sleep';
169
181
  export * from './shared/utils/format-autobet-settings';
170
182
  export * from './shared/utils/prevent-non-numeric-input';