gigaboard 1.4.1 → 1.5.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/{board-model-BMtkLQvL.d.cts → board-model-BIVxSCWC.d.cts} +73 -2
- package/dist/{board-model-BMtkLQvL.d.ts → board-model-BIVxSCWC.d.ts} +73 -2
- package/dist/{chunk-EJUGH25P.js → chunk-53XWDREK.js} +4 -3
- package/dist/chunk-53XWDREK.js.map +1 -0
- package/dist/{chunk-SO6AOEFF.js → chunk-6F3FZAG7.js} +116 -18
- package/dist/chunk-6F3FZAG7.js.map +1 -0
- package/dist/{chunk-UBD62NOI.cjs → chunk-FUP2LDMO.cjs} +121 -16
- package/dist/chunk-FUP2LDMO.cjs.map +1 -0
- package/dist/{chunk-D45G3J5E.cjs → chunk-N4WTPXFC.cjs} +4 -2
- package/dist/chunk-N4WTPXFC.cjs.map +1 -0
- package/dist/core.cjs +72 -44
- package/dist/core.d.cts +17 -12
- package/dist/core.d.ts +17 -12
- package/dist/core.js +1 -1
- package/dist/{gigachess-C08uAeFw.d.ts → gigachess-DN-ncmAU.d.ts} +1 -1
- package/dist/{gigachess-Dr5gCN68.d.cts → gigachess-XpNGPM2m.d.cts} +1 -1
- package/dist/index.cjs +879 -259
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +55 -8
- package/dist/index.d.ts +55 -8
- package/dist/index.js +786 -198
- package/dist/index.js.map +1 -1
- package/dist/server.cjs +11 -11
- package/dist/server.d.cts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +1 -1
- package/dist/{types-CcOgT5ov.d.ts → types-4W8ULiE2.d.ts} +1 -1
- package/dist/{types-DfqRXtbD.d.cts → types-Dox7oLof.d.cts} +1 -1
- package/package.json +2 -2
- package/dist/chunk-D45G3J5E.cjs.map +0 -1
- package/dist/chunk-EJUGH25P.js.map +0 -1
- package/dist/chunk-SO6AOEFF.js.map +0 -1
- package/dist/chunk-UBD62NOI.cjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,12 +1,55 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
import {
|
|
6
|
-
export { D as
|
|
7
|
-
|
|
2
|
+
import { CSSProperties, RefObject, ReactNode } from 'react';
|
|
3
|
+
import { S as SquareIndex, u as BoardCell, v as BoardModel, x as BoardSnapshot, w as BoardModelOptions, P as PackedMove } from './board-model-BIVxSCWC.cjs';
|
|
4
|
+
export { D as Color, E as EngineAdapter, W as NULL_MOVE_SAN, X as NULL_MOVE_SANS, Y as NULL_MOVE_UCI, Z as NULL_MOVE_WORD, a as PieceType, a1 as ZobristKey, a2 as createBoardModel, a8 as isNullMove, a9 as isNullMoveSan, aa as isNullMoveUci, ac as packMove, ae as unpackMove } from './board-model-BIVxSCWC.cjs';
|
|
5
|
+
import { O as Orientation, T as Theme, P as PieceRenderer, C as ChessboardProps, A as AnimationOptions, R as ResolvedArrowPalette, U as UseChessGameOptions } from './types-Dox7oLof.cjs';
|
|
6
|
+
export { a as ArrowColors, D as DEFAULT_MOVE_HAPTIC_PATTERNS, b as DEFAULT_MOVE_SOUND_SOURCES, H as HapticFeedbackOptions, L as LegalTargetStyle, M as MoveFeedbackKey, c as MoveHapticKey, d as MoveHapticOptions, e as MoveHapticPatterns, f as MoveSoundKey, g as MoveSoundOptions, h as MoveSoundSources, i as PositionTransition, j as PromotionContext, k as RanksPosition, S as SquareContext, l as TriggerMoveHaptic, m as TriggerMoveSound, n as classifyMoveFeedback, t as triggerHaptic, o as triggerMoveHaptic, u as useMoveHaptics, p as useMoveSound, w as warmupHaptics } from './types-Dox7oLof.cjs';
|
|
7
|
+
export { c as createGigachessAdapter, p as preloadGigachessAdapter } from './gigachess-XpNGPM2m.cjs';
|
|
8
8
|
export { HapticInput, TriggerOptions } from 'web-haptics';
|
|
9
9
|
|
|
10
|
+
declare function formatFenPlacement(board: Uint8Array): string;
|
|
11
|
+
interface BoardEditorProps {
|
|
12
|
+
/** Current FEN or placement string. */
|
|
13
|
+
fen?: string;
|
|
14
|
+
/** Called whenever the board placement changes. */
|
|
15
|
+
onChange?: (fen: string) => void;
|
|
16
|
+
/** Called when a specific square piece changes. */
|
|
17
|
+
onPieceChange?: (square: SquareIndex, cell: BoardCell, algebraic: string) => void;
|
|
18
|
+
/** Currently selected piece for placement (e.g. "wP", "bP", "wK", or null for eraser). */
|
|
19
|
+
selectedPiece?: string | null;
|
|
20
|
+
/** Callback when shortcut piece is chosen. */
|
|
21
|
+
onSelectPiece?: (piece: string | null) => void;
|
|
22
|
+
/** Board orientation (default "white"). */
|
|
23
|
+
orientation?: Orientation;
|
|
24
|
+
/** Board visual theme. */
|
|
25
|
+
theme?: Theme;
|
|
26
|
+
/** Piece renderer. */
|
|
27
|
+
pieces?: PieceRenderer;
|
|
28
|
+
/** Whether algebraic coordinates are shown. */
|
|
29
|
+
showCoordinates?: boolean;
|
|
30
|
+
/** Container style overrides. */
|
|
31
|
+
style?: CSSProperties;
|
|
32
|
+
/** Container class name. */
|
|
33
|
+
className?: string;
|
|
34
|
+
/** Accessible label. */
|
|
35
|
+
ariaLabel?: string;
|
|
36
|
+
/** Announce feedback callback (e.g. forward to useAriaLive). */
|
|
37
|
+
onAnnounce?: (message: string) => void;
|
|
38
|
+
/** Custom generator for square speech labels. */
|
|
39
|
+
getSquareAriaLabel?: (square: SquareIndex, cell: BoardCell, algebraic: string) => string;
|
|
40
|
+
/** Current focused square (controlled). */
|
|
41
|
+
focusedSquare?: SquareIndex;
|
|
42
|
+
/** Square focus callback. */
|
|
43
|
+
onSquareFocus?: (square: SquareIndex, cell: BoardCell, algebraic: string) => void;
|
|
44
|
+
/** Clear board callback. */
|
|
45
|
+
onClear?: () => void;
|
|
46
|
+
/** Set starting position callback. */
|
|
47
|
+
onSetStartingPosition?: () => void;
|
|
48
|
+
/** Toggle side to move callback. */
|
|
49
|
+
onToggleSideToMove?: () => void;
|
|
50
|
+
}
|
|
51
|
+
declare function BoardEditor({ fen, onChange, onPieceChange, selectedPiece, onSelectPiece, orientation, theme, pieces, showCoordinates, style, className, ariaLabel, onAnnounce, getSquareAriaLabel, focusedSquare: propFocusedSquare, onSquareFocus, onClear, onSetStartingPosition, onToggleSideToMove, }: BoardEditorProps): react_jsx_runtime.JSX.Element;
|
|
52
|
+
|
|
10
53
|
/**
|
|
11
54
|
* Interactive chess board.
|
|
12
55
|
*
|
|
@@ -423,6 +466,10 @@ declare function getPointAtSquareCentre(container: HTMLElement, square: SquareIn
|
|
|
423
466
|
readonly x: number;
|
|
424
467
|
readonly y: number;
|
|
425
468
|
};
|
|
469
|
+
/** Algebraic name (`"a1"`, `"h8"`, …) for a square index. */
|
|
470
|
+
declare function algebraicOf(square: SquareIndex): string;
|
|
471
|
+
/** Square index for an algebraic name (`"a1"`, `"h8"`, …), or `null` if invalid. */
|
|
472
|
+
declare function squareOf(algebraic: string): SquareIndex | null;
|
|
426
473
|
|
|
427
474
|
declare const defaultPieces: PieceRenderer;
|
|
428
475
|
|
|
@@ -436,6 +483,6 @@ declare const defaultPieces: PieceRenderer;
|
|
|
436
483
|
*/
|
|
437
484
|
|
|
438
485
|
/** Package version — keep in sync with `package.json`. */
|
|
439
|
-
declare const PACKAGE_VERSION = "1.
|
|
486
|
+
declare const PACKAGE_VERSION = "1.5.0";
|
|
440
487
|
|
|
441
|
-
export { AnimationOptions, AnimationRunner, BoardCell, BoardModel, BoardSnapshot, CSS_VARS, Chessboard, ChessboardProps, DEFAULT_ILLEGAL_FLASH_TINT, DEFAULT_PREMOVE_TINT, type HoverSquareContext, Orientation, PACKAGE_VERSION, PackedMove, PieceRenderer, ResolvedArrowPalette, SquareIndex, Theme, UseChessGameOptions, defaultArrowColors, defaultPieces, defaultTheme, getPointAtSquareCentre, getSquareAtPoint, useArrowGesture, useBoardSlice, useBoardSnapshot, useChessGame, useClickToMove, useDrag, useHoverSquare, useKeyboardNav, useSquareCell };
|
|
488
|
+
export { AnimationOptions, AnimationRunner, BoardCell, BoardEditor, type BoardEditorProps, BoardModel, BoardSnapshot, CSS_VARS, Chessboard, ChessboardProps, DEFAULT_ILLEGAL_FLASH_TINT, DEFAULT_PREMOVE_TINT, type HoverSquareContext, Orientation, PACKAGE_VERSION, PackedMove, PieceRenderer, ResolvedArrowPalette, SquareIndex, Theme, UseChessGameOptions, algebraicOf, defaultArrowColors, defaultPieces, defaultTheme, formatFenPlacement, getPointAtSquareCentre, getSquareAtPoint, squareOf, useArrowGesture, useBoardSlice, useBoardSnapshot, useChessGame, useClickToMove, useDrag, useHoverSquare, useKeyboardNav, useSquareCell };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,55 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
import {
|
|
6
|
-
export { D as
|
|
7
|
-
|
|
2
|
+
import { CSSProperties, RefObject, ReactNode } from 'react';
|
|
3
|
+
import { S as SquareIndex, u as BoardCell, v as BoardModel, x as BoardSnapshot, w as BoardModelOptions, P as PackedMove } from './board-model-BIVxSCWC.js';
|
|
4
|
+
export { D as Color, E as EngineAdapter, W as NULL_MOVE_SAN, X as NULL_MOVE_SANS, Y as NULL_MOVE_UCI, Z as NULL_MOVE_WORD, a as PieceType, a1 as ZobristKey, a2 as createBoardModel, a8 as isNullMove, a9 as isNullMoveSan, aa as isNullMoveUci, ac as packMove, ae as unpackMove } from './board-model-BIVxSCWC.js';
|
|
5
|
+
import { O as Orientation, T as Theme, P as PieceRenderer, C as ChessboardProps, A as AnimationOptions, R as ResolvedArrowPalette, U as UseChessGameOptions } from './types-4W8ULiE2.js';
|
|
6
|
+
export { a as ArrowColors, D as DEFAULT_MOVE_HAPTIC_PATTERNS, b as DEFAULT_MOVE_SOUND_SOURCES, H as HapticFeedbackOptions, L as LegalTargetStyle, M as MoveFeedbackKey, c as MoveHapticKey, d as MoveHapticOptions, e as MoveHapticPatterns, f as MoveSoundKey, g as MoveSoundOptions, h as MoveSoundSources, i as PositionTransition, j as PromotionContext, k as RanksPosition, S as SquareContext, l as TriggerMoveHaptic, m as TriggerMoveSound, n as classifyMoveFeedback, t as triggerHaptic, o as triggerMoveHaptic, u as useMoveHaptics, p as useMoveSound, w as warmupHaptics } from './types-4W8ULiE2.js';
|
|
7
|
+
export { c as createGigachessAdapter, p as preloadGigachessAdapter } from './gigachess-DN-ncmAU.js';
|
|
8
8
|
export { HapticInput, TriggerOptions } from 'web-haptics';
|
|
9
9
|
|
|
10
|
+
declare function formatFenPlacement(board: Uint8Array): string;
|
|
11
|
+
interface BoardEditorProps {
|
|
12
|
+
/** Current FEN or placement string. */
|
|
13
|
+
fen?: string;
|
|
14
|
+
/** Called whenever the board placement changes. */
|
|
15
|
+
onChange?: (fen: string) => void;
|
|
16
|
+
/** Called when a specific square piece changes. */
|
|
17
|
+
onPieceChange?: (square: SquareIndex, cell: BoardCell, algebraic: string) => void;
|
|
18
|
+
/** Currently selected piece for placement (e.g. "wP", "bP", "wK", or null for eraser). */
|
|
19
|
+
selectedPiece?: string | null;
|
|
20
|
+
/** Callback when shortcut piece is chosen. */
|
|
21
|
+
onSelectPiece?: (piece: string | null) => void;
|
|
22
|
+
/** Board orientation (default "white"). */
|
|
23
|
+
orientation?: Orientation;
|
|
24
|
+
/** Board visual theme. */
|
|
25
|
+
theme?: Theme;
|
|
26
|
+
/** Piece renderer. */
|
|
27
|
+
pieces?: PieceRenderer;
|
|
28
|
+
/** Whether algebraic coordinates are shown. */
|
|
29
|
+
showCoordinates?: boolean;
|
|
30
|
+
/** Container style overrides. */
|
|
31
|
+
style?: CSSProperties;
|
|
32
|
+
/** Container class name. */
|
|
33
|
+
className?: string;
|
|
34
|
+
/** Accessible label. */
|
|
35
|
+
ariaLabel?: string;
|
|
36
|
+
/** Announce feedback callback (e.g. forward to useAriaLive). */
|
|
37
|
+
onAnnounce?: (message: string) => void;
|
|
38
|
+
/** Custom generator for square speech labels. */
|
|
39
|
+
getSquareAriaLabel?: (square: SquareIndex, cell: BoardCell, algebraic: string) => string;
|
|
40
|
+
/** Current focused square (controlled). */
|
|
41
|
+
focusedSquare?: SquareIndex;
|
|
42
|
+
/** Square focus callback. */
|
|
43
|
+
onSquareFocus?: (square: SquareIndex, cell: BoardCell, algebraic: string) => void;
|
|
44
|
+
/** Clear board callback. */
|
|
45
|
+
onClear?: () => void;
|
|
46
|
+
/** Set starting position callback. */
|
|
47
|
+
onSetStartingPosition?: () => void;
|
|
48
|
+
/** Toggle side to move callback. */
|
|
49
|
+
onToggleSideToMove?: () => void;
|
|
50
|
+
}
|
|
51
|
+
declare function BoardEditor({ fen, onChange, onPieceChange, selectedPiece, onSelectPiece, orientation, theme, pieces, showCoordinates, style, className, ariaLabel, onAnnounce, getSquareAriaLabel, focusedSquare: propFocusedSquare, onSquareFocus, onClear, onSetStartingPosition, onToggleSideToMove, }: BoardEditorProps): react_jsx_runtime.JSX.Element;
|
|
52
|
+
|
|
10
53
|
/**
|
|
11
54
|
* Interactive chess board.
|
|
12
55
|
*
|
|
@@ -423,6 +466,10 @@ declare function getPointAtSquareCentre(container: HTMLElement, square: SquareIn
|
|
|
423
466
|
readonly x: number;
|
|
424
467
|
readonly y: number;
|
|
425
468
|
};
|
|
469
|
+
/** Algebraic name (`"a1"`, `"h8"`, …) for a square index. */
|
|
470
|
+
declare function algebraicOf(square: SquareIndex): string;
|
|
471
|
+
/** Square index for an algebraic name (`"a1"`, `"h8"`, …), or `null` if invalid. */
|
|
472
|
+
declare function squareOf(algebraic: string): SquareIndex | null;
|
|
426
473
|
|
|
427
474
|
declare const defaultPieces: PieceRenderer;
|
|
428
475
|
|
|
@@ -436,6 +483,6 @@ declare const defaultPieces: PieceRenderer;
|
|
|
436
483
|
*/
|
|
437
484
|
|
|
438
485
|
/** Package version — keep in sync with `package.json`. */
|
|
439
|
-
declare const PACKAGE_VERSION = "1.
|
|
486
|
+
declare const PACKAGE_VERSION = "1.5.0";
|
|
440
487
|
|
|
441
|
-
export { AnimationOptions, AnimationRunner, BoardCell, BoardModel, BoardSnapshot, CSS_VARS, Chessboard, ChessboardProps, DEFAULT_ILLEGAL_FLASH_TINT, DEFAULT_PREMOVE_TINT, type HoverSquareContext, Orientation, PACKAGE_VERSION, PackedMove, PieceRenderer, ResolvedArrowPalette, SquareIndex, Theme, UseChessGameOptions, defaultArrowColors, defaultPieces, defaultTheme, getPointAtSquareCentre, getSquareAtPoint, useArrowGesture, useBoardSlice, useBoardSnapshot, useChessGame, useClickToMove, useDrag, useHoverSquare, useKeyboardNav, useSquareCell };
|
|
488
|
+
export { AnimationOptions, AnimationRunner, BoardCell, BoardEditor, type BoardEditorProps, BoardModel, BoardSnapshot, CSS_VARS, Chessboard, ChessboardProps, DEFAULT_ILLEGAL_FLASH_TINT, DEFAULT_PREMOVE_TINT, type HoverSquareContext, Orientation, PACKAGE_VERSION, PackedMove, PieceRenderer, ResolvedArrowPalette, SquareIndex, Theme, UseChessGameOptions, algebraicOf, defaultArrowColors, defaultPieces, defaultTheme, formatFenPlacement, getPointAtSquareCentre, getSquareAtPoint, squareOf, useArrowGesture, useBoardSlice, useBoardSnapshot, useChessGame, useClickToMove, useDrag, useHoverSquare, useKeyboardNav, useSquareCell };
|