@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/board/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EACL,YAAY,EAEZ,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,GAC9B,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,OAAO,EACP,QAAQ,EAER,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,GAC3B,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,UAAU,EAEV,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EAEjB,WAAW,EACX,SAAS,EACT,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,OAAO,EAEP,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC3B,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,UAAU,EAEV,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,GAC3B,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,UAAU,EAEV,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,GAC3B,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Board Primitives
|
|
3
|
+
*
|
|
4
|
+
* Reusable board visualization components for different game types.
|
|
5
|
+
*
|
|
6
|
+
* Components:
|
|
7
|
+
* - NetworkGraph: For route-building games (Ticket to Ride, Pandemic)
|
|
8
|
+
* - HexGrid: For hex-based games (Catan, wargames)
|
|
9
|
+
* - SquareGrid: For grid-based games (Chess, Go, Checkers)
|
|
10
|
+
* - ZoneMap: For area control games (Risk, Small World)
|
|
11
|
+
* - TrackBoard: For track/racing games (Monopoly, Game of Life)
|
|
12
|
+
* - SlotSystem: For worker placement games (Agricola, Viticulture)
|
|
13
|
+
*/
|
|
14
|
+
// NetworkGraph - Route building games
|
|
15
|
+
export { NetworkGraph,
|
|
16
|
+
// Pre-built helper components for easy customization
|
|
17
|
+
DefaultNetworkNode, DefaultNetworkEdge, DefaultNetworkPiece, } from "./NetworkGraph.js";
|
|
18
|
+
// HexGrid - Hex-based games (Catan, wargames)
|
|
19
|
+
export { HexGrid, hexUtils,
|
|
20
|
+
// Pre-built helper components for easy customization
|
|
21
|
+
DefaultHexTile, DefaultHexEdge, DefaultHexVertex, } from "./HexGrid.js";
|
|
22
|
+
export { createHexBoardView, } from "./hex-board-view.js";
|
|
23
|
+
// SquareGrid - Grid-based games (Chess, Go, Checkers)
|
|
24
|
+
export { SquareGrid,
|
|
25
|
+
// Pre-built helper components for easy customization
|
|
26
|
+
DefaultGridCell, DefaultGridPiece, DefaultChessPiece,
|
|
27
|
+
// Utility functions
|
|
28
|
+
toAlgebraic, toNumeric, } from "./SquareGrid.js";
|
|
29
|
+
// ZoneMap - Area control games
|
|
30
|
+
export { ZoneMap,
|
|
31
|
+
// Pre-built helper components for easy customization
|
|
32
|
+
DefaultZone, DefaultZonePieces, DefaultZonePiece, } from "./ZoneMap.js";
|
|
33
|
+
// TrackBoard - Track/racing games
|
|
34
|
+
export { TrackBoard,
|
|
35
|
+
// Pre-built helper components for easy customization
|
|
36
|
+
DefaultTrackSpace, DefaultTrackPiece, DefaultTrackConnection, DefaultTrackJump, } from "./TrackBoard.js";
|
|
37
|
+
// SlotSystem - Worker placement games
|
|
38
|
+
export { SlotSystem,
|
|
39
|
+
// Pre-built helper components for easy customization
|
|
40
|
+
DefaultSlotItem, DefaultSlotOccupant, DefaultEmptySlot, } from "./SlotSystem.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction-accessibility.d.ts","sourceRoot":"","sources":["../../../src/components/board/interaction-accessibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,aAAa,EACpB,UAAU,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,EACpC,OAAO,CAAC,EAAE;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GACtC,IAAI,CAcN"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function handleKeyboardActivation(event, onActivate, options) {
|
|
2
|
+
if (!onActivate) {
|
|
3
|
+
return;
|
|
4
|
+
}
|
|
5
|
+
if (event.key !== "Enter" && event.key !== " ") {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
event.preventDefault();
|
|
9
|
+
if (options?.stopPropagation) {
|
|
10
|
+
event.stopPropagation();
|
|
11
|
+
}
|
|
12
|
+
onActivate();
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface InteractiveTargetLayer {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
eligible?: ReadonlySet<string>;
|
|
4
|
+
selectTargetId?: (targetId: string) => void | Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export interface InteractiveTargetRenderState {
|
|
7
|
+
isEnabled: boolean;
|
|
8
|
+
isEligible: boolean;
|
|
9
|
+
isHovered: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function interactiveTargetRenderState(layer: InteractiveTargetLayer, targetId: string, isHovered: boolean): InteractiveTargetRenderState;
|
|
12
|
+
export declare function isInteractiveTargetSelectable(layer: InteractiveTargetLayer, state: InteractiveTargetRenderState): boolean;
|
|
13
|
+
//# sourceMappingURL=target-layer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target-layer.d.ts","sourceRoot":"","sources":["../../../src/components/board/target-layer.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/B,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7D;AAED,MAAM,WAAW,4BAA4B;IAC3C,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,sBAAsB,EAC7B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,OAAO,GACjB,4BAA4B,CAM9B;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,sBAAsB,EAC7B,KAAK,EAAE,4BAA4B,GAClC,OAAO,CAET"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function interactiveTargetRenderState(layer, targetId, isHovered) {
|
|
2
|
+
return {
|
|
3
|
+
isEnabled: layer.enabled !== false,
|
|
4
|
+
isEligible: layer.eligible?.has(targetId) ?? true,
|
|
5
|
+
isHovered,
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export function isInteractiveTargetSelectable(layer, state) {
|
|
9
|
+
return state.isEnabled && state.isEligible && !!layer.selectTargetId;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-render-content.type-test.d.ts","sourceRoot":"","sources":["../../src/components/card-render-content.type-test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Reducer-native UI primitives for building game interfaces. */
|
|
2
|
+
export { Card, type CardProps, type ViewCard } from "./Card.js";
|
|
3
|
+
export { Hand, type HandProps } from "./Hand.js";
|
|
4
|
+
export { HandDock, type HandDockMode, type HandDockPlacement, type HandDockPresentation, type HandDockProps, type HandDockToggleContext, } from "./HandDock.js";
|
|
5
|
+
export { PlayArea, type PlayAreaProps } from "./PlayArea.js";
|
|
6
|
+
export { GameSkeleton, type GameSkeletonProps } from "./GameSkeleton.js";
|
|
7
|
+
export { ToastProvider, useToast, type Toast, type ToastType, } from "./Toast.js";
|
|
8
|
+
export { ErrorBoundary, type ErrorBoundaryProps } from "./ErrorBoundary.js";
|
|
9
|
+
export { PluginRuntime, type PluginRuntimeProps } from "./PluginRuntime.js";
|
|
10
|
+
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, } from "./Drawer.js";
|
|
11
|
+
export { Dialog, DialogPortal, DialogOverlay, DialogTrigger, DialogClose, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, } from "../internal/ui/dialog.js";
|
|
12
|
+
export { ResourceCounter, type ResourceCounterProps, type ResourceDisplayConfig, } from "./ResourceCounter.js";
|
|
13
|
+
export { CostDisplay, type CostDisplayProps, type ResourceDefinition, } from "./CostDisplay.js";
|
|
14
|
+
export { ActionButton, type ActionButtonProps } from "./ActionButton.js";
|
|
15
|
+
export { PrimaryButton, type PrimaryButtonProps } from "./PrimaryButton.js";
|
|
16
|
+
export { ThemedButton, type ThemedButtonProps } from "./ThemedButton.js";
|
|
17
|
+
export { PrimaryActionButton, type PrimaryActionButtonProps, type PrimaryActionAttention, } from "./PrimaryActionButton.js";
|
|
18
|
+
export { InteractionForm, InteractionField, defaultFormInputs, hasDefaultInteractionFormFields, type InteractionFieldProps, type InteractionFieldRenderMap, type InteractionFieldRenderProps, type InteractionFormProps, } from "./InteractionForm.js";
|
|
19
|
+
export { ActionPanel, ActionGroup, type ActionPanelProps, type ActionGroupProps, } from "./ActionPanel.js";
|
|
20
|
+
export { MoreActions, type MoreActionsProps } from "./MoreActions.js";
|
|
21
|
+
export { DiceRoller, type DiceRollerProps } from "./DiceRoller.js";
|
|
22
|
+
export { PhaseIndicator, type PhaseIndicatorProps } from "./PhaseIndicator.js";
|
|
23
|
+
export { GameEndDisplay, type GameEndDisplayProps, type PlayerScore, } from "./GameEndDisplay.js";
|
|
24
|
+
export { PromptDialogHost, type PromptDialogHostProps, } from "./PromptDialogHost.js";
|
|
25
|
+
export { NetworkGraph, DefaultNetworkNode, DefaultNetworkEdge, DefaultNetworkPiece, type NetworkGraphProps, type NetworkNode, type NetworkEdge, type NetworkPiece, type DefaultNetworkNodeProps, type DefaultNetworkEdgeProps, type DefaultNetworkPieceProps, } from "./board/NetworkGraph.js";
|
|
26
|
+
export { ZoneMap, DefaultZone, DefaultZonePieces, DefaultZonePiece, type ZoneMapProps, type ZoneDefinition, type ZonePiece, type ZoneShape, type ZoneHighlightType, type DefaultZoneProps, type DefaultZonePiecesProps, type DefaultZonePieceProps, } from "./board/ZoneMap.js";
|
|
27
|
+
export { TrackBoard, DefaultTrackSpace, DefaultTrackPiece, DefaultTrackConnection, DefaultTrackJump, type TrackBoardProps, type TrackSpace, type TrackPiece, type DefaultTrackSpaceProps, type DefaultTrackPieceProps, type DefaultTrackConnectionProps, type DefaultTrackJumpProps, } from "./board/TrackBoard.js";
|
|
28
|
+
export { SlotSystem, DefaultSlotItem, DefaultSlotOccupant, DefaultEmptySlot, type SlotSystemProps, type SlotDefinition, type SlotOccupant, type DefaultSlotItemProps, type DefaultSlotOccupantProps, type DefaultEmptySlotProps, } from "./board/SlotSystem.js";
|
|
29
|
+
export { SquareGrid, DefaultGridCell, DefaultGridPiece, DefaultChessPiece, toAlgebraic, toNumeric, type SquareGridBoardProps, type SquareGridProps, type InteractiveSquareEdge, type InteractiveSquareVertex, type SquareEdgePosition, type SquareVertexPosition, type DefaultGridCellProps, type DefaultGridPieceProps, type DefaultChessPieceProps, } from "./board/SquareGrid.js";
|
|
30
|
+
export { HexGrid, hexUtils, DefaultHexTile, DefaultHexEdge, DefaultHexVertex, type HexGridBoardProps, type HexGridProps, type HexOrientation, type HexTileGeometry, type InteractiveHexEdge, type InteractiveHexVertex, type InteractiveTargetLayer, type InteractiveTargetRenderState, type EdgePosition, type DefaultHexTileProps, type DefaultHexEdgeProps, type DefaultHexVertexProps, } from "./board/HexGrid.js";
|
|
31
|
+
export { createHexBoardView, type HexBoardView, type HexBoardViewTile, } from "./board/hex-board-view.js";
|
|
32
|
+
export type { HexTileState, HexEdgeState, HexVertexState, SquareCellState, SquareEdgeState, SquarePieceState, SquareVertexState, } from "../types/player-state.js";
|
|
33
|
+
export type { CardCollection, ViewSlotOccupant } from "@dreamboard/sdk-types";
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,iEAAiE;AAGjE,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EACL,QAAQ,EACR,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,qBAAqB,GAC3B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAG7D,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACL,aAAa,EACb,QAAQ,EACR,KAAK,KAAK,EACV,KAAK,SAAS,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,aAAa,EACb,WAAW,EACX,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,aAAa,EACb,WAAW,EACX,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACL,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,GAC5B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,+BAA+B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,WAAW,EACX,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EACL,cAAc,EACd,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,GAC3B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,GAC9B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,OAAO,EACP,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,GAC3B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,UAAU,EACV,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,GAC3B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,OAAO,EACP,QAAQ,EACR,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,EACjC,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,gBAAgB,GACtB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Reducer-native UI primitives for building game interfaces. */
|
|
2
|
+
// Presentational components (no hooks, receive data as props)
|
|
3
|
+
export { Card } from "./Card.js";
|
|
4
|
+
export { Hand } from "./Hand.js";
|
|
5
|
+
export { HandDock, } from "./HandDock.js";
|
|
6
|
+
export { PlayArea } from "./PlayArea.js";
|
|
7
|
+
// Other UI components
|
|
8
|
+
export { GameSkeleton } from "./GameSkeleton.js";
|
|
9
|
+
export { ToastProvider, useToast, } from "./Toast.js";
|
|
10
|
+
export { ErrorBoundary } from "./ErrorBoundary.js";
|
|
11
|
+
export { PluginRuntime } from "./PluginRuntime.js";
|
|
12
|
+
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, } from "./Drawer.js";
|
|
13
|
+
export { Dialog, DialogPortal, DialogOverlay, DialogTrigger, DialogClose, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, } from "../internal/ui/dialog.js";
|
|
14
|
+
// Game UI primitives (SDK v0.1.0+)
|
|
15
|
+
export { ResourceCounter, } from "./ResourceCounter.js";
|
|
16
|
+
export { CostDisplay, } from "./CostDisplay.js";
|
|
17
|
+
export { ActionButton } from "./ActionButton.js";
|
|
18
|
+
export { PrimaryButton } from "./PrimaryButton.js";
|
|
19
|
+
export { ThemedButton } from "./ThemedButton.js";
|
|
20
|
+
export { PrimaryActionButton, } from "./PrimaryActionButton.js";
|
|
21
|
+
export { InteractionForm, InteractionField, defaultFormInputs, hasDefaultInteractionFormFields, } from "./InteractionForm.js";
|
|
22
|
+
export { ActionPanel, ActionGroup, } from "./ActionPanel.js";
|
|
23
|
+
export { MoreActions } from "./MoreActions.js";
|
|
24
|
+
export { DiceRoller } from "./DiceRoller.js";
|
|
25
|
+
export { PhaseIndicator } from "./PhaseIndicator.js";
|
|
26
|
+
export { GameEndDisplay, } from "./GameEndDisplay.js";
|
|
27
|
+
export { PromptDialogHost, } from "./PromptDialogHost.js";
|
|
28
|
+
// Board primitives (SDK v0.2.0+)
|
|
29
|
+
export { NetworkGraph, DefaultNetworkNode, DefaultNetworkEdge, DefaultNetworkPiece, } from "./board/NetworkGraph.js";
|
|
30
|
+
export { ZoneMap, DefaultZone, DefaultZonePieces, DefaultZonePiece, } from "./board/ZoneMap.js";
|
|
31
|
+
export { TrackBoard, DefaultTrackSpace, DefaultTrackPiece, DefaultTrackConnection, DefaultTrackJump, } from "./board/TrackBoard.js";
|
|
32
|
+
export { SlotSystem, DefaultSlotItem, DefaultSlotOccupant, DefaultEmptySlot, } from "./board/SlotSystem.js";
|
|
33
|
+
export { SquareGrid, DefaultGridCell, DefaultGridPiece, DefaultChessPiece, toAlgebraic, toNumeric, } from "./board/SquareGrid.js";
|
|
34
|
+
export { HexGrid, hexUtils, DefaultHexTile, DefaultHexEdge, DefaultHexVertex, } from "./board/HexGrid.js";
|
|
35
|
+
export { createHexBoardView, } from "./board/hex-board-view.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type InteractionDialogDismissBehavior = {
|
|
2
|
+
type: "none";
|
|
3
|
+
} | {
|
|
4
|
+
type: "dismiss";
|
|
5
|
+
} | {
|
|
6
|
+
type: "minimize";
|
|
7
|
+
trayLabel: string;
|
|
8
|
+
trayIcon?: string;
|
|
9
|
+
};
|
|
10
|
+
export interface InteractionDialogPresentation {
|
|
11
|
+
dismissBehavior?: InteractionDialogDismissBehavior;
|
|
12
|
+
}
|
|
13
|
+
export declare function resolveDialogDismissBehavior(dialog: InteractionDialogPresentation | undefined): InteractionDialogDismissBehavior;
|
|
14
|
+
export declare function canCloseDialog(dismissBehavior: InteractionDialogDismissBehavior): boolean;
|
|
15
|
+
//# sourceMappingURL=interaction-dialog-behavior.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction-dialog-behavior.d.ts","sourceRoot":"","sources":["../../src/components/interaction-dialog-behavior.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gCAAgC,GACxC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/D,MAAM,WAAW,6BAA6B;IAC5C,eAAe,CAAC,EAAE,gCAAgC,CAAC;CACpD;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,6BAA6B,GAAG,SAAS,GAChD,gCAAgC,CAIlC;AAED,wBAAgB,cAAc,CAC5B,eAAe,EAAE,gCAAgC,GAChD,OAAO,CAET"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function resolveDialogDismissBehavior(dialog) {
|
|
2
|
+
const dismissBehavior = dialog?.dismissBehavior;
|
|
3
|
+
if (dismissBehavior)
|
|
4
|
+
return dismissBehavior;
|
|
5
|
+
return { type: "none" };
|
|
6
|
+
}
|
|
7
|
+
export function canCloseDialog(dismissBehavior) {
|
|
8
|
+
return dismissBehavior.type !== "none";
|
|
9
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type InteractionHandle } from "../../hooks/useInteractionHandle.js";
|
|
3
|
+
import type { InteractionDescriptor } from "../../types/plugin-state.js";
|
|
4
|
+
import type { InteractionDefaultedKeysOf, InteractionParamsByKeyShape, InteractionParamsOf, SurfaceRenderMap } from "./types.js";
|
|
5
|
+
export interface BlockerSurfaceProps<I extends string = never, ParamsByKey extends Partial<InteractionParamsByKeyShape> = {}> {
|
|
6
|
+
/**
|
|
7
|
+
* Optional per-interaction overrides. Omit to fall back to the default
|
|
8
|
+
* `DefaultInteractionButton` inside the blocker overlay.
|
|
9
|
+
*/
|
|
10
|
+
render?: SurfaceRenderMap<I, ParamsByKey>;
|
|
11
|
+
/**
|
|
12
|
+
* Fallback renderer for blocker interactions without a `render` entry.
|
|
13
|
+
* Defaults to the built-in `DefaultInteractionButton`.
|
|
14
|
+
*/
|
|
15
|
+
renderItem?: (descriptor: InteractionDescriptor<I>, handle: InteractionHandle<InteractionParamsOf<ParamsByKey, I>, InteractionDefaultedKeysOf<ParamsByKey, I>>) => ReactNode;
|
|
16
|
+
/** Shown when no blocker interactions are addressed to the controlling seat. */
|
|
17
|
+
empty?: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Default renderer for legacy blocker interactions. Rendered as a layout-less
|
|
21
|
+
* item list; callers decide whether to mount it inline or wrap it in their own
|
|
22
|
+
* overlay container.
|
|
23
|
+
*
|
|
24
|
+
* Visual styling is sourced entirely from the active {@link useTheme}.
|
|
25
|
+
*/
|
|
26
|
+
export declare function BlockerSurface<I extends string = never, ParamsByKey extends Partial<InteractionParamsByKeyShape> = {}>({ render, renderItem, empty }: BlockerSurfaceProps<I, ParamsByKey>): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
//# sourceMappingURL=BlockerSurface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockerSurface.d.ts","sourceRoot":"","sources":["../../../src/components/surfaces/BlockerSurface.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEzE,OAAO,KAAK,EACV,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,mBAAmB,CAClC,CAAC,SAAS,MAAM,GAAG,KAAK,EACxB,WAAW,SAAS,OAAO,CAAC,2BAA2B,CAAC,GAAG,EAAE;IAE7D;;;OAGG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;IAC1C;;;OAGG;IACH,UAAU,CAAC,EAAE,CACX,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC,EACpC,MAAM,EAAE,iBAAiB,CACvB,mBAAmB,CAAC,WAAW,EAAE,CAAC,CAAC,EACnC,0BAA0B,CAAC,WAAW,EAAE,CAAC,CAAC,CAC3C,KACE,SAAS,CAAC;IACf,gFAAgF;IAChF,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,CAAC,SAAS,MAAM,GAAG,KAAK,EACxB,WAAW,SAAS,OAAO,CAAC,2BAA2B,CAAC,GAAG,EAAE,EAC7D,EAAE,MAAM,EAAE,UAAU,EAAE,KAAY,EAAE,EAAE,mBAAmB,CAAC,CAAC,EAAE,WAAW,CAAC,2CAkC1E"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useSeatInbox } from "../../hooks/useSeatInbox.js";
|
|
3
|
+
import { useInteractionHandle, } from "../../hooks/useInteractionHandle.js";
|
|
4
|
+
import { useTheme } from "../../theme/ThemeProvider.js";
|
|
5
|
+
import { DefaultInteractionButton } from "./internal/DefaultInteractionButton.js";
|
|
6
|
+
/**
|
|
7
|
+
* Default renderer for legacy blocker interactions. Rendered as a layout-less
|
|
8
|
+
* item list; callers decide whether to mount it inline or wrap it in their own
|
|
9
|
+
* overlay container.
|
|
10
|
+
*
|
|
11
|
+
* Visual styling is sourced entirely from the active {@link useTheme}.
|
|
12
|
+
*/
|
|
13
|
+
export function BlockerSurface({ render, renderItem, empty = null }) {
|
|
14
|
+
const theme = useTheme();
|
|
15
|
+
const inbox = useSeatInbox();
|
|
16
|
+
// Blocker semantics: only mount descriptors that are *actually blocking*.
|
|
17
|
+
// An unavailable blocker (e.g. `discardCards` when this seat is not on the
|
|
18
|
+
// discard list) must not escalate into a modal overlay — that would block
|
|
19
|
+
// the UI with no valid action to dismiss it.
|
|
20
|
+
const items = (inbox.bySurface.blocker ?? []).filter((descriptor) => descriptor.available !== false);
|
|
21
|
+
if (items.length === 0)
|
|
22
|
+
return _jsx(_Fragment, { children: empty });
|
|
23
|
+
return (_jsx("div", { role: "alertdialog", "aria-modal": "true", "aria-label": "Blocking interaction", "data-surface": "blocker", style: {
|
|
24
|
+
display: "flex",
|
|
25
|
+
flexDirection: "column",
|
|
26
|
+
gap: theme.space[3],
|
|
27
|
+
alignItems: "stretch",
|
|
28
|
+
}, children: items.map((descriptor) => (_jsx(BlockerItem, { descriptor: descriptor, render: render, renderItem: renderItem }, descriptor.interactionKey))) }));
|
|
29
|
+
}
|
|
30
|
+
function BlockerItem({ descriptor, render, renderItem, }) {
|
|
31
|
+
const handle = useInteractionHandle(descriptor);
|
|
32
|
+
const override = render?.[descriptor.interactionKey];
|
|
33
|
+
if (override)
|
|
34
|
+
return _jsx(_Fragment, { children: override(descriptor, handle) });
|
|
35
|
+
if (renderItem)
|
|
36
|
+
return _jsx(_Fragment, { children: renderItem(descriptor, handle) });
|
|
37
|
+
return (_jsx(DefaultInteractionButton, { descriptor: descriptor, handle: handle, defaultFormOpen: true }));
|
|
38
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type InteractionHandle } from "../../hooks/useInteractionHandle.js";
|
|
3
|
+
import type { InteractionDescriptor } from "../../types/plugin-state.js";
|
|
4
|
+
/** Standard board surface tags produced by the trusted bundle. */
|
|
5
|
+
export type BoardSurfaceTag = "board-vertex" | "board-edge" | "board-tile" | "board-space";
|
|
6
|
+
/**
|
|
7
|
+
* Context handed to the `<BoardSurface>` children render-prop. Covers
|
|
8
|
+
* everything callers need to route hex/vertex/edge/space clicks into the
|
|
9
|
+
* correct interaction with a single `select(targetId)` call.
|
|
10
|
+
*/
|
|
11
|
+
export interface BoardSurfaceContext<I extends string = string> {
|
|
12
|
+
/** All available board-* interactions (armed and unarmed). */
|
|
13
|
+
interactions: ReadonlyArray<InteractionDescriptor<I>>;
|
|
14
|
+
/** Key of the currently armed interaction, or null. */
|
|
15
|
+
armedId: string | null;
|
|
16
|
+
/** Handle of the armed interaction, or null when nothing is armed. */
|
|
17
|
+
armed: InteractionHandle | null;
|
|
18
|
+
/**
|
|
19
|
+
* Eligible target ids for the armed interaction, keyed by
|
|
20
|
+
* input-collector name (e.g. `{ vertexId: Set(['v-1','v-2']) }`).
|
|
21
|
+
*/
|
|
22
|
+
eligible: Readonly<Record<string, ReadonlySet<string>>>;
|
|
23
|
+
/** Arm a specific interaction key on its surface (or disarm when null). */
|
|
24
|
+
arm: (interactionKey: string | null) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Commit a target click. Writes `targetId` into the first draft input
|
|
27
|
+
* whose eligible-set includes it (preferring inputs that are still
|
|
28
|
+
* empty) and submits as soon as every required input is filled.
|
|
29
|
+
*/
|
|
30
|
+
select: (targetId: string) => Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Whether `targetId` is eligible under the armed interaction.
|
|
33
|
+
* Pass `inputKey` to scope the check to a specific input.
|
|
34
|
+
*/
|
|
35
|
+
isEligible: (targetId: string, inputKey?: string) => boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface BoardSurfaceProps<I extends string = string> {
|
|
38
|
+
/**
|
|
39
|
+
* Required children-as-function. Receives a
|
|
40
|
+
* {@link BoardSurfaceContext} with the armed interaction, eligible
|
|
41
|
+
* targets and a click-routing `select(targetId)` helper.
|
|
42
|
+
*/
|
|
43
|
+
children: (ctx: BoardSurfaceContext<I>) => ReactNode;
|
|
44
|
+
/** Rendered when no board-* interactions are available. */
|
|
45
|
+
empty?: ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* When true (default), auto-arm the single available interaction so
|
|
48
|
+
* single-choice boards don't need explicit arming UI.
|
|
49
|
+
*/
|
|
50
|
+
autoArmSingle?: boolean;
|
|
51
|
+
/** Surface tags included in this instance. Defaults to all four. */
|
|
52
|
+
surfaces?: readonly BoardSurfaceTag[];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Surface for any interaction tagged `board-vertex`, `board-edge`,
|
|
56
|
+
* `board-tile` or `board-space`.
|
|
57
|
+
*
|
|
58
|
+
* `BoardSurface` does **not** render board geometry (that stays with
|
|
59
|
+
* the app). Instead it exposes an opinionated click-routing context so
|
|
60
|
+
* that a plain SVG/canvas board wired via `select(targetId)`
|
|
61
|
+
* automatically participates in arming, eligibility highlighting, and
|
|
62
|
+
* submission.
|
|
63
|
+
*
|
|
64
|
+
* ```tsx
|
|
65
|
+
* <BoardSurface>
|
|
66
|
+
* {({ eligible, select, armedId }) => (
|
|
67
|
+
* <HexBoard
|
|
68
|
+
* highlightedVertices={eligible.vertexId}
|
|
69
|
+
* onVertexClick={(id) => select(id)}
|
|
70
|
+
* armedInteractionId={armedId}
|
|
71
|
+
* />
|
|
72
|
+
* )}
|
|
73
|
+
* </BoardSurface>
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export declare function BoardSurface<I extends string = string>({ children, empty, autoArmSingle, surfaces, }: BoardSurfaceProps<I>): import("react/jsx-runtime").JSX.Element;
|
|
77
|
+
//# sourceMappingURL=BoardSurface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BoardSurface.d.ts","sourceRoot":"","sources":["../../../src/components/surfaces/BoardSurface.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGxE,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAUzE,kEAAkE;AAClE,MAAM,MAAM,eAAe,GACvB,cAAc,GACd,YAAY,GACZ,YAAY,GACZ,aAAa,CAAC;AAElB;;;;GAIG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC5D,8DAA8D;IAC9D,YAAY,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,uDAAuD;IACvD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,sEAAsE;IACtE,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAChC;;;OAGG;IACH,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACxD,2EAA2E;IAC3E,GAAG,EAAE,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7C;;;;OAIG;IACH,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C;;;OAGG;IACH,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;CAC9D;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC1D;;;;OAIG;IACH,QAAQ,EAAE,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;IACrD,2DAA2D;IAC3D,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;CACvC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,EACtD,QAAQ,EACR,KAAY,EACZ,aAAoB,EACpB,QAAsE,GACvE,EAAE,iBAAiB,CAAC,CAAC,CAAC,2CA0FtB"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useMemo } from "react";
|
|
3
|
+
import { useStore } from "zustand";
|
|
4
|
+
import { useInteractionUiStore } from "../../context/InteractionDraftContext.js";
|
|
5
|
+
import { useInteractionHandle, } from "../../hooks/useInteractionHandle.js";
|
|
6
|
+
import { usePluginState } from "../../context/PluginStateContext.js";
|
|
7
|
+
import { eligibleTargetsByInput, eligibleTargetsByBoardKind, hasBoardTargetInput, interactionArmScope, interactionInputKeys, } from "../../utils/interaction-inputs.js";
|
|
8
|
+
/**
|
|
9
|
+
* Surface for any interaction tagged `board-vertex`, `board-edge`,
|
|
10
|
+
* `board-tile` or `board-space`.
|
|
11
|
+
*
|
|
12
|
+
* `BoardSurface` does **not** render board geometry (that stays with
|
|
13
|
+
* the app). Instead it exposes an opinionated click-routing context so
|
|
14
|
+
* that a plain SVG/canvas board wired via `select(targetId)`
|
|
15
|
+
* automatically participates in arming, eligibility highlighting, and
|
|
16
|
+
* submission.
|
|
17
|
+
*
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <BoardSurface>
|
|
20
|
+
* {({ eligible, select, armedId }) => (
|
|
21
|
+
* <HexBoard
|
|
22
|
+
* highlightedVertices={eligible.vertexId}
|
|
23
|
+
* onVertexClick={(id) => select(id)}
|
|
24
|
+
* armedInteractionId={armedId}
|
|
25
|
+
* />
|
|
26
|
+
* )}
|
|
27
|
+
* </BoardSurface>
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export function BoardSurface({ children, empty = null, autoArmSingle = true, surfaces = ["board-vertex", "board-edge", "board-tile", "board-space"], }) {
|
|
31
|
+
const store = useInteractionUiStore();
|
|
32
|
+
const subscribedArmedBySurface = useStore(store, (state) => state.arms);
|
|
33
|
+
const armedBySurface = store.getState().arms ?? subscribedArmedBySurface;
|
|
34
|
+
const descriptors = usePluginState((state) => state.gameplay.availableInteractions ?? []);
|
|
35
|
+
const armedIds = useMemo(() => new Set(Object.values(armedBySurface)), [armedBySurface]);
|
|
36
|
+
const interactions = useMemo(() => {
|
|
37
|
+
const targetKinds = new Set(surfaces.map(boardTargetKindForSurface));
|
|
38
|
+
return descriptors.filter((descriptor) => armedIds.has(descriptor.interactionKey) ||
|
|
39
|
+
(hasBoardTargetInput(descriptor) &&
|
|
40
|
+
(targetKinds.size === 0 ||
|
|
41
|
+
Object.keys(eligibleTargetsByBoardKind(descriptor)).some((kind) => targetKinds.has(kind)))));
|
|
42
|
+
}, [armedIds, descriptors, surfaces]);
|
|
43
|
+
const armedId = useMemo(() => {
|
|
44
|
+
const interactionKeys = new Set(interactions.map((descriptor) => descriptor.interactionKey));
|
|
45
|
+
return (Object.values(armedBySurface).find((id) => interactionKeys.has(id)) ??
|
|
46
|
+
null);
|
|
47
|
+
}, [armedBySurface, interactions]);
|
|
48
|
+
const armedDescriptor = useMemo(() => interactions.find((descriptor) => descriptor.interactionKey === armedId) ??
|
|
49
|
+
interactions.find((descriptor) => armedIds.has(descriptor.interactionKey)) ??
|
|
50
|
+
null, [armedIds, interactions, armedId]);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (!autoArmSingle)
|
|
53
|
+
return;
|
|
54
|
+
if (interactions.length !== 1)
|
|
55
|
+
return;
|
|
56
|
+
const only = interactions[0];
|
|
57
|
+
if (!only || !only.available)
|
|
58
|
+
return;
|
|
59
|
+
const scope = interactionArmScope(only);
|
|
60
|
+
if (store.getArmed(scope) === only.interactionKey)
|
|
61
|
+
return;
|
|
62
|
+
store.arm(scope, only.interactionKey);
|
|
63
|
+
}, [autoArmSingle, interactions, store]);
|
|
64
|
+
// Disarm stale ids (interaction disappeared from the inbox).
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
for (const [surface, interactionKey] of Object.entries(armedBySurface)) {
|
|
67
|
+
const stillPresent = interactions.some((descriptor) => descriptor.interactionKey === interactionKey);
|
|
68
|
+
if (!stillPresent) {
|
|
69
|
+
store.arm(surface, null);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}, [armedBySurface, interactions, store]);
|
|
73
|
+
if (interactions.length === 0) {
|
|
74
|
+
return _jsx(_Fragment, { children: empty });
|
|
75
|
+
}
|
|
76
|
+
if (armedDescriptor) {
|
|
77
|
+
return (_jsx(ArmedBoardBody, { interactions: interactions, armedDescriptor: armedDescriptor, children: children }));
|
|
78
|
+
}
|
|
79
|
+
return (_jsx(UnarmedBoardBody, { interactions: interactions, children: children }));
|
|
80
|
+
}
|
|
81
|
+
function ArmedBoardBody({ interactions, armedDescriptor, children, }) {
|
|
82
|
+
const armed = useInteractionHandle(armedDescriptor);
|
|
83
|
+
const store = useInteractionUiStore();
|
|
84
|
+
const eligible = useMemo(() => {
|
|
85
|
+
const result = {};
|
|
86
|
+
const raw = eligibleTargetsByInput(armed.descriptor);
|
|
87
|
+
for (const [key, values] of Object.entries(raw)) {
|
|
88
|
+
result[key] = new Set(values ?? []);
|
|
89
|
+
}
|
|
90
|
+
return result;
|
|
91
|
+
}, [armed.descriptor]);
|
|
92
|
+
const arm = useCallback((interactionKey) => {
|
|
93
|
+
if (interactionKey === null) {
|
|
94
|
+
store.arm(interactionArmScope(armedDescriptor), null);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const target = interactions.find((d) => d.interactionKey === interactionKey);
|
|
98
|
+
if (!target)
|
|
99
|
+
return;
|
|
100
|
+
store.arm(interactionArmScope(target), interactionKey);
|
|
101
|
+
}, [armedDescriptor, interactions, store]);
|
|
102
|
+
const isEligible = useCallback((targetId, inputKey) => {
|
|
103
|
+
if (inputKey !== undefined) {
|
|
104
|
+
return eligible[inputKey]?.has(targetId) ?? false;
|
|
105
|
+
}
|
|
106
|
+
return Object.values(eligible).some((set) => set.has(targetId));
|
|
107
|
+
}, [eligible]);
|
|
108
|
+
const select = useCallback(async (targetId) => {
|
|
109
|
+
const keys = Object.keys(eligible);
|
|
110
|
+
if (keys.length === 0)
|
|
111
|
+
return;
|
|
112
|
+
const currentDraft = armed.draft;
|
|
113
|
+
const emptyMatch = keys.find((k) => eligible[k]?.has(targetId) &&
|
|
114
|
+
(currentDraft[k] === undefined || currentDraft[k] === null));
|
|
115
|
+
const fallback = keys.find((k) => eligible[k]?.has(targetId));
|
|
116
|
+
const match = emptyMatch ?? fallback;
|
|
117
|
+
if (!match)
|
|
118
|
+
return;
|
|
119
|
+
armed.setInput(match, targetId);
|
|
120
|
+
const nextDraft = {
|
|
121
|
+
...currentDraft,
|
|
122
|
+
[match]: targetId,
|
|
123
|
+
};
|
|
124
|
+
const required = interactionInputKeys(armed.descriptor);
|
|
125
|
+
const ready = required.every((key) => nextDraft[key] !== undefined && nextDraft[key] !== null);
|
|
126
|
+
if (ready) {
|
|
127
|
+
await armed.submit(nextDraft);
|
|
128
|
+
}
|
|
129
|
+
}, [armed, eligible]);
|
|
130
|
+
const ctx = {
|
|
131
|
+
interactions,
|
|
132
|
+
armedId: armed.descriptor.interactionKey,
|
|
133
|
+
armed,
|
|
134
|
+
eligible,
|
|
135
|
+
arm,
|
|
136
|
+
select,
|
|
137
|
+
isEligible,
|
|
138
|
+
};
|
|
139
|
+
return _jsx(_Fragment, { children: children(ctx) });
|
|
140
|
+
}
|
|
141
|
+
function UnarmedBoardBody({ interactions, children, }) {
|
|
142
|
+
const store = useInteractionUiStore();
|
|
143
|
+
const arm = useCallback((interactionKey) => {
|
|
144
|
+
if (interactionKey === null) {
|
|
145
|
+
for (const descriptor of interactions) {
|
|
146
|
+
store.arm(interactionArmScope(descriptor), null);
|
|
147
|
+
}
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const target = interactions.find((d) => d.interactionKey === interactionKey);
|
|
151
|
+
if (!target)
|
|
152
|
+
return;
|
|
153
|
+
store.arm(interactionArmScope(target), interactionKey);
|
|
154
|
+
}, [interactions, store]);
|
|
155
|
+
const noop = useCallback(async () => { }, []);
|
|
156
|
+
const never = useCallback(() => false, []);
|
|
157
|
+
const ctx = {
|
|
158
|
+
interactions,
|
|
159
|
+
armedId: null,
|
|
160
|
+
armed: null,
|
|
161
|
+
eligible: EMPTY_ELIGIBLE,
|
|
162
|
+
arm,
|
|
163
|
+
select: noop,
|
|
164
|
+
isEligible: never,
|
|
165
|
+
};
|
|
166
|
+
return _jsx(_Fragment, { children: children(ctx) });
|
|
167
|
+
}
|
|
168
|
+
const EMPTY_ELIGIBLE = {};
|
|
169
|
+
function boardTargetKindForSurface(surface) {
|
|
170
|
+
switch (surface) {
|
|
171
|
+
case "board-edge":
|
|
172
|
+
return "edge";
|
|
173
|
+
case "board-space":
|
|
174
|
+
return "space";
|
|
175
|
+
case "board-tile":
|
|
176
|
+
return "tile";
|
|
177
|
+
case "board-vertex":
|
|
178
|
+
return "vertex";
|
|
179
|
+
}
|
|
180
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type InteractionHandle } from "../../hooks/useInteractionHandle.js";
|
|
3
|
+
import type { InteractionDescriptor } from "../../types/plugin-state.js";
|
|
4
|
+
import type { InteractionDefaultedKeysOf, InteractionParamsByKeyShape, InteractionParamsOf, SurfaceRenderMap } from "./types.js";
|
|
5
|
+
export interface ChromeSurfaceProps<I extends string = never, ParamsByKey extends Partial<InteractionParamsByKeyShape> = {}> {
|
|
6
|
+
/**
|
|
7
|
+
* Optional per-interaction overrides. Omit to fall back to the default
|
|
8
|
+
* `DefaultInteractionButton` for every chrome interaction.
|
|
9
|
+
*/
|
|
10
|
+
render?: SurfaceRenderMap<I, ParamsByKey>;
|
|
11
|
+
/**
|
|
12
|
+
* Fallback renderer for chrome interactions without a `render` entry.
|
|
13
|
+
* Defaults to the built-in `DefaultInteractionButton`.
|
|
14
|
+
*/
|
|
15
|
+
renderItem?: (descriptor: InteractionDescriptor<I>, handle: InteractionHandle<InteractionParamsOf<ParamsByKey, I>, InteractionDefaultedKeysOf<ParamsByKey, I>>) => ReactNode;
|
|
16
|
+
/** Interaction keys intentionally rendered elsewhere, such as auto primary actions. */
|
|
17
|
+
excludeInteractionKeys?: readonly string[];
|
|
18
|
+
/** Shown when no chrome interactions are available. */
|
|
19
|
+
empty?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Default renderer for legacy chrome interactions — persistent controls like
|
|
23
|
+
* menu buttons or status indicators. Renders a layout-less horizontal flex row
|
|
24
|
+
* so callers can own positioning and spacing.
|
|
25
|
+
*
|
|
26
|
+
* Visual styling is sourced entirely from the active {@link useTheme}.
|
|
27
|
+
*/
|
|
28
|
+
export declare function ChromeSurface<I extends string = never, ParamsByKey extends Partial<InteractionParamsByKeyShape> = {}>({ render, renderItem, excludeInteractionKeys, empty, }: ChromeSurfaceProps<I, ParamsByKey>): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
//# sourceMappingURL=ChromeSurface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChromeSurface.d.ts","sourceRoot":"","sources":["../../../src/components/surfaces/ChromeSurface.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEzE,OAAO,KAAK,EACV,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,kBAAkB,CACjC,CAAC,SAAS,MAAM,GAAG,KAAK,EACxB,WAAW,SAAS,OAAO,CAAC,2BAA2B,CAAC,GAAG,EAAE;IAE7D;;;OAGG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;IAC1C;;;OAGG;IACH,UAAU,CAAC,EAAE,CACX,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC,EACpC,MAAM,EAAE,iBAAiB,CACvB,mBAAmB,CAAC,WAAW,EAAE,CAAC,CAAC,EACnC,0BAA0B,CAAC,WAAW,EAAE,CAAC,CAAC,CAC3C,KACE,SAAS,CAAC;IACf,uFAAuF;IACvF,sBAAsB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,uDAAuD;IACvD,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,CAAC,SAAS,MAAM,GAAG,KAAK,EACxB,WAAW,SAAS,OAAO,CAAC,2BAA2B,CAAC,GAAG,EAAE,EAC7D,EACA,MAAM,EACN,UAAU,EACV,sBAAsB,EACtB,KAAY,GACb,EAAE,kBAAkB,CAAC,CAAC,EAAE,WAAW,CAAC,2CA6BpC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useSeatInbox } from "../../hooks/useSeatInbox.js";
|
|
3
|
+
import { useInteractionHandle, } from "../../hooks/useInteractionHandle.js";
|
|
4
|
+
import { useTheme } from "../../theme/ThemeProvider.js";
|
|
5
|
+
import { DefaultInteractionButton } from "./internal/DefaultInteractionButton.js";
|
|
6
|
+
/**
|
|
7
|
+
* Default renderer for legacy chrome interactions — persistent controls like
|
|
8
|
+
* menu buttons or status indicators. Renders a layout-less horizontal flex row
|
|
9
|
+
* so callers can own positioning and spacing.
|
|
10
|
+
*
|
|
11
|
+
* Visual styling is sourced entirely from the active {@link useTheme}.
|
|
12
|
+
*/
|
|
13
|
+
export function ChromeSurface({ render, renderItem, excludeInteractionKeys, empty = null, }) {
|
|
14
|
+
const theme = useTheme();
|
|
15
|
+
const inbox = useSeatInbox();
|
|
16
|
+
const excluded = new Set(excludeInteractionKeys ?? []);
|
|
17
|
+
const items = (inbox.bySurface.chrome ?? []).filter((descriptor) => !excluded.has(descriptor.interactionKey));
|
|
18
|
+
if (items.length === 0)
|
|
19
|
+
return _jsx(_Fragment, { children: empty });
|
|
20
|
+
return (_jsx("div", { role: "toolbar", "aria-label": "Chrome actions", "data-surface": "chrome", style: {
|
|
21
|
+
display: "flex",
|
|
22
|
+
gap: theme.space[2],
|
|
23
|
+
alignItems: "center",
|
|
24
|
+
}, children: items.map((descriptor) => (_jsx(ChromeItem, { descriptor: descriptor, render: render, renderItem: renderItem }, descriptor.interactionKey))) }));
|
|
25
|
+
}
|
|
26
|
+
function ChromeItem({ descriptor, render, renderItem, }) {
|
|
27
|
+
const handle = useInteractionHandle(descriptor);
|
|
28
|
+
const override = render?.[descriptor.interactionKey];
|
|
29
|
+
if (override)
|
|
30
|
+
return _jsx(_Fragment, { children: override(descriptor, handle) });
|
|
31
|
+
if (renderItem)
|
|
32
|
+
return _jsx(_Fragment, { children: renderItem(descriptor, handle) });
|
|
33
|
+
return _jsx(DefaultInteractionButton, { descriptor: descriptor, handle: handle });
|
|
34
|
+
}
|