@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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @react-chess-tools/react-chess-game
2
2
 
3
+ ## 0.5.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 9d33423: Fix PuzzleBoard options merging
8
+
3
9
  ## 0.5.1
4
10
 
5
11
  ### Patch Changes
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
- export { ChessGame, type ChessGameContextType, type ChessGameProps, type GameInfo, KeyboardControls, type RootProps, type Sound, type Sounds, type SoundsProps, useChessGame, useChessGameContext, type useChessGameProps };
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
@@ -591,6 +591,7 @@ var ChessGame = {
591
591
  };
592
592
  export {
593
593
  ChessGame,
594
+ deepMergeChessboardOptions,
594
595
  useChessGame,
595
596
  useChessGameContext
596
597
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-chess-tools/react-chess-game",
3
- "version": "0.5.1",
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";