Skip to main content

jellyflow_core/core/model/
resources.rs

1use serde::{Deserialize, Serialize};
2use serde_json::Value;
3
4use crate::types::TypeDesc;
5
6use super::geometry::CanvasRect;
7
8/// Graph-scoped symbol.
9#[derive(Debug, Clone, Serialize, Deserialize)]
10pub struct Symbol {
11    /// Display name.
12    pub name: String,
13    /// Type descriptor.
14    #[serde(default, skip_serializing_if = "Option::is_none")]
15    pub ty: Option<TypeDesc>,
16    /// Default value (if any).
17    #[serde(default, skip_serializing_if = "Option::is_none")]
18    pub default_value: Option<Value>,
19    /// Arbitrary domain metadata.
20    #[serde(default, skip_serializing_if = "Value::is_null")]
21    pub meta: Value,
22}
23
24/// A node group.
25#[derive(Debug, Clone, Serialize, Deserialize)]
26pub struct Group {
27    /// Display name.
28    pub title: String,
29    /// Group bounds in canvas space.
30    pub rect: CanvasRect,
31    /// Group color (domain/theme-owned).
32    #[serde(default, skip_serializing_if = "Option::is_none")]
33    pub color: Option<String>,
34}
35
36/// A sticky note.
37#[derive(Debug, Clone, Serialize, Deserialize)]
38pub struct StickyNote {
39    /// Markdown/plain text body.
40    pub text: String,
41    /// Note bounds in canvas space.
42    pub rect: CanvasRect,
43    /// Note color (domain/theme-owned).
44    #[serde(default, skip_serializing_if = "Option::is_none")]
45    pub color: Option<String>,
46}