@enigma-lake/mines-play-controller-sdk 3.2.0 → 4.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/base/AutoPlayController/AutoPlayController.d.ts +1 -1
- package/dist/components/base/Button/Button.d.ts +1 -1
- package/dist/components/base/ChevronIcon/ChevronIcon.d.ts +1 -1
- package/dist/components/base/DifficultySelector/DifficultySelector.d.ts +1 -1
- package/dist/components/base/DifficultySelector/Selector.d.ts +1 -1
- package/dist/components/base/FreeRoundsIntroModal/FreeRoundsIntroModal.d.ts +2 -1
- package/dist/components/base/FreeRoundsSummaryModal/FreeRoundsSummaryModal.d.ts +1 -1
- package/dist/components/base/GroupRow/GroupRow.d.ts +1 -1
- package/dist/components/base/Input/Input.d.ts +1 -1
- package/dist/components/base/InputWithIcon/InputWithIcon.d.ts +1 -1
- package/dist/components/base/InputWithSwitch/InputWithSwitch.d.ts +1 -1
- package/dist/components/base/ManualPlayController/ManualPlayController.d.ts +1 -1
- package/dist/components/base/PlayController/PlayController.d.ts +1 -1
- package/dist/components/base/PlayValueInput/PlayValueInput.d.ts +1 -1
- package/dist/components/base/PlayValueList/PlayValueList.d.ts +1 -1
- package/dist/components/base/SelectMenu/GoldIcon.d.ts +1 -1
- package/dist/components/base/SelectMenu/SelectMenu.d.ts +1 -1
- package/dist/components/base/SelectMenu/SweepsIcon.d.ts +1 -1
- package/dist/components/base/Switch/Switch.d.ts +2 -1
- package/dist/i18n/I18nContext.d.ts +13 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/locales/en.d.ts +2 -0
- package/dist/i18n/locales/zh-CN.d.ts +2 -0
- package/dist/i18n/translator.d.ts +6 -0
- package/dist/i18n/types.d.ts +30 -0
- package/dist/index.d.ts +67 -13
- package/dist/index.mjs +234 -64
- package/dist/index.mjs.map +1 -1
- package/dist/types/playController.d.ts +7 -0
- package/package.json +9 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const AutoPlayController: () => import("react
|
|
1
|
+
declare const AutoPlayController: () => import("react").JSX.Element;
|
|
2
2
|
export default AutoPlayController;
|
|
@@ -11,7 +11,7 @@ type Props = React.ComponentProps<"button"> & {
|
|
|
11
11
|
className?: string;
|
|
12
12
|
};
|
|
13
13
|
declare const Button: {
|
|
14
|
-
({ disabled, roleType, className, theme, ...props }: Props):
|
|
14
|
+
({ disabled, roleType, className, theme, ...props }: Props): React.JSX.Element;
|
|
15
15
|
themes: {
|
|
16
16
|
primary: string;
|
|
17
17
|
success: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PlaySettingsProps } from "../../../types/playController";
|
|
2
2
|
declare const DifficultySelector: ({ playOptions, }: {
|
|
3
3
|
playOptions: PlaySettingsProps;
|
|
4
|
-
}) => import("react
|
|
4
|
+
}) => import("react").JSX.Element;
|
|
5
5
|
export default DifficultySelector;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SelectorProps } from "./types";
|
|
2
|
-
declare const Selector: ({ currentValue, label, values, onSelect, disabled, }: SelectorProps) => import("react
|
|
2
|
+
declare const Selector: ({ currentValue, label, values, onSelect, disabled, }: SelectorProps) => import("react").JSX.Element;
|
|
3
3
|
export default Selector;
|
|
@@ -7,8 +7,9 @@ export interface FreeRoundsIntroModalProps {
|
|
|
7
7
|
currency?: string;
|
|
8
8
|
decimals?: number;
|
|
9
9
|
expiresAt?: string | number | Date;
|
|
10
|
+
language?: string;
|
|
10
11
|
onPlayNow?: () => void;
|
|
11
12
|
onPlayLater?: () => void;
|
|
12
13
|
}
|
|
13
|
-
declare const FreeRoundsIntroModal: ({ open, roundsRemaining, stakeCents, coinType, currency, decimals, expiresAt, onPlayNow, onPlayLater, }: FreeRoundsIntroModalProps) => import("react
|
|
14
|
+
declare const FreeRoundsIntroModal: ({ open, roundsRemaining, stakeCents, coinType, currency, decimals, expiresAt, language, onPlayNow, onPlayLater, }: FreeRoundsIntroModalProps) => import("react").JSX.Element;
|
|
14
15
|
export default FreeRoundsIntroModal;
|
|
@@ -5,5 +5,5 @@ export interface FreeRoundsSummaryModalProps {
|
|
|
5
5
|
decimals?: number;
|
|
6
6
|
onClose: () => void;
|
|
7
7
|
}
|
|
8
|
-
declare const FreeRoundsSummaryModal: ({ totalWinAmount, coin, roundsPlayed, decimals, onClose, }: FreeRoundsSummaryModalProps) => import("react
|
|
8
|
+
declare const FreeRoundsSummaryModal: ({ totalWinAmount, coin, roundsPlayed, decimals, onClose, }: FreeRoundsSummaryModalProps) => import("react").JSX.Element;
|
|
9
9
|
export default FreeRoundsSummaryModal;
|
|
@@ -3,5 +3,5 @@ export type Props = ComponentProps<"div"> & {
|
|
|
3
3
|
isClassicGame?: boolean;
|
|
4
4
|
label?: string;
|
|
5
5
|
};
|
|
6
|
-
declare const GroupRow: ({ children, label, className, isClassicGame, ...restProps }: Props) => import("react
|
|
6
|
+
declare const GroupRow: ({ children, label, className, isClassicGame, ...restProps }: Props) => import("react").JSX.Element;
|
|
7
7
|
export default GroupRow;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
declare const Input: ({ onChange, disabled, className, max, ...restProps }: React.ComponentProps<"input">) =>
|
|
2
|
+
declare const Input: ({ onChange, disabled, className, max, ...restProps }: React.ComponentProps<"input">) => React.JSX.Element;
|
|
3
3
|
export default Input;
|
|
@@ -11,5 +11,5 @@ export type Props = PropsWithChildren<ComponentProps<"input">> & {
|
|
|
11
11
|
currency: Currency;
|
|
12
12
|
label?: string;
|
|
13
13
|
};
|
|
14
|
-
declare const InputWithIcon: ({ children, switcherConfig, disabled, currency, label, className, ...restProps }: Props) => import("react
|
|
14
|
+
declare const InputWithIcon: ({ children, switcherConfig, disabled, currency, label, className, ...restProps }: Props) => import("react").JSX.Element;
|
|
15
15
|
export default InputWithIcon;
|
|
@@ -8,5 +8,5 @@ export type Props = PropsWithChildren<ComponentProps<"input">> & {
|
|
|
8
8
|
disabled: boolean;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
-
declare const InputWithSwitch: ({ children, switcherConfig, disabled, className, isClassicGame, ...restProps }: Props) => import("react
|
|
11
|
+
declare const InputWithSwitch: ({ children, switcherConfig, disabled, className, isClassicGame, ...restProps }: Props) => import("react").JSX.Element;
|
|
12
12
|
export default InputWithSwitch;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const ManualPlayController: () => import("react
|
|
1
|
+
declare const ManualPlayController: () => import("react").JSX.Element;
|
|
2
2
|
export default ManualPlayController;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface PlayAmountControlProps {
|
|
2
2
|
isDisabled: () => boolean;
|
|
3
3
|
}
|
|
4
|
-
declare const PlayAmountControl: ({ isDisabled }: PlayAmountControlProps) => import("react
|
|
4
|
+
declare const PlayAmountControl: ({ isDisabled }: PlayAmountControlProps) => import("react").JSX.Element;
|
|
5
5
|
export default PlayAmountControl;
|
|
@@ -5,5 +5,5 @@ export type Props = PropsWithChildren<ComponentProps<"div">> & {
|
|
|
5
5
|
value: string;
|
|
6
6
|
isClassicGame?: boolean;
|
|
7
7
|
};
|
|
8
|
-
declare const PlayValueInput: ({ disabled, children, className, isClassicGame, value, onClick, }: Props) => import("react
|
|
8
|
+
declare const PlayValueInput: ({ disabled, children, className, isClassicGame, value, onClick, }: Props) => import("react").JSX.Element;
|
|
9
9
|
export default PlayValueInput;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const PlayValueList: () => import("react
|
|
1
|
+
declare const PlayValueList: () => import("react").JSX.Element | null;
|
|
2
2
|
export default PlayValueList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const GoldIcon: () => import("react
|
|
1
|
+
export declare const GoldIcon: () => import("react").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface ISelectMenuProps {
|
|
2
2
|
disabled?: boolean;
|
|
3
3
|
}
|
|
4
|
-
declare const SelectMenu: ({ disabled }: ISelectMenuProps) => import("react
|
|
4
|
+
declare const SelectMenu: ({ disabled }: ISelectMenuProps) => import("react").JSX.Element;
|
|
5
5
|
export default SelectMenu;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SweepsIcon: () => import("react
|
|
1
|
+
export declare const SweepsIcon: () => import("react").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type React from "react";
|
|
1
2
|
interface SwitchProps {
|
|
2
3
|
enabled: boolean;
|
|
3
4
|
onSwitch: () => void;
|
|
@@ -5,5 +6,5 @@ interface SwitchProps {
|
|
|
5
6
|
disabled: boolean;
|
|
6
7
|
isClassicGame?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare const Switch: ({ enabled, onSwitch, disabled, isPlaying, }: SwitchProps) =>
|
|
9
|
+
export declare const Switch: ({ enabled, onSwitch, disabled, isPlaying, }: SwitchProps) => React.JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { SupportedLanguage } from "./types";
|
|
3
|
+
import { Translator } from "./translator";
|
|
4
|
+
interface I18nContextValue {
|
|
5
|
+
language: SupportedLanguage;
|
|
6
|
+
t: Translator;
|
|
7
|
+
}
|
|
8
|
+
export declare const I18nProvider: ({ language, children, }: {
|
|
9
|
+
language?: string;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}) => import("react").JSX.Element;
|
|
12
|
+
export declare const useTranslation: () => I18nContextValue;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { Messages, MessageKey, SupportedLanguage, TranslationParams, } from "./types";
|
|
2
|
+
export { SUPPORTED_LANGUAGE_CODES } from "./types";
|
|
3
|
+
export { DEFAULT_LANGUAGE, SUPPORTED_LANGUAGES, resolveLanguage, createTranslator, } from "./translator";
|
|
4
|
+
export type { Translator } from "./translator";
|
|
5
|
+
export { I18nProvider, useTranslation } from "./I18nContext";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MessageKey, SupportedLanguage, TranslationParams } from "./types";
|
|
2
|
+
export declare const DEFAULT_LANGUAGE: SupportedLanguage;
|
|
3
|
+
export declare const SUPPORTED_LANGUAGES: readonly SupportedLanguage[];
|
|
4
|
+
export declare const resolveLanguage: (input?: string | null) => SupportedLanguage;
|
|
5
|
+
export type Translator = (key: MessageKey, params?: TranslationParams) => string;
|
|
6
|
+
export declare const createTranslator: (language: SupportedLanguage) => Translator;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const SUPPORTED_LANGUAGE_CODES: readonly ["en", "zh-CN"];
|
|
2
|
+
export type SupportedLanguage = (typeof SUPPORTED_LANGUAGE_CODES)[number];
|
|
3
|
+
export type TranslationParams = Record<string, string | number>;
|
|
4
|
+
export interface Messages {
|
|
5
|
+
playNow: string;
|
|
6
|
+
selectPlayAmount: string;
|
|
7
|
+
cashout: string;
|
|
8
|
+
collect: string;
|
|
9
|
+
doubleTitle: string;
|
|
10
|
+
doubleSubtitle: string;
|
|
11
|
+
playFreeRound: string;
|
|
12
|
+
startAutoplay: string;
|
|
13
|
+
stopAutoplay: string;
|
|
14
|
+
startFreeAutoplay: string;
|
|
15
|
+
numberOfPlays: string;
|
|
16
|
+
selectTileToast: string;
|
|
17
|
+
minesLabel: string;
|
|
18
|
+
selectPlayAmountAria: string;
|
|
19
|
+
freeRoundsModalTitle: string;
|
|
20
|
+
freeRoundsHave: string;
|
|
21
|
+
freeRoundsUnitOne: string;
|
|
22
|
+
freeRoundsUnitOther: string;
|
|
23
|
+
freeRoundsPerRound: string;
|
|
24
|
+
freeRoundsExpiresIn: string;
|
|
25
|
+
dayUnitOne: string;
|
|
26
|
+
dayUnitOther: string;
|
|
27
|
+
freeRoundsModalPlayNow: string;
|
|
28
|
+
freeRoundsModalPlayLater: string;
|
|
29
|
+
}
|
|
30
|
+
export type MessageKey = keyof Messages;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React$1
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import React__default, { ReactNode, ReactElement } from 'react';
|
|
2
3
|
import { CurrencyProps, PlayLimitsV2 } from '@enigma-lake/zoot-platform-sdk';
|
|
3
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
declare enum GAME_MODE {
|
|
6
6
|
MANUAL = "manual",
|
|
@@ -28,6 +28,37 @@ type Widget = {
|
|
|
28
28
|
}) => ReactNode;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
+
declare const SUPPORTED_LANGUAGE_CODES: readonly ["en", "zh-CN"];
|
|
32
|
+
type SupportedLanguage = (typeof SUPPORTED_LANGUAGE_CODES)[number];
|
|
33
|
+
type TranslationParams = Record<string, string | number>;
|
|
34
|
+
interface Messages {
|
|
35
|
+
playNow: string;
|
|
36
|
+
selectPlayAmount: string;
|
|
37
|
+
cashout: string;
|
|
38
|
+
collect: string;
|
|
39
|
+
doubleTitle: string;
|
|
40
|
+
doubleSubtitle: string;
|
|
41
|
+
playFreeRound: string;
|
|
42
|
+
startAutoplay: string;
|
|
43
|
+
stopAutoplay: string;
|
|
44
|
+
startFreeAutoplay: string;
|
|
45
|
+
numberOfPlays: string;
|
|
46
|
+
selectTileToast: string;
|
|
47
|
+
minesLabel: string;
|
|
48
|
+
selectPlayAmountAria: string;
|
|
49
|
+
freeRoundsModalTitle: string;
|
|
50
|
+
freeRoundsHave: string;
|
|
51
|
+
freeRoundsUnitOne: string;
|
|
52
|
+
freeRoundsUnitOther: string;
|
|
53
|
+
freeRoundsPerRound: string;
|
|
54
|
+
freeRoundsExpiresIn: string;
|
|
55
|
+
dayUnitOne: string;
|
|
56
|
+
dayUnitOther: string;
|
|
57
|
+
freeRoundsModalPlayNow: string;
|
|
58
|
+
freeRoundsModalPlayLater: string;
|
|
59
|
+
}
|
|
60
|
+
type MessageKey = keyof Messages;
|
|
61
|
+
|
|
31
62
|
type StylingProps = {
|
|
32
63
|
panel: {
|
|
33
64
|
bottom?: string;
|
|
@@ -90,8 +121,8 @@ type FreeRoundsOptionsProps = {
|
|
|
90
121
|
onPlayLater?: () => void;
|
|
91
122
|
};
|
|
92
123
|
type TextTransformOption = "none" | "uppercase" | "lowercase" | "capitalize";
|
|
93
|
-
type PlayControllerTextStyle = Omit<
|
|
94
|
-
textTransform?:
|
|
124
|
+
type PlayControllerTextStyle = Omit<React__default.CSSProperties, "textTransform"> & {
|
|
125
|
+
textTransform?: React__default.CSSProperties["textTransform"];
|
|
95
126
|
disableOpacity?: number;
|
|
96
127
|
};
|
|
97
128
|
type PlayControllerButtonId = "play" | "startAutoplay" | "stopAutoplay" | "cashout" | "selectPlayAmount";
|
|
@@ -99,9 +130,9 @@ type PlayControllerButtonVariant = {
|
|
|
99
130
|
backgroundColor: string;
|
|
100
131
|
pressedBackgroundColor?: string;
|
|
101
132
|
textTransform?: TextTransformOption;
|
|
102
|
-
style?:
|
|
103
|
-
pressedStyle?:
|
|
104
|
-
disabledStyle?:
|
|
133
|
+
style?: React__default.CSSProperties;
|
|
134
|
+
pressedStyle?: React__default.CSSProperties;
|
|
135
|
+
disabledStyle?: React__default.CSSProperties;
|
|
105
136
|
};
|
|
106
137
|
type PlayControllerButtonConfig<VariantKey extends string> = {
|
|
107
138
|
label: string;
|
|
@@ -114,9 +145,9 @@ type PlayControllerButtonConfig<VariantKey extends string> = {
|
|
|
114
145
|
backgroundColor?: string;
|
|
115
146
|
pressedBackgroundColor?: string;
|
|
116
147
|
textTransform?: TextTransformOption;
|
|
117
|
-
style?:
|
|
118
|
-
pressedStyle?:
|
|
119
|
-
disabledStyle?:
|
|
148
|
+
style?: React__default.CSSProperties;
|
|
149
|
+
pressedStyle?: React__default.CSSProperties;
|
|
150
|
+
disabledStyle?: React__default.CSSProperties;
|
|
120
151
|
};
|
|
121
152
|
type PlayControllerSwitcherState = {
|
|
122
153
|
thumb?: string;
|
|
@@ -132,6 +163,12 @@ type PlayControllerButtonsConfig<VariantKey extends string = "primary" | "danger
|
|
|
132
163
|
buttons: Partial<Record<PlayControllerButtonId, PlayControllerButtonConfig<VariantKey>>>;
|
|
133
164
|
};
|
|
134
165
|
type PlayControllerProps = StylingProps & ActionsProps & {
|
|
166
|
+
/**
|
|
167
|
+
* Active play-controller language. Accepts any BCP-47 style code (it is
|
|
168
|
+
* normalized to a supported locale, defaulting to English). The host
|
|
169
|
+
* forwards this from UserInformation.language (zoot-platform-sdk).
|
|
170
|
+
*/
|
|
171
|
+
language?: SupportedLanguage | string;
|
|
135
172
|
currencyOptions: CurrencyProps;
|
|
136
173
|
playOptions: PlaySettingsProps;
|
|
137
174
|
leftWidgets: Widget[];
|
|
@@ -198,10 +235,11 @@ interface FreeRoundsIntroModalProps {
|
|
|
198
235
|
currency?: string;
|
|
199
236
|
decimals?: number;
|
|
200
237
|
expiresAt?: string | number | Date;
|
|
238
|
+
language?: string;
|
|
201
239
|
onPlayNow?: () => void;
|
|
202
240
|
onPlayLater?: () => void;
|
|
203
241
|
}
|
|
204
|
-
declare const FreeRoundsIntroModal: ({ open, roundsRemaining, stakeCents, coinType, currency, decimals, expiresAt, onPlayNow, onPlayLater, }: FreeRoundsIntroModalProps) =>
|
|
242
|
+
declare const FreeRoundsIntroModal: ({ open, roundsRemaining, stakeCents, coinType, currency, decimals, expiresAt, language, onPlayNow, onPlayLater, }: FreeRoundsIntroModalProps) => React$1.JSX.Element;
|
|
205
243
|
|
|
206
244
|
interface FreeRoundsSummaryModalProps {
|
|
207
245
|
totalWinAmount: number;
|
|
@@ -210,6 +248,22 @@ interface FreeRoundsSummaryModalProps {
|
|
|
210
248
|
decimals?: number;
|
|
211
249
|
onClose: () => void;
|
|
212
250
|
}
|
|
213
|
-
declare const FreeRoundsSummaryModal: ({ totalWinAmount, coin, roundsPlayed, decimals, onClose, }: FreeRoundsSummaryModalProps) =>
|
|
251
|
+
declare const FreeRoundsSummaryModal: ({ totalWinAmount, coin, roundsPlayed, decimals, onClose, }: FreeRoundsSummaryModalProps) => React$1.JSX.Element;
|
|
252
|
+
|
|
253
|
+
declare const DEFAULT_LANGUAGE: SupportedLanguage;
|
|
254
|
+
declare const SUPPORTED_LANGUAGES: readonly SupportedLanguage[];
|
|
255
|
+
declare const resolveLanguage: (input?: string | null) => SupportedLanguage;
|
|
256
|
+
type Translator = (key: MessageKey, params?: TranslationParams) => string;
|
|
257
|
+
declare const createTranslator: (language: SupportedLanguage) => Translator;
|
|
258
|
+
|
|
259
|
+
interface I18nContextValue {
|
|
260
|
+
language: SupportedLanguage;
|
|
261
|
+
t: Translator;
|
|
262
|
+
}
|
|
263
|
+
declare const I18nProvider: ({ language, children, }: {
|
|
264
|
+
language?: string;
|
|
265
|
+
children: ReactNode;
|
|
266
|
+
}) => React$1.JSX.Element;
|
|
267
|
+
declare const useTranslation: () => I18nContextValue;
|
|
214
268
|
|
|
215
|
-
export { AUTO_PLAY_STATE, AutoManualPlayProvider, DOUBLE_OR_NOTHING_STATE, type DoubleOrNothingProps, FreeRoundsIntroModal, type FreeRoundsIntroModalProps, type FreeRoundsOptionsProps, FreeRoundsSummaryModal, type FreeRoundsSummaryModalProps, GAME_MODE, WIDGET, type Widget, format };
|
|
269
|
+
export { AUTO_PLAY_STATE, AutoManualPlayProvider, DEFAULT_LANGUAGE, DOUBLE_OR_NOTHING_STATE, type DoubleOrNothingProps, FreeRoundsIntroModal, type FreeRoundsIntroModalProps, type FreeRoundsOptionsProps, FreeRoundsSummaryModal, type FreeRoundsSummaryModalProps, GAME_MODE, I18nProvider, type MessageKey, type Messages, type PlayControllerProps, SUPPORTED_LANGUAGES, SUPPORTED_LANGUAGE_CODES, type SupportedLanguage, type TranslationParams, type Translator, WIDGET, type Widget, createTranslator, format, resolveLanguage, useTranslation };
|