;
+}
+
+export default App;
diff --git a/src/VisualEditor/VisualEditor.css b/src/VisualEditor/VisualEditor.css
index d399f3a..8ce73d5 100644
--- a/src/VisualEditor/VisualEditor.css
+++ b/src/VisualEditor/VisualEditor.css
@@ -30,7 +30,7 @@ text.highlight {
}
.rountangle {
- fill: rgba(255, 255, 255, 255);
+ fill: white;
/* fill: none; */
stroke: black;
stroke-width: 2px;
@@ -58,6 +58,10 @@ text.highlight {
.rountangle.error {
stroke: rgb(230,0,0);
}
+.rountangle.active {
+ fill: rgb(255, 196, 0);
+ fill-opacity: 0.6;
+}
.selected:hover {
cursor: grab;
diff --git a/src/VisualEditor/VisualEditor.tsx b/src/VisualEditor/VisualEditor.tsx
index e71b54f..8185bee 100644
--- a/src/VisualEditor/VisualEditor.tsx
+++ b/src/VisualEditor/VisualEditor.tsx
@@ -1,4 +1,4 @@
-import { MouseEventHandler, SetStateAction, useEffect, useRef, useState } from "react";
+import { Dispatch, MouseEventHandler, SetStateAction, useEffect, useRef, useState } from "react";
import { ArcDirection, Line2D, Rect2D, Vec2D, addV2D, arcDirection, area, euclideanDistance, getBottomSide, getLeftSide, getRightSide, getTopSide, isEntirelyWithin, normalizeRect, subtractV2D, transformLine, transformRect } from "./geometry";
import "./VisualEditor.css";
@@ -9,7 +9,9 @@ import { parseStatechart } from "./parser";
import { CORNER_HELPER_OFFSET, CORNER_HELPER_RADIUS, MIN_ROUNTANGLE_SIZE, ROUNTANGLE_RADIUS } from "./parameters";
import * as lz4 from "@nick/lz4";
-import { initialize } from "./interpreter";
+import { getActiveStates, initialize } from "./interpreter";
+import { RT_Statechart } from "./runtime_types";
+import { emptyStatechart, Statechart } from "./ast";
type DraggingState = {
@@ -48,7 +50,16 @@ export const sides: [RountanglePart, (r:Rect2D)=>Line2D][] = [
["bottom", getBottomSide],
];
-export function VisualEditor() {
+type VisualEditorProps = {
+ ast: Statechart,
+ setAST: Dispatch