@dxos/plugin-chess 0.8.4-main.422d1c7879 → 0.8.4-main.4f23b4e393
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/neutral/ChessArticle-QLLKZGPH.mjs +88 -0
- package/dist/lib/neutral/ChessArticle-QLLKZGPH.mjs.map +7 -0
- package/dist/lib/neutral/ChessCard-I5RSZZIP.mjs +19 -0
- package/dist/lib/neutral/ChessCard-I5RSZZIP.mjs.map +7 -0
- package/dist/lib/neutral/ChessPlugin.mjs +30 -0
- package/dist/lib/neutral/ChessPlugin.mjs.map +7 -0
- package/dist/lib/neutral/ChessPlugin.node.mjs +23 -0
- package/dist/lib/neutral/ChessPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/blueprint-definition-PZXHAYLD.mjs +15 -0
- package/dist/lib/neutral/blueprint-definition-PZXHAYLD.mjs.map +7 -0
- package/dist/lib/neutral/blueprints/index.mjs +8 -0
- package/dist/lib/neutral/capabilities/index.mjs +13 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-5UOTTW6U.mjs +8 -0
- package/dist/lib/neutral/chunk-5UOTTW6U.mjs.map +7 -0
- package/dist/lib/neutral/chunk-E4LZPHAQ.mjs +148 -0
- package/dist/lib/neutral/chunk-E4LZPHAQ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-FFXSIHW6.mjs +21 -0
- package/dist/lib/neutral/chunk-FFXSIHW6.mjs.map +7 -0
- package/dist/lib/{browser/chunk-MC7L6JNC.mjs → neutral/chunk-XWKNXG62.mjs} +8 -10
- package/dist/lib/neutral/chunk-XWKNXG62.mjs.map +7 -0
- package/dist/lib/{browser → neutral/components}/index.mjs +8 -158
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +11 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/game-variant-24UKIBRM.mjs +40 -0
- package/dist/lib/neutral/game-variant-24UKIBRM.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +18 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/move-RQZ7BJY3.mjs +37 -0
- package/dist/lib/neutral/move-RQZ7BJY3.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-EKZKFQUG.mjs +13 -0
- package/dist/lib/neutral/operation-handler-EKZKFQUG.mjs.map +7 -0
- package/dist/lib/{browser/types → neutral/operations}/index.mjs +3 -3
- package/dist/lib/neutral/play-GDGCEPQL.mjs +46 -0
- package/dist/lib/neutral/play-GDGCEPQL.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/{browser/print-EW7LPW4D.mjs → neutral/print-ZQA74KZI.mjs} +5 -6
- package/dist/lib/neutral/print-ZQA74KZI.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +34 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +10 -0
- 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/blueprints/chess-blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/chess-blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +0 -1
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +2 -2
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/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 +3 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
- package/dist/types/src/components/Chessboard/Chessboard.d.ts +6 -2
- package/dist/types/src/components/Chessboard/Chessboard.d.ts.map +1 -1
- package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts +32 -23
- package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts.map +1 -1
- package/dist/types/src/components/Chessboard/Info.d.ts +4 -5
- package/dist/types/src/components/Chessboard/Info.d.ts.map +1 -1
- package/dist/types/src/components/Chessboard/types.d.ts +2 -2
- package/dist/types/src/components/Chessboard/types.d.ts.map +1 -1
- package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts +3 -4
- package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts.map +1 -1
- package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts +32 -23
- package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ChessCard/ChessCard.d.ts +3 -4
- package/dist/types/src/containers/ChessCard/ChessCard.d.ts.map +1 -1
- package/dist/types/src/containers/ChessCard/ChessCard.stories.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +2 -3
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/move.d.ts +3 -3
- package/dist/types/src/operations/move.d.ts.map +1 -1
- package/dist/types/src/operations/play.d.ts +3 -3
- package/dist/types/src/operations/play.d.ts.map +1 -1
- package/dist/types/src/operations/print.d.ts +3 -3
- package/dist/types/src/operations/print.d.ts.map +1 -1
- package/dist/types/src/{cli/plugin.d.ts → plugin.d.ts} +1 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +32 -24
- 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/src/types/ChessOperation.d.ts +24 -0
- package/dist/types/src/types/ChessOperation.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +1 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +91 -68
- package/src/ChessPlugin.node.ts +23 -0
- package/src/ChessPlugin.test.ts +8 -10
- package/src/ChessPlugin.tsx +11 -34
- package/src/blueprints/chess-blueprint.ts +6 -9
- package/src/blueprints/index.ts +0 -1
- package/src/capabilities/blueprint-definition.ts +2 -0
- package/src/capabilities/game-variant.ts +42 -0
- package/src/capabilities/index.ts +3 -2
- package/src/capabilities/operation-handler.ts +3 -3
- package/src/components/Chessboard/Chessboard.stories.tsx +3 -3
- package/src/components/Chessboard/Chessboard.tsx +4 -4
- package/src/components/Chessboard/Info.tsx +3 -63
- package/src/components/Chessboard/types.ts +1 -1
- package/src/containers/ChessArticle/ChessArticle.stories.tsx +9 -3
- package/src/containers/ChessArticle/ChessArticle.tsx +45 -10
- package/src/containers/ChessCard/ChessCard.stories.tsx +7 -2
- package/src/containers/ChessCard/ChessCard.tsx +10 -5
- package/src/index.ts +0 -3
- package/src/operations/index.ts +2 -7
- package/src/operations/move.ts +13 -13
- package/src/operations/play.ts +14 -14
- package/src/operations/print.ts +3 -3
- package/src/plugin.ts +11 -0
- package/src/translations.ts +6 -10
- package/src/types/Chess.ts +19 -22
- package/src/{operations/definitions.ts → types/ChessOperation.ts} +10 -34
- package/src/types/index.ts +1 -0
- package/dist/lib/browser/blueprints/index.mjs +0 -14
- package/dist/lib/browser/chunk-2TJN26DN.mjs +0 -67
- package/dist/lib/browser/chunk-2TJN26DN.mjs.map +0 -7
- package/dist/lib/browser/chunk-JZMN24DY.mjs +0 -28
- package/dist/lib/browser/chunk-JZMN24DY.mjs.map +0 -7
- package/dist/lib/browser/chunk-MC7L6JNC.mjs.map +0 -7
- package/dist/lib/browser/chunk-XAJZK6Z2.mjs +0 -110
- package/dist/lib/browser/chunk-XAJZK6Z2.mjs.map +0 -7
- package/dist/lib/browser/cli/index.mjs +0 -34
- package/dist/lib/browser/cli/index.mjs.map +0 -7
- package/dist/lib/browser/create-AJHN4QT4.mjs +0 -24
- package/dist/lib/browser/create-AJHN4QT4.mjs.map +0 -7
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/move-T2NLRBR4.mjs +0 -36
- package/dist/lib/browser/move-T2NLRBR4.mjs.map +0 -7
- package/dist/lib/browser/operations/index.mjs +0 -19
- package/dist/lib/browser/play-7VTMD3SJ.mjs +0 -45
- package/dist/lib/browser/play-7VTMD3SJ.mjs.map +0 -7
- package/dist/lib/browser/print-EW7LPW4D.mjs.map +0 -7
- package/dist/lib/node-esm/blueprints/index.mjs +0 -15
- package/dist/lib/node-esm/chunk-4HZWCKMR.mjs +0 -38
- package/dist/lib/node-esm/chunk-4HZWCKMR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LQEDIKCV.mjs +0 -29
- package/dist/lib/node-esm/chunk-LQEDIKCV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NYU5JVXP.mjs +0 -111
- package/dist/lib/node-esm/chunk-NYU5JVXP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OIRJVY2R.mjs +0 -68
- package/dist/lib/node-esm/chunk-OIRJVY2R.mjs.map +0 -7
- package/dist/lib/node-esm/cli/index.mjs +0 -35
- package/dist/lib/node-esm/cli/index.mjs.map +0 -7
- package/dist/lib/node-esm/create-QSETDT4N.mjs +0 -25
- package/dist/lib/node-esm/create-QSETDT4N.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -390
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/move-5F2ANDTE.mjs +0 -37
- package/dist/lib/node-esm/move-5F2ANDTE.mjs.map +0 -7
- package/dist/lib/node-esm/operations/index.mjs +0 -20
- package/dist/lib/node-esm/play-W4DQCQRX.mjs +0 -46
- package/dist/lib/node-esm/play-W4DQCQRX.mjs.map +0 -7
- package/dist/lib/node-esm/print-UJHXAXMS.mjs +0 -31
- package/dist/lib/node-esm/print-UJHXAXMS.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -9
- package/dist/lib/node-esm/types/index.mjs.map +0 -7
- package/dist/types/src/capabilities/artifact-definition.d.ts +0 -12
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/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.map +0 -1
- package/dist/types/src/operations/create.d.ts +0 -5
- package/dist/types/src/operations/create.d.ts.map +0 -1
- package/dist/types/src/operations/definitions.d.ts +0 -51
- package/dist/types/src/operations/definitions.d.ts.map +0 -1
- package/src/capabilities/artifact-definition.ts +0 -135
- package/src/capabilities/react-surface.tsx +0 -35
- package/src/cli/index.ts +0 -5
- package/src/cli/plugin.ts +0 -37
- package/src/operations/create.ts +0 -21
- /package/dist/lib/{browser → neutral}/blueprints/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
- /package/dist/lib/{browser/operations → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{browser/types/index.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/lib/{node-esm/blueprints → neutral/operations}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/operations → neutral/types}/index.mjs.map +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-chess",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.4f23b4e393",
|
|
4
4
|
"description": "Chess for new plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -13,44 +13,71 @@
|
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
15
|
"imports": {
|
|
16
|
-
"#blueprints":
|
|
17
|
-
"#capabilities": "./src/capabilities/index.ts",
|
|
18
|
-
"#components": "./src/components/index.ts",
|
|
19
|
-
"#containers": "./src/containers/index.ts",
|
|
20
|
-
"#meta": "./src/meta.ts",
|
|
21
|
-
"#operations": "./src/operations/index.ts",
|
|
22
|
-
"#types": "./src/types/index.ts"
|
|
23
|
-
},
|
|
24
|
-
"exports": {
|
|
25
|
-
".": {
|
|
26
|
-
"source": "./src/index.ts",
|
|
27
|
-
"types": "./dist/types/src/index.d.ts",
|
|
28
|
-
"browser": "./dist/lib/browser/index.mjs",
|
|
29
|
-
"node": "./dist/lib/node-esm/index.mjs"
|
|
30
|
-
},
|
|
31
|
-
"./blueprints": {
|
|
16
|
+
"#blueprints": {
|
|
32
17
|
"source": "./src/blueprints/index.ts",
|
|
33
18
|
"types": "./dist/types/src/blueprints/index.d.ts",
|
|
34
|
-
"
|
|
35
|
-
|
|
19
|
+
"default": "./dist/lib/neutral/blueprints/index.mjs"
|
|
20
|
+
},
|
|
21
|
+
"#capabilities": {
|
|
22
|
+
"source": "./src/capabilities/index.ts",
|
|
23
|
+
"types": "./dist/types/src/capabilities/index.d.ts",
|
|
24
|
+
"default": "./dist/lib/neutral/capabilities/index.mjs"
|
|
25
|
+
},
|
|
26
|
+
"#components": {
|
|
27
|
+
"source": "./src/components/index.ts",
|
|
28
|
+
"types": "./dist/types/src/components/index.d.ts",
|
|
29
|
+
"default": "./dist/lib/neutral/components/index.mjs"
|
|
36
30
|
},
|
|
37
|
-
"
|
|
38
|
-
"source": "./src/
|
|
39
|
-
"types": "./dist/types/src/
|
|
40
|
-
"
|
|
41
|
-
"node": "./dist/lib/node-esm/cli/index.mjs"
|
|
31
|
+
"#containers": {
|
|
32
|
+
"source": "./src/containers/index.ts",
|
|
33
|
+
"types": "./dist/types/src/containers/index.d.ts",
|
|
34
|
+
"default": "./dist/lib/neutral/containers/index.mjs"
|
|
42
35
|
},
|
|
43
|
-
"
|
|
36
|
+
"#meta": {
|
|
37
|
+
"source": "./src/meta.ts",
|
|
38
|
+
"types": "./dist/types/src/meta.d.ts",
|
|
39
|
+
"default": "./dist/lib/neutral/meta.mjs"
|
|
40
|
+
},
|
|
41
|
+
"#operations": {
|
|
44
42
|
"source": "./src/operations/index.ts",
|
|
45
43
|
"types": "./dist/types/src/operations/index.d.ts",
|
|
46
|
-
"
|
|
47
|
-
|
|
44
|
+
"default": "./dist/lib/neutral/operations/index.mjs"
|
|
45
|
+
},
|
|
46
|
+
"#plugin": {
|
|
47
|
+
"source": {
|
|
48
|
+
"node": "./src/ChessPlugin.node.ts",
|
|
49
|
+
"default": "./src/ChessPlugin.tsx"
|
|
50
|
+
},
|
|
51
|
+
"types": "./dist/types/src/ChessPlugin.d.ts",
|
|
52
|
+
"node": "./dist/lib/neutral/ChessPlugin.node.mjs",
|
|
53
|
+
"default": "./dist/lib/neutral/ChessPlugin.mjs"
|
|
48
54
|
},
|
|
49
|
-
"
|
|
55
|
+
"#translations": {
|
|
56
|
+
"source": "./src/translations.ts",
|
|
57
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
58
|
+
"default": "./dist/lib/neutral/translations.mjs"
|
|
59
|
+
},
|
|
60
|
+
"#types": {
|
|
50
61
|
"source": "./src/types/index.ts",
|
|
51
62
|
"types": "./dist/types/src/types/index.d.ts",
|
|
52
|
-
"
|
|
53
|
-
|
|
63
|
+
"default": "./dist/lib/neutral/types/index.mjs"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"exports": {
|
|
67
|
+
".": {
|
|
68
|
+
"source": "./src/index.ts",
|
|
69
|
+
"types": "./dist/types/src/index.d.ts",
|
|
70
|
+
"default": "./dist/lib/neutral/index.mjs"
|
|
71
|
+
},
|
|
72
|
+
"./plugin": {
|
|
73
|
+
"source": "./src/plugin.ts",
|
|
74
|
+
"types": "./dist/types/src/plugin.d.ts",
|
|
75
|
+
"default": "./dist/lib/neutral/plugin.mjs"
|
|
76
|
+
},
|
|
77
|
+
"./translations": {
|
|
78
|
+
"source": "./src/translations.ts",
|
|
79
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
80
|
+
"default": "./dist/lib/neutral/translations.mjs"
|
|
54
81
|
}
|
|
55
82
|
},
|
|
56
83
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -59,56 +86,52 @@
|
|
|
59
86
|
"src"
|
|
60
87
|
],
|
|
61
88
|
"dependencies": {
|
|
62
|
-
"@automerge/automerge": "3.2.
|
|
89
|
+
"@automerge/automerge": "3.2.6",
|
|
63
90
|
"@effect-atom/atom-react": "^0.5.0",
|
|
64
91
|
"chess.js": "^1.0.0",
|
|
65
92
|
"effect": "3.20.0",
|
|
66
|
-
"@dxos/ai": "0.8.4-main.
|
|
67
|
-
"@dxos/app-
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/echo-db": "0.8.4-main.
|
|
74
|
-
"@dxos/echo": "0.8.4-main.
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/plugin-
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/plugin-
|
|
82
|
-
"@dxos/plugin-
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/react-
|
|
85
|
-
"@dxos/react-ui-mosaic": "0.8.4-main.
|
|
86
|
-
"@dxos/react-ui-
|
|
87
|
-
"@dxos/
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/
|
|
91
|
-
"@dxos/util": "0.8.4-main.422d1c7879"
|
|
93
|
+
"@dxos/ai": "0.8.4-main.4f23b4e393",
|
|
94
|
+
"@dxos/app-toolkit": "0.8.4-main.4f23b4e393",
|
|
95
|
+
"@dxos/assistant": "0.8.4-main.4f23b4e393",
|
|
96
|
+
"@dxos/async": "0.8.4-main.4f23b4e393",
|
|
97
|
+
"@dxos/compute": "0.8.4-main.4f23b4e393",
|
|
98
|
+
"@dxos/display-name": "0.8.4-main.4f23b4e393",
|
|
99
|
+
"@dxos/echo": "0.8.4-main.4f23b4e393",
|
|
100
|
+
"@dxos/echo-db": "0.8.4-main.4f23b4e393",
|
|
101
|
+
"@dxos/echo-react": "0.8.4-main.4f23b4e393",
|
|
102
|
+
"@dxos/invariant": "0.8.4-main.4f23b4e393",
|
|
103
|
+
"@dxos/log": "0.8.4-main.4f23b4e393",
|
|
104
|
+
"@dxos/app-framework": "0.8.4-main.4f23b4e393",
|
|
105
|
+
"@dxos/plugin-client": "0.8.4-main.4f23b4e393",
|
|
106
|
+
"@dxos/plugin-game": "0.8.4-main.4f23b4e393",
|
|
107
|
+
"@dxos/plugin-graph": "0.8.4-main.4f23b4e393",
|
|
108
|
+
"@dxos/plugin-markdown": "0.8.4-main.4f23b4e393",
|
|
109
|
+
"@dxos/plugin-space": "0.8.4-main.4f23b4e393",
|
|
110
|
+
"@dxos/react-client": "0.8.4-main.4f23b4e393",
|
|
111
|
+
"@dxos/react-ui-gameboard": "0.8.4-main.4f23b4e393",
|
|
112
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.4f23b4e393",
|
|
113
|
+
"@dxos/react-ui-sfx": "0.8.4-main.4f23b4e393",
|
|
114
|
+
"@dxos/schema": "0.8.4-main.4f23b4e393",
|
|
115
|
+
"@dxos/types": "0.8.4-main.4f23b4e393",
|
|
116
|
+
"@dxos/react-ui-stack": "0.8.4-main.4f23b4e393",
|
|
117
|
+
"@dxos/util": "0.8.4-main.4f23b4e393"
|
|
92
118
|
},
|
|
93
119
|
"devDependencies": {
|
|
94
120
|
"@types/react": "~19.2.7",
|
|
95
121
|
"@types/react-dom": "~19.2.3",
|
|
96
122
|
"react": "~19.2.3",
|
|
97
123
|
"react-dom": "~19.2.3",
|
|
98
|
-
"vite": "^
|
|
99
|
-
"@dxos/plugin-testing": "0.8.4-main.
|
|
100
|
-
"@dxos/
|
|
101
|
-
"@dxos/
|
|
102
|
-
"@dxos/
|
|
103
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
124
|
+
"vite": "^8.0.10",
|
|
125
|
+
"@dxos/plugin-testing": "0.8.4-main.4f23b4e393",
|
|
126
|
+
"@dxos/react-ui": "0.8.4-main.4f23b4e393",
|
|
127
|
+
"@dxos/plugin-theme": "0.8.4-main.4f23b4e393",
|
|
128
|
+
"@dxos/ui-theme": "0.8.4-main.4f23b4e393",
|
|
129
|
+
"@dxos/storybook-utils": "0.8.4-main.4f23b4e393"
|
|
104
130
|
},
|
|
105
131
|
"peerDependencies": {
|
|
106
132
|
"react": "~19.2.3",
|
|
107
133
|
"react-dom": "~19.2.3",
|
|
108
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
109
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
110
|
-
},
|
|
111
|
-
"publishConfig": {
|
|
112
|
-
"access": "public"
|
|
134
|
+
"@dxos/react-ui": "0.8.4-main.4f23b4e393",
|
|
135
|
+
"@dxos/ui-theme": "0.8.4-main.4f23b4e393"
|
|
113
136
|
}
|
|
114
137
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
|
+
|
|
8
|
+
import { BlueprintDefinition, OperationHandler } from '#capabilities';
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
import { Chess } from '#types';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Headless variant of ChessPlugin (no React surfaces / GameVariant).
|
|
14
|
+
* Used in node contexts (CLI, agents) where rendering is unavailable.
|
|
15
|
+
*/
|
|
16
|
+
export const ChessPlugin = Plugin.define(meta).pipe(
|
|
17
|
+
AppPlugin.addSchemaModule({ schema: [Chess.State] }),
|
|
18
|
+
AppPlugin.addBlueprintDefinitionModule({ activate: BlueprintDefinition }),
|
|
19
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
20
|
+
Plugin.make,
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export default ChessPlugin;
|
package/src/ChessPlugin.test.ts
CHANGED
|
@@ -6,13 +6,13 @@ import { describe, test } from 'vitest';
|
|
|
6
6
|
|
|
7
7
|
import { ActivationEvents } from '@dxos/app-framework';
|
|
8
8
|
import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
9
|
-
|
|
10
|
-
import { ClientPlugin } from '@dxos/plugin-client/cli';
|
|
9
|
+
import { ClientPlugin } from '@dxos/plugin-client/plugin';
|
|
11
10
|
import { createComposerTestApp } from '@dxos/plugin-testing/harness';
|
|
12
11
|
|
|
13
|
-
import { ChessPlugin } from '
|
|
12
|
+
import { ChessPlugin } from '#plugin';
|
|
13
|
+
|
|
14
14
|
import { meta } from './meta';
|
|
15
|
-
import {
|
|
15
|
+
import { ChessOperation } from './types';
|
|
16
16
|
|
|
17
17
|
const moduleId = (name: string) => `${meta.id}.module.${name}`;
|
|
18
18
|
|
|
@@ -22,10 +22,8 @@ describe('ChessPlugin', () => {
|
|
|
22
22
|
plugins: [ClientPlugin({}), ChessPlugin()],
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
// Modules expected to be active after a normal startup.
|
|
26
|
-
expect(harness.manager.getActive()).toEqual(
|
|
27
|
-
expect.arrayContaining([moduleId('metadata'), moduleId('schema'), moduleId('ReactSurface')]),
|
|
28
|
-
);
|
|
25
|
+
// Modules expected to be active after a normal startup (headless/node variant).
|
|
26
|
+
expect(harness.manager.getActive()).toEqual(expect.arrayContaining([moduleId('schema')]));
|
|
29
27
|
|
|
30
28
|
// SetupArtifactDefinition is fired by AssistantPlugin, which can't be included here due to a workspace cycle.
|
|
31
29
|
await harness.fire(AppActivationEvents.SetupArtifactDefinition);
|
|
@@ -38,14 +36,14 @@ describe('ChessPlugin', () => {
|
|
|
38
36
|
|
|
39
37
|
test('invokes the Print operation via the invoker capability', async ({ expect }) => {
|
|
40
38
|
await using harness = await createComposerTestApp({ plugins: [ChessPlugin()] });
|
|
41
|
-
const result = await harness.invoke(Print, {});
|
|
39
|
+
const result = await harness.invoke(ChessOperation.Print, {});
|
|
42
40
|
// Empty input returns empty ASCII (handler swallows errors for malformed FEN).
|
|
43
41
|
expect(typeof result.ascii).toBe('string');
|
|
44
42
|
});
|
|
45
43
|
|
|
46
44
|
test('Print renders a PGN to ASCII board', async ({ expect }) => {
|
|
47
45
|
await using harness = await createComposerTestApp({ plugins: [ChessPlugin()] });
|
|
48
|
-
const { ascii } = await harness.invoke(Print, { pgn: '1. e4 e5' });
|
|
46
|
+
const { ascii } = await harness.invoke(ChessOperation.Print, { pgn: '1. e4 e5' });
|
|
49
47
|
expect(ascii).toContain('a b c d e f g h');
|
|
50
48
|
});
|
|
51
49
|
});
|
package/src/ChessPlugin.tsx
CHANGED
|
@@ -2,48 +2,25 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
import * as Option from 'effect/Option';
|
|
7
|
-
|
|
8
5
|
import { Plugin } from '@dxos/app-framework';
|
|
9
|
-
import { AppPlugin } from '@dxos/app-toolkit';
|
|
10
|
-
import { Annotation } from '@dxos/echo';
|
|
11
|
-
import { Operation } from '@dxos/operation';
|
|
12
|
-
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
13
|
-
import { type CreateObject } from '@dxos/plugin-space/types';
|
|
6
|
+
import { AppPlugin, AppActivationEvents } from '@dxos/app-toolkit';
|
|
14
7
|
|
|
15
|
-
import {
|
|
16
|
-
import { BlueprintDefinition, OperationHandler, ReactSurface } from '#capabilities';
|
|
8
|
+
import { BlueprintDefinition, GameVariant, OperationHandler } from '#capabilities';
|
|
17
9
|
import { meta } from '#meta';
|
|
10
|
+
import { translations } from '#translations';
|
|
18
11
|
import { Chess } from '#types';
|
|
19
12
|
|
|
20
|
-
import { translations } from './translations';
|
|
21
|
-
|
|
22
13
|
export const ChessPlugin = Plugin.define(meta).pipe(
|
|
14
|
+
Plugin.addModule({
|
|
15
|
+
id: 'game-variant',
|
|
16
|
+
activatesOn: AppActivationEvents.SetupSchema,
|
|
17
|
+
activate: GameVariant,
|
|
18
|
+
}),
|
|
23
19
|
AppPlugin.addBlueprintDefinitionModule({ activate: BlueprintDefinition }),
|
|
24
20
|
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
25
|
-
AppPlugin.
|
|
26
|
-
metadata: {
|
|
27
|
-
id: Chess.Game.typename,
|
|
28
|
-
metadata: {
|
|
29
|
-
icon: Annotation.IconAnnotation.get(Chess.Game).pipe(Option.getOrThrow).icon,
|
|
30
|
-
iconHue: Annotation.IconAnnotation.get(Chess.Game).pipe(Option.getOrThrow).hue ?? 'white',
|
|
31
|
-
blueprints: [ChessBlueprint.key],
|
|
32
|
-
createObject: ((props, options) =>
|
|
33
|
-
Effect.gen(function* () {
|
|
34
|
-
const object = Chess.make(props);
|
|
35
|
-
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
36
|
-
object,
|
|
37
|
-
target: options.target,
|
|
38
|
-
hidden: true,
|
|
39
|
-
targetNodeId: options.targetNodeId,
|
|
40
|
-
});
|
|
41
|
-
})) satisfies CreateObject,
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
}),
|
|
45
|
-
AppPlugin.addSchemaModule({ schema: [Chess.Game] }),
|
|
46
|
-
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
21
|
+
AppPlugin.addSchemaModule({ schema: [Chess.State] }),
|
|
47
22
|
AppPlugin.addTranslationsModule({ translations }),
|
|
48
23
|
Plugin.make,
|
|
49
24
|
);
|
|
25
|
+
|
|
26
|
+
export default ChessPlugin;
|
|
@@ -2,19 +2,16 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import { Blueprint, Template } from '@dxos/blueprints';
|
|
5
|
+
import { Blueprint, Template } from '@dxos/compute';
|
|
7
6
|
import { trim } from '@dxos/util';
|
|
8
7
|
|
|
9
|
-
import {
|
|
8
|
+
import { Chess, ChessOperation } from '#types';
|
|
10
9
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const operations = [Create, Move, Play, Print];
|
|
10
|
+
const operations = [ChessOperation.Move, ChessOperation.Play, ChessOperation.Print];
|
|
14
11
|
|
|
15
12
|
const make = () =>
|
|
16
13
|
Blueprint.make({
|
|
17
|
-
key: BLUEPRINT_KEY,
|
|
14
|
+
key: Chess.BLUEPRINT_KEY,
|
|
18
15
|
name: 'Chess',
|
|
19
16
|
tools: Blueprint.toolDefinitions({ operations }),
|
|
20
17
|
instructions: Template.make({
|
|
@@ -27,8 +24,8 @@ const make = () =>
|
|
|
27
24
|
}),
|
|
28
25
|
});
|
|
29
26
|
|
|
30
|
-
const blueprint:
|
|
31
|
-
key: BLUEPRINT_KEY,
|
|
27
|
+
const blueprint: Blueprint.Definition = {
|
|
28
|
+
key: Chess.BLUEPRINT_KEY,
|
|
32
29
|
make,
|
|
33
30
|
};
|
|
34
31
|
|
package/src/blueprints/index.ts
CHANGED
|
@@ -6,6 +6,8 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import { Capability } from '@dxos/app-framework';
|
|
8
8
|
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
|
+
// eslint-disable-next-line unused-imports/no-unused-imports
|
|
10
|
+
import type { Blueprint } from '@dxos/compute';
|
|
9
11
|
|
|
10
12
|
import { ChessBlueprint } from '#blueprints';
|
|
11
13
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Schema from 'effect/Schema';
|
|
7
|
+
|
|
8
|
+
import { Capability } from '@dxos/app-framework';
|
|
9
|
+
import { GameCapabilities, type GameVariant } from '@dxos/plugin-game';
|
|
10
|
+
|
|
11
|
+
import { ChessArticle, ChessCard } from '#containers';
|
|
12
|
+
import { Chess } from '#types';
|
|
13
|
+
|
|
14
|
+
const CreateChessInput = Schema.Struct({
|
|
15
|
+
name: Schema.optional(
|
|
16
|
+
Schema.String.annotations({
|
|
17
|
+
title: 'Name',
|
|
18
|
+
description: 'Optional name for the game.',
|
|
19
|
+
}),
|
|
20
|
+
),
|
|
21
|
+
pgn: Schema.optional(
|
|
22
|
+
Schema.String.annotations({
|
|
23
|
+
title: 'PGN',
|
|
24
|
+
description: 'Optional Portable Game Notation to start from.',
|
|
25
|
+
}),
|
|
26
|
+
),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const variant: GameVariant = {
|
|
30
|
+
id: Chess.State.typename,
|
|
31
|
+
label: 'Chess',
|
|
32
|
+
icon: 'ph--shield-chevron--regular',
|
|
33
|
+
variantSchema: Chess.State,
|
|
34
|
+
inputSchema: CreateChessInput,
|
|
35
|
+
roles: ['white', 'black'] as const,
|
|
36
|
+
createVariant: (input) =>
|
|
37
|
+
Effect.sync(() => Chess.make({ pgn: typeof input.pgn === 'string' ? input.pgn : undefined })),
|
|
38
|
+
card: ChessCard,
|
|
39
|
+
article: ChessArticle,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default Capability.makeModule(() => Effect.succeed(Capability.contributes(GameCapabilities.Variant, variant)));
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Capability } from '@dxos/app-framework';
|
|
6
|
-
|
|
6
|
+
// eslint-disable-next-line unused-imports/no-unused-imports
|
|
7
|
+
import type { Blueprint, OperationHandlerSet } from '@dxos/compute';
|
|
7
8
|
|
|
8
9
|
export const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));
|
|
10
|
+
export const GameVariant = Capability.lazy('GameVariant', () => import('./game-variant'));
|
|
9
11
|
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
10
12
|
'OperationHandler',
|
|
11
13
|
() => import('./operation-handler'),
|
|
12
14
|
);
|
|
13
|
-
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
import * as Effect from 'effect/Effect';
|
|
4
4
|
|
|
5
5
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
6
|
-
import type { OperationHandlerSet } from '@dxos/
|
|
6
|
+
import type { OperationHandlerSet } from '@dxos/compute';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { ChessOperationHandlerSet } from '#operations';
|
|
9
9
|
|
|
10
10
|
export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
|
|
11
11
|
Effect.fnUntraced(function* () {
|
|
12
|
-
return Capability.contributes(Capabilities.OperationHandler,
|
|
12
|
+
return Capability.contributes(Capabilities.OperationHandler, ChessOperationHandlerSet);
|
|
13
13
|
}),
|
|
14
14
|
);
|
|
@@ -9,9 +9,9 @@ import { withClientProvider } from '@dxos/react-client/testing';
|
|
|
9
9
|
import { type Player } from '@dxos/react-ui-gameboard';
|
|
10
10
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
11
11
|
|
|
12
|
+
import { translations } from '#translations';
|
|
12
13
|
import { Chess } from '#types';
|
|
13
14
|
|
|
14
|
-
import { translations } from '../../translations';
|
|
15
15
|
import { Chessboard, type ChessboardController, type ChessboardInfoProps } from './Chessboard';
|
|
16
16
|
|
|
17
17
|
const SAMPLE_PGN =
|
|
@@ -25,7 +25,7 @@ type DefaultStoryProps = {
|
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
const DefaultStory = ({ pgn }: DefaultStoryProps) => {
|
|
28
|
-
const
|
|
28
|
+
const state = useMemo(() => Chess.make(pgn ? { pgn } : undefined), [pgn]);
|
|
29
29
|
const [orientation, setOrientation] = useState<Player>('white');
|
|
30
30
|
const [showInfo, setShowInfo] = useState(true);
|
|
31
31
|
const controller = useRef<ChessboardController>(null);
|
|
@@ -35,7 +35,7 @@ const DefaultStory = ({ pgn }: DefaultStoryProps) => {
|
|
|
35
35
|
}, []);
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
|
-
<Chessboard.Root
|
|
38
|
+
<Chessboard.Root state={state} ref={controller}>
|
|
39
39
|
<div className='flex h-full w-full gap-4 p-4 overflow-hidden'>
|
|
40
40
|
<Chessboard.Content classNames='grow'>
|
|
41
41
|
<Chessboard.Board classNames='border rounded-xs' orientation={orientation} />
|
|
@@ -42,14 +42,14 @@ export interface ChessboardController {
|
|
|
42
42
|
//
|
|
43
43
|
|
|
44
44
|
type RootProps = PropsWithChildren<{
|
|
45
|
-
|
|
45
|
+
state: Chess.State;
|
|
46
46
|
}>;
|
|
47
47
|
|
|
48
|
-
const Root = forwardRef<ChessboardController, RootProps>(({
|
|
48
|
+
const Root = forwardRef<ChessboardController, RootProps>(({ state, children }, forwardedRef) => {
|
|
49
49
|
const registry = useContext(RegistryContext);
|
|
50
|
-
const model = useMemo(() => new ExtendedChessModel(registry,
|
|
50
|
+
const model = useMemo(() => new ExtendedChessModel(registry, state), [registry]);
|
|
51
51
|
const click = useSoundEffect('Click');
|
|
52
|
-
const [pgn, updatePgn] = useObject(
|
|
52
|
+
const [pgn, updatePgn] = useObject(state, 'pgn');
|
|
53
53
|
|
|
54
54
|
// Controller.
|
|
55
55
|
useImperativeHandle(forwardedRef, () => {
|
|
@@ -5,10 +5,7 @@
|
|
|
5
5
|
import { useAtomValue } from '@effect-atom/atom-react';
|
|
6
6
|
import React, { type JSX, type PropsWithChildren, useEffect, useMemo, useRef } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import { Obj } from '@dxos/echo';
|
|
10
|
-
import { type SpaceMember, useMembers } from '@dxos/react-client/echo';
|
|
11
|
-
import { Icon, IconButton, Select, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
8
|
+
import { Icon, IconButton, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
12
9
|
import { type Player, useGameboardContext } from '@dxos/react-ui-gameboard';
|
|
13
10
|
import { mx } from '@dxos/ui-theme';
|
|
14
11
|
|
|
@@ -29,8 +26,6 @@ export type InfoProps = ThemedClassName<
|
|
|
29
26
|
export const Info = ({ classNames, orientation = 'white', onOrientationChange, onClose, ...props }: InfoProps) => {
|
|
30
27
|
const { t } = useTranslation(meta.id);
|
|
31
28
|
const { model } = useGameboardContext<ExtendedChessModel>(INFO_NAME);
|
|
32
|
-
const db = Obj.getDatabase(model.object);
|
|
33
|
-
const members = useMembers(db?.spaceId);
|
|
34
29
|
|
|
35
30
|
return (
|
|
36
31
|
<div
|
|
@@ -54,17 +49,7 @@ export const Info = ({ classNames, orientation = 'white', onOrientationChange, o
|
|
|
54
49
|
/>
|
|
55
50
|
)
|
|
56
51
|
}
|
|
57
|
-
|
|
58
|
-
<PlayerSelector
|
|
59
|
-
value={model.object.players?.[orientation === 'white' ? 'black' : 'white']}
|
|
60
|
-
onValueChange={(value) => {
|
|
61
|
-
Obj.change(model.object, (obj) => {
|
|
62
|
-
obj.players![orientation === 'white' ? 'black' : 'white'] = value;
|
|
63
|
-
});
|
|
64
|
-
}}
|
|
65
|
-
members={members}
|
|
66
|
-
/>
|
|
67
|
-
</PlayerIndicator>
|
|
52
|
+
/>
|
|
68
53
|
|
|
69
54
|
<History model={model} {...props} />
|
|
70
55
|
|
|
@@ -83,17 +68,7 @@ export const Info = ({ classNames, orientation = 'white', onOrientationChange, o
|
|
|
83
68
|
/>
|
|
84
69
|
)
|
|
85
70
|
}
|
|
86
|
-
|
|
87
|
-
<PlayerSelector
|
|
88
|
-
value={model.object.players?.[orientation]}
|
|
89
|
-
onValueChange={(value) => {
|
|
90
|
-
Obj.change(model.object, (obj) => {
|
|
91
|
-
obj.players![orientation] = value;
|
|
92
|
-
});
|
|
93
|
-
}}
|
|
94
|
-
members={members}
|
|
95
|
-
/>
|
|
96
|
-
</PlayerIndicator>
|
|
71
|
+
/>
|
|
97
72
|
</div>
|
|
98
73
|
);
|
|
99
74
|
};
|
|
@@ -216,38 +191,3 @@ const PlayerIndicator = ({ children, model, player, icon }: PlayerIndicatorProps
|
|
|
216
191
|
</div>
|
|
217
192
|
);
|
|
218
193
|
};
|
|
219
|
-
|
|
220
|
-
//
|
|
221
|
-
// PlayerSelector
|
|
222
|
-
//
|
|
223
|
-
|
|
224
|
-
type PlayerSelectorProps = {
|
|
225
|
-
value?: string;
|
|
226
|
-
onValueChange: (player: string) => void;
|
|
227
|
-
members: SpaceMember[];
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
const PlayerSelector = ({ value, onValueChange, members }: PlayerSelectorProps) => {
|
|
231
|
-
const { t } = useTranslation(meta.id);
|
|
232
|
-
return (
|
|
233
|
-
<Select.Root value={value} onValueChange={onValueChange}>
|
|
234
|
-
<Select.TriggerButton placeholder={t('select-player.button')} />
|
|
235
|
-
<Select.Portal>
|
|
236
|
-
<Select.Content>
|
|
237
|
-
<Select.Viewport>
|
|
238
|
-
{members.map((member) => {
|
|
239
|
-
const memberKey = member.identity.identityKey.toHex();
|
|
240
|
-
const displayName = member.identity?.profile?.displayName || generateName(memberKey);
|
|
241
|
-
return (
|
|
242
|
-
<Select.Option key={memberKey} value={memberKey}>
|
|
243
|
-
{displayName}
|
|
244
|
-
</Select.Option>
|
|
245
|
-
);
|
|
246
|
-
})}
|
|
247
|
-
</Select.Viewport>
|
|
248
|
-
<Select.Arrow />
|
|
249
|
-
</Select.Content>
|
|
250
|
-
</Select.Portal>
|
|
251
|
-
</Select.Root>
|
|
252
|
-
);
|
|
253
|
-
};
|
|
@@ -5,12 +5,14 @@
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
import React, { useMemo } from 'react';
|
|
7
7
|
|
|
8
|
+
import { type Obj } from '@dxos/echo';
|
|
9
|
+
import { make as makeGame } from '@dxos/plugin-game';
|
|
8
10
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
9
11
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
10
12
|
|
|
13
|
+
import { translations } from '#translations';
|
|
11
14
|
import { Chess } from '#types';
|
|
12
15
|
|
|
13
|
-
import { translations } from '../../translations';
|
|
14
16
|
import { ChessArticle } from './ChessArticle';
|
|
15
17
|
|
|
16
18
|
type DefaultStoryProps = {
|
|
@@ -18,8 +20,12 @@ type DefaultStoryProps = {
|
|
|
18
20
|
};
|
|
19
21
|
|
|
20
22
|
const DefaultStory = ({ pgn }: DefaultStoryProps) => {
|
|
21
|
-
const game = useMemo(() =>
|
|
22
|
-
|
|
23
|
+
const { game, state } = useMemo(() => {
|
|
24
|
+
const state = Chess.make(pgn ? { pgn } : undefined);
|
|
25
|
+
const game = makeGame({ name: 'Story game', variant: state as Obj.Unknown });
|
|
26
|
+
return { game, state };
|
|
27
|
+
}, [pgn]);
|
|
28
|
+
return <ChessArticle role='article' attendableId='story' game={game} variant={state} />;
|
|
23
29
|
};
|
|
24
30
|
|
|
25
31
|
const meta = {
|