Skip to content

Commit 43ddf22

Browse files
authored
Support for systems + hashable components (#107)
1 parent 868613f commit 43ddf22

58 files changed

Lines changed: 65 additions & 60 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Sources/StitchSchemaKit/V25/CommentBoxData_V25.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public enum CommentBoxData_V25: StitchSchemaVersionable {
1515
public typealias CanvasItemId = CanvasItemId_V25.CanvasItemId
1616
// MARK: - endif
1717

18-
public struct CommentBoxData: Equatable, Hashable {
18+
public struct CommentBoxData: Hashable {
1919
public var id: UUID
2020

2121
/*

Sources/StitchSchemaKit/V25/Document/StitchComponent_V25.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public enum StitchComponent_V25: StitchSchemaVersionable {
1717
public typealias SidebarLayerList = [SidebarLayerData_V25.SidebarLayerData]
1818
// MARK: - end
1919

20-
public struct StitchComponent: StitchVersionedCodable, Equatable, Sendable {
20+
public struct StitchComponent: StitchVersionedCodable, Hashable, Sendable {
2121
// Share location, saved here due to static helpers for sharing
2222
public var saveLocation: GraphSaveLocation
2323
public var graph: GraphEntity

Sources/StitchSchemaKit/V25/Graph/GraphDocumentPath_V25.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ public enum GraphDocumentPath_V25: StitchSchemaVersionable {
1414
public typealias PreviousInstance = Self.GraphDocumentPath
1515
// MARK: - end
1616

17-
public struct GraphDocumentPath: Codable, Equatable, Sendable {
17+
public struct GraphDocumentPath: Codable, Hashable, Sendable {
1818
public let docId: UUID
19-
public let componentId: UUID
19+
public var componentId: UUID
2020
public let componentsPath: [UUID]
2121

2222
public init(docId: UUID,

Sources/StitchSchemaKit/V25/Graph/GraphEntity_V25.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public enum GraphEntity_V25: StitchSchemaVersionable {
1717
public typealias CommentBoxData = CommentBoxData_V25.CommentBoxData
1818
// MARK: - end
1919

20-
public struct GraphEntity: Equatable, Sendable {
20+
public struct GraphEntity: Hashable, Sendable {
2121
public var id: UUID
2222
public var name: String
2323
public var nodes: [NodeEntity]

Sources/StitchSchemaKit/V25/Graph/GraphSaveLocation_V25.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public enum GraphSaveLocation_V25: StitchSchemaVersionable {
1616
public typealias StitchSystemType = StitchSystemType_V25.StitchSystemType
1717
// MARK: - end
1818

19-
public enum GraphSaveLocation: Codable, Equatable, Sendable {
19+
public enum GraphSaveLocation: Codable, Hashable, Sendable {
2020
case document(UUID)
2121
case localComponent(GraphDocumentPath)
2222
case systemComponent(StitchSystemType, UUID)

Sources/StitchSchemaKit/V25/Graph/SystemType_V25.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ public enum StitchSystemType_V25: StitchSchemaVersionable {
2121
public var id: Int {
2222
switch self {
2323
case .userLibrary:
24-
return Self.userLibraryName.hashValue
24+
return 0
2525

2626
case .system(let id):
2727
return id.hashValue
2828
}
2929
}
3030

3131
public var description: String {
32-
"\(self.hashValue)"
32+
"\(self.id)"
3333
}
3434
}
3535
}

Sources/StitchSchemaKit/V25/Layer_V25.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public enum Layer_V25: StitchSchemaVersionable {
1414
// MARK: - endif
1515

1616

17-
public enum Layer: String, CaseIterable {
17+
public enum Layer: String, CaseIterable, Hashable {
1818
case text,
1919
oval,
2020
rectangle,

Sources/StitchSchemaKit/V25/Node/CanvasNodeEntity_V25.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public enum CanvasNodeEntity_V25: StitchSchemaVersionable {
1818
public typealias NodePortInputEntitySchemas = [NodePortInputEntity_V25.NodePortInputEntity]
1919
// MARK: - end
2020

21-
public struct CanvasNodeEntity: Equatable {
21+
public struct CanvasNodeEntity: Hashable {
2222
public var position: CGPoint
2323
public var zIndex: Double
2424
public var parentGroupNodeId: UUID?

Sources/StitchSchemaKit/V25/Node/Component/ComponentEntity_V25.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public enum ComponentEntity_V25: StitchSchemaVersionable {
1414
public typealias PreviousInstance = NodeTypeEntity_V24.NodeTypeEntity
1515
// MARK: - end
1616

17-
public struct ComponentEntity: Codable, Equatable {
17+
public struct ComponentEntity: Codable, Hashable {
1818
public let componentId: UUID
1919
public var inputs: [NodeConnectionType_V25.NodeConnectionType]
2020
public var canvasEntity: CanvasNodeEntity_V25.CanvasNodeEntity

Sources/StitchSchemaKit/V25/Node/Group/SplitterNodeEntity_V25.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public enum SplitterNodeEntity_V25: StitchSchemaVersionable {
1515
public typealias SplitterType = SplitterType_V25.SplitterType
1616
// MARK: - end
1717

18-
public struct SplitterNodeEntity: Equatable {
18+
public struct SplitterNodeEntity: Hashable {
1919
public let id: UUID
2020
// Dates used to sort ports in group node view
2121
public var lastModifiedDate: Date

0 commit comments

Comments
 (0)