@ankhorage/zora 21.0.22 → 21.1.0
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 +20 -0
- package/README.md +40 -184
- package/dist/features/authoring/allowedChildren.d.ts +5 -2
- package/dist/features/authoring/allowedChildren.d.ts.map +1 -1
- package/dist/features/authoring/allowedChildren.js +13 -2
- package/dist/features/authoring/allowedChildren.js.map +1 -1
- package/dist/features/authoring/componentMeta.d.ts.map +1 -1
- package/dist/features/authoring/componentMeta.js +21 -0
- package/dist/features/authoring/componentMeta.js.map +1 -1
- package/dist/features/authoring/constants.d.ts +3 -0
- package/dist/features/authoring/constants.d.ts.map +1 -1
- package/dist/features/authoring/constants.js +3 -0
- package/dist/features/authoring/constants.js.map +1 -1
- package/dist/features/button/adapters/inbound/Button.d.ts +0 -4
- package/dist/features/button/adapters/inbound/Button.d.ts.map +1 -1
- package/dist/features/button/adapters/inbound/Button.js +0 -4
- package/dist/features/button/adapters/inbound/Button.js.map +1 -1
- package/dist/features/card/adapters/inbound/Card.d.ts +0 -4
- package/dist/features/card/adapters/inbound/Card.d.ts.map +1 -1
- package/dist/features/card/adapters/inbound/Card.js +0 -4
- package/dist/features/card/adapters/inbound/Card.js.map +1 -1
- package/dist/features/card/cardMeta.d.ts +1 -1
- package/dist/features/card/cardMeta.d.ts.map +1 -1
- package/dist/features/card/cardMeta.js +7 -2
- package/dist/features/card/cardMeta.js.map +1 -1
- package/dist/features/chess/adapters/inbound/ChessBoard.d.ts +5 -0
- package/dist/features/chess/adapters/inbound/ChessBoard.d.ts.map +1 -0
- package/dist/features/chess/adapters/inbound/ChessBoard.js +119 -0
- package/dist/features/chess/adapters/inbound/ChessBoard.js.map +1 -0
- package/dist/features/chess/adapters/inbound/OpeningBook.d.ts +5 -0
- package/dist/features/chess/adapters/inbound/OpeningBook.d.ts.map +1 -0
- package/dist/features/chess/adapters/inbound/OpeningBook.js +94 -0
- package/dist/features/chess/adapters/inbound/OpeningBook.js.map +1 -0
- package/dist/features/chess/meta.d.ts +219 -0
- package/dist/features/chess/meta.d.ts.map +1 -0
- package/dist/features/chess/meta.js +165 -0
- package/dist/features/chess/meta.js.map +1 -0
- package/dist/features/chess/public.d.ts +12 -0
- package/dist/features/chess/public.d.ts.map +1 -0
- package/dist/features/chess/public.js +10 -0
- package/dist/features/chess/public.js.map +1 -0
- package/dist/features/chess/utils/chessSquares.d.ts +4 -0
- package/dist/features/chess/utils/chessSquares.d.ts.map +1 -0
- package/dist/features/chess/utils/chessSquares.js +3 -0
- package/dist/features/chess/utils/chessSquares.js.map +1 -0
- package/dist/features/chess/utils/createBoardSquares.d.ts +4 -0
- package/dist/features/chess/utils/createBoardSquares.d.ts.map +1 -0
- package/dist/features/chess/utils/createBoardSquares.js +9 -0
- package/dist/features/chess/utils/createBoardSquares.js.map +1 -0
- package/dist/features/chess/utils/createChessBoardColorScheme.d.ts +35 -0
- package/dist/features/chess/utils/createChessBoardColorScheme.d.ts.map +1 -0
- package/dist/features/chess/utils/createChessBoardColorScheme.js +26 -0
- package/dist/features/chess/utils/createChessBoardColorScheme.js.map +1 -0
- package/dist/features/chess/utils/createOpeningBookColorScheme.d.ts +11 -0
- package/dist/features/chess/utils/createOpeningBookColorScheme.d.ts.map +1 -0
- package/dist/features/chess/utils/createOpeningBookColorScheme.js +21 -0
- package/dist/features/chess/utils/createOpeningBookColorScheme.js.map +1 -0
- package/dist/features/chess/utils/getSquareFile.d.ts +4 -0
- package/dist/features/chess/utils/getSquareFile.d.ts.map +1 -0
- package/dist/features/chess/utils/getSquareFile.js +5 -0
- package/dist/features/chess/utils/getSquareFile.js.map +1 -0
- package/dist/features/chess/utils/getSquareRank.d.ts +4 -0
- package/dist/features/chess/utils/getSquareRank.d.ts.map +1 -0
- package/dist/features/chess/utils/getSquareRank.js +5 -0
- package/dist/features/chess/utils/getSquareRank.js.map +1 -0
- package/dist/features/chess/utils/isLightSquare.d.ts +4 -0
- package/dist/features/chess/utils/isLightSquare.d.ts.map +1 -0
- package/dist/features/chess/utils/isLightSquare.js +6 -0
- package/dist/features/chess/utils/isLightSquare.js.map +1 -0
- package/dist/features/empty-state/adapters/inbound/EmptyState.d.ts +0 -4
- package/dist/features/empty-state/adapters/inbound/EmptyState.d.ts.map +1 -1
- package/dist/features/empty-state/adapters/inbound/EmptyState.js +0 -4
- package/dist/features/empty-state/adapters/inbound/EmptyState.js.map +1 -1
- package/dist/features/form/text-input/adapters/inbound/TextInput.d.ts +0 -4
- package/dist/features/form/text-input/adapters/inbound/TextInput.d.ts.map +1 -1
- package/dist/features/form/text-input/adapters/inbound/TextInput.js +0 -4
- package/dist/features/form/text-input/adapters/inbound/TextInput.js.map +1 -1
- package/dist/features/game/adapters/inbound/Game.d.ts +5 -0
- package/dist/features/game/adapters/inbound/Game.d.ts.map +1 -0
- package/dist/features/game/adapters/inbound/Game.js +24 -0
- package/dist/features/game/adapters/inbound/Game.js.map +1 -0
- package/dist/features/game/adapters/inbound/GameEntity.d.ts +5 -0
- package/dist/features/game/adapters/inbound/GameEntity.d.ts.map +1 -0
- package/dist/features/game/adapters/inbound/GameEntity.js +29 -0
- package/dist/features/game/adapters/inbound/GameEntity.js.map +1 -0
- package/dist/features/game/adapters/inbound/GameField.d.ts +4 -0
- package/dist/features/game/adapters/inbound/GameField.d.ts.map +1 -0
- package/dist/features/game/adapters/inbound/GameField.js +32 -0
- package/dist/features/game/adapters/inbound/GameField.js.map +1 -0
- package/dist/features/game/adapters/inbound/GameInputZone.d.ts +4 -0
- package/dist/features/game/adapters/inbound/GameInputZone.d.ts.map +1 -0
- package/dist/features/game/adapters/inbound/GameInputZone.js +50 -0
- package/dist/features/game/adapters/inbound/GameInputZone.js.map +1 -0
- package/dist/features/game/adapters/inbound/GameMeasurementProbe.d.ts +4 -0
- package/dist/features/game/adapters/inbound/GameMeasurementProbe.d.ts.map +1 -0
- package/dist/features/game/adapters/inbound/GameMeasurementProbe.js +54 -0
- package/dist/features/game/adapters/inbound/GameMeasurementProbe.js.map +1 -0
- package/dist/features/game/adapters/inbound/GameOverlay.d.ts +4 -0
- package/dist/features/game/adapters/inbound/GameOverlay.d.ts.map +1 -0
- package/dist/features/game/adapters/inbound/GameOverlay.js +39 -0
- package/dist/features/game/adapters/inbound/GameOverlay.js.map +1 -0
- package/dist/features/game/adapters/inbound/createGameKeyboardEvent.d.ts +16 -0
- package/dist/features/game/adapters/inbound/createGameKeyboardEvent.d.ts.map +1 -0
- package/dist/features/game/adapters/inbound/createGameKeyboardEvent.js +16 -0
- package/dist/features/game/adapters/inbound/createGameKeyboardEvent.js.map +1 -0
- package/dist/features/game/adapters/inbound/createGameMeasurementEvent.d.ts +14 -0
- package/dist/features/game/adapters/inbound/createGameMeasurementEvent.d.ts.map +1 -0
- package/dist/features/game/adapters/inbound/createGameMeasurementEvent.js +25 -0
- package/dist/features/game/adapters/inbound/createGameMeasurementEvent.js.map +1 -0
- package/dist/features/game/adapters/inbound/createGamePointerEvent.d.ts +17 -0
- package/dist/features/game/adapters/inbound/createGamePointerEvent.d.ts.map +1 -0
- package/dist/features/game/adapters/inbound/createGamePointerEvent.js +20 -0
- package/dist/features/game/adapters/inbound/createGamePointerEvent.js.map +1 -0
- package/dist/features/game/adapters/inbound/measureGameEntity.d.ts +5 -0
- package/dist/features/game/adapters/inbound/measureGameEntity.d.ts.map +1 -0
- package/dist/features/game/adapters/inbound/measureGameEntity.js +22 -0
- package/dist/features/game/adapters/inbound/measureGameEntity.js.map +1 -0
- package/dist/features/game/adapters/inbound/useGameInputZoneResponder.d.ts +15 -0
- package/dist/features/game/adapters/inbound/useGameInputZoneResponder.d.ts.map +1 -0
- package/dist/features/game/adapters/inbound/useGameInputZoneResponder.js +67 -0
- package/dist/features/game/adapters/inbound/useGameInputZoneResponder.js.map +1 -0
- package/dist/features/game/composition/GameRuntimeContext.d.ts +5 -0
- package/dist/features/game/composition/GameRuntimeContext.d.ts.map +1 -0
- package/dist/features/game/composition/GameRuntimeContext.js +4 -0
- package/dist/features/game/composition/GameRuntimeContext.js.map +1 -0
- package/dist/features/game/composition/createGameBindingContext.d.ts +4 -0
- package/dist/features/game/composition/createGameBindingContext.d.ts.map +1 -0
- package/dist/features/game/composition/createGameBindingContext.js +10 -0
- package/dist/features/game/composition/createGameBindingContext.js.map +1 -0
- package/dist/features/game/composition/createGameMeasurementRegistry.d.ts +4 -0
- package/dist/features/game/composition/createGameMeasurementRegistry.d.ts.map +1 -0
- package/dist/features/game/composition/createGameMeasurementRegistry.js +15 -0
- package/dist/features/game/composition/createGameMeasurementRegistry.js.map +1 -0
- package/dist/features/game/composition/useGameRuntime.d.ts +5 -0
- package/dist/features/game/composition/useGameRuntime.d.ts.map +1 -0
- package/dist/features/game/composition/useGameRuntime.js +117 -0
- package/dist/features/game/composition/useGameRuntime.js.map +1 -0
- package/dist/features/game/composition/useGameScheduledEffects.d.ts +17 -0
- package/dist/features/game/composition/useGameScheduledEffects.d.ts.map +1 -0
- package/dist/features/game/composition/useGameScheduledEffects.js +40 -0
- package/dist/features/game/composition/useGameScheduledEffects.js.map +1 -0
- package/dist/features/game/meta/gameEntityMeta.d.ts +403 -0
- package/dist/features/game/meta/gameEntityMeta.d.ts.map +1 -0
- package/dist/features/game/meta/gameEntityMeta.js +224 -0
- package/dist/features/game/meta/gameEntityMeta.js.map +1 -0
- package/dist/features/game/meta/gameFieldMeta.d.ts +61 -0
- package/dist/features/game/meta/gameFieldMeta.d.ts.map +1 -0
- package/dist/features/game/meta/gameFieldMeta.js +48 -0
- package/dist/features/game/meta/gameFieldMeta.js.map +1 -0
- package/dist/features/game/meta/gameInputZoneMeta.d.ts +163 -0
- package/dist/features/game/meta/gameInputZoneMeta.d.ts.map +1 -0
- package/dist/features/game/meta/gameInputZoneMeta.js +138 -0
- package/dist/features/game/meta/gameInputZoneMeta.js.map +1 -0
- package/dist/features/game/meta/gameMeasurementProbeMeta.d.ts +112 -0
- package/dist/features/game/meta/gameMeasurementProbeMeta.d.ts.map +1 -0
- package/dist/features/game/meta/gameMeasurementProbeMeta.js +70 -0
- package/dist/features/game/meta/gameMeasurementProbeMeta.js.map +1 -0
- package/dist/features/game/meta/gameMeta.d.ts +130 -0
- package/dist/features/game/meta/gameMeta.d.ts.map +1 -0
- package/dist/features/game/meta/gameMeta.js +113 -0
- package/dist/features/game/meta/gameMeta.js.map +1 -0
- package/dist/features/game/meta/gameOverlayMeta.d.ts +55 -0
- package/dist/features/game/meta/gameOverlayMeta.d.ts.map +1 -0
- package/dist/features/game/meta/gameOverlayMeta.js +65 -0
- package/dist/features/game/meta/gameOverlayMeta.js.map +1 -0
- package/dist/features/game/public.d.ts +8 -0
- package/dist/features/game/public.d.ts.map +1 -0
- package/dist/features/game/public.js +7 -0
- package/dist/features/game/public.js.map +1 -0
- package/dist/features/game/utils/clampGamePercentage.d.ts +3 -0
- package/dist/features/game/utils/clampGamePercentage.d.ts.map +1 -0
- package/dist/features/game/utils/clampGamePercentage.js +5 -0
- package/dist/features/game/utils/clampGamePercentage.js.map +1 -0
- package/dist/features/game/utils/resolveGameEntityMotionPlan.d.ts +15 -0
- package/dist/features/game/utils/resolveGameEntityMotionPlan.d.ts.map +1 -0
- package/dist/features/game/utils/resolveGameEntityMotionPlan.js +31 -0
- package/dist/features/game/utils/resolveGameEntityMotionPlan.js.map +1 -0
- package/dist/features/game/utils/toGamePercentage.d.ts +3 -0
- package/dist/features/game/utils/toGamePercentage.d.ts.map +1 -0
- package/dist/features/game/utils/toGamePercentage.js +6 -0
- package/dist/features/game/utils/toGamePercentage.js.map +1 -0
- package/dist/features/game/utils/useAnimatedGameEntityValue.d.ts +5 -0
- package/dist/features/game/utils/useAnimatedGameEntityValue.d.ts.map +1 -0
- package/dist/features/game/utils/useAnimatedGameEntityValue.js +33 -0
- package/dist/features/game/utils/useAnimatedGameEntityValue.js.map +1 -0
- package/dist/features/game/utils/useGameEntityAnimatedStyle.d.ts +16 -0
- package/dist/features/game/utils/useGameEntityAnimatedStyle.d.ts.map +1 -0
- package/dist/features/game/utils/useGameEntityAnimatedStyle.js +52 -0
- package/dist/features/game/utils/useGameEntityAnimatedStyle.js.map +1 -0
- package/dist/features/game/utils/useGameEntityMeasurement.d.ts +5 -0
- package/dist/features/game/utils/useGameEntityMeasurement.d.ts.map +1 -0
- package/dist/features/game/utils/useGameEntityMeasurement.js +14 -0
- package/dist/features/game/utils/useGameEntityMeasurement.js.map +1 -0
- package/dist/features/game/utils/useGameEntityMotionProgress.d.ts +5 -0
- package/dist/features/game/utils/useGameEntityMotionProgress.d.ts.map +1 -0
- package/dist/features/game/utils/useGameEntityMotionProgress.js +87 -0
- package/dist/features/game/utils/useGameEntityMotionProgress.js.map +1 -0
- package/dist/features/game/utils/useGameReducedMotion.d.ts +3 -0
- package/dist/features/game/utils/useGameReducedMotion.d.ts.map +1 -0
- package/dist/features/game/utils/useGameReducedMotion.js +13 -0
- package/dist/features/game/utils/useGameReducedMotion.js.map +1 -0
- package/dist/features/graph-view/adapters/inbound/web-artifact/GraphView.d.ts +5 -5
- package/dist/features/graph-view/adapters/inbound/web-artifact/GraphView.js +5 -5
- package/dist/features/graph-view/adapters/inbound/web-artifact/GraphView.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.js +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphController.js +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphController.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphLoopSizer.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphLoopSizer.js +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphLoopSizer.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.js +7 -7
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphGeometryKey.d.ts +0 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphGeometryKey.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphGeometryKey.js +0 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphGeometryKey.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphTopologyKey.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphTopologyKey.js +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphTopologyKey.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/hasGraphLayoutChanged.d.ts +0 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/hasGraphLayoutChanged.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/hasGraphLayoutChanged.js +0 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/hasGraphLayoutChanged.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/runDetachedGraphLayout.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/runDetachedGraphLayout.js +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/runDetachedGraphLayout.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/sizeGraphNodesToLabels.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/sizeGraphNodesToLabels.js +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/sizeGraphNodesToLabels.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.d.ts +0 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.js +0 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.js.map +1 -1
- package/dist/features/layout/gridMeta.d.ts +1 -1
- package/dist/features/layout/gridMeta.d.ts.map +1 -1
- package/dist/features/layout/gridMeta.js +7 -2
- package/dist/features/layout/gridMeta.js.map +1 -1
- package/dist/features/layout/screenMeta.d.ts +1 -1
- package/dist/features/layout/viewMeta.d.ts +1 -1
- package/dist/features/layout/viewMeta.d.ts.map +1 -1
- package/dist/features/layout/viewMeta.js +6 -2
- package/dist/features/layout/viewMeta.js.map +1 -1
- package/dist/features/registry/ZORA_COMPONENT_REGISTRY.d.ts.map +1 -1
- package/dist/features/registry/ZORA_COMPONENT_REGISTRY.js +16 -0
- package/dist/features/registry/ZORA_COMPONENT_REGISTRY.js.map +1 -1
- package/dist/features/section/screenSectionMeta.d.ts +1 -1
- package/dist/features/tabletop/adapters/inbound/CardBack.d.ts +5 -0
- package/dist/features/tabletop/adapters/inbound/CardBack.d.ts.map +1 -0
- package/dist/features/tabletop/adapters/inbound/CardBack.js +47 -0
- package/dist/features/tabletop/adapters/inbound/CardBack.js.map +1 -0
- package/dist/features/tabletop/adapters/inbound/CardHand.d.ts +5 -0
- package/dist/features/tabletop/adapters/inbound/CardHand.d.ts.map +1 -0
- package/dist/features/tabletop/adapters/inbound/CardHand.js +28 -0
- package/dist/features/tabletop/adapters/inbound/CardHand.js.map +1 -0
- package/dist/features/tabletop/adapters/inbound/PlayingCard.d.ts +5 -0
- package/dist/features/tabletop/adapters/inbound/PlayingCard.d.ts.map +1 -0
- package/dist/features/tabletop/adapters/inbound/PlayingCard.js +64 -0
- package/dist/features/tabletop/adapters/inbound/PlayingCard.js.map +1 -0
- package/dist/features/tabletop/adapters/inbound/PokerTrainingTable.d.ts +5 -0
- package/dist/features/tabletop/adapters/inbound/PokerTrainingTable.d.ts.map +1 -0
- package/dist/features/tabletop/adapters/inbound/PokerTrainingTable.js +12 -0
- package/dist/features/tabletop/adapters/inbound/PokerTrainingTable.js.map +1 -0
- package/dist/features/tabletop/adapters/inbound/TabletopTable.d.ts +5 -0
- package/dist/features/tabletop/adapters/inbound/TabletopTable.d.ts.map +1 -0
- package/dist/features/tabletop/adapters/inbound/TabletopTable.js +206 -0
- package/dist/features/tabletop/adapters/inbound/TabletopTable.js.map +1 -0
- package/dist/features/tabletop/meta.d.ts +353 -0
- package/dist/features/tabletop/meta.d.ts.map +1 -0
- package/dist/features/tabletop/meta.js +252 -0
- package/dist/features/tabletop/meta.js.map +1 -0
- package/dist/features/tabletop/public.d.ts +10 -0
- package/dist/features/tabletop/public.d.ts.map +1 -0
- package/dist/features/tabletop/public.js +9 -0
- package/dist/features/tabletop/public.js.map +1 -0
- package/dist/features/tabletop/utils/createPokerTrainingTableState.d.ts +13 -0
- package/dist/features/tabletop/utils/createPokerTrainingTableState.d.ts.map +1 -0
- package/dist/features/tabletop/utils/createPokerTrainingTableState.js +112 -0
- package/dist/features/tabletop/utils/createPokerTrainingTableState.js.map +1 -0
- package/dist/features/tabletop/utils/createTabletopColorScheme.d.ts +36 -0
- package/dist/features/tabletop/utils/createTabletopColorScheme.d.ts.map +1 -0
- package/dist/features/tabletop/utils/createTabletopColorScheme.js +144 -0
- package/dist/features/tabletop/utils/createTabletopColorScheme.js.map +1 -0
- package/dist/features/tabletop/utils/createTabletopGameSeats.d.ts +13 -0
- package/dist/features/tabletop/utils/createTabletopGameSeats.d.ts.map +1 -0
- package/dist/features/tabletop/utils/createTabletopGameSeats.js +22 -0
- package/dist/features/tabletop/utils/createTabletopGameSeats.js.map +1 -0
- package/dist/features/tabletop/utils/getPlayingCardLabel.d.ts +4 -0
- package/dist/features/tabletop/utils/getPlayingCardLabel.d.ts.map +1 -0
- package/dist/features/tabletop/utils/getPlayingCardLabel.js +6 -0
- package/dist/features/tabletop/utils/getPlayingCardLabel.js.map +1 -0
- package/dist/features/tabletop/utils/getTabletopCardDimensions.d.ts +12 -0
- package/dist/features/tabletop/utils/getTabletopCardDimensions.d.ts.map +1 -0
- package/dist/features/tabletop/utils/getTabletopCardDimensions.js +35 -0
- package/dist/features/tabletop/utils/getTabletopCardDimensions.js.map +1 -0
- package/dist/features/tabletop/utils/getTabletopSeatPosition.d.ts +9 -0
- package/dist/features/tabletop/utils/getTabletopSeatPosition.d.ts.map +1 -0
- package/dist/features/tabletop/utils/getTabletopSeatPosition.js +88 -0
- package/dist/features/tabletop/utils/getTabletopSeatPosition.js.map +1 -0
- package/dist/features/tree-view/adapters/inbound/TreeView.d.ts +1 -1
- package/dist/features/tree-view/adapters/inbound/TreeView.js +1 -1
- package/dist/features/tree-view/adapters/inbound/TreeView.js.map +1 -1
- package/dist/features/tree-view/adapters/inbound/web-artifact/TreeView.d.ts +1 -1
- package/dist/features/tree-view/adapters/inbound/web-artifact/TreeView.js +1 -1
- package/dist/features/tree-view/adapters/inbound/web-artifact/TreeView.js.map +1 -1
- package/dist/features/typography/adapters/inbound/Heading.d.ts +0 -4
- package/dist/features/typography/adapters/inbound/Heading.d.ts.map +1 -1
- package/dist/features/typography/adapters/inbound/Heading.js +0 -4
- package/dist/features/typography/adapters/inbound/Heading.js.map +1 -1
- package/dist/features/typography/adapters/inbound/Text.d.ts +0 -4
- package/dist/features/typography/adapters/inbound/Text.d.ts.map +1 -1
- package/dist/features/typography/adapters/inbound/Text.js +0 -4
- package/dist/features/typography/adapters/inbound/Text.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/types/chess.d.ts +83 -0
- package/dist/types/chess.d.ts.map +1 -0
- package/dist/types/chess.js +2 -0
- package/dist/types/chess.js.map +1 -0
- package/dist/types/gamePresentation.d.ts +94 -0
- package/dist/types/gamePresentation.d.ts.map +1 -0
- package/dist/types/gamePresentation.js +2 -0
- package/dist/types/gamePresentation.js.map +1 -0
- package/dist/types/gameRuntime.d.ts +29 -0
- package/dist/types/gameRuntime.d.ts.map +1 -0
- package/dist/types/gameRuntime.js +2 -0
- package/dist/types/gameRuntime.js.map +1 -0
- package/dist/types/tabletop.d.ts +129 -0
- package/dist/types/tabletop.d.ts.map +1 -0
- package/dist/types/tabletop.js +2 -0
- package/dist/types/tabletop.js.map +1 -0
- package/package.json +6 -7
- package/src/features/authoring/allowedChildren.ts +15 -2
- package/src/features/authoring/componentMeta.test.ts +93 -0
- package/src/features/authoring/componentMeta.ts +27 -0
- package/src/features/authoring/constants.ts +3 -0
- package/src/features/button/adapters/inbound/Button.tsx +0 -4
- package/src/features/card/adapters/inbound/Card.tsx +0 -4
- package/src/features/card/cardMeta.ts +12 -2
- package/src/features/chess/adapters/inbound/ChessBoard.tsx +169 -0
- package/src/features/chess/adapters/inbound/OpeningBook.tsx +131 -0
- package/src/features/chess/meta.ts +168 -0
- package/src/features/chess/public.test.tsx +165 -0
- package/src/features/chess/public.ts +27 -0
- package/src/features/chess/utils/chessSquares.ts +6 -0
- package/src/features/chess/utils/createBoardSquares.ts +13 -0
- package/src/features/chess/utils/createChessBoardColorScheme.ts +55 -0
- package/src/features/chess/utils/createOpeningBookColorScheme.ts +26 -0
- package/src/features/chess/utils/getSquareFile.ts +6 -0
- package/src/features/chess/utils/getSquareRank.ts +6 -0
- package/src/features/chess/utils/isLightSquare.ts +8 -0
- package/src/features/chessTabletopOwnership.test.ts +71 -0
- package/src/features/empty-state/adapters/inbound/EmptyState.tsx +0 -4
- package/src/features/form/text-input/adapters/inbound/TextInput.tsx +0 -4
- package/src/features/game/adapters/inbound/Game.tsx +43 -0
- package/src/features/game/adapters/inbound/GameEntity.tsx +44 -0
- package/src/features/game/adapters/inbound/GameField.tsx +52 -0
- package/src/features/game/adapters/inbound/GameInputZone.tsx +99 -0
- package/src/features/game/adapters/inbound/GameMeasurementProbe.tsx +83 -0
- package/src/features/game/adapters/inbound/GameOverlay.tsx +58 -0
- package/src/features/game/adapters/inbound/createGameKeyboardEvent.test.ts +51 -0
- package/src/features/game/adapters/inbound/createGameKeyboardEvent.ts +33 -0
- package/src/features/game/adapters/inbound/createGameMeasurementEvent.test.ts +56 -0
- package/src/features/game/adapters/inbound/createGameMeasurementEvent.ts +38 -0
- package/src/features/game/adapters/inbound/createGamePointerEvent.test.ts +56 -0
- package/src/features/game/adapters/inbound/createGamePointerEvent.ts +39 -0
- package/src/features/game/adapters/inbound/measureGameEntity.ts +28 -0
- package/src/features/game/adapters/inbound/useGameInputZoneResponder.ts +85 -0
- package/src/features/game/composition/GameRuntimeContext.ts +6 -0
- package/src/features/game/composition/createGameBindingContext.test.ts +66 -0
- package/src/features/game/composition/createGameBindingContext.ts +11 -0
- package/src/features/game/composition/createGameMeasurementRegistry.test.ts +35 -0
- package/src/features/game/composition/createGameMeasurementRegistry.ts +16 -0
- package/src/features/game/composition/useGameRuntime.test.tsx +173 -0
- package/src/features/game/composition/useGameRuntime.ts +200 -0
- package/src/features/game/composition/useGameScheduledEffects.ts +85 -0
- package/src/features/game/meta/gameEntityMeta.ts +226 -0
- package/src/features/game/meta/gameFieldMeta.ts +49 -0
- package/src/features/game/meta/gameInputZoneMeta.ts +140 -0
- package/src/features/game/meta/gameMeasurementProbeMeta.ts +72 -0
- package/src/features/game/meta/gameMeta.ts +115 -0
- package/src/features/game/meta/gameOverlayMeta.ts +66 -0
- package/src/features/game/public.test.tsx +64 -0
- package/src/features/game/public.ts +19 -0
- package/src/features/game/utils/clampGamePercentage.ts +4 -0
- package/src/features/game/utils/resolveGameEntityMotionPlan.test.ts +63 -0
- package/src/features/game/utils/resolveGameEntityMotionPlan.ts +53 -0
- package/src/features/game/utils/toGamePercentage.ts +6 -0
- package/src/features/game/utils/useAnimatedGameEntityValue.ts +41 -0
- package/src/features/game/utils/useGameEntityAnimatedStyle.ts +87 -0
- package/src/features/game/utils/useGameEntityMeasurement.ts +19 -0
- package/src/features/game/utils/useGameEntityMotionProgress.ts +114 -0
- package/src/features/game/utils/useGameReducedMotion.ts +15 -0
- package/src/features/graph-view/adapters/inbound/web-artifact/GraphView.tsx +5 -5
- package/src/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/createGraphController.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/createGraphLoopSizer.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.ts +7 -7
- package/src/features/graph-view/adapters/inbound/web-artifact/getGraphGeometryKey.ts +0 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/getGraphTopologyKey.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/hasGraphLayoutChanged.ts +0 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/runDetachedGraphLayout.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/sizeGraphNodesToLabels.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.ts +0 -1
- package/src/features/layout/gridMeta.ts +12 -2
- package/src/features/layout/viewMeta.ts +10 -2
- package/src/features/registry/ZORA_COMPONENT_REGISTRY.ts +29 -0
- package/src/features/tabletop/adapters/inbound/CardBack.tsx +70 -0
- package/src/features/tabletop/adapters/inbound/CardHand.tsx +61 -0
- package/src/features/tabletop/adapters/inbound/PlayingCard.tsx +95 -0
- package/src/features/tabletop/adapters/inbound/PokerTrainingTable.tsx +34 -0
- package/src/features/tabletop/adapters/inbound/TabletopTable.tsx +264 -0
- package/src/features/tabletop/meta.ts +254 -0
- package/src/features/tabletop/public.test.tsx +127 -0
- package/src/features/tabletop/public.ts +32 -0
- package/src/features/tabletop/utils/createPokerTrainingTableState.ts +152 -0
- package/src/features/tabletop/utils/createTabletopColorScheme.ts +232 -0
- package/src/features/tabletop/utils/createTabletopGameSeats.ts +31 -0
- package/src/features/tabletop/utils/getPlayingCardLabel.ts +8 -0
- package/src/features/tabletop/utils/getTabletopCardDimensions.ts +45 -0
- package/src/features/tabletop/utils/getTabletopSeatPosition.ts +100 -0
- package/src/features/tree-view/adapters/inbound/TreeView.tsx +1 -1
- package/src/features/tree-view/adapters/inbound/web-artifact/TreeView.tsx +1 -1
- package/src/features/typography/adapters/inbound/Heading.tsx +0 -4
- package/src/features/typography/adapters/inbound/Text.tsx +0 -4
- package/src/index.ts +83 -0
- package/src/types/chess.ts +95 -0
- package/src/types/gamePresentation.ts +103 -0
- package/src/types/gameRuntime.ts +34 -0
- package/src/types/tabletop.ts +131 -0
- package/web-dist/chunks/{Accordion-cscmtcn8.js → Accordion-0txegc16.js} +1 -1
- package/web-dist/chunks/{Accordion-06588rzn.js → Accordion-10xw59gm.js} +1 -1
- package/web-dist/chunks/{Accordion-8kgtg62g.js → Accordion-2zh15wt9.js} +6 -6
- package/web-dist/chunks/{Accordion-pkqj4g3r.js → Accordion-481bknsd.js} +5 -5
- package/web-dist/chunks/{Accordion-grfbz6f2.js → Accordion-4fkjn6r5.js} +1 -1
- package/web-dist/chunks/{Accordion-ftjkdjqs.js → Accordion-4gx45mn0.js} +3 -3
- package/web-dist/chunks/{Accordion-fjnck2tg.js → Accordion-4s69xvqy.js} +6 -6
- package/web-dist/chunks/{Accordion-jh7nxehr.js → Accordion-50jz5nhg.js} +1 -1
- package/web-dist/chunks/{Accordion-t6sdgmbz.js → Accordion-52xke54s.js} +1 -1
- package/web-dist/chunks/{Accordion-far6szrp.js → Accordion-6npzmbgk.js} +5 -5
- package/web-dist/chunks/{Accordion-q7c1ryf2.js → Accordion-6z4npcgf.js} +4 -4
- package/web-dist/chunks/{Accordion-gbba10rg.js → Accordion-8gw5tkfw.js} +6 -6
- package/web-dist/chunks/{Accordion-fmxygyb6.js → Accordion-8qteyww0.js} +4 -4
- package/web-dist/chunks/{Accordion-1pp37dtg.js → Accordion-9h5dx3ck.js} +4 -4
- package/web-dist/chunks/{Accordion-paha5aje.js → Accordion-9mmqf3wr.js} +2 -2
- package/web-dist/chunks/{Accordion-f5swy5bs.js → Accordion-b21zrnzj.js} +1 -1
- package/web-dist/chunks/{Accordion-ars389m1.js → Accordion-b8qd23hr.js} +3 -3
- package/web-dist/chunks/{Accordion-hxfa71g9.js → Accordion-c79y8g44.js} +7 -7
- package/web-dist/chunks/Accordion-ca2csh5r.js +321 -0
- package/web-dist/chunks/{Accordion-49gf1zb8.js → Accordion-cjht9dyv.js} +1 -1
- package/web-dist/chunks/{Accordion-sz21xsf4.js → Accordion-cq6hn45r.js} +1 -1
- package/web-dist/chunks/{Accordion-33rd76r7.js → Accordion-d90g9wcb.js} +8 -8
- package/web-dist/chunks/{Accordion-crx58d5n.js → Accordion-f5jb299b.js} +2 -2
- package/web-dist/chunks/{Accordion-h95wvyn5.js → Accordion-fe6vmbpf.js} +2 -2
- package/web-dist/chunks/{Accordion-jzbq36ec.js → Accordion-fqm027n3.js} +8 -8
- package/web-dist/chunks/{Accordion-0jkm3y3w.js → Accordion-gpccarct.js} +1 -1
- package/web-dist/chunks/{Accordion-v6ykq9hv.js → Accordion-h95h3xdb.js} +10 -10
- package/web-dist/chunks/{Accordion-t3p4ykg7.js → Accordion-j8ab9k8k.js} +8 -8
- package/web-dist/chunks/{Accordion-qpwhmqzd.js → Accordion-k5z591wx.js} +13 -13
- package/web-dist/chunks/{Accordion-rrpej6sv.js → Accordion-kdncjvc7.js} +7 -7
- package/web-dist/chunks/{Accordion-f05a7r28.js → Accordion-ks4a1c6w.js} +5 -5
- package/web-dist/chunks/{Accordion-x0j8b2by.js → Accordion-ma1sfe5z.js} +5 -5
- package/web-dist/chunks/{Accordion-2dws3778.js → Accordion-mhtyce1k.js} +4 -4
- package/web-dist/chunks/{Accordion-1vewf8aa.js → Accordion-n7gtb5ec.js} +2 -2
- package/web-dist/chunks/{Accordion-0psdn97s.js → Accordion-p42mm8rr.js} +1 -1
- package/web-dist/chunks/{Accordion-3404tth9.js → Accordion-panw5f0q.js} +7 -7
- package/web-dist/chunks/{Accordion-4a6wj3ez.js → Accordion-pxq8gfgg.js} +9 -9
- package/web-dist/chunks/{Accordion-xshn7k8f.js → Accordion-qwbshc4s.js} +4 -4
- package/web-dist/chunks/{Accordion-395r3wra.js → Accordion-r51wsmvy.js} +2 -2
- package/web-dist/chunks/Accordion-rt13cqr7.js +830 -0
- package/web-dist/chunks/{Accordion-hz4xaqjf.js → Accordion-s1f9hb5a.js} +9 -9
- package/web-dist/chunks/{Accordion-7ja4mtbz.js → Accordion-sv87mbqa.js} +1 -1
- package/web-dist/chunks/{Accordion-r4c9k9y7.js → Accordion-t4k9egq6.js} +2 -2
- package/web-dist/chunks/{Accordion-96cqeekv.js → Accordion-t64m1kca.js} +5 -5
- package/web-dist/chunks/Accordion-wg31jkvp.js +1559 -0
- package/web-dist/chunks/{Accordion-ch67q4t0.js → Accordion-y9zr4x2x.js} +4 -4
- package/web-dist/chunks/{Accordion-31aeqxak.js → Accordion-ye3k55r7.js} +3 -3
- package/web-dist/chunks/{Accordion-s42wwh6m.js → Accordion-z29agann.js} +6 -6
- package/web-dist/chunks/{Accordion-f1h2f05v.js → Accordion-ze26effy.js} +5 -5
- package/web-dist/chunks/{Accordion-tx78txec.js → Accordion-zqzcagxz.js} +5 -5
- package/web-dist/components/accordion/Accordion.js +12 -12
- package/web-dist/components/accordion-item/AccordionItem.js +12 -12
- package/web-dist/components/activity-indicator/ActivityIndicator.js +3 -3
- package/web-dist/components/app-bar/AppBar.js +19 -19
- package/web-dist/components/app-shell/AppShell.js +6 -6
- package/web-dist/components/avatar/Avatar.js +12 -12
- package/web-dist/components/avatar-group/AvatarGroup.js +12 -12
- package/web-dist/components/badge/Badge.js +7 -7
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +20 -20
- package/web-dist/components/bottom-sheet/BottomSheet.js +8 -8
- package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +8 -8
- package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +8 -8
- package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +8 -8
- package/web-dist/components/bottom-sheet-view/BottomSheetView.js +8 -8
- package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +8 -8
- package/web-dist/components/breadcrumbs/Breadcrumbs.js +15 -15
- package/web-dist/components/button/Button.js +12 -12
- package/web-dist/components/button-group/ButtonGroup.js +12 -12
- package/web-dist/components/camera-permission-view/CameraPermissionView.js +20 -20
- package/web-dist/components/card/Card.js +19 -19
- package/web-dist/components/card-back/CardBack.d.ts +7 -0
- package/web-dist/components/card-back/CardBack.js +19 -0
- package/web-dist/components/card-back/index.d.ts +1 -0
- package/web-dist/components/card-back/index.js +2 -0
- package/web-dist/components/card-hand/CardHand.d.ts +7 -0
- package/web-dist/components/card-hand/CardHand.js +19 -0
- package/web-dist/components/card-hand/index.d.ts +1 -0
- package/web-dist/components/card-hand/index.js +2 -0
- package/web-dist/components/chat-list-item/ChatListItem.js +16 -16
- package/web-dist/components/checkbox/Checkbox.js +12 -12
- package/web-dist/components/checkbox-group/CheckboxGroup.js +12 -12
- package/web-dist/components/chess-board/ChessBoard.d.ts +4 -0
- package/web-dist/components/chess-board/ChessBoard.js +13 -0
- package/web-dist/components/chess-board/index.d.ts +1 -0
- package/web-dist/components/chess-board/index.js +2 -0
- package/web-dist/components/chip/Chip.js +13 -13
- package/web-dist/components/chip-group/ChipGroup.js +13 -13
- package/web-dist/components/collection-editor/CollectionEditor.js +19 -19
- package/web-dist/components/content-rail/ContentRail.js +13 -13
- package/web-dist/components/data-table/DataTable.js +26 -26
- package/web-dist/components/date-picker/DatePicker.js +17 -17
- package/web-dist/components/dialog/Dialog.js +12 -12
- package/web-dist/components/divider/Divider.js +6 -6
- package/web-dist/components/empty-state/EmptyState.js +20 -20
- package/web-dist/components/field/Field.js +12 -12
- package/web-dist/components/flat-list/FlatList.js +13 -13
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +18 -18
- package/web-dist/components/form/Form.js +16 -16
- package/web-dist/components/form-actions/FormActions.js +16 -16
- package/web-dist/components/form-error/FormError.js +16 -16
- package/web-dist/components/game/Game.d.ts +8 -0
- package/web-dist/components/game/Game.js +25 -0
- package/web-dist/components/game/index.d.ts +1 -0
- package/web-dist/components/game/index.js +2 -0
- package/web-dist/components/game-entity/GameEntity.d.ts +8 -0
- package/web-dist/components/game-entity/GameEntity.js +25 -0
- package/web-dist/components/game-entity/index.d.ts +1 -0
- package/web-dist/components/game-entity/index.js +2 -0
- package/web-dist/components/game-field/GameField.d.ts +8 -0
- package/web-dist/components/game-field/GameField.js +25 -0
- package/web-dist/components/game-field/index.d.ts +1 -0
- package/web-dist/components/game-field/index.js +2 -0
- package/web-dist/components/game-input-zone/GameInputZone.d.ts +8 -0
- package/web-dist/components/game-input-zone/GameInputZone.js +25 -0
- package/web-dist/components/game-input-zone/index.d.ts +1 -0
- package/web-dist/components/game-input-zone/index.js +2 -0
- package/web-dist/components/game-measurement-probe/GameMeasurementProbe.d.ts +8 -0
- package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +25 -0
- package/web-dist/components/game-measurement-probe/index.d.ts +1 -0
- package/web-dist/components/game-measurement-probe/index.js +2 -0
- package/web-dist/components/game-overlay/GameOverlay.d.ts +8 -0
- package/web-dist/components/game-overlay/GameOverlay.js +25 -0
- package/web-dist/components/game-overlay/index.d.ts +1 -0
- package/web-dist/components/game-overlay/index.js +2 -0
- package/web-dist/components/gradient/Gradient.js +7 -7
- package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +7 -7
- package/web-dist/components/graph-view/GraphView.d.ts +5 -5
- package/web-dist/components/grid/Grid.js +6 -6
- package/web-dist/components/heading/Heading.js +6 -6
- package/web-dist/components/hero/Hero.js +19 -19
- package/web-dist/components/icon/Icon.js +4 -4
- package/web-dist/components/icon-button/IconButton.js +12 -12
- package/web-dist/components/image/Image.js +10 -10
- package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +2 -2
- package/web-dist/components/list/List.js +13 -13
- package/web-dist/components/list-item/ListItem.js +13 -13
- package/web-dist/components/list-section/ListSection.js +13 -13
- package/web-dist/components/media-card/MediaCard.js +19 -19
- package/web-dist/components/message-bubble/MessageBubble.js +16 -16
- package/web-dist/components/metric-card/MetricCard.js +19 -19
- package/web-dist/components/missing-element/MissingElement.js +11 -11
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +18 -18
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +18 -18
- package/web-dist/components/opening-book/OpeningBook.d.ts +4 -0
- package/web-dist/components/opening-book/OpeningBook.js +13 -0
- package/web-dist/components/opening-book/index.d.ts +1 -0
- package/web-dist/components/opening-book/index.js +2 -0
- package/web-dist/components/otp-form/OtpForm.js +18 -18
- package/web-dist/components/pagination/Pagination.js +13 -13
- package/web-dist/components/palette-item/PaletteItem.js +19 -19
- package/web-dist/components/playing-card/PlayingCard.d.ts +7 -0
- package/web-dist/components/playing-card/PlayingCard.js +19 -0
- package/web-dist/components/playing-card/index.d.ts +1 -0
- package/web-dist/components/playing-card/index.js +2 -0
- package/web-dist/components/poker-training-table/PokerTrainingTable.d.ts +7 -0
- package/web-dist/components/poker-training-table/PokerTrainingTable.js +19 -0
- package/web-dist/components/poker-training-table/index.d.ts +1 -0
- package/web-dist/components/poker-training-table/index.js +2 -0
- package/web-dist/components/popover-menu/PopoverMenu.js +14 -14
- package/web-dist/components/post-card/PostCard.js +19 -19
- package/web-dist/components/product-card/ProductCard.js +19 -19
- package/web-dist/components/progress/Progress.js +10 -10
- package/web-dist/components/progress-ring/ProgressRing.js +10 -10
- package/web-dist/components/radio/Radio.js +14 -14
- package/web-dist/components/radio-group/RadioGroup.js +14 -14
- package/web-dist/components/rating/Rating.js +9 -9
- package/web-dist/components/reader-surface/ReaderSurface.js +21 -21
- package/web-dist/components/scan-overlay/ScanOverlay.js +20 -20
- package/web-dist/components/screen/Screen.js +6 -6
- package/web-dist/components/screen-section/ScreenSection.js +10 -10
- package/web-dist/components/scroll-view/ScrollView.js +6 -6
- package/web-dist/components/search-input/SearchInput.js +13 -13
- package/web-dist/components/section-header/SectionHeader.js +10 -10
- package/web-dist/components/section-list/SectionList.js +13 -13
- package/web-dist/components/select/Select.js +16 -16
- package/web-dist/components/selectable-item/SelectableItem.js +5 -5
- package/web-dist/components/selection-provider/SelectionProvider.js +5 -5
- package/web-dist/components/sign-in-form/SignInForm.js +18 -18
- package/web-dist/components/sign-up-form/SignUpForm.js +18 -18
- package/web-dist/components/skeleton/Skeleton.js +22 -22
- package/web-dist/components/skeleton-card/SkeletonCard.js +22 -22
- package/web-dist/components/skeleton-list/SkeletonList.js +22 -22
- package/web-dist/components/skeleton-text/SkeletonText.js +22 -22
- package/web-dist/components/surface/Surface.js +7 -7
- package/web-dist/components/switch/Switch.js +7 -7
- package/web-dist/components/tab/Tab.js +7 -7
- package/web-dist/components/tab-list/TabList.js +7 -7
- package/web-dist/components/tab-panel/TabPanel.js +7 -7
- package/web-dist/components/tabletop-table/TabletopTable.d.ts +7 -0
- package/web-dist/components/tabletop-table/TabletopTable.js +19 -0
- package/web-dist/components/tabletop-table/index.d.ts +1 -0
- package/web-dist/components/tabletop-table/index.js +2 -0
- package/web-dist/components/tabs/Tabs.js +7 -7
- package/web-dist/components/text/Text.js +6 -6
- package/web-dist/components/text-input/TextInput.js +13 -13
- package/web-dist/components/time-picker/TimePicker.js +17 -17
- package/web-dist/components/timeline/Timeline.js +11 -11
- package/web-dist/components/toast/Toast.js +9 -9
- package/web-dist/components/toast-provider/ToastProvider.js +9 -9
- package/web-dist/components/toolbar/Toolbar.js +19 -19
- package/web-dist/components/tree-item/TreeItem.js +16 -16
- package/web-dist/components/tree-view/TreeView.d.ts +1 -1
- package/web-dist/components/uploader/Uploader.js +22 -22
- package/web-dist/components/view/View.js +6 -6
- package/web-dist/manifest.json +1650 -1379
- package/web-dist/runtime/ZoraProvider.js +8 -8
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CreatePokerTrainingTableStateOptions, PokerTrainingTableState, PokerTrainingTaskTableData } from '../../../types/tabletop';
|
|
2
|
+
/***
|
|
3
|
+
* Adapts the table-relevant subset of a poker training task to generic tabletop presentation state.
|
|
4
|
+
*
|
|
5
|
+
* The canonical poker ring for the task table size is rotated so the hero occupies the first
|
|
6
|
+
* (bottom) tabletop seat. Players omitted by the task are reconstructed as folded with the
|
|
7
|
+
* configured default stack.
|
|
8
|
+
*
|
|
9
|
+
* Accepts serializable poker training task data plus presentation defaults for omitted fields and
|
|
10
|
+
* returns seats and shared-table content ready for `TabletopTable`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createPokerTrainingTableState(task: PokerTrainingTaskTableData, { defaultStackBigBlinds }?: CreatePokerTrainingTableStateOptions): PokerTrainingTableState;
|
|
13
|
+
//# sourceMappingURL=createPokerTrainingTableState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPokerTrainingTableState.d.ts","sourceRoot":"","sources":["../../../../src/features/tabletop/utils/createPokerTrainingTableState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oCAAoC,EAGpC,uBAAuB,EACvB,0BAA0B,EAE3B,MAAM,yBAAyB,CAAC;AAGjC;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,0BAA0B,EAChC,EAAE,qBAA2B,EAAE,GAAE,oCAAyC,GACzE,uBAAuB,CAqCzB"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { createTabletopGameSeats } from './createTabletopGameSeats';
|
|
2
|
+
/***
|
|
3
|
+
* Adapts the table-relevant subset of a poker training task to generic tabletop presentation state.
|
|
4
|
+
*
|
|
5
|
+
* The canonical poker ring for the task table size is rotated so the hero occupies the first
|
|
6
|
+
* (bottom) tabletop seat. Players omitted by the task are reconstructed as folded with the
|
|
7
|
+
* configured default stack.
|
|
8
|
+
*
|
|
9
|
+
* Accepts serializable poker training task data plus presentation defaults for omitted fields and
|
|
10
|
+
* returns seats and shared-table content ready for `TabletopTable`.
|
|
11
|
+
*/
|
|
12
|
+
export function createPokerTrainingTableState(task, { defaultStackBigBlinds = 100 } = {}) {
|
|
13
|
+
const tableSize = task.tableSize ?? '9max';
|
|
14
|
+
const positions = tableSize === '6max' ? sixMaxPokerPositions : nineMaxPokerPositions;
|
|
15
|
+
const bigBlind = task.blinds?.big;
|
|
16
|
+
const heroPosition = task.heroPosition ?? task.players?.find((player) => player.isHero)?.position;
|
|
17
|
+
const orderedPositions = rotatePokerPositions(positions, heroPosition);
|
|
18
|
+
const defaultStack = `${formatAmount(defaultStackBigBlinds)} BB`;
|
|
19
|
+
const participants = (task.players ?? []).map((player) => createPokerParticipantState(player, task, bigBlind));
|
|
20
|
+
const seats = createTabletopGameSeats({
|
|
21
|
+
seats: orderedPositions.map((position) => ({
|
|
22
|
+
id: position,
|
|
23
|
+
defaultState: {
|
|
24
|
+
label: position,
|
|
25
|
+
tokenLabel: position === 'BTN' ? 'D' : undefined,
|
|
26
|
+
},
|
|
27
|
+
})),
|
|
28
|
+
participants,
|
|
29
|
+
missingParticipantState: {
|
|
30
|
+
disabled: true,
|
|
31
|
+
muted: true,
|
|
32
|
+
sublabel: `${defaultStack} · Folded`,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
return {
|
|
36
|
+
seatCount: positions.length,
|
|
37
|
+
seats,
|
|
38
|
+
centerCards: task.communityCards ?? [],
|
|
39
|
+
centerLabel: task.pot === undefined ? undefined : `Pot ${formatAmount(task.pot)}`,
|
|
40
|
+
centerSublabel: task.blinds === undefined
|
|
41
|
+
? undefined
|
|
42
|
+
: `Blinds ${formatAmount(task.blinds.small)} / ${formatAmount(task.blinds.big)}`,
|
|
43
|
+
accessibilityLabel: createPokerAccessibilityLabel(tableSize, heroPosition, task),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
const sixMaxPokerPositions = ['BTN', 'SB', 'BB', 'UTG', 'HJ', 'CO'];
|
|
47
|
+
const nineMaxPokerPositions = [
|
|
48
|
+
'BTN',
|
|
49
|
+
'SB',
|
|
50
|
+
'BB',
|
|
51
|
+
'UTG',
|
|
52
|
+
'UTG+1',
|
|
53
|
+
'UTG+2',
|
|
54
|
+
'MP',
|
|
55
|
+
'HJ',
|
|
56
|
+
'CO',
|
|
57
|
+
];
|
|
58
|
+
/*** Rotates one canonical poker ring to place the hero at the bottom seat. */
|
|
59
|
+
function rotatePokerPositions(positions, heroPosition) {
|
|
60
|
+
const heroIndex = positions.findIndex((position) => position === heroPosition);
|
|
61
|
+
if (heroIndex <= 0)
|
|
62
|
+
return positions;
|
|
63
|
+
return [...positions.slice(heroIndex), ...positions.slice(0, heroIndex)];
|
|
64
|
+
}
|
|
65
|
+
/*** Converts one poker participant record into a generic seat-state override. */
|
|
66
|
+
function createPokerParticipantState(player, task, bigBlind) {
|
|
67
|
+
const isHero = player.isHero === true || player.position === task.heroPosition;
|
|
68
|
+
const cards = player.cards ?? (isHero ? task.heroCards : undefined);
|
|
69
|
+
const folded = player.folded === true;
|
|
70
|
+
return {
|
|
71
|
+
seatId: player.position,
|
|
72
|
+
state: {
|
|
73
|
+
cards,
|
|
74
|
+
disabled: folded,
|
|
75
|
+
faceDownCards: cards === undefined && !folded && !isHero ? 2 : undefined,
|
|
76
|
+
muted: folded,
|
|
77
|
+
selected: isHero,
|
|
78
|
+
sublabel: formatPlayerSublabel(player, bigBlind),
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/*** Formats stack and optional committed chips as a compact seat sublabel. */
|
|
83
|
+
function formatPlayerSublabel(player, bigBlind) {
|
|
84
|
+
const stack = player.stack === undefined ? undefined : formatChipStack(player.stack, bigBlind);
|
|
85
|
+
const bet = player.bet === undefined ? undefined : `Bet ${formatChipStack(player.bet, bigBlind)}`;
|
|
86
|
+
const parts = [stack, bet, player.folded === true ? 'Folded' : undefined].filter((part) => part !== undefined);
|
|
87
|
+
return parts.length === 0 ? undefined : parts.join(' · ');
|
|
88
|
+
}
|
|
89
|
+
/*** Formats chips as big blinds when a positive blind is known, otherwise as an amount. */
|
|
90
|
+
function formatChipStack(amount, bigBlind) {
|
|
91
|
+
if (bigBlind !== undefined && bigBlind > 0) {
|
|
92
|
+
return `${formatAmount(amount / bigBlind)} BB`;
|
|
93
|
+
}
|
|
94
|
+
return `${formatAmount(amount)} chips`;
|
|
95
|
+
}
|
|
96
|
+
/*** Formats a numeric poker amount consistently across native and web runtimes. */
|
|
97
|
+
function formatAmount(amount) {
|
|
98
|
+
return new Intl.NumberFormat('en-US', { maximumFractionDigits: 2 }).format(amount);
|
|
99
|
+
}
|
|
100
|
+
/*** Summarizes the reconstructed table for assistive technologies. */
|
|
101
|
+
function createPokerAccessibilityLabel(tableSize, heroPosition, task) {
|
|
102
|
+
const parts = [`${tableSize === '6max' ? 'Six' : 'Nine'}-player poker table`];
|
|
103
|
+
if (heroPosition !== undefined)
|
|
104
|
+
parts.push(`Hero ${heroPosition}`);
|
|
105
|
+
if (task.pot !== undefined)
|
|
106
|
+
parts.push(`Pot ${formatAmount(task.pot)}`);
|
|
107
|
+
if (task.blinds !== undefined) {
|
|
108
|
+
parts.push(`Blinds ${formatAmount(task.blinds.small)} / ${formatAmount(task.blinds.big)}`);
|
|
109
|
+
}
|
|
110
|
+
return `${parts.join('. ')}.`;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=createPokerTrainingTableState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPokerTrainingTableState.js","sourceRoot":"","sources":["../../../../src/features/tabletop/utils/createPokerTrainingTableState.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;;;;;;;;GASG;AACH,MAAM,UAAU,6BAA6B,CAC3C,IAAgC,EAChC,EAAE,qBAAqB,GAAG,GAAG,KAA2C,EAAE;IAE1E,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,MAAM,CAAC;IAC3C,MAAM,SAAS,GAAG,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,qBAAqB,CAAC;IACtF,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC;IAClC,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI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AED,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC;AACzC,CAAC;AAED,mFAAmF;AACnF,SAAS,YAAY,CAAC,MAAc;IAClC,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,qBAAqB,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACrF,CAAC;AAED,sEAAsE;AACtE,SAAS,6BAA6B,CACpC,SAAiC,EACjC,YAAgC,EAChC,IAAgC;IAEhC,MAAM,KAAK,GAAG,CAAC,GAAG,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,qBAAqB,CAAC,CAAC;IAC9E,IAAI,YAAY,KAAK,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,YAAY,EAAE,CAAC,CAAC;IACnE,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,OAAO,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACxE,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC9B,KAAK,CAAC,IAAI,CAAC,UAAU,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC7F,CAAC;IAED,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AAChC,CAAC","sourcesContent":["import type {\n CreatePokerTrainingTableStateOptions,\n PokerTrainingPlayer,\n PokerTrainingTableSize,\n PokerTrainingTableState,\n PokerTrainingTaskTableData,\n TabletopGameParticipantState,\n} from '../../../types/tabletop';\nimport { createTabletopGameSeats } from './createTabletopGameSeats';\n\n/***\n * Adapts the table-relevant subset of a poker training task to generic tabletop presentation state.\n *\n * The canonical poker ring for the task table size is rotated so the hero occupies the first\n * (bottom) tabletop seat. Players omitted by the task are reconstructed as folded with the\n * configured default stack.\n *\n * Accepts serializable poker training task data plus presentation defaults for omitted fields and\n * returns seats and shared-table content ready for `TabletopTable`.\n */\nexport function createPokerTrainingTableState(\n task: PokerTrainingTaskTableData,\n { defaultStackBigBlinds = 100 }: CreatePokerTrainingTableStateOptions = {},\n): PokerTrainingTableState {\n const tableSize = task.tableSize ?? '9max';\n const positions = tableSize === '6max' ? sixMaxPokerPositions : nineMaxPokerPositions;\n const bigBlind = task.blinds?.big;\n const heroPosition = task.heroPosition ?? task.players?.find((player) => player.isHero)?.position;\n const orderedPositions = rotatePokerPositions(positions, heroPosition);\n const defaultStack = `${formatAmount(defaultStackBigBlinds)} BB`;\n const participants = (task.players ?? []).map((player) =>\n createPokerParticipantState(player, task, bigBlind),\n );\n const seats = createTabletopGameSeats({\n seats: orderedPositions.map((position) => ({\n id: position,\n defaultState: {\n label: position,\n tokenLabel: position === 'BTN' ? 'D' : undefined,\n },\n })),\n participants,\n missingParticipantState: {\n disabled: true,\n muted: true,\n sublabel: `${defaultStack} · Folded`,\n },\n });\n\n return {\n seatCount: positions.length,\n seats,\n centerCards: task.communityCards ?? [],\n centerLabel: task.pot === undefined ? undefined : `Pot ${formatAmount(task.pot)}`,\n centerSublabel:\n task.blinds === undefined\n ? undefined\n : `Blinds ${formatAmount(task.blinds.small)} / ${formatAmount(task.blinds.big)}`,\n accessibilityLabel: createPokerAccessibilityLabel(tableSize, heroPosition, task),\n };\n}\n\nconst sixMaxPokerPositions = ['BTN', 'SB', 'BB', 'UTG', 'HJ', 'CO'] as const;\nconst nineMaxPokerPositions = [\n 'BTN',\n 'SB',\n 'BB',\n 'UTG',\n 'UTG+1',\n 'UTG+2',\n 'MP',\n 'HJ',\n 'CO',\n] as const;\n\n/*** Rotates one canonical poker ring to place the hero at the bottom seat. */\nfunction rotatePokerPositions(\n positions: readonly string[],\n heroPosition: string | undefined,\n): readonly string[] {\n const heroIndex = positions.findIndex((position) => position === heroPosition);\n if (heroIndex <= 0) return positions;\n\n return [...positions.slice(heroIndex), ...positions.slice(0, heroIndex)];\n}\n\n/*** Converts one poker participant record into a generic seat-state override. */\nfunction createPokerParticipantState(\n player: PokerTrainingPlayer,\n task: PokerTrainingTaskTableData,\n bigBlind: number | undefined,\n): TabletopGameParticipantState {\n const isHero = player.isHero === true || player.position === task.heroPosition;\n const cards = player.cards ?? (isHero ? task.heroCards : undefined);\n const folded = player.folded === true;\n\n return {\n seatId: player.position,\n state: {\n cards,\n disabled: folded,\n faceDownCards: cards === undefined && !folded && !isHero ? 2 : undefined,\n muted: folded,\n selected: isHero,\n sublabel: formatPlayerSublabel(player, bigBlind),\n },\n };\n}\n\n/*** Formats stack and optional committed chips as a compact seat sublabel. */\nfunction formatPlayerSublabel(\n player: PokerTrainingPlayer,\n bigBlind: number | undefined,\n): string | undefined {\n const stack = player.stack === undefined ? undefined : formatChipStack(player.stack, bigBlind);\n const bet = player.bet === undefined ? undefined : `Bet ${formatChipStack(player.bet, bigBlind)}`;\n const parts = [stack, bet, player.folded === true ? 'Folded' : undefined].filter(\n (part): part is string => part !== undefined,\n );\n\n return parts.length === 0 ? undefined : parts.join(' · ');\n}\n\n/*** Formats chips as big blinds when a positive blind is known, otherwise as an amount. */\nfunction formatChipStack(amount: number, bigBlind: number | undefined): string {\n if (bigBlind !== undefined && bigBlind > 0) {\n return `${formatAmount(amount / bigBlind)} BB`;\n }\n\n return `${formatAmount(amount)} chips`;\n}\n\n/*** Formats a numeric poker amount consistently across native and web runtimes. */\nfunction formatAmount(amount: number): string {\n return new Intl.NumberFormat('en-US', { maximumFractionDigits: 2 }).format(amount);\n}\n\n/*** Summarizes the reconstructed table for assistive technologies. */\nfunction createPokerAccessibilityLabel(\n tableSize: PokerTrainingTableSize,\n heroPosition: string | undefined,\n task: PokerTrainingTaskTableData,\n): string {\n const parts = [`${tableSize === '6max' ? 'Six' : 'Nine'}-player poker table`];\n if (heroPosition !== undefined) parts.push(`Hero ${heroPosition}`);\n if (task.pot !== undefined) parts.push(`Pot ${formatAmount(task.pot)}`);\n if (task.blinds !== undefined) {\n parts.push(`Blinds ${formatAmount(task.blinds.small)} / ${formatAmount(task.blinds.big)}`);\n }\n\n return `${parts.join('. ')}.`;\n}\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { TabletopColorOverrides, TabletopColorScheme } from '../../../types/tabletop';
|
|
2
|
+
interface TabletopColorThemeShape {
|
|
3
|
+
semantics: {
|
|
4
|
+
action: {
|
|
5
|
+
primary: {
|
|
6
|
+
base: string;
|
|
7
|
+
softBg: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
content: {
|
|
11
|
+
default: string;
|
|
12
|
+
muted: string;
|
|
13
|
+
};
|
|
14
|
+
neutral: {
|
|
15
|
+
border: string;
|
|
16
|
+
divider: string;
|
|
17
|
+
surface: string;
|
|
18
|
+
surfaceHover: string;
|
|
19
|
+
};
|
|
20
|
+
warning: {
|
|
21
|
+
base: string;
|
|
22
|
+
softBg: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/***
|
|
27
|
+
* Creates the theme-derived color palette used by tabletop primitives.
|
|
28
|
+
*
|
|
29
|
+
* Use `createTabletopColorScheme` when custom components need to align with the
|
|
30
|
+
* same card, table, seat, token, and contrast-aware foreground colors as the
|
|
31
|
+
* built-in tabletop components.
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
export declare function createTabletopColorScheme(theme: TabletopColorThemeShape, overrides?: TabletopColorOverrides): TabletopColorScheme;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=createTabletopColorScheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTabletopColorScheme.d.ts","sourceRoot":"","sources":["../../../../src/features/tabletop/utils/createTabletopColorScheme.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE3F,UAAU,uBAAuB;IAC/B,SAAS,EAAE;QACT,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM,CAAC;gBACb,MAAM,EAAE,MAAM,CAAC;aAChB,CAAC;SACH,CAAC;QACF,OAAO,EAAE;YACP,OAAO,EAAE,MAAM,CAAC;YAChB,KAAK,EAAE,MAAM,CAAC;SACf,CAAC;QACF,OAAO,EAAE;YACP,MAAM,EAAE,MAAM,CAAC;YACf,OAAO,EAAE,MAAM,CAAC;YAChB,OAAO,EAAE,MAAM,CAAC;YAChB,YAAY,EAAE,MAAM,CAAC;SACtB,CAAC;QACF,OAAO,EAAE;YACP,IAAI,EAAE,MAAM,CAAC;YACb,MAAM,EAAE,MAAM,CAAC;SAChB,CAAC;KACH,CAAC;CACH;AAUD;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,uBAAuB,EAC9B,SAAS,GAAE,sBAA2B,GACrC,mBAAmB,CAgErB"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { getReadableForeground, parseHexColor as parseCanonicalHexColor, } from '@ankhorage/color-theory';
|
|
2
|
+
const MINIMUM_READABLE_CONTRAST = 4.5;
|
|
3
|
+
/***
|
|
4
|
+
* Creates the theme-derived color palette used by tabletop primitives.
|
|
5
|
+
*
|
|
6
|
+
* Use `createTabletopColorScheme` when custom components need to align with the
|
|
7
|
+
* same card, table, seat, token, and contrast-aware foreground colors as the
|
|
8
|
+
* built-in tabletop components.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export function createTabletopColorScheme(theme, overrides = {}) {
|
|
12
|
+
const cardSurface = overrides.cardSurface ?? theme.semantics.neutral.surface;
|
|
13
|
+
const seatSurface = overrides.seatSurface ?? theme.semantics.neutral.surface;
|
|
14
|
+
const tableFelt = overrides.tableFelt ?? theme.semantics.action.primary.softBg;
|
|
15
|
+
const tokenSurface = overrides.tokenSurface ?? theme.semantics.warning.softBg;
|
|
16
|
+
const cardText = overrides.cardText ??
|
|
17
|
+
resolveReadableTextColor(cardSurface, theme.semantics.content.default, theme.semantics.content.muted);
|
|
18
|
+
const seatText = overrides.seatText ??
|
|
19
|
+
resolveReadableTextColor(seatSurface, theme.semantics.content.default, theme.semantics.content.muted);
|
|
20
|
+
const tableText = overrides.tableText ??
|
|
21
|
+
resolveReadableTextColor(tableFelt, theme.semantics.content.default, theme.semantics.content.muted);
|
|
22
|
+
const tokenText = overrides.tokenText ??
|
|
23
|
+
resolveReadableTextColor(tokenSurface, theme.semantics.content.default, theme.semantics.content.muted);
|
|
24
|
+
return {
|
|
25
|
+
cardBack: overrides.cardBack ?? theme.semantics.warning.base,
|
|
26
|
+
cardBackBorder: overrides.cardBackBorder ?? theme.semantics.neutral.border,
|
|
27
|
+
cardBorder: overrides.cardBorder ?? theme.semantics.neutral.border,
|
|
28
|
+
cardSurface,
|
|
29
|
+
cardText,
|
|
30
|
+
mutedText: overrides.mutedText ??
|
|
31
|
+
resolveReadableTextColor(cardSurface, theme.semantics.content.muted, cardText),
|
|
32
|
+
redSuitText: overrides.redSuitText ??
|
|
33
|
+
resolveReadableTextColor(cardSurface, theme.semantics.warning.base, cardText),
|
|
34
|
+
seatBorder: overrides.seatBorder ?? theme.semantics.neutral.divider,
|
|
35
|
+
seatMutedText: overrides.seatMutedText ??
|
|
36
|
+
resolveReadableTextColor(seatSurface, theme.semantics.content.muted, seatText),
|
|
37
|
+
seatSelectedBorder: overrides.seatSelectedBorder ?? theme.semantics.action.primary.base,
|
|
38
|
+
seatSurface,
|
|
39
|
+
seatText,
|
|
40
|
+
tableBorder: overrides.tableBorder ?? theme.semantics.warning.base,
|
|
41
|
+
tableFelt,
|
|
42
|
+
tableInnerBorder: overrides.tableInnerBorder ?? theme.semantics.neutral.divider,
|
|
43
|
+
tableMutedText: overrides.tableMutedText ??
|
|
44
|
+
resolveReadableTextColor(tableFelt, theme.semantics.content.muted, tableText),
|
|
45
|
+
tableText,
|
|
46
|
+
tokenSurface,
|
|
47
|
+
tokenText,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/*** Chooses the most legible supplied foreground for a themed surface. */
|
|
51
|
+
function resolveReadableTextColor(background, preferred, fallback) {
|
|
52
|
+
const preferredContrast = getContrastRatio(background, preferred);
|
|
53
|
+
if (preferredContrast !== null && preferredContrast >= MINIMUM_READABLE_CONTRAST) {
|
|
54
|
+
return preferred;
|
|
55
|
+
}
|
|
56
|
+
const parsedBackground = parseHexColor(background);
|
|
57
|
+
const normalizedBackground = parsedBackground === null ? null : parseCanonicalHexColor(toHexColor(parsedBackground));
|
|
58
|
+
const strongestForeground = normalizedBackground === null
|
|
59
|
+
? undefined
|
|
60
|
+
: getReadableForeground(normalizedBackground).foreground;
|
|
61
|
+
const candidates = uniqueColors([
|
|
62
|
+
preferred,
|
|
63
|
+
fallback,
|
|
64
|
+
...(strongestForeground === undefined ? [] : [strongestForeground]),
|
|
65
|
+
]);
|
|
66
|
+
const [readableCandidate] = candidates
|
|
67
|
+
.map((candidate) => ({ candidate, contrast: getContrastRatio(background, candidate) }))
|
|
68
|
+
.filter((entry) => entry.contrast !== null)
|
|
69
|
+
.sort((left, right) => right.contrast - left.contrast);
|
|
70
|
+
return readableCandidate?.candidate ?? preferred;
|
|
71
|
+
}
|
|
72
|
+
/*** Converts a parsed color to Color Theory's canonical six-digit input. */
|
|
73
|
+
function toHexColor(color) {
|
|
74
|
+
return `#${[color.red, color.green, color.blue].map((channel) => channel.toString(16).padStart(2, '0')).join('')}`;
|
|
75
|
+
}
|
|
76
|
+
/*** Removes duplicate contrast candidates without changing their order. */
|
|
77
|
+
function uniqueColors(colors) {
|
|
78
|
+
return [...new Set(colors)];
|
|
79
|
+
}
|
|
80
|
+
/*** Measures contrast when both colors can be parsed as hex. */
|
|
81
|
+
function getContrastRatio(background, foreground) {
|
|
82
|
+
const backgroundColor = parseHexColor(background);
|
|
83
|
+
const foregroundColor = parseHexColor(foreground);
|
|
84
|
+
if (backgroundColor === null || foregroundColor === null)
|
|
85
|
+
return null;
|
|
86
|
+
const backgroundLuminance = getRelativeLuminance(backgroundColor);
|
|
87
|
+
const foregroundLuminance = getRelativeLuminance(foregroundColor);
|
|
88
|
+
const lighter = Math.max(backgroundLuminance, foregroundLuminance);
|
|
89
|
+
const darker = Math.min(backgroundLuminance, foregroundLuminance);
|
|
90
|
+
return (lighter + 0.05) / (darker + 0.05);
|
|
91
|
+
}
|
|
92
|
+
/*** Parses the hex colors supported by the tabletop palette. */
|
|
93
|
+
function parseHexColor(color) {
|
|
94
|
+
const value = color.trim();
|
|
95
|
+
const hex = value.startsWith('#') ? value.slice(1) : '';
|
|
96
|
+
if (!isSupportedHexLength(hex) || !isHexColorValue(hex))
|
|
97
|
+
return null;
|
|
98
|
+
if (hex.length === 3) {
|
|
99
|
+
const red = hex.slice(0, 1);
|
|
100
|
+
const green = hex.slice(1, 2);
|
|
101
|
+
const blue = hex.slice(2, 3);
|
|
102
|
+
return {
|
|
103
|
+
red: parseInt(red + red, 16),
|
|
104
|
+
green: parseInt(green + green, 16),
|
|
105
|
+
blue: parseInt(blue + blue, 16),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
red: parseInt(hex.slice(0, 2), 16),
|
|
110
|
+
green: parseInt(hex.slice(2, 4), 16),
|
|
111
|
+
blue: parseInt(hex.slice(4, 6), 16),
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/*** Checks the supported short, full, and alpha hex lengths. */
|
|
115
|
+
function isSupportedHexLength(hex) {
|
|
116
|
+
return hex.length === 3 || hex.length === 6 || hex.length === 8;
|
|
117
|
+
}
|
|
118
|
+
/*** Rejects non-hexadecimal color digits. */
|
|
119
|
+
function isHexColorValue(hex) {
|
|
120
|
+
return [...hex].every((character) => isHexCharacter(character));
|
|
121
|
+
}
|
|
122
|
+
/*** Checks whether a character is a hexadecimal digit. */
|
|
123
|
+
function isHexCharacter(character) {
|
|
124
|
+
const code = character.charCodeAt(0);
|
|
125
|
+
const isDigit = code >= 48 && code <= 57;
|
|
126
|
+
const isUpperHex = code >= 65 && code <= 70;
|
|
127
|
+
const isLowerHex = code >= 97 && code <= 102;
|
|
128
|
+
return isDigit || isUpperHex || isLowerHex;
|
|
129
|
+
}
|
|
130
|
+
/*** Computes relative luminance for one RGB color. */
|
|
131
|
+
function getRelativeLuminance(color) {
|
|
132
|
+
const red = normalizeColorChannel(color.red);
|
|
133
|
+
const green = normalizeColorChannel(color.green);
|
|
134
|
+
const blue = normalizeColorChannel(color.blue);
|
|
135
|
+
return 0.2126 * red + 0.7152 * green + 0.0722 * blue;
|
|
136
|
+
}
|
|
137
|
+
/*** Converts an RGB channel into linear light. */
|
|
138
|
+
function normalizeColorChannel(value) {
|
|
139
|
+
const normalized = value / 255;
|
|
140
|
+
if (normalized <= 0.03928)
|
|
141
|
+
return normalized / 12.92;
|
|
142
|
+
return ((normalized + 0.055) / 1.055) ** 2.4;
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=createTabletopColorScheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTabletopColorScheme.js","sourceRoot":"","sources":["../../../../src/features/tabletop/utils/createTabletopColorScheme.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,aAAa,IAAI,sBAAsB,GACxC,MAAM,yBAAyB,CAAC;AAmCjC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAEtC;;;;;;;GAOG;AACH,MAAM,UAAU,yBAAyB,CACvC,KAA8B,EAC9B,YAAoC,EAAE;IAEtC,MAAM,WAAW,GAAG,SAAS,CAAC,WAAW,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC;IAC7E,MAAM,WAAW,GAAG,SAAS,CAAC,WAAW,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC;IAC7E,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,IAAI,KAA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IAAI,IAAI,IAAI,EAAE,CAAC;IACzC,MAAM,UAAU,GAAG,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC;IAC5C,MAAM,UAAU,GAAG,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,GAAG,CAAC;IAE7C,OAAO,OAAO,IAAI,UAAU,IAAI,UAAU,CAAC;AAC7C,CAAC;AAED,sDAAsD;AACtD,SAAS,oBAAoB,CAAC,KAAe;IAC3C,MAAM,GAAG,GAAG,qBAAqB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7C,MAAM,KAAK,GAAG,qBAAqB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjD,MAAM,IAAI,GAAG,qBAAqB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAE/C,OAAO,MAAM,GAAG,GAAG,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,IAAI,CAAC;AACvD,CAAC;AAED,kDAAkD;AAClD,SAAS,qBAAqB,CAAC,KAAa;IAC1C,MAAM,UAAU,GAAG,KAAK,GAAG,GAAG,CAAC;IAC/B,IAAI,UAAU,IAAI,OAAO;QAAE,OAAO,UAAU,GAAG,KAAK,CAAC;IACrD,OAAO,CAAC,CAAC,UAAU,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC;AAC/C,CAAC","sourcesContent":["import {\n getReadableForeground,\n parseHexColor as parseCanonicalHexColor,\n} from '@ankhorage/color-theory';\n\nimport type { TabletopColorOverrides, TabletopColorScheme } from '../../../types/tabletop';\n\ninterface TabletopColorThemeShape {\n semantics: {\n action: {\n primary: {\n base: string;\n softBg: string;\n };\n };\n content: {\n default: string;\n muted: string;\n };\n neutral: {\n border: string;\n divider: string;\n surface: string;\n surfaceHover: string;\n };\n warning: {\n base: string;\n softBg: string;\n };\n };\n}\n\ninterface RgbColor {\n readonly red: number;\n readonly green: number;\n readonly blue: number;\n}\n\nconst MINIMUM_READABLE_CONTRAST = 4.5;\n\n/***\n * Creates the theme-derived color palette used by tabletop primitives.\n *\n * Use `createTabletopColorScheme` when custom components need to align with the\n * same card, table, seat, token, and contrast-aware foreground colors as the\n * built-in tabletop components.\n *\n */\nexport function createTabletopColorScheme(\n theme: TabletopColorThemeShape,\n overrides: TabletopColorOverrides = {},\n): TabletopColorScheme {\n const cardSurface = overrides.cardSurface ?? theme.semantics.neutral.surface;\n const seatSurface = overrides.seatSurface ?? theme.semantics.neutral.surface;\n const tableFelt = overrides.tableFelt ?? theme.semantics.action.primary.softBg;\n const tokenSurface = overrides.tokenSurface ?? theme.semantics.warning.softBg;\n\n const cardText =\n overrides.cardText ??\n resolveReadableTextColor(\n cardSurface,\n theme.semantics.content.default,\n theme.semantics.content.muted,\n );\n const seatText =\n overrides.seatText ??\n resolveReadableTextColor(\n seatSurface,\n theme.semantics.content.default,\n theme.semantics.content.muted,\n );\n const tableText =\n overrides.tableText ??\n resolveReadableTextColor(\n tableFelt,\n theme.semantics.content.default,\n theme.semantics.content.muted,\n );\n const tokenText =\n overrides.tokenText ??\n resolveReadableTextColor(\n tokenSurface,\n theme.semantics.content.default,\n theme.semantics.content.muted,\n );\n\n return {\n cardBack: overrides.cardBack ?? theme.semantics.warning.base,\n cardBackBorder: overrides.cardBackBorder ?? theme.semantics.neutral.border,\n cardBorder: overrides.cardBorder ?? theme.semantics.neutral.border,\n cardSurface,\n cardText,\n mutedText:\n overrides.mutedText ??\n resolveReadableTextColor(cardSurface, theme.semantics.content.muted, cardText),\n redSuitText:\n overrides.redSuitText ??\n resolveReadableTextColor(cardSurface, theme.semantics.warning.base, cardText),\n seatBorder: overrides.seatBorder ?? theme.semantics.neutral.divider,\n seatMutedText:\n overrides.seatMutedText ??\n resolveReadableTextColor(seatSurface, theme.semantics.content.muted, seatText),\n seatSelectedBorder: overrides.seatSelectedBorder ?? theme.semantics.action.primary.base,\n seatSurface,\n seatText,\n tableBorder: overrides.tableBorder ?? theme.semantics.warning.base,\n tableFelt,\n tableInnerBorder: overrides.tableInnerBorder ?? theme.semantics.neutral.divider,\n tableMutedText:\n overrides.tableMutedText ??\n resolveReadableTextColor(tableFelt, theme.semantics.content.muted, tableText),\n tableText,\n tokenSurface,\n tokenText,\n };\n}\n\n/*** Chooses the most legible supplied foreground for a themed surface. */\nfunction resolveReadableTextColor(background: string, preferred: string, fallback: string): string {\n const preferredContrast = getContrastRatio(background, preferred);\n if (preferredContrast !== null && preferredContrast >= MINIMUM_READABLE_CONTRAST) {\n return preferred;\n }\n\n const parsedBackground = parseHexColor(background);\n const normalizedBackground =\n parsedBackground === null ? null : parseCanonicalHexColor(toHexColor(parsedBackground));\n const strongestForeground =\n normalizedBackground === null\n ? undefined\n : getReadableForeground(normalizedBackground).foreground;\n const candidates = uniqueColors([\n preferred,\n fallback,\n ...(strongestForeground === undefined ? [] : [strongestForeground]),\n ]);\n const [readableCandidate] = candidates\n .map((candidate) => ({ candidate, contrast: getContrastRatio(background, candidate) }))\n .filter(\n (entry): entry is { readonly candidate: string; readonly contrast: number } =>\n entry.contrast !== null,\n )\n .sort((left, right) => right.contrast - left.contrast);\n\n return readableCandidate?.candidate ?? preferred;\n}\n\n/*** Converts a parsed color to Color Theory's canonical six-digit input. */\nfunction toHexColor(color: RgbColor): string {\n return `#${[color.red, color.green, color.blue].map((channel) => channel.toString(16).padStart(2, '0')).join('')}`;\n}\n\n/*** Removes duplicate contrast candidates without changing their order. */\nfunction uniqueColors(colors: readonly string[]): string[] {\n return [...new Set(colors)];\n}\n\n/*** Measures contrast when both colors can be parsed as hex. */\nfunction getContrastRatio(background: string, foreground: string): number | null {\n const backgroundColor = parseHexColor(background);\n const foregroundColor = parseHexColor(foreground);\n\n if (backgroundColor === null || foregroundColor === null) return null;\n\n const backgroundLuminance = getRelativeLuminance(backgroundColor);\n const foregroundLuminance = getRelativeLuminance(foregroundColor);\n const lighter = Math.max(backgroundLuminance, foregroundLuminance);\n const darker = Math.min(backgroundLuminance, foregroundLuminance);\n\n return (lighter + 0.05) / (darker + 0.05);\n}\n\n/*** Parses the hex colors supported by the tabletop palette. */\nfunction parseHexColor(color: string): RgbColor | null {\n const value = color.trim();\n const hex = value.startsWith('#') ? value.slice(1) : '';\n if (!isSupportedHexLength(hex) || !isHexColorValue(hex)) return null;\n\n if (hex.length === 3) {\n const red = hex.slice(0, 1);\n const green = hex.slice(1, 2);\n const blue = hex.slice(2, 3);\n\n return {\n red: parseInt(red + red, 16),\n green: parseInt(green + green, 16),\n blue: parseInt(blue + blue, 16),\n };\n }\n\n return {\n red: parseInt(hex.slice(0, 2), 16),\n green: parseInt(hex.slice(2, 4), 16),\n blue: parseInt(hex.slice(4, 6), 16),\n };\n}\n\n/*** Checks the supported short, full, and alpha hex lengths. */\nfunction isSupportedHexLength(hex: string): boolean {\n return hex.length === 3 || hex.length === 6 || hex.length === 8;\n}\n\n/*** Rejects non-hexadecimal color digits. */\nfunction isHexColorValue(hex: string): boolean {\n return [...hex].every((character) => isHexCharacter(character));\n}\n\n/*** Checks whether a character is a hexadecimal digit. */\nfunction isHexCharacter(character: string): boolean {\n const code = character.charCodeAt(0);\n const isDigit = code >= 48 && code <= 57;\n const isUpperHex = code >= 65 && code <= 70;\n const isLowerHex = code >= 97 && code <= 102;\n\n return isDigit || isUpperHex || isLowerHex;\n}\n\n/*** Computes relative luminance for one RGB color. */\nfunction getRelativeLuminance(color: RgbColor): number {\n const red = normalizeColorChannel(color.red);\n const green = normalizeColorChannel(color.green);\n const blue = normalizeColorChannel(color.blue);\n\n return 0.2126 * red + 0.7152 * green + 0.0722 * blue;\n}\n\n/*** Converts an RGB channel into linear light. */\nfunction normalizeColorChannel(value: number): number {\n const normalized = value / 255;\n if (normalized <= 0.03928) return normalized / 12.92;\n return ((normalized + 0.055) / 1.055) ** 2.4;\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CreateTabletopGameSeatsInput, TabletopSeatState } from '../../../types/tabletop';
|
|
2
|
+
/***
|
|
3
|
+
* Joins an ordered game layout with the participant states currently present in a scene.
|
|
4
|
+
*
|
|
5
|
+
* Missing participants retain their seat definition and receive the configured fallback state,
|
|
6
|
+
* which lets card games represent folded, eliminated, disconnected, or otherwise inactive seats
|
|
7
|
+
* without embedding those game rules in the tabletop renderer.
|
|
8
|
+
*
|
|
9
|
+
* Accepts ordered seats, participant overrides, and the fallback for missing participants, then
|
|
10
|
+
* returns normalized tabletop seats in the same order as the supplied seat definitions.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createTabletopGameSeats({ seats, participants, missingParticipantState, }: CreateTabletopGameSeatsInput): readonly TabletopSeatState[];
|
|
13
|
+
//# sourceMappingURL=createTabletopGameSeats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTabletopGameSeats.d.ts","sourceRoot":"","sources":["../../../../src/features/tabletop/utils/createTabletopGameSeats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE/F;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,KAAK,EACL,YAAY,EACZ,uBAAyD,GAC1D,EAAE,4BAA4B,GAAG,SAAS,iBAAiB,EAAE,CAc7D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/***
|
|
2
|
+
* Joins an ordered game layout with the participant states currently present in a scene.
|
|
3
|
+
*
|
|
4
|
+
* Missing participants retain their seat definition and receive the configured fallback state,
|
|
5
|
+
* which lets card games represent folded, eliminated, disconnected, or otherwise inactive seats
|
|
6
|
+
* without embedding those game rules in the tabletop renderer.
|
|
7
|
+
*
|
|
8
|
+
* Accepts ordered seats, participant overrides, and the fallback for missing participants, then
|
|
9
|
+
* returns normalized tabletop seats in the same order as the supplied seat definitions.
|
|
10
|
+
*/
|
|
11
|
+
export function createTabletopGameSeats({ seats, participants, missingParticipantState = { disabled: true, muted: true }, }) {
|
|
12
|
+
const participantsBySeat = new Map(participants.map((participant) => [participant.seatId, participant]));
|
|
13
|
+
return seats.map((seat) => {
|
|
14
|
+
const participant = participantsBySeat.get(seat.id);
|
|
15
|
+
return {
|
|
16
|
+
id: seat.id,
|
|
17
|
+
...seat.defaultState,
|
|
18
|
+
...(participant === undefined ? missingParticipantState : participant.state),
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=createTabletopGameSeats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTabletopGameSeats.js","sourceRoot":"","sources":["../../../../src/features/tabletop/utils/createTabletopGameSeats.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CAAC,EACtC,KAAK,EACL,YAAY,EACZ,uBAAuB,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,GAC5B;IAC7B,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAChC,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAU,CAAC,CAC9E,CAAC;IAEF,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,MAAM,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAEpD,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,GAAG,IAAI,CAAC,YAAY;YACpB,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC;SAC7E,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { CreateTabletopGameSeatsInput, TabletopSeatState } from '../../../types/tabletop';\n\n/***\n * Joins an ordered game layout with the participant states currently present in a scene.\n *\n * Missing participants retain their seat definition and receive the configured fallback state,\n * which lets card games represent folded, eliminated, disconnected, or otherwise inactive seats\n * without embedding those game rules in the tabletop renderer.\n *\n * Accepts ordered seats, participant overrides, and the fallback for missing participants, then\n * returns normalized tabletop seats in the same order as the supplied seat definitions.\n */\nexport function createTabletopGameSeats({\n seats,\n participants,\n missingParticipantState = { disabled: true, muted: true },\n}: CreateTabletopGameSeatsInput): readonly TabletopSeatState[] {\n const participantsBySeat = new Map(\n participants.map((participant) => [participant.seatId, participant] as const),\n );\n\n return seats.map((seat) => {\n const participant = participantsBySeat.get(seat.id);\n\n return {\n id: seat.id,\n ...seat.defaultState,\n ...(participant === undefined ? missingParticipantState : participant.state),\n };\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPlayingCardLabel.d.ts","sourceRoot":"","sources":["../../../../src/features/tabletop/utils/getPlayingCardLabel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAIhE,oDAAoD;AACpD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAElE"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const rankLabels = { A: 'ace', J: 'jack', K: 'king', Q: 'queen' };
|
|
2
|
+
/*** Gives a face-up card a spoken rank and suit. */
|
|
3
|
+
export function getPlayingCardLabel(card) {
|
|
4
|
+
return `${rankLabels[card.rank] ?? card.rank} of ${card.suit}`;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=getPlayingCardLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPlayingCardLabel.js","sourceRoot":"","sources":["../../../../src/features/tabletop/utils/getPlayingCardLabel.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAqC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;AAEpG,oDAAoD;AACpD,MAAM,UAAU,mBAAmB,CAAC,IAAsB;IACxD,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;AACjE,CAAC","sourcesContent":["import type { PlayingCardValue } from '../../../types/tabletop';\n\nconst rankLabels: Readonly<Record<string, string>> = { A: 'ace', J: 'jack', K: 'king', Q: 'queen' };\n\n/*** Gives a face-up card a spoken rank and suit. */\nexport function getPlayingCardLabel(card: PlayingCardValue): string {\n return `${rankLabels[card.rank] ?? card.rank} of ${card.suit}`;\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TabletopCardSize } from '../../../types/tabletop';
|
|
2
|
+
interface TabletopCardDimensions {
|
|
3
|
+
readonly width: number;
|
|
4
|
+
readonly height: number;
|
|
5
|
+
readonly radius: number;
|
|
6
|
+
readonly rankFontSize: number;
|
|
7
|
+
readonly suitFontSize: number;
|
|
8
|
+
}
|
|
9
|
+
/*** Returns the published dimensions for a tabletop card size. */
|
|
10
|
+
export declare function getTabletopCardDimensions(size: TabletopCardSize): TabletopCardDimensions;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=getTabletopCardDimensions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTabletopCardDimensions.d.ts","sourceRoot":"","sources":["../../../../src/features/tabletop/utils/getTabletopCardDimensions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AA0BD,kEAAkE;AAClE,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,gBAAgB,GAAG,sBAAsB,CASxF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const cardDimensions = {
|
|
2
|
+
large: {
|
|
3
|
+
width: 56,
|
|
4
|
+
height: 80,
|
|
5
|
+
radius: 8,
|
|
6
|
+
rankFontSize: 20,
|
|
7
|
+
suitFontSize: 16,
|
|
8
|
+
},
|
|
9
|
+
medium: {
|
|
10
|
+
width: 40,
|
|
11
|
+
height: 56,
|
|
12
|
+
radius: 6,
|
|
13
|
+
rankFontSize: 15,
|
|
14
|
+
suitFontSize: 12,
|
|
15
|
+
},
|
|
16
|
+
small: {
|
|
17
|
+
width: 28,
|
|
18
|
+
height: 40,
|
|
19
|
+
radius: 5,
|
|
20
|
+
rankFontSize: 11,
|
|
21
|
+
suitFontSize: 9,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
/*** Returns the published dimensions for a tabletop card size. */
|
|
25
|
+
export function getTabletopCardDimensions(size) {
|
|
26
|
+
switch (size) {
|
|
27
|
+
case 'small':
|
|
28
|
+
return cardDimensions.small;
|
|
29
|
+
case 'large':
|
|
30
|
+
return cardDimensions.large;
|
|
31
|
+
case 'medium':
|
|
32
|
+
return cardDimensions.medium;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=getTabletopCardDimensions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTabletopCardDimensions.js","sourceRoot":"","sources":["../../../../src/features/tabletop/utils/getTabletopCardDimensions.ts"],"names":[],"mappings":"AAUA,MAAM,cAAc,GAA+D;IACjF,KAAK,EAAE;QACL,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,CAAC;QACT,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,EAAE;KACjB;IACD,MAAM,EAAE;QACN,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,CAAC;QACT,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,EAAE;KACjB;IACD,KAAK,EAAE;QACL,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,CAAC;QACT,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,CAAC;KAChB;CACF,CAAC;AAEF,kEAAkE;AAClE,MAAM,UAAU,yBAAyB,CAAC,IAAsB;IAC9D,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,OAAO;YACV,OAAO,cAAc,CAAC,KAAK,CAAC;QAC9B,KAAK,OAAO;YACV,OAAO,cAAc,CAAC,KAAK,CAAC;QAC9B,KAAK,QAAQ;YACX,OAAO,cAAc,CAAC,MAAM,CAAC;IACjC,CAAC;AACH,CAAC","sourcesContent":["import type { TabletopCardSize } from '../../../types/tabletop';\n\ninterface TabletopCardDimensions {\n readonly width: number;\n readonly height: number;\n readonly radius: number;\n readonly rankFontSize: number;\n readonly suitFontSize: number;\n}\n\nconst cardDimensions: Readonly<Record<TabletopCardSize, TabletopCardDimensions>> = {\n large: {\n width: 56,\n height: 80,\n radius: 8,\n rankFontSize: 20,\n suitFontSize: 16,\n },\n medium: {\n width: 40,\n height: 56,\n radius: 6,\n rankFontSize: 15,\n suitFontSize: 12,\n },\n small: {\n width: 28,\n height: 40,\n radius: 5,\n rankFontSize: 11,\n suitFontSize: 9,\n },\n};\n\n/*** Returns the published dimensions for a tabletop card size. */\nexport function getTabletopCardDimensions(size: TabletopCardSize): TabletopCardDimensions {\n switch (size) {\n case 'small':\n return cardDimensions.small;\n case 'large':\n return cardDimensions.large;\n case 'medium':\n return cardDimensions.medium;\n }\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type TabletopSeatPositionValue = `${number}%`;
|
|
2
|
+
interface TabletopSeatPosition {
|
|
3
|
+
readonly top: TabletopSeatPositionValue;
|
|
4
|
+
readonly left: TabletopSeatPositionValue;
|
|
5
|
+
}
|
|
6
|
+
/*** Returns a seat's canonical position with the hero at the bottom. */
|
|
7
|
+
export declare function getTabletopSeatPosition(index: number, count: number): TabletopSeatPosition;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=getTabletopSeatPosition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTabletopSeatPosition.d.ts","sourceRoot":"","sources":["../../../../src/features/tabletop/utils/getTabletopSeatPosition.ts"],"names":[],"mappings":"AAEA,KAAK,yBAAyB,GAAG,GAAG,MAAM,GAAG,CAAC;AAE9C,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,GAAG,EAAE,yBAAyB,CAAC;IACxC,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;CAC1C;AAsFD,wEAAwE;AACxE,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,oBAAoB,CAK1F"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
const fallbackSeatPosition = { top: '82%', left: '50%' };
|
|
2
|
+
const seatPositions = {
|
|
3
|
+
2: [fallbackSeatPosition, { top: '18%', left: '50%' }],
|
|
4
|
+
3: [fallbackSeatPosition, { top: '28%', left: '18%' }, { top: '28%', left: '82%' }],
|
|
5
|
+
4: [
|
|
6
|
+
fallbackSeatPosition,
|
|
7
|
+
{ top: '50%', left: '12%' },
|
|
8
|
+
{ top: '18%', left: '50%' },
|
|
9
|
+
{ top: '50%', left: '88%' },
|
|
10
|
+
],
|
|
11
|
+
5: [
|
|
12
|
+
{ top: '84%', left: '50%' },
|
|
13
|
+
{ top: '62%', left: '12%' },
|
|
14
|
+
{ top: '18%', left: '24%' },
|
|
15
|
+
{ top: '18%', left: '76%' },
|
|
16
|
+
{ top: '62%', left: '88%' },
|
|
17
|
+
],
|
|
18
|
+
6: [
|
|
19
|
+
{ top: '84%', left: '50%' },
|
|
20
|
+
{ top: '68%', left: '16%' },
|
|
21
|
+
{ top: '26%', left: '16%' },
|
|
22
|
+
{ top: '16%', left: '50%' },
|
|
23
|
+
{ top: '26%', left: '84%' },
|
|
24
|
+
{ top: '68%', left: '84%' },
|
|
25
|
+
],
|
|
26
|
+
7: [
|
|
27
|
+
{ top: '86%', left: '50%' },
|
|
28
|
+
{ top: '70%', left: '14%' },
|
|
29
|
+
{ top: '34%', left: '10%' },
|
|
30
|
+
{ top: '14%', left: '34%' },
|
|
31
|
+
{ top: '14%', left: '66%' },
|
|
32
|
+
{ top: '34%', left: '90%' },
|
|
33
|
+
{ top: '70%', left: '86%' },
|
|
34
|
+
],
|
|
35
|
+
8: [
|
|
36
|
+
{ top: '86%', left: '50%' },
|
|
37
|
+
{ top: '72%', left: '16%' },
|
|
38
|
+
{ top: '50%', left: '8%' },
|
|
39
|
+
{ top: '20%', left: '20%' },
|
|
40
|
+
{ top: '14%', left: '50%' },
|
|
41
|
+
{ top: '20%', left: '80%' },
|
|
42
|
+
{ top: '50%', left: '92%' },
|
|
43
|
+
{ top: '72%', left: '84%' },
|
|
44
|
+
],
|
|
45
|
+
9: [
|
|
46
|
+
{ top: '88%', left: '50%' },
|
|
47
|
+
{ top: '78%', left: '12%' },
|
|
48
|
+
{ top: '50%', left: '4%' },
|
|
49
|
+
{ top: '18%', left: '10%' },
|
|
50
|
+
{ top: '8%', left: '28%' },
|
|
51
|
+
{ top: '8%', left: '50%' },
|
|
52
|
+
{ top: '8%', left: '72%' },
|
|
53
|
+
{ top: '18%', left: '90%' },
|
|
54
|
+
{ top: '50%', left: '96%' },
|
|
55
|
+
],
|
|
56
|
+
10: [
|
|
57
|
+
{ top: '88%', left: '50%' },
|
|
58
|
+
{ top: '80%', left: '20%' },
|
|
59
|
+
{ top: '58%', left: '6%' },
|
|
60
|
+
{ top: '30%', left: '8%' },
|
|
61
|
+
{ top: '10%', left: '30%' },
|
|
62
|
+
{ top: '8%', left: '50%' },
|
|
63
|
+
{ top: '10%', left: '70%' },
|
|
64
|
+
{ top: '30%', left: '92%' },
|
|
65
|
+
{ top: '58%', left: '94%' },
|
|
66
|
+
{ top: '80%', left: '80%' },
|
|
67
|
+
],
|
|
68
|
+
};
|
|
69
|
+
/*** Clamps the requested tabletop seat count to a supported ring. */
|
|
70
|
+
function normalizeTabletopSeatCount(count) {
|
|
71
|
+
const rounded = Math.round(count);
|
|
72
|
+
if (rounded <= 2)
|
|
73
|
+
return 2;
|
|
74
|
+
if (rounded >= 10)
|
|
75
|
+
return 10;
|
|
76
|
+
return rounded;
|
|
77
|
+
}
|
|
78
|
+
/*** Returns the canonical seat positions for a ring size. */
|
|
79
|
+
function getTabletopSeatPositions(count) {
|
|
80
|
+
return seatPositions[normalizeTabletopSeatCount(count)];
|
|
81
|
+
}
|
|
82
|
+
/*** Returns a seat's canonical position with the hero at the bottom. */
|
|
83
|
+
export function getTabletopSeatPosition(index, count) {
|
|
84
|
+
const positions = getTabletopSeatPositions(count);
|
|
85
|
+
const position = positions[index % positions.length];
|
|
86
|
+
return position ?? fallbackSeatPosition;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=getTabletopSeatPosition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTabletopSeatPosition.js","sourceRoot":"","sources":["../../../../src/features/tabletop/utils/getTabletopSeatPosition.ts"],"names":[],"mappings":"AASA,MAAM,oBAAoB,GAAyB,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AAE/E,MAAM,aAAa,GAAyE;IAC1F,CAAC,EAAE,CAAC,oBAAoB,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACtD,CAAC,EAAE,CAAC,oBAAoB,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACnF,CAAC,EAAE;QACD,oBAAoB;QACpB,EAAE,GAAG,EAAE,KAAK,E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AC","sourcesContent":["import type { TabletopSeatCount } from '../../../types/tabletop';\n\ntype TabletopSeatPositionValue = `${number}%`;\n\ninterface TabletopSeatPosition {\n readonly top: TabletopSeatPositionValue;\n readonly left: TabletopSeatPositionValue;\n}\n\nconst fallbackSeatPosition: TabletopSeatPosition = { top: '82%', left: '50%' };\n\nconst seatPositions: Readonly<Record<TabletopSeatCount, readonly TabletopSeatPosition[]>> = {\n 2: [fallbackSeatPosition, { top: '18%', left: '50%' }],\n 3: [fallbackSeatPosition, { top: '28%', left: '18%' }, { top: '28%', left: '82%' }],\n 4: [\n fallbackSeatPosition,\n { top: '50%', left: '12%' },\n { top: '18%', left: '50%' },\n { top: '50%', left: '88%' },\n ],\n 5: [\n { top: '84%', left: '50%' },\n { top: '62%', left: '12%' },\n { top: '18%', left: '24%' },\n { top: '18%', left: '76%' },\n { top: '62%', left: '88%' },\n ],\n 6: [\n { top: '84%', left: '50%' },\n { top: '68%', left: '16%' },\n { top: '26%', left: '16%' },\n { top: '16%', left: '50%' },\n { top: '26%', left: '84%' },\n { top: '68%', left: '84%' },\n ],\n 7: [\n { top: '86%', left: '50%' },\n { top: '70%', left: '14%' },\n { top: '34%', left: '10%' },\n { top: '14%', left: '34%' },\n { top: '14%', left: '66%' },\n { top: '34%', left: '90%' },\n { top: '70%', left: '86%' },\n ],\n 8: [\n { top: '86%', left: '50%' },\n { top: '72%', left: '16%' },\n { top: '50%', left: '8%' },\n { top: '20%', left: '20%' },\n { top: '14%', left: '50%' },\n { top: '20%', left: '80%' },\n { top: '50%', left: '92%' },\n { top: '72%', left: '84%' },\n ],\n 9: [\n { top: '88%', left: '50%' },\n { top: '78%', left: '12%' },\n { top: '50%', left: '4%' },\n { top: '18%', left: '10%' },\n { top: '8%', left: '28%' },\n { top: '8%', left: '50%' },\n { top: '8%', left: '72%' },\n { top: '18%', left: '90%' },\n { top: '50%', left: '96%' },\n ],\n 10: [\n { top: '88%', left: '50%' },\n { top: '80%', left: '20%' },\n { top: '58%', left: '6%' },\n { top: '30%', left: '8%' },\n { top: '10%', left: '30%' },\n { top: '8%', left: '50%' },\n { top: '10%', left: '70%' },\n { top: '30%', left: '92%' },\n { top: '58%', left: '94%' },\n { top: '80%', left: '80%' },\n ],\n};\n\n/*** Clamps the requested tabletop seat count to a supported ring. */\nfunction normalizeTabletopSeatCount(count: number): TabletopSeatCount {\n const rounded = Math.round(count);\n if (rounded <= 2) return 2;\n if (rounded >= 10) return 10;\n\n return rounded as TabletopSeatCount;\n}\n\n/*** Returns the canonical seat positions for a ring size. */\nfunction getTabletopSeatPositions(count: number): readonly TabletopSeatPosition[] {\n return seatPositions[normalizeTabletopSeatCount(count)];\n}\n\n/*** Returns a seat's canonical position with the hero at the bottom. */\nexport function getTabletopSeatPosition(index: number, count: number): TabletopSeatPosition {\n const positions = getTabletopSeatPositions(count);\n const position = positions[index % positions.length];\n\n return position ?? fallbackSeatPosition;\n}\n"]}
|