Add the pure MoonBit core: grid, gestures, updater, vdom, app
grid: packing, pinning, resize steps (port of Layout.js and app.py's grid logic). gesture: pointer state machine (tap, long press, drag, release, swipe). updater: release/version parsing and the update decision. vdom: pure virtual DOM with an HTML-text renderer for tests. app: Elm-style Model/Msg/update/view with effects as data, persistence (JSON layout, import of the old WebView build's localStorage), drawer/search, menus, drag and resize. 60 headless tests drive it through pointer input. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
66e8e90da1
commit
28e0284d9b
28 files changed
+4278
No files matched your search
@@ -0,0 +1,45 @@
|
||||
// Generated using `moon info`, DON'T EDIT IT
|
||||
package "experiments/launcher/vdom"
|
||||
|
||||
// Values
|
||||
pub fn cls_if(String, Bool) -> String
|
||||
|
||||
pub fn[M] el(String, key? : Int32, classes? : Array[String], attrs? : Array[(String, String)], props? : Array[(String, String)], style? : String, handlers? : Handlers[M], children? : Array[Node[M]]) -> Node[M]
|
||||
|
||||
pub fn[M] text(String) -> Node[M]
|
||||
|
||||
pub fn[M] to_html(Node[M], indent? : Int32) -> String
|
||||
|
||||
// Errors
|
||||
|
||||
// Types and methods
|
||||
pub(all) struct Element[M] {
|
||||
tag : String
|
||||
key : Int32
|
||||
classes : Array[String]
|
||||
attrs : Array[(String, String)]
|
||||
props : Array[(String, String)]
|
||||
style : String
|
||||
handlers : Handlers[M]
|
||||
children : Array[Node[M]]
|
||||
}
|
||||
|
||||
pub(all) struct Handlers[M] {
|
||||
down : M?
|
||||
tap : M?
|
||||
press : M?
|
||||
enter : M?
|
||||
escape : M?
|
||||
input : ((String) -> M)?
|
||||
}
|
||||
pub fn[M] Handlers::is_empty(Self[M]) -> Bool
|
||||
pub fn[M] Handlers::none() -> Self[M]
|
||||
|
||||
pub(all) enum Node[M] {
|
||||
Text(String)
|
||||
El(Element[M])
|
||||
}
|
||||
|
||||
// Type aliases
|
||||
|
||||
// Traits
|
||||
Reference in new issue
Block a user