@dxos/plugin-chess 0.8.4-main.422d1c7879 → 0.8.4-main.51f1e5ca51
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/dist/lib/browser/blueprints/index.mjs +35 -6
- package/dist/lib/browser/blueprints/index.mjs.map +4 -4
- package/dist/lib/browser/{chunk-JZMN24DY.mjs → chunk-2DFOUJBD.mjs} +4 -4
- package/dist/lib/browser/chunk-2DFOUJBD.mjs.map +7 -0
- package/dist/lib/browser/{chunk-2TJN26DN.mjs → chunk-IN3LZ2OO.mjs} +2 -7
- package/dist/lib/browser/{chunk-2TJN26DN.mjs.map → chunk-IN3LZ2OO.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-XAJZK6Z2.mjs → chunk-OBKYFOJA.mjs} +3 -3
- package/dist/lib/browser/chunk-OBKYFOJA.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +1 -1
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/{create-AJHN4QT4.mjs → create-2ME3FNBX.mjs} +4 -4
- package/dist/lib/browser/create-2ME3FNBX.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +10 -57
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{move-T2NLRBR4.mjs → move-TTMIPD5J.mjs} +5 -5
- package/dist/lib/browser/move-TTMIPD5J.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +3 -3
- package/dist/lib/browser/{play-7VTMD3SJ.mjs → play-GHXPV2T2.mjs} +5 -5
- package/dist/lib/browser/play-GHXPV2T2.mjs.map +7 -0
- package/dist/lib/browser/{print-EW7LPW4D.mjs → print-RNAGAOM7.mjs} +4 -4
- package/dist/lib/browser/{print-EW7LPW4D.mjs.map → print-RNAGAOM7.mjs.map} +1 -1
- package/dist/lib/browser/translations.mjs +38 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/blueprints/index.mjs +35 -6
- package/dist/lib/node-esm/blueprints/index.mjs.map +4 -4
- package/dist/lib/node-esm/{chunk-NYU5JVXP.mjs → chunk-G2EHRXHX.mjs} +3 -3
- package/dist/lib/node-esm/chunk-G2EHRXHX.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OIRJVY2R.mjs → chunk-OHBKSL2Q.mjs} +2 -7
- package/dist/lib/node-esm/{chunk-OIRJVY2R.mjs.map → chunk-OHBKSL2Q.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-LQEDIKCV.mjs → chunk-V4FN2DZR.mjs} +4 -4
- package/dist/lib/node-esm/chunk-V4FN2DZR.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +1 -1
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/{create-QSETDT4N.mjs → create-CC2P7GPT.mjs} +4 -4
- package/dist/lib/node-esm/create-CC2P7GPT.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +10 -57
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{move-5F2ANDTE.mjs → move-CYHXWHHM.mjs} +5 -5
- package/dist/lib/node-esm/move-CYHXWHHM.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +3 -3
- package/dist/lib/node-esm/{play-W4DQCQRX.mjs → play-KTNK2PBL.mjs} +5 -5
- package/dist/lib/node-esm/play-KTNK2PBL.mjs.map +7 -0
- package/dist/lib/node-esm/{print-UJHXAXMS.mjs → print-P23VKVNU.mjs} +4 -4
- package/dist/lib/node-esm/{print-UJHXAXMS.mjs.map → print-P23VKVNU.mjs.map} +1 -1
- package/dist/lib/node-esm/translations.mjs +39 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/ChessPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/chess-blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/chess-blueprint.d.ts.map +1 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +1 -2
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +2 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/Chessboard/Chessboard.d.ts +4 -0
- package/dist/types/src/components/Chessboard/Chessboard.d.ts.map +1 -1
- package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts +40 -23
- package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts.map +1 -1
- package/dist/types/src/components/Chessboard/Info.d.ts +4 -5
- package/dist/types/src/components/Chessboard/Info.d.ts.map +1 -1
- package/dist/types/src/components/Chessboard/types.d.ts.map +1 -1
- package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts.map +1 -1
- package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts +40 -23
- package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ChessCard/ChessCard.d.ts.map +1 -1
- package/dist/types/src/containers/ChessCard/ChessCard.stories.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/create.d.ts +1 -1
- package/dist/types/src/operations/create.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +2 -2
- package/dist/types/src/operations/definitions.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/move.d.ts +1 -1
- package/dist/types/src/operations/move.d.ts.map +1 -1
- package/dist/types/src/operations/play.d.ts +1 -1
- package/dist/types/src/operations/play.d.ts.map +1 -1
- package/dist/types/src/operations/print.d.ts +1 -1
- package/dist/types/src/operations/print.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +40 -24
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Chess.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +40 -35
- package/src/ChessPlugin.tsx +2 -3
- package/src/blueprints/chess-blueprint.ts +2 -3
- package/src/capabilities/artifact-definition.ts +2 -2
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/cli/plugin.ts +1 -1
- package/src/components/Chessboard/Chessboard.stories.tsx +1 -1
- package/src/components/Chessboard/Info.tsx +2 -2
- package/src/containers/ChessArticle/ChessArticle.stories.tsx +1 -1
- package/src/index.ts +0 -2
- package/src/operations/create.ts +1 -1
- package/src/operations/definitions.ts +1 -1
- package/src/operations/index.ts +1 -1
- package/src/operations/move.ts +2 -2
- package/src/operations/play.ts +2 -2
- package/src/operations/print.ts +1 -1
- package/dist/lib/browser/chunk-JZMN24DY.mjs.map +0 -7
- package/dist/lib/browser/chunk-MC7L6JNC.mjs +0 -36
- package/dist/lib/browser/chunk-MC7L6JNC.mjs.map +0 -7
- package/dist/lib/browser/chunk-XAJZK6Z2.mjs.map +0 -7
- package/dist/lib/browser/create-AJHN4QT4.mjs.map +0 -7
- package/dist/lib/browser/move-T2NLRBR4.mjs.map +0 -7
- package/dist/lib/browser/play-7VTMD3SJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4HZWCKMR.mjs +0 -38
- package/dist/lib/node-esm/chunk-4HZWCKMR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LQEDIKCV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NYU5JVXP.mjs.map +0 -7
- package/dist/lib/node-esm/create-QSETDT4N.mjs.map +0 -7
- package/dist/lib/node-esm/move-5F2ANDTE.mjs.map +0 -7
- package/dist/lib/node-esm/play-W4DQCQRX.mjs.map +0 -7
|
@@ -1,12 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
chess_blueprint_default
|
|
3
|
-
} from "../chunk-MC7L6JNC.mjs";
|
|
4
1
|
import {
|
|
5
2
|
operations_exports
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-2DFOUJBD.mjs";
|
|
4
|
+
import "../chunk-OBKYFOJA.mjs";
|
|
5
|
+
import "../chunk-IN3LZ2OO.mjs";
|
|
9
6
|
import "../chunk-J5LGTIGS.mjs";
|
|
7
|
+
|
|
8
|
+
// src/blueprints/chess-blueprint.ts
|
|
9
|
+
import { Blueprint, Template } from "@dxos/compute";
|
|
10
|
+
import { trim } from "@dxos/util";
|
|
11
|
+
import { Create, Move, Play, Print } from "#operations";
|
|
12
|
+
var BLUEPRINT_KEY = "org.dxos.blueprint.chess";
|
|
13
|
+
var operations = [
|
|
14
|
+
Create,
|
|
15
|
+
Move,
|
|
16
|
+
Play,
|
|
17
|
+
Print
|
|
18
|
+
];
|
|
19
|
+
var make = () => Blueprint.make({
|
|
20
|
+
key: BLUEPRINT_KEY,
|
|
21
|
+
name: "Chess",
|
|
22
|
+
tools: Blueprint.toolDefinitions({
|
|
23
|
+
operations
|
|
24
|
+
}),
|
|
25
|
+
instructions: Template.make({
|
|
26
|
+
source: trim`
|
|
27
|
+
You are an expert chess player.
|
|
28
|
+
To analyze a game you can access the "pgn" property by loading the context object that represents the current game.
|
|
29
|
+
You could suggest a good next move or offer to play a move.
|
|
30
|
+
Don't actually make a move unless you are asked to.
|
|
31
|
+
`
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
var blueprint = {
|
|
35
|
+
key: BLUEPRINT_KEY,
|
|
36
|
+
make
|
|
37
|
+
};
|
|
38
|
+
var chess_blueprint_default = blueprint;
|
|
10
39
|
export {
|
|
11
40
|
chess_blueprint_default as ChessBlueprint,
|
|
12
41
|
operations_exports as ChessFunctions
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [],
|
|
4
|
-
"sourcesContent": [],
|
|
5
|
-
"mappings": "",
|
|
6
|
-
"names": []
|
|
3
|
+
"sources": ["../../../../src/blueprints/chess-blueprint.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Blueprint, Template } from '@dxos/compute';\nimport { trim } from '@dxos/util';\n\nimport { Create, Move, Play, Print } from '#operations';\n\nconst BLUEPRINT_KEY = 'org.dxos.blueprint.chess';\n\nconst operations = [Create, Move, Play, Print];\n\nconst make = () =>\n Blueprint.make({\n key: BLUEPRINT_KEY,\n name: 'Chess',\n tools: Blueprint.toolDefinitions({ operations }),\n instructions: Template.make({\n source: trim`\n You are an expert chess player.\n To analyze a game you can access the \"pgn\" property by loading the context object that represents the current game.\n You could suggest a good next move or offer to play a move.\n Don't actually make a move unless you are asked to.\n `,\n }),\n });\n\nconst blueprint: Blueprint.Definition = {\n key: BLUEPRINT_KEY,\n make,\n};\n\nexport default blueprint;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,SAASA,WAAWC,gBAAgB;AACpC,SAASC,YAAY;AAErB,SAASC,QAAQC,MAAMC,MAAMC,aAAa;AAE1C,IAAMC,gBAAgB;AAEtB,IAAMC,aAAa;EAACL;EAAQC;EAAMC;EAAMC;;AAExC,IAAMG,OAAO,MACXT,UAAUS,KAAK;EACbC,KAAKH;EACLI,MAAM;EACNC,OAAOZ,UAAUa,gBAAgB;IAAEL;EAAW,CAAA;EAC9CM,cAAcb,SAASQ,KAAK;IAC1BM,QAAQb;;;;;;EAMV,CAAA;AACF,CAAA;AAEF,IAAMc,YAAkC;EACtCN,KAAKH;EACLE;AACF;AAEA,IAAA,0BAAeO;",
|
|
6
|
+
"names": ["Blueprint", "Template", "trim", "Create", "Move", "Play", "Print", "BLUEPRINT_KEY", "operations", "make", "key", "name", "tools", "toolDefinitions", "instructions", "source", "blueprint"]
|
|
7
7
|
}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
Move,
|
|
4
4
|
Play,
|
|
5
5
|
Print
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OBKYFOJA.mjs";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
9
|
} from "./chunk-J5LGTIGS.mjs";
|
|
@@ -17,12 +17,12 @@ __export(operations_exports, {
|
|
|
17
17
|
Play: () => Play,
|
|
18
18
|
Print: () => Print
|
|
19
19
|
});
|
|
20
|
-
import { OperationHandlerSet } from "@dxos/
|
|
21
|
-
var Handlers = OperationHandlerSet.lazy(() => import("./create-
|
|
20
|
+
import { OperationHandlerSet } from "@dxos/compute";
|
|
21
|
+
var Handlers = OperationHandlerSet.lazy(() => import("./create-2ME3FNBX.mjs"), () => import("./move-TTMIPD5J.mjs"), () => import("./play-GHXPV2T2.mjs"), () => import("./print-RNAGAOM7.mjs"));
|
|
22
22
|
var ChessHandlers = Handlers;
|
|
23
23
|
|
|
24
24
|
export {
|
|
25
25
|
ChessHandlers,
|
|
26
26
|
operations_exports
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
28
|
+
//# sourceMappingURL=chunk-2DFOUJBD.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { OperationHandlerSet } from '@dxos/compute';\n\nconst Handlers = OperationHandlerSet.lazy(\n () => import('./create'),\n () => import('./move'),\n () => import('./play'),\n () => import('./print'),\n);\n\nexport { Create, Move, Play, Print } from './definitions';\n\nexport const ChessHandlers = Handlers;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAAA;;;;;;;;AAIA,SAASA,2BAA2B;AAEpC,IAAMC,WAAWD,oBAAoBE,KACnC,MAAM,OAAO,uBAAA,GACb,MAAM,OAAO,qBAAA,GACb,MAAM,OAAO,qBAAA,GACb,MAAM,OAAO,sBAAA,CAAA;AAKR,IAAMC,gBAAgBF;",
|
|
6
|
+
"names": ["OperationHandlerSet", "Handlers", "lazy", "ChessHandlers"]
|
|
7
|
+
}
|
|
@@ -45,12 +45,7 @@ var make = ({ name, pgn, fen } = {}) => {
|
|
|
45
45
|
try {
|
|
46
46
|
chess.loadPgn(pgn);
|
|
47
47
|
} catch {
|
|
48
|
-
log.warn(pgn, void 0, {
|
|
49
|
-
F: __dxlog_file,
|
|
50
|
-
L: 52,
|
|
51
|
-
S: void 0,
|
|
52
|
-
C: (f, a) => f(...a)
|
|
53
|
-
});
|
|
48
|
+
log.warn(pgn, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 40, S: void 0 });
|
|
54
49
|
}
|
|
55
50
|
}
|
|
56
51
|
return Obj.make(Game, {
|
|
@@ -64,4 +59,4 @@ var make = ({ name, pgn, fen } = {}) => {
|
|
|
64
59
|
export {
|
|
65
60
|
Chess_exports
|
|
66
61
|
};
|
|
67
|
-
//# sourceMappingURL=chunk-
|
|
62
|
+
//# sourceMappingURL=chunk-IN3LZ2OO.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/types/Chess.ts"],
|
|
4
4
|
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Chess as ChessJS } from 'chess.js';\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, Obj, Type } from '@dxos/echo';\nimport { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';\nimport { log } from '@dxos/log';\n\nexport const Game = Schema.Struct({\n name: Schema.optional(Schema.String),\n players: Schema.Struct({\n white: Schema.optional(\n Schema.String.annotations({\n description: 'DID of white player',\n }),\n ),\n black: Schema.optional(\n Schema.String.annotations({\n description: 'DID of black player',\n }),\n ),\n }).pipe(FormInputAnnotation.set(false), Schema.optional),\n pgn: Schema.String.annotations({\n description: 'Portable Game Notation.',\n }).pipe(FormInputAnnotation.set(false), Schema.optional),\n fen: Schema.String.annotations({\n description: 'Forsyth-Edwards Notation.',\n }).pipe(FormInputAnnotation.set(false), Schema.optional),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.chess',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({\n icon: 'ph--shield-chevron--regular',\n hue: 'amber',\n }),\n);\n\nexport interface Game extends Schema.Schema.Type<typeof Game> {}\n\nexport const make = ({ name, pgn, fen }: { name?: string; pgn?: string; fen?: string } = {}) => {\n const chess = new ChessJS();\n if (pgn) {\n try {\n chess.loadPgn(pgn);\n } catch {\n log.warn(pgn);\n }\n }\n\n return Obj.make(Game, {\n name,\n pgn,\n fen,\n players: {},\n });\n};\n"],
|
|
5
|
-
"mappings": ";;;;;AAAA;;;;;AAIA,SAASA,SAASC,eAAe;AACjC,YAAYC,YAAY;AAExB,SAASC,YAAYC,KAAKC,YAAY;AACtC,SAASC,qBAAqBC,uBAAuB;AACrD,SAASC,WAAW
|
|
6
|
-
"names": ["Chess", "ChessJS", "Schema", "Annotation", "Obj", "Type", "FormInputAnnotation", "LabelAnnotation", "log", "Game", "
|
|
5
|
+
"mappings": ";;;;;AAAA;;;;;AAIA,SAASA,SAASC,eAAe;AACjC,YAAYC,YAAY;AAExB,SAASC,YAAYC,KAAKC,YAAY;AACtC,SAASC,qBAAqBC,uBAAuB;AACrD,SAASC,WAAW;AAEpB,IAAA,eAAaC;AAEXC,IAASR,OAAc,cAAA;QACdA,gBACLA,aAAOS;WACLC,cAAa;IACf,OAAA,gBAAA,cAAA,YAAA;MAEFC,aAAcC;;IAGZ,OAAA,gBAAA,cAAA,YAAA;MAEIR,aAAAA;IACRS,CAAKb,CAAAA;UACHU,oBAAa,IAAA,KAAA,GAAA,eAAA;EACf,KAAQN,cAAAA,YAAuB;IAC/BU,aAAYL;UACVC,oBAAa,IAAA,KAAA,GAAA,eAAA;EACf,KAAQN,cAAAA,YAAuB;IAE/BD,aAAY;EACVY,CAAAA,EAAAA,KAAAA,oBAAU,IAAA,KAAA,GAAA,eAAA;QACVC,KAAS,OAAA;EAEXX,UAAAA;EAAqB,SAAA;CAAO,GAC5BJ,gBAAWgB,IAAAA;EACTC;IACAC,WAAK,eAAA,IAAA;EAEP,MAAA;EAIF,KAAO;;AAEL,IAAS,OAAA,CAAA,EAAA,MAAA,KAAA,IAAA,IAAA,CAAA,MAAA;QACP,QAAI,IAAA,QAAA;WACFC;AACF,QAAE;AACAd,YAAIe,QAAKR,GAAAA;IACX,QAAA;AACF,UAAA,KAAA,KAAA,QAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,OAAA,CAAA;IAEA;;SAEEA,IAAAA,KAAAA,MAAAA;IACAC;IACAN;IACF;IACA,SAAA,CAAA;;;",
|
|
6
|
+
"names": ["Chess", "ChessJS", "Schema", "Annotation", "Obj", "Type", "FormInputAnnotation", "LabelAnnotation", "log", "Game", "players", "String", "description", "black", "optional", "pgn", "fen", "typename", "version", "IconAnnotation", "icon", "hue", "chess", "warn"]
|
|
7
7
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Chess_exports
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IN3LZ2OO.mjs";
|
|
4
4
|
|
|
5
5
|
// src/operations/definitions.ts
|
|
6
6
|
import * as Schema from "effect/Schema";
|
|
7
|
+
import { Operation } from "@dxos/compute";
|
|
7
8
|
import { Database, Ref } from "@dxos/echo";
|
|
8
|
-
import { Operation } from "@dxos/operation";
|
|
9
9
|
var Create = Operation.make({
|
|
10
10
|
meta: {
|
|
11
11
|
key: "org.dxos.function.chess.create",
|
|
@@ -107,4 +107,4 @@ export {
|
|
|
107
107
|
Play,
|
|
108
108
|
Print
|
|
109
109
|
};
|
|
110
|
-
//# sourceMappingURL=chunk-
|
|
110
|
+
//# sourceMappingURL=chunk-OBKYFOJA.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/definitions.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Operation } from '@dxos/compute';\nimport { Database, Ref } from '@dxos/echo';\n\nimport { Chess } from '../types';\n\nexport const Create = Operation.make({\n meta: {\n key: 'org.dxos.function.chess.create',\n name: 'Create Chess',\n description: 'Creates a new chess game.',\n },\n input: Schema.Struct({\n name: Schema.optional(\n Schema.String.annotations({\n description: 'Name of the game.',\n }),\n ),\n pgn: Schema.optional(\n Schema.String.annotations({\n description: 'Portable Game Notation.',\n }),\n ),\n fen: Schema.optional(\n Schema.String.annotations({\n description: 'Forsyth-Edwards Notation.',\n }),\n ),\n }),\n output: Chess.Game,\n services: [Database.Service],\n});\n\nexport const Move = Operation.make({\n meta: {\n key: 'org.dxos.function.chess.move',\n name: 'Move',\n description: 'Makes a move in the given chess game.',\n },\n input: Schema.Struct({\n game: Ref.Ref(Chess.Game).annotations({\n description: 'The ID of the chess object.',\n }),\n move: Schema.String.annotations({\n description: 'The move to make in the chess game.',\n examples: ['e4', 'Bf3'],\n }),\n }),\n output: Schema.Struct({\n pgn: Schema.String.annotations({\n description: 'The PGN of the game after the move was played.',\n }),\n }),\n services: [Database.Service],\n});\n\nexport const Play = Operation.make({\n meta: {\n key: 'org.dxos.function.chess.play',\n name: 'Play',\n description: 'Uses the chess engine to play the next move.',\n },\n input: Schema.Struct({\n game: Ref.Ref(Chess.Game).annotations({\n description: 'The ID of the chess object.',\n }),\n side: Schema.optional(Schema.Literal('white', 'black', 'any')).annotations({\n description: 'The side to play.',\n defaultValue: 'any',\n }),\n }),\n output: Schema.Struct({\n pgn: Schema.String.annotations({\n description: 'The PGN of the game after the move was played.',\n }),\n move: Schema.optional(Schema.String).annotations({\n description: 'The move that was played.',\n }),\n }),\n services: [Database.Service],\n});\n\nexport const Print = Operation.make({\n meta: {\n key: 'org.dxos.function.chess.print',\n name: 'Print game',\n description: 'Prints the chess game to ASCII.',\n },\n input: Schema.Struct({\n pgn: Schema.optional(\n Schema.String.annotations({\n description: 'Portable Game Notation.',\n }),\n ),\n fen: Schema.optional(\n Schema.String.annotations({\n description: 'Forsyth-Edwards Notation.',\n }),\n ),\n }),\n output: Schema.Struct({\n ascii: Schema.String,\n }),\n});\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,UAAUC,WAAW;AAIvB,IAAMC,SAASC,UAAUC,KAAK;EACnCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBH,MAAaI,gBACJC,cAAOC,YAAY;MACxBL,aAAa;IACf,CAAA,CAAA;IAEFM,KAAYH,gBACHC,cAAOC,YAAY;MACxBL,aAAa;IACf,CAAA,CAAA;IAEFO,KAAYJ,gBACHC,cAAOC,YAAY;MACxBL,aAAa;IACf,CAAA,CAAA;EAEJ,CAAA;EACAQ,QAAQC,cAAMC;EACdC,UAAU;IAACC,SAASC;;AACtB,CAAA;AAEO,IAAMC,OAAOnB,UAAUC,KAAK;EACjCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBa,MAAMC,IAAIA,IAAIP,cAAMC,IAAI,EAAEL,YAAY;MACpCL,aAAa;IACf,CAAA;IACAiB,MAAab,cAAOC,YAAY;MAC9BL,aAAa;MACbkB,UAAU;QAAC;QAAM;;IACnB,CAAA;EACF,CAAA;EACAV,QAAeN,cAAO;IACpBI,KAAYF,cAAOC,YAAY;MAC7BL,aAAa;IACf,CAAA;EACF,CAAA;EACAW,UAAU;IAACC,SAASC;;AACtB,CAAA;AAEO,IAAMM,OAAOxB,UAAUC,KAAK;EACjCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBa,MAAMC,IAAIA,IAAIP,cAAMC,IAAI,EAAEL,YAAY;MACpCL,aAAa;IACf,CAAA;IACAoB,MAAajB,gBAAgBkB,eAAQ,SAAS,SAAS,KAAA,CAAA,EAAQhB,YAAY;MACzEL,aAAa;MACbsB,cAAc;IAChB,CAAA;EACF,CAAA;EACAd,QAAeN,cAAO;IACpBI,KAAYF,cAAOC,YAAY;MAC7BL,aAAa;IACf,CAAA;IACAiB,MAAad,gBAAgBC,aAAM,EAAEC,YAAY;MAC/CL,aAAa;IACf,CAAA;EACF,CAAA;EACAW,UAAU;IAACC,SAASC;;AACtB,CAAA;AAEO,IAAMU,QAAQ5B,UAAUC,KAAK;EAClCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBI,KAAYH,gBACHC,cAAOC,YAAY;MACxBL,aAAa;IACf,CAAA,CAAA;IAEFO,KAAYJ,gBACHC,cAAOC,YAAY;MACxBL,aAAa;IACf,CAAA,CAAA;EAEJ,CAAA;EACAQ,QAAeN,cAAO;IACpBsB,OAAcpB;EAChB,CAAA;AACF,CAAA;",
|
|
6
|
+
"names": ["Schema", "Operation", "Database", "Ref", "Create", "Operation", "make", "meta", "key", "name", "description", "input", "Struct", "optional", "String", "annotations", "pgn", "fen", "output", "Chess", "Game", "services", "Database", "Service", "Move", "game", "Ref", "move", "examples", "Play", "side", "Literal", "defaultValue", "Print", "ascii"]
|
|
7
|
+
}
|
|
@@ -4,7 +4,7 @@ import "../chunk-J5LGTIGS.mjs";
|
|
|
4
4
|
import * as Effect from "effect/Effect";
|
|
5
5
|
import { Plugin } from "@dxos/app-framework";
|
|
6
6
|
import { AppPlugin } from "@dxos/app-toolkit";
|
|
7
|
-
import { Operation } from "@dxos/
|
|
7
|
+
import { Operation } from "@dxos/compute";
|
|
8
8
|
import { SpaceOperation } from "@dxos/plugin-space/operations";
|
|
9
9
|
import { meta } from "#meta";
|
|
10
10
|
import { Chess } from "#types";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/plugin.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/
|
|
5
|
-
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAc;AACvB,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,sBAAsB;AAG/B,SAASC,YAAY;AACrB,SAASC,aAAa;AAGf,IAAMC,
|
|
6
|
-
"names": ["Effect", "Plugin", "AppPlugin", "Operation", "SpaceOperation", "meta", "Chess", "ChessPlugin", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\nimport { SpaceOperation } from '@dxos/plugin-space/operations';\nimport { type CreateObject } from '@dxos/plugin-space/types';\n\nimport { meta } from '#meta';\nimport { Chess } from '#types';\n\n// TODO(wittjosiah): Factor out shared modules.\nexport const ChessPlugin = Plugin.define(meta).pipe(\n AppPlugin.addMetadataModule({\n metadata: {\n id: Chess.Game.typename,\n metadata: {\n createObject: ((props, options) =>\n Effect.gen(function* () {\n const object = Chess.make(props);\n return yield* Operation.invoke(SpaceOperation.AddObject, {\n object,\n target: options.target,\n hidden: true,\n targetNodeId: options.targetNodeId,\n });\n })) satisfies CreateObject,\n },\n },\n }),\n AppPlugin.addSchemaModule({ schema: [Chess.Game] }),\n Plugin.make,\n);\n"],
|
|
5
|
+
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAc;AACvB,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,sBAAsB;AAG/B,SAASC,YAAY;AACrB,SAASC,aAAa;AAGf,IAAMC,cAAcN,OAAOO,OAAOH,IAAAA,EAAMI,KAC7CP,UAAUQ,kBAAkB;EAC1BC,UAAU;IACRC,IAAIN,MAAMO,KAAKC;IACfH,UAAU;MACRI,cAAe,CAACC,OAAOC,YACdC,WAAI,aAAA;AACT,cAAMC,SAASb,MAAMc,KAAKJ,KAAAA;AAC1B,eAAO,OAAOb,UAAUkB,OAAOjB,eAAekB,WAAW;UACvDH;UACAI,QAAQN,QAAQM;UAChBC,QAAQ;UACRC,cAAcR,QAAQQ;QACxB,CAAA;MACF,CAAA;IACJ;EACF;AACF,CAAA,GACAvB,UAAUwB,gBAAgB;EAAEC,QAAQ;IAACrB,MAAMO;;AAAM,CAAA,GACjDZ,OAAOmB,IAAI;",
|
|
6
|
+
"names": ["Effect", "Plugin", "AppPlugin", "Operation", "SpaceOperation", "meta", "Chess", "ChessPlugin", "define", "pipe", "addMetadataModule", "metadata", "id", "Game", "typename", "createObject", "props", "options", "gen", "object", "make", "invoke", "AddObject", "target", "hidden", "targetNodeId", "addSchemaModule", "schema"]
|
|
7
7
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Create
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OBKYFOJA.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Chess_exports
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-IN3LZ2OO.mjs";
|
|
7
7
|
import "./chunk-J5LGTIGS.mjs";
|
|
8
8
|
|
|
9
9
|
// src/operations/create.ts
|
|
10
10
|
import * as Effect from "effect/Effect";
|
|
11
|
+
import { Operation } from "@dxos/compute";
|
|
11
12
|
import { Database } from "@dxos/echo";
|
|
12
|
-
import { Operation } from "@dxos/operation";
|
|
13
13
|
var handler = Create.pipe(Operation.withHandler(Effect.fn(function* ({ name, pgn, fen }) {
|
|
14
14
|
return yield* Database.add(Chess_exports.make({
|
|
15
15
|
name,
|
|
@@ -21,4 +21,4 @@ var create_default = handler;
|
|
|
21
21
|
export {
|
|
22
22
|
create_default as default
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=create-
|
|
24
|
+
//# sourceMappingURL=create-2ME3FNBX.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/create.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Operation } from '@dxos/compute';\nimport { Database } from '@dxos/echo';\n\nimport { Chess } from '../types';\nimport { Create } from './definitions';\n\nconst handler: Operation.WithHandler<typeof Create> = Create.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ name, pgn, fen }) {\n return yield* Database.add(Chess.make({ name, pgn, fen }));\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,gBAAgB;AAKzB,IAAMC,UAAgDC,OAAOC,KAC3DC,UAAUC,YACDC,UAAG,WAAW,EAAEC,MAAMC,KAAKC,IAAG,GAAE;AACrC,SAAO,OAAOC,SAASC,IAAIC,cAAMC,KAAK;IAAEN;IAAMC;IAAKC;EAAI,CAAA,CAAA;AACzD,CAAA,CAAA,CAAA;AAIJ,IAAA,iBAAeR;",
|
|
6
|
+
"names": ["Effect", "Operation", "Database", "handler", "Create", "pipe", "Operation", "withHandler", "fn", "name", "pgn", "fen", "Database", "add", "Chess", "make"]
|
|
7
|
+
}
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
chess_blueprint_default
|
|
3
|
-
} from "./chunk-MC7L6JNC.mjs";
|
|
4
|
-
import {
|
|
5
|
-
operations_exports
|
|
6
|
-
} from "./chunk-JZMN24DY.mjs";
|
|
7
|
-
import "./chunk-XAJZK6Z2.mjs";
|
|
8
|
-
import {
|
|
9
|
-
Chess_exports
|
|
10
|
-
} from "./chunk-2TJN26DN.mjs";
|
|
11
1
|
import "./chunk-J5LGTIGS.mjs";
|
|
12
2
|
|
|
13
3
|
// src/components/Chessboard/Chessboard.tsx
|
|
@@ -50,7 +40,7 @@ var Info = ({ classNames, orientation = "white", onOrientationChange, onClose, .
|
|
|
50
40
|
}, /* @__PURE__ */ React.createElement(PlayerSelector, {
|
|
51
41
|
value: model.object.players?.[orientation === "white" ? "black" : "white"],
|
|
52
42
|
onValueChange: (value) => {
|
|
53
|
-
Obj.
|
|
43
|
+
Obj.update(model.object, (obj) => {
|
|
54
44
|
obj.players[orientation === "white" ? "black" : "white"] = value;
|
|
55
45
|
});
|
|
56
46
|
},
|
|
@@ -72,7 +62,7 @@ var Info = ({ classNames, orientation = "white", onOrientationChange, onClose, .
|
|
|
72
62
|
}, /* @__PURE__ */ React.createElement(PlayerSelector, {
|
|
73
63
|
value: model.object.players?.[orientation],
|
|
74
64
|
onValueChange: (value) => {
|
|
75
|
-
Obj.
|
|
65
|
+
Obj.update(model.object, (obj) => {
|
|
76
66
|
obj.players[orientation] = value;
|
|
77
67
|
});
|
|
78
68
|
},
|
|
@@ -303,63 +293,29 @@ import * as Effect from "effect/Effect";
|
|
|
303
293
|
import * as Option from "effect/Option";
|
|
304
294
|
import { Plugin } from "@dxos/app-framework";
|
|
305
295
|
import { AppPlugin } from "@dxos/app-toolkit";
|
|
296
|
+
import { Operation } from "@dxos/compute";
|
|
306
297
|
import { Annotation } from "@dxos/echo";
|
|
307
|
-
import { Operation } from "@dxos/operation";
|
|
308
298
|
import { SpaceOperation } from "@dxos/plugin-space/operations";
|
|
309
299
|
import { ChessBlueprint } from "#blueprints";
|
|
310
300
|
import { BlueprintDefinition, OperationHandler, ReactSurface } from "#capabilities";
|
|
311
|
-
import { meta as meta4 } from "#meta";
|
|
312
|
-
import { Chess as Chess2 } from "#types";
|
|
313
|
-
|
|
314
|
-
// src/translations.ts
|
|
315
301
|
import { meta as meta3 } from "#meta";
|
|
302
|
+
import { translations } from "#translations";
|
|
316
303
|
import { Chess } from "#types";
|
|
317
|
-
var
|
|
318
|
-
{
|
|
319
|
-
"en-US": {
|
|
320
|
-
[Chess.Game.typename]: {
|
|
321
|
-
"typename.label": "Game",
|
|
322
|
-
"typename.label_zero": "Games",
|
|
323
|
-
"typename.label_one": "Game",
|
|
324
|
-
"typename.label_other": "Games",
|
|
325
|
-
"object-name.placeholder": "New game",
|
|
326
|
-
"add-object.label": "Add game",
|
|
327
|
-
"rename-object.label": "Rename game",
|
|
328
|
-
"delete-object.label": "Delete game",
|
|
329
|
-
"object-deleted.label": "Game deleted"
|
|
330
|
-
},
|
|
331
|
-
[meta3.id]: {
|
|
332
|
-
"plugin.name": "Chess",
|
|
333
|
-
"delete-game.label": "Delete",
|
|
334
|
-
"game.checkmate.label": "Checkmate",
|
|
335
|
-
"game.stalemate.label": "Stalemate",
|
|
336
|
-
"game.draw.label": "Draw",
|
|
337
|
-
"game.check.label": "Check",
|
|
338
|
-
"select-player.button": "Select player",
|
|
339
|
-
"toggle-info.button": "Toggle info",
|
|
340
|
-
"close-info.button": "Close info",
|
|
341
|
-
"flip-board.button": "Flip board"
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
];
|
|
346
|
-
|
|
347
|
-
// src/ChessPlugin.tsx
|
|
348
|
-
var ChessPlugin = Plugin.define(meta4).pipe(AppPlugin.addBlueprintDefinitionModule({
|
|
304
|
+
var ChessPlugin = Plugin.define(meta3).pipe(AppPlugin.addBlueprintDefinitionModule({
|
|
349
305
|
activate: BlueprintDefinition
|
|
350
306
|
}), AppPlugin.addOperationHandlerModule({
|
|
351
307
|
activate: OperationHandler
|
|
352
308
|
}), AppPlugin.addMetadataModule({
|
|
353
309
|
metadata: {
|
|
354
|
-
id:
|
|
310
|
+
id: Chess.Game.typename,
|
|
355
311
|
metadata: {
|
|
356
|
-
icon: Annotation.IconAnnotation.get(
|
|
357
|
-
iconHue: Annotation.IconAnnotation.get(
|
|
312
|
+
icon: Annotation.IconAnnotation.get(Chess.Game).pipe(Option.getOrThrow).icon,
|
|
313
|
+
iconHue: Annotation.IconAnnotation.get(Chess.Game).pipe(Option.getOrThrow).hue ?? "white",
|
|
358
314
|
blueprints: [
|
|
359
315
|
ChessBlueprint.key
|
|
360
316
|
],
|
|
361
317
|
createObject: (props, options) => Effect.gen(function* () {
|
|
362
|
-
const object =
|
|
318
|
+
const object = Chess.make(props);
|
|
363
319
|
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
364
320
|
object,
|
|
365
321
|
target: options.target,
|
|
@@ -371,7 +327,7 @@ var ChessPlugin = Plugin.define(meta4).pipe(AppPlugin.addBlueprintDefinitionModu
|
|
|
371
327
|
}
|
|
372
328
|
}), AppPlugin.addSchemaModule({
|
|
373
329
|
schema: [
|
|
374
|
-
|
|
330
|
+
Chess.Game
|
|
375
331
|
]
|
|
376
332
|
}), AppPlugin.addSurfaceModule({
|
|
377
333
|
activate: ReactSurface
|
|
@@ -379,9 +335,6 @@ var ChessPlugin = Plugin.define(meta4).pipe(AppPlugin.addBlueprintDefinitionModu
|
|
|
379
335
|
translations
|
|
380
336
|
}), Plugin.make);
|
|
381
337
|
export {
|
|
382
|
-
Chess_exports as Chess,
|
|
383
|
-
chess_blueprint_default as ChessBlueprint,
|
|
384
|
-
operations_exports as ChessFunctions,
|
|
385
338
|
ChessPlugin,
|
|
386
339
|
Chessboard,
|
|
387
340
|
meta2 as meta
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/Chessboard/Chessboard.tsx", "../../../src/components/Chessboard/Info.tsx", "../../../src/components/Chessboard/types.ts", "../../../src/meta.ts", "../../../src/ChessPlugin.tsx"
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { RegistryContext } from '@effect-atom/atom-react';\nimport React, {\n type PropsWithChildren,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n} from 'react';\n\nimport { addEventListener } from '@dxos/async';\nimport { useObject } from '@dxos/echo-react';\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport {\n type ChessModel,\n Gameboard,\n type GameboardRootProps,\n Chessboard as NaturalChessboard,\n type ChessboardProps as NaturalChessboardProps,\n getRawPgn,\n useGameboardContext,\n} from '@dxos/react-ui-gameboard';\nimport { useSoundEffect } from '@dxos/react-ui-sfx';\n\nimport { type Chess } from '#types';\n\nimport { Info, type InfoProps } from './Info';\nimport { ExtendedChessModel } from './types';\n\nexport interface ChessboardController {\n setMoveNumber(index: number): void;\n}\n\n//\n// Root\n//\n\ntype RootProps = PropsWithChildren<{\n game: Chess.Game;\n}>;\n\nconst Root = forwardRef<ChessboardController, RootProps>(({ game, children }, forwardedRef) => {\n const registry = useContext(RegistryContext);\n const model = useMemo(() => new ExtendedChessModel(registry, game), [registry]);\n const click = useSoundEffect('Click');\n const [pgn, updatePgn] = useObject(game, 'pgn');\n\n // Controller.\n useImperativeHandle(forwardedRef, () => {\n return {\n setMoveNumber: (index) => model.setMoveIndex(index),\n };\n }, [model]);\n\n // TODO(wittjosiah): Rather than useEffect to sync ECHO object to model, create an alternative model implementation.\n // This model would take the ECHO object and derive game state directly from that.\n // Mutation methods would mutate the ECHO object and other state would be derived from that.\n\n // External change.\n // NOTE: Warning if user has not interacted with the board.\n useEffect(() => {\n if (model.pgn !== getRawPgn(pgn ?? '')) {\n const silent = model.pgn === '*';\n model.update(pgn);\n if (!silent) {\n void click.play();\n }\n }\n }, [pgn]);\n\n // Move.\n const handleDrop = useCallback<NonNullable<GameboardRootProps<ChessModel>['onDrop']>>(\n (move) => {\n if (!model.makeMove(move)) {\n return false;\n }\n\n void click.play();\n updatePgn(() => model.pgn);\n return true;\n },\n [model],\n );\n\n return (\n <Gameboard.Root model={model} onDrop={handleDrop}>\n {children}\n </Gameboard.Root>\n );\n});\n\n//\n// Content\n//\n\ntype Role = 'card--content';\n\ntype ContentProps = ThemedClassName<PropsWithChildren<{ role?: Role }>>;\n\nconst Content = ({ classNames, children }: ContentProps) => {\n return (\n <Gameboard.Content grow contain classNames={classNames}>\n {children}\n </Gameboard.Content>\n );\n};\n\n//\n// Board\n//\n\nconst BOARD_NAME = 'Chessboard.Board';\n\ntype BoardProps = NaturalChessboardProps;\n\nconst Board = (props: BoardProps) => {\n const registry = useContext(RegistryContext);\n const { model } = useGameboardContext<ChessModel>(BOARD_NAME);\n\n // Keyboard navigation.\n const ref = useRef<HTMLDivElement>(null);\n useEffect(() => {\n if (!ref.current) {\n return;\n }\n\n // Participate in keyboard navigation (set tabIndex={0})\n ref.current.setAttribute('data-arrow-keys', 'all');\n\n return addEventListener(ref.current, 'keydown', (ev) => {\n const moveIndex = registry.get(model.moveIndex);\n switch (ev.key) {\n case 'ArrowUp':\n model.setMoveIndex(0);\n break;\n case 'ArrowDown':\n model.setMoveIndex(model.game.history().length);\n break;\n case 'ArrowLeft':\n if (moveIndex > 0) {\n model.setMoveIndex(moveIndex - 1);\n }\n break;\n case 'ArrowRight':\n if (moveIndex < model.game.history().length) {\n model.setMoveIndex(moveIndex + 1);\n }\n break;\n }\n });\n }, [registry, model]);\n\n return <NaturalChessboard {...props} ref={ref} />;\n};\n\nBoard.displayName = BOARD_NAME;\n\n//\n// Chessboard\n//\n\nexport const Chessboard = {\n Root: Root,\n Content: Content,\n Board: Board,\n Info: Info,\n};\n\nexport type {\n RootProps as ChessboardRootProps,\n ContentProps as ChessboardContentProps,\n BoardProps as ChessboardBoardProps,\n InfoProps as ChessboardInfoProps,\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport React, { type JSX, type PropsWithChildren, useEffect, useMemo, useRef } from 'react';\n\nimport { generateName } from '@dxos/display-name';\nimport { Obj } from '@dxos/echo';\nimport { type SpaceMember, useMembers } from '@dxos/react-client/echo';\nimport { Icon, IconButton, Select, type ThemedClassName, useTranslation } from '@dxos/react-ui';\nimport { type Player, useGameboardContext } from '@dxos/react-ui-gameboard';\nimport { mx } from '@dxos/ui-theme';\n\nimport { meta } from '#meta';\n\nimport { type ExtendedChessModel } from './types';\n\nconst INFO_NAME = 'Chessboard.Info';\n\nexport type InfoProps = ThemedClassName<\n {\n orientation?: Player;\n onOrientationChange?: (orientation: Player) => void;\n onClose?: () => void;\n } & Pick<HistoryProps, 'min' | 'max' | 'onSelect'>\n>;\n\nexport const Info = ({ classNames, orientation = 'white', onOrientationChange, onClose, ...props }: InfoProps) => {\n const { t } = useTranslation(meta.id);\n const { model } = useGameboardContext<ExtendedChessModel>(INFO_NAME);\n const db = Obj.getDatabase(model.object);\n const members = useMembers(db?.spaceId);\n\n return (\n <div\n className={mx(\n 'grid grid-rows-[min-content_1fr_min-content] w-full min-w-[18rem] p-2 overflow-hidden bg-group-surface rounded-xs',\n classNames,\n )}\n >\n <PlayerIndicator\n model={model}\n player={orientation === 'white' ? 'black' : 'white'}\n icon={\n onClose && (\n <IconButton\n variant='ghost'\n icon='ph--x--regular'\n iconOnly\n label={t('close-info.button')}\n size={4}\n onClick={onClose}\n />\n )\n }\n >\n <PlayerSelector\n value={model.object.players?.[orientation === 'white' ? 'black' : 'white']}\n onValueChange={(value) => {\n Obj.change(model.object, (obj) => {\n obj.players![orientation === 'white' ? 'black' : 'white'] = value;\n });\n }}\n members={members}\n />\n </PlayerIndicator>\n\n <History model={model} {...props} />\n\n <PlayerIndicator\n model={model}\n player={orientation}\n icon={\n onOrientationChange && (\n <IconButton\n classNames={mx('transition duration-200 ease-linear', orientation === 'white' && 'rotate-180')}\n icon='ph--arrows-clockwise--regular'\n iconOnly\n label={t('flip-board.button')}\n size={4}\n onClick={() => onOrientationChange(orientation === 'white' ? 'black' : 'white')}\n />\n )\n }\n >\n <PlayerSelector\n value={model.object.players?.[orientation]}\n onValueChange={(value) => {\n Obj.change(model.object, (obj) => {\n obj.players![orientation] = value;\n });\n }}\n members={members}\n />\n </PlayerIndicator>\n </div>\n );\n};\n\nInfo.displayName = INFO_NAME;\n\n//\n// History\n//\n\ntype HistoryProps = ThemedClassName<{\n model: ExtendedChessModel;\n min?: number;\n max?: number;\n onSelect?: (index: number) => void;\n}>;\n\nconst History = ({ classNames, model, min, max, onSelect }: HistoryProps) => {\n const { t } = useTranslation(meta.id);\n const moveIndex = useAtomValue(model.moveIndex);\n const label = model.game.isGameOver()\n ? model.game.isCheckmate()\n ? t('game.checkmate.label')\n : model.game.isStalemate()\n ? t('game.stalemate.label')\n : t('game.draw.label')\n : model.game.isCheck()\n ? t('game.check.label')\n : undefined;\n\n const history = model.game.history();\n const moves = useMemo(\n () =>\n history.reduce(\n (acc, move, index) => {\n if (index % 2 === 0) {\n acc.push([{ index, move }]);\n } else {\n acc[acc.length - 1].push({ index, move });\n }\n return acc;\n },\n [] as { index: number; move: string }[][],\n ),\n [history.length],\n );\n\n const scrollerRef = useRef<HTMLDivElement>(null);\n useEffect(() => {\n scrollerRef.current?.scrollTo({ top: scrollerRef.current.scrollHeight });\n }, [history.length]);\n\n useEffect(() => {\n const div = scrollerRef.current?.querySelector(`[data-index=\"${moveIndex - 1}\"]`);\n scrollerRef.current?.classList.add('scrollbar-none');\n div?.scrollIntoView({ behavior: 'smooth' });\n scrollerRef.current?.classList.remove('scrollbar-none');\n }, [moveIndex]);\n\n return (\n <div\n ref={scrollerRef}\n className={mx('overflow-y-auto', classNames)}\n style={{\n minHeight: min === undefined ? 'auto' : `${min * 24}px`,\n maxHeight: max === undefined ? 'auto' : `${max * 24}px`,\n }}\n >\n {moves.map(([a, b], index) => (\n <div key={index} className='grid grid-cols-[3rem_1fr_1fr_1rem] gap-2 ps-4'>\n <div className='content-center text-xs text-subdued'>{index + 1}</div>\n {a && (\n <div\n data-index={a.index}\n className={mx('ps-2 text-sm cursor-pointer', a.index === moveIndex - 1 && 'bg-primary-500')}\n onClick={() => onSelect?.(a.index + 1)}\n >\n {a.move}\n </div>\n )}\n {b && (\n <div\n data-index={b.index}\n className={mx('ps-2 text-sm cursor-pointer', b.index === moveIndex - 1 && 'bg-primary-500')}\n onClick={() => onSelect?.(b.index + 1)}\n >\n {b.move}\n </div>\n )}\n </div>\n ))}\n {label && <div className='text-center'>{label}</div>}\n </div>\n );\n};\n\n//\n// PlayerIndicator\n//\n\ntype PlayerIndicatorProps = PropsWithChildren<{\n model: ExtendedChessModel;\n player: Player;\n icon?: JSX.Element;\n}>;\n\nconst PlayerIndicator = ({ children, model, player, icon }: PlayerIndicatorProps) => {\n const turn = player === (model.game.turn() === 'w' ? 'white' : 'black');\n return (\n <div className='grid grid-cols-[2rem_1fr_2rem] gap-2 h-(--dx-rail-size) px-1 flex items-center overflow-hidden'>\n <div className='place-items-center'>\n <Icon\n icon={turn ? 'ph--circle--fill' : 'ph--circle--thin'}\n size={6}\n classNames={mx(turn && (model.game.isCheckmate() ? 'text-error-500' : 'text-success-text'))}\n />\n </div>\n <div className='truncate overflow-hidden items-center'>{children}</div>\n {icon}\n </div>\n );\n};\n\n//\n// PlayerSelector\n//\n\ntype PlayerSelectorProps = {\n value?: string;\n onValueChange: (player: string) => void;\n members: SpaceMember[];\n};\n\nconst PlayerSelector = ({ value, onValueChange, members }: PlayerSelectorProps) => {\n const { t } = useTranslation(meta.id);\n return (\n <Select.Root value={value} onValueChange={onValueChange}>\n <Select.TriggerButton placeholder={t('select-player.button')} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {members.map((member) => {\n const memberKey = member.identity.identityKey.toHex();\n const displayName = member.identity?.profile?.displayName || generateName(memberKey);\n return (\n <Select.Option key={memberKey} value={memberKey}>\n {displayName}\n </Select.Option>\n );\n })}\n </Select.Viewport>\n <Select.Arrow />\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Registry } from '@effect-atom/atom-react';\n\nimport { ChessModel } from '@dxos/react-ui-gameboard';\n\nimport { type Chess } from '#types';\n\nexport class ExtendedChessModel extends ChessModel {\n constructor(\n registry: Registry.Registry,\n readonly object: Chess.Game,\n ) {\n super(registry);\n }\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.chess',\n name: 'Chess',\n description: trim`\n Full-featured chess game supporting multiplayer matches with friends or practice sessions against AI opponents.\n Track game history and analyze moves in real-time.\n `,\n icon: 'ph--shield-chevron--regular',\n iconHue: 'amber',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-chess',\n screenshots: ['https://dxos.network/plugin-details-chess-dark.png'],\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\nimport { Annotation } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\nimport { SpaceOperation } from '@dxos/plugin-space/operations';\nimport { type CreateObject } from '@dxos/plugin-space/types';\n\nimport { ChessBlueprint } from '#blueprints';\nimport { BlueprintDefinition, OperationHandler, ReactSurface } from '#capabilities';\nimport { meta } from '#meta';\nimport { Chess } from '#types';\n\nimport { translations } from './translations';\n\nexport const ChessPlugin = Plugin.define(meta).pipe(\n AppPlugin.addBlueprintDefinitionModule({ activate: BlueprintDefinition }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addMetadataModule({\n metadata: {\n id: Chess.Game.typename,\n metadata: {\n icon: Annotation.IconAnnotation.get(Chess.Game).pipe(Option.getOrThrow).icon,\n iconHue: Annotation.IconAnnotation.get(Chess.Game).pipe(Option.getOrThrow).hue ?? 'white',\n blueprints: [ChessBlueprint.key],\n createObject: ((props, options) =>\n Effect.gen(function* () {\n const object = Chess.make(props);\n return yield* Operation.invoke(SpaceOperation.AddObject, {\n object,\n target: options.target,\n hidden: true,\n targetNodeId: options.targetNodeId,\n });\n })) satisfies CreateObject,\n },\n },\n }),\n AppPlugin.addSchemaModule({ schema: [Chess.Game] }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.make,\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from '#meta';\nimport { Chess } from '#types';\n\nexport const translations = [\n {\n 'en-US': {\n [Chess.Game.typename]: {\n 'typename.label': 'Game',\n 'typename.label_zero': 'Games',\n 'typename.label_one': 'Game',\n 'typename.label_other': 'Games',\n 'object-name.placeholder': 'New game',\n 'add-object.label': 'Add game',\n 'rename-object.label': 'Rename game',\n 'delete-object.label': 'Delete game',\n 'object-deleted.label': 'Game deleted',\n },\n [meta.id]: {\n 'plugin.name': 'Chess',\n 'delete-game.label': 'Delete',\n 'game.checkmate.label': 'Checkmate',\n 'game.stalemate.label': 'Stalemate',\n 'game.draw.label': 'Draw',\n 'game.check.label': 'Check',\n 'select-player.button': 'Select player',\n 'toggle-info.button': 'Toggle info',\n 'close-info.button': 'Close info',\n 'flip-board.button': 'Flip board',\n },\n },\n },\n] as const satisfies Resource[];\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["RegistryContext", "React", "forwardRef", "useCallback", "useContext", "useEffect", "useImperativeHandle", "useMemo", "useRef", "addEventListener", "useObject", "Gameboard", "Chessboard", "NaturalChessboard", "getRawPgn", "useGameboardContext", "useSoundEffect", "useAtomValue", "React", "useEffect", "useMemo", "useRef", "generateName", "Obj", "useMembers", "Icon", "IconButton", "Select", "useTranslation", "useGameboardContext", "mx", "meta", "INFO_NAME", "Info", "classNames", "orientation", "onOrientationChange", "onClose", "props", "t", "
|
|
3
|
+
"sources": ["../../../src/components/Chessboard/Chessboard.tsx", "../../../src/components/Chessboard/Info.tsx", "../../../src/components/Chessboard/types.ts", "../../../src/meta.ts", "../../../src/ChessPlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { RegistryContext } from '@effect-atom/atom-react';\nimport React, {\n type PropsWithChildren,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n} from 'react';\n\nimport { addEventListener } from '@dxos/async';\nimport { useObject } from '@dxos/echo-react';\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport {\n type ChessModel,\n Gameboard,\n type GameboardRootProps,\n Chessboard as NaturalChessboard,\n type ChessboardProps as NaturalChessboardProps,\n getRawPgn,\n useGameboardContext,\n} from '@dxos/react-ui-gameboard';\nimport { useSoundEffect } from '@dxos/react-ui-sfx';\n\nimport { type Chess } from '#types';\n\nimport { Info, type InfoProps } from './Info';\nimport { ExtendedChessModel } from './types';\n\nexport interface ChessboardController {\n setMoveNumber(index: number): void;\n}\n\n//\n// Root\n//\n\ntype RootProps = PropsWithChildren<{\n game: Chess.Game;\n}>;\n\nconst Root = forwardRef<ChessboardController, RootProps>(({ game, children }, forwardedRef) => {\n const registry = useContext(RegistryContext);\n const model = useMemo(() => new ExtendedChessModel(registry, game), [registry]);\n const click = useSoundEffect('Click');\n const [pgn, updatePgn] = useObject(game, 'pgn');\n\n // Controller.\n useImperativeHandle(forwardedRef, () => {\n return {\n setMoveNumber: (index) => model.setMoveIndex(index),\n };\n }, [model]);\n\n // TODO(wittjosiah): Rather than useEffect to sync ECHO object to model, create an alternative model implementation.\n // This model would take the ECHO object and derive game state directly from that.\n // Mutation methods would mutate the ECHO object and other state would be derived from that.\n\n // External change.\n // NOTE: Warning if user has not interacted with the board.\n useEffect(() => {\n if (model.pgn !== getRawPgn(pgn ?? '')) {\n const silent = model.pgn === '*';\n model.update(pgn);\n if (!silent) {\n void click.play();\n }\n }\n }, [pgn]);\n\n // Move.\n const handleDrop = useCallback<NonNullable<GameboardRootProps<ChessModel>['onDrop']>>(\n (move) => {\n if (!model.makeMove(move)) {\n return false;\n }\n\n void click.play();\n updatePgn(() => model.pgn);\n return true;\n },\n [model],\n );\n\n return (\n <Gameboard.Root model={model} onDrop={handleDrop}>\n {children}\n </Gameboard.Root>\n );\n});\n\n//\n// Content\n//\n\ntype Role = 'card--content';\n\ntype ContentProps = ThemedClassName<PropsWithChildren<{ role?: Role }>>;\n\nconst Content = ({ classNames, children }: ContentProps) => {\n return (\n <Gameboard.Content grow contain classNames={classNames}>\n {children}\n </Gameboard.Content>\n );\n};\n\n//\n// Board\n//\n\nconst BOARD_NAME = 'Chessboard.Board';\n\ntype BoardProps = NaturalChessboardProps;\n\nconst Board = (props: BoardProps) => {\n const registry = useContext(RegistryContext);\n const { model } = useGameboardContext<ChessModel>(BOARD_NAME);\n\n // Keyboard navigation.\n const ref = useRef<HTMLDivElement>(null);\n useEffect(() => {\n if (!ref.current) {\n return;\n }\n\n // Participate in keyboard navigation (set tabIndex={0})\n ref.current.setAttribute('data-arrow-keys', 'all');\n\n return addEventListener(ref.current, 'keydown', (ev) => {\n const moveIndex = registry.get(model.moveIndex);\n switch (ev.key) {\n case 'ArrowUp':\n model.setMoveIndex(0);\n break;\n case 'ArrowDown':\n model.setMoveIndex(model.game.history().length);\n break;\n case 'ArrowLeft':\n if (moveIndex > 0) {\n model.setMoveIndex(moveIndex - 1);\n }\n break;\n case 'ArrowRight':\n if (moveIndex < model.game.history().length) {\n model.setMoveIndex(moveIndex + 1);\n }\n break;\n }\n });\n }, [registry, model]);\n\n return <NaturalChessboard {...props} ref={ref} />;\n};\n\nBoard.displayName = BOARD_NAME;\n\n//\n// Chessboard\n//\n\nexport const Chessboard = {\n Root: Root,\n Content: Content,\n Board: Board,\n Info: Info,\n};\n\nexport type {\n RootProps as ChessboardRootProps,\n ContentProps as ChessboardContentProps,\n BoardProps as ChessboardBoardProps,\n InfoProps as ChessboardInfoProps,\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport React, { type JSX, type PropsWithChildren, useEffect, useMemo, useRef } from 'react';\n\nimport { generateName } from '@dxos/display-name';\nimport { Obj } from '@dxos/echo';\nimport { type SpaceMember, useMembers } from '@dxos/react-client/echo';\nimport { Icon, IconButton, Select, type ThemedClassName, useTranslation } from '@dxos/react-ui';\nimport { type Player, useGameboardContext } from '@dxos/react-ui-gameboard';\nimport { mx } from '@dxos/ui-theme';\n\nimport { meta } from '#meta';\n\nimport { type ExtendedChessModel } from './types';\n\nconst INFO_NAME = 'Chessboard.Info';\n\nexport type InfoProps = ThemedClassName<\n {\n orientation?: Player;\n onOrientationChange?: (orientation: Player) => void;\n onClose?: () => void;\n } & Pick<HistoryProps, 'min' | 'max' | 'onSelect'>\n>;\n\nexport const Info = ({ classNames, orientation = 'white', onOrientationChange, onClose, ...props }: InfoProps) => {\n const { t } = useTranslation(meta.id);\n const { model } = useGameboardContext<ExtendedChessModel>(INFO_NAME);\n const db = Obj.getDatabase(model.object);\n const members = useMembers(db?.spaceId);\n\n return (\n <div\n className={mx(\n 'grid grid-rows-[min-content_1fr_min-content] w-full min-w-[18rem] p-2 overflow-hidden bg-group-surface rounded-xs',\n classNames,\n )}\n >\n <PlayerIndicator\n model={model}\n player={orientation === 'white' ? 'black' : 'white'}\n icon={\n onClose && (\n <IconButton\n variant='ghost'\n icon='ph--x--regular'\n iconOnly\n label={t('close-info.button')}\n size={4}\n onClick={onClose}\n />\n )\n }\n >\n <PlayerSelector\n value={model.object.players?.[orientation === 'white' ? 'black' : 'white']}\n onValueChange={(value) => {\n Obj.update(model.object, (obj) => {\n obj.players![orientation === 'white' ? 'black' : 'white'] = value;\n });\n }}\n members={members}\n />\n </PlayerIndicator>\n\n <History model={model} {...props} />\n\n <PlayerIndicator\n model={model}\n player={orientation}\n icon={\n onOrientationChange && (\n <IconButton\n classNames={mx('transition duration-200 ease-linear', orientation === 'white' && 'rotate-180')}\n icon='ph--arrows-clockwise--regular'\n iconOnly\n label={t('flip-board.button')}\n size={4}\n onClick={() => onOrientationChange(orientation === 'white' ? 'black' : 'white')}\n />\n )\n }\n >\n <PlayerSelector\n value={model.object.players?.[orientation]}\n onValueChange={(value) => {\n Obj.update(model.object, (obj) => {\n obj.players![orientation] = value;\n });\n }}\n members={members}\n />\n </PlayerIndicator>\n </div>\n );\n};\n\nInfo.displayName = INFO_NAME;\n\n//\n// History\n//\n\ntype HistoryProps = ThemedClassName<{\n model: ExtendedChessModel;\n min?: number;\n max?: number;\n onSelect?: (index: number) => void;\n}>;\n\nconst History = ({ classNames, model, min, max, onSelect }: HistoryProps) => {\n const { t } = useTranslation(meta.id);\n const moveIndex = useAtomValue(model.moveIndex);\n const label = model.game.isGameOver()\n ? model.game.isCheckmate()\n ? t('game.checkmate.label')\n : model.game.isStalemate()\n ? t('game.stalemate.label')\n : t('game.draw.label')\n : model.game.isCheck()\n ? t('game.check.label')\n : undefined;\n\n const history = model.game.history();\n const moves = useMemo(\n () =>\n history.reduce(\n (acc, move, index) => {\n if (index % 2 === 0) {\n acc.push([{ index, move }]);\n } else {\n acc[acc.length - 1].push({ index, move });\n }\n return acc;\n },\n [] as { index: number; move: string }[][],\n ),\n [history.length],\n );\n\n const scrollerRef = useRef<HTMLDivElement>(null);\n useEffect(() => {\n scrollerRef.current?.scrollTo({ top: scrollerRef.current.scrollHeight });\n }, [history.length]);\n\n useEffect(() => {\n const div = scrollerRef.current?.querySelector(`[data-index=\"${moveIndex - 1}\"]`);\n scrollerRef.current?.classList.add('scrollbar-none');\n div?.scrollIntoView({ behavior: 'smooth' });\n scrollerRef.current?.classList.remove('scrollbar-none');\n }, [moveIndex]);\n\n return (\n <div\n ref={scrollerRef}\n className={mx('overflow-y-auto', classNames)}\n style={{\n minHeight: min === undefined ? 'auto' : `${min * 24}px`,\n maxHeight: max === undefined ? 'auto' : `${max * 24}px`,\n }}\n >\n {moves.map(([a, b], index) => (\n <div key={index} className='grid grid-cols-[3rem_1fr_1fr_1rem] gap-2 ps-4'>\n <div className='content-center text-xs text-subdued'>{index + 1}</div>\n {a && (\n <div\n data-index={a.index}\n className={mx('ps-2 text-sm cursor-pointer', a.index === moveIndex - 1 && 'bg-primary-500')}\n onClick={() => onSelect?.(a.index + 1)}\n >\n {a.move}\n </div>\n )}\n {b && (\n <div\n data-index={b.index}\n className={mx('ps-2 text-sm cursor-pointer', b.index === moveIndex - 1 && 'bg-primary-500')}\n onClick={() => onSelect?.(b.index + 1)}\n >\n {b.move}\n </div>\n )}\n </div>\n ))}\n {label && <div className='text-center'>{label}</div>}\n </div>\n );\n};\n\n//\n// PlayerIndicator\n//\n\ntype PlayerIndicatorProps = PropsWithChildren<{\n model: ExtendedChessModel;\n player: Player;\n icon?: JSX.Element;\n}>;\n\nconst PlayerIndicator = ({ children, model, player, icon }: PlayerIndicatorProps) => {\n const turn = player === (model.game.turn() === 'w' ? 'white' : 'black');\n return (\n <div className='grid grid-cols-[2rem_1fr_2rem] gap-2 h-(--dx-rail-size) px-1 flex items-center overflow-hidden'>\n <div className='place-items-center'>\n <Icon\n icon={turn ? 'ph--circle--fill' : 'ph--circle--thin'}\n size={6}\n classNames={mx(turn && (model.game.isCheckmate() ? 'text-error-500' : 'text-success-text'))}\n />\n </div>\n <div className='truncate overflow-hidden items-center'>{children}</div>\n {icon}\n </div>\n );\n};\n\n//\n// PlayerSelector\n//\n\ntype PlayerSelectorProps = {\n value?: string;\n onValueChange: (player: string) => void;\n members: SpaceMember[];\n};\n\nconst PlayerSelector = ({ value, onValueChange, members }: PlayerSelectorProps) => {\n const { t } = useTranslation(meta.id);\n return (\n <Select.Root value={value} onValueChange={onValueChange}>\n <Select.TriggerButton placeholder={t('select-player.button')} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {members.map((member) => {\n const memberKey = member.identity.identityKey.toHex();\n const displayName = member.identity?.profile?.displayName || generateName(memberKey);\n return (\n <Select.Option key={memberKey} value={memberKey}>\n {displayName}\n </Select.Option>\n );\n })}\n </Select.Viewport>\n <Select.Arrow />\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Registry } from '@effect-atom/atom-react';\n\nimport { ChessModel } from '@dxos/react-ui-gameboard';\n\nimport { type Chess } from '#types';\n\nexport class ExtendedChessModel extends ChessModel {\n constructor(\n registry: Registry.Registry,\n readonly object: Chess.Game,\n ) {\n super(registry);\n }\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.chess',\n name: 'Chess',\n description: trim`\n Full-featured chess game supporting multiplayer matches with friends or practice sessions against AI opponents.\n Track game history and analyze moves in real-time.\n `,\n icon: 'ph--shield-chevron--regular',\n iconHue: 'amber',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-chess',\n screenshots: ['https://dxos.network/plugin-details-chess-dark.png'],\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\nimport { Annotation } from '@dxos/echo';\nimport { SpaceOperation } from '@dxos/plugin-space/operations';\nimport { type CreateObject } from '@dxos/plugin-space/types';\n\nimport { ChessBlueprint } from '#blueprints';\nimport { BlueprintDefinition, OperationHandler, ReactSurface } from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { Chess } from '#types';\n\nexport const ChessPlugin = Plugin.define(meta).pipe(\n AppPlugin.addBlueprintDefinitionModule({ activate: BlueprintDefinition }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addMetadataModule({\n metadata: {\n id: Chess.Game.typename,\n metadata: {\n icon: Annotation.IconAnnotation.get(Chess.Game).pipe(Option.getOrThrow).icon,\n iconHue: Annotation.IconAnnotation.get(Chess.Game).pipe(Option.getOrThrow).hue ?? 'white',\n blueprints: [ChessBlueprint.key],\n createObject: ((props, options) =>\n Effect.gen(function* () {\n const object = Chess.make(props);\n return yield* Operation.invoke(SpaceOperation.AddObject, {\n object,\n target: options.target,\n hidden: true,\n targetNodeId: options.targetNodeId,\n });\n })) satisfies CreateObject,\n },\n },\n }),\n AppPlugin.addSchemaModule({ schema: [Chess.Game] }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.make,\n);\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,uBAAuB;AAChC,OAAOC,UAELC,YACAC,aACAC,YACAC,aAAAA,YACAC,qBACAC,WAAAA,UACAC,UAAAA,eACK;AAEP,SAASC,wBAAwB;AACjC,SAASC,iBAAiB;AAE1B,SAEEC,WAEAC,cAAcC,mBAEdC,WACAC,uBAAAA,4BACK;AACP,SAASC,sBAAsB;;;ACxB/B,SAASC,oBAAoB;AAC7B,OAAOC,SAA2CC,WAAWC,SAASC,cAAc;AAEpF,SAASC,oBAAoB;AAC7B,SAASC,WAAW;AACpB,SAA2BC,kBAAkB;AAC7C,SAASC,MAAMC,YAAYC,QAA8BC,sBAAsB;AAC/E,SAAsBC,2BAA2B;AACjD,SAASC,UAAU;AAEnB,SAASC,YAAY;AAIrB,IAAMC,YAAY;AAUX,IAAMC,OAAO,CAAC,EAAEC,YAAYC,cAAc,SAASC,qBAAqBC,SAAS,GAAGC,MAAAA,MAAkB;AAC3G,QAAM,EAAEC,EAAC,IAAKX,eAAeG,KAAKS,EAAE;AACpC,QAAM,EAAEC,MAAK,IAAKZ,oBAAwCG,SAAAA;AAC1D,QAAMU,KAAKnB,IAAIoB,YAAYF,MAAMG,MAAM;AACvC,QAAMC,UAAUrB,WAAWkB,IAAII,OAAAA;AAE/B,SACE,sBAAA,cAACC,OAAAA;IACCC,WAAWlB,GACT,qHACAI,UAAAA;KAGF,sBAAA,cAACe,iBAAAA;IACCR;IACAS,Q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EACF;AACF,CAAA,GACAxC,UAAUyC,gBAAgB;EAAEC,QAAQ;IAAChC,MAAMU;;AAAM,CAAA,GACjDpB,UAAU2C,iBAAiB;EAAE5B,UAAUR;AAAa,CAAA,GACpDP,UAAU4C,sBAAsB;EAAEnC;AAAa,CAAA,GAC/CV,OAAOoC,IAAI;",
|
|
6
|
+
"names": ["RegistryContext", "React", "forwardRef", "useCallback", "useContext", "useEffect", "useImperativeHandle", "useMemo", "useRef", "addEventListener", "useObject", "Gameboard", "Chessboard", "NaturalChessboard", "getRawPgn", "useGameboardContext", "useSoundEffect", "useAtomValue", "React", "useEffect", "useMemo", "useRef", "generateName", "Obj", "useMembers", "Icon", "IconButton", "Select", "useTranslation", "useGameboardContext", "mx", "meta", "INFO_NAME", "Info", "classNames", "orientation", "onOrientationChange", "onClose", "props", "t", "id", "model", "db", "getDatabase", "object", "members", "spaceId", "div", "className", "PlayerIndicator", "player", "icon", "variant", "iconOnly", "label", "size", "onClick", "PlayerSelector", "value", "players", "onValueChange", "update", "obj", "History", "displayName", "min", "max", "onSelect", "moveIndex", "game", "isGameOver", "isCheckmate", "isStalemate", "isCheck", "undefined", "history", "moves", "reduce", "acc", "move", "index", "push", "length", "scrollerRef", "current", "scrollTo", "top", "scrollHeight", "querySelector", "classList", "add", "scrollIntoView", "behavior", "remove", "ref", "style", "minHeight", "maxHeight", "map", "a", "b", "key", "data-index", "children", "turn", "Root", "TriggerButton", "placeholder", "Portal", "Content", "Viewport", "member", "memberKey", "identity", "identityKey", "toHex", "profile", "Option", "Arrow", "ChessModel", "ExtendedChessModel", "registry", "object", "Root", "forwardRef", "game", "children", "forwardedRef", "registry", "useContext", "RegistryContext", "model", "useMemo", "ExtendedChessModel", "click", "useSoundEffect", "pgn", "updatePgn", "useObject", "useImperativeHandle", "setMoveNumber", "index", "setMoveIndex", "useEffect", "getRawPgn", "silent", "update", "play", "handleDrop", "useCallback", "move", "makeMove", "React", "Gameboard", "onDrop", "Content", "classNames", "grow", "contain", "BOARD_NAME", "Board", "props", "useGameboardContext", "ref", "useRef", "current", "setAttribute", "addEventListener", "ev", "moveIndex", "get", "key", "history", "length", "NaturalChessboard", "displayName", "Chessboard", "Info", "trim", "meta", "id", "name", "description", "icon", "iconHue", "source", "screenshots", "Effect", "Option", "Plugin", "AppPlugin", "Operation", "Annotation", "SpaceOperation", "ChessBlueprint", "BlueprintDefinition", "OperationHandler", "ReactSurface", "meta", "translations", "Chess", "ChessPlugin", "define", "pipe", "addBlueprintDefinitionModule", "activate", "addOperationHandlerModule", "addMetadataModule", "metadata", "id", "Game", "typename", "icon", "IconAnnotation", "get", "getOrThrow", "iconHue", "hue", "blueprints", "key", "createObject", "props", "options", "gen", "object", "make", "invoke", "AddObject", "target", "hidden", "targetNodeId", "addSchemaModule", "schema", "addSurfaceModule", "addTranslationsModule"]
|
|
7
7
|
}
|