@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,122 @@
|
|
|
1
|
+
import { ConnectionObject } from "./ConnectionObject";
|
|
2
|
+
import { ConnectionTransport } from "./ConnectionTransport";
|
|
3
|
+
|
|
4
|
+
type Message = {
|
|
5
|
+
name: string;
|
|
6
|
+
fnName: string;
|
|
7
|
+
requestId: number;
|
|
8
|
+
args: any[];
|
|
9
|
+
isResponse: boolean;
|
|
10
|
+
response: any;
|
|
11
|
+
errorMessage: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export class Connection {
|
|
15
|
+
private requestCounter = 0;
|
|
16
|
+
private actualConnectionObjects: ConnectionObject[] = [];
|
|
17
|
+
private registry: { [name: string]: object } = {};
|
|
18
|
+
private requestRegistry: { [id: number]: { resolve: (a: any) => void; reject: (message: string) => void } } = {};
|
|
19
|
+
private unprocessableMessages: Message[] = [];
|
|
20
|
+
|
|
21
|
+
constructor(public transport: ConnectionTransport) {
|
|
22
|
+
this.transport.onReceiveMessage((message) => this.handleMessage(message));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
handleMessage(message: Message) {
|
|
26
|
+
const { name, fnName, requestId, args, isResponse, errorMessage, response } = message;
|
|
27
|
+
|
|
28
|
+
if (isResponse) {
|
|
29
|
+
const { resolve, reject } = this.requestRegistry[requestId];
|
|
30
|
+
if (!resolve) {
|
|
31
|
+
throw new Error("Cannot find requestId");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (errorMessage) {
|
|
35
|
+
reject(errorMessage);
|
|
36
|
+
} else {
|
|
37
|
+
resolve(response);
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
const obj = this.registry[name] as any;
|
|
41
|
+
if (!obj) {
|
|
42
|
+
this.unprocessableMessages.push(message);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const fn = obj[fnName];
|
|
46
|
+
if (!fn) {
|
|
47
|
+
throw new Error(`${fn} is not found`);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
try {
|
|
51
|
+
fn.apply(obj, args)
|
|
52
|
+
.then((response: any) => {
|
|
53
|
+
this.transport.sendMessage({ requestId, response, isResponse: true });
|
|
54
|
+
})
|
|
55
|
+
.catch((error: Error) => {
|
|
56
|
+
console.error(error);
|
|
57
|
+
this.transport.sendMessage({ requestId, errorMessage: error.message ?? error, isResponse: true });
|
|
58
|
+
});
|
|
59
|
+
} catch (error) {
|
|
60
|
+
console.error(error);
|
|
61
|
+
this.transport.sendMessage({
|
|
62
|
+
requestId,
|
|
63
|
+
errorMessage: error instanceof Error ? error.message : error,
|
|
64
|
+
isResponse: true,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
dispose() {
|
|
71
|
+
this.actualConnectionObjects.forEach((conn) => conn.dispose());
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
register<T extends ConnectionObject>(instance: T, name?: string) {
|
|
75
|
+
if (!name) {
|
|
76
|
+
name = Object.getPrototypeOf(instance).constructor.name;
|
|
77
|
+
}
|
|
78
|
+
if (!name) {
|
|
79
|
+
throw new Error("Name must be specified");
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
this.registry[name] = instance;
|
|
83
|
+
this.actualConnectionObjects.push(instance);
|
|
84
|
+
|
|
85
|
+
const messagesToProcess = this.unprocessableMessages;
|
|
86
|
+
this.unprocessableMessages = [];
|
|
87
|
+
messagesToProcess.forEach((message) => this.handleMessage(message));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// wish we didn't have to pass "name" in here... but
|
|
91
|
+
// javascript is javascript
|
|
92
|
+
get<T>(name: string): T {
|
|
93
|
+
let result = this.registry[name];
|
|
94
|
+
if (!result) {
|
|
95
|
+
result = new Proxy(
|
|
96
|
+
{},
|
|
97
|
+
{
|
|
98
|
+
get: (target, prop) => {
|
|
99
|
+
return (...args: any) => {
|
|
100
|
+
const fnName = prop;
|
|
101
|
+
const requestId = this.requestCounter++;
|
|
102
|
+
const result = new Promise((resolve, reject) => {
|
|
103
|
+
this.requestRegistry[requestId] = { resolve, reject };
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
this.transport.sendMessage({
|
|
107
|
+
name,
|
|
108
|
+
fnName,
|
|
109
|
+
requestId,
|
|
110
|
+
args,
|
|
111
|
+
isResponse: false,
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
return result;
|
|
115
|
+
};
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
return result as T;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class ConnectionObject {
|
|
2
|
+
private cbsToCallWhenDisposing: (() => void)[] = [];
|
|
3
|
+
protected register(cb: () => void) {
|
|
4
|
+
this.cbsToCallWhenDisposing.push(cb);
|
|
5
|
+
return cb;
|
|
6
|
+
}
|
|
7
|
+
protected unregister(cb: () => void) {
|
|
8
|
+
this.cbsToCallWhenDisposing = this.cbsToCallWhenDisposing.filter((c) => c !== cb);
|
|
9
|
+
}
|
|
10
|
+
public dispose() {
|
|
11
|
+
this.cbsToCallWhenDisposing.forEach((cb) => cb());
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { EventChannel } from "../utilities/EventChannel";
|
|
2
|
+
|
|
3
|
+
export interface ConnectionTransport {
|
|
4
|
+
sendMessage(message: any): void;
|
|
5
|
+
onReceiveMessage(cb: (message: any) => void): () => void;
|
|
6
|
+
connected: EventChannel<boolean>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const LOCAL_LATENCY_SIMULATION = 50;
|
|
10
|
+
|
|
11
|
+
export class LocalConnectionTransport implements ConnectionTransport {
|
|
12
|
+
public connected = new EventChannel(false);
|
|
13
|
+
private cbs: ((message: any) => void)[] = [];
|
|
14
|
+
private connectedTransport?: LocalConnectionTransport;
|
|
15
|
+
|
|
16
|
+
private queue: (() => void)[] = [];
|
|
17
|
+
|
|
18
|
+
connect(transport: LocalConnectionTransport) {
|
|
19
|
+
this.connectedTransport = transport;
|
|
20
|
+
transport.connectedTransport = this;
|
|
21
|
+
this.connected.value = true;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
sendMessage(message: any): void {
|
|
25
|
+
if (!this.connectedTransport) {
|
|
26
|
+
throw new Error("Not connected");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const copied = JSON.parse(JSON.stringify(message));
|
|
30
|
+
|
|
31
|
+
this.queue.push(() => {
|
|
32
|
+
if (this.connectedTransport) {
|
|
33
|
+
this.connectedTransport.cbs.forEach((cb) => cb(copied));
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
setTimeout(() => this.processMessageOnQueue(), Math.random() * LOCAL_LATENCY_SIMULATION);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
processMessageOnQueue() {
|
|
40
|
+
const cb = this.queue.shift();
|
|
41
|
+
if (cb) {
|
|
42
|
+
cb();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
onReceiveMessage(cb: (message: any) => void): () => void {
|
|
47
|
+
this.cbs.push(cb);
|
|
48
|
+
return () => {
|
|
49
|
+
this.cbs = this.cbs.filter((c) => c !== cb);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { Chit } from "./Chit";
|
|
3
|
+
import TopBarDropdown from "../components/TopBarDropdown";
|
|
4
|
+
import { NonEditable } from "../utilities/Annotations";
|
|
5
|
+
|
|
6
|
+
export abstract class DropdownChit extends Chit {
|
|
7
|
+
/** @internal */
|
|
8
|
+
@NonEditable type = "dropdown";
|
|
9
|
+
|
|
10
|
+
abstract renderLabel(playerId: string): string | ReactNode;
|
|
11
|
+
abstract renderBody(playerId: string): string | ReactNode | ReactNode[];
|
|
12
|
+
|
|
13
|
+
/** @internal */
|
|
14
|
+
render() {
|
|
15
|
+
return <TopBarDropdown label={this.renderLabel("")}>{this.renderBody("")}</TopBarDropdown>;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { GalleryItem, GalleryItemSource } from "../components/GalleryViewer";
|
|
2
|
+
import { chitsToGalleryItems } from "../utilities/GalleryItemConversion";
|
|
3
|
+
import { Chit } from "./Chit";
|
|
4
|
+
|
|
5
|
+
export class GalleryItemChitChildrenSource implements GalleryItemSource {
|
|
6
|
+
private unSub: () => void;
|
|
7
|
+
|
|
8
|
+
constructor(public backingObject: Chit) {
|
|
9
|
+
this.unSub = backingObject.onChange("deserialized", () => {
|
|
10
|
+
this.cbs.forEach((cb) => cb());
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
close() {
|
|
15
|
+
this.unSub();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
get items(): GalleryItem[] {
|
|
19
|
+
const children = this.backingObject.children.concat();
|
|
20
|
+
children.sort((a, b) => a.createdOrder - b.createdOrder);
|
|
21
|
+
return chitsToGalleryItems(children);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
private cbs: (() => void)[] = [];
|
|
25
|
+
registerUpdateHandler(cb: () => void): () => void {
|
|
26
|
+
this.cbs.push(cb);
|
|
27
|
+
return () => {
|
|
28
|
+
this.cbs = this.cbs.filter((c) => c !== cb);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { GalleryItem, GalleryItemSource } from "../components/GalleryViewer";
|
|
2
|
+
|
|
3
|
+
export class GalleryItemRawSource implements GalleryItemSource {
|
|
4
|
+
constructor(private galleryItems: GalleryItem[]) {}
|
|
5
|
+
|
|
6
|
+
get items() {
|
|
7
|
+
return this.galleryItems;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
close() {}
|
|
11
|
+
|
|
12
|
+
registerUpdateHandler() {
|
|
13
|
+
return () => {};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Chit } from "./Chit";
|
|
2
|
+
import { Turn } from "./Turn";
|
|
3
|
+
import { ParameterizedCanvas } from "../utilities/ParameterizedCanvas";
|
|
4
|
+
import { GameTheme } from "./GameTheme";
|
|
5
|
+
import { GameButton } from "./GameButton";
|
|
6
|
+
import { PlayerChit } from "./PlayerChit";
|
|
7
|
+
import { RootChit } from "./RootChit";
|
|
8
|
+
import { ChitRenderSpec } from "../rendering/ChitRenderSpec";
|
|
9
|
+
import { TokenDefinition } from "../components/TokenizedMessage";
|
|
10
|
+
|
|
11
|
+
export interface IChitLibrary<P extends PlayerChit, R extends RootChit<P>> {
|
|
12
|
+
[key: string]: new () => Chit;
|
|
13
|
+
Player: new () => P;
|
|
14
|
+
Root: new () => R;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface ICanvasLibrary {
|
|
18
|
+
[key: string]: new () => ParameterizedCanvas;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface IButtonLibrary {
|
|
22
|
+
[key: string]: new () => GameButton;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type GameResult<P extends PlayerChit> = {
|
|
26
|
+
winners: P[];
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Core entry point for a pretty-chitty game. This needs to ultimately provide:
|
|
31
|
+
* - A way to generate players
|
|
32
|
+
* - A way to generate the root chit
|
|
33
|
+
* - An async `run` method to actually execute the game logic
|
|
34
|
+
* - A library of chits, buttons and canvases
|
|
35
|
+
*
|
|
36
|
+
* See documentation on {@link Turn} for more details on how to structure your game logic.
|
|
37
|
+
*
|
|
38
|
+
* @group Core Game Elements
|
|
39
|
+
*/
|
|
40
|
+
export interface Game<P extends PlayerChit, R extends RootChit<P>> {
|
|
41
|
+
get theme(): GameTheme;
|
|
42
|
+
get name(): string;
|
|
43
|
+
get chitLibrary(): IChitLibrary<P, R>;
|
|
44
|
+
get canvasLibrary(): ICanvasLibrary;
|
|
45
|
+
get buttonLibrary(): IButtonLibrary;
|
|
46
|
+
tokenMap?: { [key: string]: TokenDefinition };
|
|
47
|
+
|
|
48
|
+
run(setup: Turn<GameResult<P>, P, R>, rootChit: R): Promise<GameResult<P>>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Useful if you want consistent lighting and ornaments for all of your panels
|
|
52
|
+
* @param spec
|
|
53
|
+
*/
|
|
54
|
+
renderDefaultRootChit?(spec: ChitRenderSpec): void;
|
|
55
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { NonEditable } from "../utilities/Annotations";
|
|
2
|
+
import { Chit } from "./Chit";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A GameBag is an infinite supply of a game component available to the game. It's important that it allows
|
|
6
|
+
* players taking concurrent turns to all oeprate against this same bag without creating a mismatch conflict.
|
|
7
|
+
*
|
|
8
|
+
* @group Chits
|
|
9
|
+
*/
|
|
10
|
+
export abstract class GameBagChit<T extends Chit> extends Chit {
|
|
11
|
+
@NonEditable type = "bag";
|
|
12
|
+
|
|
13
|
+
public abstract chitGenerator(): T;
|
|
14
|
+
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
|
+
override shouldRenderChild(childChit: Chit): boolean {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
draw(): T {
|
|
21
|
+
const chit = this.chitGenerator();
|
|
22
|
+
chit.parentFallback = this;
|
|
23
|
+
return chit;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
drawMultiple(count: number): T[] {
|
|
27
|
+
const chits = [...new Array(count)].map(() =>
|
|
28
|
+
this.chitGenerator().set((c) => {
|
|
29
|
+
c.parentFallback = this;
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
32
|
+
return chits;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
discard(chit: T | T[]): void {
|
|
36
|
+
if (Array.isArray(chit)) {
|
|
37
|
+
chit.forEach((c) => c.removeFromParent());
|
|
38
|
+
} else {
|
|
39
|
+
chit.removeFromParent();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { Check, Flip } from "@mui/icons-material";
|
|
2
|
+
import { BottomBarButtonIcon } from "../components/BottomBarButton";
|
|
3
|
+
import { ButtonPick, ChitPick, FindChit } from "./Pick";
|
|
4
|
+
import { NonEditable } from "../utilities/Annotations";
|
|
5
|
+
import { Chit } from "./Chit";
|
|
6
|
+
import { GalleryItemSource } from "../components/GalleryViewer";
|
|
7
|
+
import { GalleryItemChitChildrenSource } from "./GalleryItemChitChildrenSource";
|
|
8
|
+
import { GalleryItemRawSource } from "./GalleryItemRawSource";
|
|
9
|
+
import { chitsToGalleryItems } from "../utilities/GalleryItemConversion";
|
|
10
|
+
|
|
11
|
+
export type ButtonCallback = () => void | Promise<void>;
|
|
12
|
+
|
|
13
|
+
export class GameButton {
|
|
14
|
+
/** @internal */
|
|
15
|
+
@NonEditable type = "button";
|
|
16
|
+
|
|
17
|
+
public icon: BottomBarButtonIcon = Flip;
|
|
18
|
+
public label: string = "Flip Me";
|
|
19
|
+
public message: string | undefined;
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
public canAutoResolve = true;
|
|
23
|
+
|
|
24
|
+
constructor(public cb?: ButtonCallback) {}
|
|
25
|
+
|
|
26
|
+
static pick(button: GameButton): ButtonPick {
|
|
27
|
+
const result = new ButtonPick();
|
|
28
|
+
result.messageContents = button.message;
|
|
29
|
+
result.button = button;
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public pick(): ButtonPick {
|
|
34
|
+
return GameButton.pick(this);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public set(cb: (chit: this) => void): this {
|
|
38
|
+
cb(this);
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** @internal */
|
|
43
|
+
serialize(): any {
|
|
44
|
+
return {};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
48
|
+
/** @internal */
|
|
49
|
+
deserialize(config: any, findChit: FindChit) {}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export class ToggleGalleryButton extends GameButton {
|
|
53
|
+
autoShow = true;
|
|
54
|
+
|
|
55
|
+
/** @internal */
|
|
56
|
+
parentChit?: Chit;
|
|
57
|
+
|
|
58
|
+
/** @internal */
|
|
59
|
+
galleryItemSource?: GalleryItemSource;
|
|
60
|
+
|
|
61
|
+
setParentChit(parentChit: Chit): this {
|
|
62
|
+
this.parentChit = parentChit;
|
|
63
|
+
return this;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** @internal */
|
|
67
|
+
serialize() {
|
|
68
|
+
return {
|
|
69
|
+
parentChitId: this.parentChit?.id,
|
|
70
|
+
autoShow: this.autoShow,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** @internal */
|
|
75
|
+
deserialize({ parentChitId, autoShow }: { parentChitId?: string; autoShow: boolean }, findChit: FindChit) {
|
|
76
|
+
if (parentChitId) {
|
|
77
|
+
this.parentChit = findChit(parentChitId);
|
|
78
|
+
}
|
|
79
|
+
this.autoShow = autoShow;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** @internal */
|
|
83
|
+
computeItemSource(chitPick: ChitPick<any>) {
|
|
84
|
+
if (this.parentChit) {
|
|
85
|
+
this.galleryItemSource = new GalleryItemChitChildrenSource(this.parentChit);
|
|
86
|
+
} else {
|
|
87
|
+
this.galleryItemSource = new GalleryItemRawSource(chitsToGalleryItems(chitPick.chits));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export abstract class DynamicGameButton<T> extends GameButton {
|
|
93
|
+
private spec: T | undefined;
|
|
94
|
+
|
|
95
|
+
config(spec: T): this {
|
|
96
|
+
this.spec = spec;
|
|
97
|
+
this.process(spec);
|
|
98
|
+
return this;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
abstract process(spec: T): void;
|
|
102
|
+
|
|
103
|
+
/** @internal */
|
|
104
|
+
serialize(): any {
|
|
105
|
+
if (this.spec === undefined) {
|
|
106
|
+
throw "Not configured";
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return {
|
|
110
|
+
spec: this.spec,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
115
|
+
/** @internal */
|
|
116
|
+
deserialize({ spec }: { spec: T }) {
|
|
117
|
+
this.spec = spec;
|
|
118
|
+
this.process(this.spec);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export class Confirm extends GameButton {
|
|
123
|
+
label = "Confirm";
|
|
124
|
+
icon = Check;
|
|
125
|
+
/** @internal */
|
|
126
|
+
canAutoResolve = false;
|
|
127
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { NonEditable } from "../utilities/Annotations";
|
|
2
|
+
import { Chit } from "./Chit";
|
|
3
|
+
|
|
4
|
+
export type Stage<T> = {
|
|
5
|
+
type: "draw" | "discard";
|
|
6
|
+
chits: T[];
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A GameDeck contains a fixed number of chits. The deck is broken into "stages", and all draws happen from the top stage.
|
|
11
|
+
* Discards are added to a bottom stage. If a stage is empty, the stage is removed and all other stages move up in line.
|
|
12
|
+
* If you need to draw a card from the discard stage, it becomes a primary stage and a new discard stage is created.
|
|
13
|
+
*
|
|
14
|
+
* @group Chits
|
|
15
|
+
*/
|
|
16
|
+
export class GameDeckChit<T extends Chit> extends Chit {
|
|
17
|
+
@NonEditable type = "deck";
|
|
18
|
+
|
|
19
|
+
public chitGenerator?: () => T;
|
|
20
|
+
public stages: Stage<T>[] = [];
|
|
21
|
+
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
23
|
+
override shouldRenderChild(childChit: Chit): boolean {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async draw(message?: string): Promise<T | undefined> {
|
|
28
|
+
while (this.isEmpty(this.stages[0])) {
|
|
29
|
+
this.stages.shift();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const stage = this.stages[0];
|
|
33
|
+
if (stage) {
|
|
34
|
+
switch (stage.type) {
|
|
35
|
+
case "draw": {
|
|
36
|
+
const index = Math.floor(stage.chits.length * (await this.currentTurn.rng(message)));
|
|
37
|
+
const selected = stage.chits[index];
|
|
38
|
+
stage.chits.splice(index, 1);
|
|
39
|
+
selected.setParent();
|
|
40
|
+
return selected;
|
|
41
|
+
}
|
|
42
|
+
case "discard": {
|
|
43
|
+
stage.type = "draw";
|
|
44
|
+
return this.draw(message);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (this.chitGenerator) {
|
|
50
|
+
return this.chitGenerator();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
private isEmpty(stage?: Stage<T>) {
|
|
55
|
+
return stage?.chits.length === 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
private findDiscardStage() {
|
|
59
|
+
if (!(this.stages[this.stages.length - 1]?.type === "discard")) {
|
|
60
|
+
this.stages.push({ type: "discard", chits: [] });
|
|
61
|
+
}
|
|
62
|
+
return this.stages[this.stages.length - 1];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
discard(chit: T | T[]) {
|
|
66
|
+
if (Array.isArray(chit)) {
|
|
67
|
+
chit.forEach((chit) => this.orderedChildren.add(chit));
|
|
68
|
+
const stage = this.findDiscardStage();
|
|
69
|
+
stage.chits = stage.chits.concat(chit);
|
|
70
|
+
} else {
|
|
71
|
+
this.orderedChildren.add(chit);
|
|
72
|
+
this.findDiscardStage().chits.push(chit);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// TODO: add functions stackTop(shuffled), stackBottom(shuffled),
|
|
77
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import Color from "color";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Controls color scheme and layout options for all things in a pretty-chitty game. Much of
|
|
5
|
+
* this can be overridden per chit, but some cannot. For example, the background color of the game
|
|
6
|
+
* is controlled here while the default chitHighlightColor is set here, but can be overridden per chit.
|
|
7
|
+
*
|
|
8
|
+
* Highly recommend using `GameTheme.withDefaults(primaryColor, highlightColor, textColor)` to
|
|
9
|
+
* generate a base theme and then override what you need from there.
|
|
10
|
+
*
|
|
11
|
+
* @group Core Game Elements
|
|
12
|
+
*/
|
|
13
|
+
export class GameTheme {
|
|
14
|
+
public backgroundColor = "#0f0119";
|
|
15
|
+
|
|
16
|
+
public spacing = 8;
|
|
17
|
+
public bottomBarHeight = 80;
|
|
18
|
+
public topBarHeight = 40;
|
|
19
|
+
public barColor = "#1c092c";
|
|
20
|
+
public barGradientPercent = 0.05;
|
|
21
|
+
public barGradientAngle = 110;
|
|
22
|
+
|
|
23
|
+
public backgroundGradientPercent = 0.2;
|
|
24
|
+
public backgroundGradientAngle = 150;
|
|
25
|
+
|
|
26
|
+
public actionBarColor = "#3a1957";
|
|
27
|
+
public actionBarAnimationDuration = 0.3;
|
|
28
|
+
public actionBarContextColor = "#3a1957";
|
|
29
|
+
public actionBarContextAnimationDuration = 0.3;
|
|
30
|
+
public actionBarContextShadow = "rgba(0,0,0,0.2)";
|
|
31
|
+
|
|
32
|
+
public barTextColor = "rgba(255,255,255,0.6)";
|
|
33
|
+
public barTextHighlightColor = "rgba(255,255,255,0.6)";
|
|
34
|
+
public barBreak = "rgba(255,255,255,0.3)";
|
|
35
|
+
public barActiveTextColor = "rgba(255,255,255,0.9)";
|
|
36
|
+
public barHighlightTextColor = "#66d5c1";
|
|
37
|
+
public barDisabledTextColor = "rgba(255,255,255,0.2)";
|
|
38
|
+
public panelSlotColor = "#858b99";
|
|
39
|
+
public panelSlotSelectedColor = "#66d5c1";
|
|
40
|
+
public fullResetColor = "#66d5c1";
|
|
41
|
+
public barTopDropdownColor = "#1c092c";
|
|
42
|
+
public barTopLineColor = "rgba(255,255,255,0.1)";
|
|
43
|
+
|
|
44
|
+
public endGameBackgroundColor = "#1c092c";
|
|
45
|
+
public endGameTextColor = "rgba(255,255,255,1)";
|
|
46
|
+
|
|
47
|
+
public chitHighlightColor = "#66d5c1";
|
|
48
|
+
public chitOutlineWidth = 3;
|
|
49
|
+
public chitOutlineStrength = 0.75;
|
|
50
|
+
|
|
51
|
+
public panelSelectionCutoutBackground = "#ffffff";
|
|
52
|
+
public panelSelectionCutoutSelected = "#66d5c1";
|
|
53
|
+
|
|
54
|
+
public dialogBackgroundColor = "rgba(0,0,0,0.5)";
|
|
55
|
+
public dialogForegroundColor = "#ffffff";
|
|
56
|
+
public dialogFontSize = 14;
|
|
57
|
+
|
|
58
|
+
public sparkForegroundColor = "#222";
|
|
59
|
+
public sparkDuration = 200;
|
|
60
|
+
public sparkBorderWidth = 4;
|
|
61
|
+
public sparkPadding = 2;
|
|
62
|
+
public sparkBorderColor = "rgba(0,0,0,0.3)";
|
|
63
|
+
public sparkFlashColor = "#0ff";
|
|
64
|
+
public sparkSize = 20;
|
|
65
|
+
public sparkFontSize = 12;
|
|
66
|
+
public topBarDropShadowColor = "rgba(0,0,0,0.7)";
|
|
67
|
+
public topBarPlayerDropShadowColor = "rgba(0,0,0,0.2)";
|
|
68
|
+
|
|
69
|
+
public galleryItemWidth = 150;
|
|
70
|
+
public galleryItemHeight: number | undefined;
|
|
71
|
+
public galleryItemSpacing = 20;
|
|
72
|
+
|
|
73
|
+
public gallerySummaryBackgroundColor = "#000000";
|
|
74
|
+
public gallerySummaryBackgroundOpacity = 0.7;
|
|
75
|
+
|
|
76
|
+
public actionLogBackgroundColor = "rgba(255,255,255,0.05)";
|
|
77
|
+
public actionLogDialogBackgroundColor = "#000000";
|
|
78
|
+
public actionLogDialogHighlightBackgroundColor = "rgba(255,255,255,0.3)";
|
|
79
|
+
public actionLogTextColor = "#ffffff";
|
|
80
|
+
public actionBarWidth = 600;
|
|
81
|
+
public actionBarLinesToShow = 2;
|
|
82
|
+
|
|
83
|
+
/** Reference to .png or .jpg file to show as box art in advertising the game */
|
|
84
|
+
public boxArt = "";
|
|
85
|
+
/** Reference to .png or .jpg file to show as a screenshot in advertising the game */
|
|
86
|
+
public screenshot = "";
|
|
87
|
+
|
|
88
|
+
static withDefaults(primaryColor: string, highlight: string, textColor: string = "#ffffff") {
|
|
89
|
+
const result = new GameTheme();
|
|
90
|
+
result.chitHighlightColor = highlight;
|
|
91
|
+
result.backgroundColor = Color(primaryColor).darken(0.5).hex();
|
|
92
|
+
result.barColor = primaryColor;
|
|
93
|
+
result.actionBarColor = Color(primaryColor).mix(Color(highlight), 0.4).hex();
|
|
94
|
+
result.actionBarContextColor = primaryColor;
|
|
95
|
+
result.fullResetColor = highlight;
|
|
96
|
+
result.barHighlightTextColor = highlight;
|
|
97
|
+
result.barTopDropdownColor = Color(primaryColor).mix(Color(highlight), 0.1).alpha(0.9).hexa();
|
|
98
|
+
result.barTextHighlightColor = highlight;
|
|
99
|
+
|
|
100
|
+
result.endGameBackgroundColor = result.barTopDropdownColor;
|
|
101
|
+
|
|
102
|
+
result.barTextColor = Color(textColor).alpha(0.9).hexa();
|
|
103
|
+
result.barTextHighlightColor = Color(textColor).mix(Color(highlight), 0.5).alpha(0.9).hexa();
|
|
104
|
+
result.barBreak = Color(textColor).alpha(0.3).hexa();
|
|
105
|
+
result.barActiveTextColor = Color(textColor).alpha(0.9).hexa();
|
|
106
|
+
result.barTopLineColor = Color(textColor).alpha(0.1).hexa();
|
|
107
|
+
result.endGameTextColor = Color(textColor).alpha(1).hexa();
|
|
108
|
+
|
|
109
|
+
result.barDisabledTextColor = Color(result.barColor).isLight()
|
|
110
|
+
? Color(result.barColor).darken(0.75).hexa()
|
|
111
|
+
: Color(result.barColor).lighten(0.75).hexa();
|
|
112
|
+
|
|
113
|
+
result.actionLogTextColor = result.barActiveTextColor;
|
|
114
|
+
result.actionLogDialogBackgroundColor = result.backgroundColor;
|
|
115
|
+
|
|
116
|
+
return result;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
layoutSize(width: number): "large" | "medium" | "mobile" {
|
|
120
|
+
return width >= this.actionBarWidth * 2 ? "large" : width >= this.actionBarWidth * 1.3 ? "medium" : "mobile";
|
|
121
|
+
}
|
|
122
|
+
}
|