@dxos/react-ui-gameboard 0.8.4-main.c4373fc → 0.8.4-main.c85a9c8dae

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.
Files changed (92) hide show
  1. package/README.md +2 -0
  2. package/dist/lib/browser/index.mjs +547 -682
  3. package/dist/lib/browser/index.mjs.map +3 -3
  4. package/dist/lib/browser/meta.json +1 -1
  5. package/dist/lib/node-esm/index.mjs +547 -682
  6. package/dist/lib/node-esm/index.mjs.map +3 -3
  7. package/dist/lib/node-esm/meta.json +1 -1
  8. package/dist/types/src/components/Chessboard/Chessboard.d.ts +1 -1
  9. package/dist/types/src/components/Chessboard/Chessboard.d.ts.map +1 -1
  10. package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts +1 -4
  11. package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts.map +1 -1
  12. package/dist/types/src/components/Chessboard/chess.d.ts +5 -4
  13. package/dist/types/src/components/Chessboard/chess.d.ts.map +1 -1
  14. package/dist/types/src/components/Gameboard/Gameboard.d.ts +5 -6
  15. package/dist/types/src/components/Gameboard/Gameboard.d.ts.map +1 -1
  16. package/dist/types/src/components/Gameboard/Piece.d.ts.map +1 -1
  17. package/dist/types/src/components/Gameboard/Square.d.ts.map +1 -1
  18. package/dist/types/src/components/Gameboard/types.d.ts +2 -3
  19. package/dist/types/src/components/Gameboard/types.d.ts.map +1 -1
  20. package/dist/types/src/gen/pieces/chess/alpha/bB.d.ts +2 -2
  21. package/dist/types/src/gen/pieces/chess/alpha/bB.d.ts.map +1 -1
  22. package/dist/types/src/gen/pieces/chess/alpha/bK.d.ts +2 -2
  23. package/dist/types/src/gen/pieces/chess/alpha/bN.d.ts +2 -2
  24. package/dist/types/src/gen/pieces/chess/alpha/bP.d.ts +2 -2
  25. package/dist/types/src/gen/pieces/chess/alpha/bQ.d.ts +2 -2
  26. package/dist/types/src/gen/pieces/chess/alpha/bQ.d.ts.map +1 -1
  27. package/dist/types/src/gen/pieces/chess/alpha/bR.d.ts +2 -2
  28. package/dist/types/src/gen/pieces/chess/alpha/index.d.ts +12 -12
  29. package/dist/types/src/gen/pieces/chess/alpha/wB.d.ts +2 -2
  30. package/dist/types/src/gen/pieces/chess/alpha/wK.d.ts +2 -2
  31. package/dist/types/src/gen/pieces/chess/alpha/wN.d.ts +2 -2
  32. package/dist/types/src/gen/pieces/chess/alpha/wP.d.ts +2 -2
  33. package/dist/types/src/gen/pieces/chess/alpha/wQ.d.ts +2 -2
  34. package/dist/types/src/gen/pieces/chess/alpha/wR.d.ts +2 -2
  35. package/dist/types/src/gen/pieces/chess/cburnett/bB.d.ts +2 -2
  36. package/dist/types/src/gen/pieces/chess/cburnett/bB.d.ts.map +1 -1
  37. package/dist/types/src/gen/pieces/chess/cburnett/bK.d.ts +2 -2
  38. package/dist/types/src/gen/pieces/chess/cburnett/bK.d.ts.map +1 -1
  39. package/dist/types/src/gen/pieces/chess/cburnett/bN.d.ts +2 -2
  40. package/dist/types/src/gen/pieces/chess/cburnett/bN.d.ts.map +1 -1
  41. package/dist/types/src/gen/pieces/chess/cburnett/bP.d.ts +2 -2
  42. package/dist/types/src/gen/pieces/chess/cburnett/bQ.d.ts +2 -2
  43. package/dist/types/src/gen/pieces/chess/cburnett/bQ.d.ts.map +1 -1
  44. package/dist/types/src/gen/pieces/chess/cburnett/bR.d.ts +2 -2
  45. package/dist/types/src/gen/pieces/chess/cburnett/bR.d.ts.map +1 -1
  46. package/dist/types/src/gen/pieces/chess/cburnett/index.d.ts +12 -12
  47. package/dist/types/src/gen/pieces/chess/cburnett/wB.d.ts +2 -2
  48. package/dist/types/src/gen/pieces/chess/cburnett/wB.d.ts.map +1 -1
  49. package/dist/types/src/gen/pieces/chess/cburnett/wK.d.ts +2 -2
  50. package/dist/types/src/gen/pieces/chess/cburnett/wK.d.ts.map +1 -1
  51. package/dist/types/src/gen/pieces/chess/cburnett/wN.d.ts +2 -2
  52. package/dist/types/src/gen/pieces/chess/cburnett/wN.d.ts.map +1 -1
  53. package/dist/types/src/gen/pieces/chess/cburnett/wP.d.ts +2 -2
  54. package/dist/types/src/gen/pieces/chess/cburnett/wQ.d.ts +2 -2
  55. package/dist/types/src/gen/pieces/chess/cburnett/wQ.d.ts.map +1 -1
  56. package/dist/types/src/gen/pieces/chess/cburnett/wR.d.ts +2 -2
  57. package/dist/types/src/gen/pieces/chess/cburnett/wR.d.ts.map +1 -1
  58. package/dist/types/tsconfig.tsbuildinfo +1 -1
  59. package/package.json +26 -23
  60. package/src/components/Chessboard/Chessboard.stories.tsx +9 -8
  61. package/src/components/Chessboard/Chessboard.tsx +21 -13
  62. package/src/components/Chessboard/chess.ts +13 -10
  63. package/src/components/Gameboard/Gameboard.tsx +8 -9
  64. package/src/components/Gameboard/Piece.tsx +5 -3
  65. package/src/components/Gameboard/Square.tsx +5 -3
  66. package/src/components/Gameboard/types.ts +2 -3
  67. package/src/gen/pieces/chess/alpha/bB.tsx +9 -6
  68. package/src/gen/pieces/chess/alpha/bK.tsx +7 -7
  69. package/src/gen/pieces/chess/alpha/bN.tsx +7 -7
  70. package/src/gen/pieces/chess/alpha/bP.tsx +5 -5
  71. package/src/gen/pieces/chess/alpha/bQ.tsx +9 -6
  72. package/src/gen/pieces/chess/alpha/bR.tsx +6 -6
  73. package/src/gen/pieces/chess/alpha/index.ts +12 -12
  74. package/src/gen/pieces/chess/alpha/wB.tsx +7 -7
  75. package/src/gen/pieces/chess/alpha/wK.tsx +7 -7
  76. package/src/gen/pieces/chess/alpha/wN.tsx +7 -7
  77. package/src/gen/pieces/chess/alpha/wP.tsx +7 -7
  78. package/src/gen/pieces/chess/alpha/wQ.tsx +7 -7
  79. package/src/gen/pieces/chess/alpha/wR.tsx +7 -7
  80. package/src/gen/pieces/chess/cburnett/bB.tsx +20 -9
  81. package/src/gen/pieces/chess/cburnett/bK.tsx +25 -15
  82. package/src/gen/pieces/chess/cburnett/bN.tsx +20 -13
  83. package/src/gen/pieces/chess/cburnett/bP.tsx +6 -6
  84. package/src/gen/pieces/chess/cburnett/bQ.tsx +19 -13
  85. package/src/gen/pieces/chess/cburnett/bR.tsx +27 -11
  86. package/src/gen/pieces/chess/cburnett/index.ts +12 -12
  87. package/src/gen/pieces/chess/cburnett/wB.tsx +19 -9
  88. package/src/gen/pieces/chess/cburnett/wK.tsx +19 -12
  89. package/src/gen/pieces/chess/cburnett/wN.tsx +16 -9
  90. package/src/gen/pieces/chess/cburnett/wP.tsx +7 -7
  91. package/src/gen/pieces/chess/cburnett/wQ.tsx +19 -9
  92. package/src/gen/pieces/chess/cburnett/wR.tsx +19 -9
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-gameboard",
3
- "version": "0.8.4-main.c4373fc",
3
+ "version": "0.8.4-main.c85a9c8dae",
4
4
  "description": "Game board.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/dxos/dxos"
