Enhance canvas connection validation and image resolution handling

- Introduced new functions for validating canvas connections, ensuring proper source and target node types.
- Updated edge and node mutation logic to enforce connection policies and improve error handling.
- Enhanced image resolution handling by integrating a new image source resolution function for better URL retrieval.
- Refactored existing validation logic to streamline connection checks and improve maintainability.
This commit is contained in:
Matthias
2026-04-02 22:27:05 +02:00
parent 3fa686d60d
commit 519caefae2
7 changed files with 356 additions and 82 deletions

View File

@@ -40,6 +40,7 @@ import {
isNodePaletteEnabled,
type NodeCatalogEntry,
} from "@/lib/canvas-node-catalog";
import { CANVAS_NODE_DND_MIME } from "@/lib/canvas-connection-policy";
import { cn } from "@/lib/utils";
const CATALOG_ICONS: Partial<Record<string, LucideIcon>> = {
@@ -89,7 +90,7 @@ function SidebarRow({
const onDragStart = (event: React.DragEvent) => {
if (!enabled) return;
event.dataTransfer.setData("application/lemonspace-node-type", entry.type);
event.dataTransfer.setData(CANVAS_NODE_DND_MIME, entry.type);
event.dataTransfer.effectAllowed = "move";
};