@swiftbrowser/native 0.26.3 → 0.26.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/swift/Sources/SwiftBrowserNative/Views/Kinds/KeyboardBar.swift +19 -0
- package/swift/Sources/SwiftBrowserNative/Views/Kinds/Lists.swift +3 -0
- package/swift/Sources/SwiftBrowserNative/Views/Kinds/Navigation.swift +1 -0
- package/swift/Sources/SwiftBrowserProtocol/Props.swift +6 -0
- package/wasm/SwiftBrowserNative.wasm +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swiftbrowser/native",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Run a @swiftbrowser/react app natively: the runtime a JavaScriptCore-hosted app needs (timers, console, fetch and the other web globals over the SwiftBrowser Native bridge), the `run` entry that renders into the native SwiftUI renderer, and the bundler that builds app.js for the Xcode target.",
|
|
6
6
|
"repository": {
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@babel/core": "^7.29.7",
|
|
66
|
-
"@swiftbrowser/react": "0.26.
|
|
67
|
-
"@swiftbrowser/web": "0.26.
|
|
66
|
+
"@swiftbrowser/react": "0.26.4",
|
|
67
|
+
"@swiftbrowser/web": "0.26.4",
|
|
68
68
|
"esbuild": "^0.28.2",
|
|
69
69
|
"react-refresh": "^0.17.0"
|
|
70
70
|
},
|
|
@@ -81,4 +81,23 @@ private struct CapsuleGlass: ViewModifier {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
#endif
|
|
84
|
+
|
|
85
|
+
/// `.navigationSubtitle` (macOS 11, iOS 26): the screen's `subtitle`, under
|
|
86
|
+
/// the title in a Mac's title bar. The iOS build's SDK floor is older than
|
|
87
|
+
/// the modifier, so only a Mac (and the shim's round trip) draws it.
|
|
88
|
+
struct NavigationSubtitle: ViewModifier {
|
|
89
|
+
let subtitle: String?
|
|
90
|
+
|
|
91
|
+
func body(content: Content) -> some View {
|
|
92
|
+
#if os(macOS) || canImport(FoundationBridge)
|
|
93
|
+
if let subtitle, !subtitle.isEmpty {
|
|
94
|
+
content.navigationSubtitle(subtitle)
|
|
95
|
+
} else {
|
|
96
|
+
content
|
|
97
|
+
}
|
|
98
|
+
#else
|
|
99
|
+
content
|
|
100
|
+
#endif
|
|
101
|
+
}
|
|
102
|
+
}
|
|
84
103
|
#endif
|
|
@@ -15,6 +15,9 @@ struct ListElement: View {
|
|
|
15
15
|
let props = ListProps(props: node.props)
|
|
16
16
|
let list = selectionList(props)
|
|
17
17
|
let styled: AnyView = {
|
|
18
|
+
// A `Form` (the shim's and React's mark their list `form`): the
|
|
19
|
+
// system's form, which on a Mac is the columns style.
|
|
20
|
+
if props.form { return AnyView(Form { ListRowsView(children: node.children) }) }
|
|
18
21
|
switch props.style {
|
|
19
22
|
case "plain": return AnyView(list.listStyle(.plain))
|
|
20
23
|
case "sidebar": return AnyView(list.listStyle(.sidebar))
|
|
@@ -145,6 +145,7 @@ struct NavigationScreenElement: View {
|
|
|
145
145
|
let titled = content
|
|
146
146
|
.modifier(KeyboardBarInset(toolbars: keyboardToolbars))
|
|
147
147
|
.navigationTitle(props.title)
|
|
148
|
+
.modifier(NavigationSubtitle(subtitle: props.subtitle))
|
|
148
149
|
.toolbar { ScreenToolbar(toolbars: shown) }
|
|
149
150
|
.onAppear {
|
|
150
151
|
// A pushed screen, appearing: its bar as it is now, until the push has settled.
|
|
@@ -175,11 +175,14 @@ public struct ListProps: Equatable, Sendable {
|
|
|
175
175
|
public var editing: Bool?
|
|
176
176
|
/// `List(selection:)` over a `Set`: several rows may be selected.
|
|
177
177
|
public var multiSelect: Bool
|
|
178
|
+
/// A `Form`: drawn as one (on a Mac, the columns style).
|
|
179
|
+
public var form: Bool
|
|
178
180
|
public init(props: JSONObject) {
|
|
179
181
|
style = props.string("style") ?? "insetGrouped"
|
|
180
182
|
refreshable = props.bool("refreshable") ?? false
|
|
181
183
|
editing = props.bool("editing")
|
|
182
184
|
multiSelect = props.bool("multiSelect") ?? false
|
|
185
|
+
form = props.bool("form") ?? false
|
|
183
186
|
}
|
|
184
187
|
}
|
|
185
188
|
|
|
@@ -294,6 +297,8 @@ public struct ToggleProps: Equatable, Sendable {
|
|
|
294
297
|
|
|
295
298
|
public struct NavScreenProps: Equatable, Sendable {
|
|
296
299
|
public var title: String
|
|
300
|
+
/// `.navigationSubtitle`: under the title in a Mac's title bar.
|
|
301
|
+
public var subtitle: String?
|
|
297
302
|
/// `automatic`, `large` or `inline`.
|
|
298
303
|
public var displayMode: String
|
|
299
304
|
/// 0 for the stack's root screen.
|
|
@@ -306,6 +311,7 @@ public struct NavScreenProps: Equatable, Sendable {
|
|
|
306
311
|
public var statusBarHidden: Bool
|
|
307
312
|
public init(props: JSONObject) {
|
|
308
313
|
title = props.string("title") ?? ""
|
|
314
|
+
subtitle = props.string("subtitle")
|
|
309
315
|
displayMode = props.string("displayMode") ?? "automatic"
|
|
310
316
|
depth = props.int("depth") ?? 0
|
|
311
317
|
toolbarRole = props.string("toolbarRole")
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/wasm/SwiftBrowserNative.wasm
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 50287835 bytes
|
|
4
|
+
sha256: af44f347a82278412c3e963bbb3d47e240c12ec80a8220b5641277010d238984
|