@office-iss/react-native-win32 0.69.0-preview.3 → 0.70.0-preview.1
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/.eslintrc.js +0 -1
- package/.flowconfig +5 -1
- package/CHANGELOG.json +221 -17
- package/CHANGELOG.md +88 -10
- package/IntegrationTests/AsyncStorageTest.js +20 -4
- package/IntegrationTests/BUCK +2 -2
- package/IntegrationTests/LayoutEventsTest.js +4 -1
- package/IntegrationTests/{launchWebSocketServer.command → launchWebSocketServer.sh} +3 -9
- package/Libraries/Alert/Alert.js +18 -4
- package/Libraries/Alert/Alert.win32.js +2 -0
- package/Libraries/Alert/NativeAlertManager.js +1 -0
- package/Libraries/Animated/Animated.js +2 -2
- package/Libraries/Animated/AnimatedEvent.js +7 -4
- package/Libraries/Animated/AnimatedImplementation.js +17 -3
- package/Libraries/Animated/AnimatedMock.js +7 -2
- package/Libraries/Animated/NativeAnimatedHelper.js +220 -95
- package/Libraries/Animated/NativeAnimatedModule.js +3 -0
- package/Libraries/Animated/NativeAnimatedTurboModule.js +3 -0
- package/Libraries/Animated/animations/SpringAnimation.js +3 -3
- package/Libraries/Animated/animations/TimingAnimation.js +3 -3
- package/Libraries/Animated/createAnimatedComponent.js +8 -1
- package/Libraries/Animated/nodes/AnimatedAddition.js +3 -1
- package/Libraries/Animated/nodes/AnimatedColor.js +50 -29
- package/Libraries/Animated/nodes/AnimatedDiffClamp.js +3 -1
- package/Libraries/Animated/nodes/AnimatedDivision.js +3 -1
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +22 -21
- package/Libraries/Animated/nodes/AnimatedModulo.js +3 -1
- package/Libraries/Animated/nodes/AnimatedMultiplication.js +3 -2
- package/Libraries/Animated/nodes/AnimatedProps.js +20 -12
- package/Libraries/Animated/nodes/AnimatedStyle.js +19 -16
- package/Libraries/Animated/nodes/AnimatedSubtraction.js +3 -1
- package/Libraries/Animated/nodes/AnimatedTransform.js +5 -5
- package/Libraries/Animated/nodes/AnimatedValue.js +14 -5
- package/Libraries/Animated/nodes/AnimatedValueXY.js +28 -1
- package/Libraries/Animated/useAnimatedProps.js +1 -0
- package/Libraries/AppState/AppState.js +0 -32
- package/Libraries/BatchedBridge/MessageQueue.js +21 -15
- package/Libraries/BatchedBridge/NativeModules.js +3 -4
- package/Libraries/Blob/FileReader.js +0 -6
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +0 -20
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +0 -20
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -0
- package/Libraries/Components/Keyboard/Keyboard.js +0 -11
- package/Libraries/Components/Pressable/Pressable.js +2 -0
- package/Libraries/Components/Pressable/Pressable.win32.js +2 -0
- package/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +1 -3
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +3 -30
- package/Libraries/Components/SafeAreaView/SafeAreaView.win32.js +4 -32
- package/Libraries/Components/ScrollView/ScrollView.js +13 -11
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +5 -3
- package/Libraries/Components/StatusBar/StatusBar.js +10 -7
- package/Libraries/Components/TextInput/InputAccessoryView.js +14 -13
- package/Libraries/Components/TextInput/TextInput.js +12 -2
- package/Libraries/Components/Touchable/PooledClass.js +16 -4
- package/Libraries/Components/Touchable/Touchable.js +50 -1
- package/Libraries/Components/Touchable/Touchable.win32.js +972 -0
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +6 -2
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +0 -7
- package/Libraries/Components/View/ViewPropTypes.js +3 -8
- package/Libraries/Components/View/ViewPropTypes.win32.js +3 -8
- package/Libraries/Core/ExceptionsManager.js +2 -0
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Core/Timers/JSTimers.js +2 -2
- package/Libraries/Core/polyfillPromise.js +0 -32
- package/Libraries/Core/setUpBatchedBridge.js +5 -1
- package/Libraries/Core/setUpPerformance.js +1 -1
- package/Libraries/EventEmitter/NativeEventEmitter.js +0 -13
- package/Libraries/Image/AssetSourceResolver.js +2 -2
- package/Libraries/Image/Image.android.js +5 -3
- package/Libraries/Image/Image.ios.js +6 -3
- package/Libraries/Image/Image.win32.js +6 -3
- package/Libraries/Image/ImageSource.js +7 -5
- package/Libraries/Inspector/ElementBox.js +2 -2
- package/Libraries/Inspector/NetworkOverlay.js +13 -8
- package/Libraries/Interaction/PanResponder.js +16 -14
- package/Libraries/Linking/Linking.js +0 -11
- package/Libraries/Lists/FlatList.js +3 -2
- package/Libraries/Lists/SectionList.js +2 -0
- package/Libraries/Lists/ViewabilityHelper.js +7 -3
- package/Libraries/Lists/VirtualizeUtils.js +33 -20
- package/Libraries/Lists/VirtualizedList.js +93 -47
- package/Libraries/Lists/VirtualizedListContext.js +1 -0
- package/Libraries/Lists/VirtualizedSectionList.js +14 -9
- package/Libraries/Lists/__tests__/VirtualizeUtils-test.js +19 -18
- package/Libraries/Lists/__tests__/VirtualizedList-test.js +10 -6
- package/Libraries/LogBox/Data/LogBoxData.js +1 -1
- package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
- package/Libraries/LogBox/LogBox.js +3 -1
- package/Libraries/LogBox/UI/AnsiHighlight.js +2 -0
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +3 -0
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +0 -3
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +8 -3
- package/Libraries/NativeComponent/BaseViewConfig.android.js +9 -18
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +26 -12
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +26 -12
- package/Libraries/Network/XMLHttpRequest.js +9 -11
- package/Libraries/Performance/PureComponentDebug.js +1 -0
- package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +9 -1
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +16 -0
- package/Libraries/Pressability/Pressability.js +26 -16
- package/Libraries/Pressability/Pressability.win32.js +26 -16
- package/Libraries/Promise.js +0 -1
- package/Libraries/ReactNative/AppRegistry.js +16 -13
- package/Libraries/ReactNative/BridgelessUIManager.js +2 -0
- package/Libraries/ReactNative/PaperUIManager.js +9 -9
- package/Libraries/ReactNative/PaperUIManager.win32.js +7 -8
- package/Libraries/ReactNative/ReactNativeFeatureFlags.js +12 -0
- package/Libraries/ReactNative/ReactNativeRuntimeDiagnostics.js +68 -0
- package/Libraries/ReactNative/getNativeComponentAttributes.js +6 -7
- package/Libraries/ReactNative/renderApplication.js +1 -1
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +4443 -3615
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +1496 -1170
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +1694 -1356
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +4439 -3588
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1583 -1249
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1719 -1372
- package/Libraries/Storage/AsyncStorage.js +7 -1
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +8 -0
- package/Libraries/StyleSheet/flattenStyle.js +1 -1
- package/Libraries/StyleSheet/processTransform.js +2 -0
- package/Libraries/StyleSheet/splitLayoutProps.js +2 -0
- package/Libraries/Text/Text.js +15 -7
- package/Libraries/Types/CoreEventTypes.js +137 -11
- package/Libraries/Types/CoreEventTypes.win32.js +147 -22
- package/Libraries/Utilities/Dimensions.js +0 -13
- package/Libraries/Utilities/Dimensions.win32.js +0 -9
- package/Libraries/Utilities/HMRClient.js +3 -3
- package/Libraries/Utilities/Platform.ios.js +0 -7
- package/Libraries/Utilities/ReactNativeTestTools.js +3 -1
- package/Libraries/Utilities/codegenNativeCommands.js +11 -2
- package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +2 -0
- package/Libraries/Utilities/stringifySafe.js +3 -1
- package/Libraries/Utilities/truncate.js +1 -1
- package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +2 -2
- package/Libraries/Vibration/Vibration.js +1 -1
- package/Libraries/WebSocket/WebSocket.js +1 -0
- package/Libraries/vendor/emitter/EventEmitter.js +105 -12
- package/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js +73 -117
- package/flow/JSITimerInternalType.js +30 -0
- package/jest/assetFileTransformer.js +3 -2
- package/jest/setup.js +4 -0
- package/jest.config.js +0 -1
- package/overrides.json +23 -16
- package/package.json +21 -22
- package/rntypes/index.d.ts +0 -1
- package/src/rntypes/index.d.ts +0 -1
- package/Libraries/vendor/emitter/EventSubscription.js +0 -19
- package/Libraries/vendor/emitter/_EmitterSubscription.js +0 -62
- package/Libraries/vendor/emitter/_EventEmitter.js +0 -184
- package/Libraries/vendor/emitter/_EventSubscription.js +0 -45
- package/Libraries/vendor/emitter/_EventSubscriptionVendor.js +0 -108
- package/jest/preprocessor.js +0 -40
- package/jest/preprocessor_DO_NOT_USE.js +0 -122
- package/src/Libraries/Lists/__tests__/__snapshots__/VirtualizeUtils-test.js.snap +0 -3
|
@@ -127,38 +127,6 @@ class AppState {
|
|
|
127
127
|
}
|
|
128
128
|
throw new Error('Trying to subscribe to unknown event: ' + type);
|
|
129
129
|
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* @deprecated Use `remove` on the EventSubscription from `addEventListener`.
|
|
133
|
-
*/
|
|
134
|
-
removeEventListener<K: $Keys<AppStateEventDefinitions>>(
|
|
135
|
-
type: K,
|
|
136
|
-
listener: (...$ElementType<AppStateEventDefinitions, K>) => mixed,
|
|
137
|
-
): void {
|
|
138
|
-
const emitter = this._emitter;
|
|
139
|
-
if (emitter == null) {
|
|
140
|
-
throw new Error('Cannot use AppState when `isAvailable` is false.');
|
|
141
|
-
}
|
|
142
|
-
// NOTE: This will report a deprecation notice via `console.error`.
|
|
143
|
-
switch (type) {
|
|
144
|
-
case 'change':
|
|
145
|
-
// $FlowIssue[invalid-tuple-arity] Flow cannot refine handler based on the event type
|
|
146
|
-
// $FlowIssue[incompatible-call]
|
|
147
|
-
emitter.removeListener('appStateDidChange', listener);
|
|
148
|
-
return;
|
|
149
|
-
case 'memoryWarning':
|
|
150
|
-
// $FlowIssue[invalid-tuple-arity] Flow cannot refine handler based on the event type
|
|
151
|
-
emitter.removeListener('memoryWarning', listener);
|
|
152
|
-
return;
|
|
153
|
-
case 'blur':
|
|
154
|
-
case 'focus':
|
|
155
|
-
// $FlowIssue[invalid-tuple-arity] Flow cannot refine handler based on the event type
|
|
156
|
-
// $FlowIssue[incompatible-call]
|
|
157
|
-
emitter.removeListener('appStateFocusChange', listener);
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
throw new Error('Trying to unsubscribe from unknown event: ' + type);
|
|
161
|
-
}
|
|
162
130
|
}
|
|
163
131
|
|
|
164
132
|
module.exports = (new AppState(): AppState);
|
|
@@ -10,13 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
const ErrorUtils = require('../vendor/core/ErrorUtils');
|
|
14
13
|
const Systrace = require('../Performance/Systrace');
|
|
15
|
-
|
|
16
14
|
const deepFreezeAndThrowOnMutationInDev = require('../Utilities/deepFreezeAndThrowOnMutationInDev');
|
|
17
|
-
const invariant = require('invariant');
|
|
18
15
|
const stringifySafe = require('../Utilities/stringifySafe').default;
|
|
19
16
|
const warnOnce = require('../Utilities/warnOnce');
|
|
17
|
+
const ErrorUtils = require('../vendor/core/ErrorUtils');
|
|
18
|
+
const invariant = require('invariant');
|
|
20
19
|
|
|
21
20
|
export type SpyData = {
|
|
22
21
|
type: number,
|
|
@@ -199,7 +198,7 @@ class MessageQueue {
|
|
|
199
198
|
delete this._debugInfo[this._callID - DEBUG_INFO_LIMIT];
|
|
200
199
|
}
|
|
201
200
|
if (this._successCallbacks.size > 500) {
|
|
202
|
-
const info = {};
|
|
201
|
+
const info: {[number]: {method: string, module: string}} = {};
|
|
203
202
|
this._successCallbacks.forEach((_, callID) => {
|
|
204
203
|
const debug = this._debugInfo[callID];
|
|
205
204
|
const module = debug && this._remoteModuleTable[debug[0]];
|
|
@@ -253,7 +252,7 @@ class MessageQueue {
|
|
|
253
252
|
// folly-convertible. As a special case, if a prop value is a
|
|
254
253
|
// function it is permitted here, and special-cased in the
|
|
255
254
|
// conversion.
|
|
256
|
-
const isValidArgument = val => {
|
|
255
|
+
const isValidArgument = (val: mixed) => {
|
|
257
256
|
switch (typeof val) {
|
|
258
257
|
case 'undefined':
|
|
259
258
|
case 'boolean':
|
|
@@ -287,7 +286,7 @@ class MessageQueue {
|
|
|
287
286
|
// Replacement allows normally non-JSON-convertible values to be
|
|
288
287
|
// seen. There is ambiguity with string values, but in context,
|
|
289
288
|
// it should at least be a strong hint.
|
|
290
|
-
const replacer = (key, val) => {
|
|
289
|
+
const replacer = (key: string, val: $FlowFixMe) => {
|
|
291
290
|
const t = typeof val;
|
|
292
291
|
if (t === 'function') {
|
|
293
292
|
return '<<Function ' + val.name + '>>';
|
|
@@ -405,15 +404,22 @@ class MessageQueue {
|
|
|
405
404
|
this.__spy({type: TO_JS, module, method, args});
|
|
406
405
|
}
|
|
407
406
|
const moduleMethods = this.getCallableModule(module);
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
407
|
+
if (!moduleMethods) {
|
|
408
|
+
const callableModuleNames = Object.keys(this._lazyCallableModules);
|
|
409
|
+
const n = callableModuleNames.length;
|
|
410
|
+
const callableModuleNameList = callableModuleNames.join(', ');
|
|
411
|
+
invariant(
|
|
412
|
+
false,
|
|
413
|
+
`Failed to call into JavaScript module method ${module}.${method}(). Module has not been registered as callable. Registered callable JavaScript modules (n = ${n}): ${callableModuleNameList}.
|
|
414
|
+
A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.`,
|
|
415
|
+
);
|
|
416
|
+
}
|
|
417
|
+
if (!moduleMethods[method]) {
|
|
418
|
+
invariant(
|
|
419
|
+
false,
|
|
420
|
+
`Failed to call into JavaScript module method ${module}.${method}(). Module exists, but the method is undefined.`,
|
|
421
|
+
);
|
|
422
|
+
}
|
|
417
423
|
moduleMethods[method].apply(moduleMethods, args);
|
|
418
424
|
Systrace.endEvent();
|
|
419
425
|
}
|
|
@@ -10,12 +10,11 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
import type {ExtendedError} from '../Core/ExtendedError';
|
|
14
14
|
|
|
15
|
+
const BatchedBridge = require('./BatchedBridge');
|
|
15
16
|
const invariant = require('invariant');
|
|
16
17
|
|
|
17
|
-
import type {ExtendedError} from '../Core/ExtendedError';
|
|
18
|
-
|
|
19
18
|
export type ModuleConfig = [
|
|
20
19
|
string /* name */,
|
|
21
20
|
?{...} /* constants */,
|
|
@@ -51,7 +50,7 @@ function genModule(
|
|
|
51
50
|
return {name: moduleName};
|
|
52
51
|
}
|
|
53
52
|
|
|
54
|
-
const module = {};
|
|
53
|
+
const module: {[string]: mixed} = {};
|
|
55
54
|
methods &&
|
|
56
55
|
methods.forEach((methodName, methodID) => {
|
|
57
56
|
const isPromise =
|
|
@@ -46,7 +46,6 @@ class FileReader extends (EventTarget(...READER_EVENTS): any) {
|
|
|
46
46
|
_error: ?Error;
|
|
47
47
|
_result: ?ReaderResult;
|
|
48
48
|
_aborted: boolean = false;
|
|
49
|
-
_subscriptions: Array<any> = [];
|
|
50
49
|
|
|
51
50
|
constructor() {
|
|
52
51
|
super();
|
|
@@ -59,11 +58,6 @@ class FileReader extends (EventTarget(...READER_EVENTS): any) {
|
|
|
59
58
|
this._result = null;
|
|
60
59
|
}
|
|
61
60
|
|
|
62
|
-
_clearSubscriptions(): void {
|
|
63
|
-
this._subscriptions.forEach(sub => sub.remove());
|
|
64
|
-
this._subscriptions = [];
|
|
65
|
-
}
|
|
66
|
-
|
|
67
61
|
_setReadyState(newState: ReadyState) {
|
|
68
62
|
this._readyState = newState;
|
|
69
63
|
this.dispatchEvent({type: 'readystatechange'});
|
|
@@ -12,7 +12,6 @@ import RCTDeviceEventEmitter from '../../EventEmitter/RCTDeviceEventEmitter';
|
|
|
12
12
|
import {sendAccessibilityEvent} from '../../Renderer/shims/ReactNative';
|
|
13
13
|
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
|
14
14
|
import Platform from '../../Utilities/Platform';
|
|
15
|
-
import type EventEmitter from '../../vendor/emitter/EventEmitter';
|
|
16
15
|
import type {EventSubscription} from '../../vendor/emitter/EventEmitter';
|
|
17
16
|
import NativeAccessibilityInfoAndroid from './NativeAccessibilityInfo';
|
|
18
17
|
import NativeAccessibilityManagerIOS from './NativeAccessibilityManager';
|
|
@@ -365,25 +364,6 @@ const AccessibilityInfo = {
|
|
|
365
364
|
}
|
|
366
365
|
},
|
|
367
366
|
|
|
368
|
-
/**
|
|
369
|
-
* @deprecated Use `remove` on the EventSubscription from `addEventListener`.
|
|
370
|
-
*/
|
|
371
|
-
removeEventListener<K: $Keys<AccessibilityEventDefinitions>>(
|
|
372
|
-
eventName: K,
|
|
373
|
-
handler: (...$ElementType<AccessibilityEventDefinitions, K>) => void,
|
|
374
|
-
): void {
|
|
375
|
-
// NOTE: This will report a deprecation notice via `console.error`.
|
|
376
|
-
const deviceEventName = EventNames.get(eventName);
|
|
377
|
-
if (deviceEventName != null) {
|
|
378
|
-
// $FlowIgnore[incompatible-cast]
|
|
379
|
-
(RCTDeviceEventEmitter: EventEmitter<$FlowFixMe>).removeListener(
|
|
380
|
-
'deviceEventName',
|
|
381
|
-
// $FlowFixMe[invalid-tuple-arity]
|
|
382
|
-
handler,
|
|
383
|
-
);
|
|
384
|
-
}
|
|
385
|
-
},
|
|
386
|
-
|
|
387
367
|
/**
|
|
388
368
|
* Get the recommended timeout for changes to the UI needed by this user.
|
|
389
369
|
*
|
|
@@ -12,7 +12,6 @@ import RCTDeviceEventEmitter from '../../EventEmitter/RCTDeviceEventEmitter';
|
|
|
12
12
|
import {sendAccessibilityEvent} from '../../Renderer/shims/ReactNative';
|
|
13
13
|
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
|
14
14
|
import Platform from '../../Utilities/Platform';
|
|
15
|
-
import type EventEmitter from '../../vendor/emitter/EventEmitter';
|
|
16
15
|
import type {EventSubscription} from '../../vendor/emitter/EventEmitter';
|
|
17
16
|
import NativeAccessibilityInfo from './NativeAccessibilityInfo';
|
|
18
17
|
import NativeAccessibilityManagerIOS from './NativeAccessibilityManager';
|
|
@@ -371,25 +370,6 @@ const AccessibilityInfo = {
|
|
|
371
370
|
}
|
|
372
371
|
},
|
|
373
372
|
|
|
374
|
-
/**
|
|
375
|
-
* @deprecated Use `remove` on the EventSubscription from `addEventListener`.
|
|
376
|
-
*/
|
|
377
|
-
removeEventListener<K: $Keys<AccessibilityEventDefinitions>>(
|
|
378
|
-
eventName: K,
|
|
379
|
-
handler: (...$ElementType<AccessibilityEventDefinitions, K>) => void,
|
|
380
|
-
): void {
|
|
381
|
-
// NOTE: This will report a deprecation notice via `console.error`.
|
|
382
|
-
const deviceEventName = EventNames.get(eventName);
|
|
383
|
-
if (deviceEventName != null) {
|
|
384
|
-
// $FlowIgnore[incompatible-cast]
|
|
385
|
-
(RCTDeviceEventEmitter: EventEmitter<$FlowFixMe>).removeListener(
|
|
386
|
-
'deviceEventName',
|
|
387
|
-
// $FlowFixMe[invalid-tuple-arity]
|
|
388
|
-
handler,
|
|
389
|
-
);
|
|
390
|
-
}
|
|
391
|
-
},
|
|
392
|
-
|
|
393
373
|
/**
|
|
394
374
|
* Get the recommended timeout for changes to the UI needed by this user.
|
|
395
375
|
*
|
|
@@ -232,6 +232,8 @@ class DrawerLayoutAndroid extends React.Component<Props, State> {
|
|
|
232
232
|
);
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
+
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
|
|
236
|
+
* LTI update could not be added via codemod */
|
|
235
237
|
_onDrawerSlide = event => {
|
|
236
238
|
if (this.props.onDrawerSlide) {
|
|
237
239
|
this.props.onDrawerSlide(event);
|
|
@@ -253,6 +255,8 @@ class DrawerLayoutAndroid extends React.Component<Props, State> {
|
|
|
253
255
|
}
|
|
254
256
|
};
|
|
255
257
|
|
|
258
|
+
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
|
|
259
|
+
* LTI update could not be added via codemod */
|
|
256
260
|
_onDrawerStateChanged = event => {
|
|
257
261
|
if (this.props.onDrawerStateChanged) {
|
|
258
262
|
this.props.onDrawerStateChanged(
|
|
@@ -141,17 +141,6 @@ class Keyboard {
|
|
|
141
141
|
return this._emitter.addListener(eventType, listener);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
/**
|
|
145
|
-
* @deprecated Use `remove` on the EventSubscription from `addListener`.
|
|
146
|
-
*/
|
|
147
|
-
removeListener<K: $Keys<KeyboardEventDefinitions>>(
|
|
148
|
-
eventType: K,
|
|
149
|
-
listener: (...$ElementType<KeyboardEventDefinitions, K>) => mixed,
|
|
150
|
-
): void {
|
|
151
|
-
// NOTE: This will report a deprecation notice via `console.error`.
|
|
152
|
-
this._emitter.removeListener(eventType, listener);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
144
|
/**
|
|
156
145
|
* Removes all listeners for a specific event type.
|
|
157
146
|
*
|
|
@@ -170,6 +170,8 @@ type Props = $ReadOnly<{|
|
|
|
170
170
|
* Component used to build display components that should respond to whether the
|
|
171
171
|
* component is currently pressed or not.
|
|
172
172
|
*/
|
|
173
|
+
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
|
|
174
|
+
* LTI update could not be added via codemod */
|
|
173
175
|
function Pressable(props: Props, forwardedRef): React.Node {
|
|
174
176
|
const {
|
|
175
177
|
accessible,
|
|
@@ -216,6 +216,8 @@ type Props = $ReadOnly<{|
|
|
|
216
216
|
* Component used to build display components that should respond to whether the
|
|
217
217
|
* component is currently pressed or not.
|
|
218
218
|
*/
|
|
219
|
+
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
|
|
220
|
+
* LTI update could not be added via codemod */
|
|
219
221
|
function Pressable(props: Props, forwardedRef): React.Node {
|
|
220
222
|
const {
|
|
221
223
|
accessible,
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {ViewProps} from '../View/ViewPropTypes';
|
|
12
|
-
import type {WithDefault} from '../../Types/CodegenTypes';
|
|
13
12
|
|
|
14
13
|
import codegenNativeComponent from '../../Utilities/codegenNativeComponent';
|
|
15
14
|
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
|
@@ -17,8 +16,7 @@ import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
|
|
17
16
|
type NativeProps = $ReadOnly<{|
|
|
18
17
|
...ViewProps,
|
|
19
18
|
|
|
20
|
-
//
|
|
21
|
-
emulateUnlessSupported?: WithDefault<boolean, false>,
|
|
19
|
+
// No props
|
|
22
20
|
|}>;
|
|
23
21
|
|
|
24
22
|
export default (codegenNativeComponent<NativeProps>('SafeAreaView', {
|
|
@@ -12,18 +12,9 @@ import Platform from '../../Utilities/Platform';
|
|
|
12
12
|
import * as React from 'react';
|
|
13
13
|
import View from '../View/View';
|
|
14
14
|
|
|
15
|
-
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
|
16
15
|
import type {ViewProps} from '../View/ViewPropTypes';
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
...ViewProps,
|
|
20
|
-
emulateUnlessSupported?: boolean,
|
|
21
|
-
|}>;
|
|
22
|
-
|
|
23
|
-
let exported: React.AbstractComponent<
|
|
24
|
-
Props,
|
|
25
|
-
React.ElementRef<HostComponent<mixed>>,
|
|
26
|
-
>;
|
|
17
|
+
let exported: React.AbstractComponent<ViewProps, React.ElementRef<typeof View>>;
|
|
27
18
|
|
|
28
19
|
/**
|
|
29
20
|
* Renders nested content and automatically applies paddings reflect the portion
|
|
@@ -35,27 +26,9 @@ let exported: React.AbstractComponent<
|
|
|
35
26
|
* sensor housing area on iPhone X).
|
|
36
27
|
*/
|
|
37
28
|
if (Platform.OS === 'android') {
|
|
38
|
-
exported =
|
|
39
|
-
function SafeAreaView(props, forwardedRef) {
|
|
40
|
-
const {emulateUnlessSupported, ...localProps} = props;
|
|
41
|
-
return <View {...localProps} ref={forwardedRef} />;
|
|
42
|
-
},
|
|
43
|
-
);
|
|
29
|
+
exported = View;
|
|
44
30
|
} else {
|
|
45
|
-
|
|
46
|
-
require('./RCTSafeAreaViewNativeComponent').default;
|
|
47
|
-
|
|
48
|
-
exported = React.forwardRef<Props, React.ElementRef<HostComponent<mixed>>>(
|
|
49
|
-
function SafeAreaView(props, forwardedRef) {
|
|
50
|
-
return (
|
|
51
|
-
<RCTSafeAreaViewNativeComponent
|
|
52
|
-
emulateUnlessSupported={true}
|
|
53
|
-
{...props}
|
|
54
|
-
ref={forwardedRef}
|
|
55
|
-
/>
|
|
56
|
-
);
|
|
57
|
-
},
|
|
58
|
-
);
|
|
31
|
+
exported = require('./RCTSafeAreaViewNativeComponent').default;
|
|
59
32
|
}
|
|
60
33
|
|
|
61
34
|
export default exported;
|
|
@@ -12,18 +12,9 @@ import Platform from '../../Utilities/Platform';
|
|
|
12
12
|
import * as React from 'react';
|
|
13
13
|
import View from '../View/View';
|
|
14
14
|
|
|
15
|
-
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
|
16
15
|
import type {ViewProps} from '../View/ViewPropTypes';
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
...ViewProps,
|
|
20
|
-
emulateUnlessSupported?: boolean,
|
|
21
|
-
|}>;
|
|
22
|
-
|
|
23
|
-
let exported: React.AbstractComponent<
|
|
24
|
-
Props,
|
|
25
|
-
React.ElementRef<HostComponent<mixed>>,
|
|
26
|
-
>;
|
|
17
|
+
let exported: React.AbstractComponent<ViewProps, React.ElementRef<typeof View>>;
|
|
27
18
|
|
|
28
19
|
/**
|
|
29
20
|
* Renders nested content and automatically applies paddings reflect the portion
|
|
@@ -34,30 +25,11 @@ let exported: React.AbstractComponent<
|
|
|
34
25
|
* limitation of the screen, such as rounded corners or camera notches (aka
|
|
35
26
|
* sensor housing area on iPhone X).
|
|
36
27
|
*/
|
|
37
|
-
|
|
28
|
+
|
|
38
29
|
if (Platform.OS === 'android' || Platform.OS === 'win32') {
|
|
39
|
-
|
|
40
|
-
exported = React.forwardRef<Props, React.ElementRef<HostComponent<mixed>>>(
|
|
41
|
-
function SafeAreaView(props, forwardedRef) {
|
|
42
|
-
const {emulateUnlessSupported, ...localProps} = props;
|
|
43
|
-
return <View {...localProps} ref={forwardedRef} />;
|
|
44
|
-
},
|
|
45
|
-
);
|
|
30
|
+
exported = View;
|
|
46
31
|
} else {
|
|
47
|
-
|
|
48
|
-
require('./RCTSafeAreaViewNativeComponent').default;
|
|
49
|
-
|
|
50
|
-
exported = React.forwardRef<Props, React.ElementRef<HostComponent<mixed>>>(
|
|
51
|
-
function SafeAreaView(props, forwardedRef) {
|
|
52
|
-
return (
|
|
53
|
-
<RCTSafeAreaViewNativeComponent
|
|
54
|
-
emulateUnlessSupported={true}
|
|
55
|
-
{...props}
|
|
56
|
-
ref={forwardedRef}
|
|
57
|
-
/>
|
|
58
|
-
);
|
|
59
|
-
},
|
|
60
|
-
);
|
|
32
|
+
exported = require('./RCTSafeAreaViewNativeComponent').default;
|
|
61
33
|
}
|
|
62
34
|
|
|
63
35
|
export default exported;
|
|
@@ -173,8 +173,8 @@ type IOSProps = $ReadOnly<{|
|
|
|
173
173
|
*/
|
|
174
174
|
automaticallyAdjustContentInsets?: ?boolean,
|
|
175
175
|
/**
|
|
176
|
-
* Controls whether the ScrollView should automatically adjust
|
|
177
|
-
* and scrollViewInsets when the Keyboard changes
|
|
176
|
+
* Controls whether the ScrollView should automatically adjust its `contentInset`
|
|
177
|
+
* and `scrollViewInsets` when the Keyboard changes its size. The default value is false.
|
|
178
178
|
* @platform ios
|
|
179
179
|
*/
|
|
180
180
|
automaticallyAdjustKeyboardInsets?: ?boolean,
|
|
@@ -190,12 +190,6 @@ type IOSProps = $ReadOnly<{|
|
|
|
190
190
|
* @platform ios
|
|
191
191
|
*/
|
|
192
192
|
contentInset?: ?EdgeInsetsProp,
|
|
193
|
-
/**
|
|
194
|
-
* Used to manually set the starting scroll offset.
|
|
195
|
-
* The default value is `{x: 0, y: 0}`.
|
|
196
|
-
* @platform ios
|
|
197
|
-
*/
|
|
198
|
-
contentOffset?: ?PointProp,
|
|
199
193
|
/**
|
|
200
194
|
* When true, the scroll view bounces when it reaches the end of the
|
|
201
195
|
* content if the content is larger then the scroll view along the axis of
|
|
@@ -457,6 +451,11 @@ export type Props = $ReadOnly<{|
|
|
|
457
451
|
* ```
|
|
458
452
|
*/
|
|
459
453
|
contentContainerStyle?: ?ViewStyleProp,
|
|
454
|
+
/**
|
|
455
|
+
* Used to manually set the starting scroll offset.
|
|
456
|
+
* The default value is `{x: 0, y: 0}`.
|
|
457
|
+
*/
|
|
458
|
+
contentOffset?: ?PointProp,
|
|
460
459
|
/**
|
|
461
460
|
* When true, the scroll view stops on the next index (in relation to scroll
|
|
462
461
|
* position at release) regardless of how fast the gesture is. This can be
|
|
@@ -1108,7 +1107,7 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
1108
1107
|
}
|
|
1109
1108
|
};
|
|
1110
1109
|
|
|
1111
|
-
_getKeyForIndex(index, childArray) {
|
|
1110
|
+
_getKeyForIndex(index: $FlowFixMe, childArray: $FlowFixMe) {
|
|
1112
1111
|
const child = childArray[index];
|
|
1113
1112
|
return child && child.key;
|
|
1114
1113
|
}
|
|
@@ -1141,7 +1140,7 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
1141
1140
|
}
|
|
1142
1141
|
}
|
|
1143
1142
|
|
|
1144
|
-
_onStickyHeaderLayout(index, event, key) {
|
|
1143
|
+
_onStickyHeaderLayout(index: $FlowFixMe, event: $FlowFixMe, key: $FlowFixMe) {
|
|
1145
1144
|
const {stickyHeaderIndices} = this.props;
|
|
1146
1145
|
if (!stickyHeaderIndices) {
|
|
1147
1146
|
return;
|
|
@@ -1519,6 +1518,7 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
1519
1518
|
keyboardNeverPersistTaps &&
|
|
1520
1519
|
this._keyboardIsDismissible() &&
|
|
1521
1520
|
e.target != null &&
|
|
1521
|
+
// $FlowFixMe[incompatible-call]
|
|
1522
1522
|
!TextInputState.isTextInput(e.target)
|
|
1523
1523
|
) {
|
|
1524
1524
|
return true;
|
|
@@ -1822,7 +1822,9 @@ const styles = StyleSheet.create({
|
|
|
1822
1822
|
},
|
|
1823
1823
|
});
|
|
1824
1824
|
|
|
1825
|
-
|
|
1825
|
+
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
|
|
1826
|
+
* LTI update could not be added via codemod */
|
|
1827
|
+
function Wrapper(props, ref: (mixed => mixed) | {current: mixed, ...}) {
|
|
1826
1828
|
return <ScrollView {...props} scrollViewRef={ref} />;
|
|
1827
1829
|
}
|
|
1828
1830
|
Wrapper.displayName = 'ScrollView';
|
|
@@ -90,7 +90,7 @@ class ScrollViewStickyHeader extends React.Component<Props, State> {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
updateTranslateListener(
|
|
93
|
-
translateY:
|
|
93
|
+
translateY: AnimatedNode,
|
|
94
94
|
isFabric: boolean,
|
|
95
95
|
offset: AnimatedDiffClamp | null,
|
|
96
96
|
) {
|
|
@@ -177,6 +177,8 @@ class ScrollViewStickyHeader extends React.Component<Props, State> {
|
|
|
177
177
|
}
|
|
178
178
|
};
|
|
179
179
|
|
|
180
|
+
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
|
|
181
|
+
* LTI update could not be added via codemod */
|
|
180
182
|
_setComponentRef = ref => {
|
|
181
183
|
this._ref = ref;
|
|
182
184
|
};
|
|
@@ -274,11 +276,11 @@ class ScrollViewStickyHeader extends React.Component<Props, State> {
|
|
|
274
276
|
.interpolate({
|
|
275
277
|
extrapolateLeft: 'clamp',
|
|
276
278
|
inputRange: [layoutY, layoutY + 1],
|
|
277
|
-
outputRange:
|
|
279
|
+
outputRange: [0, 1],
|
|
278
280
|
})
|
|
279
281
|
.interpolate({
|
|
280
282
|
inputRange: [0, 1],
|
|
281
|
-
outputRange:
|
|
283
|
+
outputRange: [0, -1],
|
|
282
284
|
}),
|
|
283
285
|
-this.state.layoutHeight,
|
|
284
286
|
0,
|
|
@@ -112,14 +112,17 @@ function mergePropsStack(
|
|
|
112
112
|
propsStack: Array<Object>,
|
|
113
113
|
defaultValues: Object,
|
|
114
114
|
): Object {
|
|
115
|
-
return propsStack.reduce(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
return propsStack.reduce(
|
|
116
|
+
(prev, cur) => {
|
|
117
|
+
for (const prop in cur) {
|
|
118
|
+
if (cur[prop] != null) {
|
|
119
|
+
prev[prop] = cur[prop];
|
|
120
|
+
}
|
|
119
121
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
return prev;
|
|
123
|
+
},
|
|
124
|
+
{...defaultValues},
|
|
125
|
+
);
|
|
123
126
|
}
|
|
124
127
|
|
|
125
128
|
/**
|
|
@@ -88,22 +88,23 @@ type Props = $ReadOnly<{|
|
|
|
88
88
|
|
|
89
89
|
class InputAccessoryView extends React.Component<Props> {
|
|
90
90
|
render(): React.Node {
|
|
91
|
-
if (Platform.OS
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
if (Platform.OS === 'ios') {
|
|
92
|
+
if (React.Children.count(this.props.children) === 0) {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
94
95
|
|
|
95
|
-
|
|
96
|
+
return (
|
|
97
|
+
<RCTInputAccessoryViewNativeComponent
|
|
98
|
+
style={[this.props.style, styles.container]}
|
|
99
|
+
nativeID={this.props.nativeID}
|
|
100
|
+
backgroundColor={this.props.backgroundColor}>
|
|
101
|
+
{this.props.children}
|
|
102
|
+
</RCTInputAccessoryViewNativeComponent>
|
|
103
|
+
);
|
|
104
|
+
} else {
|
|
105
|
+
console.warn('<InputAccessoryView> is only supported on iOS.');
|
|
96
106
|
return null;
|
|
97
107
|
}
|
|
98
|
-
|
|
99
|
-
return (
|
|
100
|
-
<RCTInputAccessoryViewNativeComponent
|
|
101
|
-
style={[this.props.style, styles.container]}
|
|
102
|
-
nativeID={this.props.nativeID}
|
|
103
|
-
backgroundColor={this.props.backgroundColor}>
|
|
104
|
-
{this.props.children}
|
|
105
|
-
</RCTInputAccessoryViewNativeComponent>
|
|
106
|
-
);
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
110
|
|
|
@@ -392,6 +392,14 @@ type AndroidProps = $ReadOnly<{|
|
|
|
392
392
|
| 'off'
|
|
393
393
|
),
|
|
394
394
|
|
|
395
|
+
/**
|
|
396
|
+
* When provided it will set the color of the cursor (or "caret") in the component.
|
|
397
|
+
* Unlike the behavior of `selectionColor` the cursor color will be set independently
|
|
398
|
+
* from the color of the text selection box.
|
|
399
|
+
* @platform android
|
|
400
|
+
*/
|
|
401
|
+
cursorColor?: ?ColorValue,
|
|
402
|
+
|
|
395
403
|
/**
|
|
396
404
|
* When `false`, if there is a small amount of space available around a text input
|
|
397
405
|
* (e.g. landscape orientation on a phone), the OS may choose to have the user edit
|
|
@@ -968,6 +976,8 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
968
976
|
const text =
|
|
969
977
|
typeof props.value === 'string'
|
|
970
978
|
? props.value
|
|
979
|
+
: typeof lastNativeText === 'string'
|
|
980
|
+
? lastNativeText
|
|
971
981
|
: typeof props.defaultValue === 'string'
|
|
972
982
|
? props.defaultValue
|
|
973
983
|
: '';
|
|
@@ -976,7 +986,7 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
976
986
|
// that the update should be ignored and we should stick with the value
|
|
977
987
|
// that we have in JS.
|
|
978
988
|
useLayoutEffect(() => {
|
|
979
|
-
const nativeUpdate = {};
|
|
989
|
+
const nativeUpdate: {text?: string, selection?: Selection} = {};
|
|
980
990
|
|
|
981
991
|
if (lastNativeText !== props.value && typeof props.value === 'string') {
|
|
982
992
|
nativeUpdate.text = props.value;
|
|
@@ -1225,7 +1235,7 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1225
1235
|
|
|
1226
1236
|
const style =
|
|
1227
1237
|
props.multiline === true
|
|
1228
|
-
? [styles.multilineInput, props.style]
|
|
1238
|
+
? StyleSheet.flatten([styles.multilineInput, props.style])
|
|
1229
1239
|
: props.style;
|
|
1230
1240
|
|
|
1231
1241
|
const useOnChangeSync =
|