@dxos/plugin-chess 0.7.5-main.9d2a38b → 0.7.5-main.ff8607b
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/ChessContainer-LPMACR6Y.mjs +106 -0
- package/dist/lib/browser/ChessContainer-LPMACR6Y.mjs.map +7 -0
- package/dist/lib/browser/{chunk-VHSLLEH3.mjs → chunk-KC36U5TF.mjs} +6 -3
- package/dist/lib/browser/{chunk-VHSLLEH3.mjs.map → chunk-KC36U5TF.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +8 -8
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-FUAOSHHX.mjs → intent-resolver-5CPSAZSA.mjs} +12 -9
- package/dist/lib/browser/{intent-resolver-FUAOSHHX.mjs.map → intent-resolver-5CPSAZSA.mjs.map} +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-63EO2PZO.mjs → react-surface-6J2N3V5R.mjs} +3 -3
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/ChessContainer-ZFOCAXZL.cjs +131 -0
- package/dist/lib/node/ChessContainer-ZFOCAXZL.cjs.map +7 -0
- package/dist/lib/node/{chunk-3BLH7NRV.cjs → chunk-BEZSGC5V.cjs} +9 -6
- package/dist/lib/node/{chunk-3BLH7NRV.cjs.map → chunk-BEZSGC5V.cjs.map} +3 -3
- package/dist/lib/node/index.cjs +21 -21
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-VTB6P3IL.cjs → intent-resolver-2YYMQ2H5.cjs} +15 -12
- package/dist/lib/node/{intent-resolver-VTB6P3IL.cjs.map → intent-resolver-2YYMQ2H5.cjs.map} +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-PO42G64E.cjs → react-surface-IOAB5AXZ.cjs} +8 -8
- package/dist/lib/node/types/index.cjs +5 -5
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/ChessContainer-DF6IFM2R.mjs +108 -0
- package/dist/lib/node-esm/ChessContainer-DF6IFM2R.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-M2CRYWX5.mjs → chunk-A6KO5IFZ.mjs} +6 -3
- package/dist/lib/node-esm/{chunk-M2CRYWX5.mjs.map → chunk-A6KO5IFZ.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +8 -8
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-MKEQFVZO.mjs → intent-resolver-XCT7HZ43.mjs} +12 -9
- package/dist/lib/node-esm/{intent-resolver-MKEQFVZO.mjs.map → intent-resolver-XCT7HZ43.mjs.map} +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-CXEBEDLT.mjs → react-surface-47I77M7F.mjs} +3 -3
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/ChessPlugin.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/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/components/ChessContainer.d.ts +4 -3
- package/dist/types/src/components/ChessContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChessPanel.d.ts +11 -0
- package/dist/types/src/components/ChessPanel.d.ts.map +1 -0
- package/dist/types/src/components/Chessboard.stories.d.ts +8 -0
- package/dist/types/src/components/Chessboard.stories.d.ts.map +1 -0
- package/dist/types/src/components/{Chess.d.ts → PlayerSelector.d.ts} +4 -5
- package/dist/types/src/components/PlayerSelector.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +2 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/package.json +19 -20
- package/src/ChessPlugin.tsx +5 -13
- package/src/capabilities/intent-resolver.ts +8 -5
- package/src/components/ChessContainer.tsx +41 -4
- package/src/components/ChessPanel.tsx +67 -0
- package/src/components/Chessboard.stories.tsx +39 -0
- package/src/components/{Chess.tsx → PlayerSelector.tsx} +2 -49
- package/src/meta.ts +3 -1
- package/dist/lib/browser/ChessContainer-JYXOZIDK.mjs +0 -505
- package/dist/lib/browser/ChessContainer-JYXOZIDK.mjs.map +0 -7
- package/dist/lib/node/ChessContainer-XRP7D63X.cjs +0 -518
- package/dist/lib/node/ChessContainer-XRP7D63X.cjs.map +0 -7
- package/dist/lib/node-esm/ChessContainer-37QUCUTD.mjs +0 -507
- package/dist/lib/node-esm/ChessContainer-37QUCUTD.mjs.map +0 -7
- package/dist/types/src/components/Chess.d.ts.map +0 -1
- package/dist/types/src/components/Chessboard/Chessboard.d.ts +0 -37
- package/dist/types/src/components/Chessboard/Chessboard.d.ts.map +0 -1
- package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts +0 -13
- package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts.map +0 -1
- package/dist/types/src/components/Chessboard/index.d.ts +0 -2
- package/dist/types/src/components/Chessboard/index.d.ts.map +0 -1
- package/dist/types/src/components/Chessboard/pieces/custom.d.ts +0 -3
- package/dist/types/src/components/Chessboard/pieces/custom.d.ts.map +0 -1
- package/dist/types/src/components/Chessboard/pieces/index.d.ts +0 -4
- package/dist/types/src/components/Chessboard/pieces/index.d.ts.map +0 -1
- package/dist/types/src/components/Chessboard/pieces/phosphor.d.ts +0 -3
- package/dist/types/src/components/Chessboard/pieces/phosphor.d.ts.map +0 -1
- package/dist/types/src/components/Chessboard/pieces/riohacha.d.ts +0 -3
- package/dist/types/src/components/Chessboard/pieces/riohacha.d.ts.map +0 -1
- package/src/components/Chessboard/Chessboard.stories.tsx +0 -43
- package/src/components/Chessboard/Chessboard.tsx +0 -170
- package/src/components/Chessboard/index.ts +0 -5
- package/src/components/Chessboard/pieces/custom.tsx +0 -82
- package/src/components/Chessboard/pieces/index.ts +0 -7
- package/src/components/Chessboard/pieces/phosphor.tsx +0 -71
- package/src/components/Chessboard/pieces/riohacha.tsx +0 -166
- /package/dist/lib/browser/{react-surface-63EO2PZO.mjs.map → react-surface-6J2N3V5R.mjs.map} +0 -0
- /package/dist/lib/node/{react-surface-PO42G64E.cjs.map → react-surface-IOAB5AXZ.cjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-CXEBEDLT.mjs.map → react-surface-47I77M7F.mjs.map} +0 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// packages/plugins/plugin-chess/src/components/ChessContainer.tsx
|
|
2
|
+
import { Chess } from "chess.js";
|
|
3
|
+
import React2, { useCallback, useEffect, useMemo } from "react";
|
|
4
|
+
import { getSpace } from "@dxos/react-client/echo";
|
|
5
|
+
import { ChessModel, Board, Chessboard } from "@dxos/react-ui-gameboard";
|
|
6
|
+
import { StackItem } from "@dxos/react-ui-stack";
|
|
7
|
+
|
|
8
|
+
// packages/plugins/plugin-chess/src/components/PlayerSelector.tsx
|
|
9
|
+
import { CrownCross } from "@phosphor-icons/react";
|
|
10
|
+
import React from "react";
|
|
11
|
+
import { generateName } from "@dxos/display-name";
|
|
12
|
+
import { useMembers } from "@dxos/react-client/echo";
|
|
13
|
+
import { Input, Select, useThemeContext } from "@dxos/react-ui";
|
|
14
|
+
import { getSize, mx } from "@dxos/react-ui-theme";
|
|
15
|
+
var PlayerSelector = ({ game, space }) => {
|
|
16
|
+
const members = useMembers(space.key);
|
|
17
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
18
|
+
role: "none",
|
|
19
|
+
className: "grid grid-cols-2 gap-8"
|
|
20
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
21
|
+
role: "none",
|
|
22
|
+
className: "flex flex-row-reverse items-center gap-2"
|
|
23
|
+
}, /* @__PURE__ */ React.createElement(PlayerSelect, {
|
|
24
|
+
side: "white",
|
|
25
|
+
value: game.playerWhite,
|
|
26
|
+
onValueChange: (player) => game.playerWhite = player,
|
|
27
|
+
members
|
|
28
|
+
})), /* @__PURE__ */ React.createElement("div", {
|
|
29
|
+
role: "none",
|
|
30
|
+
className: "flex flex-row items-center gap-2"
|
|
31
|
+
}, /* @__PURE__ */ React.createElement(PlayerSelect, {
|
|
32
|
+
side: "black",
|
|
33
|
+
value: game.playerBlack,
|
|
34
|
+
onValueChange: (player) => game.playerBlack = player,
|
|
35
|
+
members
|
|
36
|
+
})));
|
|
37
|
+
};
|
|
38
|
+
var PlayerSelect = ({ side, value, onValueChange, members }) => {
|
|
39
|
+
const { themeMode } = useThemeContext();
|
|
40
|
+
const iconFillMode = side === "black" && themeMode === "light" || side === "white" && themeMode === "dark" ? "fill" : void 0;
|
|
41
|
+
return /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(Input.Label, null, /* @__PURE__ */ React.createElement(CrownCross, {
|
|
42
|
+
className: mx(getSize(6)),
|
|
43
|
+
weight: iconFillMode,
|
|
44
|
+
"aria-label": `Chess icon for side ${side}`
|
|
45
|
+
})), /* @__PURE__ */ React.createElement(Select.Root, {
|
|
46
|
+
value,
|
|
47
|
+
onValueChange
|
|
48
|
+
}, /* @__PURE__ */ React.createElement(Select.TriggerButton, {
|
|
49
|
+
placeholder: "Select player"
|
|
50
|
+
}), /* @__PURE__ */ React.createElement(Select.Portal, null, /* @__PURE__ */ React.createElement(Select.Content, null, /* @__PURE__ */ React.createElement(Select.Viewport, null, members.map((member) => {
|
|
51
|
+
const memberKey = member.identity.identityKey.toHex();
|
|
52
|
+
const displayName = member.identity?.profile?.displayName || generateName(memberKey);
|
|
53
|
+
return /* @__PURE__ */ React.createElement(Select.Option, {
|
|
54
|
+
key: memberKey,
|
|
55
|
+
value: memberKey
|
|
56
|
+
}, displayName);
|
|
57
|
+
}))))));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// packages/plugins/plugin-chess/src/components/ChessContainer.tsx
|
|
61
|
+
var ChessContainer = ({ game }) => {
|
|
62
|
+
const model = useMemo(() => new ChessModel(), []);
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (!model || game.pgn !== model?.game.pgn()) {
|
|
65
|
+
const chess = new Chess();
|
|
66
|
+
if (game.pgn) {
|
|
67
|
+
chess.loadPgn(game.pgn);
|
|
68
|
+
}
|
|
69
|
+
model.initialize(chess.fen());
|
|
70
|
+
}
|
|
71
|
+
}, [
|
|
72
|
+
game.pgn
|
|
73
|
+
]);
|
|
74
|
+
const space = getSpace(game);
|
|
75
|
+
if (!space) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
const handleDrop = useCallback((move) => {
|
|
79
|
+
if (model.makeMove(move)) {
|
|
80
|
+
game.pgn = model.game.pgn();
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
return false;
|
|
84
|
+
}, [
|
|
85
|
+
model
|
|
86
|
+
]);
|
|
87
|
+
return /* @__PURE__ */ React2.createElement(StackItem.Content, {
|
|
88
|
+
toolbar: false
|
|
89
|
+
}, /* @__PURE__ */ React2.createElement("div", {
|
|
90
|
+
role: "none",
|
|
91
|
+
className: "grid grid-rows-[60px_1fr_60px] grow overflow-hidden"
|
|
92
|
+
}, /* @__PURE__ */ React2.createElement("div", null), /* @__PURE__ */ React2.createElement("div", {
|
|
93
|
+
className: "flex m-4 overflow-hidden"
|
|
94
|
+
}, /* @__PURE__ */ React2.createElement(Board.Root, {
|
|
95
|
+
model,
|
|
96
|
+
onDrop: handleDrop
|
|
97
|
+
}, /* @__PURE__ */ React2.createElement(Chessboard, null))), /* @__PURE__ */ React2.createElement(PlayerSelector, {
|
|
98
|
+
space,
|
|
99
|
+
game
|
|
100
|
+
})));
|
|
101
|
+
};
|
|
102
|
+
var ChessContainer_default = ChessContainer;
|
|
103
|
+
export {
|
|
104
|
+
ChessContainer_default as default
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=ChessContainer-LPMACR6Y.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/ChessContainer.tsx", "../../../src/components/PlayerSelector.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Chess } from 'chess.js';\nimport React, { useCallback, useEffect, useMemo } from 'react';\n\nimport { getSpace } from '@dxos/react-client/echo';\nimport { ChessModel, Board, Chessboard, type BoardRootProps } from '@dxos/react-ui-gameboard';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { PlayerSelector } from './PlayerSelector';\nimport { type GameType } from '../types';\n\nconst ChessContainer = ({ game }: { game: GameType; role?: string }) => {\n const model = useMemo(() => new ChessModel(), []);\n useEffect(() => {\n if (!model || game.pgn !== model?.game.pgn()) {\n const chess = new Chess();\n if (game.pgn) {\n chess.loadPgn(game.pgn);\n }\n\n model.initialize(chess.fen());\n }\n }, [game.pgn]);\n\n const space = getSpace(game);\n if (!space) {\n return null;\n }\n\n const handleDrop = useCallback<NonNullable<BoardRootProps['onDrop']>>(\n (move) => {\n if (model.makeMove(move)) {\n game.pgn = model.game.pgn();\n return true;\n }\n\n return false;\n },\n [model],\n );\n\n return (\n <StackItem.Content toolbar={false}>\n <div role='none' className='grid grid-rows-[60px_1fr_60px] grow overflow-hidden'>\n <div />\n\n <div className='flex m-4 overflow-hidden'>\n <Board.Root model={model} onDrop={handleDrop}>\n <Chessboard />\n </Board.Root>\n </div>\n\n <PlayerSelector space={space} game={game} />\n </div>\n </StackItem.Content>\n );\n};\n\nexport default ChessContainer;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { CrownCross } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport { generateName } from '@dxos/display-name';\nimport { useMembers, type Space, type SpaceMember } from '@dxos/react-client/echo';\nimport { Input, Select, useThemeContext } from '@dxos/react-ui';\nimport { getSize, mx } from '@dxos/react-ui-theme';\n\nimport { type GameType } from '../types';\n\nexport const PlayerSelector = ({ game, space }: { game: GameType; space: Space }) => {\n const members = useMembers(space.key);\n\n return (\n <div role='none' className='grid grid-cols-2 gap-8'>\n <div role='none' className='flex flex-row-reverse items-center gap-2'>\n <PlayerSelect\n side='white'\n value={game.playerWhite}\n onValueChange={(player) => (game.playerWhite = player)}\n members={members}\n />\n </div>\n <div role='none' className='flex flex-row items-center gap-2'>\n <PlayerSelect\n side='black'\n value={game.playerBlack}\n onValueChange={(player) => (game.playerBlack = player)}\n members={members}\n />\n </div>\n </div>\n );\n};\n\nconst PlayerSelect = ({\n side,\n value,\n onValueChange,\n members,\n}: {\n side: 'white' | 'black';\n value: string | undefined;\n onValueChange: (player: string) => void;\n members: SpaceMember[];\n}) => {\n const { themeMode } = useThemeContext();\n const iconFillMode =\n (side === 'black' && themeMode === 'light') || (side === 'white' && themeMode === 'dark') ? 'fill' : undefined;\n\n return (\n <Input.Root>\n <Input.Label>\n <CrownCross className={mx(getSize(6))} weight={iconFillMode} aria-label={`Chess icon for side ${side}`} />\n </Input.Label>\n <Select.Root value={value} onValueChange={onValueChange}>\n <Select.TriggerButton placeholder={'Select player'} />\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.Content>\n </Select.Portal>\n </Select.Root>\n </Input.Root>\n );\n};\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,aAAa;AACtB,OAAOC,UAASC,aAAaC,WAAWC,eAAe;AAEvD,SAASC,gBAAgB;AACzB,SAASC,YAAYC,OAAOC,kBAAuC;AACnE,SAASC,iBAAiB;;;ACL1B,SAASC,kBAAkB;AAC3B,OAAOC,WAAW;AAElB,SAASC,oBAAoB;AAC7B,SAASC,kBAAgD;AACzD,SAASC,OAAOC,QAAQC,uBAAuB;AAC/C,SAASC,SAASC,UAAU;AAIrB,IAAMC,iBAAiB,CAAC,EAAEC,MAAMC,MAAK,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AAA,CAAA,CAAA,CAAA,CAAA;AAOd;;;ADjEA,IAAMI,iBAAiB,CAAC,EAAEC,KAAI,MAAqC;AACjE,QAAMC,QAAQC,QAAQ,MAAM,IAAIC,WAAAA,GAAc,CAAA,CAAE;AAChDC,YAAU,MAAA;AACR,QAAI,CAACH,SAASD,KAAKK,QAAQJ,OAAOD,KAAKK,IAAAA,GAAO;AAC5C,YAAMC,QAAQ,IAAIC,MAAAA;AAClB,UAAIP,KAAKK,KAAK;AACZC,cAAME,QAAQR,KAAKK,GAAG;MACxB;AAEAJ,YAAMQ,WAAWH,MAAMI,IAAG,CAAA;IAC5B;EACF,GAAG;IAACV,KAAKK;GAAI;AAEb,QAAMM,QAAQC,SAASZ,IAAAA;AACvB,MAAI,CAACW,OAAO;AACV,WAAO;EACT;AAEA,QAAME,aAAaC,YACjB,CAACC,SAAAA;AACC,QAAId,MAAMe,SAASD,IAAAA,GAAO;AACxBf,WAAKK,MAAMJ,MAAMD,KAAKK,IAAG;AACzB,aAAO;IACT;AAEA,WAAO;EACT,GACA;IAACJ;GAAM;AAGT,SACE,gBAAAgB,OAAA,cAACC,UAAUC,SAAO;IAACC,SAAS;KAC1B,gBAAAH,OAAA,cAACI,OAAAA;IAAIC,MAAK;IAAOC,WAAU;KACzB,gBAAAN,OAAA,cAACI,OAAAA,IAAAA,GAED,gBAAAJ,OAAA,cAACI,OAAAA;IAAIE,WAAU;KACb,gBAAAN,OAAA,cAACO,MAAMC,MAAI;IAACxB;IAAcyB,QAAQb;KAChC,gBAAAI,OAAA,cAACU,YAAAA,IAAAA,CAAAA,CAAAA,GAIL,gBAAAV,OAAA,cAACW,gBAAAA;IAAejB;IAAcX;;AAItC;AAEA,IAAA,yBAAeD;",
|
|
6
|
+
"names": ["Chess", "React", "useCallback", "useEffect", "useMemo", "getSpace", "ChessModel", "Board", "Chessboard", "StackItem", "CrownCross", "React", "generateName", "useMembers", "Input", "Select", "useThemeContext", "getSize", "mx", "PlayerSelector", "game", "space", "members", "useMembers", "key", "div", "role", "className", "PlayerSelect", "side", "value", "playerWhite", "onValueChange", "player", "playerBlack", "themeMode", "useThemeContext", "iconFillMode", "undefined", "Input", "Root", "Label", "CrownCross", "mx", "getSize", "weight", "aria-label", "Select", "TriggerButton", "placeholder", "Portal", "Content", "Viewport", "map", "member", "memberKey", "identity", "identityKey", "toHex", "displayName", "profile", "generateName", "Option", "ChessContainer", "game", "model", "useMemo", "ChessModel", "useEffect", "pgn", "chess", "Chess", "loadPgn", "initialize", "fen", "space", "getSpace", "handleDrop", "useCallback", "move", "makeMove", "React", "StackItem", "Content", "toolbar", "div", "role", "className", "Board", "Root", "onDrop", "Chessboard", "PlayerSelector"]
|
|
7
|
+
}
|
|
@@ -28,9 +28,12 @@ var CHESS_PLUGIN = "dxos.org/plugin/chess";
|
|
|
28
28
|
var meta = {
|
|
29
29
|
id: CHESS_PLUGIN,
|
|
30
30
|
name: "Chess",
|
|
31
|
-
description: "
|
|
31
|
+
description: "Chess is a simple plugin which allows you to render an interactive chessboard inside of a plank. This chessboard can be used for collaborative chess games, or for practice experiments with the LLM. ",
|
|
32
32
|
icon: "ph--shield-chevron--regular",
|
|
33
|
-
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-chess"
|
|
33
|
+
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-chess",
|
|
34
|
+
screenshots: [
|
|
35
|
+
"https://dxos.network/plugin-details-chess-dark.png"
|
|
36
|
+
]
|
|
34
37
|
};
|
|
35
38
|
|
|
36
39
|
// packages/plugins/plugin-chess/src/types/types.ts
|
|
@@ -60,4 +63,4 @@ export {
|
|
|
60
63
|
ChessAction,
|
|
61
64
|
isObject
|
|
62
65
|
};
|
|
63
|
-
//# sourceMappingURL=chunk-
|
|
66
|
+
//# sourceMappingURL=chunk-KC36U5TF.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/types/schema.ts", "../../../src/types/types.ts", "../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { S, TypedObject } from '@dxos/echo-schema';\n\nexport const MoveSchema = S.mutable(\n S.partial(\n S.Struct({\n source: S.String,\n target: S.String,\n piece: S.String,\n }),\n ),\n);\n\nexport class GameType extends TypedObject({ typename: 'dxos.org/type/Chess', version: '0.1.0' })(\n {\n name: S.optional(S.String),\n playerWhite: S.String,\n playerBlack: S.String,\n moves: S.mutable(S.Array(S.String)),\n pgn: S.String,\n },\n { partial: true },\n) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { S } from '@dxos/echo-schema';\nimport { isReactiveObject } from '@dxos/live-object';\n\nimport { GameType } from './schema';\nimport { CHESS_PLUGIN } from '../meta';\n\nexport namespace ChessAction {\n const CHESS_ACTION = `${CHESS_PLUGIN}/action`;\n\n export class Create extends S.TaggedClass<Create>()(`${CHESS_ACTION}/create`, {\n input: S.Struct({\n name: S.optional(S.String),\n }),\n output: S.Struct({\n object: GameType,\n }),\n }) {}\n}\n\nexport const isObject = (object: unknown): object is GameType => {\n return isReactiveObject(object) && object instanceof GameType;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const CHESS_PLUGIN = 'dxos.org/plugin/chess';\n\nexport const meta = {\n id: CHESS_PLUGIN,\n name: 'Chess',\n description
|
|
5
|
-
"mappings": ";AAIA,SAASA,GAAGC,mBAAmB;AAExB,IAAMC,aAAaC,EAAEC,QAC1BD,EAAEE,QACAF,EAAEG,OAAO;EACPC,QAAQJ,EAAEK;EACVC,QAAQN,EAAEK;EACVE,OAAOP,EAAEK;AACX,CAAA,CAAA,CAAA;AAIG,IAAMG,WAAN,cAAuBC,YAAY;EAAEC,UAAU;EAAuBC,SAAS;AAAQ,CAAA,EAC5F;EACEC,MAAMZ,EAAEa,SAASb,EAAEK,MAAM;EACzBS,aAAad,EAAEK;EACfU,aAAaf,EAAEK;EACfW,OAAOhB,EAAEC,QAAQD,EAAEiB,MAAMjB,EAAEK,MAAM,CAAA;EACjCa,KAAKlB,EAAEK;AACT,GACA;EAAEH,SAAS;AAAK,CAAA,EAAA;AACf;;;ACrBH,SAASiB,KAAAA,UAAS;AAClB,SAASC,wBAAwB;;;ACC1B,IAAMC,eAAe;AAErB,IAAMC,OAAO;EAClBC,IAAIF;EACJG,MAAM;EACNC,
|
|
6
|
-
"names": ["S", "TypedObject", "MoveSchema", "S", "mutable", "partial", "Struct", "source", "String", "target", "piece", "GameType", "TypedObject", "typename", "version", "name", "optional", "playerWhite", "playerBlack", "moves", "Array", "pgn", "S", "isReactiveObject", "CHESS_PLUGIN", "meta", "id", "name", "description", "icon", "source", "ChessAction", "CHESS_ACTION", "CHESS_PLUGIN", "Create", "S", "TaggedClass", "input", "Struct", "name", "optional", "String", "output", "object", "GameType", "isObject", "isReactiveObject"]
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { S, TypedObject } from '@dxos/echo-schema';\n\nexport const MoveSchema = S.mutable(\n S.partial(\n S.Struct({\n source: S.String,\n target: S.String,\n piece: S.String,\n }),\n ),\n);\n\nexport class GameType extends TypedObject({ typename: 'dxos.org/type/Chess', version: '0.1.0' })(\n {\n name: S.optional(S.String),\n playerWhite: S.String,\n playerBlack: S.String,\n moves: S.mutable(S.Array(S.String)),\n pgn: S.String,\n },\n { partial: true },\n) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { S } from '@dxos/echo-schema';\nimport { isReactiveObject } from '@dxos/live-object';\n\nimport { GameType } from './schema';\nimport { CHESS_PLUGIN } from '../meta';\n\nexport namespace ChessAction {\n const CHESS_ACTION = `${CHESS_PLUGIN}/action`;\n\n export class Create extends S.TaggedClass<Create>()(`${CHESS_ACTION}/create`, {\n input: S.Struct({\n name: S.optional(S.String),\n }),\n output: S.Struct({\n object: GameType,\n }),\n }) {}\n}\n\nexport const isObject = (object: unknown): object is GameType => {\n return isReactiveObject(object) && object instanceof GameType;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const CHESS_PLUGIN = 'dxos.org/plugin/chess';\n\nexport const meta = {\n id: CHESS_PLUGIN,\n name: 'Chess',\n description:\n 'Chess is a simple plugin which allows you to render an interactive chessboard inside of a plank. This chessboard can be used for collaborative chess games, or for practice experiments with the LLM. ',\n icon: 'ph--shield-chevron--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-chess',\n screenshots: ['https://dxos.network/plugin-details-chess-dark.png'],\n} satisfies PluginMeta;\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,GAAGC,mBAAmB;AAExB,IAAMC,aAAaC,EAAEC,QAC1BD,EAAEE,QACAF,EAAEG,OAAO;EACPC,QAAQJ,EAAEK;EACVC,QAAQN,EAAEK;EACVE,OAAOP,EAAEK;AACX,CAAA,CAAA,CAAA;AAIG,IAAMG,WAAN,cAAuBC,YAAY;EAAEC,UAAU;EAAuBC,SAAS;AAAQ,CAAA,EAC5F;EACEC,MAAMZ,EAAEa,SAASb,EAAEK,MAAM;EACzBS,aAAad,EAAEK;EACfU,aAAaf,EAAEK;EACfW,OAAOhB,EAAEC,QAAQD,EAAEiB,MAAMjB,EAAEK,MAAM,CAAA;EACjCa,KAAKlB,EAAEK;AACT,GACA;EAAEH,SAAS;AAAK,CAAA,EAAA;AACf;;;ACrBH,SAASiB,KAAAA,UAAS;AAClB,SAASC,wBAAwB;;;ACC1B,IAAMC,eAAe;AAErB,IAAMC,OAAO;EAClBC,IAAIF;EACJG,MAAM;EACNC,aACE;EACFC,MAAM;EACNC,QAAQ;EACRC,aAAa;IAAC;;AAChB;;;;UDNiBC,cAAAA;AACf,QAAMC,eAAe,GAAGC,YAAAA;EAEjB,MAAMC,eAAeC,GAAEC,YAAW,EAAW,GAAGJ,YAAAA,WAAuB;IAC5EK,OAAOF,GAAEG,OAAO;MACdC,MAAMJ,GAAEK,SAASL,GAAEM,MAAM;IAC3B,CAAA;IACAC,QAAQP,GAAEG,OAAO;MACfK,QAAQC;IACV,CAAA;EACF,CAAA,EAAA;EAAI;eAPSV,SAAAA;AAQf,GAXiBH,gBAAAA,cAAAA,CAAAA,EAAAA;AAaV,IAAMc,WAAW,CAACF,WAAAA;AACvB,SAAOG,iBAAiBH,MAAAA,KAAWA,kBAAkBC;AACvD;",
|
|
6
|
+
"names": ["S", "TypedObject", "MoveSchema", "S", "mutable", "partial", "Struct", "source", "String", "target", "piece", "GameType", "TypedObject", "typename", "version", "name", "optional", "playerWhite", "playerBlack", "moves", "Array", "pgn", "S", "isReactiveObject", "CHESS_PLUGIN", "meta", "id", "name", "description", "icon", "source", "screenshots", "ChessAction", "CHESS_ACTION", "CHESS_PLUGIN", "Create", "S", "TaggedClass", "input", "Struct", "name", "optional", "String", "output", "object", "GameType", "isObject", "isReactiveObject"]
|
|
7
7
|
}
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
ChessAction,
|
|
4
4
|
GameType,
|
|
5
5
|
meta
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KC36U5TF.mjs";
|
|
7
7
|
|
|
8
8
|
// packages/plugins/plugin-chess/src/ChessPlugin.tsx
|
|
9
|
-
import { Capabilities, contributes, createIntent, defineModule, definePlugin, Events
|
|
9
|
+
import { Capabilities, contributes, createIntent, defineModule, definePlugin, Events } from "@dxos/app-framework";
|
|
10
10
|
import { ClientCapabilities, ClientEvents } from "@dxos/plugin-client";
|
|
11
11
|
|
|
12
12
|
// packages/plugins/plugin-chess/src/capabilities/index.ts
|
|
13
13
|
import { lazy } from "@dxos/app-framework";
|
|
14
|
-
var IntentResolver = lazy(() => import("./intent-resolver-
|
|
15
|
-
var ReactSurface = lazy(() => import("./react-surface-
|
|
14
|
+
var IntentResolver = lazy(() => import("./intent-resolver-5CPSAZSA.mjs"));
|
|
15
|
+
var ReactSurface = lazy(() => import("./react-surface-6J2N3V5R.mjs"));
|
|
16
16
|
|
|
17
17
|
// packages/plugins/plugin-chess/src/translations.ts
|
|
18
18
|
var translations_default = [
|
|
@@ -40,7 +40,7 @@ var ChessPlugin = () => definePlugin(meta, [
|
|
|
40
40
|
}),
|
|
41
41
|
defineModule({
|
|
42
42
|
id: `${meta.id}/module/metadata`,
|
|
43
|
-
activatesOn:
|
|
43
|
+
activatesOn: Events.SetupMetadata,
|
|
44
44
|
activate: () => contributes(Capabilities.Metadata, {
|
|
45
45
|
id: GameType.typename,
|
|
46
46
|
metadata: {
|
|
@@ -57,19 +57,19 @@ var ChessPlugin = () => definePlugin(meta, [
|
|
|
57
57
|
}),
|
|
58
58
|
defineModule({
|
|
59
59
|
id: `${meta.id}/module/schema`,
|
|
60
|
-
activatesOn: ClientEvents.
|
|
60
|
+
activatesOn: ClientEvents.SetupSchema,
|
|
61
61
|
activate: () => contributes(ClientCapabilities.Schema, [
|
|
62
62
|
GameType
|
|
63
63
|
])
|
|
64
64
|
}),
|
|
65
65
|
defineModule({
|
|
66
66
|
id: `${meta.id}/module/react-surface`,
|
|
67
|
-
activatesOn: Events.
|
|
67
|
+
activatesOn: Events.SetupSurfaces,
|
|
68
68
|
activate: ReactSurface
|
|
69
69
|
}),
|
|
70
70
|
defineModule({
|
|
71
71
|
id: `${meta.id}/module/intent-resolver`,
|
|
72
|
-
activatesOn: Events.
|
|
72
|
+
activatesOn: Events.SetupIntents,
|
|
73
73
|
activate: IntentResolver
|
|
74
74
|
})
|
|
75
75
|
]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/ChessPlugin.tsx", "../../../src/capabilities/index.ts", "../../../src/translations.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,
|
|
6
|
-
"names": ["Capabilities", "contributes", "createIntent", "defineModule", "definePlugin", "Events", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Capabilities, contributes, createIntent, defineModule, definePlugin, Events } from '@dxos/app-framework';\nimport { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';\n\nimport { IntentResolver, ReactSurface } from './capabilities';\nimport { CHESS_PLUGIN, meta } from './meta';\nimport translations from './translations';\nimport { ChessAction, GameType } from './types';\n\nexport const ChessPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/metadata`,\n activatesOn: Events.SetupMetadata,\n activate: () =>\n contributes(Capabilities.Metadata, {\n id: GameType.typename,\n metadata: {\n createObject: (props: { name?: string }) => createIntent(ChessAction.Create, props),\n placeholder: ['game title placeholder', { ns: CHESS_PLUGIN }],\n icon: 'ph--shield-chevron--regular',\n },\n }),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () => contributes(ClientCapabilities.Schema, [GameType]),\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupSurfaces,\n activate: ReactSurface,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntents,\n activate: IntentResolver,\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CHESS_PLUGIN } from './meta';\nimport { GameType } from './types';\n\nexport default [\n {\n 'en-US': {\n [GameType.typename]: {\n 'typename label': 'Game',\n },\n [CHESS_PLUGIN]: {\n 'plugin name': 'Chess',\n 'game title placeholder': 'New game',\n 'create game label': 'Create game',\n 'delete game label': 'Delete',\n },\n },\n },\n];\n"],
|
|
5
|
+
"mappings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", "createIntent", "defineModule", "definePlugin", "Events", "ClientCapabilities", "ClientEvents", "lazy", "IntentResolver", "lazy", "ReactSurface", "GameType", "typename", "CHESS_PLUGIN", "ChessPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "SetupMetadata", "Metadata", "GameType", "typename", "metadata", "createObject", "props", "createIntent", "ChessAction", "Create", "placeholder", "ns", "CHESS_PLUGIN", "icon", "ClientEvents", "SetupSchema", "ClientCapabilities", "Schema", "SetupSurfaces", "ReactSurface", "SetupIntents", "IntentResolver"]
|
|
7
7
|
}
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ChessAction,
|
|
3
3
|
GameType
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KC36U5TF.mjs";
|
|
5
5
|
|
|
6
6
|
// packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts
|
|
7
7
|
import { Capabilities, contributes, createResolver } from "@dxos/app-framework";
|
|
8
8
|
import { create } from "@dxos/live-object";
|
|
9
|
-
var intent_resolver_default = () => contributes(Capabilities.IntentResolver, createResolver(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
})
|
|
9
|
+
var intent_resolver_default = () => contributes(Capabilities.IntentResolver, createResolver({
|
|
10
|
+
intent: ChessAction.Create,
|
|
11
|
+
resolve: ({ name }) => ({
|
|
12
|
+
data: {
|
|
13
|
+
object: create(GameType, {
|
|
14
|
+
name
|
|
15
|
+
})
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
}));
|
|
16
19
|
export {
|
|
17
20
|
intent_resolver_default as default
|
|
18
21
|
};
|
|
19
|
-
//# sourceMappingURL=intent-resolver-
|
|
22
|
+
//# sourceMappingURL=intent-resolver-5CPSAZSA.mjs.map
|
package/dist/lib/browser/{intent-resolver-FUAOSHHX.mjs.map → intent-resolver-5CPSAZSA.mjs.map}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/capabilities/intent-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, createResolver } from '@dxos/app-framework';\nimport { create } from '@dxos/live-object';\n\nimport { ChessAction, GameType } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.IntentResolver,\n createResolver(ChessAction.Create
|
|
5
|
-
"mappings": ";;;;;;AAIA,SAASA,cAAcC,aAAaC,sBAAsB;AAC1D,SAASC,cAAc;AAIvB,IAAA,0BAAe,MACbC,YACEC,aAAaC,gBACbC,
|
|
6
|
-
"names": ["Capabilities", "contributes", "createResolver", "create", "contributes", "Capabilities", "IntentResolver", "createResolver", "ChessAction", "Create", "name", "data", "object", "create", "GameType"]
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, createResolver } from '@dxos/app-framework';\nimport { create } from '@dxos/live-object';\n\nimport { ChessAction, GameType } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.IntentResolver,\n createResolver({\n intent: ChessAction.Create,\n resolve: ({ name }) => ({\n data: {\n object: create(GameType, { name }),\n },\n }),\n }),\n );\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,SAASA,cAAcC,aAAaC,sBAAsB;AAC1D,SAASC,cAAc;AAIvB,IAAA,0BAAe,MACbC,YACEC,aAAaC,gBACbC,eAAe;EACbC,QAAQC,YAAYC;EACpBC,SAAS,CAAC,EAAEC,KAAI,OAAQ;IACtBC,MAAM;MACJC,QAAQC,OAAOC,UAAU;QAAEJ;MAAK,CAAA;IAClC;EACF;AACF,CAAA,CAAA;",
|
|
6
|
+
"names": ["Capabilities", "contributes", "createResolver", "create", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ChessAction", "Create", "resolve", "name", "data", "object", "create", "GameType"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/plugin-chess/src/types/schema.ts":{"bytes":2461,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/meta.ts":{"bytes":1411,"imports":[],"format":"esm"},"packages/plugins/plugin-chess/src/types/types.ts":{"bytes":2799,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-chess/src/types/index.ts":{"bytes":586,"imports":[{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytes":1974,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/Chessboard/pieces/custom.tsx":{"bytes":32344,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/Chessboard/pieces/phosphor.tsx":{"bytes":6674,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/Chessboard/pieces/riohacha.tsx":{"bytes":30948,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/Chessboard/pieces/index.ts":{"bytes":704,"imports":[{"path":"packages/plugins/plugin-chess/src/components/Chessboard/pieces/custom.tsx","kind":"import-statement","original":"./custom"},{"path":"packages/plugins/plugin-chess/src/components/Chessboard/pieces/phosphor.tsx","kind":"import-statement","original":"./phosphor"},{"path":"packages/plugins/plugin-chess/src/components/Chessboard/pieces/riohacha.tsx","kind":"import-statement","original":"./riohacha"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/Chessboard/Chessboard.tsx":{"bytes":15769,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-chessboard","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/Chessboard/pieces/index.ts","kind":"import-statement","original":"./pieces"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/Chessboard/index.ts":{"bytes":529,"imports":[{"path":"packages/plugins/plugin-chess/src/components/Chessboard/Chessboard.tsx","kind":"import-statement","original":"./Chessboard"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/Chess.tsx":{"bytes":14027,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/invariant","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-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/Chessboard/index.ts","kind":"import-statement","original":"./Chessboard"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytes":2405,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/Chess.tsx","kind":"import-statement","original":"./Chess"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/index.ts":{"bytes":798,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","kind":"dynamic-import","original":"./ChessContainer"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytes":2649,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytes":1080,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/plugin-chess/src/translations.ts":{"bytes":1819,"imports":[{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytes":6788,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/index.ts":{"bytes":592,"imports":[{"path":"packages/plugins/plugin-chess/src/ChessPlugin.tsx","kind":"import-statement","original":"./ChessPlugin"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-chess/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4360},"packages/plugins/plugin-chess/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-VHSLLEH3.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-FUAOSHHX.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/react-surface-63EO2PZO.mjs","kind":"dynamic-import"}],"exports":["CHESS_PLUGIN","ChessPlugin","meta"],"entryPoint":"packages/plugins/plugin-chess/src/index.ts","inputs":{"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytesInOutput":1355},"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytesInOutput":190},"packages/plugins/plugin-chess/src/translations.ts":{"bytesInOutput":324},"packages/plugins/plugin-chess/src/index.ts":{"bytesInOutput":0}},"bytes":2266},"packages/plugins/plugin-chess/dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-chess/dist/lib/browser/types/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-VHSLLEH3.mjs","kind":"import-statement"}],"exports":["ChessAction","GameType","MoveSchema","isObject"],"entryPoint":"packages/plugins/plugin-chess/src/types/index.ts","inputs":{},"bytes":192},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-FUAOSHHX.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":978},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-FUAOSHHX.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-VHSLLEH3.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytesInOutput":323}},"bytes":562},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-JYXOZIDK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":47068},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-JYXOZIDK.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/invariant","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-theme","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-chessboard","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","inputs":{"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytesInOutput":495},"packages/plugins/plugin-chess/src/components/Chess.tsx":{"bytesInOutput":3989},"packages/plugins/plugin-chess/src/components/Chessboard/Chessboard.tsx":{"bytesInOutput":2364},"packages/plugins/plugin-chess/src/components/Chessboard/pieces/custom.tsx":{"bytesInOutput":12536},"packages/plugins/plugin-chess/src/components/Chessboard/pieces/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/components/Chessboard/pieces/phosphor.tsx":{"bytesInOutput":1678},"packages/plugins/plugin-chess/src/components/Chessboard/pieces/riohacha.tsx":{"bytesInOutput":11516},"packages/plugins/plugin-chess/src/components/Chessboard/index.ts":{"bytesInOutput":0}},"bytes":33320},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-63EO2PZO.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1559},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-63EO2PZO.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-VHSLLEH3.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-JYXOZIDK.mjs","kind":"dynamic-import"}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","inputs":{"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytesInOutput":434},"packages/plugins/plugin-chess/src/components/index.ts":{"bytesInOutput":104}},"bytes":900},"packages/plugins/plugin-chess/dist/lib/browser/chunk-VHSLLEH3.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3210},"packages/plugins/plugin-chess/dist/lib/browser/chunk-VHSLLEH3.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["CHESS_PLUGIN","ChessAction","GameType","MoveSchema","isObject","meta"],"inputs":{"packages/plugins/plugin-chess/src/types/schema.ts":{"bytesInOutput":430},"packages/plugins/plugin-chess/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/types/types.ts":{"bytesInOutput":558},"packages/plugins/plugin-chess/src/meta.ts":{"bytesInOutput":247}},"bytes":1573}}}
|
|
1
|
+
{"inputs":{"packages/plugins/plugin-chess/src/types/schema.ts":{"bytes":2461,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/meta.ts":{"bytes":2089,"imports":[],"format":"esm"},"packages/plugins/plugin-chess/src/types/types.ts":{"bytes":2799,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-chess/src/types/index.ts":{"bytes":586,"imports":[{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytes":2167,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytes":8757,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","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-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytes":6004,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx","kind":"import-statement","original":"./PlayerSelector"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/index.ts":{"bytes":798,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","kind":"dynamic-import","original":"./ChessContainer"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytes":2649,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytes":1080,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/plugin-chess/src/translations.ts":{"bytes":1819,"imports":[{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytes":6685,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/index.ts":{"bytes":592,"imports":[{"path":"packages/plugins/plugin-chess/src/ChessPlugin.tsx","kind":"import-statement","original":"./ChessPlugin"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-chess/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4298},"packages/plugins/plugin-chess/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-KC36U5TF.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-5CPSAZSA.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/react-surface-6J2N3V5R.mjs","kind":"dynamic-import"}],"exports":["CHESS_PLUGIN","ChessPlugin","meta"],"entryPoint":"packages/plugins/plugin-chess/src/index.ts","inputs":{"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytesInOutput":1336},"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytesInOutput":190},"packages/plugins/plugin-chess/src/translations.ts":{"bytesInOutput":324},"packages/plugins/plugin-chess/src/index.ts":{"bytesInOutput":0}},"bytes":2247},"packages/plugins/plugin-chess/dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-chess/dist/lib/browser/types/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-KC36U5TF.mjs","kind":"import-statement"}],"exports":["ChessAction","GameType","MoveSchema","isObject"],"entryPoint":"packages/plugins/plugin-chess/src/types/index.ts","inputs":{},"bytes":192},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-5CPSAZSA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1071},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-5CPSAZSA.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-KC36U5TF.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytesInOutput":360}},"bytes":599},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-LPMACR6Y.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7737},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-LPMACR6Y.mjs":{"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","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-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","inputs":{"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytesInOutput":1501},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytesInOutput":2299}},"bytes":4104},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-6J2N3V5R.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1559},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-6J2N3V5R.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-KC36U5TF.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-LPMACR6Y.mjs","kind":"dynamic-import"}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","inputs":{"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytesInOutput":434},"packages/plugins/plugin-chess/src/components/index.ts":{"bytesInOutput":104}},"bytes":900},"packages/plugins/plugin-chess/dist/lib/browser/chunk-KC36U5TF.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3507},"packages/plugins/plugin-chess/dist/lib/browser/chunk-KC36U5TF.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["CHESS_PLUGIN","ChessAction","GameType","MoveSchema","isObject","meta"],"inputs":{"packages/plugins/plugin-chess/src/types/schema.ts":{"bytesInOutput":430},"packages/plugins/plugin-chess/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/types/types.ts":{"bytesInOutput":558},"packages/plugins/plugin-chess/src/meta.ts":{"bytesInOutput":513}},"bytes":1839}}}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CHESS_PLUGIN,
|
|
3
3
|
isObject
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KC36U5TF.mjs";
|
|
5
5
|
|
|
6
6
|
// packages/plugins/plugin-chess/src/capabilities/react-surface.tsx
|
|
7
7
|
import React from "react";
|
|
@@ -9,7 +9,7 @@ import { Capabilities, contributes, createSurface } from "@dxos/app-framework";
|
|
|
9
9
|
|
|
10
10
|
// packages/plugins/plugin-chess/src/components/index.ts
|
|
11
11
|
import { lazy } from "react";
|
|
12
|
-
var ChessContainer = lazy(() => import("./ChessContainer-
|
|
12
|
+
var ChessContainer = lazy(() => import("./ChessContainer-LPMACR6Y.mjs"));
|
|
13
13
|
|
|
14
14
|
// packages/plugins/plugin-chess/src/capabilities/react-surface.tsx
|
|
15
15
|
var react_surface_default = () => contributes(Capabilities.ReactSurface, createSurface({
|
|
@@ -27,4 +27,4 @@ var react_surface_default = () => contributes(Capabilities.ReactSurface, createS
|
|
|
27
27
|
export {
|
|
28
28
|
react_surface_default as default
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=react-surface-
|
|
30
|
+
//# sourceMappingURL=react-surface-6J2N3V5R.mjs.map
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var ChessContainer_ZFOCAXZL_exports = {};
|
|
30
|
+
__export(ChessContainer_ZFOCAXZL_exports, {
|
|
31
|
+
default: () => ChessContainer_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(ChessContainer_ZFOCAXZL_exports);
|
|
34
|
+
var import_chess = require("chess.js");
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_echo = require("@dxos/react-client/echo");
|
|
37
|
+
var import_react_ui_gameboard = require("@dxos/react-ui-gameboard");
|
|
38
|
+
var import_react_ui_stack = require("@dxos/react-ui-stack");
|
|
39
|
+
var import_react2 = require("@phosphor-icons/react");
|
|
40
|
+
var import_react3 = __toESM(require("react"));
|
|
41
|
+
var import_display_name = require("@dxos/display-name");
|
|
42
|
+
var import_echo2 = require("@dxos/react-client/echo");
|
|
43
|
+
var import_react_ui = require("@dxos/react-ui");
|
|
44
|
+
var import_react_ui_theme = require("@dxos/react-ui-theme");
|
|
45
|
+
var PlayerSelector = ({ game, space }) => {
|
|
46
|
+
const members = (0, import_echo2.useMembers)(space.key);
|
|
47
|
+
return /* @__PURE__ */ import_react3.default.createElement("div", {
|
|
48
|
+
role: "none",
|
|
49
|
+
className: "grid grid-cols-2 gap-8"
|
|
50
|
+
}, /* @__PURE__ */ import_react3.default.createElement("div", {
|
|
51
|
+
role: "none",
|
|
52
|
+
className: "flex flex-row-reverse items-center gap-2"
|
|
53
|
+
}, /* @__PURE__ */ import_react3.default.createElement(PlayerSelect, {
|
|
54
|
+
side: "white",
|
|
55
|
+
value: game.playerWhite,
|
|
56
|
+
onValueChange: (player) => game.playerWhite = player,
|
|
57
|
+
members
|
|
58
|
+
})), /* @__PURE__ */ import_react3.default.createElement("div", {
|
|
59
|
+
role: "none",
|
|
60
|
+
className: "flex flex-row items-center gap-2"
|
|
61
|
+
}, /* @__PURE__ */ import_react3.default.createElement(PlayerSelect, {
|
|
62
|
+
side: "black",
|
|
63
|
+
value: game.playerBlack,
|
|
64
|
+
onValueChange: (player) => game.playerBlack = player,
|
|
65
|
+
members
|
|
66
|
+
})));
|
|
67
|
+
};
|
|
68
|
+
var PlayerSelect = ({ side, value, onValueChange, members }) => {
|
|
69
|
+
const { themeMode } = (0, import_react_ui.useThemeContext)();
|
|
70
|
+
const iconFillMode = side === "black" && themeMode === "light" || side === "white" && themeMode === "dark" ? "fill" : void 0;
|
|
71
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Input.Root, null, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Input.Label, null, /* @__PURE__ */ import_react3.default.createElement(import_react2.CrownCross, {
|
|
72
|
+
className: (0, import_react_ui_theme.mx)((0, import_react_ui_theme.getSize)(6)),
|
|
73
|
+
weight: iconFillMode,
|
|
74
|
+
"aria-label": `Chess icon for side ${side}`
|
|
75
|
+
})), /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Select.Root, {
|
|
76
|
+
value,
|
|
77
|
+
onValueChange
|
|
78
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Select.TriggerButton, {
|
|
79
|
+
placeholder: "Select player"
|
|
80
|
+
}), /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Select.Portal, null, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Select.Content, null, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Select.Viewport, null, members.map((member) => {
|
|
81
|
+
const memberKey = member.identity.identityKey.toHex();
|
|
82
|
+
const displayName = member.identity?.profile?.displayName || (0, import_display_name.generateName)(memberKey);
|
|
83
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Select.Option, {
|
|
84
|
+
key: memberKey,
|
|
85
|
+
value: memberKey
|
|
86
|
+
}, displayName);
|
|
87
|
+
}))))));
|
|
88
|
+
};
|
|
89
|
+
var ChessContainer = ({ game }) => {
|
|
90
|
+
const model = (0, import_react.useMemo)(() => new import_react_ui_gameboard.ChessModel(), []);
|
|
91
|
+
(0, import_react.useEffect)(() => {
|
|
92
|
+
if (!model || game.pgn !== model?.game.pgn()) {
|
|
93
|
+
const chess = new import_chess.Chess();
|
|
94
|
+
if (game.pgn) {
|
|
95
|
+
chess.loadPgn(game.pgn);
|
|
96
|
+
}
|
|
97
|
+
model.initialize(chess.fen());
|
|
98
|
+
}
|
|
99
|
+
}, [
|
|
100
|
+
game.pgn
|
|
101
|
+
]);
|
|
102
|
+
const space = (0, import_echo.getSpace)(game);
|
|
103
|
+
if (!space) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
const handleDrop = (0, import_react.useCallback)((move) => {
|
|
107
|
+
if (model.makeMove(move)) {
|
|
108
|
+
game.pgn = model.game.pgn();
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
return false;
|
|
112
|
+
}, [
|
|
113
|
+
model
|
|
114
|
+
]);
|
|
115
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react_ui_stack.StackItem.Content, {
|
|
116
|
+
toolbar: false
|
|
117
|
+
}, /* @__PURE__ */ import_react.default.createElement("div", {
|
|
118
|
+
role: "none",
|
|
119
|
+
className: "grid grid-rows-[60px_1fr_60px] grow overflow-hidden"
|
|
120
|
+
}, /* @__PURE__ */ import_react.default.createElement("div", null), /* @__PURE__ */ import_react.default.createElement("div", {
|
|
121
|
+
className: "flex m-4 overflow-hidden"
|
|
122
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_react_ui_gameboard.Board.Root, {
|
|
123
|
+
model,
|
|
124
|
+
onDrop: handleDrop
|
|
125
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_react_ui_gameboard.Chessboard, null))), /* @__PURE__ */ import_react.default.createElement(PlayerSelector, {
|
|
126
|
+
space,
|
|
127
|
+
game
|
|
128
|
+
})));
|
|
129
|
+
};
|
|
130
|
+
var ChessContainer_default = ChessContainer;
|
|
131
|
+
//# sourceMappingURL=ChessContainer-ZFOCAXZL.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/ChessContainer.tsx", "../../../src/components/PlayerSelector.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Chess } from 'chess.js';\nimport React, { useCallback, useEffect, useMemo } from 'react';\n\nimport { getSpace } from '@dxos/react-client/echo';\nimport { ChessModel, Board, Chessboard, type BoardRootProps } from '@dxos/react-ui-gameboard';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { PlayerSelector } from './PlayerSelector';\nimport { type GameType } from '../types';\n\nconst ChessContainer = ({ game }: { game: GameType; role?: string }) => {\n const model = useMemo(() => new ChessModel(), []);\n useEffect(() => {\n if (!model || game.pgn !== model?.game.pgn()) {\n const chess = new Chess();\n if (game.pgn) {\n chess.loadPgn(game.pgn);\n }\n\n model.initialize(chess.fen());\n }\n }, [game.pgn]);\n\n const space = getSpace(game);\n if (!space) {\n return null;\n }\n\n const handleDrop = useCallback<NonNullable<BoardRootProps['onDrop']>>(\n (move) => {\n if (model.makeMove(move)) {\n game.pgn = model.game.pgn();\n return true;\n }\n\n return false;\n },\n [model],\n );\n\n return (\n <StackItem.Content toolbar={false}>\n <div role='none' className='grid grid-rows-[60px_1fr_60px] grow overflow-hidden'>\n <div />\n\n <div className='flex m-4 overflow-hidden'>\n <Board.Root model={model} onDrop={handleDrop}>\n <Chessboard />\n </Board.Root>\n </div>\n\n <PlayerSelector space={space} game={game} />\n </div>\n </StackItem.Content>\n );\n};\n\nexport default ChessContainer;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { CrownCross } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport { generateName } from '@dxos/display-name';\nimport { useMembers, type Space, type SpaceMember } from '@dxos/react-client/echo';\nimport { Input, Select, useThemeContext } from '@dxos/react-ui';\nimport { getSize, mx } from '@dxos/react-ui-theme';\n\nimport { type GameType } from '../types';\n\nexport const PlayerSelector = ({ game, space }: { game: GameType; space: Space }) => {\n const members = useMembers(space.key);\n\n return (\n <div role='none' className='grid grid-cols-2 gap-8'>\n <div role='none' className='flex flex-row-reverse items-center gap-2'>\n <PlayerSelect\n side='white'\n value={game.playerWhite}\n onValueChange={(player) => (game.playerWhite = player)}\n members={members}\n />\n </div>\n <div role='none' className='flex flex-row items-center gap-2'>\n <PlayerSelect\n side='black'\n value={game.playerBlack}\n onValueChange={(player) => (game.playerBlack = player)}\n members={members}\n />\n </div>\n </div>\n );\n};\n\nconst PlayerSelect = ({\n side,\n value,\n onValueChange,\n members,\n}: {\n side: 'white' | 'black';\n value: string | undefined;\n onValueChange: (player: string) => void;\n members: SpaceMember[];\n}) => {\n const { themeMode } = useThemeContext();\n const iconFillMode =\n (side === 'black' && themeMode === 'light') || (side === 'white' && themeMode === 'dark') ? 'fill' : undefined;\n\n return (\n <Input.Root>\n <Input.Label>\n <CrownCross className={mx(getSize(6))} weight={iconFillMode} aria-label={`Chess icon for side ${side}`} />\n </Input.Label>\n <Select.Root value={value} onValueChange={onValueChange}>\n <Select.TriggerButton placeholder={'Select player'} />\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.Content>\n </Select.Portal>\n </Select.Root>\n </Input.Root>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,GAEDD,6BAAAA,QAAA,cAACC,OAAAA;IAAIE,WAAU;KACbH,6BAAAA,QAAA,cAACyD,gCAAMzC,MAAI;IAACwB;IAAckB,QAAQP;KAChCnD,6BAAAA,QAAA,cAAC2D,sCAAAA,IAAAA,CAAAA,CAAAA,GAIL3D,6BAAAA,QAAA,cAACN,gBAAAA;IAAeE;IAAcD;;AAItC;AAEA,IAAA,yBAAe4C;",
|
|
6
|
+
"names": ["import_react", "import_echo", "PlayerSelector", "game", "space", "members", "useMembers", "key", "React", "div", "role", "className", "PlayerSelect", "side", "value", "playerWhite", "onValueChange", "player", "playerBlack", "themeMode", "useThemeContext", "iconFillMode", "undefined", "Input", "Root", "Label", "CrownCross", "mx", "getSize", "weight", "aria-label", "Select", "TriggerButton", "placeholder", "Portal", "Content", "Viewport", "map", "member", "memberKey", "identity", "identityKey", "toHex", "displayName", "profile", "generateName", "Option", "ChessContainer", "model", "useMemo", "ChessModel", "useEffect", "pgn", "chess", "Chess", "loadPgn", "initialize", "fen", "getSpace", "handleDrop", "useCallback", "move", "makeMove", "StackItem", "toolbar", "Board", "onDrop", "Chessboard"]
|
|
7
|
+
}
|