Inital commit

This commit is contained in:
2026-06-29 09:40:34 +02:00
commit 3ee804a543
68 changed files with 10924 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
import { FaArrowsUpDownLeftRight, FaExpand } from "react-icons/fa6";
import type { DefinedTool } from "./interfaces";
import type { JSX } from "react";
import { FaMousePointer } from "react-icons/fa";
export const TOOLS: DefinedTool<any>[] = [];
export function defineTool<T = any, K extends string = string>(
key: K,
name: string,
icon: () => JSX.Element,
defaultSettings: () => T = () => null,
): DefinedTool<T, K> {
const tool: DefinedTool<T, K> = {
key,
name,
icon,
defaultSettings,
};
TOOLS.push(tool);
return tool;
}
export const TOOL_SELECT = defineTool<null>("select", "Select", () => <FaMousePointer />);
export const TOOL_CANVAS_MOVE = defineTool<null>("move", "move-canvas", () => <FaArrowsUpDownLeftRight />);
export const TOOL_OBJECT_MOVE = defineTool<null>("move-object", "Move object", () => <FaExpand />);