1#![cfg_attr(docsrs, feature(doc_cfg))]
2
3mod dioxus_document;
13mod events;
14mod mutation_writer;
15pub use blitz_dom::DocumentConfig;
16pub use dioxus_document::DioxusDocument;
17
18use blitz_dom::{ns, LocalName, Namespace, QualName};
19type NodeId = usize;
20
21pub(crate) fn qual_name(local_name: &str, namespace: Option<&str>) -> QualName {
22 QualName {
23 prefix: None,
24 ns: namespace.map(Namespace::from).unwrap_or(ns!(html)),
25 local: LocalName::from(local_name),
26 }
27}
28
29macro_rules! trace {
31 ($pattern:literal) => {{
32 #[cfg(feature = "tracing")]
33 tracing::debug!($pattern);
34 }};
35 ($pattern:literal, $item1:expr) => {{
36 #[cfg(feature = "tracing")]
37 tracing::debug!($pattern, $item1);
38 }};
39 ($pattern:literal, $item1:expr, $item2:expr) => {{
40 #[cfg(feature = "tracing")]
41 tracing::debug!($pattern, $item1, $item2);
42 }};
43 ($pattern:literal, $item1:expr, $item2:expr, $item3:expr) => {{
44 #[cfg(feature = "tracing")]
45 tracing::debug!($pattern, $item1, $item2);
46 }};
47 ($pattern:literal, $item1:expr, $item2:expr, $item3:expr, $item4:expr) => {{
48 #[cfg(feature = "tracing")]
49 tracing::debug!($pattern, $item1, $item2, $item3, $item4);
50 }};
51}
52pub(crate) use trace;