@pretty-chitty/core 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +51 -0
- package/README.md +152 -0
- package/dist/0e0a96423fd742218c61.woff2 +0 -0
- package/dist/1e28c9f184923aacc181.woff +0 -0
- package/dist/37f3b2ddcbe588b2aaa5.jpg +0 -0
- package/dist/3f0fb9058a03e14ad2fa.jpg +0 -0
- package/dist/4482e08504d544757971.woff2 +0 -0
- package/dist/5212361bfd059a27e2da.woff2 +0 -0
- package/dist/699b459f21e39ca4b8df.woff2 +0 -0
- package/dist/7e339dfbea59fe54f2e3.png +0 -0
- package/dist/a3e6d4ebd8f859f0f1dc.woff +0 -0
- package/dist/b8b0d3bc0d26444e4a5a.woff2 +0 -0
- package/dist/bce9a6fcc5b3da9a086a.woff +0 -0
- package/dist/components/ActionLogDisplay.d.ts +4 -0
- package/dist/components/ActionLogDisplay.d.ts.map +1 -0
- package/dist/components/ActionLogDisplay.js +144 -0
- package/dist/components/ActionLogDisplay.js.map +1 -0
- package/dist/components/ActionLogHistory.d.ts +6 -0
- package/dist/components/ActionLogHistory.d.ts.map +1 -0
- package/dist/components/ActionLogHistory.js +81 -0
- package/dist/components/ActionLogHistory.js.map +1 -0
- package/dist/components/ActionLogHistoryDisplay.d.ts +2 -0
- package/dist/components/ActionLogHistoryDisplay.d.ts.map +1 -0
- package/dist/components/ActionLogHistoryDisplay.js +17 -0
- package/dist/components/ActionLogHistoryDisplay.js.map +1 -0
- package/dist/components/ActionLogSidebar.d.ts +2 -0
- package/dist/components/ActionLogSidebar.d.ts.map +1 -0
- package/dist/components/ActionLogSidebar.js +9 -0
- package/dist/components/ActionLogSidebar.js.map +1 -0
- package/dist/components/BottomBar.d.ts +2 -0
- package/dist/components/BottomBar.d.ts.map +1 -0
- package/dist/components/BottomBar.js +33 -0
- package/dist/components/BottomBar.js.map +1 -0
- package/dist/components/BottomBarBreak.d.ts +2 -0
- package/dist/components/BottomBarBreak.d.ts.map +1 -0
- package/dist/components/BottomBarBreak.js +8 -0
- package/dist/components/BottomBarBreak.js.map +1 -0
- package/dist/components/BottomBarButton.d.ts +16 -0
- package/dist/components/BottomBarButton.d.ts.map +1 -0
- package/dist/components/BottomBarButton.js +123 -0
- package/dist/components/BottomBarButton.js.map +1 -0
- package/dist/components/CanvasLibraryViewer.d.ts +8 -0
- package/dist/components/CanvasLibraryViewer.d.ts.map +1 -0
- package/dist/components/CanvasLibraryViewer.js +29 -0
- package/dist/components/CanvasLibraryViewer.js.map +1 -0
- package/dist/components/ChitLibraryViewer.d.ts +8 -0
- package/dist/components/ChitLibraryViewer.d.ts.map +1 -0
- package/dist/components/ChitLibraryViewer.js +101 -0
- package/dist/components/ChitLibraryViewer.js.map +1 -0
- package/dist/components/ClientTrustMatchViewer.d.ts +11 -0
- package/dist/components/ClientTrustMatchViewer.d.ts.map +1 -0
- package/dist/components/ClientTrustMatchViewer.js +53 -0
- package/dist/components/ClientTrustMatchViewer.js.map +1 -0
- package/dist/components/ContextGalleryDisplay.d.ts +4 -0
- package/dist/components/ContextGalleryDisplay.d.ts.map +1 -0
- package/dist/components/ContextGalleryDisplay.js +49 -0
- package/dist/components/ContextGalleryDisplay.js.map +1 -0
- package/dist/components/GalleryDisplay.d.ts +2 -0
- package/dist/components/GalleryDisplay.d.ts.map +1 -0
- package/dist/components/GalleryDisplay.js +42 -0
- package/dist/components/GalleryDisplay.js.map +1 -0
- package/dist/components/GalleryPlayground.d.ts +14 -0
- package/dist/components/GalleryPlayground.d.ts.map +1 -0
- package/dist/components/GalleryPlayground.js +36 -0
- package/dist/components/GalleryPlayground.js.map +1 -0
- package/dist/components/GalleryViewer.d.ts +48 -0
- package/dist/components/GalleryViewer.d.ts.map +1 -0
- package/dist/components/GalleryViewer.js +567 -0
- package/dist/components/GalleryViewer.js.map +1 -0
- package/dist/components/GameDesigner.d.ts +5 -0
- package/dist/components/GameDesigner.d.ts.map +1 -0
- package/dist/components/GameDesigner.js +14 -0
- package/dist/components/GameDesigner.js.map +1 -0
- package/dist/components/GameDialog.d.ts +7 -0
- package/dist/components/GameDialog.d.ts.map +1 -0
- package/dist/components/GameDialog.js +24 -0
- package/dist/components/GameDialog.js.map +1 -0
- package/dist/components/GameModalBackdrop.d.ts +10 -0
- package/dist/components/GameModalBackdrop.d.ts.map +1 -0
- package/dist/components/GameModalBackdrop.js +33 -0
- package/dist/components/GameModalBackdrop.js.map +1 -0
- package/dist/components/GameModalDialog.d.ts +11 -0
- package/dist/components/GameModalDialog.d.ts.map +1 -0
- package/dist/components/GameModalDialog.js +42 -0
- package/dist/components/GameModalDialog.js.map +1 -0
- package/dist/components/LiveButton.d.ts +4 -0
- package/dist/components/LiveButton.d.ts.map +1 -0
- package/dist/components/LiveButton.js +17 -0
- package/dist/components/LiveButton.js.map +1 -0
- package/dist/components/MatchEndDisplay.d.ts +2 -0
- package/dist/components/MatchEndDisplay.d.ts.map +1 -0
- package/dist/components/MatchEndDisplay.js +67 -0
- package/dist/components/MatchEndDisplay.js.map +1 -0
- package/dist/components/MatchViewer.d.ts +5 -0
- package/dist/components/MatchViewer.d.ts.map +1 -0
- package/dist/components/MatchViewer.js +59 -0
- package/dist/components/MatchViewer.js.map +1 -0
- package/dist/components/ObjectWithPropsEditor.d.ts +5 -0
- package/dist/components/ObjectWithPropsEditor.d.ts.map +1 -0
- package/dist/components/ObjectWithPropsEditor.js +88 -0
- package/dist/components/ObjectWithPropsEditor.js.map +1 -0
- package/dist/components/Panel/MultiPanel.d.ts +13 -0
- package/dist/components/Panel/MultiPanel.d.ts.map +1 -0
- package/dist/components/Panel/MultiPanel.js +196 -0
- package/dist/components/Panel/MultiPanel.js.map +1 -0
- package/dist/components/Panel/PanelContents.d.ts +27 -0
- package/dist/components/Panel/PanelContents.d.ts.map +1 -0
- package/dist/components/Panel/PanelContents.js +202 -0
- package/dist/components/Panel/PanelContents.js.map +1 -0
- package/dist/components/Panel/PanelTabStack.d.ts +9 -0
- package/dist/components/Panel/PanelTabStack.d.ts.map +1 -0
- package/dist/components/Panel/PanelTabStack.js +56 -0
- package/dist/components/Panel/PanelTabStack.js.map +1 -0
- package/dist/components/Panel/SinglePanel.d.ts +13 -0
- package/dist/components/Panel/SinglePanel.d.ts.map +1 -0
- package/dist/components/Panel/SinglePanel.js +44 -0
- package/dist/components/Panel/SinglePanel.js.map +1 -0
- package/dist/components/Panel/ViewerWrapper.d.ts +17 -0
- package/dist/components/Panel/ViewerWrapper.d.ts.map +1 -0
- package/dist/components/Panel/ViewerWrapper.js +70 -0
- package/dist/components/Panel/ViewerWrapper.js.map +1 -0
- package/dist/components/Panel/ViewerZoomControls.d.ts +8 -0
- package/dist/components/Panel/ViewerZoomControls.d.ts.map +1 -0
- package/dist/components/Panel/ViewerZoomControls.js +152 -0
- package/dist/components/Panel/ViewerZoomControls.js.map +1 -0
- package/dist/components/Panel/util.d.ts +3 -0
- package/dist/components/Panel/util.d.ts.map +1 -0
- package/dist/components/Panel/util.js +5 -0
- package/dist/components/Panel/util.js.map +1 -0
- package/dist/components/PanelSpark.d.ts +7 -0
- package/dist/components/PanelSpark.d.ts.map +1 -0
- package/dist/components/PanelSpark.js +84 -0
- package/dist/components/PanelSpark.js.map +1 -0
- package/dist/components/PersistentCanvas.d.ts +12 -0
- package/dist/components/PersistentCanvas.d.ts.map +1 -0
- package/dist/components/PersistentCanvas.js +44 -0
- package/dist/components/PersistentCanvas.js.map +1 -0
- package/dist/components/PlayerImage.d.ts +9 -0
- package/dist/components/PlayerImage.d.ts.map +1 -0
- package/dist/components/PlayerImage.js +21 -0
- package/dist/components/PlayerImage.js.map +1 -0
- package/dist/components/Playground.d.ts +9 -0
- package/dist/components/Playground.d.ts.map +1 -0
- package/dist/components/Playground.js +129 -0
- package/dist/components/Playground.js.map +1 -0
- package/dist/components/PromptControls.d.ts +4 -0
- package/dist/components/PromptControls.d.ts.map +1 -0
- package/dist/components/PromptControls.js +87 -0
- package/dist/components/PromptControls.js.map +1 -0
- package/dist/components/SelectableItemAndStage.d.ts +8 -0
- package/dist/components/SelectableItemAndStage.d.ts.map +1 -0
- package/dist/components/SelectableItemAndStage.js +16 -0
- package/dist/components/SelectableItemAndStage.js.map +1 -0
- package/dist/components/SettingsDisplay.d.ts +2 -0
- package/dist/components/SettingsDisplay.d.ts.map +1 -0
- package/dist/components/SettingsDisplay.js +62 -0
- package/dist/components/SettingsDisplay.js.map +1 -0
- package/dist/components/SparkLineChart.d.ts +21 -0
- package/dist/components/SparkLineChart.d.ts.map +1 -0
- package/dist/components/SparkLineChart.js +143 -0
- package/dist/components/SparkLineChart.js.map +1 -0
- package/dist/components/StageAndEditor.d.ts +5 -0
- package/dist/components/StageAndEditor.d.ts.map +1 -0
- package/dist/components/StageAndEditor.js +12 -0
- package/dist/components/StageAndEditor.js.map +1 -0
- package/dist/components/TimeControlBar.d.ts +5 -0
- package/dist/components/TimeControlBar.d.ts.map +1 -0
- package/dist/components/TimeControlBar.js +38 -0
- package/dist/components/TimeControlBar.js.map +1 -0
- package/dist/components/TokenizedMessage.d.ts +13 -0
- package/dist/components/TokenizedMessage.d.ts.map +1 -0
- package/dist/components/TokenizedMessage.js +102 -0
- package/dist/components/TokenizedMessage.js.map +1 -0
- package/dist/components/TopBar.d.ts +4 -0
- package/dist/components/TopBar.d.ts.map +1 -0
- package/dist/components/TopBar.js +47 -0
- package/dist/components/TopBar.js.map +1 -0
- package/dist/components/TopBarDropdown.d.ts +6 -0
- package/dist/components/TopBarDropdown.d.ts.map +1 -0
- package/dist/components/TopBarDropdown.js +69 -0
- package/dist/components/TopBarDropdown.js.map +1 -0
- package/dist/components/TopBarPlayers.d.ts +2 -0
- package/dist/components/TopBarPlayers.d.ts.map +1 -0
- package/dist/components/TopBarPlayers.js +70 -0
- package/dist/components/TopBarPlayers.js.map +1 -0
- package/dist/components/UpdatingCanvasImage.d.ts +7 -0
- package/dist/components/UpdatingCanvasImage.d.ts.map +1 -0
- package/dist/components/UpdatingCanvasImage.js +22 -0
- package/dist/components/UpdatingCanvasImage.js.map +1 -0
- package/dist/components/UpdatingCanvasViewer.d.ts +7 -0
- package/dist/components/UpdatingCanvasViewer.d.ts.map +1 -0
- package/dist/components/UpdatingCanvasViewer.js +50 -0
- package/dist/components/UpdatingCanvasViewer.js.map +1 -0
- package/dist/components/Viewer.d.ts +16 -0
- package/dist/components/Viewer.d.ts.map +1 -0
- package/dist/components/Viewer.js +289 -0
- package/dist/components/Viewer.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -0
- package/dist/e085acb5e467d8e85d21.woff +0 -0
- package/dist/e65dff62134b8879e792.woff +0 -0
- package/dist/game/Chit.d.ts +64 -0
- package/dist/game/Chit.d.ts.map +1 -0
- package/dist/game/Chit.js +524 -0
- package/dist/game/Chit.js.map +1 -0
- package/dist/game/ClientTimeState.d.ts +16 -0
- package/dist/game/ClientTimeState.d.ts.map +1 -0
- package/dist/game/ClientTimeState.js +38 -0
- package/dist/game/ClientTimeState.js.map +1 -0
- package/dist/game/ClockDetails.d.ts +9 -0
- package/dist/game/ClockDetails.d.ts.map +1 -0
- package/dist/game/ClockDetails.js +19 -0
- package/dist/game/ClockDetails.js.map +1 -0
- package/dist/game/Connection.d.ts +26 -0
- package/dist/game/Connection.d.ts.map +1 -0
- package/dist/game/Connection.js +99 -0
- package/dist/game/Connection.js.map +1 -0
- package/dist/game/ConnectionObject.d.ts +7 -0
- package/dist/game/ConnectionObject.d.ts.map +1 -0
- package/dist/game/ConnectionObject.js +16 -0
- package/dist/game/ConnectionObject.js.map +1 -0
- package/dist/game/ConnectionTransport.d.ts +17 -0
- package/dist/game/ConnectionTransport.d.ts.map +1 -0
- package/dist/game/ConnectionTransport.js +39 -0
- package/dist/game/ConnectionTransport.js.map +1 -0
- package/dist/game/DropdownChit.d.ts +7 -0
- package/dist/game/DropdownChit.d.ts.map +1 -0
- package/dist/game/DropdownChit.js +29 -0
- package/dist/game/DropdownChit.js.map +1 -0
- package/dist/game/GalleryItemChitChildrenSource.d.ts +12 -0
- package/dist/game/GalleryItemChitChildrenSource.d.ts.map +1 -0
- package/dist/game/GalleryItemChitChildrenSource.js +25 -0
- package/dist/game/GalleryItemChitChildrenSource.js.map +1 -0
- package/dist/game/GalleryItemRawSource.d.ts +9 -0
- package/dist/game/GalleryItemRawSource.d.ts.map +1 -0
- package/dist/game/GalleryItemRawSource.js +13 -0
- package/dist/game/GalleryItemRawSource.js.map +1 -0
- package/dist/game/Game.d.ts +51 -0
- package/dist/game/Game.d.ts.map +1 -0
- package/dist/game/Game.js +2 -0
- package/dist/game/Game.js.map +1 -0
- package/dist/game/GameBagChit.d.ts +16 -0
- package/dist/game/GameBagChit.d.ts.map +1 -0
- package/dist/game/GameBagChit.js +51 -0
- package/dist/game/GameBagChit.js.map +1 -0
- package/dist/game/GameButton.d.ts +30 -0
- package/dist/game/GameButton.d.ts.map +1 -0
- package/dist/game/GameButton.js +115 -0
- package/dist/game/GameButton.js.map +1 -0
- package/dist/game/GameDeckChit.d.ts +23 -0
- package/dist/game/GameDeckChit.d.ts.map +1 -0
- package/dist/game/GameDeckChit.js +79 -0
- package/dist/game/GameDeckChit.js.map +1 -0
- package/dist/game/GameTheme.d.ts +75 -0
- package/dist/game/GameTheme.d.ts.map +1 -0
- package/dist/game/GameTheme.js +103 -0
- package/dist/game/GameTheme.js.map +1 -0
- package/dist/game/Match.d.ts +34 -0
- package/dist/game/Match.d.ts.map +1 -0
- package/dist/game/Match.js +151 -0
- package/dist/game/Match.js.map +1 -0
- package/dist/game/MatchConnection.d.ts +8 -0
- package/dist/game/MatchConnection.d.ts.map +1 -0
- package/dist/game/MatchConnection.js +6 -0
- package/dist/game/MatchConnection.js.map +1 -0
- package/dist/game/MatchStorage.d.ts +17 -0
- package/dist/game/MatchStorage.d.ts.map +1 -0
- package/dist/game/MatchStorage.js +32 -0
- package/dist/game/MatchStorage.js.map +1 -0
- package/dist/game/ModalState.d.ts +9 -0
- package/dist/game/ModalState.d.ts.map +1 -0
- package/dist/game/ModalState.js +27 -0
- package/dist/game/ModalState.js.map +1 -0
- package/dist/game/OrderedOutlet.d.ts +50 -0
- package/dist/game/OrderedOutlet.d.ts.map +1 -0
- package/dist/game/OrderedOutlet.js +164 -0
- package/dist/game/OrderedOutlet.js.map +1 -0
- package/dist/game/Pick.d.ts +26 -0
- package/dist/game/Pick.d.ts.map +1 -0
- package/dist/game/Pick.js +239 -0
- package/dist/game/Pick.js.map +1 -0
- package/dist/game/PlayerChit.d.ts +16 -0
- package/dist/game/PlayerChit.d.ts.map +1 -0
- package/dist/game/PlayerChit.js +56 -0
- package/dist/game/PlayerChit.js.map +1 -0
- package/dist/game/PlayerInfo.d.ts +12 -0
- package/dist/game/PlayerInfo.d.ts.map +1 -0
- package/dist/game/PlayerInfo.js +20 -0
- package/dist/game/PlayerInfo.js.map +1 -0
- package/dist/game/PlayerPromptStatusChit.d.ts +5 -0
- package/dist/game/PlayerPromptStatusChit.d.ts.map +1 -0
- package/dist/game/PlayerPromptStatusChit.js +35 -0
- package/dist/game/PlayerPromptStatusChit.js.map +1 -0
- package/dist/game/Prompt.d.ts +94 -0
- package/dist/game/Prompt.d.ts.map +1 -0
- package/dist/game/Prompt.js +229 -0
- package/dist/game/Prompt.js.map +1 -0
- package/dist/game/RootChit.d.ts +15 -0
- package/dist/game/RootChit.d.ts.map +1 -0
- package/dist/game/RootChit.js +62 -0
- package/dist/game/RootChit.js.map +1 -0
- package/dist/game/SparkChit.d.ts +27 -0
- package/dist/game/SparkChit.d.ts.map +1 -0
- package/dist/game/SparkChit.js +97 -0
- package/dist/game/SparkChit.js.map +1 -0
- package/dist/game/StaticChitTypeRegistry.d.ts +5 -0
- package/dist/game/StaticChitTypeRegistry.d.ts.map +1 -0
- package/dist/game/StaticChitTypeRegistry.js +3 -0
- package/dist/game/StaticChitTypeRegistry.js.map +1 -0
- package/dist/game/Turn.d.ts +169 -0
- package/dist/game/Turn.d.ts.map +1 -0
- package/dist/game/Turn.js +1031 -0
- package/dist/game/Turn.js.map +1 -0
- package/dist/game/TurnState.d.ts +30 -0
- package/dist/game/TurnState.d.ts.map +1 -0
- package/dist/game/TurnState.js +170 -0
- package/dist/game/TurnState.js.map +1 -0
- package/dist/game/clientTransport/ClientPrompts.d.ts +23 -0
- package/dist/game/clientTransport/ClientPrompts.d.ts.map +1 -0
- package/dist/game/clientTransport/ClientPrompts.js +85 -0
- package/dist/game/clientTransport/ClientPrompts.js.map +1 -0
- package/dist/game/clientTransport/ClientStatus.d.ts +19 -0
- package/dist/game/clientTransport/ClientStatus.d.ts.map +1 -0
- package/dist/game/clientTransport/ClientStatus.js +25 -0
- package/dist/game/clientTransport/ClientStatus.js.map +1 -0
- package/dist/game/clientTransport/ClientTime.d.ts +42 -0
- package/dist/game/clientTransport/ClientTime.d.ts.map +1 -0
- package/dist/game/clientTransport/ClientTime.js +197 -0
- package/dist/game/clientTransport/ClientTime.js.map +1 -0
- package/dist/game/index.d.ts +1 -0
- package/dist/game/index.d.ts.map +1 -0
- package/dist/game/index.js +2 -0
- package/dist/game/index.js.map +1 -0
- package/dist/game/serverTransport/ServerPrompts.d.ts +17 -0
- package/dist/game/serverTransport/ServerPrompts.d.ts.map +1 -0
- package/dist/game/serverTransport/ServerPrompts.js +51 -0
- package/dist/game/serverTransport/ServerPrompts.js.map +1 -0
- package/dist/game/serverTransport/ServerStatus.d.ts +12 -0
- package/dist/game/serverTransport/ServerStatus.d.ts.map +1 -0
- package/dist/game/serverTransport/ServerStatus.js +16 -0
- package/dist/game/serverTransport/ServerStatus.js.map +1 -0
- package/dist/game/serverTransport/ServerTime.d.ts +39 -0
- package/dist/game/serverTransport/ServerTime.d.ts.map +1 -0
- package/dist/game/serverTransport/ServerTime.js +57 -0
- package/dist/game/serverTransport/ServerTime.js.map +1 -0
- package/dist/hooks/useChits.d.ts +4 -0
- package/dist/hooks/useChits.d.ts.map +1 -0
- package/dist/hooks/useChits.js +24 -0
- package/dist/hooks/useChits.js.map +1 -0
- package/dist/hooks/useConnection.d.ts +8 -0
- package/dist/hooks/useConnection.d.ts.map +1 -0
- package/dist/hooks/useConnection.js +14 -0
- package/dist/hooks/useConnection.js.map +1 -0
- package/dist/hooks/useEventChannelState.d.ts +4 -0
- package/dist/hooks/useEventChannelState.d.ts.map +1 -0
- package/dist/hooks/useEventChannelState.js +25 -0
- package/dist/hooks/useEventChannelState.js.map +1 -0
- package/dist/hooks/useGame.d.ts +8 -0
- package/dist/hooks/useGame.d.ts.map +1 -0
- package/dist/hooks/useGame.js +14 -0
- package/dist/hooks/useGame.js.map +1 -0
- package/dist/hooks/useGameTheme.d.ts +8 -0
- package/dist/hooks/useGameTheme.d.ts.map +1 -0
- package/dist/hooks/useGameTheme.js +11 -0
- package/dist/hooks/useGameTheme.js.map +1 -0
- package/dist/hooks/useModalState.d.ts +7 -0
- package/dist/hooks/useModalState.d.ts.map +1 -0
- package/dist/hooks/useModalState.js +12 -0
- package/dist/hooks/useModalState.js.map +1 -0
- package/dist/hooks/usePanelPositioning.d.ts +22 -0
- package/dist/hooks/usePanelPositioning.d.ts.map +1 -0
- package/dist/hooks/usePanelPositioning.js +10 -0
- package/dist/hooks/usePanelPositioning.js.map +1 -0
- package/dist/hooks/usePanelScale.d.ts +7 -0
- package/dist/hooks/usePanelScale.d.ts.map +1 -0
- package/dist/hooks/usePanelScale.js +22 -0
- package/dist/hooks/usePanelScale.js.map +1 -0
- package/dist/hooks/usePanelStates.d.ts +9 -0
- package/dist/hooks/usePanelStates.d.ts.map +1 -0
- package/dist/hooks/usePanelStates.js +19 -0
- package/dist/hooks/usePanelStates.js.map +1 -0
- package/dist/hooks/usePlayer.d.ts +7 -0
- package/dist/hooks/usePlayer.d.ts.map +1 -0
- package/dist/hooks/usePlayer.js +14 -0
- package/dist/hooks/usePlayer.js.map +1 -0
- package/dist/hooks/useSmartDebouncedState.d.ts +27 -0
- package/dist/hooks/useSmartDebouncedState.d.ts.map +1 -0
- package/dist/hooks/useSmartDebouncedState.js +109 -0
- package/dist/hooks/useSmartDebouncedState.js.map +1 -0
- package/dist/hooks/useTimeController.d.ts +22 -0
- package/dist/hooks/useTimeController.d.ts.map +1 -0
- package/dist/hooks/useTimeController.js +89 -0
- package/dist/hooks/useTimeController.js.map +1 -0
- package/dist/hooks/useTokenMap.d.ts +5 -0
- package/dist/hooks/useTokenMap.d.ts.map +1 -0
- package/dist/hooks/useTokenMap.js +16 -0
- package/dist/hooks/useTokenMap.js.map +1 -0
- package/dist/hooks/useWebGlRenderer.d.ts +34 -0
- package/dist/hooks/useWebGlRenderer.d.ts.map +1 -0
- package/dist/hooks/useWebGlRenderer.js +167 -0
- package/dist/hooks/useWebGlRenderer.js.map +1 -0
- package/dist/index.d.ts +97 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.html +12 -0
- package/dist/index.js +62 -0
- package/dist/index.js.map +1 -0
- package/dist/pretty-chitty.js +190767 -0
- package/dist/pretty-chitty.js.map +1 -0
- package/dist/rendering/CameraSpec.d.ts +22 -0
- package/dist/rendering/CameraSpec.d.ts.map +1 -0
- package/dist/rendering/CameraSpec.js +25 -0
- package/dist/rendering/CameraSpec.js.map +1 -0
- package/dist/rendering/CameraWrapperPerspective.d.ts +44 -0
- package/dist/rendering/CameraWrapperPerspective.d.ts.map +1 -0
- package/dist/rendering/CameraWrapperPerspective.js +481 -0
- package/dist/rendering/CameraWrapperPerspective.js.map +1 -0
- package/dist/rendering/ChitGalleryItemInstance.d.ts +31 -0
- package/dist/rendering/ChitGalleryItemInstance.d.ts.map +1 -0
- package/dist/rendering/ChitGalleryItemInstance.js +75 -0
- package/dist/rendering/ChitGalleryItemInstance.js.map +1 -0
- package/dist/rendering/ChitRenderInstance.d.ts +104 -0
- package/dist/rendering/ChitRenderInstance.d.ts.map +1 -0
- package/dist/rendering/ChitRenderInstance.js +902 -0
- package/dist/rendering/ChitRenderInstance.js.map +1 -0
- package/dist/rendering/ChitRenderSpec.d.ts +80 -0
- package/dist/rendering/ChitRenderSpec.d.ts.map +1 -0
- package/dist/rendering/ChitRenderSpec.js +152 -0
- package/dist/rendering/ChitRenderSpec.js.map +1 -0
- package/dist/rendering/HighlightSpec.d.ts +6 -0
- package/dist/rendering/HighlightSpec.d.ts.map +1 -0
- package/dist/rendering/HighlightSpec.js +6 -0
- package/dist/rendering/HighlightSpec.js.map +1 -0
- package/dist/rendering/LightSpec.d.ts +17 -0
- package/dist/rendering/LightSpec.d.ts.map +1 -0
- package/dist/rendering/LightSpec.js +37 -0
- package/dist/rendering/LightSpec.js.map +1 -0
- package/dist/rendering/LightWrapper.d.ts +19 -0
- package/dist/rendering/LightWrapper.d.ts.map +1 -0
- package/dist/rendering/LightWrapper.js +114 -0
- package/dist/rendering/LightWrapper.js.map +1 -0
- package/dist/rendering/RootChitRenderInstance.d.ts +81 -0
- package/dist/rendering/RootChitRenderInstance.d.ts.map +1 -0
- package/dist/rendering/RootChitRenderInstance.js +372 -0
- package/dist/rendering/RootChitRenderInstance.js.map +1 -0
- package/dist/rendering/Splay.d.ts +23 -0
- package/dist/rendering/Splay.d.ts.map +1 -0
- package/dist/rendering/Splay.js +89 -0
- package/dist/rendering/Splay.js.map +1 -0
- package/dist/rendering/SplayCounter.d.ts +19 -0
- package/dist/rendering/SplayCounter.d.ts.map +1 -0
- package/dist/rendering/SplayCounter.js +18 -0
- package/dist/rendering/SplayCounter.js.map +1 -0
- package/dist/rendering/TextureReferenceCounter.d.ts +12 -0
- package/dist/rendering/TextureReferenceCounter.d.ts.map +1 -0
- package/dist/rendering/TextureReferenceCounter.js +76 -0
- package/dist/rendering/TextureReferenceCounter.js.map +1 -0
- package/dist/rendering/index.d.ts +1 -0
- package/dist/rendering/index.d.ts.map +1 -0
- package/dist/rendering/index.js +2 -0
- package/dist/rendering/index.js.map +1 -0
- package/dist/rendering/outline/DepthVisualizationPass.d.ts +12 -0
- package/dist/rendering/outline/DepthVisualizationPass.d.ts.map +1 -0
- package/dist/rendering/outline/DepthVisualizationPass.js +93 -0
- package/dist/rendering/outline/DepthVisualizationPass.js.map +1 -0
- package/dist/rendering/outline/EffectComposer.d.ts +24 -0
- package/dist/rendering/outline/EffectComposer.d.ts.map +1 -0
- package/dist/rendering/outline/EffectComposer.js +118 -0
- package/dist/rendering/outline/EffectComposer.js.map +1 -0
- package/dist/rendering/outline/FullScreenQuad.d.ts +12 -0
- package/dist/rendering/outline/FullScreenQuad.d.ts.map +1 -0
- package/dist/rendering/outline/FullScreenQuad.js +21 -0
- package/dist/rendering/outline/FullScreenQuad.js.map +1 -0
- package/dist/rendering/outline/IDBasedOutlinePass.d.ts +49 -0
- package/dist/rendering/outline/IDBasedOutlinePass.d.ts.map +1 -0
- package/dist/rendering/outline/IDBasedOutlinePass.js +597 -0
- package/dist/rendering/outline/IDBasedOutlinePass.js.map +1 -0
- package/dist/rendering/outline/OutputPass.d.ts +13 -0
- package/dist/rendering/outline/OutputPass.d.ts.map +1 -0
- package/dist/rendering/outline/OutputPass.js +57 -0
- package/dist/rendering/outline/OutputPass.js.map +1 -0
- package/dist/rendering/outline/RenderPass.d.ts +13 -0
- package/dist/rendering/outline/RenderPass.d.ts.map +1 -0
- package/dist/rendering/outline/RenderPass.js +54 -0
- package/dist/rendering/outline/RenderPass.js.map +1 -0
- package/dist/rendering/outline/SceneWrapper.d.ts +39 -0
- package/dist/rendering/outline/SceneWrapper.d.ts.map +1 -0
- package/dist/rendering/outline/SceneWrapper.js +522 -0
- package/dist/rendering/outline/SceneWrapper.js.map +1 -0
- package/dist/rendering/outline/ShaderPass.d.ts +12 -0
- package/dist/rendering/outline/ShaderPass.d.ts.map +1 -0
- package/dist/rendering/outline/ShaderPass.js +43 -0
- package/dist/rendering/outline/ShaderPass.js.map +1 -0
- package/dist/rendering/outline/index.d.ts +8 -0
- package/dist/rendering/outline/index.d.ts.map +1 -0
- package/dist/rendering/outline/index.js +8 -0
- package/dist/rendering/outline/index.js.map +1 -0
- package/dist/rendering/outline/passes/DebugIDMappingPass.d.ts +20 -0
- package/dist/rendering/outline/passes/DebugIDMappingPass.d.ts.map +1 -0
- package/dist/rendering/outline/passes/DebugIDMappingPass.js +131 -0
- package/dist/rendering/outline/passes/DebugIDMappingPass.js.map +1 -0
- package/dist/rendering/outline/passes/DepthOcclusionPass.d.ts +24 -0
- package/dist/rendering/outline/passes/DepthOcclusionPass.d.ts.map +1 -0
- package/dist/rendering/outline/passes/DepthOcclusionPass.js +95 -0
- package/dist/rendering/outline/passes/DepthOcclusionPass.js.map +1 -0
- package/dist/rendering/outline/passes/InterMeshEdgeDetectionPass.d.ts +32 -0
- package/dist/rendering/outline/passes/InterMeshEdgeDetectionPass.d.ts.map +1 -0
- package/dist/rendering/outline/passes/InterMeshEdgeDetectionPass.js +208 -0
- package/dist/rendering/outline/passes/InterMeshEdgeDetectionPass.js.map +1 -0
- package/dist/rendering/outline/shaders.d.ts +20 -0
- package/dist/rendering/outline/shaders.d.ts.map +1 -0
- package/dist/rendering/outline/shaders.js +103 -0
- package/dist/rendering/outline/shaders.js.map +1 -0
- package/dist/rendering/outline/types.d.ts +14 -0
- package/dist/rendering/outline/types.d.ts.map +1 -0
- package/dist/rendering/outline/types.js +16 -0
- package/dist/rendering/outline/types.js.map +1 -0
- package/dist/utilities/Annotations.d.ts +60 -0
- package/dist/utilities/Annotations.d.ts.map +1 -0
- package/dist/utilities/Annotations.js +171 -0
- package/dist/utilities/Annotations.js.map +1 -0
- package/dist/utilities/BaseTable.d.ts +8 -0
- package/dist/utilities/BaseTable.d.ts.map +1 -0
- package/dist/utilities/BaseTable.js +35 -0
- package/dist/utilities/BaseTable.js.map +1 -0
- package/dist/utilities/BboxUtils.d.ts +3 -0
- package/dist/utilities/BboxUtils.d.ts.map +1 -0
- package/dist/utilities/BboxUtils.js +19 -0
- package/dist/utilities/BboxUtils.js.map +1 -0
- package/dist/utilities/CanvasStack/CanvasOperations.d.ts +140 -0
- package/dist/utilities/CanvasStack/CanvasOperations.d.ts.map +1 -0
- package/dist/utilities/CanvasStack/CanvasOperations.js +403 -0
- package/dist/utilities/CanvasStack/CanvasOperations.js.map +1 -0
- package/dist/utilities/CanvasStack/CanvasStack.d.ts +42 -0
- package/dist/utilities/CanvasStack/CanvasStack.d.ts.map +1 -0
- package/dist/utilities/CanvasStack/CanvasStack.js +128 -0
- package/dist/utilities/CanvasStack/CanvasStack.js.map +1 -0
- package/dist/utilities/CanvasStack/IconCanvas.d.ts +10 -0
- package/dist/utilities/CanvasStack/IconCanvas.d.ts.map +1 -0
- package/dist/utilities/CanvasStack/IconCanvas.js +15 -0
- package/dist/utilities/CanvasStack/IconCanvas.js.map +1 -0
- package/dist/utilities/CanvasStack/ImageCache.d.ts +8 -0
- package/dist/utilities/CanvasStack/ImageCache.d.ts.map +1 -0
- package/dist/utilities/CanvasStack/ImageCache.js +29 -0
- package/dist/utilities/CanvasStack/ImageCache.js.map +1 -0
- package/dist/utilities/CanvasStack/ImageColorOverlayer.d.ts +2 -0
- package/dist/utilities/CanvasStack/ImageColorOverlayer.d.ts.map +1 -0
- package/dist/utilities/CanvasStack/ImageColorOverlayer.js +31 -0
- package/dist/utilities/CanvasStack/ImageColorOverlayer.js.map +1 -0
- package/dist/utilities/CanvasStack/PlayerCanvas.d.ts +10 -0
- package/dist/utilities/CanvasStack/PlayerCanvas.d.ts.map +1 -0
- package/dist/utilities/CanvasStack/PlayerCanvas.js +15 -0
- package/dist/utilities/CanvasStack/PlayerCanvas.js.map +1 -0
- package/dist/utilities/CanvasStack/ReactCanvas.d.ts +133 -0
- package/dist/utilities/CanvasStack/ReactCanvas.d.ts.map +1 -0
- package/dist/utilities/CanvasStack/ReactCanvas.js +161 -0
- package/dist/utilities/CanvasStack/ReactCanvas.js.map +1 -0
- package/dist/utilities/CanvasStack/RichTextRenderer.d.ts +63 -0
- package/dist/utilities/CanvasStack/RichTextRenderer.d.ts.map +1 -0
- package/dist/utilities/CanvasStack/RichTextRenderer.js +523 -0
- package/dist/utilities/CanvasStack/RichTextRenderer.js.map +1 -0
- package/dist/utilities/CardMesh.d.ts +17 -0
- package/dist/utilities/CardMesh.d.ts.map +1 -0
- package/dist/utilities/CardMesh.js +44 -0
- package/dist/utilities/CardMesh.js.map +1 -0
- package/dist/utilities/Dice.d.ts +24 -0
- package/dist/utilities/Dice.d.ts.map +1 -0
- package/dist/utilities/Dice.js +148 -0
- package/dist/utilities/Dice.js.map +1 -0
- package/dist/utilities/EventChannel.d.ts +13 -0
- package/dist/utilities/EventChannel.d.ts.map +1 -0
- package/dist/utilities/EventChannel.js +47 -0
- package/dist/utilities/EventChannel.js.map +1 -0
- package/dist/utilities/GalleryItemConversion.d.ts +4 -0
- package/dist/utilities/GalleryItemConversion.d.ts.map +1 -0
- package/dist/utilities/GalleryItemConversion.js +28 -0
- package/dist/utilities/GalleryItemConversion.js.map +1 -0
- package/dist/utilities/IUpdatingCanvas.d.ts +19 -0
- package/dist/utilities/IUpdatingCanvas.d.ts.map +1 -0
- package/dist/utilities/IUpdatingCanvas.js +2 -0
- package/dist/utilities/IUpdatingCanvas.js.map +1 -0
- package/dist/utilities/LayoutHelper.d.ts +34 -0
- package/dist/utilities/LayoutHelper.d.ts.map +1 -0
- package/dist/utilities/LayoutHelper.js +451 -0
- package/dist/utilities/LayoutHelper.js.map +1 -0
- package/dist/utilities/ObjectWithProps.d.ts +5 -0
- package/dist/utilities/ObjectWithProps.d.ts.map +1 -0
- package/dist/utilities/ObjectWithProps.js +65 -0
- package/dist/utilities/ObjectWithProps.js.map +1 -0
- package/dist/utilities/OutlineCanvas.d.ts +12 -0
- package/dist/utilities/OutlineCanvas.d.ts.map +1 -0
- package/dist/utilities/OutlineCanvas.js +31 -0
- package/dist/utilities/OutlineCanvas.js.map +1 -0
- package/dist/utilities/OutlineGeometry.d.ts +3 -0
- package/dist/utilities/OutlineGeometry.d.ts.map +1 -0
- package/dist/utilities/OutlineGeometry.js +57 -0
- package/dist/utilities/OutlineGeometry.js.map +1 -0
- package/dist/utilities/ParameterizedCanvas.d.ts +13 -0
- package/dist/utilities/ParameterizedCanvas.d.ts.map +1 -0
- package/dist/utilities/ParameterizedCanvas.js +85 -0
- package/dist/utilities/ParameterizedCanvas.js.map +1 -0
- package/dist/utilities/RequestSharedAnimationFrame.d.ts +2 -0
- package/dist/utilities/RequestSharedAnimationFrame.d.ts.map +1 -0
- package/dist/utilities/RequestSharedAnimationFrame.js +16 -0
- package/dist/utilities/RequestSharedAnimationFrame.js.map +1 -0
- package/dist/utilities/StaticImage.d.ts +19 -0
- package/dist/utilities/StaticImage.d.ts.map +1 -0
- package/dist/utilities/StaticImage.js +38 -0
- package/dist/utilities/StaticImage.js.map +1 -0
- package/dist/utilities/SvgExtruder.d.ts +20 -0
- package/dist/utilities/SvgExtruder.d.ts.map +1 -0
- package/dist/utilities/SvgExtruder.js +238 -0
- package/dist/utilities/SvgExtruder.js.map +1 -0
- package/dist/utilities/ThreeDisposer.d.ts +11 -0
- package/dist/utilities/ThreeDisposer.d.ts.map +1 -0
- package/dist/utilities/ThreeDisposer.js +53 -0
- package/dist/utilities/ThreeDisposer.js.map +1 -0
- package/dist/utilities/zIndex.d.ts +14 -0
- package/dist/utilities/zIndex.d.ts.map +1 -0
- package/dist/utilities/zIndex.js +14 -0
- package/dist/utilities/zIndex.js.map +1 -0
- package/package.json +138 -0
- package/src/library/assets/checker.svg +4 -0
- package/src/library/assets/cutout.svg +22 -0
- package/src/library/components/ActionLogDisplay.tsx +183 -0
- package/src/library/components/ActionLogHistory.tsx +127 -0
- package/src/library/components/ActionLogHistoryDisplay.tsx +21 -0
- package/src/library/components/ActionLogSidebar.tsx +17 -0
- package/src/library/components/BottomBar.tsx +78 -0
- package/src/library/components/BottomBarBreak.tsx +12 -0
- package/src/library/components/BottomBarButton.tsx +181 -0
- package/src/library/components/CanvasLibraryViewer.tsx +86 -0
- package/src/library/components/ChitLibraryViewer.tsx +168 -0
- package/src/library/components/ClientTrustMatchViewer.tsx +83 -0
- package/src/library/components/ContextGalleryDisplay.tsx +72 -0
- package/src/library/components/GalleryDisplay.tsx +57 -0
- package/src/library/components/GalleryPlayground.tsx +50 -0
- package/src/library/components/GalleryViewer.tsx +773 -0
- package/src/library/components/GameDesigner.tsx +39 -0
- package/src/library/components/GameDialog.tsx +43 -0
- package/src/library/components/GameModalBackdrop.tsx +47 -0
- package/src/library/components/GameModalDialog.tsx +77 -0
- package/src/library/components/LiveButton.tsx +26 -0
- package/src/library/components/MatchEndDisplay.tsx +120 -0
- package/src/library/components/MatchViewer.tsx +111 -0
- package/src/library/components/ObjectWithPropsEditor.tsx +169 -0
- package/src/library/components/Panel/MultiPanel.tsx +276 -0
- package/src/library/components/Panel/PanelContents.tsx +359 -0
- package/src/library/components/Panel/PanelTabStack.tsx +103 -0
- package/src/library/components/Panel/SinglePanel.tsx +75 -0
- package/src/library/components/Panel/ViewerWrapper.tsx +131 -0
- package/src/library/components/Panel/ViewerZoomControls.tsx +216 -0
- package/src/library/components/Panel/util.ts +7 -0
- package/src/library/components/PanelSpark.tsx +112 -0
- package/src/library/components/PersistentCanvas.tsx +81 -0
- package/src/library/components/PlayerImage.tsx +40 -0
- package/src/library/components/Playground.tsx +285 -0
- package/src/library/components/PromptControls.tsx +132 -0
- package/src/library/components/SelectableItemAndStage.tsx +49 -0
- package/src/library/components/SettingsDisplay.tsx +142 -0
- package/src/library/components/SparkLineChart.tsx +307 -0
- package/src/library/components/StageAndEditor.tsx +28 -0
- package/src/library/components/TimeControlBar.tsx +71 -0
- package/src/library/components/TokenizedMessage.tsx +206 -0
- package/src/library/components/TopBar.tsx +90 -0
- package/src/library/components/TopBarDropdown.tsx +94 -0
- package/src/library/components/TopBarPlayers.tsx +163 -0
- package/src/library/components/UpdatingCanvasImage.tsx +25 -0
- package/src/library/components/UpdatingCanvasViewer.tsx +62 -0
- package/src/library/components/Viewer.tsx +360 -0
- package/src/library/components/index.ts +0 -0
- package/src/library/game/Chit.test.ts +66 -0
- package/src/library/game/Chit.ts +575 -0
- package/src/library/game/ClientTimeState.ts +42 -0
- package/src/library/game/ClockDetails.ts +24 -0
- package/src/library/game/Connection.test.ts +50 -0
- package/src/library/game/Connection.ts +122 -0
- package/src/library/game/ConnectionObject.ts +13 -0
- package/src/library/game/ConnectionTransport.ts +52 -0
- package/src/library/game/DropdownChit.tsx +17 -0
- package/src/library/game/GalleryItemChitChildrenSource.ts +31 -0
- package/src/library/game/GalleryItemRawSource.ts +15 -0
- package/src/library/game/Game.ts +55 -0
- package/src/library/game/GameBagChit.ts +42 -0
- package/src/library/game/GameButton.ts +127 -0
- package/src/library/game/GameDeckChit.ts +77 -0
- package/src/library/game/GameTheme.ts +122 -0
- package/src/library/game/Match.ts +187 -0
- package/src/library/game/MatchConnection.ts +5 -0
- package/src/library/game/MatchStorage.ts +51 -0
- package/src/library/game/ModalState.ts +29 -0
- package/src/library/game/OrderedOutlet.ts +198 -0
- package/src/library/game/Pick.ts +314 -0
- package/src/library/game/PlayerChit.ts +43 -0
- package/src/library/game/PlayerInfo.ts +30 -0
- package/src/library/game/PlayerPromptStatusChit.ts +20 -0
- package/src/library/game/Prompt.ts +292 -0
- package/src/library/game/RootChit.ts +54 -0
- package/src/library/game/SparkChit.ts +97 -0
- package/src/library/game/StaticChitTypeRegistry.ts +3 -0
- package/src/library/game/Turn.test.ts +611 -0
- package/src/library/game/Turn.ts +1249 -0
- package/src/library/game/TurnState.ts +187 -0
- package/src/library/game/clientTransport/ClientPrompts.ts +102 -0
- package/src/library/game/clientTransport/ClientStatus.ts +36 -0
- package/src/library/game/clientTransport/ClientTime.ts +256 -0
- package/src/library/game/index.ts +0 -0
- package/src/library/game/serverTransport/ServerPrompts.ts +76 -0
- package/src/library/game/serverTransport/ServerStatus.ts +31 -0
- package/src/library/game/serverTransport/ServerTime.ts +74 -0
- package/src/library/hooks/useChits.ts +32 -0
- package/src/library/hooks/useConnection.tsx +16 -0
- package/src/library/hooks/useEventChannelState.ts +33 -0
- package/src/library/hooks/useGame.tsx +16 -0
- package/src/library/hooks/useGameTheme.tsx +12 -0
- package/src/library/hooks/useModalState.tsx +13 -0
- package/src/library/hooks/usePanelPositioning.tsx +31 -0
- package/src/library/hooks/usePanelScale.tsx +23 -0
- package/src/library/hooks/usePanelStates.ts +30 -0
- package/src/library/hooks/usePlayer.tsx +15 -0
- package/src/library/hooks/useSmartDebouncedState.ts +161 -0
- package/src/library/hooks/useTimeController.tsx +108 -0
- package/src/library/hooks/useTokenMap.ts +20 -0
- package/src/library/hooks/useWebGlRenderer.tsx +227 -0
- package/src/library/index.ts +116 -0
- package/src/library/rendering/CameraSpec.ts +25 -0
- package/src/library/rendering/CameraWrapperPerspective.ts +612 -0
- package/src/library/rendering/ChitGalleryItemInstance.ts +108 -0
- package/src/library/rendering/ChitRenderInstance.ts +1141 -0
- package/src/library/rendering/ChitRenderSpec.ts +213 -0
- package/src/library/rendering/HighlightSpec.ts +5 -0
- package/src/library/rendering/LightSpec.ts +41 -0
- package/src/library/rendering/LightWrapper.ts +152 -0
- package/src/library/rendering/RootChitRenderInstance.ts +460 -0
- package/src/library/rendering/Splay.ts +118 -0
- package/src/library/rendering/SplayCounter.tsx +37 -0
- package/src/library/rendering/TextureReferenceCounter.ts +86 -0
- package/src/library/rendering/index.ts +0 -0
- package/src/library/rendering/outline/DepthVisualizationPass.ts +117 -0
- package/src/library/rendering/outline/EffectComposer.ts +187 -0
- package/src/library/rendering/outline/FullScreenQuad.ts +32 -0
- package/src/library/rendering/outline/IDBasedOutlinePass.ts +741 -0
- package/src/library/rendering/outline/OutputPass.ts +88 -0
- package/src/library/rendering/outline/RenderPass.ts +72 -0
- package/src/library/rendering/outline/SceneWrapper.ts +617 -0
- package/src/library/rendering/outline/ShaderPass.ts +50 -0
- package/src/library/rendering/outline/index.ts +8 -0
- package/src/library/rendering/outline/passes/DebugIDMappingPass.ts +154 -0
- package/src/library/rendering/outline/passes/DepthOcclusionPass.ts +106 -0
- package/src/library/rendering/outline/passes/InterMeshEdgeDetectionPass.ts +244 -0
- package/src/library/rendering/outline/shaders.ts +110 -0
- package/src/library/rendering/outline/types.ts +25 -0
- package/src/library/utilities/Annotations.ts +188 -0
- package/src/library/utilities/BaseTable.tsx +58 -0
- package/src/library/utilities/BboxUtils.ts +23 -0
- package/src/library/utilities/CanvasStack/CanvasOperations.tsx +630 -0
- package/src/library/utilities/CanvasStack/CanvasStack.ts +191 -0
- package/src/library/utilities/CanvasStack/IconCanvas.tsx +17 -0
- package/src/library/utilities/CanvasStack/ImageCache.ts +38 -0
- package/src/library/utilities/CanvasStack/ImageColorOverlayer.ts +36 -0
- package/src/library/utilities/CanvasStack/PlayerCanvas.tsx +17 -0
- package/src/library/utilities/CanvasStack/ReactCanvas.tsx +293 -0
- package/src/library/utilities/CanvasStack/RichTextRenderer.ts +719 -0
- package/src/library/utilities/CardMesh.ts +55 -0
- package/src/library/utilities/Dice.tsx +183 -0
- package/src/library/utilities/EventChannel.ts +52 -0
- package/src/library/utilities/GalleryItemConversion.ts +30 -0
- package/src/library/utilities/IUpdatingCanvas.ts +14 -0
- package/src/library/utilities/LayoutHelper.ts +586 -0
- package/src/library/utilities/ObjectWithProps.ts +52 -0
- package/src/library/utilities/OutlineCanvas.tsx +45 -0
- package/src/library/utilities/OutlineGeometry.ts +69 -0
- package/src/library/utilities/ParameterizedCanvas.ts +78 -0
- package/src/library/utilities/RequestSharedAnimationFrame.ts +16 -0
- package/src/library/utilities/StaticImage.tsx +58 -0
- package/src/library/utilities/SvgExtruder.ts +330 -0
- package/src/library/utilities/ThreeDisposer.ts +66 -0
- package/src/library/utilities/zIndex.ts +15 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React, { useLayoutEffect, useRef, useState } from "react";
|
|
2
|
+
|
|
3
|
+
interface PersistentCanvasProps {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
displayWidth: number;
|
|
7
|
+
displayHeight: number;
|
|
8
|
+
canvasRef: React.RefObject<HTMLCanvasElement>;
|
|
9
|
+
onSnapshotCleared?: () => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default function PersistentCanvas({
|
|
13
|
+
width,
|
|
14
|
+
height,
|
|
15
|
+
displayWidth,
|
|
16
|
+
displayHeight,
|
|
17
|
+
canvasRef,
|
|
18
|
+
onSnapshotCleared,
|
|
19
|
+
}: PersistentCanvasProps) {
|
|
20
|
+
const [snapshotDataUrl, setSnapshotDataUrl] = useState<string | null>(null);
|
|
21
|
+
const prevSizeRef = useRef({ width: 0, height: 0 });
|
|
22
|
+
|
|
23
|
+
// Capture snapshot BEFORE DOM updates using useLayoutEffect
|
|
24
|
+
useLayoutEffect(() => {
|
|
25
|
+
const canvas = canvasRef.current;
|
|
26
|
+
if (canvas && (prevSizeRef.current.width !== width || prevSizeRef.current.height !== height)) {
|
|
27
|
+
// Only capture if we had a previous size (not first render)
|
|
28
|
+
if (prevSizeRef.current.width > 0 && prevSizeRef.current.height > 0) {
|
|
29
|
+
try {
|
|
30
|
+
setSnapshotDataUrl(canvas.toDataURL());
|
|
31
|
+
} catch (e) {
|
|
32
|
+
// Ignore errors from tainted canvas
|
|
33
|
+
setSnapshotDataUrl(null);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
prevSizeRef.current = { width, height };
|
|
37
|
+
}
|
|
38
|
+
}, [width, height, canvasRef]);
|
|
39
|
+
|
|
40
|
+
// Expose method to clear snapshot
|
|
41
|
+
React.useImperativeHandle(
|
|
42
|
+
canvasRef,
|
|
43
|
+
() => {
|
|
44
|
+
const canvas = canvasRef.current;
|
|
45
|
+
if (canvas) {
|
|
46
|
+
(canvas as any).clearSnapshot = () => {
|
|
47
|
+
setSnapshotDataUrl(null);
|
|
48
|
+
onSnapshotCleared?.();
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return canvas as HTMLCanvasElement;
|
|
52
|
+
},
|
|
53
|
+
[canvasRef, onSnapshotCleared]
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<div style={{ position: "absolute", top: 0, right: 0, left: 0, bottom: 0 }}>
|
|
58
|
+
{snapshotDataUrl && (
|
|
59
|
+
<img
|
|
60
|
+
src={snapshotDataUrl}
|
|
61
|
+
alt=""
|
|
62
|
+
style={{
|
|
63
|
+
position: "absolute",
|
|
64
|
+
top: 0,
|
|
65
|
+
left: 0,
|
|
66
|
+
width: "100%",
|
|
67
|
+
height: "100%",
|
|
68
|
+
objectFit: "cover",
|
|
69
|
+
imageRendering: "auto",
|
|
70
|
+
}}
|
|
71
|
+
/>
|
|
72
|
+
)}
|
|
73
|
+
<canvas
|
|
74
|
+
ref={canvasRef}
|
|
75
|
+
width={width}
|
|
76
|
+
height={height}
|
|
77
|
+
style={{ width: displayWidth, height: displayHeight }}
|
|
78
|
+
/>
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Box, SxProps } from "@mui/material";
|
|
3
|
+
import { PlayerChit } from "../game/PlayerChit";
|
|
4
|
+
import { useGameTheme } from "../hooks/useGameTheme";
|
|
5
|
+
|
|
6
|
+
export default function PlayerImage({
|
|
7
|
+
player,
|
|
8
|
+
borderColor,
|
|
9
|
+
size = 50,
|
|
10
|
+
sx,
|
|
11
|
+
}: {
|
|
12
|
+
player: PlayerChit;
|
|
13
|
+
borderColor?: string;
|
|
14
|
+
size?: number;
|
|
15
|
+
sx?: SxProps;
|
|
16
|
+
}) {
|
|
17
|
+
const theme = useGameTheme();
|
|
18
|
+
const BORDER_RATIO = player.color === "transparent" ? 0 : 1 / 12;
|
|
19
|
+
const IMAGE_SIZE = Math.ceil(size * (1 - BORDER_RATIO * 2));
|
|
20
|
+
return (
|
|
21
|
+
<Box
|
|
22
|
+
sx={{
|
|
23
|
+
background: player.color,
|
|
24
|
+
border: `${size * BORDER_RATIO}px solid ${borderColor ?? player.color}`,
|
|
25
|
+
borderRadius: 2,
|
|
26
|
+
boxShadow: `0 0 ${theme.spacing / 4}px ${theme.spacing / 4}px ${theme.topBarPlayerDropShadowColor}`,
|
|
27
|
+
overflow: "hidden",
|
|
28
|
+
position: "relative",
|
|
29
|
+
width: size,
|
|
30
|
+
height: size,
|
|
31
|
+
lineHeight: `${IMAGE_SIZE}px`,
|
|
32
|
+
...sx,
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
<Box sx={{ position: "absolute", top: 0, left: 0 }}>
|
|
36
|
+
<img src={player.imageUrl} style={{ width: IMAGE_SIZE, height: IMAGE_SIZE }} />
|
|
37
|
+
</Box>
|
|
38
|
+
</Box>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import React, { useEffect, useState, ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
import SelectableItemAndStage from "./SelectableItemAndStage";
|
|
4
|
+
import { Chit } from "../game/Chit";
|
|
5
|
+
import { Box, Button, Stack, Tabs, Tab, ToggleButton, ToggleButtonGroup } from "@mui/material";
|
|
6
|
+
import useLocalStorageState from "use-local-storage-state";
|
|
7
|
+
import { MatchViewer } from "./MatchViewer";
|
|
8
|
+
import { Game } from "../game/Game";
|
|
9
|
+
import { GameProvider } from "../hooks/useGame";
|
|
10
|
+
import { ConnectionProvider } from "../hooks/useConnection";
|
|
11
|
+
import { Connection } from "../game/Connection";
|
|
12
|
+
import { LocalConnectionTransport } from "../game/ConnectionTransport";
|
|
13
|
+
import { Match } from "../game/Match";
|
|
14
|
+
import { PlayerInfo } from "../game/PlayerInfo";
|
|
15
|
+
import { LocalMatchStorage } from "../game/MatchStorage";
|
|
16
|
+
import { GridOn, PhoneIphone, Tab as TabIcon } from "@material-ui/icons";
|
|
17
|
+
import { PlayerProvider } from "../hooks/usePlayer";
|
|
18
|
+
|
|
19
|
+
type Layout = "tile" | "tab" | "phone";
|
|
20
|
+
|
|
21
|
+
export interface IChitLibrary {
|
|
22
|
+
[key: string]: new () => Chit;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function PlayerEditor({ playerId, match, showBack }: { showBack?: boolean; playerId: string; match: Match<any, any> }) {
|
|
26
|
+
const [localConnection, setLocalConnection] = useState<Connection | undefined>();
|
|
27
|
+
const [, setRemoteConnection] = useState<LocalConnectionTransport>(new LocalConnectionTransport());
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const newRemoteConnection = new LocalConnectionTransport();
|
|
31
|
+
const newConnection = new Connection(new LocalConnectionTransport());
|
|
32
|
+
(newConnection.transport as LocalConnectionTransport).connect(newRemoteConnection);
|
|
33
|
+
match.connect(newRemoteConnection, playerId);
|
|
34
|
+
|
|
35
|
+
setLocalConnection(newConnection);
|
|
36
|
+
setRemoteConnection(newRemoteConnection);
|
|
37
|
+
return () => {
|
|
38
|
+
newConnection.dispose();
|
|
39
|
+
// TODO:
|
|
40
|
+
// match.disconnection(newRemoteConnection);
|
|
41
|
+
};
|
|
42
|
+
}, [match, playerId]);
|
|
43
|
+
|
|
44
|
+
if (!localConnection) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<ConnectionProvider connection={localConnection}>
|
|
50
|
+
<PlayerProvider playerId={playerId}>
|
|
51
|
+
<MatchViewer onBack={showBack ? () => {} : undefined} />
|
|
52
|
+
</PlayerProvider>
|
|
53
|
+
</ConnectionProvider>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function MatchGrid({ match }: { match: Match<any, any> }) {
|
|
58
|
+
let rows = Math.ceil(Math.sqrt(match.players.length));
|
|
59
|
+
let columns = Math.ceil(match.players.length / rows);
|
|
60
|
+
|
|
61
|
+
if (rows > columns) {
|
|
62
|
+
const t = rows;
|
|
63
|
+
rows = columns;
|
|
64
|
+
columns = t;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const playerRows = match.players.reduce((acc: PlayerInfo[][], player, i) => {
|
|
68
|
+
const rowIndex = Math.floor(i / columns);
|
|
69
|
+
acc[rowIndex] ??= [];
|
|
70
|
+
acc[rowIndex].push(player);
|
|
71
|
+
return acc;
|
|
72
|
+
}, []);
|
|
73
|
+
return (
|
|
74
|
+
<Stack direction={"column"} sx={{ overflow: "hidden", height: "100%", width: "100%" }}>
|
|
75
|
+
{playerRows.map((ps, i) => (
|
|
76
|
+
<Stack key={i} direction="row" sx={{ height: `${100 / playerRows.length}%`, width: "100%" }}>
|
|
77
|
+
{ps.map((p) => (
|
|
78
|
+
<Box key={p.id} sx={{ width: `${100 / ps.length}%`, height: "100%" }}>
|
|
79
|
+
<PlayerEditor playerId={p.id} match={match} />
|
|
80
|
+
</Box>
|
|
81
|
+
))}
|
|
82
|
+
</Stack>
|
|
83
|
+
))}
|
|
84
|
+
</Stack>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function MatchTabs({ match }: { match: Match<any, any> }) {
|
|
89
|
+
const [tabIndex, setTabIndex] = useLocalStorageState("selectedPlayerIndex", {
|
|
90
|
+
defaultValue: 0,
|
|
91
|
+
});
|
|
92
|
+
if (tabIndex >= match.players.length && tabIndex > 0) {
|
|
93
|
+
setTabIndex(0);
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<Stack sx={{ height: "100%", width: "100%" }}>
|
|
99
|
+
<Tabs
|
|
100
|
+
value={tabIndex}
|
|
101
|
+
onChange={(e, newValue) => setTabIndex(newValue)}
|
|
102
|
+
indicatorColor="secondary"
|
|
103
|
+
textColor="inherit"
|
|
104
|
+
variant="fullWidth"
|
|
105
|
+
>
|
|
106
|
+
{match.players.map((p) => (
|
|
107
|
+
<Tab label={p.name} key={p.id} />
|
|
108
|
+
))}
|
|
109
|
+
</Tabs>
|
|
110
|
+
<Box flex={1} sx={{ height: "100%" }}>
|
|
111
|
+
{[match.players[tabIndex].id].map((id) => (
|
|
112
|
+
<PlayerEditor key={id} playerId={id} match={match} />
|
|
113
|
+
))}
|
|
114
|
+
</Box>
|
|
115
|
+
</Stack>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function MatchPhone({ match }: { match: Match<any, any> }) {
|
|
120
|
+
return (
|
|
121
|
+
<Box sx={{ height: "100%", width: "100%", overflow: "scroll" }}>
|
|
122
|
+
<Stack direction={"row"} sx={{ width: `${390 * match.players.length}px` }}>
|
|
123
|
+
{match.players.map((p) => (
|
|
124
|
+
<Box key={p.id} sx={{ width: `390px`, height: "684px" }}>
|
|
125
|
+
<PlayerEditor showBack playerId={p.id} match={match} />
|
|
126
|
+
</Box>
|
|
127
|
+
))}
|
|
128
|
+
</Stack>
|
|
129
|
+
</Box>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function Editor({
|
|
134
|
+
setButtons,
|
|
135
|
+
layout,
|
|
136
|
+
game,
|
|
137
|
+
matchInformation,
|
|
138
|
+
}: {
|
|
139
|
+
setButtons: (buttons: ReactNode) => void;
|
|
140
|
+
layout: Layout;
|
|
141
|
+
game: Game<any, any>;
|
|
142
|
+
matchInformation: string;
|
|
143
|
+
}) {
|
|
144
|
+
const [match, setMatch] = useState<Match<any, any> | null>(null);
|
|
145
|
+
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
const FIRST_NAMES = ["Fred", "Steve", "Paul", "Josh", "Sara", "Miles"];
|
|
148
|
+
const LAST_NAMES = ["Johnson", "Dennis", "Green", "Breckman", "Stevens", "Smith"];
|
|
149
|
+
const storage = new LocalMatchStorage(matchInformation);
|
|
150
|
+
const players = [];
|
|
151
|
+
let playerCount = parseInt(matchInformation);
|
|
152
|
+
if (!Number.isFinite(playerCount)) {
|
|
153
|
+
playerCount = 2;
|
|
154
|
+
}
|
|
155
|
+
for (let i = 0; i < playerCount; i++) {
|
|
156
|
+
players.push(
|
|
157
|
+
new PlayerInfo(
|
|
158
|
+
`p${i}`,
|
|
159
|
+
`${FIRST_NAMES[(i + playerCount) % FIRST_NAMES.length]} ${LAST_NAMES[i % LAST_NAMES.length]}`,
|
|
160
|
+
),
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
const match = new Match(game, players, storage);
|
|
164
|
+
let cancelled = false;
|
|
165
|
+
match.load().then(() => {
|
|
166
|
+
if (cancelled) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
match.start();
|
|
170
|
+
setMatch(match);
|
|
171
|
+
|
|
172
|
+
const saveStateToLocalStorage = (key: string, state: any) => {
|
|
173
|
+
localStorage.setItem(key, JSON.stringify(state));
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
const readStateFromLocalStorage = (key: string) => {
|
|
177
|
+
const state = localStorage.getItem(key);
|
|
178
|
+
return state ? JSON.parse(state) : {};
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
let aState = readStateFromLocalStorage("aState");
|
|
182
|
+
let bState = readStateFromLocalStorage("bState");
|
|
183
|
+
|
|
184
|
+
setButtons(
|
|
185
|
+
<>
|
|
186
|
+
<Button>New</Button>
|
|
187
|
+
<Button onClick={() => storage.saveState({}, [], "active", undefined, true)}>Reset</Button>
|
|
188
|
+
|
|
189
|
+
<Button
|
|
190
|
+
onClick={() =>
|
|
191
|
+
storage.readState().then((d) => {
|
|
192
|
+
aState = d;
|
|
193
|
+
saveStateToLocalStorage("aState", aState);
|
|
194
|
+
})
|
|
195
|
+
}
|
|
196
|
+
>
|
|
197
|
+
Save A
|
|
198
|
+
</Button>
|
|
199
|
+
<Button
|
|
200
|
+
onClick={() =>
|
|
201
|
+
storage.readState().then((d) => {
|
|
202
|
+
bState = d;
|
|
203
|
+
saveStateToLocalStorage("bState", bState);
|
|
204
|
+
})
|
|
205
|
+
}
|
|
206
|
+
>
|
|
207
|
+
Save B
|
|
208
|
+
</Button>
|
|
209
|
+
<Button
|
|
210
|
+
onClick={() => {
|
|
211
|
+
aState = readStateFromLocalStorage("aState");
|
|
212
|
+
storage.saveState(aState, [], "active", undefined, true);
|
|
213
|
+
}}
|
|
214
|
+
>
|
|
215
|
+
Read A
|
|
216
|
+
</Button>
|
|
217
|
+
<Button
|
|
218
|
+
onClick={() => {
|
|
219
|
+
bState = readStateFromLocalStorage("bState");
|
|
220
|
+
storage.saveState(bState, [], "active", undefined, true);
|
|
221
|
+
}}
|
|
222
|
+
>
|
|
223
|
+
Read B
|
|
224
|
+
</Button>
|
|
225
|
+
</>,
|
|
226
|
+
);
|
|
227
|
+
});
|
|
228
|
+
return () => {
|
|
229
|
+
match.dispose();
|
|
230
|
+
cancelled = true;
|
|
231
|
+
};
|
|
232
|
+
}, [game, matchInformation, setButtons]);
|
|
233
|
+
|
|
234
|
+
if (!match) {
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
return (
|
|
239
|
+
<GameProvider game={game}>
|
|
240
|
+
{layout === "tile" && <MatchGrid match={match} />}
|
|
241
|
+
{layout === "tab" && <MatchTabs match={match} />}
|
|
242
|
+
{layout === "phone" && <MatchPhone match={match} />}
|
|
243
|
+
</GameProvider>
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export default function Playground({ game }: { game: Game<any, any> }) {
|
|
248
|
+
const [layout, setLayout] = useLocalStorageState<Layout>("matchViewerLayout", {
|
|
249
|
+
defaultValue: "tile",
|
|
250
|
+
});
|
|
251
|
+
const [buttons, setButtons] = useState<ReactNode | null>(null);
|
|
252
|
+
|
|
253
|
+
const items = ["2", "3", "4", "5", "1", "6", "7", "8", "9", "10"];
|
|
254
|
+
|
|
255
|
+
return (
|
|
256
|
+
<SelectableItemAndStage
|
|
257
|
+
keySpace="playground"
|
|
258
|
+
items={items}
|
|
259
|
+
topOptions={
|
|
260
|
+
<Stack direction="row">
|
|
261
|
+
{buttons}
|
|
262
|
+
|
|
263
|
+
<ToggleButtonGroup
|
|
264
|
+
exclusive
|
|
265
|
+
size="small"
|
|
266
|
+
sx={{ m: 2 }}
|
|
267
|
+
value={layout}
|
|
268
|
+
onChange={(e, newValue) => setLayout(newValue)}
|
|
269
|
+
>
|
|
270
|
+
<ToggleButton value="tile">
|
|
271
|
+
<GridOn />
|
|
272
|
+
</ToggleButton>
|
|
273
|
+
<ToggleButton value="tab">
|
|
274
|
+
<TabIcon />
|
|
275
|
+
</ToggleButton>
|
|
276
|
+
<ToggleButton value="phone">
|
|
277
|
+
<PhoneIphone />
|
|
278
|
+
</ToggleButton>
|
|
279
|
+
</ToggleButtonGroup>
|
|
280
|
+
</Stack>
|
|
281
|
+
}
|
|
282
|
+
render={(item) => <Editor setButtons={setButtons} layout={layout} matchInformation={item} game={game} />}
|
|
283
|
+
/>
|
|
284
|
+
);
|
|
285
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import { ChevronRight, ChevronLeft, Replay, QuestionMark } from "@mui/icons-material";
|
|
3
|
+
import { Box, Stack } from "@mui/material";
|
|
4
|
+
import BottomBarButton from "./BottomBarButton";
|
|
5
|
+
import { useGameTheme } from "../hooks/useGameTheme";
|
|
6
|
+
import BottomBarBreak from "./BottomBarBreak";
|
|
7
|
+
import { useEventChannelState } from "../hooks/useEventChannelState";
|
|
8
|
+
import { useAnimationSpeedMultiplier, useClientPrompts, useTimeState } from "../hooks/useTimeController";
|
|
9
|
+
import { usePlayerId } from "../hooks/usePlayer";
|
|
10
|
+
import GameDialog from "./GameDialog";
|
|
11
|
+
import Markdown from "react-markdown";
|
|
12
|
+
import { ZINDEX_PROMPT_CONTROLS } from "../utilities/zIndex";
|
|
13
|
+
import { GameButton, ToggleGalleryButton } from "../game/GameButton";
|
|
14
|
+
import { useModalState } from "../hooks/useModalState";
|
|
15
|
+
import { ContextGalleryDisplay } from "./ContextGalleryDisplay";
|
|
16
|
+
import { NoValidMovesPrompt } from "../game/Prompt";
|
|
17
|
+
|
|
18
|
+
function GameButtonWrapper({ button }: { button: GameButton }) {
|
|
19
|
+
const modalState = useModalState();
|
|
20
|
+
const [source, setSource] = useEventChannelState(modalState.gallerySource);
|
|
21
|
+
|
|
22
|
+
let highlight = false;
|
|
23
|
+
let cb = button.cb;
|
|
24
|
+
|
|
25
|
+
if (button instanceof ToggleGalleryButton) {
|
|
26
|
+
if (
|
|
27
|
+
(button.galleryItemSource === source && source) ||
|
|
28
|
+
(source?.backingObject && button.galleryItemSource?.backingObject === source.backingObject)
|
|
29
|
+
) {
|
|
30
|
+
highlight = true;
|
|
31
|
+
cb = () => setSource(undefined);
|
|
32
|
+
} else if (button.galleryItemSource) {
|
|
33
|
+
const source = button.galleryItemSource;
|
|
34
|
+
cb = () => setSource(source);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return <BottomBarButton highlight={highlight} icon={button.icon} label={button.label} onClick={cb} />;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export default function PromptControls({ collapsible }: { collapsible?: boolean }) {
|
|
42
|
+
const [expanded, setExpanded] = useState(false);
|
|
43
|
+
const [showHelp, setShowHelp] = useState(false);
|
|
44
|
+
const timeState = useTimeState();
|
|
45
|
+
const playerId = usePlayerId();
|
|
46
|
+
const speed = useAnimationSpeedMultiplier();
|
|
47
|
+
const clientPrompt = useClientPrompts();
|
|
48
|
+
const [prompt] = useEventChannelState(clientPrompt.currentPrompt);
|
|
49
|
+
const [promptSpec] = useEventChannelState(clientPrompt.getPromptEventChannelForPlayer(playerId));
|
|
50
|
+
const [expandedBecauseOfPrompt, setExpandedBecauseOfPrompt] = useState(!!prompt);
|
|
51
|
+
const [live] = useEventChannelState(timeState.live);
|
|
52
|
+
const theme = useGameTheme();
|
|
53
|
+
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
setExpanded(true);
|
|
56
|
+
if (!live) {
|
|
57
|
+
setExpandedBecauseOfPrompt(false);
|
|
58
|
+
} else if (prompt) {
|
|
59
|
+
if (prompt instanceof NoValidMovesPrompt) {
|
|
60
|
+
setShowHelp(true);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
setExpandedBecauseOfPrompt(true);
|
|
64
|
+
} else {
|
|
65
|
+
const to = setTimeout(() => setExpandedBecauseOfPrompt(false), promptSpec ? 4000 : 400);
|
|
66
|
+
return () => clearTimeout(to);
|
|
67
|
+
}
|
|
68
|
+
}, [prompt, live, promptSpec]);
|
|
69
|
+
|
|
70
|
+
if (!prompt && showHelp) {
|
|
71
|
+
setShowHelp(false);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<Stack
|
|
76
|
+
direction="row"
|
|
77
|
+
sx={{
|
|
78
|
+
position: collapsible ? "absolute" : "static",
|
|
79
|
+
overflow: "hidden",
|
|
80
|
+
zIndex: ZINDEX_PROMPT_CONTROLS,
|
|
81
|
+
background: theme.actionBarColor,
|
|
82
|
+
maxWidth: collapsible ? "calc(100% - 30px)" : undefined,
|
|
83
|
+
width: collapsible ? "97%" : "100%",
|
|
84
|
+
minWidth: "100px",
|
|
85
|
+
height: theme.bottomBarHeight,
|
|
86
|
+
transform: collapsible
|
|
87
|
+
? expandedBecauseOfPrompt
|
|
88
|
+
? `translateX(${expanded ? "0px" : "calc(100% - 55px)"})`
|
|
89
|
+
: "translateX(100%)"
|
|
90
|
+
: "",
|
|
91
|
+
opacity: !collapsible ? (expandedBecauseOfPrompt ? 1 : 0.4) : 1,
|
|
92
|
+
transition: `transform ease-in-out ${theme.actionBarAnimationDuration * speed}s, opacity linear ${theme.actionBarAnimationDuration * speed}s`,
|
|
93
|
+
pr: 1,
|
|
94
|
+
pl: collapsible ? 0 : 1,
|
|
95
|
+
right: 0,
|
|
96
|
+
boxShadow: "-2px -2px 10px 0px rgba(0,0,0,0.2)",
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
{collapsible && (
|
|
100
|
+
<>
|
|
101
|
+
<BottomBarButton
|
|
102
|
+
removeLabel
|
|
103
|
+
icon={expanded ? ChevronRight : ChevronLeft}
|
|
104
|
+
onClick={() => setExpanded(!expanded)}
|
|
105
|
+
/>
|
|
106
|
+
<BottomBarBreak />
|
|
107
|
+
</>
|
|
108
|
+
)}
|
|
109
|
+
|
|
110
|
+
{/* {prompt && <BottomBarButton icon={QuestionMark} label="Help" onClick={() => setShowHelp(true)} />} */}
|
|
111
|
+
{/* {prompt && (
|
|
112
|
+
<GameDialog onClose={() => setShowHelp(false)} open={showHelp}>
|
|
113
|
+
<Markdown>{prompt.formatHelpText()}</Markdown>
|
|
114
|
+
</GameDialog>
|
|
115
|
+
)} */}
|
|
116
|
+
|
|
117
|
+
{prompt?.canReset && (
|
|
118
|
+
<BottomBarButton
|
|
119
|
+
icon={Replay}
|
|
120
|
+
label="Undo"
|
|
121
|
+
onClick={() => prompt.stepBack()}
|
|
122
|
+
onLongClick={() => prompt.stepBack(true)}
|
|
123
|
+
/>
|
|
124
|
+
)}
|
|
125
|
+
<Box flex={1} />
|
|
126
|
+
{prompt?.buttons.map((button, idx) => (
|
|
127
|
+
<GameButtonWrapper key={idx} button={button} />
|
|
128
|
+
))}
|
|
129
|
+
<ContextGalleryDisplay size={theme.bottomBarHeight - theme.spacing * 2} />
|
|
130
|
+
</Stack>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React, { ReactNode, useEffect } from "react";
|
|
2
|
+
import useLocalStorageState from "use-local-storage-state";
|
|
3
|
+
import { Stack, Box, Select, MenuItem, Paper } from "@mui/material";
|
|
4
|
+
|
|
5
|
+
export default function SelectableItemAndStage({
|
|
6
|
+
items,
|
|
7
|
+
render,
|
|
8
|
+
keySpace,
|
|
9
|
+
topOptions,
|
|
10
|
+
}: {
|
|
11
|
+
items: string[];
|
|
12
|
+
keySpace: string;
|
|
13
|
+
render: (t: string) => ReactNode;
|
|
14
|
+
topOptions?: ReactNode;
|
|
15
|
+
}) {
|
|
16
|
+
const [selected, setSelected] = useLocalStorageState<string>(`dropdown${keySpace}`, {
|
|
17
|
+
defaultValue: "",
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (selected === "" && items.length > 0) {
|
|
22
|
+
setSelected(items[0]);
|
|
23
|
+
}
|
|
24
|
+
}, [selected, items, setSelected]);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Stack sx={{ height: "100%" }}>
|
|
28
|
+
<Paper elevation={3} sx={{ position: "relative" }}>
|
|
29
|
+
<Stack direction={"row"}>
|
|
30
|
+
<Select
|
|
31
|
+
variant="standard"
|
|
32
|
+
sx={{ m: 2, width: 200 }}
|
|
33
|
+
value={selected}
|
|
34
|
+
label="Select Choice"
|
|
35
|
+
onChange={(e) => setSelected(e.target.value)}
|
|
36
|
+
>
|
|
37
|
+
{items.map((item) => (
|
|
38
|
+
<MenuItem value={item} key={item}>
|
|
39
|
+
{item}
|
|
40
|
+
</MenuItem>
|
|
41
|
+
))}
|
|
42
|
+
</Select>
|
|
43
|
+
{topOptions}
|
|
44
|
+
</Stack>
|
|
45
|
+
</Paper>
|
|
46
|
+
<Box flexGrow={1}>{selected ? render(selected) : null}</Box>
|
|
47
|
+
</Stack>
|
|
48
|
+
);
|
|
49
|
+
}
|