@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
package/Libraries/Blob/URL.js
CHANGED
|
@@ -107,15 +107,21 @@ export class URL {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
get hash(): string {
|
|
110
|
-
|
|
110
|
+
const hashMatch = this._url.match(/#([^/]*)/);
|
|
111
|
+
return hashMatch ? `#${hashMatch[1]}` : '';
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
get host(): string {
|
|
114
|
-
|
|
115
|
+
const hostMatch = this._url.match(/^https?:\/\/(?:[^@]+@)?([^:/?#]+)/);
|
|
116
|
+
const portMatch = this._url.match(/:(\d+)(?=[/?#]|$)/);
|
|
117
|
+
return hostMatch
|
|
118
|
+
? hostMatch[1] + (portMatch ? `:${portMatch[1]}` : '')
|
|
119
|
+
: '';
|
|
115
120
|
}
|
|
116
121
|
|
|
117
122
|
get hostname(): string {
|
|
118
|
-
|
|
123
|
+
const hostnameMatch = this._url.match(/^https?:\/\/(?:[^@]+@)?([^:/?#]+)/);
|
|
124
|
+
return hostnameMatch ? hostnameMatch[1] : '';
|
|
119
125
|
}
|
|
120
126
|
|
|
121
127
|
get href(): string {
|
|
@@ -123,27 +129,33 @@ export class URL {
|
|
|
123
129
|
}
|
|
124
130
|
|
|
125
131
|
get origin(): string {
|
|
126
|
-
|
|
132
|
+
const matches = this._url.match(/^(https?:\/\/[^/]+)/);
|
|
133
|
+
return matches ? matches[1] : '';
|
|
127
134
|
}
|
|
128
135
|
|
|
129
136
|
get password(): string {
|
|
130
|
-
|
|
137
|
+
const passwordMatch = this._url.match(/https?:\/\/.*:(.*)@/);
|
|
138
|
+
return passwordMatch ? passwordMatch[1] : '';
|
|
131
139
|
}
|
|
132
140
|
|
|
133
141
|
get pathname(): string {
|
|
134
|
-
|
|
142
|
+
const pathMatch = this._url.match(/https?:\/\/[^/]+(\/[^?#]*)?/);
|
|
143
|
+
return pathMatch ? pathMatch[1] || '/' : '/';
|
|
135
144
|
}
|
|
136
145
|
|
|
137
146
|
get port(): string {
|
|
138
|
-
|
|
147
|
+
const portMatch = this._url.match(/:(\d+)(?=[/?#]|$)/);
|
|
148
|
+
return portMatch ? portMatch[1] : '';
|
|
139
149
|
}
|
|
140
150
|
|
|
141
151
|
get protocol(): string {
|
|
142
|
-
|
|
152
|
+
const protocolMatch = this._url.match(/^([a-zA-Z][a-zA-Z\d+\-.]*):/);
|
|
153
|
+
return protocolMatch ? protocolMatch[1] + ':' : '';
|
|
143
154
|
}
|
|
144
155
|
|
|
145
156
|
get search(): string {
|
|
146
|
-
|
|
157
|
+
const searchMatch = this._url.match(/\?([^#]*)/);
|
|
158
|
+
return searchMatch ? `?${searchMatch[1]}` : '';
|
|
147
159
|
}
|
|
148
160
|
|
|
149
161
|
get searchParams(): URLSearchParams {
|
|
@@ -168,6 +180,7 @@ export class URL {
|
|
|
168
180
|
}
|
|
169
181
|
|
|
170
182
|
get username(): string {
|
|
171
|
-
|
|
183
|
+
const usernameMatch = this._url.match(/^https?:\/\/([^:@]+)(?::[^@]*)?@/);
|
|
184
|
+
return usernameMatch ? usernameMatch[1] : '';
|
|
172
185
|
}
|
|
173
186
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
declare export class URLSearchParams {
|
|
12
|
+
_searchParams: Array<[string, string]>;
|
|
13
|
+
constructor(params?: Record<string, string>): void;
|
|
14
|
+
append(key: string, value: string): void;
|
|
15
|
+
delete(name: string): empty;
|
|
16
|
+
get(name: string): empty;
|
|
17
|
+
getAll(name: string): empty;
|
|
18
|
+
has(name: string): empty;
|
|
19
|
+
set(name: string, value: string): empty;
|
|
20
|
+
sort(): empty;
|
|
21
|
+
@@iterator(): Iterator<[string, string]>;
|
|
22
|
+
toString(): string;
|
|
23
|
+
}
|
|
@@ -8,7 +8,7 @@
|
|
|
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 {EventSubscription} from '../../vendor/emitter/EventEmitter';
|
|
13
13
|
|
|
14
14
|
import RCTDeviceEventEmitter from '../../EventEmitter/RCTDeviceEventEmitter';
|
|
@@ -8,7 +8,7 @@
|
|
|
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 {EventSubscription} from '../../vendor/emitter/EventEmitter';
|
|
13
13
|
|
|
14
14
|
import RCTDeviceEventEmitter from '../../EventEmitter/RCTDeviceEventEmitter';
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
/**
|
|
12
|
+
* This is a function exposed to the React Renderer that can be used by the
|
|
13
|
+
* pre-Fabric renderer to emit accessibility events to pre-Fabric nodes.
|
|
14
|
+
*/
|
|
15
|
+
declare function legacySendAccessibilityEvent(
|
|
16
|
+
reactTag: number,
|
|
17
|
+
eventType: string,
|
|
18
|
+
): void;
|
|
19
|
+
|
|
20
|
+
export default legacySendAccessibilityEvent;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
|
-
import type {HostComponent} from '
|
|
12
|
+
import type {HostComponent} from '../../../src/private/types/HostComponent';
|
|
13
13
|
import type {ViewProps} from '../View/ViewPropTypes';
|
|
14
14
|
|
|
15
15
|
import StyleSheet, {type ColorValue} from '../../StyleSheet/StyleSheet';
|
|
@@ -26,7 +26,7 @@ const GRAY = '#999999';
|
|
|
26
26
|
|
|
27
27
|
type IndicatorSize = number | 'small' | 'large';
|
|
28
28
|
|
|
29
|
-
type
|
|
29
|
+
type ActivityIndicatorIOSProps = $ReadOnly<{
|
|
30
30
|
/**
|
|
31
31
|
Whether the indicator should hide when not animating.
|
|
32
32
|
|
|
@@ -34,9 +34,9 @@ type IOSProps = $ReadOnly<{
|
|
|
34
34
|
*/
|
|
35
35
|
hidesWhenStopped?: ?boolean,
|
|
36
36
|
}>;
|
|
37
|
-
type
|
|
37
|
+
export type ActivityIndicatorProps = $ReadOnly<{
|
|
38
38
|
...ViewProps,
|
|
39
|
-
...
|
|
39
|
+
...ActivityIndicatorIOSProps,
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
Whether to show the indicator (`true`) or hide it (`false`).
|
|
@@ -69,7 +69,7 @@ const ActivityIndicator = (
|
|
|
69
69
|
size = 'small',
|
|
70
70
|
style,
|
|
71
71
|
...restProps
|
|
72
|
-
}:
|
|
72
|
+
}: ActivityIndicatorProps,
|
|
73
73
|
forwardedRef?: any,
|
|
74
74
|
) => {
|
|
75
75
|
let sizeStyle;
|
|
@@ -112,7 +112,7 @@ const ActivityIndicator = (
|
|
|
112
112
|
// $FlowFixMe[prop-missing] Flow doesn't know when this is the android component
|
|
113
113
|
<PlatformActivityIndicator {...nativeProps} {...androidProps} />
|
|
114
114
|
) : (
|
|
115
|
-
/* $FlowFixMe[
|
|
115
|
+
/* $FlowFixMe[incompatible-type] (>=0.106.0 site=react_native_android_fb) This comment
|
|
116
116
|
* suppresses an error found when Flow v0.106 was deployed. To see the
|
|
117
117
|
* error, delete this comment and run Flow. */
|
|
118
118
|
<PlatformActivityIndicator {...nativeProps} />
|
|
@@ -154,8 +154,8 @@ const ActivityIndicator = (
|
|
|
154
154
|
*/
|
|
155
155
|
|
|
156
156
|
const ActivityIndicatorWithRef: component(
|
|
157
|
-
ref
|
|
158
|
-
...props:
|
|
157
|
+
ref?: React.RefSetter<HostComponent<empty>>,
|
|
158
|
+
...props: ActivityIndicatorProps
|
|
159
159
|
) = React.forwardRef(ActivityIndicator);
|
|
160
160
|
ActivityIndicatorWithRef.displayName = 'ActivityIndicator';
|
|
161
161
|
|
|
@@ -27,7 +27,7 @@ import View from './View/View';
|
|
|
27
27
|
import invariant from 'invariant';
|
|
28
28
|
import * as React from 'react';
|
|
29
29
|
|
|
30
|
-
type ButtonProps = $ReadOnly<{
|
|
30
|
+
export type ButtonProps = $ReadOnly<{
|
|
31
31
|
/**
|
|
32
32
|
Text to display inside the button. On Android the given title will be
|
|
33
33
|
converted to the uppercased form.
|
|
@@ -286,7 +286,7 @@ const Touchable: typeof TouchableNativeFeedback | typeof TouchableOpacity =
|
|
|
286
286
|
type ButtonRef = React.ElementRef<typeof Touchable>;
|
|
287
287
|
|
|
288
288
|
const Button: component(
|
|
289
|
-
ref
|
|
289
|
+
ref?: React.RefSetter<ButtonRef>,
|
|
290
290
|
...props: ButtonProps
|
|
291
291
|
) = React.forwardRef((props: ButtonProps, ref: React.RefSetter<ButtonRef>) => {
|
|
292
292
|
const {
|
|
@@ -28,7 +28,7 @@ import View from './View/View';
|
|
|
28
28
|
import invariant from 'invariant';
|
|
29
29
|
import * as React from 'react';
|
|
30
30
|
|
|
31
|
-
type ButtonProps = $ReadOnly<{
|
|
31
|
+
export type ButtonProps = $ReadOnly<{
|
|
32
32
|
/**
|
|
33
33
|
Text to display inside the button. On Android the given title will be
|
|
34
34
|
converted to the uppercased form.
|
|
@@ -289,7 +289,7 @@ const Touchable: typeof TouchableNativeFeedback | typeof TouchableOpacity =
|
|
|
289
289
|
type ButtonRef = React.ElementRef<typeof Touchable>;
|
|
290
290
|
|
|
291
291
|
const Button: component(
|
|
292
|
-
ref
|
|
292
|
+
ref?: React.RefSetter<ButtonRef>,
|
|
293
293
|
...props: ButtonProps
|
|
294
294
|
) = React.forwardRef((props: ButtonProps, ref: React.RefSetter<ButtonRef>) => {
|
|
295
295
|
// Win32
|
|
@@ -8,14 +8,18 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {AccessibilityRole} from '../../Components/View/ViewAccessibility';
|
|
12
11
|
import type {
|
|
13
12
|
MeasureInWindowOnSuccessCallback,
|
|
14
13
|
MeasureLayoutOnSuccessCallback,
|
|
15
14
|
MeasureOnSuccessCallback,
|
|
16
|
-
} from '
|
|
17
|
-
import type {
|
|
18
|
-
import
|
|
15
|
+
} from '../../../src/private/types/HostInstance';
|
|
16
|
+
import type {AccessibilityRole} from '../../Components/View/ViewAccessibility';
|
|
17
|
+
import typeof DrawerLayoutAndroidCommon from './DrawerLayoutAndroid.js';
|
|
18
|
+
import type {
|
|
19
|
+
DrawerLayoutAndroidMethods,
|
|
20
|
+
DrawerLayoutAndroidProps,
|
|
21
|
+
DrawerLayoutAndroidState,
|
|
22
|
+
} from './DrawerLayoutAndroidTypes';
|
|
19
23
|
|
|
20
24
|
import StyleSheet from '../../StyleSheet/StyleSheet';
|
|
21
25
|
import dismissKeyboard from '../../Utilities/dismissKeyboard';
|
|
@@ -29,99 +33,6 @@ import * as React from 'react';
|
|
|
29
33
|
|
|
30
34
|
const DRAWER_STATES = ['Idle', 'Dragging', 'Settling'];
|
|
31
35
|
|
|
32
|
-
type DrawerStates = 'Idle' | 'Dragging' | 'Settling';
|
|
33
|
-
|
|
34
|
-
type DrawerSlideEvent = $ReadOnly<{
|
|
35
|
-
offset: number,
|
|
36
|
-
}>;
|
|
37
|
-
|
|
38
|
-
type Props = $ReadOnly<{
|
|
39
|
-
accessibilityRole?: ?AccessibilityRole,
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Determines whether the keyboard gets dismissed in response to a drag.
|
|
43
|
-
* - 'none' (the default), drags do not dismiss the keyboard.
|
|
44
|
-
* - 'on-drag', the keyboard is dismissed when a drag begins.
|
|
45
|
-
*/
|
|
46
|
-
keyboardDismissMode?: ?('none' | 'on-drag'),
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Specifies the background color of the drawer. The default value is white.
|
|
50
|
-
* If you want to set the opacity of the drawer, use rgba. Example:
|
|
51
|
-
*
|
|
52
|
-
* ```
|
|
53
|
-
* return (
|
|
54
|
-
* <DrawerLayoutAndroid drawerBackgroundColor="rgba(0,0,0,0.5)">
|
|
55
|
-
* </DrawerLayoutAndroid>
|
|
56
|
-
* );
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
drawerBackgroundColor?: ?ColorValue,
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Specifies the side of the screen from which the drawer will slide in.
|
|
63
|
-
*/
|
|
64
|
-
drawerPosition: ?('left' | 'right'),
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Specifies the width of the drawer, more precisely the width of the view that be pulled in
|
|
68
|
-
* from the edge of the window.
|
|
69
|
-
*/
|
|
70
|
-
drawerWidth?: ?number,
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Specifies the lock mode of the drawer. The drawer can be locked in 3 states:
|
|
74
|
-
* - unlocked (default), meaning that the drawer will respond (open/close) to touch gestures.
|
|
75
|
-
* - locked-closed, meaning that the drawer will stay closed and not respond to gestures.
|
|
76
|
-
* - locked-open, meaning that the drawer will stay opened and not respond to gestures.
|
|
77
|
-
* The drawer may still be opened and closed programmatically (`openDrawer`/`closeDrawer`).
|
|
78
|
-
*/
|
|
79
|
-
drawerLockMode?: ?('unlocked' | 'locked-closed' | 'locked-open'),
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Function called whenever there is an interaction with the navigation view.
|
|
83
|
-
*/
|
|
84
|
-
onDrawerSlide?: ?DirectEventHandler<DrawerSlideEvent>,
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Function called when the drawer state has changed. The drawer can be in 3 states:
|
|
88
|
-
* - Idle, meaning there is no interaction with the navigation view happening at the time
|
|
89
|
-
* - Dragging, meaning there is currently an interaction with the navigation view
|
|
90
|
-
* - Settling, meaning that there was an interaction with the navigation view, and the
|
|
91
|
-
* navigation view is now finishing its closing or opening animation
|
|
92
|
-
*/
|
|
93
|
-
onDrawerStateChanged?: ?(state: DrawerStates) => mixed,
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Function called whenever the navigation view has been opened.
|
|
97
|
-
*/
|
|
98
|
-
onDrawerOpen?: ?() => mixed,
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Function called whenever the navigation view has been closed.
|
|
102
|
-
*/
|
|
103
|
-
onDrawerClose?: ?() => mixed,
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* The navigation view that will be rendered to the side of the screen and can be pulled in.
|
|
107
|
-
*/
|
|
108
|
-
renderNavigationView: () => React.MixedElement,
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Make the drawer take the entire screen and draw the background of the
|
|
112
|
-
* status bar to allow it to open over the status bar. It will only have an
|
|
113
|
-
* effect on API 21+.
|
|
114
|
-
*/
|
|
115
|
-
statusBarBackgroundColor?: ?ColorValue,
|
|
116
|
-
|
|
117
|
-
children?: React.Node,
|
|
118
|
-
style?: ?ViewStyleProp,
|
|
119
|
-
}>;
|
|
120
|
-
|
|
121
|
-
type State = {
|
|
122
|
-
drawerOpened: boolean,
|
|
123
|
-
};
|
|
124
|
-
|
|
125
36
|
/**
|
|
126
37
|
* React component that wraps the platform `DrawerLayout` (Android only). The
|
|
127
38
|
* Drawer (typically used for navigation) is rendered with `renderNavigationView`
|
|
@@ -153,7 +64,10 @@ type State = {
|
|
|
153
64
|
* },
|
|
154
65
|
* ```
|
|
155
66
|
*/
|
|
156
|
-
class DrawerLayoutAndroid
|
|
67
|
+
class DrawerLayoutAndroid
|
|
68
|
+
extends React.Component<DrawerLayoutAndroidProps, DrawerLayoutAndroidState>
|
|
69
|
+
implements DrawerLayoutAndroidMethods
|
|
70
|
+
{
|
|
157
71
|
static get positions(): mixed {
|
|
158
72
|
console.warn(
|
|
159
73
|
'Setting DrawerLayoutAndroid drawerPosition using `DrawerLayoutAndroid.positions` is deprecated. Instead pass the string value "left" or "right"',
|
|
@@ -168,7 +82,7 @@ class DrawerLayoutAndroid extends React.Component<Props, State> {
|
|
|
168
82
|
React.ElementRef<typeof AndroidDrawerLayoutNativeComponent>,
|
|
169
83
|
>();
|
|
170
84
|
|
|
171
|
-
state:
|
|
85
|
+
state: DrawerLayoutAndroidState = {
|
|
172
86
|
drawerOpened: false,
|
|
173
87
|
};
|
|
174
88
|
|
|
@@ -391,4 +305,4 @@ const styles = StyleSheet.create({
|
|
|
391
305
|
},
|
|
392
306
|
});
|
|
393
307
|
|
|
394
|
-
export default DrawerLayoutAndroid;
|
|
308
|
+
export default DrawerLayoutAndroid as $FlowFixMe as DrawerLayoutAndroidCommon;
|
|
@@ -10,8 +10,68 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
//
|
|
14
|
-
import
|
|
13
|
+
// import typeof DrawerLayoutAndroid from './DrawerLayoutAndroid.android';
|
|
14
|
+
import type {
|
|
15
|
+
MeasureInWindowOnSuccessCallback,
|
|
16
|
+
MeasureLayoutOnSuccessCallback,
|
|
17
|
+
MeasureOnSuccessCallback,
|
|
18
|
+
} from '../../../src/private/types/HostInstance';
|
|
19
|
+
import type {
|
|
20
|
+
DrawerLayoutAndroidMethods,
|
|
21
|
+
DrawerLayoutAndroidProps,
|
|
22
|
+
DrawerLayoutAndroidState,
|
|
23
|
+
} from './DrawerLayoutAndroidTypes';
|
|
15
24
|
|
|
16
|
-
|
|
17
|
-
|
|
25
|
+
import UnimplementedView from '../UnimplementedViews/UnimplementedView';
|
|
26
|
+
import * as React from 'react';
|
|
27
|
+
|
|
28
|
+
export type {
|
|
29
|
+
DrawerLayoutAndroidProps,
|
|
30
|
+
DrawerSlideEvent,
|
|
31
|
+
} from './DrawerLayoutAndroidTypes';
|
|
32
|
+
|
|
33
|
+
export default class DrawerLayoutAndroid
|
|
34
|
+
extends React.Component<DrawerLayoutAndroidProps, DrawerLayoutAndroidState>
|
|
35
|
+
implements DrawerLayoutAndroidMethods
|
|
36
|
+
{
|
|
37
|
+
render(): React.Node {
|
|
38
|
+
return <UnimplementedView {...this.props} />;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
openDrawer(): void {
|
|
42
|
+
throw new Error('DrawerLayoutAndroid is only available on Android');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
closeDrawer(): void {
|
|
46
|
+
throw new Error('DrawerLayoutAndroid is only available on Android');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
blur(): void {
|
|
50
|
+
throw new Error('DrawerLayoutAndroid is only available on Android');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
focus(): void {
|
|
54
|
+
throw new Error('DrawerLayoutAndroid is only available on Android');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
measure(callback: MeasureOnSuccessCallback): void {
|
|
58
|
+
throw new Error('DrawerLayoutAndroid is only available on Android');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
measureInWindow(callback: MeasureInWindowOnSuccessCallback): void {
|
|
62
|
+
throw new Error('DrawerLayoutAndroid is only available on Android');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
measureLayout(
|
|
66
|
+
relativeToNativeNode: number,
|
|
67
|
+
onSuccess: MeasureLayoutOnSuccessCallback,
|
|
68
|
+
onFail?: () => void,
|
|
69
|
+
): void {
|
|
70
|
+
throw new Error('DrawerLayoutAndroid is only available on Android');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// $FlowFixMe[unclear-type]
|
|
74
|
+
setNativeProps(nativeProps: Object): void {
|
|
75
|
+
throw new Error('DrawerLayoutAndroid is only available on Android');
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
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 {
|
|
12
|
+
MeasureInWindowOnSuccessCallback,
|
|
13
|
+
MeasureLayoutOnSuccessCallback,
|
|
14
|
+
MeasureOnSuccessCallback,
|
|
15
|
+
} from '../../../src/private/types/HostInstance';
|
|
16
|
+
import type {ColorValue} from '../../StyleSheet/StyleSheet';
|
|
17
|
+
import type {NativeSyntheticEvent} from '../../Types/CoreEventTypes';
|
|
18
|
+
import type {ViewProps} from '../View/ViewPropTypes';
|
|
19
|
+
|
|
20
|
+
import * as React from 'react';
|
|
21
|
+
|
|
22
|
+
export type DrawerStates = 'Idle' | 'Dragging' | 'Settling';
|
|
23
|
+
|
|
24
|
+
export type DrawerSlideEvent = NativeSyntheticEvent<
|
|
25
|
+
$ReadOnly<{
|
|
26
|
+
offset: number,
|
|
27
|
+
}>,
|
|
28
|
+
>;
|
|
29
|
+
|
|
30
|
+
export type DrawerLayoutAndroidProps = $ReadOnly<{
|
|
31
|
+
...ViewProps,
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Determines whether the keyboard gets dismissed in response to a drag.
|
|
35
|
+
* - 'none' (the default), drags do not dismiss the keyboard.
|
|
36
|
+
* - 'on-drag', the keyboard is dismissed when a drag begins.
|
|
37
|
+
*/
|
|
38
|
+
keyboardDismissMode?: ?('none' | 'on-drag'),
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Specifies the background color of the drawer. The default value is white.
|
|
42
|
+
* If you want to set the opacity of the drawer, use rgba. Example:
|
|
43
|
+
*
|
|
44
|
+
* ```
|
|
45
|
+
* return (
|
|
46
|
+
* <DrawerLayoutAndroid drawerBackgroundColor="rgba(0,0,0,0.5)">
|
|
47
|
+
* </DrawerLayoutAndroid>
|
|
48
|
+
* );
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
drawerBackgroundColor?: ?ColorValue,
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Specifies the side of the screen from which the drawer will slide in.
|
|
55
|
+
*/
|
|
56
|
+
drawerPosition: ?('left' | 'right'),
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Specifies the width of the drawer, more precisely the width of the view that be pulled in
|
|
60
|
+
* from the edge of the window.
|
|
61
|
+
*/
|
|
62
|
+
drawerWidth?: ?number,
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Specifies the lock mode of the drawer. The drawer can be locked in 3 states:
|
|
66
|
+
* - unlocked (default), meaning that the drawer will respond (open/close) to touch gestures.
|
|
67
|
+
* - locked-closed, meaning that the drawer will stay closed and not respond to gestures.
|
|
68
|
+
* - locked-open, meaning that the drawer will stay opened and not respond to gestures.
|
|
69
|
+
* The drawer may still be opened and closed programmatically (`openDrawer`/`closeDrawer`).
|
|
70
|
+
*/
|
|
71
|
+
drawerLockMode?: ?('unlocked' | 'locked-closed' | 'locked-open'),
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Function called whenever there is an interaction with the navigation view.
|
|
75
|
+
*/
|
|
76
|
+
onDrawerSlide?: ?(event: DrawerSlideEvent) => mixed,
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Function called when the drawer state has changed. The drawer can be in 3 states:
|
|
80
|
+
* - Idle, meaning there is no interaction with the navigation view happening at the time
|
|
81
|
+
* - Dragging, meaning there is currently an interaction with the navigation view
|
|
82
|
+
* - Settling, meaning that there was an interaction with the navigation view, and the
|
|
83
|
+
* navigation view is now finishing its closing or opening animation
|
|
84
|
+
*/
|
|
85
|
+
onDrawerStateChanged?: ?(state: DrawerStates) => mixed,
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Function called whenever the navigation view has been opened.
|
|
89
|
+
*/
|
|
90
|
+
onDrawerOpen?: ?() => mixed,
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Function called whenever the navigation view has been closed.
|
|
94
|
+
*/
|
|
95
|
+
onDrawerClose?: ?() => mixed,
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* The navigation view that will be rendered to the side of the screen and can be pulled in.
|
|
99
|
+
*/
|
|
100
|
+
renderNavigationView: () => React.MixedElement,
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Make the drawer take the entire screen and draw the background of the
|
|
104
|
+
* status bar to allow it to open over the status bar. It will only have an
|
|
105
|
+
* effect on API 21+.
|
|
106
|
+
*/
|
|
107
|
+
statusBarBackgroundColor?: ?ColorValue,
|
|
108
|
+
}>;
|
|
109
|
+
|
|
110
|
+
export type DrawerLayoutAndroidState = {
|
|
111
|
+
drawerOpened: boolean,
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export interface DrawerLayoutAndroidMethods {
|
|
115
|
+
/**
|
|
116
|
+
* Opens the drawer.
|
|
117
|
+
*/
|
|
118
|
+
openDrawer(): void;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Closes the drawer.
|
|
122
|
+
*/
|
|
123
|
+
closeDrawer(): void;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Native methods
|
|
127
|
+
*/
|
|
128
|
+
blur(): void;
|
|
129
|
+
focus(): void;
|
|
130
|
+
measure(callback: MeasureOnSuccessCallback): void;
|
|
131
|
+
measureInWindow(callback: MeasureInWindowOnSuccessCallback): void;
|
|
132
|
+
measureLayout(
|
|
133
|
+
relativeToNativeNode: number,
|
|
134
|
+
onSuccess: MeasureLayoutOnSuccessCallback,
|
|
135
|
+
onFail?: () => void,
|
|
136
|
+
): void;
|
|
137
|
+
setNativeProps(nativeProps: Object): void;
|
|
138
|
+
}
|
|
@@ -25,7 +25,7 @@ import View from '../View/View';
|
|
|
25
25
|
import Keyboard from './Keyboard';
|
|
26
26
|
import * as React from 'react';
|
|
27
27
|
|
|
28
|
-
type
|
|
28
|
+
export type KeyboardAvoidingViewProps = $ReadOnly<{
|
|
29
29
|
...ViewProps,
|
|
30
30
|
|
|
31
31
|
/**
|
|
@@ -59,7 +59,10 @@ type State = {
|
|
|
59
59
|
* View that moves out of the way when the keyboard appears by automatically
|
|
60
60
|
* adjusting its height, position, or bottom padding.
|
|
61
61
|
*/
|
|
62
|
-
class KeyboardAvoidingView extends React.Component<
|
|
62
|
+
class KeyboardAvoidingView extends React.Component<
|
|
63
|
+
KeyboardAvoidingViewProps,
|
|
64
|
+
State,
|
|
65
|
+
> {
|
|
63
66
|
_frame: ?ViewLayout = null;
|
|
64
67
|
_keyboardEvent: ?KeyboardEvent = null;
|
|
65
68
|
_subscriptions: Array<EventSubscription> = [];
|
|
@@ -67,7 +70,7 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
|
|
|
67
70
|
_initialFrameHeight: number = 0;
|
|
68
71
|
_bottom: number = 0;
|
|
69
72
|
|
|
70
|
-
constructor(props:
|
|
73
|
+
constructor(props: KeyboardAvoidingViewProps) {
|
|
71
74
|
super(props);
|
|
72
75
|
this.state = {bottom: 0};
|
|
73
76
|
this.viewRef = React.createRef();
|
|
@@ -175,7 +178,7 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
|
|
|
175
178
|
}
|
|
176
179
|
};
|
|
177
180
|
|
|
178
|
-
componentDidUpdate(_:
|
|
181
|
+
componentDidUpdate(_: KeyboardAvoidingViewProps, prevState: State): void {
|
|
179
182
|
const enabled = this.props.enabled ?? true;
|
|
180
183
|
if (enabled && this._bottom !== prevState.bottom) {
|
|
181
184
|
this.setState({bottom: this._bottom});
|
|
@@ -13,7 +13,7 @@ import StyleSheet from '../../StyleSheet/StyleSheet';
|
|
|
13
13
|
import LayoutConformanceNativeComponent from './LayoutConformanceNativeComponent';
|
|
14
14
|
import * as React from 'react';
|
|
15
15
|
|
|
16
|
-
type
|
|
16
|
+
export type LayoutConformanceProps = $ReadOnly<{
|
|
17
17
|
/**
|
|
18
18
|
* strict: Layout in accordance with W3C spec, even when breaking
|
|
19
19
|
* compatibility: Layout with the same behavior as previous versions of React Native
|
|
@@ -29,13 +29,15 @@ type Props = $ReadOnly<{
|
|
|
29
29
|
// degrade the error experience).
|
|
30
30
|
const isFabricUIManagerInstalled = global?.nativeFabricUIManager != null;
|
|
31
31
|
|
|
32
|
-
function LayoutConformance(props:
|
|
32
|
+
function LayoutConformance(props: LayoutConformanceProps): React.Node {
|
|
33
33
|
return (
|
|
34
34
|
<LayoutConformanceNativeComponent {...props} style={styles.container} />
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
function UnimplementedLayoutConformance(
|
|
38
|
+
function UnimplementedLayoutConformance(
|
|
39
|
+
props: LayoutConformanceProps,
|
|
40
|
+
): React.Node {
|
|
39
41
|
if (__DEV__) {
|
|
40
42
|
const warnOnce = require('../../Utilities/warnOnce').default;
|
|
41
43
|
|
|
@@ -50,7 +52,7 @@ function UnimplementedLayoutConformance(props: Props): React.Node {
|
|
|
50
52
|
|
|
51
53
|
export default (isFabricUIManagerInstalled
|
|
52
54
|
? LayoutConformance
|
|
53
|
-
: UnimplementedLayoutConformance) as component(...
|
|
55
|
+
: UnimplementedLayoutConformance) as component(...LayoutConformanceProps);
|
|
54
56
|
|
|
55
57
|
const styles = StyleSheet.create({
|
|
56
58
|
container: {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {HostComponent} from '
|
|
11
|
+
import type {HostComponent} from '../../../src/private/types/HostComponent';
|
|
12
12
|
import type {ViewProps} from '../View/ViewPropTypes';
|
|
13
13
|
|
|
14
14
|
import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry';
|