feat(frontend): clean up

This commit is contained in:
Faton Ramadani
2024-08-12 13:59:11 +02:00
parent 3ea2529640
commit c56f6ea374
5 changed files with 12 additions and 17 deletions
@@ -289,8 +289,6 @@
}
}}
on:insert={async ({ detail }) => {
console.log('insert', detail)
if (shouldRunTutorial('forloop', detail.detail, 1)) {
flowTutorials?.runTutorialById('forloop', detail.index)
} else if (shouldRunTutorial('branchone', detail.detail, 2)) {
@@ -203,7 +203,6 @@
if ($selectedId != mod.id) {
$selectedId = mod.id
}
console.log('selected', mod)
dispatch('select', mod)
}
}
@@ -1,11 +0,0 @@
## Rendering
- Nodes [x]
- Edges [x]
- Insert button [x]
- AI button [x]
- Delete branch button [x]
- Insert branch button [x]
- Graph actions [x]
## Functionality
@@ -52,7 +52,14 @@
class="edgeButtonContainer nodrag nopan"
style:transform="translate(-50%, -50%) translate({labelX}px,{labelY}px)"
>
<InsertModuleButton index={0} modules={data?.modules ?? []} funcDesc="" />
<InsertModuleButton
index={0}
modules={data?.modules ?? []}
funcDesc=""
on:new={(e) => {
data?.eventHandlers.insert({ modules: data.modules, index: 0, detail: e.detail })
}}
/>
</div>
{/if}
@@ -67,8 +74,7 @@
on:click={() => {
data.eventHandlers.insert({
modules: data.modules,
module: undefined,
type: 'move'
module: undefined
})
}}
type="button"
@@ -4,12 +4,14 @@
import type { FlowModule } from '$lib/gen/models/FlowModule'
import type { GraphEventHandlers } from '../../graphBuilder'
import { getStateColor } from '../../util'
import type { GraphModuleState } from '../../model'
export let data: {
id: string
insertable: boolean
modules: FlowModule[]
eventHandlers: GraphEventHandlers
flowModuleStates: Record<string, GraphModuleState> | undefined
}
</script>
@@ -22,6 +24,7 @@
selected={false}
insertable={false}
bgColor={getStateColor(undefined, darkMode)}
borderColor={getStateColor(data?.flowModuleStates?.[data?.id]?.type, darkMode)}
on:select={(e) => {
data?.eventHandlers?.select(e.detail)
}}