10
+ },
7
11
  "license": "MIT",
8
12
  "author": "DXOS.org",
9
13
  "type": "module",
@@ -24,37 +28,36 @@
24
28
  "src"
25
29
  ],
26
30
  "dependencies": {
27
- "@atlaskit/pragmatic-drag-and-drop": "^1.4.0",
28
- "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.3",
29
- "@preact-signals/safe-react": "^0.9.0",
30
- "@preact/signals-core": "^1.12.1",
31
+ "@atlaskit/pragmatic-drag-and-drop": "1.7.7",
32
+ "@atlaskit/pragmatic-drag-and-drop-hitbox": "1.1.0",
33
+ "@effect-atom/atom-react": "^0.5.0",
31
34
  "@radix-ui/react-context": "1.1.1",
32
- "chess.js": "^1.4.0",
35
+ "chess.js": "^1.0.0",
33
36
  "react-resize-detector": "^11.0.1",
34
- "@dxos/debug": "0.8.4-main.c4373fc",
35
- "@dxos/invariant": "0.8.4-main.c4373fc",
36
- "@dxos/log": "0.8.4-main.c4373fc",
37
- "@dxos/node-std": "0.8.4-main.c4373fc",
38
- "@dxos/util": "0.8.4-main.c4373fc"
37
+ "@dxos/debug": "0.8.4-main.c85a9c8dae",
38
+ "@dxos/invariant": "0.8.4-main.c85a9c8dae",
39
+ "@dxos/node-std": "0.8.4-main.c85a9c8dae",
40
+ "@dxos/util": "0.8.4-main.c85a9c8dae",
41
+ "@dxos/log": "0.8.4-main.c85a9c8dae"
39
42
  },
40
43
  "devDependencies": {
41
44
  "@svgr/cli": "^8.1.0",
42
45
  "@types/lodash.defaultsdeep": "^4.6.6",
43
- "@types/react": "~19.2.2",
44
- "@types/react-dom": "~19.2.1",
46
+ "@types/react": "~19.2.7",
47
+ "@types/react-dom": "~19.2.3",
45
48
  "lodash.defaultsdeep": "^4.6.1",
46
- "react": "~19.2.0",
47
- "react-dom": "~19.2.0",
48
- "vite": "7.1.9",
49
- "@dxos/react-ui-theme": "0.8.4-main.c4373fc",
50
- "@dxos/react-ui": "0.8.4-main.c4373fc",
51
- "@dxos/storybook-utils": "0.8.4-main.c4373fc"
49
+ "react": "~19.2.3",
50
+ "react-dom": "~19.2.3",
51
+ "vite": "^7.1.11",
52
+ "@dxos/storybook-utils": "0.8.4-main.c85a9c8dae",
53
+ "@dxos/react-ui": "0.8.4-main.c85a9c8dae",
54
+ "@dxos/ui-theme": "0.8.4-main.c85a9c8dae"
52
55
  },
53
56
  "peerDependencies": {
54
- "react": "^19.0.0",
55
- "react-dom": "^19.0.0",
56
- "@dxos/react-ui": "0.8.4-main.c4373fc",
57
- "@dxos/react-ui-theme": "0.8.4-main.c4373fc"
57
+ "react": "~19.2.3",
58
+ "react-dom": "~19.2.3",
59
+ "@dxos/react-ui": "0.8.4-main.c85a9c8dae",
60
+ "@dxos/ui-theme": "0.8.4-main.c85a9c8dae"
58
61
  },
59
62
  "publishConfig": {
60
63
  "access": "public"
@@ -2,11 +2,13 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
+ import { RegistryContext } from '@effect-atom/atom-react';
5
6
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
- import React, { useCallback, useEffect, useMemo, useState } from 'react';
7
+ import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react';
7
8
 
8
9
  import { Button, Toolbar } from '@dxos/react-ui';
9
- import { withTheme } from '@dxos/react-ui/testing';
10
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
11
+ import { withRegistry } from '@dxos/storybook-utils';
10
12
 
11
13
  import { Gameboard, type GameboardRootProps, type Move, type Player } from '../Gameboard';
12
14
 
@@ -18,7 +20,8 @@ type DefaultStoryProps = Pick<ChessboardProps, 'orientation' | 'showLabels' | 'd
18
20
  };
