From 7253c9e5b4fa282d8a6eaeae5bda29ad5cb429bd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 10 Jan 2022 09:05:56 +0000 Subject: [PATCH 1/4] Release 0.5.1 to main From aa91dd059e094dcd8003a765e34c07aacd06dfbb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 11 Apr 2022 19:20:53 +0000 Subject: [PATCH 2/4] Release 0.7.0 to main From 5d8371820e12823110f3669d5fa8b91b635130be Mon Sep 17 00:00:00 2001 From: judicael_ai Date: Thu, 14 Apr 2022 20:51:29 +0300 Subject: [PATCH 3/4] feat(viz): add orientation option to viz --- src/App.tsx | 32 ++++++------ src/PanelsView.tsx | 6 ++- src/ResizableBox.tsx | 56 +++++++++++++++------ src/SettingsPanel.tsx | 26 +++++++++- src/visualizerOrientationContext.tsx | 73 ++++++++++++++++++++++++++++ 5 files changed, 157 insertions(+), 36 deletions(-) create mode 100644 src/visualizerOrientationContext.tsx diff --git a/src/App.tsx b/src/App.tsx index cfffc708..b301f7c9 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -21,6 +21,7 @@ import { useInterpretCanvas } from './useInterpretCanvas'; import router, { useRouter } from 'next/router'; import { parseEmbedQuery, withoutEmbedQueryParams } from './utils'; import { registryLinks } from './registryLinks'; +import { VizOrientationProvider } from './visualizerOrientationContext'; const defaultHeadProps = { title: 'XState Visualizer', @@ -131,23 +132,20 @@ function App({ isEmbedded = false }: { isEmbedded?: boolean }) { - - {!(embed?.isEmbedded && embed.mode === EmbedMode.Panels) && ( - - - - )} - - - + + <> + {!( + embed?.isEmbedded && embed.mode === EmbedMode.Panels + ) && ( + + + + )} + + + + + diff --git a/src/PanelsView.tsx b/src/PanelsView.tsx index 9770c26e..7cfd9550 100644 --- a/src/PanelsView.tsx +++ b/src/PanelsView.tsx @@ -24,10 +24,12 @@ import { SpinnerWithText } from './SpinnerWithText'; import { StatePanel } from './StatePanel'; import { EmbedMode } from './types'; import { calculatePanelIndexByPanelName } from './utils'; +import { useVizOrientation } from './visualizerOrientationContext'; export const PanelsView = (props: BoxProps) => { const embed = useEmbed(); const simService = useSimulation(); + const vizOrientation = useVizOrientation(); const services = useSelector(simService, selectServices); const [sourceState, sendToSourceService] = useSourceActor(); const [activePanelIndex, setActiveTabIndex] = useState(() => @@ -40,10 +42,10 @@ export const PanelsView = (props: BoxProps) => { } }, [embed]); - return ( + return vizOrientation.orientation === 'full' ? null : (