Skip to content

Commit 0091c45

Browse files
ellboschpianostringquartetnarner
authored
Layer pinning + 3D transform changes (#95)
Co-authored-by: Chris Clampitt <christian.clampitt@nyu.edu> Co-authored-by: Nick Arner <nicholasarner@gmail.com>
1 parent 274b624 commit 0091c45

116 files changed

Lines changed: 5937 additions & 110 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/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ chmod +x versioning.sh
2929
3. Update **all** `StitchDocument versions to fix compiler errors from `StitchDocumentMigratable` changes.
3030

3131
## Tips
32+
* **Please mark custom migration code with `// TODO: ...` comment code.** It makes identifying custom migration code easier for subsequent versions.
3233
* In the Stitch codebase, use the `DEV_DEBUG` scheme if you expect to make more edits to the schema version. This fixes migration issues caused by making changes to existing versions.

Sources/StitchSchemaKit/SchemaVersions.swift

Lines changed: 99 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -9,91 +9,96 @@ import Foundation
99
import SwiftUI
1010

1111
// MARK: - UPDATE VERSION NUMBERS HERE
12-
public typealias CurrentAsyncMediaValue = AsyncMediaValue_V22
13-
public typealias CurrentClassicAnimationCurve = ClassicAnimationCurve_V22
14-
public typealias CurrentCameraSettings = CameraSettings_V22
15-
public typealias CurrentCommentBoxData = CommentBoxData_V22
16-
public typealias CurrentCustomShape = CustomShape_V22
17-
public typealias CurrentDataType = DataType_V22
18-
public typealias CurrentDelayStyle = DelayStyle_V22
19-
public typealias CurrentDateAndTimeFormat = DateAndTimeFormat_V22
20-
public typealias CurrentExpansionDirection = ExpansionDirection_V22
21-
public typealias CurrentGroupNodeIDCoordinate = GroupNodeID_V22
22-
public typealias CurrentPatch = Patch_V22
23-
public typealias CurrentPatchNodeEntity = PatchNodeEntity_V22
24-
public typealias CurrentLayerDimension = LayerDimension_V22
25-
public typealias CurrentLayerNodeEntity = LayerNodeEntity_V22
26-
public typealias CurrentLayerNodeId = LayerNodeId_V22
27-
public typealias CurrentNodeEntity = NodeEntity_V22
28-
public typealias CurrentNodePortInputEntity = NodePortInputEntity_V22
29-
public typealias CurrentSplitterNodeEntity = SplitterNodeEntity_V22
30-
public typealias CurrentSplitterType = SplitterType_V22
31-
public typealias CurrentNodeIOCoordinate = NodeIOCoordinate_V22
32-
public typealias CurrentJSONCurveTo = JSONCurveTo_V22
33-
public typealias CurrentJSONShapeCommand = JSONShapeCommand_V22
34-
public typealias CurrentJSONShapeKeys = JSONShapeKeys_V22
35-
public typealias CurrentSidebarLayerData = SidebarLayerData_V22
36-
public typealias CurrentNodeKind = NodeKind_V22
37-
public typealias CurrentAnchoring = Anchoring_V22
38-
public typealias CurrentCameraDirection = CameraDirection_V22
39-
public typealias CurrentLayer = Layer_V22
40-
public typealias CurrentLayerSize = LayerSize_V22
41-
public typealias CurrentLayerTextDecoration = LayerTextDecoration_V22
42-
public typealias CurrentLayerStroke = LayerStroke_V22
43-
public typealias CurrentLayerTextAlignment = LayerTextAlignment_V22
44-
public typealias CurrentLayerTextVerticalAlignment = LayerTextVerticalAlignment_V22
45-
public typealias CurrentLightType = LightType_V22
46-
public typealias CurrentMediaKey = MediaKey_V22
47-
public typealias CurrentMobileHapticStyle = MobileHapticStyle_V22
48-
public typealias CurrentNetworkRequestType = NetworkRequestType_V22
49-
public typealias CurrentPathPoint = PathPoint_V22
50-
public typealias CurrentPlane = Plane_V22
51-
public typealias CurrentPoint3D = Point3D_V22
52-
public typealias CurrentPoint4D = Point4D_V22
53-
public typealias CurrentPortValueComparable = PortValueComparable_V22
54-
public typealias CurrentPreviewSize = PreviewSize_V22
55-
public typealias CurrentRGBA = RGBA_V22
56-
public typealias CurrentRoundedRectangleData = RoundedRectangleData_V22
57-
public typealias CurrentScrollDecelerationRate = ScrollDecelerationRate_V22
58-
public typealias CurrentScrollJumpStyle = ScrollJumpStyle_V22
59-
public typealias CurrentScrollMode = ScrollMode_V22
60-
public typealias CurrentShapeCommand = ShapeCommand_V22
61-
public typealias CurrentShapeCommandType = ShapeCommandType_V22
62-
public typealias CurrentShapeCoordinates = ShapeCoordinates_V22
63-
public typealias CurrentShapeAndRect = ShapeAndRect_V22
64-
public typealias CurrentStitchDocument = StitchDocument_V22
65-
public typealias CurrentStitchBlendMode = StitchBlendMode_V22
66-
public typealias CurrentStitchCameraOrientation = StitchCameraOrientation_V22
67-
public typealias CurrentStitchDeviceOrientation = StitchDeviceOrientation_V22
68-
public typealias CurrentStitchMapType = StitchMapType_V22
69-
public typealias CurrentStitchFont = StitchFont_V22
70-
public typealias CurrentStitchFontChoice = StitchFontChoice_V22
71-
public typealias CurrentStitchFontWeight = StitchFontWeight_V22
72-
public typealias CurrentStitchJSON = StitchJSON_V22
73-
public typealias CurrentStitchOrientation = StitchOrientation_V22
74-
public typealias CurrentStitchProgressIndicatorStyle = ProgressIndicatorStyle_V22
75-
public typealias CurrentTextTransform = TextTransform_V22
76-
public typealias CurrentTriangleData = TriangleData_V22
77-
public typealias CurrentPortValue = PortValue_V22
78-
public typealias CurrentUserVisibleType = UserVisibleType_V22
79-
public typealias CurrentVisualMediaFitStyle = VisualMediaFitStyle_V22
80-
public typealias CurrentNodeConnectionType = NodeConnectionType_V22
81-
public typealias CurrentLayerInputType = LayerInputType_V22
82-
public typealias CurrentNodeIOPortType = NodeIOPortType_V22
83-
public typealias CurrentStrokeLineCap = StrokeLineCap_V22
84-
public typealias CurrentStrokeLineJoin = StrokeLineJoin_V22
85-
public typealias CurrentStitchStringValue = StitchStringValue_V22
86-
public typealias CurrentStitchContentMode = StitchContentMode_V22
87-
public typealias CurrentStitchSpacing = StitchSpacing_V22
88-
public typealias CurrentStitchPadding = StitchPadding_V22
89-
public typealias CurrentSizingScenario = SizingScenario_V22
90-
public typealias CurrentNodeTypeEntity = NodeTypeEntity_V22
91-
public typealias CurrentCanvasNodeEntity = CanvasNodeEntity_V22
92-
public typealias CurrentLayerInputDataEntity = LayerInputDataEntity_V22
93-
public typealias CurrentCanvasItemId = CanvasItemId_V22
94-
public typealias CurrentLayerInputCoordinate = LayerInputCoordinate_V22
95-
public typealias CurrentLayerOutputCoordinate = LayerOutputCoordinate_V22
96-
//public typealias CurrentPinToId = PinToId_V22
12+
public typealias CurrentAsyncMediaValue = AsyncMediaValue_V23
13+
public typealias CurrentClassicAnimationCurve = ClassicAnimationCurve_V23
14+
public typealias CurrentCameraSettings = CameraSettings_V23
15+
public typealias CurrentCommentBoxData = CommentBoxData_V23
16+
public typealias CurrentCustomShape = CustomShape_V23
17+
public typealias CurrentDataType = DataType_V23
18+
public typealias CurrentDelayStyle = DelayStyle_V23
19+
public typealias CurrentDateAndTimeFormat = DateAndTimeFormat_V23
20+
public typealias CurrentExpansionDirection = ExpansionDirection_V23
21+
public typealias CurrentGroupNodeIDCoordinate = GroupNodeID_V23
22+
public typealias CurrentPatch = Patch_V23
23+
public typealias CurrentPatchNodeEntity = PatchNodeEntity_V23
24+
public typealias CurrentLayerDimension = LayerDimension_V23
25+
public typealias CurrentLayerNodeEntity = LayerNodeEntity_V23
26+
public typealias CurrentLayerNodeId = LayerNodeId_V23
27+
public typealias CurrentNodeEntity = NodeEntity_V23
28+
public typealias CurrentNodePortInputEntity = NodePortInputEntity_V23
29+
public typealias CurrentSplitterNodeEntity = SplitterNodeEntity_V23
30+
public typealias CurrentSplitterType = SplitterType_V23
31+
public typealias CurrentNodeIOCoordinate = NodeIOCoordinate_V23
32+
public typealias CurrentJSONCurveTo = JSONCurveTo_V23
33+
public typealias CurrentJSONShapeCommand = JSONShapeCommand_V23
34+
public typealias CurrentJSONShapeKeys = JSONShapeKeys_V23
35+
public typealias CurrentSidebarLayerData = SidebarLayerData_V23
36+
public typealias CurrentNodeKind = NodeKind_V23
37+
public typealias CurrentAnchoring = Anchoring_V23
38+
public typealias CurrentCameraDirection = CameraDirection_V23
39+
public typealias CurrentLayer = Layer_V23
40+
public typealias CurrentLayerSize = LayerSize_V23
41+
public typealias CurrentLayerTextDecoration = LayerTextDecoration_V23
42+
public typealias CurrentLayerStroke = LayerStroke_V23
43+
public typealias CurrentLayerTextAlignment = LayerTextAlignment_V23
44+
public typealias CurrentLayerTextVerticalAlignment = LayerTextVerticalAlignment_V23
45+
public typealias CurrentLightType = LightType_V23
46+
public typealias CurrentMediaKey = MediaKey_V23
47+
public typealias CurrentMobileHapticStyle = MobileHapticStyle_V23
48+
public typealias CurrentNetworkRequestType = NetworkRequestType_V23
49+
public typealias CurrentPathPoint = PathPoint_V23
50+
public typealias CurrentPlane = Plane_V23
51+
public typealias CurrentPoint3D = Point3D_V23
52+
public typealias CurrentPoint4D = Point4D_V23
53+
public typealias CurrentPortValueComparable = PortValueComparable_V23
54+
public typealias CurrentPreviewSize = PreviewSize_V23
55+
public typealias CurrentRGBA = RGBA_V23
56+
public typealias CurrentRoundedRectangleData = RoundedRectangleData_V23
57+
public typealias CurrentScrollDecelerationRate = ScrollDecelerationRate_V23
58+
public typealias CurrentScrollJumpStyle = ScrollJumpStyle_V23
59+
public typealias CurrentScrollMode = ScrollMode_V23
60+
public typealias CurrentShapeCommand = ShapeCommand_V23
61+
public typealias CurrentShapeCommandType = ShapeCommandType_V23
62+
public typealias CurrentShapeCoordinates = ShapeCoordinates_V23
63+
public typealias CurrentShapeAndRect = ShapeAndRect_V23
64+
public typealias CurrentStitchDocument = StitchDocument_V23
65+
public typealias CurrentStitchBlendMode = StitchBlendMode_V23
66+
public typealias CurrentStitchCameraOrientation = StitchCameraOrientation_V23
67+
public typealias CurrentStitchDeviceOrientation = StitchDeviceOrientation_V23
68+
public typealias CurrentStitchMapType = StitchMapType_V23
69+
public typealias CurrentStitchFont = StitchFont_V23
70+
public typealias CurrentStitchFontChoice = StitchFontChoice_V23
71+
public typealias CurrentStitchFontWeight = StitchFontWeight_V23
72+
public typealias CurrentStitchJSON = StitchJSON_V23
73+
public typealias CurrentStitchOrientation = StitchOrientation_V23
74+
public typealias CurrentStitchProgressIndicatorStyle = ProgressIndicatorStyle_V23
75+
public typealias CurrentTextTransform = TextTransform_V23
76+
public typealias CurrentTriangleData = TriangleData_V23
77+
public typealias CurrentPortValue = PortValue_V23
78+
public typealias CurrentUserVisibleType = UserVisibleType_V23
79+
public typealias CurrentVisualMediaFitStyle = VisualMediaFitStyle_V23
80+
public typealias CurrentNodeConnectionType = NodeConnectionType_V23
81+
public typealias CurrentLayerInputType = LayerInputType_V23
82+
public typealias CurrentNodeIOPortType = NodeIOPortType_V23
83+
public typealias CurrentStrokeLineCap = StrokeLineCap_V23
84+
public typealias CurrentStrokeLineJoin = StrokeLineJoin_V23
85+
public typealias CurrentStitchStringValue = StitchStringValue_V23
86+
public typealias CurrentStitchContentMode = StitchContentMode_V23
87+
public typealias CurrentStitchSpacing = StitchSpacing_V23
88+
public typealias CurrentStitchPadding = StitchPadding_V23
89+
public typealias CurrentSizingScenario = SizingScenario_V23
90+
public typealias CurrentNodeTypeEntity = NodeTypeEntity_V23
91+
public typealias CurrentCanvasNodeEntity = CanvasNodeEntity_V23
92+
public typealias CurrentLayerInputDataEntity = LayerInputDataEntity_V23
93+
public typealias CurrentCanvasItemId = CanvasItemId_V23
94+
public typealias CurrentLayerInputCoordinate = LayerInputCoordinate_V23
95+
public typealias CurrentLayerOutputCoordinate = LayerOutputCoordinate_V23
96+
public typealias CurrentPinToId = PinToId_V23
97+
public typealias CurrentLayerInputEntity = LayerInputEntity_V23
98+
public typealias CurrentLayerInputPort = LayerInputPort_V23
99+
public typealias CurrentLayerInputKeyPathType = LayerInputKeyPathType_V23
100+
public typealias CurrentUnpackedPortType = UnpackedPortType_V23
101+
public typealias CurrentStitchTransform = StitchTransform_V23
97102

98103
// MARK: - end
99104

@@ -183,7 +188,12 @@ public typealias LayerInputDataEntity = CurrentLayerInputDataEntity.LayerInputDa
183188
public typealias CanvasItemId = CurrentCanvasItemId.CanvasItemId
184189
public typealias LayerInputCoordinate = CurrentLayerInputCoordinate.LayerInputCoordinate
185190
public typealias LayerOutputCoordinate = CurrentLayerOutputCoordinate.LayerOutputCoordinate
186-
//public typealias PinToId = CurrentPinToId.PinToId
191+
public typealias PinToId = CurrentPinToId.PinToId
192+
public typealias LayerInputEntity = CurrentLayerInputEntity.LayerInputEntity
193+
public typealias LayerInputPort = CurrentLayerInputPort.LayerInputPort
194+
public typealias LayerInputKeyPathType = CurrentLayerInputKeyPathType.LayerInputKeyPathType
195+
public typealias UnpackedPortType = CurrentUnpackedPortType.UnpackedPortType
196+
public typealias StitchTransform = CurrentStitchTransform.StitchTransform
187197

188198
public enum StitchSchemaVersion: Int, VersionType {
189199
case _V1 = 1
@@ -208,6 +218,7 @@ public enum StitchSchemaVersion: Int, VersionType {
208218
case _V20 = 20
209219
case _V21 = 21
210220
case _V22 = 22
221+
case _V23 = 23
211222
}
212223

213224
public protocol VersionType: CaseIterable, Codable, Comparable, RawRepresentable {}
@@ -275,6 +286,8 @@ extension StitchDocumentVersion {
275286
return StitchDocument_V21.StitchDocument.self
276287
case ._V22:
277288
return StitchDocument_V22.StitchDocument.self
289+
case ._V23:
290+
return StitchDocument_V23.StitchDocument.self
278291
}
279292
}
280293
}

