===== explicit-slots/view.generated.mbt =====
// Generated by selene-xaml@0.37.3. DO NOT EDIT.
// input user fixtures/component-usage.xaml sha256=89a8e9720a5e19baeebe790636d0bd2d00fdcb7c08dc7d7f977931acb106e9b6
// input moon-info fixtures/component.mbti sha256=296e62b189c528b302529b3d8691a64bd97b75107acd15221da5e071a6fdc4af
// input resource fixtures/status-card.xaml sha256=67dadcb6b1f8501d25fcfd58dcf9d165583e1ce4a888e42a8bf104f1d7de6eb3

///|
type ComponentState = @model.ComponentState

///|
pub(all) enum ComponentUsageViewAction {} derive(Eq, Debug)

///|
#warnings("-unused_value")
fn generated_rect_component(
  value : String,
  index : Int,
  path : String,
  image_region : Bool,
  corner_radius : Bool,
  non_negative : Bool,
) -> Double raise {
  @xaml_view.generated_view_rect_component(
    value,
    index,
    path,
    image_region,
    corner_radius~,
    non_negative~,
  )
}

///|
#warnings("-unused_value")
fn generated_image_drop_shadow(
  value : String,
  path : String,
) -> @xaml_view.ImageDropShadow? raise {
  @xaml_view.generated_view_image_drop_shadow(value, path)
}

///|
#warnings("-struct_never_constructed")
pub struct ComponentUsageView {}

///|
let generated_runtime : @xaml_view.GeneratedViewRuntime[
  ComponentState,
  ComponentUsageViewAction,
] = @xaml_view.GeneratedViewRuntime::new(generated_handle_event)

///|
/// World-isolated typed actions emitted by this view.
pub let action_event_bus : @event.Events[
  @xaml_view.GeneratedViewAction[ComponentUsageViewAction],
] = generated_runtime.action_events()

///|
/// ViewModel components mounted by this View in the current World.
pub fn ComponentUsageView::view_models() -> Map[@entity.Entity, ComponentState] {
  generated_runtime.view_models()
}

///|
#warnings("-unused_error_type")
fn generated_specs(state : ComponentState) -> Array[@xaml_view.NodeSpec] raise {
  let nodes : Array[@xaml_view.NodeSpec] = []
  nodes.push({
    key: "node-root-view",
    parent: None,
    kind: @xaml_view.NodeKind::View,
    text: "",
    spans: [],
    source: "",
    path_geometry: None,
    active: true,
    enabled: true,
    focusable: false,
    tab_index: 0,
    focus_scope: false,
    auto_focus: false,
    navigation_up: "",
    navigation_down: "",
    navigation_left: "",
    navigation_right: "",
    automation_name: "",
    style: { ..@xaml_view.NodeStyle::default() },
    visual_state_groups: [],
  })
  nodes.push({
    key: "node-root-0-flex",
    parent: Some("node-root-view"),
    kind: @xaml_view.NodeKind::Flex,
    text: "",
    spans: [],
    source: "",
    path_geometry: None,
    active: true,
    enabled: true,
    focusable: false,
    tab_index: 0,
    focus_scope: false,
    auto_focus: false,
    navigation_up: "",
    navigation_down: "",
    navigation_left: "",
    navigation_right: "",
    automation_name: "",
    style: { ..@xaml_view.NodeStyle::default(), border_brush: "#62d6a7" },
    visual_state_groups: [],
  })
  nodes.push({
    key: "node-root-0/0-text",
    parent: Some("node-root-0-flex"),
    kind: @xaml_view.NodeKind::Text,
    text: state.title,
    spans: [],
    source: "",
    path_geometry: None,
    active: true,
    enabled: true,
    focusable: false,
    tab_index: 0,
    focus_scope: false,
    auto_focus: false,
    navigation_up: "",
    navigation_down: "",
    navigation_left: "",
    navigation_right: "",
    automation_name: "",
    style: { ..@xaml_view.NodeStyle::default() },
    visual_state_groups: [],
  })
  nodes.push({
    key: "node-root-0/1-image",
    parent: Some("node-root-0-flex"),
    kind: @xaml_view.NodeKind::Image,
    text: "",
    spans: [],
    source: "icon.png",
    path_geometry: None,
    active: true,
    enabled: true,
    focusable: false,
    tab_index: 0,
    focus_scope: false,
    auto_focus: false,
    navigation_up: "",
    navigation_down: "",
    navigation_left: "",
    navigation_right: "",
    automation_name: "",
    style: { ..@xaml_view.NodeStyle::default() },
    visual_state_groups: [],
  })
  nodes.push({
    key: "node-root-0/2-text",
    parent: Some("node-root-0-flex"),
    kind: @xaml_view.NodeKind::Text,
    text: state.status,
    spans: [],
    source: "",
    path_geometry: None,
    active: true,
    enabled: true,
    focusable: false,
    tab_index: 0,
    focus_scope: false,
    auto_focus: false,
    navigation_up: "",
    navigation_down: "",
    navigation_left: "",
    navigation_right: "",
    automation_name: "",
    style: { ..@xaml_view.NodeStyle::default() },
    visual_state_groups: [],
  })
  nodes
}

