You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/BluetoothExplorerUI/PluginsView.swift
+70-2Lines changed: 70 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,26 @@
2
2
// PluginsView.swift
3
3
// BluetoothExplorerUI
4
4
//
5
-
// Lists loaded parser plugins with enable/disable toggles and load-error surfacing.
5
+
// Manages parser plugins: enable/disable, import from a file, delete, and surface load errors.
6
+
// Bundled plugins are copied into the app's Documents directory on first launch, so everything
7
+
// listed here lives in one place the user can inspect.
6
8
//
7
9
8
10
import SwiftUI
11
+
#if canImport(UniformTypeIdentifiers)
12
+
import UniformTypeIdentifiers
13
+
#endif
9
14
import BluetoothExplorerModel
10
15
11
16
publicstructPluginsView:View{
12
17
13
18
@Environment(Store.self)
14
19
varstore:Store
15
20
21
+
// Not `private`: Skip's bridging requires @State properties to be at least internal.
22
+
@StatevarisImporting=false
23
+
@StatevarimportError:String?
24
+
16
25
publicinit(){}
17
26
18
27
publicvarbody:someView{
@@ -21,15 +30,74 @@ public struct PluginsView: View {
21
30
ForEach(store.pluginManager.plugins){ state in
22
31
row(for: state)
23
32
}
33
+
.onDelete{ offsets in
34
+
delete(at: offsets)
35
+
}
24
36
} header:{
25
37
Text("Parsers")
26
38
} footer:{
27
-
Text("Plugins decode advertisement and characteristic values. Built-in parsers are native; others are WebAssembly modules.")
39
+
Text("Plugins decode advertisement and characteristic values. Built-in parsers are native; others are WebAssembly modules stored in the app's Documents folder.")
0 commit comments