dioxus_mind_elixir/lib.rs
1//! Rust-native Dioxus mind maps, styled through inheritable CSS variables.
2//!
3//! Renderer-independent checked tree operations, JSON persistence and snapshot
4//! history with four HTML/CSS layouts and measured SVG connectors. Use
5//! `use_mind_map` and `EditableMindMap` for a shared editable document.
6//! Optional typed plugins add interaction, outlines and Rust export formats.
7//!
8//! # Platform support
9//!
10//! The default crate enables no renderer. The host selects Dioxus Web or Desktop.
11//! Enable the `web` feature for live CSS/font capture to SVG and raster images on
12//! `wasm32-unknown-unknown`. Desktop live capture is currently unsupported and
13//! returns a recoverable error; tree operations and XMind encoding are portable.
14//! Static HTML exports contain no interactive editor. Data compatibility is a
15//! strict plain-text subset; unknown JSON fields are rejected.
16//!
17//! # Optional plugins
18//!
19//! Keep the guards returned by [`use_plugins`] or [`MindMapHandle::register_plugin`]
20//! alive for as long as their capabilities are needed. Views share one handle's
21//! document and history, while each view retains its own viewport and editor.
22//! Source examples and validation notes are in the project repository.
23//!
24//! ```rust,no_run
25//! use dioxus::prelude::*;
26//! use dioxus_mind_elixir::{MindMap, MindMapData, Node};
27//!
28//! fn app() -> Element {
29//! let data = use_signal(|| MindMapData::new(
30//! Node::new("root", "Ideas").with_children(vec![Node::new("child", "Rust")])
31//! ));
32//! rsx! { MindMap { data } }
33//! }
34//! ```
35
36mod generate_branch;
37mod handle;
38mod interact;
39mod outline;
40mod platform;
41pub mod plugins;
42mod state;
43pub mod text;
44mod theme;
45mod types;
46mod view;
47
48pub use handle::{
49 MindMapHandle, PendingEdit, PluginGuard, Subscription, use_mind_map, use_plugins,
50};
51pub use interact::{Point, Viewport};
52pub use outline::{Outline, OutlineProps, Toolbar, ToolbarProps};
53pub use state::{CoreEvent, MindMapState, Operation, OperationOptions, OperationResult, Placement};
54pub use theme::Theme;
55pub use types::{
56 LayoutDirection, MindMapData, MindMapError, Node, NodeDirection, NodeImage, NodeStyle,
57};
58pub use view::{Alignment, EditableMindMap, EditableMindMapProps, MindMap, MindMapProps};
59
60/// Component stylesheet embedded in the crate; no asset-copy step is needed.
61pub const STYLESHEET: &str = include_str!("../assets/mind-map.css");