@enigma-lake/tower-play-controller-sdk 2.2.4 → 2.2.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.
@@ -3,8 +3,12 @@ import { RiskTypes } from "./types";
3
3
  declare const DifficultySelector: ({ playOptions, dropdownConfig, isClassicGame, }: {
4
4
  playOptions: PlaySettingsProps;
5
5
  dropdownConfig: {
6
- bgColorHex?: string;
7
- riskColorConfig?: Partial<Record<RiskTypes, string>>;
6
+ bgColorHex: string;
7
+ riskColorConfig: {
8
+ [RiskTypes.LOW]: string;
9
+ [RiskTypes.MEDIUM]: string;
10
+ [RiskTypes.HIGH]: string;
11
+ };
8
12
  };
9
13
  isClassicGame?: boolean;
10
14
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import { SelectorProps } from "./types";
2
- declare const Selector: <T>({ currentValue, label, riskColor, values, onSelect, disabled, isClassicGame, formatDisplay, }: SelectorProps<T>) => import("react/jsx-runtime").JSX.Element;
2
+ declare const Selector: <T>({ currentValue, label, riskColor, values, onSelect, disabled, isClassicGame, }: SelectorProps<T>) => import("react/jsx-runtime").JSX.Element;
3
3
  export default Selector;
@@ -6,7 +6,6 @@ export interface SelectorProps<T> {
6
6
  disabled: boolean;
7
7
  currentValue: T;
8
8
  isClassicGame?: boolean;
9
- formatDisplay?: (value: T) => string;
10
9
  }
11
10
  export declare enum SELECTORS {
12
11
  RISK = "Risk"
@@ -16,4 +15,3 @@ export declare enum RiskTypes {
16
15
  MEDIUM = "MEDIUM",
17
16
  HIGH = "HIGH"
18
17
  }
19
- export declare const DEFAULT_RISK_COLORS: Record<RiskTypes, string>;
@@ -0,0 +1,10 @@
1
+ interface FreeRoundsAffordanceProps {
2
+ isAvailable: boolean;
3
+ isEngaged: boolean;
4
+ roundsRemaining: number;
5
+ totalRounds?: number;
6
+ onUseFreeRounds?: () => void;
7
+ disabled?: boolean;
8
+ }
9
+ declare const FreeRoundsAffordance: ({ isAvailable, isEngaged, roundsRemaining, onUseFreeRounds, disabled, }: FreeRoundsAffordanceProps) => import("react/jsx-runtime").JSX.Element | null;
10
+ export default FreeRoundsAffordance;
@@ -0,0 +1,2 @@
1
+ import FreeRoundsAffordance from "./FreeRoundsAffordance";
2
+ export default FreeRoundsAffordance;
@@ -1,14 +1,13 @@
1
1
  export interface FreeRoundsIntroModalProps {
2
2
  open: boolean;
3
3
  roundsRemaining: number;
4
- totalRounds: number;
4
+ totalRounds?: number;
5
5
  stakeCents: number;
6
6
  coinType?: number;
7
7
  currency?: string;
8
8
  decimals?: number;
9
- expiresAt?: string | number | Date;
10
9
  onPlayNow?: () => void;
11
10
  onPlayLater?: () => void;
12
11
  }
13
- declare const FreeRoundsIntroModal: ({ open, roundsRemaining, stakeCents, coinType, currency, decimals, expiresAt, onPlayNow, onPlayLater, }: FreeRoundsIntroModalProps) => import("react/jsx-runtime").JSX.Element;
12
+ declare const FreeRoundsIntroModal: ({ open, roundsRemaining, stakeCents, coinType, currency, decimals, onPlayNow, onPlayLater, }: FreeRoundsIntroModalProps) => import("react/jsx-runtime").JSX.Element;
14
13
  export default FreeRoundsIntroModal;
@@ -30,11 +30,13 @@ export declare const usePlayController: () => {
30
30
  togglePlayAmountView: () => void;
31
31
  };
32
32
  freeRounds: {
33
+ isAvailable: boolean;
33
34
  isEngaged: boolean;
34
35
  roundsRemaining: number;
35
36
  totalRounds: number;
36
37
  stakeCents: number;
37
38
  coinType: number | undefined;
38
39
  currency: string | undefined;
40
+ onUseFreeRounds: (() => void) | undefined;
39
41
  };
40
42
  };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { ReactNode, ReactElement } from 'react';
2
- import { CurrencyProps, SupportedLanguage, PlayLimitsV2, Translator as Translator$1 } from '@enigma-lake/zoot-platform-sdk';
3
- export { DEFAULT_LANGUAGE, SUPPORTED_LANGUAGES, SUPPORTED_LANGUAGE_CODES, SupportedLanguage, TranslationParams, resolveLanguage } from '@enigma-lake/zoot-platform-sdk';
2
+ import { CurrencyProps, PlayLimitsV2 } from '@enigma-lake/zoot-platform-sdk';
4
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
4
 
6
5
  declare enum GAME_MODE {
@@ -34,47 +33,6 @@ declare enum RiskTypes {
34
33
  MEDIUM = "MEDIUM",
35
34
  HIGH = "HIGH"
36
35
  }
37
- declare const DEFAULT_RISK_COLORS: Record<RiskTypes, string>;
38
-
39
- type Messages = {
40
- playNow: string;
41
- playFreeRound: string;
42
- selectPlayAmount: string;
43
- cashout: string;
44
- collect: string;
45
- doubleTitle: string;
46
- doubleSubtitle: string;
47
- startAutoplay: string;
48
- stopAutoplay: string;
49
- numberOfPlays: string;
50
- selectPlayAmountAria: string;
51
- playAmountLabel: string;
52
- autoLabel: string;
53
- selectTileToast: string;
54
- riskLabel: string;
55
- riskLow: string;
56
- riskMedium: string;
57
- riskHigh: string;
58
- freeRoundLeftOne: string;
59
- freeRoundLeftOther: string;
60
- freeRoundsModalTitle: string;
61
- freeRoundsHave: string;
62
- freeRoundsUnitOne: string;
63
- freeRoundsUnitOther: string;
64
- freeRoundsPerRound: string;
65
- freeRoundsExpiresIn: string;
66
- dayUnitOne: string;
67
- dayUnitOther: string;
68
- freeRoundsModalPlayNow: string;
69
- freeRoundsModalPlayLater: string;
70
- freeRoundsSummaryWon: string;
71
- freeRoundsSummaryIn: string;
72
- freeRoundsSummaryUnitOne: string;
73
- freeRoundsSummaryUnitOther: string;
74
- freeRoundsSummaryCredited: string;
75
- freeRoundsSummaryClose: string;
76
- };
77
- type MessageKey = keyof Messages;
78
36
 
79
37
  /**
80
38
  * Styling / theme-related props for the controller.
@@ -83,22 +41,26 @@ type MessageKey = keyof Messages;
83
41
  type StylingWithRisk = {
84
42
  panel: {
85
43
  bottom?: string;
86
- bgColorHex?: string;
44
+ bgColorHex: string;
87
45
  bgColorOpacity?: number;
88
46
  };
89
47
  dropdown: {
90
- bgColorHex?: string;
91
- riskColorConfig?: Partial<Record<RiskTypes, string>>;
48
+ bgColorHex: string;
49
+ riskColorConfig: {
50
+ [RiskTypes.LOW]: string;
51
+ [RiskTypes.MEDIUM]: string;
52
+ [RiskTypes.HIGH]: string;
53
+ };
92
54
  };
93
55
  };
94
56
  type StylingWithoutRisk = {
95
57
  panel: {
96
58
  bottom?: string;
97
- bgColorHex?: string;
59
+ bgColorHex: string;
98
60
  bgColorOpacity?: number;
99
61
  };
100
62
  dropdown: {
101
- bgColorHex?: string;
63
+ bgColorHex: string;
102
64
  };
103
65
  };
104
66
  /**
@@ -172,15 +134,14 @@ type DoubleOrNothingProps = {
172
134
  onDoubleOrNothingClose: () => void;
173
135
  };
174
136
  type FreeRoundsOptionsProps = {
137
+ available: boolean;
175
138
  engaged: boolean;
176
- supportsGrantFundedAutoplay?: boolean;
177
139
  roundsRemaining: number;
178
140
  totalRounds: number;
179
141
  stakeCents: number;
180
142
  coinType?: number;
181
143
  currency?: string;
182
- expiresAt?: string | number | Date;
183
- autoplayActive?: boolean;
144
+ onUseFreeRounds?: () => void;
184
145
  showIntroModal?: boolean;
185
146
  onPlayNow?: () => void;
186
147
  onPlayLater?: () => void;
@@ -207,7 +168,6 @@ type BaseControllerCommon = {
207
168
  leftWidgets: Widget[];
208
169
  rightWidgets: Widget[];
209
170
  centerWidgets: Widget[];
210
- language?: SupportedLanguage | string;
211
171
  /**
212
172
  * Optional so existing integrations don't break.
213
173
  * If you want it required, remove the `?`.
@@ -222,12 +182,9 @@ type BaseControllerCommon = {
222
182
  isClassicGame?: boolean;
223
183
  classicGame?: ClassicGameProps;
224
184
  /**
225
- * Optional free-rounds config. Engagement is binary via the intro modal
226
- * (PLAY NOW / PLAY LATER). When engaged, the per-round value is locked to
227
- * the grant and a "{N} FREE ROUNDS LEFT" footer renders. When not engaged,
228
- * the controller renders exactly as if the user had no free rounds.
229
- * Manual-mode only unless the game opts into grant-funded autoplay via
230
- * `supportsGrantFundedAutoplay`.
185
+ * Optional free-rounds config. When present, the manual controller surfaces
186
+ * a "Use Free Rounds (N)" affordance and, once engaged, locks the stake to
187
+ * the grant. Manual-mode only.
231
188
  */
232
189
  freeRoundsOptions?: FreeRoundsOptionsProps;
233
190
  };
@@ -344,37 +301,14 @@ declare const AutoManualPlayProvider: React.FC<AutoManualPlayStateProviderProps>
344
301
  interface FreeRoundsIntroModalProps {
345
302
  open: boolean;
346
303
  roundsRemaining: number;
347
- totalRounds: number;
304
+ totalRounds?: number;
348
305
  stakeCents: number;
349
306
  coinType?: number;
350
307
  currency?: string;
351
308
  decimals?: number;
352
- expiresAt?: string | number | Date;
353
309
  onPlayNow?: () => void;
354
310
  onPlayLater?: () => void;
355
311
  }
356
- declare const FreeRoundsIntroModal: ({ open, roundsRemaining, stakeCents, coinType, currency, decimals, expiresAt, onPlayNow, onPlayLater, }: FreeRoundsIntroModalProps) => react_jsx_runtime.JSX.Element;
357
-
358
- interface FreeRoundsSummaryModalProps {
359
- totalWinAmount: number;
360
- coin: string;
361
- roundsPlayed: number;
362
- decimals?: number;
363
- onClose: () => void;
364
- }
365
- declare const FreeRoundsSummaryModal: ({ totalWinAmount, coin, roundsPlayed, decimals, onClose, }: FreeRoundsSummaryModalProps) => react_jsx_runtime.JSX.Element;
366
-
367
- type Translator = Translator$1<MessageKey>;
368
- declare const createTranslator: (language: SupportedLanguage) => Translator;
369
-
370
- interface I18nContextValue {
371
- language: SupportedLanguage;
372
- t: Translator;
373
- }
374
- declare const I18nProvider: ({ language, children, }: {
375
- language?: string;
376
- children: ReactNode;
377
- }) => react_jsx_runtime.JSX.Element;
378
- declare const useTranslation: () => I18nContextValue;
312
+ declare const FreeRoundsIntroModal: ({ open, roundsRemaining, stakeCents, coinType, currency, decimals, onPlayNow, onPlayLater, }: FreeRoundsIntroModalProps) => react_jsx_runtime.JSX.Element;
379
313
 
380
- export { AUTO_PLAY_STATE, AutoManualPlayProvider, DEFAULT_RISK_COLORS, DOUBLE_OR_NOTHING_STATE, FreeRoundsIntroModal, type FreeRoundsIntroModalProps, type FreeRoundsOptionsProps, FreeRoundsSummaryModal, type FreeRoundsSummaryModalProps, GAME_MODE, I18nProvider, type MessageKey, type Messages, type PlayControllerProps, type PlayControllerWithRisk, type PlayControllerWithoutRisk, type Translator, WIDGET, type Widget, canAutoplaySpaceTrigger, createAutoplayButtonAction, createManualCashoutClickHandler, createTranslator, format, isAutoplayButtonDisabled, isManualCashoutDisabled, useTranslation };
314
+ export { AUTO_PLAY_STATE, AutoManualPlayProvider, DOUBLE_OR_NOTHING_STATE, FreeRoundsIntroModal, type FreeRoundsIntroModalProps, type FreeRoundsOptionsProps, GAME_MODE, type PlayControllerProps, type PlayControllerWithRisk, type PlayControllerWithoutRisk, WIDGET, type Widget, canAutoplaySpaceTrigger, createAutoplayButtonAction, createManualCashoutClickHandler, format, isAutoplayButtonDisabled, isManualCashoutDisabled };