Sources/StitchSchemaKit/Util.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ extension URL {
327327
// the values contained in a single Input or Output
328328
public typealias PortValues = [PortValue]
329329

330-
public typealias StitchMatrix = matrix_float4x4
331330
public typealias StitchPosition = CGSize
332331
public typealias ShapeDataArray = [ShapeAndRect]
333332
public typealias JSONShapeCommands = [JSONShapeCommand]

Sources/StitchSchemaKit/V1/NodePort/PortValue_V1.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public enum PortValue_V1: StitchSchemaVersionable {
5555
case int(Int) // e.g nodeId or index?
5656
case number(Double) // e.g. CGFloat, part of CGSize, etc.
5757
case layerDimension(LayerDimension)
58-
case matrixTransform(StitchMatrix)
58+
case matrixTransform(matrix_float4x4)
5959
case plane(Plane)
6060
case networkRequestType(NetworkRequestType)
6161
case color(Color)

Sources/StitchSchemaKit/V10/NodePort/PortValue_V10.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public enum PortValue_V10: StitchSchemaVersionable {
6161
case int(Int) // e.g nodeId or index?
6262
case number(Double) // e.g. CGFloat, part of CGSize, etc.
6363
case layerDimension(LayerDimension)
64-
case matrixTransform(StitchMatrix)
64+
case matrixTransform(matrix_float4x4)
6565
case plane(Plane)
6666
case networkRequestType(NetworkRequestType)
6767
case color(Color)

Sources/StitchSchemaKit/V11/NodePort/PortValue_V11.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public enum PortValue_V11: StitchSchemaVersionable {
6161
case int(Int) // e.g nodeId or index?
6262
case number(Double) // e.g. CGFloat, part of CGSize, etc.
6363
case layerDimension(LayerDimension)
64-
case matrixTransform(StitchMatrix)
64+
case matrixTransform(matrix_float4x4)
6565
case plane(Plane)
6666
case networkRequestType(NetworkRequestType)
6767
case color(Color)

Sources/StitchSchemaKit/V12/NodePort/PortValue_V12.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public enum PortValue_V12: StitchSchemaVersionable {
6161
case int(Int) // e.g nodeId or index?
6262
case number(Double) // e.g. CGFloat, part of CGSize, etc.
6363
case layerDimension(LayerDimension)
64-
case matrixTransform(StitchMatrix)
64+
case matrixTransform(matrix_float4x4)
6565
case plane(Plane)
6666
case networkRequestType(NetworkRequestType)
6767
case color(Color)

Sources/StitchSchemaKit/V13/NodePort/PortValue_V13.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public enum PortValue_V13: StitchSchemaVersionable {
6363
case int(Int) // e.g nodeId or index?
6464
case number(Double) // e.g. CGFloat, part of CGSize, etc.
6565
case layerDimension(LayerDimension)
66-
case matrixTransform(StitchMatrix)
66+
case matrixTransform(matrix_float4x4)
6767
case plane(Plane)
6868
case networkRequestType(NetworkRequestType)
6969
case color(Color)

Sources/StitchSchemaKit/V14/NodePort/PortValue_V14.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public enum PortValue_V14: StitchSchemaVersionable {
6363
case int(Int) // e.g nodeId or index?
6464
case number(Double) // e.g. CGFloat, part of CGSize, etc.
6565
case layerDimension(LayerDimension)
66-
case matrixTransform(StitchMatrix)
66+
case matrixTransform(matrix_float4x4)
6767
case plane(Plane)
6868
case networkRequestType(NetworkRequestType)
6969
case color(Color)

Sources/StitchSchemaKit/V15/NodePort/PortValue_V15.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public enum PortValue_V15: StitchSchemaVersionable {
6363
case int(Int) // e.g nodeId or index?
6464
case number(Double) // e.g. CGFloat, part of CGSize, etc.
6565
case layerDimension(LayerDimension)
66-
case matrixTransform(StitchMatrix)
66+
case matrixTransform(matrix_float4x4)
6767
case plane(Plane)
6868
case networkRequestType(NetworkRequestType)
6969
case color(Color)

0 commit comments

Comments
 (0)