From 30fa1aaca1d6932afbbb209c24aab753ca8ee7d7 Mon Sep 17 00:00:00 2001 From: Joeri Exelmans Date: Sat, 25 Oct 2025 23:30:08 +0200 Subject: [PATCH] move some files around to confuse everyone --- src/App/App.tsx | 6 +++--- src/App/{ => Modals}/About.tsx | 0 src/App/{ => Modals}/TextDialog.tsx | 0 src/App/PersistentDetails.tsx | 2 +- .../Plant/DigitalWatch/DigitalWatch.css | 0 .../Plant/DigitalWatch/DigitalWatch.tsx | 0 .../Plant/DigitalWatch/digital-font.ttf | Bin .../Plant/DigitalWatch/noteSmall.png | Bin .../Plant/DigitalWatch/watch-light.png | Bin src/{ => App}/Plant/DigitalWatch/watch.png | Bin src/{ => App}/Plant/Dummy/Dummy.tsx | 0 src/{ => App}/Plant/Microwave/Microwave.css | 0 src/{ => App}/Plant/Microwave/Microwave.tsx | 0 src/{ => App}/Plant/Microwave/bell.wav | Bin src/{ => App}/Plant/Microwave/running.wav | Bin .../Plant/Microwave/small_closed_off.png | Bin .../Plant/Microwave/small_closed_on.png | Bin .../Plant/Microwave/small_opened_off.png | Bin .../Plant/Microwave/small_opened_on.png | Bin src/{ => App}/Plant/Plant.ts | 0 src/App/RTHistory.tsx | 2 +- src/App/ShowAST.tsx | 2 +- src/App/{ => TopPanel}/Icons.tsx | 0 src/App/TopPanel/InsertModes.tsx | 6 +++--- src/App/{ => TopPanel}/KeyInfo.tsx | 0 src/App/{ => TopPanel}/TopPanel.tsx | 18 +++++++++--------- src/App/TopPanel/UndoRedoButtons.tsx | 2 +- src/App/TopPanel/ZoomButtons.tsx | 4 ++-- src/{ => App}/VisualEditor/ArrowSVG.tsx | 4 ++-- src/{ => App}/VisualEditor/DiamondSVG.tsx | 2 +- src/{ => App}/VisualEditor/HistorySVG.tsx | 0 src/{ => App}/VisualEditor/RectHelpers.tsx | 2 +- src/{ => App}/VisualEditor/RountangleSVG.tsx | 4 ++-- src/{ => App}/VisualEditor/TextSVG.tsx | 6 +++--- src/{ => App}/VisualEditor/VisualEditor.css | 0 src/{ => App}/VisualEditor/VisualEditor.tsx | 10 +++++----- src/{ => App}/VisualEditor/editor_types.ts | 0 src/{ => App}/VisualEditor/geometry.ts | 2 +- src/{ => App}/VisualEditor/parameters.ts | 0 src/{ => App}/VisualEditor/svg_helper.ts | 0 src/{util => App}/persistent_state.ts | 0 src/App/shortcut_handler.ts | 2 +- src/statecharts/concrete_syntax.ts | 6 +++--- src/statecharts/detect_connections.ts | 2 +- src/statecharts/parser.ts | 8 ++++---- src/{App => util}/util.ts | 0 46 files changed, 45 insertions(+), 45 deletions(-) rename src/App/{ => Modals}/About.tsx (100%) rename src/App/{ => Modals}/TextDialog.tsx (100%) rename src/{ => App}/Plant/DigitalWatch/DigitalWatch.css (100%) rename src/{ => App}/Plant/DigitalWatch/DigitalWatch.tsx (100%) rename src/{ => App}/Plant/DigitalWatch/digital-font.ttf (100%) rename src/{ => App}/Plant/DigitalWatch/noteSmall.png (100%) rename src/{ => App}/Plant/DigitalWatch/watch-light.png (100%) rename src/{ => App}/Plant/DigitalWatch/watch.png (100%) rename src/{ => App}/Plant/Dummy/Dummy.tsx (100%) rename src/{ => App}/Plant/Microwave/Microwave.css (100%) rename src/{ => App}/Plant/Microwave/Microwave.tsx (100%) rename src/{ => App}/Plant/Microwave/bell.wav (100%) rename src/{ => App}/Plant/Microwave/running.wav (100%) rename src/{ => App}/Plant/Microwave/small_closed_off.png (100%) rename src/{ => App}/Plant/Microwave/small_closed_on.png (100%) rename src/{ => App}/Plant/Microwave/small_opened_off.png (100%) rename src/{ => App}/Plant/Microwave/small_opened_on.png (100%) rename src/{ => App}/Plant/Plant.ts (100%) rename src/App/{ => TopPanel}/Icons.tsx (100%) rename src/App/{ => TopPanel}/KeyInfo.tsx (100%) rename src/App/{ => TopPanel}/TopPanel.tsx (95%) rename src/{ => App}/VisualEditor/ArrowSVG.tsx (96%) rename src/{ => App}/VisualEditor/DiamondSVG.tsx (97%) rename src/{ => App}/VisualEditor/HistorySVG.tsx (100%) rename src/{ => App}/VisualEditor/RectHelpers.tsx (97%) rename src/{ => App}/VisualEditor/RountangleSVG.tsx (93%) rename src/{ => App}/VisualEditor/TextSVG.tsx (91%) rename src/{ => App}/VisualEditor/VisualEditor.css (100%) rename src/{ => App}/VisualEditor/VisualEditor.tsx (98%) rename src/{ => App}/VisualEditor/editor_types.ts (100%) rename src/{ => App}/VisualEditor/geometry.ts (98%) rename src/{ => App}/VisualEditor/parameters.ts (100%) rename src/{ => App}/VisualEditor/svg_helper.ts (100%) rename src/{util => App}/persistent_state.ts (100%) rename src/{App => util}/util.ts (100%) diff --git a/src/App/App.tsx b/src/App/App.tsx index 385a742..73fec05 100644 --- a/src/App/App.tsx +++ b/src/App/App.tsx @@ -2,13 +2,13 @@ import { ReactElement, useCallback, useEffect, useMemo, useRef, useState } from import { handleInputEvent, initialize, RuntimeError } from "../statecharts/interpreter"; import { BigStep, RT_Event } from "../statecharts/runtime_types"; -import { InsertMode, VisualEditor, VisualEditorState } from "../VisualEditor/VisualEditor"; +import { InsertMode, VisualEditor, VisualEditorState } from "./VisualEditor/VisualEditor"; import { getSimTime, getWallClkDelay, TimeMode } from "../statecharts/time"; import "../index.css"; import "./App.css"; -import { TopPanel } from "./TopPanel"; +import { TopPanel } from "./TopPanel/TopPanel"; import { ShowAST, ShowInputEvents, ShowInternalEvents, ShowOutputEvents } from "./ShowAST"; import { parseStatechart } from "../statecharts/parser"; import { getKeyHandler } from "./shortcut_handler"; @@ -18,7 +18,7 @@ import { PersistentDetails } from "./PersistentDetails"; import { DigitalWatchPlant } from "@/Plant/DigitalWatch/DigitalWatch"; import { DummyPlant } from "@/Plant/Dummy/Dummy"; import { Plant } from "@/Plant/Plant"; -import { usePersistentState } from "@/util/persistent_state"; +import { usePersistentState } from "@/App/persistent_state"; import { RTHistory } from "./RTHistory"; import { detectConnections } from "@/statecharts/detect_connections"; import { MicrowavePlant } from "@/Plant/Microwave/Microwave"; diff --git a/src/App/About.tsx b/src/App/Modals/About.tsx similarity index 100% rename from src/App/About.tsx rename to src/App/Modals/About.tsx diff --git a/src/App/TextDialog.tsx b/src/App/Modals/TextDialog.tsx similarity index 100% rename from src/App/TextDialog.tsx rename to src/App/Modals/TextDialog.tsx diff --git a/src/App/PersistentDetails.tsx b/src/App/PersistentDetails.tsx index 3d59be4..174ce71 100644 --- a/src/App/PersistentDetails.tsx +++ b/src/App/PersistentDetails.tsx @@ -1,4 +1,4 @@ -import { usePersistentState } from "@/util/persistent_state" +import { usePersistentState } from "@/App/persistent_state" import { DetailsHTMLAttributes, PropsWithChildren } from "react"; type Props = { diff --git a/src/Plant/DigitalWatch/DigitalWatch.css b/src/App/Plant/DigitalWatch/DigitalWatch.css similarity index 100% rename from src/Plant/DigitalWatch/DigitalWatch.css rename to src/App/Plant/DigitalWatch/DigitalWatch.css diff --git a/src/Plant/DigitalWatch/DigitalWatch.tsx b/src/App/Plant/DigitalWatch/DigitalWatch.tsx similarity index 100% rename from src/Plant/DigitalWatch/DigitalWatch.tsx rename to src/App/Plant/DigitalWatch/DigitalWatch.tsx diff --git a/src/Plant/DigitalWatch/digital-font.ttf b/src/App/Plant/DigitalWatch/digital-font.ttf similarity index 100% rename from src/Plant/DigitalWatch/digital-font.ttf rename to src/App/Plant/DigitalWatch/digital-font.ttf diff --git a/src/Plant/DigitalWatch/noteSmall.png b/src/App/Plant/DigitalWatch/noteSmall.png similarity index 100% rename from src/Plant/DigitalWatch/noteSmall.png rename to src/App/Plant/DigitalWatch/noteSmall.png diff --git a/src/Plant/DigitalWatch/watch-light.png b/src/App/Plant/DigitalWatch/watch-light.png similarity index 100% rename from src/Plant/DigitalWatch/watch-light.png rename to src/App/Plant/DigitalWatch/watch-light.png diff --git a/src/Plant/DigitalWatch/watch.png b/src/App/Plant/DigitalWatch/watch.png similarity index 100% rename from src/Plant/DigitalWatch/watch.png rename to src/App/Plant/DigitalWatch/watch.png diff --git a/src/Plant/Dummy/Dummy.tsx b/src/App/Plant/Dummy/Dummy.tsx similarity index 100% rename from src/Plant/Dummy/Dummy.tsx rename to src/App/Plant/Dummy/Dummy.tsx diff --git a/src/Plant/Microwave/Microwave.css b/src/App/Plant/Microwave/Microwave.css similarity index 100% rename from src/Plant/Microwave/Microwave.css rename to src/App/Plant/Microwave/Microwave.css diff --git a/src/Plant/Microwave/Microwave.tsx b/src/App/Plant/Microwave/Microwave.tsx similarity index 100% rename from src/Plant/Microwave/Microwave.tsx rename to src/App/Plant/Microwave/Microwave.tsx diff --git a/src/Plant/Microwave/bell.wav b/src/App/Plant/Microwave/bell.wav similarity index 100% rename from src/Plant/Microwave/bell.wav rename to src/App/Plant/Microwave/bell.wav diff --git a/src/Plant/Microwave/running.wav b/src/App/Plant/Microwave/running.wav similarity index 100% rename from src/Plant/Microwave/running.wav rename to src/App/Plant/Microwave/running.wav diff --git a/src/Plant/Microwave/small_closed_off.png b/src/App/Plant/Microwave/small_closed_off.png similarity index 100% rename from src/Plant/Microwave/small_closed_off.png rename to src/App/Plant/Microwave/small_closed_off.png diff --git a/src/Plant/Microwave/small_closed_on.png b/src/App/Plant/Microwave/small_closed_on.png similarity index 100% rename from src/Plant/Microwave/small_closed_on.png rename to src/App/Plant/Microwave/small_closed_on.png diff --git a/src/Plant/Microwave/small_opened_off.png b/src/App/Plant/Microwave/small_opened_off.png similarity index 100% rename from src/Plant/Microwave/small_opened_off.png rename to src/App/Plant/Microwave/small_opened_off.png diff --git a/src/Plant/Microwave/small_opened_on.png b/src/App/Plant/Microwave/small_opened_on.png similarity index 100% rename from src/Plant/Microwave/small_opened_on.png rename to src/App/Plant/Microwave/small_opened_on.png diff --git a/src/Plant/Plant.ts b/src/App/Plant/Plant.ts similarity index 100% rename from src/Plant/Plant.ts rename to src/App/Plant/Plant.ts diff --git a/src/App/RTHistory.tsx b/src/App/RTHistory.tsx index 76aceda..295905f 100644 --- a/src/App/RTHistory.tsx +++ b/src/App/RTHistory.tsx @@ -1,7 +1,7 @@ import { Dispatch, memo, Ref, SetStateAction, useCallback } from "react"; import { Statechart, stateDescription } from "../statecharts/abstract_syntax"; import { BigStep, Environment, Mode, RaisedEvent, RT_Event } from "../statecharts/runtime_types"; -import { formatTime } from "./util"; +import { formatTime } from "../util/util"; import { TimeMode } from "../statecharts/time"; import { TraceItem, TraceState } from "./App"; diff --git a/src/App/ShowAST.tsx b/src/App/ShowAST.tsx index 1e4b586..a7f86dd 100644 --- a/src/App/ShowAST.tsx +++ b/src/App/ShowAST.tsx @@ -72,7 +72,7 @@ export const ShowAST = memo(function ShowASTx(props: {root: ConcreteState | Unst }); import BoltIcon from '@mui/icons-material/Bolt'; -import { KeyInfoHidden, KeyInfoVisible } from "./KeyInfo"; +import { KeyInfoHidden, KeyInfoVisible } from "./TopPanel/KeyInfo"; import { memo, useEffect } from "react"; export function ShowInputEvents({inputEvents, onRaise, disabled, showKeys}: {inputEvents: EventTrigger[], onRaise: (e: string, p: any) => void, disabled: boolean, showKeys: boolean}) { diff --git a/src/App/Icons.tsx b/src/App/TopPanel/Icons.tsx similarity index 100% rename from src/App/Icons.tsx rename to src/App/TopPanel/Icons.tsx diff --git a/src/App/TopPanel/InsertModes.tsx b/src/App/TopPanel/InsertModes.tsx index 61d0953..aa120bb 100644 --- a/src/App/TopPanel/InsertModes.tsx +++ b/src/App/TopPanel/InsertModes.tsx @@ -1,7 +1,7 @@ import { Dispatch, memo, ReactElement, SetStateAction } from "react"; -import { KeyInfoHidden, KeyInfoVisible } from "../KeyInfo"; -import { InsertMode } from "@/VisualEditor/VisualEditor"; -import { HistoryIcon, PseudoStateIcon, RountangleIcon } from "../Icons"; +import { KeyInfoHidden, KeyInfoVisible } from "./KeyInfo"; +import { InsertMode } from "@/App/VisualEditor/VisualEditor"; +import { HistoryIcon, PseudoStateIcon, RountangleIcon } from "./Icons"; import TrendingFlatIcon from '@mui/icons-material/TrendingFlat'; diff --git a/src/App/KeyInfo.tsx b/src/App/TopPanel/KeyInfo.tsx similarity index 100% rename from src/App/KeyInfo.tsx rename to src/App/TopPanel/KeyInfo.tsx diff --git a/src/App/TopPanel.tsx b/src/App/TopPanel/TopPanel.tsx similarity index 95% rename from src/App/TopPanel.tsx rename to src/App/TopPanel/TopPanel.tsx index 1b78f60..e6cd92a 100644 --- a/src/App/TopPanel.tsx +++ b/src/App/TopPanel/TopPanel.tsx @@ -1,13 +1,13 @@ import { Dispatch, memo, ReactElement, SetStateAction, useCallback, useEffect, useState } from "react"; -import { TimerElapseEvent, Timers } from "../statecharts/runtime_types"; -import { getSimTime, setPaused, setRealtime, TimeMode } from "../statecharts/time"; +import { TimerElapseEvent, Timers } from "../../statecharts/runtime_types"; +import { getSimTime, setPaused, setRealtime, TimeMode } from "../../statecharts/time"; import { InsertMode } from "../VisualEditor/VisualEditor"; -import { About } from "./About"; -import { EditHistory, TraceState } from "./App"; +import { About } from "../Modals/About"; +import { EditHistory, TraceState } from "../App"; import { KeyInfoHidden, KeyInfoVisible } from "./KeyInfo"; -import { UndoRedoButtons } from "./TopPanel/UndoRedoButtons"; -import { ZoomButtons } from "./TopPanel/ZoomButtons"; -import { formatTime } from "./util"; +import { UndoRedoButtons } from "./UndoRedoButtons"; +import { ZoomButtons } from "./ZoomButtons"; +import { formatTime } from "../../util/util"; import AccessAlarmIcon from '@mui/icons-material/AccessAlarm'; import CachedIcon from '@mui/icons-material/Cached'; @@ -17,8 +17,8 @@ import PauseIcon from '@mui/icons-material/Pause'; import PlayArrowIcon from '@mui/icons-material/PlayArrow'; import SkipNextIcon from '@mui/icons-material/SkipNext'; import StopIcon from '@mui/icons-material/Stop'; -import { InsertModes } from "./TopPanel/InsertModes"; -import { usePersistentState } from "@/util/persistent_state"; +import { InsertModes } from "./InsertModes"; +import { usePersistentState } from "@/App/persistent_state"; export type TopPanelProps = { trace: TraceState | null, diff --git a/src/App/TopPanel/UndoRedoButtons.tsx b/src/App/TopPanel/UndoRedoButtons.tsx index de8d3be..742c74d 100644 --- a/src/App/TopPanel/UndoRedoButtons.tsx +++ b/src/App/TopPanel/UndoRedoButtons.tsx @@ -1,5 +1,5 @@ import { memo } from "react"; -import { KeyInfoHidden, KeyInfoVisible } from "../KeyInfo"; +import { KeyInfoHidden, KeyInfoVisible } from "./KeyInfo"; import UndoIcon from '@mui/icons-material/Undo'; import RedoIcon from '@mui/icons-material/Redo'; diff --git a/src/App/TopPanel/ZoomButtons.tsx b/src/App/TopPanel/ZoomButtons.tsx index 503e3ba..91a80c9 100644 --- a/src/App/TopPanel/ZoomButtons.tsx +++ b/src/App/TopPanel/ZoomButtons.tsx @@ -1,6 +1,6 @@ -import { ZOOM_MAX, ZOOM_MIN, ZOOM_STEP } from "@/VisualEditor/parameters"; +import { ZOOM_MAX, ZOOM_MIN, ZOOM_STEP } from "@/App/VisualEditor/parameters"; import { Dispatch, memo, SetStateAction, useEffect } from "react"; -import { KeyInfoHidden, KeyInfoVisible } from "../KeyInfo"; +import { KeyInfoHidden, KeyInfoVisible } from "./KeyInfo"; import ZoomInIcon from '@mui/icons-material/ZoomIn'; import ZoomOutIcon from '@mui/icons-material/ZoomOut'; diff --git a/src/VisualEditor/ArrowSVG.tsx b/src/App/VisualEditor/ArrowSVG.tsx similarity index 96% rename from src/VisualEditor/ArrowSVG.tsx rename to src/App/VisualEditor/ArrowSVG.tsx index 709ca76..3f01d47 100644 --- a/src/VisualEditor/ArrowSVG.tsx +++ b/src/App/VisualEditor/ArrowSVG.tsx @@ -1,8 +1,8 @@ import { memo } from "react"; -import { Arrow, ArrowPart } from "../statecharts/concrete_syntax"; +import { Arrow, ArrowPart } from "../../statecharts/concrete_syntax"; import { ArcDirection, euclideanDistance } from "./geometry"; import { CORNER_HELPER_RADIUS } from "./parameters"; -import { arraysEqual } from "@/App/util"; +import { arraysEqual } from "@/util/util"; export const ArrowSVG = memo(function(props: { arrow: Arrow; selected: ArrowPart[]; error: string; highlight: boolean; fired: boolean; arc: ArcDirection; initialMarker: boolean }) { diff --git a/src/VisualEditor/DiamondSVG.tsx b/src/App/VisualEditor/DiamondSVG.tsx similarity index 97% rename from src/VisualEditor/DiamondSVG.tsx rename to src/App/VisualEditor/DiamondSVG.tsx index e4d9a5f..77a86f8 100644 --- a/src/VisualEditor/DiamondSVG.tsx +++ b/src/App/VisualEditor/DiamondSVG.tsx @@ -3,7 +3,7 @@ import { rountangleMinSize } from "./VisualEditor"; import { Vec2D } from "./geometry"; import { RectHelper } from "./RectHelpers"; import { memo } from "react"; -import { arraysEqual } from "@/App/util"; +import { arraysEqual } from "@/util/util"; export const DiamondShape = memo(function DiamondShape(props: {size: Vec2D, extraAttrs: object}) { const minSize = rountangleMinSize(props.size); diff --git a/src/VisualEditor/HistorySVG.tsx b/src/App/VisualEditor/HistorySVG.tsx similarity index 100% rename from src/VisualEditor/HistorySVG.tsx rename to src/App/VisualEditor/HistorySVG.tsx diff --git a/src/VisualEditor/RectHelpers.tsx b/src/App/VisualEditor/RectHelpers.tsx similarity index 97% rename from src/VisualEditor/RectHelpers.tsx rename to src/App/VisualEditor/RectHelpers.tsx index 44d4ea9..8668789 100644 --- a/src/VisualEditor/RectHelpers.tsx +++ b/src/App/VisualEditor/RectHelpers.tsx @@ -1,5 +1,5 @@ import { memo } from "react"; -import { RectSide } from "../statecharts/concrete_syntax"; +import { RectSide } from "../../statecharts/concrete_syntax"; import { Vec2D } from "./geometry"; import { CORNER_HELPER_OFFSET, CORNER_HELPER_RADIUS } from "./parameters"; diff --git a/src/VisualEditor/RountangleSVG.tsx b/src/App/VisualEditor/RountangleSVG.tsx similarity index 93% rename from src/VisualEditor/RountangleSVG.tsx rename to src/App/VisualEditor/RountangleSVG.tsx index 7659d78..4eae8db 100644 --- a/src/VisualEditor/RountangleSVG.tsx +++ b/src/App/VisualEditor/RountangleSVG.tsx @@ -1,9 +1,9 @@ import { memo } from "react"; -import { Rountangle, RectSide } from "../statecharts/concrete_syntax"; +import { Rountangle, RectSide } from "../../statecharts/concrete_syntax"; import { ROUNTANGLE_RADIUS } from "./parameters"; import { RectHelper } from "./RectHelpers"; import { rountangleMinSize } from "./VisualEditor"; -import { arraysEqual } from "@/App/util"; +import { arraysEqual } from "@/util/util"; export const RountangleSVG = memo(function RountangleSVG(props: {rountangle: Rountangle; selected: RectSide[]; highlight: RectSide[]; error?: string; active: boolean; }) { diff --git a/src/VisualEditor/TextSVG.tsx b/src/App/VisualEditor/TextSVG.tsx similarity index 91% rename from src/VisualEditor/TextSVG.tsx rename to src/App/VisualEditor/TextSVG.tsx index b2287a7..8a80aba 100644 --- a/src/VisualEditor/TextSVG.tsx +++ b/src/App/VisualEditor/TextSVG.tsx @@ -1,6 +1,6 @@ -import { TextDialog } from "@/App/TextDialog"; -import { TraceableError } from "..//statecharts/parser"; -import {Text} from "../statecharts/concrete_syntax"; +import { TextDialog } from "@/App/Modals/TextDialog"; +import { TraceableError } from "../../statecharts/parser"; +import {Text} from "../../statecharts/concrete_syntax"; import { Dispatch, memo, ReactElement, SetStateAction } from "react"; export const TextSVG = memo(function TextSVG(props: {text: Text, error: TraceableError|undefined, selected: boolean, highlight: boolean, onEdit: (text: Text, newText: string) => void, setModal: Dispatch>}) { diff --git a/src/VisualEditor/VisualEditor.css b/src/App/VisualEditor/VisualEditor.css similarity index 100% rename from src/VisualEditor/VisualEditor.css rename to src/App/VisualEditor/VisualEditor.css diff --git a/src/VisualEditor/VisualEditor.tsx b/src/App/VisualEditor/VisualEditor.tsx similarity index 98% rename from src/VisualEditor/VisualEditor.tsx rename to src/App/VisualEditor/VisualEditor.tsx index b650c58..72be33c 100644 --- a/src/VisualEditor/VisualEditor.tsx +++ b/src/App/VisualEditor/VisualEditor.tsx @@ -1,8 +1,8 @@ import { ClipboardEvent, Dispatch, memo, ReactElement, SetStateAction, useCallback, useEffect, useMemo, useRef, useState } from "react"; -import { Statechart } from "../statecharts/abstract_syntax"; -import { Arrow, ArrowPart, Diamond, History, Rountangle, RectSide, Text } from "../statecharts/concrete_syntax"; -import { parseStatechart, TraceableError } from "../statecharts/parser"; +import { Statechart } from "../../statecharts/abstract_syntax"; +import { Arrow, ArrowPart, Diamond, History, Rountangle, RectSide, Text } from "../../statecharts/concrete_syntax"; +import { parseStatechart, TraceableError } from "../../statecharts/parser"; import { ArcDirection, Line2D, Rect2D, Vec2D, addV2D, arcDirection, area, getBottomSide, getLeftSide, getRightSide, getTopSide, isEntirelyWithin, normalizeRect, scaleV2D, subtractV2D, transformLine, transformRect } from "./geometry"; import { MIN_ROUNTANGLE_SIZE } from "./parameters"; import { getBBoxInSvgCoords } from "./svg_helper"; @@ -11,12 +11,12 @@ import { RountangleSVG } from "./RountangleSVG"; import { TextSVG } from "./TextSVG"; import { DiamondSVG } from "./DiamondSVG"; import { HistorySVG } from "./HistorySVG"; -import { Connections, detectConnections } from "../statecharts/detect_connections"; +import { Connections, detectConnections } from "../../statecharts/detect_connections"; import "./VisualEditor.css"; import { TraceState } from "@/App/App"; import { Mode } from "@/statecharts/runtime_types"; -import { arraysEqual, objectsEqual, setsEqual } from "@/App/util"; +import { arraysEqual, objectsEqual, setsEqual } from "@/util/util"; export type VisualEditorState = { rountangles: Rountangle[]; diff --git a/src/VisualEditor/editor_types.ts b/src/App/VisualEditor/editor_types.ts similarity index 100% rename from src/VisualEditor/editor_types.ts rename to src/App/VisualEditor/editor_types.ts diff --git a/src/VisualEditor/geometry.ts b/src/App/VisualEditor/geometry.ts similarity index 98% rename from src/VisualEditor/geometry.ts rename to src/App/VisualEditor/geometry.ts index dbb3d1e..f183193 100644 --- a/src/VisualEditor/geometry.ts +++ b/src/App/VisualEditor/geometry.ts @@ -1,4 +1,4 @@ -import { RectSide } from "../statecharts/concrete_syntax"; +import { RectSide } from "../../statecharts/concrete_syntax"; export type Vec2D = { x: number; diff --git a/src/VisualEditor/parameters.ts b/src/App/VisualEditor/parameters.ts similarity index 100% rename from src/VisualEditor/parameters.ts rename to src/App/VisualEditor/parameters.ts diff --git a/src/VisualEditor/svg_helper.ts b/src/App/VisualEditor/svg_helper.ts similarity index 100% rename from src/VisualEditor/svg_helper.ts rename to src/App/VisualEditor/svg_helper.ts diff --git a/src/util/persistent_state.ts b/src/App/persistent_state.ts similarity index 100% rename from src/util/persistent_state.ts rename to src/App/persistent_state.ts diff --git a/src/App/shortcut_handler.ts b/src/App/shortcut_handler.ts index 824a245..834f874 100644 --- a/src/App/shortcut_handler.ts +++ b/src/App/shortcut_handler.ts @@ -1,5 +1,5 @@ import { Dispatch, SetStateAction } from "react"; -import { InsertMode } from "../VisualEditor/VisualEditor"; +import { InsertMode } from "./VisualEditor/VisualEditor"; export function getKeyHandler(setMode: Dispatch>) { return function onKeyDown(e: KeyboardEvent) { diff --git a/src/statecharts/concrete_syntax.ts b/src/statecharts/concrete_syntax.ts index d4c6c40..372ef98 100644 --- a/src/statecharts/concrete_syntax.ts +++ b/src/statecharts/concrete_syntax.ts @@ -1,6 +1,6 @@ -import { Rect2D, Vec2D, Line2D, euclideanDistance, intersectLines, isWithin, lineBBox, subtractV2D } from "../VisualEditor/geometry"; -import { ARROW_SNAP_THRESHOLD, HISTORY_RADIUS, TEXT_SNAP_THRESHOLD } from "../VisualEditor/parameters"; -import { sides, VisualEditorState } from "../VisualEditor/VisualEditor"; +import { Rect2D, Vec2D, Line2D, euclideanDistance, intersectLines, isWithin, lineBBox, subtractV2D } from "../App/VisualEditor/geometry"; +import { ARROW_SNAP_THRESHOLD, HISTORY_RADIUS, TEXT_SNAP_THRESHOLD } from "../App/VisualEditor/parameters"; +import { sides, VisualEditorState } from "../App/VisualEditor/VisualEditor"; export type Rountangle = { uid: string; diff --git a/src/statecharts/detect_connections.ts b/src/statecharts/detect_connections.ts index 9465eca..4d7b00f 100644 --- a/src/statecharts/detect_connections.ts +++ b/src/statecharts/detect_connections.ts @@ -1,4 +1,4 @@ -import { VisualEditorState } from "@/VisualEditor/VisualEditor"; +import { VisualEditorState } from "@/App/VisualEditor/VisualEditor"; import { findNearestArrow, findNearestHistory, findNearestSide, findRountangle, RectSide } from "./concrete_syntax"; export type Connections = { diff --git a/src/statecharts/parser.ts b/src/statecharts/parser.ts index a7d1862..2b631a7 100644 --- a/src/statecharts/parser.ts +++ b/src/statecharts/parser.ts @@ -1,12 +1,12 @@ import { ConcreteState, HistoryState, OrState, UnstableState, Statechart, stateDescription, Transition } from "./abstract_syntax"; import { Rountangle } from "./concrete_syntax"; -import { isEntirelyWithin, Rect2D } from "../VisualEditor/geometry"; +import { isEntirelyWithin, Rect2D } from "../App/VisualEditor/geometry"; import { Action, EventTrigger, Expression, ParsedText } from "./label_ast"; import { parse as parseLabel, SyntaxError } from "./label_parser"; import { Connections } from "./detect_connections"; -import { HISTORY_RADIUS } from "../VisualEditor/parameters"; -import { VisualEditorState } from "@/VisualEditor/VisualEditor"; -import { memoize } from "@/App/util"; +import { HISTORY_RADIUS } from "../App/VisualEditor/parameters"; +import { VisualEditorState } from "@/App/VisualEditor/VisualEditor"; +import { memoize } from "@/util/util"; export type TraceableError = { shapeUid: string; diff --git a/src/App/util.ts b/src/util/util.ts similarity index 100% rename from src/App/util.ts rename to src/util/util.ts