1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#![doc(
    html_logo_url = "https://freyaui.dev/logo.svg",
    html_favicon_url = "https://freyaui.dev/logo.svg"
)]
//! # Freya
//!
//! Build native & cross-platform GUI applications using 🦀 Rust.
//!
//! Powered by [🧬 Dioxus](https://dioxuslabs.com) and [🎨 Skia](https://skia.org/).
//!
//! - [Elements API reference](freya_elements::elements#structs)
//! - [Events API reference](freya_elements::elements#functions)
//! - [Elements guides](freya_elements::_docs)
//! - [Components](freya_components)
//! - [Hooks](freya_hooks)
//! - [Theming](self::_docs::theming)
//! - [Hot reload](self::_docs::hot_reload)
//! - [Testing](freya_testing)
//! - [Animating](freya_hooks::use_animation)
//! - [Devtools](self::_docs::devtools)
//!
//! ```rust,no_run
//! use freya::prelude::*;
//!
//! fn main(){
//!     launch(app);
//! }
//!
//! fn app() -> Element {
//!    let mut count = use_signal(|| 0);
//!
//!    rsx!(
//!        rect {
//!            height: "100%",
//!            width: "100%",
//!            background: "rgb(35, 35, 35)",
//!            color: "white",
//!            padding: "12",
//!            onclick: move |_| count += 1,
//!            label { "Click to increase -> {count}" }
//!        }
//!    )
//! }
//! ```
//!
//! ## Features flags
//!
//! - `devtools`: enables a side panel to inspect your App tree, styles and computed layout.
//! - `use_camera`: enables the `use_camera` hook.
//! - `log`: enables internal logs.

/// Freya docs.
#[cfg(doc)]
pub mod _docs;

/// Dioxus library.
pub use dioxus;
pub use dioxus_core;
#[cfg(doc)]
pub use freya_elements::_docs as elements_docs;

/// Launch your app.
pub mod launch;

/// Collection of basic components.
pub mod components {
    pub use freya_components::*;
}

/// Useful utilities.
pub mod hooks {
    pub use freya_hooks::*;
}

/// Common data structures and utils.
pub mod common {
    pub use freya_common::*;
}

/// Elements, attributes and events definitions.
pub use freya_elements::elements;
/// Events data.
pub use freya_elements::events;

/// Hot reload configuration.
pub mod hotreload {
    pub use freya_elements::elements::FreyaCtx;
}

pub use torin;

pub mod plugins;

/// Useful imports.
pub mod prelude {
    pub use dioxus_core::{
        prelude::*,
        {
            self,
        },
    };
    pub use dioxus_core_macro::*;
    pub use dioxus_hooks::*;
    pub use dioxus_hot_reload::{
        self,
        hot_reload_init,
        Config,
    };
    pub use dioxus_signals::*;
    pub use freya_components::*;
    pub use freya_core::prelude::PreferredTheme;
    pub use freya_elements::{
        elements as dioxus_elements,
        events::*,
    };
    pub use freya_hooks::*;
    pub use freya_node_state::{
        dynamic_bytes,
        static_bytes,
        CustomAttributeValues,
    };
    pub use freya_renderer::*;
    pub use torin::prelude::*;

    pub use crate::{
        launch::*,
        plugins::*,
    };
}