7
7
// ID: C424ABD9FC88B2DFD0B7B2319F2E7987
8
8
9
9
import Foundation
10
- internal import OpenGraphShims
11
- @_spi ( ForOpenSwiftUIOnly) import OpenSwiftUICore
10
+ package import OpenGraphShims
12
11
13
- struct CachedEnvironment {
14
- var environment : Attribute < EnvironmentValues >
12
+ package struct CachedEnvironment {
13
+ package var environment : Attribute < EnvironmentValues >
15
14
private var items : [ Item ]
16
15
#if canImport(Darwin)
17
16
private var constants : [ HashableConstant : AnyAttribute ]
18
17
#endif
19
- private var animatedFrame : AnimatedFrame ?
18
+ // private var animatedFrame: AnimatedFrame?
20
19
// private var resolvedFgStyles: [ResolvedFgStyle : Swift<_ShapeStyle_Resolved.ResolvedFg>]
21
20
22
- init ( _ environment: Attribute < EnvironmentValues > ) {
21
+ package init ( _ environment: Attribute < EnvironmentValues > ) {
23
22
self . environment = environment
24
23
items = [ ]
25
24
#if canImport(Darwin)
26
25
constants = [ : ]
27
26
#endif
28
- animatedFrame = nil
27
+ // animatedFrame = nil
29
28
// resolvedFgStyles = [:]
30
29
}
31
30
32
- mutating func attribute< Value> ( keyPath: KeyPath < EnvironmentValues , Value > ) -> Attribute < Value > {
31
+ package mutating func attribute< Value> ( keyPath: KeyPath < EnvironmentValues , Value > ) -> Attribute < Value > {
33
32
#if canImport(Darwin)
34
33
if let item = items. first ( where: { $0. key == keyPath } ) {
35
34
return Attribute ( identifier: item. value)
@@ -43,7 +42,7 @@ struct CachedEnvironment {
43
42
#endif
44
43
}
45
44
46
- mutating func intern< Value> ( _ value: Value , id: Int ) -> Attribute < Value > {
45
+ package mutating func intern< Value> ( _ value: Value , id: Int ) -> Attribute < Value > {
47
46
#if canImport(Darwin)
48
47
let constant = HashableConstant ( value, id: id)
49
48
if let identifier = constants [ constant] {
@@ -58,13 +57,13 @@ struct CachedEnvironment {
58
57
#endif
59
58
}
60
59
61
- func animatePosition( for inputs: _ViewInputs ) -> Attribute < ViewOrigin > {
62
- fatalError ( " TODO " )
63
- }
64
-
65
- func animateSize( for inputs: _ViewInputs ) -> Attribute < ViewSize > {
66
- fatalError ( " TODO " )
67
- }
60
+ // func animatePosition(for inputs: _ViewInputs) -> Attribute<ViewOrigin> {
61
+ // fatalError("TODO")
62
+ // }
63
+ //
64
+ // func animateSize(for inputs: _ViewInputs) -> Attribute<ViewSize> {
65
+ // fatalError("TODO")
66
+ // }
68
67
69
68
// func resolvedForegroundStyle() {}
70
69
}
@@ -119,40 +118,40 @@ private struct HashableConstant: Hashable {
119
118
}
120
119
}
121
120
122
- private struct AnimatedFrame {
123
- let position : Attribute < ViewOrigin >
124
- let size : Attribute < ViewSize >
125
- let pixelLength : Attribute < CGFloat >
126
- let time : Attribute < Time >
127
- let transaction : Attribute < Transaction >
128
- let viewPhase : Attribute < _GraphInputs . Phase >
129
- let animatedFrame : Attribute < ViewFrame >
130
- private var _animatedPosition : Attribute < ViewOrigin > ?
131
- private var _animatedSize : Attribute < ViewSize > ?
132
-
133
- mutating func animatePosition( ) -> Attribute < ViewOrigin > {
134
- guard let _animatedPosition else {
135
- // FIXME
136
- let animatePosition = animatedFrame. unsafeOffset (
137
- at: 0 ,
138
- as: ViewOrigin . self
139
- )
140
- _animatedPosition = animatePosition
141
- return animatePosition
142
- }
143
- return _animatedPosition
144
- }
145
-
146
- mutating func animateSize( ) -> Attribute < ViewSize > {
147
- guard let _animatedSize else {
148
- // FIXME
149
- let animatedSize = animatedFrame. unsafeOffset (
150
- at: MemoryLayout< ViewOrigin> . size,
151
- as: ViewSize . self
152
- )
153
- _animatedSize = animatedSize
154
- return animatedSize
155
- }
156
- return _animatedSize
157
- }
158
- }
121
+ // private struct AnimatedFrame {
122
+ // let position: Attribute<ViewOrigin>
123
+ // let size: Attribute<ViewSize>
124
+ // let pixelLength: Attribute<CGFloat>
125
+ // let time: Attribute<Time>
126
+ // let transaction: Attribute<Transaction>
127
+ // let viewPhase: Attribute<_GraphInputs.Phase>
128
+ // let animatedFrame: Attribute<ViewFrame>
129
+ // private var _animatedPosition: Attribute<ViewOrigin>?
130
+ // private var _animatedSize: Attribute<ViewSize>?
131
+ //
132
+ // mutating func animatePosition() -> Attribute<ViewOrigin> {
133
+ // guard let _animatedPosition else {
134
+ // // FIXME
135
+ // let animatePosition = animatedFrame.unsafeOffset(
136
+ // at: 0,
137
+ // as:ViewOrigin.self
138
+ // )
139
+ // _animatedPosition = animatePosition
140
+ // return animatePosition
141
+ // }
142
+ // return _animatedPosition
143
+ // }
144
+ //
145
+ // mutating func animateSize() -> Attribute<ViewSize> {
146
+ // guard let _animatedSize else {
147
+ // // FIXME
148
+ // let animatedSize = animatedFrame.unsafeOffset(
149
+ // at: MemoryLayout<ViewOrigin>.size,
150
+ // as: ViewSize.self
151
+ // )
152
+ // _animatedSize = animatedSize
153
+ // return animatedSize
154
+ // }
155
+ // return _animatedSize
156
+ // }
157
+ // }
0 commit comments