@mirasen/chessboard 1.5.3 → 1.5.4
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/CHANGELOG.md +7 -0
- package/README.md +8 -8
- package/dist/animation/planner.js +1 -3
- package/dist/state/interaction/movability.js +1 -1
- package/package.json +8 -18
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
[](https://github.com/mirasen-io/chessboard/actions/workflows/ci.yml)
|
|
3
3
|
[](https://sonarcloud.io/summary/new_code?id=mirasen-io_chessboard)
|
|
4
4
|
[](https://sonarcloud.io/summary/new_code?id=mirasen-io_chessboard)
|
|
5
|
-
[](./LICENSE)
|
|
6
6
|
|
|
7
7
|
# @mirasen/chessboard
|
|
8
8
|
|
|
@@ -10,10 +10,10 @@ A production-grade, framework-agnostic TypeScript chessboard platform with real
|
|
|
10
10
|
|
|
11
11
|
## Try it live (including annotations)
|
|
12
12
|
|
|
13
|
-
- [Play a chess.js game](https://mirasen.
|
|
14
|
-
- [Watch 12 live boards](https://mirasen.
|
|
15
|
-
- [Try the promotion flow](https://mirasen.
|
|
16
|
-
- [Try the minimal example](https://mirasen.
|
|
13
|
+
- [Play a chess.js game](https://mirasen.k-tarmyshov.workers.dev/chessboard/examples/chessjs)
|
|
14
|
+
- [Watch 12 live boards](https://mirasen.k-tarmyshov.workers.dev/chessboard/examples/live-games-grid)
|
|
15
|
+
- [Try the promotion flow](https://mirasen.k-tarmyshov.workers.dev/chessboard/examples/promotion)
|
|
16
|
+
- [Try the minimal example](https://mirasen.k-tarmyshov.workers.dev/chessboard/examples/minimal)
|
|
17
17
|
|
|
18
18
|
## Using React?
|
|
19
19
|
|
|
@@ -64,7 +64,7 @@ That means the board already covers a meaningful baseline chess UX instead of st
|
|
|
64
64
|
|
|
65
65
|
### Built-in chessboard behavior
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
The `@mirasen/chessboard` package provides a complete modern interaction and visual baseline out of the box: selection, deselection, reselection, drag-to-move, release targeting, legal destinations, circles and arrows, promotion, auto-promotion, and state-diff animation.
|
|
68
68
|
|
|
69
69
|
Moves are resolved on release rather than committed immediately on press, giving users a more forgiving interaction flow. Because animation is driven by board-state transitions, pieces can move, appear, disappear, promote, castle, or return smoothly without app-level rendering glue code.
|
|
70
70
|
|
|
@@ -393,11 +393,11 @@ Configured built-in extensions can be provided either as declarative `{ builtin,
|
|
|
393
393
|
|
|
394
394
|
### Default visual identity and attribution
|
|
395
395
|
|
|
396
|
-
The default first-party extension baseline includes a subtle
|
|
396
|
+
The default first-party extension baseline includes a subtle mirasen board watermark.
|
|
397
397
|
|
|
398
398
|
If you want full control over the visual baseline, use an explicit extension list and omit the `watermark` extension.
|
|
399
399
|
|
|
400
|
-
Attribution is not required by the MIT license, but it is appreciated. If
|
|
400
|
+
Attribution is not required by the MIT license, but it is appreciated. If the mirasen chessboard library helps your project, please consider keeping the default watermark or linking to `@mirasen/chessboard`.
|
|
401
401
|
|
|
402
402
|
## Documentation
|
|
403
403
|
|
|
@@ -88,9 +88,7 @@ function buildEffectiveAnimationPlanningSnapshot(state) {
|
|
|
88
88
|
}
|
|
89
89
|
function normalizePromotionEffectiveCurrent(previous, current) {
|
|
90
90
|
const lastMove = current.change.lastMove;
|
|
91
|
-
if (current.change.deferredUIMoveRequest !== null ||
|
|
92
|
-
lastMove === null ||
|
|
93
|
-
lastMove.promotedTo === undefined) {
|
|
91
|
+
if (current.change.deferredUIMoveRequest !== null || lastMove?.promotedTo === undefined) {
|
|
94
92
|
return current;
|
|
95
93
|
}
|
|
96
94
|
if (previous.lastMoveSource === 'projected-deferred-ui-move') {
|
|
@@ -9,7 +9,7 @@ function moveDestinationsEqual(a, b) {
|
|
|
9
9
|
a.capturedSquare === b.capturedSquare &&
|
|
10
10
|
a.secondary?.from === b.secondary?.from &&
|
|
11
11
|
a.secondary?.to === b.secondary?.to &&
|
|
12
|
-
setsEqual(new Set(a.promotedTo
|
|
12
|
+
setsEqual(new Set(a.promotedTo ?? []), new Set(b.promotedTo ?? [])));
|
|
13
13
|
}
|
|
14
14
|
function recordToDestinationsMap(record) {
|
|
15
15
|
const map = new Map();
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirasen/chessboard",
|
|
3
3
|
"description": "Production-grade framework-agnostic TypeScript chessboard platform with real chess interaction built in.",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.4",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
|
-
"name": "
|
|
7
|
+
"name": "mirasen"
|
|
8
8
|
},
|
|
9
9
|
"keywords": [
|
|
10
10
|
"mirasen",
|
|
@@ -23,10 +23,11 @@
|
|
|
23
23
|
"legal-moves",
|
|
24
24
|
"touch"
|
|
25
25
|
],
|
|
26
|
-
"homepage": "https://mirasen.
|
|
26
|
+
"homepage": "https://mirasen.k-tarmyshov.workers.dev/chessboard",
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|
|
29
|
-
"url": "git+https://github.com/mirasen-io/chessboard.git"
|
|
29
|
+
"url": "git+https://github.com/mirasen-io/chessboard.git",
|
|
30
|
+
"directory": "packages/chessboard"
|
|
30
31
|
},
|
|
31
32
|
"bugs": {
|
|
32
33
|
"url": "https://github.com/mirasen-io/chessboard/issues"
|
|
@@ -58,16 +59,13 @@
|
|
|
58
59
|
"scripts": {
|
|
59
60
|
"build": "rimraf ./dist && tsc --project tsconfig.json && npm run prepack",
|
|
60
61
|
"build:release": "rimraf ./dist && tsc --project tsconfig-release.json && npm run prepack",
|
|
61
|
-
"prepare": "bash ./scripts/npm-link.sh",
|
|
62
62
|
"prepack": "publint",
|
|
63
63
|
"format": "prettier --write .",
|
|
64
64
|
"lint": "prettier --check . && eslint .",
|
|
65
65
|
"check": "tsc --project tsconfig.json --noEmit",
|
|
66
66
|
"check:test": "tsc --project tsconfig-test.json",
|
|
67
67
|
"test": "npm run check:test && vitest run --run",
|
|
68
|
-
"coverage": "npm run check:test && vitest run --coverage"
|
|
69
|
-
"changeset:version": "changeset version && npm install && npm run format && git add --all",
|
|
70
|
-
"changeset:publish": "changeset publish"
|
|
68
|
+
"coverage": "npm run check:test && vitest run --coverage"
|
|
71
69
|
},
|
|
72
70
|
"files": [
|
|
73
71
|
"dist",
|
|
@@ -82,22 +80,14 @@
|
|
|
82
80
|
"!benchmarks"
|
|
83
81
|
],
|
|
84
82
|
"devDependencies": {
|
|
85
|
-
"@
|
|
86
|
-
"@eslint/compat": "^2.1.1",
|
|
87
|
-
"@eslint/js": "^10.0.1",
|
|
88
|
-
"@types/node": "^26.6.5",
|
|
83
|
+
"@types/node": "^26.6.6",
|
|
89
84
|
"@vitest/coverage-v8": "^5.0.5",
|
|
90
85
|
"chess.js": "^1.4.0",
|
|
91
|
-
"eslint": "^10.13.0",
|
|
92
|
-
"eslint-config-prettier": "^10.1.8",
|
|
93
|
-
"globals": "^17.13.0",
|
|
94
86
|
"jsdom": "^30.1.3",
|
|
95
|
-
"prettier": "^3.9.10",
|
|
96
87
|
"publint": "^0.3.25",
|
|
97
88
|
"rimraf": "^6.1.3",
|
|
98
89
|
"serve": "^14.2.6",
|
|
99
90
|
"typescript": "^6.0.3",
|
|
100
|
-
"typescript-eslint": "^8.72.1",
|
|
101
91
|
"vitest": "^5.0.5"
|
|
102
92
|
},
|
|
103
93
|
"engines": {
|
|
@@ -105,7 +95,7 @@
|
|
|
105
95
|
},
|
|
106
96
|
"dependencies": {
|
|
107
97
|
"@ktarmyshov/assert": "^0.1.15",
|
|
108
|
-
"es-toolkit": "^1.53.
|
|
98
|
+
"es-toolkit": "^1.53.1",
|
|
109
99
|
"type-fest": "^5.10.0"
|
|
110
100
|
},
|
|
111
101
|
"peerDependencies": {
|