diff --git a/artwork/logo.xopp b/artwork/logo.xopp index 661e50f..741e106 100644 Binary files a/artwork/logo.xopp and b/artwork/logo.xopp differ diff --git a/src/App/About.tsx b/src/App/About.tsx new file mode 100644 index 0000000..104e114 --- /dev/null +++ b/src/App/About.tsx @@ -0,0 +1,11 @@ +import logo from "../../artwork/logo.svg"; + +export function About() { + return
+

+

StateBuddy is a statechart editing, simulation, debugging and testing environment inspired by CouchEdit.

+

It was originally created for teaching Statecharts to university students, but likely is a useful tool for other purposes as well.

+

StateBuddy is open source.

+

For commerical use, e‑mail me for permission.

+
; +} diff --git a/src/App/App.tsx b/src/App/App.tsx index bfebb73..26e6927 100644 --- a/src/App/App.tsx +++ b/src/App/App.tsx @@ -1,4 +1,4 @@ -import { useEffect, useRef, useState } from "react"; +import { ReactElement, useEffect, useRef, useState } from "react"; import { emptyStatechart, Statechart } from "../statecharts/abstract_syntax"; import { handleInputEvent, initialize } from "../statecharts/interpreter"; @@ -25,6 +25,8 @@ export function App() { const [rtIdx, setRTIdx] = useState(); const [time, setTime] = useState({kind: "paused", simtime: 0}); + const [modal, setModal] = useState(null); + const refRightSideBar = useRef(null); function onInit() { @@ -144,7 +146,19 @@ export function App() { console.log(ast); - return + return <> + {/* Modal dialog */} + {modal &&
setModal(null)} + style={{width: '100%', height: '100%', position:'absolute', textAlign: 'center', backgroundColor: 'rgba(127,127,127,0.5)' }}> +
+ e.stopPropagation()}> + {modal} + +
+
} + {/* Top bar */} @@ -195,7 +209,8 @@ export function App() { }}> - ; +
+ ; } export default App; diff --git a/src/App/BottomPanel.tsx b/src/App/BottomPanel.tsx index ab78100..595a7ad 100644 --- a/src/App/BottomPanel.tsx +++ b/src/App/BottomPanel.tsx @@ -6,7 +6,7 @@ import "./BottomPanel.css"; import head from "../head.svg" ; export function BottomPanel(props: {errors: TraceableError[]}) { - const [greeting, setGreeting] = useState( "Welcome to StateBuddy, buddy!"); + const [greeting, setGreeting] = useState(<> "Welcome to StateBuddy, buddy!"); useEffect(() => { setTimeout(() => { diff --git a/src/App/TopPanel.tsx b/src/App/TopPanel.tsx index 85828b8..46ad441 100644 --- a/src/App/TopPanel.tsx +++ b/src/App/TopPanel.tsx @@ -13,10 +13,12 @@ import AccessAlarmIcon from '@mui/icons-material/AccessAlarm'; import StopIcon from '@mui/icons-material/Stop'; import UndoIcon from '@mui/icons-material/Undo'; import RedoIcon from '@mui/icons-material/Redo'; +import InfoOutlineIcon from '@mui/icons-material/InfoOutline'; import { formatTime } from "./util"; import { InsertMode } from "../VisualEditor/VisualEditor"; import { KeyInfoHidden, KeyInfoVisible } from "./KeyInfo"; +import { About } from "./About"; export type TopPanelProps = { rt?: BigStep, @@ -30,6 +32,7 @@ export type TopPanelProps = { ast: Statechart, mode: InsertMode, setMode: Dispatch>, + setModal: Dispatch>, } function RountangleIcon(props: {kind: string}) { @@ -63,7 +66,7 @@ function HistoryIcon(props: {kind: "shallow"|"deep"}) { } -export function TopPanel({rt, rtIdx, time, setTime, onInit, onClear, onRaise, onBack, ast, mode, setMode}: TopPanelProps) { +export function TopPanel({rt, rtIdx, time, setTime, onInit, onClear, onRaise, onBack, ast, mode, setMode, setModal}: TopPanelProps) { const [displayTime, setDisplayTime] = useState("0.000"); const [timescale, setTimescale] = useState(1); const [showKeys, setShowKeys] = useState(true); @@ -322,5 +325,9 @@ export function TopPanel({rt, rtIdx, time, setTime, onInit, onClear, onRaise, on +   + + + ; }