orbit/
lib.rs

1// Core module of the Orbit UI Framework
2pub mod component;
3pub mod component_single;
4pub mod events;
5pub mod layout;
6pub mod parser;
7pub mod platform;
8pub mod renderer;
9pub mod state;
10pub mod style;
11
12pub mod kit; // Added for OrbitKit components
13
14/// Version of the Orbit UI Framework
15pub const VERSION: &str = env!("CARGO_PKG_VERSION");
16
17/// Re-export of common types for convenience
18pub mod prelude {
19    pub use crate::component::{
20        callback,
21        props::{PropValidationError, PropValidator},
22        Callback, Component, ComponentError, ContextProvider, LifecyclePhase, Props,
23    };
24    pub use crate::component_single::{Context, Node};
25    pub use crate::events::{
26        delegation::{DelegatedEvent, EventDelegate, PropagationPhase},
27        Event,
28    };
29    pub use crate::layout::{
30        AlignContent, AlignItems, Dimension, EdgeValues, FlexDirection, FlexWrap, JustifyContent,
31        LayoutEngine, LayoutNode, LayoutResult, LayoutStats, LayoutStyle, Point, PositionType,
32        Rect, Size,
33    };
34    pub use crate::renderer::Renderer;
35    pub use crate::state::{
36        create_computed, create_effect, create_signal, Computed, Effect, Signal, State,
37        StateContainer,
38    };
39    #[cfg(feature = "desktop")]
40    pub use winit::event::MouseButton;
41}
42
43/// Initialize the Orbit framework with default settings
44pub fn init() -> Result<(), Error> {
45    // Initialize logging
46    // Initialize default renderer
47    // Set up platform adapters
48    Ok(())
49}
50
51/// Errors that can occur in the Orbit framework
52#[derive(Debug, thiserror::Error)]
53pub enum Error {
54    #[error("Initialization error: {0}")]
55    Init(String),
56
57    #[error("Rendering error: {0}")]
58    Render(String),
59
60    #[error("Renderer error: {0}")]
61    Renderer(String),
62
63    #[error("Component error: {0}")]
64    Component(String),
65
66    #[error("Parser error: {0}")]
67    Parser(String),
68
69    #[error("Platform error: {0}")]
70    Platform(String),
71}