19
21
 
20
22
  const DefaultStory = ({ orientation: _orientation, pgn, ...props }: DefaultStoryProps) => {
21
- const model = useMemo(() => new ChessModel(pgn), [pgn]);
23
+ const registry = useContext(RegistryContext);
24
+ const model = useMemo(() => new ChessModel(registry, pgn), [registry, pgn]);
22
25
  const [orientation, setOrientation] = useState<Player | undefined>(_orientation);
23
26
 
24
27
  const handleDrop = useCallback<NonNullable<GameboardRootProps<ChessModel>['onDrop']>>(
@@ -52,7 +55,8 @@ const DefaultStory = ({ orientation: _orientation, pgn, ...props }: DefaultStory
52
55
  };
53
56
 
54
57
  const GridStory = () => {
55
- const models = useMemo(() => Array.from({ length: 9 }).map(() => new ChessModel()), []);
58
+ const registry = useContext(RegistryContext);
59
+ const models = useMemo(() => Array.from({ length: 9 }).map(() => new ChessModel(registry)), [registry]);
56
60
  useEffect(() => {
57
61
  const i = setInterval(() => {
58
62
  const model = models[Math.floor(Math.random() * models.length)];
@@ -80,10 +84,7 @@ const meta = {
80
84
  title: 'ui/react-ui-gameboard/Chessboard',
81
85
  component: Chessboard,
82
86
  render: DefaultStory,
83
- decorators: [withTheme],
84
- parameters: {
85
- layout: 'column',
86
- },
87
+ decorators: [withRegistry, withTheme(), withLayout({ layout: 'column' })],
87
88
  } satisfies Meta<typeof Chessboard>;
88
89
 
89
90
  export default meta;
@@ -2,17 +2,19 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import { Atom, useAtomValue } from '@effect-atom/atom-react';
5
6
  import React, { type PropsWithChildren, forwardRef, memo, useEffect, useMemo, useRef, useState } from 'react';
6
7
  import { useResizeDetector } from 'react-resize-detector';
7
8
 
8
9
  import { type ThemedClassName, useForwardedRef } from '@dxos/react-ui';
9
- import { mx } from '@dxos/react-ui-theme';
10
- import { isTruthy } from '@dxos/util';
10
+ import { mx } from '@dxos/ui-theme';
11
+ import { isNonNullable } from '@dxos/util';
11
12
 
12
13
  import {
13
14
  type DOMRectBounds,
14
15
  Gameboard,
15
16
  type Location,
17
+ type PieceMap,
16
18
  type PieceRecord,
17
19
  type Player,
18
20
  getRelativeBounds,
@@ -22,6 +24,14 @@ import {
22
24
 
23
25
  import { type ChessModel, type ChessPiece, ChessPieces, boardStyles, getSquareColor, locationToPos } from './chess';
24
26
 
27
+ /** Fallback atom for when model is undefined. */
28
+ const EMPTY_PIECES_ATOM = Atom.make<PieceMap<ChessPiece>>({});
29
+
30
+ /**
31
+ * Chessboard layout.
32
+ */
33
+ const CHESSBOARD_NAME = 'Chessboard';
34
+
25
35
  export type ChessboardProps = ThemedClassName<
26
36
  PropsWithChildren<{
27
37
  orientation?: Player;
@@ -32,14 +42,12 @@ export type ChessboardProps = ThemedClassName<
32
42
  }>
33
43
  >;
34
44
 
35
- /**
36
- * Chessboard layout.
37
- */
38
45
  const ChessboardComponent = forwardRef<HTMLDivElement, ChessboardProps>(
39
46
  ({ classNames, orientation, showLabels, debug, rows = 8, cols = 8 }, forwardedRef) => {
40
47
  const targetRef = useForwardedRef(forwardedRef);
41
48
  const { width, height } = useResizeDetector({ targetRef, refreshRate: 200 });
42
- const { model, promoting, onPromotion } = useGameboardContext<ChessModel>(Chessboard.displayName!);
49
+ const { model, promoting, onPromotion } = useGameboardContext<ChessModel>(CHESSBOARD_NAME);
50
+ const pieces = useAtomValue(model?.pieces ?? EMPTY_PIECES_ATOM);
43
51
 
44
52
  // Board squares.
45
53
  const squares = useMemo<Location[]>(() => {
@@ -55,7 +63,7 @@ const ChessboardComponent = forwardRef<HTMLDivElement, ChessboardProps>(
55
63
  <div
56
64
  key={locationToString(location)}
57
65
  {...{
58
- ['data-location' as const]: locationToString(location),
66
+ 'data-location': locationToString(location),
59
67
  }}
60
68
  />
61
69
  );
@@ -84,7 +92,7 @@ const ChessboardComponent = forwardRef<HTMLDivElement, ChessboardProps>(
84
92
  return [];
85
93
  }
86
94
 
87
- return Object.values(model?.pieces.value ?? {})
95
+ return Object.values(pieces)
88
96
  .map((piece) => {
89
97
  if (piece.id === promoting?.id) {
90
98
  return null;
@@ -93,11 +101,11 @@ const ChessboardComponent = forwardRef<HTMLDivElement, ChessboardProps>(
93
101
  const bounds = grid[locationToString(piece.location)];
94
102
  return { piece, bounds };
95
103
  })
96
- .filter(isTruthy);
97
- }, [grid, model?.pieces.value, promoting]);
104
+ .filter(isNonNullable);
105
+ }, [grid, pieces, promoting]);
98
106
 
99
107
  return (
100
- <div ref={targetRef} tabIndex={0} className={mx('relative outline-none', classNames)}>
108
+ <div ref={targetRef} tabIndex={0} className={mx('relative outline-hidden', classNames)}>
101
109
  {/* DOM Layout. */}
102
110
  <div ref={gridRef} className='grid grid-rows-8 grid-cols-8 aspect-square select-none'>
103
111
  {layout}
@@ -134,7 +142,7 @@ const ChessboardComponent = forwardRef<HTMLDivElement, ChessboardProps>(
134
142
  piece={promoting}
135
143
  onSelect={(piece) => {
136
144
  onPromotion({
137
- from: Object.values(model.pieces.value).find((p) => p.id === promoting.id)!.location,
145
+ from: Object.values(pieces).find((p) => p.id === promoting.id)!.location,
138
146
  to: piece.location,
139
147
  piece: promoting.type,
140
148
  promotion: piece.type,
@@ -147,7 +155,7 @@ const ChessboardComponent = forwardRef<HTMLDivElement, ChessboardProps>(
147
155
  },
148
156
  );
149
157
 
150
- ChessboardComponent.displayName = 'Chessboard';
158
+ ChessboardComponent.displayName = CHESSBOARD_NAME;
151
159
 
152
160
  export const Chessboard = memo(ChessboardComponent);
153
161
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { type ReadonlySignal, signal } from '@preact/signals-core';
5
+ import { Atom, type Registry } from '@effect-atom/atom-react';
6
6
  import { Chess as ChessJS } from 'chess.js';
7
7
  import { type FC, type SVGProps } from 'react';
8
8
 
@@ -85,15 +85,18 @@ export const createChess = (pgn?: string): ChessJS => {
85
85
  */
86
86
  export class ChessModel implements GameboardModel<ChessPiece> {
87
87
  private readonly _chess = new ChessJS();
88
- private readonly _pieces = signal<PieceMap<ChessPiece>>({});
89
- private readonly _moveIndex = signal(0);
88
+ private readonly _pieces = Atom.make<PieceMap<ChessPiece>>({});
89
+ private readonly _moveIndex = Atom.make(0);
90
90
 
91
- constructor(pgn?: string) {
91
+ constructor(
92
+ private readonly _registry: Registry.Registry,
93
+ pgn?: string,
94
+ ) {
92
95
  this.update(pgn);
93
96
  }
94
97
 
95
98
  get readonly(): boolean {
96
- return this._moveIndex.value !== this._chess.history().length;
99
+ return this._registry.get(this._moveIndex) !== this._chess.history().length;
97
100
  }
98
101
 
99
102
  get turn(): Player {
@@ -104,11 +107,11 @@ export class ChessModel implements GameboardModel<ChessPiece> {
104
107
  return this._chess;
105
108
  }
106
109
 
107
- get pieces(): ReadonlySignal<PieceMap<ChessPiece>> {
110
+ get pieces(): Atom.Atom<PieceMap<ChessPiece>> {
108
111
  return this._pieces;
109
112
  }
110
113
 
111
- get moveIndex(): ReadonlySignal<number> {
114
+ get moveIndex(): Atom.Atom<number> {
112
115
  return this._moveIndex;
113
116
  }
114
117
 
@@ -158,7 +161,7 @@ export class ChessModel implements GameboardModel<ChessPiece> {
158
161
 
159
162
  const current = this._chess.history();
160
163
  if (!isValidNextMove(previous, current)) {
161
- this._pieces.value = {};
164
+ this._registry.set(this._pieces, {});
162
165
  }
163
166
 
164
167
  this._updateBoard(this._chess);
@@ -201,8 +204,8 @@ export class ChessModel implements GameboardModel<ChessPiece> {
201
204
  * Update pieces preserving identity.
202
205
  */
203
206
  private _updateBoard(chess: ChessJS): void {
204
- this._pieces.value = createPieceMap(chess);
205
- this._moveIndex.value = chess.history().length;
207
+ this._registry.set(this._pieces, createPieceMap(chess));
208
+ this._registry.set(this._moveIndex, chess.history().length);
206
209
  }
207
210
  }
208
211
 
@@ -8,13 +8,13 @@ import React, { type PropsWithChildren, forwardRef, useCallback, useEffect, useS
8
8
 
9
9
  import { log } from '@dxos/log';
10
10
  import { type ThemedClassName } from '@dxos/react-ui';
11
- import { mx } from '@dxos/react-ui-theme';
11
+ import { mx } from '@dxos/ui-theme';
12
12
 
13
13
  import { Piece, type PieceProps } from './Piece';
14
14
  import { Square, type SquareProps } from './Square';
15
15
  import { type GameboardModel, type Move, type PieceRecord, isLocation, isPiece } from './types';
16
16
 
17
- export type GameboardContextValue<M extends GameboardModel> = {
17
+ export type GameboardContextValue<M extends GameboardModel<any>> = {
18
18
  model: M;
19
19
  dragging?: boolean; // TODO(burdon): Change to PieceRecord.
20
20
  promoting?: PieceRecord;
@@ -23,7 +23,7 @@ export type GameboardContextValue<M extends GameboardModel> = {
23
23
 
24
24
  const [GameboardContextProvider, useRadixGameboardContext] = createContext<GameboardContextValue<any>>('Gameboard');
25
25
 
26
- const useGameboardContext = <M extends GameboardModel>(consumerName: string): GameboardContextValue<M> => {
26
+ const useGameboardContext = <M extends GameboardModel<any>>(consumerName: string): GameboardContextValue<M> => {
27
27
  return useRadixGameboardContext(consumerName);
28
28
  };
29
29
 
@@ -31,20 +31,19 @@ const useGameboardContext = <M extends GameboardModel>(consumerName: string): Ga
31
31
  // Root
32
32
  //
33
33
 
34
- type GameboardRootProps<M extends GameboardModel> = PropsWithChildren<{
34
+ type GameboardRootProps<M extends GameboardModel<any>> = PropsWithChildren<{
35
35
  model?: M;
36
- moveNumber?: number;
37
36
  onDrop?: (move: Move) => boolean;
38
37
  }>;
39
38
 
40
39
  /**
41
40
  * Generic board container.
42
41
  */
43
- const GameboardRoot = <M extends GameboardModel>({ children, model, moveNumber, onDrop }: GameboardRootProps<M>) => {
42
+ const GameboardRoot = <M extends GameboardModel<any>>({ children, model, onDrop }: GameboardRootProps<M>) => {
44
43
  const [dragging, setDragging] = useState(false);
45
44
  const [promoting, setPromoting] = useState<PieceRecord | undefined>();
46
45
 
47
- const handlePromotion = useCallback<GameboardContextValue<M>['onPromotion']>((move) => {
46
+ const handlePromotion = useCallback<GameboardContextValue<GameboardModel<any>>['onPromotion']>((move) => {
48
47
  log('onPromotion', { move });
49
48
  setPromoting(undefined);
50
49
  onDrop?.(move);
@@ -108,10 +107,10 @@ const GameboardContent = forwardRef<HTMLDivElement, GameboardContentProps>(
108
107
  return (
109
108
  <div
110
109
  role='none'
111
- className={mx(grow && 'grid is-full bs-full size-container place-content-center', classNames)}
110
+ className={mx(grow && 'grid w-full h-full dx-size-container place-content-center', classNames)}
112
111
  ref={forwardedRef}
113
112
  >
114
- {contain ? <div className='is-[min(100cqw,100cqh)] bs-[min(100cqw,100cqh)]'>{children}</div> : children}
113
+ {contain ? <div className='w-[min(100cqw,100cqh)] h-[min(100cqw,100cqh)]'>{children}</div> : children}
115
114
  </div>
116
115
  );
117
116
  },
@@ -11,7 +11,7 @@ import { createPortal } from 'react-dom';
11
11
  import { invariant } from '@dxos/invariant';
12
12
  import { log } from '@dxos/log';
13
13
  import { type ThemedClassName, useDynamicRef } from '@dxos/react-ui';
14
- import { mx } from '@dxos/react-ui-theme';
14
+ import { mx } from '@dxos/ui-theme';
15
15
 
16
16
  import { useGameboardContext } from './Gameboard';
17
17
  import { type Location, type PieceRecord, type Player, isEqualLocation, isLocation } from './types';
@@ -26,8 +26,10 @@ export type PieceProps = ThemedClassName<{
26
26
  onClick?: () => void;
27
27
  }>;
28
28
 
29
+ const PIECE_NAME = 'Piece';
30
+
29
31
  export const Piece = memo(({ classNames, Component, piece, bounds, label, onClick }: PieceProps) => {
30
- const { model, dragging: isDragging, promoting } = useGameboardContext(Piece.displayName!);
32
+ const { model, dragging: isDragging, promoting } = useGameboardContext(PIECE_NAME);
31
33
  const promotingRef = useDynamicRef(promoting);
32
34
  const [dragging, setDragging] = useState(false);
33
35
  const [preview, setPreview] = useState<HTMLElement>();
@@ -134,4 +136,4 @@ export const Piece = memo(({ classNames, Component, piece, bounds, label, onClic
134
136
  );
135
137
  });
136
138
 
137
- Piece.displayName = 'Piece';
139
+ Piece.displayName = PIECE_NAME;
@@ -8,7 +8,7 @@ import React, { memo, useEffect, useRef, useState } from 'react';
8
8
  import { invariant } from '@dxos/invariant';
9
9
  import { log } from '@dxos/log';
10
10
  import { type ThemedClassName } from '@dxos/react-ui';
11
- import { mx } from '@dxos/react-ui-theme';
11
+ import { mx } from '@dxos/ui-theme';
12
12
 
13
13
  import { useGameboardContext } from './Gameboard';
14
14
  import { type Location, isPiece } from './types';
@@ -22,10 +22,12 @@ export type SquareProps = ThemedClassName<{
22
22
  label?: string;
23
23
  }>;
24
24
 
25
+ const SQUARE_NAME = 'Square';
26
+
25
27
  export const Square = memo(({ location, bounds, label, classNames }: SquareProps) => {
26
28
  const ref = useRef<HTMLDivElement>(null);
27
29
  const [state, setState] = useState<HoveredState>('idle');
28
- const { model } = useGameboardContext(Square.displayName!);
30
+ const { model } = useGameboardContext(SQUARE_NAME);
29
31
 
30
32
  useEffect(() => {
31
33
  const el = ref.current;
@@ -71,4 +73,4 @@ export const Square = memo(({ location, bounds, label, classNames }: SquareProps
71
73
  );
72
74
  });
73
75
 
74
- Square.displayName = 'Square';
76
+ Square.displayName = SQUARE_NAME;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { type ReadonlySignal } from '@preact/signals-core';
5
+ import { type Atom } from '@effect-atom/atom-react';
6
6
 
7
7
  // TODO(burdon): Don't make this assumption.
8
8
  export type Player = 'black' | 'white';
@@ -54,8 +54,7 @@ export const isEqualLocation = (l1: Location, l2: Location): boolean => l1[0] ==
54
54
  export interface GameboardModel<T extends PieceType = PieceType> {
55
55
  readonly: boolean;
56
56
  turn: Player;
57
- /** @reactive */
58
- pieces: ReadonlySignal<PieceMap<T>>;
57
+ pieces: Atom.Atom<PieceMap<T>>;
59
58
  isValidMove: (move: Move) => boolean;
60
59
  canPromote?: (move: Move) => boolean;
61
60
  }
@@ -1,11 +1,14 @@
1
- import * as React from 'react';
2
- import type { SVGProps } from 'react';
1
+ import * as React from "react";
2
+ import type { SVGProps } from "react";
3
3
  const SvgBB = (props: SVGProps<SVGSVGElement>) => (
4
- <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2048 2048' {...props}>
5
- <path fill='#f9f9f9' d='M732 1290 628 993l386-417 421 375-132 380 49 152-658-9z' />
4
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048" {...props}>
6
5
  <path
7
- fill='#101010'
8
- d='M768 1365q-5 39-26 82h564q-18-36-26-82zm495-73 46-73q-142-49-285-47-144-2-285 47l46 73q118-40 239-38 120-2 239 38m-432 227H624q67-116 72-229-114-119-162-223t-6-224q33-96 118-189t312-247q-17-11-46-36t-29-79q0-58 41-96t100-38q58 0 100 38t41 96q0 54-29 79t-46 36q226 153 311 247t119 189q42 119-6 224t-162 223q4 113 72 229h-207l10 16q33 53 70 60t89 7h250q76 0 142 62t65 179h-495q-123 0-223-84t-101-199q0 114-101 199t-223 84H205q0-117 65-179t142-62h250q51 0 88-7t71-60zm146-701h-95v89h95v165h94V907h95v-89h-95V714h-94z'
6
+ fill="#f9f9f9"
7
+ d="M732 1290 628 993l386-417 421 375-132 380 49 152-658-9z"
8
+ />
9
+ <path
10
+ fill="#101010"
11
+ d="M768 1365q-5 39-26 82h564q-18-36-26-82zm495-73 46-73q-142-49-285-47-144-2-285 47l46 73q118-40 239-38 120-2 239 38m-432 227H624q67-116 72-229-114-119-162-223t-6-224q33-96 118-189t312-247q-17-11-46-36t-29-79q0-58 41-96t100-38q58 0 100 38t41 96q0 54-29 79t-46 36q226 153 311 247t119 189q42 119-6 224t-162 223q4 113 72 229h-207l10 16q33 53 70 60t89 7h250q76 0 142 62t65 179h-495q-123 0-223-84t-101-199q0 114-101 199t-223 84H205q0-117 65-179t142-62h250q51 0 88-7t71-60zm146-701h-95v89h95v165h94V907h95v-89h-95V714h-94z"
9
12
  />
10
13
  </svg>
11
14
  );
@@ -1,14 +1,14 @@
1
- import * as React from 'react';
2
- import type { SVGProps } from 'react';
1
+ import * as React from "react";
2
+ import type { SVGProps } from "react";
3
3
  const SvgBK = (props: SVGProps<SVGSVGElement>) => (
4
- <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2048 2048' {...props}>
4
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048" {...props}>
5
5
  <path
6
- fill='#f9f9f9'
7
- d='m553 1485-55 320 1048 5-48-335s324-313 330-467c7-153-35-331-241-406-183-67-372 121-372 121l-182-161-190 160S658 586 587 592a373 373 0 0 0-362 333c10 331 328 560 328 560'
6
+ fill="#f9f9f9"
7
+ d="m553 1485-55 320 1048 5-48-335s324-313 330-467c7-153-35-331-241-406-183-67-372 121-372 121l-182-161-190 160S658 586 587 592a373 373 0 0 0-362 333c10 331 328 560 328 560"
8
8
  />
9
9
  <path
10
- fill='#101010'
11
- d='M1024 1769h489l-12-73H547l-12 73zm0-921q-25-60-62-111 31-48 62-65 30 17 62 65-38 51-62 111m-97 454q-154 11-303 58-123-108-200-213t-77-202q0-89 74-159t148-70q67 0 135 63t102 130q30 54 75 175t46 218m-350 217-26 156 145-84zm447-907q-47 0-136 121-31-36-50-55 93-140 186-140 92 0 186 140-20 19-50 55-90-121-136-121m0 775q-1-126-42-267t-84-227l-14-27-12-23q-28-43-48-69-51-63-120-105t-134-42q-103 0-208 93T257 949q0 120 99 255t249 259q201-74 419-76m0 456H448l61-365q-325-280-326-535-1-159 125-274t267-116q78 0 159 47t142 119q61 74 99 165t49 150q12-60 49-150t99-165q61-72 142-119t159-47q140 0 266 116t126 274q-2 255-326 535l61 365zm97-541q0-97 45-218t76-175q34-68 102-130t135-63q74 0 148 70t74 159q0 96-77 202t-200 213q-150-47-303-58m350 217-119 72 145 84zm-447-132q217 2 419 76 150-125 249-259t99-255q0-136-105-229t-208-93q-66 0-135 42t-119 105q-21 26-48 69l-12 23-14 27q-44 85-85 227t-41 267m-139 159 139 86 139-84-139-86zm92-1248v-95h94v95h107v95h-107v153q-48-16-94 0V393H870v-95z'
10
+ fill="#101010"
11
+ d="M1024 1769h489l-12-73H547l-12 73zm0-921q-25-60-62-111 31-48 62-65 30 17 62 65-38 51-62 111m-97 454q-154 11-303 58-123-108-200-213t-77-202q0-89 74-159t148-70q67 0 135 63t102 130q30 54 75 175t46 218m-350 217-26 156 145-84zm447-907q-47 0-136 121-31-36-50-55 93-140 186-140 92 0 186 140-20 19-50 55-90-121-136-121m0 775q-1-126-42-267t-84-227l-14-27-12-23q-28-43-48-69-51-63-120-105t-134-42q-103 0-208 93T257 949q0 120 99 255t249 259q201-74 419-76m0 456H448l61-365q-325-280-326-535-1-159 125-274t267-116q78 0 159 47t142 119q61 74 99 165t49 150q12-60 49-150t99-165q61-72 142-119t159-47q140 0 266 116t126 274q-2 255-326 535l61 365zm97-541q0-97 45-218t76-175q34-68 102-130t135-63q74 0 148 70t74 159q0 96-77 202t-200 213q-150-47-303-58m350 217-119 72 145 84zm-447-132q217 2 419 76 150-125 249-259t99-255q0-136-105-229t-208-93q-66 0-135 42t-119 105q-21 26-48 69l-12 23-14 27q-44 85-85 227t-41 267m-139 159 139 86 139-84-139-86zm92-1248v-95h94v95h107v95h-107v153q-48-16-94 0V393H870v-95z"
12
12
  />
13
13
  </svg>
14
14
  );
@@ -1,14 +1,14 @@
1
- import * as React from 'react';
2
- import type { SVGProps } from 'react';
1
+ import * as React from "react";
2
+ import type { SVGProps } from "react";
3
3
  const SvgBN = (props: SVGProps<SVGSVGElement>) => (
4
- <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2048 2048' {...props}>
4
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048" {...props}>
5
5
  <path
6
- fill='#f9f9f9'
7
- d='M1658 1806c-408-301-71-920-452-1343l60-16s296 167 320 257c182 468 41 691 135 1077zM972 523l120 176-312-3zM498 981l-93-41 42-93 127 28z'
6
+ fill="#f9f9f9"
7
+ d="M1658 1806c-408-301-71-920-452-1343l60-16s296 167 320 257c182 468 41 691 135 1077zM972 523l120 176-312-3zM498 981l-93-41 42-93 127 28z"
8
8
  />
9
9
  <path
10
- fill='#101010'
11
- d='m502 868-52 1-26 64 69 21 46-55zm536-187q34 1-16-68t-80-42L826 680zm-338-98q6-39 116-107t220-144l115-154 96 217q342 172 433 418t47 603q-18 128 5 236t57 190l-1242 1q-9-178 39-301t183-238q50-11 83-39t53-59l63-1 138-29 139-97 66-207q0-17-8-34t-12-37q-62 228-161 289t-191 58q-236-42-292 60l-56 102-217-121 115-82-51-50-122 86-12-297zm981 1192q-102-130-85-308t27-363-50-351-316-276q220 164 253 342t16 351-12 329 167 276'
10
+ fill="#101010"
11
+ d="m502 868-52 1-26 64 69 21 46-55zm536-187q34 1-16-68t-80-42L826 680zm-338-98q6-39 116-107t220-144l115-154 96 217q342 172 433 418t47 603q-18 128 5 236t57 190l-1242 1q-9-178 39-301t183-238q50-11 83-39t53-59l63-1 138-29 139-97 66-207q0-17-8-34t-12-37q-62 228-161 289t-191 58q-236-42-292 60l-56 102-217-121 115-82-51-50-122 86-12-297zm981 1192q-102-130-85-308t27-363-50-351-316-276q220 164 253 342t16 351-12 329 167 276"
12
12
  />
13
13
  </svg>
14
14
  );
@@ -1,10 +1,10 @@
1
- import * as React from 'react';
2
- import type { SVGProps } from 'react';
1
+ import * as React from "react";
2
+ import type { SVGProps } from "react";
3
3
  const SvgBP = (props: SVGProps<SVGSVGElement>) => (
4
- <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2048 2048' {...props}>
4
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048" {...props}>
5
5
  <path
6
- fill='#101010'
7
- d='M1024 1843H446v-74q-4-80 42-137t125-108q117-91 172-217t78-268H576l284-239q-86-74-86-188 0-103 73-177t177-74q103 0 177 74t73 177q0 114-86 188l284 239h-287q23 141 78 268t172 217q79 51 125 108t42 137v74z'
6
+ fill="#101010"
7
+ d="M1024 1843H446v-74q-4-80 42-137t125-108q117-91 172-217t78-268H576l284-239q-86-74-86-188 0-103 73-177t177-74q103 0 177 74t73 177q0 114-86 188l284 239h-287q23 141 78 268t172 217q79 51 125 108t42 137v74z"
8
8
  />
9
9
  </svg>
10
10
  );
@@ -1,11 +1,14 @@
1
- import * as React from 'react';
2
- import type { SVGProps } from 'react';
1
+ import * as React from "react";
2
+ import type { SVGProps } from "react";
3
3
  const SvgBQ = (props: SVGProps<SVGSVGElement>) => (
4
- <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2048 2048' {...props}>
5
- <path fill='#f9f9f9' d='m520 1801.8 41.5-448.7 474-128.9 458 133.5 34.4 446.4z' />
4
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048" {...props}>
6
5
  <path
7
- fill='#101010'
8
- d='M590 1519q4 72-15 158l134-86zm434 324H441q114-231 57.5-456.5T296 937q-12 2-19 2-54 0-92.5-38.5T146 808t38.5-92.5T277 677t92.5 38.5T408 808q0 20-6 38-4 14-15 33l196 139 100-486q-64-31-72-103-5-44 29-91t88-53q54-5 96 29t48 88q7 68-46 114l198 412 198-412q-54-46-46-114 6-54 48-88t96-29q54 6 87.5 53t29.5 91q-9 72-72 103l100 486 196-139q-12-19-15-33-6-18-6-38 0-54 38.5-92.5T1771 677t92.5 38.5T1902 808t-38.5 92.5T1771 939q-7 0-19-2-147 224-203 449.5t58 456.5zm0-450q109 0 222 28.5t213 67.5q2-41 11-89-108-42-221.5-68t-224.5-26-225 26-221 68q8 48 11 89 99-39 212-67.5t223-28.5m0 376h478q-15-34-24-73H570q-10 39-24 73zm434-250-119 72 134 86q-20-86-15-158m-573 47 139 87 139-84-139-86z'
6
+ fill="#f9f9f9"
7
+ d="m520 1801.8 41.5-448.7 474-128.9 458 133.5 34.4 446.4z"
8
+ />
9
+ <path
10
+ fill="#101010"
11
+ d="M590 1519q4 72-15 158l134-86zm434 324H441q114-231 57.5-456.5T296 937q-12 2-19 2-54 0-92.5-38.5T146 808t38.5-92.5T277 677t92.5 38.5T408 808q0 20-6 38-4 14-15 33l196 139 100-486q-64-31-72-103-5-44 29-91t88-53q54-5 96 29t48 88q7 68-46 114l198 412 198-412q-54-46-46-114 6-54 48-88t96-29q54 6 87.5 53t29.5 91q-9 72-72 103l100 486 196-139q-12-19-15-33-6-18-6-38 0-54 38.5-92.5T1771 677t92.5 38.5T1902 808t-38.5 92.5T1771 939q-7 0-19-2-147 224-203 449.5t58 456.5zm0-450q109 0 222 28.5t213 67.5q2-41 11-89-108-42-221.5-68t-224.5-26-225 26-221 68q8 48 11 89 99-39 212-67.5t223-28.5m0 376h478q-15-34-24-73H570q-10 39-24 73zm434-250-119 72 134 86q-20-86-15-158m-573 47 139 87 139-84-139-86z"
9
12
  />
10
13
  </svg>
11
14
  );
@@ -1,11 +1,11 @@
1
- import * as React from 'react';
2
- import type { SVGProps } from 'react';
1
+ import * as React from "react";
2
+ import type { SVGProps } from "react";
3
3
  const SvgBR = (props: SVGProps<SVGSVGElement>) => (
4
- <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2048 2048' {...props}>
5
- <path fill='#f9f9f9' d='m674 732-76 807 851 14-75-833z' />
4
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048" {...props}>
5
+ <path fill="#f9f9f9" d="m674 732-76 807 851 14-75-833z" />
6
6
  <path
7
- fill='#101010'
8
- d='M1024 1843H383l29-264 159-118 50-659-149-107-17-341h289v147h137V354h286v147h137V354h289l-17 341-149 107 50 659 159 118 29 264zm0-989h333l-6-88H697l-6 88zm0 647h381l-6-87H649l-6 87z'
7
+ fill="#101010"
8
+ d="M1024 1843H383l29-264 159-118 50-659-149-107-17-341h289v147h137V354h286v147h137V354h289l-17 341-149 107 50 659 159 118 29 264zm0-989h333l-6-88H697l-6 88zm0 647h381l-6-87H649l-6 87z"
9
9
  />
10
10
  </svg>
11
11
  );
@@ -1,12 +1,12 @@
1
- export { default as BB } from './bB';
2
- export { default as BK } from './bK';
3
- export { default as BN } from './bN';
4
- export { default as BP } from './bP';
5
- export { default as BQ } from './bQ';
6
- export { default as BR } from './bR';
7
- export { default as WB } from './wB';
8
- export { default as WK } from './wK';
9
- export { default as WN } from './wN';
10
- export { default as WP } from './wP';
11
- export { default as WQ } from './wQ';
12
- export { default as WR } from './wR';
1
+ export { default as BB } from "./bB";
2
+ export { default as BK } from "./bK";
3
+ export { default as BN } from "./bN";
4
+ export { default as BP } from "./bP";
5
+ export { default as BQ } from "./bQ";
6
+ export { default as BR } from "./bR";
7
+ export { default as WB } from "./wB";
8
+ export { default as WK } from "./wK";
9
+ export { default as WN } from "./wN";
10
+ export { default as WP } from "./wP";
11
+ export { default as WQ } from "./wQ";
12
+ export { default as WR } from "./wR";
@@ -1,14 +1,14 @@
1
- import * as React from 'react';
2
- import type { SVGProps } from 'react';
1
+ import * as React from "react";
2
+ import type { SVGProps } from "react";
3
3
  const SvgWB = (props: SVGProps<SVGSVGElement>) => (
4
- <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2048 2048' {...props}>
4
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048" {...props}>
5
5
  <path
6
- fill='#f9f9f9'
7
- d='m948 366 1-139 148-7 1 147zM564 860c114-267 456-443 456-443s392 176 476 502c-9 209-183 332-183 332l27 221-653 6 46-233s-230-171-169-385m-101 790c175 6 355 23 425-142h92s0 190-88 246c-163 103-625 38-625 38s-15-146 196-142m631 37-36-185 102 5s22 153 315 131c381-17 318 153 318 153l-483 5z'
6
+ fill="#f9f9f9"
7
+ d="m948 366 1-139 148-7 1 147zM564 860c114-267 456-443 456-443s392 176 476 502c-9 209-183 332-183 332l27 221-653 6 46-233s-230-171-169-385m-101 790c175 6 355 23 425-142h92s0 190-88 246c-163 103-625 38-625 38s-15-146 196-142m631 37-36-185 102 5s22 153 315 131c381-17 318 153 318 153l-483 5z"
8
8
  />
9
9
  <path
10
- fill='#101010'
11
- d='M1024 356q66 0 64-66 1-55-64-55-66 0-64 55-3 66 64 66m0 1204q0 114-101 199t-223 84H205q0-117 65-179t142-62h250q51 0 88-7t71-60l10-16h76q-7 21-3 13-45 105-109 125t-146 19H409q-52 0-86 40t-34 53h424q66 0 159-65t93-185H624q67-116 72-229-114-119-162-223t-6-224q33-96 118-189t312-247q-17-11-46-36t-29-79q0-58 41-96t100-38q58 0 100 38t41 96q0 54-29 79t-46 36q226 153 311 247t119 189q42 119-6 224t-162 223q4 113 72 229h-341q0 120 93 185t159 65h424q0-13-34-53t-86-40h-240q-83 0-146-19t-109-125q4 8-3-13h76l10 16q33 53 70 60t89 7h250q76 0 142 62t65 179h-495q-123 0-223-84t-101-199m0-114h283q-28-84-29-154-120-41-254-38-135-3-254 38-2 70-29 154zm0-267q159-1 285 42 189-180 142-346-60-193-427-431-368 238-427 431-48 166 142 346 125-43 285-42m-47-361V714h94v104h95v89h-95v165h-94V907h-95v-89z'
10
+ fill="#101010"
11
+ d="M1024 356q66 0 64-66 1-55-64-55-66 0-64 55-3 66 64 66m0 1204q0 114-101 199t-223 84H205q0-117 65-179t142-62h250q51 0 88-7t71-60l10-16h76q-7 21-3 13-45 105-109 125t-146 19H409q-52 0-86 40t-34 53h424q66 0 159-65t93-185H624q67-116 72-229-114-119-162-223t-6-224q33-96 118-189t312-247q-17-11-46-36t-29-79q0-58 41-96t100-38q58 0 100 38t41 96q0 54-29 79t-46 36q226 153 311 247t119 189q42 119-6 224t-162 223q4 113 72 229h-341q0 120 93 185t159 65h424q0-13-34-53t-86-40h-240q-83 0-146-19t-109-125q4 8-3-13h76l10 16q33 53 70 60t89 7h250q76 0 142 62t65 179h-495q-123 0-223-84t-101-199m0-114h283q-28-84-29-154-120-41-254-38-135-3-254 38-2 70-29 154zm0-267q159-1 285 42 189-180 142-346-60-193-427-431-368 238-427 431-48 166 142 346 125-43 285-42m-47-361V714h94v104h95v89h-95v165h-94V907h-95v-89z"
12
12
  />
13
13
  </svg>
14
14
  );