Skip to main content

jellyflow_core/
lib.rs

1//! Headless graph primitives for Jellyflow.
2//!
3//! This crate owns the portable graph document model, stable IDs, type descriptors, and interaction
4//! policy value types shared by higher-level runtimes and UI adapters. It must stay free of Fret UI,
5//! renderer, platform, and windowing dependencies.
6
7#![deny(unsafe_code)]
8
9pub mod core;
10pub mod interaction;
11pub mod ops;
12pub mod types;
13
14pub use core::{
15    Binding, BindingEndpoint, BindingId, CanvasPoint, CanvasRect, CanvasSize, Edge, EdgeId,
16    EdgeKind, EdgeReconnectable, EdgeReconnectableEndpoint, Graph, GraphId, GraphImport,
17    GraphImportClosure, GraphImportError, GraphLocalBindingTarget, GraphValidationError,
18    GraphValidationReport, Group, GroupId, Node, NodeExtent, NodeId, NodeKindKey, NodeOrigin, Port,
19    PortCapacity, PortDirection, PortId, PortKey, PortKind, SourceAnchor, StickyNote, StickyNoteId,
20    Symbol, SymbolId,
21};
22pub use interaction::{
23    NodeGraphConnectionMode, NodeGraphDragHandleMode, NodeGraphModifierKey, NodeGraphModifiers,
24};
25pub use ops::{
26    ApplyError, DEFAULT_HISTORY_LIMIT, EdgeEndpoints, GraphFragment, GraphHistory, GraphOp,
27    GraphOpBuilderExt, GraphTransaction, IdRemapSeed, IdRemapper, PasteTuning,
28    find_invalid_size_in_tx, find_non_finite_in_tx, normalize_transaction,
29};
30pub use types::{
31    DefaultTypeCompatibility, TypeCompatibility, TypeCompatibilityResult, TypeDesc, TypeVarId,
32};
33
34#[cfg(test)]
35mod tests {
36    #[test]
37    fn manifest_stays_free_of_fret_ui_renderer_and_platform_dependencies() {
38        let manifest = include_str!("../Cargo.toml");
39        for forbidden in [
40            "fret-core",
41            "fret-ui",
42            "fret-runtime",
43            "fret-canvas",
44            "wgpu",
45            "winit",
46        ] {
47            assert!(
48                !manifest.contains(forbidden),
49                "jellyflow-core must stay headless; forbidden dependency `{forbidden}` found",
50            );
51        }
52    }
53}