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
+5
View File
@@ -10,6 +10,10 @@ public struct MainView: View {
@State private var showCardManagement = false
@State private var cardConfigurationVersion = 0
private let profileEditor: (Binding<String>, Bool) -> AnyView = { text, isEditable in
AnyView(CodeEditTextView(text: text, isEditable: isEditable))
}
public init() {}
public var body: some View {
@@ -59,6 +63,7 @@ public struct MainView: View {
.environment(\.selection, $viewModel.selection)
.environment(\.importProfile, $viewModel.importProfile)
.environment(\.importRemoteProfile, $viewModel.importRemoteProfile)
.environment(\.profileEditor, profileEditor)
.handlesExternalEvents(preferring: [], allowing: ["*"])
.onOpenURL(perform: viewModel.openURL)
.sheet(isPresented: $showCardManagement) {