adds schema view and schema generating command
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import Foundation
|
||||
import HelderCore
|
||||
import HelderServices
|
||||
|
||||
/// Schema card positions per project, in memory instead of UserDefaults.
|
||||
final class FakeSchemaLayouts: SchemaLayoutPersisting, @unchecked Sendable {
|
||||
private let state = Locked([String: [String: SchemaPoint]]())
|
||||
|
||||
var saved: [String: [String: SchemaPoint]] {
|
||||
get { state.current }
|
||||
set { state.mutate { $0 = newValue } }
|
||||
}
|
||||
|
||||
func loadPositions(root: String) -> [String: SchemaPoint] { state.current[root] ?? [:] }
|
||||
func savePositions(_ positions: [String: SchemaPoint], root: String) { state.mutate { $0[root] = positions } }
|
||||
}
|
||||
Reference in New Issue
Block a user