react-native-windows 0.0.0-canary.445 → 0.0.0-canary.449
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.flowconfig +1 -4
- package/Directory.Build.targets +15 -4
- package/Libraries/Animated/AnimatedEvent.js +10 -5
- package/Libraries/Animated/AnimatedPlatformConfig.js +13 -0
- package/Libraries/Animated/Easing.js +36 -36
- package/Libraries/Animated/animations/Animation.js +5 -3
- package/Libraries/Animated/animations/DecayAnimation.js +5 -0
- package/Libraries/Animated/animations/SpringAnimation.js +5 -0
- package/Libraries/Animated/animations/TimingAnimation.js +4 -1
- package/Libraries/Animated/nodes/AnimatedAddition.js +5 -4
- package/Libraries/Animated/nodes/AnimatedDiffClamp.js +4 -3
- package/Libraries/Animated/nodes/AnimatedDivision.js +5 -4
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +5 -3
- package/Libraries/Animated/nodes/AnimatedModulo.js +4 -3
- package/Libraries/Animated/nodes/AnimatedMultiplication.js +5 -4
- package/Libraries/Animated/nodes/AnimatedNode.js +17 -5
- package/Libraries/Animated/nodes/AnimatedProps.js +11 -3
- package/Libraries/Animated/nodes/AnimatedStyle.js +6 -4
- package/Libraries/Animated/nodes/AnimatedSubtraction.js +5 -4
- package/Libraries/Animated/nodes/AnimatedTracking.js +7 -5
- package/Libraries/Animated/nodes/AnimatedTransform.js +5 -3
- package/Libraries/Animated/nodes/AnimatedValue.js +2 -0
- package/Libraries/Animated/nodes/AnimatedWithChildren.js +5 -4
- package/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js +2 -2
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +3 -3
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js +2 -0
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +12 -0
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +133 -68
- package/Libraries/Components/Slider/SliderNativeComponent.js +2 -2
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +115 -2
- package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +8 -4
- package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +4 -4
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +31 -8
- package/Libraries/Components/Touchable/TouchableOpacity.js +0 -1
- package/Libraries/Components/Touchable/TouchableOpacity.windows.js +0 -1
- package/Libraries/Components/View/ViewPropTypes.js +7 -0
- package/Libraries/Components/View/ViewPropTypes.windows.js +7 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/ReactNativeVersionCheck.js +1 -0
- package/Libraries/Core/Timers/JSTimers.js +17 -28
- package/Libraries/Image/Image.android.js +16 -7
- package/Libraries/Image/ImageViewNativeComponent.js +94 -57
- package/Libraries/Image/TextInlineImageNativeComponent.js +11 -69
- package/Libraries/Lists/VirtualizedList.js +8 -6
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +0 -1
- package/Libraries/NativeComponent/NativeComponentRegistry.js +1 -19
- package/Libraries/NativeComponent/NativeComponentRegistryUnstable.js +27 -0
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +39 -0
- package/Libraries/Network/XMLHttpRequest.js +0 -1
- package/Libraries/Performance/QuickPerformanceLogger.js +17 -0
- package/Libraries/ReactNative/DummyUIManager.js +12 -5
- package/Libraries/ReactNative/UIManager.js +4 -6
- package/Libraries/ReactNative/UIManagerInjection.js +3 -1
- package/Libraries/ReactNative/getNativeComponentAttributes.js +4 -0
- package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +279 -360
- package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +93 -86
- package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +346 -401
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +279 -359
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +88 -79
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +341 -394
- package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +2 -0
- package/Microsoft.ReactNative/ABIViewManager.cpp +10 -1
- package/Microsoft.ReactNative/ABIViewManager.h +4 -0
- package/Microsoft.ReactNative/IViewManager.idl +7 -0
- package/Microsoft.ReactNative/Modules/Animated/CalculatedAnimationDriver.cpp +2 -2
- package/Microsoft.ReactNative/Modules/Animated/InterpolationAnimatedNode.cpp +1 -1
- package/Microsoft.ReactNative/Views/ShadowNodeBase.cpp +1 -0
- package/Microsoft.ReactNative/Views/TouchEventHandler.cpp +4 -9
- package/Microsoft.ReactNative/Views/ViewManagerBase.h +2 -0
- package/Microsoft.ReactNative.Cxx/NativeModules.h +1 -1
- package/PropertySheets/External/Microsoft.ReactNative.Common.targets +15 -4
- package/PropertySheets/Generated/PackageVersion.g.props +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/mapbuffer/MapBuffer.cpp +128 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/mapbuffer/MapBuffer.h +150 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/mapbuffer/MapBufferBuilder.cpp +149 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/mapbuffer/MapBufferBuilder.h +59 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/mapbuffer/tests/MapBufferTest.cpp +167 -0
- package/codegen/react/components/rnwcore/Props.cpp +2 -2
- package/codegen/react/components/rnwcore/Props.h +1 -1
- package/jest/mockModal.js +2 -2
- package/package.json +10 -10
- package/Libraries/Components/TextInput/AndroidTextInputViewConfig.js +0 -113
- package/Libraries/Core/ReactNativeVersionCheck.windows.js +0 -57
- package/Libraries/DeprecatedPropTypes/DeprecatedColorPropType.js +0 -76
- package/Libraries/DeprecatedPropTypes/DeprecatedEdgeInsetsPropType.js +0 -28
- package/Libraries/DeprecatedPropTypes/DeprecatedImagePropType.android.js +0 -131
- package/Libraries/DeprecatedPropTypes/DeprecatedImagePropType.ios.js +0 -82
- package/Libraries/DeprecatedPropTypes/DeprecatedImagePropType.windows.js +0 -82
- package/Libraries/DeprecatedPropTypes/DeprecatedImageSourcePropType.js +0 -40
- package/Libraries/DeprecatedPropTypes/DeprecatedImageStylePropTypes.js +0 -76
- package/Libraries/DeprecatedPropTypes/DeprecatedLayoutPropTypes.js +0 -233
- package/Libraries/DeprecatedPropTypes/DeprecatedPointPropType.js +0 -24
- package/Libraries/DeprecatedPropTypes/DeprecatedShadowPropTypesIOS.js +0 -30
- package/Libraries/DeprecatedPropTypes/DeprecatedStyleSheetPropType.js +0 -32
- package/Libraries/DeprecatedPropTypes/DeprecatedTextInputPropTypes.js +0 -693
- package/Libraries/DeprecatedPropTypes/DeprecatedTextPropTypes.js +0 -158
- package/Libraries/DeprecatedPropTypes/DeprecatedTextStylePropTypes.js +0 -157
- package/Libraries/DeprecatedPropTypes/DeprecatedTransformPropTypes.js +0 -99
- package/Libraries/DeprecatedPropTypes/DeprecatedViewAccessibility.js +0 -46
- package/Libraries/DeprecatedPropTypes/DeprecatedViewAccessibility.windows.js +0 -72
- package/Libraries/DeprecatedPropTypes/DeprecatedViewPropTypes.js +0 -408
- package/Libraries/DeprecatedPropTypes/DeprecatedViewStylePropTypes.js +0 -68
- package/Libraries/DeprecatedPropTypes/deprecatedCreateStrictShapeTypeChecker.js +0 -86
package/.flowconfig
CHANGED
|
@@ -59,9 +59,6 @@
|
|
|
59
59
|
; Ignore the src folder - flow files are combined with ones from react-native into the root Libraries folder
|
|
60
60
|
.*/vnext/src/.*
|
|
61
61
|
|
|
62
|
-
; Ignore files with flow typing issues #9223
|
|
63
|
-
.*/vnext/Libraries/Core/ReactNativeVersionCheck.js
|
|
64
|
-
|
|
65
62
|
[untyped]
|
|
66
63
|
.*/node_modules/@react-native-community/cli/.*/.*
|
|
67
64
|
|
|
@@ -121,4 +118,4 @@ untyped-import
|
|
|
121
118
|
untyped-type-import
|
|
122
119
|
|
|
123
120
|
[version]
|
|
124
|
-
^0.
|
|
121
|
+
^0.170.0
|
package/Directory.Build.targets
CHANGED
|
@@ -4,10 +4,21 @@
|
|
|
4
4
|
<!-- This import will noop when customer code is built. This import is here to help building the bits in the react-native-windows repository. -->
|
|
5
5
|
<Import Condition="Exists($([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../')))" Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" />
|
|
6
6
|
|
|
7
|
-
<!--Allow implicitly restoring
|
|
8
|
-
<Target Name="BeforeResolveReferences" Condition="'$(BuildingInsideVisualStudio)' == 'true'">
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
<!--Allow implicitly restoring NuGet dependencies in C++ projects using the Visual Studio IDE.-->
|
|
8
|
+
<Target Name="BeforeResolveReferences" Condition="'$(BuildingInsideVisualStudio)' == 'true' AND '$(MSBuildProjectExtension)' == '.vcxproj'">
|
|
9
|
+
<!--
|
|
10
|
+
Ensure restoring of PackageReference dependencies.
|
|
11
|
+
-->
|
|
12
|
+
<MSBuild Projects="$(MSBuildProjectFile)" Targets="Restore" Properties="RestoreProjectStyle=PackageReference" />
|
|
13
|
+
|
|
14
|
+
<!--
|
|
15
|
+
Ensure restoring of packages.config dependencies.
|
|
16
|
+
|
|
17
|
+
RestoreProjectStyle=PackagesConfig - Required to use the packages.config mechanism
|
|
18
|
+
RestorePackagesConfig=true - Required to use the packages.config mechanism
|
|
19
|
+
RestoreUseStaticGraphEvaluation=false - Override setting from Directory.Build.props
|
|
20
|
+
-->
|
|
21
|
+
<MSBuild Projects="$(MSBuildProjectFile)" Targets="Restore" Properties="RestoreProjectStyle=PackagesConfig;RestorePackagesConfig=true;RestoreUseStaticGraphEvaluation=false" />
|
|
11
22
|
</Target>
|
|
12
23
|
|
|
13
24
|
</Project>
|
|
@@ -19,6 +19,8 @@ const invariant = require('invariant');
|
|
|
19
19
|
|
|
20
20
|
const {shouldUseNativeDriver} = require('./NativeAnimatedHelper');
|
|
21
21
|
|
|
22
|
+
import type {PlatformConfig} from './AnimatedPlatformConfig';
|
|
23
|
+
|
|
22
24
|
export type Mapping =
|
|
23
25
|
| {[key: string]: Mapping, ...}
|
|
24
26
|
| AnimatedValue
|
|
@@ -26,12 +28,14 @@ export type Mapping =
|
|
|
26
28
|
export type EventConfig = {
|
|
27
29
|
listener?: ?Function,
|
|
28
30
|
useNativeDriver: boolean,
|
|
31
|
+
platformConfig?: PlatformConfig,
|
|
29
32
|
};
|
|
30
33
|
|
|
31
34
|
function attachNativeEvent(
|
|
32
35
|
viewRef: any,
|
|
33
36
|
eventName: string,
|
|
34
37
|
argMapping: $ReadOnlyArray<?Mapping>,
|
|
38
|
+
platformConfig: ?PlatformConfig,
|
|
35
39
|
): {detach: () => void} {
|
|
36
40
|
// Find animated values in `argMapping` and create an array representing their
|
|
37
41
|
// key path inside the `nativeEvent` object. Ex.: ['contentOffset', 'x'].
|
|
@@ -39,7 +43,7 @@ function attachNativeEvent(
|
|
|
39
43
|
|
|
40
44
|
const traverse = (value, path) => {
|
|
41
45
|
if (value instanceof AnimatedValue) {
|
|
42
|
-
value.__makeNative();
|
|
46
|
+
value.__makeNative(platformConfig);
|
|
43
47
|
|
|
44
48
|
eventMappings.push({
|
|
45
49
|
nativeEventPath: path,
|
|
@@ -145,9 +149,9 @@ function validateMapping(argMapping, args) {
|
|
|
145
149
|
class AnimatedEvent {
|
|
146
150
|
_argMapping: $ReadOnlyArray<?Mapping>;
|
|
147
151
|
_listeners: Array<Function> = [];
|
|
148
|
-
_callListeners: Function;
|
|
149
152
|
_attachedEvent: ?{detach: () => void, ...};
|
|
150
153
|
__isNative: boolean;
|
|
154
|
+
__platformConfig: ?PlatformConfig;
|
|
151
155
|
|
|
152
156
|
constructor(argMapping: $ReadOnlyArray<?Mapping>, config: EventConfig) {
|
|
153
157
|
this._argMapping = argMapping;
|
|
@@ -160,9 +164,9 @@ class AnimatedEvent {
|
|
|
160
164
|
if (config.listener) {
|
|
161
165
|
this.__addListener(config.listener);
|
|
162
166
|
}
|
|
163
|
-
this._callListeners = this._callListeners.bind(this);
|
|
164
167
|
this._attachedEvent = null;
|
|
165
168
|
this.__isNative = shouldUseNativeDriver(config);
|
|
169
|
+
this.__platformConfig = config.platformConfig;
|
|
166
170
|
}
|
|
167
171
|
|
|
168
172
|
__addListener(callback: Function): void {
|
|
@@ -183,6 +187,7 @@ class AnimatedEvent {
|
|
|
183
187
|
viewRef,
|
|
184
188
|
eventName,
|
|
185
189
|
this._argMapping,
|
|
190
|
+
this.__platformConfig,
|
|
186
191
|
);
|
|
187
192
|
}
|
|
188
193
|
|
|
@@ -245,9 +250,9 @@ class AnimatedEvent {
|
|
|
245
250
|
};
|
|
246
251
|
}
|
|
247
252
|
|
|
248
|
-
_callListeners(...args: any) {
|
|
253
|
+
_callListeners = (...args: any) => {
|
|
249
254
|
this._listeners.forEach(listener => listener(...args));
|
|
250
|
-
}
|
|
255
|
+
};
|
|
251
256
|
}
|
|
252
257
|
|
|
253
258
|
module.exports = {AnimatedEvent, attachNativeEvent};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
export type PlatformConfig = {};
|
|
@@ -57,20 +57,20 @@ let ease;
|
|
|
57
57
|
* - [`inOut`](docs/easing.html#inout) makes any easing function symmetrical
|
|
58
58
|
* - [`out`](docs/easing.html#out) runs an easing function backwards
|
|
59
59
|
*/
|
|
60
|
-
|
|
60
|
+
const Easing = {
|
|
61
61
|
/**
|
|
62
62
|
* A stepping function, returns 1 for any positive value of `n`.
|
|
63
63
|
*/
|
|
64
|
-
|
|
64
|
+
step0(n: number): number {
|
|
65
65
|
return n > 0 ? 1 : 0;
|
|
66
|
-
}
|
|
66
|
+
},
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* A stepping function, returns 1 if `n` is greater than or equal to 1.
|
|
70
70
|
*/
|
|
71
|
-
|
|
71
|
+
step1(n: number): number {
|
|
72
72
|
return n >= 1 ? 1 : 0;
|
|
73
|
-
}
|
|
73
|
+
},
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* A linear function, `f(t) = t`. Position correlates to elapsed time one to
|
|
@@ -78,9 +78,9 @@ class Easing {
|
|
|
78
78
|
*
|
|
79
79
|
* http://cubic-bezier.com/#0,0,1,1
|
|
80
80
|
*/
|
|
81
|
-
|
|
81
|
+
linear(t: number): number {
|
|
82
82
|
return t;
|
|
83
|
-
}
|
|
83
|
+
},
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* A simple inertial interaction, similar to an object slowly accelerating to
|
|
@@ -88,12 +88,12 @@ class Easing {
|
|
|
88
88
|
*
|
|
89
89
|
* http://cubic-bezier.com/#.42,0,1,1
|
|
90
90
|
*/
|
|
91
|
-
|
|
91
|
+
ease(t: number): number {
|
|
92
92
|
if (!ease) {
|
|
93
93
|
ease = Easing.bezier(0.42, 0, 1, 1);
|
|
94
94
|
}
|
|
95
95
|
return ease(t);
|
|
96
|
-
}
|
|
96
|
+
},
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
99
|
* A quadratic function, `f(t) = t * t`. Position equals the square of elapsed
|
|
@@ -101,9 +101,9 @@ class Easing {
|
|
|
101
101
|
*
|
|
102
102
|
* http://easings.net/#easeInQuad
|
|
103
103
|
*/
|
|
104
|
-
|
|
104
|
+
quad(t: number): number {
|
|
105
105
|
return t * t;
|
|
106
|
-
}
|
|
106
|
+
},
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
109
|
* A cubic function, `f(t) = t * t * t`. Position equals the cube of elapsed
|
|
@@ -111,9 +111,9 @@ class Easing {
|
|
|
111
111
|
*
|
|
112
112
|
* http://easings.net/#easeInCubic
|
|
113
113
|
*/
|
|
114
|
-
|
|
114
|
+
cubic(t: number): number {
|
|
115
115
|
return t * t * t;
|
|
116
|
-
}
|
|
116
|
+
},
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
119
|
* A power function. Position is equal to the Nth power of elapsed time.
|
|
@@ -121,36 +121,36 @@ class Easing {
|
|
|
121
121
|
* n = 4: http://easings.net/#easeInQuart
|
|
122
122
|
* n = 5: http://easings.net/#easeInQuint
|
|
123
123
|
*/
|
|
124
|
-
|
|
124
|
+
poly(n: number): (t: number) => number {
|
|
125
125
|
return (t: number) => Math.pow(t, n);
|
|
126
|
-
}
|
|
126
|
+
},
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
129
|
* A sinusoidal function.
|
|
130
130
|
*
|
|
131
131
|
* http://easings.net/#easeInSine
|
|
132
132
|
*/
|
|
133
|
-
|
|
133
|
+
sin(t: number): number {
|
|
134
134
|
return 1 - Math.cos((t * Math.PI) / 2);
|
|
135
|
-
}
|
|
135
|
+
},
|
|
136
136
|
|
|
137
137
|
/**
|
|
138
138
|
* A circular function.
|
|
139
139
|
*
|
|
140
140
|
* http://easings.net/#easeInCirc
|
|
141
141
|
*/
|
|
142
|
-
|
|
142
|
+
circle(t: number): number {
|
|
143
143
|
return 1 - Math.sqrt(1 - t * t);
|
|
144
|
-
}
|
|
144
|
+
},
|
|
145
145
|
|
|
146
146
|
/**
|
|
147
147
|
* An exponential function.
|
|
148
148
|
*
|
|
149
149
|
* http://easings.net/#easeInExpo
|
|
150
150
|
*/
|
|
151
|
-
|
|
151
|
+
exp(t: number): number {
|
|
152
152
|
return Math.pow(2, 10 * (t - 1));
|
|
153
|
-
}
|
|
153
|
+
},
|
|
154
154
|
|
|
155
155
|
/**
|
|
156
156
|
* A simple elastic interaction, similar to a spring oscillating back and
|
|
@@ -162,10 +162,10 @@ class Easing {
|
|
|
162
162
|
*
|
|
163
163
|
* http://easings.net/#easeInElastic
|
|
164
164
|
*/
|
|
165
|
-
|
|
165
|
+
elastic(bounciness: number = 1): (t: number) => number {
|
|
166
166
|
const p = bounciness * Math.PI;
|
|
167
167
|
return t => 1 - Math.pow(Math.cos((t * Math.PI) / 2), 3) * Math.cos(t * p);
|
|
168
|
-
}
|
|
168
|
+
},
|
|
169
169
|
|
|
170
170
|
/**
|
|
171
171
|
* Use with `Animated.parallel()` to create a simple effect where the object
|
|
@@ -173,16 +173,16 @@ class Easing {
|
|
|
173
173
|
*
|
|
174
174
|
* https://easings.net/#easeInBack
|
|
175
175
|
*/
|
|
176
|
-
|
|
176
|
+
back(s: number = 1.70158): (t: number) => number {
|
|
177
177
|
return t => t * t * ((s + 1) * t - s);
|
|
178
|
-
}
|
|
178
|
+
},
|
|
179
179
|
|
|
180
180
|
/**
|
|
181
181
|
* Provides a simple bouncing effect.
|
|
182
182
|
*
|
|
183
183
|
* http://easings.net/#easeInBounce
|
|
184
184
|
*/
|
|
185
|
-
|
|
185
|
+
bounce(t: number): number {
|
|
186
186
|
if (t < 1 / 2.75) {
|
|
187
187
|
return 7.5625 * t * t;
|
|
188
188
|
}
|
|
@@ -199,7 +199,7 @@ class Easing {
|
|
|
199
199
|
|
|
200
200
|
const t2 = t - 2.625 / 2.75;
|
|
201
201
|
return 7.5625 * t2 * t2 + 0.984375;
|
|
202
|
-
}
|
|
202
|
+
},
|
|
203
203
|
|
|
204
204
|
/**
|
|
205
205
|
* Provides a cubic bezier curve, equivalent to CSS Transitions'
|
|
@@ -208,7 +208,7 @@ class Easing {
|
|
|
208
208
|
* A useful tool to visualize cubic bezier curves can be found at
|
|
209
209
|
* http://cubic-bezier.com/
|
|
210
210
|
*/
|
|
211
|
-
|
|
211
|
+
bezier(
|
|
212
212
|
x1: number,
|
|
213
213
|
y1: number,
|
|
214
214
|
x2: number,
|
|
@@ -216,35 +216,35 @@ class Easing {
|
|
|
216
216
|
): (t: number) => number {
|
|
217
217
|
const _bezier = require('./bezier');
|
|
218
218
|
return _bezier(x1, y1, x2, y2);
|
|
219
|
-
}
|
|
219
|
+
},
|
|
220
220
|
|
|
221
221
|
/**
|
|
222
222
|
* Runs an easing function forwards.
|
|
223
223
|
*/
|
|
224
|
-
|
|
224
|
+
in(easing: (t: number) => number): (t: number) => number {
|
|
225
225
|
return easing;
|
|
226
|
-
}
|
|
226
|
+
},
|
|
227
227
|
|
|
228
228
|
/**
|
|
229
229
|
* Runs an easing function backwards.
|
|
230
230
|
*/
|
|
231
|
-
|
|
231
|
+
out(easing: (t: number) => number): (t: number) => number {
|
|
232
232
|
return t => 1 - easing(1 - t);
|
|
233
|
-
}
|
|
233
|
+
},
|
|
234
234
|
|
|
235
235
|
/**
|
|
236
236
|
* Makes any easing function symmetrical. The easing function will run
|
|
237
237
|
* forwards for half of the duration, then backwards for the rest of the
|
|
238
238
|
* duration.
|
|
239
239
|
*/
|
|
240
|
-
|
|
240
|
+
inOut(easing: (t: number) => number): (t: number) => number {
|
|
241
241
|
return t => {
|
|
242
242
|
if (t < 0.5) {
|
|
243
243
|
return easing(t * 2) / 2;
|
|
244
244
|
}
|
|
245
245
|
return 1 - easing((1 - t) * 2) / 2;
|
|
246
246
|
};
|
|
247
|
-
}
|
|
248
|
-
}
|
|
247
|
+
},
|
|
248
|
+
};
|
|
249
249
|
|
|
250
250
|
module.exports = Easing;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
13
|
const NativeAnimatedHelper = require('../NativeAnimatedHelper');
|
|
14
|
-
|
|
14
|
+
import type {PlatformConfig} from '../AnimatedPlatformConfig';
|
|
15
15
|
import type AnimatedValue from '../nodes/AnimatedValue';
|
|
16
16
|
|
|
17
17
|
export type EndResult = {finished: boolean, ...};
|
|
@@ -20,6 +20,7 @@ export type EndCallback = (result: EndResult) => void;
|
|
|
20
20
|
export type AnimationConfig = {
|
|
21
21
|
isInteraction?: boolean,
|
|
22
22
|
useNativeDriver: boolean,
|
|
23
|
+
platformConfig?: PlatformConfig,
|
|
23
24
|
onComplete?: ?EndCallback,
|
|
24
25
|
iterations?: number,
|
|
25
26
|
};
|
|
@@ -65,12 +66,13 @@ class Animation {
|
|
|
65
66
|
startNativeAnimationWaitId,
|
|
66
67
|
);
|
|
67
68
|
try {
|
|
68
|
-
|
|
69
|
+
const config = this.__getNativeAnimationConfig();
|
|
70
|
+
animatedValue.__makeNative(config.platformConfig);
|
|
69
71
|
this.__nativeId = NativeAnimatedHelper.generateNewAnimationId();
|
|
70
72
|
NativeAnimatedHelper.API.startAnimatingNode(
|
|
71
73
|
this.__nativeId,
|
|
72
74
|
animatedValue.__getNativeTag(),
|
|
73
|
-
|
|
75
|
+
config,
|
|
74
76
|
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
|
|
75
77
|
this.__debouncedOnEnd.bind(this),
|
|
76
78
|
);
|
|
@@ -14,6 +14,7 @@ const Animation = require('./Animation');
|
|
|
14
14
|
|
|
15
15
|
const {shouldUseNativeDriver} = require('../NativeAnimatedHelper');
|
|
16
16
|
|
|
17
|
+
import type {PlatformConfig} from '../AnimatedPlatformConfig';
|
|
17
18
|
import type AnimatedValue from '../nodes/AnimatedValue';
|
|
18
19
|
import type {AnimationConfig, EndCallback} from './Animation';
|
|
19
20
|
|
|
@@ -44,12 +45,14 @@ class DecayAnimation extends Animation {
|
|
|
44
45
|
_onUpdate: (value: number) => void;
|
|
45
46
|
_animationFrame: any;
|
|
46
47
|
_useNativeDriver: boolean;
|
|
48
|
+
_platformConfig: ?PlatformConfig;
|
|
47
49
|
|
|
48
50
|
constructor(config: DecayAnimationConfigSingle) {
|
|
49
51
|
super();
|
|
50
52
|
this._deceleration = config.deceleration ?? 0.998;
|
|
51
53
|
this._velocity = config.velocity;
|
|
52
54
|
this._useNativeDriver = shouldUseNativeDriver(config);
|
|
55
|
+
this._platformConfig = config.platformConfig;
|
|
53
56
|
this.__isInteraction = config.isInteraction ?? !this._useNativeDriver;
|
|
54
57
|
this.__iterations = config.iterations ?? 1;
|
|
55
58
|
}
|
|
@@ -57,6 +60,7 @@ class DecayAnimation extends Animation {
|
|
|
57
60
|
__getNativeAnimationConfig(): {|
|
|
58
61
|
deceleration: number,
|
|
59
62
|
iterations: number,
|
|
63
|
+
platformConfig: ?PlatformConfig,
|
|
60
64
|
type: $TEMPORARY$string<'decay'>,
|
|
61
65
|
velocity: number,
|
|
62
66
|
|} {
|
|
@@ -65,6 +69,7 @@ class DecayAnimation extends Animation {
|
|
|
65
69
|
deceleration: this._deceleration,
|
|
66
70
|
velocity: this._velocity,
|
|
67
71
|
iterations: this.__iterations,
|
|
72
|
+
platformConfig: this._platformConfig,
|
|
68
73
|
};
|
|
69
74
|
}
|
|
70
75
|
|
|
@@ -20,6 +20,7 @@ const invariant = require('invariant');
|
|
|
20
20
|
|
|
21
21
|
const {shouldUseNativeDriver} = require('../NativeAnimatedHelper');
|
|
22
22
|
|
|
23
|
+
import type {PlatformConfig} from '../AnimatedPlatformConfig';
|
|
23
24
|
import type {AnimationConfig, EndCallback} from './Animation';
|
|
24
25
|
|
|
25
26
|
export type SpringAnimationConfig = {
|
|
@@ -92,6 +93,7 @@ class SpringAnimation extends Animation {
|
|
|
92
93
|
_onUpdate: (value: number) => void;
|
|
93
94
|
_animationFrame: any;
|
|
94
95
|
_useNativeDriver: boolean;
|
|
96
|
+
_platformConfig: ?PlatformConfig;
|
|
95
97
|
|
|
96
98
|
constructor(config: SpringAnimationConfigSingle) {
|
|
97
99
|
super();
|
|
@@ -104,6 +106,7 @@ class SpringAnimation extends Animation {
|
|
|
104
106
|
this._toValue = config.toValue;
|
|
105
107
|
this._delay = config.delay ?? 0;
|
|
106
108
|
this._useNativeDriver = shouldUseNativeDriver(config);
|
|
109
|
+
this._platformConfig = config.platformConfig;
|
|
107
110
|
this.__isInteraction = config.isInteraction ?? !this._useNativeDriver;
|
|
108
111
|
this.__iterations = config.iterations ?? 1;
|
|
109
112
|
|
|
@@ -162,6 +165,7 @@ class SpringAnimation extends Animation {
|
|
|
162
165
|
initialVelocity: number,
|
|
163
166
|
iterations: number,
|
|
164
167
|
mass: number,
|
|
168
|
+
platformConfig: ?PlatformConfig,
|
|
165
169
|
overshootClamping: boolean,
|
|
166
170
|
restDisplacementThreshold: number,
|
|
167
171
|
restSpeedThreshold: number,
|
|
@@ -180,6 +184,7 @@ class SpringAnimation extends Animation {
|
|
|
180
184
|
initialVelocity: this._initialVelocity ?? this._lastVelocity,
|
|
181
185
|
toValue: this._toValue,
|
|
182
186
|
iterations: this.__iterations,
|
|
187
|
+
platformConfig: this._platformConfig,
|
|
183
188
|
};
|
|
184
189
|
}
|
|
185
190
|
|
|
@@ -17,6 +17,7 @@ const Animation = require('./Animation');
|
|
|
17
17
|
|
|
18
18
|
const {shouldUseNativeDriver} = require('../NativeAnimatedHelper');
|
|
19
19
|
|
|
20
|
+
import type {PlatformConfig} from '../AnimatedPlatformConfig';
|
|
20
21
|
import type {AnimationConfig, EndCallback} from './Animation';
|
|
21
22
|
|
|
22
23
|
export type TimingAnimationConfig = {
|
|
@@ -48,7 +49,6 @@ let _easeInOut;
|
|
|
48
49
|
function easeInOut() {
|
|
49
50
|
if (!_easeInOut) {
|
|
50
51
|
const Easing = require('../Easing');
|
|
51
|
-
// $FlowFixMe[method-unbinding]
|
|
52
52
|
_easeInOut = Easing.inOut(Easing.ease);
|
|
53
53
|
}
|
|
54
54
|
return _easeInOut;
|
|
@@ -65,6 +65,7 @@ class TimingAnimation extends Animation {
|
|
|
65
65
|
_animationFrame: any;
|
|
66
66
|
_timeout: any;
|
|
67
67
|
_useNativeDriver: boolean;
|
|
68
|
+
_platformConfig: ?PlatformConfig;
|
|
68
69
|
|
|
69
70
|
constructor(config: TimingAnimationConfigSingle) {
|
|
70
71
|
super();
|
|
@@ -74,6 +75,7 @@ class TimingAnimation extends Animation {
|
|
|
74
75
|
this._delay = config.delay ?? 0;
|
|
75
76
|
this.__iterations = config.iterations ?? 1;
|
|
76
77
|
this._useNativeDriver = shouldUseNativeDriver(config);
|
|
78
|
+
this._platformConfig = config.platformConfig;
|
|
77
79
|
this.__isInteraction = config.isInteraction ?? !this._useNativeDriver;
|
|
78
80
|
}
|
|
79
81
|
|
|
@@ -90,6 +92,7 @@ class TimingAnimation extends Animation {
|
|
|
90
92
|
frames,
|
|
91
93
|
toValue: this._toValue,
|
|
92
94
|
iterations: this.__iterations,
|
|
95
|
+
platformConfig: this._platformConfig,
|
|
93
96
|
};
|
|
94
97
|
}
|
|
95
98
|
|
|
@@ -15,6 +15,7 @@ const AnimatedNode = require('./AnimatedNode');
|
|
|
15
15
|
const AnimatedValue = require('./AnimatedValue');
|
|
16
16
|
const AnimatedWithChildren = require('./AnimatedWithChildren');
|
|
17
17
|
|
|
18
|
+
import type {PlatformConfig} from '../AnimatedPlatformConfig';
|
|
18
19
|
import type {InterpolationConfigType} from './AnimatedInterpolation';
|
|
19
20
|
|
|
20
21
|
class AnimatedAddition extends AnimatedWithChildren {
|
|
@@ -27,10 +28,10 @@ class AnimatedAddition extends AnimatedWithChildren {
|
|
|
27
28
|
this._b = typeof b === 'number' ? new AnimatedValue(b) : b;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
__makeNative() {
|
|
31
|
-
this._a.__makeNative();
|
|
32
|
-
this._b.__makeNative();
|
|
33
|
-
super.__makeNative();
|
|
31
|
+
__makeNative(platformConfig: ?PlatformConfig) {
|
|
32
|
+
this._a.__makeNative(platformConfig);
|
|
33
|
+
this._b.__makeNative(platformConfig);
|
|
34
|
+
super.__makeNative(platformConfig);
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
__getValue(): number {
|
|
@@ -15,6 +15,7 @@ const AnimatedNode = require('./AnimatedNode');
|
|
|
15
15
|
const AnimatedWithChildren = require('./AnimatedWithChildren');
|
|
16
16
|
|
|
17
17
|
import type {InterpolationConfigType} from './AnimatedInterpolation';
|
|
18
|
+
import type {PlatformConfig} from '../AnimatedPlatformConfig';
|
|
18
19
|
|
|
19
20
|
class AnimatedDiffClamp extends AnimatedWithChildren {
|
|
20
21
|
_a: AnimatedNode;
|
|
@@ -32,9 +33,9 @@ class AnimatedDiffClamp extends AnimatedWithChildren {
|
|
|
32
33
|
this._value = this._lastValue = this._a.__getValue();
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
__makeNative() {
|
|
36
|
-
this._a.__makeNative();
|
|
37
|
-
super.__makeNative();
|
|
36
|
+
__makeNative(platformConfig: ?PlatformConfig) {
|
|
37
|
+
this._a.__makeNative(platformConfig);
|
|
38
|
+
super.__makeNative(platformConfig);
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
interpolate(config: InterpolationConfigType): AnimatedInterpolation {
|
|
@@ -16,6 +16,7 @@ const AnimatedValue = require('./AnimatedValue');
|
|
|
16
16
|
const AnimatedWithChildren = require('./AnimatedWithChildren');
|
|
17
17
|
|
|
18
18
|
import type {InterpolationConfigType} from './AnimatedInterpolation';
|
|
19
|
+
import type {PlatformConfig} from '../AnimatedPlatformConfig';
|
|
19
20
|
|
|
20
21
|
class AnimatedDivision extends AnimatedWithChildren {
|
|
21
22
|
_a: AnimatedNode;
|
|
@@ -31,10 +32,10 @@ class AnimatedDivision extends AnimatedWithChildren {
|
|
|
31
32
|
this._b = typeof b === 'number' ? new AnimatedValue(b) : b;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
__makeNative() {
|
|
35
|
-
this._a.__makeNative();
|
|
36
|
-
this._b.__makeNative();
|
|
37
|
-
super.__makeNative();
|
|
35
|
+
__makeNative(platformConfig: ?PlatformConfig) {
|
|
36
|
+
this._a.__makeNative(platformConfig);
|
|
37
|
+
this._b.__makeNative(platformConfig);
|
|
38
|
+
super.__makeNative(platformConfig);
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
__getValue(): number {
|
|
@@ -19,6 +19,8 @@ const NativeAnimatedHelper = require('../NativeAnimatedHelper');
|
|
|
19
19
|
const invariant = require('invariant');
|
|
20
20
|
const normalizeColor = require('../../StyleSheet/normalizeColor');
|
|
21
21
|
|
|
22
|
+
import type {PlatformConfig} from '../AnimatedPlatformConfig';
|
|
23
|
+
|
|
22
24
|
type ExtrapolateType = 'extend' | 'identity' | 'clamp';
|
|
23
25
|
|
|
24
26
|
export type InterpolationConfigType = {
|
|
@@ -317,9 +319,9 @@ class AnimatedInterpolation extends AnimatedWithChildren {
|
|
|
317
319
|
this._interpolation = createInterpolation(config);
|
|
318
320
|
}
|
|
319
321
|
|
|
320
|
-
__makeNative() {
|
|
321
|
-
this._parent.__makeNative();
|
|
322
|
-
super.__makeNative();
|
|
322
|
+
__makeNative(platformConfig: ?PlatformConfig) {
|
|
323
|
+
this._parent.__makeNative(platformConfig);
|
|
324
|
+
super.__makeNative(platformConfig);
|
|
323
325
|
}
|
|
324
326
|
|
|
325
327
|
__getValue(): number | string {
|
|
@@ -15,6 +15,7 @@ const AnimatedNode = require('./AnimatedNode');
|
|
|
15
15
|
const AnimatedWithChildren = require('./AnimatedWithChildren');
|
|
16
16
|
|
|
17
17
|
import type {InterpolationConfigType} from './AnimatedInterpolation';
|
|
18
|
+
import type {PlatformConfig} from '../AnimatedPlatformConfig';
|
|
18
19
|
|
|
19
20
|
class AnimatedModulo extends AnimatedWithChildren {
|
|
20
21
|
_a: AnimatedNode;
|
|
@@ -26,9 +27,9 @@ class AnimatedModulo extends AnimatedWithChildren {
|
|
|
26
27
|
this._modulus = modulus;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
__makeNative() {
|
|
30
|
-
this._a.__makeNative();
|
|
31
|
-
super.__makeNative();
|
|
30
|
+
__makeNative(platformConfig: ?PlatformConfig) {
|
|
31
|
+
this._a.__makeNative(platformConfig);
|
|
32
|
+
super.__makeNative(platformConfig);
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
__getValue(): number {
|
|
@@ -16,6 +16,7 @@ const AnimatedValue = require('./AnimatedValue');
|
|
|
16
16
|
const AnimatedWithChildren = require('./AnimatedWithChildren');
|
|
17
17
|
|
|
18
18
|
import type {InterpolationConfigType} from './AnimatedInterpolation';
|
|
19
|
+
import type {PlatformConfig} from '../AnimatedPlatformConfig';
|
|
19
20
|
|
|
20
21
|
class AnimatedMultiplication extends AnimatedWithChildren {
|
|
21
22
|
_a: AnimatedNode;
|
|
@@ -27,10 +28,10 @@ class AnimatedMultiplication extends AnimatedWithChildren {
|
|
|
27
28
|
this._b = typeof b === 'number' ? new AnimatedValue(b) : b;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
__makeNative() {
|
|
31
|
-
this._a.__makeNative();
|
|
32
|
-
this._b.__makeNative();
|
|
33
|
-
super.__makeNative();
|
|
31
|
+
__makeNative(platformConfig: ?PlatformConfig) {
|
|
32
|
+
this._a.__makeNative(platformConfig);
|
|
33
|
+
this._b.__makeNative(platformConfig);
|
|
34
|
+
super.__makeNative(platformConfig);
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
__getValue(): number {
|