chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 12:29:49 +08:00
commit 505bac6b53
1470 changed files with 457757 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
# Native SDK mobile-shell example
The mobile shell shape is implemented by the concrete platform hosts in `examples/ios` and `examples/android`.
- `examples/ios` uses a native UIKit header with a WKWebView workspace and native command buttons.
- `examples/android` uses a native Android header with a WebView workspace, JNI bridge, native command buttons, and system Back dispatch.
Both hosts leave keyboard avoidance in the native layout system while forwarding viewport metrics to the Native SDK: UIKit adjusts the WebView constraint from keyboard frame notifications, and Android uses `adjustResize` for soft-keyboard relayout.
Android orientation and screen-size changes stay in the same activity so the embedded runtime survives rotation while resize/frame events update the content surface.
The embedded ABI also includes hardware key, committed text, IME composition, retained GPU/widget accessibility semantics, and widget accessibility action entry points for future GPU/widget text fields.
Use those platform folders when building or running the example.
The shared mobile metadata in `app.zon` records the intended platforms, capabilities, command IDs, and shell view tree. Package generation maps that shell metadata to native host config for the header labels, command buttons, and WebView workspace while each mobile host still owns safe areas, keyboard behavior, and platform lifecycle.
+43
View File
@@ -0,0 +1,43 @@
.{
.id = "dev.native_sdk.mobile_shell",
.name = "mobile-shell",
.display_name = "Mobile Shell",
.version = "0.1.0",
.platforms = .{ "ios", "android" },
.permissions = .{},
.capabilities = .{ "webview", "native_views", "native_module" },
.commands = .{
.{ .id = "mobile.back", .title = "Back" },
.{ .id = "mobile.refresh", .title = "Refresh" },
},
.shell = .{
// Declared platform chrome: on hosts that project it (the iOS
// canvas host today) the tab set becomes a REAL system tab bar
// and the primary action a real button; taps dispatch the ids
// below through the same command path as the header buttons.
// Hosts without a projection (this fixed WebView shell's
// hand-written hosts, desktop, Android for now) leave it inert.
.chrome = .{
.tabs = .{
.{ .id = "mobile.tab.workspace", .label = "Workspace", .icon = "menu" },
.{ .id = "mobile.tab.status", .label = "Status", .icon = "info" },
},
.primary_action = .{ .id = "mobile.refresh", .label = "Refresh", .icon = "refresh-cw" },
},
.windows = .{
.{
.label = "main",
.title = "Mobile Shell",
.views = .{
.{ .label = "mobile-header", .kind = "toolbar", .edge = "top", .height = 104, .role = "toolbar" },
.{ .label = "mobile-title", .kind = "label", .parent = "mobile-header", .text = "Mobile Shell", .accessibility_label = "Mobile Shell" },
.{ .label = "mobile-status", .kind = "statusbar", .edge = "bottom", .height = 28, .text = "Native commands ready" },
.{ .label = "mobile-back", .kind = "button", .parent = "mobile-header", .text = "Back", .command = "mobile.back" },
.{ .label = "mobile-refresh", .kind = "button", .parent = "mobile-header", .text = "Refresh", .command = "mobile.refresh" },
.{ .label = "workspace", .kind = "webview", .url = "zero://app/index.html", .fill = true },
},
},
},
},
.web_engine = "system",
}