react-native-chess-kit 0.1.0 → 0.2.1
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/lib/commonjs/board-annotations.js +131 -0
- package/lib/commonjs/board-annotations.js.map +1 -0
- package/lib/commonjs/board-arrows.js +164 -0
- package/lib/commonjs/board-arrows.js.map +1 -0
- package/lib/commonjs/board-highlights.js +212 -0
- package/lib/commonjs/board-highlights.js.map +1 -0
- package/lib/commonjs/board-piece.js +71 -25
- package/lib/commonjs/board-piece.js.map +1 -1
- package/lib/commonjs/board-pieces.js +2 -0
- package/lib/commonjs/board-pieces.js.map +1 -1
- package/lib/commonjs/board.js +392 -42
- package/lib/commonjs/board.js.map +1 -1
- package/lib/commonjs/constants.js +104 -0
- package/lib/commonjs/constants.js.map +1 -0
- package/lib/commonjs/index.js +128 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/pieces/default-pieces.js +536 -0
- package/lib/commonjs/pieces/default-pieces.js.map +1 -0
- package/lib/commonjs/pieces/index.js +13 -0
- package/lib/commonjs/pieces/index.js.map +1 -0
- package/lib/commonjs/promotion-picker.js +129 -0
- package/lib/commonjs/promotion-picker.js.map +1 -0
- package/lib/commonjs/static-board.js +150 -0
- package/lib/commonjs/static-board.js.map +1 -0
- package/lib/commonjs/themes.js +175 -0
- package/lib/commonjs/themes.js.map +1 -0
- package/lib/commonjs/use-board-gesture.js +184 -11
- package/lib/commonjs/use-board-gesture.js.map +1 -1
- package/lib/commonjs/use-premove.js +44 -0
- package/lib/commonjs/use-premove.js.map +1 -0
- package/lib/module/board-annotations.js +126 -0
- package/lib/module/board-annotations.js.map +1 -0
- package/lib/module/board-arrows.js +161 -0
- package/lib/module/board-arrows.js.map +1 -0
- package/lib/module/board-highlights.js +206 -0
- package/lib/module/board-highlights.js.map +1 -0
- package/lib/module/board-piece.js +72 -26
- package/lib/module/board-piece.js.map +1 -1
- package/lib/module/board-pieces.js +2 -0
- package/lib/module/board-pieces.js.map +1 -1
- package/lib/module/board.js +395 -44
- package/lib/module/board.js.map +1 -1
- package/lib/module/constants.js +100 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/index.js +29 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/pieces/default-pieces.js +530 -0
- package/lib/module/pieces/default-pieces.js.map +1 -0
- package/lib/module/pieces/index.js +4 -0
- package/lib/module/pieces/index.js.map +1 -0
- package/lib/module/promotion-picker.js +124 -0
- package/lib/module/promotion-picker.js.map +1 -0
- package/lib/module/static-board.js +146 -0
- package/lib/module/static-board.js.map +1 -0
- package/lib/module/themes.js +171 -0
- package/lib/module/themes.js.map +1 -0
- package/lib/module/use-board-gesture.js +185 -11
- package/lib/module/use-board-gesture.js.map +1 -1
- package/lib/module/use-premove.js +40 -0
- package/lib/module/use-premove.js.map +1 -0
- package/lib/typescript/board-annotations.d.ts +30 -0
- package/lib/typescript/board-annotations.d.ts.map +1 -0
- package/lib/typescript/board-arrows.d.ts +27 -0
- package/lib/typescript/board-arrows.d.ts.map +1 -0
- package/lib/typescript/board-highlights.d.ts +65 -0
- package/lib/typescript/board-highlights.d.ts.map +1 -0
- package/lib/typescript/board-piece.d.ts +19 -9
- package/lib/typescript/board-piece.d.ts.map +1 -1
- package/lib/typescript/board-pieces.d.ts +2 -1
- package/lib/typescript/board-pieces.d.ts.map +1 -1
- package/lib/typescript/board.d.ts +11 -2
- package/lib/typescript/board.d.ts.map +1 -1
- package/lib/typescript/constants.d.ts +54 -0
- package/lib/typescript/constants.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +9 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/pieces/default-pieces.d.ts +3 -0
- package/lib/typescript/pieces/default-pieces.d.ts.map +1 -0
- package/lib/typescript/pieces/index.d.ts +2 -0
- package/lib/typescript/pieces/index.d.ts.map +1 -0
- package/lib/typescript/promotion-picker.d.ts +30 -0
- package/lib/typescript/promotion-picker.d.ts.map +1 -0
- package/lib/typescript/static-board.d.ts +12 -0
- package/lib/typescript/static-board.d.ts.map +1 -0
- package/lib/typescript/themes.d.ts +15 -0
- package/lib/typescript/themes.d.ts.map +1 -0
- package/lib/typescript/types.d.ts +194 -24
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/use-board-gesture.d.ts +28 -2
- package/lib/typescript/use-board-gesture.d.ts.map +1 -1
- package/lib/typescript/use-premove.d.ts +31 -0
- package/lib/typescript/use-premove.d.ts.map +1 -0
- package/package.json +4 -2
- package/src/board-annotations.tsx +147 -0
- package/src/board-arrows.tsx +197 -0
- package/src/board-highlights.tsx +226 -0
- package/src/board-piece.tsx +77 -29
- package/src/board-pieces.tsx +4 -1
- package/src/board.tsx +462 -46
- package/src/constants.ts +100 -0
- package/src/index.ts +62 -1
- package/src/pieces/default-pieces.tsx +383 -0
- package/src/pieces/index.ts +1 -0
- package/src/promotion-picker.tsx +147 -0
- package/src/static-board.tsx +150 -0
- package/src/themes.ts +129 -0
- package/src/types.ts +251 -25
- package/src/use-board-gesture.ts +219 -8
- package/src/use-premove.ts +59 -0
|
@@ -8,6 +8,36 @@ var _react = require("react");
|
|
|
8
8
|
var _reactNativeGestureHandler = require("react-native-gesture-handler");
|
|
9
9
|
var _reactNativeReanimated = require("react-native-reanimated");
|
|
10
10
|
var _useBoardPieces = require("./use-board-pieces");
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// Callback types
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
|
|
15
|
+
/** Rich callbacks exposed to consumers (all optional) */
|
|
16
|
+
|
|
17
|
+
/** Premove-related callbacks from board.tsx */
|
|
18
|
+
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
// Params
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
// Helpers
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
|
|
27
|
+
/** Check if a piece color matches the current player turn */
|
|
28
|
+
function isPieceTurn(pieceColor, currentTurn) {
|
|
29
|
+
return pieceColor === currentTurn;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Map piece color char to player ChessColor */
|
|
33
|
+
function pieceColorToPlayer(color) {
|
|
34
|
+
return color === 'w' ? 'white' : 'black';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
// Hook
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
|
|
11
41
|
/**
|
|
12
42
|
* Single centralized gesture handler for the entire board.
|
|
13
43
|
*
|
|
@@ -26,6 +56,13 @@ var _useBoardPieces = require("./use-board-pieces");
|
|
|
26
56
|
* gestureEnabled, player, or moveMethod change). Frequently-changing data
|
|
27
57
|
* (pieces, selectedSquare, legalMoves) is read from refs via runOnJS bridge
|
|
28
58
|
* functions, avoiding costly gesture teardown/rebuild on every move.
|
|
59
|
+
*
|
|
60
|
+
* v0.2.0 additions:
|
|
61
|
+
* - Rich callbacks (onPieceClick, onSquareClick, onPieceDragBegin, onPieceDragEnd)
|
|
62
|
+
* - Drag target square tracking (shared value for DragTargetHighlight)
|
|
63
|
+
* - Premove support (queue move when not your turn)
|
|
64
|
+
* - Haptic feedback via callback
|
|
65
|
+
* - Long press detection for onSquareLongPress
|
|
29
66
|
*/
|
|
30
67
|
function useBoardGesture({
|
|
31
68
|
squareSize,
|
|
@@ -35,8 +72,12 @@ function useBoardGesture({
|
|
|
35
72
|
moveMethod,
|
|
36
73
|
pieces,
|
|
37
74
|
callbacks,
|
|
75
|
+
richCallbacks,
|
|
76
|
+
premoveCallbacks,
|
|
77
|
+
premovesEnabled = false,
|
|
38
78
|
selectedSquare,
|
|
39
|
-
legalMoves
|
|
79
|
+
legalMoves,
|
|
80
|
+
currentTurn
|
|
40
81
|
}) {
|
|
41
82
|
// Shared values for drag tracking — updated on UI thread only
|
|
42
83
|
const activeSquare = (0, _reactNativeReanimated.useSharedValue)(null);
|
|
@@ -44,12 +85,14 @@ function useBoardGesture({
|
|
|
44
85
|
const dragY = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
45
86
|
const isDragging = (0, _reactNativeReanimated.useSharedValue)(false);
|
|
46
87
|
const dragPieceCode = (0, _reactNativeReanimated.useSharedValue)(null);
|
|
88
|
+
const dragTargetSquare = (0, _reactNativeReanimated.useSharedValue)(null);
|
|
47
89
|
const gestureState = {
|
|
48
90
|
activeSquare,
|
|
49
91
|
dragX,
|
|
50
92
|
dragY,
|
|
51
93
|
isDragging,
|
|
52
|
-
dragPieceCode
|
|
94
|
+
dragPieceCode,
|
|
95
|
+
dragTargetSquare
|
|
53
96
|
};
|
|
54
97
|
|
|
55
98
|
// --- Refs for frequently-changing data (read from JS thread via runOnJS) ---
|
|
@@ -62,6 +105,15 @@ function useBoardGesture({
|
|
|
62
105
|
legalMovesRef.current = legalMoves;
|
|
63
106
|
const callbacksRef = (0, _react.useRef)(callbacks);
|
|
64
107
|
callbacksRef.current = callbacks;
|
|
108
|
+
const richCallbacksRef = (0, _react.useRef)(richCallbacks);
|
|
109
|
+
richCallbacksRef.current = richCallbacks;
|
|
110
|
+
const premoveCallbacksRef = (0, _react.useRef)(premoveCallbacks);
|
|
111
|
+
premoveCallbacksRef.current = premoveCallbacks;
|
|
112
|
+
const currentTurnRef = (0, _react.useRef)(currentTurn);
|
|
113
|
+
currentTurnRef.current = currentTurn;
|
|
114
|
+
|
|
115
|
+
// Track the piece being dragged for rich drag-end callback
|
|
116
|
+
const draggedPieceRef = (0, _react.useRef)(null);
|
|
65
117
|
|
|
66
118
|
// --- JS-thread bridge functions called from worklets via runOnJS ---
|
|
67
119
|
// These read current values from refs, so they always have fresh data.
|
|
@@ -72,11 +124,16 @@ function useBoardGesture({
|
|
|
72
124
|
const currentSelected = selectedSquareRef.current;
|
|
73
125
|
const currentLegalMoves = legalMovesRef.current;
|
|
74
126
|
const cbs = callbacksRef.current;
|
|
127
|
+
const rich = richCallbacksRef.current;
|
|
75
128
|
const canClick = moveMethod !== 'drag';
|
|
76
129
|
|
|
77
130
|
// Build lookup for the current touch
|
|
78
131
|
const piece = currentPieces.find(p => p.square === square);
|
|
79
|
-
const isPlayerPiece = piece ? player === 'both' || (piece.color
|
|
132
|
+
const isPlayerPiece = piece ? player === 'both' || pieceColorToPlayer(piece.color) === player : false;
|
|
133
|
+
|
|
134
|
+
// Check if it's this piece's turn (for premove detection)
|
|
135
|
+
const turn = currentTurnRef.current;
|
|
136
|
+
const isOwnTurn = piece && turn ? isPieceTurn(piece.color, turn) : true; // default to true if turn not tracked
|
|
80
137
|
|
|
81
138
|
// Click-to-move: second tap on a legal target square
|
|
82
139
|
const legalSquares = new Set(currentLegalMoves.map(m => m.square));
|
|
@@ -85,38 +142,136 @@ function useBoardGesture({
|
|
|
85
142
|
activeSquare.value = null;
|
|
86
143
|
isDragging.value = false;
|
|
87
144
|
dragPieceCode.value = null;
|
|
145
|
+
dragTargetSquare.value = null;
|
|
146
|
+
rich?.onHaptic?.('move');
|
|
88
147
|
return;
|
|
89
148
|
}
|
|
90
149
|
if (isPlayerPiece && piece) {
|
|
91
|
-
//
|
|
150
|
+
// Premove: player piece but not their turn
|
|
151
|
+
if (premovesEnabled && !isOwnTurn) {
|
|
152
|
+
// If there's already a selected square, this tap completes a premove
|
|
153
|
+
if (currentSelected && currentSelected !== square) {
|
|
154
|
+
premoveCallbacksRef.current?.onPremoveSet?.({
|
|
155
|
+
from: currentSelected,
|
|
156
|
+
to: square
|
|
157
|
+
});
|
|
158
|
+
cbs.onSelectionCleared();
|
|
159
|
+
activeSquare.value = null;
|
|
160
|
+
dragPieceCode.value = null;
|
|
161
|
+
dragTargetSquare.value = null;
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
// First tap: select the piece for premove
|
|
165
|
+
activeSquare.value = square;
|
|
166
|
+
dragX.value = touchX;
|
|
167
|
+
dragY.value = touchY;
|
|
168
|
+
dragPieceCode.value = piece.code;
|
|
169
|
+
cbs.onPieceSelected(square);
|
|
170
|
+
rich?.onPieceClick?.(square, piece.code);
|
|
171
|
+
rich?.onHaptic?.('select');
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Normal case: tapped/started dragging a player piece on their turn
|
|
92
176
|
activeSquare.value = square;
|
|
93
177
|
dragX.value = touchX;
|
|
94
178
|
dragY.value = touchY;
|
|
95
179
|
dragPieceCode.value = piece.code;
|
|
180
|
+
draggedPieceRef.current = {
|
|
181
|
+
square,
|
|
182
|
+
code: piece.code
|
|
183
|
+
};
|
|
96
184
|
cbs.onPieceSelected(square);
|
|
185
|
+
|
|
186
|
+
// Rich callbacks
|
|
187
|
+
rich?.onPieceClick?.(square, piece.code);
|
|
188
|
+
rich?.onHaptic?.('select');
|
|
97
189
|
} else {
|
|
98
|
-
// Tapped empty square or opponent piece
|
|
190
|
+
// Tapped empty square or opponent piece
|
|
191
|
+
|
|
192
|
+
// If premoves enabled and there's a selection, check if this is a premove target
|
|
193
|
+
if (premovesEnabled && currentSelected && !isOwnTurn) {
|
|
194
|
+
premoveCallbacksRef.current?.onPremoveSet?.({
|
|
195
|
+
from: currentSelected,
|
|
196
|
+
to: square
|
|
197
|
+
});
|
|
198
|
+
cbs.onSelectionCleared();
|
|
199
|
+
activeSquare.value = null;
|
|
200
|
+
dragPieceCode.value = null;
|
|
201
|
+
dragTargetSquare.value = null;
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
99
204
|
activeSquare.value = null;
|
|
100
205
|
dragPieceCode.value = null;
|
|
206
|
+
dragTargetSquare.value = null;
|
|
101
207
|
if (currentSelected) {
|
|
102
208
|
cbs.onSelectionCleared();
|
|
103
209
|
}
|
|
210
|
+
|
|
211
|
+
// Rich callback: square click (empty square or opponent piece)
|
|
212
|
+
rich?.onSquareClick?.(square);
|
|
213
|
+
}
|
|
214
|
+
}, [squareSize, orientation, player, moveMethod, premovesEnabled, activeSquare, dragX, dragY, isDragging, dragPieceCode, dragTargetSquare]);
|
|
215
|
+
const handleDragStart = (0, _react.useCallback)((touchX, touchY) => {
|
|
216
|
+
const rich = richCallbacksRef.current;
|
|
217
|
+
const dragged = draggedPieceRef.current;
|
|
218
|
+
if (dragged) {
|
|
219
|
+
rich?.onPieceDragBegin?.(dragged.square, dragged.code);
|
|
104
220
|
}
|
|
105
|
-
|
|
221
|
+
// Update drag target to current square
|
|
222
|
+
const square = (0, _useBoardPieces.xyToSquare)(touchX, touchY, squareSize, orientation);
|
|
223
|
+
dragTargetSquare.value = square;
|
|
224
|
+
}, [squareSize, orientation, dragTargetSquare]);
|
|
225
|
+
const handleDragUpdate = (0, _react.useCallback)((touchX, touchY) => {
|
|
226
|
+
// Update drag target square (for highlight). This runs on JS thread
|
|
227
|
+
// but is called from worklet via runOnJS only when the square changes.
|
|
228
|
+
const square = (0, _useBoardPieces.xyToSquare)(touchX, touchY, squareSize, orientation);
|
|
229
|
+
dragTargetSquare.value = square;
|
|
230
|
+
}, [squareSize, orientation, dragTargetSquare]);
|
|
106
231
|
const handleEnd = (0, _react.useCallback)((touchX, touchY) => {
|
|
107
232
|
const fromSquare = activeSquare.value;
|
|
108
233
|
if (!fromSquare) return;
|
|
109
234
|
const toSquare = (0, _useBoardPieces.xyToSquare)(touchX, touchY, squareSize, orientation);
|
|
110
235
|
isDragging.value = false;
|
|
236
|
+
dragTargetSquare.value = null;
|
|
237
|
+
const rich = richCallbacksRef.current;
|
|
238
|
+
|
|
239
|
+
// Fire drag end callback
|
|
240
|
+
const dragged = draggedPieceRef.current;
|
|
241
|
+
if (dragged) {
|
|
242
|
+
rich?.onPieceDragEnd?.(toSquare, dragged.code);
|
|
243
|
+
draggedPieceRef.current = null;
|
|
244
|
+
}
|
|
111
245
|
if (fromSquare !== toSquare) {
|
|
112
|
-
|
|
246
|
+
// Check if this is a premove (not your turn)
|
|
247
|
+
const turn = currentTurnRef.current;
|
|
248
|
+
const piece = piecesRef.current.find(p => p.square === fromSquare);
|
|
249
|
+
const isOwnTurn = piece && turn ? isPieceTurn(piece.color, turn) : true;
|
|
250
|
+
if (premovesEnabled && !isOwnTurn) {
|
|
251
|
+
premoveCallbacksRef.current?.onPremoveSet?.({
|
|
252
|
+
from: fromSquare,
|
|
253
|
+
to: toSquare
|
|
254
|
+
});
|
|
255
|
+
} else {
|
|
256
|
+
callbacksRef.current.onPieceMoved(fromSquare, toSquare);
|
|
257
|
+
}
|
|
113
258
|
}
|
|
114
259
|
activeSquare.value = null;
|
|
115
260
|
dragPieceCode.value = null;
|
|
116
|
-
}, [squareSize, orientation, activeSquare, isDragging, dragPieceCode]);
|
|
261
|
+
}, [squareSize, orientation, activeSquare, isDragging, dragPieceCode, dragTargetSquare, premovesEnabled]);
|
|
262
|
+
|
|
263
|
+
// Long press handler (separate gesture, composed with pan)
|
|
264
|
+
const handleLongPress = (0, _react.useCallback)((touchX, touchY) => {
|
|
265
|
+
const square = (0, _useBoardPieces.xyToSquare)(touchX, touchY, squareSize, orientation);
|
|
266
|
+
richCallbacksRef.current?.onSquareLongPress?.(square);
|
|
267
|
+
}, [squareSize, orientation]);
|
|
117
268
|
|
|
118
269
|
// --- Build the gesture (STABLE — only changes on layout/config changes) ---
|
|
119
270
|
const canDrag = moveMethod !== 'click';
|
|
271
|
+
|
|
272
|
+
// Track the last drag target square to avoid redundant runOnJS calls
|
|
273
|
+
const lastDragTargetCol = (0, _reactNativeReanimated.useSharedValue)(-1);
|
|
274
|
+
const lastDragTargetRow = (0, _reactNativeReanimated.useSharedValue)(-1);
|
|
120
275
|
const gesture = (0, _react.useMemo)(() => {
|
|
121
276
|
return _reactNativeGestureHandler.Gesture.Pan().enabled(gestureEnabled).minDistance(0) // Also detect taps (zero-distance pans)
|
|
122
277
|
.onBegin(e => {
|
|
@@ -124,11 +279,12 @@ function useBoardGesture({
|
|
|
124
279
|
|
|
125
280
|
// Bridge to JS for piece lookup + selection logic
|
|
126
281
|
(0, _reactNativeReanimated.runOnJS)(handleBegin)(e.x, e.y);
|
|
127
|
-
}).onStart(
|
|
282
|
+
}).onStart(e => {
|
|
128
283
|
'worklet';
|
|
129
284
|
|
|
130
285
|
if (!canDrag || !activeSquare.value) return;
|
|
131
286
|
isDragging.value = true;
|
|
287
|
+
(0, _reactNativeReanimated.runOnJS)(handleDragStart)(e.x, e.y);
|
|
132
288
|
}).onUpdate(e => {
|
|
133
289
|
'worklet';
|
|
134
290
|
|
|
@@ -136,6 +292,15 @@ function useBoardGesture({
|
|
|
136
292
|
// Only 2 shared value writes — no JS bridge, no re-renders
|
|
137
293
|
dragX.value = e.x;
|
|
138
294
|
dragY.value = e.y;
|
|
295
|
+
|
|
296
|
+
// Update drag target square (only when square changes to minimize JS bridge calls)
|
|
297
|
+
const col = Math.max(0, Math.min(7, Math.floor(e.x / squareSize)));
|
|
298
|
+
const row = Math.max(0, Math.min(7, Math.floor(e.y / squareSize)));
|
|
299
|
+
if (col !== lastDragTargetCol.value || row !== lastDragTargetRow.value) {
|
|
300
|
+
lastDragTargetCol.value = col;
|
|
301
|
+
lastDragTargetRow.value = row;
|
|
302
|
+
(0, _reactNativeReanimated.runOnJS)(handleDragUpdate)(e.x, e.y);
|
|
303
|
+
}
|
|
139
304
|
}).onEnd(e => {
|
|
140
305
|
'worklet';
|
|
141
306
|
|
|
@@ -146,10 +311,18 @@ function useBoardGesture({
|
|
|
146
311
|
|
|
147
312
|
// Safety reset if gesture was interrupted
|
|
148
313
|
isDragging.value = false;
|
|
314
|
+
dragTargetSquare.value = null;
|
|
315
|
+
lastDragTargetCol.value = -1;
|
|
316
|
+
lastDragTargetRow.value = -1;
|
|
149
317
|
});
|
|
150
|
-
}, [gestureEnabled, canDrag, handleBegin, handleEnd,
|
|
318
|
+
}, [gestureEnabled, canDrag, squareSize, handleBegin, handleDragStart, handleDragUpdate, handleEnd,
|
|
151
319
|
// Shared values are stable refs — listed for exhaustive-deps but don't cause recreations
|
|
152
|
-
activeSquare, dragX, dragY, isDragging]);
|
|
320
|
+
activeSquare, dragX, dragY, isDragging, dragTargetSquare, lastDragTargetCol, lastDragTargetRow]);
|
|
321
|
+
|
|
322
|
+
// Compose with long press if the consumer wants it
|
|
323
|
+
// For now, long press is detected via a separate gesture that runs simultaneously.
|
|
324
|
+
// This is done at the board level if needed — keeping the pan gesture clean here.
|
|
325
|
+
|
|
153
326
|
return {
|
|
154
327
|
gesture,
|
|
155
328
|
gestureState
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNativeGestureHandler","_reactNativeReanimated","_useBoardPieces","useBoardGesture","squareSize","orientation","gestureEnabled","player","moveMethod","pieces","callbacks","selectedSquare","legalMoves","activeSquare","useSharedValue","dragX","dragY","isDragging","dragPieceCode","gestureState","piecesRef","useRef","current","selectedSquareRef","legalMovesRef","callbacksRef","handleBegin","useCallback","touchX","touchY","square","xyToSquare","currentPieces","currentSelected","currentLegalMoves","cbs","canClick","piece","find","p","isPlayerPiece","color","legalSquares","Set","map","m","has","onPieceMoved","value","code","onPieceSelected","onSelectionCleared","handleEnd","fromSquare","toSquare","canDrag","gesture","useMemo","Gesture","Pan","enabled","minDistance","onBegin","e","runOnJS","x","y","onStart","onUpdate","onEnd","onFinalize"],"sourceRoot":"..\\..\\src","sources":["use-board-gesture.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,0BAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAMA,IAAAG,eAAA,GAAAH,OAAA;AA2BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,eAAeA,CAAC;EAC9BC,UAAU;EACVC,WAAW;EACXC,cAAc;EACdC,MAAM;EACNC,UAAU;EACVC,MAAM;EACNC,SAAS;EACTC,cAAc;EACdC;AACqB,CAAC,EAAyB;EAC/C;EACA,MAAMC,YAAY,GAAG,IAAAC,qCAAc,EAAgB,IAAI,CAAC;EACxD,MAAMC,KAAK,GAAG,IAAAD,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AC;MACjBjD,KAAK,CAACgC,KAAK,GAAGe,CAAC,CAACG,CAAC;IACnB,CAAC,CAAC,CACDG,KAAK,CAAEN,CAAC,IAAK;MACZ,SAAS;;MACT,IAAI,CAAC9C,UAAU,CAAC+B,KAAK,IAAI,CAACnC,YAAY,CAACmC,KAAK,EAAE;MAC9C,IAAAgB,8BAAO,EAACZ,SAAS,CAAC,CAACW,CAAC,CAACE,CAAC,EAAEF,CAAC,CAACG,CAAC,CAAC;IAC9B,CAAC,CAAC,CACDI,UAAU,CAAC,MAAM;MAChB,SAAS;;MACT;MACArD,UAAU,CAAC+B,KAAK,GAAG,KAAK;IAC1B,CAAC,CAAC;EACN,CAAC,EAAE,CACD1C,cAAc,EACdiD,OAAO,EACP7B,WAAW,EACX0B,SAAS;EACT;EACAvC,YAAY,EACZE,KAAK,EACLC,KAAK,EACLC,UAAU,CACX,CAAC;EAEF,OAAO;IAAEuC,OAAO;IAAErC;EAAa,CAAC;AAClC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNativeGestureHandler","_reactNativeReanimated","_useBoardPieces","isPieceTurn","pieceColor","currentTurn","pieceColorToPlayer","color","useBoardGesture","squareSize","orientation","gestureEnabled","player","moveMethod","pieces","callbacks","richCallbacks","premoveCallbacks","premovesEnabled","selectedSquare","legalMoves","activeSquare","useSharedValue","dragX","dragY","isDragging","dragPieceCode","dragTargetSquare","gestureState","piecesRef","useRef","current","selectedSquareRef","legalMovesRef","callbacksRef","richCallbacksRef","premoveCallbacksRef","currentTurnRef","draggedPieceRef","handleBegin","useCallback","touchX","touchY","square","xyToSquare","currentPieces","currentSelected","currentLegalMoves","cbs","rich","canClick","piece","find","p","isPlayerPiece","turn","isOwnTurn","legalSquares","Set","map","m","has","onPieceMoved","value","onHaptic","onPremoveSet","from","to","onSelectionCleared","code","onPieceSelected","onPieceClick","onSquareClick","handleDragStart","dragged","onPieceDragBegin","handleDragUpdate","handleEnd","fromSquare","toSquare","onPieceDragEnd","handleLongPress","onSquareLongPress","canDrag","lastDragTargetCol","lastDragTargetRow","gesture","useMemo","Gesture","Pan","enabled","minDistance","onBegin","e","runOnJS","x","y","onStart","onUpdate","col","Math","max","min","floor","row","onEnd","onFinalize"],"sourceRoot":"..\\..\\src","sources":["use-board-gesture.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,0BAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAeA,IAAAG,eAAA,GAAAH,OAAA;AAEA;AACA;AACA;;AAQA;;AAUA;;AAKA;AACA;AACA;;AA2BA;AACA;AACA;;AAEA;AACA,SAASI,WAAWA,CAACC,UAAqB,EAAEC,WAAsB,EAAW;EAC3E,OAAOD,UAAU,KAAKC,WAAW;AACnC;;AAEA;AACA,SAASC,kBAAkBA,CAACC,KAAgB,EAAc;EACxD,OAAOA,KAAK,KAAK,GAAG,GAAG,OAAO,GAAG,OAAO;AAC1C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,eAAeA,CAAC;EAC9BC,UAAU;EACVC,WAAW;EACXC,cAAc;EACdC,MAAM;EACNC,UAAU;EACVC,MAAM;EACNC,SAAS;EACTC,aAAa;EACbC,gBAAgB;EAChBC,eAAe,GAAG,KAAK;EACvBC,cAAc;EACdC,UAAU;EACVf;AACqB,CAAC,EAAyB;EAC/C;EACA,MAAMgB,YAAY,GAAG,IAAAC,qCAAc,EAAgB,IAAI,CAAC;EACxD,MAAMC,KAAK,GAAG,IAAAD,qCAAc,EAAC,CAAC,CAAC;EAC/B,MAAME,KAAK,GAAG,IAAAF,qCAAc,EAAC,CAAC,CAAC;EAC/B,MAAMG,UAAU,GAAG,IAAAH,qCAAc,EAAC,KAAK,CAAC;EACxC,MAAMI,aAAa,GAAG,IAAAJ,qCA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C,CAACE,CAAC,EAAEF,CAAC,CAACG,CAAC,CAAC;MACrC;IACF,CAAC,CAAC,CACDS,KAAK,CAAEZ,CAAC,IAAK;MACZ,SAAS;;MACT,IAAI,CAACpE,UAAU,CAACsC,KAAK,IAAI,CAAC1C,YAAY,CAAC0C,KAAK,EAAE;MAC9C,IAAA+B,8BAAO,EAACjB,SAAS,CAAC,CAACgB,CAAC,CAACE,CAAC,EAAEF,CAAC,CAACG,CAAC,CAAC;IAC9B,CAAC,CAAC,CACDU,UAAU,CAAC,MAAM;MAChB,SAAS;;MACT;MACAjF,UAAU,CAACsC,KAAK,GAAG,KAAK;MACxBpC,gBAAgB,CAACoC,KAAK,GAAG,IAAI;MAC7BqB,iBAAiB,CAACrB,KAAK,GAAG,CAAC,CAAC;MAC5BsB,iBAAiB,CAACtB,KAAK,GAAG,CAAC,CAAC;IAC9B,CAAC,CAAC;EACN,CAAC,EAAE,CACDpD,cAAc,EACdwE,OAAO,EACP1E,UAAU,EACV8B,WAAW,EACXkC,eAAe,EACfG,gBAAgB,EAChBC,SAAS;EACT;EACAxD,YAAY,EACZE,KAAK,EACLC,KAAK,EACLC,UAAU,EACVE,gBAAgB,EAChByD,iBAAiB,EACjBC,iBAAiB,CAClB,CAAC;;EAEF;EACA;EACA;;EAEA,OAAO;IAAEC,OAAO;IAAE1D;EAAa,CAAC;AAClC","ignoreList":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.usePremove = usePremove;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
/**
|
|
9
|
+
* Manages a single premove queue (one premove at a time).
|
|
10
|
+
*
|
|
11
|
+
* Premoves work like lichess:
|
|
12
|
+
* 1. When it's not your turn, you can drag/click a move — it queues as a premove
|
|
13
|
+
* 2. The premove squares are highlighted with a distinct color
|
|
14
|
+
* 3. When your turn begins (FEN changes and it's now your turn), the premove
|
|
15
|
+
* is automatically attempted via the board's internal chess.js
|
|
16
|
+
* 4. If the premove is legal, it's applied; if not, it's silently discarded
|
|
17
|
+
*
|
|
18
|
+
* The board.tsx orchestrates this: it calls consumePremove() in a useEffect
|
|
19
|
+
* that watches the FEN (turn change), then attempts the move.
|
|
20
|
+
*/
|
|
21
|
+
function usePremove() {
|
|
22
|
+
const [premove, setPremoveState] = (0, _react.useState)(null);
|
|
23
|
+
const setPremove = (0, _react.useCallback)(pm => {
|
|
24
|
+
setPremoveState(pm);
|
|
25
|
+
}, []);
|
|
26
|
+
const clearPremove = (0, _react.useCallback)(() => {
|
|
27
|
+
setPremoveState(null);
|
|
28
|
+
}, []);
|
|
29
|
+
const consumePremove = (0, _react.useCallback)(() => {
|
|
30
|
+
let consumed = null;
|
|
31
|
+
setPremoveState(current => {
|
|
32
|
+
consumed = current;
|
|
33
|
+
return null;
|
|
34
|
+
});
|
|
35
|
+
return consumed;
|
|
36
|
+
}, []);
|
|
37
|
+
return {
|
|
38
|
+
premove,
|
|
39
|
+
setPremove,
|
|
40
|
+
clearPremove,
|
|
41
|
+
consumePremove
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=use-premove.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","usePremove","premove","setPremoveState","useState","setPremove","useCallback","pm","clearPremove","consumePremove","consumed","current"],"sourceRoot":"..\\..\\src","sources":["use-premove.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAAA,EAAqB;EAC7C,MAAM,CAACC,OAAO,EAAEC,eAAe,CAAC,GAAG,IAAAC,eAAQ,EAAqB,IAAI,CAAC;EAErE,MAAMC,UAAU,GAAG,IAAAC,kBAAW,EAAEC,EAAe,IAAK;IAClDJ,eAAe,CAACI,EAAE,CAAC;EACrB,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMC,YAAY,GAAG,IAAAF,kBAAW,EAAC,MAAM;IACrCH,eAAe,CAAC,IAAI,CAAC;EACvB,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMM,cAAc,GAAG,IAAAH,kBAAW,EAAC,MAA0B;IAC3D,IAAII,QAA4B,GAAG,IAAI;IACvCP,eAAe,CAAEQ,OAAO,IAAK;MAC3BD,QAAQ,GAAGC,OAAO;MAClB,OAAO,IAAI;IACb,CAAC,CAAC;IACF,OAAOD,QAAQ;EACjB,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IACLR,OAAO;IACPG,UAAU;IACVG,YAAY;IACZC;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { View, Text } from 'react-native';
|
|
5
|
+
import { squareToXY } from './use-board-pieces';
|
|
6
|
+
import { DEFAULT_ANNOTATION_BG, DEFAULT_ANNOTATION_TEXT, ANNOTATION_SCALE } from './constants';
|
|
7
|
+
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
// Props
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
// Annotations layer
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Text annotation badges on chess squares (!, ?, !!, ??, etc.).
|
|
18
|
+
*
|
|
19
|
+
* Each annotation appears as a small colored badge at the top-right
|
|
20
|
+
* corner of the target square. Positioned absolutely, pointer-events none.
|
|
21
|
+
*/
|
|
22
|
+
export const BoardAnnotations = /*#__PURE__*/React.memo(function BoardAnnotations({
|
|
23
|
+
boardSize,
|
|
24
|
+
orientation,
|
|
25
|
+
squareSize,
|
|
26
|
+
annotations
|
|
27
|
+
}) {
|
|
28
|
+
if (annotations.length === 0) return null;
|
|
29
|
+
const badgeSize = squareSize * ANNOTATION_SCALE;
|
|
30
|
+
const fontSize = badgeSize * 0.65;
|
|
31
|
+
return /*#__PURE__*/_jsx(View, {
|
|
32
|
+
style: {
|
|
33
|
+
position: 'absolute',
|
|
34
|
+
width: boardSize,
|
|
35
|
+
height: boardSize
|
|
36
|
+
},
|
|
37
|
+
pointerEvents: "none",
|
|
38
|
+
children: annotations.map((ann, i) => {
|
|
39
|
+
const {
|
|
40
|
+
x,
|
|
41
|
+
y
|
|
42
|
+
} = squareToXY(ann.square, squareSize, orientation);
|
|
43
|
+
const bgColor = ann.backgroundColor ?? DEFAULT_ANNOTATION_BG;
|
|
44
|
+
const textColor = ann.color ?? DEFAULT_ANNOTATION_TEXT;
|
|
45
|
+
return /*#__PURE__*/_jsx(View, {
|
|
46
|
+
style: {
|
|
47
|
+
position: 'absolute',
|
|
48
|
+
// Position at top-right corner of the square
|
|
49
|
+
left: x + squareSize - badgeSize - 1,
|
|
50
|
+
top: y + 1,
|
|
51
|
+
minWidth: badgeSize,
|
|
52
|
+
height: badgeSize,
|
|
53
|
+
borderRadius: badgeSize / 2,
|
|
54
|
+
backgroundColor: bgColor,
|
|
55
|
+
alignItems: 'center',
|
|
56
|
+
justifyContent: 'center',
|
|
57
|
+
paddingHorizontal: 2
|
|
58
|
+
},
|
|
59
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
60
|
+
style: {
|
|
61
|
+
color: textColor,
|
|
62
|
+
fontSize,
|
|
63
|
+
fontWeight: '700',
|
|
64
|
+
lineHeight: badgeSize * 0.85,
|
|
65
|
+
textAlign: 'center'
|
|
66
|
+
},
|
|
67
|
+
numberOfLines: 1,
|
|
68
|
+
children: ann.text
|
|
69
|
+
})
|
|
70
|
+
}, `ann-${ann.square}-${i}`);
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
// Standalone export for advanced consumers
|
|
77
|
+
// ---------------------------------------------------------------------------
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Single annotation badge component.
|
|
81
|
+
* Exported for consumers who build their own overlay layers.
|
|
82
|
+
*/
|
|
83
|
+
export const Annotation = /*#__PURE__*/React.memo(function Annotation({
|
|
84
|
+
square,
|
|
85
|
+
text,
|
|
86
|
+
squareSize,
|
|
87
|
+
orientation,
|
|
88
|
+
color,
|
|
89
|
+
backgroundColor
|
|
90
|
+
}) {
|
|
91
|
+
const {
|
|
92
|
+
x,
|
|
93
|
+
y
|
|
94
|
+
} = squareToXY(square, squareSize, orientation);
|
|
95
|
+
const badgeSize = squareSize * ANNOTATION_SCALE;
|
|
96
|
+
const fontSize = badgeSize * 0.65;
|
|
97
|
+
const bgColor = backgroundColor ?? DEFAULT_ANNOTATION_BG;
|
|
98
|
+
const textColor = color ?? DEFAULT_ANNOTATION_TEXT;
|
|
99
|
+
return /*#__PURE__*/_jsx(View, {
|
|
100
|
+
style: {
|
|
101
|
+
position: 'absolute',
|
|
102
|
+
left: x + squareSize - badgeSize - 1,
|
|
103
|
+
top: y + 1,
|
|
104
|
+
minWidth: badgeSize,
|
|
105
|
+
height: badgeSize,
|
|
106
|
+
borderRadius: badgeSize / 2,
|
|
107
|
+
backgroundColor: bgColor,
|
|
108
|
+
alignItems: 'center',
|
|
109
|
+
justifyContent: 'center',
|
|
110
|
+
paddingHorizontal: 2
|
|
111
|
+
},
|
|
112
|
+
pointerEvents: "none",
|
|
113
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
114
|
+
style: {
|
|
115
|
+
color: textColor,
|
|
116
|
+
fontSize,
|
|
117
|
+
fontWeight: '700',
|
|
118
|
+
lineHeight: badgeSize * 0.85,
|
|
119
|
+
textAlign: 'center'
|
|
120
|
+
},
|
|
121
|
+
numberOfLines: 1,
|
|
122
|
+
children: text
|
|
123
|
+
})
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
//# sourceMappingURL=board-annotations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","Text","squareToXY","DEFAULT_ANNOTATION_BG","DEFAULT_ANNOTATION_TEXT","ANNOTATION_SCALE","jsx","_jsx","BoardAnnotations","memo","boardSize","orientation","squareSize","annotations","length","badgeSize","fontSize","style","position","width","height","pointerEvents","children","map","ann","i","x","y","square","bgColor","backgroundColor","textColor","color","left","top","minWidth","borderRadius","alignItems","justifyContent","paddingHorizontal","fontWeight","lineHeight","textAlign","numberOfLines","text","Annotation"],"sourceRoot":"..\\..\\src","sources":["board-annotations.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAGzC,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,qBAAqB,EAAEC,uBAAuB,EAAEC,gBAAgB,QAAQ,aAAa;;AAE9F;AACA;AACA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AASA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,gBAAGT,KAAK,CAACU,IAAI,CAAC,SAASD,gBAAgBA,CAAC;EACnEE,SAAS;EACTC,WAAW;EACXC,UAAU;EACVC;AACqB,CAAC,EAAE;EACxB,IAAIA,WAAW,CAACC,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI;EAEzC,MAAMC,SAAS,GAAGH,UAAU,GAAGP,gBAAgB;EAC/C,MAAMW,QAAQ,GAAGD,SAAS,GAAG,IAAI;EAEjC,oBACER,IAAA,CAACP,IAAI;IACHiB,KAAK,EAAE;MAAEC,QAAQ,EAAE,UAAU;MAAEC,KAAK,EAAET,SAAS;MAAEU,MAAM,EAAEV;IAAU,CAAE;IACrEW,aAAa,EAAC,MAAM;IAAAC,QAAA,EAEnBT,WAAW,CAACU,GAAG,CAAC,CAACC,GAAG,EAAEC,CAAC,KAAK;MAC3B,MAAM;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