@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,181 @@
|
|
|
1
|
+
import { Box, Stack, SvgIconTypeMap, Typography } from "@mui/material";
|
|
2
|
+
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
+
import { useGameTheme } from "../hooks/useGameTheme";
|
|
4
|
+
import { LongPressEventType, useLongPress } from "use-long-press";
|
|
5
|
+
import useHover from "@react-hook/hover";
|
|
6
|
+
import { OverridableComponent } from "@mui/material/OverridableComponent";
|
|
7
|
+
import { useInterval } from "react-interval-hook";
|
|
8
|
+
import { ZINDEX_BOTTOM_BAR_BUTTON_LABEL, ZINDEX_BOTTOM_BAR_BUTTON_LONG_CLICK } from "../utilities/zIndex";
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
11
|
+
export type BottomBarButtonIcon = OverridableComponent<SvgIconTypeMap<{}, "svg">> & { muiName: string };
|
|
12
|
+
|
|
13
|
+
export default function BottomBarButton({
|
|
14
|
+
icon,
|
|
15
|
+
label,
|
|
16
|
+
highlight = false,
|
|
17
|
+
disabled = false,
|
|
18
|
+
removeLabel = false,
|
|
19
|
+
onClick,
|
|
20
|
+
onLongClick,
|
|
21
|
+
whileHolding,
|
|
22
|
+
}: {
|
|
23
|
+
icon: BottomBarButtonIcon;
|
|
24
|
+
label?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
removeLabel?: boolean;
|
|
27
|
+
highlight?: boolean;
|
|
28
|
+
onClick?: () => void;
|
|
29
|
+
onLongClick?: () => void;
|
|
30
|
+
whileHolding?: (steps: number) => void;
|
|
31
|
+
}) {
|
|
32
|
+
if (disabled) {
|
|
33
|
+
onClick = undefined;
|
|
34
|
+
onLongClick = undefined;
|
|
35
|
+
whileHolding = undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const theme = useGameTheme();
|
|
39
|
+
const ref = useRef(null);
|
|
40
|
+
const hovered = useHover(ref);
|
|
41
|
+
|
|
42
|
+
let listenForLongPress = true;
|
|
43
|
+
|
|
44
|
+
const INTERVAL = 400;
|
|
45
|
+
const [holdStart, setHoldStart] = useState(0);
|
|
46
|
+
const holdFn = useCallback(() => {
|
|
47
|
+
const steps = holdStart ? Math.round((Date.now() - holdStart) / INTERVAL) : 0;
|
|
48
|
+
if (whileHolding) {
|
|
49
|
+
whileHolding(Math.round(Math.pow(steps + 1, 1.5)));
|
|
50
|
+
}
|
|
51
|
+
}, [whileHolding, holdStart]);
|
|
52
|
+
|
|
53
|
+
if (!whileHolding) {
|
|
54
|
+
listenForLongPress = false;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const { start, stop } = useInterval(holdFn, INTERVAL, {
|
|
58
|
+
autoStart: false,
|
|
59
|
+
immediate: true,
|
|
60
|
+
selfCorrecting: false,
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
// eslint-disable-next-line prefer-const
|
|
64
|
+
let [isPressed, setIsPressed] = useState(false);
|
|
65
|
+
|
|
66
|
+
// Stop interval and reset state when button becomes disabled
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
if (disabled) {
|
|
69
|
+
setIsPressed(false);
|
|
70
|
+
setHoldStart(0);
|
|
71
|
+
stop();
|
|
72
|
+
}
|
|
73
|
+
}, [disabled, stop]);
|
|
74
|
+
|
|
75
|
+
const LONG_PRESS_SECONDS = 1.25;
|
|
76
|
+
const bind = useLongPress(
|
|
77
|
+
() => {
|
|
78
|
+
// long press done!
|
|
79
|
+
onLongClick && onLongClick();
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
onStart: () => {
|
|
83
|
+
setIsPressed(true);
|
|
84
|
+
if (listenForLongPress) {
|
|
85
|
+
setHoldStart(Date.now());
|
|
86
|
+
start();
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
onFinish: () => {
|
|
90
|
+
setIsPressed(false);
|
|
91
|
+
if (listenForLongPress) {
|
|
92
|
+
setHoldStart(0);
|
|
93
|
+
stop();
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
onCancel: () => {
|
|
97
|
+
setIsPressed(false);
|
|
98
|
+
if (listenForLongPress) {
|
|
99
|
+
setHoldStart(0);
|
|
100
|
+
stop();
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
onMove: () => {
|
|
104
|
+
// console.log("Detected mouse or touch movement"),
|
|
105
|
+
},
|
|
106
|
+
filterEvents: () => true,
|
|
107
|
+
threshold: LONG_PRESS_SECONDS * 1000,
|
|
108
|
+
captureEvent: true,
|
|
109
|
+
cancelOnMovement: 25,
|
|
110
|
+
cancelOutsideElement: true,
|
|
111
|
+
detect: LongPressEventType.Pointer,
|
|
112
|
+
},
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
label = label?.toUpperCase();
|
|
116
|
+
let color = theme.barTextColor;
|
|
117
|
+
let textShadowColor: string | null = null;
|
|
118
|
+
if (hovered) {
|
|
119
|
+
color = theme.barActiveTextColor;
|
|
120
|
+
textShadowColor = theme.barActiveTextColor;
|
|
121
|
+
}
|
|
122
|
+
if (disabled) {
|
|
123
|
+
color = theme.barDisabledTextColor;
|
|
124
|
+
textShadowColor = null;
|
|
125
|
+
isPressed = false;
|
|
126
|
+
}
|
|
127
|
+
const IconType = icon;
|
|
128
|
+
|
|
129
|
+
const iconColor = highlight ? theme.barTextHighlightColor : color;
|
|
130
|
+
|
|
131
|
+
return (
|
|
132
|
+
<Box
|
|
133
|
+
ref={ref}
|
|
134
|
+
onClick={() => {
|
|
135
|
+
if (onClick) {
|
|
136
|
+
onClick();
|
|
137
|
+
}
|
|
138
|
+
}}
|
|
139
|
+
{...bind()}
|
|
140
|
+
sx={{
|
|
141
|
+
position: "relative",
|
|
142
|
+
top: isPressed ? 1 : 0,
|
|
143
|
+
left: isPressed ? 1 : 0,
|
|
144
|
+
userSelect: "none",
|
|
145
|
+
cursor: !disabled ? "pointer" : undefined,
|
|
146
|
+
p: 1,
|
|
147
|
+
height: "100%",
|
|
148
|
+
textShadow: textShadowColor && `0 0 4px ${textShadowColor}`,
|
|
149
|
+
color,
|
|
150
|
+
transition: "color linear 0.25s, left linear 0.05s, top linear 0.05s",
|
|
151
|
+
}}
|
|
152
|
+
>
|
|
153
|
+
{onLongClick && (
|
|
154
|
+
<Box
|
|
155
|
+
sx={{
|
|
156
|
+
background: theme.fullResetColor,
|
|
157
|
+
left: 0,
|
|
158
|
+
right: 0,
|
|
159
|
+
bottom: 0,
|
|
160
|
+
zIndex: ZINDEX_BOTTOM_BAR_BUTTON_LONG_CLICK,
|
|
161
|
+
borderRadius: "200px",
|
|
162
|
+
position: "absolute",
|
|
163
|
+
transition: `transform ease-out ${isPressed ? LONG_PRESS_SECONDS : 0.1}s`,
|
|
164
|
+
transform: isPressed ? "scale(1.1)" : "scale(0)",
|
|
165
|
+
top: 0,
|
|
166
|
+
}}
|
|
167
|
+
/>
|
|
168
|
+
)}
|
|
169
|
+
<Stack sx={{ position: "relative", zIndex: ZINDEX_BOTTOM_BAR_BUTTON_LABEL, height: "100%" }}>
|
|
170
|
+
<Box flex={1} />
|
|
171
|
+
<Box sx={{ color: iconColor, fontSize: "30px", lineHeight: "30px", height: "30px", textAlign: "center" }}>
|
|
172
|
+
<IconType fontSize="inherit" />
|
|
173
|
+
</Box>
|
|
174
|
+
{!removeLabel && (
|
|
175
|
+
<Typography sx={{ textAlign: "center", mt: 0.5, fontSize: 12 }}>{label ?? "\u00a0"}</Typography>
|
|
176
|
+
)}
|
|
177
|
+
<Box flex={1} />
|
|
178
|
+
</Stack>
|
|
179
|
+
</Box>
|
|
180
|
+
);
|
|
181
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React, { useMemo, useEffect, useState } from "react";
|
|
2
|
+
|
|
3
|
+
import { Box, ToggleButton, ToggleButtonGroup } from "@mui/material";
|
|
4
|
+
import {
|
|
5
|
+
FormatColorFill,
|
|
6
|
+
PhotoSizeSelectSmall,
|
|
7
|
+
PhotoSizeSelectActual,
|
|
8
|
+
PhotoSizeSelectLarge,
|
|
9
|
+
GridOn,
|
|
10
|
+
GridOff,
|
|
11
|
+
} from "@material-ui/icons";
|
|
12
|
+
|
|
13
|
+
import UpdatingCanvasViewer, { Size } from "./UpdatingCanvasViewer";
|
|
14
|
+
import ObjectWithPropsEditor from "./ObjectWithPropsEditor";
|
|
15
|
+
import { ParameterizedCanvas } from "../utilities/ParameterizedCanvas";
|
|
16
|
+
import { IUpdatingCanvas } from "../utilities/IUpdatingCanvas";
|
|
17
|
+
import StageAndEditor from "./StageAndEditor";
|
|
18
|
+
import SelectableItemAndStage from "./SelectableItemAndStage";
|
|
19
|
+
import useLocalStorageState from "use-local-storage-state";
|
|
20
|
+
|
|
21
|
+
export interface ICanvasLibrary {
|
|
22
|
+
[key: string]: new () => ParameterizedCanvas;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function Editor({ size, ClassDef }: { size: Size; ClassDef: new () => ParameterizedCanvas }) {
|
|
26
|
+
const instance = useMemo(() => ClassDef && new ClassDef(), [ClassDef]);
|
|
27
|
+
const [canvas, setCanvas] = useState<IUpdatingCanvas | null>(null);
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (!instance) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
setCanvas(instance.get());
|
|
35
|
+
return instance.onChange(null, () => setCanvas(instance.get()));
|
|
36
|
+
}, [instance]);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<StageAndEditor editor={<ObjectWithPropsEditor obj={instance} />}>
|
|
40
|
+
<Box sx={{ p: 3 }}>{canvas && <UpdatingCanvasViewer size={size} updatingCanvas={instance.get()} />}</Box>
|
|
41
|
+
</StageAndEditor>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default function CanvasLibraryViewer({ library }: { library: ICanvasLibrary }) {
|
|
46
|
+
const items = useMemo(() => Object.keys(library), [library]);
|
|
47
|
+
const [selectedSize, setSelectedSize] = useLocalStorageState<Size>("canvasLibrarySize", {
|
|
48
|
+
defaultValue: "actual",
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<SelectableItemAndStage
|
|
53
|
+
keySpace="canvasLibrary"
|
|
54
|
+
topOptions={
|
|
55
|
+
<ToggleButtonGroup
|
|
56
|
+
exclusive
|
|
57
|
+
size="small"
|
|
58
|
+
sx={{ m: 2 }}
|
|
59
|
+
value={selectedSize}
|
|
60
|
+
onChange={(e, newValue) => setSelectedSize(newValue)}
|
|
61
|
+
>
|
|
62
|
+
<ToggleButton value="actual">
|
|
63
|
+
<PhotoSizeSelectActual />
|
|
64
|
+
</ToggleButton>
|
|
65
|
+
<ToggleButton value="fill">
|
|
66
|
+
<FormatColorFill />
|
|
67
|
+
</ToggleButton>
|
|
68
|
+
<ToggleButton value="small">
|
|
69
|
+
<PhotoSizeSelectSmall />
|
|
70
|
+
</ToggleButton>
|
|
71
|
+
<ToggleButton value="large">
|
|
72
|
+
<PhotoSizeSelectLarge />
|
|
73
|
+
</ToggleButton>
|
|
74
|
+
<ToggleButton value="tile">
|
|
75
|
+
<GridOn />
|
|
76
|
+
</ToggleButton>
|
|
77
|
+
<ToggleButton value="small_tile">
|
|
78
|
+
<GridOff />
|
|
79
|
+
</ToggleButton>
|
|
80
|
+
</ToggleButtonGroup>
|
|
81
|
+
}
|
|
82
|
+
items={items}
|
|
83
|
+
render={(item) => <Editor size={selectedSize} ClassDef={library[item]} />}
|
|
84
|
+
/>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import React, { useMemo, useEffect, useState, useRef } from "react";
|
|
2
|
+
|
|
3
|
+
import ObjectWithPropsEditor from "./ObjectWithPropsEditor";
|
|
4
|
+
import StageAndEditor from "./StageAndEditor";
|
|
5
|
+
import SelectableItemAndStage from "./SelectableItemAndStage";
|
|
6
|
+
import { Chit } from "../game/Chit";
|
|
7
|
+
import Viewer from "./Viewer";
|
|
8
|
+
import { Box, Checkbox, FormControlLabel, MenuItem, Select, Stack, Typography } from "@mui/material";
|
|
9
|
+
import { BaseTable } from "../utilities/BaseTable";
|
|
10
|
+
import { ChitRenderSpec } from "../rendering/ChitRenderSpec";
|
|
11
|
+
import useLocalStorageState from "use-local-storage-state";
|
|
12
|
+
import { useTimeState } from "../hooks/useTimeController";
|
|
13
|
+
import useSize from "@react-hook/size";
|
|
14
|
+
import { PlayerProvider } from "../hooks/usePlayer";
|
|
15
|
+
|
|
16
|
+
export interface IChitLibrary {
|
|
17
|
+
[key: string]: new () => Chit;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function ResizingViewer({ wireframes, chit }: { wireframes: boolean; chit: Chit }) {
|
|
21
|
+
const ref = useRef(null);
|
|
22
|
+
const [width, height] = useSize(ref);
|
|
23
|
+
return (
|
|
24
|
+
<Box sx={{ position: "absolute", top: 0, right: 0, left: 0, bottom: 0, overflow: "hidden" }} ref={ref}>
|
|
25
|
+
<PlayerProvider playerId="abc">
|
|
26
|
+
<Viewer w={width} h={height} wireframes={wireframes} chit={chit} />
|
|
27
|
+
</PlayerProvider>
|
|
28
|
+
</Box>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function Editor({
|
|
33
|
+
wireframes = false,
|
|
34
|
+
ClassDef,
|
|
35
|
+
ParentClassDef,
|
|
36
|
+
}: {
|
|
37
|
+
wireframes: boolean;
|
|
38
|
+
ClassDef: new () => Chit;
|
|
39
|
+
ParentClassDef?: new () => Chit;
|
|
40
|
+
}) {
|
|
41
|
+
const timeState = useTimeState();
|
|
42
|
+
const [instance, setInstance] = useState<Chit | undefined>();
|
|
43
|
+
const [parentInstance, setParentInstance] = useState<Chit | undefined>();
|
|
44
|
+
const [rootInstance, setRootInstance] = useState<Chit | undefined>();
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (!ClassDef) {
|
|
48
|
+
setInstance(undefined);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const newInstance = new ClassDef();
|
|
53
|
+
setInstance(newInstance);
|
|
54
|
+
return () => newInstance.removeFromParent();
|
|
55
|
+
}, [ClassDef]);
|
|
56
|
+
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (ParentClassDef) {
|
|
59
|
+
const newInstance = new ParentClassDef();
|
|
60
|
+
setParentInstance(newInstance);
|
|
61
|
+
return () => newInstance.removeFromParent();
|
|
62
|
+
} else {
|
|
63
|
+
setParentInstance(undefined);
|
|
64
|
+
}
|
|
65
|
+
}, [ParentClassDef]);
|
|
66
|
+
|
|
67
|
+
const BT = BaseTable;
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
let needsToHaveStageCreated = true;
|
|
70
|
+
|
|
71
|
+
if (!instance) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
try {
|
|
76
|
+
timeState.animationSpeedMultiplier.value = 1;
|
|
77
|
+
timeState.isLoading.value = false;
|
|
78
|
+
setTimeout(() => rootInstance?.renderInstance?.tweenGroup?.update(Number.MAX_SAFE_INTEGER), 10);
|
|
79
|
+
|
|
80
|
+
const instanceRenderResult = new ChitRenderSpec(instance);
|
|
81
|
+
instance.render(instanceRenderResult);
|
|
82
|
+
parentInstance?.add(instance);
|
|
83
|
+
if (instanceRenderResult.camera || instanceRenderResult.lightSpec) {
|
|
84
|
+
needsToHaveStageCreated = false;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (parentInstance) {
|
|
88
|
+
needsToHaveStageCreated = true;
|
|
89
|
+
const parentRenderResult = new ChitRenderSpec(parentInstance);
|
|
90
|
+
parentInstance.render(parentRenderResult);
|
|
91
|
+
if (parentRenderResult.camera || parentRenderResult.lightSpec) {
|
|
92
|
+
needsToHaveStageCreated = false;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (needsToHaveStageCreated) {
|
|
97
|
+
if (!(rootInstance instanceof BT)) {
|
|
98
|
+
const stage = new BT();
|
|
99
|
+
stage.add(parentInstance ?? instance);
|
|
100
|
+
stage.target = instance;
|
|
101
|
+
stage.parentTarget = parentInstance;
|
|
102
|
+
setRootInstance(stage);
|
|
103
|
+
} else {
|
|
104
|
+
rootInstance.add(parentInstance ?? instance);
|
|
105
|
+
rootInstance.target = instance;
|
|
106
|
+
rootInstance.parentTarget = parentInstance;
|
|
107
|
+
rootInstance.notifyChange("target");
|
|
108
|
+
rootInstance.notifyChange("parentTarget");
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
setRootInstance(parentInstance ?? instance);
|
|
112
|
+
}
|
|
113
|
+
} catch (e) {
|
|
114
|
+
console.error(e);
|
|
115
|
+
}
|
|
116
|
+
}, [timeState, instance, parentInstance, rootInstance, BT]);
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
<StageAndEditor editor={rootInstance && <ObjectWithPropsEditor obj={rootInstance} />}>
|
|
120
|
+
{rootInstance && <ResizingViewer wireframes={wireframes} chit={rootInstance} />}
|
|
121
|
+
</StageAndEditor>
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export default function ChitLibraryViewer({ library }: { library: IChitLibrary }) {
|
|
126
|
+
const items = useMemo(() => Object.keys(library), [library]);
|
|
127
|
+
const [parentType, setParentType] = useLocalStorageState<string>("chitLibraryParentType", {
|
|
128
|
+
defaultValue: "",
|
|
129
|
+
});
|
|
130
|
+
const [wireframes, setWireframes] = useLocalStorageState<boolean>("showBoundingBoxes", { defaultValue: false });
|
|
131
|
+
|
|
132
|
+
return (
|
|
133
|
+
<SelectableItemAndStage
|
|
134
|
+
keySpace="chitLibrary"
|
|
135
|
+
topOptions={
|
|
136
|
+
<Stack direction="row">
|
|
137
|
+
<Typography sx={{ ml: 4, lineHeight: 4 }}>Parent:</Typography>
|
|
138
|
+
<Select
|
|
139
|
+
variant="standard"
|
|
140
|
+
sx={{ m: 2, width: 200 }}
|
|
141
|
+
value={parentType}
|
|
142
|
+
label="Select Choice"
|
|
143
|
+
onChange={(e) => setParentType(e.target.value ?? undefined)}
|
|
144
|
+
>
|
|
145
|
+
<MenuItem value={""}>(none)</MenuItem>
|
|
146
|
+
{items.map((item) => (
|
|
147
|
+
<MenuItem value={item} key={item}>
|
|
148
|
+
{item}
|
|
149
|
+
</MenuItem>
|
|
150
|
+
))}
|
|
151
|
+
</Select>
|
|
152
|
+
<FormControlLabel
|
|
153
|
+
control={<Checkbox checked={wireframes} onChange={(e) => setWireframes(e.target.checked)} />}
|
|
154
|
+
label={"Bounding Boxes"}
|
|
155
|
+
/>
|
|
156
|
+
</Stack>
|
|
157
|
+
}
|
|
158
|
+
items={items}
|
|
159
|
+
render={(item) => (
|
|
160
|
+
<Editor
|
|
161
|
+
wireframes={wireframes}
|
|
162
|
+
ParentClassDef={parentType ? library[parentType] : undefined}
|
|
163
|
+
ClassDef={library[item]}
|
|
164
|
+
/>
|
|
165
|
+
)}
|
|
166
|
+
/>
|
|
167
|
+
);
|
|
168
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import { Game } from "../game/Game";
|
|
3
|
+
import { IMatchStorage } from "../game/MatchStorage";
|
|
4
|
+
import { IPlayerInfo, PlayerInfo } from "../game/PlayerInfo";
|
|
5
|
+
import { ConnectionProvider } from "../hooks/useConnection";
|
|
6
|
+
import { GameProvider } from "../hooks/useGame";
|
|
7
|
+
import { PlayerProvider } from "../hooks/usePlayer";
|
|
8
|
+
import { MatchViewer } from "./MatchViewer";
|
|
9
|
+
import { Match } from "../game/Match";
|
|
10
|
+
import { Connection } from "../game/Connection";
|
|
11
|
+
import { LocalConnectionTransport } from "../game/ConnectionTransport";
|
|
12
|
+
|
|
13
|
+
export function ClientTrustMatchViewer({
|
|
14
|
+
playerId,
|
|
15
|
+
players,
|
|
16
|
+
game,
|
|
17
|
+
matchStorage,
|
|
18
|
+
onBack,
|
|
19
|
+
}: {
|
|
20
|
+
playerId: string;
|
|
21
|
+
players: IPlayerInfo[];
|
|
22
|
+
game: Game<any, any>;
|
|
23
|
+
matchStorage: IMatchStorage;
|
|
24
|
+
onBack?: () => void;
|
|
25
|
+
}) {
|
|
26
|
+
const [match, setMatch] = useState<Match<any, any> | undefined>();
|
|
27
|
+
const [localConnection, setLocalConnection] = useState<Connection | undefined>();
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (game && players && matchStorage) {
|
|
31
|
+
const match = new Match(
|
|
32
|
+
game,
|
|
33
|
+
players.map((p) => new PlayerInfo(p)),
|
|
34
|
+
matchStorage,
|
|
35
|
+
);
|
|
36
|
+
let cancelled = false;
|
|
37
|
+
match.load().then(() => {
|
|
38
|
+
if (cancelled) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
match.start();
|
|
42
|
+
setMatch(match);
|
|
43
|
+
});
|
|
44
|
+
return () => {
|
|
45
|
+
match.dispose();
|
|
46
|
+
cancelled = true;
|
|
47
|
+
};
|
|
48
|
+
} else {
|
|
49
|
+
setMatch(undefined);
|
|
50
|
+
}
|
|
51
|
+
}, [game, matchStorage, players]);
|
|
52
|
+
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (!match) {
|
|
55
|
+
setLocalConnection(undefined);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const newRemoteConnection = new LocalConnectionTransport();
|
|
60
|
+
const newConnection = new Connection(new LocalConnectionTransport());
|
|
61
|
+
(newConnection.transport as LocalConnectionTransport).connect(newRemoteConnection);
|
|
62
|
+
match.connect(newRemoteConnection, playerId);
|
|
63
|
+
|
|
64
|
+
setLocalConnection(newConnection);
|
|
65
|
+
return () => {
|
|
66
|
+
newConnection.dispose();
|
|
67
|
+
};
|
|
68
|
+
}, [match, playerId]);
|
|
69
|
+
|
|
70
|
+
if (!localConnection) {
|
|
71
|
+
return null; // loading...
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<GameProvider game={game}>
|
|
76
|
+
<ConnectionProvider connection={localConnection}>
|
|
77
|
+
<PlayerProvider playerId={playerId}>
|
|
78
|
+
<MatchViewer onBack={onBack} />
|
|
79
|
+
</PlayerProvider>
|
|
80
|
+
</ConnectionProvider>
|
|
81
|
+
</GameProvider>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import { Box } from "@mui/material";
|
|
3
|
+
import { GalleryItem, GalleryViewer } from "./GalleryViewer";
|
|
4
|
+
import { useRef } from "react";
|
|
5
|
+
import { ZINDEX_CONTEXT_GALLERY_DISPLAY } from "../utilities/zIndex";
|
|
6
|
+
import { useGameTheme } from "../hooks/useGameTheme";
|
|
7
|
+
import { useAnimationSpeedMultiplier, useClientPrompts } from "../hooks/useTimeController";
|
|
8
|
+
import { PickPrompt } from "../game/Prompt";
|
|
9
|
+
import { Chit } from "../game/Chit";
|
|
10
|
+
import { chitsToGalleryItems } from "../utilities/GalleryItemConversion";
|
|
11
|
+
import { useEventChannelState } from "../hooks/useEventChannelState";
|
|
12
|
+
|
|
13
|
+
export function ContextGalleryDisplay({ size }: { size: number }) {
|
|
14
|
+
const theme = useGameTheme();
|
|
15
|
+
const ref = useRef(null);
|
|
16
|
+
const speed = useAnimationSpeedMultiplier();
|
|
17
|
+
const clientPrompts = useClientPrompts();
|
|
18
|
+
const [currentPrompt] = useEventChannelState(clientPrompts.currentPrompt);
|
|
19
|
+
const [items, setItems] = useState<GalleryItem[]>([]);
|
|
20
|
+
const hasItems = items && items?.length > 0;
|
|
21
|
+
|
|
22
|
+
let targetChit: Chit | undefined = undefined;
|
|
23
|
+
if (currentPrompt && currentPrompt instanceof PickPrompt) {
|
|
24
|
+
const pickWithContext = currentPrompt.picks.find((p) => p.contextChit);
|
|
25
|
+
if (pickWithContext) {
|
|
26
|
+
targetChit = pickWithContext.contextChit;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (targetChit) {
|
|
32
|
+
setItems(chitsToGalleryItems([targetChit]));
|
|
33
|
+
} else {
|
|
34
|
+
setItems([]);
|
|
35
|
+
}
|
|
36
|
+
}, [targetChit, setItems]);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Box sx={{ position: "relative" }}>
|
|
40
|
+
<Box
|
|
41
|
+
ref={ref}
|
|
42
|
+
sx={{
|
|
43
|
+
width: size,
|
|
44
|
+
height: size,
|
|
45
|
+
top: theme.spacing,
|
|
46
|
+
position: hasItems ? "relative" : "absolute",
|
|
47
|
+
ml: `${theme.spacing}px`,
|
|
48
|
+
right: hasItems ? 0 : `${-size - theme.spacing}px`,
|
|
49
|
+
zIndex: ZINDEX_CONTEXT_GALLERY_DISPLAY,
|
|
50
|
+
borderRadius: "10px",
|
|
51
|
+
background: theme.actionBarContextColor,
|
|
52
|
+
boxShadow: `inset 0px 2px 3px 3px ${theme.actionBarContextShadow}`,
|
|
53
|
+
transition: `right ease-in-out ${theme.actionBarContextAnimationDuration * speed}s`,
|
|
54
|
+
}}
|
|
55
|
+
>
|
|
56
|
+
<GalleryViewer
|
|
57
|
+
fov={2}
|
|
58
|
+
angle={0}
|
|
59
|
+
showSummary={false}
|
|
60
|
+
paused={items.length > 0 ? false : true}
|
|
61
|
+
items={items ?? []}
|
|
62
|
+
tweenDuration={0}
|
|
63
|
+
galleryItemWidth={size - theme.spacing * 2}
|
|
64
|
+
galleryItemHeight={size - theme.spacing * 2}
|
|
65
|
+
itemSpacing={0}
|
|
66
|
+
w={size}
|
|
67
|
+
h={size}
|
|
68
|
+
/>
|
|
69
|
+
</Box>
|
|
70
|
+
</Box>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React, { useEffect, useState, useRef } from "react";
|
|
2
|
+
import { Box } from "@mui/material";
|
|
3
|
+
import { useEventChannelState } from "../hooks/useEventChannelState";
|
|
4
|
+
import { useModalState } from "../hooks/useModalState";
|
|
5
|
+
import { GalleryItem, GalleryViewer } from "./GalleryViewer";
|
|
6
|
+
import useSize from "@react-hook/size";
|
|
7
|
+
import { useAnimationSpeedMultiplier } from "../hooks/useTimeController";
|
|
8
|
+
import { useGameTheme } from "../hooks/useGameTheme";
|
|
9
|
+
import { GameModalBackdrop } from "./GameModalBackdrop";
|
|
10
|
+
|
|
11
|
+
const DELAY = 300;
|
|
12
|
+
|
|
13
|
+
export function GalleryDisplay() {
|
|
14
|
+
const theme = useGameTheme();
|
|
15
|
+
const animationSpeedMultiplier = useAnimationSpeedMultiplier();
|
|
16
|
+
const ref = useRef(null);
|
|
17
|
+
const [width, height] = useSize(ref);
|
|
18
|
+
const modalState = useModalState();
|
|
19
|
+
const [items, setItems] = useState<GalleryItem[] | undefined>(undefined);
|
|
20
|
+
const [source, setSource] = useEventChannelState(modalState.gallerySource);
|
|
21
|
+
const hasItems = items && items?.length > 0;
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (source) {
|
|
25
|
+
setItems(source.items);
|
|
26
|
+
const unSub = source.registerUpdateHandler(() => {
|
|
27
|
+
setItems(source.items);
|
|
28
|
+
});
|
|
29
|
+
return () => {
|
|
30
|
+
source.close();
|
|
31
|
+
unSub();
|
|
32
|
+
};
|
|
33
|
+
} else {
|
|
34
|
+
setItems(undefined);
|
|
35
|
+
}
|
|
36
|
+
}, [source, setItems]);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
// This has to be outside of the modal backdrop so we can get the size correctly
|
|
40
|
+
<Box ref={ref} sx={{ position: "absolute", top: 0, left: 0, right: 0, bottom: 0 }}>
|
|
41
|
+
<GameModalBackdrop visible={!!hasItems}>
|
|
42
|
+
<GalleryViewer
|
|
43
|
+
onClose={() => {
|
|
44
|
+
setSource(undefined);
|
|
45
|
+
}}
|
|
46
|
+
items={items ?? []}
|
|
47
|
+
tweenDuration={DELAY * animationSpeedMultiplier * 0.8}
|
|
48
|
+
galleryItemWidth={theme.galleryItemWidth}
|
|
49
|
+
galleryItemHeight={theme.galleryItemHeight}
|
|
50
|
+
itemSpacing={theme.galleryItemSpacing}
|
|
51
|
+
w={width}
|
|
52
|
+
h={height}
|
|
53
|
+
/>
|
|
54
|
+
</GameModalBackdrop>
|
|
55
|
+
</Box>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import { Game } from "../game/Game";
|
|
3
|
+
import { Box } from "@mui/material";
|
|
4
|
+
import { GalleryViewer } from "./GalleryViewer";
|
|
5
|
+
import type { GalleryItem } from "./GalleryViewer";
|
|
6
|
+
import { BoxGeometry, Mesh, MeshPhongMaterial } from "three";
|
|
7
|
+
|
|
8
|
+
export class MyItem implements GalleryItem {
|
|
9
|
+
constructor(
|
|
10
|
+
public color: number,
|
|
11
|
+
public id: string,
|
|
12
|
+
) {}
|
|
13
|
+
|
|
14
|
+
createMesh() {
|
|
15
|
+
const result = new Mesh(new BoxGeometry(50, 50, 50), new MeshPhongMaterial({ color: this.color }));
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
registerUpdateHandler(cb: () => void) {
|
|
20
|
+
console.log(cb);
|
|
21
|
+
return () => {};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default function GalleryPlayground({ game }: { game: Game<any, any> }) {
|
|
26
|
+
const [items, setItems] = useState(
|
|
27
|
+
[...new Array(5)].map((d, i) => new MyItem(Math.random() * 0xffffff, i.toString())),
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
setTimeout(() => {
|
|
32
|
+
const index = Math.floor(Math.random() * items.length);
|
|
33
|
+
if (Math.random() > 0.5) {
|
|
34
|
+
const item = new MyItem(Math.random() * 0xffffff, Math.random().toString());
|
|
35
|
+
|
|
36
|
+
setItems(items.slice(0, index).concat([item]).concat(items.slice(index)));
|
|
37
|
+
} else {
|
|
38
|
+
setItems(items.slice(0, index).concat(items.slice(index + 1)));
|
|
39
|
+
}
|
|
40
|
+
}, 1000);
|
|
41
|
+
}, [items]);
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<Box>
|
|
45
|
+
<Box sx={{ position: "relative" }}>
|
|
46
|
+
<GalleryViewer items={items} galleryItemWidth={150} itemSpacing={20} w={800} h={600} />
|
|
47
|
+
</Box>
|
|
48
|
+
</Box>
|
|
49
|
+
);
|
|
50
|
+
}
|