🐛 Fix package registration

This commit is contained in:
Manuel Cillero 2024-04-03 15:17:20 +02:00
parent 7fd262eaa0
commit 4ea28030c7
5 changed files with 26 additions and 57 deletions

View file

@ -7,8 +7,5 @@ pub use fluent::Fluent;
mod body;
pub use body::Body;
mod components;
pub use components::Components;
mod region;
pub use region::Region;

View file

@ -1,36 +0,0 @@
use crate::prelude::*;
#[derive(AutoDefault)]
pub struct Components(MixedComponents);
impl ComponentTrait for Components {
fn new() -> Self {
Components::default()
}
fn prepare_component(&self, cx: &mut Context) -> PrepareMarkup {
PrepareMarkup::With(self.components().render(cx))
}
}
impl Components {
// Components BUILDER.
#[fn_builder]
pub fn alter_components(&mut self, op: AnyOp) -> &mut Self {
self.0.alter_value(op);
self
}
#[rustfmt::skip]
pub fn add_component(mut self, component: impl ComponentTrait) -> Self {
self.0.alter_value(AnyOp::Add(AnyComponent::with(component)));
self
}
// Components GETTERS.
pub fn components(&self) -> &MixedComponents {
&self.0
}
}