@office-iss/react-native-win32 0.81.2 → 0.82.0-preview.2
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 -11
- package/CHANGELOG.json +118 -43
- package/CHANGELOG.md +45 -27
- package/IntegrationTests/IntegrationTestsApp.js +2 -2
- package/IntegrationTests/LayoutEventsTest.js +3 -3
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +7 -3
- package/Libraries/Alert/RCTAlertManager.android.js +4 -2
- package/Libraries/Animated/Animated.d.ts +2 -0
- package/Libraries/Animated/AnimatedEvent.js +1 -1
- package/Libraries/Animated/AnimatedExports.js.flow +1 -0
- package/Libraries/Animated/AnimatedImplementation.js +4 -2
- package/Libraries/Animated/AnimatedMock.js +1 -1
- package/Libraries/Animated/Easing.js +2 -0
- package/Libraries/Animated/NativeAnimatedAllowlist.js +1 -0
- package/Libraries/Animated/animations/Animation.js +19 -20
- package/Libraries/Animated/animations/TimingAnimation.js +2 -0
- package/Libraries/Animated/components/AnimatedScrollView.js +3 -2
- package/Libraries/Animated/components/AnimatedSectionList.js +1 -1
- package/Libraries/Animated/nodes/AnimatedColor.js +9 -9
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +4 -4
- package/Libraries/Animated/nodes/AnimatedNode.js +14 -7
- package/Libraries/Animated/nodes/AnimatedObject.js +7 -7
- package/Libraries/Animated/nodes/AnimatedProps.js +32 -32
- package/Libraries/Animated/nodes/AnimatedStyle.js +23 -21
- package/Libraries/Animated/nodes/AnimatedTransform.js +6 -6
- package/Libraries/Animated/nodes/AnimatedValue.js +18 -26
- package/Libraries/AppState/AppState.js +8 -4
- package/Libraries/BatchedBridge/BatchedBridge.js +1 -0
- package/Libraries/BatchedBridge/MessageQueue.js +5 -0
- package/Libraries/BatchedBridge/NativeModules.js +1 -1
- package/Libraries/Blob/BlobManager.js +1 -1
- package/Libraries/Blob/URLSearchParams.js +2 -0
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +2 -2
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +2 -2
- package/Libraries/Components/Button.js +1 -1
- package/Libraries/Components/Button.win32.js +1 -1
- package/Libraries/Components/Pressable/Pressable.js +10 -1
- package/Libraries/Components/Pressable/Pressable.win32.js +9 -0
- package/Libraries/Components/Pressable/useAndroidRippleForView.js +2 -2
- package/Libraries/Components/ScrollView/ScrollView.js +13 -4
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
- package/Libraries/Components/StatusBar/StatusBar.js +2 -2
- package/Libraries/Components/Switch/Switch.js +1 -1
- package/Libraries/Components/TextInput/TextInput.flow.js +12 -5
- package/Libraries/Components/TextInput/TextInput.flow.win32.js +12 -5
- package/Libraries/Components/TextInput/TextInput.js +14 -5
- package/Libraries/Components/TextInput/TextInput.win32.js +15 -7
- package/Libraries/Components/TextInput/TextInputState.js +1 -1
- package/Libraries/Components/TextInput/TextInputState.win32.js +1 -1
- package/Libraries/Components/TextInput/Win32TextInputNativeComponent.js +2 -3
- 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/TouchableWin32.js +1 -1
- package/Libraries/Components/Touchable/TouchableWin32.js.map +1 -1
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +3 -3
- package/Libraries/Components/View/View.js +81 -167
- package/Libraries/Components/View/View.win32.js +3 -1
- package/Libraries/Core/Devtools/loadBundleFromServer.js +1 -1
- package/Libraries/Core/Devtools/loadBundleFromServer.win32.js +1 -1
- package/Libraries/Core/ExceptionsManager.js +4 -2
- package/Libraries/Core/ReactFiberErrorDialog.js +3 -3
- package/Libraries/Core/ReactNativeVersion.js +37 -10
- package/Libraries/Core/Timers/JSTimers.js +4 -1
- package/Libraries/Core/Timers/NativeTiming.js +1 -0
- package/Libraries/Core/Timers/immediateShim.js +2 -1
- package/Libraries/Core/Timers/queueMicrotask.js +1 -0
- package/Libraries/Core/setUpPerformance.js +3 -4
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +5 -3
- package/Libraries/Image/Image.android.js +327 -111
- package/Libraries/Image/Image.ios.js +6 -1
- package/Libraries/Image/Image.win32.js +6 -1
- package/Libraries/Image/ImageSourceUtils.js +8 -2
- package/Libraries/Image/assetPaths.js +1 -1
- package/Libraries/Image/resolveAssetSource.js +1 -1
- package/Libraries/Image/resolveAssetSource.win32.js +6 -7
- package/Libraries/Interaction/InteractionManager.js +118 -167
- package/Libraries/Interaction/PanResponder.js +7 -52
- package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -0
- package/Libraries/Lists/FlatList.js +5 -6
- package/Libraries/LogBox/Data/LogBoxData.js +5 -2
- package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +2 -2
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.win32.js +1 -1
- package/Libraries/Modal/Modal.js +3 -3
- package/Libraries/NativeComponent/NativeComponentRegistry.js +1 -1
- package/Libraries/NativeComponent/ViewConfig.js +2 -2
- package/Libraries/Network/RCTNetworking.android.js +1 -1
- package/Libraries/Network/RCTNetworking.ios.js +1 -1
- package/Libraries/Network/RCTNetworking.win32.js +1 -1
- package/Libraries/Network/XMLHttpRequest.js +20 -5
- package/Libraries/Network/convertRequestBody.js +1 -1
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +10 -9
- package/Libraries/Pressability/HoverState.js +2 -0
- package/Libraries/Pressability/HoverState.win32.js +2 -0
- package/Libraries/Pressability/Pressability.js +1 -1
- package/Libraries/Pressability/Pressability.win32.js +1 -1
- package/Libraries/PushNotificationIOS/PushNotificationIOS.js +2 -2
- package/Libraries/ReactNative/AppRegistryImpl.js +4 -2
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +3 -3
- package/Libraries/ReactNative/RendererImplementation.js +116 -116
- package/Libraries/ReactNative/UIManager.js +3 -3
- package/Libraries/ReactNative/renderApplication.js +1 -0
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -1
- 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/ReactNativeViewConfigRegistry.js +3 -1
- package/Libraries/Share/Share.js +4 -0
- package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +2 -2
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +2 -2
- package/Libraries/StyleSheet/PlatformColorValueTypes.win32.js +4 -0
- package/Libraries/StyleSheet/StyleSheet.d.ts +7 -22
- package/Libraries/StyleSheet/StyleSheetExports.js +2 -8
- package/Libraries/StyleSheet/StyleSheetExports.js.flow +11 -18
- package/Libraries/StyleSheet/flattenStyle.js +2 -2
- package/Libraries/StyleSheet/processAspectRatio.js +2 -0
- package/Libraries/StyleSheet/processFilter.js +5 -5
- package/Libraries/StyleSheet/splitLayoutProps.js +2 -2
- package/Libraries/Text/Text.js +534 -234
- package/Libraries/Text/Text.win32.js +647 -274
- package/Libraries/Text/TextNativeComponent.js +2 -2
- package/Libraries/Text/TextNativeComponent.win32.js +2 -2
- package/Libraries/Utilities/Appearance.d.ts +3 -5
- package/Libraries/Utilities/Appearance.js +5 -17
- package/Libraries/Utilities/HMRClient.js +2 -1
- package/Libraries/Utilities/Platform.android.js +3 -3
- package/Libraries/Utilities/Platform.d.ts +1 -0
- package/Libraries/Utilities/Platform.ios.js +1 -1
- package/Libraries/Utilities/Platform.win32.js +3 -3
- package/Libraries/Utilities/PlatformTypes.js +1 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +12 -0
- package/Libraries/Utilities/SceneTracker.js +1 -1
- package/Libraries/Utilities/codegenNativeCommands.js +1 -1
- package/Libraries/Utilities/codegenNativeComponent.js +1 -1
- package/Libraries/Utilities/createPerformanceLogger.js +32 -0
- package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +2 -0
- package/Libraries/Utilities/differ/pointsDiffer.js +1 -1
- package/Libraries/Utilities/useMergeRefs.js +1 -1
- package/Libraries/WebSocket/WebSocketInterceptor.js +2 -0
- package/Libraries/promiseRejectionTrackingOptions.js +17 -31
- package/Libraries/vendor/emitter/EventEmitter.js +1 -1
- package/flow/bom.js.flow +223 -1
- package/flow/prettier.js.flow +14 -0
- package/index.js +14 -2
- package/index.win32.js +16 -2
- package/jest/local-setup.js +2 -2
- package/jest/mock.js +1 -1
- package/jest/mockComponent.js +9 -9
- package/jest/mockNativeComponent.js +3 -2
- package/jest/mocks/Modal.js +1 -1
- package/jest/mocks/ScrollView.js +1 -1
- package/jest/mocks/ViewNativeComponent.js +1 -1
- package/jest/setup.js +23 -12
- package/overrides.json +23 -23
- package/package.json +28 -27
- package/saveAssetPlugin.js +2 -2
- package/src/private/animated/NativeAnimatedHelper.js +16 -5
- package/src/private/animated/NativeAnimatedHelper.win32.js +16 -5
- package/src/private/animated/createAnimatedPropsHook.js +11 -60
- package/src/private/animated/createAnimatedPropsMemoHook.js +8 -54
- package/src/private/components/virtualview/VirtualView.js +43 -12
- package/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.js +93 -0
- package/src/private/components/virtualview/VirtualViewNativeComponent.js +6 -0
- package/src/private/devsupport/devmenu/elementinspector/Inspector.js +2 -2
- package/src/private/devsupport/devmenu/elementinspector/ReactDevToolsOverlay.js +2 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +85 -52
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +23 -4
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +15 -6
- package/src/private/renderer/errorhandling/ErrorHandlers.js +3 -3
- package/src/private/setup/{setUpPerformanceObserver.js → setUpPerformanceModern.js} +43 -18
- package/src/private/specs_DEPRECATED/modules/NativeTiming.js +1 -0
- package/src/private/types/HostInstance.js +4 -1
- package/src/private/webapis/dom/nodes/ReactNativeDocument.js +22 -2
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +1 -1
- package/src/private/webapis/dom/nodes/ReadOnlyElement.js +5 -3
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +16 -13
- package/src/private/webapis/dom/nodes/internals/NodeInternals.js +45 -22
- package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.js +1 -1
- package/src/private/webapis/dom/nodes/specs/NativeDOM.js +26 -192
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +15 -12
- package/src/private/webapis/dom/oldstylecollections/NodeList.js +14 -11
- 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/mutationobserver/internals/MutationObserverManager.js +1 -1
- package/src/private/webapis/performance/EventTiming.js +40 -25
- package/src/private/webapis/performance/LongTasks.js +35 -2
- package/src/private/webapis/performance/Performance.js +347 -166
- package/src/private/webapis/performance/PerformanceEntry.js +40 -23
- package/src/private/webapis/performance/PerformanceObserver.js +37 -29
- package/src/private/webapis/performance/ReactNativeStartupTiming.js +3 -24
- package/src/private/webapis/performance/ResourceTiming.js +29 -18
- package/src/private/webapis/performance/UserTiming.js +92 -34
- package/src/private/webapis/performance/UserTimingExtensibility.js.flow +38 -0
- package/src/private/webapis/performance/internals/RawPerformanceEntry.js +3 -4
- package/src/private/webapis/performance/internals/Utilities.js +9 -0
- package/src/private/webapis/performance/specs/NativePerformance.js +23 -23
- package/src/private/webapis/structuredClone/structuredClone.js +10 -10
- package/src-win/Libraries/Components/Touchable/TouchableWin32.tsx +1 -1
- package/Libraries/Interaction/InteractionManagerStub.js +0 -184
- package/Libraries/Interaction/TaskQueue.js +0 -183
- package/Libraries/ReactNative/ReactNativeFeatureFlags.js +0 -31
|
@@ -4,176 +4,32 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @flow strict
|
|
7
|
+
* @flow strict
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {EventSubscription} from '../vendor/emitter/EventEmitter';
|
|
12
|
-
import type {Task} from './TaskQueue';
|
|
13
12
|
|
|
14
|
-
import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
|
|
15
|
-
import EventEmitter from '../vendor/emitter/EventEmitter';
|
|
16
|
-
|
|
17
|
-
const BatchedBridge = require('../BatchedBridge/BatchedBridge').default;
|
|
18
|
-
const TaskQueue = require('./TaskQueue').default;
|
|
19
13
|
const invariant = require('invariant');
|
|
20
14
|
|
|
21
|
-
export type
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const _emitter = new EventEmitter<{
|
|
26
|
-
interactionComplete: [],
|
|
27
|
-
interactionStart: [],
|
|
28
|
-
}>();
|
|
29
|
-
|
|
30
|
-
const DEBUG_DELAY: 0 = 0;
|
|
31
|
-
const DEBUG: false = false;
|
|
32
|
-
|
|
33
|
-
const InteractionManagerImpl = {
|
|
34
|
-
Events: {
|
|
35
|
-
interactionStart: 'interactionStart',
|
|
36
|
-
interactionComplete: 'interactionComplete',
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Schedule a function to run after all interactions have completed. Returns a cancellable
|
|
41
|
-
* "promise".
|
|
42
|
-
*/
|
|
43
|
-
runAfterInteractions(task: ?Task): {
|
|
44
|
-
then: <U>(
|
|
45
|
-
onFulfill?: ?(void) => ?(Promise<U> | U),
|
|
46
|
-
onReject?: ?(error: mixed) => ?(Promise<U> | U),
|
|
47
|
-
) => Promise<U>,
|
|
48
|
-
cancel: () => void,
|
|
49
|
-
...
|
|
50
|
-
} {
|
|
51
|
-
const tasks: Array<Task> = [];
|
|
52
|
-
const promise = new Promise((resolve: () => void) => {
|
|
53
|
-
_scheduleUpdate();
|
|
54
|
-
if (task) {
|
|
55
|
-
tasks.push(task);
|
|
56
|
-
}
|
|
57
|
-
tasks.push({
|
|
58
|
-
run: resolve,
|
|
59
|
-
name: 'resolve ' + ((task && task.name) || '?'),
|
|
60
|
-
});
|
|
61
|
-
_taskQueue.enqueueTasks(tasks);
|
|
62
|
-
});
|
|
63
|
-
return {
|
|
64
|
-
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
|
|
65
|
-
then: promise.then.bind(promise),
|
|
66
|
-
cancel: function () {
|
|
67
|
-
_taskQueue.cancelTasks(tasks);
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Notify manager that an interaction has started.
|
|
74
|
-
*/
|
|
75
|
-
createInteractionHandle(): Handle {
|
|
76
|
-
DEBUG && console.log('InteractionManager: create interaction handle');
|
|
77
|
-
_scheduleUpdate();
|
|
78
|
-
const handle = ++_inc;
|
|
79
|
-
_addInteractionSet.add(handle);
|
|
80
|
-
return handle;
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Notify manager that an interaction has completed.
|
|
85
|
-
*/
|
|
86
|
-
clearInteractionHandle(handle: Handle) {
|
|
87
|
-
DEBUG && console.log('InteractionManager: clear interaction handle');
|
|
88
|
-
invariant(!!handle, 'InteractionManager: Must provide a handle to clear.');
|
|
89
|
-
_scheduleUpdate();
|
|
90
|
-
_addInteractionSet.delete(handle);
|
|
91
|
-
_deleteInteractionSet.add(handle);
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
// $FlowFixMe[unclear-type] unclear type of _emitter
|
|
95
|
-
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
|
|
96
|
-
addListener: _emitter.addListener.bind(_emitter) as (
|
|
97
|
-
eventType: string,
|
|
98
|
-
// $FlowFixMe[unclear-type] unclear type of arguments
|
|
99
|
-
listener: (...args: any) => mixed,
|
|
100
|
-
context: mixed,
|
|
101
|
-
) => EventSubscription,
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* A positive number will use setTimeout to schedule any tasks after the
|
|
105
|
-
* eventLoopRunningTime hits the deadline value, otherwise all tasks will be
|
|
106
|
-
* executed in one setImmediate batch (default).
|
|
107
|
-
*/
|
|
108
|
-
setDeadline(deadline: number) {
|
|
109
|
-
_deadline = deadline;
|
|
110
|
-
},
|
|
15
|
+
export type SimpleTask = {
|
|
16
|
+
name: string,
|
|
17
|
+
run: () => void,
|
|
111
18
|
};
|
|
19
|
+
export type PromiseTask = {
|
|
20
|
+
name: string,
|
|
21
|
+
gen: () => Promise<void>,
|
|
22
|
+
};
|
|
23
|
+
export type Task = SimpleTask | PromiseTask | (() => void);
|
|
112
24
|
|
|
113
|
-
|
|
114
|
-
const _addInteractionSet = new Set<number | Handle>();
|
|
115
|
-
const _deleteInteractionSet = new Set<Handle>();
|
|
116
|
-
const _taskQueue = new TaskQueue({onMoreTasks: _scheduleUpdate});
|
|
117
|
-
let _nextUpdateHandle: $FlowFixMe | TimeoutID = 0;
|
|
118
|
-
let _inc = 0;
|
|
119
|
-
let _deadline = -1;
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Schedule an asynchronous update to the interaction state.
|
|
123
|
-
*/
|
|
124
|
-
function _scheduleUpdate() {
|
|
125
|
-
if (!_nextUpdateHandle) {
|
|
126
|
-
if (_deadline > 0) {
|
|
127
|
-
_nextUpdateHandle = setTimeout(_processUpdate, 0 + DEBUG_DELAY);
|
|
128
|
-
} else {
|
|
129
|
-
_nextUpdateHandle = setImmediate(_processUpdate);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Notify listeners, process queue, etc
|
|
136
|
-
*/
|
|
137
|
-
function _processUpdate() {
|
|
138
|
-
_nextUpdateHandle = 0;
|
|
139
|
-
|
|
140
|
-
const interactionCount = _interactionSet.size;
|
|
141
|
-
_addInteractionSet.forEach(handle => _interactionSet.add(handle));
|
|
142
|
-
_deleteInteractionSet.forEach(handle => _interactionSet.delete(handle));
|
|
143
|
-
const nextInteractionCount = _interactionSet.size;
|
|
144
|
-
|
|
145
|
-
if (interactionCount !== 0 && nextInteractionCount === 0) {
|
|
146
|
-
// transition from 1+ --> 0 interactions
|
|
147
|
-
/* $FlowFixMe[prop-missing] Natural Inference rollout. See
|
|
148
|
-
* https://fburl.com/workplace/6291gfvu */
|
|
149
|
-
/* $FlowFixMe[invalid-computed-prop] Natural Inference rollout. See
|
|
150
|
-
* https://fburl.com/workplace/6291gfvu */
|
|
151
|
-
_emitter.emit(InteractionManager.Events.interactionComplete);
|
|
152
|
-
} else if (interactionCount === 0 && nextInteractionCount !== 0) {
|
|
153
|
-
// transition from 0 --> 1+ interactions
|
|
154
|
-
/* $FlowFixMe[prop-missing] Natural Inference rollout. See
|
|
155
|
-
* https://fburl.com/workplace/6291gfvu */
|
|
156
|
-
/* $FlowFixMe[invalid-computed-prop] Natural Inference rollout. See
|
|
157
|
-
* https://fburl.com/workplace/6291gfvu */
|
|
158
|
-
_emitter.emit(InteractionManager.Events.interactionStart);
|
|
159
|
-
}
|
|
25
|
+
export type Handle = number;
|
|
160
26
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
BatchedBridge.getEventLoopRunningTime() >= _deadline
|
|
168
|
-
) {
|
|
169
|
-
// Hit deadline before processing all tasks, so process more later.
|
|
170
|
-
_scheduleUpdate();
|
|
171
|
-
break;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
_addInteractionSet.clear();
|
|
176
|
-
_deleteInteractionSet.clear();
|
|
27
|
+
// NOTE: The original implementation of `InteractionManager` never rejected
|
|
28
|
+
// the returned promise. This preserves that behavior in the stub.
|
|
29
|
+
function reject(error: Error): void {
|
|
30
|
+
setTimeout(() => {
|
|
31
|
+
throw error;
|
|
32
|
+
}, 0);
|
|
177
33
|
}
|
|
178
34
|
|
|
179
35
|
/**
|
|
@@ -227,11 +83,106 @@ function _processUpdate() {
|
|
|
227
83
|
*
|
|
228
84
|
* @deprecated
|
|
229
85
|
*/
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
86
|
+
const InteractionManagerStub = {
|
|
87
|
+
Events: {
|
|
88
|
+
interactionStart: 'interactionStart',
|
|
89
|
+
interactionComplete: 'interactionComplete',
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Schedule a function to run after all interactions have completed. Returns a cancellable
|
|
94
|
+
* "promise".
|
|
95
|
+
*
|
|
96
|
+
* @deprecated
|
|
97
|
+
*/
|
|
98
|
+
runAfterInteractions(task: ?Task): {
|
|
99
|
+
then: <U>(
|
|
100
|
+
onFulfill?: ?(void) => ?(Promise<U> | U),
|
|
101
|
+
onReject?: ?(error: mixed) => ?(Promise<U> | U),
|
|
102
|
+
) => Promise<U>,
|
|
103
|
+
cancel: () => void,
|
|
104
|
+
...
|
|
105
|
+
} {
|
|
106
|
+
let immediateID: ?$FlowFixMe;
|
|
107
|
+
const promise = new Promise(resolve => {
|
|
108
|
+
immediateID = setImmediate(() => {
|
|
109
|
+
if (typeof task === 'object' && task !== null) {
|
|
110
|
+
if (typeof task.gen === 'function') {
|
|
111
|
+
task.gen().then(resolve, reject);
|
|
112
|
+
} else if (typeof task.run === 'function') {
|
|
113
|
+
try {
|
|
114
|
+
task.run();
|
|
115
|
+
resolve();
|
|
116
|
+
} catch (error) {
|
|
117
|
+
reject(error);
|
|
118
|
+
}
|
|
119
|
+
} else {
|
|
120
|
+
reject(new TypeError(`Task "${task.name}" missing gen or run.`));
|
|
121
|
+
}
|
|
122
|
+
} else if (typeof task === 'function') {
|
|
123
|
+
try {
|
|
124
|
+
task();
|
|
125
|
+
resolve();
|
|
126
|
+
} catch (error) {
|
|
127
|
+
reject(error);
|
|
128
|
+
}
|
|
129
|
+
} else {
|
|
130
|
+
reject(new TypeError('Invalid task of type: ' + typeof task));
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
return {
|
|
136
|
+
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
|
|
137
|
+
then: promise.then.bind(promise),
|
|
138
|
+
cancel() {
|
|
139
|
+
clearImmediate(immediateID);
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Notify manager that an interaction has started.
|
|
146
|
+
*
|
|
147
|
+
* @deprecated
|
|
148
|
+
*/
|
|
149
|
+
createInteractionHandle(): Handle {
|
|
150
|
+
return -1;
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Notify manager that an interaction has completed.
|
|
155
|
+
*
|
|
156
|
+
* @deprecated
|
|
157
|
+
*/
|
|
158
|
+
clearInteractionHandle(handle: Handle) {
|
|
159
|
+
invariant(!!handle, 'InteractionManager: Must provide a handle to clear.');
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* @deprecated
|
|
164
|
+
*/
|
|
165
|
+
addListener(
|
|
166
|
+
eventType: string,
|
|
167
|
+
// $FlowFixMe[unclear-type]
|
|
168
|
+
listener: (...args: any) => mixed,
|
|
169
|
+
context: mixed,
|
|
170
|
+
): EventSubscription {
|
|
171
|
+
return {
|
|
172
|
+
remove() {},
|
|
173
|
+
};
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* A positive number will use setTimeout to schedule any tasks after the
|
|
178
|
+
* eventLoopRunningTime hits the deadline value, otherwise all tasks will be
|
|
179
|
+
* executed in one setImmediate batch (default).
|
|
180
|
+
*
|
|
181
|
+
* @deprecated
|
|
182
|
+
*/
|
|
183
|
+
setDeadline(deadline: number) {
|
|
184
|
+
// Do nothing.
|
|
185
|
+
},
|
|
186
|
+
};
|
|
236
187
|
|
|
237
|
-
export default
|
|
188
|
+
export default InteractionManagerStub;
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
import type {GestureResponderEvent} from '../Types/CoreEventTypes';
|
|
14
14
|
|
|
15
|
-
const InteractionManager = require('./InteractionManager').default;
|
|
16
15
|
const TouchHistoryMath = require('./TouchHistoryMath').default;
|
|
17
16
|
|
|
18
17
|
const currentCentroidXOfTouchesChangedAfter =
|
|
@@ -31,9 +30,6 @@ const currentCentroidY = TouchHistoryMath.currentCentroidY;
|
|
|
31
30
|
* single-touch gestures resilient to extra touches, and can be used to
|
|
32
31
|
* recognize simple multi-touch gestures.
|
|
33
32
|
*
|
|
34
|
-
* By default, `PanResponder` holds an `InteractionManager` handle to block
|
|
35
|
-
* long-running JS events from interrupting active gestures.
|
|
36
|
-
*
|
|
37
33
|
* It provides a predictable wrapper of the responder handlers provided by the
|
|
38
34
|
* [gesture responder system](docs/gesture-responder-system.html).
|
|
39
35
|
* For each handler, it provides a new `gestureState` object alongside the
|
|
@@ -405,9 +401,6 @@ const PanResponder = {
|
|
|
405
401
|
getInteractionHandle: () => ?number,
|
|
406
402
|
panHandlers: GestureResponderHandlerMethods,
|
|
407
403
|
} {
|
|
408
|
-
const interactionState = {
|
|
409
|
-
handle: (null: ?number),
|
|
410
|
-
};
|
|
411
404
|
const gestureState: PanResponderGestureState = {
|
|
412
405
|
// Useful for debugging
|
|
413
406
|
stateID: Math.random(),
|
|
@@ -422,7 +415,7 @@ const PanResponder = {
|
|
|
422
415
|
numberActiveTouches: 0,
|
|
423
416
|
_accountsForMovesUpTo: 0,
|
|
424
417
|
};
|
|
425
|
-
const panHandlers = {
|
|
418
|
+
const panHandlers: GestureResponderHandlerMethods = {
|
|
426
419
|
onStartShouldSetResponder(event: GestureResponderEvent): boolean {
|
|
427
420
|
return config.onStartShouldSetPanResponder == null
|
|
428
421
|
? false
|
|
@@ -464,10 +457,6 @@ const PanResponder = {
|
|
|
464
457
|
},
|
|
465
458
|
|
|
466
459
|
onResponderGrant(event: GestureResponderEvent): boolean {
|
|
467
|
-
if (!interactionState.handle) {
|
|
468
|
-
interactionState.handle =
|
|
469
|
-
InteractionManager.createInteractionHandle();
|
|
470
|
-
}
|
|
471
460
|
gestureState.x0 = currentCentroidX(event.touchHistory);
|
|
472
461
|
gestureState.y0 = currentCentroidY(event.touchHistory);
|
|
473
462
|
gestureState.dx = 0;
|
|
@@ -482,21 +471,11 @@ const PanResponder = {
|
|
|
482
471
|
},
|
|
483
472
|
|
|
484
473
|
onResponderReject(event: GestureResponderEvent): void {
|
|
485
|
-
|
|
486
|
-
interactionState,
|
|
487
|
-
config.onPanResponderReject,
|
|
488
|
-
event,
|
|
489
|
-
gestureState,
|
|
490
|
-
);
|
|
474
|
+
config.onPanResponderReject?.call(undefined, event, gestureState);
|
|
491
475
|
},
|
|
492
476
|
|
|
493
477
|
onResponderRelease(event: GestureResponderEvent): void {
|
|
494
|
-
|
|
495
|
-
interactionState,
|
|
496
|
-
config.onPanResponderRelease,
|
|
497
|
-
event,
|
|
498
|
-
gestureState,
|
|
499
|
-
);
|
|
478
|
+
config.onPanResponderRelease?.call(undefined, event, gestureState);
|
|
500
479
|
PanResponder._initializeGestureState(gestureState);
|
|
501
480
|
},
|
|
502
481
|
|
|
@@ -529,21 +508,11 @@ const PanResponder = {
|
|
|
529
508
|
onResponderEnd(event: GestureResponderEvent): void {
|
|
530
509
|
const touchHistory = event.touchHistory;
|
|
531
510
|
gestureState.numberActiveTouches = touchHistory.numberActiveTouches;
|
|
532
|
-
|
|
533
|
-
interactionState,
|
|
534
|
-
config.onPanResponderEnd,
|
|
535
|
-
event,
|
|
536
|
-
gestureState,
|
|
537
|
-
);
|
|
511
|
+
config.onPanResponderEnd?.call(undefined, event, gestureState);
|
|
538
512
|
},
|
|
539
513
|
|
|
540
514
|
onResponderTerminate(event: GestureResponderEvent): void {
|
|
541
|
-
|
|
542
|
-
interactionState,
|
|
543
|
-
config.onPanResponderTerminate,
|
|
544
|
-
event,
|
|
545
|
-
gestureState,
|
|
546
|
-
);
|
|
515
|
+
config.onPanResponderTerminate?.call(undefined, event, gestureState);
|
|
547
516
|
PanResponder._initializeGestureState(gestureState);
|
|
548
517
|
},
|
|
549
518
|
|
|
@@ -556,27 +525,13 @@ const PanResponder = {
|
|
|
556
525
|
return {
|
|
557
526
|
panHandlers,
|
|
558
527
|
getInteractionHandle(): ?number {
|
|
559
|
-
|
|
528
|
+
// TODO: Deprecate and delete this method.
|
|
529
|
+
return null;
|
|
560
530
|
},
|
|
561
531
|
};
|
|
562
532
|
},
|
|
563
533
|
};
|
|
564
534
|
|
|
565
|
-
function clearInteractionHandle(
|
|
566
|
-
interactionState: {handle: ?number, ...},
|
|
567
|
-
callback: ?(ActiveCallback | PassiveCallback),
|
|
568
|
-
event: GestureResponderEvent,
|
|
569
|
-
gestureState: PanResponderGestureState,
|
|
570
|
-
) {
|
|
571
|
-
if (interactionState.handle) {
|
|
572
|
-
InteractionManager.clearInteractionHandle(interactionState.handle);
|
|
573
|
-
interactionState.handle = null;
|
|
574
|
-
}
|
|
575
|
-
if (callback) {
|
|
576
|
-
callback(event, gestureState);
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
|
|
580
535
|
export type PanResponderInstance = ReturnType<(typeof PanResponder)['create']>;
|
|
581
536
|
|
|
582
537
|
export default PanResponder;
|
|
@@ -108,6 +108,8 @@ function configureNext(
|
|
|
108
108
|
if (UIManager?.configureNextLayoutAnimation) {
|
|
109
109
|
UIManager.configureNextLayoutAnimation(
|
|
110
110
|
config,
|
|
111
|
+
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
|
112
|
+
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
111
113
|
onAnimationComplete ?? function () {},
|
|
112
114
|
onAnimationDidFail ??
|
|
113
115
|
function () {} /* this should never be called in Non-Fabric */,
|
|
@@ -432,7 +432,7 @@ class FlatList<ItemT = any> extends React.PureComponent<FlatListProps<ItemT>> {
|
|
|
432
432
|
}));
|
|
433
433
|
} else if (this.props.onViewableItemsChanged) {
|
|
434
434
|
this._virtualizedListPairs.push({
|
|
435
|
-
/* $FlowFixMe[incompatible-
|
|
435
|
+
/* $FlowFixMe[incompatible-type] (>=0.63.0 site=react_native_fb) This
|
|
436
436
|
* comment suppresses an error found when Flow v0.63 was deployed. To
|
|
437
437
|
* see the error delete this comment and run Flow. */
|
|
438
438
|
viewabilityConfig: this.props.viewabilityConfig,
|
|
@@ -569,7 +569,7 @@ class FlatList<ItemT = any> extends React.PureComponent<FlatListProps<ItemT>> {
|
|
|
569
569
|
.join(':');
|
|
570
570
|
}
|
|
571
571
|
|
|
572
|
-
// $FlowFixMe[incompatible-
|
|
572
|
+
// $FlowFixMe[incompatible-type] Can't call keyExtractor with an array
|
|
573
573
|
return keyExtractor(items, index);
|
|
574
574
|
};
|
|
575
575
|
|
|
@@ -626,11 +626,10 @@ class FlatList<ItemT = any> extends React.PureComponent<FlatListProps<ItemT>> {
|
|
|
626
626
|
const render = (props: ListRenderItemInfo<ItemT>): React.Node => {
|
|
627
627
|
if (ListItemComponent) {
|
|
628
628
|
// $FlowFixMe[not-a-component] Component isn't valid
|
|
629
|
-
// $FlowFixMe[incompatible-type
|
|
630
|
-
// $FlowFixMe[incompatible-return] Component isn't valid
|
|
629
|
+
// $FlowFixMe[incompatible-type] Component isn't valid
|
|
631
630
|
return <ListItemComponent {...props} />;
|
|
632
631
|
} else if (renderItem) {
|
|
633
|
-
// $FlowFixMe[incompatible-
|
|
632
|
+
// $FlowFixMe[incompatible-type]
|
|
634
633
|
return renderItem(props);
|
|
635
634
|
} else {
|
|
636
635
|
return null;
|
|
@@ -648,7 +647,7 @@ class FlatList<ItemT = any> extends React.PureComponent<FlatListProps<ItemT>> {
|
|
|
648
647
|
<View style={StyleSheet.compose(styles.row, columnWrapperStyle)}>
|
|
649
648
|
{item.map((it, kk) => {
|
|
650
649
|
const element = render({
|
|
651
|
-
// $FlowFixMe[incompatible-
|
|
650
|
+
// $FlowFixMe[incompatible-type]
|
|
652
651
|
item: it,
|
|
653
652
|
index: index * cols + kk,
|
|
654
653
|
separators: info.separators,
|
|
@@ -20,7 +20,6 @@ import type {
|
|
|
20
20
|
|
|
21
21
|
import DebuggerSessionObserver from '../../../src/private/devsupport/rndevtools/FuseboxSessionObserver';
|
|
22
22
|
import parseErrorStack from '../../Core/Devtools/parseErrorStack';
|
|
23
|
-
import NativeDevSettings from '../../NativeModules/specs/NativeDevSettings';
|
|
24
23
|
import NativeLogBox from '../../NativeModules/specs/NativeLogBox';
|
|
25
24
|
import LogBoxLog from './LogBoxLog';
|
|
26
25
|
import {parseLogBoxException} from './parseLogBoxLog';
|
|
@@ -443,7 +442,7 @@ export function withSubscription(
|
|
|
443
442
|
componentDidCatch(err: Error, errorInfo: {componentStack: string, ...}) {
|
|
444
443
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for
|
|
445
444
|
* this parameters */
|
|
446
|
-
// $FlowFixMe[incompatible-
|
|
445
|
+
// $FlowFixMe[incompatible-type]
|
|
447
446
|
reportLogBoxError(err, errorInfo.componentStack);
|
|
448
447
|
}
|
|
449
448
|
|
|
@@ -493,6 +492,10 @@ function showFuseboxWarningsMigrationMessageOnce() {
|
|
|
493
492
|
return;
|
|
494
493
|
}
|
|
495
494
|
hasShownFuseboxWarningsMigrationMessage = true;
|
|
495
|
+
|
|
496
|
+
const NativeDevSettings =
|
|
497
|
+
require('../../NativeModules/specs/NativeDevSettings').default;
|
|
498
|
+
|
|
496
499
|
appendNewLog(
|
|
497
500
|
new LogBoxLog({
|
|
498
501
|
level: 'warn',
|
|
@@ -509,7 +509,7 @@ export function parseLogBoxLog(args: $ReadOnlyArray<mixed>): {
|
|
|
509
509
|
return {
|
|
510
510
|
...parseInterpolation(argsWithoutComponentStack),
|
|
511
511
|
componentStack,
|
|
512
|
-
/* $FlowFixMe[incompatible-
|
|
512
|
+
/* $FlowFixMe[incompatible-type] Natural Inference rollout. See
|
|
513
513
|
* https://fburl.com/workplace/6291gfvu */
|
|
514
514
|
componentStackType,
|
|
515
515
|
};
|
|
@@ -61,7 +61,7 @@ export default function LogBoxInspectorHeader(props: Props): React.Node {
|
|
|
61
61
|
id="logbox_header_button_prev"
|
|
62
62
|
disabled={props.total <= 1}
|
|
63
63
|
level={props.level}
|
|
64
|
-
image={
|
|
64
|
+
image={new String('←')}
|
|
65
65
|
onPress={() => props.onSelectIndex(prevIndex)}
|
|
66
66
|
/>
|
|
67
67
|
<View style={styles.title}>
|
|
@@ -73,7 +73,7 @@ export default function LogBoxInspectorHeader(props: Props): React.Node {
|
|
|
73
73
|
id="logbox_header_button_next"
|
|
74
74
|
disabled={props.total <= 1}
|
|
75
75
|
level={props.level}
|
|
76
|
-
image={
|
|
76
|
+
image={new String('→')}
|
|
77
77
|
onPress={() => props.onSelectIndex(nextIndex)}
|
|
78
78
|
/>
|
|
79
79
|
</View>
|
package/Libraries/Modal/Modal.js
CHANGED
|
@@ -292,7 +292,7 @@ class Modal extends React.Component<ModalProps, ModalState> {
|
|
|
292
292
|
backgroundColor:
|
|
293
293
|
this.props.transparent === true
|
|
294
294
|
? 'transparent'
|
|
295
|
-
: this.props.backdropColor ?? 'white',
|
|
295
|
+
: (this.props.backdropColor ?? 'white'),
|
|
296
296
|
};
|
|
297
297
|
|
|
298
298
|
let animationType = this.props.animationType || 'none';
|
|
@@ -370,13 +370,13 @@ const styles = StyleSheet.create({
|
|
|
370
370
|
modal: {
|
|
371
371
|
position: 'absolute',
|
|
372
372
|
},
|
|
373
|
-
/* $FlowFixMe[incompatible-
|
|
373
|
+
/* $FlowFixMe[incompatible-type] Natural Inference rollout. See
|
|
374
374
|
* https://fburl.com/workplace/6291gfvu */
|
|
375
375
|
container: {
|
|
376
376
|
/* $FlowFixMe[invalid-computed-prop] (>=0.111.0 site=react_native_fb) This
|
|
377
377
|
* comment suppresses an error found when Flow v0.111 was deployed. To see
|
|
378
378
|
* the error, delete this comment and run Flow. */
|
|
379
|
-
// $FlowFixMe[incompatible-
|
|
379
|
+
// $FlowFixMe[incompatible-type]
|
|
380
380
|
[side]: 0,
|
|
381
381
|
top: 0,
|
|
382
382
|
flex: 1,
|
|
@@ -32,7 +32,7 @@ export function createViewConfig(
|
|
|
32
32
|
PlatformBaseViewConfig.directEventTypes,
|
|
33
33
|
partialViewConfig.directEventTypes,
|
|
34
34
|
),
|
|
35
|
-
// $FlowFixMe[incompatible-
|
|
35
|
+
// $FlowFixMe[incompatible-type]
|
|
36
36
|
validAttributes: composeIndexers(
|
|
37
37
|
// $FlowFixMe[incompatible-call] `style` property confuses Flow.
|
|
38
38
|
PlatformBaseViewConfig.validAttributes,
|
|
@@ -47,6 +47,6 @@ function composeIndexers<T>(
|
|
|
47
47
|
maybeB: ?{+[string]: T},
|
|
48
48
|
): {+[string]: T} {
|
|
49
49
|
return maybeA == null || maybeB == null
|
|
50
|
-
? maybeA ?? maybeB ?? {}
|
|
50
|
+
? (maybeA ?? maybeB ?? {})
|
|
51
51
|
: {...maybeA, ...maybeB};
|
|
52
52
|
}
|
|
@@ -53,7 +53,7 @@ const RCTNetworking = {
|
|
|
53
53
|
listener: (...RCTNetworkingEventDefinitions[K]) => mixed,
|
|
54
54
|
context?: mixed,
|
|
55
55
|
): EventSubscription {
|
|
56
|
-
// $FlowFixMe[incompatible-
|
|
56
|
+
// $FlowFixMe[incompatible-type]
|
|
57
57
|
return emitter.addListener(eventType, listener, context);
|
|
58
58
|
},
|
|
59
59
|
|
|
@@ -23,7 +23,7 @@ const RCTNetworking = {
|
|
|
23
23
|
listener: (...RCTNetworkingEventDefinitions[K]) => mixed,
|
|
24
24
|
context?: mixed,
|
|
25
25
|
): EventSubscription {
|
|
26
|
-
// $FlowFixMe[incompatible-
|
|
26
|
+
// $FlowFixMe[incompatible-type]
|
|
27
27
|
return RCTDeviceEventEmitter.addListener(eventType, listener, context);
|
|
28
28
|
},
|
|
29
29
|
|
|
@@ -23,7 +23,7 @@ const RCTNetworking = {
|
|
|
23
23
|
listener: (...RCTNetworkingEventDefinitions[K]) => mixed,
|
|
24
24
|
context?: mixed,
|
|
25
25
|
): EventSubscription {
|
|
26
|
-
// $FlowFixMe[incompatible-
|
|
26
|
+
// $FlowFixMe[incompatible-type]
|
|
27
27
|
return RCTDeviceEventEmitter.addListener(eventType, listener, context);
|
|
28
28
|
},
|
|
29
29
|
|