@office-iss/react-native-win32 0.76.2 → 0.77.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/.eslintignore +1 -1
- package/.flowconfig +5 -1
- package/CHANGELOG.json +164 -53
- package/CHANGELOG.md +74 -28
- package/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +1 -0
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +13 -0
- package/Libraries/Animated/AnimatedEvent.js +1 -1
- package/Libraries/Animated/AnimatedImplementation.js +2 -2
- package/Libraries/Animated/NativeAnimatedAllowlist.js +20 -9
- package/Libraries/Animated/animations/Animation.js +60 -25
- package/Libraries/Animated/animations/DecayAnimation.js +26 -38
- package/Libraries/Animated/animations/SpringAnimation.js +33 -39
- package/Libraries/Animated/animations/TimingAnimation.js +34 -42
- package/Libraries/Animated/components/AnimatedFlatList.js +1 -1
- package/Libraries/Animated/components/AnimatedSectionList.js +3 -1
- package/Libraries/Animated/createAnimatedComponent.js +60 -33
- package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +1 -1
- package/Libraries/Animated/nodes/AnimatedNode.js +39 -45
- package/Libraries/Animated/nodes/AnimatedObject.js +13 -3
- package/Libraries/Animated/nodes/AnimatedProps.js +96 -46
- package/Libraries/Animated/nodes/AnimatedStyle.js +108 -39
- package/Libraries/Animated/nodes/AnimatedTransform.js +56 -23
- package/Libraries/Animated/nodes/AnimatedValue.js +1 -1
- package/Libraries/Animated/nodes/AnimatedWithChildren.js +1 -3
- package/Libraries/Animated/useAnimatedProps.js +41 -35
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +19 -3
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +77 -5
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +82 -5
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +4 -4
- package/Libraries/Components/Button.js +9 -4
- package/Libraries/Components/Button.win32.js +12 -4
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +3 -1
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +7 -0
- package/Libraries/Components/Pressable/Pressable.js +4 -4
- package/Libraries/Components/Pressable/Pressable.win32.js +4 -4
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +13 -7
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +3 -2
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +4 -4
- package/Libraries/Components/SafeAreaView/SafeAreaView.win32.js +4 -4
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +0 -1
- package/Libraries/Components/ScrollView/ScrollView.js +49 -88
- package/Libraries/Components/ScrollView/ScrollViewCommands.js +1 -1
- package/Libraries/Components/ScrollView/ScrollViewContext.js +2 -0
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +0 -2
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +8 -9
- package/Libraries/Components/Switch/Switch.js +8 -6
- package/Libraries/Components/TextInput/InputAccessoryView.js +1 -1
- package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +4 -4
- package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +6 -4
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +2 -1
- package/Libraries/Components/TextInput/TextInput.d.ts +27 -4
- package/Libraries/Components/TextInput/TextInput.flow.js +36 -19
- package/Libraries/Components/TextInput/TextInput.js +37 -13
- package/Libraries/Components/TextInput/TextInput.win32.js +40 -15
- package/Libraries/Components/TextInput/TextInputState.js +11 -13
- package/Libraries/Components/TextInput/TextInputState.win32.js +13 -16
- package/Libraries/Components/TextInput/Win32TextInputNativeComponent.js +3 -0
- package/Libraries/Components/Touchable/BoundingDimensions.js +11 -3
- package/Libraries/Components/Touchable/Position.js +7 -2
- package/Libraries/Components/Touchable/Touchable.js +4 -0
- package/Libraries/Components/Touchable/Touchable.win32.js +4 -0
- package/Libraries/Components/Touchable/TouchableBounce.js +6 -2
- package/Libraries/Components/Touchable/TouchableHighlight.js +5 -5
- package/Libraries/Components/Touchable/TouchableOpacity.js +6 -5
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +1 -2
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +6 -1
- package/Libraries/Components/View/View.js +4 -4
- package/Libraries/Components/View/View.win32.js +4 -4
- package/Libraries/Components/View/ViewNativeComponent.js +6 -98
- package/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
- package/Libraries/Components/View/ViewPropTypes.js +0 -3
- package/Libraries/Components/View/ViewPropTypes.win32.js +0 -3
- package/Libraries/Components/View/ViewWin32.js +1 -0
- package/Libraries/Core/ExceptionsManager.js +50 -29
- package/Libraries/Core/ReactNativeVersion.js +3 -3
- package/Libraries/Core/__mocks__/NativeExceptionsManager.js +0 -1
- package/Libraries/Core/setUpBatchedBridge.js +1 -10
- package/Libraries/Core/setUpDeveloperTools.js +1 -5
- package/Libraries/Core/setUpErrorHandling.js +20 -18
- package/Libraries/Core/setUpReactDevTools.js +107 -8
- package/Libraries/Core/setUpSegmentFetcher.js +1 -0
- package/Libraries/Core/setUpTimers.js +21 -18
- package/Libraries/Debugging/DebuggingOverlay.js +4 -5
- package/Libraries/Image/AssetSourceResolver.js +12 -1
- package/Libraries/Image/Image.android.js +1 -5
- package/Libraries/Image/Image.d.ts +20 -29
- package/Libraries/Image/Image.ios.js +0 -2
- package/Libraries/Image/Image.win32.js +0 -2
- package/Libraries/Image/ImageBackground.js +2 -5
- package/Libraries/Image/ImageProps.js +7 -6
- package/Libraries/Image/ImageResizeMode.d.ts +8 -1
- package/Libraries/Image/ImageResizeMode.js +4 -1
- package/Libraries/Image/ImageSource.d.ts +0 -2
- package/Libraries/Image/ImageSource.js +0 -2
- package/Libraries/Image/ImageTypes.flow.js +11 -9
- package/Libraries/Image/ImageUtils.js +6 -3
- package/Libraries/Image/ImageViewNativeComponent.js +5 -3
- package/Libraries/Inspector/Inspector.js +1 -0
- package/Libraries/Inspector/Inspector.win32.js +2 -1
- package/Libraries/Inspector/NetworkOverlay.js +4 -0
- package/Libraries/Inspector/ReactDevToolsOverlay.js +8 -14
- package/Libraries/Inspector/getInspectorDataForViewAtPoint.js +3 -5
- package/Libraries/Interaction/InteractionManager.js +6 -1
- package/Libraries/Interaction/InteractionManagerStub.js +176 -0
- package/Libraries/Interaction/TouchHistoryMath.js +22 -19
- package/Libraries/JSInspector/NetworkAgent.js +1 -1
- package/Libraries/Lists/FlatList.d.ts +1 -2
- package/Libraries/Lists/FlatList.js +2 -2
- package/Libraries/Lists/SectionListModern.js +7 -7
- package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +2 -2
- package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +1 -1
- package/Libraries/LogBox/Data/LogBoxData.js +3 -3
- package/Libraries/LogBox/LogBox.js +18 -5
- package/Libraries/LogBox/LogBoxInspectorContainer.js +1 -1
- package/Libraries/LogBox/LogBoxNotificationContainer.js +2 -2
- package/Libraries/LogBox/UI/AnsiHighlight.js +26 -17
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +6 -1
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.win32.js +6 -1
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +1 -1
- package/Libraries/LogBox/UI/LogBoxMessage.js +2 -2
- package/Libraries/Modal/Modal.d.ts +12 -0
- package/Libraries/Modal/Modal.js +31 -4
- package/Libraries/NativeComponent/BaseViewConfig.android.js +72 -1
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +2 -1
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +3 -11
- package/Libraries/NativeComponent/NativeComponentRegistry.js +3 -3
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +0 -1
- package/Libraries/Network/XHRInterceptor.js +63 -14
- package/Libraries/Network/XMLHttpRequest.js +26 -1
- package/Libraries/NewAppScreen/components/HermesBadge.js +1 -1
- package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +49 -2
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +4 -4
- package/Libraries/Pressability/HoverState.js +2 -0
- package/Libraries/Pressability/HoverState.win32.js +2 -0
- package/Libraries/Pressability/Pressability.js +2 -3
- package/Libraries/Pressability/Pressability.win32.js +2 -3
- package/Libraries/Pressability/usePressability.js +4 -1
- package/Libraries/ReactNative/AppContainer.js +1 -1
- package/Libraries/ReactNative/AppRegistry.js +1 -11
- package/Libraries/ReactNative/DisplayMode.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -3
- package/Libraries/ReactNative/RendererImplementation.js +18 -17
- package/Libraries/ReactNative/getCachedComponentWithDebugName.js +1 -3
- package/Libraries/ReactNative/renderApplication.js +9 -8
- package/Libraries/ReactNative/requireNativeComponent.js +5 -2
- package/Libraries/Renderer/shims/ReactFabric.js +3 -3
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +2 -2
- package/Libraries/Renderer/shims/ReactNative.js +3 -3
- package/Libraries/Renderer/shims/ReactNativeTypes.js +22 -35
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +5 -6
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -2
- package/Libraries/StyleSheet/StyleSheet.js +7 -1
- package/Libraries/StyleSheet/StyleSheet.win32.js +7 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +13 -2
- package/Libraries/StyleSheet/StyleSheetTypes.js +24 -6
- package/Libraries/StyleSheet/processBackgroundImage.js +87 -110
- package/Libraries/StyleSheet/processTransform.js +3 -34
- package/Libraries/Text/Text.js +248 -249
- package/Libraries/Text/Text.win32.js +282 -295
- package/Libraries/Text/TextNativeComponent.js +0 -1
- package/Libraries/TurboModule/TurboModuleRegistry.js +5 -5
- package/Libraries/Types/CoreEventTypes.d.ts +3 -10
- package/Libraries/Types/CoreEventTypes.js +4 -6
- package/Libraries/Types/CoreEventTypes.win32.js +4 -6
- package/Libraries/Utilities/Appearance.js +3 -1
- package/Libraries/Utilities/BackHandler.android.js +6 -18
- package/Libraries/Utilities/BackHandler.d.ts +0 -4
- package/Libraries/Utilities/BackHandler.ios.js +0 -7
- package/Libraries/Utilities/BackHandler.win32.js +6 -18
- package/Libraries/Utilities/FocusManager.win32.js +1 -1
- package/Libraries/Utilities/HMRClient.js +3 -4
- package/Libraries/Utilities/Platform.flow.js +2 -2
- package/Libraries/Utilities/Platform.flow.win32.js +3 -2
- package/Libraries/Utilities/__mocks__/BackHandler.js +3 -8
- package/Libraries/Utilities/codegenNativeComponent.js +1 -1
- package/Libraries/Utilities/useMergeRefs.js +26 -7
- package/Libraries/WebSocket/WebSocketEvent.js +4 -1
- package/Libraries/WebSocket/WebSocketInterceptor.js +31 -13
- package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +6 -5
- package/Libraries/promiseRejectionTrackingOptions.js +1 -1
- package/index.js +10 -3
- package/index.win32.js +10 -3
- package/jest/setup.js +36 -1
- package/overrides.json +37 -37
- package/package.json +20 -20
- package/src/private/animated/NativeAnimatedHelper.js +18 -16
- package/src/private/animated/NativeAnimatedHelper.win32.js +18 -15
- package/src/private/animated/useAnimatedPropsMemo.js +348 -0
- package/src/private/components/HScrollViewNativeComponents.js +1 -27
- package/src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE.js +11 -8
- package/src/private/components/VScrollViewNativeComponents.js +2 -25
- package/src/private/debugging/ReactDevToolsSettingsManager.android.js +20 -0
- package/src/private/debugging/ReactDevToolsSettingsManager.ios.js +30 -0
- package/src/private/debugging/ReactDevToolsSettingsManager.win32.js +20 -0
- package/src/private/{fusebox → debugging}/setUpFuseboxReactDevToolsDispatcher.js +6 -0
- package/src/private/devmenu/DevMenu.d.ts +20 -0
- package/src/private/devmenu/DevMenu.js +31 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +95 -86
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +8 -2
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +17 -19
- package/src/private/fusebox/specs/NativeReactDevToolsRuntimeSettingsModule.js +34 -0
- package/src/private/setup/setUpDOM.js +14 -6
- package/src/private/setup/setUpMutationObserver.js +5 -0
- package/src/private/specs/components/AndroidHorizontalScrollContentViewNativeComponent.js +1 -0
- package/src/private/specs/components/RCTModalHostViewNativeComponent.js +8 -0
- package/src/private/specs/modules/NativeAccessibilityInfo.js +9 -0
- package/src/private/specs/modules/NativeAccessibilityInfoWin32.js +9 -0
- package/src/private/specs/modules/NativeAccessibilityManager.js +4 -0
- package/src/private/specs/modules/NativeActionSheetManager.js +2 -0
- package/src/private/specs/modules/NativeAppearance.js +4 -10
- package/src/private/specs/modules/NativeExceptionsManager.js +0 -12
- package/src/private/specs/modules/{NativeDevToolsSettingsManager.js → NativeReactDevToolsSettingsManager.js} +3 -5
- package/src/private/webapis/dom/geometry/DOMRect.js +2 -2
- package/src/private/webapis/dom/geometry/DOMRectReadOnly.js +2 -2
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +2 -3
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +102 -11
- package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +26 -0
- package/src/private/webapis/intersectionobserver/IntersectionObserverManager.js +1 -0
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +1 -0
- package/src/private/webapis/intersectionobserver/specs/__mocks__/NativeIntersectionObserver.js +9 -0
- package/src/private/webapis/performance/EventTiming.js +13 -8
- package/src/private/webapis/performance/Performance.js +66 -73
- package/src/private/webapis/performance/PerformanceEntry.js +2 -5
- package/src/private/webapis/performance/PerformanceObserver.js +65 -164
- package/src/private/webapis/performance/RawPerformanceEntry.js +1 -1
- package/src/private/webapis/performance/UserTiming.js +11 -7
- package/src/private/webapis/performance/Utilities.js +18 -0
- package/src/private/webapis/performance/specs/NativePerformance.js +71 -2
- package/src/private/webapis/performance/specs/__mocks__/NativePerformanceMock.js +267 -0
- package/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +19 -3
- package/src-win/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
- package/types/index.d.ts +1 -1
- package/types/public/ReactNativeTypes.d.ts +4 -8
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.android.js +0 -35
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.d.ts +0 -20
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.ios.js +0 -49
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.win32.js +0 -35
- package/Libraries/DevToolsSettings/NativeDevToolsSettingsManager.js +0 -13
- package/Libraries/ReactNative/ReactFabricInternals.js +0 -17
- package/src/private/components/useSyncOnScroll.js +0 -48
- package/src/private/webapis/performance/specs/NativePerformanceObserver.js +0 -61
- package/src/private/webapis/performance/specs/__mocks__/NativePerformance.js +0 -67
- package/src/private/webapis/performance/specs/__mocks__/NativePerformanceObserver.js +0 -127
- package/types/experimental.d.ts +0 -59
- /package/src/private/{fusebox → debugging}/FuseboxSessionObserver.js +0 -0
|
@@ -8,11 +8,7 @@
|
|
|
8
8
|
* @flow strict-local
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {
|
|
12
|
-
TScrollViewNativeComponentInstance,
|
|
13
|
-
TScrollViewNativeImperativeHandle,
|
|
14
|
-
} from '../../../src/private/components/useSyncOnScroll';
|
|
15
|
-
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
|
11
|
+
import type {HostInstance} from '../../Renderer/shims/ReactNativeTypes';
|
|
16
12
|
import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType';
|
|
17
13
|
import type {PointProp} from '../../StyleSheet/PointPropType';
|
|
18
14
|
import type {ViewStyleProp} from '../../StyleSheet/StyleSheet';
|
|
@@ -46,7 +42,6 @@ import StyleSheet from '../../StyleSheet/StyleSheet';
|
|
|
46
42
|
import Dimensions from '../../Utilities/Dimensions';
|
|
47
43
|
import dismissKeyboard from '../../Utilities/dismissKeyboard';
|
|
48
44
|
import Platform from '../../Utilities/Platform';
|
|
49
|
-
import EventEmitter from '../../vendor/emitter/EventEmitter';
|
|
50
45
|
import Keyboard from '../Keyboard/Keyboard';
|
|
51
46
|
import TextInputState from '../TextInput/TextInputState';
|
|
52
47
|
import processDecelerationRate from './processDecelerationRate';
|
|
@@ -152,7 +147,7 @@ export type DecelerationRateType = 'fast' | 'normal' | number;
|
|
|
152
147
|
export type ScrollResponderType = ScrollViewImperativeMethods;
|
|
153
148
|
|
|
154
149
|
type PublicScrollViewInstance = $ReadOnly<{|
|
|
155
|
-
|
|
150
|
+
...HostInstance,
|
|
156
151
|
...ScrollViewImperativeMethods,
|
|
157
152
|
|}>;
|
|
158
153
|
|
|
@@ -371,10 +366,10 @@ type AndroidProps = $ReadOnly<{|
|
|
|
371
366
|
fadingEdgeLength?: ?number,
|
|
372
367
|
|}>;
|
|
373
368
|
|
|
374
|
-
type StickyHeaderComponentType =
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
369
|
+
type StickyHeaderComponentType = component(
|
|
370
|
+
ref?: React.RefSetter<$ReadOnly<interface {setNextHeaderY: number => void}>>,
|
|
371
|
+
...ScrollViewStickyHeaderProps
|
|
372
|
+
);
|
|
378
373
|
|
|
379
374
|
export type Props = $ReadOnly<{|
|
|
380
375
|
...ViewProps,
|
|
@@ -743,10 +738,6 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
743
738
|
_subscriptionKeyboardDidShow: ?EventSubscription = null;
|
|
744
739
|
_subscriptionKeyboardDidHide: ?EventSubscription = null;
|
|
745
740
|
|
|
746
|
-
#onScrollEmitter: ?EventEmitter<{
|
|
747
|
-
scroll: [{x: number, y: number}],
|
|
748
|
-
}> = null;
|
|
749
|
-
|
|
750
741
|
state: State = {
|
|
751
742
|
layoutHeight: null,
|
|
752
743
|
};
|
|
@@ -817,8 +808,6 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
817
808
|
if (this._scrollAnimatedValueAttachment) {
|
|
818
809
|
this._scrollAnimatedValueAttachment.detach();
|
|
819
810
|
}
|
|
820
|
-
|
|
821
|
-
this.#onScrollEmitter?.removeAllListeners();
|
|
822
811
|
}
|
|
823
812
|
|
|
824
813
|
/**
|
|
@@ -844,9 +833,8 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
844
833
|
return this._innerView.nativeInstance;
|
|
845
834
|
};
|
|
846
835
|
|
|
847
|
-
getNativeScrollRef: () =>
|
|
848
|
-
|
|
849
|
-
return nativeInstance == null ? null : nativeInstance.componentRef.current;
|
|
836
|
+
getNativeScrollRef: () => HostInstance | null = () => {
|
|
837
|
+
return this._scrollView.nativeInstance;
|
|
850
838
|
};
|
|
851
839
|
|
|
852
840
|
/**
|
|
@@ -937,20 +925,6 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
937
925
|
Commands.flashScrollIndicators(component);
|
|
938
926
|
};
|
|
939
927
|
|
|
940
|
-
_subscribeToOnScroll: (
|
|
941
|
-
callback: ({x: number, y: number}) => void,
|
|
942
|
-
) => EventSubscription = callback => {
|
|
943
|
-
let onScrollEmitter = this.#onScrollEmitter;
|
|
944
|
-
if (onScrollEmitter == null) {
|
|
945
|
-
onScrollEmitter = new EventEmitter();
|
|
946
|
-
this.#onScrollEmitter = onScrollEmitter;
|
|
947
|
-
// This is the first subscription, so make sure the native component is
|
|
948
|
-
// also configured to output synchronous scroll events.
|
|
949
|
-
this._scrollView.nativeInstance?.unstable_setEnableSyncOnScroll(true);
|
|
950
|
-
}
|
|
951
|
-
return onScrollEmitter.addListener('scroll', callback);
|
|
952
|
-
};
|
|
953
|
-
|
|
954
928
|
/**
|
|
955
929
|
* This method should be used as the callback to onFocus in a TextInputs'
|
|
956
930
|
* parent view. Note that any module using this mixin needs to return
|
|
@@ -961,12 +935,12 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
961
935
|
* @param {bool} preventNegativeScrolling Whether to allow pulling the content
|
|
962
936
|
* down to make it meet the keyboard's top. Default is false.
|
|
963
937
|
*/
|
|
964
|
-
scrollResponderScrollNativeHandleToKeyboard:
|
|
965
|
-
nodeHandle: number |
|
|
938
|
+
scrollResponderScrollNativeHandleToKeyboard: (
|
|
939
|
+
nodeHandle: number | HostInstance,
|
|
966
940
|
additionalOffset?: number,
|
|
967
941
|
preventNegativeScrollOffset?: boolean,
|
|
968
|
-
) => void =
|
|
969
|
-
nodeHandle: number |
|
|
942
|
+
) => void = (
|
|
943
|
+
nodeHandle: number | HostInstance,
|
|
970
944
|
additionalOffset?: number,
|
|
971
945
|
preventNegativeScrollOffset?: boolean,
|
|
972
946
|
) => {
|
|
@@ -1154,11 +1128,6 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
1154
1128
|
_handleScroll = (e: ScrollEvent) => {
|
|
1155
1129
|
this._observedScrollSinceBecomingResponder = true;
|
|
1156
1130
|
this.props.onScroll && this.props.onScroll(e);
|
|
1157
|
-
|
|
1158
|
-
this.#onScrollEmitter?.emit('scroll', {
|
|
1159
|
-
x: e.nativeEvent.contentOffset.x,
|
|
1160
|
-
y: e.nativeEvent.contentOffset.y,
|
|
1161
|
-
});
|
|
1162
1131
|
};
|
|
1163
1132
|
|
|
1164
1133
|
_handleLayout = (e: LayoutEvent) => {
|
|
@@ -1181,45 +1150,36 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
1181
1150
|
(instance: InnerViewInstance): InnerViewInstance => instance,
|
|
1182
1151
|
);
|
|
1183
1152
|
|
|
1184
|
-
_scrollView: RefForwarder<
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
scrollToEnd: this.scrollToEnd,
|
|
1212
|
-
flashScrollIndicators: this.flashScrollIndicators,
|
|
1213
|
-
scrollResponderZoomTo: this.scrollResponderZoomTo,
|
|
1214
|
-
// TODO: Replace unstable_subscribeToOnScroll once scrollView.addEventListener('scroll', (e: ScrollEvent) => {}, {passive: false});
|
|
1215
|
-
unstable_subscribeToOnScroll: this._subscribeToOnScroll,
|
|
1216
|
-
scrollResponderScrollNativeHandleToKeyboard:
|
|
1217
|
-
this.scrollResponderScrollNativeHandleToKeyboard,
|
|
1218
|
-
},
|
|
1219
|
-
);
|
|
1153
|
+
_scrollView: RefForwarder<HostInstance, PublicScrollViewInstance | null> =
|
|
1154
|
+
createRefForwarder(nativeInstance => {
|
|
1155
|
+
// This is a hack. Ideally we would forwardRef to the underlying
|
|
1156
|
+
// host component. However, since ScrollView has it's own methods that can be
|
|
1157
|
+
// called as well, if we used the standard forwardRef then these
|
|
1158
|
+
// methods wouldn't be accessible and thus be a breaking change.
|
|
1159
|
+
//
|
|
1160
|
+
// Therefore we edit ref to include ScrollView's public methods so that
|
|
1161
|
+
// they are callable from the ref.
|
|
1162
|
+
|
|
1163
|
+
// $FlowFixMe[prop-missing] - Known issue with appending custom methods.
|
|
1164
|
+
const publicInstance: PublicScrollViewInstance = Object.assign(
|
|
1165
|
+
nativeInstance,
|
|
1166
|
+
{
|
|
1167
|
+
getScrollResponder: this.getScrollResponder,
|
|
1168
|
+
getScrollableNode: this.getScrollableNode,
|
|
1169
|
+
getInnerViewNode: this.getInnerViewNode,
|
|
1170
|
+
getInnerViewRef: this.getInnerViewRef,
|
|
1171
|
+
getNativeScrollRef: this.getNativeScrollRef,
|
|
1172
|
+
scrollTo: this.scrollTo,
|
|
1173
|
+
scrollToEnd: this.scrollToEnd,
|
|
1174
|
+
flashScrollIndicators: this.flashScrollIndicators,
|
|
1175
|
+
scrollResponderZoomTo: this.scrollResponderZoomTo,
|
|
1176
|
+
scrollResponderScrollNativeHandleToKeyboard:
|
|
1177
|
+
this.scrollResponderScrollNativeHandleToKeyboard,
|
|
1178
|
+
},
|
|
1179
|
+
);
|
|
1220
1180
|
|
|
1221
|
-
|
|
1222
|
-
|
|
1181
|
+
return publicInstance;
|
|
1182
|
+
});
|
|
1223
1183
|
|
|
1224
1184
|
/**
|
|
1225
1185
|
* Warning, this may be called several times for a single keyboard opening.
|
|
@@ -1829,8 +1789,9 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
1829
1789
|
}
|
|
1830
1790
|
|
|
1831
1791
|
const refreshControl = this.props.refreshControl;
|
|
1832
|
-
const scrollViewRef
|
|
1833
|
-
this.
|
|
1792
|
+
const scrollViewRef = this._scrollView.getForwardingRef(
|
|
1793
|
+
this.props.scrollViewRef,
|
|
1794
|
+
);
|
|
1834
1795
|
|
|
1835
1796
|
if (refreshControl) {
|
|
1836
1797
|
if (Platform.OS === 'ios') {
|
|
@@ -1935,7 +1896,10 @@ function createRefForwarder<TNativeInstance, TPublicInstance>(
|
|
|
1935
1896
|
// NOTE: This wrapper component is necessary because `ScrollView` is a class
|
|
1936
1897
|
// component and we need to map `ref` to a differently named prop. This can be
|
|
1937
1898
|
// removed when `ScrollView` is a functional component.
|
|
1938
|
-
const Wrapper
|
|
1899
|
+
const Wrapper: component(
|
|
1900
|
+
ref: React.RefSetter<PublicScrollViewInstance>,
|
|
1901
|
+
...props: Props
|
|
1902
|
+
) = React.forwardRef(function Wrapper(
|
|
1939
1903
|
props: Props,
|
|
1940
1904
|
ref: ?React.RefSetter<PublicScrollViewInstance>,
|
|
1941
1905
|
): React.Node {
|
|
@@ -1949,8 +1913,5 @@ Wrapper.displayName = 'ScrollView';
|
|
|
1949
1913
|
// $FlowExpectedError[prop-missing]
|
|
1950
1914
|
Wrapper.Context = ScrollViewContext;
|
|
1951
1915
|
|
|
1952
|
-
module.exports = ((Wrapper: $FlowFixMe):
|
|
1953
|
-
React.ElementConfig<typeof ScrollView>,
|
|
1954
|
-
PublicScrollViewInstance,
|
|
1955
|
-
> &
|
|
1916
|
+
module.exports = ((Wrapper: $FlowFixMe): typeof Wrapper &
|
|
1956
1917
|
ScrollViewComponentStatics);
|
|
@@ -14,7 +14,7 @@ import type {Double} from '../../Types/CodegenTypes';
|
|
|
14
14
|
import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
|
|
15
15
|
import * as React from 'react';
|
|
16
16
|
|
|
17
|
-
type ScrollViewNativeComponentType = HostComponent<
|
|
17
|
+
type ScrollViewNativeComponentType = HostComponent<{...}>;
|
|
18
18
|
interface NativeCommands {
|
|
19
19
|
+flashScrollIndicators: (
|
|
20
20
|
viewRef: React.ElementRef<ScrollViewNativeComponentType>,
|
|
@@ -18,5 +18,7 @@ if (__DEV__) {
|
|
|
18
18
|
}
|
|
19
19
|
export default ScrollViewContext;
|
|
20
20
|
|
|
21
|
+
// $FlowFixMe[incompatible-type] frozen objects are readonly
|
|
21
22
|
export const HORIZONTAL: Value = Object.freeze({horizontal: true});
|
|
23
|
+
// $FlowFixMe[incompatible-type] frozen objects are readonly
|
|
22
24
|
export const VERTICAL: Value = Object.freeze({horizontal: false});
|
|
@@ -45,7 +45,6 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
|
|
|
45
45
|
diff: require('../../Utilities/differ/pointsDiffer'),
|
|
46
46
|
},
|
|
47
47
|
decelerationRate: true,
|
|
48
|
-
enableSyncOnScroll: true, // Fabric only.
|
|
49
48
|
disableIntervalMomentum: true,
|
|
50
49
|
maintainVisibleContentPosition: true,
|
|
51
50
|
pagingEnabled: true,
|
|
@@ -135,7 +134,6 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
|
|
|
135
134
|
contentInsetAdjustmentBehavior: true,
|
|
136
135
|
decelerationRate: true,
|
|
137
136
|
endDraggingSensitivityMultiplier: true,
|
|
138
|
-
enableSyncOnScroll: true, // Fabric only.
|
|
139
137
|
directionalLockEnabled: true,
|
|
140
138
|
disableIntervalMomentum: true,
|
|
141
139
|
indicatorStyle: true,
|
|
@@ -38,10 +38,10 @@ type Instance = {
|
|
|
38
38
|
...
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
const ScrollViewStickyHeaderWithForwardedRef:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
const ScrollViewStickyHeaderWithForwardedRef: component(
|
|
42
|
+
ref: React.RefSetter<Instance>,
|
|
43
|
+
...props: Props
|
|
44
|
+
) = React.forwardRef(function ScrollViewStickyHeader(props, forwardedRef) {
|
|
45
45
|
const {
|
|
46
46
|
inverted,
|
|
47
47
|
scrollViewHeight,
|
|
@@ -65,8 +65,8 @@ const ScrollViewStickyHeaderWithForwardedRef: React.AbstractComponent<
|
|
|
65
65
|
ref.setNextHeaderY = setNextHeaderLayoutY;
|
|
66
66
|
setIsFabric(isFabricPublicInstance(ref));
|
|
67
67
|
}, []);
|
|
68
|
-
const ref:
|
|
69
|
-
// $FlowFixMe[
|
|
68
|
+
const ref: React.RefSetter<React.ElementRef<typeof Animated.View>> =
|
|
69
|
+
// $FlowFixMe[prop-missing] - Instance is mutated to have `setNextHeaderY`.
|
|
70
70
|
useMergeRefs<Instance>(callbackRef, forwardedRef);
|
|
71
71
|
|
|
72
72
|
const offset = useMemo(
|
|
@@ -275,12 +275,12 @@ const ScrollViewStickyHeaderWithForwardedRef: React.AbstractComponent<
|
|
|
275
275
|
: null;
|
|
276
276
|
|
|
277
277
|
return (
|
|
278
|
-
/* $FlowFixMe[prop-missing] passthroughAnimatedPropExplicitValues isn't properly
|
|
279
|
-
included in the Animated.View flow type. */
|
|
280
278
|
<Animated.View
|
|
281
279
|
collapsable={false}
|
|
282
280
|
nativeID={props.nativeID}
|
|
283
281
|
onLayout={_onLayout}
|
|
282
|
+
/* $FlowFixMe[prop-missing] passthroughAnimatedPropExplicitValues isn't properly
|
|
283
|
+
included in the Animated.View flow type. */
|
|
284
284
|
ref={ref}
|
|
285
285
|
style={[
|
|
286
286
|
child.props.style,
|
|
@@ -301,7 +301,6 @@ const ScrollViewStickyHeaderWithForwardedRef: React.AbstractComponent<
|
|
|
301
301
|
const styles = StyleSheet.create({
|
|
302
302
|
header: {
|
|
303
303
|
zIndex: 10,
|
|
304
|
-
position: 'relative',
|
|
305
304
|
},
|
|
306
305
|
fill: {
|
|
307
306
|
flex: 1,
|
|
@@ -130,12 +130,14 @@ const returnsTrue = () => true;
|
|
|
130
130
|
```
|
|
131
131
|
*/
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
133
|
+
type SwitchRef = React.ElementRef<
|
|
134
|
+
typeof SwitchNativeComponent | typeof AndroidSwitchNativeComponent,
|
|
135
|
+
>;
|
|
136
|
+
|
|
137
|
+
const SwitchWithForwardedRef: component(
|
|
138
|
+
ref: React.RefSetter<SwitchRef>,
|
|
139
|
+
...props: Props
|
|
140
|
+
) = React.forwardRef(function Switch(props, forwardedRef): React.Node {
|
|
139
141
|
const {
|
|
140
142
|
disabled,
|
|
141
143
|
ios_backgroundColor,
|
|
@@ -87,7 +87,7 @@ type Props = $ReadOnly<{|
|
|
|
87
87
|
backgroundColor?: ?ColorValue,
|
|
88
88
|
|}>;
|
|
89
89
|
|
|
90
|
-
const InputAccessoryView: React.
|
|
90
|
+
const InputAccessoryView: React.ComponentType<Props> = (props: Props) => {
|
|
91
91
|
const {width} = useWindowDimensions();
|
|
92
92
|
|
|
93
93
|
if (Platform.OS === 'ios') {
|
|
@@ -18,7 +18,7 @@ import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentR
|
|
|
18
18
|
import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
|
|
19
19
|
import RCTTextInputViewConfig from './RCTTextInputViewConfig';
|
|
20
20
|
|
|
21
|
-
type NativeType = HostComponent<
|
|
21
|
+
type NativeType = HostComponent<{...}>;
|
|
22
22
|
|
|
23
23
|
type NativeCommands = TextInputNativeCommands<NativeType>;
|
|
24
24
|
|
|
@@ -35,11 +35,11 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
|
|
|
35
35
|
},
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
const MultilineTextInputNativeComponent: HostComponent<
|
|
39
|
-
NativeComponentRegistry.get<
|
|
38
|
+
const MultilineTextInputNativeComponent: HostComponent<{...}> =
|
|
39
|
+
NativeComponentRegistry.get<{...}>(
|
|
40
40
|
'RCTMultilineTextInputView',
|
|
41
41
|
() => __INTERNAL_VIEW_CONFIG,
|
|
42
42
|
);
|
|
43
43
|
|
|
44
44
|
// flowlint-next-line unclear-type:off
|
|
45
|
-
export default ((MultilineTextInputNativeComponent: any): HostComponent<
|
|
45
|
+
export default ((MultilineTextInputNativeComponent: any): HostComponent<{...}>);
|
|
@@ -18,7 +18,7 @@ import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentR
|
|
|
18
18
|
import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
|
|
19
19
|
import RCTTextInputViewConfig from './RCTTextInputViewConfig';
|
|
20
20
|
|
|
21
|
-
type NativeType = HostComponent<
|
|
21
|
+
type NativeType = HostComponent<{...}>;
|
|
22
22
|
|
|
23
23
|
type NativeCommands = TextInputNativeCommands<NativeType>;
|
|
24
24
|
|
|
@@ -31,11 +31,13 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
|
|
|
31
31
|
...RCTTextInputViewConfig,
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
const SinglelineTextInputNativeComponent: HostComponent<
|
|
35
|
-
NativeComponentRegistry.get<
|
|
34
|
+
const SinglelineTextInputNativeComponent: HostComponent<{...}> =
|
|
35
|
+
NativeComponentRegistry.get<{...}>(
|
|
36
36
|
'RCTSinglelineTextInputView',
|
|
37
37
|
() => __INTERNAL_VIEW_CONFIG,
|
|
38
38
|
);
|
|
39
39
|
|
|
40
40
|
// flowlint-next-line unclear-type:off
|
|
41
|
-
export default ((SinglelineTextInputNativeComponent: any): HostComponent<
|
|
41
|
+
export default ((SinglelineTextInputNativeComponent: any): HostComponent<{
|
|
42
|
+
...
|
|
43
|
+
}>);
|
|
@@ -104,7 +104,6 @@ const RCTTextInputViewConfig = {
|
|
|
104
104
|
textTransform: true,
|
|
105
105
|
textAlign: true,
|
|
106
106
|
fontFamily: true,
|
|
107
|
-
lineBreakModeIOS: true,
|
|
108
107
|
lineHeight: true,
|
|
109
108
|
isHighlighted: true,
|
|
110
109
|
writingDirection: true,
|
|
@@ -122,6 +121,7 @@ const RCTTextInputViewConfig = {
|
|
|
122
121
|
},
|
|
123
122
|
editable: true,
|
|
124
123
|
inputAccessoryViewID: true,
|
|
124
|
+
inputAccessoryViewButtonLabel: true,
|
|
125
125
|
caretHidden: true,
|
|
126
126
|
enablesReturnKeyAutomatically: true,
|
|
127
127
|
placeholderTextColor: {
|
|
@@ -152,6 +152,7 @@ const RCTTextInputViewConfig = {
|
|
|
152
152
|
showSoftInputOnFocus: true,
|
|
153
153
|
autoFocus: true,
|
|
154
154
|
lineBreakStrategyIOS: true,
|
|
155
|
+
lineBreakModeIOS: true,
|
|
155
156
|
smartInsertDelete: true,
|
|
156
157
|
...ConditionallyIgnoredEventHandlers({
|
|
157
158
|
onChange: true,
|
|
@@ -11,7 +11,7 @@ import type * as React from 'react';
|
|
|
11
11
|
import {Constructor} from '../../../types/private/Utilities';
|
|
12
12
|
import {TimerMixin} from '../../../types/private/TimerMixin';
|
|
13
13
|
import {
|
|
14
|
-
|
|
14
|
+
HostInstance,
|
|
15
15
|
NativeMethods,
|
|
16
16
|
} from '../../../types/public/ReactNativeTypes';
|
|
17
17
|
import {ColorValue, StyleProp} from '../../StyleSheet/StyleSheet';
|
|
@@ -255,6 +255,11 @@ export interface TextInputIOSProps {
|
|
|
255
255
|
* - `'birthdateDay'` (iOS 17+)
|
|
256
256
|
* - `'birthdateMonth'` (iOS 17+)
|
|
257
257
|
* - `'birthdateYear'` (iOS 17+)
|
|
258
|
+
* - `'cellularEID'` (iOS 17.4+)
|
|
259
|
+
* - `'cellularIMEI'` (iOS 17.4+)
|
|
260
|
+
* - `'dateTime'` (iOS 15+)
|
|
261
|
+
* - `'flightNumber'` (iOS 15+)
|
|
262
|
+
* - `'shipmentTrackingNumber'` (iOS 15+)
|
|
258
263
|
*
|
|
259
264
|
*/
|
|
260
265
|
textContentType?:
|
|
@@ -299,6 +304,11 @@ export interface TextInputIOSProps {
|
|
|
299
304
|
| 'birthdateDay'
|
|
300
305
|
| 'birthdateMonth'
|
|
301
306
|
| 'birthdateYear'
|
|
307
|
+
| 'cellularEID'
|
|
308
|
+
| 'cellularIMEI'
|
|
309
|
+
| 'dateTime'
|
|
310
|
+
| 'flightNumber'
|
|
311
|
+
| 'shipmentTrackingNumber'
|
|
302
312
|
| undefined;
|
|
303
313
|
|
|
304
314
|
/**
|
|
@@ -316,6 +326,19 @@ export interface TextInputIOSProps {
|
|
|
316
326
|
| 'push-out'
|
|
317
327
|
| undefined;
|
|
318
328
|
|
|
329
|
+
/**
|
|
330
|
+
* Set line break mode on iOS.
|
|
331
|
+
* @platform ios
|
|
332
|
+
*/
|
|
333
|
+
lineBreakModeIOS?:
|
|
334
|
+
| 'wordWrapping'
|
|
335
|
+
| 'char'
|
|
336
|
+
| 'clip'
|
|
337
|
+
| 'head'
|
|
338
|
+
| 'middle'
|
|
339
|
+
| 'tail'
|
|
340
|
+
| undefined;
|
|
341
|
+
|
|
319
342
|
/**
|
|
320
343
|
* If `false`, the iOS system will not insert an extra space after a paste operation
|
|
321
344
|
* neither delete one or two spaces after a cut or delete operation.
|
|
@@ -937,21 +960,21 @@ interface TextInputState {
|
|
|
937
960
|
* Returns the ref of the currently focused text field, if one exists
|
|
938
961
|
* If no text field is focused it returns null
|
|
939
962
|
*/
|
|
940
|
-
currentlyFocusedInput():
|
|
963
|
+
currentlyFocusedInput(): HostInstance;
|
|
941
964
|
|
|
942
965
|
/**
|
|
943
966
|
* @param textField ref of the text field to focus
|
|
944
967
|
* Focuses the specified text field
|
|
945
968
|
* noop if the text field was already focused
|
|
946
969
|
*/
|
|
947
|
-
focusTextInput(textField?:
|
|
970
|
+
focusTextInput(textField?: HostInstance): void;
|
|
948
971
|
|
|
949
972
|
/**
|
|
950
973
|
* @param textField ref of the text field to focus
|
|
951
974
|
* Unfocuses the specified text field
|
|
952
975
|
* noop if it wasn't focused
|
|
953
976
|
*/
|
|
954
|
-
blurTextInput(textField?:
|
|
977
|
+
blurTextInput(textField?: HostInstance): void;
|
|
955
978
|
}
|
|
956
979
|
|
|
957
980
|
/**
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {
|
|
11
|
+
import type {HostInstance} from '../../Renderer/shims/ReactNativeTypes';
|
|
12
12
|
import type {
|
|
13
13
|
PressEvent,
|
|
14
14
|
ScrollEvent,
|
|
@@ -22,7 +22,6 @@ import {
|
|
|
22
22
|
type ViewStyleProp,
|
|
23
23
|
} from '../../StyleSheet/StyleSheet';
|
|
24
24
|
import * as React from 'react';
|
|
25
|
-
type ComponentRef = React.ElementRef<HostComponent<mixed>>;
|
|
26
25
|
|
|
27
26
|
type ReactRefSetter<T> = {current: null | T, ...} | ((ref: null | T) => mixed);
|
|
28
27
|
|
|
@@ -198,7 +197,12 @@ export type TextContentType =
|
|
|
198
197
|
| 'birthdate'
|
|
199
198
|
| 'birthdateDay'
|
|
200
199
|
| 'birthdateMonth'
|
|
201
|
-
| 'birthdateYear'
|
|
200
|
+
| 'birthdateYear'
|
|
201
|
+
| 'cellularEID'
|
|
202
|
+
| 'cellularIMEI'
|
|
203
|
+
| 'dateTime'
|
|
204
|
+
| 'flightNumber'
|
|
205
|
+
| 'shipmentTrackingNumber';
|
|
202
206
|
|
|
203
207
|
export type enterKeyHintType =
|
|
204
208
|
| 'enter'
|
|
@@ -262,6 +266,12 @@ type IOSProps = $ReadOnly<{|
|
|
|
262
266
|
*/
|
|
263
267
|
inputAccessoryViewID?: ?string,
|
|
264
268
|
|
|
269
|
+
/**
|
|
270
|
+
* An optional label that overrides the default input accessory view button label.
|
|
271
|
+
* @platform ios
|
|
272
|
+
*/
|
|
273
|
+
inputAccessoryViewButtonLabel?: ?string,
|
|
274
|
+
|
|
265
275
|
/**
|
|
266
276
|
* Determines the color of the keyboard.
|
|
267
277
|
* @platform ios
|
|
@@ -312,6 +322,19 @@ type IOSProps = $ReadOnly<{|
|
|
|
312
322
|
*/
|
|
313
323
|
lineBreakStrategyIOS?: ?('none' | 'standard' | 'hangul-word' | 'push-out'),
|
|
314
324
|
|
|
325
|
+
/**
|
|
326
|
+
* Set line break mode on iOS.
|
|
327
|
+
* @platform ios
|
|
328
|
+
*/
|
|
329
|
+
lineBreakModeIOS?: ?(
|
|
330
|
+
| 'wordWrapping'
|
|
331
|
+
| 'char'
|
|
332
|
+
| 'clip'
|
|
333
|
+
| 'head'
|
|
334
|
+
| 'middle'
|
|
335
|
+
| 'tail'
|
|
336
|
+
),
|
|
337
|
+
|
|
315
338
|
/**
|
|
316
339
|
* If `false`, the iOS system will not insert an extra space after a paste operation
|
|
317
340
|
* neither delete one or two spaces after a cut or delete operation.
|
|
@@ -608,9 +631,7 @@ export type Props = $ReadOnly<{|
|
|
|
608
631
|
*/
|
|
609
632
|
editable?: ?boolean,
|
|
610
633
|
|
|
611
|
-
forwardedRef?: ?ReactRefSetter<
|
|
612
|
-
React.ElementRef<HostComponent<mixed>> & ImperativeMethods,
|
|
613
|
-
>,
|
|
634
|
+
forwardedRef?: ?ReactRefSetter<HostInstance & ImperativeMethods>,
|
|
614
635
|
|
|
615
636
|
/**
|
|
616
637
|
* `enterKeyHint` defines what action label (or icon) to present for the enter key on virtual keyboards.
|
|
@@ -956,7 +977,7 @@ export type Props = $ReadOnly<{|
|
|
|
956
977
|
type ImperativeMethods = $ReadOnly<{|
|
|
957
978
|
clear: () => void,
|
|
958
979
|
isFocused: () => boolean,
|
|
959
|
-
getNativeRef: () => ?
|
|
980
|
+
getNativeRef: () => ?HostInstance,
|
|
960
981
|
setSelection: (start: number, end: number) => void,
|
|
961
982
|
|}>;
|
|
962
983
|
|
|
@@ -1071,22 +1092,18 @@ type ImperativeMethods = $ReadOnly<{|
|
|
|
1071
1092
|
* or control this param programmatically with native code.
|
|
1072
1093
|
*
|
|
1073
1094
|
*/
|
|
1074
|
-
type InternalTextInput = (
|
|
1095
|
+
type InternalTextInput = component(
|
|
1096
|
+
ref: React.RefSetter<$ReadOnly<{...HostInstance, ...ImperativeMethods}>>,
|
|
1097
|
+
...Props
|
|
1098
|
+
);
|
|
1075
1099
|
|
|
1076
1100
|
export type TextInputComponentStatics = $ReadOnly<{|
|
|
1077
1101
|
State: $ReadOnly<{|
|
|
1078
|
-
currentlyFocusedInput: () => ?
|
|
1102
|
+
currentlyFocusedInput: () => ?HostInstance,
|
|
1079
1103
|
currentlyFocusedField: () => ?number,
|
|
1080
|
-
focusTextInput: (textField: ?
|
|
1081
|
-
blurTextInput: (textField: ?
|
|
1104
|
+
focusTextInput: (textField: ?HostInstance) => void,
|
|
1105
|
+
blurTextInput: (textField: ?HostInstance) => void,
|
|
1082
1106
|
|}>,
|
|
1083
1107
|
|}>;
|
|
1084
1108
|
|
|
1085
|
-
export type TextInputType =
|
|
1086
|
-
React.ElementConfig<InternalTextInput>,
|
|
1087
|
-
$ReadOnly<{|
|
|
1088
|
-
...React.ElementRef<HostComponent<mixed>>,
|
|
1089
|
-
...ImperativeMethods,
|
|
1090
|
-
|}>,
|
|
1091
|
-
> &
|
|
1092
|
-
TextInputComponentStatics;
|
|
1109
|
+
export type TextInputType = InternalTextInput & TextInputComponentStatics;
|