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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
use *;
/// Represents a single attribute on a virtual DOM node.
///
/// Combines an attribute name with its corresponding value.
///
/// OPT 2: attribute names are `Cow<'static, str>`. The `html!` macro
/// emits `Cow::Borrowed("class")` for the common literal case so
/// attribute keys share a single static slice across the whole rendered
/// DOM, removing the per-attribute `String` heap allocation. The
/// `AttributeValue::Text(String)` payload keeps its owned allocation
/// (text values are user-supplied strings that almost always come
/// from string interpolation or runtime formatting).
/// Represents a CSS pseudo-class or pseudo-element rule attached to a class.
///
/// Each rule has a selector suffix (e.g., ":hover", "::before", ":focus")
/// and a style declaration string. When injected into the DOM, it produces
/// a rule like `.class-name:hover { background: red; }`.
/// Represents a CSS class with a name, its style declarations, and optional pseudo rules.
///
/// Created by the `class!` macro and used in `html!` via the `class:` attribute.
/// When the renderer encounters a `Css`, it injects the styles into the
/// DOM's `<style>` element on first use and applies the class name to the element.
/// Represents a CSS @media rule attached to a class.
///
/// Each media rule has a query string (e.g., "(max-width: 767px)"),
/// a style declaration string, and optional nested pseudo-element rules.
/// When injected into the DOM, it produces a rule like:
/// `@media (max-width: 767px) { .class-name { font-size: 14px; } .class-name::-webkit-scrollbar { width: 0px; } }`.
/// Adapts various event value types into an `AttributeValue` for event attributes.
///
/// The `html!` macro generates `EventAdapter::new(expr).into_attribute(event_name)`
/// instead of inline trait dispatch boilerplate. This eliminates the per-attribute-site
/// generation of `__EventWrapper`, `__IsClosure`, `__ClosurePicker`, `__ValuePicker`,
/// `__FallbackHelper`, and `__dispatch` types, significantly reducing macro output size.
///
/// The adapter pattern handles three cases:
/// - `FnMut(NativeEvent)` closure → `AttributeValue::Event` via `NativeEventHandler`
/// - `NativeEventHandler` directly → `AttributeValue::Event` as-is
/// - `Option<NativeEventHandler>` → `AttributeValue::Event` or `AttributeValue::Text`
/// Adapts an event with a specific event name into an `AttributeValue`.
///
/// This type wraps an event value and its event name, enabling
/// `Into<AttributeValue>` trait implementation for events.
/// Used by the `html!` macro for event attributes like `onclick`.
/// Adapts an arbitrary attribute value expression into an `AttributeValue`.
///
/// Handles the dispatch between event closures and reactive values without
/// requiring the macro to generate inline trait hierarchies. The macro emits
/// `AttrValueAdapter::new(expr).into_attribute_value()` instead of the
/// `__IsClosure` / `__ClosurePicker` / `__ValuePicker` / `__FallbackHelper`
/// / `__dispatch` boilerplate.
///
/// For event attributes (key starts with "on"), event closures are wrapped
/// into `AttributeValue::Event`. For non-event attributes, values are
/// converted via `IntoReactiveValue`.
/// Adapts an `inner_html:` payload into the matching `AttributeValue`
/// variant (`InnerHtml(String)` for static strings, `InnerHtmlSignal`
/// for `Signal<String>`).
///
/// This is a sibling to [`AttrValueAdapter`] specialised for the
/// `inner_html:` attribute key. The html! macro emits
/// `InnerHtmlAdapter::new(expr).into()` whenever it sees an
/// `inner_html: ...` binding, so that `inner_html: "raw"` and
/// `inner_html: my_signal` route through `set_inner_html` rather than
/// the generic `set_attribute_or_property` path used for ordinary
/// `Text` attributes.
///
/// The actual `String` ↔ `Signal<String>` dispatch happens in the
/// `From<InnerHtmlAdapter<T>> for AttributeValue` impl below, where
/// the trait bounds on `T` decide which variant is produced.
/// Adapts a callback with a custom name into an `AttributeValue`.
///
/// This type wraps a callback and its custom attribute name, enabling
/// `Into<AttributeValue>` trait implementation for named callbacks.
/// Used by the `html!` macro for component callback props.
/// A `Sync` wrapper for single-threaded global `HashSet` access.
///
/// SAFETY: This type is only safe to use in single-threaded contexts
/// (e.g., WASM). It implements `Sync` to allow usage as a `static`
/// variable, but concurrent access from multiple threads would be
/// undefined behavior.
pub )]
pub ,
);