use crate::prelude::*;
use beet_core::prelude::*;
pub type WebNodes = (DoctypeNode, CommentNode, ElementNode, AttributeKey);
#[derive(Debug, Default, Copy, Clone, Component, Reflect)]
#[reflect(Default, Component)]
#[component(immutable)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "tokens", derive(ToTokens))]
pub struct DoctypeNode;
#[derive(Debug, Default, Clone, Deref, DerefMut, Component, Reflect)]
#[reflect(Default, Component)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "tokens", derive(ToTokens))]
pub struct CommentNode(pub String);
impl CommentNode {
pub fn new(content: impl Into<String>) -> Self { Self(content.into()) }
}
#[derive(Debug, Default, Copy, Clone, Component, Reflect)]
#[reflect(Default, Component)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "tokens", derive(ToTokens))]
pub struct ElementNode {
pub self_closing: bool,
}
impl ElementNode {
pub fn open() -> Self {
Self {
self_closing: false,
}
}
pub fn self_closing() -> Self { Self { self_closing: true } }
}