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
//! euv Macros
//!
//! Procedural macros for the euv UI framework, including the `rsx!` macro
//! for declarative UI syntax, the `class!` macro for CSS class definitions,
//! and the `component` attribute macro.
pub use ;
use ;
/// The `rsx!` macro for writing declarative UI in euv.
///
/// This macro accepts a syntax similar to Dioxus RSX:
///
/// ```ignore
/// rsx! {
/// div {
/// class: c_container()
/// h1 { "Hello, euv!" }
/// button {
/// onclick: move |_| { /* handle click */ },
/// "Click me"
/// }
/// }
/// }
/// ```
/// The `class!` macro for defining CSS classes with style properties.
///
/// Each class definition creates a `CssClass` function that can be used
/// in `rsx!` via the `class:` attribute. Styles are automatically injected
/// into the DOM on first use.
///
/// ```ignore
/// class! {
/// pub container {
/// max_width: "800px";
/// margin: "0 auto";
/// }
/// pub(crate) header {
/// font_size: "28px";
/// }
/// hidden {
/// display: "none";
/// }
/// }
/// ```
/// The `watch!` macro for creating reactive side effects.
///
/// Watches one or more signals and executes a closure whenever any of them changes.
/// The closure is also executed once immediately with the current signal values.
///
/// The number of signal expressions must match the number of closure parameters.
/// Each closure parameter receives the current value (via `.get()`) of the
/// corresponding signal.
///
/// ```ignore
/// let count = use_signal(|| 0_i32);
/// let name = use_signal(|| String::from("euv"));
/// watch!(count, name, |count_val, name_val| {
/// web_sys::console::log_1(&format!("count={}, name={}", count_val, name_val).into());
/// });
/// ```
/// The `component` attribute macro for marking component functions.