@office-iss/react-native-win32 0.0.0-canary.299 → 0.0.0-canary.300
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 +3 -6
- package/CHANGELOG.json +46 -1
- package/CHANGELOG.md +19 -6
- package/IntegrationTests/IntegrationTestsApp.js +1 -1
- package/Libraries/Alert/RCTAlertManager.android.js +2 -0
- package/Libraries/Animated/Animated.d.ts +2 -0
- package/Libraries/Animated/AnimatedImplementation.js +2 -0
- package/Libraries/Animated/Easing.js +2 -0
- package/Libraries/Animated/animations/Animation.js +14 -14
- package/Libraries/Animated/animations/TimingAnimation.js +2 -0
- package/Libraries/Animated/nodes/AnimatedNode.js +7 -7
- package/Libraries/Animated/nodes/AnimatedObject.js +7 -7
- package/Libraries/Animated/nodes/AnimatedProps.js +30 -30
- package/Libraries/Animated/nodes/AnimatedStyle.js +17 -17
- package/Libraries/Animated/nodes/AnimatedTransform.js +5 -5
- package/Libraries/Animated/nodes/AnimatedValue.js +18 -18
- package/Libraries/AppState/AppState.js +3 -3
- package/Libraries/BatchedBridge/MessageQueue.js +4 -0
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +1 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +1 -1
- package/Libraries/Components/Pressable/Pressable.js +10 -1
- package/Libraries/Components/Pressable/Pressable.win32.js +9 -0
- package/Libraries/Components/StatusBar/StatusBar.js +2 -2
- package/Libraries/Components/Switch/Switch.js +1 -1
- package/Libraries/Components/TextInput/TextInput.js +2 -2
- package/Libraries/Components/TextInput/TextInput.win32.js +2 -1
- package/Libraries/Components/Touchable/TouchableBounce.js +1 -1
- package/Libraries/Components/Touchable/TouchableHighlight.js +1 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -1
- package/Libraries/Components/Touchable/TouchableOpacity.js +1 -1
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -2
- package/Libraries/Components/View/View.js +86 -168
- package/Libraries/Core/ReactNativeVersion.js +37 -10
- package/Libraries/Core/Timers/queueMicrotask.js +1 -0
- package/Libraries/Core/setUpPerformance.js +2 -1
- package/Libraries/Interaction/InteractionManager.js +118 -171
- package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -0
- package/Libraries/LogBox/Data/LogBoxData.js +4 -1
- package/Libraries/Modal/Modal.js +1 -1
- package/Libraries/NativeComponent/ViewConfig.js +1 -1
- package/Libraries/Network/XMLHttpRequest.js +18 -5
- package/Libraries/Pressability/Pressability.js +1 -1
- package/Libraries/Pressability/Pressability.win32.js +1 -1
- package/Libraries/ReactNative/AppRegistryImpl.js +4 -2
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +38 -35
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +51 -22
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +54 -24
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +36 -33
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +5 -5
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +5 -5
- package/Libraries/Renderer/shims/ReactFabric.js +3 -1
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +3 -1
- package/Libraries/Renderer/shims/ReactNative.js +3 -1
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +3 -1
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +3 -1
- package/Libraries/Utilities/useMergeRefs.js +1 -1
- package/Libraries/promiseRejectionTrackingOptions.js +17 -31
- package/flow/HermesInternalType.js +114 -0
- package/flow/Stringish.js +14 -0
- package/flow/bom.js.flow +554 -0
- package/flow/console.js +49 -0
- package/flow/cssom.js.flow +575 -0
- package/flow/dom.js.flow +6289 -0
- package/flow/global.js +88 -0
- package/flow/prettier.js.flow +14 -0
- package/flow/streams.js.flow +140 -0
- package/index.js +5 -2
- package/index.win32.js +6 -2
- package/jest/mockComponent.js +1 -1
- package/jest/setup.js +11 -0
- package/overrides.json +11 -11
- package/package.json +19 -19
- package/src/private/animated/NativeAnimatedHelper.js +8 -1
- package/src/private/animated/NativeAnimatedHelper.win32.js +8 -1
- package/src/private/animated/createAnimatedPropsHook.js +2 -49
- package/src/private/animated/createAnimatedPropsMemoHook.js +2 -48
- package/src/private/components/virtualview/VirtualView.js +22 -6
- package/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.js +93 -0
- package/src/private/devsupport/devmenu/elementinspector/ReactDevToolsOverlay.js +2 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +71 -51
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +19 -0
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +15 -5
- package/src/private/webapis/dom/nodes/ReadOnlyElement.js +1 -1
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +2 -2
- package/src/private/webapis/dom/oldstylecollections/NodeList.js +2 -2
- package/src/private/webapis/geometry/DOMRectList.js +2 -2
- package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +19 -74
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +0 -4
- package/src/private/webapis/performance/EventTiming.js +5 -9
- package/src/private/webapis/performance/Performance.js +251 -191
- package/src/private/webapis/performance/PerformanceObserver.js +8 -29
- package/src/private/webapis/performance/UserTiming.js +24 -23
- package/src/private/webapis/performance/UserTimingExtensibility.js.flow +38 -0
- package/src/private/webapis/performance/internals/Utilities.js +9 -0
- package/src/private/webapis/performance/specs/NativePerformance.js +19 -33
- package/src/private/webapis/structuredClone/structuredClone.js +1 -1
- package/Libraries/Interaction/InteractionManagerStub.js +0 -184
- package/Libraries/Interaction/TaskQueue.js +0 -197
- package/Libraries/ReactNative/ReactNativeFeatureFlags.js +0 -31
package/.flowconfig
CHANGED
|
@@ -50,6 +50,8 @@
|
|
|
50
50
|
; Ignore react-native files in node_modules since they are copied into project root
|
|
51
51
|
.*/node_modules/react-native/.*
|
|
52
52
|
|
|
53
|
+
; Ignore all flow directory contents in node_modules
|
|
54
|
+
.*/flow/.*
|
|
53
55
|
|
|
54
56
|
; Ignore react-native-windows' build output. Flow is not compiled with long path support and after running unittests these folders have long paths
|
|
55
57
|
.*/node_modules/react-native-windows/build/.*
|
|
@@ -59,7 +61,6 @@
|
|
|
59
61
|
|
|
60
62
|
; These files dont need to be checked and just increase the build time
|
|
61
63
|
.*/node_modules/e2etest/.*
|
|
62
|
-
.*/node_modules/sample-apps/.*
|
|
63
64
|
.*/node_modules/playground/.*
|
|
64
65
|
|
|
65
66
|
<PROJECT_ROOT>/packages/react-native/sdks/.*
|
|
@@ -149,11 +150,7 @@ module.system.haste.module_ref_prefix=m#
|
|
|
149
150
|
|
|
150
151
|
react.runtime=automatic
|
|
151
152
|
|
|
152
|
-
suppress_type=$FlowIssue
|
|
153
153
|
suppress_type=$FlowFixMe
|
|
154
|
-
suppress_type=$FlowFixMeProps
|
|
155
|
-
suppress_type=$FlowFixMeState
|
|
156
|
-
suppress_type=$FlowFixMeEmpty
|
|
157
154
|
|
|
158
155
|
ban_spread_key_props=true
|
|
159
156
|
|
|
@@ -180,4 +177,4 @@ untyped-import
|
|
|
180
177
|
untyped-type-import
|
|
181
178
|
|
|
182
179
|
[version]
|
|
183
|
-
^0.
|
|
180
|
+
^0.278.0
|
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,52 @@
|
|
|
2
2
|
"name": "@office-iss/react-native-win32",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Thu, 13 Nov 2025 02:30:50 GMT",
|
|
6
|
+
"version": "0.0.0-canary.300",
|
|
7
|
+
"tag": "@office-iss/react-native-win32_v0.0.0-canary.300",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "66076509+vineethkuttan@users.noreply.github.com",
|
|
12
|
+
"package": "@office-iss/react-native-win32",
|
|
13
|
+
"commit": "33e8489afe38fdd8b8170f750bdd5983b4f1dc7e",
|
|
14
|
+
"comment": "Integrate 0.82.0-nightly-20250806-5936f29d6"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "30809111+acoates-ms@users.noreply.github.com",
|
|
18
|
+
"package": "@office-iss/react-native-win32",
|
|
19
|
+
"commit": "0fe72b72890415cab242d5e253253b819f92d8e3",
|
|
20
|
+
"comment": "Remove paper"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@office-iss/react-native-win32",
|
|
25
|
+
"comment": "Bump @rnw-scripts/eslint-config to v1.2.38",
|
|
26
|
+
"commit": "not available"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@office-iss/react-native-win32",
|
|
31
|
+
"comment": "Bump @rnw-scripts/jest-out-of-tree-snapshot-resolver to v1.1.42",
|
|
32
|
+
"commit": "not available"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@office-iss/react-native-win32",
|
|
37
|
+
"comment": "Bump @rnw-scripts/just-task to v2.3.57",
|
|
38
|
+
"commit": "not available"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"author": "beachball",
|
|
42
|
+
"package": "@office-iss/react-native-win32",
|
|
43
|
+
"comment": "Bump react-native-platform-override to v1.9.60",
|
|
44
|
+
"commit": "not available"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"date": "Tue, 21 Oct 2025 05:28:10 GMT",
|
|
6
51
|
"version": "0.0.0-canary.299",
|
|
7
52
|
"tag": "@office-iss/react-native-win32_v0.0.0-canary.299",
|
|
8
53
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
# Change Log - @office-iss/react-native-win32
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Thu, 13 Nov 2025 02:30:50 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## 0.0.0-canary.
|
|
7
|
+
## 0.0.0-canary.300
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Thu, 13 Nov 2025 02:30:50 GMT
|
|
10
10
|
|
|
11
11
|
### Changes
|
|
12
12
|
|
|
13
|
-
- Integrate 0.
|
|
14
|
-
-
|
|
15
|
-
-
|
|
13
|
+
- Integrate 0.82.0-nightly-20250806-5936f29d6 (66076509+vineethkuttan@users.noreply.github.com)
|
|
14
|
+
- Remove paper (30809111+acoates-ms@users.noreply.github.com)
|
|
15
|
+
- Bump @rnw-scripts/eslint-config to v1.2.38
|
|
16
|
+
- Bump @rnw-scripts/jest-out-of-tree-snapshot-resolver to v1.1.42
|
|
17
|
+
- Bump @rnw-scripts/just-task to v2.3.57
|
|
18
|
+
- Bump react-native-platform-override to v1.9.60
|
|
16
19
|
|
|
20
|
+
## 0.0.0-canary.299
|
|
21
|
+
|
|
22
|
+
Tue, 21 Oct 2025 05:28:10 GMT
|
|
23
|
+
|
|
24
|
+
### Changes
|
|
25
|
+
|
|
26
|
+
- Integrate 0.81.0-nightly-20250709-6892dde36 (kvineeth@microsoft.com)
|
|
27
|
+
- Integrate 0.81.0-nightly-20250702-b41b924b2 (kvineeth@microsoft.com)
|
|
28
|
+
- fix: stricter checks against key events (sanajmi@microsoft.com)
|
|
29
|
+
|
|
17
30
|
## 0.0.0-canary.298
|
|
18
31
|
|
|
19
32
|
Tue, 07 Oct 2025 05:27:27 GMT
|
|
@@ -48,7 +48,7 @@ require('./LoggingTestModule');
|
|
|
48
48
|
|
|
49
49
|
type Test = any;
|
|
50
50
|
|
|
51
|
-
class IntegrationTestsApp extends React.Component<{...}, $
|
|
51
|
+
class IntegrationTestsApp extends React.Component<{...}, $FlowFixMe> {
|
|
52
52
|
state: {test: ?Test} = {
|
|
53
53
|
test: (null: ?Test),
|
|
54
54
|
};
|
|
@@ -28,6 +28,8 @@ export function alertWithArgs(
|
|
|
28
28
|
args,
|
|
29
29
|
emptyCallback,
|
|
30
30
|
// $FlowFixMe[incompatible-call] - Mismatched platform interfaces.
|
|
31
|
+
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
|
32
|
+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
31
33
|
callback || emptyCallback,
|
|
32
34
|
);
|
|
33
35
|
}
|
|
@@ -551,6 +551,7 @@ export namespace Animated {
|
|
|
551
551
|
[K in keyof T]: WithAnimatedValue<T[K]>;
|
|
552
552
|
};
|
|
553
553
|
|
|
554
|
+
// prettier-ignore
|
|
554
555
|
export type WithAnimatedValue<T> = T extends Builtin | Nullable
|
|
555
556
|
? T
|
|
556
557
|
: T extends Primitive
|
|
@@ -563,6 +564,7 @@ export namespace Animated {
|
|
|
563
564
|
|
|
564
565
|
type NonAnimatedProps = 'key' | 'ref';
|
|
565
566
|
|
|
567
|
+
// prettier-ignore
|
|
566
568
|
type TAugmentRef<T> = T extends React.Ref<infer R>
|
|
567
569
|
? unknown extends R
|
|
568
570
|
? never
|
|
@@ -94,6 +94,8 @@ const _combineCallbacks = function (
|
|
|
94
94
|
if (callback && config.onComplete) {
|
|
95
95
|
return (...args: Array<EndResult>) => {
|
|
96
96
|
config.onComplete && config.onComplete(...args);
|
|
97
|
+
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
|
98
|
+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
97
99
|
callback && callback(...args);
|
|
98
100
|
};
|
|
99
101
|
} else {
|
|
@@ -91,6 +91,8 @@ const EasingStatic = {
|
|
|
91
91
|
* http://cubic-bezier.com/#.42,0,1,1
|
|
92
92
|
*/
|
|
93
93
|
ease(t: number): number {
|
|
94
|
+
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
|
95
|
+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
94
96
|
if (!ease) {
|
|
95
97
|
ease = EasingStatic.bezier(0.42, 0, 1, 1);
|
|
96
98
|
}
|
|
@@ -41,9 +41,9 @@ let startNativeAnimationNextId = 1;
|
|
|
41
41
|
// Once an animation has been stopped or finished its course, it will
|
|
42
42
|
// not be reused.
|
|
43
43
|
export default class Animation {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
_nativeID: ?number;
|
|
45
|
+
_onEnd: ?EndCallback;
|
|
46
|
+
_useNativeDriver: boolean;
|
|
47
47
|
|
|
48
48
|
__active: boolean;
|
|
49
49
|
__isInteraction: boolean;
|
|
@@ -52,10 +52,10 @@ export default class Animation {
|
|
|
52
52
|
__debugID: ?string;
|
|
53
53
|
|
|
54
54
|
constructor(config: AnimationConfig) {
|
|
55
|
-
this
|
|
55
|
+
this._useNativeDriver = NativeAnimatedHelper.shouldUseNativeDriver(config);
|
|
56
56
|
|
|
57
57
|
this.__active = false;
|
|
58
|
-
this.__isInteraction = config.isInteraction ?? !this
|
|
58
|
+
this.__isInteraction = config.isInteraction ?? !this._useNativeDriver;
|
|
59
59
|
this.__isLooping = config.isLooping;
|
|
60
60
|
this.__iterations = config.iterations ?? 1;
|
|
61
61
|
if (__DEV__) {
|
|
@@ -70,7 +70,7 @@ export default class Animation {
|
|
|
70
70
|
previousAnimation: ?Animation,
|
|
71
71
|
animatedValue: AnimatedValue,
|
|
72
72
|
): void {
|
|
73
|
-
if (!this
|
|
73
|
+
if (!this._useNativeDriver && animatedValue.__isNative === true) {
|
|
74
74
|
throw new Error(
|
|
75
75
|
'Attempting to run JS driven animation on animated node ' +
|
|
76
76
|
'that has been moved to "native" earlier by starting an ' +
|
|
@@ -78,13 +78,13 @@ export default class Animation {
|
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
this
|
|
81
|
+
this._onEnd = onEnd;
|
|
82
82
|
this.__active = true;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
stop(): void {
|
|
86
|
-
if (this
|
|
87
|
-
const nativeID = this
|
|
86
|
+
if (this._nativeID != null) {
|
|
87
|
+
const nativeID = this._nativeID;
|
|
88
88
|
const identifier = `${nativeID}:stopAnimation`;
|
|
89
89
|
try {
|
|
90
90
|
// This is only required when singleOpBatching is used, as otherwise
|
|
@@ -123,7 +123,7 @@ export default class Animation {
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
__startAnimationIfNative(animatedValue: AnimatedValue): boolean {
|
|
126
|
-
if (!this
|
|
126
|
+
if (!this._useNativeDriver) {
|
|
127
127
|
return false;
|
|
128
128
|
}
|
|
129
129
|
|
|
@@ -135,9 +135,9 @@ export default class Animation {
|
|
|
135
135
|
try {
|
|
136
136
|
const config = this.__getNativeAnimationConfig();
|
|
137
137
|
animatedValue.__makeNative(config.platformConfig);
|
|
138
|
-
this
|
|
138
|
+
this._nativeID = NativeAnimatedHelper.generateNewAnimationId();
|
|
139
139
|
NativeAnimatedHelper.API.startAnimatingNode(
|
|
140
|
-
this
|
|
140
|
+
this._nativeID,
|
|
141
141
|
animatedValue.__getNativeTag(),
|
|
142
142
|
config,
|
|
143
143
|
result => {
|
|
@@ -185,9 +185,9 @@ export default class Animation {
|
|
|
185
185
|
* callback will never be called more than once.
|
|
186
186
|
*/
|
|
187
187
|
__notifyAnimationEnd(result: EndResult): void {
|
|
188
|
-
const callback = this
|
|
188
|
+
const callback = this._onEnd;
|
|
189
189
|
if (callback != null) {
|
|
190
|
-
this
|
|
190
|
+
this._onEnd = null;
|
|
191
191
|
callback(result);
|
|
192
192
|
}
|
|
193
193
|
}
|
|
@@ -49,6 +49,8 @@ export type TimingAnimationConfigSingle = $ReadOnly<{
|
|
|
49
49
|
|
|
50
50
|
let _easeInOut;
|
|
51
51
|
function easeInOut() {
|
|
52
|
+
/* $FlowFixMe[constant-condition] Error discovered during Constant Condition
|
|
53
|
+
* roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
52
54
|
if (!_easeInOut) {
|
|
53
55
|
const Easing = require('../Easing').default;
|
|
54
56
|
_easeInOut = Easing.inOut(Easing.ease);
|
|
@@ -28,7 +28,7 @@ let _assertNativeAnimatedModule: ?() => void = () => {
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
export default class AnimatedNode {
|
|
31
|
-
|
|
31
|
+
_listeners: Map<string, ValueListenerCallback>;
|
|
32
32
|
|
|
33
33
|
_platformConfig: ?PlatformConfig = undefined;
|
|
34
34
|
|
|
@@ -38,7 +38,7 @@ export default class AnimatedNode {
|
|
|
38
38
|
...
|
|
39
39
|
}>,
|
|
40
40
|
) {
|
|
41
|
-
this
|
|
41
|
+
this._listeners = new Map();
|
|
42
42
|
if (__DEV__) {
|
|
43
43
|
this.__debugID = config?.debugID;
|
|
44
44
|
}
|
|
@@ -85,7 +85,7 @@ export default class AnimatedNode {
|
|
|
85
85
|
*/
|
|
86
86
|
addListener(callback: (value: any) => mixed): string {
|
|
87
87
|
const id = String(_uniqueId++);
|
|
88
|
-
this
|
|
88
|
+
this._listeners.set(id, callback);
|
|
89
89
|
return id;
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -96,7 +96,7 @@ export default class AnimatedNode {
|
|
|
96
96
|
* See https://reactnative.dev/docs/animatedvalue#removelistener
|
|
97
97
|
*/
|
|
98
98
|
removeListener(id: string): void {
|
|
99
|
-
this
|
|
99
|
+
this._listeners.delete(id);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
/**
|
|
@@ -105,11 +105,11 @@ export default class AnimatedNode {
|
|
|
105
105
|
* See https://reactnative.dev/docs/animatedvalue#removealllisteners
|
|
106
106
|
*/
|
|
107
107
|
removeAllListeners(): void {
|
|
108
|
-
this
|
|
108
|
+
this._listeners.clear();
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
hasListeners(): boolean {
|
|
112
|
-
return this
|
|
112
|
+
return this._listeners.size > 0;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
__onAnimatedValueUpdateReceived(value: number, offset: number): void {
|
|
@@ -118,7 +118,7 @@ export default class AnimatedNode {
|
|
|
118
118
|
|
|
119
119
|
__callListeners(value: number): void {
|
|
120
120
|
const event = {value};
|
|
121
|
-
this
|
|
121
|
+
this._listeners.forEach(listener => {
|
|
122
122
|
listener(event);
|
|
123
123
|
});
|
|
124
124
|
}
|
|
@@ -21,7 +21,7 @@ const MAX_DEPTH = 5;
|
|
|
21
21
|
|
|
22
22
|
export function isPlainObject(
|
|
23
23
|
value: mixed,
|
|
24
|
-
/* $
|
|
24
|
+
/* $FlowFixMe[incompatible-type-guard] - Flow does not know that the prototype
|
|
25
25
|
and ReactElement checks preserve the type refinement of `value`. */
|
|
26
26
|
): value is $ReadOnly<{[string]: mixed}> {
|
|
27
27
|
return (
|
|
@@ -82,7 +82,7 @@ function mapAnimatedNodes(value: any, fn: any => any, depth: number = 0): any {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
export default class AnimatedObject extends AnimatedWithChildren {
|
|
85
|
-
|
|
85
|
+
_nodes: $ReadOnlyArray<AnimatedNode>;
|
|
86
86
|
_value: mixed;
|
|
87
87
|
|
|
88
88
|
/**
|
|
@@ -106,7 +106,7 @@ export default class AnimatedObject extends AnimatedWithChildren {
|
|
|
106
106
|
config?: ?AnimatedNodeConfig,
|
|
107
107
|
) {
|
|
108
108
|
super(config);
|
|
109
|
-
this
|
|
109
|
+
this._nodes = nodes;
|
|
110
110
|
this._value = value;
|
|
111
111
|
}
|
|
112
112
|
|
|
@@ -117,7 +117,7 @@ export default class AnimatedObject extends AnimatedWithChildren {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
__getValueWithStaticObject(staticObject: mixed): any {
|
|
120
|
-
const nodes = this
|
|
120
|
+
const nodes = this._nodes;
|
|
121
121
|
let index = 0;
|
|
122
122
|
// NOTE: We can depend on `this._value` and `staticObject` sharing a
|
|
123
123
|
// structure because of `useAnimatedPropsMemo`.
|
|
@@ -131,7 +131,7 @@ export default class AnimatedObject extends AnimatedWithChildren {
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
__attach(): void {
|
|
134
|
-
const nodes = this
|
|
134
|
+
const nodes = this._nodes;
|
|
135
135
|
for (let ii = 0, length = nodes.length; ii < length; ii++) {
|
|
136
136
|
const node = nodes[ii];
|
|
137
137
|
node.__addChild(this);
|
|
@@ -140,7 +140,7 @@ export default class AnimatedObject extends AnimatedWithChildren {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
__detach(): void {
|
|
143
|
-
const nodes = this
|
|
143
|
+
const nodes = this._nodes;
|
|
144
144
|
for (let ii = 0, length = nodes.length; ii < length; ii++) {
|
|
145
145
|
const node = nodes[ii];
|
|
146
146
|
node.__removeChild(this);
|
|
@@ -149,7 +149,7 @@ export default class AnimatedObject extends AnimatedWithChildren {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
__makeNative(platformConfig: ?PlatformConfig): void {
|
|
152
|
-
const nodes = this
|
|
152
|
+
const nodes = this._nodes;
|
|
153
153
|
for (let ii = 0, length = nodes.length; ii < length; ii++) {
|
|
154
154
|
const node = nodes[ii];
|
|
155
155
|
node.__makeNative(platformConfig);
|
|
@@ -92,11 +92,11 @@ function createAnimatedProps(
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
export default class AnimatedProps extends AnimatedNode {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
95
|
+
_callback: () => void;
|
|
96
|
+
_nodeKeys: $ReadOnlyArray<string>;
|
|
97
|
+
_nodes: $ReadOnlyArray<AnimatedNode>;
|
|
98
|
+
_props: {[string]: mixed};
|
|
99
|
+
_target: ?TargetView = null;
|
|
100
100
|
|
|
101
101
|
constructor(
|
|
102
102
|
inputProps: {[string]: mixed},
|
|
@@ -106,19 +106,19 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
106
106
|
) {
|
|
107
107
|
super(config);
|
|
108
108
|
const [nodeKeys, nodes, props] = createAnimatedProps(inputProps, allowlist);
|
|
109
|
-
this
|
|
110
|
-
this
|
|
111
|
-
this
|
|
112
|
-
this
|
|
109
|
+
this._nodeKeys = nodeKeys;
|
|
110
|
+
this._nodes = nodes;
|
|
111
|
+
this._props = props;
|
|
112
|
+
this._callback = callback;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
__getValue(): Object {
|
|
116
116
|
const props: {[string]: mixed} = {};
|
|
117
117
|
|
|
118
|
-
const keys = Object.keys(this
|
|
118
|
+
const keys = Object.keys(this._props);
|
|
119
119
|
for (let ii = 0, length = keys.length; ii < length; ii++) {
|
|
120
120
|
const key = keys[ii];
|
|
121
|
-
const value = this
|
|
121
|
+
const value = this._props[key];
|
|
122
122
|
|
|
123
123
|
if (value instanceof AnimatedNode) {
|
|
124
124
|
props[key] = value.__getValue();
|
|
@@ -143,7 +143,7 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
143
143
|
const keys = Object.keys(staticProps);
|
|
144
144
|
for (let ii = 0, length = keys.length; ii < length; ii++) {
|
|
145
145
|
const key = keys[ii];
|
|
146
|
-
const maybeNode = this
|
|
146
|
+
const maybeNode = this._props[key];
|
|
147
147
|
|
|
148
148
|
if (key === 'style') {
|
|
149
149
|
const staticStyle = staticProps.style;
|
|
@@ -176,10 +176,10 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
176
176
|
__getNativeAnimatedEventTuples(): $ReadOnlyArray<[string, AnimatedEvent]> {
|
|
177
177
|
const tuples = [];
|
|
178
178
|
|
|
179
|
-
const keys = Object.keys(this
|
|
179
|
+
const keys = Object.keys(this._props);
|
|
180
180
|
for (let ii = 0, length = keys.length; ii < length; ii++) {
|
|
181
181
|
const key = keys[ii];
|
|
182
|
-
const value = this
|
|
182
|
+
const value = this._props[key];
|
|
183
183
|
|
|
184
184
|
if (value instanceof AnimatedEvent && value.__isNative) {
|
|
185
185
|
tuples.push([key, value]);
|
|
@@ -192,8 +192,8 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
192
192
|
__getAnimatedValue(): Object {
|
|
193
193
|
const props: {[string]: mixed} = {};
|
|
194
194
|
|
|
195
|
-
const nodeKeys = this
|
|
196
|
-
const nodes = this
|
|
195
|
+
const nodeKeys = this._nodeKeys;
|
|
196
|
+
const nodes = this._nodes;
|
|
197
197
|
for (let ii = 0, length = nodes.length; ii < length; ii++) {
|
|
198
198
|
const key = nodeKeys[ii];
|
|
199
199
|
const node = nodes[ii];
|
|
@@ -204,7 +204,7 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
__attach(): void {
|
|
207
|
-
const nodes = this
|
|
207
|
+
const nodes = this._nodes;
|
|
208
208
|
for (let ii = 0, length = nodes.length; ii < length; ii++) {
|
|
209
209
|
const node = nodes[ii];
|
|
210
210
|
node.__addChild(this);
|
|
@@ -213,12 +213,12 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
__detach(): void {
|
|
216
|
-
if (this.__isNative && this
|
|
217
|
-
this.#disconnectAnimatedView(this
|
|
216
|
+
if (this.__isNative && this._target != null) {
|
|
217
|
+
this.#disconnectAnimatedView(this._target);
|
|
218
218
|
}
|
|
219
|
-
this
|
|
219
|
+
this._target = null;
|
|
220
220
|
|
|
221
|
-
const nodes = this
|
|
221
|
+
const nodes = this._nodes;
|
|
222
222
|
for (let ii = 0, length = nodes.length; ii < length; ii++) {
|
|
223
223
|
const node = nodes[ii];
|
|
224
224
|
node.__removeChild(this);
|
|
@@ -228,11 +228,11 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
update(): void {
|
|
231
|
-
this
|
|
231
|
+
this._callback();
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
__makeNative(platformConfig: ?PlatformConfig): void {
|
|
235
|
-
const nodes = this
|
|
235
|
+
const nodes = this._nodes;
|
|
236
236
|
for (let ii = 0, length = nodes.length; ii < length; ii++) {
|
|
237
237
|
const node = nodes[ii];
|
|
238
238
|
node.__makeNative(platformConfig);
|
|
@@ -246,19 +246,19 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
246
246
|
// where it will be needed to traverse the graph of attached values.
|
|
247
247
|
super.__setPlatformConfig(platformConfig);
|
|
248
248
|
|
|
249
|
-
if (this
|
|
250
|
-
this.#connectAnimatedView(this
|
|
249
|
+
if (this._target != null) {
|
|
250
|
+
this.#connectAnimatedView(this._target);
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
setNativeView(instance: TargetViewInstance): void {
|
|
256
|
-
if (this
|
|
256
|
+
if (this._target?.instance === instance) {
|
|
257
257
|
return;
|
|
258
258
|
}
|
|
259
|
-
this
|
|
259
|
+
this._target = {instance, connectedViewTag: null};
|
|
260
260
|
if (this.__isNative) {
|
|
261
|
-
this.#connectAnimatedView(this
|
|
261
|
+
this.#connectAnimatedView(this._target);
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
|
|
@@ -306,8 +306,8 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
306
306
|
const platformConfig = this.__getPlatformConfig();
|
|
307
307
|
const propsConfig: {[string]: number} = {};
|
|
308
308
|
|
|
309
|
-
const nodeKeys = this
|
|
310
|
-
const nodes = this
|
|
309
|
+
const nodeKeys = this._nodeKeys;
|
|
310
|
+
const nodes = this._nodes;
|
|
311
311
|
for (let ii = 0, length = nodes.length; ii < length; ii++) {
|
|
312
312
|
const key = nodeKeys[ii];
|
|
313
313
|
const node = nodes[ii];
|
|
@@ -82,10 +82,10 @@ function createAnimatedStyle(
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
export default class AnimatedStyle extends AnimatedWithChildren {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
_originalStyleForWeb: ?mixed;
|
|
86
|
+
_nodeKeys: $ReadOnlyArray<string>;
|
|
87
|
+
_nodes: $ReadOnlyArray<AnimatedNode>;
|
|
88
|
+
_style: {[string]: mixed};
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
91
|
* Creates an `AnimatedStyle` if `value` contains `AnimatedNode` instances.
|
|
@@ -118,9 +118,9 @@ export default class AnimatedStyle extends AnimatedWithChildren {
|
|
|
118
118
|
config?: ?AnimatedNodeConfig,
|
|
119
119
|
) {
|
|
120
120
|
super(config);
|
|
121
|
-
this
|
|
122
|
-
this
|
|
123
|
-
this
|
|
121
|
+
this._nodeKeys = nodeKeys;
|
|
122
|
+
this._nodes = nodes;
|
|
123
|
+
this._style = style;
|
|
124
124
|
|
|
125
125
|
if ((Platform.OS as string) === 'web') {
|
|
126
126
|
// $FlowIgnore[cannot-write] - Intentional shadowing.
|
|
@@ -134,10 +134,10 @@ export default class AnimatedStyle extends AnimatedWithChildren {
|
|
|
134
134
|
__getValue(): FlatStyleForWeb<FlatStyle> | FlatStyle {
|
|
135
135
|
const style: {[string]: mixed} = {};
|
|
136
136
|
|
|
137
|
-
const keys = Object.keys(this
|
|
137
|
+
const keys = Object.keys(this._style);
|
|
138
138
|
for (let ii = 0, length = keys.length; ii < length; ii++) {
|
|
139
139
|
const key = keys[ii];
|
|
140
|
-
const value = this
|
|
140
|
+
const value = this._style[key];
|
|
141
141
|
|
|
142
142
|
if (value instanceof AnimatedNode) {
|
|
143
143
|
style[key] = value.__getValue();
|
|
@@ -166,7 +166,7 @@ export default class AnimatedStyle extends AnimatedWithChildren {
|
|
|
166
166
|
const keys = Object.keys(style);
|
|
167
167
|
for (let ii = 0, length = keys.length; ii < length; ii++) {
|
|
168
168
|
const key = keys[ii];
|
|
169
|
-
const maybeNode = this
|
|
169
|
+
const maybeNode = this._style[key];
|
|
170
170
|
|
|
171
171
|
if (key === 'transform' && maybeNode instanceof AnimatedTransform) {
|
|
172
172
|
style[key] = maybeNode.__getValueWithStaticTransforms(
|
|
@@ -185,8 +185,8 @@ export default class AnimatedStyle extends AnimatedWithChildren {
|
|
|
185
185
|
__getAnimatedValue(): Object {
|
|
186
186
|
const style: {[string]: mixed} = {};
|
|
187
187
|
|
|
188
|
-
const nodeKeys = this
|
|
189
|
-
const nodes = this
|
|
188
|
+
const nodeKeys = this._nodeKeys;
|
|
189
|
+
const nodes = this._nodes;
|
|
190
190
|
for (let ii = 0, length = nodes.length; ii < length; ii++) {
|
|
191
191
|
const key = nodeKeys[ii];
|
|
192
192
|
const node = nodes[ii];
|
|
@@ -197,7 +197,7 @@ export default class AnimatedStyle extends AnimatedWithChildren {
|
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
__attach(): void {
|
|
200
|
-
const nodes = this
|
|
200
|
+
const nodes = this._nodes;
|
|
201
201
|
for (let ii = 0, length = nodes.length; ii < length; ii++) {
|
|
202
202
|
const node = nodes[ii];
|
|
203
203
|
node.__addChild(this);
|
|
@@ -206,7 +206,7 @@ export default class AnimatedStyle extends AnimatedWithChildren {
|
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
__detach(): void {
|
|
209
|
-
const nodes = this
|
|
209
|
+
const nodes = this._nodes;
|
|
210
210
|
for (let ii = 0, length = nodes.length; ii < length; ii++) {
|
|
211
211
|
const node = nodes[ii];
|
|
212
212
|
node.__removeChild(this);
|
|
@@ -215,7 +215,7 @@ export default class AnimatedStyle extends AnimatedWithChildren {
|
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
__makeNative(platformConfig: ?PlatformConfig) {
|
|
218
|
-
const nodes = this
|
|
218
|
+
const nodes = this._nodes;
|
|
219
219
|
for (let ii = 0, length = nodes.length; ii < length; ii++) {
|
|
220
220
|
const node = nodes[ii];
|
|
221
221
|
node.__makeNative(platformConfig);
|
|
@@ -227,8 +227,8 @@ export default class AnimatedStyle extends AnimatedWithChildren {
|
|
|
227
227
|
const platformConfig = this.__getPlatformConfig();
|
|
228
228
|
const styleConfig: {[string]: ?number} = {};
|
|
229
229
|
|
|
230
|
-
const nodeKeys = this
|
|
231
|
-
const nodes = this
|
|
230
|
+
const nodeKeys = this._nodeKeys;
|
|
231
|
+
const nodes = this._nodes;
|
|
232
232
|
for (let ii = 0, length = nodes.length; ii < length; ii++) {
|
|
233
233
|
const key = nodeKeys[ii];
|
|
234
234
|
const node = nodes[ii];
|