@dxos/plugin-chess 0.8.4-main.9be5663bfe → 0.8.4-main.abd8ff62ef
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 +4 -4
- package/dist/lib/browser/{chunk-JZMN24DY.mjs → chunk-H6SON7WG.mjs} +4 -4
- package/dist/lib/browser/chunk-H6SON7WG.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-MC7L6JNC.mjs → chunk-JYP24G6K.mjs} +2 -2
- package/dist/lib/browser/chunk-JYP24G6K.mjs.map +7 -0
- 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/{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 -357
- 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 +4 -4
- package/dist/lib/node-esm/{chunk-LQEDIKCV.mjs → chunk-4C4GPZTA.mjs} +4 -4
- package/dist/lib/node-esm/chunk-4C4GPZTA.mjs.map +7 -0
- 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-4HZWCKMR.mjs → chunk-NSFPC4IO.mjs} +2 -2
- package/dist/lib/node-esm/chunk-NSFPC4IO.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/{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 -357
- 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 +1 -0
- package/dist/types/src/ChessPlugin.d.ts.map +1 -1
- package/dist/types/src/{cli/plugin.d.ts → ChessPlugin.node.d.ts} +2 -1
- 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/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 +2 -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/node.d.ts +5 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- 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 +2 -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 +50 -48
- package/src/{cli/plugin.ts → ChessPlugin.node.ts} +11 -3
- package/src/ChessPlugin.test.ts +49 -0
- package/src/ChessPlugin.tsx +4 -3
- package/src/blueprints/chess-blueprint.ts +2 -3
- package/src/capabilities/artifact-definition.ts +2 -2
- package/src/capabilities/blueprint-definition.ts +2 -0
- package/src/capabilities/index.ts +2 -1
- package/src/capabilities/node.ts +16 -0
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/capabilities/react-surface.tsx +5 -5
- 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 +5 -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.map +0 -7
- package/dist/lib/browser/chunk-XAJZK6Z2.mjs.map +0 -7
- package/dist/lib/browser/cli/index.mjs +0 -34
- package/dist/lib/browser/cli/index.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.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/cli/index.mjs +0 -35
- package/dist/lib/node-esm/cli/index.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
- package/dist/types/src/cli/index.d.ts +0 -2
- package/dist/types/src/cli/index.d.ts.map +0 -1
- package/dist/types/src/cli/plugin.d.ts.map +0 -1
- package/src/cli/index.ts +0 -5
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
Create
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-G2EHRXHX.mjs";
|
|
5
5
|
import {
|
|
6
6
|
Chess_exports
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OHBKSL2Q.mjs";
|
|
8
8
|
import "./chunk-HSLMI22Q.mjs";
|
|
9
9
|
|
|
10
10
|
// src/operations/create.ts
|
|
11
11
|
import * as Effect from "effect/Effect";
|
|
12
|
+
import { Operation } from "@dxos/compute";
|
|
12
13
|
import { Database } from "@dxos/echo";
|
|
13
|
-
import { Operation } from "@dxos/operation";
|
|
14
14
|
var handler = Create.pipe(Operation.withHandler(Effect.fn(function* ({ name, pgn, fen }) {
|
|
15
15
|
return yield* Database.add(Chess_exports.make({
|
|
16
16
|
name,
|
|
@@ -22,4 +22,4 @@ var create_default = handler;
|
|
|
22
22
|
export {
|
|
23
23
|
create_default as default
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=create-
|
|
25
|
+
//# sourceMappingURL=create-CC2P7GPT.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,290 +1,22 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
chess_blueprint_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NSFPC4IO.mjs";
|
|
5
5
|
import {
|
|
6
6
|
operations_exports
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-4C4GPZTA.mjs";
|
|
8
|
+
import "./chunk-G2EHRXHX.mjs";
|
|
9
9
|
import {
|
|
10
10
|
Chess_exports
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-OHBKSL2Q.mjs";
|
|
12
12
|
import "./chunk-HSLMI22Q.mjs";
|
|
13
13
|
|
|
14
|
-
// src/
|
|
15
|
-
import {
|
|
16
|
-
import React2, { forwardRef, useCallback, useContext, useEffect as useEffect2, useImperativeHandle, useMemo as useMemo2, useRef as useRef2 } from "react";
|
|
17
|
-
import { addEventListener } from "@dxos/async";
|
|
18
|
-
import { useObject } from "@dxos/echo-react";
|
|
19
|
-
import { Gameboard, Chessboard as NaturalChessboard, getRawPgn, useGameboardContext as useGameboardContext2 } from "@dxos/react-ui-gameboard";
|
|
20
|
-
import { useSoundEffect } from "@dxos/react-ui-sfx";
|
|
21
|
-
|
|
22
|
-
// src/components/Chessboard/Info.tsx
|
|
23
|
-
import { useAtomValue } from "@effect-atom/atom-react";
|
|
24
|
-
import React, { useEffect, useMemo, useRef } from "react";
|
|
25
|
-
import { generateName } from "@dxos/display-name";
|
|
26
|
-
import { Obj } from "@dxos/echo";
|
|
27
|
-
import { useMembers } from "@dxos/react-client/echo";
|
|
28
|
-
import { Icon, IconButton, Select, useTranslation } from "@dxos/react-ui";
|
|
29
|
-
import { useGameboardContext } from "@dxos/react-ui-gameboard";
|
|
30
|
-
import { mx } from "@dxos/ui-theme";
|
|
31
|
-
import { meta } from "#meta";
|
|
32
|
-
var INFO_NAME = "Chessboard.Info";
|
|
33
|
-
var Info = ({ classNames, orientation = "white", onOrientationChange, onClose, ...props }) => {
|
|
34
|
-
const { t } = useTranslation(meta.id);
|
|
35
|
-
const { model } = useGameboardContext(INFO_NAME);
|
|
36
|
-
const db = Obj.getDatabase(model.object);
|
|
37
|
-
const members = useMembers(db?.spaceId);
|
|
38
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
39
|
-
className: mx("grid grid-rows-[min-content_1fr_min-content] w-full min-w-[18rem] p-2 overflow-hidden bg-group-surface rounded-xs", classNames)
|
|
40
|
-
}, /* @__PURE__ */ React.createElement(PlayerIndicator, {
|
|
41
|
-
model,
|
|
42
|
-
player: orientation === "white" ? "black" : "white",
|
|
43
|
-
icon: onClose && /* @__PURE__ */ React.createElement(IconButton, {
|
|
44
|
-
variant: "ghost",
|
|
45
|
-
icon: "ph--x--regular",
|
|
46
|
-
iconOnly: true,
|
|
47
|
-
label: t("close-info.button"),
|
|
48
|
-
size: 4,
|
|
49
|
-
onClick: onClose
|
|
50
|
-
})
|
|
51
|
-
}, /* @__PURE__ */ React.createElement(PlayerSelector, {
|
|
52
|
-
value: model.object.players?.[orientation === "white" ? "black" : "white"],
|
|
53
|
-
onValueChange: (value) => {
|
|
54
|
-
Obj.change(model.object, (obj) => {
|
|
55
|
-
obj.players[orientation === "white" ? "black" : "white"] = value;
|
|
56
|
-
});
|
|
57
|
-
},
|
|
58
|
-
members
|
|
59
|
-
})), /* @__PURE__ */ React.createElement(History, {
|
|
60
|
-
model,
|
|
61
|
-
...props
|
|
62
|
-
}), /* @__PURE__ */ React.createElement(PlayerIndicator, {
|
|
63
|
-
model,
|
|
64
|
-
player: orientation,
|
|
65
|
-
icon: onOrientationChange && /* @__PURE__ */ React.createElement(IconButton, {
|
|
66
|
-
classNames: mx("transition duration-200 ease-linear", orientation === "white" && "rotate-180"),
|
|
67
|
-
icon: "ph--arrows-clockwise--regular",
|
|
68
|
-
iconOnly: true,
|
|
69
|
-
label: t("flip-board.button"),
|
|
70
|
-
size: 4,
|
|
71
|
-
onClick: () => onOrientationChange(orientation === "white" ? "black" : "white")
|
|
72
|
-
})
|
|
73
|
-
}, /* @__PURE__ */ React.createElement(PlayerSelector, {
|
|
74
|
-
value: model.object.players?.[orientation],
|
|
75
|
-
onValueChange: (value) => {
|
|
76
|
-
Obj.change(model.object, (obj) => {
|
|
77
|
-
obj.players[orientation] = value;
|
|
78
|
-
});
|
|
79
|
-
},
|
|
80
|
-
members
|
|
81
|
-
})));
|
|
82
|
-
};
|
|
83
|
-
Info.displayName = INFO_NAME;
|
|
84
|
-
var History = ({ classNames, model, min, max, onSelect }) => {
|
|
85
|
-
const { t } = useTranslation(meta.id);
|
|
86
|
-
const moveIndex = useAtomValue(model.moveIndex);
|
|
87
|
-
const label = model.game.isGameOver() ? model.game.isCheckmate() ? t("game.checkmate.label") : model.game.isStalemate() ? t("game.stalemate.label") : t("game.draw.label") : model.game.isCheck() ? t("game.check.label") : void 0;
|
|
88
|
-
const history = model.game.history();
|
|
89
|
-
const moves = useMemo(() => history.reduce((acc, move, index) => {
|
|
90
|
-
if (index % 2 === 0) {
|
|
91
|
-
acc.push([
|
|
92
|
-
{
|
|
93
|
-
index,
|
|
94
|
-
move
|
|
95
|
-
}
|
|
96
|
-
]);
|
|
97
|
-
} else {
|
|
98
|
-
acc[acc.length - 1].push({
|
|
99
|
-
index,
|
|
100
|
-
move
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
return acc;
|
|
104
|
-
}, []), [
|
|
105
|
-
history.length
|
|
106
|
-
]);
|
|
107
|
-
const scrollerRef = useRef(null);
|
|
108
|
-
useEffect(() => {
|
|
109
|
-
scrollerRef.current?.scrollTo({
|
|
110
|
-
top: scrollerRef.current.scrollHeight
|
|
111
|
-
});
|
|
112
|
-
}, [
|
|
113
|
-
history.length
|
|
114
|
-
]);
|
|
115
|
-
useEffect(() => {
|
|
116
|
-
const div = scrollerRef.current?.querySelector(`[data-index="${moveIndex - 1}"]`);
|
|
117
|
-
scrollerRef.current?.classList.add("scrollbar-none");
|
|
118
|
-
div?.scrollIntoView({
|
|
119
|
-
behavior: "smooth"
|
|
120
|
-
});
|
|
121
|
-
scrollerRef.current?.classList.remove("scrollbar-none");
|
|
122
|
-
}, [
|
|
123
|
-
moveIndex
|
|
124
|
-
]);
|
|
125
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
126
|
-
ref: scrollerRef,
|
|
127
|
-
className: mx("overflow-y-auto", classNames),
|
|
128
|
-
style: {
|
|
129
|
-
minHeight: min === void 0 ? "auto" : `${min * 24}px`,
|
|
130
|
-
maxHeight: max === void 0 ? "auto" : `${max * 24}px`
|
|
131
|
-
}
|
|
132
|
-
}, moves.map(([a, b], index) => /* @__PURE__ */ React.createElement("div", {
|
|
133
|
-
key: index,
|
|
134
|
-
className: "grid grid-cols-[3rem_1fr_1fr_1rem] gap-2 ps-4"
|
|
135
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
136
|
-
className: "content-center text-xs text-subdued"
|
|
137
|
-
}, index + 1), a && /* @__PURE__ */ React.createElement("div", {
|
|
138
|
-
"data-index": a.index,
|
|
139
|
-
className: mx("ps-2 text-sm cursor-pointer", a.index === moveIndex - 1 && "bg-primary-500"),
|
|
140
|
-
onClick: () => onSelect?.(a.index + 1)
|
|
141
|
-
}, a.move), b && /* @__PURE__ */ React.createElement("div", {
|
|
142
|
-
"data-index": b.index,
|
|
143
|
-
className: mx("ps-2 text-sm cursor-pointer", b.index === moveIndex - 1 && "bg-primary-500"),
|
|
144
|
-
onClick: () => onSelect?.(b.index + 1)
|
|
145
|
-
}, b.move))), label && /* @__PURE__ */ React.createElement("div", {
|
|
146
|
-
className: "text-center"
|
|
147
|
-
}, label));
|
|
148
|
-
};
|
|
149
|
-
var PlayerIndicator = ({ children, model, player, icon }) => {
|
|
150
|
-
const turn = player === (model.game.turn() === "w" ? "white" : "black");
|
|
151
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
152
|
-
className: "grid grid-cols-[2rem_1fr_2rem] gap-2 h-(--dx-rail-size) px-1 flex items-center overflow-hidden"
|
|
153
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
154
|
-
className: "place-items-center"
|
|
155
|
-
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
156
|
-
icon: turn ? "ph--circle--fill" : "ph--circle--thin",
|
|
157
|
-
size: 6,
|
|
158
|
-
classNames: mx(turn && (model.game.isCheckmate() ? "text-error-500" : "text-success-text"))
|
|
159
|
-
})), /* @__PURE__ */ React.createElement("div", {
|
|
160
|
-
className: "truncate overflow-hidden items-center"
|
|
161
|
-
}, children), icon);
|
|
162
|
-
};
|
|
163
|
-
var PlayerSelector = ({ value, onValueChange, members }) => {
|
|
164
|
-
const { t } = useTranslation(meta.id);
|
|
165
|
-
return /* @__PURE__ */ React.createElement(Select.Root, {
|
|
166
|
-
value,
|
|
167
|
-
onValueChange
|
|
168
|
-
}, /* @__PURE__ */ React.createElement(Select.TriggerButton, {
|
|
169
|
-
placeholder: t("select-player.button")
|
|
170
|
-
}), /* @__PURE__ */ React.createElement(Select.Portal, null, /* @__PURE__ */ React.createElement(Select.Content, null, /* @__PURE__ */ React.createElement(Select.Viewport, null, members.map((member) => {
|
|
171
|
-
const memberKey = member.identity.identityKey.toHex();
|
|
172
|
-
const displayName = member.identity?.profile?.displayName || generateName(memberKey);
|
|
173
|
-
return /* @__PURE__ */ React.createElement(Select.Option, {
|
|
174
|
-
key: memberKey,
|
|
175
|
-
value: memberKey
|
|
176
|
-
}, displayName);
|
|
177
|
-
})), /* @__PURE__ */ React.createElement(Select.Arrow, null))));
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
// src/components/Chessboard/types.ts
|
|
181
|
-
import { ChessModel } from "@dxos/react-ui-gameboard";
|
|
182
|
-
var ExtendedChessModel = class extends ChessModel {
|
|
183
|
-
object;
|
|
184
|
-
constructor(registry, object) {
|
|
185
|
-
super(registry), this.object = object;
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
// src/components/Chessboard/Chessboard.tsx
|
|
190
|
-
var Root = /* @__PURE__ */ forwardRef(({ game, children }, forwardedRef) => {
|
|
191
|
-
const registry = useContext(RegistryContext);
|
|
192
|
-
const model = useMemo2(() => new ExtendedChessModel(registry, game), [
|
|
193
|
-
registry
|
|
194
|
-
]);
|
|
195
|
-
const click = useSoundEffect("Click");
|
|
196
|
-
const [pgn, updatePgn] = useObject(game, "pgn");
|
|
197
|
-
useImperativeHandle(forwardedRef, () => {
|
|
198
|
-
return {
|
|
199
|
-
setMoveNumber: (index) => model.setMoveIndex(index)
|
|
200
|
-
};
|
|
201
|
-
}, [
|
|
202
|
-
model
|
|
203
|
-
]);
|
|
204
|
-
useEffect2(() => {
|
|
205
|
-
if (model.pgn !== getRawPgn(pgn ?? "")) {
|
|
206
|
-
const silent = model.pgn === "*";
|
|
207
|
-
model.update(pgn);
|
|
208
|
-
if (!silent) {
|
|
209
|
-
void click.play();
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}, [
|
|
213
|
-
pgn
|
|
214
|
-
]);
|
|
215
|
-
const handleDrop = useCallback((move) => {
|
|
216
|
-
if (!model.makeMove(move)) {
|
|
217
|
-
return false;
|
|
218
|
-
}
|
|
219
|
-
void click.play();
|
|
220
|
-
updatePgn(() => model.pgn);
|
|
221
|
-
return true;
|
|
222
|
-
}, [
|
|
223
|
-
model
|
|
224
|
-
]);
|
|
225
|
-
return /* @__PURE__ */ React2.createElement(Gameboard.Root, {
|
|
226
|
-
model,
|
|
227
|
-
onDrop: handleDrop
|
|
228
|
-
}, children);
|
|
229
|
-
});
|
|
230
|
-
var Content = ({ classNames, children }) => {
|
|
231
|
-
return /* @__PURE__ */ React2.createElement(Gameboard.Content, {
|
|
232
|
-
grow: true,
|
|
233
|
-
contain: true,
|
|
234
|
-
classNames
|
|
235
|
-
}, children);
|
|
236
|
-
};
|
|
237
|
-
var BOARD_NAME = "Chessboard.Board";
|
|
238
|
-
var Board = (props) => {
|
|
239
|
-
const registry = useContext(RegistryContext);
|
|
240
|
-
const { model } = useGameboardContext2(BOARD_NAME);
|
|
241
|
-
const ref = useRef2(null);
|
|
242
|
-
useEffect2(() => {
|
|
243
|
-
if (!ref.current) {
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
|
-
ref.current.setAttribute("data-arrow-keys", "all");
|
|
247
|
-
return addEventListener(ref.current, "keydown", (ev) => {
|
|
248
|
-
const moveIndex = registry.get(model.moveIndex);
|
|
249
|
-
switch (ev.key) {
|
|
250
|
-
case "ArrowUp":
|
|
251
|
-
model.setMoveIndex(0);
|
|
252
|
-
break;
|
|
253
|
-
case "ArrowDown":
|
|
254
|
-
model.setMoveIndex(model.game.history().length);
|
|
255
|
-
break;
|
|
256
|
-
case "ArrowLeft":
|
|
257
|
-
if (moveIndex > 0) {
|
|
258
|
-
model.setMoveIndex(moveIndex - 1);
|
|
259
|
-
}
|
|
260
|
-
break;
|
|
261
|
-
case "ArrowRight":
|
|
262
|
-
if (moveIndex < model.game.history().length) {
|
|
263
|
-
model.setMoveIndex(moveIndex + 1);
|
|
264
|
-
}
|
|
265
|
-
break;
|
|
266
|
-
}
|
|
267
|
-
});
|
|
268
|
-
}, [
|
|
269
|
-
registry,
|
|
270
|
-
model
|
|
271
|
-
]);
|
|
272
|
-
return /* @__PURE__ */ React2.createElement(NaturalChessboard, {
|
|
273
|
-
...props,
|
|
274
|
-
ref
|
|
275
|
-
});
|
|
276
|
-
};
|
|
277
|
-
Board.displayName = BOARD_NAME;
|
|
278
|
-
var Chessboard = {
|
|
279
|
-
Root,
|
|
280
|
-
Content,
|
|
281
|
-
Board,
|
|
282
|
-
Info
|
|
283
|
-
};
|
|
14
|
+
// src/index.ts
|
|
15
|
+
import { Plugin } from "@dxos/app-framework";
|
|
284
16
|
|
|
285
17
|
// src/meta.ts
|
|
286
18
|
import { trim } from "@dxos/util";
|
|
287
|
-
var
|
|
19
|
+
var meta = {
|
|
288
20
|
id: "org.dxos.plugin.chess",
|
|
289
21
|
name: "Chess",
|
|
290
22
|
description: trim`
|
|
@@ -299,92 +31,13 @@ var meta2 = {
|
|
|
299
31
|
]
|
|
300
32
|
};
|
|
301
33
|
|
|
302
|
-
// src/
|
|
303
|
-
|
|
304
|
-
import * as Option from "effect/Option";
|
|
305
|
-
import { Plugin } from "@dxos/app-framework";
|
|
306
|
-
import { AppPlugin } from "@dxos/app-toolkit";
|
|
307
|
-
import { Annotation } from "@dxos/echo";
|
|
308
|
-
import { Operation } from "@dxos/operation";
|
|
309
|
-
import { SpaceOperation } from "@dxos/plugin-space/operations";
|
|
310
|
-
import { ChessBlueprint } from "#blueprints";
|
|
311
|
-
import { BlueprintDefinition, OperationHandler, ReactSurface } from "#capabilities";
|
|
312
|
-
import { meta as meta4 } from "#meta";
|
|
313
|
-
import { Chess as Chess2 } from "#types";
|
|
314
|
-
|
|
315
|
-
// src/translations.ts
|
|
316
|
-
import { meta as meta3 } from "#meta";
|
|
317
|
-
import { Chess } from "#types";
|
|
318
|
-
var translations = [
|
|
319
|
-
{
|
|
320
|
-
"en-US": {
|
|
321
|
-
[Chess.Game.typename]: {
|
|
322
|
-
"typename.label": "Game",
|
|
323
|
-
"typename.label_zero": "Games",
|
|
324
|
-
"typename.label_one": "Game",
|
|
325
|
-
"typename.label_other": "Games",
|
|
326
|
-
"object-name.placeholder": "New game",
|
|
327
|
-
"add-object.label": "Add game",
|
|
328
|
-
"rename-object.label": "Rename game",
|
|
329
|
-
"delete-object.label": "Delete game",
|
|
330
|
-
"object-deleted.label": "Game deleted"
|
|
331
|
-
},
|
|
332
|
-
[meta3.id]: {
|
|
333
|
-
"plugin.name": "Chess",
|
|
334
|
-
"delete-game.label": "Delete",
|
|
335
|
-
"game.checkmate.label": "Checkmate",
|
|
336
|
-
"game.stalemate.label": "Stalemate",
|
|
337
|
-
"game.draw.label": "Draw",
|
|
338
|
-
"game.check.label": "Check",
|
|
339
|
-
"select-player.button": "Select player",
|
|
340
|
-
"toggle-info.button": "Toggle info",
|
|
341
|
-
"close-info.button": "Close info",
|
|
342
|
-
"flip-board.button": "Flip board"
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
];
|
|
347
|
-
|
|
348
|
-
// src/ChessPlugin.tsx
|
|
349
|
-
var ChessPlugin = Plugin.define(meta4).pipe(AppPlugin.addBlueprintDefinitionModule({
|
|
350
|
-
activate: BlueprintDefinition
|
|
351
|
-
}), AppPlugin.addOperationHandlerModule({
|
|
352
|
-
activate: OperationHandler
|
|
353
|
-
}), AppPlugin.addMetadataModule({
|
|
354
|
-
metadata: {
|
|
355
|
-
id: Chess2.Game.typename,
|
|
356
|
-
metadata: {
|
|
357
|
-
icon: Annotation.IconAnnotation.get(Chess2.Game).pipe(Option.getOrThrow).icon,
|
|
358
|
-
iconHue: Annotation.IconAnnotation.get(Chess2.Game).pipe(Option.getOrThrow).hue ?? "white",
|
|
359
|
-
blueprints: [
|
|
360
|
-
ChessBlueprint.key
|
|
361
|
-
],
|
|
362
|
-
createObject: (props, options) => Effect.gen(function* () {
|
|
363
|
-
const object = Chess2.make(props);
|
|
364
|
-
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
365
|
-
object,
|
|
366
|
-
target: options.target,
|
|
367
|
-
hidden: true,
|
|
368
|
-
targetNodeId: options.targetNodeId
|
|
369
|
-
});
|
|
370
|
-
})
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
}), AppPlugin.addSchemaModule({
|
|
374
|
-
schema: [
|
|
375
|
-
Chess2.Game
|
|
376
|
-
]
|
|
377
|
-
}), AppPlugin.addSurfaceModule({
|
|
378
|
-
activate: ReactSurface
|
|
379
|
-
}), AppPlugin.addTranslationsModule({
|
|
380
|
-
translations
|
|
381
|
-
}), Plugin.make);
|
|
34
|
+
// src/index.ts
|
|
35
|
+
var ChessPlugin = Plugin.lazy(meta, () => import("#plugin"));
|
|
382
36
|
export {
|
|
383
37
|
Chess_exports as Chess,
|
|
384
38
|
chess_blueprint_default as ChessBlueprint,
|
|
385
39
|
operations_exports as ChessFunctions,
|
|
386
40
|
ChessPlugin,
|
|
387
|
-
|
|
388
|
-
meta2 as meta
|
|
41
|
+
meta
|
|
389
42
|
};
|
|
390
43
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/
|
|
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": ";;;;;;;;;;;;;;AAIA,SAASA,
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../../../src/index.ts", "../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\nexport * from './blueprints';\nexport * from './meta';\nexport * from './types';\n\nexport const ChessPlugin = Plugin.lazy(meta, () => import('#plugin'));\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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAIA,SAASA,cAAc;;;ACCvB,SAASC,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaJ;;;;EAIbK,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,aAAa;IAAC;;AAChB;;;ADNO,IAAMC,cAAcC,OAAOC,KAAKC,MAAM,MAAM,OAAO,SAAA,CAAA;",
|
|
6
|
+
"names": ["Plugin", "trim", "meta", "id", "name", "description", "icon", "iconHue", "source", "screenshots", "ChessPlugin", "Plugin", "lazy", "meta"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/blueprints/chess-blueprint.ts":{"bytes":3377,"imports":[{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"#operations","kind":"import-statement","external":true}],"format":"esm"},"src/types/Chess.ts":{"bytes":6097,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":508,"imports":[{"path":"src/types/Chess.ts","kind":"import-statement","original":"./Chess"}],"format":"esm"},"src/operations/definitions.ts":{"bytes":9864,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/operations/create.ts":{"bytes":2029,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"},{"path":"src/operations/definitions.ts","kind":"import-statement","original":"./definitions"}],"format":"esm"},"src/operations/move.ts":{"bytes":3439,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true},{"path":"src/operations/definitions.ts","kind":"import-statement","original":"./definitions"}],"format":"esm"},"src/operations/play.ts":{"bytes":4736,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true},{"path":"src/operations/definitions.ts","kind":"import-statement","original":"./definitions"}],"format":"esm"},"src/operations/print.ts":{"bytes":2383,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true},{"path":"src/operations/definitions.ts","kind":"import-statement","original":"./definitions"}],"format":"esm"},"src/operations/index.ts":{"bytes":1522,"imports":[{"path":"@dxos/operation","kind":"import-statement","external":true},{"path":"src/operations/definitions.ts","kind":"import-statement","original":"./definitions"},{"path":"src/operations/create.ts","kind":"dynamic-import","original":"./create"},{"path":"src/operations/move.ts","kind":"dynamic-import","original":"./move"},{"path":"src/operations/play.ts","kind":"dynamic-import","original":"./play"},{"path":"src/operations/print.ts","kind":"dynamic-import","original":"./print"}],"format":"esm"},"src/blueprints/index.ts":{"bytes":795,"imports":[{"path":"src/blueprints/chess-blueprint.ts","kind":"import-statement","original":"./chess-blueprint"},{"path":"src/operations/index.ts","kind":"import-statement","original":"../operations"}],"format":"esm"},"src/components/Chessboard/Info.tsx":{"bytes":24900,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/components/Chessboard/types.ts":{"bytes":1296,"imports":[{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"format":"esm"},"src/components/Chessboard/Chessboard.tsx":{"bytes":13978,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true},{"path":"@dxos/react-ui-sfx","kind":"import-statement","external":true},{"path":"src/components/Chessboard/Info.tsx","kind":"import-statement","original":"./Info"},{"path":"src/components/Chessboard/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/components/Chessboard/index.ts":{"bytes":484,"imports":[{"path":"src/components/Chessboard/Chessboard.tsx","kind":"import-statement","original":"./Chessboard"}],"format":"esm"},"src/meta.ts":{"bytes":2043,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/translations.ts":{"bytes":3709,"imports":[{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/ChessPlugin.tsx":{"bytes":6970,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/operations","kind":"import-statement","external":true},{"path":"#blueprints","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"src/index.ts":{"bytes":843,"imports":[{"path":"src/blueprints/index.ts","kind":"import-statement","original":"./blueprints"},{"path":"src/components/Chessboard/index.ts","kind":"import-statement","original":"./components/Chessboard"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"src/ChessPlugin.tsx","kind":"import-statement","original":"./ChessPlugin"}],"format":"esm"},"src/cli/plugin.ts":{"bytes":4124,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/operations","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/cli/index.ts":{"bytes":458,"imports":[{"path":"src/cli/plugin.ts","kind":"import-statement","original":"./plugin"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/print-UJHXAXMS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1251},"dist/lib/node-esm/print-UJHXAXMS.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-NYU5JVXP.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-OIRJVY2R.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/operations/print.ts","inputs":{"src/operations/print.ts":{"bytesInOutput":440}},"bytes":753},"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":27655},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-4HZWCKMR.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-LQEDIKCV.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-NYU5JVXP.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-OIRJVY2R.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true},{"path":"@dxos/react-ui-sfx","kind":"import-statement","external":true},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/operations","kind":"import-statement","external":true},{"path":"#blueprints","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["Chess","ChessBlueprint","ChessFunctions","ChessPlugin","Chessboard","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/components/Chessboard/Chessboard.tsx":{"bytesInOutput":2837},"src/components/Chessboard/Info.tsx":{"bytesInOutput":6441},"src/components/Chessboard/types.ts":{"bytesInOutput":201},"src/components/Chessboard/index.ts":{"bytesInOutput":0},"src/meta.ts":{"bytesInOutput":516},"src/ChessPlugin.tsx":{"bytesInOutput":1579},"src/translations.ts":{"bytesInOutput":983}},"bytes":13353},"dist/lib/node-esm/blueprints/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/blueprints/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-4HZWCKMR.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-LQEDIKCV.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-NYU5JVXP.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-OIRJVY2R.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"}],"exports":["ChessBlueprint","ChessFunctions"],"entryPoint":"src/blueprints/index.ts","inputs":{},"bytes":448},"dist/lib/node-esm/chunk-4HZWCKMR.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1753},"dist/lib/node-esm/chunk-4HZWCKMR.mjs":{"imports":[{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"#operations","kind":"import-statement","external":true}],"exports":["chess_blueprint_default"],"inputs":{"src/blueprints/chess-blueprint.ts":{"bytesInOutput":833},"src/blueprints/index.ts":{"bytesInOutput":0}},"bytes":1046},"dist/lib/node-esm/cli/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2160},"dist/lib/node-esm/cli/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/operations","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["ChessPlugin"],"entryPoint":"src/cli/index.ts","inputs":{"src/cli/plugin.ts":{"bytesInOutput":845},"src/cli/index.ts":{"bytesInOutput":0}},"bytes":1052},"dist/lib/node-esm/operations/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/operations/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-LQEDIKCV.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-NYU5JVXP.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-OIRJVY2R.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"}],"exports":["ChessHandlers","Create","Move","Play","Print"],"entryPoint":"src/operations/index.ts","inputs":{},"bytes":386},"dist/lib/node-esm/chunk-LQEDIKCV.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":746},"dist/lib/node-esm/chunk-LQEDIKCV.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-NYU5JVXP.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"},{"path":"@dxos/operation","kind":"import-statement","external":true},{"path":"dist/lib/node-esm/create-QSETDT4N.mjs","kind":"dynamic-import"},{"path":"dist/lib/node-esm/move-5F2ANDTE.mjs","kind":"dynamic-import"},{"path":"dist/lib/node-esm/play-W4DQCQRX.mjs","kind":"dynamic-import"},{"path":"dist/lib/node-esm/print-UJHXAXMS.mjs","kind":"dynamic-import"}],"exports":["ChessHandlers","operations_exports"],"inputs":{"src/operations/index.ts":{"bytesInOutput":464}},"bytes":804},"dist/lib/node-esm/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/types/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-OIRJVY2R.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"}],"exports":["Chess"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":253},"dist/lib/node-esm/create-QSETDT4N.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1044},"dist/lib/node-esm/create-QSETDT4N.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-NYU5JVXP.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-OIRJVY2R.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/operations/create.ts","inputs":{"src/operations/create.ts":{"bytesInOutput":336}},"bytes":678},"dist/lib/node-esm/move-5F2ANDTE.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1882},"dist/lib/node-esm/move-5F2ANDTE.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-NYU5JVXP.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-OIRJVY2R.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/operations/move.ts","inputs":{"src/operations/move.ts":{"bytesInOutput":654}},"bytes":963},"dist/lib/node-esm/play-W4DQCQRX.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2575},"dist/lib/node-esm/play-W4DQCQRX.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-NYU5JVXP.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-OIRJVY2R.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/operations/play.ts","inputs":{"src/operations/play.ts":{"bytesInOutput":972}},"bytes":1281},"dist/lib/node-esm/chunk-NYU5JVXP.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4775},"dist/lib/node-esm/chunk-NYU5JVXP.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-OIRJVY2R.mjs","kind":"import-statement"},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true}],"exports":["Create","Move","Play","Print"],"inputs":{"src/operations/definitions.ts":{"bytesInOutput":2577}},"bytes":2850},"dist/lib/node-esm/chunk-OIRJVY2R.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3075},"dist/lib/node-esm/chunk-OIRJVY2R.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Chess_exports"],"inputs":{"src/types/Chess.ts":{"bytesInOutput":1625},"src/types/index.ts":{"bytesInOutput":0}},"bytes":1864},"dist/lib/node-esm/chunk-HSLMI22Q.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/chunk-HSLMI22Q.mjs":{"imports":[],"exports":["__export"],"inputs":{},"bytes":327}}}
|
|
1
|
+
{"inputs":{"src/meta.ts":{"bytes":1964,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/blueprints/chess-blueprint.ts":{"bytes":3169,"imports":[{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"#operations","kind":"import-statement","external":true}],"format":"esm"},"src/types/Chess.ts":{"bytes":6005,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":422,"imports":[{"path":"src/types/Chess.ts","kind":"import-statement","original":"./Chess"}],"format":"esm"},"src/operations/definitions.ts":{"bytes":9761,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/operations/create.ts":{"bytes":1931,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"},{"path":"src/operations/definitions.ts","kind":"import-statement","original":"./definitions"}],"format":"esm"},"src/operations/move.ts":{"bytes":3339,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/operations/definitions.ts","kind":"import-statement","original":"./definitions"}],"format":"esm"},"src/operations/play.ts":{"bytes":4640,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/operations/definitions.ts","kind":"import-statement","original":"./definitions"}],"format":"esm"},"src/operations/print.ts":{"bytes":2286,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"src/operations/definitions.ts","kind":"import-statement","original":"./definitions"}],"format":"esm"},"src/operations/index.ts":{"bytes":1425,"imports":[{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"src/operations/definitions.ts","kind":"import-statement","original":"./definitions"},{"path":"src/operations/create.ts","kind":"dynamic-import","original":"./create"},{"path":"src/operations/move.ts","kind":"dynamic-import","original":"./move"},{"path":"src/operations/play.ts","kind":"dynamic-import","original":"./play"},{"path":"src/operations/print.ts","kind":"dynamic-import","original":"./print"}],"format":"esm"},"src/blueprints/index.ts":{"bytes":700,"imports":[{"path":"src/blueprints/chess-blueprint.ts","kind":"import-statement","original":"./chess-blueprint"},{"path":"src/operations/index.ts","kind":"import-statement","original":"../operations"}],"format":"esm"},"src/index.ts":{"bytes":1105,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/blueprints/index.ts","kind":"import-statement","original":"./blueprints"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"#plugin","kind":"dynamic-import","external":true}],"format":"esm"},"src/translations.ts":{"bytes":3622,"imports":[{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/node-esm/print-P23VKVNU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1249},"dist/lib/node-esm/print-P23VKVNU.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-G2EHRXHX.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-OHBKSL2Q.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/operations/print.ts","inputs":{"src/operations/print.ts":{"bytesInOutput":438}},"bytes":751},"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1412},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-NSFPC4IO.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-4C4GPZTA.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-G2EHRXHX.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-OHBKSL2Q.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"#plugin","kind":"dynamic-import","external":true}],"exports":["Chess","ChessBlueprint","ChessFunctions","ChessPlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":108},"src/meta.ts":{"bytesInOutput":515}},"bytes":1190},"dist/lib/node-esm/blueprints/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/blueprints/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-NSFPC4IO.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-4C4GPZTA.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-G2EHRXHX.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-OHBKSL2Q.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"}],"exports":["ChessBlueprint","ChessFunctions"],"entryPoint":"src/blueprints/index.ts","inputs":{},"bytes":448},"dist/lib/node-esm/chunk-NSFPC4IO.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1608},"dist/lib/node-esm/chunk-NSFPC4IO.mjs":{"imports":[{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"#operations","kind":"import-statement","external":true}],"exports":["chess_blueprint_default"],"inputs":{"src/blueprints/chess-blueprint.ts":{"bytesInOutput":830},"src/blueprints/index.ts":{"bytesInOutput":0}},"bytes":1043},"dist/lib/node-esm/operations/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/operations/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-4C4GPZTA.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-G2EHRXHX.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-OHBKSL2Q.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"}],"exports":["ChessHandlers","Create","Move","Play","Print"],"entryPoint":"src/operations/index.ts","inputs":{},"bytes":386},"dist/lib/node-esm/chunk-4C4GPZTA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":721},"dist/lib/node-esm/chunk-4C4GPZTA.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-G2EHRXHX.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"dist/lib/node-esm/create-CC2P7GPT.mjs","kind":"dynamic-import"},{"path":"dist/lib/node-esm/move-CYHXWHHM.mjs","kind":"dynamic-import"},{"path":"dist/lib/node-esm/play-KTNK2PBL.mjs","kind":"dynamic-import"},{"path":"dist/lib/node-esm/print-P23VKVNU.mjs","kind":"dynamic-import"}],"exports":["ChessHandlers","operations_exports"],"inputs":{"src/operations/index.ts":{"bytesInOutput":462}},"bytes":802},"dist/lib/node-esm/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1716},"dist/lib/node-esm/translations.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":973}},"bytes":1189},"dist/lib/node-esm/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/types/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-OHBKSL2Q.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"}],"exports":["Chess"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":253},"dist/lib/node-esm/create-CC2P7GPT.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1042},"dist/lib/node-esm/create-CC2P7GPT.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-G2EHRXHX.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-OHBKSL2Q.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/operations/create.ts","inputs":{"src/operations/create.ts":{"bytesInOutput":334}},"bytes":676},"dist/lib/node-esm/move-CYHXWHHM.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1880},"dist/lib/node-esm/move-CYHXWHHM.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-G2EHRXHX.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-OHBKSL2Q.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/operations/move.ts","inputs":{"src/operations/move.ts":{"bytesInOutput":652}},"bytes":961},"dist/lib/node-esm/play-KTNK2PBL.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2573},"dist/lib/node-esm/play-KTNK2PBL.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-G2EHRXHX.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-OHBKSL2Q.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/operations/play.ts","inputs":{"src/operations/play.ts":{"bytesInOutput":970}},"bytes":1279},"dist/lib/node-esm/chunk-G2EHRXHX.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4773},"dist/lib/node-esm/chunk-G2EHRXHX.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-OHBKSL2Q.mjs","kind":"import-statement"},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["Create","Move","Play","Print"],"inputs":{"src/operations/definitions.ts":{"bytesInOutput":2575}},"bytes":2848},"dist/lib/node-esm/chunk-OHBKSL2Q.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2865},"dist/lib/node-esm/chunk-OHBKSL2Q.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-HSLMI22Q.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Chess_exports"],"inputs":{"src/types/Chess.ts":{"bytesInOutput":1589},"src/types/index.ts":{"bytesInOutput":0}},"bytes":1828},"dist/lib/node-esm/chunk-HSLMI22Q.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/chunk-HSLMI22Q.mjs":{"imports":[],"exports":["__export"],"inputs":{},"bytes":327}}}
|