@dxos/react-ui-gameboard 0.7.5-main.ff8607b → 0.7.5-staging.2ff1350
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/index.mjs +147 -44
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +147 -43
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +147 -44
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/Board/Board.d.ts +2 -2
- package/dist/types/src/Board/Board.d.ts.map +1 -1
- package/dist/types/src/Board/Piece.d.ts +1 -1
- package/dist/types/src/Board/Piece.d.ts.map +1 -1
- package/dist/types/src/Board/Square.d.ts +1 -1
- package/dist/types/src/Board/Square.d.ts.map +1 -1
- package/dist/types/src/Board/context.d.ts +7 -7
- package/dist/types/src/Board/context.d.ts.map +1 -1
- package/dist/types/src/Board/index.d.ts +1 -0
- package/dist/types/src/Board/index.d.ts.map +1 -1
- package/dist/types/src/Board/types.d.ts +6 -2
- package/dist/types/src/Board/types.d.ts.map +1 -1
- package/dist/types/src/Chessboard/Chessboard.d.ts +1 -1
- package/dist/types/src/Chessboard/Chessboard.d.ts.map +1 -1
- package/dist/types/src/Chessboard/Chessboard.stories.d.ts +3 -2
- package/dist/types/src/Chessboard/Chessboard.stories.d.ts.map +1 -1
- package/dist/types/src/Chessboard/chess.d.ts +5 -9
- package/dist/types/src/Chessboard/chess.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/alpha/bB.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/alpha/bB.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/alpha/bK.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/alpha/bK.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/alpha/bN.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/alpha/bN.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/alpha/bP.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/alpha/bP.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/alpha/bQ.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/alpha/bQ.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/alpha/bR.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/alpha/bR.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/alpha/wB.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/alpha/wB.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/alpha/wK.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/alpha/wK.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/alpha/wN.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/alpha/wN.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/alpha/wP.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/alpha/wP.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/alpha/wQ.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/alpha/wQ.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/alpha/wR.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/alpha/wR.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/cburnett/bB.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/cburnett/bB.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/cburnett/bK.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/cburnett/bK.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/cburnett/bN.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/cburnett/bN.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/cburnett/bP.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/cburnett/bP.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/cburnett/bQ.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/cburnett/bQ.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/cburnett/bR.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/cburnett/bR.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/cburnett/wB.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/cburnett/wB.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/cburnett/wK.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/cburnett/wK.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/cburnett/wN.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/cburnett/wN.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/cburnett/wP.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/cburnett/wP.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/cburnett/wQ.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/cburnett/wQ.d.ts.map +1 -1
- package/dist/types/src/gen/pieces/chess/cburnett/wR.d.ts +1 -2
- package/dist/types/src/gen/pieces/chess/cburnett/wR.d.ts.map +1 -1
- package/package.json +12 -11
- package/src/Board/Board.tsx +24 -6
- package/src/Board/Piece.tsx +10 -9
- package/src/Board/Square.tsx +1 -1
- package/src/Board/context.ts +9 -2
- package/src/Board/index.ts +1 -0
- package/src/Board/types.ts +6 -2
- package/src/Chessboard/Chessboard.stories.tsx +45 -3
- package/src/Chessboard/Chessboard.tsx +76 -9
- package/src/Chessboard/chess.ts +31 -10
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import '@dxos-theme';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import React from 'react';
|
|
4
3
|
import { type ChessboardProps } from './Chessboard';
|
|
5
4
|
type RenderProps = Pick<ChessboardProps, 'orientation' | 'showLabels' | 'debug'> & {
|
|
6
5
|
fen: string;
|
|
7
6
|
};
|
|
8
|
-
declare const Render: ({ fen, orientation: _orientation, ...props }: RenderProps) =>
|
|
7
|
+
declare const Render: ({ fen, orientation: _orientation, ...props }: RenderProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
declare const meta: Meta<typeof Render>;
|
|
10
9
|
export default meta;
|
|
11
10
|
type Story = StoryObj<typeof Render>;
|
|
12
11
|
export declare const Default: Story;
|
|
12
|
+
export declare const Promotion: Story;
|
|
13
13
|
export declare const Debug: Story;
|
|
14
|
+
export declare const Nine: Story;
|
|
14
15
|
//# sourceMappingURL=Chessboard.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chessboard.stories.d.ts","sourceRoot":"","sources":["../../../../src/Chessboard/Chessboard.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"Chessboard.stories.d.ts","sourceRoot":"","sources":["../../../../src/Chessboard/Chessboard.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAOvD,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAIhE,KAAK,WAAW,GAAG,IAAI,CAAC,eAAe,EAAE,aAAa,GAAG,YAAY,GAAG,OAAO,CAAC,GAAG;IACjF,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,QAAA,MAAM,MAAM,iDAAkD,WAAW,4CA6BxE,CAAC;AA2BF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAK7B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAC;AAErC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,SAAS,EAAE,KAIvB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAOnB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAElB,CAAC"}
|
|
@@ -6,15 +6,10 @@ export type ChessPiece = 'BK' | 'BQ' | 'BR' | 'BB' | 'BN' | 'BP' | 'WK' | 'WQ' |
|
|
|
6
6
|
export declare const ChessPieces: Record<ChessPiece, FC<SVGProps<SVGSVGElement>>>;
|
|
7
7
|
export declare const posToLocation: (pos: string) => Location;
|
|
8
8
|
export declare const locationToPos: ([row, col]: Location) => string;
|
|
9
|
-
export declare const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
blue: {
|
|
15
|
-
white: string;
|
|
16
|
-
black: string;
|
|
17
|
-
};
|
|
9
|
+
export declare const boardStyles: {
|
|
10
|
+
black: string;
|
|
11
|
+
white: string;
|
|
12
|
+
promotion: string;
|
|
18
13
|
};
|
|
19
14
|
export declare const getSquareColor: ([row, col]: Location) => string;
|
|
20
15
|
/**
|
|
@@ -30,6 +25,7 @@ export declare class ChessModel implements BoardModel<ChessPiece> {
|
|
|
30
25
|
get fen(): string;
|
|
31
26
|
initialize(fen?: string): void;
|
|
32
27
|
isValidMove(move: Move): boolean;
|
|
28
|
+
canPromote(move: Move): boolean;
|
|
33
29
|
makeMove(move: Move): boolean;
|
|
34
30
|
makeRandomMove(): boolean;
|
|
35
31
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chess.d.ts","sourceRoot":"","sources":["../../../../src/Chessboard/chess.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAU,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,KAAK,EAAe,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAI/C,OAAO,EACL,KAAK,IAAI,EACT,KAAK,QAAQ,EACb,KAAK,QAAQ,EAEb,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,MAAM,EACZ,MAAM,UAAU,CAAC;AAGlB,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3G,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAS,CAAC;AAElF,eAAO,MAAM,aAAa,QAAS,MAAM,KAAG,QAI3C,CAAC;AAEF,eAAO,MAAM,aAAa,eAAgB,QAAQ,KAAG,MAEpD,CAAC;
|
|
1
|
+
{"version":3,"file":"chess.d.ts","sourceRoot":"","sources":["../../../../src/Chessboard/chess.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAU,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,KAAK,EAAe,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAI/C,OAAO,EACL,KAAK,IAAI,EACT,KAAK,QAAQ,EACb,KAAK,QAAQ,EAEb,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,MAAM,EACZ,MAAM,UAAU,CAAC;AAGlB,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3G,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAS,CAAC;AAElF,eAAO,MAAM,aAAa,QAAS,MAAM,KAAG,QAI3C,CAAC;AAEF,eAAO,MAAM,aAAa,eAAgB,QAAQ,KAAG,MAEpD,CAAC;AAyBF,eAAO,MAAM,WAAW;;;;CAAkB,CAAC;AAE3C,eAAO,MAAM,cAAc,eAAgB,QAAQ,WAElD,CAAC;AAmBF;;GAEG;AACH,qBAAa,UAAW,YAAW,UAAU,CAAC,UAAU,CAAC;IACvD,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoC;gBAEhD,GAAG,CAAC,EAAE,MAAM;IAIxB,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,MAAM,IAAI,cAAc,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAEjD;IAED,IAAI,IAAI,IAAI,KAAK,CAEhB;IAED,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED,UAAU,CAAC,GAAG,CAAC,EAAE,MAAM;IAMvB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO;IAIhC,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO;IAM/B,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO;IAW7B,cAAc,IAAI,OAAO;IAYzB;;OAEG;IACH,OAAO,CAAC,OAAO;CAsBhB;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,SAAS,UAAU,QAAQ,CAAC,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,KAAG,QAAQ,CAAC,CAAC,CAmClG,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgBB: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgBB: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgBB;
|
|
5
4
|
//# sourceMappingURL=bB.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bB.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/bB.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bB.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/bB.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAQ5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgBK: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgBK: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgBK;
|
|
5
4
|
//# sourceMappingURL=bK.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bK.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/bK.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bK.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/bK.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAW5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgBN: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgBN: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgBN;
|
|
5
4
|
//# sourceMappingURL=bN.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bN.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/bN.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bN.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/bN.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAW5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgBP: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgBP: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgBP;
|
|
5
4
|
//# sourceMappingURL=bP.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bP.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/bP.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bP.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/bP.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAO5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgBQ: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgBQ: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgBQ;
|
|
5
4
|
//# sourceMappingURL=bQ.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bQ.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/bQ.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bQ.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/bQ.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAQ5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgBR: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgBR: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgBR;
|
|
5
4
|
//# sourceMappingURL=bR.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bR.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/bR.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bR.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/bR.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAQ5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgWB: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgWB: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgWB;
|
|
5
4
|
//# sourceMappingURL=wB.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wB.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/wB.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wB.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/wB.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAW5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgWK: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgWK: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgWK;
|
|
5
4
|
//# sourceMappingURL=wK.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wK.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/wK.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wK.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/wK.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAW5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgWN: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgWN: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgWN;
|
|
5
4
|
//# sourceMappingURL=wN.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wN.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/wN.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wN.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/wN.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAW5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgWP: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgWP: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgWP;
|
|
5
4
|
//# sourceMappingURL=wP.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wP.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/wP.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wP.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/wP.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAW5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgWQ: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgWQ: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgWQ;
|
|
5
4
|
//# sourceMappingURL=wQ.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wQ.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/wQ.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wQ.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/wQ.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAW5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgWR: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgWR: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgWR;
|
|
5
4
|
//# sourceMappingURL=wR.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wR.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/wR.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wR.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/alpha/wR.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAW5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgBB: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgBB: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgBB;
|
|
5
4
|
//# sourceMappingURL=bB.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bB.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/bB.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bB.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/bB.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAW5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgBK: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgBK: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgBK;
|
|
5
4
|
//# sourceMappingURL=bK.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bK.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/bK.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bK.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/bK.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAsB5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgBN: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgBN: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgBN;
|
|
5
4
|
//# sourceMappingURL=bN.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bN.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/bN.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bN.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/bN.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAoB5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgBP: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgBP: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgBP;
|
|
5
4
|
//# sourceMappingURL=bP.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bP.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/bP.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bP.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/bP.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAS5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgBQ: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgBQ: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgBQ;
|
|
5
4
|
//# sourceMappingURL=bQ.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bQ.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/bQ.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bQ.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/bQ.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CA0B5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgBR: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgBR: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgBR;
|
|
5
4
|
//# sourceMappingURL=bR.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bR.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/bR.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bR.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/bR.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAe5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgWB: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgWB: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgWB;
|
|
5
4
|
//# sourceMappingURL=wB.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wB.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/wB.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wB.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/wB.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAW5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgWK: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgWK: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgWK;
|
|
5
4
|
//# sourceMappingURL=wK.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wK.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/wK.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wK.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/wK.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAiB5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgWN: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgWN: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgWN;
|
|
5
4
|
//# sourceMappingURL=wN.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wN.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/wN.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wN.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/wN.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAc5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgWP: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgWP: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgWP;
|
|
5
4
|
//# sourceMappingURL=wP.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wP.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/wP.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wP.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/wP.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAU5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgWQ: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgWQ: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgWQ;
|
|
5
4
|
//# sourceMappingURL=wQ.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wQ.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/wQ.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wQ.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/wQ.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAY5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { SVGProps } from 'react';
|
|
3
|
-
declare const SvgWR: (props: SVGProps<SVGSVGElement>) =>
|
|
2
|
+
declare const SvgWR: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default SvgWR;
|
|
5
4
|
//# sourceMappingURL=wR.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wR.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/wR.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wR.d.ts","sourceRoot":"","sources":["../../../../../../../src/gen/pieces/chess/cburnett/wR.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,KAAK,UAAW,QAAQ,CAAC,aAAa,CAAC,4CAU5C,CAAC;AACF,eAAe,KAAK,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-gameboard",
|
|
3
|
-
"version": "0.7.5-
|
|
3
|
+
"version": "0.7.5-staging.2ff1350",
|
|
4
4
|
"description": "Game board.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "DXOS.org",
|
|
9
|
+
"type": "module",
|
|
9
10
|
"exports": {
|
|
10
11
|
".": {
|
|
11
12
|
"types": "./dist/types/src/index.d.ts",
|
|
@@ -24,11 +25,11 @@
|
|
|
24
25
|
"@preact/signals-core": "^1.6.0",
|
|
25
26
|
"chess.js": "^1.0.0",
|
|
26
27
|
"react-resize-detector": "^11.0.1",
|
|
27
|
-
"@dxos/debug": "0.7.5-
|
|
28
|
-
"@dxos/
|
|
29
|
-
"@dxos/
|
|
30
|
-
"@dxos/
|
|
31
|
-
"@dxos/
|
|
28
|
+
"@dxos/debug": "0.7.5-staging.2ff1350",
|
|
29
|
+
"@dxos/log": "0.7.5-staging.2ff1350",
|
|
30
|
+
"@dxos/invariant": "0.7.5-staging.2ff1350",
|
|
31
|
+
"@dxos/node-std": "0.7.5-staging.2ff1350",
|
|
32
|
+
"@dxos/util": "0.7.5-staging.2ff1350"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
35
|
"@svgr/cli": "^8.1.0",
|
|
@@ -39,15 +40,15 @@
|
|
|
39
40
|
"react": "~18.2.0",
|
|
40
41
|
"react-dom": "~18.2.0",
|
|
41
42
|
"vite": "5.4.7",
|
|
42
|
-
"@dxos/react-ui": "0.7.5-
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
43
|
+
"@dxos/react-ui": "0.7.5-staging.2ff1350",
|
|
44
|
+
"@dxos/storybook-utils": "0.7.5-staging.2ff1350",
|
|
45
|
+
"@dxos/react-ui-theme": "0.7.5-staging.2ff1350"
|
|
45
46
|
},
|
|
46
47
|
"peerDependencies": {
|
|
47
48
|
"react": "~18.2.0",
|
|
48
49
|
"react-dom": "~18.2.0",
|
|
49
|
-
"@dxos/react-ui": "0.7.5-
|
|
50
|
-
"@dxos/react-ui-theme": "0.7.5-
|
|
50
|
+
"@dxos/react-ui": "0.7.5-staging.2ff1350",
|
|
51
|
+
"@dxos/react-ui-theme": "0.7.5-staging.2ff1350"
|
|
51
52
|
},
|
|
52
53
|
"publishConfig": {
|
|
53
54
|
"access": "public"
|
package/src/Board/Board.tsx
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
6
|
-
import React, { type PropsWithChildren, useEffect, useState } from 'react';
|
|
6
|
+
import React, { type PropsWithChildren, useCallback, useEffect, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { log } from '@dxos/log';
|
|
9
9
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
10
10
|
import { mx } from '@dxos/react-ui-theme';
|
|
11
11
|
|
|
12
12
|
import { Container } from './Container';
|
|
13
|
-
import { BoardContext } from './context';
|
|
14
|
-
import { type BoardModel, isLocation, isPiece, type Move } from './types';
|
|
13
|
+
import { BoardContext, type BoardContextType } from './context';
|
|
14
|
+
import { type BoardModel, isLocation, isPiece, type Move, type PieceRecord } from './types';
|
|
15
15
|
|
|
16
16
|
type RootProps = ThemedClassName<
|
|
17
17
|
PropsWithChildren<{
|
|
@@ -25,8 +25,20 @@ type RootProps = ThemedClassName<
|
|
|
25
25
|
*/
|
|
26
26
|
const Root = ({ children, classNames, model, onDrop }: RootProps) => {
|
|
27
27
|
const [dragging, setDragging] = useState(false);
|
|
28
|
+
const [promoting, setPromoting] = useState<PieceRecord | undefined>();
|
|
29
|
+
|
|
30
|
+
// Handle promotion.
|
|
31
|
+
const onPromotion = useCallback<BoardContextType['onPromotion']>((move) => {
|
|
32
|
+
log('onPromotion', { move });
|
|
33
|
+
setPromoting(undefined);
|
|
34
|
+
onDrop?.(move);
|
|
35
|
+
}, []);
|
|
28
36
|
|
|
29
37
|
useEffect(() => {
|
|
38
|
+
if (!model) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
30
42
|
// TODO(burdon): Should target specific container.
|
|
31
43
|
return monitorForElements({
|
|
32
44
|
onDragStart: ({ source }) => {
|
|
@@ -46,14 +58,20 @@ const Root = ({ children, classNames, model, onDrop }: RootProps) => {
|
|
|
46
58
|
return;
|
|
47
59
|
}
|
|
48
60
|
|
|
49
|
-
|
|
61
|
+
const move: Move = { from: piece.location, to: targetLocation, piece: piece.type };
|
|
62
|
+
if (model.canPromote?.(move)) {
|
|
63
|
+
setPromoting({ ...piece, location: targetLocation });
|
|
64
|
+
} else {
|
|
65
|
+
onDrop?.(move);
|
|
66
|
+
}
|
|
67
|
+
|
|
50
68
|
setDragging(false);
|
|
51
69
|
},
|
|
52
70
|
});
|
|
53
|
-
}, []);
|
|
71
|
+
}, [model]);
|
|
54
72
|
|
|
55
73
|
return (
|
|
56
|
-
<BoardContext.Provider value={{ model, dragging }}>
|
|
74
|
+
<BoardContext.Provider value={{ model, dragging, promoting, onPromotion }}>
|
|
57
75
|
<Container classNames={mx('aspect-square', classNames)}>{children}</Container>
|
|
58
76
|
</BoardContext.Provider>
|
|
59
77
|
);
|
package/src/Board/Piece.tsx
CHANGED
|
@@ -11,7 +11,7 @@ import { createPortal } from 'react-dom';
|
|
|
11
11
|
|
|
12
12
|
import { invariant } from '@dxos/invariant';
|
|
13
13
|
import { log } from '@dxos/log';
|
|
14
|
-
import { useTrackProps, type ThemedClassName } from '@dxos/react-ui';
|
|
14
|
+
import { useDynamicRef, useTrackProps, type ThemedClassName } from '@dxos/react-ui';
|
|
15
15
|
import { mx } from '@dxos/react-ui-theme';
|
|
16
16
|
|
|
17
17
|
import { useBoardContext } from './context';
|
|
@@ -30,7 +30,8 @@ export const Piece = memo(({ classNames, piece, orientation, bounds, label, Comp
|
|
|
30
30
|
useTrackProps({ classNames, piece, orientation, bounds, label, Component }, Piece.displayName, false);
|
|
31
31
|
const { model } = useBoardContext();
|
|
32
32
|
|
|
33
|
-
const { dragging: isDragging } = useBoardContext();
|
|
33
|
+
const { dragging: isDragging, promoting } = useBoardContext();
|
|
34
|
+
const promotingRef = useDynamicRef(promoting);
|
|
34
35
|
const [dragging, setDragging] = useState(false);
|
|
35
36
|
const [preview, setPreview] = useState<HTMLElement>();
|
|
36
37
|
|
|
@@ -65,20 +66,20 @@ export const Piece = memo(({ classNames, piece, orientation, bounds, label, Comp
|
|
|
65
66
|
nativeSetDragImage,
|
|
66
67
|
});
|
|
67
68
|
},
|
|
68
|
-
canDrag: () => model?.turn === piece.side,
|
|
69
|
+
canDrag: () => !promotingRef.current && model?.turn === piece.side,
|
|
69
70
|
onDragStart: () => setDragging(true),
|
|
70
|
-
onDrop: ({ location }) => {
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
setCurrent((current) => ({ ...current, location: loc }));
|
|
71
|
+
onDrop: ({ location: { current } }) => {
|
|
72
|
+
const location = current.dropTargets[0].data.location;
|
|
73
|
+
if (isLocation(location)) {
|
|
74
|
+
setCurrent((current) => ({ ...current, location }));
|
|
75
75
|
}
|
|
76
|
+
|
|
76
77
|
setDragging(false);
|
|
77
78
|
},
|
|
78
79
|
});
|
|
79
80
|
}, [model, piece]);
|
|
80
81
|
|
|
81
|
-
//
|
|
82
|
+
// Must update position independently of render cycle (otherwise animation is interrupted).
|
|
82
83
|
useEffect(() => {
|
|
83
84
|
requestAnimationFrame(() => {
|
|
84
85
|
if (!ref.current || !bounds) {
|
package/src/Board/Square.tsx
CHANGED
|
@@ -45,7 +45,7 @@ export const Square = memo(({ location, bounds, label, classNames }: SquareProps
|
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
if (model?.isValidMove({
|
|
48
|
+
if (model?.isValidMove({ from: piece.location, to: location, piece: piece.type })) {
|
|
49
49
|
setState('validMove');
|
|
50
50
|
} else {
|
|
51
51
|
setState('invalidMove');
|
package/src/Board/context.ts
CHANGED
|
@@ -6,9 +6,16 @@ import { createContext, useContext } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { raise } from '@dxos/debug';
|
|
8
8
|
|
|
9
|
-
import { type BoardModel } from './types';
|
|
9
|
+
import { type PieceRecord, type BoardModel, type Move } from './types';
|
|
10
10
|
|
|
11
|
-
export
|
|
11
|
+
export type BoardContextType = {
|
|
12
|
+
model?: BoardModel;
|
|
13
|
+
dragging?: boolean; // TODO(burdon): Change to PieceRecord.
|
|
14
|
+
promoting?: PieceRecord;
|
|
15
|
+
onPromotion: (move: Move) => void;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const BoardContext = createContext<BoardContextType | undefined>(undefined);
|
|
12
19
|
|
|
13
20
|
export const useBoardContext = () => {
|
|
14
21
|
return useContext(BoardContext) ?? raise(new Error('Missing BoardContext'));
|