@dxos/plugin-chess 0.8.4-main.1068cf700f → 0.8.4-main.1c7ec43d41
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 +9 -6
- package/dist/lib/browser/chunk-5FHUZILG.mjs +63 -0
- package/dist/lib/browser/chunk-5FHUZILG.mjs.map +7 -0
- package/dist/lib/browser/chunk-BCTL5GYK.mjs +88 -0
- package/dist/lib/browser/chunk-BCTL5GYK.mjs.map +7 -0
- package/dist/lib/browser/chunk-ORLWKOYE.mjs +26 -0
- package/dist/lib/browser/chunk-ORLWKOYE.mjs.map +7 -0
- package/dist/lib/browser/chunk-YER5TC5N.mjs +35 -0
- package/dist/lib/browser/chunk-YER5TC5N.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +27 -85
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/move-BH3WZUJH.mjs +39 -0
- package/dist/lib/browser/move-BH3WZUJH.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +17 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/play-IM4BDFSY.mjs +48 -0
- package/dist/lib/browser/play-IM4BDFSY.mjs.map +7 -0
- package/dist/lib/browser/print-M3ZO2XZT.mjs +30 -0
- package/dist/lib/browser/print-M3ZO2XZT.mjs.map +7 -0
- package/dist/lib/browser/translations.mjs +34 -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 +9 -6
- package/dist/lib/node-esm/chunk-A3P4HC7O.mjs +89 -0
- package/dist/lib/node-esm/chunk-A3P4HC7O.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-B42KRPBJ.mjs +37 -0
- package/dist/lib/node-esm/chunk-B42KRPBJ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WSHXDK3W.mjs +27 -0
- package/dist/lib/node-esm/chunk-WSHXDK3W.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-YRW4LYGF.mjs +64 -0
- package/dist/lib/node-esm/chunk-YRW4LYGF.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +27 -85
- 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-53HLCSAL.mjs +40 -0
- package/dist/lib/node-esm/move-53HLCSAL.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +18 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/play-YXXPG5SO.mjs +49 -0
- package/dist/lib/node-esm/play-YXXPG5SO.mjs.map +7 -0
- package/dist/lib/node-esm/print-L2LUM3IW.mjs +31 -0
- package/dist/lib/node-esm/print-L2LUM3IW.mjs.map +7 -0
- package/dist/lib/node-esm/translations.mjs +35 -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/ChessPlugin.node.d.ts +8 -0
- package/dist/types/src/ChessPlugin.node.d.ts.map +1 -0
- package/dist/types/src/ChessPlugin.test.d.ts +2 -0
- package/dist/types/src/ChessPlugin.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/chess-blueprint.d.ts +3 -20
- package/dist/types/src/blueprints/chess-blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +2 -2
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/game-variant.d.ts +6 -0
- package/dist/types/src/capabilities/game-variant.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +5 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +10 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/components/{Chessboard.d.ts → Chessboard/Chessboard.d.ts} +10 -11
- package/dist/types/src/components/Chessboard/Chessboard.d.ts.map +1 -0
- package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts +57 -0
- package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts.map +1 -0
- package/dist/types/src/components/{Info.d.ts → Chessboard/Info.d.ts} +5 -6
- package/dist/types/src/components/Chessboard/Info.d.ts.map +1 -0
- package/dist/types/src/components/Chessboard/index.d.ts +2 -0
- package/dist/types/src/components/Chessboard/index.d.ts.map +1 -0
- package/dist/types/src/components/Chessboard/types.d.ts +8 -0
- package/dist/types/src/components/Chessboard/types.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts +5 -0
- package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts +56 -0
- package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChessArticle/index.d.ts +2 -0
- package/dist/types/src/containers/ChessArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChessCard/ChessCard.d.ts +5 -0
- package/dist/types/src/containers/ChessCard/ChessCard.d.ts.map +1 -0
- package/dist/types/src/{components/Card.stories.d.ts → containers/ChessCard/ChessCard.stories.d.ts} +1 -1
- package/dist/types/src/containers/ChessCard/ChessCard.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChessCard/index.d.ts +2 -0
- package/dist/types/src/containers/ChessCard/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +4 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +24 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/move.d.ts +5 -0
- package/dist/types/src/operations/move.d.ts.map +1 -0
- package/dist/types/src/operations/play.d.ts +5 -0
- package/dist/types/src/operations/play.d.ts.map +1 -0
- package/dist/types/src/operations/print.d.ts +5 -0
- package/dist/types/src/operations/print.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +32 -23
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Chess.d.ts +10 -19
- package/dist/types/src/types/Chess.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +66 -48
- package/src/ChessPlugin.node.ts +23 -0
- package/src/ChessPlugin.test.ts +49 -0
- package/src/ChessPlugin.tsx +14 -23
- package/src/blueprints/chess-blueprint.ts +14 -9
- package/src/blueprints/index.ts +2 -2
- package/src/capabilities/blueprint-definition.ts +19 -0
- package/src/capabilities/game-variant.ts +42 -0
- package/src/capabilities/index.ts +10 -2
- package/src/capabilities/node.ts +18 -0
- package/src/capabilities/operation-handler.ts +14 -0
- package/src/components/Chessboard/Chessboard.stories.tsx +94 -0
- package/src/components/{Chessboard.tsx → Chessboard/Chessboard.tsx} +21 -31
- package/src/components/{Info.tsx → Chessboard/Info.tsx} +24 -77
- package/src/components/Chessboard/index.ts +5 -0
- package/src/components/Chessboard/types.ts +18 -0
- package/src/components/index.ts +1 -5
- package/src/{components/Chessboard.stories.tsx → containers/ChessArticle/ChessArticle.stories.tsx} +16 -10
- package/src/containers/ChessArticle/ChessArticle.tsx +108 -0
- package/src/containers/ChessArticle/index.ts +5 -0
- package/src/containers/ChessCard/ChessCard.stories.tsx +47 -0
- package/src/containers/ChessCard/ChessCard.tsx +27 -0
- package/src/containers/ChessCard/index.ts +5 -0
- package/src/containers/index.ts +8 -0
- package/src/index.ts +5 -3
- package/src/meta.ts +1 -1
- package/src/operations/definitions.ts +83 -0
- package/src/operations/index.ts +15 -0
- package/src/operations/move.ts +37 -0
- package/src/operations/play.ts +46 -0
- package/src/operations/print.ts +28 -0
- package/src/translations.ts +18 -21
- package/src/types/Chess.ts +25 -24
- package/dist/lib/browser/ChessboardContainer-GNSIZKY7.mjs +0 -80
- package/dist/lib/browser/ChessboardContainer-GNSIZKY7.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-YUKJZPOL.mjs +0 -19
- package/dist/lib/browser/blueprint-definition-YUKJZPOL.mjs.map +0 -7
- package/dist/lib/browser/chunk-66H3V2YV.mjs +0 -64
- package/dist/lib/browser/chunk-66H3V2YV.mjs.map +0 -7
- package/dist/lib/browser/chunk-H3NUMCQ6.mjs +0 -21
- package/dist/lib/browser/chunk-H3NUMCQ6.mjs.map +0 -7
- package/dist/lib/browser/chunk-MABHE5SS.mjs +0 -277
- package/dist/lib/browser/chunk-MABHE5SS.mjs.map +0 -7
- package/dist/lib/browser/chunk-PBRN5Q4R.mjs +0 -227
- package/dist/lib/browser/chunk-PBRN5Q4R.mjs.map +0 -7
- package/dist/lib/browser/chunk-QGVMZ4PK.mjs +0 -8
- package/dist/lib/browser/chunk-QGVMZ4PK.mjs.map +0 -7
- package/dist/lib/browser/cli/index.mjs +0 -29
- package/dist/lib/browser/cli/index.mjs.map +0 -7
- package/dist/lib/browser/react-surface-C52R6BRL.mjs +0 -38
- package/dist/lib/browser/react-surface-C52R6BRL.mjs.map +0 -7
- package/dist/lib/node-esm/ChessboardContainer-5OVYZMIW.mjs +0 -81
- package/dist/lib/node-esm/ChessboardContainer-5OVYZMIW.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-4HZ2HWWC.mjs +0 -20
- package/dist/lib/node-esm/blueprint-definition-4HZ2HWWC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3MAU6WHB.mjs +0 -228
- package/dist/lib/node-esm/chunk-3MAU6WHB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-F5OMIM4F.mjs +0 -23
- package/dist/lib/node-esm/chunk-F5OMIM4F.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IFK6UAKF.mjs +0 -10
- package/dist/lib/node-esm/chunk-IFK6UAKF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OUNGNJFP.mjs +0 -65
- package/dist/lib/node-esm/chunk-OUNGNJFP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-V6MKXXPO.mjs +0 -278
- package/dist/lib/node-esm/chunk-V6MKXXPO.mjs.map +0 -7
- package/dist/lib/node-esm/cli/index.mjs +0 -30
- package/dist/lib/node-esm/cli/index.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-NW33JZ6J.mjs +0 -39
- package/dist/lib/node-esm/react-surface-NW33JZ6J.mjs.map +0 -7
- package/dist/types/src/blueprints/functions/create.d.ts +0 -15
- package/dist/types/src/blueprints/functions/create.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/index.d.ts +0 -5
- package/dist/types/src/blueprints/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/move.d.ts +0 -16
- package/dist/types/src/blueprints/functions/move.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/play.d.ts +0 -17
- package/dist/types/src/blueprints/functions/play.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/print.d.ts +0 -8
- package/dist/types/src/blueprints/functions/print.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts +0 -12
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -10
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- 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 +0 -3
- package/dist/types/src/cli/plugin.d.ts.map +0 -1
- package/dist/types/src/components/Card.stories.d.ts.map +0 -1
- package/dist/types/src/components/Chessboard.d.ts.map +0 -1
- package/dist/types/src/components/Chessboard.stories.d.ts +0 -46
- package/dist/types/src/components/Chessboard.stories.d.ts.map +0 -1
- package/dist/types/src/components/ChessboardArticle.d.ts +0 -6
- package/dist/types/src/components/ChessboardArticle.d.ts.map +0 -1
- package/dist/types/src/components/ChessboardContainer.d.ts +0 -7
- package/dist/types/src/components/ChessboardContainer.d.ts.map +0 -1
- package/dist/types/src/components/Info.d.ts.map +0 -1
- package/src/blueprints/functions/create.ts +0 -38
- package/src/blueprints/functions/index.ts +0 -8
- package/src/blueprints/functions/move.ts +0 -48
- package/src/blueprints/functions/play.ts +0 -58
- package/src/blueprints/functions/print.ts +0 -42
- package/src/capabilities/artifact-definition/artifact-definition.ts +0 -135
- package/src/capabilities/artifact-definition/index.ts +0 -7
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +0 -24
- package/src/capabilities/blueprint-definition/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -28
- package/src/cli/index.ts +0 -5
- package/src/cli/plugin.ts +0 -27
- package/src/components/Card.stories.tsx +0 -47
- package/src/components/ChessboardArticle.tsx +0 -70
- package/src/components/ChessboardContainer.tsx +0 -40
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
meta
|
|
4
|
-
} from "./chunk-F5OMIM4F.mjs";
|
|
5
|
-
|
|
6
|
-
// src/components/Chessboard.tsx
|
|
7
|
-
import { RegistryContext } from "@effect-atom/atom-react";
|
|
8
|
-
import React2, { forwardRef, useCallback, useContext, useEffect as useEffect2, useImperativeHandle, useMemo as useMemo2, useRef as useRef2 } from "react";
|
|
9
|
-
import { addEventListener } from "@dxos/async";
|
|
10
|
-
import { Obj as Obj2 } from "@dxos/echo";
|
|
11
|
-
import { ChessModel, Gameboard, Chessboard as NaturalChessboard, getRawPgn, useGameboardContext as useGameboardContext2 } from "@dxos/react-ui-gameboard";
|
|
12
|
-
import { useSoundEffect } from "@dxos/react-ui-sfx";
|
|
13
|
-
import { mx as mx2 } from "@dxos/ui-theme";
|
|
14
|
-
|
|
15
|
-
// src/components/Info.tsx
|
|
16
|
-
import { useAtomValue } from "@effect-atom/atom-react";
|
|
17
|
-
import React, { useEffect, useMemo, useRef } from "react";
|
|
18
|
-
import { generateName } from "@dxos/display-name";
|
|
19
|
-
import { Obj } from "@dxos/echo";
|
|
20
|
-
import { useMembers } from "@dxos/react-client/echo";
|
|
21
|
-
import { Icon, IconButton, Select, useTranslation } from "@dxos/react-ui";
|
|
22
|
-
import { useGameboardContext } from "@dxos/react-ui-gameboard";
|
|
23
|
-
import { mx } from "@dxos/ui-theme";
|
|
24
|
-
var INFO_NAME = "Chessboard.Info";
|
|
25
|
-
var Info = ({ classNames, orientation = "white", onOrientationChange, onClose, ...props }) => {
|
|
26
|
-
const { t } = useTranslation(meta.id);
|
|
27
|
-
const { model } = useGameboardContext(INFO_NAME);
|
|
28
|
-
const db = Obj.getDatabase(model.object);
|
|
29
|
-
const members = useMembers(db?.spaceId);
|
|
30
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
31
|
-
className: mx("grid grid-rows-[min-content_1fr_min-content] is-full min-is-[18rem] p-2 overflow-hidden bg-groupSurface rounded-sm", classNames)
|
|
32
|
-
}, /* @__PURE__ */ React.createElement(PlayerIndicator, {
|
|
33
|
-
model,
|
|
34
|
-
player: orientation === "white" ? "black" : "white",
|
|
35
|
-
icon: onClose && /* @__PURE__ */ React.createElement(IconButton, {
|
|
36
|
-
icon: "ph--x--regular",
|
|
37
|
-
iconOnly: true,
|
|
38
|
-
label: t("close info button"),
|
|
39
|
-
size: 4,
|
|
40
|
-
onClick: onClose
|
|
41
|
-
})
|
|
42
|
-
}, /* @__PURE__ */ React.createElement(PlayerSelector, {
|
|
43
|
-
value: model.object.players?.[orientation === "white" ? "black" : "white"],
|
|
44
|
-
onValueChange: (value) => {
|
|
45
|
-
Obj.change(model.object, (obj) => {
|
|
46
|
-
obj.players[orientation === "white" ? "black" : "white"] = value;
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
members
|
|
50
|
-
})), /* @__PURE__ */ React.createElement(History, {
|
|
51
|
-
model,
|
|
52
|
-
...props
|
|
53
|
-
}), /* @__PURE__ */ React.createElement(PlayerIndicator, {
|
|
54
|
-
model,
|
|
55
|
-
player: orientation,
|
|
56
|
-
icon: onOrientationChange && /* @__PURE__ */ React.createElement(IconButton, {
|
|
57
|
-
classNames: mx("transition duration-200 ease-linear", orientation === "white" && "rotate-180"),
|
|
58
|
-
icon: "ph--arrows-clockwise--regular",
|
|
59
|
-
iconOnly: true,
|
|
60
|
-
label: t("flip board button"),
|
|
61
|
-
size: 4,
|
|
62
|
-
onClick: () => onOrientationChange(orientation === "white" ? "black" : "white")
|
|
63
|
-
})
|
|
64
|
-
}, /* @__PURE__ */ React.createElement(PlayerSelector, {
|
|
65
|
-
value: model.object.players?.[orientation],
|
|
66
|
-
onValueChange: (value) => {
|
|
67
|
-
Obj.change(model.object, (obj) => {
|
|
68
|
-
obj.players[orientation] = value;
|
|
69
|
-
});
|
|
70
|
-
},
|
|
71
|
-
members
|
|
72
|
-
})));
|
|
73
|
-
};
|
|
74
|
-
Info.displayName = INFO_NAME;
|
|
75
|
-
var History = ({ classNames, model, min, max, onSelect }) => {
|
|
76
|
-
const { t } = useTranslation(meta.id);
|
|
77
|
-
const moveIndex = useAtomValue(model.moveIndex);
|
|
78
|
-
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;
|
|
79
|
-
const history = model.game.history();
|
|
80
|
-
const moves = useMemo(() => history.reduce((acc, move, index) => {
|
|
81
|
-
if (index % 2 === 0) {
|
|
82
|
-
acc.push([
|
|
83
|
-
{
|
|
84
|
-
index,
|
|
85
|
-
move
|
|
86
|
-
}
|
|
87
|
-
]);
|
|
88
|
-
} else {
|
|
89
|
-
acc[acc.length - 1].push({
|
|
90
|
-
index,
|
|
91
|
-
move
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
return acc;
|
|
95
|
-
}, []), [
|
|
96
|
-
history.length
|
|
97
|
-
]);
|
|
98
|
-
const scrollerRef = useRef(null);
|
|
99
|
-
useEffect(() => {
|
|
100
|
-
scrollerRef.current?.scrollTo({
|
|
101
|
-
top: scrollerRef.current.scrollHeight
|
|
102
|
-
});
|
|
103
|
-
}, [
|
|
104
|
-
history.length
|
|
105
|
-
]);
|
|
106
|
-
useEffect(() => {
|
|
107
|
-
const div = scrollerRef.current?.querySelector(`[data-index="${moveIndex - 1}"]`);
|
|
108
|
-
scrollerRef.current?.classList.add("scrollbar-none");
|
|
109
|
-
div?.scrollIntoView({
|
|
110
|
-
behavior: "smooth"
|
|
111
|
-
});
|
|
112
|
-
scrollerRef.current?.classList.remove("scrollbar-none");
|
|
113
|
-
}, [
|
|
114
|
-
moveIndex
|
|
115
|
-
]);
|
|
116
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
117
|
-
ref: scrollerRef,
|
|
118
|
-
className: mx("overflow-y-auto", classNames),
|
|
119
|
-
style: {
|
|
120
|
-
minHeight: min === void 0 ? "auto" : `${min * 24}px`,
|
|
121
|
-
maxHeight: max === void 0 ? "auto" : `${max * 24}px`
|
|
122
|
-
}
|
|
123
|
-
}, moves.map(([a, b], index) => /* @__PURE__ */ React.createElement("div", {
|
|
124
|
-
key: index,
|
|
125
|
-
className: "grid grid-cols-[3rem_1fr_1fr_1rem] gap-2 pis-4 leading-1"
|
|
126
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
127
|
-
className: "content-center text-xs text-subdued"
|
|
128
|
-
}, index + 1), a && /* @__PURE__ */ React.createElement("div", {
|
|
129
|
-
"data-index": a.index,
|
|
130
|
-
className: mx("pis-2 cursor-pointer", a.index === moveIndex - 1 && "bg-primary-500"),
|
|
131
|
-
onClick: () => onSelect?.(a.index + 1)
|
|
132
|
-
}, a.move), b && /* @__PURE__ */ React.createElement("div", {
|
|
133
|
-
"data-index": b.index,
|
|
134
|
-
className: mx("pis-2 cursor-pointer", b.index === moveIndex - 1 && "bg-primary-500"),
|
|
135
|
-
onClick: () => onSelect?.(b.index + 1)
|
|
136
|
-
}, b.move))), label && /* @__PURE__ */ React.createElement("div", {
|
|
137
|
-
className: "text-center"
|
|
138
|
-
}, label));
|
|
139
|
-
};
|
|
140
|
-
var PlayerIndicator = ({ children, model, player, icon }) => {
|
|
141
|
-
const turn = player === (model.game.turn() === "w" ? "white" : "black");
|
|
142
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
143
|
-
className: "grid grid-cols-[2rem_1fr_2rem] gap-2 bs-[--rail-size] pli-1 flex items-center overflow-hidden"
|
|
144
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
145
|
-
className: "place-items-center"
|
|
146
|
-
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
147
|
-
icon: turn ? "ph--circle--fill" : "ph--circle--thin",
|
|
148
|
-
size: 6,
|
|
149
|
-
classNames: mx(turn && (model.game.isCheckmate() ? "text-red-500" : "text-green-500"))
|
|
150
|
-
})), /* @__PURE__ */ React.createElement("div", {
|
|
151
|
-
className: "truncate overflow-hidden items-center"
|
|
152
|
-
}, children), icon);
|
|
153
|
-
};
|
|
154
|
-
var PlayerSelector = ({ value, onValueChange, members }) => {
|
|
155
|
-
const { t } = useTranslation(meta.id);
|
|
156
|
-
return /* @__PURE__ */ React.createElement(Select.Root, {
|
|
157
|
-
value,
|
|
158
|
-
onValueChange
|
|
159
|
-
}, /* @__PURE__ */ React.createElement(Select.TriggerButton, {
|
|
160
|
-
placeholder: t("select player button")
|
|
161
|
-
}), /* @__PURE__ */ React.createElement(Select.Portal, null, /* @__PURE__ */ React.createElement(Select.Content, null, /* @__PURE__ */ React.createElement(Select.Viewport, null, members.map((member) => {
|
|
162
|
-
const memberKey = member.identity.identityKey.toHex();
|
|
163
|
-
const displayName = member.identity?.profile?.displayName || generateName(memberKey);
|
|
164
|
-
return /* @__PURE__ */ React.createElement(Select.Option, {
|
|
165
|
-
key: memberKey,
|
|
166
|
-
value: memberKey
|
|
167
|
-
}, displayName);
|
|
168
|
-
})), /* @__PURE__ */ React.createElement(Select.Arrow, null))));
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
// src/components/Chessboard.tsx
|
|
172
|
-
var ExtendedChessModel = class extends ChessModel {
|
|
173
|
-
object;
|
|
174
|
-
constructor(registry, object) {
|
|
175
|
-
super(registry), this.object = object;
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
var Root = /* @__PURE__ */ forwardRef(({ game, children }, forwardedRef) => {
|
|
179
|
-
const registry = useContext(RegistryContext);
|
|
180
|
-
const model = useMemo2(() => new ExtendedChessModel(registry, game), [
|
|
181
|
-
registry
|
|
182
|
-
]);
|
|
183
|
-
const click = useSoundEffect("Click");
|
|
184
|
-
useImperativeHandle(forwardedRef, () => {
|
|
185
|
-
return {
|
|
186
|
-
setMoveNumber: (index) => model.setMoveIndex(index)
|
|
187
|
-
};
|
|
188
|
-
}, [
|
|
189
|
-
model
|
|
190
|
-
]);
|
|
191
|
-
useEffect2(() => {
|
|
192
|
-
if (model.pgn !== getRawPgn(game.pgn ?? "")) {
|
|
193
|
-
const silent = model.pgn === "*";
|
|
194
|
-
model.update(game.pgn);
|
|
195
|
-
if (!silent) {
|
|
196
|
-
void click.play();
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}, [
|
|
200
|
-
game.pgn
|
|
201
|
-
]);
|
|
202
|
-
const handleDrop = useCallback((move) => {
|
|
203
|
-
if (!model.makeMove(move)) {
|
|
204
|
-
return false;
|
|
205
|
-
}
|
|
206
|
-
void click.play();
|
|
207
|
-
Obj2.change(game, (g) => {
|
|
208
|
-
g.pgn = model.pgn;
|
|
209
|
-
});
|
|
210
|
-
return true;
|
|
211
|
-
}, [
|
|
212
|
-
model
|
|
213
|
-
]);
|
|
214
|
-
return /* @__PURE__ */ React2.createElement(Gameboard.Root, {
|
|
215
|
-
model,
|
|
216
|
-
onDrop: handleDrop
|
|
217
|
-
}, children);
|
|
218
|
-
});
|
|
219
|
-
var Content = ({ classNames, children, role }) => {
|
|
220
|
-
return /* @__PURE__ */ React2.createElement(Gameboard.Content, {
|
|
221
|
-
classNames: mx2(classNames, role === "card--popover" && "size-container card-square"),
|
|
222
|
-
grow: !role || role === "card--extrinsic",
|
|
223
|
-
contain: !role || role === "card--extrinsic" || role === "card--popover"
|
|
224
|
-
}, children);
|
|
225
|
-
};
|
|
226
|
-
var BOARD_NAME = "Chessboard.Board";
|
|
227
|
-
var Board = (props) => {
|
|
228
|
-
const registry = useContext(RegistryContext);
|
|
229
|
-
const { model } = useGameboardContext2(BOARD_NAME);
|
|
230
|
-
const ref = useRef2(null);
|
|
231
|
-
useEffect2(() => {
|
|
232
|
-
if (!ref.current) {
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
ref.current.setAttribute("data-arrow-keys", "all");
|
|
236
|
-
return addEventListener(ref.current, "keydown", (ev) => {
|
|
237
|
-
const moveIndex = registry.get(model.moveIndex);
|
|
238
|
-
switch (ev.key) {
|
|
239
|
-
case "ArrowUp":
|
|
240
|
-
model.setMoveIndex(0);
|
|
241
|
-
break;
|
|
242
|
-
case "ArrowDown":
|
|
243
|
-
model.setMoveIndex(model.game.history().length);
|
|
244
|
-
break;
|
|
245
|
-
case "ArrowLeft":
|
|
246
|
-
if (moveIndex > 0) {
|
|
247
|
-
model.setMoveIndex(moveIndex - 1);
|
|
248
|
-
}
|
|
249
|
-
break;
|
|
250
|
-
case "ArrowRight":
|
|
251
|
-
if (moveIndex < model.game.history().length) {
|
|
252
|
-
model.setMoveIndex(moveIndex + 1);
|
|
253
|
-
}
|
|
254
|
-
break;
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
}, [
|
|
258
|
-
registry,
|
|
259
|
-
model
|
|
260
|
-
]);
|
|
261
|
-
return /* @__PURE__ */ React2.createElement(NaturalChessboard, {
|
|
262
|
-
ref,
|
|
263
|
-
...props
|
|
264
|
-
});
|
|
265
|
-
};
|
|
266
|
-
Board.displayName = BOARD_NAME;
|
|
267
|
-
var Chessboard = {
|
|
268
|
-
Root,
|
|
269
|
-
Content,
|
|
270
|
-
Board,
|
|
271
|
-
Info
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
export {
|
|
275
|
-
ExtendedChessModel,
|
|
276
|
-
Chessboard
|
|
277
|
-
};
|
|
278
|
-
//# sourceMappingURL=chunk-V6MKXXPO.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/Chessboard.tsx", "../../../src/components/Info.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Registry, 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 { Obj } from '@dxos/echo';\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport {\n 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';\nimport { mx } from '@dxos/ui-theme';\n\nimport { type Chess } from '../types';\n\nimport { Info, type InfoProps } from './Info';\n\nexport interface ChessboardController {\n setMoveNumber(index: number): void;\n}\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//\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\n // Controller.\n useImperativeHandle(forwardedRef, () => {\n return {\n setMoveNumber: (index) => model.setMoveIndex(index),\n };\n }, [model]);\n\n // External change.\n // NOTE: Warning if user has not interacted with the board.\n useEffect(() => {\n if (model.pgn !== getRawPgn(game.pgn ?? '')) {\n const silent = model.pgn === '*';\n model.update(game.pgn);\n if (!silent) {\n void click.play();\n }\n }\n }, [game.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 Obj.change(game, (g) => {\n g.pgn = model.pgn;\n });\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--popover' | 'card--intrinsic' | 'card--extrinsic';\n\ntype ContentProps = ThemedClassName<PropsWithChildren<{ role?: Role }>>;\n\nconst Content = ({ classNames, children, role }: ContentProps) => {\n return (\n <Gameboard.Content\n classNames={mx(classNames, role === 'card--popover' && 'size-container card-square')}\n grow={!role || role === 'card--extrinsic'}\n contain={!role || role === 'card--extrinsic' || role === 'card--popover'}\n >\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 ref={ref} {...props} />;\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 './Chessboard';\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] is-full min-is-[18rem] p-2 overflow-hidden bg-groupSurface rounded-sm',\n classNames,\n )}\n >\n <PlayerIndicator\n model={model}\n player={orientation === 'white' ? 'black' : 'white'}\n icon={\n onClose && (\n <IconButton icon='ph--x--regular' iconOnly label={t('close info button')} size={4} onClick={onClose} />\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 pis-4 leading-1'>\n <div className='content-center text-xs text-subdued'>{index + 1}</div>\n {a && (\n <div\n data-index={a.index}\n className={mx('pis-2 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('pis-2 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 bs-[--rail-size] pli-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-red-500' : 'text-green-500'))}\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"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,SAAwBA,uBAAuB;AAC/C,OAAOC,UAELC,YACAC,aACAC,YACAC,aAAAA,YACAC,qBACAC,WAAAA,UACAC,UAAAA,eACK;AAEP,SAASC,wBAAwB;AACjC,SAASC,OAAAA,YAAW;AAEpB,SACEC,YACAC,WAEAC,cAAcC,mBAEdC,WACAC,u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C,aAAa;AAInB,IAAMC,QAAQ,CAACC,UAAAA;AACb,QAAMzC,WAAWO,WAAWC,eAAAA;AAC5B,QAAM,EAAEC,MAAK,IAAKiC,qBAAgCH,UAAAA;AAGlD,QAAMI,MAAMC,QAAuB,IAAA;AACnC3B,EAAAA,WAAU,MAAA;AACR,QAAI,CAAC0B,IAAIE,SAAS;AAChB;IACF;AAGAF,QAAIE,QAAQC,aAAa,mBAAmB,KAAA;AAE5C,WAAOC,iBAAiBJ,IAAIE,SAAS,WAAW,CAACG,OAAAA;AAC/C,YAAMC,YAAYjD,SAASkD,IAAIzC,MAAMwC,SAAS;AAC9C,cAAQD,GAAGG,KAAG;QACZ,KAAK;AACH1C,gBAAMO,aAAa,CAAA;AACnB;QACF,KAAK;AACHP,gBAAMO,aAAaP,MAAML,KAAKgD,QAAO,EAAGC,MAAM;AAC9C;QACF,KAAK;AACH,cAAIJ,YAAY,GAAG;AACjBxC,kBAAMO,aAAaiC,YAAY,CAAA;UACjC;AACA;QACF,KAAK;AACH,cAAIA,YAAYxC,MAAML,KAAKgD,QAAO,EAAGC,QAAQ;AAC3C5C,kBAAMO,aAAaiC,YAAY,CAAA;UACjC;AACA;MACJ;IACF,CAAA;EACF,GAAG;IAACjD;IAAUS;GAAM;AAEpB,SAAO,gBAAAqB,OAAA,cAACwB,mBAAAA;IAAkBX;IAAW,GAAGF;;AAC1C;AAEAD,MAAMe,cAAchB;AAMb,IAAMiB,aAAa;EACxBtD;EACA+B;EACAO;EACAiB;AACF;",
|
|
6
|
-
"names": ["RegistryContext", "React", "forwardRef", "useCallback", "useContext", "useEffect", "useImperativeHandle", "useMemo", "useRef", "addEventListener", "Obj", "ChessModel", "Gameboard", "Chessboard", "NaturalChessboard", "getRawPgn", "useGameboardContext", "useSoundEffect", "mx", "useAtomValue", "React", "useEffect", "useMemo", "useRef", "generateName", "Obj", "useMembers", "Icon", "IconButton", "Select", "useTranslation", "useGameboardContext", "mx", "INFO_NAME", "Info", "classNames", "orientation", "onOrientationChange", "onClose", "props", "t", "useTranslation", "meta", "id", "model", "useGameboardContext", "db", "Obj", "getDatabase", "object", "members", "useMembers", "spaceId", "div", "className", "mx", "PlayerIndicator", "player", "icon", "IconButton", "iconOnly", "label", "size", "onClick", "PlayerSelector", "value", "players", "onValueChange", "change", "obj", "History", "displayName", "min", "max", "onSelect", "moveIndex", "useAtomValue", "game", "isGameOver", "isCheckmate", "isStalemate", "isCheck", "undefined", "history", "moves", "useMemo", "reduce", "acc", "move", "index", "push", "length", "scrollerRef", "useRef", "useEffect", "current", "scrollTo", "top", "scrollHeight", "querySelector", "classList", "add", "scrollIntoView", "behavior", "remove", "ref", "style", "minHeight", "maxHeight", "map", "a", "b", "key", "data-index", "children", "turn", "Icon", "Select", "Root", "TriggerButton", "placeholder", "Portal", "Content", "Viewport", "member", "memberKey", "identity", "identityKey", "toHex", "profile", "generateName", "Option", "Arrow", "ExtendedChessModel", "ChessModel", "registry", "object", "Root", "forwardRef", "game", "children", "forwardedRef", "useContext", "RegistryContext", "model", "useMemo", "click", "useSoundEffect", "useImperativeHandle", "setMoveNumber", "index", "setMoveIndex", "useEffect", "pgn", "getRawPgn", "silent", "update", "play", "handleDrop", "useCallback", "move", "makeMove", "Obj", "change", "g", "React", "Gameboard", "onDrop", "Content", "classNames", "role", "mx", "grow", "contain", "BOARD_NAME", "Board", "props", "useGameboardContext", "ref", "useRef", "current", "setAttribute", "addEventListener", "ev", "moveIndex", "get", "key", "history", "length", "NaturalChessboard", "displayName", "Chessboard", "Info"]
|
|
7
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
Chess_exports
|
|
4
|
-
} from "../chunk-OUNGNJFP.mjs";
|
|
5
|
-
import {
|
|
6
|
-
meta
|
|
7
|
-
} from "../chunk-F5OMIM4F.mjs";
|
|
8
|
-
import "../chunk-HSLMI22Q.mjs";
|
|
9
|
-
|
|
10
|
-
// src/cli/plugin.ts
|
|
11
|
-
import * as Effect from "effect/Effect";
|
|
12
|
-
import { Plugin } from "@dxos/app-framework";
|
|
13
|
-
import { AppPlugin } from "@dxos/app-toolkit";
|
|
14
|
-
var ChessPlugin = Plugin.define(meta).pipe(AppPlugin.addMetadataModule({
|
|
15
|
-
metadata: {
|
|
16
|
-
id: Chess_exports.Game.typename,
|
|
17
|
-
metadata: {
|
|
18
|
-
createObject: (props) => Effect.sync(() => Chess_exports.make(props)),
|
|
19
|
-
addToCollectionOnCreate: true
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}), AppPlugin.addSchemaModule({
|
|
23
|
-
schema: [
|
|
24
|
-
Chess_exports.Game
|
|
25
|
-
]
|
|
26
|
-
}), Plugin.make);
|
|
27
|
-
export {
|
|
28
|
-
ChessPlugin
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 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 { 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) => Effect.sync(() => Chess.make(props))) satisfies CreateObject,\n addToCollectionOnCreate: true,\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;AAOnB,IAAMC,cAAcC,OAAOC,OAAOC,IAAAA,EAAMC,KAC7CC,UAAUC,kBAAkB;EAC1BC,UAAU;IACRC,IAAIC,cAAMC,KAAKC;IACfJ,UAAU;MACRK,cAAe,CAACC,UAAiBC,YAAK,MAAML,cAAMM,KAAKF,KAAAA,CAAAA;MACvDG,yBAAyB;IAC3B;EACF;AACF,CAAA,GACAX,UAAUY,gBAAgB;EAAEC,QAAQ;IAACT,cAAMC;;AAAM,CAAA,GACjDT,OAAOc,IAAI;",
|
|
6
|
-
"names": ["Effect", "Plugin", "AppPlugin", "ChessPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addMetadataModule", "metadata", "id", "Chess", "Game", "typename", "createObject", "props", "sync", "make", "addToCollectionOnCreate", "addSchemaModule", "schema"]
|
|
7
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
ChessboardContainer
|
|
4
|
-
} from "./chunk-IFK6UAKF.mjs";
|
|
5
|
-
import {
|
|
6
|
-
Chess_exports
|
|
7
|
-
} from "./chunk-OUNGNJFP.mjs";
|
|
8
|
-
import "./chunk-V6MKXXPO.mjs";
|
|
9
|
-
import {
|
|
10
|
-
meta
|
|
11
|
-
} from "./chunk-F5OMIM4F.mjs";
|
|
12
|
-
import "./chunk-HSLMI22Q.mjs";
|
|
13
|
-
|
|
14
|
-
// src/capabilities/react-surface/react-surface.tsx
|
|
15
|
-
import * as Effect from "effect/Effect";
|
|
16
|
-
import React from "react";
|
|
17
|
-
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
18
|
-
import { Surface } from "@dxos/app-framework/ui";
|
|
19
|
-
import { Obj } from "@dxos/echo";
|
|
20
|
-
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, [
|
|
21
|
-
Surface.create({
|
|
22
|
-
id: meta.id,
|
|
23
|
-
role: [
|
|
24
|
-
"article",
|
|
25
|
-
"section",
|
|
26
|
-
"card--content"
|
|
27
|
-
],
|
|
28
|
-
// TODO(burdon): Could this be standardized so that we don't require a subject property.
|
|
29
|
-
filter: (data) => Obj.instanceOf(Chess_exports.Game, data.subject),
|
|
30
|
-
component: ({ data, role }) => /* @__PURE__ */ React.createElement(ChessboardContainer, {
|
|
31
|
-
role,
|
|
32
|
-
subject: data.subject
|
|
33
|
-
})
|
|
34
|
-
})
|
|
35
|
-
])));
|
|
36
|
-
export {
|
|
37
|
-
react_surface_default as default
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=react-surface-NW33JZ6J.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { Obj } from '@dxos/echo';\n\nimport { ChessboardContainer } from '../../components';\nimport { meta } from '../../meta';\nimport { Chess } from '../../types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactSurface, [\n Surface.create({\n id: meta.id,\n role: ['article', 'section', 'card--content'],\n // TODO(burdon): Could this be standardized so that we don't require a subject property.\n filter: (data): data is { subject: Chess.Game } => Obj.instanceOf(Chess.Game, data.subject),\n component: ({ data, role }) => <ChessboardContainer role={role} subject={data.subject} />,\n }),\n ]),\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,eAAe;AACxB,SAASC,WAAW;AAMpB,IAAA,wBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YAAYC,aAAaC,cAAc;EAChDC,QAAQC,OAAO;IACbC,IAAIC,KAAKD;IACTE,MAAM;MAAC;MAAW;MAAW;;;IAE7BC,QAAQ,CAACC,SAA0CC,IAAIC,WAAWC,cAAMC,MAAMJ,KAAKK,OAAO;IAC1FC,WAAW,CAAC,EAAEN,MAAMF,KAAI,MAAO,sBAAA,cAACS,qBAAAA;MAAoBT;MAAYO,SAASL,KAAKK;;EAChF,CAAA;CACD,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "React", "Capabilities", "Capability", "Surface", "Obj", "Capability", "makeModule", "succeed", "contributes", "Capabilities", "ReactSurface", "Surface", "create", "id", "meta", "role", "filter", "data", "Obj", "instanceOf", "Chess", "Game", "subject", "component", "ChessboardContainer"]
|
|
7
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
declare const _default: import("@dxos/functions").FunctionDefinition<{
|
|
2
|
-
readonly name?: string | undefined;
|
|
3
|
-
readonly pgn?: string | undefined;
|
|
4
|
-
readonly fen?: string | undefined;
|
|
5
|
-
}, import("@dxos/echo/Obj").Obj<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
6
|
-
readonly name?: string | undefined;
|
|
7
|
-
readonly players?: {
|
|
8
|
-
readonly white?: string | undefined;
|
|
9
|
-
readonly black?: string | undefined;
|
|
10
|
-
} | undefined;
|
|
11
|
-
readonly pgn?: string | undefined;
|
|
12
|
-
readonly fen?: string | undefined;
|
|
13
|
-
}>, import("@dxos/functions").FunctionServices>;
|
|
14
|
-
export default _default;
|
|
15
|
-
//# sourceMappingURL=create.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../../src/blueprints/functions/create.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAYA,wBAyBG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/blueprints/functions/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
declare const _default: import("@dxos/functions").FunctionDefinition<{
|
|
2
|
-
readonly game: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
3
|
-
readonly name?: string | undefined;
|
|
4
|
-
readonly players?: {
|
|
5
|
-
readonly white?: string | undefined;
|
|
6
|
-
readonly black?: string | undefined;
|
|
7
|
-
} | undefined;
|
|
8
|
-
readonly pgn?: string | undefined;
|
|
9
|
-
readonly fen?: string | undefined;
|
|
10
|
-
}>;
|
|
11
|
-
readonly move: string;
|
|
12
|
-
}, {
|
|
13
|
-
readonly pgn: string;
|
|
14
|
-
}, import("@dxos/functions").FunctionServices>;
|
|
15
|
-
export default _default;
|
|
16
|
-
//# sourceMappingURL=move.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"move.d.ts","sourceRoot":"","sources":["../../../../../src/blueprints/functions/move.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAaA,wBAkCG"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
declare const _default: import("@dxos/functions").FunctionDefinition<{
|
|
2
|
-
readonly game: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
3
|
-
readonly name?: string | undefined;
|
|
4
|
-
readonly players?: {
|
|
5
|
-
readonly white?: string | undefined;
|
|
6
|
-
readonly black?: string | undefined;
|
|
7
|
-
} | undefined;
|
|
8
|
-
readonly pgn?: string | undefined;
|
|
9
|
-
readonly fen?: string | undefined;
|
|
10
|
-
}>;
|
|
11
|
-
readonly side?: "white" | "black" | "any" | undefined;
|
|
12
|
-
}, {
|
|
13
|
-
readonly pgn: string;
|
|
14
|
-
readonly move?: string | undefined;
|
|
15
|
-
}, import("@dxos/functions").FunctionServices>;
|
|
16
|
-
export default _default;
|
|
17
|
-
//# sourceMappingURL=play.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"play.d.ts","sourceRoot":"","sources":["../../../../../src/blueprints/functions/play.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAaA,wBA4CG"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
declare const _default: import("@dxos/functions").FunctionDefinition<{
|
|
2
|
-
readonly pgn?: string | undefined;
|
|
3
|
-
readonly fen?: string | undefined;
|
|
4
|
-
}, {
|
|
5
|
-
readonly ascii: string;
|
|
6
|
-
}, import("@dxos/functions").FunctionServices>;
|
|
7
|
-
export default _default;
|
|
8
|
-
//# sourceMappingURL=print.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"print.d.ts","sourceRoot":"","sources":["../../../../../src/blueprints/functions/print.ts"],"names":[],"mappings":";;;;;;AAUA,wBA+BG"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as Effect from 'effect/Effect';
|
|
2
|
-
import { Capability, type PromiseIntentDispatcher } from '@dxos/app-framework';
|
|
3
|
-
import { type Space } from '@dxos/react-client/echo';
|
|
4
|
-
declare global {
|
|
5
|
-
interface ToolContextExtensions {
|
|
6
|
-
space?: Space;
|
|
7
|
-
dispatch?: PromiseIntentDispatcher;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<any>, never, never>;
|
|
11
|
-
export default _default;
|
|
12
|
-
//# sourceMappingURL=artifact-definition.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"artifact-definition.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/artifact-definition/artifact-definition.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,OAAO,EAAgB,UAAU,EAAE,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAM7F,OAAO,EAAU,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAO7D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,QAAQ,CAAC,EAAE,uBAAuB,CAAC;KACpC;CACF;;AAED,wBAsGE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/artifact-definition/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,kBAAkB,oEAA+E,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as Effect from 'effect/Effect';
|
|
2
|
-
import { Capability } from '@dxos/app-framework';
|
|
3
|
-
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
4
|
-
export type BlueprintCapabilities = [
|
|
5
|
-
Capability.Capability<typeof AppCapabilities.Functions>,
|
|
6
|
-
Capability.Capability<typeof AppCapabilities.BlueprintDefinition>
|
|
7
|
-
];
|
|
8
|
-
declare const blueprintDefinition: (props?: [] | undefined) => Effect.Effect<BlueprintCapabilities, Error, Capability.Service>;
|
|
9
|
-
export default blueprintDefinition;
|
|
10
|
-
//# sourceMappingURL=blueprint-definition.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blueprint-definition.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/blueprint-definition/blueprint-definition.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIpD,MAAM,MAAM,qBAAqB,GAAG;IAClC,UAAU,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,SAAS,CAAC;IACvD,UAAU,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,mBAAmB,CAAC;CAClE,CAAC;AAEF,QAAA,MAAM,mBAAmB,6FAKxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/blueprint-definition/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,mBAAmB,8FAAiF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/react-surface/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,YAAY,iJAAmE,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import * as Effect from 'effect/Effect';
|
|
2
|
-
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
3
|
-
declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<Capabilities.ReactSurface>>, never, never>;
|
|
4
|
-
export default _default;
|
|
5
|
-
//# sourceMappingURL=react-surface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/react-surface/react-surface.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;;AAQ/D,wBAYE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/cli/plugin.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQ7C,eAAO,MAAM,WAAW,4BAYvB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Card.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Card.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAkB,MAAM,OAAO,CAAC;AA2BvC,QAAA,MAAM,IAAI;;;;;;;;CAQM,CAAC;AAEjB,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Chessboard.d.ts","sourceRoot":"","sources":["../../../../src/components/Chessboard.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAmB,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EAAE,EACZ,KAAK,iBAAiB,EAQvB,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EACL,UAAU,EAIV,KAAK,eAAe,IAAI,sBAAsB,EAG/C,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAE9C,MAAM,WAAW,oBAAoB;IACnC,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