@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,187 @@
|
|
|
1
|
+
import { MismatchError } from "./Turn";
|
|
2
|
+
|
|
3
|
+
export type DecisionType = "prompt" | "rng" | "turn";
|
|
4
|
+
|
|
5
|
+
export type PromptResponse = {
|
|
6
|
+
readonly type: "prompt";
|
|
7
|
+
response?: any;
|
|
8
|
+
timestamp: Date;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type RngResponse = { readonly type: "rng"; value: number };
|
|
12
|
+
|
|
13
|
+
export type Decision = PromptResponse | RngResponse | TurnState;
|
|
14
|
+
|
|
15
|
+
export class TurnState {
|
|
16
|
+
readonly type = "turn";
|
|
17
|
+
id = "root";
|
|
18
|
+
playerId?: string;
|
|
19
|
+
createdDate = Date.now();
|
|
20
|
+
|
|
21
|
+
decisions: Decision[] = [];
|
|
22
|
+
|
|
23
|
+
private parentTurnState: TurnState | undefined;
|
|
24
|
+
private parentTurnIndex = 0;
|
|
25
|
+
|
|
26
|
+
toJSON() {
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
28
|
+
const { parentTurnIndex, parentTurnState, ...rest } = this;
|
|
29
|
+
return rest;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public getOrCreatePromptResponse(index: number): PromptResponse {
|
|
33
|
+
if (index < this.decisions.length) {
|
|
34
|
+
const result = this.decisions[index];
|
|
35
|
+
if (result.type !== "prompt") {
|
|
36
|
+
throw new MismatchError();
|
|
37
|
+
}
|
|
38
|
+
return result as PromptResponse;
|
|
39
|
+
} else if (index === this.decisions.length) {
|
|
40
|
+
this.decisions.push({
|
|
41
|
+
type: "prompt",
|
|
42
|
+
timestamp: new Date(),
|
|
43
|
+
});
|
|
44
|
+
return this.decisions[this.decisions.length - 1] as PromptResponse;
|
|
45
|
+
} else {
|
|
46
|
+
throw new MismatchError();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
public setOrCreatePromptResponse(index: number, response: PromptResponse): void {
|
|
50
|
+
if (index < this.decisions.length) {
|
|
51
|
+
const result = this.decisions[index];
|
|
52
|
+
if (result.type !== "prompt") {
|
|
53
|
+
throw new MismatchError();
|
|
54
|
+
}
|
|
55
|
+
this.decisions[index] = response;
|
|
56
|
+
} else if (index === this.decisions.length) {
|
|
57
|
+
this.decisions.push(response);
|
|
58
|
+
} else {
|
|
59
|
+
throw new MismatchError();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public getOrCreateRng(index: number): number {
|
|
64
|
+
if (index < this.decisions.length) {
|
|
65
|
+
const result = this.decisions[index];
|
|
66
|
+
if (result.type !== "rng") {
|
|
67
|
+
throw new MismatchError();
|
|
68
|
+
}
|
|
69
|
+
return (result as RngResponse).value;
|
|
70
|
+
} else if (index === this.decisions.length) {
|
|
71
|
+
const rng = Math.random();
|
|
72
|
+
this.decisions.push({
|
|
73
|
+
type: "rng",
|
|
74
|
+
value: rng,
|
|
75
|
+
});
|
|
76
|
+
return rng;
|
|
77
|
+
} else {
|
|
78
|
+
throw new MismatchError();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public getOrCreateTurnState(index: number): TurnState {
|
|
83
|
+
if (index < this.decisions.length) {
|
|
84
|
+
const result = this.decisions[index];
|
|
85
|
+
if (result.type !== "turn") {
|
|
86
|
+
throw new MismatchError();
|
|
87
|
+
}
|
|
88
|
+
return result as TurnState;
|
|
89
|
+
} else if (index === this.decisions.length) {
|
|
90
|
+
const result = new TurnState();
|
|
91
|
+
result.parentTurnState = this;
|
|
92
|
+
result.parentTurnIndex = index;
|
|
93
|
+
this.decisions.push(result);
|
|
94
|
+
return result;
|
|
95
|
+
} else {
|
|
96
|
+
throw new MismatchError();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
public deserialize(serialized: any) {
|
|
101
|
+
this.playerId = serialized.playerId;
|
|
102
|
+
this.id = serialized.id;
|
|
103
|
+
this.createdDate = serialized.createdDate ?? Date.now();
|
|
104
|
+
this.decisions = (serialized.decisions ?? []).map((d: Decision, i: number) => {
|
|
105
|
+
if (d.type === "turn") {
|
|
106
|
+
const existing = this.decisions[i];
|
|
107
|
+
if (existing?.type === "turn") {
|
|
108
|
+
existing.deserialize(d);
|
|
109
|
+
} else {
|
|
110
|
+
const r = new TurnState();
|
|
111
|
+
r.parentTurnState = this;
|
|
112
|
+
r.parentTurnIndex = i;
|
|
113
|
+
r.deserialize(d);
|
|
114
|
+
return r;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return d;
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
public hasUserMadeChoiceSinceUserContextChangedOrRng(index: number): boolean {
|
|
122
|
+
if (index < 0 && this.parentTurnState && this.parentTurnState.playerId === this.playerId) {
|
|
123
|
+
return this.parentTurnState.hasUserMadeChoiceSinceUserContextChangedOrRng(this.parentTurnIndex);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
for (let i = index; i >= 0; i--) {
|
|
127
|
+
const lastDecision = this.decisions[i];
|
|
128
|
+
if (!lastDecision) {
|
|
129
|
+
continue;
|
|
130
|
+
} else if (lastDecision.type === "rng") {
|
|
131
|
+
return false;
|
|
132
|
+
} else if (lastDecision.type === "prompt") {
|
|
133
|
+
return true;
|
|
134
|
+
} else if (lastDecision.type === "turn") {
|
|
135
|
+
const subTurn = lastDecision as TurnState;
|
|
136
|
+
if (subTurn.decisions.length === 0) {
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (subTurn.playerId === this.playerId) {
|
|
141
|
+
return subTurn.hasUserMadeChoiceSinceUserContextChangedOrRng(subTurn.decisions.length - 1);
|
|
142
|
+
}
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
public stepBack() {
|
|
150
|
+
if (!this.hasUserMadeChoiceSinceUserContextChangedOrRng(this.decisions.length)) {
|
|
151
|
+
// should be -1? does it matter?
|
|
152
|
+
throw new Error("Cannot step back");
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const lastDecision = this.decisions[this.decisions.length - 1];
|
|
156
|
+
if (!lastDecision) {
|
|
157
|
+
throw new Error("Cannot step back - no decisions");
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (lastDecision.type === "turn") {
|
|
161
|
+
lastDecision.stepBack();
|
|
162
|
+
if (lastDecision.decisions.length > 0) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
this.decisions.pop();
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
public fullStepBack() {
|
|
171
|
+
while (this.hasUserMadeChoiceSinceUserContextChangedOrRng(this.decisions.length)) {
|
|
172
|
+
const lastDecision = this.decisions[this.decisions.length - 1];
|
|
173
|
+
if (!lastDecision) {
|
|
174
|
+
throw new Error("Cannot step back - no decisions");
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if (lastDecision.type === "turn") {
|
|
178
|
+
lastDecision.stepBack();
|
|
179
|
+
if (lastDecision.decisions.length > 0) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
this.decisions.pop();
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { EventChannel } from "../../utilities/EventChannel";
|
|
2
|
+
import { ClockDetails, samePasses } from "../ClockDetails";
|
|
3
|
+
import { Connection } from "../Connection";
|
|
4
|
+
import { ConnectionObject } from "../ConnectionObject";
|
|
5
|
+
import { PlayerChit } from "../PlayerChit";
|
|
6
|
+
import { Prompt, PromptSerialization } from "../Prompt";
|
|
7
|
+
import { RootChit } from "../RootChit";
|
|
8
|
+
import { ServerPrompts } from "../serverTransport/ServerPrompts";
|
|
9
|
+
import { ClientTime } from "./ClientTime";
|
|
10
|
+
|
|
11
|
+
export class ClientPrompts<P extends PlayerChit, R extends RootChit<P>> extends ConnectionObject {
|
|
12
|
+
private waitingPrompts: { [playerId: string]: EventChannel<PromptSerialization | undefined> } = {};
|
|
13
|
+
private serverPrompts: ServerPrompts<P, R>;
|
|
14
|
+
public currentPrompt = new EventChannel<Prompt | undefined>(undefined);
|
|
15
|
+
|
|
16
|
+
private _currentPromptSpec?: PromptSerialization;
|
|
17
|
+
|
|
18
|
+
constructor(
|
|
19
|
+
private playerId: string,
|
|
20
|
+
private connection: Connection,
|
|
21
|
+
private clientTime: ClientTime,
|
|
22
|
+
) {
|
|
23
|
+
super();
|
|
24
|
+
|
|
25
|
+
this.serverPrompts = connection.get<ServerPrompts<P, R>>("ServerPrompts");
|
|
26
|
+
this.register(this.clientTime.currentClock.on(this.checkIfPromptCanBeInflated.bind(this)));
|
|
27
|
+
this.register(this.clientTime.maxClock.on(this.checkIfPromptCanBeInflated.bind(this)));
|
|
28
|
+
this.register(this.clientTime.clientTimeState.live.on(this.checkIfPromptCanBeInflated.bind(this)));
|
|
29
|
+
this.register(this.clientTime.clientTimeState.isWaitingOnAnimations.on(this.checkIfPromptCanBeInflated.bind(this)));
|
|
30
|
+
this.register(this.clientTime.activeLog.on(this.fixActiveLog.bind(this)));
|
|
31
|
+
this.register(this.getPromptEventChannelForPlayer(this.playerId).on(this.checkIfPromptCanBeInflated.bind(this)));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
fixActiveLog() {
|
|
35
|
+
if (this.currentPrompt.value && this.clientTime.activeLog.value) {
|
|
36
|
+
this.clientTime.activeLog.value = undefined;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
private checkIfPromptCanBeInflated() {
|
|
41
|
+
const isLive = this.clientTime.clientTimeState.live.value;
|
|
42
|
+
const currentTime = this.clientTime.currentClock.value.clock;
|
|
43
|
+
const maxTime = this.clientTime.maxClock.value.clock;
|
|
44
|
+
const isWaitingOnAnimations = this.clientTime.clientTimeState.isWaitingOnAnimations.value;
|
|
45
|
+
const promptSpec = this.getPromptEventChannelForPlayer(this.playerId).value;
|
|
46
|
+
|
|
47
|
+
if (isLive && promptSpec && promptSpec == this._currentPromptSpec) {
|
|
48
|
+
// do nothing - we have already inflated our prompt and it is still the correct prompt. as long as we are "live" there is no
|
|
49
|
+
// need to deflate it
|
|
50
|
+
} else if (
|
|
51
|
+
isLive &&
|
|
52
|
+
promptSpec &&
|
|
53
|
+
currentTime === maxTime &&
|
|
54
|
+
currentTime > 0 &&
|
|
55
|
+
!isWaitingOnAnimations &&
|
|
56
|
+
samePasses(this.clientTime.currentClock.value, this.clientTime.maxClock.value)
|
|
57
|
+
) {
|
|
58
|
+
if (this.currentPrompt.value) {
|
|
59
|
+
this.currentPrompt.value.stageOut();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
this._currentPromptSpec = promptSpec;
|
|
63
|
+
const prompt = Prompt.deserialize(promptSpec, this.clientTime.findChit, this.clientTime.game.buttonLibrary);
|
|
64
|
+
prompt.onResolve(async (success) => {
|
|
65
|
+
this.fixActiveLog();
|
|
66
|
+
if (success) {
|
|
67
|
+
const newPromptSpec = await this.serverPrompts.resolvePrompt(prompt.response);
|
|
68
|
+
this.getPromptEventChannelForPlayer(this.playerId).value = newPromptSpec ?? undefined;
|
|
69
|
+
} else if (prompt.shouldStepBack) {
|
|
70
|
+
this.getPromptEventChannelForPlayer(this.playerId).value = undefined;
|
|
71
|
+
await this.serverPrompts.stepBackPrompt(prompt.shouldReset ?? false);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
prompt.stageIn();
|
|
75
|
+
|
|
76
|
+
this.currentPrompt.value = prompt;
|
|
77
|
+
this.fixActiveLog();
|
|
78
|
+
} else {
|
|
79
|
+
this._currentPromptSpec = undefined;
|
|
80
|
+
if (this.currentPrompt.value) {
|
|
81
|
+
this.currentPrompt.value.stageOut();
|
|
82
|
+
}
|
|
83
|
+
this.currentPrompt.value = undefined;
|
|
84
|
+
this.fixActiveLog();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
public async setPromptForPlayer(playerId: string, prompt?: PromptSerialization, clockDetails?: ClockDetails) {
|
|
89
|
+
this.getPromptEventChannelForPlayer(playerId).value = prompt;
|
|
90
|
+
if (clockDetails) {
|
|
91
|
+
this.clientTime.newMaxClock(clockDetails);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
public getPromptEventChannelForPlayer(playerId: string) {
|
|
96
|
+
let p = this.waitingPrompts[playerId];
|
|
97
|
+
if (!p) {
|
|
98
|
+
p = this.waitingPrompts[playerId] = new EventChannel<PromptSerialization | undefined>(undefined);
|
|
99
|
+
}
|
|
100
|
+
return p;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { EventChannel } from "../../utilities/EventChannel";
|
|
2
|
+
import { Connection } from "../Connection";
|
|
3
|
+
import { ConnectionObject } from "../ConnectionObject";
|
|
4
|
+
import { PlayerChit } from "../PlayerChit";
|
|
5
|
+
import { RootChit } from "../RootChit";
|
|
6
|
+
import { ServerStatus } from "../serverTransport/ServerStatus";
|
|
7
|
+
|
|
8
|
+
type ClientGameResult = {
|
|
9
|
+
winnerIds: string[];
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export class ClientStatus<P extends PlayerChit, R extends RootChit<P>> extends ConnectionObject {
|
|
13
|
+
public errorMessage = new EventChannel<string | undefined>(undefined);
|
|
14
|
+
public matchResult = new EventChannel<ClientGameResult | undefined>(undefined);
|
|
15
|
+
private serverStatus: ServerStatus<P, R>;
|
|
16
|
+
|
|
17
|
+
constructor(private connection: Connection) {
|
|
18
|
+
super();
|
|
19
|
+
|
|
20
|
+
this.serverStatus = connection.get<ServerStatus<P, R>>("ServerStatus");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async setErrorMessage(error: string | undefined) {
|
|
24
|
+
this.errorMessage.value = error;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async setMatchResult(winnerIds?: string[]) {
|
|
28
|
+
if (winnerIds) {
|
|
29
|
+
this.matchResult.value = {
|
|
30
|
+
winnerIds: winnerIds,
|
|
31
|
+
};
|
|
32
|
+
} else {
|
|
33
|
+
this.matchResult.value = undefined;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { SparkChit } from "../SparkChit";
|
|
2
|
+
import { EventChannel } from "../../utilities/EventChannel";
|
|
3
|
+
import { Chit } from "../Chit";
|
|
4
|
+
import { ClientTimeState } from "../ClientTimeState";
|
|
5
|
+
import { ClockDetails, samePasses } from "../ClockDetails";
|
|
6
|
+
import { Connection } from "../Connection";
|
|
7
|
+
import { ConnectionObject } from "../ConnectionObject";
|
|
8
|
+
import { Game } from "../Game";
|
|
9
|
+
import { RootChit } from "../RootChit";
|
|
10
|
+
import { ServerTime } from "../serverTransport/ServerTime";
|
|
11
|
+
import { ClientPrompts } from "./ClientPrompts";
|
|
12
|
+
|
|
13
|
+
export class ClientTime extends ConnectionObject {
|
|
14
|
+
private lastSerializedState: { [chitId: string]: string } = {};
|
|
15
|
+
|
|
16
|
+
public clientPrompt?: ClientPrompts<any, any>;
|
|
17
|
+
|
|
18
|
+
constructor(
|
|
19
|
+
public connection: Connection,
|
|
20
|
+
public game: Game<any, any>,
|
|
21
|
+
public clientTimeState: ClientTimeState,
|
|
22
|
+
) {
|
|
23
|
+
super();
|
|
24
|
+
|
|
25
|
+
this.serverTime = this.connection.get<ServerTime<any, any>>("ServerTime");
|
|
26
|
+
|
|
27
|
+
this.register(this.clientTimeState.targetClock.on(() => this.processNewTargetClock()));
|
|
28
|
+
this.register(
|
|
29
|
+
this.clientTimeState.isWaitingOnAnimations.on((isWaiting) => {
|
|
30
|
+
if (
|
|
31
|
+
!isWaiting &&
|
|
32
|
+
this.clientTimeState.live.value &&
|
|
33
|
+
this.clientTimeState.targetClock.value < this.maxClock.value.clock
|
|
34
|
+
) {
|
|
35
|
+
this.clientTimeState.targetClock.value++;
|
|
36
|
+
}
|
|
37
|
+
}),
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
this.clientTimeState.animationSpeedMultiplier.value =
|
|
41
|
+
parseFloat(localStorage["animationSpeedMultiplier"] ?? "1") || 1;
|
|
42
|
+
this.register(
|
|
43
|
+
this.clientTimeState.animationSpeedMultiplier.on((targetSpeed) => {
|
|
44
|
+
localStorage["animationSpeedMultiplier"] = targetSpeed;
|
|
45
|
+
}),
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
this.clientTimeState.skipReplay.value = parseFloat(localStorage["skipReplay"] ?? "0") === 1;
|
|
49
|
+
this.register(
|
|
50
|
+
this.clientTimeState.skipReplay.on((skipReplay) => {
|
|
51
|
+
localStorage["skipReplay"] = skipReplay ? "1" : "0";
|
|
52
|
+
}),
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
this.clientTimeState.showLog.value = parseFloat(localStorage["showLog"] ?? "0") === 1;
|
|
56
|
+
this.register(
|
|
57
|
+
this.clientTimeState.showLog.on((showLog) => {
|
|
58
|
+
localStorage["showLog"] = showLog ? "1" : "0";
|
|
59
|
+
}),
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public currentClock = new EventChannel<ClockDetails>({ clock: 0, pass: -1 });
|
|
64
|
+
private chitLookup: { [id: string]: Chit } = {};
|
|
65
|
+
public maxClock = new EventChannel<ClockDetails>({ clock: 0, pass: -1 });
|
|
66
|
+
public rootChit = new EventChannel<RootChit<any> | undefined>(undefined);
|
|
67
|
+
public activeLog = new EventChannel<string | undefined>(undefined);
|
|
68
|
+
private startTime = 1;
|
|
69
|
+
|
|
70
|
+
public async gameLogs() {
|
|
71
|
+
return await this.serverTime.gameLog();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public readonly findChit: (id: string) => Chit = (id: string) => {
|
|
75
|
+
const result = this.chitLookup[id];
|
|
76
|
+
if (!result) {
|
|
77
|
+
throw new Error("Cannot find chit");
|
|
78
|
+
}
|
|
79
|
+
return result;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
public readonly findChitUnsafe: (id: string) => Chit | undefined = (id: string) => {
|
|
83
|
+
return this.chitLookup[id];
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
private serverTime: ServerTime<any, any>;
|
|
87
|
+
|
|
88
|
+
public async setStartTime(newTime: number) {
|
|
89
|
+
if (this.clientTimeState.targetClock.value <= newTime || newTime === 0) {
|
|
90
|
+
this.clientTimeState.isLoading.value = true;
|
|
91
|
+
|
|
92
|
+
if (!this.clientTimeState.skipReplay.value) {
|
|
93
|
+
this.startTime = newTime;
|
|
94
|
+
this.clientTimeState.targetClock.value = newTime;
|
|
95
|
+
} else {
|
|
96
|
+
this.clientTimeState.goLive(this.maxClock.value.clock);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public async newMaxClock(newMaxClock: ClockDetails) {
|
|
102
|
+
const oldClock = this.maxClock.value;
|
|
103
|
+
const isSamePass = samePasses(oldClock, newMaxClock);
|
|
104
|
+
|
|
105
|
+
if (isSamePass && oldClock.clock === newMaxClock.clock) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
this.maxClock.value = newMaxClock;
|
|
110
|
+
if (this.clientTimeState.live.value || !isSamePass) {
|
|
111
|
+
if (
|
|
112
|
+
!this.clientTimeState.isWaitingOnAnimations.value &&
|
|
113
|
+
this.clientTimeState.targetClock.value < this.maxClock.value.clock
|
|
114
|
+
) {
|
|
115
|
+
this.clientTimeState.targetClock.value++;
|
|
116
|
+
} else if (!isSamePass && !this.clientTimeState.isWaitingOnAnimations.value) {
|
|
117
|
+
this.clientTimeState.targetClock.value = this.maxClock.value.clock;
|
|
118
|
+
this.processNewTargetClock();
|
|
119
|
+
} else if (!this.clientTimeState.isWaitingOnAnimations.value) {
|
|
120
|
+
// some other use has reset...
|
|
121
|
+
this.clientTimeState.targetClock.value = this.maxClock.value.clock;
|
|
122
|
+
} else {
|
|
123
|
+
this.processNewTargetClock();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
private _states: { [stateId: number]: string } = {};
|
|
129
|
+
private inflateSerializedResponse(newState: { [state: number]: string }, chitStates: { [id: string]: number }) {
|
|
130
|
+
Object.assign(this._states, newState);
|
|
131
|
+
return Object.fromEntries(Object.entries(chitStates).map(([key, value]) => [key, this._states[value]]));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
private async processNewTargetClock() {
|
|
135
|
+
const newTargetClock = this.clientTimeState.targetClock.value;
|
|
136
|
+
const currentClock = this.currentClock.value;
|
|
137
|
+
|
|
138
|
+
if (newTargetClock > this.maxClock.value.clock) {
|
|
139
|
+
this.clientTimeState.targetClock.value = this.maxClock.value.clock;
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (newTargetClock < 1) {
|
|
143
|
+
this.clientTimeState.targetClock.value = 1;
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// make sure our async operations don't get interrupted by auto-advancing the timeline
|
|
148
|
+
const animationKey = `minimumAnimationDuration${Date.now()}`;
|
|
149
|
+
this.clientTimeState.setAnimationState(animationKey, true);
|
|
150
|
+
|
|
151
|
+
const response = await this.serverTime.serializeDelta(this.clientTimeState.targetClock.value);
|
|
152
|
+
const serializedChits = this.inflateSerializedResponse(response.newStates, response.chits);
|
|
153
|
+
|
|
154
|
+
// make sure nothing changed while we were waiting...
|
|
155
|
+
if (this.clientTimeState.targetClock.value === newTargetClock && currentClock === this.currentClock.value) {
|
|
156
|
+
if (newTargetClock > this.startTime) {
|
|
157
|
+
this.clientTimeState.isLoading.value = false;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// track the active log message
|
|
161
|
+
this.activeLog.value = response.log?.message;
|
|
162
|
+
this.clientPrompt?.fixActiveLog();
|
|
163
|
+
|
|
164
|
+
// first make sure all chits exist (because they may link to each other)
|
|
165
|
+
Object.entries(serializedChits).forEach(([id, value]) => {
|
|
166
|
+
let chit = this.chitLookup[id];
|
|
167
|
+
if (!chit) {
|
|
168
|
+
const c = Chit.deflate(value, this.game);
|
|
169
|
+
if (c) {
|
|
170
|
+
chit = this.chitLookup[id] = c;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
Object.values(this.chitLookup).forEach((chit) => {
|
|
176
|
+
if (chit.id && !serializedChits[chit.id]) {
|
|
177
|
+
if (chit.parentFallback) {
|
|
178
|
+
chit.beginDeserializing();
|
|
179
|
+
chit.setParent(chit.parentFallback, chit.parentOutlet ?? "graveyard");
|
|
180
|
+
chit.doneDeserializing();
|
|
181
|
+
} else {
|
|
182
|
+
chit.removeFromParent();
|
|
183
|
+
}
|
|
184
|
+
delete this.lastSerializedState[chit.id];
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
this.currentClock.value = response.clockDetails;
|
|
189
|
+
|
|
190
|
+
// now actually load the new state
|
|
191
|
+
const changedIds = new Set(
|
|
192
|
+
Object.entries(serializedChits)
|
|
193
|
+
.filter(([id, value]) => this.chitLookup[id] && this.lastSerializedState[id] !== value)
|
|
194
|
+
.map(([id]) => id),
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
const chits: Chit[] = Object.entries(serializedChits)
|
|
198
|
+
.filter(([id, value]) => this.chitLookup[id] && this.lastSerializedState[id] !== value)
|
|
199
|
+
.map(([id]) => this.chitLookup[id]);
|
|
200
|
+
|
|
201
|
+
chits.forEach((chit) => chit.beginDeserializing());
|
|
202
|
+
|
|
203
|
+
Object.entries(serializedChits)
|
|
204
|
+
.filter(([id]) => changedIds.has(id))
|
|
205
|
+
.forEach(([id, value]) => {
|
|
206
|
+
const chit = this.chitLookup[id];
|
|
207
|
+
chit.deserialize(value, this.findChit);
|
|
208
|
+
this.lastSerializedState[id] = value;
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
chits.forEach((chit) => chit.doneDeserializing());
|
|
212
|
+
|
|
213
|
+
this.rootChit.value = this.findChit("root") as RootChit<any>;
|
|
214
|
+
|
|
215
|
+
// sometimes deserializing chits does not result in animations (maybe a pure texture change?)
|
|
216
|
+
// in that case, we need to make sure that the clock moves forward
|
|
217
|
+
setTimeout(() => this.clientTimeState.setAnimationState(animationKey, false), 100);
|
|
218
|
+
} else {
|
|
219
|
+
this.clientTimeState.setAnimationState(animationKey, false);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
public async chitHistory(chits: Chit[]) {
|
|
224
|
+
const sparkHistory = await this.serverTime.chitHistory(chits.map((s) => s.id!));
|
|
225
|
+
const result: { [id: string]: { clock: number; chit: Chit }[] } = {};
|
|
226
|
+
|
|
227
|
+
const chitLookup: { [id: string]: Chit } = Object.entries(this.chitLookup).reduce(
|
|
228
|
+
(acc, [id, chit]) => {
|
|
229
|
+
const serialized = chit.serialize();
|
|
230
|
+
const c = Chit.deflate(serialized, this.game);
|
|
231
|
+
if (c) {
|
|
232
|
+
acc[id] = c;
|
|
233
|
+
}
|
|
234
|
+
return acc;
|
|
235
|
+
},
|
|
236
|
+
{} as { [id: string]: Chit },
|
|
237
|
+
);
|
|
238
|
+
const findChit = (id: string) => chitLookup[id];
|
|
239
|
+
|
|
240
|
+
Object.keys(chitLookup).forEach((id: string) => {
|
|
241
|
+
chitLookup[id].deserialize(this.chitLookup[id].serialize(), findChit);
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
Object.entries(sparkHistory).forEach(([id, history]) => {
|
|
245
|
+
result[id] = [];
|
|
246
|
+
history.forEach((h: any) => {
|
|
247
|
+
const c = Chit.deflate(h.state, this.game);
|
|
248
|
+
if (c) {
|
|
249
|
+
c.deserialize(h.state, findChit);
|
|
250
|
+
result[id].push({ clock: h.clock, chit: c });
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
return result;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Connection } from "../Connection";
|
|
2
|
+
import { ConnectionObject } from "../ConnectionObject";
|
|
3
|
+
import { Match } from "../Match";
|
|
4
|
+
import { PlayerChit } from "../PlayerChit";
|
|
5
|
+
import { PromptSerialization } from "../Prompt";
|
|
6
|
+
import { RootChit } from "../RootChit";
|
|
7
|
+
import { ClientPrompts } from "../clientTransport/ClientPrompts";
|
|
8
|
+
|
|
9
|
+
export class ServerPrompts<P extends PlayerChit, R extends RootChit<P>> extends ConnectionObject {
|
|
10
|
+
private clientPrompts: ClientPrompts<P, R>;
|
|
11
|
+
constructor(
|
|
12
|
+
private playerId: string,
|
|
13
|
+
private match: Match<P, R>,
|
|
14
|
+
private connection: Connection,
|
|
15
|
+
) {
|
|
16
|
+
super();
|
|
17
|
+
|
|
18
|
+
this.clientPrompts = this.connection.get<ClientPrompts<P, R>>("ClientPrompts");
|
|
19
|
+
|
|
20
|
+
// I HATE THIS
|
|
21
|
+
// but it's fine? maybe?
|
|
22
|
+
let unsubs: (() => void)[] = [];
|
|
23
|
+
this.register(
|
|
24
|
+
(() => {
|
|
25
|
+
const cb = match.turn.on((newTurn) => {
|
|
26
|
+
unsubs.forEach((cb) => cb());
|
|
27
|
+
unsubs = [];
|
|
28
|
+
|
|
29
|
+
if (newTurn) {
|
|
30
|
+
unsubs = newTurn.rootChit.players.map((player) =>
|
|
31
|
+
player.promptStatus.latestPrompt.on((latestPrompt: any) =>
|
|
32
|
+
this.clientPrompts.setPromptForPlayer(
|
|
33
|
+
player.playerId,
|
|
34
|
+
latestPrompt?.serialize(),
|
|
35
|
+
this.match.turn.value?.clockDetails(playerId),
|
|
36
|
+
),
|
|
37
|
+
),
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
return () => {
|
|
43
|
+
cb();
|
|
44
|
+
unsubs.forEach((cb) => cb());
|
|
45
|
+
};
|
|
46
|
+
})(),
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
private get playerChits() {
|
|
51
|
+
return this.match.turn.value?.rootChit.players;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async resolvePrompt(response: any): Promise<void | PromptSerialization> {
|
|
55
|
+
const player = this.playerChits?.find((p) => p.playerId === this.playerId);
|
|
56
|
+
if (player && player.promptStatus.latestPrompt.value) {
|
|
57
|
+
let cb: (() => void) | undefined;
|
|
58
|
+
const p = new Promise((resolve) => {
|
|
59
|
+
cb = this.match.onChange(() => resolve(0), false);
|
|
60
|
+
});
|
|
61
|
+
player.promptStatus.latestPrompt.value.resolve(response);
|
|
62
|
+
await p;
|
|
63
|
+
if (cb) {
|
|
64
|
+
cb();
|
|
65
|
+
}
|
|
66
|
+
return player.promptStatus.latestPrompt.value?.serialize();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async stepBackPrompt(fullReset: boolean = false) {
|
|
71
|
+
const player = this.playerChits?.find((p) => p.playerId === this.playerId);
|
|
72
|
+
if (player && player.promptStatus.latestPrompt.value && player.promptStatus.latestPrompt.value.canReset) {
|
|
73
|
+
player.promptStatus.latestPrompt.value.stepBack(fullReset);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Connection } from "../Connection";
|
|
2
|
+
import { ConnectionObject } from "../ConnectionObject";
|
|
3
|
+
import { Match } from "../Match";
|
|
4
|
+
import { PlayerChit } from "../PlayerChit";
|
|
5
|
+
import { RootChit } from "../RootChit";
|
|
6
|
+
import { ClientStatus } from "../clientTransport/ClientStatus";
|
|
7
|
+
|
|
8
|
+
export class ServerStatus<P extends PlayerChit, R extends RootChit<P>> extends ConnectionObject {
|
|
9
|
+
private clientStatus: ClientStatus<P, R>;
|
|
10
|
+
|
|
11
|
+
constructor(
|
|
12
|
+
private match: Match<P, R>,
|
|
13
|
+
private connection: Connection,
|
|
14
|
+
) {
|
|
15
|
+
super();
|
|
16
|
+
|
|
17
|
+
this.clientStatus = this.connection.get<ClientStatus<P, R>>("ClientStatus");
|
|
18
|
+
|
|
19
|
+
this.register(
|
|
20
|
+
this.match.errorState.on((errorMessage) => {
|
|
21
|
+
this.clientStatus.setErrorMessage(errorMessage);
|
|
22
|
+
}),
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
this.register(
|
|
26
|
+
this.match.result.on((result) => {
|
|
27
|
+
this.clientStatus.setMatchResult(result?.winners?.map((winner) => winner.id ?? ""));
|
|
28
|
+
}),
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
}
|