Skip to content
This repository was archived by the owner on Aug 17, 2025. It is now read-only.

Commit b73db7f

Browse files
committed
- Major code cleanup and refactor
- Broke down and renamed Interactive Rect into Draggable, Resizable and Fram components - Centralized redux slices for easier access and import - Split Logic from UI - Added plugin-sdk for future sdk plugin builds - Moved board hooks to root - Removed type dependencies from hooks and other components - Simplified Node system by using ids to fetch data, decreasing re-renders and improving extendability.
1 parent 0c202fb commit b73db7f

File tree

123 files changed

+659
-835
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+659
-835
lines changed

src/AppLayout.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ import CSSSnippets from "./features/snippets/Snippets";
99
import { Titlebar, ToolbarProvider } from "./features/titlebar";
1010
import { ModalContainer } from "./ui/modal";
1111
import { ThemeProvider } from "./features/theme";
12-
import { PluginManager } from "./features/plugins";
12+
import { PluginManager } from "./core/plugins";
1313
import { useAppDispatch, useAppSelector } from "./redux";
14-
import { useEffect } from "react";
15-
import { setupDevProject } from "./dev";
1614

1715
interface AppLayoutProps {
1816
children: React.ReactNode;
@@ -22,10 +20,6 @@ export const AppLayout = ({ children }: AppLayoutProps) => {
2220
const settingsOpen = useAppSelector(isSettingsModalOpen);
2321
const dispatch = useAppDispatch();
2422

25-
useEffect(() => {
26-
setupDevProject(dispatch);
27-
}, [dispatch]);
28-
2923
return (
3024
<PluginManager>
3125
<ThemeProvider>

src/Routes/Editor.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
import KeybindControl from "@/features/keybinds/components/KeybindControl";
2-
import DotGrid from "@/features/board/ui/grid/DotGrid";
3-
import NodesRenderer from "@/features/board/renderer/components/NodesRenderer";
4-
import { AppDropzone } from "@/features/importing/filedrop";
1+
import DotGrid from "@/features/board/grid/DotGrid";
52
import SidebarButton, { Sidebar } from "@/ui/sidebar";
6-
import { isSidebarOpen } from "@/redux/app/appSelectors";
3+
import { isSidebarOpen } from "@/redux/selectors/appSelectors";
74
import { useSelector } from "react-redux";
85
import { useAppDispatch, useAppSelector } from "@/redux";
9-
import {
10-
addLayer,
11-
BoardView,
12-
selectAllLayers,
13-
selectLayer,
14-
} from "@/features/board";
156
import { v4 as uuidv4 } from "uuid";
16-
import LayersSidebar from "@/ui/panels/LayerSidebar";
7+
import LayersSidebar from "@/features/board/layers/LayerSidebar";
8+
import { KeybindControl } from "@/features/keybinds";
9+
import NodesRenderer from "../features/board/nodes/NodesRenderer";
10+
import { FileDropzone } from "@/ui/dropzone";
11+
import { FallbackNode } from "../features/board/nodes/FallbackNode";
12+
import { selectAllLayers } from "@/redux/selectors/layersSelectors";
13+
import { BoardView } from "@/features/board";
14+
import { addLayer, selectLayer } from "@/redux/slices/layersSlice";
1715

1816
export default function Editor() {
1917
const dispatch = useAppDispatch();
@@ -44,9 +42,13 @@ export default function Editor() {
4442
/>
4543
</Sidebar>
4644
<div className="expand-box">
47-
<AppDropzone />
45+
<FileDropzone />
4846
<BoardView grid={<DotGrid />}>
49-
<NodesRenderer />
47+
<NodesRenderer
48+
fallback={(nodeId) => {
49+
return <FallbackNode key={nodeId} nodeId={nodeId} />;
50+
}}
51+
/>
5052
</BoardView>
5153
</div>
5254
</div>
File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { AppThunk } from "@/redux";
22
import { importerRegistry, NoSuitableImporterError } from "./ImporterRegistry";
33
import { ImportEvent } from "./types";
4-
import { showErrorToast } from "../notifications";
54
import { error } from "@tauri-apps/plugin-log";
5+
import { showErrorToast } from "@/features/notifications";
66

77
export const importFile =
88
(path: string, position: { x: number; y: number }, file: File): AppThunk =>

src/features/plugins/components/PluginManager.tsx renamed to src/core/plugins/PluginManager.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import { createContext, useContext, useEffect, useState } from "react";
22
import { error, info } from "@tauri-apps/plugin-log";
3-
import { PluginDefinition } from "../types";
4-
5-
type PluginModule = {
6-
default: PluginDefinition;
7-
};
3+
import { PluginDefinition, PluginModule } from "./types";
84

95
interface PluginContextType {
106
plugins: Map<string, PluginDefinition>;

src/core/plugins/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from "./types";
2+
export * from "./PluginManager";
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ export interface PluginDefinition {
88

99
[key: string]: unknown;
1010
}
11+
12+
export type PluginModule = {
13+
default: PluginDefinition;
14+
};

0 commit comments

Comments
 (0)