@pretty-chitty/core 2.0.0 → 2.3.0
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/README.md +8 -0
- package/dist/components/ActionLogDisplay.d.ts.map +1 -1
- package/dist/components/ActionLogDisplay.js +1 -1
- package/dist/components/ActionLogDisplay.js.map +1 -1
- package/dist/components/BottomBarButton.d.ts +3 -1
- package/dist/components/BottomBarButton.d.ts.map +1 -1
- package/dist/components/BottomBarButton.js +3 -2
- package/dist/components/BottomBarButton.js.map +1 -1
- package/dist/components/ContextGalleryDisplay.d.ts.map +1 -1
- package/dist/components/ContextGalleryDisplay.js +1 -1
- package/dist/components/ContextGalleryDisplay.js.map +1 -1
- package/dist/components/DemoWrapper.d.ts +33 -2
- package/dist/components/DemoWrapper.d.ts.map +1 -1
- package/dist/components/DemoWrapper.js +77 -36
- package/dist/components/DemoWrapper.js.map +1 -1
- package/dist/components/FullScreenGalleryDisplay.d.ts.map +1 -1
- package/dist/components/FullScreenGalleryDisplay.js +2 -2
- package/dist/components/FullScreenGalleryDisplay.js.map +1 -1
- package/dist/components/Gallery/BuiltItem.d.ts +16 -2
- package/dist/components/Gallery/BuiltItem.d.ts.map +1 -1
- package/dist/components/Gallery/BuiltItem.js +92 -16
- package/dist/components/Gallery/BuiltItem.js.map +1 -1
- package/dist/components/Gallery/GalleryController.d.ts +26 -0
- package/dist/components/Gallery/GalleryController.d.ts.map +1 -1
- package/dist/components/Gallery/GalleryController.js +106 -6
- package/dist/components/Gallery/GalleryController.js.map +1 -1
- package/dist/components/Gallery/GalleryViewer.d.ts +6 -1
- package/dist/components/Gallery/GalleryViewer.d.ts.map +1 -1
- package/dist/components/Gallery/GalleryViewer.js +139 -12
- package/dist/components/Gallery/GalleryViewer.js.map +1 -1
- package/dist/components/Gallery/LayoutManager.d.ts +10 -0
- package/dist/components/Gallery/LayoutManager.d.ts.map +1 -1
- package/dist/components/Gallery/LayoutManager.js +49 -3
- package/dist/components/Gallery/LayoutManager.js.map +1 -1
- package/dist/components/Gallery/constants.d.ts +6 -0
- package/dist/components/Gallery/constants.d.ts.map +1 -1
- package/dist/components/Gallery/constants.js +6 -0
- package/dist/components/Gallery/constants.js.map +1 -1
- package/dist/components/Gallery/registry.d.ts +34 -0
- package/dist/components/Gallery/registry.d.ts.map +1 -0
- package/dist/components/Gallery/registry.js +17 -0
- package/dist/components/Gallery/registry.js.map +1 -0
- package/dist/components/Gallery/types.d.ts +5 -0
- package/dist/components/Gallery/types.d.ts.map +1 -1
- package/dist/components/GameDesigner.d.ts.map +1 -1
- package/dist/components/GameDesigner.js +84 -10
- package/dist/components/GameDesigner.js.map +1 -1
- package/dist/components/InlineGalleryDisplay.d.ts.map +1 -1
- package/dist/components/InlineGalleryDisplay.js +35 -8
- package/dist/components/InlineGalleryDisplay.js.map +1 -1
- package/dist/components/LiveButton.d.ts.map +1 -1
- package/dist/components/LiveButton.js +5 -2
- package/dist/components/LiveButton.js.map +1 -1
- package/dist/components/MatchViewer.d.ts +6 -1
- package/dist/components/MatchViewer.d.ts.map +1 -1
- package/dist/components/MatchViewer.js +9 -3
- package/dist/components/MatchViewer.js.map +1 -1
- package/dist/components/Panel/ExternalDrag.d.ts +30 -0
- package/dist/components/Panel/ExternalDrag.d.ts.map +1 -0
- package/dist/components/Panel/ExternalDrag.js +87 -0
- package/dist/components/Panel/ExternalDrag.js.map +1 -0
- package/dist/components/Panel/MultiPanel.d.ts.map +1 -1
- package/dist/components/Panel/MultiPanel.js +18 -0
- package/dist/components/Panel/MultiPanel.js.map +1 -1
- package/dist/components/Panel/PanelContents.d.ts +3 -0
- package/dist/components/Panel/PanelContents.d.ts.map +1 -1
- package/dist/components/Panel/PanelContents.js +116 -23
- package/dist/components/Panel/PanelContents.js.map +1 -1
- package/dist/components/Panel/PanelTabStack.d.ts.map +1 -1
- package/dist/components/Panel/PanelTabStack.js +1 -1
- package/dist/components/Panel/PanelTabStack.js.map +1 -1
- package/dist/components/PanelSpark.d.ts.map +1 -1
- package/dist/components/PanelSpark.js +6 -3
- package/dist/components/PanelSpark.js.map +1 -1
- package/dist/components/Playground.d.ts.map +1 -1
- package/dist/components/Playground.js +10 -4
- package/dist/components/Playground.js.map +1 -1
- package/dist/components/PromptControls.d.ts.map +1 -1
- package/dist/components/PromptControls.js +4 -2
- package/dist/components/PromptControls.js.map +1 -1
- package/dist/components/SparkLineChart.d.ts.map +1 -1
- package/dist/components/SparkLineChart.js +22 -26
- package/dist/components/SparkLineChart.js.map +1 -1
- package/dist/components/TimeControlBar.d.ts.map +1 -1
- package/dist/components/TimeControlBar.js +5 -3
- package/dist/components/TimeControlBar.js.map +1 -1
- package/dist/components/TokenizedMarkdown.d.ts +23 -0
- package/dist/components/TokenizedMarkdown.d.ts.map +1 -0
- package/dist/components/TokenizedMarkdown.js +144 -0
- package/dist/components/TokenizedMarkdown.js.map +1 -0
- package/dist/components/TokenizedMessage.d.ts +6 -0
- package/dist/components/TokenizedMessage.d.ts.map +1 -1
- package/dist/components/TokenizedMessage.js +20 -19
- package/dist/components/TokenizedMessage.js.map +1 -1
- package/dist/components/TopBar.d.ts.map +1 -1
- package/dist/components/TopBar.js +3 -1
- package/dist/components/TopBar.js.map +1 -1
- package/dist/components/TopBarPlayers.d.ts.map +1 -1
- package/dist/components/TopBarPlayers.js +2 -2
- package/dist/components/TopBarPlayers.js.map +1 -1
- package/dist/components/Tutorial/BrowserNarration.d.ts +55 -0
- package/dist/components/Tutorial/BrowserNarration.d.ts.map +1 -0
- package/dist/components/Tutorial/BrowserNarration.js +240 -0
- package/dist/components/Tutorial/BrowserNarration.js.map +1 -0
- package/dist/components/Tutorial/TutorialBox.d.ts +26 -0
- package/dist/components/Tutorial/TutorialBox.d.ts.map +1 -0
- package/dist/components/Tutorial/TutorialBox.js +239 -0
- package/dist/components/Tutorial/TutorialBox.js.map +1 -0
- package/dist/components/Tutorial/TutorialDevPanel.d.ts +9 -0
- package/dist/components/Tutorial/TutorialDevPanel.d.ts.map +1 -0
- package/dist/components/Tutorial/TutorialDevPanel.js +92 -0
- package/dist/components/Tutorial/TutorialDevPanel.js.map +1 -0
- package/dist/components/Tutorial/TutorialOverlay.d.ts +7 -0
- package/dist/components/Tutorial/TutorialOverlay.d.ts.map +1 -0
- package/dist/components/Tutorial/TutorialOverlay.js +1147 -0
- package/dist/components/Tutorial/TutorialOverlay.js.map +1 -0
- package/dist/components/Tutorial/targetRects.d.ts +67 -0
- package/dist/components/Tutorial/targetRects.d.ts.map +1 -0
- package/dist/components/Tutorial/targetRects.js +241 -0
- package/dist/components/Tutorial/targetRects.js.map +1 -0
- package/dist/components/Viewer.d.ts.map +1 -1
- package/dist/components/Viewer.js +1 -0
- package/dist/components/Viewer.js.map +1 -1
- package/dist/game/Chit.d.ts +10 -1
- package/dist/game/Chit.d.ts.map +1 -1
- package/dist/game/Chit.js +24 -6
- package/dist/game/Chit.js.map +1 -1
- package/dist/game/ClientTimeState.d.ts +14 -0
- package/dist/game/ClientTimeState.d.ts.map +1 -1
- package/dist/game/ClientTimeState.js +17 -0
- package/dist/game/ClientTimeState.js.map +1 -1
- package/dist/game/GalleryItemChitChildrenSource.d.ts +1 -0
- package/dist/game/GalleryItemChitChildrenSource.d.ts.map +1 -1
- package/dist/game/GalleryItemChitChildrenSource.js +1 -0
- package/dist/game/GalleryItemChitChildrenSource.js.map +1 -1
- package/dist/game/GalleryItemRawSource.d.ts +1 -0
- package/dist/game/GalleryItemRawSource.d.ts.map +1 -1
- package/dist/game/GalleryItemRawSource.js +1 -0
- package/dist/game/GalleryItemRawSource.js.map +1 -1
- package/dist/game/Game.d.ts +6 -0
- package/dist/game/Game.d.ts.map +1 -1
- package/dist/game/GameButton.d.ts +8 -0
- package/dist/game/GameButton.d.ts.map +1 -1
- package/dist/game/GameButton.js +13 -1
- package/dist/game/GameButton.js.map +1 -1
- package/dist/game/GameTheme.d.ts +3 -0
- package/dist/game/GameTheme.d.ts.map +1 -1
- package/dist/game/GameTheme.js +2 -0
- package/dist/game/GameTheme.js.map +1 -1
- package/dist/game/Match.d.ts +8 -2
- package/dist/game/Match.d.ts.map +1 -1
- package/dist/game/Match.js +4 -1
- package/dist/game/Match.js.map +1 -1
- package/dist/game/ModalState.d.ts +3 -0
- package/dist/game/ModalState.d.ts.map +1 -1
- package/dist/game/ModalState.js +2 -0
- package/dist/game/ModalState.js.map +1 -1
- package/dist/game/Pick.d.ts +2 -0
- package/dist/game/Pick.d.ts.map +1 -1
- package/dist/game/Pick.js +18 -4
- package/dist/game/Pick.js.map +1 -1
- package/dist/game/PlayerPromptStatusChit.d.ts +8 -0
- package/dist/game/PlayerPromptStatusChit.d.ts.map +1 -1
- package/dist/game/PlayerPromptStatusChit.js +6 -4
- package/dist/game/PlayerPromptStatusChit.js.map +1 -1
- package/dist/game/Prompt.d.ts +18 -1
- package/dist/game/Prompt.d.ts.map +1 -1
- package/dist/game/Prompt.js +29 -1
- package/dist/game/Prompt.js.map +1 -1
- package/dist/game/SparkChit.d.ts +6 -0
- package/dist/game/SparkChit.d.ts.map +1 -1
- package/dist/game/SparkChit.js +8 -0
- package/dist/game/SparkChit.js.map +1 -1
- package/dist/game/Turn.d.ts +17 -6
- package/dist/game/Turn.d.ts.map +1 -1
- package/dist/game/Turn.js +179 -69
- package/dist/game/Turn.js.map +1 -1
- package/dist/game/TurnState.d.ts +12 -1
- package/dist/game/TurnState.d.ts.map +1 -1
- package/dist/game/TurnState.js +15 -3
- package/dist/game/TurnState.js.map +1 -1
- package/dist/game/ai/AiClientPrompts.d.ts +20 -3
- package/dist/game/ai/AiClientPrompts.d.ts.map +1 -1
- package/dist/game/ai/AiClientPrompts.js +42 -6
- package/dist/game/ai/AiClientPrompts.js.map +1 -1
- package/dist/game/ai/AiPlayerView.js +2 -0
- package/dist/game/ai/AiPlayerView.js.map +1 -1
- package/dist/game/clientTransport/ClientPrompts.d.ts +22 -1
- package/dist/game/clientTransport/ClientPrompts.d.ts.map +1 -1
- package/dist/game/clientTransport/ClientPrompts.js +72 -5
- package/dist/game/clientTransport/ClientPrompts.js.map +1 -1
- package/dist/game/clientTransport/ClientTime.d.ts +13 -0
- package/dist/game/clientTransport/ClientTime.d.ts.map +1 -1
- package/dist/game/clientTransport/ClientTime.js +71 -12
- package/dist/game/clientTransport/ClientTime.js.map +1 -1
- package/dist/game/tutorial/TutorialController.d.ts +308 -0
- package/dist/game/tutorial/TutorialController.d.ts.map +1 -0
- package/dist/game/tutorial/TutorialController.js +1195 -0
- package/dist/game/tutorial/TutorialController.js.map +1 -0
- package/dist/game/tutorial/TutorialRuntime.d.ts +89 -0
- package/dist/game/tutorial/TutorialRuntime.d.ts.map +1 -0
- package/dist/game/tutorial/TutorialRuntime.js +261 -0
- package/dist/game/tutorial/TutorialRuntime.js.map +1 -0
- package/dist/game/tutorial/TutorialTheme.d.ts +28 -0
- package/dist/game/tutorial/TutorialTheme.d.ts.map +1 -0
- package/dist/game/tutorial/TutorialTheme.js +39 -0
- package/dist/game/tutorial/TutorialTheme.js.map +1 -0
- package/dist/game/tutorial/allowed.d.ts +2 -0
- package/dist/game/tutorial/allowed.d.ts.map +1 -0
- package/dist/game/tutorial/allowed.js +119 -0
- package/dist/game/tutorial/allowed.js.map +1 -0
- package/dist/game/tutorial/checks.d.ts +58 -0
- package/dist/game/tutorial/checks.d.ts.map +1 -0
- package/dist/game/tutorial/checks.js +144 -0
- package/dist/game/tutorial/checks.js.map +1 -0
- package/dist/game/tutorial/createDemoMatch.d.ts +47 -0
- package/dist/game/tutorial/createDemoMatch.d.ts.map +1 -0
- package/dist/game/tutorial/createDemoMatch.js +67 -0
- package/dist/game/tutorial/createDemoMatch.js.map +1 -0
- package/dist/game/tutorial/defineTutorial.d.ts +353 -0
- package/dist/game/tutorial/defineTutorial.d.ts.map +1 -0
- package/dist/game/tutorial/defineTutorial.js +86 -0
- package/dist/game/tutorial/defineTutorial.js.map +1 -0
- package/dist/game/tutorial/runTutorial.d.ts +64 -0
- package/dist/game/tutorial/runTutorial.d.ts.map +1 -0
- package/dist/game/tutorial/runTutorial.js +293 -0
- package/dist/game/tutorial/runTutorial.js.map +1 -0
- package/dist/hooks/usePanelNavigation.d.ts +28 -0
- package/dist/hooks/usePanelNavigation.d.ts.map +1 -0
- package/dist/hooks/usePanelNavigation.js +36 -0
- package/dist/hooks/usePanelNavigation.js.map +1 -0
- package/dist/hooks/useTimeController.d.ts +4 -1
- package/dist/hooks/useTimeController.d.ts.map +1 -1
- package/dist/hooks/useTimeController.js +10 -2
- package/dist/hooks/useTimeController.js.map +1 -1
- package/dist/hooks/useTutorial.d.ts +51 -0
- package/dist/hooks/useTutorial.d.ts.map +1 -0
- package/dist/hooks/useTutorial.js +16 -0
- package/dist/hooks/useTutorial.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -2
- package/dist/index.js.map +1 -1
- package/dist/rendering/CameraWrapperPerspective.d.ts +5 -0
- package/dist/rendering/CameraWrapperPerspective.d.ts.map +1 -1
- package/dist/rendering/CameraWrapperPerspective.js +16 -0
- package/dist/rendering/CameraWrapperPerspective.js.map +1 -1
- package/dist/rendering/ChitGalleryItemInstance.d.ts +14 -3
- package/dist/rendering/ChitGalleryItemInstance.d.ts.map +1 -1
- package/dist/rendering/ChitGalleryItemInstance.js +29 -1
- package/dist/rendering/ChitGalleryItemInstance.js.map +1 -1
- package/dist/rendering/ChitRenderInstance.d.ts +15 -1
- package/dist/rendering/ChitRenderInstance.d.ts.map +1 -1
- package/dist/rendering/ChitRenderInstance.js +49 -4
- package/dist/rendering/ChitRenderInstance.js.map +1 -1
- package/dist/rendering/LightWrapper.d.ts.map +1 -1
- package/dist/rendering/LightWrapper.js +10 -1
- package/dist/rendering/LightWrapper.js.map +1 -1
- package/dist/rendering/RootChitRenderInstance.d.ts +2 -0
- package/dist/rendering/RootChitRenderInstance.d.ts.map +1 -1
- package/dist/rendering/RootChitRenderInstance.js +29 -0
- package/dist/rendering/RootChitRenderInstance.js.map +1 -1
- package/dist/rendering/Splay.d.ts +11 -0
- package/dist/rendering/Splay.d.ts.map +1 -1
- package/dist/rendering/Splay.js +20 -10
- package/dist/rendering/Splay.js.map +1 -1
- package/dist/utilities/Annotations.d.ts +15 -0
- package/dist/utilities/Annotations.d.ts.map +1 -1
- package/dist/utilities/Annotations.js +31 -7
- package/dist/utilities/Annotations.js.map +1 -1
- package/dist/utilities/CanvasStack/CanvasStack.d.ts +2 -0
- package/dist/utilities/CanvasStack/CanvasStack.d.ts.map +1 -1
- package/dist/utilities/CanvasStack/CanvasStack.js +4 -0
- package/dist/utilities/CanvasStack/CanvasStack.js.map +1 -1
- package/dist/utilities/CanvasStack/RichTextRenderer.d.ts.map +1 -1
- package/dist/utilities/CanvasStack/RichTextRenderer.js +12 -0
- package/dist/utilities/CanvasStack/RichTextRenderer.js.map +1 -1
- package/dist/utilities/Dice.d.ts +2 -0
- package/dist/utilities/Dice.d.ts.map +1 -1
- package/dist/utilities/Dice.js +5 -1
- package/dist/utilities/Dice.js.map +1 -1
- package/dist/utilities/GalleryItemConversion.d.ts.map +1 -1
- package/dist/utilities/GalleryItemConversion.js +5 -7
- package/dist/utilities/GalleryItemConversion.js.map +1 -1
- package/dist/utilities/TokenizedText.d.ts +6 -0
- package/dist/utilities/TokenizedText.d.ts.map +1 -1
- package/dist/utilities/TokenizedText.js.map +1 -1
- package/dist/utilities/zIndex.d.ts +1 -0
- package/dist/utilities/zIndex.d.ts.map +1 -1
- package/dist/utilities/zIndex.js +1 -0
- package/dist/utilities/zIndex.js.map +1 -1
- package/package.json +3 -2
- package/src/library/components/ActionLogDisplay.tsx +1 -0
- package/src/library/components/BottomBarButton.tsx +5 -0
- package/src/library/components/ContextGalleryDisplay.tsx +2 -0
- package/src/library/components/DemoWrapper.tsx +150 -44
- package/src/library/components/FullScreenGalleryDisplay.tsx +3 -0
- package/src/library/components/Gallery/BuiltItem.ts +92 -16
- package/src/library/components/Gallery/GalleryController.ts +111 -10
- package/src/library/components/Gallery/GalleryViewer.tsx +144 -12
- package/src/library/components/Gallery/LayoutManager.ts +55 -6
- package/src/library/components/Gallery/constants.ts +6 -0
- package/src/library/components/Gallery/registry.ts +44 -0
- package/src/library/components/Gallery/types.ts +6 -0
- package/src/library/components/GameDesigner.tsx +165 -12
- package/src/library/components/InlineGalleryDisplay.tsx +41 -6
- package/src/library/components/LiveButton.tsx +8 -5
- package/src/library/components/MatchViewer.tsx +14 -3
- package/src/library/components/Panel/ExternalDrag.ts +122 -0
- package/src/library/components/Panel/MultiPanel.tsx +21 -0
- package/src/library/components/Panel/PanelContents.tsx +96 -1
- package/src/library/components/Panel/PanelTabStack.tsx +1 -0
- package/src/library/components/PanelSpark.tsx +12 -5
- package/src/library/components/Playground.tsx +48 -21
- package/src/library/components/PromptControls.tsx +7 -3
- package/src/library/components/SparkLineChart.tsx +23 -27
- package/src/library/components/TimeControlBar.tsx +5 -3
- package/src/library/components/TokenizedMarkdown.tsx +224 -0
- package/src/library/components/TokenizedMessage.tsx +28 -32
- package/src/library/components/TopBar.tsx +2 -1
- package/src/library/components/TopBarPlayers.tsx +13 -15
- package/src/library/components/Tutorial/BrowserNarration.ts +233 -0
- package/src/library/components/Tutorial/TutorialBox.tsx +506 -0
- package/src/library/components/Tutorial/TutorialDevPanel.tsx +297 -0
- package/src/library/components/Tutorial/TutorialOverlay.tsx +1316 -0
- package/src/library/components/Tutorial/targetRects.ts +273 -0
- package/src/library/components/Viewer.tsx +1 -0
- package/src/library/game/Chit.ts +28 -7
- package/src/library/game/ClientTimeState.ts +18 -0
- package/src/library/game/GalleryItemChitChildrenSource.ts +1 -0
- package/src/library/game/GalleryItemRawSource.ts +1 -0
- package/src/library/game/Game.ts +7 -0
- package/src/library/game/GameButton.ts +13 -1
- package/src/library/game/GameTheme.ts +4 -0
- package/src/library/game/Match.ts +12 -2
- package/src/library/game/ModalState.ts +3 -0
- package/src/library/game/Pick.ts +17 -4
- package/src/library/game/PlayerPromptStatusChit.ts +6 -4
- package/src/library/game/Prompt.ts +33 -2
- package/src/library/game/SparkChit.ts +9 -0
- package/src/library/game/Turn.ts +185 -70
- package/src/library/game/TurnState.ts +26 -3
- package/src/library/game/ai/AI_GUIDE.md +10 -0
- package/src/library/game/ai/AiClientPrompts.ts +60 -11
- package/src/library/game/ai/AiPlayerView.ts +2 -0
- package/src/library/game/clientTransport/ClientPrompts.ts +76 -5
- package/src/library/game/clientTransport/ClientTime.ts +75 -14
- package/src/library/game/serialize.test.ts +275 -0
- package/src/library/game/tutorial/TUTORIAL_GUIDE.md +416 -0
- package/src/library/game/tutorial/TutorialController.test.ts +731 -0
- package/src/library/game/tutorial/TutorialController.ts +1299 -0
- package/src/library/game/tutorial/TutorialRuntime.ts +311 -0
- package/src/library/game/tutorial/TutorialTheme.ts +67 -0
- package/src/library/game/tutorial/allowed.ts +145 -0
- package/src/library/game/tutorial/checks.ts +186 -0
- package/src/library/game/tutorial/createDemoMatch.ts +115 -0
- package/src/library/game/tutorial/defineTutorial.ts +414 -0
- package/src/library/game/tutorial/runTutorial.ts +350 -0
- package/src/library/game/undo.test.ts +282 -0
- package/src/library/hooks/usePanelNavigation.tsx +65 -0
- package/src/library/hooks/useTimeController.tsx +10 -2
- package/src/library/hooks/useTutorial.tsx +80 -0
- package/src/library/index.ts +58 -2
- package/src/library/rendering/CameraWrapperPerspective.ts +17 -0
- package/src/library/rendering/ChitGalleryItemInstance.ts +30 -1
- package/src/library/rendering/ChitRenderInstance.ts +57 -4
- package/src/library/rendering/LightWrapper.ts +10 -1
- package/src/library/rendering/RootChitRenderInstance.ts +30 -1
- package/src/library/rendering/Splay.test.ts +60 -0
- package/src/library/rendering/Splay.ts +30 -9
- package/src/library/utilities/Annotations.ts +35 -7
- package/src/library/utilities/CanvasStack/CanvasStack.ts +6 -1
- package/src/library/utilities/CanvasStack/RichTextRenderer.ts +13 -0
- package/src/library/utilities/Dice.tsx +5 -1
- package/src/library/utilities/GalleryItemConversion.ts +5 -6
- package/src/library/utilities/TokenizedText.ts +6 -0
- package/src/library/utilities/zIndex.ts +1 -0
|
@@ -28,32 +28,30 @@ interface SparkLineChartProps {
|
|
|
28
28
|
width?: number;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
const HALO_OPACITY = 0.
|
|
31
|
+
const HALO_OPACITY = 0.85;
|
|
32
32
|
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
// black and white read as arbitrary noise.
|
|
33
|
+
// The halo is the bg itself, made opaque — a knockout that cuts each line and
|
|
34
|
+
// label cleanly out of the grid and the lines it crosses, invisible against the
|
|
35
|
+
// bg. A halo opposite the bg reads as grey fuzz around everything.
|
|
37
36
|
function getUnifiedHaloColor(backgroundColor: string): string {
|
|
38
|
-
return Color(backgroundColor).
|
|
37
|
+
return Color(backgroundColor).alpha(1).hex();
|
|
39
38
|
}
|
|
40
39
|
|
|
41
|
-
//
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (candidate.contrast(halo) >= minRatio) return candidate.hex();
|
|
40
|
+
// A player colour too close to the bg's luminance (dark red on a dark dialog)
|
|
41
|
+
// would vanish, so step its HSL lightness away from the bg until WCAG contrast
|
|
42
|
+
// clears the large-text threshold (the 20px bold labels). Hue and saturation
|
|
43
|
+
// are kept, so the colour still reads as that player's; colours that already
|
|
44
|
+
// contrast are left untouched.
|
|
45
|
+
function adjustLineForBackground(lineColor: string, backgroundColor: string, minRatio = 3): string {
|
|
46
|
+
const bg = Color(backgroundColor).alpha(1);
|
|
47
|
+
const line = Color(lineColor).alpha(1);
|
|
48
|
+
if (line.contrast(bg) >= minRatio) return line.hex();
|
|
49
|
+
const step = bg.isDark() ? 5 : -5;
|
|
50
|
+
for (let l = line.lightness() + step; l > 0 && l < 100; l += step) {
|
|
51
|
+
const candidate = line.lightness(l);
|
|
52
|
+
if (candidate.contrast(bg) >= minRatio) return candidate.hex();
|
|
55
53
|
}
|
|
56
|
-
return
|
|
54
|
+
return bg.isDark() ? "#ffffff" : "#000000";
|
|
57
55
|
}
|
|
58
56
|
|
|
59
57
|
export function SparkLineChart({
|
|
@@ -168,14 +166,12 @@ export function SparkLineChart({
|
|
|
168
166
|
const getY = (value: number) => chartHeight - ((value - chartMinValue) / chartValueRange) * chartHeight;
|
|
169
167
|
const chartEndX = chartWidth;
|
|
170
168
|
|
|
171
|
-
//
|
|
172
|
-
//
|
|
173
|
-
// bg the halo is dark, all the light pastels keep their hue, and the lone
|
|
174
|
-
// dark line gets lightened until the dark halo can actually frame it.
|
|
169
|
+
// Lines keep their player colours unless they'd sink into the bg; the halo
|
|
170
|
+
// matches the bg so it separates without tinting anything.
|
|
175
171
|
const haloColor = getUnifiedHaloColor(backgroundColor);
|
|
176
172
|
const displayLines = lines.map((line) => ({
|
|
177
173
|
...line,
|
|
178
|
-
color:
|
|
174
|
+
color: adjustLineForBackground(line.color, backgroundColor),
|
|
179
175
|
}));
|
|
180
176
|
|
|
181
177
|
return (
|
|
@@ -231,7 +227,7 @@ export function SparkLineChart({
|
|
|
231
227
|
|
|
232
228
|
return (
|
|
233
229
|
<g key={line.id}>
|
|
234
|
-
{/*
|
|
230
|
+
{/* Bg-coloured knockout behind every line. */}
|
|
235
231
|
<path
|
|
236
232
|
d={extendedPathData}
|
|
237
233
|
fill="none"
|
|
@@ -15,11 +15,13 @@ export default function TimeControlBar({ autoLive = false }: { autoLive?: boolea
|
|
|
15
15
|
const [live, setLive] = useEventChannelState(timeState.live);
|
|
16
16
|
const [targetClock, setTargetClock] = useEventChannelState(timeState.targetClock);
|
|
17
17
|
const [maxClock] = useEventChannelState(timeController.maxClock);
|
|
18
|
+
const [hold] = useEventChannelState(timeState.timelineHold);
|
|
19
|
+
const end = hold === undefined ? maxClock.clock : Math.min(hold, maxClock.clock);
|
|
18
20
|
const modalState = useModalState();
|
|
19
21
|
const [settingsVisible, setSettingsVisible] = useEventChannelState(modalState.settingsVisible);
|
|
20
22
|
|
|
21
23
|
return (
|
|
22
|
-
<Box sx={{ width: "100%", height: "100%", position: "relative" }}>
|
|
24
|
+
<Box data-tutorial-target="time" sx={{ width: "100%", height: "100%", position: "relative" }}>
|
|
23
25
|
<Box sx={{ height: "6px", position: "absolute", width: "100%" }}>
|
|
24
26
|
{targetClock < maxClock.clock && !live && (
|
|
25
27
|
<Box
|
|
@@ -50,11 +52,11 @@ export default function TimeControlBar({ autoLive = false }: { autoLive?: boolea
|
|
|
50
52
|
}}
|
|
51
53
|
/>
|
|
52
54
|
<BottomBarButton
|
|
53
|
-
disabled={targetClock >=
|
|
55
|
+
disabled={targetClock >= end}
|
|
54
56
|
icon={FastForward}
|
|
55
57
|
label={"Forward"}
|
|
56
58
|
whileHolding={(n: number) => {
|
|
57
|
-
if (autoLive && targetClock + n >=
|
|
59
|
+
if (autoLive && targetClock + n >= end) {
|
|
58
60
|
setLive(true);
|
|
59
61
|
setTargetClock(targetClock + n);
|
|
60
62
|
} else {
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
|
+
import Markdown, { Components } from "react-markdown";
|
|
3
|
+
import { Box } from "@mui/material";
|
|
4
|
+
import { Token } from "./TokenizedMessage";
|
|
5
|
+
import { TokenDefinition, TokenMap } from "../utilities/TokenizedText";
|
|
6
|
+
import { UpdatingCanvasImage } from "./UpdatingCanvasImage";
|
|
7
|
+
import { StaticImage } from "../utilities/StaticImage";
|
|
8
|
+
|
|
9
|
+
export interface TokenizedMarkdownProps {
|
|
10
|
+
/** Markdown. `:token:` references render as the game's icons, like log lines. */
|
|
11
|
+
text: string;
|
|
12
|
+
fontSize: number;
|
|
13
|
+
tokenMap?: TokenMap;
|
|
14
|
+
color?: string;
|
|
15
|
+
/** Sentence to emphasise (0-based, counted across the whole text); others are dimmed. -1 for none. */
|
|
16
|
+
activeSentence?: number;
|
|
17
|
+
/** Opacity of sentences other than the active one. Default 0.55 */
|
|
18
|
+
dimmedOpacity?: number;
|
|
19
|
+
/** Colour of the active sentence. Default: inherit */
|
|
20
|
+
accent?: string;
|
|
21
|
+
/** Resolves relative image URLs. Default: unchanged */
|
|
22
|
+
resolveImage?: (src: string) => string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const TOKEN_REGEX = /:([a-zA-Z0-9_-]+):/g;
|
|
26
|
+
const SENTENCE_END = /[.!?]+["')\]]*(?=\s|$)/g;
|
|
27
|
+
|
|
28
|
+
type HastNode = {
|
|
29
|
+
type: string;
|
|
30
|
+
tagName?: string;
|
|
31
|
+
value?: string;
|
|
32
|
+
properties?: Record<string, unknown>;
|
|
33
|
+
children?: HastNode[];
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A rehype plugin that turns `:token:` text into `<span data-token>` and wraps the text of each
|
|
38
|
+
* sentence in `<span data-sentence>`, counting sentences in document order. Keeps the structure
|
|
39
|
+
* react-markdown produced; only text nodes change.
|
|
40
|
+
*/
|
|
41
|
+
function rehypeTokensAndSentences(tokenMap: TokenMap) {
|
|
42
|
+
return () => (tree: HastNode) => {
|
|
43
|
+
let sentence = 0;
|
|
44
|
+
const walk = (node: HastNode, insideCode: boolean) => {
|
|
45
|
+
if (node.type === "element" && (node.tagName === "code" || node.tagName === "pre")) {
|
|
46
|
+
insideCode = true;
|
|
47
|
+
}
|
|
48
|
+
if (!node.children) return;
|
|
49
|
+
const next: HastNode[] = [];
|
|
50
|
+
for (const child of node.children) {
|
|
51
|
+
if (child.type === "text" && !insideCode && child.value) {
|
|
52
|
+
next.push(...splitText(child.value));
|
|
53
|
+
} else {
|
|
54
|
+
walk(child, insideCode);
|
|
55
|
+
next.push(child);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
node.children = next;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const span = (properties: Record<string, unknown>, children: HastNode[]): HastNode => ({
|
|
62
|
+
type: "element",
|
|
63
|
+
tagName: "span",
|
|
64
|
+
properties,
|
|
65
|
+
children,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const splitText = (value: string): HastNode[] => {
|
|
69
|
+
const out: HastNode[] = [];
|
|
70
|
+
let buffer = "";
|
|
71
|
+
const flushText = () => {
|
|
72
|
+
if (buffer) {
|
|
73
|
+
out.push(span({ dataSentence: sentence }, [{ type: "text", value: buffer }]));
|
|
74
|
+
buffer = "";
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
// Tokens first, then sentence ends inside the plain runs
|
|
78
|
+
let last = 0;
|
|
79
|
+
const tokenRegex = new RegExp(TOKEN_REGEX.source, "g");
|
|
80
|
+
let m: RegExpExecArray | null;
|
|
81
|
+
const pushRun = (run: string) => {
|
|
82
|
+
let runLast = 0;
|
|
83
|
+
const endRegex = new RegExp(SENTENCE_END.source, "g");
|
|
84
|
+
let e: RegExpExecArray | null;
|
|
85
|
+
while ((e = endRegex.exec(run)) !== null) {
|
|
86
|
+
buffer += run.substring(runLast, e.index + e[0].length);
|
|
87
|
+
runLast = e.index + e[0].length;
|
|
88
|
+
flushText();
|
|
89
|
+
sentence++;
|
|
90
|
+
}
|
|
91
|
+
buffer += run.substring(runLast);
|
|
92
|
+
};
|
|
93
|
+
while ((m = tokenRegex.exec(value)) !== null) {
|
|
94
|
+
const name = m[1];
|
|
95
|
+
if (!tokenMap[name]) continue;
|
|
96
|
+
pushRun(value.substring(last, m.index));
|
|
97
|
+
flushText();
|
|
98
|
+
out.push(span({ dataToken: name, dataSentence: sentence }, []));
|
|
99
|
+
last = m.index + m[0].length;
|
|
100
|
+
}
|
|
101
|
+
pushRun(value.substring(last));
|
|
102
|
+
flushText();
|
|
103
|
+
return out;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
walk(tree, false);
|
|
107
|
+
// Trailing text with no terminal punctuation still counts as a sentence; nothing to do.
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function MarkdownImage({
|
|
112
|
+
src,
|
|
113
|
+
alt,
|
|
114
|
+
tokenMap,
|
|
115
|
+
resolveImage,
|
|
116
|
+
}: {
|
|
117
|
+
src?: string;
|
|
118
|
+
alt?: string;
|
|
119
|
+
tokenMap: TokenMap;
|
|
120
|
+
resolveImage?: (src: string) => string;
|
|
121
|
+
}) {
|
|
122
|
+
if (!src) return null;
|
|
123
|
+
if (src.startsWith("token:")) {
|
|
124
|
+
const def: TokenDefinition | undefined = tokenMap[src.substring("token:".length)];
|
|
125
|
+
if (!def?.image) return <>{alt}</>;
|
|
126
|
+
if (typeof def.image === "string") {
|
|
127
|
+
return <Box component="img" src={def.image} alt={alt} sx={{ maxWidth: "100%", display: "block", my: 1 }} />;
|
|
128
|
+
}
|
|
129
|
+
const canvas = new StaticImage(def.image).get();
|
|
130
|
+
return (
|
|
131
|
+
<Box sx={{ my: 1 }}>
|
|
132
|
+
<UpdatingCanvasImage image={canvas} style={{ maxWidth: "100%", display: "block" }} />
|
|
133
|
+
</Box>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
return (
|
|
137
|
+
<Box
|
|
138
|
+
component="img"
|
|
139
|
+
src={resolveImage ? resolveImage(src) : src}
|
|
140
|
+
alt={alt}
|
|
141
|
+
sx={{ maxWidth: "100%", height: "auto", display: "block", my: 1, borderRadius: 1 }}
|
|
142
|
+
/>
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Markdown with the game's `:token:` icons inline, rendered with the same token map and `Token`
|
|
148
|
+
* component as the action log, plus optional per-sentence emphasis for narration. Images can be
|
|
149
|
+
* URLs or `token:<name>` to show a token's art at image size.
|
|
150
|
+
*/
|
|
151
|
+
export function TokenizedMarkdown({
|
|
152
|
+
text,
|
|
153
|
+
fontSize,
|
|
154
|
+
tokenMap = {},
|
|
155
|
+
color,
|
|
156
|
+
activeSentence = -1,
|
|
157
|
+
dimmedOpacity = 0.55,
|
|
158
|
+
accent,
|
|
159
|
+
resolveImage,
|
|
160
|
+
}: TokenizedMarkdownProps) {
|
|
161
|
+
const plugin = useMemo(() => rehypeTokensAndSentences(tokenMap), [tokenMap]);
|
|
162
|
+
|
|
163
|
+
const components = useMemo<Components>(
|
|
164
|
+
() => ({
|
|
165
|
+
// eslint-disable-next-line react/prop-types
|
|
166
|
+
span: (props) => {
|
|
167
|
+
// eslint-disable-next-line react/prop-types
|
|
168
|
+
const { node, children, ...rest } = props as any;
|
|
169
|
+
// eslint-disable-next-line react/prop-types
|
|
170
|
+
const p = node?.properties ?? {};
|
|
171
|
+
const tokenName = p.dataToken as string | undefined;
|
|
172
|
+
const sentence = p.dataSentence as number | undefined;
|
|
173
|
+
const emphasised = activeSentence < 0 || sentence === undefined || sentence === activeSentence;
|
|
174
|
+
const style: React.CSSProperties = {
|
|
175
|
+
opacity: emphasised ? 1 : dimmedOpacity,
|
|
176
|
+
color: emphasised && activeSentence >= 0 && accent ? accent : undefined,
|
|
177
|
+
transition: "opacity 0.25s linear, color 0.25s linear",
|
|
178
|
+
};
|
|
179
|
+
if (tokenName) {
|
|
180
|
+
return (
|
|
181
|
+
<span style={style}>
|
|
182
|
+
<Token name={tokenName} definition={tokenMap[tokenName]} fontSize={fontSize} />
|
|
183
|
+
</span>
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
return (
|
|
187
|
+
<span {...rest} style={style}>
|
|
188
|
+
{children}
|
|
189
|
+
</span>
|
|
190
|
+
);
|
|
191
|
+
},
|
|
192
|
+
// eslint-disable-next-line react/prop-types
|
|
193
|
+
img: (props) => {
|
|
194
|
+
// eslint-disable-next-line react/prop-types
|
|
195
|
+
const { src, alt } = props as any;
|
|
196
|
+
return <MarkdownImage src={src} alt={alt} tokenMap={tokenMap} resolveImage={resolveImage} />;
|
|
197
|
+
},
|
|
198
|
+
p: ({ children }) => <Box sx={{ my: 0.75, "&:first-of-type": { mt: 0 }, "&:last-of-type": { mb: 0 } }}>{children}</Box>,
|
|
199
|
+
ul: ({ children }) => <Box component="ul" sx={{ my: 0.5, pl: 2.5 }}>{children}</Box>,
|
|
200
|
+
ol: ({ children }) => <Box component="ol" sx={{ my: 0.5, pl: 2.5 }}>{children}</Box>,
|
|
201
|
+
li: ({ children }) => <Box component="li" sx={{ my: 0.25 }}>{children}</Box>,
|
|
202
|
+
h1: ({ children }) => <Box sx={{ fontSize: fontSize * 1.4, fontWeight: "bold", my: 0.5 }}>{children}</Box>,
|
|
203
|
+
h2: ({ children }) => <Box sx={{ fontSize: fontSize * 1.25, fontWeight: "bold", my: 0.5 }}>{children}</Box>,
|
|
204
|
+
h3: ({ children }) => <Box sx={{ fontSize: fontSize * 1.1, fontWeight: "bold", my: 0.5 }}>{children}</Box>,
|
|
205
|
+
a: ({ children, href }) => (
|
|
206
|
+
<a href={href} target="_blank" rel="noreferrer" style={{ color: accent ?? "inherit" }}>
|
|
207
|
+
{children}
|
|
208
|
+
</a>
|
|
209
|
+
),
|
|
210
|
+
blockquote: ({ children }) => (
|
|
211
|
+
<Box sx={{ borderLeft: `3px solid ${accent ?? "currentColor"}`, pl: 1.5, my: 0.75, opacity: 0.9 }}>{children}</Box>
|
|
212
|
+
),
|
|
213
|
+
}),
|
|
214
|
+
[activeSentence, dimmedOpacity, accent, tokenMap, fontSize, resolveImage],
|
|
215
|
+
);
|
|
216
|
+
|
|
217
|
+
return (
|
|
218
|
+
<Box sx={{ fontSize: `${fontSize}px`, lineHeight: 1.35, color }}>
|
|
219
|
+
<Markdown rehypePlugins={[plugin]} components={components} skipHtml>
|
|
220
|
+
{text}
|
|
221
|
+
</Markdown>
|
|
222
|
+
</Box>
|
|
223
|
+
);
|
|
224
|
+
}
|
|
@@ -23,44 +23,34 @@ function calculateBackgroundColor(textColor: string): string {
|
|
|
23
23
|
: color.lightness(95).hex(); // 95% brightness for dark colors
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
const LINE_HEIGHT = 1.1;
|
|
27
|
+
const DEFAULT_IMAGE_BLEED = 0.1;
|
|
28
|
+
|
|
26
29
|
// Token Image Component
|
|
27
30
|
interface TokenImageProps {
|
|
28
31
|
src: string | ImageSpec;
|
|
29
32
|
alt: string;
|
|
30
33
|
fontSize: number;
|
|
31
|
-
|
|
34
|
+
bleed: number;
|
|
32
35
|
}
|
|
33
36
|
|
|
34
|
-
function TokenImage({ src, alt, fontSize,
|
|
37
|
+
function TokenImage({ src, alt, fontSize, bleed }: TokenImageProps) {
|
|
38
|
+
// grow past the line box, then cancel the extra height with negative margins so lines don't get pushed apart
|
|
39
|
+
const bleedPx = bleed * fontSize;
|
|
40
|
+
const style = {
|
|
41
|
+
height: `${fontSize * LINE_HEIGHT + bleedPx * 2}px`,
|
|
42
|
+
marginTop: `${-bleedPx}px`,
|
|
43
|
+
marginBottom: `${-bleedPx}px`,
|
|
44
|
+
marginLeft: "1px",
|
|
45
|
+
marginRight: "3px",
|
|
46
|
+
position: "relative" as const,
|
|
47
|
+
};
|
|
48
|
+
|
|
35
49
|
if (typeof src !== "string") {
|
|
36
50
|
const updatingCanvas = new StaticImage(src).get();
|
|
37
|
-
return
|
|
38
|
-
<UpdatingCanvasImage
|
|
39
|
-
image={updatingCanvas}
|
|
40
|
-
style={{
|
|
41
|
-
height: `${fontSize - 4}px`,
|
|
42
|
-
marginRight: "4px",
|
|
43
|
-
transform: `scale(1.4)`,
|
|
44
|
-
position: "relative",
|
|
45
|
-
marginLeft: "2px",
|
|
46
|
-
}}
|
|
47
|
-
/>
|
|
48
|
-
);
|
|
51
|
+
return <UpdatingCanvasImage image={updatingCanvas} style={style} />;
|
|
49
52
|
} else {
|
|
50
|
-
return
|
|
51
|
-
<Box
|
|
52
|
-
component="img"
|
|
53
|
-
src={src}
|
|
54
|
-
alt={alt}
|
|
55
|
-
sx={{
|
|
56
|
-
height: `${fontSize - 4}px`,
|
|
57
|
-
marginRight: "4px",
|
|
58
|
-
transform: `scale(1.4)`,
|
|
59
|
-
position: "relative",
|
|
60
|
-
marginLeft: "2px",
|
|
61
|
-
}}
|
|
62
|
-
/>
|
|
63
|
-
);
|
|
53
|
+
return <Box component="img" src={src} alt={alt} sx={style} />;
|
|
64
54
|
}
|
|
65
55
|
}
|
|
66
56
|
|
|
@@ -93,7 +83,7 @@ interface TokenProps {
|
|
|
93
83
|
fontSize: number;
|
|
94
84
|
}
|
|
95
85
|
|
|
96
|
-
function Token({ name, definition, fontSize }: TokenProps) {
|
|
86
|
+
export function Token({ name, definition, fontSize }: TokenProps) {
|
|
97
87
|
if (!definition) {
|
|
98
88
|
return <>{`:${name}:`}</>;
|
|
99
89
|
}
|
|
@@ -107,7 +97,8 @@ function Token({ name, definition, fontSize }: TokenProps) {
|
|
|
107
97
|
display: "inline-flex",
|
|
108
98
|
alignItems: "center",
|
|
109
99
|
whiteSpace: "nowrap",
|
|
110
|
-
|
|
100
|
+
// an image has no text baseline, so center image tokens on the text instead
|
|
101
|
+
verticalAlign: definition.image ? "middle" : "baseline",
|
|
111
102
|
backgroundColor,
|
|
112
103
|
padding: backgroundColor ? "1px 2px" : 0,
|
|
113
104
|
margin: backgroundColor ? "-1px 0" : 0,
|
|
@@ -115,7 +106,12 @@ function Token({ name, definition, fontSize }: TokenProps) {
|
|
|
115
106
|
}}
|
|
116
107
|
>
|
|
117
108
|
{definition.image && (
|
|
118
|
-
<TokenImage
|
|
109
|
+
<TokenImage
|
|
110
|
+
src={definition.image}
|
|
111
|
+
alt={name}
|
|
112
|
+
fontSize={fontSize}
|
|
113
|
+
bleed={definition.imageBleed ?? (backgroundColor ? 0 : DEFAULT_IMAGE_BLEED)}
|
|
114
|
+
/>
|
|
119
115
|
)}
|
|
120
116
|
{definition.label && <TokenLabel label={definition.label} color={definition.color} fontSize={fontSize} />}
|
|
121
117
|
</Box>
|
|
@@ -130,7 +126,7 @@ export function TokenizedMessage({ message, fontSize, tokenMap = {} }: Tokenized
|
|
|
130
126
|
<Box
|
|
131
127
|
sx={{
|
|
132
128
|
fontSize: `${fontSize}px`,
|
|
133
|
-
lineHeight: `${fontSize *
|
|
129
|
+
lineHeight: `${fontSize * LINE_HEIGHT}px`,
|
|
134
130
|
}}
|
|
135
131
|
>
|
|
136
132
|
{elements.map((element) =>
|
|
@@ -79,7 +79,8 @@ export default function TopBar({ onBack }: { onBack?: () => void }) {
|
|
|
79
79
|
<TopBarPlayers />
|
|
80
80
|
</Box>
|
|
81
81
|
{dropdowns.map((dropdown) => (
|
|
82
|
-
|
|
82
|
+
// a tutorial points at a dropdown (a player aid) as `{ ui: "dropdown:<chit id>" }`
|
|
83
|
+
<Box key={dropdown.id} data-tutorial-target={`dropdown:${dropdown.id}`} sx={{ width: barWidth, borderLeft: `1px solid ${theme.barBreak}` }}>
|
|
83
84
|
<DropdownChitWrapper chitId={dropdown.id} />
|
|
84
85
|
</Box>
|
|
85
86
|
))}
|
|
@@ -117,12 +117,7 @@ function PlayerInfoRow({ headers, player }: { player: PlayerChit; headers?: bool
|
|
|
117
117
|
<PlayerInfoCell size={size} key={spark.id} spark={spark} />
|
|
118
118
|
))}
|
|
119
119
|
<TextPlayerInfoCell size={size} width={NAME_WIDTH} text={player.name} />
|
|
120
|
-
{
|
|
121
|
-
<TextPlayerInfoCell
|
|
122
|
-
size={size}
|
|
123
|
-
width={PROMPT_WIDTH}
|
|
124
|
-
text={player.promptStatus.latestPromptMessageText ?? player.promptStatus.latestPromptMessage ?? ""}
|
|
125
|
-
/>
|
|
120
|
+
<TextPlayerInfoCell size={size} width={PROMPT_WIDTH} text={player.promptStatus.latestPromptMessage ?? ""} />
|
|
126
121
|
</Stack>
|
|
127
122
|
);
|
|
128
123
|
}
|
|
@@ -138,15 +133,18 @@ export default function TopBarPlayers() {
|
|
|
138
133
|
<TopBarDropdown
|
|
139
134
|
label={
|
|
140
135
|
<Stack direction={"row"} sx={{ pt: 1, pb: 1, maxWidth: "100%" }}>
|
|
141
|
-
{
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
136
|
+
{/* The avatar cluster is what a tutorial points at with { ui: "players" }, not the whole strip */}
|
|
137
|
+
<Stack direction={"row"} data-tutorial-target="players" sx={{ pl: 1 }}>
|
|
138
|
+
{playerChits.map((player) => (
|
|
139
|
+
<PlayerImage
|
|
140
|
+
sx={{ ml: -1 }}
|
|
141
|
+
borderColor={player.promptStatus.latestPromptMessage ? theme.chitHighlightColor : undefined}
|
|
142
|
+
size={theme.topBarHeight - theme.spacing * 2}
|
|
143
|
+
key={player.id}
|
|
144
|
+
player={player}
|
|
145
|
+
/>
|
|
146
|
+
))}
|
|
147
|
+
</Stack>
|
|
150
148
|
<Typography
|
|
151
149
|
flex={1}
|
|
152
150
|
sx={{
|