@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,460 @@
|
|
|
1
|
+
import { Tween, Group as TweenGroup } from "@tweenjs/tween.js";
|
|
2
|
+
import { ChitRenderInstance } from "./ChitRenderInstance";
|
|
3
|
+
import { Chit } from "../game/Chit";
|
|
4
|
+
import { Box3, Group, Object3D, Raycaster, Vector2, Vector3 } from "three";
|
|
5
|
+
import { CameraWrapperPerspective } from "./CameraWrapperPerspective";
|
|
6
|
+
import { LightWrapper } from "./LightWrapper";
|
|
7
|
+
import { ModalState } from "../game/ModalState";
|
|
8
|
+
import { GalleryItemSource } from "../components/GalleryViewer";
|
|
9
|
+
import { chitsToGalleryItems } from "../utilities/GalleryItemConversion";
|
|
10
|
+
import { GalleryItemRawSource } from "../game/GalleryItemRawSource";
|
|
11
|
+
import { CameraSpec } from "./CameraSpec";
|
|
12
|
+
import { SceneWrapper } from "./outline";
|
|
13
|
+
import { TextureReferenaceCounter, TextureReferenceCounterRootGroup } from "./TextureReferenceCounter";
|
|
14
|
+
|
|
15
|
+
export type AnimationState = "leaving" | "entering" | "pending" | "inactive";
|
|
16
|
+
|
|
17
|
+
//
|
|
18
|
+
// Like a ChitRenderInstance, but only useful at the root
|
|
19
|
+
// contains threejs high level stuff like lights, cameras and tween controls
|
|
20
|
+
//
|
|
21
|
+
export class RootChitRenderInstance extends ChitRenderInstance implements TextureReferenceCounterRootGroup {
|
|
22
|
+
private _sceneWrapper = new SceneWrapper();
|
|
23
|
+
public _rootGroup = new Group();
|
|
24
|
+
public _lightGroup = new Group();
|
|
25
|
+
private _tweenGroup = new TweenGroup();
|
|
26
|
+
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
28
|
+
public convertCameraSpaceToScreenSpace = (x: number, y: number): Vector2 | undefined => {
|
|
29
|
+
return;
|
|
30
|
+
};
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
32
|
+
public convertScreenSpaceToCameraSpace = (x: number, y: number): Vector2 | undefined => {
|
|
33
|
+
return;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
private _width: number = 1;
|
|
37
|
+
private _height: number = 1;
|
|
38
|
+
|
|
39
|
+
public get width() {
|
|
40
|
+
return this._width;
|
|
41
|
+
}
|
|
42
|
+
public get height() {
|
|
43
|
+
return this._height;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** @internal */
|
|
47
|
+
public get sceneWrapper() {
|
|
48
|
+
return this._sceneWrapper;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** @internal */
|
|
52
|
+
public playerId?: string;
|
|
53
|
+
|
|
54
|
+
public cameraWrapper = new CameraWrapperPerspective(this);
|
|
55
|
+
public lightWrapper = new LightWrapper();
|
|
56
|
+
|
|
57
|
+
constructor(chit: Chit) {
|
|
58
|
+
super(chit);
|
|
59
|
+
TextureReferenaceCounter.registerInstance(this);
|
|
60
|
+
this._sceneWrapper.scene.add(this.rootGroup);
|
|
61
|
+
this.id = chit.id ?? `${Date.now()}_${Math.random()}`;
|
|
62
|
+
this.bboxGroup.visible = false;
|
|
63
|
+
this._tweenGroup.update(0); // make it so initial tweens finish right away?
|
|
64
|
+
this.handleHierarchy();
|
|
65
|
+
this.group.position.y = 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
private _notifyTimeout?: NodeJS.Timeout;
|
|
69
|
+
protected override notifyBoundingBoxChanged(): void {
|
|
70
|
+
if (this._notifyTimeout) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
this._notifyTimeout = setTimeout(() => {
|
|
75
|
+
this._notifyTimeout = undefined;
|
|
76
|
+
// find our bounds
|
|
77
|
+
const bbox = new Box3();
|
|
78
|
+
this.bboxGroup.updateWorldMatrix(false, true);
|
|
79
|
+
|
|
80
|
+
const recurse = (obj: Object3D) => {
|
|
81
|
+
if (obj.children.length > 0) {
|
|
82
|
+
obj.children.forEach(recurse);
|
|
83
|
+
} else if (obj.scale.length() > 0) {
|
|
84
|
+
bbox.expandByObject(obj);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
recurse(this.bboxGroup);
|
|
88
|
+
|
|
89
|
+
if (Number.isFinite(bbox.max.x)) {
|
|
90
|
+
this.cameraWrapper.adjust(bbox);
|
|
91
|
+
this.lightWrapper.adjust(bbox);
|
|
92
|
+
this.markDirty();
|
|
93
|
+
}
|
|
94
|
+
}, 0);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
public dirty = false;
|
|
98
|
+
markDirty() {
|
|
99
|
+
this.dirty = true;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
resetDirty() {
|
|
103
|
+
if (this.dirty) {
|
|
104
|
+
TextureReferenaceCounter.update();
|
|
105
|
+
this.dirty = false;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
private modalState?: ModalState;
|
|
110
|
+
public setup(modalState: ModalState) {
|
|
111
|
+
this.init();
|
|
112
|
+
this.modalState = modalState;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
public override checkPreDestroy() {
|
|
116
|
+
// nothing to do.
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
public get camera() {
|
|
121
|
+
return this.cameraWrapper.camera;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
public setSize(w: number, h: number) {
|
|
125
|
+
if (this._width !== w || this._height !== h) {
|
|
126
|
+
this._width = w;
|
|
127
|
+
this._height = h;
|
|
128
|
+
this.cameraWrapper.setSize(w, h);
|
|
129
|
+
this.lightWrapper.setSize(w, h);
|
|
130
|
+
this.dirty = true;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
private _cbs: (() => void)[] = [];
|
|
135
|
+
private _totalPauseDuration = 0;
|
|
136
|
+
private _pausedAt = 0;
|
|
137
|
+
private _isPaused = false;
|
|
138
|
+
private _hasPendingChanges = true;
|
|
139
|
+
private _hasChitsLeaving = false;
|
|
140
|
+
private _hasChitsEntering = true;
|
|
141
|
+
|
|
142
|
+
public onPanelStatusChange(cb: () => void) {
|
|
143
|
+
this._cbs.push(cb);
|
|
144
|
+
return () => (this._cbs = this._cbs.filter((c) => c !== cb));
|
|
145
|
+
}
|
|
146
|
+
private notifyPanelStatusChange() {
|
|
147
|
+
this._cbs.forEach((cb) => cb());
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
public get paused() {
|
|
151
|
+
return this._isPaused;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
public get animationState(): AnimationState {
|
|
155
|
+
if (this._hasChitsLeaving) {
|
|
156
|
+
return "leaving";
|
|
157
|
+
}
|
|
158
|
+
if (this._hasChitsEntering) {
|
|
159
|
+
return "entering";
|
|
160
|
+
}
|
|
161
|
+
if (this._hasPendingChanges) {
|
|
162
|
+
return "pending";
|
|
163
|
+
}
|
|
164
|
+
return "inactive";
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
public pause() {
|
|
168
|
+
if (!this._isPaused) {
|
|
169
|
+
this._isPaused = true;
|
|
170
|
+
this._pausedAt = performance.now();
|
|
171
|
+
this.notifyPanelStatusChange();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
public resume() {
|
|
176
|
+
if (this._isPaused) {
|
|
177
|
+
this._isPaused = false;
|
|
178
|
+
this._totalPauseDuration += performance.now() - this._pausedAt;
|
|
179
|
+
this.notifyPanelStatusChange();
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
public resetMarks() {
|
|
184
|
+
this._hasPendingChanges = false;
|
|
185
|
+
this._hasChitsEntering = false;
|
|
186
|
+
this._hasChitsLeaving = false;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
public markHasPendingChange() {
|
|
190
|
+
if (!this._hasPendingChanges) {
|
|
191
|
+
this._hasPendingChanges = true;
|
|
192
|
+
this.notifyPanelStatusChange();
|
|
193
|
+
this.sceneWrapper.markDirty();
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
public markHasChitsLeaving() {
|
|
198
|
+
if (!this._hasChitsLeaving) {
|
|
199
|
+
this._hasChitsLeaving = true;
|
|
200
|
+
this.notifyPanelStatusChange();
|
|
201
|
+
this.sceneWrapper.markDirty();
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
public markHasChitsEntering() {
|
|
206
|
+
if (!this._hasChitsEntering) {
|
|
207
|
+
this._hasChitsEntering = true;
|
|
208
|
+
this.notifyPanelStatusChange();
|
|
209
|
+
this.sceneWrapper.markDirty();
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
public markHasChange() {
|
|
214
|
+
this.sceneWrapper.markDirty();
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
getRootGroup(): Object3D {
|
|
218
|
+
return this.rootGroup;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
protected get now() {
|
|
222
|
+
const n = performance.now();
|
|
223
|
+
return n - this._totalPauseDuration - (this._isPaused ? n - this._pausedAt : 0);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
public update(background = false) {
|
|
227
|
+
if (this._isPaused) {
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
if (this._tweenGroup) {
|
|
231
|
+
const hasChange = this._tweenGroup.update(this.now);
|
|
232
|
+
if (!background && !hasChange && (this._hasPendingChanges || this._hasChitsEntering || this._hasChitsLeaving)) {
|
|
233
|
+
this._hasPendingChanges = false;
|
|
234
|
+
this._hasChitsEntering = false;
|
|
235
|
+
this._hasChitsLeaving = false;
|
|
236
|
+
this.notifyPanelStatusChange();
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (this._sceneWrapper.isDirty()) {
|
|
240
|
+
return true;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return hasChange;
|
|
244
|
+
}
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
public override destroy() {
|
|
249
|
+
TextureReferenaceCounter.unregisterInstance(this);
|
|
250
|
+
this.lightWrapper.destroy();
|
|
251
|
+
this.cameraWrapper.destroy();
|
|
252
|
+
clearTimeout(this._notifyTimeout);
|
|
253
|
+
this._sceneWrapper.dispose();
|
|
254
|
+
super.destroy();
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
public set wireframes(newValue: boolean) {
|
|
258
|
+
this.bboxGroup.visible = newValue;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
private _animationSpeedMultiplier = 0.0001;
|
|
262
|
+
public get animationSpeedMultiplier(): number {
|
|
263
|
+
return this._animationSpeedMultiplier;
|
|
264
|
+
}
|
|
265
|
+
public set animationSpeedMultiplier(newValue: number) {
|
|
266
|
+
this._animationSpeedMultiplier = newValue;
|
|
267
|
+
this.zeroTween();
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
protected override handleHierarchy() {
|
|
271
|
+
// if called from superclass constructor...
|
|
272
|
+
if (!this._rootGroup) {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
this._rootGroup.add(this.group);
|
|
277
|
+
this._rootGroup.add(this.bboxGroup);
|
|
278
|
+
this._rootGroup.add(this.lightWrapper.group);
|
|
279
|
+
|
|
280
|
+
let camera = this.renderSpec?.camera;
|
|
281
|
+
if (!camera) {
|
|
282
|
+
camera = new CameraSpec();
|
|
283
|
+
}
|
|
284
|
+
camera.extraPaddingTop = this.paddingTop;
|
|
285
|
+
|
|
286
|
+
this.cameraWrapper.setCameraSpec(camera);
|
|
287
|
+
this.lightWrapper.setLightSpec(this.renderSpec?.lightSpec);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
private paddingTop = 0;
|
|
291
|
+
public setPaddingTop(paddingTop: number) {
|
|
292
|
+
this.paddingTop = paddingTop;
|
|
293
|
+
this.refresh();
|
|
294
|
+
this.dirty = true;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
public get tweenGroup(): TweenGroup | undefined {
|
|
298
|
+
return this._tweenGroup;
|
|
299
|
+
}
|
|
300
|
+
public get rootGroup(): Group {
|
|
301
|
+
return this._rootGroup;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
public override get rootRenderInstance(): RootChitRenderInstance {
|
|
305
|
+
return this;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
public createRenderSpec() {
|
|
309
|
+
const result = super.createRenderSpec();
|
|
310
|
+
if (this.chit.game?.renderDefaultRootChit) {
|
|
311
|
+
this.chit.game?.renderDefaultRootChit(result);
|
|
312
|
+
}
|
|
313
|
+
return result;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
public createTween<T extends Record<string, any>>(props: T, cb: (tween: Tween<T>) => void): Tween<T> {
|
|
317
|
+
const tween = new Tween<T>(props, this._tweenGroup);
|
|
318
|
+
cb(tween);
|
|
319
|
+
tween.start(this.now);
|
|
320
|
+
return tween;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
private findEligibleRenderInstances(
|
|
324
|
+
filter: (c: Chit) => boolean,
|
|
325
|
+
x: number,
|
|
326
|
+
y: number,
|
|
327
|
+
distance: number,
|
|
328
|
+
precision: number,
|
|
329
|
+
): Chit[] {
|
|
330
|
+
const result = new Map<Chit, number>();
|
|
331
|
+
const chitRenderInstances: ChitRenderInstance[] = [];
|
|
332
|
+
const threeJsToChitLookup: { [threejsId: number]: Chit } = {};
|
|
333
|
+
|
|
334
|
+
this.chit.walk((c) => {
|
|
335
|
+
if (filter(c) && c.renderInstance) {
|
|
336
|
+
chitRenderInstances.push(c.renderInstance);
|
|
337
|
+
threeJsToChitLookup[c.renderInstance.clickbox.id] = c;
|
|
338
|
+
|
|
339
|
+
// if this is a "gallery" render instance, no need to check its children for clicks
|
|
340
|
+
if (c.renderInstance?.absorbsClickEventsForChildren) {
|
|
341
|
+
return false;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
return true;
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
const PI2 = Math.PI * 2;
|
|
348
|
+
for (let r = 0; r <= distance; r += precision) {
|
|
349
|
+
const circumference = PI2 * r;
|
|
350
|
+
|
|
351
|
+
for (let steps = 0; steps <= circumference; steps += precision) {
|
|
352
|
+
const angle = (steps / circumference) * PI2;
|
|
353
|
+
let vector = new Vector3(
|
|
354
|
+
((x + r * Math.cos(angle)) / this._width) * 2 - 1,
|
|
355
|
+
-((y + r * Math.sin(angle)) / this._height) * 2 + 1,
|
|
356
|
+
0.5,
|
|
357
|
+
);
|
|
358
|
+
vector = vector.unproject(this.camera);
|
|
359
|
+
|
|
360
|
+
const raycaster = new Raycaster(this.camera.position, vector.sub(this.camera.position).normalize());
|
|
361
|
+
const intersects = raycaster.intersectObjects(
|
|
362
|
+
chitRenderInstances.map((c) => c.clickbox),
|
|
363
|
+
true,
|
|
364
|
+
);
|
|
365
|
+
|
|
366
|
+
for (let i = 0; i < intersects.length; i++) {
|
|
367
|
+
const id = intersects[i].object.id;
|
|
368
|
+
const c = threeJsToChitLookup[id];
|
|
369
|
+
if (filter(c)) {
|
|
370
|
+
result.set(c, Math.min(result.get(c) ?? r, r));
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
return [...result.keys()];
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
public handleClick(x: number, y: number, distance: number, precision: number) {
|
|
379
|
+
const chits = this.findEligibleRenderInstances((c) => !!c.onClick, x, y, distance, precision);
|
|
380
|
+
|
|
381
|
+
if (chits.length > 0) {
|
|
382
|
+
if (this.modalState && chits.length >= 2) {
|
|
383
|
+
const items = chitsToGalleryItems(chits);
|
|
384
|
+
if (items.length >= 2) {
|
|
385
|
+
items.forEach((item) => {
|
|
386
|
+
const orig = item.onClick;
|
|
387
|
+
if (orig) {
|
|
388
|
+
item.onClick = () => {
|
|
389
|
+
orig();
|
|
390
|
+
if (this.modalState) {
|
|
391
|
+
this.modalState.gallerySource.value = undefined;
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
this.modalState.gallerySource.value = new GalleryItemRawSource(items);
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
const chit = chits[0];
|
|
402
|
+
if (chit && chit.onClick) {
|
|
403
|
+
chit.onClick();
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
public handleLongClick(x: number, y: number, distance: number, precision: number) {
|
|
409
|
+
const chits = this.findEligibleRenderInstances(
|
|
410
|
+
(c) => !!c.renderInstance?.showDetailsOnLongPress(),
|
|
411
|
+
x,
|
|
412
|
+
y,
|
|
413
|
+
distance,
|
|
414
|
+
precision,
|
|
415
|
+
);
|
|
416
|
+
if (this.modalState && chits.length > 0) {
|
|
417
|
+
const items = chitsToGalleryItems(chits);
|
|
418
|
+
this.modalState.gallerySource.value = new GalleryItemRawSource(items);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
public showGallery(source: GalleryItemSource) {
|
|
423
|
+
if (this.modalState) {
|
|
424
|
+
const s = this.modalState.gallerySource;
|
|
425
|
+
s.value = source;
|
|
426
|
+
return () => {
|
|
427
|
+
if (s.value === source) {
|
|
428
|
+
s.value = undefined;
|
|
429
|
+
}
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
return () => {};
|
|
433
|
+
}
|
|
434
|
+
public hideGallery(source: GalleryItemSource) {
|
|
435
|
+
if (this.modalState && this.modalState.gallerySource.value === source) {
|
|
436
|
+
this.modalState.gallerySource.value = undefined;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
public handleZoom(x: number, y: number, dz: number, animate: boolean) {
|
|
441
|
+
this.cameraWrapper.handleZoom(x, y, dz, animate);
|
|
442
|
+
this.markDirty();
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
public handlePan(dx: number, dy: number) {
|
|
446
|
+
this.cameraWrapper.handlePan(dx, dy);
|
|
447
|
+
this.markDirty();
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
public get cameraZoom() {
|
|
451
|
+
return this.cameraWrapper.zoom;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// override this stuff - we are never going to a new viewer
|
|
455
|
+
protected override moveToNewViewer(): void {}
|
|
456
|
+
protected override detach() {}
|
|
457
|
+
protected override shouldMoveToNewViewer(): boolean {
|
|
458
|
+
return false;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
type SplayResults = { x: number; y: number; z: number };
|
|
2
|
+
export type SplayOrientation = "center" | "decreasing" | "increasing";
|
|
3
|
+
|
|
4
|
+
function midFromOrientation(max: number, orientation: SplayOrientation) {
|
|
5
|
+
switch (orientation) {
|
|
6
|
+
case "center":
|
|
7
|
+
return (max - 1) / 2;
|
|
8
|
+
case "decreasing":
|
|
9
|
+
return max - 1;
|
|
10
|
+
case "increasing":
|
|
11
|
+
return 0;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const splayOrder: { [key: string]: SplayResults[] } = {};
|
|
16
|
+
|
|
17
|
+
function getSplayOrder(
|
|
18
|
+
key: string,
|
|
19
|
+
rows: number,
|
|
20
|
+
columns: number,
|
|
21
|
+
rowOrientation: SplayOrientation,
|
|
22
|
+
columnOrientation: SplayOrientation,
|
|
23
|
+
): SplayResults[] {
|
|
24
|
+
if (splayOrder[key]) {
|
|
25
|
+
return splayOrder[key];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const midX = midFromOrientation(columns, columnOrientation);
|
|
29
|
+
const midY = midFromOrientation(rows, rowOrientation);
|
|
30
|
+
const order: SplayResults[] = [];
|
|
31
|
+
for (let row = 0; row < rows; row++) {
|
|
32
|
+
for (let column = 0; column < columns; column++) {
|
|
33
|
+
order.push({ x: column - midX, y: row - midY, z: row * rows + column });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
order.sort((a, b) => {
|
|
38
|
+
const d1 = Math.abs(a.x) + Math.abs(a.y);
|
|
39
|
+
const d2 = Math.abs(b.x) + Math.abs(b.y);
|
|
40
|
+
if (d1 == d2) {
|
|
41
|
+
return a.z - b.z;
|
|
42
|
+
}
|
|
43
|
+
return d1 - d2;
|
|
44
|
+
});
|
|
45
|
+
splayOrder[key] = order;
|
|
46
|
+
return order;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export class Splay {
|
|
50
|
+
public rows: number = 1;
|
|
51
|
+
public columns: number = 1;
|
|
52
|
+
public rowOrientation: SplayOrientation = "center";
|
|
53
|
+
public columnOrientation: SplayOrientation = "center";
|
|
54
|
+
|
|
55
|
+
public enabled: boolean = false;
|
|
56
|
+
public zSpacingMultiplier: number = 1;
|
|
57
|
+
public zPerIndexMultiplier: number = 0;
|
|
58
|
+
public spacingMultiplier: number = 1;
|
|
59
|
+
public itemWidth?: number = undefined;
|
|
60
|
+
public itemHeight?: number = undefined;
|
|
61
|
+
|
|
62
|
+
toString() {
|
|
63
|
+
return `${this.rows} ${this.columns} ${this.rowOrientation} ${this.columnOrientation} ${this.enabled} ${this.zSpacingMultiplier} ${this.spacingMultiplier} ${this.itemWidth} ${this.itemHeight}`;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
private get splayOrder() {
|
|
67
|
+
return getSplayOrder(
|
|
68
|
+
`${this.rows}_${this.columns}_${this.rowOrientation}_${this.columnOrientation}`,
|
|
69
|
+
this.rows,
|
|
70
|
+
this.columns,
|
|
71
|
+
this.rowOrientation,
|
|
72
|
+
this.columnOrientation,
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
processSplay(childIndex: number, sizeX: number, sizeY: number, sizeZ: number): SplayResults {
|
|
77
|
+
const order = this.splayOrder;
|
|
78
|
+
const zIndex = Math.floor(childIndex / order.length);
|
|
79
|
+
const orderIndex = childIndex % order.length;
|
|
80
|
+
const orderItem = order[orderIndex];
|
|
81
|
+
return {
|
|
82
|
+
x: (this.itemWidth ?? sizeX) * this.spacingMultiplier * orderItem.x,
|
|
83
|
+
y: (this.itemHeight ?? sizeY) * this.spacingMultiplier * orderItem.y,
|
|
84
|
+
z: sizeZ * this.zSpacingMultiplier * zIndex + this.zPerIndexMultiplier * childIndex,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** @internal */
|
|
89
|
+
splayEndPosition(
|
|
90
|
+
itemWidth: number,
|
|
91
|
+
itemHeight: number,
|
|
92
|
+
position: "top" | "left" | "right" | "bottom" = "bottom",
|
|
93
|
+
): { x: number; y: number } {
|
|
94
|
+
const counter = this.rows * this.columns;
|
|
95
|
+
|
|
96
|
+
let x = 0,
|
|
97
|
+
y = 0;
|
|
98
|
+
for (let i = 0; i < counter; i++) {
|
|
99
|
+
const splayResult = this.processSplay(i, itemWidth, itemHeight, 1);
|
|
100
|
+
switch (position) {
|
|
101
|
+
case "top":
|
|
102
|
+
y = Math.max(splayResult.y + itemHeight / 2, y);
|
|
103
|
+
break;
|
|
104
|
+
case "bottom":
|
|
105
|
+
y = Math.min(splayResult.y - itemHeight / 2, y);
|
|
106
|
+
break;
|
|
107
|
+
case "left":
|
|
108
|
+
x = Math.min(splayResult.x - itemWidth / 2, x);
|
|
109
|
+
break;
|
|
110
|
+
case "right":
|
|
111
|
+
x = Math.max(splayResult.x + itemWidth / 2, x);
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return { x, y };
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Text } from "../utilities/CanvasStack/ReactCanvas";
|
|
3
|
+
import { ParameterizedCanvas } from "../utilities/ParameterizedCanvas";
|
|
4
|
+
|
|
5
|
+
export type SplayCounterOptions = {
|
|
6
|
+
fontSize: number;
|
|
7
|
+
fontFamily?: string;
|
|
8
|
+
stroke?: string;
|
|
9
|
+
fill?: string;
|
|
10
|
+
shadow?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export class SplayCounter extends ParameterizedCanvas {
|
|
14
|
+
public value: number = 0;
|
|
15
|
+
constructor(
|
|
16
|
+
public width: number,
|
|
17
|
+
public height: number,
|
|
18
|
+
public textOptions: SplayCounterOptions,
|
|
19
|
+
public dpi: number,
|
|
20
|
+
public label: string,
|
|
21
|
+
) {
|
|
22
|
+
super();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
protected render() {
|
|
26
|
+
return (
|
|
27
|
+
<Text
|
|
28
|
+
font={`${this.textOptions.fontSize * this.dpi}px ${this.textOptions.fontFamily ?? "sans-serif"}`}
|
|
29
|
+
fill={this.textOptions.fill ?? "#000"}
|
|
30
|
+
shadowColor={this.textOptions.shadow}
|
|
31
|
+
shadowBlur={this.textOptions.fontSize * 0.1 * this.dpi}
|
|
32
|
+
>
|
|
33
|
+
{this.label}
|
|
34
|
+
</Text>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { BufferGeometry, Material, Mesh, Object3D } from "three";
|
|
2
|
+
import { CanvasStack } from "../utilities/CanvasStack/CanvasStack";
|
|
3
|
+
|
|
4
|
+
export type TextureReferenceCounterRootGroup = {
|
|
5
|
+
getRootGroup(): Object3D;
|
|
6
|
+
markHasChange(): void;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export class TextureReferenaceCounter {
|
|
10
|
+
private static instances: TextureReferenceCounterRootGroup[] = [];
|
|
11
|
+
|
|
12
|
+
static registerInstance(instance: TextureReferenceCounterRootGroup) {
|
|
13
|
+
if (!TextureReferenaceCounter.instances.includes(instance)) {
|
|
14
|
+
TextureReferenaceCounter.instances.push(instance);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static unregisterInstance(instance: TextureReferenceCounterRootGroup) {
|
|
19
|
+
const index = TextureReferenaceCounter.instances.indexOf(instance);
|
|
20
|
+
if (index !== -1) {
|
|
21
|
+
TextureReferenaceCounter.instances.splice(index, 1);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
static update() {
|
|
26
|
+
const allIdsUsed = new Set<string>();
|
|
27
|
+
const allMaterialsUsed = new Map<string, Material>();
|
|
28
|
+
const allGeosUsed = new Map<string, BufferGeometry>();
|
|
29
|
+
const props = [
|
|
30
|
+
"map",
|
|
31
|
+
"lightMap",
|
|
32
|
+
"aoMap",
|
|
33
|
+
"emissiveMap",
|
|
34
|
+
"bumpMap",
|
|
35
|
+
"normalMap",
|
|
36
|
+
"displacementMap",
|
|
37
|
+
"specularMap",
|
|
38
|
+
"alphaMap",
|
|
39
|
+
"envMap",
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
const processMaterial = (mat: Material) => {
|
|
43
|
+
allMaterialsUsed.set(mat.uuid, mat);
|
|
44
|
+
const mata = mat as any;
|
|
45
|
+
props.forEach((prop) => {
|
|
46
|
+
if (mata[prop]) {
|
|
47
|
+
allIdsUsed.add(mata[prop].uuid);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// Scan all active root render instances
|
|
53
|
+
TextureReferenaceCounter.instances.forEach((instance) => {
|
|
54
|
+
instance.getRootGroup().traverseVisible((obj) => {
|
|
55
|
+
if (obj instanceof Mesh) {
|
|
56
|
+
if (obj.geometry instanceof BufferGeometry) {
|
|
57
|
+
allGeosUsed.set(obj.geometry.uuid, obj.geometry);
|
|
58
|
+
}
|
|
59
|
+
if (Array.isArray(obj.material)) {
|
|
60
|
+
obj.material.forEach(processMaterial);
|
|
61
|
+
} else {
|
|
62
|
+
processMaterial(obj.material);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// Mark all textures as used globally
|
|
69
|
+
CanvasStack.disposer.markUsed(allIdsUsed, () => {
|
|
70
|
+
// Mark all instances as dirty when textures change
|
|
71
|
+
TextureReferenaceCounter.instances.forEach((instance) => {
|
|
72
|
+
instance.markHasChange();
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
CanvasStack.materialDisposer.markUsedMap(allMaterialsUsed, () => {
|
|
76
|
+
TextureReferenaceCounter.instances.forEach((instance) => {
|
|
77
|
+
instance.markHasChange();
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
CanvasStack.geoDisposer.markUsedMap(allGeosUsed, () => {
|
|
81
|
+
TextureReferenaceCounter.instances.forEach((instance) => {
|
|
82
|
+
instance.markHasChange();
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
File without changes
|