Skip to main content

jellyflow_runtime/runtime/events/
node_drag.rs

1use serde::{Deserialize, Serialize};
2
3use jellyflow_core::core::{CanvasPoint, NodeId};
4
5#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
6#[serde(rename_all = "snake_case")]
7pub enum NodeDragEndOutcome {
8    Committed,
9    Rejected,
10    Canceled,
11    NoOp,
12}
13
14#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
15pub struct NodeDragStart {
16    pub primary: NodeId,
17    pub nodes: Vec<NodeId>,
18    pub pointer: CanvasPoint,
19}
20
21#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
22pub struct NodeDragUpdate {
23    pub primary: NodeId,
24    pub nodes: Vec<NodeId>,
25    pub pointer: CanvasPoint,
26}
27
28#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
29pub struct NodeDragEnd {
30    pub primary: NodeId,
31    pub nodes: Vec<NodeId>,
32    pub pointer: CanvasPoint,
33    pub outcome: NodeDragEndOutcome,
34}