feat(ui): native vessel, HTML vessel update, native hello examples, profile card, UI tools
El SDK Release / build-and-release (pull_request) Failing after 17s
El SDK Release / build-and-release (pull_request) Failing after 17s
el-native vessel: El-level wrappers around __widget_* C builtins, exposing vstack, label, button, text_field, etc. as clean El functions for application code. el-html/main.elh: updated extern declarations for the HTML vessel's codegen API. native-hello: cross-platform desktop example (AppKit/GTK4/Win32/SDL2) with build scripts, Dockerfiles for Linux/Pi, and Win32 cross-compile support. native-hello-android: Gradle project with ElBridge integration and build script. native-hello-ios: Xcode project for the iOS UIKit target. profile-card: manifest.el for a styling/layout/i18n example app that exercises el-style, el-layout, el-i18n, el-config, and el-secrets vessels. ui/tools/native-codegen: Python codegen pass (el_ui_native_codegen.py) that lowers el-ui component DSL to el-native vessel calls, plus build script and test fixtures.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
component App {
|
||||
state {
|
||||
counter: Int = 0
|
||||
input_text: String = ""
|
||||
}
|
||||
|
||||
fn increment(widget: Int, data: String) -> Void {
|
||||
state.counter = state.counter + 1
|
||||
widget_set_text(g_w_count_label, str_concat("Count: ", int_to_str(g_counter)))
|
||||
}
|
||||
|
||||
fn on_name_change(widget: Int, data: String) -> Void {
|
||||
state.input_text = data
|
||||
widget_set_disabled(g_w_btn_greet, str_len(g_input_text) == 0)
|
||||
}
|
||||
|
||||
template {
|
||||
<vstack spacing=24 padding=20 bg="#0f172a">
|
||||
<label text="Hello World" style="heading" />
|
||||
<hstack spacing=8>
|
||||
<text_field placeholder="Enter name" on_change=on_name_change flex=1 />
|
||||
<button label="Greet" on_click=on_greet_click disabled={str_len(state.input_text) == 0} />
|
||||
</hstack>
|
||||
<label text="Count: {state.counter}" />
|
||||
<button label="Increment" on_click=increment />
|
||||
</vstack>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user