- Added
dizhi
notation system (max 12 ranks/files). - Charset of dist files is now utf-8 - relevant for kanji coords.
Notation
is now a string -'numeric' | 'japanese' | 'engine' | 'hex'
, not a const enum.notation.ts
no longer exists,coords
function is now incoords.ts
andNotation
type is intypes.ts
.
- Files are now built to
esm
directory. - Constants were moved from
types.ts
intoconstants.ts
. Notation
was moved fromtypes.ts
intonotation.ts
.- Type guards were moved from
types.ts
intoutil.ts
. allKeys
was moved fromutil.ts
intoconstants.ts
.
- Fixed possible division by zero resulting in NaN positions, while calculating positions of outside elements, that have no width/height.
- Added to
drawable.forced
to config. When set to true moving/dropping is not possible and only shapes will be drawn. - Dependencies bumped.
- Added
unpromotesTo
topromotion
in config. If a piece can't be added to or removed from hand, due to not being inhands.roles
, unpromotion will be attempted. Returnundefined
by default. - Calling
selectPiece
in api now correctly always selects specified piece and unselects only when null is provided. - Added
addSparesToHand
toselectable
in config. If true - clicking on a piece in hand while having a spare piece selected will result in adding the spare piece's role to hand. Defaults tofalse
. - Dependencies bumped.
- Fix square rendering for non-square boards (#10).
- Dependencies updated.
- Added
shogiground.js
andshogiground.min.js
in dist to npm.
- Fix redrawing with multiple instances of shogiground.
- Renamed
cancelMove
tocancelMoveOrDrop
to better reflect what it actually does. - Added an option to drop spare pieces (
selectabled.forceSpares
) by selecting a square even with selectable disabled.
- Inlined hand wrapper element (
sg-hand-wrap
) now hasinlined
class.
- Brush is also added as class to custom svgs.
- 'primary' brush class is added for arrows containing empty brush name.
- Each shape is now inside
g
element. Brush names (classes) andsgHash
are assigned to theseg
elements - you need to update css.
- Fix
highlight.checkRoles
not being optional inconfig
config.checks
can now also takesColor
orboolean
- roles to highlight can be set inhighlight.checkRoles
- Don't add hover class to squares, when not necessary
- Export canPremove and canPredrop
- Fix
checks
inconfig
- Remove
premove
andpredrop
included functions, now you have to pass a function that will be called, this truly removes shogi logic from shogiground. - Remove
Role
type, now it's juststring
, again - removes shogi logic from shogiground, custom parsers for sfen must be used, but default is provided for standard shogi. - Max size of the board extended to 16x16.
DropDests
usePieceName
as a key, not role.check
changed tochecks
, takes onlyKey[]
now.- Callback event -
unselect
andunselectPiece
- triggered only when we unselect directly on the orig square/piece. - Hex notation for coords added.
- Files and ranks notation are now set separately.
- Add description option to shapes - mainly for promotion ('+').
- Rename
Dests
toMoveDests
. - Changelog started.