@dreamboard-games/ui-sdk 0.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +89 -0
- package/NOTICE +1 -0
- package/README.md +154 -0
- package/dist/components/ActionButton.d.ts +13 -0
- package/dist/components/ActionButton.d.ts.map +1 -0
- package/dist/components/ActionButton.js +14 -0
- package/dist/components/ActionPanel.d.ts +33 -0
- package/dist/components/ActionPanel.d.ts.map +1 -0
- package/dist/components/ActionPanel.js +148 -0
- package/dist/components/Card.d.ts +29 -0
- package/dist/components/Card.d.ts.map +1 -0
- package/dist/components/Card.js +220 -0
- package/dist/components/ChromeSuppressionContext.d.ts +7 -0
- package/dist/components/ChromeSuppressionContext.d.ts.map +1 -0
- package/dist/components/ChromeSuppressionContext.js +34 -0
- package/dist/components/CostDisplay.d.ts +22 -0
- package/dist/components/CostDisplay.d.ts.map +1 -0
- package/dist/components/CostDisplay.js +41 -0
- package/dist/components/DiceRoller.d.ts +30 -0
- package/dist/components/DiceRoller.d.ts.map +1 -0
- package/dist/components/DiceRoller.js +319 -0
- package/dist/components/Drawer.d.ts +19 -0
- package/dist/components/Drawer.d.ts.map +1 -0
- package/dist/components/Drawer.js +55 -0
- package/dist/components/ErrorBoundary.d.ts +24 -0
- package/dist/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/components/ErrorBoundary.js +37 -0
- package/dist/components/GameEndDisplay.d.ts +27 -0
- package/dist/components/GameEndDisplay.d.ts.map +1 -0
- package/dist/components/GameEndDisplay.js +185 -0
- package/dist/components/GameSkeleton.d.ts +12 -0
- package/dist/components/GameSkeleton.d.ts.map +1 -0
- package/dist/components/GameSkeleton.js +54 -0
- package/dist/components/Hand.d.ts +99 -0
- package/dist/components/Hand.d.ts.map +1 -0
- package/dist/components/Hand.js +162 -0
- package/dist/components/HandDock.d.ts +35 -0
- package/dist/components/HandDock.d.ts.map +1 -0
- package/dist/components/HandDock.js +124 -0
- package/dist/components/InteractionForm.d.ts +50 -0
- package/dist/components/InteractionForm.d.ts.map +1 -0
- package/dist/components/InteractionForm.js +402 -0
- package/dist/components/MoreActions.d.ts +49 -0
- package/dist/components/MoreActions.d.ts.map +1 -0
- package/dist/components/MoreActions.js +64 -0
- package/dist/components/PhaseIndicator.d.ts +35 -0
- package/dist/components/PhaseIndicator.d.ts.map +1 -0
- package/dist/components/PhaseIndicator.js +212 -0
- package/dist/components/PlayArea.d.ts +28 -0
- package/dist/components/PlayArea.d.ts.map +1 -0
- package/dist/components/PlayArea.js +48 -0
- package/dist/components/PluginRuntime.d.ts +37 -0
- package/dist/components/PluginRuntime.d.ts.map +1 -0
- package/dist/components/PluginRuntime.js +47 -0
- package/dist/components/PrimaryActionButton.d.ts +98 -0
- package/dist/components/PrimaryActionButton.d.ts.map +1 -0
- package/dist/components/PrimaryActionButton.js +183 -0
- package/dist/components/PrimaryButton.d.ts +20 -0
- package/dist/components/PrimaryButton.d.ts.map +1 -0
- package/dist/components/PrimaryButton.js +5 -0
- package/dist/components/PromptDialogHost.d.ts +15 -0
- package/dist/components/PromptDialogHost.d.ts.map +1 -0
- package/dist/components/PromptDialogHost.js +22 -0
- package/dist/components/ResourceCounter.d.ts +38 -0
- package/dist/components/ResourceCounter.d.ts.map +1 -0
- package/dist/components/ResourceCounter.js +118 -0
- package/dist/components/ThemedButton.d.ts +12 -0
- package/dist/components/ThemedButton.d.ts.map +1 -0
- package/dist/components/ThemedButton.js +38 -0
- package/dist/components/Toast.d.ts +35 -0
- package/dist/components/Toast.d.ts.map +1 -0
- package/dist/components/Toast.js +116 -0
- package/dist/components/board/HexGrid.d.ts +344 -0
- package/dist/components/board/HexGrid.d.ts.map +1 -0
- package/dist/components/board/HexGrid.js +340 -0
- package/dist/components/board/NetworkGraph.d.ts +100 -0
- package/dist/components/board/NetworkGraph.d.ts.map +1 -0
- package/dist/components/board/NetworkGraph.js +123 -0
- package/dist/components/board/SlotSystem.d.ts +71 -0
- package/dist/components/board/SlotSystem.d.ts.map +1 -0
- package/dist/components/board/SlotSystem.js +87 -0
- package/dist/components/board/SquareGrid.d.ts +188 -0
- package/dist/components/board/SquareGrid.d.ts.map +1 -0
- package/dist/components/board/SquareGrid.js +328 -0
- package/dist/components/board/TrackBoard.d.ts +113 -0
- package/dist/components/board/TrackBoard.d.ts.map +1 -0
- package/dist/components/board/TrackBoard.js +135 -0
- package/dist/components/board/ZoneMap.d.ts +88 -0
- package/dist/components/board/ZoneMap.d.ts.map +1 -0
- package/dist/components/board/ZoneMap.js +133 -0
- package/dist/components/board/hex-board-view.d.ts +69 -0
- package/dist/components/board/hex-board-view.d.ts.map +1 -0
- package/dist/components/board/hex-board-view.js +60 -0
- package/dist/components/board/index.d.ts +23 -0
- package/dist/components/board/index.d.ts.map +1 -0
- package/dist/components/board/index.js +40 -0
- package/dist/components/board/interaction-accessibility.d.ts +5 -0
- package/dist/components/board/interaction-accessibility.d.ts.map +1 -0
- package/dist/components/board/interaction-accessibility.js +13 -0
- package/dist/components/board/target-layer.d.ts +13 -0
- package/dist/components/board/target-layer.d.ts.map +1 -0
- package/dist/components/board/target-layer.js +10 -0
- package/dist/components/card-render-content.type-test.d.ts +2 -0
- package/dist/components/card-render-content.type-test.d.ts.map +1 -0
- package/dist/components/card-render-content.type-test.js +1 -0
- package/dist/components/index.d.ts +34 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +35 -0
- package/dist/components/interaction-dialog-behavior.d.ts +15 -0
- package/dist/components/interaction-dialog-behavior.d.ts.map +1 -0
- package/dist/components/interaction-dialog-behavior.js +9 -0
- package/dist/components/surfaces/BlockerSurface.d.ts +27 -0
- package/dist/components/surfaces/BlockerSurface.d.ts.map +1 -0
- package/dist/components/surfaces/BlockerSurface.js +38 -0
- package/dist/components/surfaces/BoardSurface.d.ts +77 -0
- package/dist/components/surfaces/BoardSurface.d.ts.map +1 -0
- package/dist/components/surfaces/BoardSurface.js +180 -0
- package/dist/components/surfaces/ChromeSurface.d.ts +29 -0
- package/dist/components/surfaces/ChromeSurface.d.ts.map +1 -0
- package/dist/components/surfaces/ChromeSurface.js +34 -0
- package/dist/components/surfaces/ExhaustivenessAudit.d.ts +32 -0
- package/dist/components/surfaces/ExhaustivenessAudit.d.ts.map +1 -0
- package/dist/components/surfaces/ExhaustivenessAudit.js +65 -0
- package/dist/components/surfaces/InboxSurface.d.ts +40 -0
- package/dist/components/surfaces/InboxSurface.d.ts.map +1 -0
- package/dist/components/surfaces/InboxSurface.js +99 -0
- package/dist/components/surfaces/MarketSurface.d.ts +62 -0
- package/dist/components/surfaces/MarketSurface.d.ts.map +1 -0
- package/dist/components/surfaces/MarketSurface.js +242 -0
- package/dist/components/surfaces/PanelSurface.d.ts +111 -0
- package/dist/components/surfaces/PanelSurface.d.ts.map +1 -0
- package/dist/components/surfaces/PanelSurface.js +180 -0
- package/dist/components/surfaces/PlayerCardsSurface.d.ts +104 -0
- package/dist/components/surfaces/PlayerCardsSurface.d.ts.map +1 -0
- package/dist/components/surfaces/PlayerCardsSurface.js +178 -0
- package/dist/components/surfaces/internal/CardZoneFollowUpForm.d.ts +7 -0
- package/dist/components/surfaces/internal/CardZoneFollowUpForm.d.ts.map +1 -0
- package/dist/components/surfaces/internal/CardZoneFollowUpForm.js +9 -0
- package/dist/components/surfaces/internal/DefaultInteractionButton.d.ts +71 -0
- package/dist/components/surfaces/internal/DefaultInteractionButton.d.ts.map +1 -0
- package/dist/components/surfaces/internal/DefaultInteractionButton.js +82 -0
- package/dist/components/surfaces/internal/useCardZoneInteractions.d.ts +21 -0
- package/dist/components/surfaces/internal/useCardZoneInteractions.d.ts.map +1 -0
- package/dist/components/surfaces/internal/useCardZoneInteractions.js +202 -0
- package/dist/components/surfaces/types.d.ts +59 -0
- package/dist/components/surfaces/types.d.ts.map +1 -0
- package/dist/components/surfaces/types.js +1 -0
- package/dist/context/ClientParamSchemaContext.d.ts +21 -0
- package/dist/context/ClientParamSchemaContext.d.ts.map +1 -0
- package/dist/context/ClientParamSchemaContext.js +12 -0
- package/dist/context/InteractionDraftContext.d.ts +69 -0
- package/dist/context/InteractionDraftContext.d.ts.map +1 -0
- package/dist/context/InteractionDraftContext.js +145 -0
- package/dist/context/PluginSessionContext.d.ts +33 -0
- package/dist/context/PluginSessionContext.d.ts.map +1 -0
- package/dist/context/PluginSessionContext.js +38 -0
- package/dist/context/PluginStateContext.d.ts +116 -0
- package/dist/context/PluginStateContext.d.ts.map +1 -0
- package/dist/context/PluginStateContext.js +186 -0
- package/dist/context/RuntimeContext.d.ts +49 -0
- package/dist/context/RuntimeContext.d.ts.map +1 -0
- package/dist/context/RuntimeContext.js +67 -0
- package/dist/defaults/components.d.ts +52 -0
- package/dist/defaults/components.d.ts.map +1 -0
- package/dist/defaults/components.js +159 -0
- package/dist/defaults/index.d.ts +2 -0
- package/dist/defaults/index.d.ts.map +1 -0
- package/dist/defaults/index.js +1 -0
- package/dist/errors/ValidationError.d.ts +10 -0
- package/dist/errors/ValidationError.d.ts.map +1 -0
- package/dist/errors/ValidationError.js +23 -0
- package/dist/helpers/cards.d.ts +3 -0
- package/dist/helpers/cards.d.ts.map +1 -0
- package/dist/helpers/cards.js +11 -0
- package/dist/helpers/track-board.d.ts +79 -0
- package/dist/helpers/track-board.d.ts.map +1 -0
- package/dist/helpers/track-board.js +56 -0
- package/dist/hooks/useActivePlayers.d.ts +16 -0
- package/dist/hooks/useActivePlayers.d.ts.map +1 -0
- package/dist/hooks/useActivePlayers.js +17 -0
- package/dist/hooks/useBoardInteractions.d.ts +110 -0
- package/dist/hooks/useBoardInteractions.d.ts.map +1 -0
- package/dist/hooks/useBoardInteractions.js +248 -0
- package/dist/hooks/useBoardTopology.d.ts +23 -0
- package/dist/hooks/useBoardTopology.d.ts.map +1 -0
- package/dist/hooks/useBoardTopology.js +128 -0
- package/dist/hooks/useCards.d.ts +3 -0
- package/dist/hooks/useCards.d.ts.map +1 -0
- package/dist/hooks/useCards.js +5 -0
- package/dist/hooks/useGameSelector.d.ts +13 -0
- package/dist/hooks/useGameSelector.d.ts.map +1 -0
- package/dist/hooks/useGameSelector.js +67 -0
- package/dist/hooks/useGameView.d.ts +6 -0
- package/dist/hooks/useGameView.d.ts.map +1 -0
- package/dist/hooks/useGameView.js +7 -0
- package/dist/hooks/useHandLayout.d.ts +120 -0
- package/dist/hooks/useHandLayout.d.ts.map +1 -0
- package/dist/hooks/useHandLayout.js +235 -0
- package/dist/hooks/useHexBoard.d.ts +19 -0
- package/dist/hooks/useHexBoard.d.ts.map +1 -0
- package/dist/hooks/useHexBoard.js +28 -0
- package/dist/hooks/useHexGrid.d.ts +56 -0
- package/dist/hooks/useHexGrid.d.ts.map +1 -0
- package/dist/hooks/useHexGrid.js +112 -0
- package/dist/hooks/useInteractionByKey.d.ts +29 -0
- package/dist/hooks/useInteractionByKey.d.ts.map +1 -0
- package/dist/hooks/useInteractionByKey.js +263 -0
- package/dist/hooks/useInteractionHandle.d.ts +103 -0
- package/dist/hooks/useInteractionHandle.d.ts.map +1 -0
- package/dist/hooks/useInteractionHandle.js +254 -0
- package/dist/hooks/useIsMobile.d.ts +7 -0
- package/dist/hooks/useIsMobile.d.ts.map +1 -0
- package/dist/hooks/useIsMobile.js +29 -0
- package/dist/hooks/useIsMyTurn.d.ts +6 -0
- package/dist/hooks/useIsMyTurn.d.ts.map +1 -0
- package/dist/hooks/useIsMyTurn.js +11 -0
- package/dist/hooks/useLobby.d.ts +28 -0
- package/dist/hooks/useLobby.d.ts.map +1 -0
- package/dist/hooks/useLobby.js +60 -0
- package/dist/hooks/useMe.d.ts +11 -0
- package/dist/hooks/useMe.d.ts.map +1 -0
- package/dist/hooks/useMe.js +32 -0
- package/dist/hooks/usePanZoom.d.ts +113 -0
- package/dist/hooks/usePanZoom.d.ts.map +1 -0
- package/dist/hooks/usePanZoom.js +165 -0
- package/dist/hooks/usePlayerInfo.d.ts +4 -0
- package/dist/hooks/usePlayerInfo.d.ts.map +1 -0
- package/dist/hooks/usePlayerInfo.js +21 -0
- package/dist/hooks/usePlayerTurnOrder.d.ts +15 -0
- package/dist/hooks/usePlayerTurnOrder.d.ts.map +1 -0
- package/dist/hooks/usePlayerTurnOrder.js +22 -0
- package/dist/hooks/usePluginRuntime.d.ts +45 -0
- package/dist/hooks/usePluginRuntime.d.ts.map +1 -0
- package/dist/hooks/usePluginRuntime.js +92 -0
- package/dist/hooks/useSeatInbox.d.ts +22 -0
- package/dist/hooks/useSeatInbox.d.ts.map +1 -0
- package/dist/hooks/useSeatInbox.js +43 -0
- package/dist/hooks/useSimultaneousPhase.d.ts +7 -0
- package/dist/hooks/useSimultaneousPhase.d.ts.map +1 -0
- package/dist/hooks/useSimultaneousPhase.js +8 -0
- package/dist/hooks/useSquareBoard.d.ts +21 -0
- package/dist/hooks/useSquareBoard.d.ts.map +1 -0
- package/dist/hooks/useSquareBoard.js +67 -0
- package/dist/hooks/useSquareGrid.d.ts +96 -0
- package/dist/hooks/useSquareGrid.d.ts.map +1 -0
- package/dist/hooks/useSquareGrid.js +152 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/internal/ui/alert.d.ts +8 -0
- package/dist/internal/ui/alert.d.ts.map +1 -0
- package/dist/internal/ui/alert.js +11 -0
- package/dist/internal/ui/button.d.ts +10 -0
- package/dist/internal/ui/button.d.ts.map +1 -0
- package/dist/internal/ui/button.js +21 -0
- package/dist/internal/ui/dialog.d.ts +16 -0
- package/dist/internal/ui/dialog.d.ts.map +1 -0
- package/dist/internal/ui/dialog.js +35 -0
- package/dist/internal/ui/input.d.ts +3 -0
- package/dist/internal/ui/input.d.ts.map +1 -0
- package/dist/internal/ui/input.js +5 -0
- package/dist/internal/ui/label.d.ts +4 -0
- package/dist/internal/ui/label.d.ts.map +1 -0
- package/dist/internal/ui/label.js +7 -0
- package/dist/internal/ui/select.d.ts +9 -0
- package/dist/internal/ui/select.d.ts.map +1 -0
- package/dist/internal/ui/select.js +23 -0
- package/dist/internal/ui/tooltip.d.ts +7 -0
- package/dist/internal/ui/tooltip.d.ts.map +1 -0
- package/dist/internal/ui/tooltip.js +16 -0
- package/dist/internal/ui/utils.d.ts +3 -0
- package/dist/internal/ui/utils.d.ts.map +1 -0
- package/dist/internal/ui/utils.js +4 -0
- package/dist/internal.d.ts +7 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +4 -0
- package/dist/plugin-styles.css +246 -0
- package/dist/primitives/board.d.ts +29 -0
- package/dist/primitives/board.d.ts.map +1 -0
- package/dist/primitives/board.js +163 -0
- package/dist/primitives/game-ui-provider.d.ts +12 -0
- package/dist/primitives/game-ui-provider.d.ts.map +1 -0
- package/dist/primitives/game-ui-provider.js +7 -0
- package/dist/primitives/index.d.ts +8 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +7 -0
- package/dist/primitives/interaction.d.ts +52 -0
- package/dist/primitives/interaction.d.ts.map +1 -0
- package/dist/primitives/interaction.js +250 -0
- package/dist/primitives/phase.d.ts +15 -0
- package/dist/primitives/phase.d.ts.map +1 -0
- package/dist/primitives/phase.js +18 -0
- package/dist/primitives/player-roster.d.ts +64 -0
- package/dist/primitives/player-roster.d.ts.map +1 -0
- package/dist/primitives/player-roster.js +149 -0
- package/dist/primitives/primitive-props.d.ts +15 -0
- package/dist/primitives/primitive-props.d.ts.map +1 -0
- package/dist/primitives/primitive-props.js +39 -0
- package/dist/primitives/prompt.d.ts +44 -0
- package/dist/primitives/prompt.d.ts.map +1 -0
- package/dist/primitives/prompt.js +101 -0
- package/dist/primitives/zone.d.ts +31 -0
- package/dist/primitives/zone.d.ts.map +1 -0
- package/dist/primitives/zone.js +58 -0
- package/dist/reducer.d.ts +21 -0
- package/dist/reducer.d.ts.map +1 -0
- package/dist/reducer.js +14 -0
- package/dist/runtime/createPluginRuntimeAPI.d.ts +67 -0
- package/dist/runtime/createPluginRuntimeAPI.d.ts.map +1 -0
- package/dist/runtime/createPluginRuntimeAPI.js +419 -0
- package/dist/theme/ThemeProvider.d.ts +98 -0
- package/dist/theme/ThemeProvider.d.ts.map +1 -0
- package/dist/theme/ThemeProvider.js +148 -0
- package/dist/theme/board.d.ts +42 -0
- package/dist/theme/board.d.ts.map +1 -0
- package/dist/theme/board.js +34 -0
- package/dist/theme/css-vars.d.ts +31 -0
- package/dist/theme/css-vars.d.ts.map +1 -0
- package/dist/theme/css-vars.js +88 -0
- package/dist/theme/derive.d.ts +66 -0
- package/dist/theme/derive.d.ts.map +1 -0
- package/dist/theme/derive.js +161 -0
- package/dist/theme/index.d.ts +22 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +20 -0
- package/dist/theme/presets/arcade.d.ts +10 -0
- package/dist/theme/presets/arcade.d.ts.map +1 -0
- package/dist/theme/presets/arcade.js +257 -0
- package/dist/theme/presets/studio.d.ts +10 -0
- package/dist/theme/presets/studio.d.ts.map +1 -0
- package/dist/theme/presets/studio.js +257 -0
- package/dist/theme/presets/tabletop.d.ts +15 -0
- package/dist/theme/presets/tabletop.d.ts.map +1 -0
- package/dist/theme/presets/tabletop.js +262 -0
- package/dist/theme/tokens.d.ts +345 -0
- package/dist/theme/tokens.d.ts.map +1 -0
- package/dist/theme/tokens.js +57 -0
- package/dist/types/player-state.d.ts +337 -0
- package/dist/types/player-state.d.ts.map +1 -0
- package/dist/types/player-state.js +1 -0
- package/dist/types/plugin-state.d.ts +324 -0
- package/dist/types/plugin-state.d.ts.map +1 -0
- package/dist/types/plugin-state.js +1 -0
- package/dist/types/reducer-state.d.ts +10 -0
- package/dist/types/reducer-state.d.ts.map +1 -0
- package/dist/types/reducer-state.js +1 -0
- package/dist/types/runtime-api.d.ts +99 -0
- package/dist/types/runtime-api.d.ts.map +1 -0
- package/dist/types/runtime-api.js +1 -0
- package/dist/types/tiled-board.d.ts +187 -0
- package/dist/types/tiled-board.d.ts.map +1 -0
- package/dist/types/tiled-board.js +226 -0
- package/dist/ui-contract.d.ts +78 -0
- package/dist/ui-contract.d.ts.map +1 -0
- package/dist/ui-contract.js +15 -0
- package/dist/ui-sdk.d.ts +3409 -0
- package/dist/utils/interaction-inputs.d.ts +22 -0
- package/dist/utils/interaction-inputs.d.ts.map +1 -0
- package/dist/utils/interaction-inputs.js +219 -0
- package/dist/utils/interaction-labels.d.ts +4 -0
- package/dist/utils/interaction-labels.d.ts.map +1 -0
- package/dist/utils/interaction-labels.js +18 -0
- package/dist/utils/interaction-status.d.ts +15 -0
- package/dist/utils/interaction-status.d.ts.map +1 -0
- package/dist/utils/interaction-status.js +31 -0
- package/package.json +101 -0
- package/src/components/ActionButton.tsx +48 -0
- package/src/components/ActionPanel.tsx +310 -0
- package/src/components/Card.tsx +385 -0
- package/src/components/ChromeSuppressionContext.tsx +70 -0
- package/src/components/CostDisplay.test.tsx +23 -0
- package/src/components/CostDisplay.tsx +145 -0
- package/src/components/DiceRoller.tsx +601 -0
- package/src/components/Drawer.tsx +179 -0
- package/src/components/ErrorBoundary.tsx +119 -0
- package/src/components/GameEndDisplay.test.tsx +19 -0
- package/src/components/GameEndDisplay.tsx +398 -0
- package/src/components/GameSkeleton.tsx +260 -0
- package/src/components/Hand.tsx +387 -0
- package/src/components/HandDock.tsx +257 -0
- package/src/components/InteractionForm.test.tsx +303 -0
- package/src/components/InteractionForm.tsx +1029 -0
- package/src/components/MoreActions.test.tsx +93 -0
- package/src/components/MoreActions.tsx +143 -0
- package/src/components/PhaseIndicator.tsx +341 -0
- package/src/components/PlayArea.tsx +125 -0
- package/src/components/PluginRuntime.tsx +92 -0
- package/src/components/PrimaryActionButton.test.tsx +138 -0
- package/src/components/PrimaryActionButton.tsx +351 -0
- package/src/components/PrimaryButton.tsx +44 -0
- package/src/components/PromptDialogHost.tsx +92 -0
- package/src/components/ResourceCounter.test.tsx +29 -0
- package/src/components/ResourceCounter.tsx +275 -0
- package/src/components/ThemedButton.tsx +78 -0
- package/src/components/Toast.tsx +251 -0
- package/src/components/__fixtures__/ActionButton.fixture.tsx +234 -0
- package/src/components/__fixtures__/ActionPanel.fixture.tsx +298 -0
- package/src/components/__fixtures__/Card.fixture.tsx +185 -0
- package/src/components/__fixtures__/CostDisplay.fixture.tsx +156 -0
- package/src/components/__fixtures__/DiceRoller.fixture.tsx +435 -0
- package/src/components/__fixtures__/Drawer.fixture.tsx +113 -0
- package/src/components/__fixtures__/ErrorBoundary.fixture.tsx +82 -0
- package/src/components/__fixtures__/GameEndDisplay.fixture.tsx +188 -0
- package/src/components/__fixtures__/GameSkeleton.fixture.tsx +46 -0
- package/src/components/__fixtures__/Hand.fixture.tsx +522 -0
- package/src/components/__fixtures__/HexGrid.fixture.tsx +1181 -0
- package/src/components/__fixtures__/NetworkGraph.fixture.tsx +599 -0
- package/src/components/__fixtures__/PhaseIndicator.fixture.tsx +181 -0
- package/src/components/__fixtures__/PlayArea.fixture.tsx +221 -0
- package/src/components/__fixtures__/ResourceCounter.fixture.tsx +227 -0
- package/src/components/__fixtures__/SlotSystem.fixture.tsx +824 -0
- package/src/components/__fixtures__/SquareGrid.fixture.tsx +764 -0
- package/src/components/__fixtures__/Toast.fixture.tsx +97 -0
- package/src/components/__fixtures__/TrackBoard.fixture.tsx +685 -0
- package/src/components/__fixtures__/ZoneMap.fixture.tsx +754 -0
- package/src/components/board/HexGrid.tsx +1294 -0
- package/src/components/board/NetworkGraph.tsx +476 -0
- package/src/components/board/SlotSystem.tsx +339 -0
- package/src/components/board/SquareGrid.tsx +1165 -0
- package/src/components/board/TrackBoard.tsx +496 -0
- package/src/components/board/ZoneMap.tsx +448 -0
- package/src/components/board/hex-board-view.test.tsx +114 -0
- package/src/components/board/hex-board-view.ts +123 -0
- package/src/components/board/index.ts +142 -0
- package/src/components/board/interaction-accessibility.ts +21 -0
- package/src/components/board/target-layer-grids.test.tsx +420 -0
- package/src/components/board/target-layer.ts +30 -0
- package/src/components/card-render-content.type-test.ts +27 -0
- package/src/components/index.ts +208 -0
- package/src/components/interaction-dialog-behavior.test.ts +23 -0
- package/src/components/interaction-dialog-behavior.ts +22 -0
- package/src/components/surfaces/BlockerSurface.test.tsx +158 -0
- package/src/components/surfaces/BlockerSurface.tsx +127 -0
- package/src/components/surfaces/BoardSurface.tsx +340 -0
- package/src/components/surfaces/ChromeSurface.tsx +123 -0
- package/src/components/surfaces/ExhaustivenessAudit.tsx +91 -0
- package/src/components/surfaces/InboxSurface.test.tsx +149 -0
- package/src/components/surfaces/InboxSurface.tsx +245 -0
- package/src/components/surfaces/MarketSurface.tsx +544 -0
- package/src/components/surfaces/PanelSurface.test.tsx +496 -0
- package/src/components/surfaces/PanelSurface.tsx +458 -0
- package/src/components/surfaces/PlayerCardsSurface.tsx +525 -0
- package/src/components/surfaces/internal/CardZoneFollowUpForm.tsx +35 -0
- package/src/components/surfaces/internal/DefaultInteractionButton.tsx +219 -0
- package/src/components/surfaces/internal/useCardZoneInteractions.ts +311 -0
- package/src/components/surfaces/types.ts +100 -0
- package/src/context/ClientParamSchemaContext.tsx +44 -0
- package/src/context/InteractionDraftContext.tsx +204 -0
- package/src/context/PluginSessionContext.tsx +47 -0
- package/src/context/PluginStateContext.tsx +254 -0
- package/src/context/RuntimeContext.tsx +96 -0
- package/src/defaults/components.tsx +442 -0
- package/src/defaults/defaults.test.tsx +230 -0
- package/src/defaults/index.ts +1 -0
- package/src/errors/ValidationError.ts +29 -0
- package/src/helpers/cards.ts +19 -0
- package/src/helpers/track-board.ts +211 -0
- package/src/hooks/useActivePlayers.ts +19 -0
- package/src/hooks/useBoardInteractions.test.tsx +622 -0
- package/src/hooks/useBoardInteractions.ts +434 -0
- package/src/hooks/useBoardTopology.ts +316 -0
- package/src/hooks/useCards.test.tsx +129 -0
- package/src/hooks/useCards.ts +10 -0
- package/src/hooks/useGameSelector.ts +105 -0
- package/src/hooks/useGameView.ts +9 -0
- package/src/hooks/useHandLayout.ts +349 -0
- package/src/hooks/useHexBoard.ts +74 -0
- package/src/hooks/useHexGrid.ts +185 -0
- package/src/hooks/useInteractionByKey.ts +349 -0
- package/src/hooks/useInteractionHandle.ts +437 -0
- package/src/hooks/useIsMobile.ts +35 -0
- package/src/hooks/useIsMyTurn.test.tsx +99 -0
- package/src/hooks/useIsMyTurn.ts +15 -0
- package/src/hooks/useLobby.ts +76 -0
- package/src/hooks/useMe.ts +48 -0
- package/src/hooks/usePanZoom.ts +278 -0
- package/src/hooks/usePlayerInfo.ts +28 -0
- package/src/hooks/usePlayerTurnOrder.ts +23 -0
- package/src/hooks/usePluginRuntime.test.tsx +102 -0
- package/src/hooks/usePluginRuntime.ts +130 -0
- package/src/hooks/useSeatInbox.ts +61 -0
- package/src/hooks/useSimultaneousPhase.ts +10 -0
- package/src/hooks/useSquareBoard.ts +124 -0
- package/src/hooks/useSquareGrid.ts +328 -0
- package/src/index.test.ts +474 -0
- package/src/index.ts +148 -0
- package/src/internal/ui/alert.tsx +51 -0
- package/src/internal/ui/button.tsx +58 -0
- package/src/internal/ui/dialog.tsx +134 -0
- package/src/internal/ui/input.tsx +21 -0
- package/src/internal/ui/label.tsx +21 -0
- package/src/internal/ui/select.tsx +129 -0
- package/src/internal/ui/tooltip.tsx +54 -0
- package/src/internal/ui/utils.ts +5 -0
- package/src/internal.ts +18 -0
- package/src/plugin-styles.css +246 -0
- package/src/primitives/board.test.tsx +139 -0
- package/src/primitives/board.tsx +267 -0
- package/src/primitives/game-ui-provider.tsx +35 -0
- package/src/primitives/index.ts +83 -0
- package/src/primitives/interaction.test.tsx +420 -0
- package/src/primitives/interaction.tsx +405 -0
- package/src/primitives/phase.test.tsx +82 -0
- package/src/primitives/phase.tsx +43 -0
- package/src/primitives/player-roster.test.tsx +168 -0
- package/src/primitives/player-roster.tsx +301 -0
- package/src/primitives/primitive-props.tsx +82 -0
- package/src/primitives/prompt.test.tsx +159 -0
- package/src/primitives/prompt.tsx +203 -0
- package/src/primitives/zone.tsx +113 -0
- package/src/reducer.ts +42 -0
- package/src/runtime/createPluginRuntimeAPI.ts +605 -0
- package/src/theme/ThemeProvider.test.tsx +36 -0
- package/src/theme/ThemeProvider.tsx +252 -0
- package/src/theme/board.ts +61 -0
- package/src/theme/css-vars.ts +105 -0
- package/src/theme/derive.ts +240 -0
- package/src/theme/index.ts +61 -0
- package/src/theme/presets/arcade.ts +261 -0
- package/src/theme/presets/studio.ts +261 -0
- package/src/theme/presets/tabletop.ts +266 -0
- package/src/theme/theme.test.ts +258 -0
- package/src/theme/tokens.ts +392 -0
- package/src/types/player-state.ts +445 -0
- package/src/types/plugin-state.ts +407 -0
- package/src/types/reducer-state.ts +24 -0
- package/src/types/runtime-api.ts +114 -0
- package/src/types/tiled-board.ts +785 -0
- package/src/ui-contract.ts +168 -0
- package/src/utils/interaction-inputs.test.ts +109 -0
- package/src/utils/interaction-inputs.ts +331 -0
- package/src/utils/interaction-labels.ts +23 -0
- package/src/utils/interaction-status.ts +59 -0
package/dist/ui-sdk.d.ts
ADDED
|
@@ -0,0 +1,3409 @@
|
|
|
1
|
+
import { PlayerId as PlayerId$1, BoardId, SpaceId, SpaceTypeId, EdgeTypeId, VertexTypeId, PieceId, PieceTypeId, BoardBaseId, PerPlayer, DieId, CardIdsByDeckId, CardId, CardProperties, ResourceId } from '@dreamboard/manifest-contract';
|
|
2
|
+
export { BoardRef, PerPlayer, PerPlayerBoardRef, SharedBoardRef } from '@dreamboard/manifest-contract';
|
|
3
|
+
import { GameView, PhaseName } from '@dreamboard/ui-contract';
|
|
4
|
+
import * as React$1 from 'react';
|
|
5
|
+
import React__default, { ReactNode, CSSProperties, AriaAttributes, HTMLAttributes, JSX, ReactElement, ButtonHTMLAttributes, InputHTMLAttributes, RefObject, Component, ErrorInfo, ComponentType, ComponentProps } from 'react';
|
|
6
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
|
+
import { HTMLMotionProps } from 'framer-motion';
|
|
8
|
+
|
|
9
|
+
declare function useActivePlayers(): readonly PlayerId$1[];
|
|
10
|
+
|
|
11
|
+
type ActionName = string;
|
|
12
|
+
interface SeatAssignment {
|
|
13
|
+
playerId: PlayerId$1;
|
|
14
|
+
controllerUserId?: string;
|
|
15
|
+
displayName: string;
|
|
16
|
+
playerColor?: string;
|
|
17
|
+
isHost?: boolean;
|
|
18
|
+
}
|
|
19
|
+
interface HistoryEntrySummary {
|
|
20
|
+
id: string;
|
|
21
|
+
version: number;
|
|
22
|
+
timestamp: string;
|
|
23
|
+
description: string;
|
|
24
|
+
playerId?: PlayerId$1;
|
|
25
|
+
actionType?: ActionName;
|
|
26
|
+
isCurrent: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface LobbyState {
|
|
30
|
+
|
|
31
|
+
seats: SeatAssignment[];
|
|
32
|
+
|
|
33
|
+
canStart: boolean;
|
|
34
|
+
|
|
35
|
+
hostUserId: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
type NotificationType = "YOUR_TURN" | "PROMPT_OPENED" | "ACTION_EXECUTED" | "ACTION_REJECTED" | "TURN_CHANGED" | "STATE_CHANGED" | "GAME_ENDED" | "ERROR";
|
|
39
|
+
|
|
40
|
+
interface YourTurnPayload {
|
|
41
|
+
type: "YOUR_TURN";
|
|
42
|
+
activePlayers: PlayerId$1[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface PromptOpenedPayload {
|
|
46
|
+
type: "PROMPT_OPENED";
|
|
47
|
+
promptId: string;
|
|
48
|
+
promptInstanceId: string;
|
|
49
|
+
targetPlayer: PlayerId$1;
|
|
50
|
+
title?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface ActionExecutedPayload {
|
|
54
|
+
type: "ACTION_EXECUTED";
|
|
55
|
+
playerId: PlayerId$1;
|
|
56
|
+
actionType: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface ActionRejectedPayload {
|
|
60
|
+
type: "ACTION_REJECTED";
|
|
61
|
+
reason: string;
|
|
62
|
+
targetPlayer?: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
interface StateChangedPayload {
|
|
66
|
+
type: "STATE_CHANGED";
|
|
67
|
+
newState: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
interface TurnChangedPayload {
|
|
71
|
+
type: "TURN_CHANGED";
|
|
72
|
+
previousPlayers: PlayerId$1[];
|
|
73
|
+
currentPlayers: PlayerId$1[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
interface GameEndedPayload {
|
|
77
|
+
type: "GAME_ENDED";
|
|
78
|
+
winner?: string;
|
|
79
|
+
finalScores: Record<string, number>;
|
|
80
|
+
reason: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
interface ErrorPayload {
|
|
84
|
+
type: "ERROR";
|
|
85
|
+
message: string;
|
|
86
|
+
code?: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
type NotificationPayload = YourTurnPayload | PromptOpenedPayload | ActionExecutedPayload | ActionRejectedPayload | TurnChangedPayload | StateChangedPayload | GameEndedPayload | ErrorPayload;
|
|
90
|
+
|
|
91
|
+
interface Notification {
|
|
92
|
+
|
|
93
|
+
id: string;
|
|
94
|
+
|
|
95
|
+
type: NotificationType;
|
|
96
|
+
|
|
97
|
+
payload: NotificationPayload;
|
|
98
|
+
|
|
99
|
+
timestamp: number;
|
|
100
|
+
|
|
101
|
+
read: boolean;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
interface PluginSessionState$1 {
|
|
105
|
+
|
|
106
|
+
sessionId: string | null;
|
|
107
|
+
|
|
108
|
+
controllablePlayerIds: PlayerId$1[];
|
|
109
|
+
|
|
110
|
+
controllingPlayerId: PlayerId$1 | null;
|
|
111
|
+
|
|
112
|
+
userId: string | null;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
interface HistoryState {
|
|
116
|
+
|
|
117
|
+
entries: HistoryEntrySummary[];
|
|
118
|
+
|
|
119
|
+
currentIndex: number;
|
|
120
|
+
|
|
121
|
+
canGoBack: boolean;
|
|
122
|
+
|
|
123
|
+
canGoForward: boolean;
|
|
124
|
+
}
|
|
125
|
+
interface GameplayPromptOption {
|
|
126
|
+
id: string;
|
|
127
|
+
label: string;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
interface InteractionContextOption {
|
|
131
|
+
id: string;
|
|
132
|
+
label?: string;
|
|
133
|
+
data?: unknown;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
interface InteractionContext {
|
|
137
|
+
|
|
138
|
+
to: string;
|
|
139
|
+
title?: string;
|
|
140
|
+
|
|
141
|
+
payload?: Record<string, unknown>;
|
|
142
|
+
|
|
143
|
+
options?: readonly InteractionContextOption[];
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
type InteractionKind = "action" | "prompt";
|
|
147
|
+
type InteractionCommitPolicy = {
|
|
148
|
+
mode: "manual";
|
|
149
|
+
} | {
|
|
150
|
+
mode: "autoWhenReady";
|
|
151
|
+
};
|
|
152
|
+
interface InputSelection {
|
|
153
|
+
mode: "single" | "many";
|
|
154
|
+
min?: number;
|
|
155
|
+
max?: number;
|
|
156
|
+
distinct?: boolean;
|
|
157
|
+
}
|
|
158
|
+
interface InputDomain {
|
|
159
|
+
type: "target" | "resourceMap" | "boundedNumber" | "choice" | "choiceList";
|
|
160
|
+
targetKind?: string;
|
|
161
|
+
boardId?: string;
|
|
162
|
+
zoneId?: string;
|
|
163
|
+
zoneIds?: readonly string[];
|
|
164
|
+
eligibleTargets?: readonly string[];
|
|
165
|
+
resources?: ReadonlyArray<{
|
|
166
|
+
resourceId: string;
|
|
167
|
+
label?: string;
|
|
168
|
+
icon?: string;
|
|
169
|
+
min: number;
|
|
170
|
+
max: number;
|
|
171
|
+
}>;
|
|
172
|
+
min?: number;
|
|
173
|
+
max?: number;
|
|
174
|
+
step?: number;
|
|
175
|
+
choices?: readonly InteractionChoiceOption[];
|
|
176
|
+
selection?: InputSelection;
|
|
177
|
+
}
|
|
178
|
+
interface InteractionChoiceOption {
|
|
179
|
+
value: string;
|
|
180
|
+
label: string;
|
|
181
|
+
icon?: string;
|
|
182
|
+
badge?: string;
|
|
183
|
+
description?: string;
|
|
184
|
+
disabled?: boolean;
|
|
185
|
+
disabledReason?: string;
|
|
186
|
+
}
|
|
187
|
+
interface InteractionInputDescriptor {
|
|
188
|
+
key: string;
|
|
189
|
+
kind: string;
|
|
190
|
+
domain: InputDomain;
|
|
191
|
+
defaultValue?: unknown;
|
|
192
|
+
}
|
|
193
|
+
interface InteractionDescriptor<Key extends string = string> {
|
|
194
|
+
phaseName: string;
|
|
195
|
+
interactionKey: Key;
|
|
196
|
+
interactionId: string;
|
|
197
|
+
|
|
198
|
+
kind: InteractionKind;
|
|
199
|
+
|
|
200
|
+
commit: InteractionCommitPolicy;
|
|
201
|
+
|
|
202
|
+
zoneId?: string;
|
|
203
|
+
|
|
204
|
+
zoneIds?: readonly string[];
|
|
205
|
+
|
|
206
|
+
inputs: readonly InteractionInputDescriptor[];
|
|
207
|
+
|
|
208
|
+
cost?: Record<string, unknown>;
|
|
209
|
+
|
|
210
|
+
currentResources?: Record<string, unknown>;
|
|
211
|
+
|
|
212
|
+
available: boolean;
|
|
213
|
+
unavailableReason?: string;
|
|
214
|
+
|
|
215
|
+
context?: InteractionContext;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
interface ZoneHandlesSnapshot<InteractionType extends string = string> {
|
|
219
|
+
cardIds: readonly string[];
|
|
220
|
+
cardsById: Readonly<Record<string, string>>;
|
|
221
|
+
playableByCardId: Readonly<Record<string, ReadonlyArray<InteractionDescriptor<InteractionType>>>>;
|
|
222
|
+
}
|
|
223
|
+
interface SimultaneousPhaseSnapshot {
|
|
224
|
+
phaseName: string;
|
|
225
|
+
interactionId: string;
|
|
226
|
+
actorIds: PlayerId$1[];
|
|
227
|
+
sealedPlayerIds: PlayerId$1[];
|
|
228
|
+
pendingPlayerIds: PlayerId$1[];
|
|
229
|
+
}
|
|
230
|
+
interface GameplaySnapshot$1<PhaseType extends string = string, StageType extends string = string, InteractionType extends string = string> {
|
|
231
|
+
currentPhase: PhaseType | null;
|
|
232
|
+
currentStage: StageType | null;
|
|
233
|
+
activePlayers: PlayerId$1[];
|
|
234
|
+
simultaneousPhase?: SimultaneousPhaseSnapshot | null;
|
|
235
|
+
availableInteractions: ReadonlyArray<InteractionDescriptor<InteractionType>>;
|
|
236
|
+
|
|
237
|
+
zones: Readonly<Record<string, ZoneHandlesSnapshot<InteractionType>>>;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
interface PluginStateSnapshot<View = unknown, PhaseType extends string = string, StageType extends string = string, InteractionType extends string = string> {
|
|
241
|
+
|
|
242
|
+
view: View | null;
|
|
243
|
+
|
|
244
|
+
gameplay: GameplaySnapshot$1<PhaseType, StageType, InteractionType>;
|
|
245
|
+
|
|
246
|
+
lobby: LobbyState | null;
|
|
247
|
+
|
|
248
|
+
notifications: Notification[];
|
|
249
|
+
|
|
250
|
+
session: PluginSessionState$1;
|
|
251
|
+
|
|
252
|
+
history: HistoryState | null;
|
|
253
|
+
|
|
254
|
+
syncId: number;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
declare function useSimultaneousPhase(): SimultaneousPhaseSnapshot | null;
|
|
258
|
+
|
|
259
|
+
declare function usePlayerTurnOrder(): readonly PlayerId$1[];
|
|
260
|
+
|
|
261
|
+
type EqualityFn<T> = (left: T, right: T) => boolean;
|
|
262
|
+
|
|
263
|
+
declare function useGameSelector<T>(selector: (state: GameView) => T, equalityFn?: EqualityFn<T>): T;
|
|
264
|
+
|
|
265
|
+
declare function useIsMyTurn(): boolean;
|
|
266
|
+
|
|
267
|
+
interface ViewCard<CardIdValue extends string = string, CardTypeValue extends string = string, Properties extends Record<string, unknown> = Record<string, unknown>> {
|
|
268
|
+
id: CardIdValue;
|
|
269
|
+
cardType: CardTypeValue;
|
|
270
|
+
name?: string;
|
|
271
|
+
text?: string;
|
|
272
|
+
properties: Properties;
|
|
273
|
+
}
|
|
274
|
+
interface CardCollection<CardIdValue extends string = string, Card extends ViewCard<CardIdValue> = ViewCard<CardIdValue>> {
|
|
275
|
+
cardIds: readonly CardIdValue[];
|
|
276
|
+
cardsById: Readonly<Record<CardIdValue, Card | undefined>>;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
interface ViewSlotOccupant<PieceIdValue extends string = string, PlayerIdValue extends string = string, SlotIdValue extends string = string, Data extends Record<string, unknown> = Record<string, unknown>> {
|
|
280
|
+
pieceId: PieceIdValue;
|
|
281
|
+
playerId: PlayerIdValue | null;
|
|
282
|
+
slotId: SlotIdValue;
|
|
283
|
+
data?: Data;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
declare function useCards<CardIdValue extends string, CardValue extends ViewCard<CardIdValue>>(collection: CardCollection<CardIdValue, CardValue>): CardValue[];
|
|
287
|
+
|
|
288
|
+
declare function useGameView(): GameView;
|
|
289
|
+
|
|
290
|
+
declare function useLobby(): LobbyState;
|
|
291
|
+
|
|
292
|
+
type CardIdsByHandId = Record<string, PerPlayer<CardId[]>>;
|
|
293
|
+
type StateName = string;
|
|
294
|
+
type TilePropertiesByBoardId = Record<BoardId, Record<string, unknown>>;
|
|
295
|
+
type EdgePropertiesByBoardId = Record<BoardId, Record<string, unknown>>;
|
|
296
|
+
type VertexPropertiesByBoardId = Record<BoardId, Record<string, unknown>>;
|
|
297
|
+
interface Player {
|
|
298
|
+
|
|
299
|
+
playerId: PlayerId$1;
|
|
300
|
+
|
|
301
|
+
name: string;
|
|
302
|
+
|
|
303
|
+
isHost?: boolean;
|
|
304
|
+
|
|
305
|
+
color?: string;
|
|
306
|
+
}
|
|
307
|
+
interface HexTileState<B extends string = BoardId, SpaceIdValue extends SpaceId = SpaceId, Properties = B extends keyof TilePropertiesByBoardId ? TilePropertiesByBoardId[B] : undefined, View = unknown> {
|
|
308
|
+
|
|
309
|
+
id: SpaceIdValue;
|
|
310
|
+
|
|
311
|
+
q: number;
|
|
312
|
+
|
|
313
|
+
r: number;
|
|
314
|
+
|
|
315
|
+
typeId?: SpaceTypeId;
|
|
316
|
+
|
|
317
|
+
label?: string;
|
|
318
|
+
|
|
319
|
+
owner?: PlayerId$1;
|
|
320
|
+
|
|
321
|
+
properties?: Properties;
|
|
322
|
+
|
|
323
|
+
view?: View;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
interface HexEdgeState<B extends string = BoardId, SpaceIdValue extends SpaceId = SpaceId, EdgeIdValue extends string = string, Properties = B extends keyof EdgePropertiesByBoardId ? EdgePropertiesByBoardId[B] : undefined> {
|
|
327
|
+
|
|
328
|
+
id: EdgeIdValue;
|
|
329
|
+
|
|
330
|
+
hex1: SpaceIdValue;
|
|
331
|
+
|
|
332
|
+
hex2: SpaceIdValue;
|
|
333
|
+
|
|
334
|
+
typeId?: EdgeTypeId;
|
|
335
|
+
|
|
336
|
+
label?: string;
|
|
337
|
+
|
|
338
|
+
owner?: PlayerId$1;
|
|
339
|
+
|
|
340
|
+
properties?: Properties;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
interface HexVertexState<B extends string = BoardId, SpaceIdValue extends SpaceId = SpaceId, VertexIdValue extends string = string, Properties = B extends keyof VertexPropertiesByBoardId ? VertexPropertiesByBoardId[B] : undefined> {
|
|
344
|
+
|
|
345
|
+
id: VertexIdValue;
|
|
346
|
+
|
|
347
|
+
hexes: readonly SpaceIdValue[];
|
|
348
|
+
|
|
349
|
+
typeId?: VertexTypeId;
|
|
350
|
+
|
|
351
|
+
label?: string;
|
|
352
|
+
|
|
353
|
+
owner?: PlayerId$1;
|
|
354
|
+
|
|
355
|
+
properties?: Properties;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
interface HexBoardState<B extends string = BoardId, SpaceIdValue extends SpaceId = SpaceId, EdgeIdValue extends string = string, VertexIdValue extends string = string, TileProperties = B extends keyof TilePropertiesByBoardId ? TilePropertiesByBoardId[B] : undefined, EdgeProperties = B extends keyof EdgePropertiesByBoardId ? EdgePropertiesByBoardId[B] : undefined, VertexProperties = B extends keyof VertexPropertiesByBoardId ? VertexPropertiesByBoardId[B] : undefined> {
|
|
359
|
+
|
|
360
|
+
id: B;
|
|
361
|
+
|
|
362
|
+
tiles: ReadonlyArray<HexTileState<B, SpaceIdValue, TileProperties>>;
|
|
363
|
+
|
|
364
|
+
edges: ReadonlyArray<HexEdgeState<B, SpaceIdValue, EdgeIdValue, EdgeProperties>>;
|
|
365
|
+
|
|
366
|
+
vertices: ReadonlyArray<HexVertexState<B, SpaceIdValue, VertexIdValue, VertexProperties>>;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
interface NetworkNodeState {
|
|
370
|
+
|
|
371
|
+
id: SpaceId;
|
|
372
|
+
|
|
373
|
+
x: number;
|
|
374
|
+
|
|
375
|
+
y: number;
|
|
376
|
+
|
|
377
|
+
typeId?: SpaceTypeId;
|
|
378
|
+
|
|
379
|
+
label?: string;
|
|
380
|
+
|
|
381
|
+
owner?: PlayerId$1;
|
|
382
|
+
|
|
383
|
+
properties?: string;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
interface NetworkEdgeState {
|
|
387
|
+
|
|
388
|
+
id: string;
|
|
389
|
+
|
|
390
|
+
from: SpaceId;
|
|
391
|
+
|
|
392
|
+
to: SpaceId;
|
|
393
|
+
|
|
394
|
+
typeId?: string;
|
|
395
|
+
|
|
396
|
+
label?: string;
|
|
397
|
+
|
|
398
|
+
owner?: PlayerId$1;
|
|
399
|
+
|
|
400
|
+
properties?: string;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
interface NetworkPieceState {
|
|
404
|
+
|
|
405
|
+
id: PieceId;
|
|
406
|
+
|
|
407
|
+
nodeId: SpaceId;
|
|
408
|
+
|
|
409
|
+
typeId?: PieceTypeId;
|
|
410
|
+
|
|
411
|
+
owner?: PlayerId$1;
|
|
412
|
+
|
|
413
|
+
properties?: string;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
interface NetworkBoardState {
|
|
417
|
+
|
|
418
|
+
id: BoardId;
|
|
419
|
+
|
|
420
|
+
nodes: NetworkNodeState[];
|
|
421
|
+
|
|
422
|
+
edges: NetworkEdgeState[];
|
|
423
|
+
|
|
424
|
+
pieces: NetworkPieceState[];
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
interface SquareCellState<SpaceIdValue extends SpaceId = SpaceId, Properties = Record<string, unknown>> {
|
|
428
|
+
|
|
429
|
+
id: SpaceIdValue;
|
|
430
|
+
|
|
431
|
+
row: number;
|
|
432
|
+
|
|
433
|
+
col: number;
|
|
434
|
+
|
|
435
|
+
typeId?: SpaceTypeId;
|
|
436
|
+
|
|
437
|
+
label?: string;
|
|
438
|
+
|
|
439
|
+
owner?: PlayerId$1;
|
|
440
|
+
|
|
441
|
+
properties?: Properties;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
interface SquareEdgeState<SpaceIdValue extends SpaceId = SpaceId, EdgeIdValue extends string = string, Properties = Record<string, unknown>> {
|
|
445
|
+
|
|
446
|
+
id: EdgeIdValue;
|
|
447
|
+
|
|
448
|
+
spaceIds: readonly SpaceIdValue[];
|
|
449
|
+
|
|
450
|
+
typeId?: EdgeTypeId;
|
|
451
|
+
|
|
452
|
+
label?: string;
|
|
453
|
+
|
|
454
|
+
owner?: PlayerId$1;
|
|
455
|
+
|
|
456
|
+
properties?: Properties;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
interface SquareVertexState<SpaceIdValue extends SpaceId = SpaceId, VertexIdValue extends string = string, Properties = Record<string, unknown>> {
|
|
460
|
+
|
|
461
|
+
id: VertexIdValue;
|
|
462
|
+
|
|
463
|
+
spaceIds: readonly SpaceIdValue[];
|
|
464
|
+
|
|
465
|
+
typeId?: VertexTypeId;
|
|
466
|
+
|
|
467
|
+
label?: string;
|
|
468
|
+
|
|
469
|
+
owner?: PlayerId$1;
|
|
470
|
+
|
|
471
|
+
properties?: Properties;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
interface SquarePieceState<PieceIdValue extends PieceId = PieceId, Properties = Record<string, unknown>> {
|
|
475
|
+
|
|
476
|
+
id: PieceIdValue;
|
|
477
|
+
|
|
478
|
+
row: number;
|
|
479
|
+
|
|
480
|
+
col: number;
|
|
481
|
+
|
|
482
|
+
typeId: PieceTypeId;
|
|
483
|
+
|
|
484
|
+
owner?: PlayerId$1;
|
|
485
|
+
|
|
486
|
+
properties?: Properties;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
interface SquareBoardState<B extends string = BoardId, SpaceIdValue extends SpaceId = SpaceId, EdgeIdValue extends string = string, VertexIdValue extends string = string, PieceIdValue extends PieceId = PieceId, CellProperties = Record<string, unknown>, EdgeProperties = Record<string, unknown>, VertexProperties = Record<string, unknown>, PieceProperties = Record<string, unknown>> {
|
|
490
|
+
|
|
491
|
+
id: B;
|
|
492
|
+
|
|
493
|
+
rows: number;
|
|
494
|
+
|
|
495
|
+
cols: number;
|
|
496
|
+
|
|
497
|
+
cells: ReadonlyArray<SquareCellState<SpaceIdValue, CellProperties>>;
|
|
498
|
+
|
|
499
|
+
edges: ReadonlyArray<SquareEdgeState<SpaceIdValue, EdgeIdValue, EdgeProperties>>;
|
|
500
|
+
|
|
501
|
+
vertices: ReadonlyArray<SquareVertexState<SpaceIdValue, VertexIdValue, VertexProperties>>;
|
|
502
|
+
|
|
503
|
+
pieces: ReadonlyArray<SquarePieceState<PieceIdValue, PieceProperties>>;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
interface TrackSpaceState {
|
|
507
|
+
|
|
508
|
+
id: SpaceId;
|
|
509
|
+
|
|
510
|
+
index: number;
|
|
511
|
+
|
|
512
|
+
x: number;
|
|
513
|
+
|
|
514
|
+
y: number;
|
|
515
|
+
|
|
516
|
+
name?: string;
|
|
517
|
+
|
|
518
|
+
typeId?: SpaceTypeId;
|
|
519
|
+
|
|
520
|
+
owner?: PlayerId$1;
|
|
521
|
+
|
|
522
|
+
nextSpaces?: SpaceId[];
|
|
523
|
+
|
|
524
|
+
properties?: string;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
interface TrackPieceState {
|
|
528
|
+
|
|
529
|
+
id: PieceId;
|
|
530
|
+
|
|
531
|
+
spaceId: SpaceId;
|
|
532
|
+
|
|
533
|
+
owner: PlayerId$1;
|
|
534
|
+
|
|
535
|
+
typeId?: PieceTypeId;
|
|
536
|
+
|
|
537
|
+
properties?: string;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
interface TrackBoardState {
|
|
541
|
+
|
|
542
|
+
id: BoardId;
|
|
543
|
+
|
|
544
|
+
spaces: TrackSpaceState[];
|
|
545
|
+
|
|
546
|
+
pieces: TrackPieceState[];
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
interface DieState {
|
|
550
|
+
|
|
551
|
+
id: DieId;
|
|
552
|
+
|
|
553
|
+
sides: number;
|
|
554
|
+
|
|
555
|
+
currentValue?: number;
|
|
556
|
+
|
|
557
|
+
color?: string;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
interface BoardKindStates<State> {
|
|
561
|
+
|
|
562
|
+
shared: Record<BoardBaseId, State>;
|
|
563
|
+
|
|
564
|
+
perPlayer: Record<BoardBaseId, PerPlayer<State>>;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
interface BoardStates {
|
|
568
|
+
|
|
569
|
+
hex: BoardKindStates<HexBoardState>;
|
|
570
|
+
|
|
571
|
+
network: BoardKindStates<NetworkBoardState>;
|
|
572
|
+
|
|
573
|
+
square: BoardKindStates<SquareBoardState>;
|
|
574
|
+
|
|
575
|
+
track: BoardKindStates<TrackBoardState>;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
type DiceStates = Record<DieId, DieState>;
|
|
579
|
+
interface GameState {
|
|
580
|
+
|
|
581
|
+
currentPlayerIds: PlayerId$1[];
|
|
582
|
+
decks: CardIdsByDeckId;
|
|
583
|
+
|
|
584
|
+
hands: CardIdsByHandId;
|
|
585
|
+
|
|
586
|
+
cards: Record<CardId, ViewCard<CardId, string, CardProperties>>;
|
|
587
|
+
|
|
588
|
+
playerResources: PerPlayer<Record<string, number>>;
|
|
589
|
+
currentState: StateName;
|
|
590
|
+
isMyTurn: boolean;
|
|
591
|
+
boards: BoardStates;
|
|
592
|
+
dice: DiceStates;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
declare function useMe(): Player;
|
|
596
|
+
|
|
597
|
+
declare function usePlayerInfo(): Map<PlayerId$1, Player>;
|
|
598
|
+
|
|
599
|
+
interface SeatInbox {
|
|
600
|
+
|
|
601
|
+
bySurface: Record<string, readonly InteractionDescriptor[]>;
|
|
602
|
+
|
|
603
|
+
prompts: readonly InteractionDescriptor[];
|
|
604
|
+
|
|
605
|
+
all: readonly InteractionDescriptor[];
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
declare function useSeatInbox(): SeatInbox;
|
|
609
|
+
|
|
610
|
+
type InteractionParamsShape = Record<string, unknown>;
|
|
611
|
+
type InteractionHandleStatus = "open" | "submitting" | "submitted";
|
|
612
|
+
type DraftValidation<Params extends InteractionParamsShape = InteractionParamsShape> = {
|
|
613
|
+
ok: true;
|
|
614
|
+
params: Params;
|
|
615
|
+
fieldErrors: Partial<Record<keyof Params & string, readonly string[]>>;
|
|
616
|
+
formErrors: readonly string[];
|
|
617
|
+
missing: ReadonlyArray<keyof Params & string>;
|
|
618
|
+
} | {
|
|
619
|
+
ok: false;
|
|
620
|
+
fieldErrors: Partial<Record<keyof Params & string, readonly string[]>>;
|
|
621
|
+
formErrors: readonly string[];
|
|
622
|
+
missing: ReadonlyArray<keyof Params & string>;
|
|
623
|
+
};
|
|
624
|
+
|
|
625
|
+
interface InteractionHandle<Params extends InteractionParamsShape = InteractionParamsShape, DefaultedKeys extends keyof Params & string = never> {
|
|
626
|
+
descriptor: InteractionDescriptor;
|
|
627
|
+
|
|
628
|
+
commit: InteractionDescriptor["commit"];
|
|
629
|
+
|
|
630
|
+
submit: (params?: Params) => Promise<void>;
|
|
631
|
+
|
|
632
|
+
validate: (params?: Params) => Promise<void>;
|
|
633
|
+
|
|
634
|
+
validateDraft: () => DraftValidation<Params>;
|
|
635
|
+
|
|
636
|
+
validateDraftServer: () => Promise<void>;
|
|
637
|
+
|
|
638
|
+
submitDraft: () => Promise<void>;
|
|
639
|
+
|
|
640
|
+
available: boolean;
|
|
641
|
+
|
|
642
|
+
unavailableReason?: string;
|
|
643
|
+
|
|
644
|
+
status: InteractionHandleStatus;
|
|
645
|
+
|
|
646
|
+
draft: Readonly<Partial<Params>>;
|
|
647
|
+
|
|
648
|
+
values: Readonly<Partial<Params> & Pick<Params, DefaultedKeys>>;
|
|
649
|
+
|
|
650
|
+
setInput: <K extends keyof Params & string>(key: K, value: Params[K]) => void;
|
|
651
|
+
|
|
652
|
+
clearInput: (key?: keyof Params & string) => void;
|
|
653
|
+
|
|
654
|
+
isReady: boolean;
|
|
655
|
+
|
|
656
|
+
isArmed: boolean;
|
|
657
|
+
|
|
658
|
+
arm: () => void;
|
|
659
|
+
|
|
660
|
+
disarm: () => void;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
declare function useInteractionHandle<Params extends InteractionParamsShape = InteractionParamsShape, DefaultedKeys extends keyof Params & string = never>(descriptor: InteractionDescriptor): InteractionHandle<Params, DefaultedKeys>;
|
|
664
|
+
|
|
665
|
+
declare function useInteractionByKey<Key extends string = string, Params extends InteractionParamsShape = InteractionParamsShape, DefaultedKeys extends keyof Params & string = never>(interactionKey: Key | null | undefined): InteractionHandle<Params, DefaultedKeys> | null;
|
|
666
|
+
|
|
667
|
+
interface ValidationResult {
|
|
668
|
+
|
|
669
|
+
valid: boolean;
|
|
670
|
+
|
|
671
|
+
errorCode?: string;
|
|
672
|
+
|
|
673
|
+
message?: string;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
interface SubmissionError extends Error {
|
|
677
|
+
|
|
678
|
+
errorCode?: string;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
interface PluginSessionState {
|
|
682
|
+
|
|
683
|
+
status: "loading" | "ready";
|
|
684
|
+
|
|
685
|
+
sessionId: string | null;
|
|
686
|
+
|
|
687
|
+
controllablePlayerIds: PlayerId$1[];
|
|
688
|
+
|
|
689
|
+
controllingPlayerId: PlayerId$1 | null;
|
|
690
|
+
|
|
691
|
+
userId: string | null;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
interface RuntimeAPI {
|
|
695
|
+
|
|
696
|
+
validateInteraction: (playerId: PlayerId$1, interactionId: string, params: unknown) => Promise<ValidationResult>;
|
|
697
|
+
|
|
698
|
+
submitInteraction: (playerId: PlayerId$1, interactionId: string, params: unknown) => Promise<void>;
|
|
699
|
+
|
|
700
|
+
getSessionState: () => PluginSessionState;
|
|
701
|
+
|
|
702
|
+
disconnect: () => void;
|
|
703
|
+
|
|
704
|
+
switchPlayer?: (playerId: PlayerId$1) => void;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
declare function usePluginSession(): PluginSessionState;
|
|
708
|
+
|
|
709
|
+
interface ClientParamSchema {
|
|
710
|
+
safeParse: (value: unknown) => {
|
|
711
|
+
success: true;
|
|
712
|
+
data: Record<string, unknown>;
|
|
713
|
+
} | {
|
|
714
|
+
success: false;
|
|
715
|
+
error: {
|
|
716
|
+
issues: ReadonlyArray<{
|
|
717
|
+
path: readonly PropertyKey[];
|
|
718
|
+
message: string;
|
|
719
|
+
}>;
|
|
720
|
+
};
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
type ClientParamSchemaMap = Readonly<Record<string, Readonly<Record<string, ClientParamSchema>>>>;
|
|
724
|
+
|
|
725
|
+
type StageName = string;
|
|
726
|
+
type InteractionId = string;
|
|
727
|
+
type GameplaySnapshot = GameplaySnapshot$1<PhaseName, StageName, InteractionId>;
|
|
728
|
+
|
|
729
|
+
interface PromptDialogHostProps {
|
|
730
|
+
contentClassName?: string;
|
|
731
|
+
messageClassName?: string;
|
|
732
|
+
optionClassName?: string;
|
|
733
|
+
optionsClassName?: string;
|
|
734
|
+
overlayClassName?: string;
|
|
735
|
+
titleClassName?: string;
|
|
736
|
+
renderBody?: (prompt: InteractionDescriptor) => ReactNode;
|
|
737
|
+
renderOptionLabel?: (option: InteractionContextOption, prompt: InteractionDescriptor) => ReactNode;
|
|
738
|
+
onSubmitError?: (error: unknown, prompt: InteractionDescriptor, option: InteractionContextOption) => void;
|
|
739
|
+
}
|
|
740
|
+
declare function PromptDialogHost(props: PromptDialogHostProps): react_jsx_runtime.JSX.Element | null;
|
|
741
|
+
|
|
742
|
+
interface InteractiveTargetLayer {
|
|
743
|
+
enabled?: boolean;
|
|
744
|
+
eligible?: ReadonlySet<string>;
|
|
745
|
+
selectTargetId?: (targetId: string) => void | Promise<void>;
|
|
746
|
+
}
|
|
747
|
+
interface InteractiveTargetRenderState {
|
|
748
|
+
isEnabled: boolean;
|
|
749
|
+
isEligible: boolean;
|
|
750
|
+
isHovered: boolean;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
type BoardTargetKind = "edge" | "vertex" | "space" | "tile";
|
|
754
|
+
|
|
755
|
+
type BoardEligibleTargets = Readonly<Record<BoardTargetKind, ReadonlySet<string>>>;
|
|
756
|
+
interface BoardTargetLayerOptions {
|
|
757
|
+
enabled?: boolean;
|
|
758
|
+
extraInputs?: Record<string, unknown> | ((targetId: string) => Record<string, unknown>);
|
|
759
|
+
onBeforeSelect?: () => void;
|
|
760
|
+
onError?: (error: unknown) => void;
|
|
761
|
+
}
|
|
762
|
+
type BoardTargetLayerFactory = (options?: BoardTargetLayerOptions) => InteractiveTargetLayer;
|
|
763
|
+
interface BoardInteractionsOptions {
|
|
764
|
+
|
|
765
|
+
targetKinds?: readonly BoardTargetKind[];
|
|
766
|
+
}
|
|
767
|
+
declare class BoardInteractionConflictError extends Error {
|
|
768
|
+
readonly name = "BoardInteractionConflictError";
|
|
769
|
+
readonly targetKind: BoardTargetKind;
|
|
770
|
+
readonly targetId: string;
|
|
771
|
+
readonly interactionKeys: readonly string[];
|
|
772
|
+
constructor({ targetKind, targetId, interactionKeys, }: {
|
|
773
|
+
targetKind: BoardTargetKind;
|
|
774
|
+
targetId: string;
|
|
775
|
+
interactionKeys: readonly string[];
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
interface BoardInteractionsContext<I extends string = string> {
|
|
780
|
+
|
|
781
|
+
interactions: ReadonlyArray<InteractionDescriptor<I>>;
|
|
782
|
+
|
|
783
|
+
eligible: BoardEligibleTargets;
|
|
784
|
+
|
|
785
|
+
isEligible(targetId: string, targetKind?: BoardTargetKind): boolean;
|
|
786
|
+
|
|
787
|
+
select: {
|
|
788
|
+
edge(targetId: string, extraInputs?: Record<string, unknown>): Promise<string | null>;
|
|
789
|
+
vertex(targetId: string, extraInputs?: Record<string, unknown>): Promise<string | null>;
|
|
790
|
+
space(targetId: string, extraInputs?: Record<string, unknown>): Promise<string | null>;
|
|
791
|
+
tile(targetId: string, extraInputs?: Record<string, unknown>): Promise<string | null>;
|
|
792
|
+
};
|
|
793
|
+
|
|
794
|
+
targetLayers: {
|
|
795
|
+
edge: BoardTargetLayerFactory;
|
|
796
|
+
vertex: BoardTargetLayerFactory;
|
|
797
|
+
space: BoardTargetLayerFactory;
|
|
798
|
+
tile: BoardTargetLayerFactory;
|
|
799
|
+
};
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
declare function useBoardInteractions<I extends string = string>(options?: BoardInteractionsOptions): BoardInteractionsContext<I>;
|
|
803
|
+
|
|
804
|
+
type PrimitiveDataAttributes = Record<`data-${string}`, string | boolean | number | undefined>;
|
|
805
|
+
type PrimitiveCommonProps = {
|
|
806
|
+
asChild?: boolean;
|
|
807
|
+
children?: ReactNode;
|
|
808
|
+
className?: string;
|
|
809
|
+
style?: CSSProperties;
|
|
810
|
+
} & AriaAttributes & PrimitiveDataAttributes;
|
|
811
|
+
type EventHandler<Event> = (event: Event) => void;
|
|
812
|
+
declare function composeEventHandlers<Event extends {
|
|
813
|
+
defaultPrevented: boolean;
|
|
814
|
+
}>(authorHandler: EventHandler<Event> | undefined, primitiveHandler: EventHandler<Event> | undefined): EventHandler<Event> | undefined;
|
|
815
|
+
declare function renderPrimitive<ElementProps extends HTMLAttributes<HTMLElement>>(tagName: keyof JSX.IntrinsicElements, props: ElementProps & PrimitiveCommonProps): ReactElement;
|
|
816
|
+
|
|
817
|
+
type BoardContextValue = ReturnType<typeof useBoardInteractions>;
|
|
818
|
+
declare function useBoardPrimitiveContext(): BoardContextValue;
|
|
819
|
+
interface BoardRootProps extends PrimitiveCommonProps {
|
|
820
|
+
children: ReactNode;
|
|
821
|
+
targetKinds?: readonly BoardTargetKind[];
|
|
822
|
+
}
|
|
823
|
+
declare function BoardRoot({ children, targetKinds, ...props }: BoardRootProps): react_jsx_runtime.JSX.Element;
|
|
824
|
+
type BoardTargetExtraInputs = Record<string, unknown> | ((targetId: string) => Record<string, unknown>);
|
|
825
|
+
type BoardTargetProps<Target extends string = BoardTargetKey> = PrimitiveCommonProps & ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
826
|
+
kind: BoardTargetKind;
|
|
827
|
+
value: Target;
|
|
828
|
+
interaction?: string;
|
|
829
|
+
input?: string;
|
|
830
|
+
extraInputs?: BoardTargetExtraInputs;
|
|
831
|
+
onSelect?: (interactionKey: string | null) => void;
|
|
832
|
+
onSelectError?: (error: unknown) => void;
|
|
833
|
+
};
|
|
834
|
+
declare function BoardTarget<Target extends string = BoardTargetKey>({ interaction, input, ...props }: BoardTargetProps<Target>): react_jsx_runtime.JSX.Element;
|
|
835
|
+
declare const Board: {
|
|
836
|
+
Root: typeof BoardRoot;
|
|
837
|
+
Target: typeof BoardTarget;
|
|
838
|
+
};
|
|
839
|
+
|
|
840
|
+
interface InteractionContextValue {
|
|
841
|
+
interaction: string;
|
|
842
|
+
descriptor: InteractionDescriptor | null;
|
|
843
|
+
handle: ReturnType<typeof useInteractionHandle> | null;
|
|
844
|
+
}
|
|
845
|
+
declare function useInteractionPrimitiveContext(): InteractionContextValue;
|
|
846
|
+
interface InteractionRootProps<Interaction extends string = InteractionKey> {
|
|
847
|
+
interaction: Interaction;
|
|
848
|
+
children: ReactNode;
|
|
849
|
+
unavailable?: "render" | "hide";
|
|
850
|
+
}
|
|
851
|
+
declare function InteractionRoot<Interaction extends string = InteractionKey>({ interaction, children, unavailable, }: InteractionRootProps<Interaction>): react_jsx_runtime.JSX.Element | null;
|
|
852
|
+
type InteractionPartProps = PrimitiveCommonProps & HTMLAttributes<HTMLElement>;
|
|
853
|
+
declare function InteractionLabel({ children, ...props }: InteractionPartProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
854
|
+
declare function InteractionDescription({ children, ...props }: InteractionPartProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
|
|
855
|
+
declare function InteractionUnavailableMessage({ children, ...props }: InteractionPartProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
|
|
856
|
+
declare function InteractionValidationMessage({ children, ...props }: InteractionPartProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
|
|
857
|
+
type InteractionTriggerProps = PrimitiveCommonProps & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
858
|
+
declare function InteractionTrigger({ disabled, onClick, ...props }: InteractionTriggerProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
859
|
+
type InteractionSubmitProps = PrimitiveCommonProps & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
860
|
+
declare function InteractionSubmit({ disabled, onClick, ...props }: InteractionSubmitProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
861
|
+
type InteractionInputProps = PrimitiveCommonProps & Omit<InputHTMLAttributes<HTMLInputElement>, "name"> & {
|
|
862
|
+
name: string;
|
|
863
|
+
parse?: (value: string) => unknown;
|
|
864
|
+
};
|
|
865
|
+
declare function InteractionInput({ name, parse, onChange, disabled, ...props }: InteractionInputProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
866
|
+
type InteractionCardInputProps<Input extends string = InteractionInputKey> = PrimitiveCommonProps & ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
867
|
+
input: Input;
|
|
868
|
+
value?: string;
|
|
869
|
+
card?: string;
|
|
870
|
+
selected?: boolean;
|
|
871
|
+
onSelectedChange?: (selected: boolean) => void;
|
|
872
|
+
};
|
|
873
|
+
declare function InteractionCardInput<Input extends string = InteractionInputKey>({ input, value, card, selected, onSelectedChange, onClick, disabled, children, ...props }: InteractionCardInputProps<Input>): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
874
|
+
declare const Interaction: {
|
|
875
|
+
Root: typeof InteractionRoot;
|
|
876
|
+
Trigger: typeof InteractionTrigger;
|
|
877
|
+
Label: typeof InteractionLabel;
|
|
878
|
+
Description: typeof InteractionDescription;
|
|
879
|
+
UnavailableMessage: typeof InteractionUnavailableMessage;
|
|
880
|
+
ValidationMessage: typeof InteractionValidationMessage;
|
|
881
|
+
Input: typeof InteractionInput;
|
|
882
|
+
CardInput: typeof InteractionCardInput;
|
|
883
|
+
Submit: typeof InteractionSubmit;
|
|
884
|
+
};
|
|
885
|
+
|
|
886
|
+
type PhaseRouteMap<Phase extends string = PhaseKey> = {
|
|
887
|
+
readonly [Key in Phase]: () => ReactNode;
|
|
888
|
+
};
|
|
889
|
+
type PhaseFallback = ReactNode | ((phase: string | null) => ReactNode);
|
|
890
|
+
interface PhaseSwitchProps<Phase extends string = PhaseKey> {
|
|
891
|
+
routes: PhaseRouteMap<Phase>;
|
|
892
|
+
fallback?: PhaseFallback;
|
|
893
|
+
}
|
|
894
|
+
declare function PhaseSwitch<Phase extends string = PhaseKey>({ routes, fallback, }: PhaseSwitchProps<Phase>): ReactElement | null;
|
|
895
|
+
declare const Phase: {
|
|
896
|
+
Switch: typeof PhaseSwitch;
|
|
897
|
+
};
|
|
898
|
+
|
|
899
|
+
interface PlayerRosterBadge {
|
|
900
|
+
key: string;
|
|
901
|
+
label?: ReactNode;
|
|
902
|
+
icon?: ReactNode;
|
|
903
|
+
tooltip?: string;
|
|
904
|
+
}
|
|
905
|
+
interface PlayerRosterEntry {
|
|
906
|
+
playerId: PlayerId$1;
|
|
907
|
+
name: string;
|
|
908
|
+
color?: string;
|
|
909
|
+
index: number;
|
|
910
|
+
isActive: boolean;
|
|
911
|
+
isCurrentPlayer: boolean;
|
|
912
|
+
isControllable: boolean;
|
|
913
|
+
canSwitchToPlayer: boolean;
|
|
914
|
+
score?: number;
|
|
915
|
+
scoreLabel?: string;
|
|
916
|
+
badges: readonly PlayerRosterBadge[];
|
|
917
|
+
metadata?: Record<string, unknown>;
|
|
918
|
+
}
|
|
919
|
+
interface PlayerRosterRootProps {
|
|
920
|
+
children: ReactNode;
|
|
921
|
+
order?: "turn" | "self-first";
|
|
922
|
+
include?: "all" | "self" | "opponents";
|
|
923
|
+
score?: (playerId: PlayerId$1) => number | undefined;
|
|
924
|
+
scoreLabel?: string | ((playerId: PlayerId$1) => string | undefined);
|
|
925
|
+
badges?: (playerId: PlayerId$1) => ReadonlyArray<PlayerRosterBadge | null | false | undefined>;
|
|
926
|
+
metadata?: (playerId: PlayerId$1) => Record<string, unknown> | undefined;
|
|
927
|
+
}
|
|
928
|
+
declare function PlayerRosterRoot({ children, order, include, score, scoreLabel, badges, metadata, }: PlayerRosterRootProps): react_jsx_runtime.JSX.Element;
|
|
929
|
+
type PlayerRosterListProps = Omit<PrimitiveCommonProps, "children"> & Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
930
|
+
children?: (player: PlayerRosterEntry) => ReactNode;
|
|
931
|
+
};
|
|
932
|
+
declare function PlayerRosterList({ children, ...props }: PlayerRosterListProps): ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
933
|
+
declare function PlayerRosterEmpty({ children }: {
|
|
934
|
+
children?: ReactNode;
|
|
935
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
936
|
+
type PlayerRosterSwitchButtonProps = Omit<PrimitiveCommonProps, "children"> & ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
937
|
+
player: PlayerRosterEntry;
|
|
938
|
+
children?: ReactNode;
|
|
939
|
+
};
|
|
940
|
+
declare function PlayerRosterSwitchButton({ player, disabled, onClick, ...props }: PlayerRosterSwitchButtonProps): ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
941
|
+
type PlayerRosterPartProps = PrimitiveCommonProps & HTMLAttributes<HTMLElement> & {
|
|
942
|
+
player: PlayerRosterEntry;
|
|
943
|
+
};
|
|
944
|
+
interface PlayerRosterComponents {
|
|
945
|
+
Root(props: PlayerRosterRootProps): ReactElement | null;
|
|
946
|
+
List(props: PlayerRosterListProps): ReactElement;
|
|
947
|
+
Empty(props: {
|
|
948
|
+
children?: ReactNode;
|
|
949
|
+
}): ReactElement | null;
|
|
950
|
+
SwitchButton(props: PlayerRosterSwitchButtonProps): ReactElement;
|
|
951
|
+
Name(props: PlayerRosterPartProps): ReactElement;
|
|
952
|
+
Score(props: PlayerRosterPartProps): ReactElement | null;
|
|
953
|
+
Badges(props: PlayerRosterPartProps): ReactElement | null;
|
|
954
|
+
}
|
|
955
|
+
declare function PlayerRosterName({ player, children, ...props }: PlayerRosterPartProps): ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
956
|
+
declare function PlayerRosterScore({ player, children, ...props }: PlayerRosterPartProps): ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
|
|
957
|
+
declare function PlayerRosterBadges({ player, children, ...props }: PlayerRosterPartProps): ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
|
|
958
|
+
declare const PlayerRoster: PlayerRosterComponents;
|
|
959
|
+
|
|
960
|
+
type PromptRootProps<Prompt extends string = PromptKey> = InteractionRootProps<Prompt>;
|
|
961
|
+
declare function PromptRoot<Prompt extends string = PromptKey>(props: PromptRootProps<Prompt>): react_jsx_runtime.JSX.Element;
|
|
962
|
+
declare function PromptTitle(props: InteractionPartProps): react_jsx_runtime.JSX.Element;
|
|
963
|
+
declare function PromptMessage(props: InteractionPartProps): react_jsx_runtime.JSX.Element | null;
|
|
964
|
+
type PromptOptionProps<Option extends string = PromptOptionKey> = PrimitiveCommonProps & ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
965
|
+
value: Option;
|
|
966
|
+
disableWhenUnavailable?: boolean;
|
|
967
|
+
onSubmitError?: (error: unknown) => void;
|
|
968
|
+
onSubmitSuccess?: () => void;
|
|
969
|
+
};
|
|
970
|
+
declare function PromptOption<Option extends string = PromptOptionKey>({ value, disabled, disableWhenUnavailable, onClick, onSubmitError, onSubmitSuccess, children, ...props }: PromptOptionProps<Option>): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
971
|
+
declare function PromptOptions({ children, }: {
|
|
972
|
+
children?: (option: {
|
|
973
|
+
id: string;
|
|
974
|
+
label?: string;
|
|
975
|
+
}) => ReactNode;
|
|
976
|
+
}): react_jsx_runtime.JSX.Element;
|
|
977
|
+
declare function PromptInboxRoot({ children }: {
|
|
978
|
+
children: ReactNode;
|
|
979
|
+
}): react_jsx_runtime.JSX.Element;
|
|
980
|
+
declare function PromptInboxEmpty({ children }: {
|
|
981
|
+
children?: ReactNode;
|
|
982
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
983
|
+
declare function PromptInboxItems({ children, }: {
|
|
984
|
+
children?: (prompt: InteractionDescriptor) => ReactNode;
|
|
985
|
+
}): react_jsx_runtime.JSX.Element;
|
|
986
|
+
declare const Prompt: {
|
|
987
|
+
Root: typeof PromptRoot;
|
|
988
|
+
Title: typeof PromptTitle;
|
|
989
|
+
Message: typeof PromptMessage;
|
|
990
|
+
Option: typeof PromptOption;
|
|
991
|
+
Options: typeof PromptOptions;
|
|
992
|
+
};
|
|
993
|
+
declare const PromptInbox: {
|
|
994
|
+
Root: typeof PromptInboxRoot;
|
|
995
|
+
Empty: typeof PromptInboxEmpty;
|
|
996
|
+
Items: typeof PromptInboxItems;
|
|
997
|
+
};
|
|
998
|
+
|
|
999
|
+
interface ZoneContextValue {
|
|
1000
|
+
zone: string;
|
|
1001
|
+
snapshot: ZoneHandlesSnapshot | null;
|
|
1002
|
+
}
|
|
1003
|
+
interface ZoneCardContextValue {
|
|
1004
|
+
zone: string;
|
|
1005
|
+
cardId: string;
|
|
1006
|
+
}
|
|
1007
|
+
declare function useZonePrimitiveContext(): ZoneContextValue;
|
|
1008
|
+
declare function useZoneCardContext(): ZoneCardContextValue | null;
|
|
1009
|
+
interface ZoneRootProps<Zone extends string = ZoneKey> extends PrimitiveCommonProps, HTMLAttributes<HTMLElement> {
|
|
1010
|
+
zone: Zone;
|
|
1011
|
+
}
|
|
1012
|
+
declare function ZoneRoot<Zone extends string = ZoneKey>({ zone, children, ...props }: ZoneRootProps<Zone>): react_jsx_runtime.JSX.Element;
|
|
1013
|
+
type ZoneListProps = PrimitiveCommonProps & HTMLAttributes<HTMLElement>;
|
|
1014
|
+
declare function ZoneList({ children, ...props }: ZoneListProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
1015
|
+
interface ZoneItemProps extends PrimitiveCommonProps, HTMLAttributes<HTMLElement> {
|
|
1016
|
+
card: string;
|
|
1017
|
+
}
|
|
1018
|
+
declare function ZoneItem({ card, children, ...props }: ZoneItemProps): react_jsx_runtime.JSX.Element;
|
|
1019
|
+
declare const Zone: {
|
|
1020
|
+
Root: typeof ZoneRoot;
|
|
1021
|
+
List: typeof ZoneList;
|
|
1022
|
+
Item: typeof ZoneItem;
|
|
1023
|
+
};
|
|
1024
|
+
|
|
1025
|
+
interface DreamboardUIRegister {
|
|
1026
|
+
}
|
|
1027
|
+
type UIContractBucket = Record<string, unknown>;
|
|
1028
|
+
interface UIContract {
|
|
1029
|
+
interactions?: UIContractBucket;
|
|
1030
|
+
inputs?: UIContractBucket;
|
|
1031
|
+
prompts?: UIContractBucket;
|
|
1032
|
+
promptOptions?: UIContractBucket;
|
|
1033
|
+
zones?: UIContractBucket;
|
|
1034
|
+
cards?: UIContractBucket;
|
|
1035
|
+
phases?: UIContractBucket;
|
|
1036
|
+
boardTargets?: UIContractBucket;
|
|
1037
|
+
}
|
|
1038
|
+
type RegisteredUIContract = DreamboardUIRegister extends {
|
|
1039
|
+
ui: infer Registered extends UIContract;
|
|
1040
|
+
} ? Registered : UIContract;
|
|
1041
|
+
type BucketOf<Contract extends UIContract, Key extends keyof UIContract> = NonNullable<Contract[Key]> extends UIContractBucket ? NonNullable<Contract[Key]> : UIContractBucket;
|
|
1042
|
+
type StringKeysOrFallback<Bucket extends UIContractBucket> = string extends Extract<keyof Bucket, string> ? string : Extract<keyof Bucket, string>;
|
|
1043
|
+
type RegisteredUI = RegisteredUIContract;
|
|
1044
|
+
type InteractionKey<Contract extends UIContract = RegisteredUI> = StringKeysOrFallback<BucketOf<Contract, "interactions">>;
|
|
1045
|
+
type InteractionInputKey<Contract extends UIContract = RegisteredUI> = StringKeysOrFallback<BucketOf<Contract, "inputs">>;
|
|
1046
|
+
type PromptKey<Contract extends UIContract = RegisteredUI> = StringKeysOrFallback<BucketOf<Contract, "prompts">>;
|
|
1047
|
+
type PromptOptionKey<Contract extends UIContract = RegisteredUI> = StringKeysOrFallback<BucketOf<Contract, "promptOptions">>;
|
|
1048
|
+
type ZoneKey<Contract extends UIContract = RegisteredUI> = StringKeysOrFallback<BucketOf<Contract, "zones">>;
|
|
1049
|
+
type CardKey<Contract extends UIContract = RegisteredUI> = StringKeysOrFallback<BucketOf<Contract, "cards">>;
|
|
1050
|
+
type PhaseKey<Contract extends UIContract = RegisteredUI> = StringKeysOrFallback<BucketOf<Contract, "phases">>;
|
|
1051
|
+
type BoardTargetKey<Contract extends UIContract = RegisteredUI> = StringKeysOrFallback<BucketOf<Contract, "boardTargets">>;
|
|
1052
|
+
type TypedInteraction<Contract extends UIContract> = Omit<typeof Interaction, "Root" | "CardInput"> & {
|
|
1053
|
+
Root<Interaction extends InteractionKey<Contract>>(props: InteractionRootProps<Interaction>): ReactElement | null;
|
|
1054
|
+
CardInput<Input extends InteractionInputKey<Contract>>(props: Omit<InteractionCardInputProps, "input"> & {
|
|
1055
|
+
input: Input;
|
|
1056
|
+
}): ReactElement;
|
|
1057
|
+
};
|
|
1058
|
+
type TypedPrompt<Contract extends UIContract> = Omit<typeof Prompt, "Root" | "Option"> & {
|
|
1059
|
+
Root<Prompt extends PromptKey<Contract>>(props: PromptRootProps<Prompt>): ReactElement | null;
|
|
1060
|
+
Option<Option extends PromptOptionKey<Contract>>(props: Omit<PromptOptionProps, "value"> & {
|
|
1061
|
+
value: Option;
|
|
1062
|
+
}): ReactElement;
|
|
1063
|
+
};
|
|
1064
|
+
type TypedPromptInbox = typeof PromptInbox;
|
|
1065
|
+
type TypedPlayerRoster = PlayerRosterComponents;
|
|
1066
|
+
type TypedPhase<Contract extends UIContract> = Omit<typeof Phase, "Switch"> & {
|
|
1067
|
+
Switch(props: PhaseSwitchProps<PhaseKey<Contract>>): ReactElement | null;
|
|
1068
|
+
};
|
|
1069
|
+
type TypedZone<Contract extends UIContract> = Omit<typeof Zone, "Root"> & {
|
|
1070
|
+
Root<Zone extends ZoneKey<Contract>>(props: Omit<ZoneRootProps, "zone"> & {
|
|
1071
|
+
zone: Zone;
|
|
1072
|
+
}): ReactElement;
|
|
1073
|
+
};
|
|
1074
|
+
type TypedBoard<Contract extends UIContract> = Omit<typeof Board, "Target"> & {
|
|
1075
|
+
Target<Target extends BoardTargetKey<Contract>>(props: Omit<BoardTargetProps, "value"> & {
|
|
1076
|
+
value: Target;
|
|
1077
|
+
}): ReactElement;
|
|
1078
|
+
};
|
|
1079
|
+
interface DreamboardUI<Contract extends UIContract = RegisteredUI> {
|
|
1080
|
+
readonly contract: Contract;
|
|
1081
|
+
readonly Interaction: TypedInteraction<Contract>;
|
|
1082
|
+
readonly Prompt: TypedPrompt<Contract>;
|
|
1083
|
+
readonly PromptInbox: TypedPromptInbox;
|
|
1084
|
+
readonly PlayerRoster: TypedPlayerRoster;
|
|
1085
|
+
readonly PromptDialogHost: (props: PromptDialogHostProps) => ReactElement | null;
|
|
1086
|
+
readonly Phase: TypedPhase<Contract>;
|
|
1087
|
+
readonly Zone: TypedZone<Contract>;
|
|
1088
|
+
readonly Board: TypedBoard<Contract>;
|
|
1089
|
+
}
|
|
1090
|
+
declare function createDreamboardUI<const Contract extends UIContract>(contract: Contract): DreamboardUI<Contract>;
|
|
1091
|
+
|
|
1092
|
+
type RuntimeFields = Record<string, unknown>;
|
|
1093
|
+
interface GeneratedTiledEdgeStateLike<SpaceIdValue extends string = string, EdgeIdValue extends string = string, Fields = RuntimeFields> {
|
|
1094
|
+
id: EdgeIdValue;
|
|
1095
|
+
spaceIds: readonly SpaceIdValue[];
|
|
1096
|
+
typeId?: EdgeTypeId | null;
|
|
1097
|
+
label?: string | null;
|
|
1098
|
+
ownerId?: PlayerId$1 | null;
|
|
1099
|
+
fields?: Fields;
|
|
1100
|
+
}
|
|
1101
|
+
interface GeneratedTiledVertexStateLike<SpaceIdValue extends string = string, VertexIdValue extends string = string, Fields = RuntimeFields> {
|
|
1102
|
+
id: VertexIdValue;
|
|
1103
|
+
spaceIds: readonly SpaceIdValue[];
|
|
1104
|
+
typeId?: VertexTypeId | null;
|
|
1105
|
+
label?: string | null;
|
|
1106
|
+
ownerId?: PlayerId$1 | null;
|
|
1107
|
+
fields?: Fields;
|
|
1108
|
+
}
|
|
1109
|
+
interface GeneratedHexSpaceStateLike<SpaceIdValue extends string = string, Fields = RuntimeFields> {
|
|
1110
|
+
id: SpaceIdValue;
|
|
1111
|
+
q: number;
|
|
1112
|
+
r: number;
|
|
1113
|
+
typeId?: SpaceTypeId | null;
|
|
1114
|
+
label?: string | null;
|
|
1115
|
+
ownerId?: PlayerId$1 | null;
|
|
1116
|
+
fields?: Fields;
|
|
1117
|
+
}
|
|
1118
|
+
interface GeneratedSquareSpaceStateLike<SpaceIdValue extends string = string, Fields = RuntimeFields> {
|
|
1119
|
+
id: SpaceIdValue;
|
|
1120
|
+
row: number;
|
|
1121
|
+
col: number;
|
|
1122
|
+
typeId?: SpaceTypeId | null;
|
|
1123
|
+
label?: string | null;
|
|
1124
|
+
ownerId?: PlayerId$1 | null;
|
|
1125
|
+
fields?: Fields;
|
|
1126
|
+
}
|
|
1127
|
+
interface GeneratedHexBoardInput<BoardIdValue extends string = BoardId, SpaceIdValue extends string = string, EdgeIdValue extends string = string, VertexIdValue extends string = string, SpaceFields = RuntimeFields, EdgeFields = RuntimeFields, VertexFields = RuntimeFields> {
|
|
1128
|
+
id: BoardIdValue;
|
|
1129
|
+
layout?: "hex";
|
|
1130
|
+
orientation?: "pointy-top" | "flat-top";
|
|
1131
|
+
spaces: Readonly<Record<SpaceIdValue, GeneratedHexSpaceStateLike<SpaceIdValue, SpaceFields>>>;
|
|
1132
|
+
edges: ReadonlyArray<HexEdgeState<BoardIdValue, SpaceIdValue, EdgeIdValue, EdgeFields> | GeneratedTiledEdgeStateLike<SpaceIdValue, EdgeIdValue, EdgeFields>>;
|
|
1133
|
+
vertices: ReadonlyArray<HexVertexState<BoardIdValue, SpaceIdValue, VertexIdValue, VertexFields> | GeneratedTiledVertexStateLike<SpaceIdValue, VertexIdValue, VertexFields>>;
|
|
1134
|
+
}
|
|
1135
|
+
interface AuthoredHexBoardInput<BoardIdValue extends string = BoardId, SpaceIdValue extends string = string, EdgeIdValue extends string = string, VertexIdValue extends string = string, SpaceFields = RuntimeFields, EdgeFields = RuntimeFields, VertexFields = RuntimeFields, SpaceView = unknown> {
|
|
1136
|
+
id: BoardIdValue;
|
|
1137
|
+
layout?: "hex";
|
|
1138
|
+
orientation?: "pointy-top" | "flat-top";
|
|
1139
|
+
tiles: ReadonlyArray<HexTileState<BoardIdValue, SpaceIdValue, SpaceFields, SpaceView>>;
|
|
1140
|
+
edges: ReadonlyArray<HexEdgeState<BoardIdValue, SpaceIdValue, EdgeIdValue, EdgeFields> | GeneratedTiledEdgeStateLike<SpaceIdValue, EdgeIdValue, EdgeFields>>;
|
|
1141
|
+
vertices: ReadonlyArray<HexVertexState<BoardIdValue, SpaceIdValue, VertexIdValue, VertexFields> | GeneratedTiledVertexStateLike<SpaceIdValue, VertexIdValue, VertexFields>>;
|
|
1142
|
+
}
|
|
1143
|
+
type HexBoardInput<BoardIdValue extends string = BoardId, SpaceIdValue extends string = string, EdgeIdValue extends string = string, VertexIdValue extends string = string, SpaceFields = RuntimeFields, EdgeFields = RuntimeFields, VertexFields = RuntimeFields> = AuthoredHexBoardInput<BoardIdValue, SpaceIdValue, EdgeIdValue, VertexIdValue, SpaceFields, EdgeFields, VertexFields> | GeneratedHexBoardInput<BoardIdValue, SpaceIdValue, EdgeIdValue, VertexIdValue, SpaceFields, EdgeFields, VertexFields>;
|
|
1144
|
+
interface GeneratedSquareBoardInput<BoardIdValue extends string = BoardId, SpaceIdValue extends string = string, EdgeIdValue extends string = string, VertexIdValue extends string = string, PieceIdValue extends string = string, SpaceFields = RuntimeFields, EdgeFields = RuntimeFields, VertexFields = RuntimeFields, PieceFields = RuntimeFields> {
|
|
1145
|
+
id: BoardIdValue;
|
|
1146
|
+
layout?: "square";
|
|
1147
|
+
spaces: Readonly<Record<SpaceIdValue, GeneratedSquareSpaceStateLike<SpaceIdValue, SpaceFields>>>;
|
|
1148
|
+
edges: ReadonlyArray<SquareEdgeState<SpaceIdValue, EdgeIdValue, EdgeFields> | GeneratedTiledEdgeStateLike<SpaceIdValue, EdgeIdValue, EdgeFields>>;
|
|
1149
|
+
vertices: ReadonlyArray<SquareVertexState<SpaceIdValue, VertexIdValue, VertexFields> | GeneratedTiledVertexStateLike<SpaceIdValue, VertexIdValue, VertexFields>>;
|
|
1150
|
+
pieces?: ReadonlyArray<SquarePieceState<PieceIdValue, PieceFields>>;
|
|
1151
|
+
}
|
|
1152
|
+
interface AuthoredSquareBoardInput<BoardIdValue extends string = BoardId, SpaceIdValue extends string = string, EdgeIdValue extends string = string, VertexIdValue extends string = string, PieceIdValue extends string = string, SpaceFields = RuntimeFields, EdgeFields = RuntimeFields, VertexFields = RuntimeFields, PieceFields = RuntimeFields> {
|
|
1153
|
+
id: BoardIdValue;
|
|
1154
|
+
layout?: "square";
|
|
1155
|
+
rows: number;
|
|
1156
|
+
cols: number;
|
|
1157
|
+
cells: ReadonlyArray<SquareCellState<SpaceIdValue, SpaceFields>>;
|
|
1158
|
+
edges: ReadonlyArray<SquareEdgeState<SpaceIdValue, EdgeIdValue, EdgeFields> | GeneratedTiledEdgeStateLike<SpaceIdValue, EdgeIdValue, EdgeFields>>;
|
|
1159
|
+
vertices: ReadonlyArray<SquareVertexState<SpaceIdValue, VertexIdValue, VertexFields> | GeneratedTiledVertexStateLike<SpaceIdValue, VertexIdValue, VertexFields>>;
|
|
1160
|
+
pieces: ReadonlyArray<SquarePieceState<PieceIdValue, PieceFields>>;
|
|
1161
|
+
}
|
|
1162
|
+
type SquareBoardInput<BoardIdValue extends string = BoardId, SpaceIdValue extends string = string, EdgeIdValue extends string = string, VertexIdValue extends string = string, PieceIdValue extends string = string, SpaceFields = RuntimeFields, EdgeFields = RuntimeFields, VertexFields = RuntimeFields, PieceFields = RuntimeFields> = AuthoredSquareBoardInput<BoardIdValue, SpaceIdValue, EdgeIdValue, VertexIdValue, PieceIdValue, SpaceFields, EdgeFields, VertexFields, PieceFields> | GeneratedSquareBoardInput<BoardIdValue, SpaceIdValue, EdgeIdValue, VertexIdValue, PieceIdValue, SpaceFields, EdgeFields, VertexFields, PieceFields>;
|
|
1163
|
+
type AnyHexBoardInput = HexBoardInput<string, string, string, string, RuntimeFields, RuntimeFields, RuntimeFields>;
|
|
1164
|
+
type AnySquareBoardInput = SquareBoardInput<string, string, string, string, string, RuntimeFields, RuntimeFields, RuntimeFields, RuntimeFields>;
|
|
1165
|
+
type BoardIdOf<TBoard> = TBoard extends {
|
|
1166
|
+
id: infer Id extends string;
|
|
1167
|
+
} ? Id : string;
|
|
1168
|
+
type SpaceRecordValueOf<TBoard> = TBoard extends {
|
|
1169
|
+
spaces: Readonly<Record<string, infer Space>>;
|
|
1170
|
+
} ? Space : never;
|
|
1171
|
+
type TileValueOf<TBoard> = TBoard extends {
|
|
1172
|
+
tiles: ReadonlyArray<infer Tile>;
|
|
1173
|
+
} ? Tile : never;
|
|
1174
|
+
type CellValueOf<TBoard> = TBoard extends {
|
|
1175
|
+
cells: ReadonlyArray<infer Cell>;
|
|
1176
|
+
} ? Cell : never;
|
|
1177
|
+
type EdgeValueOf<TBoard> = TBoard extends {
|
|
1178
|
+
edges: ReadonlyArray<infer Edge>;
|
|
1179
|
+
} ? Edge : never;
|
|
1180
|
+
type VertexValueOf<TBoard> = TBoard extends {
|
|
1181
|
+
vertices: ReadonlyArray<infer Vertex>;
|
|
1182
|
+
} ? Vertex : never;
|
|
1183
|
+
type PieceValueOf<TBoard> = TBoard extends {
|
|
1184
|
+
pieces?: ReadonlyArray<infer Piece>;
|
|
1185
|
+
} ? Piece : never;
|
|
1186
|
+
type BoardSpaceIdOf<TBoard> = SpaceRecordValueOf<TBoard> extends {
|
|
1187
|
+
id: infer Id extends string;
|
|
1188
|
+
} ? Id : TileValueOf<TBoard> extends {
|
|
1189
|
+
id: infer Id extends string;
|
|
1190
|
+
} ? Id : CellValueOf<TBoard> extends {
|
|
1191
|
+
id: infer Id extends string;
|
|
1192
|
+
} ? Id : never;
|
|
1193
|
+
type BoardEdgeIdOf<TBoard> = EdgeValueOf<TBoard> extends {
|
|
1194
|
+
id: infer Id extends string;
|
|
1195
|
+
} ? Id : never;
|
|
1196
|
+
type BoardVertexIdOf<TBoard> = VertexValueOf<TBoard> extends {
|
|
1197
|
+
id: infer Id extends string;
|
|
1198
|
+
} ? Id : never;
|
|
1199
|
+
type HexTilePropertiesOf<TBoard> = SpaceRecordValueOf<TBoard> extends {
|
|
1200
|
+
fields?: infer Fields;
|
|
1201
|
+
} ? Fields : TileValueOf<TBoard> extends {
|
|
1202
|
+
properties?: infer Properties;
|
|
1203
|
+
} ? Properties : RuntimeFields;
|
|
1204
|
+
type HexTileViewOf<TBoard> = TileValueOf<TBoard> extends {
|
|
1205
|
+
view: infer View;
|
|
1206
|
+
} ? View : TileValueOf<TBoard> extends {
|
|
1207
|
+
view?: infer View;
|
|
1208
|
+
} ? View | undefined : unknown;
|
|
1209
|
+
type HexEdgePropertiesOf<TBoard> = EdgeValueOf<TBoard> extends {
|
|
1210
|
+
fields?: infer Fields;
|
|
1211
|
+
} ? Fields : EdgeValueOf<TBoard> extends {
|
|
1212
|
+
properties?: infer Properties;
|
|
1213
|
+
} ? Properties : RuntimeFields;
|
|
1214
|
+
type HexVertexPropertiesOf<TBoard> = VertexValueOf<TBoard> extends {
|
|
1215
|
+
fields?: infer Fields;
|
|
1216
|
+
} ? Fields : VertexValueOf<TBoard> extends {
|
|
1217
|
+
properties?: infer Properties;
|
|
1218
|
+
} ? Properties : RuntimeFields;
|
|
1219
|
+
type SquareCellPropertiesOf<TBoard> = SpaceRecordValueOf<TBoard> extends {
|
|
1220
|
+
fields?: infer Fields;
|
|
1221
|
+
} ? Fields : CellValueOf<TBoard> extends {
|
|
1222
|
+
properties?: infer Properties;
|
|
1223
|
+
} ? Properties : RuntimeFields;
|
|
1224
|
+
type SquareEdgePropertiesOf<TBoard> = EdgeValueOf<TBoard> extends {
|
|
1225
|
+
fields?: infer Fields;
|
|
1226
|
+
} ? Fields : EdgeValueOf<TBoard> extends {
|
|
1227
|
+
properties?: infer Properties;
|
|
1228
|
+
} ? Properties : RuntimeFields;
|
|
1229
|
+
type SquareVertexPropertiesOf<TBoard> = VertexValueOf<TBoard> extends {
|
|
1230
|
+
fields?: infer Fields;
|
|
1231
|
+
} ? Fields : VertexValueOf<TBoard> extends {
|
|
1232
|
+
properties?: infer Properties;
|
|
1233
|
+
} ? Properties : RuntimeFields;
|
|
1234
|
+
type SquarePiecePropertiesOf<TBoard> = PieceValueOf<TBoard> extends {
|
|
1235
|
+
properties?: infer Properties;
|
|
1236
|
+
} ? Properties : RuntimeFields;
|
|
1237
|
+
|
|
1238
|
+
type NormalizedHexTileOf<TBoard extends AnyHexBoardInput> = Omit<HexTileState<BoardIdOf<TBoard>, BoardSpaceIdOf<TBoard>, HexTilePropertiesOf<TBoard>, HexTileViewOf<TBoard>>, "view"> & {
|
|
1239
|
+
view: HexTileViewOf<TBoard>;
|
|
1240
|
+
};
|
|
1241
|
+
type NormalizedHexEdgeOf<TBoard extends AnyHexBoardInput> = HexEdgeState<BoardIdOf<TBoard>, BoardSpaceIdOf<TBoard>, BoardEdgeIdOf<TBoard>, HexEdgePropertiesOf<TBoard>>;
|
|
1242
|
+
type NormalizedHexVertexOf<TBoard extends AnyHexBoardInput> = HexVertexState<BoardIdOf<TBoard>, BoardSpaceIdOf<TBoard>, BoardVertexIdOf<TBoard>, HexVertexPropertiesOf<TBoard>>;
|
|
1243
|
+
type NormalizedSquareCellOf<TBoard extends AnySquareBoardInput> = SquareCellState<BoardSpaceIdOf<TBoard>, SquareCellPropertiesOf<TBoard>>;
|
|
1244
|
+
type NormalizedSquareEdgeOf<TBoard extends AnySquareBoardInput> = SquareEdgeState<BoardSpaceIdOf<TBoard>, BoardEdgeIdOf<TBoard>, SquareEdgePropertiesOf<TBoard>>;
|
|
1245
|
+
type NormalizedSquareVertexOf<TBoard extends AnySquareBoardInput> = SquareVertexState<BoardSpaceIdOf<TBoard>, BoardVertexIdOf<TBoard>, SquareVertexPropertiesOf<TBoard>>;
|
|
1246
|
+
type NormalizedSquarePieceOf<TBoard extends AnySquareBoardInput> = SquarePieceState<PieceValueOf<TBoard> extends {
|
|
1247
|
+
id: infer PieceIdValue extends string;
|
|
1248
|
+
} ? PieceIdValue : string, SquarePiecePropertiesOf<TBoard>>;
|
|
1249
|
+
type NormalizedHexBoard<TBoard extends AnyHexBoardInput> = Omit<Pick<HexBoardState<BoardIdOf<TBoard>, BoardSpaceIdOf<TBoard>, BoardEdgeIdOf<TBoard>, BoardVertexIdOf<TBoard>, HexTilePropertiesOf<TBoard>, HexEdgePropertiesOf<TBoard>, HexVertexPropertiesOf<TBoard>>, "id" | "tiles" | "edges" | "vertices">, "tiles"> & {
|
|
1250
|
+
tiles: ReadonlyArray<NormalizedHexTileOf<TBoard>>;
|
|
1251
|
+
orientation?: "pointy-top" | "flat-top";
|
|
1252
|
+
};
|
|
1253
|
+
type NormalizedSquareBoard<TBoard extends AnySquareBoardInput> = Pick<SquareBoardState<BoardIdOf<TBoard>, BoardSpaceIdOf<TBoard>, BoardEdgeIdOf<TBoard>, BoardVertexIdOf<TBoard>, PieceValueOf<TBoard> extends {
|
|
1254
|
+
id: infer PieceIdValue extends string;
|
|
1255
|
+
} ? PieceIdValue : string, SquareCellPropertiesOf<TBoard>, SquareEdgePropertiesOf<TBoard>, SquareVertexPropertiesOf<TBoard>, SquarePiecePropertiesOf<TBoard>>, "id" | "rows" | "cols" | "cells" | "edges" | "vertices" | "pieces">;
|
|
1256
|
+
declare function normalizeHexBoardInput<TBoard extends AnyHexBoardInput>(board: TBoard): NormalizedHexBoard<TBoard>;
|
|
1257
|
+
declare function normalizeSquareBoardInput<TBoard extends AnySquareBoardInput>(board: TBoard): NormalizedSquareBoard<TBoard>;
|
|
1258
|
+
|
|
1259
|
+
type BoardTopologyData = AnyHexBoardInput | AnySquareBoardInput;
|
|
1260
|
+
type BoardSpaceOf$1<TBoard extends BoardTopologyData> = TBoard extends AnyHexBoardInput ? NormalizedHexTileOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareCellOf<TBoard> : never;
|
|
1261
|
+
type BoardEdgeOf<TBoard extends BoardTopologyData> = TBoard extends AnyHexBoardInput ? NormalizedHexEdgeOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareEdgeOf<TBoard> : never;
|
|
1262
|
+
type BoardVertexOf<TBoard extends BoardTopologyData> = TBoard extends AnyHexBoardInput ? NormalizedHexVertexOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareVertexOf<TBoard> : never;
|
|
1263
|
+
type NormalizedBoardOf<TBoard extends BoardTopologyData> = TBoard extends AnyHexBoardInput ? NormalizedHexBoard<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareBoard<TBoard> : never;
|
|
1264
|
+
type BoardLayoutOf<TBoard extends BoardTopologyData> = TBoard extends AnyHexBoardInput ? "hex" : "square";
|
|
1265
|
+
interface UseBoardTopologyReturn<TBoard extends BoardTopologyData> {
|
|
1266
|
+
layout: BoardLayoutOf<TBoard>;
|
|
1267
|
+
board: NormalizedBoardOf<TBoard>;
|
|
1268
|
+
getSpace: (spaceId: BoardSpaceIdOf<TBoard>) => BoardSpaceOf$1<TBoard> | undefined;
|
|
1269
|
+
getEdge: (edgeId: BoardEdgeIdOf<TBoard>) => BoardEdgeOf<TBoard> | undefined;
|
|
1270
|
+
getVertex: (vertexId: BoardVertexIdOf<TBoard>) => BoardVertexOf<TBoard> | undefined;
|
|
1271
|
+
getAdjacentSpaces: (spaceId: BoardSpaceIdOf<TBoard>) => Array<BoardSpaceOf$1<TBoard>>;
|
|
1272
|
+
getDistance: (fromSpaceId: BoardSpaceIdOf<TBoard>, toSpaceId: BoardSpaceIdOf<TBoard>) => number;
|
|
1273
|
+
getSpaceEdges: (spaceId: BoardSpaceIdOf<TBoard>) => Array<BoardEdgeOf<TBoard>>;
|
|
1274
|
+
getSpaceVertices: (spaceId: BoardSpaceIdOf<TBoard>) => Array<BoardVertexOf<TBoard>>;
|
|
1275
|
+
getIncidentEdges: (vertexId: BoardVertexIdOf<TBoard>) => Array<BoardEdgeOf<TBoard>>;
|
|
1276
|
+
getIncidentVertices: (edgeId: BoardEdgeIdOf<TBoard>) => Array<BoardVertexOf<TBoard>>;
|
|
1277
|
+
}
|
|
1278
|
+
declare function useBoardTopology<const TBoard extends BoardTopologyData>(board: TBoard): UseBoardTopologyReturn<TBoard>;
|
|
1279
|
+
|
|
1280
|
+
declare function useHexBoard<const TBoard extends AnyHexBoardInput>(board: TBoard): {
|
|
1281
|
+
board: NormalizedHexBoard<TBoard>;
|
|
1282
|
+
getTile: (tileId: BoardSpaceIdOf<TBoard>) => NormalizedHexTileOf<TBoard> | undefined;
|
|
1283
|
+
getTileAt: (q: number, r: number) => NormalizedHexTileOf<TBoard> | undefined;
|
|
1284
|
+
getNeighbors: (tileId: BoardSpaceIdOf<TBoard>) => Array<NormalizedHexTileOf<TBoard>>;
|
|
1285
|
+
getTilesInRange: (centerTileId: BoardSpaceIdOf<TBoard>, range: number) => Array<NormalizedHexTileOf<TBoard>>;
|
|
1286
|
+
layout: TBoard extends AnyHexBoardInput ? "hex" : "square";
|
|
1287
|
+
getSpace: (spaceId: BoardSpaceIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexTileOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareCellOf<TBoard> : never) | undefined;
|
|
1288
|
+
getEdge: (edgeId: BoardEdgeIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexEdgeOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareEdgeOf<TBoard> : never) | undefined;
|
|
1289
|
+
getVertex: (vertexId: BoardVertexIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexVertexOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareVertexOf<TBoard> : never) | undefined;
|
|
1290
|
+
getAdjacentSpaces: (spaceId: BoardSpaceIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexTileOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareCellOf<TBoard> : never)[];
|
|
1291
|
+
getDistance: (fromSpaceId: BoardSpaceIdOf<TBoard>, toSpaceId: BoardSpaceIdOf<TBoard>) => number;
|
|
1292
|
+
getSpaceEdges: (spaceId: BoardSpaceIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexEdgeOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareEdgeOf<TBoard> : never)[];
|
|
1293
|
+
getSpaceVertices: (spaceId: BoardSpaceIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexVertexOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareVertexOf<TBoard> : never)[];
|
|
1294
|
+
getIncidentEdges: (vertexId: BoardVertexIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexEdgeOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareEdgeOf<TBoard> : never)[];
|
|
1295
|
+
getIncidentVertices: (edgeId: BoardEdgeIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexVertexOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareVertexOf<TBoard> : never)[];
|
|
1296
|
+
};
|
|
1297
|
+
|
|
1298
|
+
type NeighborMode = "orthogonal" | "diagonal" | "all";
|
|
1299
|
+
type DistanceMetric = "manhattan" | "chebyshev";
|
|
1300
|
+
declare function useSquareBoard<const TBoard extends AnySquareBoardInput>(board: TBoard): {
|
|
1301
|
+
board: NormalizedSquareBoard<TBoard>;
|
|
1302
|
+
getCell: (cellId: BoardSpaceIdOf<TBoard>) => NormalizedSquareCellOf<TBoard> | undefined;
|
|
1303
|
+
getCellAt: (row: number, col: number) => NormalizedSquareCellOf<TBoard> | undefined;
|
|
1304
|
+
getNeighbors: (cellId: BoardSpaceIdOf<TBoard>, mode?: NeighborMode) => NormalizedSquareCellOf<TBoard>[];
|
|
1305
|
+
getDistance: (fromCellId: BoardSpaceIdOf<TBoard>, toCellId: BoardSpaceIdOf<TBoard>, metric?: DistanceMetric) => number;
|
|
1306
|
+
layout: TBoard extends AnyHexBoardInput ? "hex" : "square";
|
|
1307
|
+
getSpace: (spaceId: BoardSpaceIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexTileOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareCellOf<TBoard> : never) | undefined;
|
|
1308
|
+
getEdge: (edgeId: BoardEdgeIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexEdgeOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareEdgeOf<TBoard> : never) | undefined;
|
|
1309
|
+
getVertex: (vertexId: BoardVertexIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexVertexOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareVertexOf<TBoard> : never) | undefined;
|
|
1310
|
+
getAdjacentSpaces: (spaceId: BoardSpaceIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexTileOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareCellOf<TBoard> : never)[];
|
|
1311
|
+
getSpaceEdges: (spaceId: BoardSpaceIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexEdgeOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareEdgeOf<TBoard> : never)[];
|
|
1312
|
+
getSpaceVertices: (spaceId: BoardSpaceIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexVertexOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareVertexOf<TBoard> : never)[];
|
|
1313
|
+
getIncidentEdges: (vertexId: BoardVertexIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexEdgeOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareEdgeOf<TBoard> : never)[];
|
|
1314
|
+
getIncidentVertices: (edgeId: BoardEdgeIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexVertexOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareVertexOf<TBoard> : never)[];
|
|
1315
|
+
};
|
|
1316
|
+
|
|
1317
|
+
type CardSize = "sm" | "md" | "lg";
|
|
1318
|
+
type HandLayout = "spread" | "stack" | "overlap";
|
|
1319
|
+
interface CardPositionProps {
|
|
1320
|
+
|
|
1321
|
+
x: number;
|
|
1322
|
+
|
|
1323
|
+
y: number;
|
|
1324
|
+
|
|
1325
|
+
zIndex: number;
|
|
1326
|
+
|
|
1327
|
+
transformOrigin: string;
|
|
1328
|
+
}
|
|
1329
|
+
interface UseHandLayoutOptions {
|
|
1330
|
+
|
|
1331
|
+
cardCount: number;
|
|
1332
|
+
|
|
1333
|
+
cardSize?: CardSize;
|
|
1334
|
+
|
|
1335
|
+
layout?: HandLayout;
|
|
1336
|
+
|
|
1337
|
+
containerPadding?: number;
|
|
1338
|
+
}
|
|
1339
|
+
interface UseHandLayoutReturn {
|
|
1340
|
+
|
|
1341
|
+
containerRef: RefObject<HTMLDivElement | null>;
|
|
1342
|
+
|
|
1343
|
+
cardsContainerRef: RefObject<HTMLDivElement | null>;
|
|
1344
|
+
|
|
1345
|
+
containerWidth: number;
|
|
1346
|
+
|
|
1347
|
+
cardOffset: number;
|
|
1348
|
+
|
|
1349
|
+
totalWidth: number;
|
|
1350
|
+
|
|
1351
|
+
useDrawerMode: boolean;
|
|
1352
|
+
|
|
1353
|
+
cardDimensions: {
|
|
1354
|
+
width: number;
|
|
1355
|
+
height: number;
|
|
1356
|
+
};
|
|
1357
|
+
|
|
1358
|
+
constants: {
|
|
1359
|
+
hoverLift: number;
|
|
1360
|
+
selectedLift: number;
|
|
1361
|
+
};
|
|
1362
|
+
|
|
1363
|
+
hoveredIndex: number | null;
|
|
1364
|
+
|
|
1365
|
+
handleMouseMove: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
1366
|
+
|
|
1367
|
+
handleMouseLeave: () => void;
|
|
1368
|
+
|
|
1369
|
+
getCardPosition: (index: number, isHovered: boolean, isSelected: boolean) => CardPositionProps;
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
declare function useHandLayout({ cardCount, cardSize, layout, containerPadding, }: UseHandLayoutOptions): UseHandLayoutReturn;
|
|
1373
|
+
|
|
1374
|
+
declare function useIsMobile(breakpoint?: number): boolean;
|
|
1375
|
+
|
|
1376
|
+
interface PanZoomTransform {
|
|
1377
|
+
|
|
1378
|
+
zoom: number;
|
|
1379
|
+
|
|
1380
|
+
pan: {
|
|
1381
|
+
x: number;
|
|
1382
|
+
y: number;
|
|
1383
|
+
};
|
|
1384
|
+
}
|
|
1385
|
+
interface UsePanZoomOptions {
|
|
1386
|
+
|
|
1387
|
+
enabled?: boolean;
|
|
1388
|
+
|
|
1389
|
+
initialZoom?: number;
|
|
1390
|
+
|
|
1391
|
+
minZoom?: number;
|
|
1392
|
+
|
|
1393
|
+
maxZoom?: number;
|
|
1394
|
+
|
|
1395
|
+
initialPan?: {
|
|
1396
|
+
x: number;
|
|
1397
|
+
y: number;
|
|
1398
|
+
};
|
|
1399
|
+
|
|
1400
|
+
mode?: "viewbox" | "css";
|
|
1401
|
+
|
|
1402
|
+
wheelSensitivity?: number;
|
|
1403
|
+
|
|
1404
|
+
onTransformChange?: (transform: PanZoomTransform) => void;
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
type GestureBindFunction = () => Omit<React.HTMLAttributes<Element>, "ref">;
|
|
1408
|
+
interface UsePanZoomReturn {
|
|
1409
|
+
|
|
1410
|
+
transform: PanZoomTransform;
|
|
1411
|
+
|
|
1412
|
+
bind: GestureBindFunction;
|
|
1413
|
+
|
|
1414
|
+
resetTransform: () => void;
|
|
1415
|
+
|
|
1416
|
+
setZoom: (zoom: number) => void;
|
|
1417
|
+
|
|
1418
|
+
setPan: (pan: {
|
|
1419
|
+
x: number;
|
|
1420
|
+
y: number;
|
|
1421
|
+
}) => void;
|
|
1422
|
+
|
|
1423
|
+
style: React.CSSProperties;
|
|
1424
|
+
|
|
1425
|
+
isDragging: boolean;
|
|
1426
|
+
|
|
1427
|
+
isPinching: boolean;
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
declare function usePanZoom(options?: UsePanZoomOptions): UsePanZoomReturn;
|
|
1431
|
+
|
|
1432
|
+
declare function calculateViewBox(bounds: {
|
|
1433
|
+
minX: number;
|
|
1434
|
+
minY: number;
|
|
1435
|
+
width: number;
|
|
1436
|
+
height: number;
|
|
1437
|
+
}, transform: PanZoomTransform): string;
|
|
1438
|
+
|
|
1439
|
+
interface PluginRuntimeAPI extends RuntimeAPI {
|
|
1440
|
+
|
|
1441
|
+
getSnapshot: () => PluginStateSnapshot | null;
|
|
1442
|
+
|
|
1443
|
+
subscribeToState: (listener: (state: PluginStateSnapshot) => void) => () => void;
|
|
1444
|
+
|
|
1445
|
+
_subscribeToSessionState: (listener: (state: PluginSessionState) => void) => () => void;
|
|
1446
|
+
|
|
1447
|
+
restoreHistory?: (entryId: string) => void;
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
interface UsePluginRuntimeOptions {
|
|
1451
|
+
|
|
1452
|
+
timeout?: number;
|
|
1453
|
+
}
|
|
1454
|
+
interface UsePluginRuntimeResult {
|
|
1455
|
+
|
|
1456
|
+
runtime: PluginRuntimeAPI;
|
|
1457
|
+
|
|
1458
|
+
isReady: boolean;
|
|
1459
|
+
|
|
1460
|
+
error: string | null;
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
declare function usePluginRuntime(options?: UsePluginRuntimeOptions): UsePluginRuntimeResult;
|
|
1464
|
+
|
|
1465
|
+
interface TrackSpace<SpaceIdValue extends string = string, Data = unknown> {
|
|
1466
|
+
id: SpaceIdValue;
|
|
1467
|
+
index: number;
|
|
1468
|
+
name?: string;
|
|
1469
|
+
type?: string;
|
|
1470
|
+
|
|
1471
|
+
nextSpaces?: readonly SpaceIdValue[];
|
|
1472
|
+
|
|
1473
|
+
jumpTo?: SpaceIdValue;
|
|
1474
|
+
position: {
|
|
1475
|
+
x: number;
|
|
1476
|
+
y: number;
|
|
1477
|
+
};
|
|
1478
|
+
data?: Data;
|
|
1479
|
+
}
|
|
1480
|
+
interface TrackPiece<PieceIdValue extends string = string, SpaceIdValue extends string = string, OwnerIdValue extends string = string, Data = unknown> {
|
|
1481
|
+
id: PieceIdValue;
|
|
1482
|
+
spaceId: SpaceIdValue;
|
|
1483
|
+
owner: OwnerIdValue;
|
|
1484
|
+
type?: string;
|
|
1485
|
+
data?: Data;
|
|
1486
|
+
}
|
|
1487
|
+
interface TrackBoardProps {
|
|
1488
|
+
spaces: TrackSpace[];
|
|
1489
|
+
pieces: TrackPiece[];
|
|
1490
|
+
type?: "linear" | "circular" | "branching";
|
|
1491
|
+
renderSpace: (space: TrackSpace, pieces: TrackPiece[]) => ReactNode;
|
|
1492
|
+
renderConnection?: (from: {
|
|
1493
|
+
x: number;
|
|
1494
|
+
y: number;
|
|
1495
|
+
}, to: {
|
|
1496
|
+
x: number;
|
|
1497
|
+
y: number;
|
|
1498
|
+
}, fromSpace: TrackSpace, toSpace: TrackSpace) => ReactNode;
|
|
1499
|
+
renderJump?: (from: {
|
|
1500
|
+
x: number;
|
|
1501
|
+
y: number;
|
|
1502
|
+
}, to: {
|
|
1503
|
+
x: number;
|
|
1504
|
+
y: number;
|
|
1505
|
+
}, fromSpace: TrackSpace, toSpace: TrackSpace, isUp: boolean) => ReactNode;
|
|
1506
|
+
width?: number | string;
|
|
1507
|
+
height?: number | string;
|
|
1508
|
+
enablePanZoom?: boolean;
|
|
1509
|
+
initialZoom?: number;
|
|
1510
|
+
minZoom?: number;
|
|
1511
|
+
maxZoom?: number;
|
|
1512
|
+
className?: string;
|
|
1513
|
+
}
|
|
1514
|
+
interface DefaultTrackSpaceProps {
|
|
1515
|
+
space: TrackSpace;
|
|
1516
|
+
size?: number;
|
|
1517
|
+
fill?: string;
|
|
1518
|
+
stroke?: string;
|
|
1519
|
+
strokeWidth?: number;
|
|
1520
|
+
isHighlighted?: boolean;
|
|
1521
|
+
isSelected?: boolean;
|
|
1522
|
+
showJumpIndicator?: boolean;
|
|
1523
|
+
onClick?: () => void;
|
|
1524
|
+
onHover?: (hovering: boolean) => void;
|
|
1525
|
+
className?: string;
|
|
1526
|
+
children?: ReactNode;
|
|
1527
|
+
}
|
|
1528
|
+
declare function DefaultTrackSpace({ space, size, fill, stroke, strokeWidth, isHighlighted, isSelected, showJumpIndicator, onClick, onHover, className, children, }: DefaultTrackSpaceProps): react_jsx_runtime.JSX.Element;
|
|
1529
|
+
interface DefaultTrackPieceProps {
|
|
1530
|
+
piece: TrackPiece;
|
|
1531
|
+
index?: number;
|
|
1532
|
+
total?: number;
|
|
1533
|
+
radius?: number;
|
|
1534
|
+
color?: string;
|
|
1535
|
+
onClick?: () => void;
|
|
1536
|
+
className?: string;
|
|
1537
|
+
}
|
|
1538
|
+
declare function DefaultTrackPiece({ piece, index, total, radius, color, onClick, className, }: DefaultTrackPieceProps): react_jsx_runtime.JSX.Element;
|
|
1539
|
+
interface DefaultTrackConnectionProps {
|
|
1540
|
+
from: {
|
|
1541
|
+
x: number;
|
|
1542
|
+
y: number;
|
|
1543
|
+
};
|
|
1544
|
+
to: {
|
|
1545
|
+
x: number;
|
|
1546
|
+
y: number;
|
|
1547
|
+
};
|
|
1548
|
+
stroke?: string;
|
|
1549
|
+
strokeWidth?: number;
|
|
1550
|
+
className?: string;
|
|
1551
|
+
}
|
|
1552
|
+
declare function DefaultTrackConnection({ from, to, stroke, strokeWidth, className, }: DefaultTrackConnectionProps): react_jsx_runtime.JSX.Element;
|
|
1553
|
+
interface DefaultTrackJumpProps {
|
|
1554
|
+
from: {
|
|
1555
|
+
x: number;
|
|
1556
|
+
y: number;
|
|
1557
|
+
};
|
|
1558
|
+
to: {
|
|
1559
|
+
x: number;
|
|
1560
|
+
y: number;
|
|
1561
|
+
};
|
|
1562
|
+
|
|
1563
|
+
isUp: boolean;
|
|
1564
|
+
spaceSize?: number;
|
|
1565
|
+
upColor?: string;
|
|
1566
|
+
downColor?: string;
|
|
1567
|
+
strokeWidth?: number;
|
|
1568
|
+
className?: string;
|
|
1569
|
+
}
|
|
1570
|
+
declare function DefaultTrackJump({ from, to, isUp, spaceSize, upColor, downColor, strokeWidth, className, }: DefaultTrackJumpProps): react_jsx_runtime.JSX.Element;
|
|
1571
|
+
declare function TrackBoard({ spaces, pieces, type, renderSpace, renderConnection, renderJump, width, height, enablePanZoom, initialZoom, minZoom, maxZoom, className, }: TrackBoardProps): react_jsx_runtime.JSX.Element;
|
|
1572
|
+
|
|
1573
|
+
interface GenericBoardSpaceLike<SpaceIdValue extends string = string, Fields = Record<string, unknown>> {
|
|
1574
|
+
id: SpaceIdValue;
|
|
1575
|
+
name?: string | null;
|
|
1576
|
+
typeId?: string | null;
|
|
1577
|
+
fields: Fields;
|
|
1578
|
+
}
|
|
1579
|
+
interface GenericBoardRelationLike<SpaceIdValue extends string = string> {
|
|
1580
|
+
fromSpaceId: SpaceIdValue;
|
|
1581
|
+
toSpaceId: SpaceIdValue;
|
|
1582
|
+
directed: boolean;
|
|
1583
|
+
}
|
|
1584
|
+
interface GenericBoardLike<BoardIdValue extends string = string, SpaceIdValue extends string = string, SpaceFields = Record<string, unknown>> {
|
|
1585
|
+
id: BoardIdValue;
|
|
1586
|
+
spaces: Readonly<Record<SpaceIdValue, GenericBoardSpaceLike<SpaceIdValue, SpaceFields>>>;
|
|
1587
|
+
relations?: ReadonlyArray<GenericBoardRelationLike<SpaceIdValue>>;
|
|
1588
|
+
}
|
|
1589
|
+
interface TrackBoardPieceLike<PieceIdValue extends string = string, SpaceIdValue extends string = string, OwnerIdValue extends string = string, Fields = unknown> {
|
|
1590
|
+
id: PieceIdValue;
|
|
1591
|
+
spaceId: SpaceIdValue;
|
|
1592
|
+
owner: OwnerIdValue;
|
|
1593
|
+
typeId?: string | null;
|
|
1594
|
+
fields?: Fields;
|
|
1595
|
+
}
|
|
1596
|
+
type BoardSpaceOf<TBoard extends GenericBoardLike> = TBoard["spaces"][keyof TBoard["spaces"]];
|
|
1597
|
+
type SpaceIdOf<TBoard extends GenericBoardLike> = BoardSpaceOf<TBoard> extends {
|
|
1598
|
+
id: infer Id extends string;
|
|
1599
|
+
} ? Id : never;
|
|
1600
|
+
type SpaceFieldsOf<TBoard extends GenericBoardLike> = BoardSpaceOf<TBoard> extends {
|
|
1601
|
+
fields: infer Fields;
|
|
1602
|
+
} ? Fields : never;
|
|
1603
|
+
type PieceIdOf<TPiece extends TrackBoardPieceLike> = TPiece extends {
|
|
1604
|
+
id: infer Id extends string;
|
|
1605
|
+
} ? Id : never;
|
|
1606
|
+
type PieceOwnerOf<TPiece extends TrackBoardPieceLike> = TPiece extends {
|
|
1607
|
+
owner: infer Owner extends string;
|
|
1608
|
+
} ? Owner : never;
|
|
1609
|
+
type PieceFieldsOf<TPiece extends TrackBoardPieceLike> = TPiece extends {
|
|
1610
|
+
fields?: infer Fields;
|
|
1611
|
+
} ? Fields : never;
|
|
1612
|
+
type TrackLayout = {
|
|
1613
|
+
type: "linear";
|
|
1614
|
+
axis?: "x" | "y";
|
|
1615
|
+
spacing?: number;
|
|
1616
|
+
origin?: {
|
|
1617
|
+
x: number;
|
|
1618
|
+
y: number;
|
|
1619
|
+
};
|
|
1620
|
+
} | {
|
|
1621
|
+
type: "circular";
|
|
1622
|
+
center: {
|
|
1623
|
+
x: number;
|
|
1624
|
+
y: number;
|
|
1625
|
+
};
|
|
1626
|
+
radius: number;
|
|
1627
|
+
startAngleDeg?: number;
|
|
1628
|
+
clockwise?: boolean;
|
|
1629
|
+
};
|
|
1630
|
+
type PositionOptions<TBoard extends GenericBoardLike> = {
|
|
1631
|
+
getPosition: (space: BoardSpaceOf<TBoard>, index: number, spaces: ReadonlyArray<BoardSpaceOf<TBoard>>) => {
|
|
1632
|
+
x: number;
|
|
1633
|
+
y: number;
|
|
1634
|
+
};
|
|
1635
|
+
layout?: never;
|
|
1636
|
+
} | {
|
|
1637
|
+
getPosition?: never;
|
|
1638
|
+
layout: TrackLayout;
|
|
1639
|
+
};
|
|
1640
|
+
type ToTrackBoardDataOptions<TBoard extends GenericBoardLike, TPiece extends TrackBoardPieceLike<string, SpaceIdOf<TBoard>, string, unknown>> = PositionOptions<TBoard> & {
|
|
1641
|
+
pieces?: readonly TPiece[];
|
|
1642
|
+
getNextSpaces?: (space: BoardSpaceOf<TBoard>, board: TBoard) => ReadonlyArray<SpaceIdOf<TBoard>> | undefined;
|
|
1643
|
+
getJumpTo?: (space: BoardSpaceOf<TBoard>, board: TBoard) => SpaceIdOf<TBoard> | undefined;
|
|
1644
|
+
};
|
|
1645
|
+
declare function toTrackBoardData<TBoard extends GenericBoardLike, TPiece extends TrackBoardPieceLike<string, SpaceIdOf<TBoard>, string, unknown>>(board: TBoard, options: ToTrackBoardDataOptions<TBoard, TPiece>): {
|
|
1646
|
+
spaces: Array<TrackSpace<SpaceIdOf<TBoard>, SpaceFieldsOf<TBoard>>>;
|
|
1647
|
+
pieces: Array<TrackPiece<PieceIdOf<TPiece>, SpaceIdOf<TBoard>, PieceOwnerOf<TPiece>, PieceFieldsOf<TPiece>>>;
|
|
1648
|
+
};
|
|
1649
|
+
|
|
1650
|
+
type PlayerId = string;
|
|
1651
|
+
|
|
1652
|
+
interface PluginStateProviderProps {
|
|
1653
|
+
children: React__default.ReactNode;
|
|
1654
|
+
|
|
1655
|
+
loadingComponent?: React__default.ReactNode;
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
declare function PluginStateProvider({ children, loadingComponent, }: PluginStateProviderProps): react_jsx_runtime.JSX.Element;
|
|
1659
|
+
|
|
1660
|
+
declare function usePluginState<T>(selector: (state: PluginStateSnapshot) => T): T;
|
|
1661
|
+
|
|
1662
|
+
declare function usePluginActions(): {
|
|
1663
|
+
|
|
1664
|
+
markNotificationRead: (notificationId: string) => void;
|
|
1665
|
+
|
|
1666
|
+
switchPlayer: (playerId: string) => void;
|
|
1667
|
+
|
|
1668
|
+
submitInteraction: (playerId: PlayerId, interactionId: string, params: unknown) => Promise<void>;
|
|
1669
|
+
};
|
|
1670
|
+
|
|
1671
|
+
declare const RuntimeContext: React__default.Context<RuntimeAPI | null>;
|
|
1672
|
+
|
|
1673
|
+
declare function useRuntimeContext(): RuntimeAPI;
|
|
1674
|
+
|
|
1675
|
+
declare function RuntimeProvider({ runtime, children, }: {
|
|
1676
|
+
runtime: RuntimeAPI;
|
|
1677
|
+
children: React__default.ReactNode;
|
|
1678
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1679
|
+
|
|
1680
|
+
interface ThemeMeta {
|
|
1681
|
+
|
|
1682
|
+
readonly id: string;
|
|
1683
|
+
|
|
1684
|
+
readonly name: string;
|
|
1685
|
+
|
|
1686
|
+
readonly mode: "light" | "dark";
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
interface ColorRamp {
|
|
1690
|
+
readonly 50: string;
|
|
1691
|
+
readonly 100: string;
|
|
1692
|
+
readonly 200: string;
|
|
1693
|
+
readonly 400: string;
|
|
1694
|
+
readonly 600: string;
|
|
1695
|
+
readonly 800: string;
|
|
1696
|
+
readonly 950: string;
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
interface PlayerColor {
|
|
1700
|
+
readonly solid: string;
|
|
1701
|
+
readonly soft: string;
|
|
1702
|
+
readonly on: string;
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
interface FoundationColor {
|
|
1706
|
+
readonly neutral: ColorRamp;
|
|
1707
|
+
readonly brand: ColorRamp;
|
|
1708
|
+
readonly accent: ColorRamp;
|
|
1709
|
+
readonly success: ColorRamp;
|
|
1710
|
+
readonly warning: ColorRamp;
|
|
1711
|
+
readonly danger: ColorRamp;
|
|
1712
|
+
readonly info: ColorRamp;
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
interface SemanticColor {
|
|
1716
|
+
readonly surface: {
|
|
1717
|
+
|
|
1718
|
+
readonly app: string;
|
|
1719
|
+
|
|
1720
|
+
readonly board: string;
|
|
1721
|
+
|
|
1722
|
+
readonly hud: string;
|
|
1723
|
+
|
|
1724
|
+
readonly card: string;
|
|
1725
|
+
|
|
1726
|
+
readonly sheet: string;
|
|
1727
|
+
|
|
1728
|
+
readonly overlay: string;
|
|
1729
|
+
|
|
1730
|
+
readonly inset: string;
|
|
1731
|
+
};
|
|
1732
|
+
readonly text: {
|
|
1733
|
+
|
|
1734
|
+
readonly primary: string;
|
|
1735
|
+
|
|
1736
|
+
readonly muted: string;
|
|
1737
|
+
|
|
1738
|
+
readonly onIntent: string;
|
|
1739
|
+
|
|
1740
|
+
readonly accent: string;
|
|
1741
|
+
|
|
1742
|
+
readonly disabled: string;
|
|
1743
|
+
};
|
|
1744
|
+
readonly border: {
|
|
1745
|
+
|
|
1746
|
+
readonly subtle: string;
|
|
1747
|
+
|
|
1748
|
+
readonly default: string;
|
|
1749
|
+
|
|
1750
|
+
readonly strong: string;
|
|
1751
|
+
|
|
1752
|
+
readonly focus: string;
|
|
1753
|
+
};
|
|
1754
|
+
|
|
1755
|
+
readonly intent: {
|
|
1756
|
+
readonly primary: IntentColor;
|
|
1757
|
+
readonly secondary: IntentColor;
|
|
1758
|
+
readonly success: IntentColor;
|
|
1759
|
+
readonly danger: IntentColor;
|
|
1760
|
+
readonly warning: IntentColor;
|
|
1761
|
+
readonly info: IntentColor;
|
|
1762
|
+
};
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
interface IntentColor {
|
|
1766
|
+
|
|
1767
|
+
readonly solid: string;
|
|
1768
|
+
|
|
1769
|
+
readonly on: string;
|
|
1770
|
+
|
|
1771
|
+
readonly soft: string;
|
|
1772
|
+
|
|
1773
|
+
readonly onSoft: string;
|
|
1774
|
+
|
|
1775
|
+
readonly border: string;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
interface Radius {
|
|
1779
|
+
readonly none: string;
|
|
1780
|
+
readonly sm: string;
|
|
1781
|
+
readonly md: string;
|
|
1782
|
+
readonly lg: string;
|
|
1783
|
+
|
|
1784
|
+
readonly hud: string;
|
|
1785
|
+
|
|
1786
|
+
readonly pill: string;
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
interface Space {
|
|
1790
|
+
readonly 0: string;
|
|
1791
|
+
readonly 0.5: string;
|
|
1792
|
+
readonly 1: string;
|
|
1793
|
+
readonly 1.5: string;
|
|
1794
|
+
readonly 2: string;
|
|
1795
|
+
readonly 3: string;
|
|
1796
|
+
readonly 4: string;
|
|
1797
|
+
readonly 6: string;
|
|
1798
|
+
readonly 8: string;
|
|
1799
|
+
readonly 12: string;
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
interface Typography {
|
|
1803
|
+
readonly fontFamily: {
|
|
1804
|
+
|
|
1805
|
+
readonly display: string;
|
|
1806
|
+
|
|
1807
|
+
readonly body: string;
|
|
1808
|
+
|
|
1809
|
+
readonly tabular: string;
|
|
1810
|
+
|
|
1811
|
+
readonly mono: string;
|
|
1812
|
+
};
|
|
1813
|
+
readonly fontSize: {
|
|
1814
|
+
readonly xs: string;
|
|
1815
|
+
readonly sm: string;
|
|
1816
|
+
readonly md: string;
|
|
1817
|
+
readonly lg: string;
|
|
1818
|
+
readonly xl: string;
|
|
1819
|
+
readonly "2xl": string;
|
|
1820
|
+
readonly "3xl": string;
|
|
1821
|
+
};
|
|
1822
|
+
readonly fontWeight: {
|
|
1823
|
+
readonly regular: string;
|
|
1824
|
+
readonly medium: string;
|
|
1825
|
+
readonly bold: string;
|
|
1826
|
+
};
|
|
1827
|
+
readonly lineHeight: {
|
|
1828
|
+
readonly tight: string;
|
|
1829
|
+
readonly normal: string;
|
|
1830
|
+
readonly relaxed: string;
|
|
1831
|
+
};
|
|
1832
|
+
readonly letterSpacing: {
|
|
1833
|
+
readonly tight: string;
|
|
1834
|
+
readonly normal: string;
|
|
1835
|
+
readonly wide: string;
|
|
1836
|
+
|
|
1837
|
+
readonly caps: string;
|
|
1838
|
+
};
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
interface Elevation {
|
|
1842
|
+
|
|
1843
|
+
readonly rest: string;
|
|
1844
|
+
|
|
1845
|
+
readonly hover: string;
|
|
1846
|
+
|
|
1847
|
+
readonly lifted: string;
|
|
1848
|
+
|
|
1849
|
+
readonly overlay: string;
|
|
1850
|
+
|
|
1851
|
+
readonly inset: string;
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
interface Motion {
|
|
1855
|
+
readonly duration: {
|
|
1856
|
+
|
|
1857
|
+
readonly fast: string;
|
|
1858
|
+
|
|
1859
|
+
readonly normal: string;
|
|
1860
|
+
|
|
1861
|
+
readonly slow: string;
|
|
1862
|
+
|
|
1863
|
+
readonly ambient: string;
|
|
1864
|
+
};
|
|
1865
|
+
readonly easing: {
|
|
1866
|
+
|
|
1867
|
+
readonly out: string;
|
|
1868
|
+
|
|
1869
|
+
readonly in: string;
|
|
1870
|
+
|
|
1871
|
+
readonly inOut: string;
|
|
1872
|
+
|
|
1873
|
+
readonly spring: string;
|
|
1874
|
+
};
|
|
1875
|
+
|
|
1876
|
+
readonly reducedMotion: "true" | "false";
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
interface ComponentTokens {
|
|
1880
|
+
readonly board: {
|
|
1881
|
+
|
|
1882
|
+
readonly frameBorder: string;
|
|
1883
|
+
|
|
1884
|
+
readonly frameBackground: string;
|
|
1885
|
+
|
|
1886
|
+
readonly hoverRing: string;
|
|
1887
|
+
|
|
1888
|
+
readonly eligibleHint: string;
|
|
1889
|
+
};
|
|
1890
|
+
readonly card: {
|
|
1891
|
+
|
|
1892
|
+
readonly border: string;
|
|
1893
|
+
|
|
1894
|
+
readonly backBorder: string;
|
|
1895
|
+
|
|
1896
|
+
readonly backBackground: string;
|
|
1897
|
+
|
|
1898
|
+
readonly selectedRing: string;
|
|
1899
|
+
};
|
|
1900
|
+
readonly playerCard: {
|
|
1901
|
+
|
|
1902
|
+
readonly activeBackground: string;
|
|
1903
|
+
|
|
1904
|
+
readonly activeBorder: string;
|
|
1905
|
+
|
|
1906
|
+
readonly activeGlow: string;
|
|
1907
|
+
|
|
1908
|
+
readonly youBadgeBackground: string;
|
|
1909
|
+
|
|
1910
|
+
readonly youBadgeForeground: string;
|
|
1911
|
+
};
|
|
1912
|
+
readonly toast: {
|
|
1913
|
+
readonly successBackground: string;
|
|
1914
|
+
readonly errorBackground: string;
|
|
1915
|
+
readonly infoBackground: string;
|
|
1916
|
+
readonly foreground: string;
|
|
1917
|
+
};
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
interface Theme {
|
|
1921
|
+
readonly meta: ThemeMeta;
|
|
1922
|
+
readonly color: FoundationColor;
|
|
1923
|
+
readonly semantic: SemanticColor;
|
|
1924
|
+
readonly radius: Radius;
|
|
1925
|
+
readonly space: Space;
|
|
1926
|
+
readonly typography: Typography;
|
|
1927
|
+
readonly elevation: Elevation;
|
|
1928
|
+
readonly motion: Motion;
|
|
1929
|
+
readonly player: readonly [
|
|
1930
|
+
PlayerColor,
|
|
1931
|
+
PlayerColor,
|
|
1932
|
+
PlayerColor,
|
|
1933
|
+
PlayerColor,
|
|
1934
|
+
PlayerColor,
|
|
1935
|
+
PlayerColor
|
|
1936
|
+
];
|
|
1937
|
+
readonly component: ComponentTokens;
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1940
|
+
type ThemeOverride = DeepPartial<Theme>;
|
|
1941
|
+
type DeepPartial<T> = T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends object ? {
|
|
1942
|
+
readonly [K in keyof T]?: DeepPartial<T[K]>;
|
|
1943
|
+
} : T;
|
|
1944
|
+
|
|
1945
|
+
declare function mergeTheme(base: Theme, override?: ThemeOverride): Theme;
|
|
1946
|
+
|
|
1947
|
+
declare const tabletopTheme: Theme;
|
|
1948
|
+
|
|
1949
|
+
declare const arcadeTheme: Theme;
|
|
1950
|
+
|
|
1951
|
+
declare const studioTheme: Theme;
|
|
1952
|
+
|
|
1953
|
+
type ThemePresetId = "tabletop" | "arcade" | "studio";
|
|
1954
|
+
|
|
1955
|
+
declare function resolveTheme(input: ThemePresetId | Theme | undefined): Theme;
|
|
1956
|
+
|
|
1957
|
+
declare function getThemePreset(id: ThemePresetId): Theme | undefined;
|
|
1958
|
+
|
|
1959
|
+
interface ThemeContextValue {
|
|
1960
|
+
|
|
1961
|
+
readonly theme: Theme;
|
|
1962
|
+
|
|
1963
|
+
readonly cssVars: CSSProperties;
|
|
1964
|
+
}
|
|
1965
|
+
interface ThemeProviderProps {
|
|
1966
|
+
|
|
1967
|
+
theme?: ThemePresetId | Theme;
|
|
1968
|
+
|
|
1969
|
+
override?: ThemeOverride;
|
|
1970
|
+
|
|
1971
|
+
reducedMotion?: "auto" | "force" | "ignore";
|
|
1972
|
+
|
|
1973
|
+
as?: "block" | "none";
|
|
1974
|
+
|
|
1975
|
+
style?: CSSProperties;
|
|
1976
|
+
|
|
1977
|
+
className?: string;
|
|
1978
|
+
children: ReactNode;
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
declare function ThemeProvider({ theme: themeInput, override, reducedMotion, as, style, className, children, }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
1982
|
+
|
|
1983
|
+
declare function useTheme(): Theme;
|
|
1984
|
+
|
|
1985
|
+
declare function useThemeCssVars(): CSSProperties;
|
|
1986
|
+
|
|
1987
|
+
declare function themeToCssVars(theme: Theme): CSSProperties;
|
|
1988
|
+
|
|
1989
|
+
declare function cssVar(...path: Array<string | number>): string;
|
|
1990
|
+
|
|
1991
|
+
declare function cssVarOr(fallback: string, ...path: Array<string | number>): string;
|
|
1992
|
+
|
|
1993
|
+
type ButtonVariant$1 = "primary" | "secondary" | "danger" | "submitted" | "success" | "warning" | "info" | "ghost";
|
|
1994
|
+
type ButtonSize$1 = "sm" | "md" | "lg";
|
|
1995
|
+
|
|
1996
|
+
declare function buttonStyle(theme: Theme, options?: {
|
|
1997
|
+
variant?: ButtonVariant$1;
|
|
1998
|
+
size?: ButtonSize$1;
|
|
1999
|
+
disabled?: boolean;
|
|
2000
|
+
pressed?: boolean;
|
|
2001
|
+
}): CSSProperties;
|
|
2002
|
+
|
|
2003
|
+
declare function chipStyle(theme: Theme, options?: {
|
|
2004
|
+
variant?: Exclude<ButtonVariant$1, "ghost">;
|
|
2005
|
+
size?: "sm" | "md";
|
|
2006
|
+
}): CSSProperties;
|
|
2007
|
+
|
|
2008
|
+
declare function surfaceStyle(theme: Theme, options?: {
|
|
2009
|
+
tone?: keyof Theme["semantic"]["surface"];
|
|
2010
|
+
interactive?: boolean;
|
|
2011
|
+
|
|
2012
|
+
radius?: keyof Theme["radius"];
|
|
2013
|
+
}): CSSProperties;
|
|
2014
|
+
|
|
2015
|
+
declare function intentForVariant(theme: Theme, variant: ButtonVariant$1): IntentColor;
|
|
2016
|
+
|
|
2017
|
+
declare function playerColor(theme: Theme, slot: number): PlayerColor;
|
|
2018
|
+
|
|
2019
|
+
declare function motionDuration(theme: Theme, key: keyof Theme["motion"]["duration"]): string;
|
|
2020
|
+
|
|
2021
|
+
interface BoardTheme {
|
|
2022
|
+
|
|
2023
|
+
readonly frameBorder: string;
|
|
2024
|
+
|
|
2025
|
+
readonly frameBackground: string;
|
|
2026
|
+
|
|
2027
|
+
readonly hoverRing: string;
|
|
2028
|
+
|
|
2029
|
+
readonly eligibleHint: string;
|
|
2030
|
+
|
|
2031
|
+
readonly tileBorder: string;
|
|
2032
|
+
|
|
2033
|
+
readonly tileBorderSubtle: string;
|
|
2034
|
+
|
|
2035
|
+
readonly tileText: string;
|
|
2036
|
+
|
|
2037
|
+
readonly ringWidth: number;
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
declare function useBoardTheme(): BoardTheme;
|
|
2041
|
+
|
|
2042
|
+
declare function deriveBoardTheme(theme: Theme): BoardTheme;
|
|
2043
|
+
|
|
2044
|
+
interface InteractionFieldRenderProps<Params extends InteractionParamsShape = InteractionParamsShape, Key extends keyof Params & string = keyof Params & string> {
|
|
2045
|
+
descriptor: InteractionDescriptor;
|
|
2046
|
+
input: InteractionInputDescriptor & {
|
|
2047
|
+
key: Key;
|
|
2048
|
+
};
|
|
2049
|
+
handle: InteractionHandle<Params>;
|
|
2050
|
+
value: Params[Key] | undefined;
|
|
2051
|
+
setValue: (value: Params[Key]) => void;
|
|
2052
|
+
clearValue: () => void;
|
|
2053
|
+
errors: readonly string[];
|
|
2054
|
+
missing: boolean;
|
|
2055
|
+
disabled: boolean;
|
|
2056
|
+
}
|
|
2057
|
+
type InteractionFieldRenderMap<Params extends InteractionParamsShape = InteractionParamsShape> = Partial<{
|
|
2058
|
+
[K in keyof Params & string]: (props: InteractionFieldRenderProps<Params, K>) => ReactNode;
|
|
2059
|
+
}>;
|
|
2060
|
+
interface InteractionFieldProps<Params extends InteractionParamsShape = InteractionParamsShape, Key extends keyof Params & string = keyof Params & string> {
|
|
2061
|
+
descriptor: InteractionDescriptor;
|
|
2062
|
+
inputKey: Key;
|
|
2063
|
+
handle: InteractionHandle<Params>;
|
|
2064
|
+
errors?: readonly string[];
|
|
2065
|
+
missing?: boolean;
|
|
2066
|
+
disabled?: boolean;
|
|
2067
|
+
render?: InteractionFieldRenderMap<Params>[Key];
|
|
2068
|
+
}
|
|
2069
|
+
interface InteractionFormProps<Params extends InteractionParamsShape = InteractionParamsShape, DefaultedKeys extends keyof Params & string = never> {
|
|
2070
|
+
descriptor: InteractionDescriptor;
|
|
2071
|
+
handle: InteractionHandle<Params, DefaultedKeys>;
|
|
2072
|
+
fields?: ReadonlyArray<keyof Params & string>;
|
|
2073
|
+
hiddenFields?: ReadonlyArray<keyof Params & string>;
|
|
2074
|
+
renderFields?: InteractionFieldRenderMap<Params>;
|
|
2075
|
+
title?: ReactNode;
|
|
2076
|
+
description?: ReactNode;
|
|
2077
|
+
submitLabel?: ReactNode;
|
|
2078
|
+
cancelLabel?: ReactNode;
|
|
2079
|
+
onCancel?: () => void;
|
|
2080
|
+
onSubmitSuccess?: () => void;
|
|
2081
|
+
disabled?: boolean;
|
|
2082
|
+
accordion?: boolean;
|
|
2083
|
+
defaultOpen?: boolean;
|
|
2084
|
+
style?: CSSProperties;
|
|
2085
|
+
}
|
|
2086
|
+
declare function InteractionForm<Params extends InteractionParamsShape = InteractionParamsShape, DefaultedKeys extends keyof Params & string = never>({ descriptor, handle, fields, hiddenFields, renderFields, title, description, submitLabel, cancelLabel, onCancel, onSubmitSuccess, disabled, accordion, defaultOpen, style, }: InteractionFormProps<Params, DefaultedKeys>): react_jsx_runtime.JSX.Element;
|
|
2087
|
+
declare function InteractionField<Params extends InteractionParamsShape = InteractionParamsShape, Key extends keyof Params & string = keyof Params & string>({ descriptor, inputKey, handle, errors, missing, disabled, render, }: InteractionFieldProps<Params, Key>): react_jsx_runtime.JSX.Element | null;
|
|
2088
|
+
declare function hasDefaultInteractionFormFields(descriptor: Pick<InteractionDescriptor, "inputs">): boolean;
|
|
2089
|
+
declare function defaultFormInputs(descriptor: Pick<InteractionDescriptor, "inputs">): InteractionInputDescriptor[];
|
|
2090
|
+
|
|
2091
|
+
interface CardProps<CardData extends ViewCard = ViewCard> extends Omit<HTMLMotionProps<"button">, "children"> {
|
|
2092
|
+
card: CardData;
|
|
2093
|
+
selected?: boolean;
|
|
2094
|
+
disabled?: boolean;
|
|
2095
|
+
size?: "sm" | "md" | "lg";
|
|
2096
|
+
faceDown?: boolean;
|
|
2097
|
+
renderContent?: (card: CardData) => React.ReactNode;
|
|
2098
|
+
onCardClick?: (cardId: string) => void;
|
|
2099
|
+
"aria-label"?: string;
|
|
2100
|
+
}
|
|
2101
|
+
|
|
2102
|
+
declare function Card<CardData extends ViewCard = ViewCard>({ card, selected, disabled, size, faceDown, renderContent, onCardClick, className, "aria-label": ariaLabel, ...motionProps }: CardProps<CardData>): react_jsx_runtime.JSX.Element;
|
|
2103
|
+
|
|
2104
|
+
interface HandCardRenderProps<CardData extends ViewCard = ViewCard> {
|
|
2105
|
+
card: CardData;
|
|
2106
|
+
index: number;
|
|
2107
|
+
isHovered: boolean;
|
|
2108
|
+
isSelected: boolean;
|
|
2109
|
+
x: number;
|
|
2110
|
+
y: number;
|
|
2111
|
+
zIndex: number;
|
|
2112
|
+
cardDimensions: {
|
|
2113
|
+
width: number;
|
|
2114
|
+
height: number;
|
|
2115
|
+
};
|
|
2116
|
+
}
|
|
2117
|
+
interface HandDrawerRenderProps<CardData extends ViewCard = ViewCard> {
|
|
2118
|
+
cards: readonly CardData[];
|
|
2119
|
+
selectedIds: readonly string[];
|
|
2120
|
+
cardCount: number;
|
|
2121
|
+
selectedCount: number;
|
|
2122
|
+
disabled: boolean;
|
|
2123
|
+
cardDimensions: {
|
|
2124
|
+
width: number;
|
|
2125
|
+
height: number;
|
|
2126
|
+
};
|
|
2127
|
+
}
|
|
2128
|
+
interface HandEmptyRenderProps {
|
|
2129
|
+
layout: HandLayout;
|
|
2130
|
+
}
|
|
2131
|
+
interface HandContainerRenderProps {
|
|
2132
|
+
totalWidth: number;
|
|
2133
|
+
totalHeight: number;
|
|
2134
|
+
cardDimensions: {
|
|
2135
|
+
width: number;
|
|
2136
|
+
height: number;
|
|
2137
|
+
};
|
|
2138
|
+
children: ReactNode;
|
|
2139
|
+
onMouseMove: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
2140
|
+
onMouseLeave: () => void;
|
|
2141
|
+
}
|
|
2142
|
+
interface HandProps<CardData extends ViewCard = ViewCard> {
|
|
2143
|
+
cards: readonly CardData[];
|
|
2144
|
+
selectedIds?: readonly string[];
|
|
2145
|
+
disabled?: boolean;
|
|
2146
|
+
cardSize?: CardSize;
|
|
2147
|
+
layout?: HandLayout;
|
|
2148
|
+
"aria-label"?: string;
|
|
2149
|
+
|
|
2150
|
+
onCardClick?: (cardId: string) => void;
|
|
2151
|
+
|
|
2152
|
+
renderCardContent?: (card: CardData) => ReactNode;
|
|
2153
|
+
|
|
2154
|
+
renderCard?: (props: HandCardRenderProps<CardData>) => ReactNode;
|
|
2155
|
+
|
|
2156
|
+
renderDrawer?: (props: HandDrawerRenderProps<CardData>) => ReactNode;
|
|
2157
|
+
|
|
2158
|
+
renderEmpty?: (props: HandEmptyRenderProps) => ReactNode;
|
|
2159
|
+
renderContainer?: (props: HandContainerRenderProps) => ReactNode;
|
|
2160
|
+
className?: string;
|
|
2161
|
+
}
|
|
2162
|
+
|
|
2163
|
+
declare function Hand<CardData extends ViewCard = ViewCard>({ cards, selectedIds, disabled, cardSize, layout, "aria-label": ariaLabel, onCardClick, renderCardContent, renderCard, renderDrawer, renderEmpty, renderContainer, className, }: HandProps<CardData>): react_jsx_runtime.JSX.Element;
|
|
2164
|
+
|
|
2165
|
+
type HandDockMode = "inline" | "drawer" | "hidden";
|
|
2166
|
+
type HandDockPlacement = "bottom-left" | "bottom-center" | "bottom-right";
|
|
2167
|
+
interface HandDockToggleContext {
|
|
2168
|
+
label: string;
|
|
2169
|
+
count: number;
|
|
2170
|
+
open: boolean;
|
|
2171
|
+
}
|
|
2172
|
+
interface HandDockPresentation {
|
|
2173
|
+
|
|
2174
|
+
mode?: HandDockMode;
|
|
2175
|
+
|
|
2176
|
+
defaultOpen?: boolean;
|
|
2177
|
+
|
|
2178
|
+
placement?: HandDockPlacement;
|
|
2179
|
+
|
|
2180
|
+
toggleLabel?: ReactNode | ((context: HandDockToggleContext) => ReactNode);
|
|
2181
|
+
|
|
2182
|
+
maxWidth?: CSSProperties["maxWidth"];
|
|
2183
|
+
|
|
2184
|
+
maxHeight?: CSSProperties["maxHeight"];
|
|
2185
|
+
|
|
2186
|
+
style?: CSSProperties;
|
|
2187
|
+
}
|
|
2188
|
+
interface HandDockProps {
|
|
2189
|
+
label: string;
|
|
2190
|
+
count: number;
|
|
2191
|
+
presentation?: HandDockPresentation;
|
|
2192
|
+
children: ReactNode;
|
|
2193
|
+
}
|
|
2194
|
+
declare function HandDock({ label, count, presentation, children, }: HandDockProps): react_jsx_runtime.JSX.Element | null;
|
|
2195
|
+
|
|
2196
|
+
interface PlayAreaProps<CardData extends ViewCard = ViewCard> {
|
|
2197
|
+
cards: readonly CardData[];
|
|
2198
|
+
filter?: (card: CardData) => boolean;
|
|
2199
|
+
cardSize?: CardProps["size"];
|
|
2200
|
+
renderCard?: CardProps<CardData>["renderContent"];
|
|
2201
|
+
layout?: "grid" | "row";
|
|
2202
|
+
interactive?: boolean;
|
|
2203
|
+
onCardClick?: (cardId: string) => void;
|
|
2204
|
+
"aria-label"?: string;
|
|
2205
|
+
className?: string;
|
|
2206
|
+
}
|
|
2207
|
+
|
|
2208
|
+
declare function PlayArea<CardData extends ViewCard = ViewCard>({ cards, filter, cardSize, renderCard, layout, interactive, onCardClick, "aria-label": ariaLabel, className, }: PlayAreaProps<CardData>): react_jsx_runtime.JSX.Element;
|
|
2209
|
+
|
|
2210
|
+
interface GameSkeletonProps {
|
|
2211
|
+
variant?: "default" | "cards" | "players" | "minimal";
|
|
2212
|
+
message?: string;
|
|
2213
|
+
className?: string;
|
|
2214
|
+
}
|
|
2215
|
+
declare function GameSkeleton({ variant, message, className, }: GameSkeletonProps): react_jsx_runtime.JSX.Element;
|
|
2216
|
+
|
|
2217
|
+
type ToastType = "success" | "error" | "info" | "warning";
|
|
2218
|
+
interface Toast {
|
|
2219
|
+
id: string;
|
|
2220
|
+
type: ToastType;
|
|
2221
|
+
message: string;
|
|
2222
|
+
duration?: number;
|
|
2223
|
+
}
|
|
2224
|
+
interface ToastContextValue {
|
|
2225
|
+
toasts: Toast[];
|
|
2226
|
+
show: (message: string, type?: ToastType, duration?: number) => void;
|
|
2227
|
+
dismiss: (id: string) => void;
|
|
2228
|
+
success: (message: string, duration?: number) => void;
|
|
2229
|
+
error: (message: string, duration?: number) => void;
|
|
2230
|
+
info: (message: string, duration?: number) => void;
|
|
2231
|
+
warning: (message: string, duration?: number) => void;
|
|
2232
|
+
}
|
|
2233
|
+
interface ToastProviderProps {
|
|
2234
|
+
children: ReactNode;
|
|
2235
|
+
}
|
|
2236
|
+
declare function ToastProvider({ children }: ToastProviderProps): react_jsx_runtime.JSX.Element;
|
|
2237
|
+
declare function useToast(): ToastContextValue;
|
|
2238
|
+
|
|
2239
|
+
interface ErrorBoundaryProps {
|
|
2240
|
+
children: ReactNode;
|
|
2241
|
+
fallback?: (error: Error, reset: () => void) => ReactNode;
|
|
2242
|
+
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
2243
|
+
}
|
|
2244
|
+
interface ErrorBoundaryState {
|
|
2245
|
+
hasError: boolean;
|
|
2246
|
+
error: Error | null;
|
|
2247
|
+
}
|
|
2248
|
+
declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
2249
|
+
constructor(props: ErrorBoundaryProps);
|
|
2250
|
+
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
2251
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
2252
|
+
handleReset: () => void;
|
|
2253
|
+
render(): ReactNode;
|
|
2254
|
+
}
|
|
2255
|
+
|
|
2256
|
+
interface PluginRuntimeProps {
|
|
2257
|
+
|
|
2258
|
+
children: React__default.ReactNode;
|
|
2259
|
+
|
|
2260
|
+
timeout?: number;
|
|
2261
|
+
|
|
2262
|
+
loadingComponent?: React__default.ReactNode;
|
|
2263
|
+
|
|
2264
|
+
errorComponent?: (error: string) => React__default.ReactNode;
|
|
2265
|
+
}
|
|
2266
|
+
|
|
2267
|
+
declare function PluginRuntime({ children, timeout, loadingComponent, errorComponent, }: PluginRuntimeProps): react_jsx_runtime.JSX.Element;
|
|
2268
|
+
|
|
2269
|
+
declare const NODES: readonly ["a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "select", "span", "svg", "ul"];
|
|
2270
|
+
type Primitives = {
|
|
2271
|
+
[E in (typeof NODES)[number]]: PrimitiveForwardRefComponent<E>;
|
|
2272
|
+
};
|
|
2273
|
+
type PrimitivePropsWithRef<E extends React$1.ElementType> = React$1.ComponentPropsWithRef<E> & {
|
|
2274
|
+
asChild?: boolean;
|
|
2275
|
+
};
|
|
2276
|
+
interface PrimitiveForwardRefComponent<E extends React$1.ElementType> extends React$1.ForwardRefExoticComponent<PrimitivePropsWithRef<E>> {
|
|
2277
|
+
}
|
|
2278
|
+
declare const Primitive: Primitives;
|
|
2279
|
+
|
|
2280
|
+
type PrimitiveDivProps$3 = React$1.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
2281
|
+
interface DismissableLayerProps$1 extends PrimitiveDivProps$3 {
|
|
2282
|
+
|
|
2283
|
+
disableOutsidePointerEvents?: boolean;
|
|
2284
|
+
|
|
2285
|
+
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
|
2286
|
+
|
|
2287
|
+
onPointerDownOutside?: (event: PointerDownOutsideEvent) => void;
|
|
2288
|
+
|
|
2289
|
+
onFocusOutside?: (event: FocusOutsideEvent) => void;
|
|
2290
|
+
|
|
2291
|
+
onInteractOutside?: (event: PointerDownOutsideEvent | FocusOutsideEvent) => void;
|
|
2292
|
+
|
|
2293
|
+
onDismiss?: () => void;
|
|
2294
|
+
}
|
|
2295
|
+
declare const DismissableLayer: React$1.ForwardRefExoticComponent<DismissableLayerProps$1 & React$1.RefAttributes<HTMLDivElement>>;
|
|
2296
|
+
type PointerDownOutsideEvent = CustomEvent<{
|
|
2297
|
+
originalEvent: PointerEvent;
|
|
2298
|
+
}>;
|
|
2299
|
+
type FocusOutsideEvent = CustomEvent<{
|
|
2300
|
+
originalEvent: FocusEvent;
|
|
2301
|
+
}>;
|
|
2302
|
+
|
|
2303
|
+
type PrimitiveDivProps$2 = React$1.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
2304
|
+
interface FocusScopeProps$1 extends PrimitiveDivProps$2 {
|
|
2305
|
+
|
|
2306
|
+
loop?: boolean;
|
|
2307
|
+
|
|
2308
|
+
trapped?: boolean;
|
|
2309
|
+
|
|
2310
|
+
onMountAutoFocus?: (event: Event) => void;
|
|
2311
|
+
|
|
2312
|
+
onUnmountAutoFocus?: (event: Event) => void;
|
|
2313
|
+
}
|
|
2314
|
+
declare const FocusScope: React$1.ForwardRefExoticComponent<FocusScopeProps$1 & React$1.RefAttributes<HTMLDivElement>>;
|
|
2315
|
+
|
|
2316
|
+
type PrimitiveDivProps$1 = React$1.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
2317
|
+
interface PortalProps$2 extends PrimitiveDivProps$1 {
|
|
2318
|
+
|
|
2319
|
+
container?: Element | DocumentFragment | null;
|
|
2320
|
+
}
|
|
2321
|
+
declare const Portal$2: React$1.ForwardRefExoticComponent<PortalProps$2 & React$1.RefAttributes<HTMLDivElement>>;
|
|
2322
|
+
|
|
2323
|
+
interface DialogProps$1 {
|
|
2324
|
+
children?: React$1.ReactNode;
|
|
2325
|
+
open?: boolean;
|
|
2326
|
+
defaultOpen?: boolean;
|
|
2327
|
+
onOpenChange?(open: boolean): void;
|
|
2328
|
+
modal?: boolean;
|
|
2329
|
+
}
|
|
2330
|
+
type PrimitiveButtonProps = React$1.ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
2331
|
+
interface DialogTriggerProps extends PrimitiveButtonProps {
|
|
2332
|
+
}
|
|
2333
|
+
type PortalProps$1 = React$1.ComponentPropsWithoutRef<typeof Portal$2>;
|
|
2334
|
+
interface DialogPortalProps {
|
|
2335
|
+
children?: React$1.ReactNode;
|
|
2336
|
+
|
|
2337
|
+
container?: PortalProps$1['container'];
|
|
2338
|
+
|
|
2339
|
+
forceMount?: true;
|
|
2340
|
+
}
|
|
2341
|
+
interface DialogOverlayProps extends DialogOverlayImplProps {
|
|
2342
|
+
|
|
2343
|
+
forceMount?: true;
|
|
2344
|
+
}
|
|
2345
|
+
type PrimitiveDivProps = React$1.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
2346
|
+
interface DialogOverlayImplProps extends PrimitiveDivProps {
|
|
2347
|
+
}
|
|
2348
|
+
interface DialogContentProps extends DialogContentTypeProps {
|
|
2349
|
+
|
|
2350
|
+
forceMount?: true;
|
|
2351
|
+
}
|
|
2352
|
+
interface DialogContentTypeProps extends Omit<DialogContentImplProps, 'trapFocus' | 'disableOutsidePointerEvents'> {
|
|
2353
|
+
}
|
|
2354
|
+
type DismissableLayerProps = React$1.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
2355
|
+
type FocusScopeProps = React$1.ComponentPropsWithoutRef<typeof FocusScope>;
|
|
2356
|
+
interface DialogContentImplProps extends Omit<DismissableLayerProps, 'onDismiss'> {
|
|
2357
|
+
|
|
2358
|
+
trapFocus?: FocusScopeProps['trapped'];
|
|
2359
|
+
|
|
2360
|
+
onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];
|
|
2361
|
+
|
|
2362
|
+
onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];
|
|
2363
|
+
}
|
|
2364
|
+
type PrimitiveHeading2Props = React$1.ComponentPropsWithoutRef<typeof Primitive.h2>;
|
|
2365
|
+
interface DialogTitleProps extends PrimitiveHeading2Props {
|
|
2366
|
+
}
|
|
2367
|
+
type PrimitiveParagraphProps = React$1.ComponentPropsWithoutRef<typeof Primitive.p>;
|
|
2368
|
+
interface DialogDescriptionProps extends PrimitiveParagraphProps {
|
|
2369
|
+
}
|
|
2370
|
+
interface DialogCloseProps extends PrimitiveButtonProps {
|
|
2371
|
+
}
|
|
2372
|
+
declare const Root$1: React$1.FC<DialogProps$1>;
|
|
2373
|
+
declare const Trigger: React$1.ForwardRefExoticComponent<DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
2374
|
+
declare const Portal$1: React$1.FC<DialogPortalProps>;
|
|
2375
|
+
declare const Overlay: React$1.ForwardRefExoticComponent<DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
2376
|
+
declare const Content: React$1.ForwardRefExoticComponent<DialogContentProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
2377
|
+
declare const Title: React$1.ForwardRefExoticComponent<DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
2378
|
+
declare const Description: React$1.ForwardRefExoticComponent<DialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
2379
|
+
declare const Close: React$1.ForwardRefExoticComponent<DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
2380
|
+
|
|
2381
|
+
interface WithFadeFromProps {
|
|
2382
|
+
|
|
2383
|
+
snapPoints: (number | string)[];
|
|
2384
|
+
|
|
2385
|
+
fadeFromIndex: number;
|
|
2386
|
+
}
|
|
2387
|
+
interface WithoutFadeFromProps {
|
|
2388
|
+
|
|
2389
|
+
snapPoints?: (number | string)[];
|
|
2390
|
+
fadeFromIndex?: never;
|
|
2391
|
+
}
|
|
2392
|
+
type DialogProps = {
|
|
2393
|
+
activeSnapPoint?: number | string | null;
|
|
2394
|
+
setActiveSnapPoint?: (snapPoint: number | string | null) => void;
|
|
2395
|
+
children?: React__default.ReactNode;
|
|
2396
|
+
open?: boolean;
|
|
2397
|
+
|
|
2398
|
+
closeThreshold?: number;
|
|
2399
|
+
|
|
2400
|
+
noBodyStyles?: boolean;
|
|
2401
|
+
onOpenChange?: (open: boolean) => void;
|
|
2402
|
+
shouldScaleBackground?: boolean;
|
|
2403
|
+
|
|
2404
|
+
setBackgroundColorOnScale?: boolean;
|
|
2405
|
+
|
|
2406
|
+
scrollLockTimeout?: number;
|
|
2407
|
+
|
|
2408
|
+
fixed?: boolean;
|
|
2409
|
+
|
|
2410
|
+
handleOnly?: boolean;
|
|
2411
|
+
|
|
2412
|
+
dismissible?: boolean;
|
|
2413
|
+
onDrag?: (event: React__default.PointerEvent<HTMLDivElement>, percentageDragged: number) => void;
|
|
2414
|
+
onRelease?: (event: React__default.PointerEvent<HTMLDivElement>, open: boolean) => void;
|
|
2415
|
+
|
|
2416
|
+
modal?: boolean;
|
|
2417
|
+
nested?: boolean;
|
|
2418
|
+
onClose?: () => void;
|
|
2419
|
+
|
|
2420
|
+
direction?: 'top' | 'bottom' | 'left' | 'right';
|
|
2421
|
+
|
|
2422
|
+
defaultOpen?: boolean;
|
|
2423
|
+
|
|
2424
|
+
disablePreventScroll?: boolean;
|
|
2425
|
+
|
|
2426
|
+
repositionInputs?: boolean;
|
|
2427
|
+
|
|
2428
|
+
snapToSequentialPoint?: boolean;
|
|
2429
|
+
container?: HTMLElement | null;
|
|
2430
|
+
|
|
2431
|
+
onAnimationEnd?: (open: boolean) => void;
|
|
2432
|
+
preventScrollRestoration?: boolean;
|
|
2433
|
+
autoFocus?: boolean;
|
|
2434
|
+
} & (WithFadeFromProps | WithoutFadeFromProps);
|
|
2435
|
+
declare function Root({ open: openProp, onOpenChange, children, onDrag: onDragProp, onRelease: onReleaseProp, snapPoints, shouldScaleBackground, setBackgroundColorOnScale, closeThreshold, scrollLockTimeout, dismissible, handleOnly, fadeFromIndex, activeSnapPoint: activeSnapPointProp, setActiveSnapPoint: setActiveSnapPointProp, fixed, modal, onClose, nested, noBodyStyles, direction, defaultOpen, disablePreventScroll, snapToSequentialPoint, preventScrollRestoration, repositionInputs, onAnimationEnd, container, autoFocus, }: DialogProps): React__default.JSX.Element;
|
|
2436
|
+
declare function NestedRoot({ onDrag, onOpenChange, open: nestedIsOpen, ...rest }: DialogProps): React__default.JSX.Element;
|
|
2437
|
+
type PortalProps = React__default.ComponentPropsWithoutRef<typeof Portal$1>;
|
|
2438
|
+
declare function Portal(props: PortalProps): React__default.JSX.Element;
|
|
2439
|
+
declare const Drawer$1: {
|
|
2440
|
+
Root: typeof Root;
|
|
2441
|
+
NestedRoot: typeof NestedRoot;
|
|
2442
|
+
Content: React__default.ForwardRefExoticComponent<Omit<DialogContentProps & React__default.RefAttributes<HTMLDivElement>, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
2443
|
+
Overlay: React__default.ForwardRefExoticComponent<Omit<DialogOverlayProps & React__default.RefAttributes<HTMLDivElement>, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
2444
|
+
Trigger: React__default.ForwardRefExoticComponent<DialogTriggerProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
2445
|
+
Portal: typeof Portal;
|
|
2446
|
+
Handle: React__default.ForwardRefExoticComponent<Omit<React__default.DetailedHTMLProps<React__default.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
2447
|
+
preventCycle?: boolean | undefined;
|
|
2448
|
+
} & React__default.RefAttributes<HTMLDivElement>>;
|
|
2449
|
+
Close: React__default.ForwardRefExoticComponent<DialogCloseProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
2450
|
+
Title: React__default.ForwardRefExoticComponent<DialogTitleProps & React__default.RefAttributes<HTMLHeadingElement>>;
|
|
2451
|
+
Description: React__default.ForwardRefExoticComponent<DialogDescriptionProps & React__default.RefAttributes<HTMLParagraphElement>>;
|
|
2452
|
+
};
|
|
2453
|
+
|
|
2454
|
+
declare function Drawer({ ...props }: React$1.ComponentProps<typeof Drawer$1.Root>): react_jsx_runtime.JSX.Element;
|
|
2455
|
+
declare function DrawerTrigger({ ...props }: React$1.ComponentProps<typeof Drawer$1.Trigger>): react_jsx_runtime.JSX.Element;
|
|
2456
|
+
declare function DrawerPortal({ ...props }: React$1.ComponentProps<typeof Drawer$1.Portal>): react_jsx_runtime.JSX.Element;
|
|
2457
|
+
declare function DrawerClose({ ...props }: React$1.ComponentProps<typeof Drawer$1.Close>): react_jsx_runtime.JSX.Element;
|
|
2458
|
+
declare function DrawerOverlay({ className, style, ...props }: React$1.ComponentProps<typeof Drawer$1.Overlay>): react_jsx_runtime.JSX.Element;
|
|
2459
|
+
interface DrawerContentProps extends React$1.ComponentPropsWithoutRef<typeof Drawer$1.Content> {
|
|
2460
|
+
showHandle?: boolean;
|
|
2461
|
+
children?: React$1.ReactNode;
|
|
2462
|
+
}
|
|
2463
|
+
declare function DrawerContent({ className, children, showHandle, ...props }: DrawerContentProps): react_jsx_runtime.JSX.Element;
|
|
2464
|
+
declare function DrawerHeader({ className, ...props }: React$1.ComponentPropsWithoutRef<"div">): react_jsx_runtime.JSX.Element;
|
|
2465
|
+
declare function DrawerFooter({ className, ...props }: React$1.ComponentPropsWithoutRef<"div">): react_jsx_runtime.JSX.Element;
|
|
2466
|
+
declare function DrawerTitle({ className, ...props }: React$1.ComponentProps<typeof Drawer$1.Title>): react_jsx_runtime.JSX.Element;
|
|
2467
|
+
declare function DrawerDescription({ className, ...props }: React$1.ComponentProps<typeof Drawer$1.Description>): react_jsx_runtime.JSX.Element;
|
|
2468
|
+
|
|
2469
|
+
declare function Dialog(props: React$1.ComponentProps<typeof Root$1>): react_jsx_runtime.JSX.Element;
|
|
2470
|
+
declare function DialogTrigger(props: React$1.ComponentProps<typeof Trigger>): react_jsx_runtime.JSX.Element;
|
|
2471
|
+
declare function DialogPortal(props: React$1.ComponentProps<typeof Portal$1>): react_jsx_runtime.JSX.Element;
|
|
2472
|
+
declare function DialogClose(props: React$1.ComponentProps<typeof Close>): react_jsx_runtime.JSX.Element;
|
|
2473
|
+
declare function DialogOverlay({ className, ...props }: React$1.ComponentProps<typeof Overlay>): react_jsx_runtime.JSX.Element;
|
|
2474
|
+
declare function DialogContent({ className, children, showCloseButton, overlayClassName, ...props }: React$1.ComponentProps<typeof Content> & {
|
|
2475
|
+
showCloseButton?: boolean;
|
|
2476
|
+
overlayClassName?: string;
|
|
2477
|
+
}): react_jsx_runtime.JSX.Element;
|
|
2478
|
+
declare function DialogHeader({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
2479
|
+
declare function DialogFooter({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
2480
|
+
declare function DialogTitle({ className, ...props }: React$1.ComponentProps<typeof Title>): react_jsx_runtime.JSX.Element;
|
|
2481
|
+
declare function DialogDescription({ className, ...props }: React$1.ComponentProps<typeof Description>): react_jsx_runtime.JSX.Element;
|
|
2482
|
+
|
|
2483
|
+
interface ResourceDisplayConfig {
|
|
2484
|
+
type: ResourceId;
|
|
2485
|
+
label: string;
|
|
2486
|
+
icon: ReactNode | ComponentType<{
|
|
2487
|
+
className?: string;
|
|
2488
|
+
strokeWidth?: number;
|
|
2489
|
+
"aria-hidden"?: string;
|
|
2490
|
+
}>;
|
|
2491
|
+
iconColor?: string;
|
|
2492
|
+
bgColor?: string;
|
|
2493
|
+
textColor?: string;
|
|
2494
|
+
}
|
|
2495
|
+
interface ResourceCounterProps {
|
|
2496
|
+
resources: ResourceDisplayConfig[];
|
|
2497
|
+
counts: Record<ResourceId, number>;
|
|
2498
|
+
layout?: "row" | "grid" | "compact";
|
|
2499
|
+
|
|
2500
|
+
columns?: number;
|
|
2501
|
+
showZero?: boolean;
|
|
2502
|
+
size?: "sm" | "md" | "lg";
|
|
2503
|
+
onResourceClick?: (resourceType: ResourceId) => void;
|
|
2504
|
+
className?: string;
|
|
2505
|
+
}
|
|
2506
|
+
declare function ResourceCounter({ resources, counts, layout, columns, showZero, size, onResourceClick, className, }: ResourceCounterProps): react_jsx_runtime.JSX.Element;
|
|
2507
|
+
|
|
2508
|
+
interface ResourceDefinition {
|
|
2509
|
+
type: string;
|
|
2510
|
+
label: string;
|
|
2511
|
+
icon?: ComponentType<{
|
|
2512
|
+
className?: string;
|
|
2513
|
+
}>;
|
|
2514
|
+
color?: string;
|
|
2515
|
+
}
|
|
2516
|
+
interface CostDisplayProps {
|
|
2517
|
+
|
|
2518
|
+
cost: Record<string, number>;
|
|
2519
|
+
|
|
2520
|
+
currentResources?: Record<string, number>;
|
|
2521
|
+
resourceDefs: ResourceDefinition[];
|
|
2522
|
+
size?: "sm" | "md";
|
|
2523
|
+
layout?: "inline" | "stacked";
|
|
2524
|
+
className?: string;
|
|
2525
|
+
}
|
|
2526
|
+
declare function CostDisplay({ cost, currentResources, resourceDefs, size, layout, className, }: CostDisplayProps): react_jsx_runtime.JSX.Element | null;
|
|
2527
|
+
|
|
2528
|
+
interface ActionButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onClick"> {
|
|
2529
|
+
handle: InteractionHandle;
|
|
2530
|
+
children?: ReactNode;
|
|
2531
|
+
}
|
|
2532
|
+
declare function ActionButton({ handle, children, disabled, title, ...rest }: ActionButtonProps): react_jsx_runtime.JSX.Element;
|
|
2533
|
+
|
|
2534
|
+
interface PrimaryButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
2535
|
+
|
|
2536
|
+
variant?: ButtonVariant$1;
|
|
2537
|
+
|
|
2538
|
+
size?: ButtonSize$1;
|
|
2539
|
+
}
|
|
2540
|
+
declare function PrimaryButton({ children, disabled, style, variant, size, ...rest }: PrimaryButtonProps): react_jsx_runtime.JSX.Element;
|
|
2541
|
+
|
|
2542
|
+
type ButtonVariant = "default" | "destructive" | "outline" | "secondary" | "ghost" | "link";
|
|
2543
|
+
type ButtonSize = "default" | "sm" | "lg" | "icon";
|
|
2544
|
+
interface ButtonProps extends React$1.ComponentProps<"button"> {
|
|
2545
|
+
variant?: ButtonVariant;
|
|
2546
|
+
size?: ButtonSize;
|
|
2547
|
+
asChild?: boolean;
|
|
2548
|
+
}
|
|
2549
|
+
declare function Button({ className, variant, size, asChild, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
2550
|
+
|
|
2551
|
+
type ShadcnButtonProps = ComponentProps<typeof Button>;
|
|
2552
|
+
interface ThemedButtonProps extends Omit<ShadcnButtonProps, "variant" | "size"> {
|
|
2553
|
+
variant?: ButtonVariant$1;
|
|
2554
|
+
size?: ButtonSize$1;
|
|
2555
|
+
pressed?: boolean;
|
|
2556
|
+
}
|
|
2557
|
+
declare function ThemedButton({ variant, size, pressed, disabled, className, style, ...props }: ThemedButtonProps): react_jsx_runtime.JSX.Element;
|
|
2558
|
+
|
|
2559
|
+
interface SubmittedActionConfig {
|
|
2560
|
+
label?: ReactNode;
|
|
2561
|
+
icon?: ReactNode;
|
|
2562
|
+
variant?: ButtonVariant$1;
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2565
|
+
type PrimaryActionAttention = "auto" | "always" | "off";
|
|
2566
|
+
interface PrimaryActionButtonProps<Params extends InteractionParamsShape = InteractionParamsShape> {
|
|
2567
|
+
|
|
2568
|
+
handle: InteractionHandle<Params>;
|
|
2569
|
+
|
|
2570
|
+
variant?: ButtonVariant$1;
|
|
2571
|
+
|
|
2572
|
+
size?: ButtonSize$1;
|
|
2573
|
+
|
|
2574
|
+
label?: ReactNode;
|
|
2575
|
+
|
|
2576
|
+
ready?: boolean;
|
|
2577
|
+
|
|
2578
|
+
whenSubmitted?: SubmittedActionConfig;
|
|
2579
|
+
|
|
2580
|
+
icon?: ReactNode;
|
|
2581
|
+
|
|
2582
|
+
params?: Record<string, unknown>;
|
|
2583
|
+
|
|
2584
|
+
attention?: PrimaryActionAttention;
|
|
2585
|
+
|
|
2586
|
+
style?: CSSProperties;
|
|
2587
|
+
|
|
2588
|
+
className?: string;
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2591
|
+
declare function PrimaryActionButton<Params extends InteractionParamsShape = InteractionParamsShape>({ handle, variant, size, label, ready, whenSubmitted, icon, params, attention, style, className, }: PrimaryActionButtonProps<Params>): react_jsx_runtime.JSX.Element;
|
|
2592
|
+
|
|
2593
|
+
interface ActionPanelProps {
|
|
2594
|
+
title?: string;
|
|
2595
|
+
|
|
2596
|
+
state?: string;
|
|
2597
|
+
|
|
2598
|
+
stateLabels?: Record<string, string>;
|
|
2599
|
+
collapsible?: boolean;
|
|
2600
|
+
defaultExpanded?: boolean;
|
|
2601
|
+
children: ReactNode;
|
|
2602
|
+
className?: string;
|
|
2603
|
+
}
|
|
2604
|
+
declare function ActionPanel({ title, state, stateLabels, collapsible, defaultExpanded, children, className, }: ActionPanelProps): react_jsx_runtime.JSX.Element;
|
|
2605
|
+
interface ActionGroupProps {
|
|
2606
|
+
title: string;
|
|
2607
|
+
description?: string;
|
|
2608
|
+
visible?: boolean;
|
|
2609
|
+
|
|
2610
|
+
variant?: "default" | "warning" | "danger" | "success";
|
|
2611
|
+
children: ReactNode;
|
|
2612
|
+
className?: string;
|
|
2613
|
+
}
|
|
2614
|
+
declare function ActionGroup({ title, description, visible, variant, children, className, }: ActionGroupProps): react_jsx_runtime.JSX.Element | null;
|
|
2615
|
+
|
|
2616
|
+
interface MoreActionsProps {
|
|
2617
|
+
|
|
2618
|
+
children: ReactNode;
|
|
2619
|
+
|
|
2620
|
+
label?: string;
|
|
2621
|
+
|
|
2622
|
+
count?: number;
|
|
2623
|
+
|
|
2624
|
+
defaultOpen?: boolean;
|
|
2625
|
+
|
|
2626
|
+
style?: CSSProperties;
|
|
2627
|
+
}
|
|
2628
|
+
declare function MoreActions({ children, label, count, defaultOpen, style, }: MoreActionsProps): react_jsx_runtime.JSX.Element;
|
|
2629
|
+
|
|
2630
|
+
interface DiceRollerRenderProps {
|
|
2631
|
+
values: Array<number | undefined> | undefined;
|
|
2632
|
+
|
|
2633
|
+
sum: number | undefined;
|
|
2634
|
+
diceCount: number;
|
|
2635
|
+
allRolled: boolean;
|
|
2636
|
+
}
|
|
2637
|
+
interface DiceRollerRollAction<Params extends InteractionParamsShape = InteractionParamsShape> {
|
|
2638
|
+
|
|
2639
|
+
handle: InteractionHandle<Params> | null;
|
|
2640
|
+
title?: ReactNode;
|
|
2641
|
+
description?: ReactNode;
|
|
2642
|
+
rollLabel?: ReactNode;
|
|
2643
|
+
resultLabel?: ReactNode;
|
|
2644
|
+
minSpinMs?: number;
|
|
2645
|
+
revealHoldMs?: number;
|
|
2646
|
+
}
|
|
2647
|
+
interface DiceRollerProps<Params extends InteractionParamsShape = InteractionParamsShape> {
|
|
2648
|
+
values?: Array<number | undefined>;
|
|
2649
|
+
|
|
2650
|
+
diceCount?: number;
|
|
2651
|
+
render?: (props: DiceRollerRenderProps) => ReactNode;
|
|
2652
|
+
|
|
2653
|
+
rollAction?: DiceRollerRollAction<Params>;
|
|
2654
|
+
className?: string;
|
|
2655
|
+
}
|
|
2656
|
+
declare function DiceRoller<Params extends InteractionParamsShape = InteractionParamsShape>({ values, diceCount, render, rollAction, className, }: DiceRollerProps<Params>): react_jsx_runtime.JSX.Element;
|
|
2657
|
+
|
|
2658
|
+
interface PhaseIndicatorProps {
|
|
2659
|
+
currentPhase: string;
|
|
2660
|
+
phaseLabels?: Record<string, string>;
|
|
2661
|
+
isMyTurn?: boolean;
|
|
2662
|
+
activePlayerNames?: string[];
|
|
2663
|
+
variant?: "badge" | "bar" | "minimal";
|
|
2664
|
+
className?: string;
|
|
2665
|
+
}
|
|
2666
|
+
declare function PhaseIndicator({ currentPhase, phaseLabels, isMyTurn, activePlayerNames, variant, className, }: PhaseIndicatorProps): react_jsx_runtime.JSX.Element;
|
|
2667
|
+
|
|
2668
|
+
interface PlayerScore {
|
|
2669
|
+
playerId: string;
|
|
2670
|
+
name: string;
|
|
2671
|
+
score: number;
|
|
2672
|
+
isWinner?: boolean;
|
|
2673
|
+
details?: Record<string, number>;
|
|
2674
|
+
}
|
|
2675
|
+
interface GameEndDisplayProps {
|
|
2676
|
+
isGameOver: boolean;
|
|
2677
|
+
|
|
2678
|
+
scores: PlayerScore[];
|
|
2679
|
+
winnerMessage?: string;
|
|
2680
|
+
showDetails?: boolean;
|
|
2681
|
+
onReturnToLobby?: () => void;
|
|
2682
|
+
className?: string;
|
|
2683
|
+
}
|
|
2684
|
+
declare function GameEndDisplay({ isGameOver, scores, winnerMessage, showDetails, onReturnToLobby, className, }: GameEndDisplayProps): react_jsx_runtime.JSX.Element | null;
|
|
2685
|
+
|
|
2686
|
+
interface NetworkNode {
|
|
2687
|
+
id: string;
|
|
2688
|
+
label?: string;
|
|
2689
|
+
position: {
|
|
2690
|
+
x: number;
|
|
2691
|
+
y: number;
|
|
2692
|
+
};
|
|
2693
|
+
type?: string;
|
|
2694
|
+
data?: Record<string, unknown>;
|
|
2695
|
+
}
|
|
2696
|
+
interface NetworkEdge {
|
|
2697
|
+
id: string;
|
|
2698
|
+
from: string;
|
|
2699
|
+
to: string;
|
|
2700
|
+
label?: string | number;
|
|
2701
|
+
owner?: string;
|
|
2702
|
+
type?: string;
|
|
2703
|
+
data?: Record<string, unknown>;
|
|
2704
|
+
}
|
|
2705
|
+
interface NetworkPiece {
|
|
2706
|
+
id: string;
|
|
2707
|
+
nodeId: string;
|
|
2708
|
+
owner?: string;
|
|
2709
|
+
type?: string;
|
|
2710
|
+
data?: Record<string, unknown>;
|
|
2711
|
+
}
|
|
2712
|
+
interface NetworkGraphProps {
|
|
2713
|
+
nodes: NetworkNode[];
|
|
2714
|
+
edges: NetworkEdge[];
|
|
2715
|
+
pieces: NetworkPiece[];
|
|
2716
|
+
|
|
2717
|
+
renderNode: (node: NetworkNode, pieces: NetworkPiece[]) => ReactNode;
|
|
2718
|
+
renderEdge: (edge: NetworkEdge, fromNode: NetworkNode, toNode: NetworkNode) => ReactNode;
|
|
2719
|
+
renderPiece: (piece: NetworkPiece, position: {
|
|
2720
|
+
x: number;
|
|
2721
|
+
y: number;
|
|
2722
|
+
}) => ReactNode;
|
|
2723
|
+
width?: number | string;
|
|
2724
|
+
height?: number | string;
|
|
2725
|
+
nodeRadius?: number;
|
|
2726
|
+
enablePanZoom?: boolean;
|
|
2727
|
+
initialZoom?: number;
|
|
2728
|
+
minZoom?: number;
|
|
2729
|
+
maxZoom?: number;
|
|
2730
|
+
padding?: number;
|
|
2731
|
+
className?: string;
|
|
2732
|
+
}
|
|
2733
|
+
interface DefaultNetworkNodeProps {
|
|
2734
|
+
radius?: number;
|
|
2735
|
+
fill?: string;
|
|
2736
|
+
stroke?: string;
|
|
2737
|
+
strokeWidth?: number;
|
|
2738
|
+
isSelected?: boolean;
|
|
2739
|
+
isHighlighted?: boolean;
|
|
2740
|
+
label?: string;
|
|
2741
|
+
maxLabelLength?: number;
|
|
2742
|
+
onClick?: () => void;
|
|
2743
|
+
onPointerEnter?: () => void;
|
|
2744
|
+
onPointerLeave?: () => void;
|
|
2745
|
+
className?: string;
|
|
2746
|
+
}
|
|
2747
|
+
|
|
2748
|
+
declare function DefaultNetworkNode({ radius, fill, stroke, strokeWidth, isSelected, isHighlighted, label, maxLabelLength, onClick, onPointerEnter, onPointerLeave, className, }: DefaultNetworkNodeProps): react_jsx_runtime.JSX.Element;
|
|
2749
|
+
interface DefaultNetworkEdgeProps {
|
|
2750
|
+
from: {
|
|
2751
|
+
x: number;
|
|
2752
|
+
y: number;
|
|
2753
|
+
};
|
|
2754
|
+
to: {
|
|
2755
|
+
x: number;
|
|
2756
|
+
y: number;
|
|
2757
|
+
};
|
|
2758
|
+
color?: string;
|
|
2759
|
+
strokeWidth?: number;
|
|
2760
|
+
isSelected?: boolean;
|
|
2761
|
+
isHighlighted?: boolean;
|
|
2762
|
+
|
|
2763
|
+
label?: string | number;
|
|
2764
|
+
onClick?: () => void;
|
|
2765
|
+
onPointerEnter?: () => void;
|
|
2766
|
+
onPointerLeave?: () => void;
|
|
2767
|
+
className?: string;
|
|
2768
|
+
}
|
|
2769
|
+
|
|
2770
|
+
declare function DefaultNetworkEdge({ from, to, color, strokeWidth, isSelected, isHighlighted, label, onClick, onPointerEnter, onPointerLeave, className, }: DefaultNetworkEdgeProps): react_jsx_runtime.JSX.Element;
|
|
2771
|
+
interface DefaultNetworkPieceProps {
|
|
2772
|
+
color?: string;
|
|
2773
|
+
radius?: number;
|
|
2774
|
+
shape?: "circle" | "square";
|
|
2775
|
+
onClick?: () => void;
|
|
2776
|
+
className?: string;
|
|
2777
|
+
}
|
|
2778
|
+
declare function DefaultNetworkPiece({ color, radius, shape, onClick, className, }: DefaultNetworkPieceProps): react_jsx_runtime.JSX.Element;
|
|
2779
|
+
declare function NetworkGraph({ nodes, edges, pieces, renderNode, renderEdge, renderPiece, width, height, nodeRadius, enablePanZoom, initialZoom, minZoom, maxZoom, padding, className, }: NetworkGraphProps): react_jsx_runtime.JSX.Element;
|
|
2780
|
+
|
|
2781
|
+
interface ZoneShape {
|
|
2782
|
+
type: "polygon" | "path" | "circle";
|
|
2783
|
+
points?: Array<{
|
|
2784
|
+
x: number;
|
|
2785
|
+
y: number;
|
|
2786
|
+
}>;
|
|
2787
|
+
|
|
2788
|
+
path?: string;
|
|
2789
|
+
center?: {
|
|
2790
|
+
x: number;
|
|
2791
|
+
y: number;
|
|
2792
|
+
};
|
|
2793
|
+
radius?: number;
|
|
2794
|
+
}
|
|
2795
|
+
interface ZoneDefinition {
|
|
2796
|
+
id: string;
|
|
2797
|
+
name: string;
|
|
2798
|
+
adjacentTo: string[];
|
|
2799
|
+
shape?: ZoneShape;
|
|
2800
|
+
value?: number;
|
|
2801
|
+
type?: string;
|
|
2802
|
+
data?: Record<string, unknown>;
|
|
2803
|
+
}
|
|
2804
|
+
interface ZonePiece {
|
|
2805
|
+
id: string;
|
|
2806
|
+
zoneId: string;
|
|
2807
|
+
type: string;
|
|
2808
|
+
owner?: string;
|
|
2809
|
+
|
|
2810
|
+
count?: number;
|
|
2811
|
+
data?: Record<string, unknown>;
|
|
2812
|
+
}
|
|
2813
|
+
interface ZoneMapProps {
|
|
2814
|
+
zones: ZoneDefinition[];
|
|
2815
|
+
pieces: ZonePiece[];
|
|
2816
|
+
renderZone: (zone: ZoneDefinition, pieces: ZonePiece[]) => ReactNode;
|
|
2817
|
+
backgroundImage?: string;
|
|
2818
|
+
width?: number | string;
|
|
2819
|
+
height?: number | string;
|
|
2820
|
+
enablePanZoom?: boolean;
|
|
2821
|
+
initialZoom?: number;
|
|
2822
|
+
minZoom?: number;
|
|
2823
|
+
maxZoom?: number;
|
|
2824
|
+
className?: string;
|
|
2825
|
+
}
|
|
2826
|
+
type ZoneHighlightType = "valid" | "selected" | "attack" | "defend" | "neutral";
|
|
2827
|
+
interface DefaultZoneProps {
|
|
2828
|
+
zone: ZoneDefinition;
|
|
2829
|
+
fill?: string;
|
|
2830
|
+
stroke?: string;
|
|
2831
|
+
strokeWidth?: number;
|
|
2832
|
+
isHighlighted?: boolean;
|
|
2833
|
+
highlightType?: ZoneHighlightType;
|
|
2834
|
+
isSelected?: boolean;
|
|
2835
|
+
showLabel?: boolean;
|
|
2836
|
+
showValue?: boolean;
|
|
2837
|
+
onClick?: () => void;
|
|
2838
|
+
onHover?: (hovering: boolean) => void;
|
|
2839
|
+
className?: string;
|
|
2840
|
+
children?: ReactNode;
|
|
2841
|
+
}
|
|
2842
|
+
declare function DefaultZone({ zone, fill, stroke, strokeWidth, isHighlighted, highlightType, isSelected, showLabel, showValue, onClick, onHover, className, children, }: DefaultZoneProps): react_jsx_runtime.JSX.Element;
|
|
2843
|
+
interface DefaultZonePiecesProps {
|
|
2844
|
+
pieces: ZonePiece[];
|
|
2845
|
+
zone: ZoneDefinition;
|
|
2846
|
+
playerColors?: Record<string, string>;
|
|
2847
|
+
radius?: number;
|
|
2848
|
+
spacing?: number;
|
|
2849
|
+
yOffset?: number;
|
|
2850
|
+
className?: string;
|
|
2851
|
+
}
|
|
2852
|
+
declare function DefaultZonePieces({ pieces, zone, playerColors, radius, spacing, yOffset, className, }: DefaultZonePiecesProps): react_jsx_runtime.JSX.Element | null;
|
|
2853
|
+
interface DefaultZonePieceProps {
|
|
2854
|
+
piece: ZonePiece;
|
|
2855
|
+
x?: number;
|
|
2856
|
+
y?: number;
|
|
2857
|
+
radius?: number;
|
|
2858
|
+
color?: string;
|
|
2859
|
+
onClick?: () => void;
|
|
2860
|
+
className?: string;
|
|
2861
|
+
}
|
|
2862
|
+
declare function DefaultZonePiece({ piece, x, y, radius, color, onClick, className, }: DefaultZonePieceProps): react_jsx_runtime.JSX.Element;
|
|
2863
|
+
declare function ZoneMap({ zones, pieces, renderZone, backgroundImage, width, height, enablePanZoom, initialZoom, minZoom, maxZoom, className, }: ZoneMapProps): react_jsx_runtime.JSX.Element;
|
|
2864
|
+
|
|
2865
|
+
interface SlotDefinition {
|
|
2866
|
+
id: string;
|
|
2867
|
+
name: string;
|
|
2868
|
+
description?: string;
|
|
2869
|
+
capacity: number;
|
|
2870
|
+
|
|
2871
|
+
exclusive?: boolean;
|
|
2872
|
+
|
|
2873
|
+
owner?: string;
|
|
2874
|
+
group?: string;
|
|
2875
|
+
cost?: Record<string, number>;
|
|
2876
|
+
reward?: Record<string, number>;
|
|
2877
|
+
type?: string;
|
|
2878
|
+
position?: {
|
|
2879
|
+
x: number;
|
|
2880
|
+
y: number;
|
|
2881
|
+
};
|
|
2882
|
+
data?: Record<string, unknown>;
|
|
2883
|
+
}
|
|
2884
|
+
type SlotOccupant = ViewSlotOccupant;
|
|
2885
|
+
interface SlotSystemProps {
|
|
2886
|
+
slots: readonly SlotDefinition[];
|
|
2887
|
+
occupants: readonly SlotOccupant[];
|
|
2888
|
+
renderSlot: (slot: SlotDefinition, occupants: readonly SlotOccupant[]) => ReactNode;
|
|
2889
|
+
layout?: "grid" | "list" | "grouped";
|
|
2890
|
+
width?: number | string;
|
|
2891
|
+
height?: number | string;
|
|
2892
|
+
|
|
2893
|
+
minSlotWidth?: number;
|
|
2894
|
+
className?: string;
|
|
2895
|
+
}
|
|
2896
|
+
interface DefaultSlotItemProps {
|
|
2897
|
+
name: string;
|
|
2898
|
+
description?: string;
|
|
2899
|
+
capacity: number;
|
|
2900
|
+
occupantCount: number;
|
|
2901
|
+
isExclusive?: boolean;
|
|
2902
|
+
isAvailable?: boolean;
|
|
2903
|
+
isHighlighted?: boolean;
|
|
2904
|
+
isSelected?: boolean;
|
|
2905
|
+
costLabel?: string;
|
|
2906
|
+
rewardLabel?: string;
|
|
2907
|
+
renderOccupants?: () => ReactNode;
|
|
2908
|
+
onClick?: () => void;
|
|
2909
|
+
onPointerEnter?: () => void;
|
|
2910
|
+
onPointerLeave?: () => void;
|
|
2911
|
+
className?: string;
|
|
2912
|
+
}
|
|
2913
|
+
|
|
2914
|
+
declare function DefaultSlotItem({ name, description, capacity, occupantCount, isExclusive, isAvailable, isHighlighted, isSelected, costLabel, rewardLabel, renderOccupants, onClick, onPointerEnter, onPointerLeave, className, }: DefaultSlotItemProps): react_jsx_runtime.JSX.Element;
|
|
2915
|
+
interface DefaultSlotOccupantProps {
|
|
2916
|
+
color?: string;
|
|
2917
|
+
size?: number;
|
|
2918
|
+
shape?: "circle" | "square";
|
|
2919
|
+
label?: string;
|
|
2920
|
+
onClick?: () => void;
|
|
2921
|
+
className?: string;
|
|
2922
|
+
}
|
|
2923
|
+
declare function DefaultSlotOccupant({ color, size, shape, label, onClick, className, }: DefaultSlotOccupantProps): react_jsx_runtime.JSX.Element;
|
|
2924
|
+
interface DefaultEmptySlotProps {
|
|
2925
|
+
size?: number;
|
|
2926
|
+
className?: string;
|
|
2927
|
+
}
|
|
2928
|
+
declare function DefaultEmptySlot({ size, className, }: DefaultEmptySlotProps): react_jsx_runtime.JSX.Element;
|
|
2929
|
+
declare function SlotSystem({ slots, occupants, renderSlot, layout, width, height, minSlotWidth, className, }: SlotSystemProps): react_jsx_runtime.JSX.Element;
|
|
2930
|
+
|
|
2931
|
+
interface SquareEdgePosition {
|
|
2932
|
+
x1: number;
|
|
2933
|
+
y1: number;
|
|
2934
|
+
x2: number;
|
|
2935
|
+
y2: number;
|
|
2936
|
+
midX: number;
|
|
2937
|
+
midY: number;
|
|
2938
|
+
angle: number;
|
|
2939
|
+
}
|
|
2940
|
+
interface SquareVertexPosition {
|
|
2941
|
+
x: number;
|
|
2942
|
+
y: number;
|
|
2943
|
+
}
|
|
2944
|
+
interface InteractiveSquareEdge<TBoard extends AnySquareBoardInput = AnySquareBoardInput> extends NormalizedSquareEdgeOf<TBoard> {
|
|
2945
|
+
position: SquareEdgePosition;
|
|
2946
|
+
}
|
|
2947
|
+
interface InteractiveSquareVertex<TBoard extends AnySquareBoardInput = AnySquareBoardInput> extends NormalizedSquareVertexOf<TBoard> {
|
|
2948
|
+
position: SquareVertexPosition;
|
|
2949
|
+
}
|
|
2950
|
+
type InteractiveSquareSpace<TBoard extends AnySquareBoardInput = AnySquareBoardInput> = NormalizedSquareCellOf<TBoard>;
|
|
2951
|
+
interface SquareGeneratedGridInputProps {
|
|
2952
|
+
id?: string;
|
|
2953
|
+
layout?: "square";
|
|
2954
|
+
spaces: Extract<AnySquareBoardInput, {
|
|
2955
|
+
spaces: unknown;
|
|
2956
|
+
}>["spaces"];
|
|
2957
|
+
pieces?: AnySquareBoardInput["pieces"];
|
|
2958
|
+
edges?: AnySquareBoardInput["edges"];
|
|
2959
|
+
vertices?: AnySquareBoardInput["vertices"];
|
|
2960
|
+
}
|
|
2961
|
+
interface SquareAuthoredGridInputProps {
|
|
2962
|
+
id?: string;
|
|
2963
|
+
layout?: "square";
|
|
2964
|
+
rows?: number;
|
|
2965
|
+
cols?: number;
|
|
2966
|
+
cells: Extract<AnySquareBoardInput, {
|
|
2967
|
+
cells: unknown;
|
|
2968
|
+
}>["cells"];
|
|
2969
|
+
pieces?: readonly SquarePieceState[];
|
|
2970
|
+
edges?: AnySquareBoardInput["edges"];
|
|
2971
|
+
vertices?: AnySquareBoardInput["vertices"];
|
|
2972
|
+
}
|
|
2973
|
+
type SquareGridInputProps = SquareGeneratedGridInputProps | SquareAuthoredGridInputProps;
|
|
2974
|
+
type ResolvedSquareArrayProp<Value> = Exclude<Value, undefined> extends readonly unknown[] ? Exclude<Value, undefined> : readonly [];
|
|
2975
|
+
type SquareBoardLikeOfProps<TProps extends SquareGridInputProps> = TProps extends {
|
|
2976
|
+
id?: infer Id;
|
|
2977
|
+
layout?: infer Layout;
|
|
2978
|
+
spaces: infer Spaces;
|
|
2979
|
+
pieces?: infer Pieces;
|
|
2980
|
+
edges?: infer Edges;
|
|
2981
|
+
vertices?: infer Vertices;
|
|
2982
|
+
} ? {
|
|
2983
|
+
id: Extract<Id, string> extends never ? string : Extract<Id, string>;
|
|
2984
|
+
layout?: Extract<Layout, "square">;
|
|
2985
|
+
spaces: Spaces;
|
|
2986
|
+
pieces: ResolvedSquareArrayProp<Pieces>;
|
|
2987
|
+
edges: ResolvedSquareArrayProp<Edges>;
|
|
2988
|
+
vertices: ResolvedSquareArrayProp<Vertices>;
|
|
2989
|
+
} & GeneratedSquareBoardInput : TProps extends {
|
|
2990
|
+
id?: infer Id;
|
|
2991
|
+
layout?: infer Layout;
|
|
2992
|
+
rows?: infer Rows;
|
|
2993
|
+
cols?: infer Cols;
|
|
2994
|
+
cells: infer Cells;
|
|
2995
|
+
pieces?: infer Pieces;
|
|
2996
|
+
edges?: infer Edges;
|
|
2997
|
+
vertices?: infer Vertices;
|
|
2998
|
+
} ? {
|
|
2999
|
+
id: Extract<Id, string> extends never ? string : Extract<Id, string>;
|
|
3000
|
+
layout?: Extract<Layout, "square">;
|
|
3001
|
+
rows: Extract<Rows, number> extends never ? number : Extract<Rows, number>;
|
|
3002
|
+
cols: Extract<Cols, number> extends never ? number : Extract<Cols, number>;
|
|
3003
|
+
cells: Cells;
|
|
3004
|
+
pieces: ResolvedSquareArrayProp<Pieces>;
|
|
3005
|
+
edges: ResolvedSquareArrayProp<Edges>;
|
|
3006
|
+
vertices: ResolvedSquareArrayProp<Vertices>;
|
|
3007
|
+
} & AuthoredSquareBoardInput : never;
|
|
3008
|
+
type SquareGridProps<TProps extends SquareGridInputProps = SquareGridInputProps> = TProps & {
|
|
3009
|
+
cellSize?: number;
|
|
3010
|
+
|
|
3011
|
+
renderCell: (row: number, col: number) => ReactNode;
|
|
3012
|
+
|
|
3013
|
+
renderPiece: (piece: NormalizedSquarePieceOf<NoInfer<SquareBoardLikeOfProps<TProps>>>) => ReactNode;
|
|
3014
|
+
renderEdge?: (edge: NormalizedSquareEdgeOf<NoInfer<SquareBoardLikeOfProps<TProps>>>, position: SquareEdgePosition) => ReactNode;
|
|
3015
|
+
renderVertex?: (vertex: NormalizedSquareVertexOf<NoInfer<SquareBoardLikeOfProps<TProps>>>, position: SquareVertexPosition) => ReactNode;
|
|
3016
|
+
showCoordinates?: boolean;
|
|
3017
|
+
coordinateStyle?: "algebraic" | "numeric" | "none";
|
|
3018
|
+
width?: number | string;
|
|
3019
|
+
height?: number | string;
|
|
3020
|
+
enablePanZoom?: boolean;
|
|
3021
|
+
initialZoom?: number;
|
|
3022
|
+
minZoom?: number;
|
|
3023
|
+
maxZoom?: number;
|
|
3024
|
+
className?: string;
|
|
3025
|
+
interactiveSpaces?: InteractiveTargetLayer;
|
|
3026
|
+
interactiveEdges?: InteractiveTargetLayer;
|
|
3027
|
+
interactiveVertices?: InteractiveTargetLayer;
|
|
3028
|
+
renderInteractiveSpace?: (space: InteractiveSquareSpace<NoInfer<SquareBoardLikeOfProps<TProps>>>, state: InteractiveTargetRenderState) => ReactNode;
|
|
3029
|
+
renderInteractiveEdge?: (edge: InteractiveSquareEdge<NoInfer<SquareBoardLikeOfProps<TProps>>>, position: SquareEdgePosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
3030
|
+
renderInteractiveVertex?: (vertex: InteractiveSquareVertex<NoInfer<SquareBoardLikeOfProps<TProps>>>, position: SquareVertexPosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
3031
|
+
};
|
|
3032
|
+
interface SquareGridBoardProps<TBoard extends AnySquareBoardInput = AnySquareBoardInput> {
|
|
3033
|
+
board: TBoard;
|
|
3034
|
+
cellSize?: number;
|
|
3035
|
+
renderCell: (row: number, col: number) => ReactNode;
|
|
3036
|
+
renderPiece: (piece: NormalizedSquarePieceOf<NoInfer<TBoard>>) => ReactNode;
|
|
3037
|
+
renderEdge?: (edge: NormalizedSquareEdgeOf<NoInfer<TBoard>>, position: SquareEdgePosition) => ReactNode;
|
|
3038
|
+
renderVertex?: (vertex: NormalizedSquareVertexOf<NoInfer<TBoard>>, position: SquareVertexPosition) => ReactNode;
|
|
3039
|
+
showCoordinates?: boolean;
|
|
3040
|
+
coordinateStyle?: "algebraic" | "numeric" | "none";
|
|
3041
|
+
width?: number | string;
|
|
3042
|
+
height?: number | string;
|
|
3043
|
+
enablePanZoom?: boolean;
|
|
3044
|
+
initialZoom?: number;
|
|
3045
|
+
minZoom?: number;
|
|
3046
|
+
maxZoom?: number;
|
|
3047
|
+
className?: string;
|
|
3048
|
+
interactiveSpaces?: InteractiveTargetLayer;
|
|
3049
|
+
interactiveEdges?: InteractiveTargetLayer;
|
|
3050
|
+
interactiveVertices?: InteractiveTargetLayer;
|
|
3051
|
+
renderInteractiveSpace?: (space: InteractiveSquareSpace<NoInfer<TBoard>>, state: InteractiveTargetRenderState) => ReactNode;
|
|
3052
|
+
renderInteractiveEdge?: (edge: InteractiveSquareEdge<NoInfer<TBoard>>, position: SquareEdgePosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
3053
|
+
renderInteractiveVertex?: (vertex: InteractiveSquareVertex<NoInfer<TBoard>>, position: SquareVertexPosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
3054
|
+
}
|
|
3055
|
+
interface DefaultGridCellProps {
|
|
3056
|
+
size: number;
|
|
3057
|
+
isLight?: boolean;
|
|
3058
|
+
lightColor?: string;
|
|
3059
|
+
darkColor?: string;
|
|
3060
|
+
isHighlighted?: boolean;
|
|
3061
|
+
highlightColor?: string;
|
|
3062
|
+
isSelected?: boolean;
|
|
3063
|
+
selectedColor?: string;
|
|
3064
|
+
isValidMove?: boolean;
|
|
3065
|
+
isCapture?: boolean;
|
|
3066
|
+
onClick?: () => void;
|
|
3067
|
+
onPointerEnter?: () => void;
|
|
3068
|
+
onPointerLeave?: () => void;
|
|
3069
|
+
className?: string;
|
|
3070
|
+
}
|
|
3071
|
+
|
|
3072
|
+
declare function DefaultGridCell({ size, isLight, lightColor, darkColor, isHighlighted, highlightColor, isSelected, selectedColor, isValidMove, isCapture, onClick, onPointerEnter, onPointerLeave, className, }: DefaultGridCellProps): react_jsx_runtime.JSX.Element;
|
|
3073
|
+
interface DefaultGridPieceProps {
|
|
3074
|
+
size: number;
|
|
3075
|
+
color?: string;
|
|
3076
|
+
strokeColor?: string;
|
|
3077
|
+
label?: string;
|
|
3078
|
+
isDragging?: boolean;
|
|
3079
|
+
onClick?: () => void;
|
|
3080
|
+
onPointerDown?: (e: React.PointerEvent) => void;
|
|
3081
|
+
className?: string;
|
|
3082
|
+
}
|
|
3083
|
+
|
|
3084
|
+
declare function DefaultGridPiece({ size, color, strokeColor, label, isDragging, onClick, onPointerDown, className, }: DefaultGridPieceProps): react_jsx_runtime.JSX.Element;
|
|
3085
|
+
interface DefaultChessPieceProps {
|
|
3086
|
+
size: number;
|
|
3087
|
+
type: string;
|
|
3088
|
+
owner: "white" | "black";
|
|
3089
|
+
onClick?: () => void;
|
|
3090
|
+
onPointerDown?: (e: React.PointerEvent) => void;
|
|
3091
|
+
className?: string;
|
|
3092
|
+
}
|
|
3093
|
+
|
|
3094
|
+
declare function DefaultChessPiece({ size, type, owner, onClick, onPointerDown, className, }: DefaultChessPieceProps): react_jsx_runtime.JSX.Element;
|
|
3095
|
+
|
|
3096
|
+
declare function toAlgebraic(row: number, col: number, totalRows: number): string;
|
|
3097
|
+
|
|
3098
|
+
declare function toNumeric(row: number, col: number): string;
|
|
3099
|
+
interface SquareGridComponent {
|
|
3100
|
+
<const TBoard extends AnySquareBoardInput>(props: SquareGridBoardProps<TBoard>): ReactNode;
|
|
3101
|
+
<const TProps extends SquareGeneratedGridInputProps>(props: SquareGridProps<TProps>): ReactNode;
|
|
3102
|
+
<const TProps extends SquareAuthoredGridInputProps>(props: SquareGridProps<TProps>): ReactNode;
|
|
3103
|
+
}
|
|
3104
|
+
declare const SquareGrid: SquareGridComponent;
|
|
3105
|
+
|
|
3106
|
+
type HexOrientation = "pointy-top" | "flat-top";
|
|
3107
|
+
|
|
3108
|
+
interface HexTileGeometry {
|
|
3109
|
+
size: number;
|
|
3110
|
+
orientation: HexOrientation;
|
|
3111
|
+
center: {
|
|
3112
|
+
x: 0;
|
|
3113
|
+
y: 0;
|
|
3114
|
+
};
|
|
3115
|
+
position: {
|
|
3116
|
+
x: number;
|
|
3117
|
+
y: number;
|
|
3118
|
+
};
|
|
3119
|
+
corners: (options?: {
|
|
3120
|
+
inset?: number;
|
|
3121
|
+
}) => Array<{
|
|
3122
|
+
x: number;
|
|
3123
|
+
y: number;
|
|
3124
|
+
}>;
|
|
3125
|
+
points: (options?: {
|
|
3126
|
+
inset?: number;
|
|
3127
|
+
}) => string;
|
|
3128
|
+
bounds: {
|
|
3129
|
+
minX: number;
|
|
3130
|
+
minY: number;
|
|
3131
|
+
maxX: number;
|
|
3132
|
+
maxY: number;
|
|
3133
|
+
width: number;
|
|
3134
|
+
height: number;
|
|
3135
|
+
};
|
|
3136
|
+
}
|
|
3137
|
+
interface EdgePosition {
|
|
3138
|
+
|
|
3139
|
+
x1: number;
|
|
3140
|
+
y1: number;
|
|
3141
|
+
|
|
3142
|
+
x2: number;
|
|
3143
|
+
y2: number;
|
|
3144
|
+
|
|
3145
|
+
midX: number;
|
|
3146
|
+
midY: number;
|
|
3147
|
+
|
|
3148
|
+
centerAngle: number;
|
|
3149
|
+
|
|
3150
|
+
edgeAngle: number;
|
|
3151
|
+
}
|
|
3152
|
+
interface InteractiveHexVertex<TBoard extends AnyHexBoardInput = AnyHexBoardInput> extends NormalizedHexVertexOf<TBoard> {
|
|
3153
|
+
position: {
|
|
3154
|
+
x: number;
|
|
3155
|
+
y: number;
|
|
3156
|
+
};
|
|
3157
|
+
spaceIds: ReadonlyArray<BoardSpaceIdOf<TBoard>>;
|
|
3158
|
+
}
|
|
3159
|
+
interface InteractiveHexEdge<TBoard extends AnyHexBoardInput = AnyHexBoardInput> extends NormalizedHexEdgeOf<TBoard> {
|
|
3160
|
+
position: EdgePosition;
|
|
3161
|
+
spaceIds: ReadonlyArray<BoardSpaceIdOf<TBoard>>;
|
|
3162
|
+
}
|
|
3163
|
+
type InteractiveHexSpace<TBoard extends AnyHexBoardInput = AnyHexBoardInput> = NormalizedHexTileOf<TBoard>;
|
|
3164
|
+
interface HexGeneratedGridInputProps {
|
|
3165
|
+
id?: string;
|
|
3166
|
+
layout?: "hex";
|
|
3167
|
+
orientation?: HexOrientation;
|
|
3168
|
+
spaces: Extract<AnyHexBoardInput, {
|
|
3169
|
+
spaces: unknown;
|
|
3170
|
+
}>["spaces"];
|
|
3171
|
+
edges?: AnyHexBoardInput["edges"];
|
|
3172
|
+
vertices?: AnyHexBoardInput["vertices"];
|
|
3173
|
+
}
|
|
3174
|
+
interface HexAuthoredGridInputProps {
|
|
3175
|
+
id?: string;
|
|
3176
|
+
layout?: "hex";
|
|
3177
|
+
orientation?: HexOrientation;
|
|
3178
|
+
tiles: Extract<AnyHexBoardInput, {
|
|
3179
|
+
tiles: unknown;
|
|
3180
|
+
}>["tiles"];
|
|
3181
|
+
edges?: AnyHexBoardInput["edges"];
|
|
3182
|
+
vertices?: AnyHexBoardInput["vertices"];
|
|
3183
|
+
}
|
|
3184
|
+
type HexGridInputProps = HexGeneratedGridInputProps | HexAuthoredGridInputProps;
|
|
3185
|
+
type ResolvedArrayProp<Value> = Exclude<Value, undefined> extends readonly unknown[] ? Exclude<Value, undefined> : readonly [];
|
|
3186
|
+
type HexBoardLikeOfProps<TProps extends HexGridInputProps> = TProps extends {
|
|
3187
|
+
id?: infer Id;
|
|
3188
|
+
layout?: infer Layout;
|
|
3189
|
+
orientation?: infer Orientation;
|
|
3190
|
+
spaces: infer Spaces;
|
|
3191
|
+
edges?: infer Edges;
|
|
3192
|
+
vertices?: infer Vertices;
|
|
3193
|
+
} ? {
|
|
3194
|
+
id: Extract<Id, string> extends never ? string : Extract<Id, string>;
|
|
3195
|
+
layout?: Extract<Layout, "hex">;
|
|
3196
|
+
orientation?: Extract<Orientation, HexOrientation>;
|
|
3197
|
+
spaces: Spaces;
|
|
3198
|
+
edges: ResolvedArrayProp<Edges>;
|
|
3199
|
+
vertices: ResolvedArrayProp<Vertices>;
|
|
3200
|
+
} & GeneratedHexBoardInput : TProps extends {
|
|
3201
|
+
id?: infer Id;
|
|
3202
|
+
layout?: infer Layout;
|
|
3203
|
+
orientation?: infer Orientation;
|
|
3204
|
+
tiles: infer Tiles;
|
|
3205
|
+
edges?: infer Edges;
|
|
3206
|
+
vertices?: infer Vertices;
|
|
3207
|
+
} ? {
|
|
3208
|
+
id: Extract<Id, string> extends never ? string : Extract<Id, string>;
|
|
3209
|
+
layout?: Extract<Layout, "hex">;
|
|
3210
|
+
orientation?: Extract<Orientation, HexOrientation>;
|
|
3211
|
+
tiles: Tiles;
|
|
3212
|
+
edges: ResolvedArrayProp<Edges>;
|
|
3213
|
+
vertices: ResolvedArrayProp<Vertices>;
|
|
3214
|
+
} & AuthoredHexBoardInput : never;
|
|
3215
|
+
type HexGridProps<TProps extends HexGridInputProps = HexGridInputProps> = TProps & {
|
|
3216
|
+
orientation?: HexOrientation;
|
|
3217
|
+
|
|
3218
|
+
hexSize?: number;
|
|
3219
|
+
|
|
3220
|
+
renderTile: (tile: NormalizedHexTileOf<NoInfer<HexBoardLikeOfProps<TProps>>>, geometry: HexTileGeometry) => ReactNode;
|
|
3221
|
+
|
|
3222
|
+
renderEdge: (edge: NormalizedHexEdgeOf<NoInfer<HexBoardLikeOfProps<TProps>>>, position: EdgePosition) => ReactNode;
|
|
3223
|
+
renderVertex: (vertex: NormalizedHexVertexOf<NoInfer<HexBoardLikeOfProps<TProps>>>, position: {
|
|
3224
|
+
x: number;
|
|
3225
|
+
y: number;
|
|
3226
|
+
}) => ReactNode;
|
|
3227
|
+
width?: number | string;
|
|
3228
|
+
height?: number | string;
|
|
3229
|
+
enablePanZoom?: boolean;
|
|
3230
|
+
initialZoom?: number;
|
|
3231
|
+
minZoom?: number;
|
|
3232
|
+
maxZoom?: number;
|
|
3233
|
+
className?: string;
|
|
3234
|
+
|
|
3235
|
+
interactiveSpaces?: InteractiveTargetLayer;
|
|
3236
|
+
|
|
3237
|
+
interactiveVertices?: InteractiveTargetLayer;
|
|
3238
|
+
|
|
3239
|
+
interactiveEdges?: InteractiveTargetLayer;
|
|
3240
|
+
|
|
3241
|
+
renderInteractiveSpace?: (space: InteractiveHexSpace<NoInfer<HexBoardLikeOfProps<TProps>>>, state: InteractiveTargetRenderState) => ReactNode;
|
|
3242
|
+
|
|
3243
|
+
renderInteractiveVertex?: (vertex: InteractiveHexVertex<NoInfer<HexBoardLikeOfProps<TProps>>>, position: {
|
|
3244
|
+
x: number;
|
|
3245
|
+
y: number;
|
|
3246
|
+
}, state: InteractiveTargetRenderState) => ReactNode;
|
|
3247
|
+
|
|
3248
|
+
renderInteractiveEdge?: (edge: InteractiveHexEdge<NoInfer<HexBoardLikeOfProps<TProps>>>, position: EdgePosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
3249
|
+
interactiveVertexSize?: number;
|
|
3250
|
+
interactiveEdgeSize?: number;
|
|
3251
|
+
};
|
|
3252
|
+
interface HexGridBoardProps<TBoard extends AnyHexBoardInput = AnyHexBoardInput> {
|
|
3253
|
+
board: TBoard;
|
|
3254
|
+
orientation?: HexOrientation;
|
|
3255
|
+
hexSize?: number;
|
|
3256
|
+
|
|
3257
|
+
renderTile: (tile: NormalizedHexTileOf<NoInfer<TBoard>>, geometry: HexTileGeometry) => ReactNode;
|
|
3258
|
+
|
|
3259
|
+
renderEdge: (edge: NormalizedHexEdgeOf<NoInfer<TBoard>>, position: EdgePosition) => ReactNode;
|
|
3260
|
+
renderVertex: (vertex: NormalizedHexVertexOf<NoInfer<TBoard>>, position: {
|
|
3261
|
+
x: number;
|
|
3262
|
+
y: number;
|
|
3263
|
+
}) => ReactNode;
|
|
3264
|
+
width?: number | string;
|
|
3265
|
+
height?: number | string;
|
|
3266
|
+
enablePanZoom?: boolean;
|
|
3267
|
+
initialZoom?: number;
|
|
3268
|
+
minZoom?: number;
|
|
3269
|
+
maxZoom?: number;
|
|
3270
|
+
className?: string;
|
|
3271
|
+
interactiveSpaces?: InteractiveTargetLayer;
|
|
3272
|
+
interactiveVertices?: InteractiveTargetLayer;
|
|
3273
|
+
interactiveEdges?: InteractiveTargetLayer;
|
|
3274
|
+
|
|
3275
|
+
renderInteractiveSpace?: (space: InteractiveHexSpace<NoInfer<TBoard>>, state: InteractiveTargetRenderState) => ReactNode;
|
|
3276
|
+
|
|
3277
|
+
renderInteractiveVertex?: (vertex: InteractiveHexVertex<NoInfer<TBoard>>, position: {
|
|
3278
|
+
x: number;
|
|
3279
|
+
y: number;
|
|
3280
|
+
}, state: InteractiveTargetRenderState) => ReactNode;
|
|
3281
|
+
|
|
3282
|
+
renderInteractiveEdge?: (edge: InteractiveHexEdge<NoInfer<TBoard>>, position: EdgePosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
3283
|
+
interactiveVertexSize?: number;
|
|
3284
|
+
interactiveEdgeSize?: number;
|
|
3285
|
+
}
|
|
3286
|
+
interface DefaultHexTileProps {
|
|
3287
|
+
|
|
3288
|
+
size: number;
|
|
3289
|
+
fill: string;
|
|
3290
|
+
stroke?: string;
|
|
3291
|
+
strokeWidth?: number;
|
|
3292
|
+
isSelected?: boolean;
|
|
3293
|
+
isHighlighted?: boolean;
|
|
3294
|
+
label?: string;
|
|
3295
|
+
showCoordinates?: boolean;
|
|
3296
|
+
coordinates?: {
|
|
3297
|
+
q: number;
|
|
3298
|
+
r: number;
|
|
3299
|
+
};
|
|
3300
|
+
orientation?: HexOrientation;
|
|
3301
|
+
onClick?: () => void;
|
|
3302
|
+
onPointerEnter?: () => void;
|
|
3303
|
+
onPointerLeave?: () => void;
|
|
3304
|
+
className?: string;
|
|
3305
|
+
}
|
|
3306
|
+
|
|
3307
|
+
declare function DefaultHexTile({ size, fill, stroke, strokeWidth, isSelected, isHighlighted, label, showCoordinates, coordinates, orientation, onClick, onPointerEnter, onPointerLeave, className, }: DefaultHexTileProps): react_jsx_runtime.JSX.Element;
|
|
3308
|
+
interface DefaultHexEdgeProps {
|
|
3309
|
+
position: EdgePosition;
|
|
3310
|
+
color: string;
|
|
3311
|
+
hasOwner?: boolean;
|
|
3312
|
+
strokeWidth?: number;
|
|
3313
|
+
touchTargetSize?: number;
|
|
3314
|
+
onClick?: () => void;
|
|
3315
|
+
className?: string;
|
|
3316
|
+
}
|
|
3317
|
+
|
|
3318
|
+
declare function DefaultHexEdge({ position, color, hasOwner, strokeWidth, touchTargetSize, onClick, className, }: DefaultHexEdgeProps): react_jsx_runtime.JSX.Element;
|
|
3319
|
+
interface DefaultHexVertexProps {
|
|
3320
|
+
position: {
|
|
3321
|
+
x: number;
|
|
3322
|
+
y: number;
|
|
3323
|
+
};
|
|
3324
|
+
color: string;
|
|
3325
|
+
stroke?: string;
|
|
3326
|
+
strokeWidth?: number;
|
|
3327
|
+
hasOwner?: boolean;
|
|
3328
|
+
isSelected?: boolean;
|
|
3329
|
+
isHighlighted?: boolean;
|
|
3330
|
+
size?: number;
|
|
3331
|
+
touchTargetSize?: number;
|
|
3332
|
+
shape?: "circle" | "square";
|
|
3333
|
+
onClick?: () => void;
|
|
3334
|
+
onPointerEnter?: () => void;
|
|
3335
|
+
onPointerLeave?: () => void;
|
|
3336
|
+
className?: string;
|
|
3337
|
+
}
|
|
3338
|
+
|
|
3339
|
+
declare function DefaultHexVertex({ position, color, stroke, strokeWidth, hasOwner, isSelected, isHighlighted, size, touchTargetSize, shape, onClick, onPointerEnter, onPointerLeave, className, }: DefaultHexVertexProps): react_jsx_runtime.JSX.Element;
|
|
3340
|
+
declare const hexUtils: {
|
|
3341
|
+
|
|
3342
|
+
axialToPixel(q: number, r: number, size: number, orientation: HexOrientation): {
|
|
3343
|
+
x: number;
|
|
3344
|
+
y: number;
|
|
3345
|
+
};
|
|
3346
|
+
getNeighbors(q: number, r: number): Array<{
|
|
3347
|
+
q: number;
|
|
3348
|
+
r: number;
|
|
3349
|
+
}>;
|
|
3350
|
+
getDistance(q1: number, r1: number, q2: number, r2: number): number;
|
|
3351
|
+
getHexCorners(centerX: number, centerY: number, size: number, orientation: HexOrientation): Array<{
|
|
3352
|
+
x: number;
|
|
3353
|
+
y: number;
|
|
3354
|
+
}>;
|
|
3355
|
+
getHexPoints(centerX: number, centerY: number, size: number, orientation: HexOrientation): string;
|
|
3356
|
+
getEdgePosition(hex1Pos: {
|
|
3357
|
+
x: number;
|
|
3358
|
+
y: number;
|
|
3359
|
+
}, hex2Pos: {
|
|
3360
|
+
x: number;
|
|
3361
|
+
y: number;
|
|
3362
|
+
}, size: number): EdgePosition;
|
|
3363
|
+
getVertexPosition(hex1Pos: {
|
|
3364
|
+
x: number;
|
|
3365
|
+
y: number;
|
|
3366
|
+
}, hex2Pos: {
|
|
3367
|
+
x: number;
|
|
3368
|
+
y: number;
|
|
3369
|
+
}, hex3Pos: {
|
|
3370
|
+
x: number;
|
|
3371
|
+
y: number;
|
|
3372
|
+
}): {
|
|
3373
|
+
x: number;
|
|
3374
|
+
y: number;
|
|
3375
|
+
};
|
|
3376
|
+
};
|
|
3377
|
+
interface HexGridComponent {
|
|
3378
|
+
<const TBoard extends AnyHexBoardInput>(props: HexGridBoardProps<TBoard>): ReactNode;
|
|
3379
|
+
<const TProps extends HexGeneratedGridInputProps>(props: HexGridProps<TProps>): ReactNode;
|
|
3380
|
+
<const TProps extends HexAuthoredGridInputProps>(props: HexGridProps<TProps>): ReactNode;
|
|
3381
|
+
}
|
|
3382
|
+
declare const HexGrid: HexGridComponent;
|
|
3383
|
+
|
|
3384
|
+
type HexBoardViewTile<TBoard extends AnyHexBoardInput, TSpaceView extends {
|
|
3385
|
+
id: BoardSpaceIdOf<TBoard>;
|
|
3386
|
+
}> = Omit<NormalizedHexTileOf<TBoard>, "view"> & {
|
|
3387
|
+
view: TSpaceView;
|
|
3388
|
+
};
|
|
3389
|
+
|
|
3390
|
+
interface HexBoardView<TBoard extends AnyHexBoardInput, TSpaceView extends {
|
|
3391
|
+
id: BoardSpaceIdOf<TBoard>;
|
|
3392
|
+
}> {
|
|
3393
|
+
id: BoardIdOf<TBoard>;
|
|
3394
|
+
layout?: "hex";
|
|
3395
|
+
orientation?: "pointy-top" | "flat-top";
|
|
3396
|
+
tiles: ReadonlyArray<HexBoardViewTile<TBoard, TSpaceView>>;
|
|
3397
|
+
edges: TBoard["edges"];
|
|
3398
|
+
vertices: TBoard["vertices"];
|
|
3399
|
+
}
|
|
3400
|
+
interface CreateHexBoardViewOptions<TSpaceView> {
|
|
3401
|
+
spaces: readonly TSpaceView[];
|
|
3402
|
+
}
|
|
3403
|
+
|
|
3404
|
+
declare function createHexBoardView<const TBoard extends AnyHexBoardInput, const TSpaceView extends {
|
|
3405
|
+
id: BoardSpaceIdOf<TBoard>;
|
|
3406
|
+
}>(board: TBoard, options: CreateHexBoardViewOptions<TSpaceView>): HexBoardView<TBoard, TSpaceView>;
|
|
3407
|
+
|
|
3408
|
+
export { ActionButton, ActionGroup, ActionPanel, Board, BoardInteractionConflictError, BoardRoot, BoardTarget, Card, CostDisplay, DefaultChessPiece, DefaultEmptySlot, DefaultGridCell, DefaultGridPiece, DefaultHexEdge, DefaultHexTile, DefaultHexVertex, DefaultNetworkEdge, DefaultNetworkNode, DefaultNetworkPiece, DefaultSlotItem, DefaultSlotOccupant, DefaultTrackConnection, DefaultTrackJump, DefaultTrackPiece, DefaultTrackSpace, DefaultZone, DefaultZonePiece, DefaultZonePieces, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiceRoller, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, ErrorBoundary, GameEndDisplay, GameSkeleton, Hand, HandDock, HexGrid, Interaction, InteractionCardInput, InteractionDescription, InteractionField, InteractionForm, InteractionInput, InteractionLabel, InteractionRoot, InteractionSubmit, InteractionTrigger, InteractionUnavailableMessage, InteractionValidationMessage, MoreActions, NetworkGraph, Phase, PhaseIndicator, PhaseSwitch, PlayArea, PlayerRoster, PlayerRosterBadges, PlayerRosterEmpty, PlayerRosterList, PlayerRosterName, PlayerRosterRoot, PlayerRosterScore, PlayerRosterSwitchButton, PluginRuntime, PluginStateProvider, PrimaryActionButton, PrimaryButton, Prompt, PromptDialogHost, PromptInbox, PromptInboxEmpty, PromptInboxItems, PromptInboxRoot, PromptMessage, PromptOption, PromptOptions, PromptRoot, PromptTitle, ResourceCounter, RuntimeContext, RuntimeProvider, SlotSystem, SquareGrid, ThemeProvider, ThemedButton, ToastProvider, TrackBoard, Zone, ZoneItem, ZoneList, ZoneMap, ZoneRoot, arcadeTheme, buttonStyle, calculateViewBox, chipStyle, composeEventHandlers, createDreamboardUI, createHexBoardView, cssVar, cssVarOr, defaultFormInputs, deriveBoardTheme, getThemePreset, hasDefaultInteractionFormFields, hexUtils, intentForVariant, mergeTheme, motionDuration, normalizeHexBoardInput, normalizeSquareBoardInput, playerColor, renderPrimitive, resolveTheme, studioTheme, surfaceStyle, tabletopTheme, themeToCssVars, toAlgebraic, toNumeric, toTrackBoardData, useActivePlayers, useBoardInteractions, useBoardPrimitiveContext, useBoardTheme, useBoardTopology, useCards, useGameSelector, useGameView, useHandLayout, useHexBoard, useInteractionByKey, useInteractionHandle, useInteractionPrimitiveContext, useIsMobile, useIsMyTurn, useLobby, useMe, usePanZoom, usePlayerInfo, usePlayerTurnOrder, usePluginActions, usePluginRuntime, usePluginSession, usePluginState, useRuntimeContext, useSeatInbox, useSimultaneousPhase, useSquareBoard, useTheme, useThemeCssVars, useToast, useZoneCardContext, useZonePrimitiveContext };
|
|
3409
|
+
export type { ActionButtonProps, ActionGroupProps, ActionPanelProps, AnyHexBoardInput, AnySquareBoardInput, AuthoredHexBoardInput, AuthoredSquareBoardInput, BoardEdgeIdOf, BoardInteractionsContext, BoardInteractionsOptions, BoardKindStates, BoardRootProps, BoardSpaceIdOf, BoardStates, BoardTargetExtraInputs, BoardTargetKey, BoardTargetLayerFactory, BoardTargetLayerOptions, BoardTargetProps, BoardTheme, BoardVertexIdOf, ButtonSize$1 as ButtonSize, ButtonVariant$1 as ButtonVariant, CardCollection, CardKey, CardPositionProps, CardProps, CardSize, ClientParamSchema, ClientParamSchemaMap, ColorRamp, ComponentTokens, CostDisplayProps, DefaultChessPieceProps, DefaultEmptySlotProps, DefaultGridCellProps, DefaultGridPieceProps, DefaultHexEdgeProps, DefaultHexTileProps, DefaultHexVertexProps, DefaultNetworkEdgeProps, DefaultNetworkNodeProps, DefaultNetworkPieceProps, DefaultSlotItemProps, DefaultSlotOccupantProps, DefaultTrackConnectionProps, DefaultTrackJumpProps, DefaultTrackPieceProps, DefaultTrackSpaceProps, DefaultZonePieceProps, DefaultZonePiecesProps, DefaultZoneProps, DiceRollerProps, DiceStates, DieState, DraftValidation, DreamboardUI, DreamboardUIRegister, EdgePosition, Elevation, ErrorBoundaryProps, FoundationColor, GameEndDisplayProps, GameSkeletonProps, GameState, GameplayPromptOption, GameplaySnapshot, GeneratedHexBoardInput, GeneratedHexSpaceStateLike, GeneratedSquareBoardInput, GeneratedSquareSpaceStateLike, GeneratedTiledEdgeStateLike, GeneratedTiledVertexStateLike, HandDockMode, HandDockPlacement, HandDockPresentation, HandDockProps, HandDockToggleContext, HandLayout, HandProps, HexBoardInput, HexBoardState, HexBoardView, HexBoardViewTile, HexEdgeState, HexGridBoardProps, HexGridProps, HexOrientation, HexTileGeometry, HexTileState, HexVertexState, IntentColor, InteractionCardInputProps, InteractionContext, InteractionContextOption, InteractionDescriptor, InteractionFieldProps, InteractionFieldRenderMap, InteractionFieldRenderProps, InteractionFormProps, InteractionHandle, InteractionHandleStatus, InteractionInputKey, InteractionInputProps, InteractionKey, InteractionParamsShape, InteractionPartProps, InteractionRootProps, InteractionSubmitProps, InteractionTriggerProps, InteractiveHexEdge, InteractiveHexVertex, InteractiveSquareEdge, InteractiveSquareVertex, InteractiveTargetLayer, InteractiveTargetRenderState, LobbyState, MoreActionsProps, Motion, NetworkBoardState, NetworkEdge, NetworkEdgeState, NetworkGraphProps, NetworkNode, NetworkNodeState, NetworkPiece, NetworkPieceState, NormalizedHexBoard, NormalizedHexEdgeOf, NormalizedHexTileOf, NormalizedHexVertexOf, NormalizedSquareBoard, NormalizedSquareCellOf, NormalizedSquareEdgeOf, NormalizedSquarePieceOf, NormalizedSquareVertexOf, PanZoomTransform, PhaseFallback, PhaseIndicatorProps, PhaseKey, PhaseRouteMap, PhaseSwitchProps, PlayAreaProps, Player, PlayerColor, PlayerRosterBadge, PlayerRosterComponents, PlayerRosterEntry, PlayerRosterListProps, PlayerRosterPartProps, PlayerRosterRootProps, PlayerRosterSwitchButtonProps, PlayerScore, PluginRuntimeProps, PluginSessionState, PluginStateSnapshot, PrimaryActionAttention, PrimaryActionButtonProps, PrimaryButtonProps, PrimitiveCommonProps, PrimitiveDataAttributes, PromptDialogHostProps, PromptKey, PromptOptionKey, PromptOptionProps, PromptRootProps, Radius, RegisteredUI, ResourceCounterProps, ResourceDefinition, ResourceDisplayConfig, RuntimeAPI, SeatInbox, SemanticColor, SlotDefinition, SlotOccupant, SlotSystemProps, Space, SquareBoardInput, SquareBoardState, SquareCellState, SquareEdgePosition, SquareEdgeState, SquareGridBoardProps, SquareGridProps, SquarePieceState, SquareVertexPosition, SquareVertexState, SubmissionError, Theme, ThemeContextValue, ThemeMeta, ThemeOverride, ThemePresetId, ThemeProviderProps, ThemedButtonProps, Toast, ToastType, TrackBoardProps, TrackBoardState, TrackPiece, TrackPieceState, TrackSpace, TrackSpaceState, TypedBoard, TypedInteraction, TypedPhase, TypedPlayerRoster, TypedPrompt, TypedPromptInbox, TypedZone, Typography, UIContract, UIContractBucket, UseHandLayoutOptions, UseHandLayoutReturn, UsePanZoomOptions, UsePanZoomReturn, UsePluginRuntimeOptions, UsePluginRuntimeResult, ValidationResult, ViewCard, ViewSlotOccupant, ZoneDefinition, ZoneHighlightType, ZoneItemProps, ZoneKey, ZoneListProps, ZoneMapProps, ZonePiece, ZoneRootProps, ZoneShape };
|