mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat: Add sticky notes support to the new canvas (no-changelog) (#10031)
This commit is contained in:
@@ -19,6 +19,7 @@ const emit = defineEmits<{
|
||||
'update:node:active': [id: string];
|
||||
'update:node:enabled': [id: string];
|
||||
'update:node:selected': [id?: string];
|
||||
'update:node:parameters': [id: string, parameters: Record<string, unknown>];
|
||||
'run:node': [id: string];
|
||||
'delete:node': [id: string];
|
||||
'delete:connection': [connection: Connection];
|
||||
@@ -57,10 +58,14 @@ const { getSelectedEdges, getSelectedNodes, viewportRef, fitView, project } = us
|
||||
|
||||
function onNodeDragStop(e: NodeDragEvent) {
|
||||
e.nodes.forEach((node) => {
|
||||
emit('update:node:position', node.id, node.position);
|
||||
onUpdateNodePosition(node.id, node.position);
|
||||
});
|
||||
}
|
||||
|
||||
function onUpdateNodePosition(id: string, position: XYPosition) {
|
||||
emit('update:node:position', id, position);
|
||||
}
|
||||
|
||||
function onSelectionDragStop(e: NodeDragEvent) {
|
||||
onNodeDragStop(e);
|
||||
}
|
||||
@@ -82,6 +87,10 @@ function onDeleteNode(id: string) {
|
||||
emit('delete:node', id);
|
||||
}
|
||||
|
||||
function onUpdateNodeParameters(id: string, parameters: Record<string, unknown>) {
|
||||
emit('update:node:parameters', id, parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* Connections
|
||||
*/
|
||||
@@ -222,6 +231,8 @@ onUnmounted(() => {
|
||||
@select="onSelectNode"
|
||||
@toggle="onToggleNodeEnabled"
|
||||
@activate="onSetNodeActive"
|
||||
@update="onUpdateNodeParameters"
|
||||
@move="onUpdateNodePosition"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user