feat(editor): Compute node position and connections when creating new nodes in new canvas (no-changelog) (#9830)

This commit is contained in:
Alex Grozav
2024-06-25 12:11:44 +03:00
committed by GitHub
parent b55fc60993
commit 31c456700a
15 changed files with 1628 additions and 858 deletions

View File

@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { Position } from '@vue-flow/core';
import { computed, provide, toRef } from 'vue';
import { computed, provide, toRef, watch } from 'vue';
import type {
CanvasElementData,
CanvasConnectionPort,
@@ -17,6 +17,7 @@ import type { NodeProps } from '@vue-flow/core';
const emit = defineEmits<{
delete: [id: string];
select: [id: string, selected: boolean];
activate: [id: string];
}>();
@@ -36,6 +37,13 @@ const nodeType = computed(() => {
return nodeTypesStore.getNodeType(props.data.type, props.data.typeVersion);
});
watch(
() => props.selected,
(selected) => {
emit('select', props.id, selected);
},
);
/**
* Inputs
*/