M0: WIT package, MoonBit components, JS host, docs, CI (#1)
CI / test (push) Successful in 19s

This commit was merged in pull request #1.
This commit is contained in:
nandi committed 2026-11-24 23:51:26 +00:00
1 parent e5548fc067
commit 880ecd4102
141 files changed
+9681 -1

No files matched your search

@@ -0,0 +1,42 @@
///| Implementation of `moonplasma:desktop/plasmoid` for the launcher.
/// The state machine lives in lib/launcher; this adapts host capabilities.
///|
let state : @logic.State = @logic.State::new()
///|
pub fn info() -> PlasmoidInfo {
{
id: "org.moonplasma.launcher",
name: "Application Launcher",
preferred: { w: 150, h: 34 },
min_width: 60,
stretch: false,
}
}
///|
pub fn render(size : @types.Size) -> Array[@types.DrawOp] {
@logic.render_button(size, @theme.get_tokens(), state)
}
///|
pub fn popup() -> PopupSurface? {
if !state.open {
return None
}
let apps = @app_catalog.list_apps()
Some({
size: @logic.popup_size(apps, state),
ops: @logic.render_popup(apps, @theme.get_tokens(), state),
})
}
///|
pub fn on_event(target : Surface, event : @types.InputEvent) -> Bool {
let t : @logic.Target = match target {
WIDGET => Widget
POPUP => Popup
}
@logic.handle_event(@app_catalog.list_apps(), state, t, event, @app_launch.launch)
}