react-chess-core 0.1.0 → 0.1.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/README.md +2 -0
- package/dist/features/analysis/core/AnalysisBoardCore.d.ts +8 -2
- package/dist/features/chessboard/ChessboardDnDProvider.d.ts +9 -0
- package/dist/features/chessboard/boardThemes.d.ts +19 -0
- package/dist/features/chessboard/chessboardTheme.d.ts +6 -2
- package/dist/features/chessboard/index.d.ts +2 -0
- package/dist/features/engine/AnalysisEngineContext.d.ts +22 -0
- package/dist/features/engine/index.d.ts +1 -0
- package/dist/features/engine/types.d.ts +10 -0
- package/dist/features/engine/useAnalysisEngine.d.ts +2 -0
- package/dist/features/navigation/PlyNavigation.d.ts +1 -1
- package/dist/features/navigation/index.d.ts +2 -0
- package/dist/features/navigation/positionKeyboardNav.d.ts +12 -0
- package/dist/features/navigation/types.d.ts +5 -0
- package/dist/features/navigation/usePositionKeyboardNav.d.ts +12 -0
- package/dist/features/training/expectedMoveDrop.d.ts +24 -0
- package/dist/features/training/index.d.ts +4 -0
- package/dist/features/training/miss/index.d.ts +5 -0
- package/dist/features/training/miss/missDisplay.d.ts +16 -0
- package/dist/features/training/miss/refutation.d.ts +19 -0
- package/dist/features/training/miss/useMissBoard.d.ts +28 -0
- package/dist/features/training/miss/useMissRefutation.d.ts +3 -0
- package/dist/features/training/miss/useMissSequence.d.ts +10 -0
- package/dist/features/training/uciFromDrop.d.ts +3 -0
- package/dist/features/training/useBoardRevision.d.ts +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +2406 -89
- package/dist/index.js +2436 -87
- package/dist/stories/AnalysisBoard.stories.d.ts +9 -0
- package/dist/stories/analysisFixtures.d.ts +5 -0
- package/dist/stories/regressions/StockfishAnalysisRegressions.stories.d.ts +7 -0
- package/dist/stories/regressions/fixtures.d.ts +17 -0
- package/dist/stories/regressions/regressionAnalysisContext.d.ts +6 -0
- package/dist/stories/storybookLayout.d.ts +4 -0
- package/package.json +6 -2
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { AnalysisBoard } from '../features/analysis/defaults/AnalysisBoard';
|
|
3
|
+
declare const meta: Meta<typeof AnalysisBoard>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof AnalysisBoard>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const LightTheme: Story;
|
|
8
|
+
/** Requires `npm run copy:stockfish` so WASM is served from `public/stockfish/`. */
|
|
9
|
+
export declare const WithStockfishEngine: Story;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AnalysisContext } from '../features/analysis/types';
|
|
2
|
+
export declare const samplePuzzleFen = "r6k/pp2r2p/4Rp1Q/3p4/8/1N1P2R1/PqP2bPP/7K b - - 0 24";
|
|
3
|
+
export declare const samplePuzzleMoves: string[];
|
|
4
|
+
/** Completed puzzle snapshot for analysis stories. */
|
|
5
|
+
export declare const createSampleAnalysisContext: () => AnalysisContext;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { AnalysisBoard } from '../../features/analysis/defaults/AnalysisBoard';
|
|
3
|
+
declare const meta: Meta<typeof AnalysisBoard>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof AnalysisBoard>;
|
|
6
|
+
/** Puzzle 66abad1bcb8d6163fd6e172a — rapid clicks through every main-line move. */
|
|
7
|
+
export declare const Move3Ke6DuringAnalysis: Story;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface AnalysisRegression {
|
|
2
|
+
/** Story name shown in Storybook. */
|
|
3
|
+
name: string;
|
|
4
|
+
/** The edge case and the expected behavior, for the story docs. */
|
|
5
|
+
description: string;
|
|
6
|
+
/** Source puzzle id (endchess) for traceability. */
|
|
7
|
+
sourceId: string;
|
|
8
|
+
/** Starting FEN as stored for the puzzle. */
|
|
9
|
+
fen: string;
|
|
10
|
+
/** Space-separated UCI solution moves (first move is played automatically). */
|
|
11
|
+
moves: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Real puzzles that previously exposed analysis bugs, captured so the scenarios
|
|
15
|
+
* can be reproduced in Storybook.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ANALYSIS_REGRESSIONS: Record<string, AnalysisRegression>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AnalysisContext } from '../../features/analysis/types';
|
|
2
|
+
import { AnalysisRegression } from './fixtures';
|
|
3
|
+
/** Main-line sidebar labels (`Start`, `1. e4`, …) for a regression puzzle. */
|
|
4
|
+
export declare const getRegressionMainLineLabels: (regression: AnalysisRegression) => string[];
|
|
5
|
+
/** Completed puzzle snapshot for analysis regression stories. */
|
|
6
|
+
export declare const createRegressionAnalysisContext: (regression: AnalysisRegression) => AnalysisContext;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AnalysisLayoutConfig } from '../features/analysis/core/analysisLayoutConfig';
|
|
2
|
+
/** Smaller boards for Storybook previews (production defaults stay at 480+). */
|
|
3
|
+
export declare const STORYBOOK_BOARD_WIDTH = 360;
|
|
4
|
+
export declare const STORYBOOK_ANALYSIS_LAYOUT: AnalysisLayoutConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-chess-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Shared React chessboard theme, highlights, browser Stockfish, and analysis board",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Robert Blackwell",
|
|
@@ -18,12 +18,17 @@
|
|
|
18
18
|
"build": "rollup -c",
|
|
19
19
|
"copy:stockfish": "node scripts/copy-stockfish.mjs",
|
|
20
20
|
"prepare": "rollup -c",
|
|
21
|
+
"prestorybook": "npm run copy:stockfish",
|
|
21
22
|
"storybook": "storybook dev -p 6007",
|
|
22
23
|
"build-storybook": "storybook build",
|
|
23
24
|
"serve-storybook": "serve storybook-static",
|
|
24
25
|
"prepublishOnly": "npm run build"
|
|
25
26
|
},
|
|
26
27
|
"dependencies": {
|
|
28
|
+
"rdndmb-html5-to-touch": "^9.0.0",
|
|
29
|
+
"react-dnd-html5-backend": "^16.0.1",
|
|
30
|
+
"react-dnd-multi-backend": "^9.0.0",
|
|
31
|
+
"react-dnd-touch-backend": "^16.0.1",
|
|
27
32
|
"rollup": "^4.22.2",
|
|
28
33
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
29
34
|
"typescript": "^5.6.2"
|
|
@@ -56,7 +61,6 @@
|
|
|
56
61
|
"react-chessboard": "^4.7.1",
|
|
57
62
|
"react-dom": "^18.3.1",
|
|
58
63
|
"storybook": "^8.2.9",
|
|
59
|
-
"storybook-dark-mode": "^4.0.2",
|
|
60
64
|
"vite-tsconfig-paths": "^5.0.1"
|
|
61
65
|
},
|
|
62
66
|
"optionalDependencies": {
|