Improve JSON editor for macOS

This commit is contained in:
世界
2025-11-26 22:25:52 +08:00
parent 3f1c716a0a
commit c5fd6a6b4e
25 changed files with 979 additions and 322 deletions
+6
View File
@@ -16,6 +16,10 @@ struct MainView: View {
@State private var showConnections = false
@State private var buttonState = ButtonVisibilityState()
private let profileEditor: (Binding<String>, Bool) -> AnyView = { text, isEditable in
AnyView(RunestoneTextView(text: text, isEditable: isEditable))
}
private var shouldShowBottomAccessory: Bool {
guard !environments.extensionProfileLoading else {
return false
@@ -124,6 +128,7 @@ struct MainView: View {
.environment(\.selection, $selection)
.environment(\.importProfile, $importProfile)
.environment(\.importRemoteProfile, $importRemoteProfile)
.environment(\.profileEditor, profileEditor)
.handlesExternalEvents(preferring: [], allowing: ["*"])
.onOpenURL(perform: openURL)
.sheet(isPresented: $showGroups) {
@@ -160,6 +165,7 @@ struct MainView: View {
.environment(\.selection, $selection)
.environment(\.importProfile, $importProfile)
.environment(\.importRemoteProfile, $importRemoteProfile)
.environment(\.profileEditor, profileEditor)
.handlesExternalEvents(preferring: [], allowing: ["*"])
.onOpenURL(perform: openURL)
}