feat(editor): Add plus handle design with ability to add connected nodes in new canvas (no-changelog) (#10097)

This commit is contained in:
Alex Grozav
2024-07-18 19:01:14 +03:00
committed by GitHub
parent 7a135df768
commit 11db5a5b51
29 changed files with 665 additions and 369 deletions

View File

@@ -26,6 +26,7 @@ const emit = defineEmits<{
'update:node:selected': [id: string];
'update:node:name': [id: string];
'update:node:parameters': [id: string, parameters: Record<string, unknown>];
'click:node:add': [id: string, handle: string];
'run:node': [id: string];
'delete:node': [id: string];
'create:node': [source: NodeCreatorOpenSource];
@@ -108,6 +109,10 @@ const paneReady = ref(false);
* Nodes
*/
function onClickNodeAdd(id: string, handle: string) {
emit('click:node:add', id, handle);
}
function onNodeDragStop(e: NodeDragEvent) {
e.nodes.forEach((node) => {
onUpdateNodePosition(node.id, node.position);
@@ -351,6 +356,7 @@ onPaneReady(async () => {
@open:contextmenu="onOpenNodeContextMenu"
@update="onUpdateNodeParameters"
@move="onUpdateNodePosition"
@add="onClickNodeAdd"
/>
</template>