@dxos/plugin-chess 0.8.4-main.c85a9c8dae → 0.8.4-main.d9fc60f731
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/LICENSE +102 -5
- package/PLUGIN.mdl +526 -0
- package/README.md +1 -1
- 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 +10 -0
- package/dist/lib/neutral/ChessPlugin.node.mjs +23 -0
- package/dist/lib/neutral/ChessPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/ChessPlugin.workerd.mjs +21 -0
- package/dist/lib/neutral/ChessPlugin.workerd.mjs.map +7 -0
- package/dist/lib/{browser/blueprint-definition-RLA7PQBB.mjs → neutral/blueprint-definition-PZXHAYLD.mjs} +4 -7
- 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/{node-esm/chunk-F5OMIM4F.mjs → neutral/chunk-7XZ4CRDL.mjs} +15 -6
- package/dist/lib/neutral/chunk-7XZ4CRDL.mjs.map +7 -0
- package/dist/lib/neutral/chunk-KMHQCP7J.mjs +148 -0
- package/dist/lib/neutral/chunk-KMHQCP7J.mjs.map +7 -0
- package/dist/lib/neutral/chunk-PJOAFP6S.mjs +41 -0
- package/dist/lib/neutral/chunk-PJOAFP6S.mjs.map +7 -0
- package/dist/lib/neutral/chunk-W2JSKHJK.mjs +8 -0
- package/dist/lib/neutral/chunk-W2JSKHJK.mjs.map +7 -0
- package/dist/lib/neutral/chunk-XWKNXG62.mjs +34 -0
- package/dist/lib/neutral/chunk-XWKNXG62.mjs.map +7 -0
- package/dist/lib/{browser/chunk-KE4FN77G.mjs → neutral/components/index.mjs} +21 -58
- 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-UMYAK7LT.mjs +41 -0
- package/dist/lib/neutral/game-variant-UMYAK7LT.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-ORBNYB2H.mjs +37 -0
- package/dist/lib/neutral/move-ORBNYB2H.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-QJCLEC27.mjs +46 -0
- package/dist/lib/neutral/play-QJCLEC27.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/print-ILCRJUYI.mjs +29 -0
- package/dist/lib/neutral/print-ILCRJUYI.mjs.map +7 -0
- package/dist/lib/neutral/testing.mjs +8 -0
- package/dist/lib/neutral/translations.mjs +35 -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/ChessPlugin.test.d.ts +2 -0
- package/dist/types/src/ChessPlugin.test.d.ts.map +1 -0
- package/dist/types/src/{cli/plugin.d.ts → ChessPlugin.workerd.d.ts} +2 -1
- package/dist/types/src/ChessPlugin.workerd.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 +6 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/game-variant.d.ts +6 -0
- package/dist/types/src/capabilities/game-variant.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +5 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/components/Chessboard/Chessboard.d.ts +8 -4
- package/dist/types/src/components/Chessboard/Chessboard.d.ts.map +1 -1
- package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts +57 -0
- package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts.map +1 -0
- package/dist/types/src/components/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 +3 -3
- 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 +34 -24
- package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ChessArticle/index.d.ts +1 -2
- package/dist/types/src/containers/ChessArticle/index.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/containers/ChessCard/index.d.ts +1 -2
- package/dist/types/src/containers/ChessCard/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/move.d.ts +5 -0
- package/dist/types/src/operations/move.d.ts.map +1 -0
- package/dist/types/src/operations/play.d.ts +5 -0
- package/dist/types/src/operations/play.d.ts.map +1 -0
- package/dist/types/src/operations/print.d.ts +5 -0
- package/dist/types/src/operations/print.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/testing.d.ts +2 -0
- package/dist/types/src/testing.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +32 -23
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Chess.d.ts +10 -20
- package/dist/types/src/types/Chess.d.ts.map +1 -1
- package/dist/types/src/types/ChessOperation.d.ts +29 -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 +100 -56
- package/src/ChessPlugin.node.ts +23 -0
- package/src/ChessPlugin.test.ts +50 -0
- package/src/ChessPlugin.tsx +19 -22
- package/src/ChessPlugin.workerd.ts +18 -0
- package/src/blueprints/chess-blueprint.ts +7 -11
- package/src/blueprints/index.ts +0 -1
- package/src/capabilities/{blueprint-definition/blueprint-definition.ts → blueprint-definition.ts} +3 -1
- package/src/capabilities/game-variant.ts +43 -0
- package/src/capabilities/index.ts +10 -2
- package/src/capabilities/operation-handler.ts +14 -0
- package/src/components/Chessboard/Chessboard.stories.tsx +94 -0
- package/src/components/Chessboard/Chessboard.tsx +7 -13
- package/src/components/Chessboard/Info.tsx +21 -74
- package/src/components/Chessboard/types.ts +2 -2
- package/src/containers/ChessArticle/ChessArticle.stories.tsx +12 -6
- package/src/containers/ChessArticle/ChessArticle.tsx +55 -19
- package/src/containers/ChessArticle/index.ts +1 -3
- package/src/containers/ChessCard/ChessCard.stories.tsx +10 -5
- package/src/containers/ChessCard/ChessCard.tsx +11 -6
- package/src/containers/ChessCard/index.ts +1 -3
- package/src/index.ts +0 -4
- package/src/meta.ts +10 -4
- package/src/operations/index.ts +11 -0
- package/src/operations/move.ts +36 -0
- package/src/operations/play.ts +45 -0
- package/src/operations/print.ts +28 -0
- package/src/plugin.ts +11 -0
- package/src/testing.ts +7 -0
- package/src/translations.ts +19 -21
- package/src/types/Chess.ts +21 -26
- package/src/types/ChessOperation.ts +88 -0
- package/src/types/index.ts +1 -0
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/ChessArticle-RI2DYAO4.mjs +0 -59
- package/dist/lib/browser/ChessArticle-RI2DYAO4.mjs.map +0 -7
- package/dist/lib/browser/ChessCard-AUMESHHE.mjs +0 -21
- package/dist/lib/browser/ChessCard-AUMESHHE.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-RLA7PQBB.mjs.map +0 -7
- package/dist/lib/browser/blueprints/index.mjs +0 -11
- package/dist/lib/browser/chunk-66H3V2YV.mjs +0 -64
- package/dist/lib/browser/chunk-66H3V2YV.mjs.map +0 -7
- package/dist/lib/browser/chunk-AWDLDU43.mjs +0 -231
- package/dist/lib/browser/chunk-AWDLDU43.mjs.map +0 -7
- package/dist/lib/browser/chunk-H3NUMCQ6.mjs +0 -21
- package/dist/lib/browser/chunk-H3NUMCQ6.mjs.map +0 -7
- package/dist/lib/browser/chunk-KE4FN77G.mjs.map +0 -7
- package/dist/lib/browser/chunk-WYUTI2K4.mjs +0 -1
- package/dist/lib/browser/cli/index.mjs +0 -29
- package/dist/lib/browser/cli/index.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -94
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-7KUFGD7C.mjs +0 -50
- package/dist/lib/browser/react-surface-7KUFGD7C.mjs.map +0 -7
- package/dist/lib/node-esm/ChessArticle-6QNVYEZV.mjs +0 -60
- package/dist/lib/node-esm/ChessArticle-6QNVYEZV.mjs.map +0 -7
- package/dist/lib/node-esm/ChessCard-QK3ZMYLT.mjs +0 -22
- package/dist/lib/node-esm/ChessCard-QK3ZMYLT.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-A2FFH3Z2.mjs +0 -19
- package/dist/lib/node-esm/blueprint-definition-A2FFH3Z2.mjs.map +0 -7
- package/dist/lib/node-esm/blueprints/index.mjs +0 -12
- package/dist/lib/node-esm/chunk-7XDEO6IJ.mjs +0 -2
- package/dist/lib/node-esm/chunk-F5OMIM4F.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-OUNGNJFP.mjs +0 -65
- package/dist/lib/node-esm/chunk-OUNGNJFP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-R7FXSQ2P.mjs +0 -232
- package/dist/lib/node-esm/chunk-R7FXSQ2P.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RNPP75JE.mjs +0 -277
- package/dist/lib/node-esm/chunk-RNPP75JE.mjs.map +0 -7
- package/dist/lib/node-esm/cli/index.mjs +0 -30
- package/dist/lib/node-esm/cli/index.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -95
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-U3HGYR5T.mjs +0 -51
- package/dist/lib/node-esm/react-surface-U3HGYR5T.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -9
- package/dist/types/src/blueprints/functions/create.d.ts +0 -15
- package/dist/types/src/blueprints/functions/create.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/index.d.ts +0 -56
- package/dist/types/src/blueprints/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/move.d.ts +0 -16
- package/dist/types/src/blueprints/functions/move.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/play.d.ts +0 -17
- package/dist/types/src/blueprints/functions/play.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/print.d.ts +0 -8
- package/dist/types/src/blueprints/functions/print.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts +0 -12
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -6
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/cli/index.d.ts +0 -2
- package/dist/types/src/cli/index.d.ts.map +0 -1
- package/dist/types/src/cli/plugin.d.ts.map +0 -1
- package/src/blueprints/functions/create.ts +0 -38
- package/src/blueprints/functions/index.ts +0 -17
- package/src/blueprints/functions/move.ts +0 -48
- package/src/blueprints/functions/play.ts +0 -58
- package/src/blueprints/functions/print.ts +0 -42
- package/src/capabilities/artifact-definition/artifact-definition.ts +0 -135
- package/src/capabilities/artifact-definition/index.ts +0 -7
- package/src/capabilities/blueprint-definition/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -33
- package/src/cli/index.ts +0 -5
- package/src/cli/plugin.ts +0 -27
- /package/dist/lib/{browser/blueprints/index.mjs.map → neutral/ChessPlugin.mjs.map} +0 -0
- /package/dist/lib/{browser/types → 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/{node-esm/blueprints → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{browser/chunk-WYUTI2K4.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral/operations}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/chunk-7XDEO6IJ.mjs.map → neutral/testing.mjs.map} +0 -0
- /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/types/index.mjs.map} +0 -0
|
@@ -5,14 +5,11 @@
|
|
|
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
|
|
|
15
|
-
import { meta } from '
|
|
12
|
+
import { meta } from '#meta';
|
|
16
13
|
|
|
17
14
|
import { type ExtendedChessModel } from './types';
|
|
18
15
|
|
|
@@ -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
|
|
@@ -44,20 +39,17 @@ export const Info = ({ classNames, orientation = 'white', onOrientationChange, o
|
|
|
44
39
|
player={orientation === 'white' ? 'black' : 'white'}
|
|
45
40
|
icon={
|
|
46
41
|
onClose && (
|
|
47
|
-
<IconButton
|
|
42
|
+
<IconButton
|
|
43
|
+
variant='ghost'
|
|
44
|
+
icon='ph--x--regular'
|
|
45
|
+
iconOnly
|
|
46
|
+
label={t('close-info.button')}
|
|
47
|
+
size={4}
|
|
48
|
+
onClick={onClose}
|
|
49
|
+
/>
|
|
48
50
|
)
|
|
49
51
|
}
|
|
50
|
-
|
|
51
|
-
<PlayerSelector
|
|
52
|
-
value={model.object.players?.[orientation === 'white' ? 'black' : 'white']}
|
|
53
|
-
onValueChange={(value) => {
|
|
54
|
-
Obj.change(model.object, (obj) => {
|
|
55
|
-
obj.players![orientation === 'white' ? 'black' : 'white'] = value;
|
|
56
|
-
});
|
|
57
|
-
}}
|
|
58
|
-
members={members}
|
|
59
|
-
/>
|
|
60
|
-
</PlayerIndicator>
|
|
52
|
+
/>
|
|
61
53
|
|
|
62
54
|
<History model={model} {...props} />
|
|
63
55
|
|
|
@@ -70,23 +62,13 @@ export const Info = ({ classNames, orientation = 'white', onOrientationChange, o
|
|
|
70
62
|
classNames={mx('transition duration-200 ease-linear', orientation === 'white' && 'rotate-180')}
|
|
71
63
|
icon='ph--arrows-clockwise--regular'
|
|
72
64
|
iconOnly
|
|
73
|
-
label={t('flip
|
|
65
|
+
label={t('flip-board.button')}
|
|
74
66
|
size={4}
|
|
75
67
|
onClick={() => onOrientationChange(orientation === 'white' ? 'black' : 'white')}
|
|
76
68
|
/>
|
|
77
69
|
)
|
|
78
70
|
}
|
|
79
|
-
|
|
80
|
-
<PlayerSelector
|
|
81
|
-
value={model.object.players?.[orientation]}
|
|
82
|
-
onValueChange={(value) => {
|
|
83
|
-
Obj.change(model.object, (obj) => {
|
|
84
|
-
obj.players![orientation] = value;
|
|
85
|
-
});
|
|
86
|
-
}}
|
|
87
|
-
members={members}
|
|
88
|
-
/>
|
|
89
|
-
</PlayerIndicator>
|
|
71
|
+
/>
|
|
90
72
|
</div>
|
|
91
73
|
);
|
|
92
74
|
};
|
|
@@ -109,12 +91,12 @@ const History = ({ classNames, model, min, max, onSelect }: HistoryProps) => {
|
|
|
109
91
|
const moveIndex = useAtomValue(model.moveIndex);
|
|
110
92
|
const label = model.game.isGameOver()
|
|
111
93
|
? model.game.isCheckmate()
|
|
112
|
-
? t('game.checkmate
|
|
94
|
+
? t('game.checkmate.label')
|
|
113
95
|
: model.game.isStalemate()
|
|
114
|
-
? t('game.stalemate
|
|
115
|
-
: t('game.draw
|
|
96
|
+
? t('game.stalemate.label')
|
|
97
|
+
: t('game.draw.label')
|
|
116
98
|
: model.game.isCheck()
|
|
117
|
-
? t('game.check
|
|
99
|
+
? t('game.check.label')
|
|
118
100
|
: undefined;
|
|
119
101
|
|
|
120
102
|
const history = model.game.history();
|
|
@@ -156,12 +138,12 @@ const History = ({ classNames, model, min, max, onSelect }: HistoryProps) => {
|
|
|
156
138
|
}}
|
|
157
139
|
>
|
|
158
140
|
{moves.map(([a, b], index) => (
|
|
159
|
-
<div key={index} className='grid grid-cols-[3rem_1fr_1fr_1rem] gap-2 ps-4
|
|
141
|
+
<div key={index} className='grid grid-cols-[3rem_1fr_1fr_1rem] gap-2 ps-4'>
|
|
160
142
|
<div className='content-center text-xs text-subdued'>{index + 1}</div>
|
|
161
143
|
{a && (
|
|
162
144
|
<div
|
|
163
145
|
data-index={a.index}
|
|
164
|
-
className={mx('ps-2 cursor-pointer', a.index === moveIndex - 1 && 'bg-primary-500')}
|
|
146
|
+
className={mx('ps-2 text-sm cursor-pointer', a.index === moveIndex - 1 && 'bg-primary-500')}
|
|
165
147
|
onClick={() => onSelect?.(a.index + 1)}
|
|
166
148
|
>
|
|
167
149
|
{a.move}
|
|
@@ -170,7 +152,7 @@ const History = ({ classNames, model, min, max, onSelect }: HistoryProps) => {
|
|
|
170
152
|
{b && (
|
|
171
153
|
<div
|
|
172
154
|
data-index={b.index}
|
|
173
|
-
className={mx('ps-2 cursor-pointer', b.index === moveIndex - 1 && 'bg-primary-500')}
|
|
155
|
+
className={mx('ps-2 text-sm cursor-pointer', b.index === moveIndex - 1 && 'bg-primary-500')}
|
|
174
156
|
onClick={() => onSelect?.(b.index + 1)}
|
|
175
157
|
>
|
|
176
158
|
{b.move}
|
|
@@ -201,7 +183,7 @@ const PlayerIndicator = ({ children, model, player, icon }: PlayerIndicatorProps
|
|
|
201
183
|
<Icon
|
|
202
184
|
icon={turn ? 'ph--circle--fill' : 'ph--circle--thin'}
|
|
203
185
|
size={6}
|
|
204
|
-
classNames={mx(turn && (model.game.isCheckmate() ? 'text-
|
|
186
|
+
classNames={mx(turn && (model.game.isCheckmate() ? 'text-error-500' : 'text-success-text'))}
|
|
205
187
|
/>
|
|
206
188
|
</div>
|
|
207
189
|
<div className='truncate overflow-hidden items-center'>{children}</div>
|
|
@@ -209,38 +191,3 @@ const PlayerIndicator = ({ children, model, player, icon }: PlayerIndicatorProps
|
|
|
209
191
|
</div>
|
|
210
192
|
);
|
|
211
193
|
};
|
|
212
|
-
|
|
213
|
-
//
|
|
214
|
-
// PlayerSelector
|
|
215
|
-
//
|
|
216
|
-
|
|
217
|
-
type PlayerSelectorProps = {
|
|
218
|
-
value?: string;
|
|
219
|
-
onValueChange: (player: string) => void;
|
|
220
|
-
members: SpaceMember[];
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
const PlayerSelector = ({ value, onValueChange, members }: PlayerSelectorProps) => {
|
|
224
|
-
const { t } = useTranslation(meta.id);
|
|
225
|
-
return (
|
|
226
|
-
<Select.Root value={value} onValueChange={onValueChange}>
|
|
227
|
-
<Select.TriggerButton placeholder={t('select player button')} />
|
|
228
|
-
<Select.Portal>
|
|
229
|
-
<Select.Content>
|
|
230
|
-
<Select.Viewport>
|
|
231
|
-
{members.map((member) => {
|
|
232
|
-
const memberKey = member.identity.identityKey.toHex();
|
|
233
|
-
const displayName = member.identity?.profile?.displayName || generateName(memberKey);
|
|
234
|
-
return (
|
|
235
|
-
<Select.Option key={memberKey} value={memberKey}>
|
|
236
|
-
{displayName}
|
|
237
|
-
</Select.Option>
|
|
238
|
-
);
|
|
239
|
-
})}
|
|
240
|
-
</Select.Viewport>
|
|
241
|
-
<Select.Arrow />
|
|
242
|
-
</Select.Content>
|
|
243
|
-
</Select.Portal>
|
|
244
|
-
</Select.Root>
|
|
245
|
-
);
|
|
246
|
-
};
|
|
@@ -6,12 +6,12 @@ import { type Registry } from '@effect-atom/atom-react';
|
|
|
6
6
|
|
|
7
7
|
import { ChessModel } from '@dxos/react-ui-gameboard';
|
|
8
8
|
|
|
9
|
-
import { type Chess } from '
|
|
9
|
+
import { type Chess } from '#types';
|
|
10
10
|
|
|
11
11
|
export class ExtendedChessModel extends ChessModel {
|
|
12
12
|
constructor(
|
|
13
13
|
registry: Registry.Registry,
|
|
14
|
-
readonly object: Chess.
|
|
14
|
+
readonly object: Chess.State,
|
|
15
15
|
) {
|
|
16
16
|
super(registry);
|
|
17
17
|
}
|
|
@@ -5,21 +5,27 @@
|
|
|
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
|
|
|
11
|
-
import { translations } from '
|
|
12
|
-
import { Chess } from '
|
|
13
|
+
import { translations } from '#translations';
|
|
14
|
+
import { Chess } from '#types';
|
|
13
15
|
|
|
14
16
|
import { ChessArticle } from './ChessArticle';
|
|
15
17
|
|
|
16
|
-
type
|
|
18
|
+
type DefaultStoryProps = {
|
|
17
19
|
pgn?: string;
|
|
18
20
|
};
|
|
19
21
|
|
|
20
|
-
const DefaultStory = ({ pgn }:
|
|
21
|
-
const game = useMemo(() =>
|
|
22
|
-
|
|
22
|
+
const DefaultStory = ({ pgn }: DefaultStoryProps) => {
|
|
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 = {
|
|
@@ -2,64 +2,100 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Chess as ChessJS } from 'chess.js';
|
|
5
6
|
import React, { useCallback, useRef, useState } from 'react';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
9
|
+
import { type GameVariantSurfaceProps } from '@dxos/plugin-game';
|
|
8
10
|
import { Panel, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
9
11
|
import { type Player } from '@dxos/react-ui-gameboard';
|
|
10
12
|
import { mx } from '@dxos/ui-theme';
|
|
11
13
|
|
|
12
|
-
import { Chessboard, type ChessboardController, type ChessboardInfoProps } from '
|
|
13
|
-
import { meta } from '
|
|
14
|
-
import {
|
|
14
|
+
import { Chessboard, type ChessboardController, type ChessboardInfoProps } from '#components';
|
|
15
|
+
import { meta } from '#meta';
|
|
16
|
+
import { Chess } from '#types';
|
|
15
17
|
|
|
16
|
-
export type ChessArticleProps =
|
|
18
|
+
export type ChessArticleProps = GameVariantSurfaceProps;
|
|
17
19
|
|
|
18
|
-
export const ChessArticle = ({ role,
|
|
20
|
+
export const ChessArticle = ({ role, variant }: ChessArticleProps) => {
|
|
19
21
|
const { t } = useTranslation(meta.id);
|
|
20
22
|
const [orientation, setOrientation] = useState<Player>('white');
|
|
21
|
-
const [
|
|
23
|
+
const [showInfo, setShowInfo] = useState(true);
|
|
22
24
|
const controller = useRef<ChessboardController>(null);
|
|
23
25
|
|
|
24
26
|
const handleSelect = useCallback<NonNullable<ChessboardInfoProps['onSelect']>>((index) => {
|
|
25
27
|
controller.current?.setMoveNumber(index);
|
|
26
28
|
}, []);
|
|
27
29
|
|
|
30
|
+
const isGameOver = (() => {
|
|
31
|
+
if (!Obj.instanceOf(Chess.State, variant) || (!variant.pgn && !variant.fen)) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
const chess = new ChessJS();
|
|
36
|
+
if (variant.pgn) {
|
|
37
|
+
chess.loadPgn(variant.pgn);
|
|
38
|
+
} else if (variant.fen) {
|
|
39
|
+
chess.load(variant.fen);
|
|
40
|
+
}
|
|
41
|
+
return chess.isGameOver();
|
|
42
|
+
} catch {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
})();
|
|
46
|
+
|
|
47
|
+
const handleNewGame = useCallback(() => {
|
|
48
|
+
if (!Obj.instanceOf(Chess.State, variant)) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
Obj.update(variant, (variant) => {
|
|
52
|
+
const mutable = variant as Obj.Mutable<typeof variant>;
|
|
53
|
+
mutable.pgn = undefined;
|
|
54
|
+
mutable.fen = undefined;
|
|
55
|
+
});
|
|
56
|
+
}, [variant]);
|
|
57
|
+
|
|
58
|
+
if (!Obj.instanceOf(Chess.State, variant)) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
|
|
28
62
|
return (
|
|
29
|
-
<Chessboard.Root
|
|
63
|
+
<Chessboard.Root state={variant} ref={controller}>
|
|
30
64
|
<Panel.Root role={role} classNames='@container'>
|
|
31
65
|
<Panel.Toolbar asChild>
|
|
32
66
|
<Toolbar.Root>
|
|
67
|
+
{isGameOver && <Toolbar.Button onClick={handleNewGame}>{t('new-game.button')}</Toolbar.Button>}
|
|
68
|
+
<div className='grow' />
|
|
33
69
|
<Toolbar.IconButton
|
|
34
70
|
icon='ph--info--regular'
|
|
35
71
|
iconOnly
|
|
36
|
-
label={t('toggle
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
onClick={() => setOpen((open) => !open)}
|
|
72
|
+
label={t('toggle-info.button')}
|
|
73
|
+
classNames={mx('invisible @4xl:visible')}
|
|
74
|
+
onClick={() => setShowInfo((open) => !open)}
|
|
40
75
|
/>
|
|
41
76
|
</Toolbar.Root>
|
|
42
77
|
</Panel.Toolbar>
|
|
43
78
|
<Panel.Content>
|
|
44
79
|
<div
|
|
45
80
|
className={mx(
|
|
46
|
-
'grid h-full w-full
|
|
47
|
-
|
|
81
|
+
'grid h-full w-full',
|
|
82
|
+
showInfo && '@4xl:grid-cols-[1fr_320px] gap-8',
|
|
83
|
+
role === 'article' && 'p-4',
|
|
48
84
|
role === 'section' && 'aspect-square',
|
|
49
|
-
role === 'section' &&
|
|
85
|
+
role === 'section' && showInfo && '@4xl:aspect-auto',
|
|
50
86
|
)}
|
|
51
87
|
>
|
|
52
88
|
<Chessboard.Content>
|
|
53
|
-
<Chessboard.Board classNames='
|
|
89
|
+
<Chessboard.Board classNames='border rounded-xs' orientation={orientation} />
|
|
54
90
|
</Chessboard.Content>
|
|
55
|
-
{
|
|
56
|
-
<div className='hidden @
|
|
91
|
+
{showInfo && (
|
|
92
|
+
<div className='hidden @4xl:flex flex-col justify-center items-center overflow-hidden'>
|
|
57
93
|
<Chessboard.Info
|
|
58
94
|
orientation={orientation}
|
|
59
95
|
min={8}
|
|
60
96
|
max={8}
|
|
61
97
|
onOrientationChange={setOrientation}
|
|
62
|
-
onClose={() =>
|
|
98
|
+
onClose={() => setShowInfo(false)}
|
|
63
99
|
onSelect={handleSelect}
|
|
64
100
|
/>
|
|
65
101
|
</div>
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
import React, { useMemo } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { make as makeGame } from '@dxos/plugin-game';
|
|
9
9
|
import { CardContainer } from '@dxos/react-ui-mosaic/testing';
|
|
10
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
10
11
|
|
|
11
|
-
import { meta as pluginMeta } from '
|
|
12
|
-
import { Chess } from '
|
|
12
|
+
import { meta as pluginMeta } from '#meta';
|
|
13
|
+
import { Chess } from '#types';
|
|
13
14
|
|
|
14
15
|
import { ChessCard } from './ChessCard';
|
|
15
16
|
|
|
@@ -17,10 +18,14 @@ const SAMPLE_PGN =
|
|
|
17
18
|
'1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. cxd4 Bb4+ 7. Nc3 d5 8. exd5 Nxd5 9. O-O Be6 10. Qb3 Na5 11. Qa4+ c6 12. Bxd5 Bxc3 13. Bxe6 fxe6 14. d5 Qg5 15. dxe6 Qg4 16. e7 Kf7 17. bxc3 Kg6 *';
|
|
18
19
|
|
|
19
20
|
const CardStory = () => {
|
|
20
|
-
const game = useMemo(() =>
|
|
21
|
+
const { game, state } = useMemo(() => {
|
|
22
|
+
const state = Chess.make({ pgn: SAMPLE_PGN });
|
|
23
|
+
const game = makeGame({ name: 'Story game', variant: state });
|
|
24
|
+
return { game, state };
|
|
25
|
+
}, []);
|
|
21
26
|
return (
|
|
22
27
|
<CardContainer role='popover' icon={pluginMeta.icon}>
|
|
23
|
-
<ChessCard
|
|
28
|
+
<ChessCard role='card--content' game={game} variant={state} />
|
|
24
29
|
</CardContainer>
|
|
25
30
|
);
|
|
26
31
|
};
|
|
@@ -4,16 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Obj } from '@dxos/echo';
|
|
8
|
+
import { type GameVariantSurfaceProps } from '@dxos/plugin-game';
|
|
8
9
|
|
|
9
|
-
import { Chessboard } from '
|
|
10
|
-
import {
|
|
10
|
+
import { Chessboard } from '#components';
|
|
11
|
+
import { Chess } from '#types';
|
|
11
12
|
|
|
12
|
-
export type ChessCardProps =
|
|
13
|
+
export type ChessCardProps = GameVariantSurfaceProps;
|
|
14
|
+
|
|
15
|
+
export const ChessCard = ({ variant }: ChessCardProps) => {
|
|
16
|
+
if (!Obj.instanceOf(Chess.State, variant)) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
13
19
|
|
|
14
|
-
export const ChessCard = ({ subject: game }: ChessCardProps) => {
|
|
15
20
|
return (
|
|
16
|
-
<Chessboard.Root
|
|
21
|
+
<Chessboard.Root state={variant}>
|
|
17
22
|
<Chessboard.Content>
|
|
18
23
|
<Chessboard.Board />
|
|
19
24
|
</Chessboard.Content>
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { DXN } from '@dxos/keys';
|
|
7
|
+
import { meta as gameMeta } from '@dxos/plugin-game';
|
|
6
8
|
import { trim } from '@dxos/util';
|
|
7
9
|
|
|
8
|
-
export const meta
|
|
9
|
-
|
|
10
|
+
export const meta = Plugin.makeMeta({
|
|
11
|
+
key: DXN.make('org.dxos.plugin.chess'),
|
|
10
12
|
name: 'Chess',
|
|
13
|
+
author: 'DXOS',
|
|
11
14
|
description: trim`
|
|
12
15
|
Full-featured chess game supporting multiplayer matches with friends or practice sessions against AI opponents.
|
|
13
16
|
Track game history and analyze moves in real-time.
|
|
@@ -15,5 +18,8 @@ export const meta: Plugin.Meta = {
|
|
|
15
18
|
icon: 'ph--shield-chevron--regular',
|
|
16
19
|
iconHue: 'amber',
|
|
17
20
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-chess',
|
|
21
|
+
spec: 'PLUGIN.mdl',
|
|
18
22
|
screenshots: ['https://dxos.network/plugin-details-chess-dark.png'],
|
|
19
|
-
|
|
23
|
+
dependsOn: [gameMeta.id],
|
|
24
|
+
tags: ['game'],
|
|
25
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Chess as ChessJS } from 'chess.js';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
10
|
+
import { loadGame } from '@dxos/plugin-game';
|
|
11
|
+
|
|
12
|
+
import { Chess, ChessOperation } from '../types';
|
|
13
|
+
|
|
14
|
+
const handler: Operation.WithHandler<typeof ChessOperation.Move> = ChessOperation.Move.pipe(
|
|
15
|
+
Operation.withHandler(
|
|
16
|
+
Effect.fn(function* ({ game, move }) {
|
|
17
|
+
const { variant } = yield* loadGame(game, Chess.State);
|
|
18
|
+
const chess = new ChessJS();
|
|
19
|
+
if (variant.pgn) {
|
|
20
|
+
chess.loadPgn(variant.pgn);
|
|
21
|
+
} else if (variant.fen) {
|
|
22
|
+
chess.load(variant.fen);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
chess.move(move, { strict: false });
|
|
26
|
+
const pgn = chess.pgn();
|
|
27
|
+
Obj.update(variant, (variant) => {
|
|
28
|
+
const mutable = variant as Obj.Mutable<typeof variant>;
|
|
29
|
+
mutable.pgn = pgn;
|
|
30
|
+
});
|
|
31
|
+
return { pgn };
|
|
32
|
+
}),
|
|
33
|
+
),
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export default handler;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Chess as ChessJS } from 'chess.js';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
10
|
+
import { loadGame } from '@dxos/plugin-game';
|
|
11
|
+
|
|
12
|
+
import { Chess, ChessOperation } from '../types';
|
|
13
|
+
|
|
14
|
+
const handler: Operation.WithHandler<typeof ChessOperation.Play> = ChessOperation.Play.pipe(
|
|
15
|
+
Operation.withHandler(
|
|
16
|
+
Effect.fn(function* ({ game, side = 'any' }) {
|
|
17
|
+
const { variant } = yield* loadGame(game, Chess.State);
|
|
18
|
+
const chess = new ChessJS();
|
|
19
|
+
if (variant.pgn) {
|
|
20
|
+
chess.loadPgn(variant.pgn);
|
|
21
|
+
} else if (variant.fen) {
|
|
22
|
+
chess.load(variant.fen);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (
|
|
26
|
+
!(side === 'any' || (chess.turn() === 'w' && side === 'white') || (chess.turn() === 'b' && side === 'black'))
|
|
27
|
+
) {
|
|
28
|
+
return { move: undefined, pgn: variant.pgn ?? '' };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const moves = chess.moves();
|
|
32
|
+
const move = moves[Math.floor(Math.random() * moves.length)];
|
|
33
|
+
|
|
34
|
+
chess.move(move, { strict: false });
|
|
35
|
+
const pgn = chess.pgn();
|
|
36
|
+
Obj.update(variant, (variant) => {
|
|
37
|
+
const mutable = variant as Obj.Mutable<typeof variant>;
|
|
38
|
+
mutable.pgn = pgn;
|
|
39
|
+
});
|
|
40
|
+
return { move, pgn };
|
|
41
|
+
}),
|
|
42
|
+
),
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
export default handler;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Chess as ChessJS } from 'chess.js';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
|
|
10
|
+
import { ChessOperation } from '../types';
|
|
11
|
+
|
|
12
|
+
const handler: Operation.WithHandler<typeof ChessOperation.Print> = ChessOperation.Print.pipe(
|
|
13
|
+
Operation.withHandler(
|
|
14
|
+
Effect.fn(function* ({ pgn, fen }) {
|
|
15
|
+
try {
|
|
16
|
+
const chess = new ChessJS(fen);
|
|
17
|
+
if (pgn) {
|
|
18
|
+
chess.loadPgn(pgn);
|
|
19
|
+
}
|
|
20
|
+
return { ascii: chess.ascii() };
|
|
21
|
+
} catch {
|
|
22
|
+
return { ascii: '' };
|
|
23
|
+
}
|
|
24
|
+
}),
|
|
25
|
+
),
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export default handler;
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const ChessPlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
10
|
+
|
|
11
|
+
export { ChessOperationHandlerSet } from './operations';
|
package/src/testing.ts
ADDED
package/src/translations.ts
CHANGED
|
@@ -2,35 +2,33 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Type } from '@dxos/echo';
|
|
5
6
|
import { type Resource } from '@dxos/react-ui';
|
|
6
7
|
|
|
7
|
-
import { meta } from '
|
|
8
|
-
import { Chess } from '
|
|
8
|
+
import { meta } from '#meta';
|
|
9
|
+
import { Chess } from '#types';
|
|
9
10
|
|
|
10
11
|
export const translations = [
|
|
11
12
|
{
|
|
12
13
|
'en-US': {
|
|
13
|
-
[Chess.
|
|
14
|
-
'typename
|
|
15
|
-
'typename
|
|
16
|
-
'typename
|
|
17
|
-
'typename
|
|
18
|
-
'object name placeholder': 'New game',
|
|
19
|
-
'rename object label': 'Rename game',
|
|
20
|
-
'delete object label': 'Delete game',
|
|
21
|
-
'object deleted label': 'Game deleted',
|
|
14
|
+
[Type.getTypename(Chess.State)]: {
|
|
15
|
+
'typename.label': 'Chess',
|
|
16
|
+
'typename.label_zero': 'Chess games',
|
|
17
|
+
'typename.label_one': 'Chess game',
|
|
18
|
+
'typename.label_other': 'Chess games',
|
|
22
19
|
},
|
|
23
20
|
[meta.id]: {
|
|
24
|
-
'plugin
|
|
25
|
-
'
|
|
26
|
-
'game.
|
|
27
|
-
'game.
|
|
28
|
-
'game.
|
|
29
|
-
'game.
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
21
|
+
'plugin.name': 'Chess',
|
|
22
|
+
'new-game.button': 'New game',
|
|
23
|
+
'delete-game.label': 'Delete',
|
|
24
|
+
'game.checkmate.label': 'Checkmate',
|
|
25
|
+
'game.stalemate.label': 'Stalemate',
|
|
26
|
+
'game.draw.label': 'Draw',
|
|
27
|
+
'game.check.label': 'Check',
|
|
28
|
+
'select-player.button': 'Select player',
|
|
29
|
+
'toggle-info.button': 'Toggle info',
|
|
30
|
+
'close-info.button': 'Close info',
|
|
31
|
+
'flip-board.button': 'Flip board',
|
|
34
32
|
},
|
|
35
33
|
},
|
|
36
34
|
},
|