///|
/// Mounts this view on an alive root entity in the current world.
/// Destroying the root ends the view lifetime.
pub fn ComponentUsageView::mount(
  entity : @entity.Entity,
  view_model : ComponentState,
) -> Unit raise {
  let desired = generated_specs(view_model)
  generated_runtime.mount(entity, view_model, desired)
}

///|
/// Releases this View while leaving its caller-owned root entity alive.
pub fn ComponentUsageView::unmount(entity : @entity.Entity) -> Unit raise {
  generated_runtime.unmount(entity)
}

///|
/// Refreshes the complete presentation from the current ViewModel component.
pub fn ComponentUsageView::refresh(entity : @entity.Entity) -> Unit raise {
  let view_model = generated_runtime.view_model(entity)
  let desired = generated_specs(view_model)
  generated_runtime.refresh(entity, desired)
}

///|
/// Reconciles this mounted View with a new ViewModel.
pub fn ComponentUsageView::replace(
  entity : @entity.Entity,
  view_model : ComponentState,
) -> Unit raise {
  let desired = generated_specs(view_model)
  generated_runtime.replace(entity, view_model, desired)
}

///|
#warnings("-unused_value")
fn generated_handle_event(
  view_model : ComponentState,
  event : @xaml_view.UiEvent,
) -> ComponentUsageViewAction? {
  None
}

///|
/// Installs this View below a root generated View that owns the shared host.
pub fn component_plugin(app : @app.App) -> @app.App {
  generated_runtime.install_component(
    app, "selene_xaml_ComponentUsageView_events",
  )
}

///|
/// Installs the shared host and this View package component tree.
pub fn plugin(app : @app.App) -> @app.App {
  app.add_plugin(@xaml_view.plugin).add_plugin(component_plugin)
}

===== fallback-slot/view.generated.mbt =====
// Generated by selene-xaml@0.37.3. DO NOT EDIT.
// input user fixtures/component-fallback.xaml sha256=b19a7edd39b31d7130970eaf0a07f34ad843b508278d74a43c09ca70c889d028
// input moon-info fixtures/component.mbti sha256=296e62b189c528b302529b3d8691a64bd97b75107acd15221da5e071a6fdc4af
// input resource fixtures/status-card.xaml sha256=67dadcb6b1f8501d25fcfd58dcf9d165583e1ce4a888e42a8bf104f1d7de6eb3

///|
type ComponentState = @model.ComponentState

///|
pub(all) enum ComponentFallbackViewAction {} derive(Eq, Debug)

///|
#warnings("-unused_value")
fn generated_rect_component(
  value : String,
  index : Int,
  path : String,
  image_region : Bool,
  corner_radius : Bool,
  non_negative : Bool,
) -> Double raise {
  @xaml_view.generated_view_rect_component(
    value,
    index,
    path,
    image_region,
    corner_radius~,
    non_negative~,
  )
}

///|
#warnings("-unused_value")
fn generated_image_drop_shadow(
  value : String,
  path : String,
) -> @xaml_view.ImageDropShadow? raise {
  @xaml_view.generated_view_image_drop_shadow(value, path)
}

///|
#warnings("-struct_never_constructed")
pub struct ComponentFallbackView {}

///|
let generated_runtime : @xaml_view.GeneratedViewRuntime[
  ComponentState,
  ComponentFallbackViewAction,
] = @xaml_view.GeneratedViewRuntime::new(generated_handle_event)

///|
/// World-isolated typed actions emitted by this view.
pub let action_event_bus : @event.Events[
  @xaml_view.GeneratedViewAction[ComponentFallbackViewAction],
] = generated_runtime.action_events()

