feat(frontend): clean up

This commit is contained in:
Faton Ramadani
2024-08-12 13:42:03 +02:00
parent 542998de14
commit 3ea2529640
3 changed files with 11 additions and 5 deletions

View File

@@ -228,9 +228,6 @@
{proOptions}
nodesDraggable={false}
on:nodeclick={(e) => handleNodeClick(e)}
on:delete={(e) => {
console.log('delete', e.detail)
}}
>
<Background class="!bg-surface-secondary" />
<Controls position="top-right" orientation="horizontal" showLock={false}>

View File

@@ -75,7 +75,8 @@ export default function graphBuilder(
sourceId,
targetId,
offset,
moving
moving,
eventHandlers
}
})
}

View File

@@ -5,6 +5,7 @@
import { ClipboardCopy } from 'lucide-svelte'
import { getContext } from 'svelte'
import type { Writable } from 'svelte/store'
import type { GraphEventHandlers } from '../../graphBuilder'
export let sourceX: number
export let sourceY: number
@@ -18,6 +19,7 @@
insertable: boolean
modules: FlowModule[]
moving: string | undefined
eventHandlers: GraphEventHandlers
}
$: [edgePath, labelX, labelY] = getBezierPath({
@@ -62,7 +64,13 @@
{#if data.moving}
<button
title="Paste module"
on:click={() => {}}
on:click={() => {
data.eventHandlers.insert({
modules: data.modules,
module: undefined,
type: 'move'
})
}}
type="button"
class="text-primary bg-surface border-[1px] mx-[1px] border-gray-300 dark:border-gray-500 focus:outline-none hover:bg-surface-hover focus:ring-4 focus:ring-surface-selected font-medium rounded-full text-sm w-[25px] h-[25px] flex items-center justify-center"
>