@dxos/plugin-chess 0.8.4-main.fffef41 → 0.9.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/LICENSE +102 -5
- package/PLUGIN.mdl +526 -0
- package/README.md +1 -1
- package/dist/lib/neutral/ChessArticle-JHI5OXYR.mjs +88 -0
- package/dist/lib/neutral/ChessArticle-JHI5OXYR.mjs.map +7 -0
- package/dist/lib/neutral/ChessCard-4TUTIFB6.mjs +19 -0
- package/dist/lib/neutral/ChessCard-4TUTIFB6.mjs.map +7 -0
- package/dist/lib/neutral/ChessPlugin.mjs +10 -0
- package/dist/lib/neutral/ChessPlugin.node.mjs +23 -0
- package/dist/lib/neutral/ChessPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/ChessPlugin.workerd.mjs +21 -0
- package/dist/lib/neutral/ChessPlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/blueprint-definition-4MOWVVWD.mjs +15 -0
- package/dist/lib/neutral/blueprint-definition-4MOWVVWD.mjs.map +7 -0
- package/dist/lib/neutral/blueprints/index.mjs +8 -0
- package/dist/lib/neutral/capabilities/index.mjs +13 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/{browser/chunk-DUO4WTAM.mjs → neutral/chunk-7XZ4CRDL.mjs} +15 -11
- package/dist/lib/neutral/chunk-7XZ4CRDL.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-OYWDKJ5B.mjs +148 -0
- package/dist/lib/neutral/chunk-OYWDKJ5B.mjs.map +7 -0
- package/dist/lib/neutral/chunk-PJOAFP6S.mjs +41 -0
- package/dist/lib/neutral/chunk-PJOAFP6S.mjs.map +7 -0
- package/dist/lib/neutral/chunk-XWKNXG62.mjs +34 -0
- package/dist/lib/neutral/chunk-XWKNXG62.mjs.map +7 -0
- package/dist/lib/neutral/chunk-YB6WZOZI.mjs +8 -0
- package/dist/lib/neutral/chunk-YB6WZOZI.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +239 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +11 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/game-variant-ZLPEN2QK.mjs +41 -0
- package/dist/lib/neutral/game-variant-ZLPEN2QK.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +18 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/move-6NCMKKWD.mjs +37 -0
- package/dist/lib/neutral/move-6NCMKKWD.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-EKZKFQUG.mjs +13 -0
- package/dist/lib/neutral/operation-handler-EKZKFQUG.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/play-F5L5LFLW.mjs +46 -0
- package/dist/lib/neutral/play-F5L5LFLW.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/print-GMSNKAS2.mjs +29 -0
- package/dist/lib/neutral/print-GMSNKAS2.mjs.map +7 -0
- package/dist/lib/neutral/testing.mjs +8 -0
- package/dist/lib/neutral/testing.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +39 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +10 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/ChessPlugin.d.ts +3 -1
- package/dist/types/src/ChessPlugin.d.ts.map +1 -1
- package/dist/types/src/ChessPlugin.node.d.ts +8 -0
- package/dist/types/src/ChessPlugin.node.d.ts.map +1 -0
- package/dist/types/src/ChessPlugin.test.d.ts +2 -0
- package/dist/types/src/ChessPlugin.test.d.ts.map +1 -0
- package/dist/types/src/ChessPlugin.workerd.d.ts +4 -0
- package/dist/types/src/ChessPlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/blueprints/chess-blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/chess-blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -5
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/game-variant.d.ts +6 -0
- package/dist/types/src/capabilities/game-variant.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +6 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/components/{Chessboard.d.ts → Chessboard/Chessboard.d.ts} +10 -10
- package/dist/types/src/components/Chessboard/Chessboard.d.ts.map +1 -0
- package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts +65 -0
- package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts.map +1 -0
- package/dist/types/src/components/{Info.d.ts → Chessboard/Info.d.ts} +5 -6
- package/dist/types/src/components/Chessboard/Info.d.ts.map +1 -0
- package/dist/types/src/components/Chessboard/index.d.ts +2 -0
- package/dist/types/src/components/Chessboard/index.d.ts.map +1 -0
- package/dist/types/src/components/Chessboard/types.d.ts +8 -0
- package/dist/types/src/components/Chessboard/types.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts +5 -0
- package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts +64 -0
- package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChessArticle/index.d.ts +2 -0
- package/dist/types/src/containers/ChessArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChessCard/ChessCard.d.ts +5 -0
- package/dist/types/src/containers/ChessCard/ChessCard.d.ts.map +1 -0
- package/dist/types/src/{components/Card.stories.d.ts → containers/ChessCard/ChessCard.stories.d.ts} +2 -9
- package/dist/types/src/containers/ChessCard/ChessCard.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChessCard/index.d.ts +2 -0
- package/dist/types/src/containers/ChessCard/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +4 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/move.d.ts +5 -0
- package/dist/types/src/operations/move.d.ts.map +1 -0
- package/dist/types/src/operations/play.d.ts +5 -0
- package/dist/types/src/operations/play.d.ts.map +1 -0
- package/dist/types/src/operations/print.d.ts +5 -0
- package/dist/types/src/operations/print.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/testing.d.ts +2 -0
- package/dist/types/src/testing.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +40 -22
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Chess.d.ts +12 -22
- package/dist/types/src/types/Chess.d.ts.map +1 -1
- package/dist/types/src/types/ChessOperation.d.ts +29 -0
- package/dist/types/src/types/ChessOperation.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +1 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +116 -56
- package/src/ChessPlugin.node.ts +23 -0
- package/src/ChessPlugin.test.ts +50 -0
- package/src/ChessPlugin.tsx +24 -53
- package/src/ChessPlugin.workerd.ts +18 -0
- package/src/blueprints/chess-blueprint.ts +32 -0
- package/src/blueprints/index.ts +5 -0
- package/src/capabilities/blueprint-definition.ts +11 -28
- package/src/capabilities/game-variant.ts +45 -0
- package/src/capabilities/index.ts +14 -6
- package/src/capabilities/operation-handler.ts +14 -0
- package/src/components/Chessboard/Chessboard.stories.tsx +94 -0
- package/src/components/{Chessboard.tsx → Chessboard/Chessboard.tsx} +35 -32
- package/src/components/{Info.tsx → Chessboard/Info.tsx} +33 -76
- package/src/components/Chessboard/index.ts +5 -0
- package/src/components/Chessboard/types.ts +18 -0
- package/src/components/index.ts +1 -5
- package/src/containers/ChessArticle/ChessArticle.stories.tsx +59 -0
- package/src/containers/ChessArticle/ChessArticle.tsx +108 -0
- package/src/containers/ChessArticle/index.ts +5 -0
- package/src/containers/ChessCard/ChessCard.stories.tsx +47 -0
- package/src/containers/ChessCard/ChessCard.tsx +27 -0
- package/src/containers/ChessCard/index.ts +5 -0
- package/src/containers/index.ts +8 -0
- package/src/index.ts +1 -5
- package/src/meta.ts +10 -4
- package/src/operations/index.ts +11 -0
- package/src/operations/move.ts +36 -0
- package/src/operations/play.ts +45 -0
- package/src/operations/print.ts +28 -0
- package/src/plugin.ts +11 -0
- package/src/testing.ts +7 -0
- package/src/translations.ts +23 -20
- package/src/types/Chess.ts +23 -30
- package/src/types/ChessOperation.ts +88 -0
- package/src/types/index.ts +1 -1
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/ChessboardContainer-5YXEM4VR.mjs +0 -96
- package/dist/lib/browser/ChessboardContainer-5YXEM4VR.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-FD4TL5EE.mjs +0 -11
- package/dist/lib/browser/chunk-5DOZV3PW.mjs +0 -294
- package/dist/lib/browser/chunk-5DOZV3PW.mjs.map +0 -7
- package/dist/lib/browser/chunk-DUO4WTAM.mjs.map +0 -7
- package/dist/lib/browser/chunk-FBLAVAMY.mjs +0 -84
- package/dist/lib/browser/chunk-FBLAVAMY.mjs.map +0 -7
- package/dist/lib/browser/chunk-Q5TZCIH7.mjs +0 -8
- package/dist/lib/browser/chunk-Q5TZCIH7.mjs.map +0 -7
- package/dist/lib/browser/chunk-TIIGNOGK.mjs +0 -169
- package/dist/lib/browser/chunk-TIIGNOGK.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -124
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-GXZN2EBT.mjs +0 -25
- package/dist/lib/browser/intent-resolver-GXZN2EBT.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-KTTAUHAA.mjs +0 -38
- package/dist/lib/browser/react-surface-KTTAUHAA.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -10
- package/dist/lib/node-esm/ChessboardContainer-7OQ6TOKB.mjs +0 -97
- package/dist/lib/node-esm/ChessboardContainer-7OQ6TOKB.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-O7ZM3HUF.mjs +0 -12
- package/dist/lib/node-esm/chunk-F4C2HVZL.mjs +0 -295
- package/dist/lib/node-esm/chunk-F4C2HVZL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KNOOJFIR.mjs +0 -29
- package/dist/lib/node-esm/chunk-KNOOJFIR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MP3A3AGA.mjs +0 -85
- package/dist/lib/node-esm/chunk-MP3A3AGA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RTCAAOLF.mjs +0 -170
- package/dist/lib/node-esm/chunk-RTCAAOLF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VVXTAVIS.mjs +0 -10
- package/dist/lib/node-esm/chunk-VVXTAVIS.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -125
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-HK5L6P6Z.mjs +0 -26
- package/dist/lib/node-esm/intent-resolver-HK5L6P6Z.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-VO4PSY6O.mjs +0 -39
- package/dist/lib/node-esm/react-surface-VO4PSY6O.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -11
- package/dist/types/src/capabilities/artifact-definition.d.ts +0 -11
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/Card.stories.d.ts.map +0 -1
- package/dist/types/src/components/Chessboard.d.ts.map +0 -1
- package/dist/types/src/components/Chessboard.stories.d.ts +0 -44
- package/dist/types/src/components/Chessboard.stories.d.ts.map +0 -1
- package/dist/types/src/components/ChessboardArticle.d.ts +0 -7
- package/dist/types/src/components/ChessboardArticle.d.ts.map +0 -1
- package/dist/types/src/components/ChessboardContainer.d.ts +0 -9
- package/dist/types/src/components/ChessboardContainer.d.ts.map +0 -1
- package/dist/types/src/components/Info.d.ts.map +0 -1
- package/dist/types/src/functions/create.d.ts +0 -14
- package/dist/types/src/functions/create.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -4
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/functions/move.d.ts +0 -8
- package/dist/types/src/functions/move.d.ts.map +0 -1
- package/dist/types/src/functions/play.d.ts +0 -9
- package/dist/types/src/functions/play.d.ts.map +0 -1
- package/dist/types/src/types/ChessAction.d.ts +0 -24
- package/dist/types/src/types/ChessAction.d.ts.map +0 -1
- package/src/capabilities/artifact-definition.ts +0 -129
- package/src/capabilities/intent-resolver.ts +0 -22
- package/src/capabilities/react-surface.tsx +0 -23
- package/src/components/Card.stories.tsx +0 -66
- package/src/components/Chessboard.stories.tsx +0 -49
- package/src/components/ChessboardArticle.tsx +0 -68
- package/src/components/ChessboardContainer.tsx +0 -44
- package/src/functions/create.ts +0 -32
- package/src/functions/index.ts +0 -7
- package/src/functions/move.ts +0 -45
- package/src/functions/play.ts +0 -55
- package/src/types/ChessAction.ts +0 -19
- /package/dist/lib/{browser/blueprint-definition-FD4TL5EE.mjs.map → neutral/ChessPlugin.mjs.map} +0 -0
- /package/dist/lib/{browser/types → neutral/blueprints}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/blueprint-definition-O7ZM3HUF.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral}/index.mjs.map +0 -0
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { DXN } from '@dxos/keys';
|
|
7
|
+
import { meta as gameMeta } from '@dxos/plugin-game';
|
|
6
8
|
import { trim } from '@dxos/util';
|
|
7
9
|
|
|
8
|
-
export const meta
|
|
9
|
-
|
|
10
|
+
export const meta = Plugin.makeMeta({
|
|
11
|
+
key: DXN.make('org.dxos.plugin.chess'),
|
|
10
12
|
name: 'Chess',
|
|
13
|
+
author: 'DXOS',
|
|
11
14
|
description: trim`
|
|
12
15
|
Full-featured chess game supporting multiplayer matches with friends or practice sessions against AI opponents.
|
|
13
16
|
Track game history and analyze moves in real-time.
|
|
@@ -15,5 +18,8 @@ export const meta: PluginMeta = {
|
|
|
15
18
|
icon: 'ph--shield-chevron--regular',
|
|
16
19
|
iconHue: 'amber',
|
|
17
20
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-chess',
|
|
21
|
+
spec: 'PLUGIN.mdl',
|
|
18
22
|
screenshots: ['https://dxos.network/plugin-details-chess-dark.png'],
|
|
19
|
-
|
|
23
|
+
dependsOn: [gameMeta.id],
|
|
24
|
+
tags: ['game'],
|
|
25
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Chess as ChessJS } from 'chess.js';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
10
|
+
import { loadGame } from '@dxos/plugin-game';
|
|
11
|
+
|
|
12
|
+
import { Chess, ChessOperation } from '../types';
|
|
13
|
+
|
|
14
|
+
const handler: Operation.WithHandler<typeof ChessOperation.Move> = ChessOperation.Move.pipe(
|
|
15
|
+
Operation.withHandler(
|
|
16
|
+
Effect.fn(function* ({ game, move }) {
|
|
17
|
+
const { variant } = yield* loadGame(game, Chess.State);
|
|
18
|
+
const chess = new ChessJS();
|
|
19
|
+
if (variant.pgn) {
|
|
20
|
+
chess.loadPgn(variant.pgn);
|
|
21
|
+
} else if (variant.fen) {
|
|
22
|
+
chess.load(variant.fen);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
chess.move(move, { strict: false });
|
|
26
|
+
const pgn = chess.pgn();
|
|
27
|
+
Obj.update(variant, (variant) => {
|
|
28
|
+
const mutable = variant as Obj.Mutable<typeof variant>;
|
|
29
|
+
mutable.pgn = pgn;
|
|
30
|
+
});
|
|
31
|
+
return { pgn };
|
|
32
|
+
}),
|
|
33
|
+
),
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export default handler;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Chess as ChessJS } from 'chess.js';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
10
|
+
import { loadGame } from '@dxos/plugin-game';
|
|
11
|
+
|
|
12
|
+
import { Chess, ChessOperation } from '../types';
|
|
13
|
+
|
|
14
|
+
const handler: Operation.WithHandler<typeof ChessOperation.Play> = ChessOperation.Play.pipe(
|
|
15
|
+
Operation.withHandler(
|
|
16
|
+
Effect.fn(function* ({ game, side = 'any' }) {
|
|
17
|
+
const { variant } = yield* loadGame(game, Chess.State);
|
|
18
|
+
const chess = new ChessJS();
|
|
19
|
+
if (variant.pgn) {
|
|
20
|
+
chess.loadPgn(variant.pgn);
|
|
21
|
+
} else if (variant.fen) {
|
|
22
|
+
chess.load(variant.fen);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (
|
|
26
|
+
!(side === 'any' || (chess.turn() === 'w' && side === 'white') || (chess.turn() === 'b' && side === 'black'))
|
|
27
|
+
) {
|
|
28
|
+
return { move: undefined, pgn: variant.pgn ?? '' };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const moves = chess.moves();
|
|
32
|
+
const move = moves[Math.floor(Math.random() * moves.length)];
|
|
33
|
+
|
|
34
|
+
chess.move(move, { strict: false });
|
|
35
|
+
const pgn = chess.pgn();
|
|
36
|
+
Obj.update(variant, (variant) => {
|
|
37
|
+
const mutable = variant as Obj.Mutable<typeof variant>;
|
|
38
|
+
mutable.pgn = pgn;
|
|
39
|
+
});
|
|
40
|
+
return { move, pgn };
|
|
41
|
+
}),
|
|
42
|
+
),
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
export default handler;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Chess as ChessJS } from 'chess.js';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
|
|
10
|
+
import { ChessOperation } from '../types';
|
|
11
|
+
|
|
12
|
+
const handler: Operation.WithHandler<typeof ChessOperation.Print> = ChessOperation.Print.pipe(
|
|
13
|
+
Operation.withHandler(
|
|
14
|
+
Effect.fn(function* ({ pgn, fen }) {
|
|
15
|
+
try {
|
|
16
|
+
const chess = new ChessJS(fen);
|
|
17
|
+
if (pgn) {
|
|
18
|
+
chess.loadPgn(pgn);
|
|
19
|
+
}
|
|
20
|
+
return { ascii: chess.ascii() };
|
|
21
|
+
} catch {
|
|
22
|
+
return { ascii: '' };
|
|
23
|
+
}
|
|
24
|
+
}),
|
|
25
|
+
),
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export default handler;
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const ChessPlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
10
|
+
|
|
11
|
+
export { ChessOperationHandlerSet } from './operations';
|
package/src/testing.ts
ADDED
package/src/translations.ts
CHANGED
|
@@ -2,34 +2,37 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Type } from '@dxos/echo';
|
|
5
6
|
import { type Resource } from '@dxos/react-ui';
|
|
6
7
|
|
|
7
|
-
import { meta } from '
|
|
8
|
-
import { Chess } from '
|
|
8
|
+
import { meta } from '#meta';
|
|
9
|
+
import { Chess } from '#types';
|
|
9
10
|
|
|
10
11
|
export const translations = [
|
|
11
12
|
{
|
|
12
13
|
'en-US': {
|
|
13
|
-
[Chess.
|
|
14
|
-
'typename
|
|
15
|
-
'typename
|
|
16
|
-
'typename
|
|
17
|
-
'typename
|
|
18
|
-
'object
|
|
19
|
-
'
|
|
20
|
-
'
|
|
14
|
+
[Type.getTypename(Chess.State)]: {
|
|
15
|
+
'typename.label': 'Chess',
|
|
16
|
+
'typename.label_zero': 'Chess games',
|
|
17
|
+
'typename.label_one': 'Chess game',
|
|
18
|
+
'typename.label_other': 'Chess games',
|
|
19
|
+
'object-name.placeholder': 'New chess game',
|
|
20
|
+
'add-object.label': 'Add chess game',
|
|
21
|
+
'rename-object.label': 'Rename chess game',
|
|
22
|
+
'delete-object.label': 'Delete chess game',
|
|
21
23
|
},
|
|
22
24
|
[meta.id]: {
|
|
23
|
-
'plugin
|
|
24
|
-
'
|
|
25
|
-
'game.
|
|
26
|
-
'game.
|
|
27
|
-
'game.
|
|
28
|
-
'game.
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
25
|
+
'plugin.name': 'Chess',
|
|
26
|
+
'new-game.button': 'New game',
|
|
27
|
+
'delete-game.label': 'Delete',
|
|
28
|
+
'game.checkmate.label': 'Checkmate',
|
|
29
|
+
'game.stalemate.label': 'Stalemate',
|
|
30
|
+
'game.draw.label': 'Draw',
|
|
31
|
+
'game.check.label': 'Check',
|
|
32
|
+
'select-player.button': 'Select player',
|
|
33
|
+
'toggle-info.button': 'Toggle info',
|
|
34
|
+
'close-info.button': 'Close info',
|
|
35
|
+
'flip-board.button': 'Flip board',
|
|
33
36
|
},
|
|
34
37
|
},
|
|
35
38
|
},
|
package/src/types/Chess.ts
CHANGED
|
@@ -5,43 +5,38 @@
|
|
|
5
5
|
import { Chess as ChessJS } from 'chess.js';
|
|
6
6
|
import * as Schema from 'effect/Schema';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { BlueprintsAnnotation } from '@dxos/app-toolkit';
|
|
9
|
+
import { DXN, Annotation, Obj, Type } from '@dxos/echo';
|
|
10
|
+
import { FormInputAnnotation, HiddenAnnotation } from '@dxos/echo/Annotation';
|
|
10
11
|
import { log } from '@dxos/log';
|
|
11
|
-
import { ItemAnnotation } from '@dxos/schema';
|
|
12
12
|
|
|
13
|
-
export const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
),
|
|
21
|
-
black: Schema.optional(
|
|
22
|
-
Schema.String.annotations({
|
|
23
|
-
description: 'DID of black player',
|
|
24
|
-
}),
|
|
25
|
-
),
|
|
26
|
-
}).pipe(Schema.mutable, FormAnnotation.set(false), Schema.optional),
|
|
13
|
+
export const BLUEPRINT_KEY = 'org.dxos.blueprint.chess';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Chess variant state. Referenced by the base `Game` object via `Game.variant`.
|
|
17
|
+
* Players, name, and other game-shared fields live on the base `Game`.
|
|
18
|
+
*/
|
|
19
|
+
export const State = Schema.Struct({
|
|
27
20
|
pgn: Schema.String.annotations({
|
|
28
21
|
description: 'Portable Game Notation.',
|
|
29
|
-
}).pipe(
|
|
22
|
+
}).pipe(FormInputAnnotation.set(false), Schema.optional),
|
|
30
23
|
fen: Schema.String.annotations({
|
|
31
24
|
description: 'Forsyth-Edwards Notation.',
|
|
32
|
-
}).pipe(
|
|
25
|
+
}).pipe(FormInputAnnotation.set(false), Schema.optional),
|
|
33
26
|
}).pipe(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
Annotation.IconAnnotation.set({ icon: 'ph--shield-chevron--regular', hue: 'amber' }),
|
|
28
|
+
BlueprintsAnnotation.set([BLUEPRINT_KEY]),
|
|
29
|
+
// Implementation detail of the unified `Game` schema. The user-facing object is `Game`;
|
|
30
|
+
// this state is only ever referenced via `Game.variant`. HiddenAnnotation keeps it out of the
|
|
31
|
+
// navtree's typed branches so an orphaned state object doesn't reappear after the
|
|
32
|
+
// wrapping Game is deleted.
|
|
33
|
+
HiddenAnnotation.set(true),
|
|
34
|
+
Type.makeObject(DXN.make('org.dxos.type.chess.state', '0.1.0')),
|
|
40
35
|
);
|
|
41
36
|
|
|
42
|
-
export
|
|
37
|
+
export type State = Type.InstanceType<typeof State>;
|
|
43
38
|
|
|
44
|
-
export const
|
|
39
|
+
export const make = ({ pgn, fen }: { pgn?: string; fen?: string } = {}): State => {
|
|
45
40
|
const chess = new ChessJS();
|
|
46
41
|
if (pgn) {
|
|
47
42
|
try {
|
|
@@ -51,9 +46,7 @@ export const makeGame = ({ name, pgn, fen }: { name?: string; pgn?: string; fen?
|
|
|
51
46
|
}
|
|
52
47
|
}
|
|
53
48
|
|
|
54
|
-
return Obj.make(
|
|
55
|
-
name,
|
|
56
|
-
players: {},
|
|
49
|
+
return Obj.make(State, {
|
|
57
50
|
pgn,
|
|
58
51
|
fen,
|
|
59
52
|
});
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import * as Schema from 'effect/Schema';
|
|
8
|
+
|
|
9
|
+
import { Operation } from '@dxos/compute';
|
|
10
|
+
import { Database, DXN } from '@dxos/echo';
|
|
11
|
+
import { GameRef } from '@dxos/plugin-game/types';
|
|
12
|
+
|
|
13
|
+
import * as Chess from './Chess';
|
|
14
|
+
|
|
15
|
+
export const Move = Operation.make({
|
|
16
|
+
meta: {
|
|
17
|
+
key: DXN.make('org.dxos.function.chess.move'),
|
|
18
|
+
name: 'Move',
|
|
19
|
+
description: 'Makes a move in the given chess game.',
|
|
20
|
+
icon: 'ph--play--regular',
|
|
21
|
+
},
|
|
22
|
+
input: Schema.Struct({
|
|
23
|
+
game: GameRef(Chess.State).annotations({
|
|
24
|
+
description: 'The ID of the game object (variant must be Chess).',
|
|
25
|
+
}),
|
|
26
|
+
move: Schema.String.annotations({
|
|
27
|
+
description: 'The move to make in the chess game.',
|
|
28
|
+
examples: ['e4', 'Bf3'],
|
|
29
|
+
}),
|
|
30
|
+
}),
|
|
31
|
+
output: Schema.Struct({
|
|
32
|
+
pgn: Schema.String.annotations({
|
|
33
|
+
description: 'The PGN of the game after the move was played.',
|
|
34
|
+
}),
|
|
35
|
+
}),
|
|
36
|
+
services: [Database.Service],
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const Play = Operation.make({
|
|
40
|
+
meta: {
|
|
41
|
+
key: DXN.make('org.dxos.function.chess.play'),
|
|
42
|
+
name: 'Play',
|
|
43
|
+
description: 'Uses the chess engine to play the next move.',
|
|
44
|
+
icon: 'ph--play--regular',
|
|
45
|
+
},
|
|
46
|
+
input: Schema.Struct({
|
|
47
|
+
game: GameRef(Chess.State).annotations({
|
|
48
|
+
description: 'The ID of the game object (variant must be Chess).',
|
|
49
|
+
}),
|
|
50
|
+
side: Schema.optional(Schema.Literal('white', 'black', 'any')).annotations({
|
|
51
|
+
description: 'The side to play.',
|
|
52
|
+
defaultValue: 'any',
|
|
53
|
+
}),
|
|
54
|
+
}),
|
|
55
|
+
output: Schema.Struct({
|
|
56
|
+
pgn: Schema.String.annotations({
|
|
57
|
+
description: 'The PGN of the game after the move was played.',
|
|
58
|
+
}),
|
|
59
|
+
move: Schema.optional(Schema.String).annotations({
|
|
60
|
+
description: 'The move that was played.',
|
|
61
|
+
}),
|
|
62
|
+
}),
|
|
63
|
+
services: [Database.Service],
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
export const Print = Operation.make({
|
|
67
|
+
meta: {
|
|
68
|
+
key: DXN.make('org.dxos.function.chess.print'),
|
|
69
|
+
name: 'Print game',
|
|
70
|
+
description: 'Prints the chess game to ASCII.',
|
|
71
|
+
icon: 'ph--clipboard-text--regular',
|
|
72
|
+
},
|
|
73
|
+
input: Schema.Struct({
|
|
74
|
+
pgn: Schema.optional(
|
|
75
|
+
Schema.String.annotations({
|
|
76
|
+
description: 'Portable Game Notation.',
|
|
77
|
+
}),
|
|
78
|
+
),
|
|
79
|
+
fen: Schema.optional(
|
|
80
|
+
Schema.String.annotations({
|
|
81
|
+
description: 'Forsyth-Edwards Notation.',
|
|
82
|
+
}),
|
|
83
|
+
),
|
|
84
|
+
}),
|
|
85
|
+
output: Schema.Struct({
|
|
86
|
+
ascii: Schema.String,
|
|
87
|
+
}),
|
|
88
|
+
});
|
package/src/types/index.ts
CHANGED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Chessboard
|
|
3
|
-
} from "./chunk-5DOZV3PW.mjs";
|
|
4
|
-
import {
|
|
5
|
-
meta
|
|
6
|
-
} from "./chunk-DUO4WTAM.mjs";
|
|
7
|
-
|
|
8
|
-
// src/components/ChessboardContainer.tsx
|
|
9
|
-
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
10
|
-
import React2 from "react";
|
|
11
|
-
import { getSpace } from "@dxos/react-client/echo";
|
|
12
|
-
|
|
13
|
-
// src/components/ChessboardArticle.tsx
|
|
14
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
15
|
-
import React, { useCallback, useRef, useState } from "react";
|
|
16
|
-
import { Toolbar, useTranslation } from "@dxos/react-ui";
|
|
17
|
-
import { StackItem } from "@dxos/react-ui-stack";
|
|
18
|
-
import { mx } from "@dxos/react-ui-theme";
|
|
19
|
-
var ChessboardArticle = ({ game, role }) => {
|
|
20
|
-
var _effect = _useSignals();
|
|
21
|
-
try {
|
|
22
|
-
const { t } = useTranslation(meta.id);
|
|
23
|
-
const [orientation, setOrientation] = useState("white");
|
|
24
|
-
const [open, setOpen] = useState(true);
|
|
25
|
-
const controller = useRef(null);
|
|
26
|
-
const handleSelect = useCallback((index) => {
|
|
27
|
-
controller.current?.setMoveNumber(index);
|
|
28
|
-
}, []);
|
|
29
|
-
return /* @__PURE__ */ React.createElement(StackItem.Content, {
|
|
30
|
-
toolbar: true,
|
|
31
|
-
classNames: "@container"
|
|
32
|
-
}, /* @__PURE__ */ React.createElement(Chessboard.Root, {
|
|
33
|
-
game,
|
|
34
|
-
ref: controller
|
|
35
|
-
}, /* @__PURE__ */ React.createElement(Toolbar.Root, null, /* @__PURE__ */ React.createElement(Toolbar.IconButton, {
|
|
36
|
-
icon: "ph--info--regular",
|
|
37
|
-
iconOnly: true,
|
|
38
|
-
label: t("toggle info button"),
|
|
39
|
-
disabled: open,
|
|
40
|
-
classNames: mx("invisible @3xl:visible"),
|
|
41
|
-
onClick: () => setOpen((open2) => !open2)
|
|
42
|
-
})), /* @__PURE__ */ React.createElement("div", {
|
|
43
|
-
className: mx("grid bs-full is-full gap-2", open && "@3xl:grid-cols-[1fr_320px]", role === "section" && "aspect-square", role === "section" && open && "@3xl:aspect-auto")
|
|
44
|
-
}, /* @__PURE__ */ React.createElement(Chessboard.Content, null, /* @__PURE__ */ React.createElement(Chessboard.Board, {
|
|
45
|
-
classNames: "m-4 rounded-sm overflow-hidden",
|
|
46
|
-
orientation
|
|
47
|
-
})), open && /* @__PURE__ */ React.createElement("div", {
|
|
48
|
-
className: "hidden @3xl:flex flex-col p-8 justify-center items-center overflow-hidden"
|
|
49
|
-
}, /* @__PURE__ */ React.createElement(Chessboard.Info, {
|
|
50
|
-
orientation,
|
|
51
|
-
min: 8,
|
|
52
|
-
max: 8,
|
|
53
|
-
onOrientationChange: setOrientation,
|
|
54
|
-
onClose: () => setOpen(false),
|
|
55
|
-
onSelect: handleSelect
|
|
56
|
-
})))));
|
|
57
|
-
} finally {
|
|
58
|
-
_effect.f();
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
// src/components/ChessboardContainer.tsx
|
|
63
|
-
var ChessboardContainer = ({ game, role }) => {
|
|
64
|
-
var _effect = _useSignals2();
|
|
65
|
-
try {
|
|
66
|
-
const space = getSpace(game);
|
|
67
|
-
if (!space) {
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
switch (role) {
|
|
71
|
-
case "card--popover":
|
|
72
|
-
case "card--intrinsic":
|
|
73
|
-
case "card--extrinsic": {
|
|
74
|
-
return /* @__PURE__ */ React2.createElement(Chessboard.Root, {
|
|
75
|
-
game
|
|
76
|
-
}, /* @__PURE__ */ React2.createElement(Chessboard.Content, {
|
|
77
|
-
role
|
|
78
|
-
}, /* @__PURE__ */ React2.createElement(Chessboard.Board, null)));
|
|
79
|
-
}
|
|
80
|
-
default: {
|
|
81
|
-
return /* @__PURE__ */ React2.createElement(ChessboardArticle, {
|
|
82
|
-
game,
|
|
83
|
-
role
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
} finally {
|
|
88
|
-
_effect.f();
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
var ChessboardContainer_default = ChessboardContainer;
|
|
92
|
-
export {
|
|
93
|
-
ChessboardContainer,
|
|
94
|
-
ChessboardContainer_default as default
|
|
95
|
-
};
|
|
96
|
-
//# sourceMappingURL=ChessboardContainer-5YXEM4VR.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/ChessboardContainer.tsx", "../../../src/components/ChessboardArticle.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { getSpace } from '@dxos/react-client/echo';\n\nimport { type Chess } from '../types';\n\nimport { Chessboard } from './Chessboard';\nimport { ChessboardArticle } from './ChessboardArticle';\n\nexport type ChessboardContainerProps = {\n game: Chess.Game;\n role?: string;\n};\n\nexport const ChessboardContainer = ({ game, role }: ChessboardContainerProps) => {\n const space = getSpace(game);\n if (!space) {\n return null;\n }\n\n switch (role) {\n case 'card--popover':\n case 'card--intrinsic':\n case 'card--extrinsic': {\n return (\n <Chessboard.Root game={game}>\n <Chessboard.Content role={role}>\n <Chessboard.Board />\n </Chessboard.Content>\n </Chessboard.Root>\n );\n }\n\n default: {\n return <ChessboardArticle game={game} role={role} />;\n }\n }\n};\n\nexport default ChessboardContainer;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback, useRef, useState } from 'react';\n\nimport { Toolbar, useTranslation } from '@dxos/react-ui';\nimport { type Player } from '@dxos/react-ui-gameboard';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { meta } from '../meta';\nimport { type Chess } from '../types';\n\nimport { Chessboard, type ChessboardController, type ChessboardInfoProps } from './Chessboard';\n\nexport const ChessboardArticle = ({ game, role }: { game: Chess.Game; role?: string }) => {\n const { t } = useTranslation(meta.id);\n const [orientation, setOrientation] = useState<Player>('white');\n const [open, setOpen] = useState(true);\n const controller = useRef<ChessboardController>(null);\n\n // TODO(burdon): Keyboard handler.\n const handleSelect = useCallback<NonNullable<ChessboardInfoProps['onSelect']>>((index) => {\n controller.current?.setMoveNumber(index);\n }, []);\n\n return (\n <StackItem.Content toolbar classNames='@container'>\n <Chessboard.Root game={game} ref={controller}>\n <Toolbar.Root>\n <Toolbar.IconButton\n icon='ph--info--regular'\n iconOnly\n label={t('toggle info button')}\n disabled={open}\n classNames={mx('invisible @3xl:visible')}\n onClick={() => setOpen((open) => !open)}\n />\n </Toolbar.Root>\n <div\n className={mx(\n 'grid bs-full is-full gap-2',\n open && '@3xl:grid-cols-[1fr_320px]',\n role === 'section' && 'aspect-square',\n role === 'section' && open && '@3xl:aspect-auto',\n )}\n >\n <Chessboard.Content>\n <Chessboard.Board classNames='m-4 rounded-sm overflow-hidden' orientation={orientation} />\n </Chessboard.Content>\n {open && (\n <div className='hidden @3xl:flex flex-col p-8 justify-center items-center overflow-hidden'>\n <Chessboard.Info\n orientation={orientation}\n min={8}\n max={8}\n onOrientationChange={setOrientation}\n onClose={() => setOpen(false)}\n onSelect={handleSelect}\n />\n </div>\n )}\n </div>\n </Chessboard.Root>\n </StackItem.Content>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;AAIA,OAAOA,YAAW;AAElB,SAASC,gBAAgB;;;;ACFzB,OAAOC,SAASC,aAAaC,QAAQC,gBAAgB;AAErD,SAASC,SAASC,sBAAsB;AAExC,SAASC,iBAAiB;AAC1B,SAASC,UAAU;AAOZ,IAAMC,oBAAoB,CAAC,EAAEC,MAAMC,KAAI,MAAuC;;;AACnF,UAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AACpC,UAAM,CAACC,aAAaC,cAAAA,IAAkBC,SAAiB,OAAA;AACvD,UAAM,CAACC,MAAMC,OAAAA,IAAWF,SAAS,IAAA;AACjC,UAAMG,aAAaC,OAA6B,IAAA;AAGhD,UAAMC,eAAeC,YAA0D,CAACC,UAAAA;AAC9EJ,iBAAWK,SAASC,cAAcF,KAAAA;IACpC,GAAG,CAAA,CAAE;AAEL,WACE,sBAAA,cAACG,UAAUC,SAAO;MAACC,SAAAA;MAAQC,YAAW;OACpC,sBAAA,cAACC,WAAWC,MAAI;MAACvB;MAAYwB,KAAKb;OAChC,sBAAA,cAACc,QAAQF,MAAI,MACX,sBAAA,cAACE,QAAQC,YAAU;MACjBC,MAAK;MACLC,UAAAA;MACAC,OAAO3B,EAAE,oBAAA;MACT4B,UAAUrB;MACVY,YAAYU,GAAG,wBAAA;MACfC,SAAS,MAAMtB,QAAQ,CAACD,UAAS,CAACA,KAAAA;SAGtC,sBAAA,cAACwB,OAAAA;MACCC,WAAWH,GACT,8BACAtB,QAAQ,8BACRR,SAAS,aAAa,iBACtBA,SAAS,aAAaQ,QAAQ,kBAAA;OAGhC,sBAAA,cAACa,WAAWH,SAAO,MACjB,sBAAA,cAACG,WAAWa,OAAK;MAACd,YAAW;MAAiCf;SAE/DG,QACC,sBAAA,cAACwB,OAAAA;MAAIC,WAAU;OACb,sBAAA,cAACZ,WAAWc,MAAI;MACd9B;MACA+B,KAAK;MACLC,KAAK;MACLC,qBAAqBhC;MACrBiC,SAAS,MAAM9B,QAAQ,KAAA;MACvB+B,UAAU5B;;;;;AAQ1B;;;ADjDO,IAAM6B,sBAAsB,CAAC,EAAEC,MAAMC,KAAI,MAA4B;;;AAC1E,UAAMC,QAAQC,SAASH,IAAAA;AACvB,QAAI,CAACE,OAAO;AACV,aAAO;IACT;AAEA,YAAQD,MAAAA;MACN,KAAK;MACL,KAAK;MACL,KAAK,mBAAmB;AACtB,eACE,gBAAAG,OAAA,cAACC,WAAWC,MAAI;UAACN;WACf,gBAAAI,OAAA,cAACC,WAAWE,SAAO;UAACN;WAClB,gBAAAG,OAAA,cAACC,WAAWG,OAAK,IAAA,CAAA,CAAA;MAIzB;MAEA,SAAS;AACP,eAAO,gBAAAJ,OAAA,cAACK,mBAAAA;UAAkBT;UAAYC;;MACxC;IACF;;;;AACF;AAEA,IAAA,8BAAeF;",
|
|
6
|
-
"names": ["React", "getSpace", "React", "useCallback", "useRef", "useState", "Toolbar", "useTranslation", "StackItem", "mx", "ChessboardArticle", "game", "role", "t", "useTranslation", "meta", "id", "orientation", "setOrientation", "useState", "open", "setOpen", "controller", "useRef", "handleSelect", "useCallback", "index", "current", "setMoveNumber", "StackItem", "Content", "toolbar", "classNames", "Chessboard", "Root", "ref", "Toolbar", "IconButton", "icon", "iconOnly", "label", "disabled", "mx", "onClick", "div", "className", "Board", "Info", "min", "max", "onOrientationChange", "onClose", "onSelect", "ChessboardContainer", "game", "role", "space", "getSpace", "React", "Chessboard", "Root", "Content", "Board", "ChessboardArticle"]
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CHESS_BLUEPRINT_KEY,
|
|
3
|
-
blueprint_definition_default
|
|
4
|
-
} from "./chunk-TIIGNOGK.mjs";
|
|
5
|
-
import "./chunk-FBLAVAMY.mjs";
|
|
6
|
-
import "./chunk-DUO4WTAM.mjs";
|
|
7
|
-
export {
|
|
8
|
-
CHESS_BLUEPRINT_KEY,
|
|
9
|
-
blueprint_definition_default as default
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=blueprint-definition-FD4TL5EE.mjs.map
|