@react-chess-tools/react-chess-game 0.5.1 → 0.5.2
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/CHANGELOG.md +6 -0
- package/dist/index.d.mts +16 -1
- package/dist/index.mjs +1 -0
- package/package.json +1 -1
- package/src/index.ts +1 -0
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -140,4 +140,19 @@ declare const getGameInfo: (game: Chess, orientation: Color) => {
|
|
|
140
140
|
};
|
|
141
141
|
type GameInfo = ReturnType<typeof getGameInfo>;
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
/**
|
|
144
|
+
* Smart deep merge for ChessboardOptions that handles different property types appropriately:
|
|
145
|
+
* - Functions: Overwrite (custom functions replace base functions)
|
|
146
|
+
* - Objects: Deep merge (nested objects merge recursively)
|
|
147
|
+
* - Primitives: Overwrite (custom values replace base values)
|
|
148
|
+
*
|
|
149
|
+
* This ensures that computed options (like squareStyles with move highlighting) are preserved
|
|
150
|
+
* while allowing custom options to extend or override them intelligently.
|
|
151
|
+
*
|
|
152
|
+
* @param baseOptions - The computed base options (e.g., computed squareStyles, event handlers)
|
|
153
|
+
* @param customOptions - Custom options provided by the user
|
|
154
|
+
* @returns Intelligently merged ChessboardOptions
|
|
155
|
+
*/
|
|
156
|
+
declare const deepMergeChessboardOptions: (baseOptions: ChessboardOptions, customOptions?: Partial<ChessboardOptions>) => ChessboardOptions;
|
|
157
|
+
|
|
158
|
+
export { ChessGame, type ChessGameContextType, type ChessGameProps, type GameInfo, KeyboardControls, type RootProps, type Sound, type Sounds, type SoundsProps, deepMergeChessboardOptions, useChessGame, useChessGameContext, type useChessGameProps };
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-chess-tools/react-chess-game",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "react-chess-game is a React component bridging chess.js with react-chessboard to offer a full-featured, ready-to-integrate chess board experience.",
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
package/src/index.ts
CHANGED
|
@@ -16,6 +16,7 @@ export type { KeyboardControls } from "./components/ChessGame/parts/KeyboardCont
|
|
|
16
16
|
|
|
17
17
|
// Utility Types
|
|
18
18
|
export type { GameInfo } from "./utils/chess";
|
|
19
|
+
export { deepMergeChessboardOptions } from "./utils/board";
|
|
19
20
|
|
|
20
21
|
// Component Props
|
|
21
22
|
export type { ChessGameProps } from "./components/ChessGame/parts/Board";
|