react-board defines its own Arrow type with a kind: ArrowKind field ('move' | 'capture' | 'danger' | 'alternative'), which maps to colors internally. pgn defines Arrow with color: AnnotationColor ('G' | 'R' | 'Y' | 'B' | 'O' | 'C').
consumers parsing PGN [%cal] annotations can't pass them to the board without an adapter.
proposal
switch react-board's Arrow to use pgn's AnnotationColor instead of ArrowKind:
// before
type ArrowKind = 'alternative' | 'capture' | 'danger' | 'move';
interface Arrow { from: Square; kind: ArrowKind; to: Square }
// after
type AnnotationColor = 'B' | 'C' | 'G' | 'O' | 'R' | 'Y';
interface Arrow { color: AnnotationColor; from: Square; to: Square }
the CSS variable map in annotation-overlay.tsx changes from keying on kind to keying on color. the drawing hook maps keyboard modifiers to AnnotationColor values instead of ArrowKind values. Circle gets the same change (kind → color).
this also expands the palette — current board only supports 4 colors, pgn supports 6 (adds cyan and orange).
breaking change — major version bump.
react-board defines its own
Arrowtype with akind: ArrowKindfield ('move' | 'capture' | 'danger' | 'alternative'), which maps to colors internally. pgn definesArrowwithcolor: AnnotationColor('G' | 'R' | 'Y' | 'B' | 'O' | 'C').consumers parsing PGN
[%cal]annotations can't pass them to the board without an adapter.proposal
switch react-board's
Arrowto use pgn'sAnnotationColorinstead ofArrowKind:the CSS variable map in
annotation-overlay.tsxchanges from keying on kind to keying on color. the drawing hook maps keyboard modifiers toAnnotationColorvalues instead ofArrowKindvalues.Circlegets the same change (kind→color).this also expands the palette — current board only supports 4 colors, pgn supports 6 (adds cyan and orange).
breaking change — major version bump.