@office-iss/react-native-win32 0.0.0-canary.287 → 0.0.0-canary.289
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 +6 -2
- package/CHANGELOG.json +63 -1
- package/CHANGELOG.md +24 -4
- package/Libraries/Alert/Alert.d.ts +4 -1
- package/Libraries/Alert/Alert.js +3 -0
- package/Libraries/{Modal/ModalInjection.js → Alert/RCTAlertManager.js.flow} +7 -4
- package/Libraries/Animated/Animated.js +8 -37
- package/Libraries/Animated/Animated.js.flow +15 -0
- package/Libraries/Animated/AnimatedExports.js +47 -0
- package/Libraries/Animated/AnimatedExports.js.flow +48 -0
- package/Libraries/Animated/Easing.js +13 -15
- package/Libraries/Animated/createAnimatedComponent.js +24 -12
- package/Libraries/Animated/nodes/AnimatedNode.js +2 -1
- package/Libraries/Animated/nodes/AnimatedProps.js +18 -1
- package/Libraries/Animated/nodes/AnimatedValue.js +6 -2
- package/Libraries/Animated/useAnimatedValue.js +1 -3
- package/Libraries/Blob/URL.js +23 -10
- package/Libraries/Blob/URLSearchParams.js.flow +23 -0
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +1 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +1 -1
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.js.flow +20 -0
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +8 -8
- package/Libraries/Components/Button.js +2 -2
- package/Libraries/Components/Button.win32.js +2 -2
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +14 -100
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +64 -4
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.js +138 -0
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +7 -4
- package/Libraries/Components/LayoutConformance/LayoutConformance.js +6 -4
- package/Libraries/Components/LayoutConformance/LayoutConformanceNativeComponent.js +1 -1
- package/Libraries/Components/Pressable/Pressable.js +18 -63
- package/Libraries/Components/Pressable/Pressable.win32.js +19 -65
- package/Libraries/Components/Pressable/useAndroidRippleForView.js +2 -2
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +4 -46
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +10 -4
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +54 -0
- package/Libraries/Components/RefreshControl/RefreshControl.js +10 -7
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +2 -1
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +1 -1
- package/Libraries/Components/SafeAreaView/SafeAreaView.win32.js +1 -1
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +2 -4
- package/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +2 -4
- package/Libraries/Components/ScrollView/ScrollView.js +43 -59
- package/Libraries/Components/ScrollView/ScrollViewCommands.js +1 -1
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +2 -4
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +6 -7
- package/Libraries/Components/StatusBar/StatusBar.js +33 -22
- package/Libraries/Components/Switch/Switch.js +70 -41
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +2 -4
- package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +2 -4
- package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +2 -4
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
- package/Libraries/Components/TextInput/Tests/TextInputTest.d.ts +2 -1
- package/Libraries/Components/TextInput/Tests/TextInputTest.js.map +1 -1
- package/Libraries/Components/TextInput/TextInput.d.ts +6 -0
- package/Libraries/Components/TextInput/TextInput.flow.js +45 -14
- package/Libraries/Components/TextInput/TextInput.js +121 -136
- package/Libraries/Components/TextInput/TextInput.win32.js +122 -137
- package/Libraries/Components/TextInput/TextInputState.js +2 -18
- package/Libraries/Components/TextInput/TextInputState.win32.js +2 -18
- package/Libraries/Components/TextInput/Win32TextInputNativeComponent.js +1 -1
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.d.ts +2 -1
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
- package/Libraries/Components/Touchable/Touchable.js +7 -7
- package/Libraries/Components/Touchable/Touchable.win32.js +7 -7
- package/Libraries/Components/Touchable/TouchableBounce.js +1 -1
- package/Libraries/Components/Touchable/TouchableHighlight.js +35 -14
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +95 -47
- package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +248 -43
- package/Libraries/Components/Touchable/TouchableOpacity.js +52 -10
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +112 -59
- package/Libraries/Components/View/View.js +1 -1
- package/Libraries/Components/View/View.win32.js +1 -1
- package/Libraries/Components/View/ViewNativeComponent.js +2 -4
- package/Libraries/Components/View/ViewPropTypes.js +15 -12
- package/Libraries/Components/View/ViewPropTypes.win32.js +74 -71
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Core/setUpReactDevTools.js +2 -0
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +10 -7
- package/Libraries/Image/Image.android.js +1 -1
- package/Libraries/Image/Image.js.flow +27 -0
- package/Libraries/Image/ImageBackground.js +1 -1
- package/Libraries/Image/ImageProps.js +97 -30
- package/Libraries/Image/ImageTypes.flow.js +16 -6
- package/Libraries/Image/ImageViewNativeComponent.js +3 -5
- package/Libraries/Image/Tests/ImageWin32Test.d.ts +2 -1
- package/Libraries/Image/Tests/ImageWin32Test.js.map +1 -1
- package/Libraries/Image/TextInlineImageNativeComponent.js +2 -4
- package/Libraries/Interaction/InteractionManager.js +9 -1
- package/Libraries/Interaction/PanResponder.js +11 -11
- package/Libraries/Interaction/TaskQueue.js +3 -2
- package/Libraries/Lists/FlatList.js +8 -7
- package/Libraries/LogBox/LogBox.js +1 -1
- package/Libraries/Modal/Modal.js +30 -4
- package/Libraries/NativeComponent/BaseViewConfig.js.flow +14 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +1 -1
- package/Libraries/Network/RCTNetworking.js.flow +44 -0
- package/Libraries/Network/XMLHttpRequest_new.js +3 -0
- package/Libraries/Network/XMLHttpRequest_old.js +3 -0
- package/Libraries/Pressability/HoverState.js +1 -0
- package/Libraries/Pressability/HoverState.win32.js +1 -0
- package/Libraries/Pressability/Pressability.js +2 -2
- package/Libraries/Pressability/Pressability.win32.js +3 -3
- package/Libraries/ReactNative/AppRegistry.flow.js +49 -0
- package/Libraries/ReactNative/AppRegistry.js +2 -322
- package/Libraries/ReactNative/AppRegistry.js.flow +23 -0
- package/Libraries/ReactNative/AppRegistryImpl.js +316 -0
- package/Libraries/ReactNative/FabricUIManager.js +5 -3
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +7 -5
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +1 -4
- package/Libraries/ReactNative/RendererImplementation.js +3 -5
- package/Libraries/ReactNative/requireNativeComponent.js +1 -1
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +12 -0
- package/Libraries/Renderer/shims/ReactNativeTypes.js +39 -91
- package/Libraries/StyleSheet/PlatformColorValueTypes.js.flow +22 -0
- package/Libraries/StyleSheet/PlatformColorValueTypesIOS.js +6 -0
- package/Libraries/StyleSheet/StyleSheet.js +5 -197
- package/Libraries/StyleSheet/StyleSheet.js.flow +166 -0
- package/Libraries/StyleSheet/{StyleSheet.win32.js → StyleSheetExports.js} +2 -151
- package/Libraries/StyleSheet/StyleSheetExports.js.flow +110 -0
- package/Libraries/StyleSheet/StyleSheetTypes.js +42 -18
- package/Libraries/Text/Text.d.ts +1 -1
- package/Libraries/Text/Text.js +3 -1
- package/Libraries/Text/Text.win32.js +3 -1
- package/Libraries/Text/TextNativeComponent.js +1 -1
- package/Libraries/Text/TextNativeComponent.win32.js +1 -1
- package/Libraries/Text/TextProps.js +124 -84
- package/Libraries/Text/TextProps.win32.js +124 -84
- package/Libraries/Types/CodegenTypesNamespace.d.ts +45 -0
- package/Libraries/Types/CodegenTypesNamespace.js +14 -0
- package/Libraries/Types/CoreEventTypes.js +1 -1
- package/Libraries/Types/CoreEventTypes.win32.js +1 -1
- package/Libraries/Types/ReactDevToolsTypes.js +4 -8
- package/Libraries/Utilities/BackHandler.js.flow +25 -0
- package/Libraries/Utilities/DevSettings.js +14 -0
- package/Libraries/Utilities/Dimensions.js +5 -0
- package/Libraries/Utilities/Dimensions.win32.js +5 -0
- package/{flow/Position.js → Libraries/Utilities/Platform.js.flow} +3 -6
- package/Libraries/Utilities/PlatformTypes.js +97 -7
- package/Libraries/Utilities/codegenNativeCommands.d.ts +18 -0
- package/Libraries/Utilities/codegenNativeComponent.d.ts +26 -0
- package/Libraries/Utilities/codegenNativeComponent.js +1 -1
- package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +2 -4
- package/Libraries/vendor/emitter/EventEmitter.js +6 -2
- package/flow/global.js +1 -0
- package/flow/jest.js +4 -2
- package/index.js +47 -43
- package/index.win32.js +63 -59
- package/overrides.json +27 -35
- package/package.json +18 -18
- package/src/private/animated/NativeAnimatedHelper.js +18 -7
- package/src/private/animated/NativeAnimatedHelper.win32.js +18 -7
- package/src/private/animated/createAnimatedPropsHook.js +34 -15
- package/src/private/components/HScrollViewNativeComponents.js +1 -1
- package/src/private/components/VScrollViewNativeComponents.js +1 -1
- package/src/private/featureflags/ReactNativeFeatureFlags.js +24 -36
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +9 -1
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +4 -4
- package/src/private/inspector/getInspectorDataForViewAtPoint.js +2 -4
- package/src/private/setup/setUpDOM.js +36 -1
- package/src/private/specs_DEPRECATED/components/ActivityIndicatorViewNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/AndroidDrawerLayoutNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/AndroidHorizontalScrollContentViewNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/AndroidSwipeRefreshLayoutNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/AndroidSwitchNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/DebuggingOverlayNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/ProgressBarAndroidNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/PullToRefreshViewNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/RCTInputAccessoryViewNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/RCTModalHostViewNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/RCTSafeAreaViewNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/SwitchNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/UnimplementedNativeViewNativeComponent.js +1 -1
- package/src/private/types/HostComponent.js +16 -0
- package/src/private/types/HostInstance.js +50 -0
- package/src/private/webapis/dom/nodes/ReactNativeDocument.js +1 -0
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +40 -32
- package/src/private/webapis/dom/nodes/ReadOnlyCharacterData.js +1 -1
- package/src/private/webapis/dom/nodes/ReadOnlyElement.js +1 -1
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +6 -19
- package/src/private/webapis/dom/nodes/internals/NodeInternals.js +6 -0
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +4 -4
- package/src/private/webapis/mutationobserver/MutationObserver.js +9 -9
- package/src/private/webapis/performance/PerformanceObserver.js +6 -6
- package/src/types/globals.d.ts +628 -0
- package/src/types/third_party/event-target-shim.d.ts +392 -0
- package/src-win/Libraries/Components/TextInput/Tests/TextInputTest.tsx +7 -7
- package/src-win/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx +3 -3
- package/src-win/Libraries/Image/Tests/ImageWin32Test.tsx +1 -1
- package/src-win/Libraries/Text/Text.d.ts +1 -1
- package/types/index.d.ts +5 -52
- package/types/modules/globals.d.ts +0 -599
|
@@ -124,7 +124,7 @@ const currentCentroidY = TouchHistoryMath.currentCentroidY;
|
|
|
124
124
|
* [PanResponder example in RNTester](https://github.com/facebook/react-native/blob/HEAD/packages/rn-tester/js/examples/PanResponder/PanResponderExample.js)
|
|
125
125
|
*/
|
|
126
126
|
|
|
127
|
-
export type
|
|
127
|
+
export type PanResponderGestureState = {
|
|
128
128
|
/**
|
|
129
129
|
* ID of the gestureState - persisted as long as there at least one touch on screen
|
|
130
130
|
*/
|
|
@@ -185,15 +185,15 @@ export type GestureState = {
|
|
|
185
185
|
|
|
186
186
|
type ActiveCallback = (
|
|
187
187
|
event: GestureResponderEvent,
|
|
188
|
-
gestureState:
|
|
188
|
+
gestureState: PanResponderGestureState,
|
|
189
189
|
) => boolean;
|
|
190
190
|
|
|
191
191
|
type PassiveCallback = (
|
|
192
192
|
event: GestureResponderEvent,
|
|
193
|
-
gestureState:
|
|
193
|
+
gestureState: PanResponderGestureState,
|
|
194
194
|
) => mixed;
|
|
195
195
|
|
|
196
|
-
export type
|
|
196
|
+
export type GestureResponderHandlers = {
|
|
197
197
|
onMoveShouldSetResponder: (event: GestureResponderEvent) => boolean,
|
|
198
198
|
onMoveShouldSetResponderCapture: (event: GestureResponderEvent) => boolean,
|
|
199
199
|
onResponderEnd: (event: GestureResponderEvent) => void,
|
|
@@ -208,7 +208,7 @@ export type PanHandlers = {
|
|
|
208
208
|
onStartShouldSetResponderCapture: (event: GestureResponderEvent) => boolean,
|
|
209
209
|
};
|
|
210
210
|
|
|
211
|
-
type
|
|
211
|
+
export type PanResponderCallbacks = $ReadOnly<{
|
|
212
212
|
onMoveShouldSetPanResponder?: ?ActiveCallback,
|
|
213
213
|
onMoveShouldSetPanResponderCapture?: ?ActiveCallback,
|
|
214
214
|
onStartShouldSetPanResponder?: ?ActiveCallback,
|
|
@@ -293,7 +293,7 @@ const PanResponder = {
|
|
|
293
293
|
* - vx/vy: Velocity.
|
|
294
294
|
*/
|
|
295
295
|
|
|
296
|
-
_initializeGestureState(gestureState:
|
|
296
|
+
_initializeGestureState(gestureState: PanResponderGestureState) {
|
|
297
297
|
gestureState.moveX = 0;
|
|
298
298
|
gestureState.moveY = 0;
|
|
299
299
|
gestureState.x0 = 0;
|
|
@@ -332,7 +332,7 @@ const PanResponder = {
|
|
|
332
332
|
* avoids more dispatches than necessary.
|
|
333
333
|
*/
|
|
334
334
|
_updateGestureStateOnMove(
|
|
335
|
-
gestureState:
|
|
335
|
+
gestureState: PanResponderGestureState,
|
|
336
336
|
touchHistory: $PropertyType<GestureResponderEvent, 'touchHistory'>,
|
|
337
337
|
) {
|
|
338
338
|
gestureState.numberActiveTouches = touchHistory.numberActiveTouches;
|
|
@@ -401,14 +401,14 @@ const PanResponder = {
|
|
|
401
401
|
* accordingly. (numberActiveTouches) may not be totally accurate unless you
|
|
402
402
|
* are the responder.
|
|
403
403
|
*/
|
|
404
|
-
create(config:
|
|
404
|
+
create(config: PanResponderCallbacks): {
|
|
405
405
|
getInteractionHandle: () => ?number,
|
|
406
|
-
panHandlers:
|
|
406
|
+
panHandlers: GestureResponderHandlers,
|
|
407
407
|
} {
|
|
408
408
|
const interactionState = {
|
|
409
409
|
handle: (null: ?number),
|
|
410
410
|
};
|
|
411
|
-
const gestureState:
|
|
411
|
+
const gestureState: PanResponderGestureState = {
|
|
412
412
|
// Useful for debugging
|
|
413
413
|
stateID: Math.random(),
|
|
414
414
|
moveX: 0,
|
|
@@ -566,7 +566,7 @@ function clearInteractionHandle(
|
|
|
566
566
|
interactionState: {handle: ?number, ...},
|
|
567
567
|
callback: ?(ActiveCallback | PassiveCallback),
|
|
568
568
|
event: GestureResponderEvent,
|
|
569
|
-
gestureState:
|
|
569
|
+
gestureState: PanResponderGestureState,
|
|
570
570
|
) {
|
|
571
571
|
if (interactionState.handle) {
|
|
572
572
|
InteractionManager.clearInteractionHandle(interactionState.handle);
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
const infoLog = require('../Utilities/infoLog').default;
|
|
14
14
|
const invariant = require('invariant');
|
|
15
15
|
|
|
16
|
-
type SimpleTask = {
|
|
16
|
+
export type SimpleTask = {
|
|
17
17
|
name: string,
|
|
18
18
|
run: () => void,
|
|
19
19
|
};
|
|
20
|
-
type PromiseTask = {
|
|
20
|
+
export type PromiseTask = {
|
|
21
21
|
name: string,
|
|
22
22
|
gen: () => Promise<void>,
|
|
23
23
|
};
|
|
@@ -117,6 +117,7 @@ class TaskQueue {
|
|
|
117
117
|
} catch (e) {
|
|
118
118
|
e.message =
|
|
119
119
|
// $FlowFixMe[incompatible-type]
|
|
120
|
+
// $FlowFixMe[incompatible-use]
|
|
120
121
|
'TaskQueue: Error with task ' + (task.name || '') + ': ' + e.message;
|
|
121
122
|
throw e;
|
|
122
123
|
}
|
|
@@ -176,17 +176,18 @@ function isArrayLike(data: mixed): boolean {
|
|
|
176
176
|
return typeof Object(data).length === 'number';
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
type
|
|
179
|
+
type FlatListBaseProps<ItemT> = {
|
|
180
180
|
...RequiredProps<ItemT>,
|
|
181
181
|
...OptionalProps<ItemT>,
|
|
182
182
|
};
|
|
183
183
|
|
|
184
184
|
type VirtualizedListProps = React.ElementConfig<typeof VirtualizedList>;
|
|
185
185
|
|
|
186
|
-
export type
|
|
186
|
+
export type FlatListProps<ItemT> = {
|
|
187
187
|
...$Diff<
|
|
188
188
|
VirtualizedListProps,
|
|
189
189
|
{
|
|
190
|
+
data: $PropertyType<VirtualizedListProps, 'data'>,
|
|
190
191
|
getItem: $PropertyType<VirtualizedListProps, 'getItem'>,
|
|
191
192
|
getItemCount: $PropertyType<VirtualizedListProps, 'getItemCount'>,
|
|
192
193
|
getItemLayout: $PropertyType<VirtualizedListProps, 'getItemLayout'>,
|
|
@@ -195,7 +196,7 @@ export type Props<ItemT> = {
|
|
|
195
196
|
...
|
|
196
197
|
},
|
|
197
198
|
>,
|
|
198
|
-
...
|
|
199
|
+
...FlatListBaseProps<ItemT>,
|
|
199
200
|
...
|
|
200
201
|
};
|
|
201
202
|
|
|
@@ -307,7 +308,7 @@ export type Props<ItemT> = {
|
|
|
307
308
|
*
|
|
308
309
|
* Also inherits [ScrollView Props](docs/scrollview.html#props), unless it is nested in another FlatList of same orientation.
|
|
309
310
|
*/
|
|
310
|
-
class FlatList<ItemT> extends React.PureComponent<
|
|
311
|
+
class FlatList<ItemT = any> extends React.PureComponent<FlatListProps<ItemT>> {
|
|
311
312
|
/**
|
|
312
313
|
* Scrolls to the end of the content. May be janky without `getItemLayout` prop.
|
|
313
314
|
*/
|
|
@@ -422,7 +423,7 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
|
|
|
422
423
|
}
|
|
423
424
|
}
|
|
424
425
|
|
|
425
|
-
constructor(props:
|
|
426
|
+
constructor(props: FlatListProps<ItemT>) {
|
|
426
427
|
super(props);
|
|
427
428
|
this._checkProps(this.props);
|
|
428
429
|
if (this.props.viewabilityConfigCallbackPairs) {
|
|
@@ -456,7 +457,7 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
|
|
|
456
457
|
}
|
|
457
458
|
|
|
458
459
|
// $FlowFixMe[missing-local-annot]
|
|
459
|
-
componentDidUpdate(prevProps:
|
|
460
|
+
componentDidUpdate(prevProps: FlatListProps<ItemT>) {
|
|
460
461
|
invariant(
|
|
461
462
|
prevProps.numColumns === this.props.numColumns,
|
|
462
463
|
'Changing numColumns on the fly is not supported. Change the key prop on FlatList when ' +
|
|
@@ -488,7 +489,7 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
|
|
|
488
489
|
};
|
|
489
490
|
|
|
490
491
|
// $FlowFixMe[missing-local-annot]
|
|
491
|
-
_checkProps(props:
|
|
492
|
+
_checkProps(props: FlatListProps<ItemT>) {
|
|
492
493
|
const {
|
|
493
494
|
// $FlowFixMe[prop-missing] this prop doesn't exist, is only used for an invariant
|
|
494
495
|
getItem,
|
|
@@ -206,7 +206,7 @@ if (__DEV__) {
|
|
|
206
206
|
if (!hasComponentStack(args) && React.captureOwnerStack != null) {
|
|
207
207
|
stack = React.captureOwnerStack();
|
|
208
208
|
if (!hasComponentStack(args)) {
|
|
209
|
-
if (stack !== '') {
|
|
209
|
+
if (stack != null && stack !== '') {
|
|
210
210
|
args[0] = args[0] += '%s';
|
|
211
211
|
args.push(stack);
|
|
212
212
|
}
|
package/Libraries/Modal/Modal.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* @flow strict-local
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import type {HostInstance} from '../../src/private/types/HostInstance';
|
|
11
12
|
import type {ViewProps} from '../Components/View/ViewPropTypes';
|
|
12
13
|
import type {RootTag} from '../ReactNative/RootTag';
|
|
13
14
|
import type {DirectEventHandler} from '../Types/CodegenTypes';
|
|
@@ -15,7 +16,6 @@ import type {DirectEventHandler} from '../Types/CodegenTypes';
|
|
|
15
16
|
import NativeEventEmitter from '../EventEmitter/NativeEventEmitter';
|
|
16
17
|
import {type ColorValue} from '../StyleSheet/StyleSheet';
|
|
17
18
|
import {type EventSubscription} from '../vendor/emitter/EventEmitter';
|
|
18
|
-
import ModalInjection from './ModalInjection';
|
|
19
19
|
import NativeModalManager from './NativeModalManager';
|
|
20
20
|
import RCTModalHostView from './RCTModalHostViewNativeComponent';
|
|
21
21
|
import VirtualizedLists from '@react-native/virtualized-lists';
|
|
@@ -36,6 +36,8 @@ type ModalEventDefinitions = {
|
|
|
36
36
|
modalDismissed: [{modalID: number}],
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
+
export type PublicModalInstance = HostInstance;
|
|
40
|
+
|
|
39
41
|
const ModalEventEmitter =
|
|
40
42
|
Platform.OS === 'ios' && NativeModalManager != null
|
|
41
43
|
? new NativeEventEmitter<ModalEventDefinitions>(
|
|
@@ -101,6 +103,11 @@ export type ModalBaseProps = {
|
|
|
101
103
|
* Defaults to `white` if not provided and transparent is `false`. Ignored if `transparent` is `true`.
|
|
102
104
|
*/
|
|
103
105
|
backdropColor?: ColorValue,
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* A ref to the native Modal component.
|
|
109
|
+
*/
|
|
110
|
+
modalRef?: React.RefSetter<PublicModalInstance>,
|
|
104
111
|
};
|
|
105
112
|
|
|
106
113
|
export type ModalPropsIOS = {
|
|
@@ -308,6 +315,7 @@ class Modal extends React.Component<ModalProps, State> {
|
|
|
308
315
|
onRequestClose={this.props.onRequestClose}
|
|
309
316
|
onShow={this.props.onShow}
|
|
310
317
|
onDismiss={onDismiss}
|
|
318
|
+
ref={this.props.modalRef}
|
|
311
319
|
visible={this.props.visible}
|
|
312
320
|
statusBarTranslucent={this.props.statusBarTranslucent}
|
|
313
321
|
navigationBarTranslucent={this.props.navigationBarTranslucent}
|
|
@@ -354,7 +362,25 @@ const styles = StyleSheet.create({
|
|
|
354
362
|
},
|
|
355
363
|
});
|
|
356
364
|
|
|
357
|
-
|
|
358
|
-
|
|
365
|
+
type ModalRefProps = $ReadOnly<{
|
|
366
|
+
ref?: React.RefSetter<PublicModalInstance>,
|
|
367
|
+
}>;
|
|
368
|
+
|
|
369
|
+
// NOTE: This wrapper component is necessary because `Modal` is a class
|
|
370
|
+
// component and we need to map `ref` to a differently named prop. This can be
|
|
371
|
+
// removed when `Modal` is a functional component.
|
|
372
|
+
function Wrapper({
|
|
373
|
+
ref,
|
|
374
|
+
...props
|
|
375
|
+
}: {
|
|
376
|
+
...ModalRefProps,
|
|
377
|
+
...ModalProps,
|
|
378
|
+
}): React.Node {
|
|
379
|
+
return <Modal {...props} modalRef={ref} />;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
Wrapper.displayName = 'Modal';
|
|
383
|
+
// $FlowExpectedError[prop-missing]
|
|
384
|
+
Wrapper.Context = VirtualizedListContextResetter;
|
|
359
385
|
|
|
360
|
-
export default
|
|
386
|
+
export default Wrapper;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @format
|
|
8
|
+
* @flow strict-local
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type {PartialViewConfigWithoutName} from './PlatformBaseViewConfig';
|
|
12
|
+
|
|
13
|
+
declare const PlatformBaseViewConfig: PartialViewConfigWithoutName;
|
|
14
|
+
export default PlatformBaseViewConfig;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict-local
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
import type {EventSubscription} from '../vendor/emitter/EventEmitter';
|
|
14
|
+
import type {RequestBody} from './convertRequestBody';
|
|
15
|
+
import type {RCTNetworkingEventDefinitions} from './RCTNetworkingEventDefinitions.flow';
|
|
16
|
+
import type {NativeResponseType} from './XMLHttpRequest';
|
|
17
|
+
|
|
18
|
+
declare const RCTNetworking: interface {
|
|
19
|
+
addListener<K: $Keys<RCTNetworkingEventDefinitions>>(
|
|
20
|
+
eventType: K,
|
|
21
|
+
// $FlowFixMe[invalid-computed-prop]
|
|
22
|
+
listener: (...$ElementType<RCTNetworkingEventDefinitions, K>) => mixed,
|
|
23
|
+
context?: mixed,
|
|
24
|
+
): EventSubscription,
|
|
25
|
+
|
|
26
|
+
sendRequest(
|
|
27
|
+
method: string,
|
|
28
|
+
trackingName: ?string,
|
|
29
|
+
url: string,
|
|
30
|
+
headers: {...},
|
|
31
|
+
data: RequestBody,
|
|
32
|
+
responseType: NativeResponseType,
|
|
33
|
+
incrementalUpdates: boolean,
|
|
34
|
+
timeout: number,
|
|
35
|
+
callback: (requestId: number) => void,
|
|
36
|
+
withCredentials: boolean,
|
|
37
|
+
): void,
|
|
38
|
+
|
|
39
|
+
abortRequest(requestId: number): void,
|
|
40
|
+
|
|
41
|
+
clearCookies(callback: (result: boolean) => void): void,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default RCTNetworking;
|
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
EventCallback,
|
|
15
15
|
EventListener,
|
|
16
16
|
} from '../../src/private/webapis/dom/events/EventTarget';
|
|
17
|
+
import type Performance from '../../src/private/webapis/performance/Performance';
|
|
17
18
|
import type {IPerformanceLogger} from '../Utilities/createPerformanceLogger';
|
|
18
19
|
|
|
19
20
|
import Event from '../../src/private/webapis/dom/events/Event';
|
|
@@ -33,6 +34,8 @@ const RCTNetworking = require('./RCTNetworking').default;
|
|
|
33
34
|
const base64 = require('base64-js');
|
|
34
35
|
const invariant = require('invariant');
|
|
35
36
|
|
|
37
|
+
declare var performance: Performance;
|
|
38
|
+
|
|
36
39
|
const DEBUG_NETWORK_SEND_DELAY: false = false; // Set to a number of milliseconds when debugging
|
|
37
40
|
const LABEL_FOR_MISSING_URL_FOR_PROFILING = 'Unknown URL';
|
|
38
41
|
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
+
import type Performance from '../../src/private/webapis/performance/Performance';
|
|
13
14
|
import type {IPerformanceLogger} from '../Utilities/createPerformanceLogger';
|
|
14
15
|
|
|
15
16
|
import {type EventSubscription} from '../vendor/emitter/EventEmitter';
|
|
@@ -22,6 +23,8 @@ const RCTNetworking = require('./RCTNetworking').default;
|
|
|
22
23
|
const base64 = require('base64-js');
|
|
23
24
|
const invariant = require('invariant');
|
|
24
25
|
|
|
26
|
+
declare var performance: Performance;
|
|
27
|
+
|
|
25
28
|
const DEBUG_NETWORK_SEND_DELAY: false = false; // Set to a number of milliseconds when debugging
|
|
26
29
|
const LABEL_FOR_MISSING_URL_FOR_PROFILING = 'Unknown URL';
|
|
27
30
|
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {HostInstance} from '
|
|
11
|
+
import type {HostInstance} from '../../src/private/types/HostInstance';
|
|
12
12
|
import type {
|
|
13
13
|
BlurEvent,
|
|
14
14
|
FocusEvent,
|
|
15
|
-
MouseEvent,
|
|
16
15
|
GestureResponderEvent,
|
|
16
|
+
MouseEvent,
|
|
17
17
|
} from '../Types/CoreEventTypes';
|
|
18
18
|
|
|
19
19
|
import SoundManager from '../Components/Sound/SoundManager';
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {HostInstance} from '
|
|
11
|
+
import type {HostInstance} from '../../src/private/types/HostInstance';
|
|
12
12
|
import type {
|
|
13
13
|
BlurEvent,
|
|
14
14
|
FocusEvent,
|
|
15
|
-
KeyEvent,
|
|
16
|
-
MouseEvent,
|
|
15
|
+
KeyEvent, // [Windows]
|
|
17
16
|
GestureResponderEvent,
|
|
17
|
+
MouseEvent,
|
|
18
18
|
} from '../Types/CoreEventTypes';
|
|
19
19
|
|
|
20
20
|
import SoundManager from '../Components/Sound/SoundManager';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
|
|
12
|
+
import type {RootTag} from '../Types/RootTagTypes';
|
|
13
|
+
import type {IPerformanceLogger} from '../Utilities/createPerformanceLogger';
|
|
14
|
+
import type {DisplayModeType} from './DisplayMode';
|
|
15
|
+
|
|
16
|
+
type Task = (taskData: any) => Promise<void>;
|
|
17
|
+
export type TaskProvider = () => Task;
|
|
18
|
+
|
|
19
|
+
export type ComponentProvider = () => React.ComponentType<any>;
|
|
20
|
+
export type ComponentProviderInstrumentationHook = (
|
|
21
|
+
component_: ComponentProvider,
|
|
22
|
+
scopedPerformanceLogger: IPerformanceLogger,
|
|
23
|
+
) => React.ComponentType<any>;
|
|
24
|
+
export type AppConfig = {
|
|
25
|
+
appKey: string,
|
|
26
|
+
component?: ComponentProvider,
|
|
27
|
+
run?: Runnable,
|
|
28
|
+
section?: boolean,
|
|
29
|
+
...
|
|
30
|
+
};
|
|
31
|
+
export type AppParameters = {
|
|
32
|
+
initialProps: $ReadOnly<{[string]: mixed, ...}>,
|
|
33
|
+
rootTag: RootTag,
|
|
34
|
+
fabric?: boolean,
|
|
35
|
+
};
|
|
36
|
+
export type Runnable = (
|
|
37
|
+
appParameters: AppParameters,
|
|
38
|
+
displayMode: DisplayModeType,
|
|
39
|
+
) => void;
|
|
40
|
+
export type Runnables = {[appKey: string]: Runnable};
|
|
41
|
+
export type Registry = {
|
|
42
|
+
sections: $ReadOnlyArray<string>,
|
|
43
|
+
runnables: Runnables,
|
|
44
|
+
...
|
|
45
|
+
};
|
|
46
|
+
export type WrapperComponentProvider = (
|
|
47
|
+
appParameters: Object,
|
|
48
|
+
) => React.ComponentType<any>;
|
|
49
|
+
export type RootViewStyleProvider = (appParameters: Object) => ViewStyleProp;
|