Implementa temas hijo y macro render_component!

Añade `Theme::parent()` para declarar jerarquías de herencia entre
temas. Sustituye la acción `PrepareRender<C>` por el método
`Theme::prepare_component()` y la macro `render_component!`.
This commit is contained in:
Manuel Cillero 2026-03-22 08:58:15 +01:00 committed by Manuel Cillero
parent 0684472df2
commit 9f8640d6bf
14 changed files with 161 additions and 139 deletions

View file

@ -12,7 +12,9 @@ use list::ActionsList;
mod all;
pub(crate) use all::add_action;
pub use all::{dispatch_actions, dispatch_actions_until};
pub use all::dispatch_actions;
// **< actions_boxed! >*****************************************************************************
/// Facilita la implementación del método [`actions()`](crate::core::extension::Extension::actions).
///
@ -22,12 +24,11 @@ pub use all::{dispatch_actions, dispatch_actions_until};
/// # Ejemplo
///
/// ```rust,ignore
/// # use pagetop::prelude::*;
/// impl Extension for MyTheme {
/// fn actions(&self) -> Vec<ActionBox> {
/// actions_boxed![
/// action::theme::BeforeRender::<Button>::new(&Self, before_render_button),
/// action::theme::PrepareRender::<Error404>::new(&Self, render_error404),
/// action::theme::AfterRender::<Button>::new(&Self, after_render_button),
/// ]
/// }
/// }
@ -35,7 +36,7 @@ pub use all::{dispatch_actions, dispatch_actions_until};
/// impl Theme for MyTheme {}
///
/// fn before_render_button(c: &mut Button, cx: &mut Context) { todo!() }
/// fn render_error404(c: &Error404, cx: &mut Context) -> Markup { todo!() }
/// fn after_render_button(c: &mut Button, cx: &mut Context) { todo!() }
/// ```
#[macro_export]
macro_rules! actions_boxed {