///|
/// ViewModel components mounted by this View in the current World.
pub fn ComponentFallbackView::view_models() -> Map[
  @entity.Entity,
  ComponentState,
] {
  generated_runtime.view_models()
}

///|
#warnings("-unused_error_type")
fn generated_specs(state : ComponentState) -> Array[@xaml_view.NodeSpec] raise {
  let nodes : Array[@xaml_view.NodeSpec] = []
  nodes.push({
    key: "node-root-view",
    parent: None,
    kind: @xaml_view.NodeKind::View,
    text: "",
    spans: [],
    source: "",
    path_geometry: None,
    active: true,
    enabled: true,
    focusable: false,
    tab_index: 0,
    focus_scope: false,
    auto_focus: false,
    navigation_up: "",
    navigation_down: "",
    navigation_left: "",
    navigation_right: "",
    automation_name: "",
    style: { ..@xaml_view.NodeStyle::default() },
    visual_state_groups: [],
  })
  nodes.push({
    key: "node-root-0-flex",
    parent: Some("node-root-view"),
    kind: @xaml_view.NodeKind::Flex,
    text: "",
    spans: [],
    source: "",
    path_geometry: None,
    active: true,
    enabled: true,
    focusable: false,
    tab_index: 0,
    focus_scope: false,
    auto_focus: false,
    navigation_up: "",
    navigation_down: "",
    navigation_left: "",
    navigation_right: "",
    automation_name: "",
    style: { ..@xaml_view.NodeStyle::default(), border_brush: "#62d6a7" },
    visual_state_groups: [],
  })
  nodes.push({
    key: "node-root-0/0-text",
    parent: Some("node-root-0-flex"),
    kind: @xaml_view.NodeKind::Text,
    text: "Empty",
    spans: [],
    source: "",
    path_geometry: None,
    active: true,
    enabled: true,
    focusable: false,
    tab_index: 0,
    focus_scope: false,
    auto_focus: false,
    navigation_up: "",
    navigation_down: "",
    navigation_left: "",
    navigation_right: "",
    automation_name: "",
    style: { ..@xaml_view.NodeStyle::default() },
    visual_state_groups: [],
  })
  nodes.push({
    key: "node-root-0/1-text",
    parent: Some("node-root-0-flex"),
    kind: @xaml_view.NodeKind::Text,
    text: "Fallback",
    spans: [],
    source: "",
    path_geometry: None,
    active: true,
    enabled: true,
    focusable: false,
    tab_index: 0,
    focus_scope: false,
    auto_focus: false,
    navigation_up: "",
    navigation_down: "",
    navigation_left: "",
    navigation_right: "",
    automation_name: "",
    style: { ..@xaml_view.NodeStyle::default() },
    visual_state_groups: [],
  })
  nodes
}

///|
/// Mounts this view on an alive root entity in the current world.
/// Destroying the root ends the view lifetime.
pub fn ComponentFallbackView::mount(
  entity : @entity.Entity,
  view_model : ComponentState,
) -> Unit raise {
  let desired = generated_specs(view_model)
  generated_runtime.mount(entity, view_model, desired)
}

///|
/// Releases this View while leaving its caller-owned root entity alive.
pub fn ComponentFallbackView::unmount(entity : @entity.Entity) -> Unit raise {
  generated_runtime.unmount(entity)
}

///|
/// Refreshes the complete presentation from the current ViewModel component.
pub fn ComponentFallbackView::refresh(entity : @entity.Entity) -> Unit raise {
  let view_model = generated_runtime.view_model(entity)
  let desired = generated_specs(view_model)
  generated_runtime.refresh(entity, desired)
}

///|
/// Reconciles this mounted View with a new ViewModel.
pub fn ComponentFallbackView::replace(
  entity : @entity.Entity,
  view_model : ComponentState,
) -> Unit raise {
  let desired = generated_specs(view_model)
  generated_runtime.replace(entity, view_model, desired)
}

///|
#warnings("-unused_value")
fn generated_handle_event(
  view_model : ComponentState,
  event : @xaml_view.UiEvent,
) -> ComponentFallbackViewAction? {
  None
}

///|
/// Installs this View below a root generated View that owns the shared host.
pub fn component_plugin(app : @app.App) -> @app.App {
  generated_runtime.install_component(
    app, "selene_xaml_ComponentFallbackView_events",
  )
}

///|
/// Installs the shared host and this View package component tree.
pub fn plugin(app : @app.App) -> @app.App {
  app.add_plugin(@xaml_view.plugin).add_plugin(component_plugin)
}

