@ankhorage/zora 21.1.4 → 22.0.1
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/CHANGELOG.md +12 -0
- package/README.md +4 -1
- package/dist/features/authoring/index.d.ts +0 -4
- package/dist/features/authoring/index.d.ts.map +1 -1
- package/dist/features/authoring/index.js +0 -3
- package/dist/features/authoring/index.js.map +1 -1
- package/dist/features/chess/adapters/inbound/ChessBoard.d.ts +1 -1
- package/dist/features/chess/adapters/inbound/ChessBoard.d.ts.map +1 -1
- package/dist/features/chess/adapters/inbound/ChessBoard.js +23 -7
- package/dist/features/chess/adapters/inbound/ChessBoard.js.map +1 -1
- package/dist/features/chess/meta.d.ts +68 -0
- package/dist/features/chess/meta.d.ts.map +1 -1
- package/dist/features/chess/meta.js +36 -1
- package/dist/features/chess/meta.js.map +1 -1
- package/dist/features/chess/public.d.ts +3 -1
- package/dist/features/chess/public.d.ts.map +1 -1
- package/dist/features/chess/public.js +2 -0
- package/dist/features/chess/public.js.map +1 -1
- package/dist/features/chess/utils/chessEngine.d.ts +8 -0
- package/dist/features/chess/utils/chessEngine.d.ts.map +1 -0
- package/dist/features/chess/utils/chessEngine.js +71 -0
- package/dist/features/chess/utils/chessEngine.js.map +1 -0
- package/dist/features/tabletop/meta.d.ts +32 -0
- package/dist/features/tabletop/meta.d.ts.map +1 -1
- package/dist/features/tabletop/meta.js +24 -0
- package/dist/features/tabletop/meta.js.map +1 -1
- package/dist/features/tabletop/public.d.ts +1 -0
- package/dist/features/tabletop/public.d.ts.map +1 -1
- package/dist/features/tabletop/public.js +1 -0
- package/dist/features/tabletop/public.js.map +1 -1
- package/dist/index.d.ts +4 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -5
- package/dist/index.js.map +1 -1
- package/dist/types/chess.d.ts +10 -0
- package/dist/types/chess.d.ts.map +1 -1
- package/dist/types/chess.js.map +1 -1
- package/package.json +5 -4
- package/src/features/authoring/featureManifest.test.ts +46 -10
- package/src/features/authoring/index.ts +0 -8
- package/src/features/chess/adapters/inbound/ChessBoard.tsx +34 -11
- package/src/features/chess/meta.ts +36 -1
- package/src/features/chess/public.test.tsx +83 -0
- package/src/features/chess/public.ts +3 -0
- package/src/features/chess/utils/chessEngine.test.ts +35 -0
- package/src/features/chess/utils/chessEngine.ts +83 -0
- package/src/features/chessTabletopOwnership.test.ts +8 -4
- package/src/features/tabletop/meta.ts +24 -0
- package/src/features/tabletop/public.test.tsx +12 -0
- package/src/features/tabletop/public.ts +1 -0
- package/src/index.ts +7 -15
- package/src/structureOwnership.test.ts +2 -7
- package/src/types/chess.ts +11 -0
- package/web-dist/chunks/Accordion-784f23tq.js +3813 -0
- package/web-dist/components/card-back/CardBack.js +1 -1
- package/web-dist/components/card-hand/CardHand.js +1 -1
- package/web-dist/components/chess-board/ChessBoard.js +1 -1
- package/web-dist/components/opening-book/OpeningBook.js +1 -1
- package/web-dist/components/playing-card/PlayingCard.js +1 -1
- package/web-dist/components/poker-training-table/PokerTrainingTable.js +1 -1
- package/web-dist/components/tabletop-table/TabletopTable.js +1 -1
- package/web-dist/manifest.json +12 -24
- package/dist/features/plugin/ZORA_CORE_PLUGIN.d.ts +0 -4
- package/dist/features/plugin/ZORA_CORE_PLUGIN.d.ts.map +0 -1
- package/dist/features/plugin/ZORA_CORE_PLUGIN.js +0 -8
- package/dist/features/plugin/ZORA_CORE_PLUGIN.js.map +0 -1
- package/dist/features/plugin/ZORA_CORE_PLUGIN_METADATA.d.ts +0 -3
- package/dist/features/plugin/ZORA_CORE_PLUGIN_METADATA.d.ts.map +0 -1
- package/dist/features/plugin/ZORA_CORE_PLUGIN_METADATA.js +0 -36
- package/dist/features/plugin/ZORA_CORE_PLUGIN_METADATA.js.map +0 -1
- package/dist/features/plugin/application/use-cases/composeZoraPluginMetadata.d.ts +0 -4
- package/dist/features/plugin/application/use-cases/composeZoraPluginMetadata.d.ts.map +0 -1
- package/dist/features/plugin/application/use-cases/composeZoraPluginMetadata.js +0 -106
- package/dist/features/plugin/application/use-cases/composeZoraPluginMetadata.js.map +0 -1
- package/dist/features/plugin/application/use-cases/composeZoraPlugins.d.ts +0 -4
- package/dist/features/plugin/application/use-cases/composeZoraPlugins.d.ts.map +0 -1
- package/dist/features/plugin/application/use-cases/composeZoraPlugins.js +0 -41
- package/dist/features/plugin/application/use-cases/composeZoraPlugins.js.map +0 -1
- package/dist/features/plugin/domain/ZoraPluginCompositionError.d.ts +0 -14
- package/dist/features/plugin/domain/ZoraPluginCompositionError.d.ts.map +0 -1
- package/dist/features/plugin/domain/ZoraPluginCompositionError.js +0 -14
- package/dist/features/plugin/domain/ZoraPluginCompositionError.js.map +0 -1
- package/dist/features/plugin/public.d.ts +0 -4
- package/dist/features/plugin/public.d.ts.map +0 -1
- package/dist/features/plugin/public.js +0 -4
- package/dist/features/plugin/public.js.map +0 -1
- package/dist/features/plugin/runtime.d.ts +0 -3
- package/dist/features/plugin/runtime.d.ts.map +0 -1
- package/dist/features/plugin/runtime.js +0 -3
- package/dist/features/plugin/runtime.js.map +0 -1
- package/dist/types/plugin.d.ts +0 -29
- package/dist/types/plugin.d.ts.map +0 -1
- package/dist/types/plugin.js +0 -2
- package/dist/types/plugin.js.map +0 -1
- package/src/features/plugin/ZORA_CORE_PLUGIN.ts +0 -9
- package/src/features/plugin/ZORA_CORE_PLUGIN_METADATA.ts +0 -49
- package/src/features/plugin/application/use-cases/composeZoraPluginMetadata.ts +0 -166
- package/src/features/plugin/application/use-cases/composeZoraPlugins.ts +0 -76
- package/src/features/plugin/domain/ZoraPluginCompositionError.ts +0 -21
- package/src/features/plugin/pluginComposition.test.ts +0 -139
- package/src/features/plugin/public.ts +0 -3
- package/src/features/plugin/runtime.ts +0 -2
- package/src/types/plugin.ts +0 -43
- package/web-dist/chunks/Accordion-86z2tvvz.js +0 -321
- package/web-dist/components/zora-plugin-composition-error/ZoraPluginCompositionError.d.ts +0 -3
- package/web-dist/components/zora-plugin-composition-error/ZoraPluginCompositionError.js +0 -17
- package/web-dist/components/zora-plugin-composition-error/index.d.ts +0 -1
- package/web-dist/components/zora-plugin-composition-error/index.js +0 -2
- /package/web-dist/chunks/{Accordion-57mn1j9e.js → Accordion-z585n0mr.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 22.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a0cd8a6: Update dependencies: `expo-document-picker`.
|
|
8
|
+
|
|
9
|
+
## 22.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- b2b83aa: refactor: remove the obsolete ZORA plugin composition API while preserving the complete integrated Chess, Game, and Tabletop feature surfaces in core
|
|
14
|
+
|
|
3
15
|
## 21.1.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# @ankhorage/zora
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.
|
|
9
9
|
|
|
@@ -94,12 +94,15 @@ export default defineParadoxConfig({
|
|
|
94
94
|
- [Game sequence](././paradox/diagrams/sequences/game.mmd)
|
|
95
95
|
- [GameInputZone sequence](././paradox/diagrams/sequences/game-input-zone.mmd)
|
|
96
96
|
- [GameOverlay sequence](././paradox/diagrams/sequences/game-overlay.mmd)
|
|
97
|
+
- [getLegalTargets sequence](././paradox/diagrams/sequences/get-legal-targets.mmd)
|
|
98
|
+
- [readChessPieces sequence](././paradox/diagrams/sequences/read-chess-pieces.mmd)
|
|
97
99
|
- [resolveAvatarInitials sequence](././paradox/diagrams/sequences/resolve-avatar-initials.mmd)
|
|
98
100
|
- [resolveOAuthProviderIcon sequence](././paradox/diagrams/sequences/resolve-oauth-provider-icon.mmd)
|
|
99
101
|
- [resolveOAuthProviderLabel sequence](././paradox/diagrams/sequences/resolve-oauth-provider-label.mmd)
|
|
100
102
|
- [SelectableItem sequence](././paradox/diagrams/sequences/selectable-item.mmd)
|
|
101
103
|
- [SelectionProvider sequence](././paradox/diagrams/sequences/selection-provider.mmd)
|
|
102
104
|
- [ThemeModeToggle sequence](././paradox/diagrams/sequences/theme-mode-toggle.mmd)
|
|
105
|
+
- [tryMove sequence](././paradox/diagrams/sequences/try-move.mmd)
|
|
103
106
|
- [useZoraTheme sequence](././paradox/diagrams/sequences/use-zora-theme.mmd)
|
|
104
107
|
- [validateField sequence](././paradox/diagrams/sequences/validate-field.mmd)
|
|
105
108
|
- [validateFields sequence](././paradox/diagrams/sequences/validate-fields.mmd)
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
export type { ZoraComponentBlueprint, ZoraComponentCategory, ZoraComponentEventMeta, ZoraComponentEventPayloadFieldMeta, ZoraComponentEventPayloadFieldType, ZoraComponentEventPayloadKind, ZoraComponentI18nMeta, ZoraComponentManifestPolicy, ZoraComponentMeta, ZoraComponentMetaRegistry, ZoraComponentPropArrayItemSchema, ZoraComponentPropAuthoring, ZoraComponentPropSchema, ZoraComponentPropType, ZoraComponentPropValue, ZoraComponentSlotMeta, } from '../../types/authoring';
|
|
2
|
-
export type { ComposedZoraPluginMetadataCatalog, ZoraPluginMetadata, ZoraPluginPlacement, } from '../../types/plugin';
|
|
3
2
|
export type { ZoraThemeRecipeBooleanFieldMeta, ZoraThemeRecipeChoiceFieldMeta, ZoraThemeRecipeFieldMeta, ZoraThemeRecipeKind, ZoraThemeRecipeMeta, ZoraThemeRecipeMetaRegistry, ZoraThemeRecipeTokenFieldMeta, ZoraThemeTokenFamily, } from '../../types/theme-recipe';
|
|
4
|
-
export { composeZoraPluginMetadata } from '../plugin/application/use-cases/composeZoraPluginMetadata';
|
|
5
|
-
export { ZoraPluginCompositionError } from '../plugin/domain/ZoraPluginCompositionError';
|
|
6
|
-
export { ZORA_CORE_PLUGIN_METADATA } from '../plugin/ZORA_CORE_PLUGIN_METADATA';
|
|
7
3
|
export type { ZoraBindableComponentType } from './bindableComponentMeta';
|
|
8
4
|
export { ZORA_BINDABLE_COMPONENT_META } from './bindableComponentMeta';
|
|
9
5
|
export { ZORA_COMPONENT_META } from './componentMeta';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/authoring/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,kCAAkC,EAClC,kCAAkC,EAClC,6BAA6B,EAC7B,qBAAqB,EACrB,2BAA2B,EAC3B,iBAAiB,EACjB,yBAAyB,EACzB,gCAAgC,EAChC,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/authoring/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,kCAAkC,EAClC,kCAAkC,EAClC,6BAA6B,EAC7B,qBAAqB,EACrB,2BAA2B,EAC3B,iBAAiB,EACjB,yBAAyB,EACzB,gCAAgC,EAChC,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,+BAA+B,EAC/B,8BAA8B,EAC9B,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,2BAA2B,EAC3B,6BAA6B,EAC7B,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
export { composeZoraPluginMetadata } from '../plugin/application/use-cases/composeZoraPluginMetadata';
|
|
2
|
-
export { ZoraPluginCompositionError } from '../plugin/domain/ZoraPluginCompositionError';
|
|
3
|
-
export { ZORA_CORE_PLUGIN_METADATA } from '../plugin/ZORA_CORE_PLUGIN_METADATA';
|
|
4
1
|
export { ZORA_BINDABLE_COMPONENT_META } from './bindableComponentMeta';
|
|
5
2
|
export { ZORA_COMPONENT_META } from './componentMeta';
|
|
6
3
|
export { ZORA_THEME_TOKEN_FAMILIES } from './constants';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/authoring/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/authoring/index.ts"],"names":[],"mappings":"AA6BA,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export type {\n ZoraComponentBlueprint,\n ZoraComponentCategory,\n ZoraComponentEventMeta,\n ZoraComponentEventPayloadFieldMeta,\n ZoraComponentEventPayloadFieldType,\n ZoraComponentEventPayloadKind,\n ZoraComponentI18nMeta,\n ZoraComponentManifestPolicy,\n ZoraComponentMeta,\n ZoraComponentMetaRegistry,\n ZoraComponentPropArrayItemSchema,\n ZoraComponentPropAuthoring,\n ZoraComponentPropSchema,\n ZoraComponentPropType,\n ZoraComponentPropValue,\n ZoraComponentSlotMeta,\n} from '../../types/authoring';\nexport type {\n ZoraThemeRecipeBooleanFieldMeta,\n ZoraThemeRecipeChoiceFieldMeta,\n ZoraThemeRecipeFieldMeta,\n ZoraThemeRecipeKind,\n ZoraThemeRecipeMeta,\n ZoraThemeRecipeMetaRegistry,\n ZoraThemeRecipeTokenFieldMeta,\n ZoraThemeTokenFamily,\n} from '../../types/theme-recipe';\nexport type { ZoraBindableComponentType } from './bindableComponentMeta';\nexport { ZORA_BINDABLE_COMPONENT_META } from './bindableComponentMeta';\nexport { ZORA_COMPONENT_META } from './componentMeta';\nexport { ZORA_THEME_TOKEN_FAMILIES } from './constants';\nexport { ZORA_THEME_RECIPE_META } from './themeRecipeMeta';\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ChessBoardProps } from '../../../../types/chess';
|
|
3
|
-
/*** Renders caller-owned chess
|
|
3
|
+
/*** Renders caller-owned or FEN-backed chess state with optional legal-move validation. */
|
|
4
4
|
export declare const ChessBoard: (props: ChessBoardProps) => React.ReactElement | null;
|
|
5
5
|
//# sourceMappingURL=ChessBoard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChessBoard.d.ts","sourceRoot":"","sources":["../../../../../src/features/chess/adapters/inbound/ChessBoard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ChessBoard.d.ts","sourceRoot":"","sources":["../../../../../src/features/chess/adapters/inbound/ChessBoard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EACV,eAAe,EAIhB,MAAM,yBAAyB,CAAC;AAuBjC,2FAA2F;AAC3F,eAAO,MAAM,UAAU,uDAAsC,CAAC"}
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Pressable, StyleSheet, Text, View } from 'react-native';
|
|
3
3
|
import { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';
|
|
4
4
|
import { useZoraTheme } from '../../../theme/composition/useZoraTheme';
|
|
5
|
+
import { getLegalTargets, readChessPieces, tryMove } from '../../utils/chessEngine';
|
|
5
6
|
import { createBoardSquares } from '../../utils/createBoardSquares';
|
|
6
7
|
import { createChessBoardColorScheme } from '../../utils/createChessBoardColorScheme';
|
|
7
8
|
import { isLightSquare } from '../../utils/isLightSquare';
|
|
@@ -19,21 +20,36 @@ const symbols = new Map([
|
|
|
19
20
|
['black:q', '♛'],
|
|
20
21
|
['black:k', '♚'],
|
|
21
22
|
]);
|
|
22
|
-
/*** Renders caller-owned chess
|
|
23
|
+
/*** Renders caller-owned or FEN-backed chess state with optional legal-move validation. */
|
|
23
24
|
export const ChessBoard = withZoraThemeScope(ChessBoardInner);
|
|
24
|
-
/*** Renders the current presentation state
|
|
25
|
-
function ChessBoardInner({ pieces
|
|
25
|
+
/*** Renders the current presentation state and delegates FEN validation to the core chess engine. */
|
|
26
|
+
function ChessBoardInner({ fen, pieces, orientation = 'white', selectedSquare = null, legalTargets, lastMove = null, disabled = false, showCoordinates = false, validateMoves = true, colorScheme, onSquarePress, onMoveAttempt, onLegalMove, onInvalidMove, renderPiece, interactionPolicy, testID, }) {
|
|
26
27
|
const { theme } = useZoraTheme();
|
|
27
28
|
const colors = createChessBoardColorScheme(theme, colorScheme);
|
|
28
29
|
const squares = createBoardSquares(orientation);
|
|
29
|
-
const piecesBySquare =
|
|
30
|
-
|
|
30
|
+
const piecesBySquare = pieces === undefined
|
|
31
|
+
? fen === undefined
|
|
32
|
+
? new Map()
|
|
33
|
+
: new Map(readChessPieces(fen))
|
|
34
|
+
: new Map(pieces.map((piece) => [piece.square, piece]));
|
|
35
|
+
const resolvedLegalTargets = legalTargets ??
|
|
36
|
+
(fen !== undefined && selectedSquare !== null ? getLegalTargets(fen, selectedSquare) : []);
|
|
37
|
+
const legalTargetSet = new Set(resolvedLegalTargets);
|
|
31
38
|
const pressSquare = (square) => {
|
|
32
39
|
if (disabled || interactionPolicy === 'passive')
|
|
33
40
|
return;
|
|
34
41
|
onSquarePress?.(square);
|
|
35
|
-
if (selectedSquare
|
|
36
|
-
|
|
42
|
+
if (selectedSquare === null || selectedSquare === square)
|
|
43
|
+
return;
|
|
44
|
+
const attempt = { from: selectedSquare, to: square };
|
|
45
|
+
onMoveAttempt?.(attempt);
|
|
46
|
+
if (!validateMoves || fen === undefined)
|
|
47
|
+
return;
|
|
48
|
+
const result = tryMove(fen, attempt);
|
|
49
|
+
if (result)
|
|
50
|
+
onLegalMove?.(result);
|
|
51
|
+
else
|
|
52
|
+
onInvalidMove?.(attempt);
|
|
37
53
|
};
|
|
38
54
|
return (<View accessibilityLabel="Chess board" style={[styles.board, { borderColor: colors.border, opacity: disabled ? 0.56 : 1 }]} testID={testID}>
|
|
39
55
|
{squares.map((square) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChessBoard.js","sourceRoot":"","sources":["../../../../../src/features/chess/adapters/inbound/ChessBoard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,MAAM,OAAO,GAAG,IAAI,GAAG,CAAiB;IACtC,CAAC,SAAS,EAAE,GAAG,CAAC;IAChB,CAAC,SAAS,EAAE,GAAG,CAAC;IAChB,CAAC,SAAS,EAAE,GAAG,CAAC;IAChB,CAAC,SAAS,EAAE,GAAG,CAAC;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,EAAE,CAAC;QACR,GAAG,EAAE,CAAC;KACP;IACD,MAAM,EAAE;QACN,UAAU,EAAE,QAAQ;QACpB,WAAW,EAAE,CAAC;QACd,KAAK,EAAE,OAAO;QACd,cAAc,EAAE,QAAQ;QACxB,QAAQ,EAAE,UAAU;KACrB;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport type { ChessBoardProps, ChessPieceState, ChessSquareId } from '../../../../types/chess';\nimport { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';\nimport { useZoraTheme } from '../../../theme/composition/useZoraTheme';\nimport { createBoardSquares } from '../../utils/createBoardSquares';\nimport { createChessBoardColorScheme } from '../../utils/createChessBoardColorScheme';\nimport { isLightSquare } from '../../utils/isLightSquare';\n\nconst symbols = new Map<string, string>([\n ['white:p', '♙'],\n ['white:n', '♘'],\n ['white:b', '♗'],\n ['white:r', '♖'],\n ['white:q', '♕'],\n ['white:k', '♔'],\n ['black:p', '♟'],\n ['black:n', '♞'],\n ['black:b', '♝'],\n ['black:r', '♜'],\n ['black:q', '♛'],\n ['black:k', '♚'],\n]);\n\n/*** Renders caller-owned chess presentation state without chess rule execution. */\nexport const ChessBoard = withZoraThemeScope(ChessBoardInner);\n\n/*** Renders the current presentation state without executing chess rules. */\nfunction ChessBoardInner({\n pieces = [],\n orientation = 'white',\n selectedSquare = null,\n legalTargets = [],\n lastMove = null,\n disabled = false,\n showCoordinates = false,\n colorScheme,\n onSquarePress,\n onMoveAttempt,\n renderPiece,\n interactionPolicy,\n testID,\n}: ChessBoardProps) {\n const { theme } = useZoraTheme();\n const colors = createChessBoardColorScheme(theme, colorScheme);\n const squares = createBoardSquares(orientation);\n const piecesBySquare = new Map<ChessSquareId, ChessPieceState>(\n pieces.map((piece) => [piece.square, piece]),\n );\n const legalTargetSet = new Set(legalTargets);\n const pressSquare = (square: ChessSquareId) => {\n if (disabled || interactionPolicy === 'passive') return;\n onSquarePress?.(square);\n if (selectedSquare !== null && selectedSquare !== square)\n onMoveAttempt?.({ from: selectedSquare, to: square });\n };\n return (\n <View\n accessibilityLabel=\"Chess board\"\n style={[styles.board, { borderColor: colors.border, opacity: disabled ? 0.56 : 1 }]}\n testID={testID}\n >\n {squares.map((square) => {\n const piece = piecesBySquare.get(square);\n const light = isLightSquare(square);\n const isTarget = legalTargetSet.has(square);\n const backgroundColor =\n selectedSquare === square\n ? colors.selectedSquare\n : isTarget\n ? colors.legalTarget\n : lastMove?.from === square\n ? colors.lastMoveFrom\n : lastMove?.to === square\n ? colors.lastMoveTo\n : light\n ? colors.lightSquare\n : colors.darkSquare;\n const pieceContent =\n piece === undefined\n ? null\n : renderPiece\n ? renderPiece({\n color: piece.color === 'white' ? colors.lightPiece : colors.darkPiece,\n piece: piece.piece,\n square,\n })\n : (symbols.get(`${piece.color}:${piece.piece.toLowerCase()}`) ?? piece.piece);\n return (\n <Pressable\n accessibilityLabel={square}\n accessibilityRole=\"button\"\n disabled={disabled || interactionPolicy === 'passive'}\n key={square}\n onPress={() => pressSquare(square)}\n style={[styles.square, { backgroundColor }]}\n testID={testID ? `${testID}-square-${square}` : undefined}\n >\n {showCoordinates ? (\n <Text\n style={[\n styles.coordinate,\n { color: light ? colors.lightSquareText : colors.darkSquareText },\n ]}\n >\n {square}\n </Text>\n ) : null}\n {piece === undefined ? null : (\n <View pointerEvents=\"none\" style={styles.pieceContainer}>\n {renderPiece ? (\n pieceContent\n ) : (\n <Text\n style={[\n styles.piece,\n { color: piece.color === 'white' ? colors.lightPiece : colors.darkPiece },\n ]}\n >\n {pieceContent}\n </Text>\n )}\n </View>\n )}\n </Pressable>\n );\n })}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n board: {\n aspectRatio: 1,\n borderRadius: 12,\n borderWidth: StyleSheet.hairlineWidth,\n flexDirection: 'row',\n flexWrap: 'wrap',\n overflow: 'hidden',\n width: '100%',\n },\n coordinate: {\n fontSize: 9,\n fontWeight: '600',\n left: 3,\n opacity: 0.72,\n position: 'absolute',\n top: 2,\n zIndex: 2,\n },\n piece: { fontSize: 32, fontWeight: '600', lineHeight: 38 },\n pieceContainer: {\n alignItems: 'center',\n bottom: 0,\n justifyContent: 'center',\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n square: {\n alignItems: 'center',\n aspectRatio: 1,\n width: '12.5%',\n justifyContent: 'center',\n position: 'relative',\n },\n});\n"]}
|
|
1
|
+
{"version":3,"file":"ChessBoard.js","sourceRoot":"","sources":["../../../../../src/features/chess/adapters/inbound/ChessBoard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAQjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,MAAM,OAAO,GAAG,IAAI,GAAG,CAAiB;IACtC,CAAC,SAAS,EAAE,GAAG,CAAC;IAChB,CAAC,SAAS,EAAE,GAAG,CAAC;IAChB,CAAC,SAAS,EAAE,GAAG,CAAC;IAChB,CAAC,SAAS,EAAE,GAAG,CAAC;IAChB,CAAC,SAAS,EAAE,GAAG,CAAC;IAChB,CAAC,SAAS,EAAE,GAAG,CAAC;IAChB,CAAC,SAAS,EAAE,GAAG,CAAC;IAChB,CAAC,SAAS,EAAE,GAAG,CAAC;IAChB,CAAC,SAAS,EAAE,GAAG,CAAC;IAChB,CAAC,SAAS,EAAE,GAAG,CAAC;I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AK,EAAE,MAAM;KACd;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,CAAC;QACX,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE,CAAC;QACP,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,MAAM,EAAE,CAAC;KACV;IACD,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE;IAC1D,cAAc,EAAE;QACd,UAAU,EAAE,QAAQ;QACpB,MAAM,EAAE,CAAC;QACT,cAAc,EAAE,QAAQ;QACxB,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,CAAC;QACR,GAAG,EAAE,CAAC;KACP;IACD,MAAM,EAAE;QACN,UAAU,EAAE,QAAQ;QACpB,WAAW,EAAE,CAAC;QACd,KAAK,EAAE,OAAO;QACd,cAAc,EAAE,QAAQ;QACxB,QAAQ,EAAE,UAAU;KACrB;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport type {\n ChessBoardProps,\n ChessMoveAttempt,\n ChessPieceState,\n ChessSquareId,\n} from '../../../../types/chess';\nimport { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';\nimport { useZoraTheme } from '../../../theme/composition/useZoraTheme';\nimport { getLegalTargets, readChessPieces, tryMove } from '../../utils/chessEngine';\nimport { createBoardSquares } from '../../utils/createBoardSquares';\nimport { createChessBoardColorScheme } from '../../utils/createChessBoardColorScheme';\nimport { isLightSquare } from '../../utils/isLightSquare';\n\nconst symbols = new Map<string, string>([\n ['white:p', '♙'],\n ['white:n', '♘'],\n ['white:b', '♗'],\n ['white:r', '♖'],\n ['white:q', '♕'],\n ['white:k', '♔'],\n ['black:p', '♟'],\n ['black:n', '♞'],\n ['black:b', '♝'],\n ['black:r', '♜'],\n ['black:q', '♛'],\n ['black:k', '♚'],\n]);\n\n/*** Renders caller-owned or FEN-backed chess state with optional legal-move validation. */\nexport const ChessBoard = withZoraThemeScope(ChessBoardInner);\n\n/*** Renders the current presentation state and delegates FEN validation to the core chess engine. */\nfunction ChessBoardInner({\n fen,\n pieces,\n orientation = 'white',\n selectedSquare = null,\n legalTargets,\n lastMove = null,\n disabled = false,\n showCoordinates = false,\n validateMoves = true,\n colorScheme,\n onSquarePress,\n onMoveAttempt,\n onLegalMove,\n onInvalidMove,\n renderPiece,\n interactionPolicy,\n testID,\n}: ChessBoardProps) {\n const { theme } = useZoraTheme();\n const colors = createChessBoardColorScheme(theme, colorScheme);\n const squares = createBoardSquares(orientation);\n const piecesBySquare =\n pieces === undefined\n ? fen === undefined\n ? new Map<ChessSquareId, ChessPieceState>()\n : new Map(readChessPieces(fen))\n : new Map<ChessSquareId, ChessPieceState>(pieces.map((piece) => [piece.square, piece]));\n const resolvedLegalTargets =\n legalTargets ??\n (fen !== undefined && selectedSquare !== null ? getLegalTargets(fen, selectedSquare) : []);\n const legalTargetSet = new Set(resolvedLegalTargets);\n const pressSquare = (square: ChessSquareId) => {\n if (disabled || interactionPolicy === 'passive') return;\n onSquarePress?.(square);\n if (selectedSquare === null || selectedSquare === square) return;\n\n const attempt: ChessMoveAttempt = { from: selectedSquare, to: square };\n onMoveAttempt?.(attempt);\n if (!validateMoves || fen === undefined) return;\n\n const result = tryMove(fen, attempt);\n if (result) onLegalMove?.(result);\n else onInvalidMove?.(attempt);\n };\n return (\n <View\n accessibilityLabel=\"Chess board\"\n style={[styles.board, { borderColor: colors.border, opacity: disabled ? 0.56 : 1 }]}\n testID={testID}\n >\n {squares.map((square) => {\n const piece = piecesBySquare.get(square);\n const light = isLightSquare(square);\n const isTarget = legalTargetSet.has(square);\n const backgroundColor =\n selectedSquare === square\n ? colors.selectedSquare\n : isTarget\n ? colors.legalTarget\n : lastMove?.from === square\n ? colors.lastMoveFrom\n : lastMove?.to === square\n ? colors.lastMoveTo\n : light\n ? colors.lightSquare\n : colors.darkSquare;\n const pieceContent =\n piece === undefined\n ? null\n : renderPiece\n ? renderPiece({\n color: piece.color === 'white' ? colors.lightPiece : colors.darkPiece,\n piece: piece.piece,\n square,\n })\n : (symbols.get(`${piece.color}:${piece.piece.toLowerCase()}`) ?? piece.piece);\n return (\n <Pressable\n accessibilityLabel={square}\n accessibilityRole=\"button\"\n disabled={disabled || interactionPolicy === 'passive'}\n key={square}\n onPress={() => pressSquare(square)}\n style={[styles.square, { backgroundColor }]}\n testID={testID ? `${testID}-square-${square}` : undefined}\n >\n {showCoordinates ? (\n <Text\n style={[\n styles.coordinate,\n { color: light ? colors.lightSquareText : colors.darkSquareText },\n ]}\n >\n {square}\n </Text>\n ) : null}\n {piece === undefined ? null : (\n <View pointerEvents=\"none\" style={styles.pieceContainer}>\n {renderPiece ? (\n pieceContent\n ) : (\n <Text\n style={[\n styles.piece,\n { color: piece.color === 'white' ? colors.lightPiece : colors.darkPiece },\n ]}\n >\n {pieceContent}\n </Text>\n )}\n </View>\n )}\n </Pressable>\n );\n })}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n board: {\n aspectRatio: 1,\n borderRadius: 12,\n borderWidth: StyleSheet.hairlineWidth,\n flexDirection: 'row',\n flexWrap: 'wrap',\n overflow: 'hidden',\n width: '100%',\n },\n coordinate: {\n fontSize: 9,\n fontWeight: '600',\n left: 3,\n opacity: 0.72,\n position: 'absolute',\n top: 2,\n zIndex: 2,\n },\n piece: { fontSize: 32, fontWeight: '600', lineHeight: 38 },\n pieceContainer: {\n alignItems: 'center',\n bottom: 0,\n justifyContent: 'center',\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n square: {\n alignItems: 'center',\n aspectRatio: 1,\n width: '12.5%',\n justifyContent: 'center',\n position: 'relative',\n },\n});\n"]}
|
|
@@ -10,6 +10,7 @@ export declare const chessBoardMeta: {
|
|
|
10
10
|
readonly pieces: readonly [];
|
|
11
11
|
readonly orientation: "white";
|
|
12
12
|
readonly showCoordinates: true;
|
|
13
|
+
readonly validateMoves: true;
|
|
13
14
|
};
|
|
14
15
|
};
|
|
15
16
|
readonly events: {
|
|
@@ -33,6 +34,56 @@ export declare const chessBoardMeta: {
|
|
|
33
34
|
readonly path: "to";
|
|
34
35
|
readonly type: "string";
|
|
35
36
|
readonly label: "To";
|
|
37
|
+
}, {
|
|
38
|
+
readonly path: "promotion";
|
|
39
|
+
readonly type: "string";
|
|
40
|
+
readonly label: "Promotion";
|
|
41
|
+
}];
|
|
42
|
+
};
|
|
43
|
+
readonly legalMove: {
|
|
44
|
+
readonly label: "Legal move";
|
|
45
|
+
readonly eventType: "chess.legalMove";
|
|
46
|
+
readonly payloadFields: readonly [{
|
|
47
|
+
readonly path: "from";
|
|
48
|
+
readonly type: "string";
|
|
49
|
+
readonly label: "From";
|
|
50
|
+
}, {
|
|
51
|
+
readonly path: "to";
|
|
52
|
+
readonly type: "string";
|
|
53
|
+
readonly label: "To";
|
|
54
|
+
}, {
|
|
55
|
+
readonly path: "fen";
|
|
56
|
+
readonly type: "string";
|
|
57
|
+
readonly label: "Position";
|
|
58
|
+
}, {
|
|
59
|
+
readonly path: "san";
|
|
60
|
+
readonly type: "string";
|
|
61
|
+
readonly label: "SAN";
|
|
62
|
+
}, {
|
|
63
|
+
readonly path: "lan";
|
|
64
|
+
readonly type: "string";
|
|
65
|
+
readonly label: "LAN";
|
|
66
|
+
}, {
|
|
67
|
+
readonly path: "promotion";
|
|
68
|
+
readonly type: "string";
|
|
69
|
+
readonly label: "Promotion";
|
|
70
|
+
}];
|
|
71
|
+
};
|
|
72
|
+
readonly invalidMove: {
|
|
73
|
+
readonly label: "Invalid move";
|
|
74
|
+
readonly eventType: "chess.invalidMove";
|
|
75
|
+
readonly payloadFields: readonly [{
|
|
76
|
+
readonly path: "from";
|
|
77
|
+
readonly type: "string";
|
|
78
|
+
readonly label: "From";
|
|
79
|
+
}, {
|
|
80
|
+
readonly path: "to";
|
|
81
|
+
readonly type: "string";
|
|
82
|
+
readonly label: "To";
|
|
83
|
+
}, {
|
|
84
|
+
readonly path: "promotion";
|
|
85
|
+
readonly type: "string";
|
|
86
|
+
readonly label: "Promotion";
|
|
36
87
|
}];
|
|
37
88
|
};
|
|
38
89
|
};
|
|
@@ -59,6 +110,14 @@ export declare const chessBoardMeta: {
|
|
|
59
110
|
};
|
|
60
111
|
};
|
|
61
112
|
readonly props: {
|
|
113
|
+
readonly fen: {
|
|
114
|
+
readonly type: "string";
|
|
115
|
+
readonly category: "Position";
|
|
116
|
+
readonly label: "FEN";
|
|
117
|
+
readonly authoring: {
|
|
118
|
+
readonly authority: "instance";
|
|
119
|
+
};
|
|
120
|
+
};
|
|
62
121
|
readonly pieces: {
|
|
63
122
|
readonly type: "array";
|
|
64
123
|
readonly category: "Board";
|
|
@@ -104,6 +163,15 @@ export declare const chessBoardMeta: {
|
|
|
104
163
|
readonly authority: "instance";
|
|
105
164
|
};
|
|
106
165
|
};
|
|
166
|
+
readonly validateMoves: {
|
|
167
|
+
readonly type: "boolean";
|
|
168
|
+
readonly category: "Behavior";
|
|
169
|
+
readonly label: "Validate moves";
|
|
170
|
+
readonly default: true;
|
|
171
|
+
readonly authoring: {
|
|
172
|
+
readonly authority: "instance";
|
|
173
|
+
};
|
|
174
|
+
};
|
|
107
175
|
readonly disabled: {
|
|
108
176
|
readonly type: "boolean";
|
|
109
177
|
readonly category: "State";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/features/chess/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/features/chess/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyHW,CAAC;AACvC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8EU,CAAC"}
|
|
@@ -6,7 +6,7 @@ export const chessBoardMeta = {
|
|
|
6
6
|
allowedChildren: [],
|
|
7
7
|
blueprint: {
|
|
8
8
|
label: 'Chess board',
|
|
9
|
-
defaultProps: { pieces: [], orientation: 'white', showCoordinates: true },
|
|
9
|
+
defaultProps: { pieces: [], orientation: 'white', showCoordinates: true, validateMoves: true },
|
|
10
10
|
},
|
|
11
11
|
events: {
|
|
12
12
|
squarePress: {
|
|
@@ -20,6 +20,28 @@ export const chessBoardMeta = {
|
|
|
20
20
|
payloadFields: [
|
|
21
21
|
{ path: 'from', type: 'string', label: 'From' },
|
|
22
22
|
{ path: 'to', type: 'string', label: 'To' },
|
|
23
|
+
{ path: 'promotion', type: 'string', label: 'Promotion' },
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
legalMove: {
|
|
27
|
+
label: 'Legal move',
|
|
28
|
+
eventType: 'chess.legalMove',
|
|
29
|
+
payloadFields: [
|
|
30
|
+
{ path: 'from', type: 'string', label: 'From' },
|
|
31
|
+
{ path: 'to', type: 'string', label: 'To' },
|
|
32
|
+
{ path: 'fen', type: 'string', label: 'Position' },
|
|
33
|
+
{ path: 'san', type: 'string', label: 'SAN' },
|
|
34
|
+
{ path: 'lan', type: 'string', label: 'LAN' },
|
|
35
|
+
{ path: 'promotion', type: 'string', label: 'Promotion' },
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
invalidMove: {
|
|
39
|
+
label: 'Invalid move',
|
|
40
|
+
eventType: 'chess.invalidMove',
|
|
41
|
+
payloadFields: [
|
|
42
|
+
{ path: 'from', type: 'string', label: 'From' },
|
|
43
|
+
{ path: 'to', type: 'string', label: 'To' },
|
|
44
|
+
{ path: 'promotion', type: 'string', label: 'Promotion' },
|
|
23
45
|
],
|
|
24
46
|
},
|
|
25
47
|
},
|
|
@@ -40,6 +62,12 @@ export const chessBoardMeta = {
|
|
|
40
62
|
},
|
|
41
63
|
},
|
|
42
64
|
props: {
|
|
65
|
+
fen: {
|
|
66
|
+
type: 'string',
|
|
67
|
+
category: 'Position',
|
|
68
|
+
label: 'FEN',
|
|
69
|
+
authoring: { authority: 'instance' },
|
|
70
|
+
},
|
|
43
71
|
pieces: {
|
|
44
72
|
type: 'array',
|
|
45
73
|
category: 'Board',
|
|
@@ -75,6 +103,13 @@ export const chessBoardMeta = {
|
|
|
75
103
|
default: false,
|
|
76
104
|
authoring: { authority: 'instance' },
|
|
77
105
|
},
|
|
106
|
+
validateMoves: {
|
|
107
|
+
type: 'boolean',
|
|
108
|
+
category: 'Behavior',
|
|
109
|
+
label: 'Validate moves',
|
|
110
|
+
default: true,
|
|
111
|
+
authoring: { authority: 'instance' },
|
|
112
|
+
},
|
|
78
113
|
disabled: {
|
|
79
114
|
type: 'boolean',
|
|
80
115
|
category: 'State',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/features/chess/meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,YAAY;IAClB,QAAQ,EAAE,WAAW;IACrB,WAAW,EACT,mGAAmG;IACrG,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE;QACT,KAAK,EAAE,aAAa;QACpB,YAAY,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE;KAC1E;IACD,MAAM,EAAE;QACN,WAAW,EAAE;YACX,KAAK,EAAE,cAAc;YACrB,SAAS,EAAE,mBAAmB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E,SAAS,EAAE,UAAU,EAAE;SACrC;KACF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../types/authoring';\n\nexport const chessBoardMeta = {\n name: 'ChessBoard',\n category: 'component',\n description:\n 'Renders caller-owned chess pieces, highlights, and move-attempt interactions without chess rules.',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: {\n label: 'Chess board',\n defaultProps: { pieces: [], orientation: 'white', showCoordinates: true },\n },\n events: {\n squarePress: {\n label: 'Square press',\n eventType: 'chess.squarePress',\n payloadFields: [{ path: 'square', type: 'string', label: 'Square' }],\n },\n moveAttempt: {\n label: 'Move attempt',\n eventType: 'chess.moveAttempt',\n payloadFields: [\n { path: 'from', type: 'string', label: 'From' },\n { path: 'to', type: 'string', label: 'To' },\n ],\n },\n },\n bindings: {\n props: {\n pieces: {\n label: 'Pieces',\n value: { type: 'array', itemType: 'object' },\n acceptsFallback: true,\n acceptsTransforms: true,\n },\n legalTargets: {\n label: 'Legal targets',\n value: { type: 'array', itemType: 'string' },\n acceptsFallback: true,\n acceptsTransforms: true,\n },\n },\n },\n props: {\n pieces: {\n type: 'array',\n category: 'Board',\n label: 'Pieces',\n default: [],\n authoring: { authority: 'instance' },\n },\n orientation: {\n type: 'enum',\n category: 'Board',\n label: 'Orientation',\n enum: ['white', 'black'],\n default: 'white',\n authoring: { authority: 'instance' },\n },\n selectedSquare: {\n type: 'string',\n category: 'Board',\n label: 'Selected square',\n authoring: { authority: 'instance' },\n },\n legalTargets: {\n type: 'array',\n category: 'Board',\n label: 'Legal targets',\n default: [],\n authoring: { authority: 'instance' },\n },\n showCoordinates: {\n type: 'boolean',\n category: 'Style',\n label: 'Show coordinates',\n default: false,\n authoring: { authority: 'instance' },\n },\n disabled: {\n type: 'boolean',\n category: 'State',\n label: 'Disabled',\n default: false,\n authoring: { authority: 'instance' },\n },\n },\n} as const satisfies ZoraComponentMeta;\nexport const openingBookMeta = {\n name: 'OpeningBook',\n category: 'component',\n description:\n 'Presents caller-owned opening suggestions and their loading, empty, selected, and press states.',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: {\n label: 'Opening book',\n defaultProps: {\n moves: [],\n title: 'Opening book',\n emptyText: 'No book moves for this position.',\n },\n },\n events: {\n movePress: {\n label: 'Move press',\n eventType: 'chess.openingMovePress',\n payloadFields: [\n { path: 'san', type: 'string', label: 'SAN' },\n { path: 'uci', type: 'string', label: 'UCI' },\n { path: 'fen', type: 'string', label: 'Position' },\n ],\n },\n },\n bindings: {\n props: {\n moves: {\n label: 'Moves',\n value: { type: 'array', itemType: 'object' },\n acceptsFallback: true,\n acceptsTransforms: true,\n },\n },\n },\n props: {\n moves: {\n type: 'array',\n category: 'Content',\n label: 'Moves',\n default: [],\n authoring: { authority: 'instance' },\n },\n title: {\n type: 'string',\n category: 'Content',\n label: 'Title',\n default: 'Opening book',\n authoring: { authority: 'instance' },\n },\n emptyText: {\n type: 'string',\n category: 'Content',\n label: 'Empty text',\n default: 'No book moves for this position.',\n authoring: { authority: 'instance' },\n },\n loading: {\n type: 'boolean',\n category: 'State',\n label: 'Loading',\n default: false,\n authoring: { authority: 'instance' },\n },\n errorText: {\n type: 'string',\n category: 'State',\n label: 'Error text',\n authoring: { authority: 'instance' },\n },\n selectedMove: {\n type: 'string',\n category: 'State',\n label: 'Selected move',\n authoring: { authority: 'instance' },\n },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/features/chess/meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,YAAY;IAClB,QAAQ,EAAE,WAAW;IACrB,WAAW,EACT,mGAAmG;IACrG,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE;QACT,KAAK,EAAE,aAAa;QACpB,YAAY,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,EAAE,IAA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EAAE;SACrC;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,YAAY;YACnB,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,eAAe;YACtB,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;KACF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../types/authoring';\n\nexport const chessBoardMeta = {\n name: 'ChessBoard',\n category: 'component',\n description:\n 'Renders caller-owned chess pieces, highlights, and move-attempt interactions without chess rules.',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: {\n label: 'Chess board',\n defaultProps: { pieces: [], orientation: 'white', showCoordinates: true, validateMoves: true },\n },\n events: {\n squarePress: {\n label: 'Square press',\n eventType: 'chess.squarePress',\n payloadFields: [{ path: 'square', type: 'string', label: 'Square' }],\n },\n moveAttempt: {\n label: 'Move attempt',\n eventType: 'chess.moveAttempt',\n payloadFields: [\n { path: 'from', type: 'string', label: 'From' },\n { path: 'to', type: 'string', label: 'To' },\n { path: 'promotion', type: 'string', label: 'Promotion' },\n ],\n },\n legalMove: {\n label: 'Legal move',\n eventType: 'chess.legalMove',\n payloadFields: [\n { path: 'from', type: 'string', label: 'From' },\n { path: 'to', type: 'string', label: 'To' },\n { path: 'fen', type: 'string', label: 'Position' },\n { path: 'san', type: 'string', label: 'SAN' },\n { path: 'lan', type: 'string', label: 'LAN' },\n { path: 'promotion', type: 'string', label: 'Promotion' },\n ],\n },\n invalidMove: {\n label: 'Invalid move',\n eventType: 'chess.invalidMove',\n payloadFields: [\n { path: 'from', type: 'string', label: 'From' },\n { path: 'to', type: 'string', label: 'To' },\n { path: 'promotion', type: 'string', label: 'Promotion' },\n ],\n },\n },\n bindings: {\n props: {\n pieces: {\n label: 'Pieces',\n value: { type: 'array', itemType: 'object' },\n acceptsFallback: true,\n acceptsTransforms: true,\n },\n legalTargets: {\n label: 'Legal targets',\n value: { type: 'array', itemType: 'string' },\n acceptsFallback: true,\n acceptsTransforms: true,\n },\n },\n },\n props: {\n fen: {\n type: 'string',\n category: 'Position',\n label: 'FEN',\n authoring: { authority: 'instance' },\n },\n pieces: {\n type: 'array',\n category: 'Board',\n label: 'Pieces',\n default: [],\n authoring: { authority: 'instance' },\n },\n orientation: {\n type: 'enum',\n category: 'Board',\n label: 'Orientation',\n enum: ['white', 'black'],\n default: 'white',\n authoring: { authority: 'instance' },\n },\n selectedSquare: {\n type: 'string',\n category: 'Board',\n label: 'Selected square',\n authoring: { authority: 'instance' },\n },\n legalTargets: {\n type: 'array',\n category: 'Board',\n label: 'Legal targets',\n default: [],\n authoring: { authority: 'instance' },\n },\n showCoordinates: {\n type: 'boolean',\n category: 'Style',\n label: 'Show coordinates',\n default: false,\n authoring: { authority: 'instance' },\n },\n validateMoves: {\n type: 'boolean',\n category: 'Behavior',\n label: 'Validate moves',\n default: true,\n authoring: { authority: 'instance' },\n },\n disabled: {\n type: 'boolean',\n category: 'State',\n label: 'Disabled',\n default: false,\n authoring: { authority: 'instance' },\n },\n },\n} as const satisfies ZoraComponentMeta;\nexport const openingBookMeta = {\n name: 'OpeningBook',\n category: 'component',\n description:\n 'Presents caller-owned opening suggestions and their loading, empty, selected, and press states.',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: {\n label: 'Opening book',\n defaultProps: {\n moves: [],\n title: 'Opening book',\n emptyText: 'No book moves for this position.',\n },\n },\n events: {\n movePress: {\n label: 'Move press',\n eventType: 'chess.openingMovePress',\n payloadFields: [\n { path: 'san', type: 'string', label: 'SAN' },\n { path: 'uci', type: 'string', label: 'UCI' },\n { path: 'fen', type: 'string', label: 'Position' },\n ],\n },\n },\n bindings: {\n props: {\n moves: {\n label: 'Moves',\n value: { type: 'array', itemType: 'object' },\n acceptsFallback: true,\n acceptsTransforms: true,\n },\n },\n },\n props: {\n moves: {\n type: 'array',\n category: 'Content',\n label: 'Moves',\n default: [],\n authoring: { authority: 'instance' },\n },\n title: {\n type: 'string',\n category: 'Content',\n label: 'Title',\n default: 'Opening book',\n authoring: { authority: 'instance' },\n },\n emptyText: {\n type: 'string',\n category: 'Content',\n label: 'Empty text',\n default: 'No book moves for this position.',\n authoring: { authority: 'instance' },\n },\n loading: {\n type: 'boolean',\n category: 'State',\n label: 'Loading',\n default: false,\n authoring: { authority: 'instance' },\n },\n errorText: {\n type: 'string',\n category: 'State',\n label: 'Error text',\n authoring: { authority: 'instance' },\n },\n selectedMove: {\n type: 'string',\n category: 'State',\n label: 'Selected move',\n authoring: { authority: 'instance' },\n },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export type { ChessBoardColorOverrides, ChessBoardColorScheme, ChessBoardOrientation, ChessBoardProps, ChessMoveAttempt, ChessPieceCode, ChessPieceRenderContext, ChessPieceRenderer, ChessPieceState, ChessPromotionPiece, ChessSquareId, OpeningBookColorOverrides, OpeningBookColorScheme, OpeningBookMove, OpeningBookProps, } from '../../types/chess';
|
|
1
|
+
export type { ChessBoardColorOverrides, ChessBoardColorScheme, ChessBoardOrientation, ChessBoardProps, ChessMoveAttempt, ChessMoveResult, ChessPieceCode, ChessPieceRenderContext, ChessPieceRenderer, ChessPieceState, ChessPromotionPiece, ChessSquareId, OpeningBookColorOverrides, OpeningBookColorScheme, OpeningBookMove, OpeningBookProps, } from '../../types/chess';
|
|
2
2
|
export { ChessBoard } from './adapters/inbound/ChessBoard';
|
|
3
3
|
export { OpeningBook } from './adapters/inbound/OpeningBook';
|
|
4
|
+
export { chessBoardMeta, openingBookMeta } from './meta';
|
|
5
|
+
export { getLegalTargets, readChessPieces, tryMove } from './utils/chessEngine';
|
|
4
6
|
export { chessSquares } from './utils/chessSquares';
|
|
5
7
|
export { createBoardSquares } from './utils/createBoardSquares';
|
|
6
8
|
export type { ChessColorThemeShape } from './utils/createChessBoardColorScheme';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/chess/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,wBAAwB,EACxB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,uBAAuB,EACvB,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,yBAAyB,EACzB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,YAAY,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/chess/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,wBAAwB,EACxB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,yBAAyB,EACzB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,YAAY,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { ChessBoard } from './adapters/inbound/ChessBoard';
|
|
2
2
|
export { OpeningBook } from './adapters/inbound/OpeningBook';
|
|
3
|
+
export { chessBoardMeta, openingBookMeta } from './meta';
|
|
4
|
+
export { getLegalTargets, readChessPieces, tryMove } from './utils/chessEngine';
|
|
3
5
|
export { chessSquares } from './utils/chessSquares';
|
|
4
6
|
export { createBoardSquares } from './utils/createBoardSquares';
|
|
5
7
|
export { createChessBoardColorScheme } from './utils/createChessBoardColorScheme';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/chess/public.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/chess/public.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["export type {\n ChessBoardColorOverrides,\n ChessBoardColorScheme,\n ChessBoardOrientation,\n ChessBoardProps,\n ChessMoveAttempt,\n ChessMoveResult,\n ChessPieceCode,\n ChessPieceRenderContext,\n ChessPieceRenderer,\n ChessPieceState,\n ChessPromotionPiece,\n ChessSquareId,\n OpeningBookColorOverrides,\n OpeningBookColorScheme,\n OpeningBookMove,\n OpeningBookProps,\n} from '../../types/chess';\nexport { ChessBoard } from './adapters/inbound/ChessBoard';\nexport { OpeningBook } from './adapters/inbound/OpeningBook';\nexport { chessBoardMeta, openingBookMeta } from './meta';\nexport { getLegalTargets, readChessPieces, tryMove } from './utils/chessEngine';\nexport { chessSquares } from './utils/chessSquares';\nexport { createBoardSquares } from './utils/createBoardSquares';\nexport type { ChessColorThemeShape } from './utils/createChessBoardColorScheme';\nexport { createChessBoardColorScheme } from './utils/createChessBoardColorScheme';\nexport { createOpeningBookColorScheme } from './utils/createOpeningBookColorScheme';\nexport { getSquareFile } from './utils/getSquareFile';\nexport { getSquareRank } from './utils/getSquareRank';\nexport { isLightSquare } from './utils/isLightSquare';\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ChessMoveAttempt, ChessMoveResult, ChessPieceState, ChessSquareId } from '../../../types/chess';
|
|
2
|
+
/*** Read all pieces from a FEN-backed position. Invalid FEN produces an empty position. */
|
|
3
|
+
export declare function readChessPieces(fen: string): ReadonlyMap<ChessSquareId, ChessPieceState>;
|
|
4
|
+
/*** Resolve legal destination squares from one FEN position and source square. */
|
|
5
|
+
export declare function getLegalTargets(fen: string, from: ChessSquareId): readonly ChessSquareId[];
|
|
6
|
+
/*** Attempt one legal chess move against FEN and return the resulting position/move notation. */
|
|
7
|
+
export declare function tryMove(fen: string, attempt: ChessMoveAttempt): ChessMoveResult | null;
|
|
8
|
+
//# sourceMappingURL=chessEngine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chessEngine.d.ts","sourceRoot":"","sources":["../../../../src/features/chess/utils/chessEngine.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EAEf,eAAe,EAEf,aAAa,EACd,MAAM,sBAAsB,CAAC;AAiC9B,2FAA2F;AAC3F,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAC,aAAa,EAAE,eAAe,CAAC,CAgBxF;AAED,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,SAAS,aAAa,EAAE,CAG1F;AAED,iGAAiG;AACjG,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,eAAe,GAAG,IAAI,CActF"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Chess } from 'chess.js';
|
|
2
|
+
/*** Create a chess.js position from FEN without leaking invalid-position exceptions. */
|
|
3
|
+
function createChess(fen) {
|
|
4
|
+
try {
|
|
5
|
+
return new Chess(fen);
|
|
6
|
+
}
|
|
7
|
+
catch {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/*** Convert a chess.js piece into the public ZORA piece code. */
|
|
12
|
+
function toPieceCode(piece) {
|
|
13
|
+
return piece.color === 'w' ? piece.type.toUpperCase() : piece.type.toLowerCase();
|
|
14
|
+
}
|
|
15
|
+
/*** Normalize a chess.js promotion marker into the public promotion union. */
|
|
16
|
+
function toPromotionPiece(piece) {
|
|
17
|
+
return piece === 'q' || piece === 'r' || piece === 'b' || piece === 'n' ? piece : undefined;
|
|
18
|
+
}
|
|
19
|
+
/*** Convert one successful chess.js move into the public result contract. */
|
|
20
|
+
function toMoveResult(move, fen) {
|
|
21
|
+
return {
|
|
22
|
+
fen,
|
|
23
|
+
from: move.from,
|
|
24
|
+
lan: move.lan,
|
|
25
|
+
promotion: toPromotionPiece(move.promotion),
|
|
26
|
+
san: move.san,
|
|
27
|
+
to: move.to,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/*** Read all pieces from a FEN-backed position. Invalid FEN produces an empty position. */
|
|
31
|
+
export function readChessPieces(fen) {
|
|
32
|
+
const chess = createChess(fen);
|
|
33
|
+
const pieces = new Map();
|
|
34
|
+
if (!chess)
|
|
35
|
+
return pieces;
|
|
36
|
+
for (const rank of chess.board()) {
|
|
37
|
+
for (const piece of rank) {
|
|
38
|
+
if (!piece)
|
|
39
|
+
continue;
|
|
40
|
+
pieces.set(piece.square, {
|
|
41
|
+
color: piece.color === 'w' ? 'white' : 'black',
|
|
42
|
+
piece: toPieceCode(piece),
|
|
43
|
+
square: piece.square,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return pieces;
|
|
48
|
+
}
|
|
49
|
+
/*** Resolve legal destination squares from one FEN position and source square. */
|
|
50
|
+
export function getLegalTargets(fen, from) {
|
|
51
|
+
const chess = createChess(fen);
|
|
52
|
+
return chess ? chess.moves({ square: from, verbose: true }).map((move) => move.to) : [];
|
|
53
|
+
}
|
|
54
|
+
/*** Attempt one legal chess move against FEN and return the resulting position/move notation. */
|
|
55
|
+
export function tryMove(fen, attempt) {
|
|
56
|
+
const chess = createChess(fen);
|
|
57
|
+
if (!chess)
|
|
58
|
+
return null;
|
|
59
|
+
try {
|
|
60
|
+
const move = chess.move({
|
|
61
|
+
from: attempt.from,
|
|
62
|
+
promotion: attempt.promotion,
|
|
63
|
+
to: attempt.to,
|
|
64
|
+
});
|
|
65
|
+
return toMoveResult(move, chess.fen());
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=chessEngine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chessEngine.js","sourceRoot":"","sources":["../../../../src/features/chess/utils/chessEngine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAa,MAAM,UAAU,CAAC;AAW5C,wFAAwF;AACxF,SAAS,WAAW,CAAC,GAAW;IAC9B,IAAI,CAAC;QACH,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,iEAAiE;AACjE,SAAS,WAAW,CAAC,KAA2D;IAC9E,OAAO,KAAK,CAAC,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;AACnF,CAAC;AAED,8EAA8E;AAC9E,SAAS,gBAAgB,CAAC,KAAyB;IACjD,OAAO,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9F,CAAC;AAED,6EAA6E;AAC7E,SAAS,YAAY,CAAC,IAAU,EAAE,GAAW;IAC3C,OAAO;QACL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C;AAC1F,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,OAAO,CAAC,GAAW,EAAE,OAAyB;IAC5D,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;YACtB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,EAAE,EAAE,OAAO,CAAC,EAAE;SACf,CAAC,CAAC;QACH,OAAO,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;IACzC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["import { Chess, type Move } from 'chess.js';\n\nimport type {\n ChessMoveAttempt,\n ChessMoveResult,\n ChessPieceCode,\n ChessPieceState,\n ChessPromotionPiece,\n ChessSquareId,\n} from '../../../types/chess';\n\n/*** Create a chess.js position from FEN without leaking invalid-position exceptions. */\nfunction createChess(fen: string): Chess | null {\n try {\n return new Chess(fen);\n } catch {\n return null;\n }\n}\n\n/*** Convert a chess.js piece into the public ZORA piece code. */\nfunction toPieceCode(piece: { readonly color: 'b' | 'w'; readonly type: string }): ChessPieceCode {\n return piece.color === 'w' ? piece.type.toUpperCase() : piece.type.toLowerCase();\n}\n\n/*** Normalize a chess.js promotion marker into the public promotion union. */\nfunction toPromotionPiece(piece: string | undefined): ChessPromotionPiece | undefined {\n return piece === 'q' || piece === 'r' || piece === 'b' || piece === 'n' ? piece : undefined;\n}\n\n/*** Convert one successful chess.js move into the public result contract. */\nfunction toMoveResult(move: Move, fen: string): ChessMoveResult {\n return {\n fen,\n from: move.from,\n lan: move.lan,\n promotion: toPromotionPiece(move.promotion),\n san: move.san,\n to: move.to,\n };\n}\n\n/*** Read all pieces from a FEN-backed position. Invalid FEN produces an empty position. */\nexport function readChessPieces(fen: string): ReadonlyMap<ChessSquareId, ChessPieceState> {\n const chess = createChess(fen);\n const pieces = new Map<ChessSquareId, ChessPieceState>();\n if (!chess) return pieces;\n\n for (const rank of chess.board()) {\n for (const piece of rank) {\n if (!piece) continue;\n pieces.set(piece.square, {\n color: piece.color === 'w' ? 'white' : 'black',\n piece: toPieceCode(piece),\n square: piece.square,\n });\n }\n }\n return pieces;\n}\n\n/*** Resolve legal destination squares from one FEN position and source square. */\nexport function getLegalTargets(fen: string, from: ChessSquareId): readonly ChessSquareId[] {\n const chess = createChess(fen);\n return chess ? chess.moves({ square: from, verbose: true }).map((move) => move.to) : [];\n}\n\n/*** Attempt one legal chess move against FEN and return the resulting position/move notation. */\nexport function tryMove(fen: string, attempt: ChessMoveAttempt): ChessMoveResult | null {\n const chess = createChess(fen);\n if (!chess) return null;\n\n try {\n const move = chess.move({\n from: attempt.from,\n promotion: attempt.promotion,\n to: attempt.to,\n });\n return toMoveResult(move, chess.fen());\n } catch {\n return null;\n }\n}\n"]}
|
|
@@ -164,6 +164,30 @@ export declare const tabletopTableMeta: {
|
|
|
164
164
|
readonly acceptsFallback: true;
|
|
165
165
|
readonly acceptsTransforms: true;
|
|
166
166
|
};
|
|
167
|
+
readonly centerLabel: {
|
|
168
|
+
readonly label: "Center label";
|
|
169
|
+
readonly value: {
|
|
170
|
+
readonly type: "string";
|
|
171
|
+
};
|
|
172
|
+
readonly acceptsFallback: true;
|
|
173
|
+
readonly acceptsTransforms: true;
|
|
174
|
+
};
|
|
175
|
+
readonly centerSublabel: {
|
|
176
|
+
readonly label: "Center sublabel";
|
|
177
|
+
readonly value: {
|
|
178
|
+
readonly type: "string";
|
|
179
|
+
};
|
|
180
|
+
readonly acceptsFallback: true;
|
|
181
|
+
readonly acceptsTransforms: true;
|
|
182
|
+
};
|
|
183
|
+
readonly disabled: {
|
|
184
|
+
readonly label: "Disabled";
|
|
185
|
+
readonly value: {
|
|
186
|
+
readonly type: "boolean";
|
|
187
|
+
};
|
|
188
|
+
readonly acceptsFallback: true;
|
|
189
|
+
readonly acceptsTransforms: true;
|
|
190
|
+
};
|
|
167
191
|
};
|
|
168
192
|
};
|
|
169
193
|
readonly props: {
|
|
@@ -299,6 +323,14 @@ export declare const pokerTrainingTableMeta: {
|
|
|
299
323
|
};
|
|
300
324
|
readonly acceptsFallback: true;
|
|
301
325
|
};
|
|
326
|
+
readonly disabled: {
|
|
327
|
+
readonly label: "Disabled";
|
|
328
|
+
readonly value: {
|
|
329
|
+
readonly type: "boolean";
|
|
330
|
+
};
|
|
331
|
+
readonly acceptsFallback: true;
|
|
332
|
+
readonly acceptsTransforms: true;
|
|
333
|
+
};
|
|
302
334
|
};
|
|
303
335
|
};
|
|
304
336
|
readonly props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/features/tabletop/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBa,CAAC;AACvC,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCa,CAAC;AACvC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BU,CAAC;AACvC,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/features/tabletop/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBa,CAAC;AACvC,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCa,CAAC;AACvC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BU,CAAC;AACvC,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6GQ,CAAC;AACvC,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0EG,CAAC"}
|