@enigma-lake/dice-play-controller-sdk 1.3.8 → 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.
- package/README.md +180 -180
- package/dist/components/base/Button/Button.d.ts +1 -1
- package/dist/components/base/ChevronIcon/ChevronIcon.d.ts +1 -1
- package/dist/components/base/FreeRoundsFooter/FreeRoundsFooter.d.ts +2 -0
- package/dist/components/base/FreeRoundsFooter/index.d.ts +2 -0
- package/dist/components/base/FreeRoundsIntroModal/FreeRoundsIntroModal.d.ts +3 -2
- package/dist/components/base/FreeRoundsSummaryModal/FreeRoundsSummaryModal.d.ts +9 -0
- package/dist/components/base/FreeRoundsSummaryModal/index.d.ts +3 -0
- package/dist/components/base/GroupRow/GroupRow.d.ts +1 -1
- package/dist/components/base/Input/Input.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/hooks/usePlayController.d.ts +0 -2
- package/dist/components/utils.d.ts +11 -0
- package/dist/index.d.ts +15 -7
- package/dist/index.mjs +170 -84
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/playController.d.ts +1 -2
- package/package.json +84 -84
- package/dist/components/base/FreeRoundsAffordance/FreeRoundsAffordance.d.ts +0 -9
- package/dist/components/base/FreeRoundsAffordance/index.d.ts +0 -2
package/README.md
CHANGED
|
@@ -1,180 +1,180 @@
|
|
|
1
|
-
# DicePlayController
|
|
2
|
-
|
|
3
|
-
The `DicePlayController` component is a key part of the gameplay interface, allowing users to initiate a play or cash out based on their current game state. It supports manual play, dynamic currency handling, and play amount adjustments.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Component Overview
|
|
8
|
-
|
|
9
|
-
The `DicePlayController` allows the user to:
|
|
10
|
-
|
|
11
|
-
- Select a currency.
|
|
12
|
-
- Adjust the play amount.
|
|
13
|
-
- Start a play
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## Setup
|
|
18
|
-
|
|
19
|
-
### 1. Install the package using npm:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
npm install @enigma-lake/dice-play-controller-sdk
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### 2. Import the component and styles in your project:
|
|
26
|
-
|
|
27
|
-
```tsx
|
|
28
|
-
import {
|
|
29
|
-
AUTO_PLAY_STATE,
|
|
30
|
-
GAME_MODE,
|
|
31
|
-
ManualPlayProvider,
|
|
32
|
-
} from "@enigma-lake/dice-play-controller-sdk";
|
|
33
|
-
|
|
34
|
-
import "@enigma-lake/dice-play-controller-sdk/dist/style.css";
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## Context & Provider
|
|
40
|
-
|
|
41
|
-
### `ManualPlayProvider`
|
|
42
|
-
|
|
43
|
-
The `ManualPlayProvider` wraps the DicePlayController, managing both manual play and autoplay. It uses React Context to provide game state and actions throughout the component tree.
|
|
44
|
-
|
|
45
|
-
🔹 **Features of `ManualPlayProvider`**:
|
|
46
|
-
|
|
47
|
-
- **Provides Context:** Exposes state and functions for controlling play behavior.
|
|
48
|
-
|
|
49
|
-
## Props
|
|
50
|
-
|
|
51
|
-
### 1. `StylingProps`
|
|
52
|
-
|
|
53
|
-
Handles the styling-related properties for the component.
|
|
54
|
-
|
|
55
|
-
- **`panel` (optional)**: Custom styling for the play controller.
|
|
56
|
-
|
|
57
|
-
- **`bgColorHex`**: Hex color for the panel background.
|
|
58
|
-
- **`bgColorOpacity` (optional)**: Opacity for the panel background.
|
|
59
|
-
- **`bottom`**: Position of the panel relative to the window.
|
|
60
|
-
|
|
61
|
-
- **`dropdown` (optional)**: Custom styling for the dropdown.
|
|
62
|
-
- **`bgColorHex`**: Hex color for the panel background.
|
|
63
|
-
|
|
64
|
-
### 2. `CurrencyProps`
|
|
65
|
-
|
|
66
|
-
Handles currency-related logic and settings.
|
|
67
|
-
|
|
68
|
-
- **`currencyOptions`**: An object containing the following properties:
|
|
69
|
-
- **`current`**: The currently selected currency
|
|
70
|
-
- **`available`**: Array of available currencies that the user can choose from.
|
|
71
|
-
|
|
72
|
-
### 3. `ActionsProps`
|
|
73
|
-
|
|
74
|
-
Defines functions for the user actions.
|
|
75
|
-
|
|
76
|
-
- **`onPlay`**: A callback function to trigger when the user starts a play.
|
|
77
|
-
|
|
78
|
-
### 4. `PlaySettingsProps`
|
|
79
|
-
|
|
80
|
-
Handles game-specific settings and states.
|
|
81
|
-
|
|
82
|
-
- **`playOptions`**: An object containing the following properties:
|
|
83
|
-
|
|
84
|
-
- **`disabledController`**: Boolean flag to disable all interactive elements in the component, preventing user interactions (e.g., when the game is in progress).
|
|
85
|
-
- **`displayController`**: Boolean flag to determine if the play controller should be visible.
|
|
86
|
-
- **`playHook`**: A hook providing the current play amount, play limits, and a function to set the play amount.
|
|
87
|
-
- **`playLimits`**: Play limits for the game.
|
|
88
|
-
- **`playAmount`**: The current play amount.
|
|
89
|
-
- **`setPlayAmount`**: A function to set the play amount.
|
|
90
|
-
- **`disabledMenu`**: Disable menu flag
|
|
91
|
-
- **`totalBalance`**: The available balance for the current currency
|
|
92
|
-
|
|
93
|
-
### 5. `Widgets`
|
|
94
|
-
|
|
95
|
-
Defines functions for the user actions.
|
|
96
|
-
|
|
97
|
-
- **`leftWidgets`**: A list of widgets that will be displayed on the left side
|
|
98
|
-
- **`centerWidgets`**: A list of widgets that will be displayed on the center
|
|
99
|
-
- **`rightWidgets`**: A list of widgets that will be displayed on the right side
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
## Example Usage
|
|
104
|
-
|
|
105
|
-
```tsx
|
|
106
|
-
import "@enigma-lake/dice-play-controller-sdk/dist/style.css";
|
|
107
|
-
import { ManualPlayProvider } from "@enigma-lake/dice-play-controller-sdk";
|
|
108
|
-
import { Currency } from "@enigma-lake/zoot-platform-sdk";
|
|
109
|
-
|
|
110
|
-
const GameExample = () => {
|
|
111
|
-
const config = {
|
|
112
|
-
currencyOptions: {
|
|
113
|
-
currentCurrency: Currency.SWEEPS,
|
|
114
|
-
currencies: [Currency.SWEEPS, Currency.GOLD],
|
|
115
|
-
winText: "0.00 SC",
|
|
116
|
-
},
|
|
117
|
-
onPlay: () => console.log("Play button clicked"),
|
|
118
|
-
playOptions: {
|
|
119
|
-
displayController: true,
|
|
120
|
-
disabledController: false,
|
|
121
|
-
disabledMenu: false,
|
|
122
|
-
playHook: () => {
|
|
123
|
-
return {
|
|
124
|
-
playLimits: { min: 1, max: 100 },
|
|
125
|
-
playAmount: 10,
|
|
126
|
-
setPlayAmount: (value) => console.log("New play amount:", value),
|
|
127
|
-
};
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
panel: {
|
|
131
|
-
bottom: window.innerWidth < 450 ? "55px" : "70px",
|
|
132
|
-
bgColorHex: "#08643F"
|
|
133
|
-
bgColorOpacity: 0.8,
|
|
134
|
-
},
|
|
135
|
-
dropdown: {
|
|
136
|
-
bgColorHex: "#10243F",
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
return (
|
|
141
|
-
<ManualPlayProvider config={config}>
|
|
142
|
-
{() => (
|
|
143
|
-
// children content
|
|
144
|
-
)}
|
|
145
|
-
</ManualPlayProvider>
|
|
146
|
-
);
|
|
147
|
-
};
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
---
|
|
151
|
-
|
|
152
|
-
## Key Features
|
|
153
|
-
|
|
154
|
-
1. **Dynamic Currency Handling**:
|
|
155
|
-
|
|
156
|
-
- Supports multiple currencies (e.g., SWEEPS, GOLD).
|
|
157
|
-
- Allows users to switch currencies easily.
|
|
158
|
-
|
|
159
|
-
2. **Play Amount Adjustment**:
|
|
160
|
-
|
|
161
|
-
- Includes buttons to halve or double the play amount.
|
|
162
|
-
- Validates play amounts against user balance and play limits.
|
|
163
|
-
|
|
164
|
-
3. **Custom Styling**:
|
|
165
|
-
|
|
166
|
-
- Supports customizable input and button colors.
|
|
167
|
-
|
|
168
|
-
4. **Play & Cashout Actions**:
|
|
169
|
-
- Allows users to initiate gameplay or cash out winnings seamlessly.
|
|
170
|
-
|
|
171
|
-
---
|
|
172
|
-
|
|
173
|
-
## Development Notes
|
|
174
|
-
|
|
175
|
-
1. **Play Amount Validation**:
|
|
176
|
-
|
|
177
|
-
- The play amount is validated to ensure it falls within the minimum and maximum limits, as well as the user's available balance.
|
|
178
|
-
|
|
179
|
-
2. **Responsive Design**:
|
|
180
|
-
- The component is styled to be responsive and integrate seamlessly into various layouts.
|
|
1
|
+
# DicePlayController
|
|
2
|
+
|
|
3
|
+
The `DicePlayController` component is a key part of the gameplay interface, allowing users to initiate a play or cash out based on their current game state. It supports manual play, dynamic currency handling, and play amount adjustments.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Component Overview
|
|
8
|
+
|
|
9
|
+
The `DicePlayController` allows the user to:
|
|
10
|
+
|
|
11
|
+
- Select a currency.
|
|
12
|
+
- Adjust the play amount.
|
|
13
|
+
- Start a play
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Setup
|
|
18
|
+
|
|
19
|
+
### 1. Install the package using npm:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @enigma-lake/dice-play-controller-sdk
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### 2. Import the component and styles in your project:
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import {
|
|
29
|
+
AUTO_PLAY_STATE,
|
|
30
|
+
GAME_MODE,
|
|
31
|
+
ManualPlayProvider,
|
|
32
|
+
} from "@enigma-lake/dice-play-controller-sdk";
|
|
33
|
+
|
|
34
|
+
import "@enigma-lake/dice-play-controller-sdk/dist/style.css";
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Context & Provider
|
|
40
|
+
|
|
41
|
+
### `ManualPlayProvider`
|
|
42
|
+
|
|
43
|
+
The `ManualPlayProvider` wraps the DicePlayController, managing both manual play and autoplay. It uses React Context to provide game state and actions throughout the component tree.
|
|
44
|
+
|
|
45
|
+
🔹 **Features of `ManualPlayProvider`**:
|
|
46
|
+
|
|
47
|
+
- **Provides Context:** Exposes state and functions for controlling play behavior.
|
|
48
|
+
|
|
49
|
+
## Props
|
|
50
|
+
|
|
51
|
+
### 1. `StylingProps`
|
|
52
|
+
|
|
53
|
+
Handles the styling-related properties for the component.
|
|
54
|
+
|
|
55
|
+
- **`panel` (optional)**: Custom styling for the play controller.
|
|
56
|
+
|
|
57
|
+
- **`bgColorHex`**: Hex color for the panel background.
|
|
58
|
+
- **`bgColorOpacity` (optional)**: Opacity for the panel background.
|
|
59
|
+
- **`bottom`**: Position of the panel relative to the window.
|
|
60
|
+
|
|
61
|
+
- **`dropdown` (optional)**: Custom styling for the dropdown.
|
|
62
|
+
- **`bgColorHex`**: Hex color for the panel background.
|
|
63
|
+
|
|
64
|
+
### 2. `CurrencyProps`
|
|
65
|
+
|
|
66
|
+
Handles currency-related logic and settings.
|
|
67
|
+
|
|
68
|
+
- **`currencyOptions`**: An object containing the following properties:
|
|
69
|
+
- **`current`**: The currently selected currency
|
|
70
|
+
- **`available`**: Array of available currencies that the user can choose from.
|
|
71
|
+
|
|
72
|
+
### 3. `ActionsProps`
|
|
73
|
+
|
|
74
|
+
Defines functions for the user actions.
|
|
75
|
+
|
|
76
|
+
- **`onPlay`**: A callback function to trigger when the user starts a play.
|
|
77
|
+
|
|
78
|
+
### 4. `PlaySettingsProps`
|
|
79
|
+
|
|
80
|
+
Handles game-specific settings and states.
|
|
81
|
+
|
|
82
|
+
- **`playOptions`**: An object containing the following properties:
|
|
83
|
+
|
|
84
|
+
- **`disabledController`**: Boolean flag to disable all interactive elements in the component, preventing user interactions (e.g., when the game is in progress).
|
|
85
|
+
- **`displayController`**: Boolean flag to determine if the play controller should be visible.
|
|
86
|
+
- **`playHook`**: A hook providing the current play amount, play limits, and a function to set the play amount.
|
|
87
|
+
- **`playLimits`**: Play limits for the game.
|
|
88
|
+
- **`playAmount`**: The current play amount.
|
|
89
|
+
- **`setPlayAmount`**: A function to set the play amount.
|
|
90
|
+
- **`disabledMenu`**: Disable menu flag
|
|
91
|
+
- **`totalBalance`**: The available balance for the current currency
|
|
92
|
+
|
|
93
|
+
### 5. `Widgets`
|
|
94
|
+
|
|
95
|
+
Defines functions for the user actions.
|
|
96
|
+
|
|
97
|
+
- **`leftWidgets`**: A list of widgets that will be displayed on the left side
|
|
98
|
+
- **`centerWidgets`**: A list of widgets that will be displayed on the center
|
|
99
|
+
- **`rightWidgets`**: A list of widgets that will be displayed on the right side
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Example Usage
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
import "@enigma-lake/dice-play-controller-sdk/dist/style.css";
|
|
107
|
+
import { ManualPlayProvider } from "@enigma-lake/dice-play-controller-sdk";
|
|
108
|
+
import { Currency } from "@enigma-lake/zoot-platform-sdk";
|
|
109
|
+
|
|
110
|
+
const GameExample = () => {
|
|
111
|
+
const config = {
|
|
112
|
+
currencyOptions: {
|
|
113
|
+
currentCurrency: Currency.SWEEPS,
|
|
114
|
+
currencies: [Currency.SWEEPS, Currency.GOLD],
|
|
115
|
+
winText: "0.00 SC",
|
|
116
|
+
},
|
|
117
|
+
onPlay: () => console.log("Play button clicked"),
|
|
118
|
+
playOptions: {
|
|
119
|
+
displayController: true,
|
|
120
|
+
disabledController: false,
|
|
121
|
+
disabledMenu: false,
|
|
122
|
+
playHook: () => {
|
|
123
|
+
return {
|
|
124
|
+
playLimits: { min: 1, max: 100 },
|
|
125
|
+
playAmount: 10,
|
|
126
|
+
setPlayAmount: (value) => console.log("New play amount:", value),
|
|
127
|
+
};
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
panel: {
|
|
131
|
+
bottom: window.innerWidth < 450 ? "55px" : "70px",
|
|
132
|
+
bgColorHex: "#08643F"
|
|
133
|
+
bgColorOpacity: 0.8,
|
|
134
|
+
},
|
|
135
|
+
dropdown: {
|
|
136
|
+
bgColorHex: "#10243F",
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<ManualPlayProvider config={config}>
|
|
142
|
+
{() => (
|
|
143
|
+
// children content
|
|
144
|
+
)}
|
|
145
|
+
</ManualPlayProvider>
|
|
146
|
+
);
|
|
147
|
+
};
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Key Features
|
|
153
|
+
|
|
154
|
+
1. **Dynamic Currency Handling**:
|
|
155
|
+
|
|
156
|
+
- Supports multiple currencies (e.g., SWEEPS, GOLD).
|
|
157
|
+
- Allows users to switch currencies easily.
|
|
158
|
+
|
|
159
|
+
2. **Play Amount Adjustment**:
|
|
160
|
+
|
|
161
|
+
- Includes buttons to halve or double the play amount.
|
|
162
|
+
- Validates play amounts against user balance and play limits.
|
|
163
|
+
|
|
164
|
+
3. **Custom Styling**:
|
|
165
|
+
|
|
166
|
+
- Supports customizable input and button colors.
|
|
167
|
+
|
|
168
|
+
4. **Play & Cashout Actions**:
|
|
169
|
+
- Allows users to initiate gameplay or cash out winnings seamlessly.
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Development Notes
|
|
174
|
+
|
|
175
|
+
1. **Play Amount Validation**:
|
|
176
|
+
|
|
177
|
+
- The play amount is validated to ensure it falls within the minimum and maximum limits, as well as the user's available balance.
|
|
178
|
+
|
|
179
|
+
2. **Responsive Design**:
|
|
180
|
+
- The component is styled to be responsive and integrate seamlessly into various layouts.
|
|
@@ -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): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
themes: {
|
|
16
16
|
primary: string;
|
|
17
17
|
success: string;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
export interface FreeRoundsIntroModalProps {
|
|
2
2
|
open: boolean;
|
|
3
3
|
roundsRemaining: number;
|
|
4
|
-
totalRounds
|
|
4
|
+
totalRounds: number;
|
|
5
5
|
stakeCents: number;
|
|
6
6
|
coinType?: number;
|
|
7
7
|
currency?: string;
|
|
8
8
|
decimals?: number;
|
|
9
|
+
expiresAt?: string | number | Date;
|
|
9
10
|
onPlayNow?: () => void;
|
|
10
11
|
onPlayLater?: () => void;
|
|
11
12
|
}
|
|
12
|
-
declare const FreeRoundsIntroModal: ({ open, roundsRemaining, stakeCents, coinType, currency, decimals, onPlayNow, onPlayLater, }: FreeRoundsIntroModalProps) => import("react").JSX.Element;
|
|
13
|
+
declare const FreeRoundsIntroModal: ({ open, roundsRemaining, totalRounds, stakeCents, coinType, currency, decimals, expiresAt, onPlayNow, onPlayLater, }: FreeRoundsIntroModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export default FreeRoundsIntroModal;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface FreeRoundsSummaryModalProps {
|
|
2
|
+
totalWinAmount: number;
|
|
3
|
+
coin: string;
|
|
4
|
+
roundsPlayed: number;
|
|
5
|
+
decimals?: number;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
}
|
|
8
|
+
declare const FreeRoundsSummaryModal: ({ totalWinAmount, coin, roundsPlayed, decimals, onClose, }: FreeRoundsSummaryModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default FreeRoundsSummaryModal;
|
|
@@ -3,5 +3,5 @@ export type Props = ComponentProps<"div"> & {
|
|
|
3
3
|
label?: string;
|
|
4
4
|
isClassicGame?: boolean;
|
|
5
5
|
};
|
|
6
|
-
declare const GroupRow: ({ children, label, className, isClassicGame, ...restProps }: Props) => import("react").JSX.Element;
|
|
6
|
+
declare const GroupRow: ({ children, label, className, isClassicGame, ...restProps }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export default GroupRow;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
declare const Input: ({ onChange, disabled, className, max, isClassicGame, ...restProps }: React.ComponentProps<"input"> & {
|
|
3
3
|
isClassicGame?: boolean;
|
|
4
|
-
}) =>
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export default Input;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const ManualPlayController: () => import("react").JSX.Element;
|
|
1
|
+
declare const ManualPlayController: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default ManualPlayController;
|
|
@@ -2,5 +2,5 @@ interface PlayAmountControlProps {
|
|
|
2
2
|
isDisabled: () => boolean;
|
|
3
3
|
lockCurrency?: boolean;
|
|
4
4
|
}
|
|
5
|
-
declare const PlayAmountControl: ({ isDisabled, lockCurrency, }: PlayAmountControlProps) => import("react").JSX.Element;
|
|
5
|
+
declare const PlayAmountControl: ({ isDisabled, lockCurrency, }: PlayAmountControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
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, value, onClick, isClassicGame, }: Props) => import("react").JSX.Element;
|
|
8
|
+
declare const PlayValueInput: ({ disabled, children, className, value, onClick, isClassicGame, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export default PlayValueInput;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const PlayValueList: () => import("react").JSX.Element | null;
|
|
1
|
+
declare const PlayValueList: () => import("react/jsx-runtime").JSX.Element | null;
|
|
2
2
|
export default PlayValueList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const GoldIcon: () => import("react").JSX.Element;
|
|
1
|
+
export declare const GoldIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface ISelectMenuProps {
|
|
2
2
|
disabled?: boolean;
|
|
3
3
|
}
|
|
4
|
-
declare const SelectMenu: ({ disabled }: ISelectMenuProps) => import("react").JSX.Element;
|
|
4
|
+
declare const SelectMenu: ({ disabled }: ISelectMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export default SelectMenu;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SweepsIcon: () => import("react").JSX.Element;
|
|
1
|
+
export declare const SweepsIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -28,13 +28,11 @@ export declare const usePlayController: () => {
|
|
|
28
28
|
override_playButtonBackgroundPressed: string | undefined;
|
|
29
29
|
};
|
|
30
30
|
freeRounds: {
|
|
31
|
-
isAvailable: boolean;
|
|
32
31
|
isEngaged: boolean;
|
|
33
32
|
roundsRemaining: number;
|
|
34
33
|
totalRounds: number;
|
|
35
34
|
stakeCents: number | undefined;
|
|
36
35
|
coinType: number | undefined;
|
|
37
36
|
currency: string | undefined;
|
|
38
|
-
onUseFreeRounds: (() => void) | undefined;
|
|
39
37
|
};
|
|
40
38
|
};
|
|
@@ -3,4 +3,15 @@ export declare const hexToRgb: (hex: string) => string | null;
|
|
|
3
3
|
export declare const selectButton: (gameMode: GAME_MODE) => HTMLButtonElement;
|
|
4
4
|
export declare const addPressedClass: (gameMode: GAME_MODE, activeClassName: string) => void;
|
|
5
5
|
export declare const removePressedClass: (gameMode: GAME_MODE, activeClassName: string) => void;
|
|
6
|
+
export declare const COIN_TYPE_SWEEPS = 0;
|
|
7
|
+
export declare const COIN_TYPE_GOLD = 1;
|
|
8
|
+
export declare const resolveCoinLabel: ({ coinType, currency, }: {
|
|
9
|
+
coinType?: number;
|
|
10
|
+
currency?: string;
|
|
11
|
+
}) => string;
|
|
12
|
+
export declare const resolveCoinDecimals: ({ coinType, currency, fallback, }: {
|
|
13
|
+
coinType?: number;
|
|
14
|
+
currency?: string;
|
|
15
|
+
fallback: number;
|
|
16
|
+
}) => number;
|
|
6
17
|
export declare const format: (value: number | string, decimals: number) => string | number;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
1
|
import { ReactNode, ReactElement } from 'react';
|
|
3
2
|
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"
|
|
@@ -53,14 +53,13 @@ type BonusBuyOptionsProps = {
|
|
|
53
53
|
override_playButtonBackgroundPressed?: string;
|
|
54
54
|
};
|
|
55
55
|
type FreeRoundsOptionsProps = {
|
|
56
|
-
available: boolean;
|
|
57
56
|
engaged: boolean;
|
|
58
57
|
roundsRemaining: number;
|
|
59
58
|
totalRounds: number;
|
|
60
59
|
stakeCents: number;
|
|
61
60
|
coinType?: number;
|
|
62
61
|
currency?: string;
|
|
63
|
-
|
|
62
|
+
expiresAt?: string | number | Date;
|
|
64
63
|
showIntroModal?: boolean;
|
|
65
64
|
onPlayNow?: () => void;
|
|
66
65
|
onPlayLater?: () => void;
|
|
@@ -103,15 +102,24 @@ declare const ManualPlayProvider: React.FC<ManualPlayStateProviderProps>;
|
|
|
103
102
|
interface FreeRoundsIntroModalProps {
|
|
104
103
|
open: boolean;
|
|
105
104
|
roundsRemaining: number;
|
|
106
|
-
totalRounds
|
|
105
|
+
totalRounds: number;
|
|
107
106
|
stakeCents: number;
|
|
108
107
|
coinType?: number;
|
|
109
108
|
currency?: string;
|
|
110
109
|
decimals?: number;
|
|
110
|
+
expiresAt?: string | number | Date;
|
|
111
111
|
onPlayNow?: () => void;
|
|
112
112
|
onPlayLater?: () => void;
|
|
113
113
|
}
|
|
114
|
-
declare const FreeRoundsIntroModal: ({ open, roundsRemaining, stakeCents, coinType, currency, decimals, onPlayNow, onPlayLater, }: FreeRoundsIntroModalProps) =>
|
|
114
|
+
declare const FreeRoundsIntroModal: ({ open, roundsRemaining, totalRounds, stakeCents, coinType, currency, decimals, expiresAt, onPlayNow, onPlayLater, }: FreeRoundsIntroModalProps) => react_jsx_runtime.JSX.Element;
|
|
115
|
+
|
|
116
|
+
interface FreeRoundsSummaryModalProps {
|
|
117
|
+
totalWinAmount: number;
|
|
118
|
+
coin: string;
|
|
119
|
+
roundsPlayed: number;
|
|
120
|
+
decimals?: number;
|
|
121
|
+
onClose: () => void;
|
|
122
|
+
}
|
|
123
|
+
declare const FreeRoundsSummaryModal: ({ totalWinAmount, coin, roundsPlayed, decimals, onClose, }: FreeRoundsSummaryModalProps) => react_jsx_runtime.JSX.Element;
|
|
115
124
|
|
|
116
|
-
export { FreeRoundsIntroModal, GAME_MODE, ManualPlayProvider, WIDGET, format };
|
|
117
|
-
export type { ActionsProps, BonusBuyOptionsProps, ClassicGameProps, FreeRoundsIntroModalProps, FreeRoundsOptionsProps, PlayControllerProps, PlaySettingsProps, StylingProps, Widget };
|
|
125
|
+
export { type ActionsProps, type BonusBuyOptionsProps, type ClassicGameProps, FreeRoundsIntroModal, type FreeRoundsIntroModalProps, type FreeRoundsOptionsProps, FreeRoundsSummaryModal, type FreeRoundsSummaryModalProps, GAME_MODE, ManualPlayProvider, type PlayControllerProps, type PlaySettingsProps, type StylingProps, WIDGET, type Widget, format };
|