react-native-windows 0.79.4 → 0.80.0-preview.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.flowconfig +12 -3
- package/Directory.Build.props +5 -2
- package/Libraries/Alert/Alert.d.ts +4 -1
- package/Libraries/Alert/Alert.js +3 -0
- package/Libraries/Alert/Alert.windows.js +3 -0
- package/Libraries/Alert/RCTAlertManager.js +17 -0
- package/Libraries/Animated/Animated.js.flow +1 -3
- package/Libraries/Animated/AnimatedEvent.js +4 -3
- package/Libraries/Animated/AnimatedExports.js +2 -2
- package/Libraries/Animated/AnimatedExports.js.flow +140 -0
- package/Libraries/Animated/AnimatedImplementation.js +2 -123
- package/Libraries/Animated/Easing.js +13 -15
- package/Libraries/Animated/animations/Animation.js +8 -4
- package/Libraries/Animated/components/AnimatedFlatList.js +7 -6
- package/Libraries/Animated/components/AnimatedScrollView.js +48 -42
- package/Libraries/Animated/components/AnimatedSectionList.js +11 -7
- package/Libraries/Animated/createAnimatedComponent.js +105 -57
- package/Libraries/Animated/nodes/AnimatedNode.js +4 -3
- package/Libraries/Animated/nodes/AnimatedProps.js +46 -26
- package/Libraries/Animated/nodes/AnimatedValue.js +16 -7
- package/Libraries/Animated/nodes/AnimatedValueXY.js +3 -1
- package/Libraries/AppState/AppState.js +7 -2
- package/Libraries/BatchedBridge/MessageQueue.js +2 -2
- package/Libraries/BatchedBridge/NativeModules.js +2 -0
- package/Libraries/Blob/BlobManager.js +1 -0
- package/Libraries/Blob/FileReader.js +219 -8
- package/Libraries/Blob/URL.js +37 -12
- package/Libraries/Blob/URLSearchParams.js +106 -31
- package/Libraries/Blob/URLSearchParams.js.flow +12 -7
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +1 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +1 -1
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.js +17 -0
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +1 -0
- package/Libraries/Components/Button.d.ts +3 -0
- package/Libraries/Components/Button.js +1 -1
- package/Libraries/Components/Button.windows.js +27 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -3
- package/Libraries/{NewAppScreen/components/Colors.js → Components/DrawerAndroid/DrawerLayoutAndroid.ios.js} +6 -10
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +6 -66
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js.flow +18 -0
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidFallback.js +71 -0
- package/Libraries/Components/Flyout/Flyout.js +11 -0
- package/Libraries/Components/Keyboard/Keyboard.js +5 -3
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +6 -3
- package/Libraries/Components/Keyboard/KeyboardExt.js.map +1 -1
- package/Libraries/Components/Popup/Popup.js +11 -0
- package/Libraries/Components/Pressable/Pressable.js +20 -4
- package/Libraries/Components/Pressable/Pressable.windows.js +20 -4
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +25 -3
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +29 -20
- package/Libraries/Components/RefreshControl/RefreshControl.js +1 -1
- package/Libraries/Components/RefreshControl/RefreshControl.windows.js +1 -1
- package/Libraries/Components/ScrollView/ScrollView.d.ts +3 -3
- package/Libraries/Components/ScrollView/ScrollView.js +132 -122
- package/Libraries/Components/ScrollView/ScrollView.windows.js +131 -122
- package/Libraries/Components/StaticRenderer.js +1 -1
- package/Libraries/Components/Switch/Switch.d.ts +3 -0
- package/Libraries/Components/Switch/Switch.js +8 -4
- package/Libraries/Components/Switch/Switch.windows.js +17 -4
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +2 -1
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +2 -4
- package/Libraries/Components/TextInput/TextInput.d.ts +70 -33
- package/Libraries/Components/TextInput/TextInput.flow.js +100 -51
- package/Libraries/Components/TextInput/TextInput.flow.windows.js +1246 -0
- package/Libraries/Components/TextInput/TextInput.js +88 -1027
- package/Libraries/Components/TextInput/TextInput.windows.js +104 -1092
- package/Libraries/Components/TextInput/TextInputState.js +1 -1
- package/Libraries/Components/TextInput/TextInputState.windows.js +1 -1
- package/Libraries/Components/TextInput/WindowsTextInputNativeComponent.js +2 -1
- package/Libraries/{Modal/ModalInjection.js → Components/ToastAndroid/ToastAndroid.ios.js} +3 -5
- package/Libraries/Components/ToastAndroid/ToastAndroid.js +4 -32
- package/Libraries/Components/ToastAndroid/ToastAndroid.js.flow +109 -0
- package/Libraries/Components/ToastAndroid/ToastAndroidFallback.js +45 -0
- package/Libraries/Components/Touchable/Touchable.js +5 -5
- package/Libraries/Components/Touchable/Touchable.windows.js +5 -5
- package/Libraries/Components/Touchable/TouchableBounce.js +14 -7
- package/Libraries/Components/Touchable/TouchableBounce.windows.js +14 -7
- package/Libraries/Components/Touchable/TouchableHighlight.js +10 -7
- package/Libraries/Components/Touchable/TouchableHighlight.windows.js +10 -7
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +6 -6
- package/Libraries/Components/Touchable/TouchableNativeFeedback.windows.js +6 -6
- package/Libraries/Components/Touchable/TouchableOpacity.js +13 -6
- package/Libraries/Components/Touchable/TouchableOpacity.windows.js +13 -6
- package/Libraries/Components/View/View.js +18 -21
- package/Libraries/Components/View/View.windows.js +39 -41
- package/Libraries/Components/View/ViewAccessibility.d.ts +8 -0
- package/Libraries/Components/View/ViewAccessibility.js +25 -1
- package/Libraries/Components/View/ViewAccessibility.windows.js +9 -1
- package/Libraries/Components/View/ViewPropTypes.js +49 -3
- package/Libraries/Components/View/ViewPropTypes.windows.js +50 -2
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpReactDevTools.js +5 -5
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +3 -3
- package/Libraries/EventEmitter/NativeEventEmitter.js +9 -4
- package/Libraries/Image/AssetSourceResolver.js +17 -4
- package/Libraries/Image/AssetSourceResolver.windows.js +17 -4
- package/Libraries/Image/Image.d.ts +26 -10
- package/Libraries/Image/Image.js +17 -0
- package/Libraries/Image/Image.js.flow +5 -5
- package/Libraries/Image/Image.windows.js +13 -1
- package/Libraries/Image/ImageBackground.js +2 -0
- package/Libraries/Image/ImageInjection.js +1 -1
- package/Libraries/Image/ImageProps.js +22 -17
- package/Libraries/Image/ImageSource.js +3 -1
- package/Libraries/Image/ImageSourceUtils.js +4 -2
- package/Libraries/Image/ImageTypes.flow.js +1 -1
- package/Libraries/Interaction/InteractionManager.d.ts +13 -0
- package/Libraries/Interaction/InteractionManager.js +1 -1
- package/Libraries/Interaction/PanResponder.js +3 -3
- package/Libraries/Interaction/TaskQueue.js +1 -0
- package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -2
- package/Libraries/Linking/Linking.js +1 -1
- package/Libraries/Lists/FlatList.d.ts +2 -2
- package/Libraries/Lists/FlatList.js +8 -11
- package/Libraries/Lists/SectionList.js +39 -42
- package/Libraries/Lists/SectionListModern.js +25 -34
- package/Libraries/Lists/VirtualizedList.js +1 -0
- package/Libraries/Lists/VirtualizedSectionList.js +1 -0
- package/Libraries/LogBox/Data/LogBoxData.js +1 -1
- package/Libraries/LogBox/LogBoxNotificationContainer.js +1 -1
- package/Libraries/Modal/Modal.js +33 -7
- package/Libraries/Modal/Modal.windows.js +33 -10
- package/Libraries/NativeComponent/BaseViewConfig.android.js +2 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +2 -0
- package/Libraries/NativeComponent/BaseViewConfig.js +17 -0
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +3 -0
- package/Libraries/NativeComponent/PlatformBaseViewConfig.js +2 -2
- package/Libraries/NativeModules/specs/NativeDevMenu.js +2 -2
- package/Libraries/Network/RCTNetworking.android.js +1 -1
- package/Libraries/Network/RCTNetworking.ios.js +1 -1
- package/Libraries/Network/RCTNetworking.js +17 -0
- package/Libraries/Network/RCTNetworking.js.flow +1 -1
- package/Libraries/Network/RCTNetworking.windows.js +1 -1
- package/Libraries/Network/XMLHttpRequest.js +781 -10
- package/Libraries/Performance/Systrace.js +7 -7
- package/Libraries/Pressability/Pressability.js +1 -1
- package/Libraries/Pressability/Pressability.windows.js +1 -1
- package/Libraries/ReactNative/AppContainer-dev.js +5 -4
- 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 +10 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -4
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +1 -4
- package/Libraries/ReactNative/RendererImplementation.js +10 -5
- package/Libraries/ReactNative/getNativeComponentAttributes.js +1 -0
- package/Libraries/ReactNative/renderApplication.js +9 -0
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +3 -3
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js.flow +51 -0
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +4840 -4748
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +4947 -4829
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3998 -3888
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +5005 -4948
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +2744 -2652
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +5020 -4933
- package/Libraries/Renderer/shims/ReactNativeTypes.js +3 -3
- package/Libraries/Settings/Settings.ios.js +1 -0
- package/Libraries/Settings/Settings.js +13 -19
- package/Libraries/Settings/SettingsFallback.js +33 -0
- package/Libraries/StyleSheet/PlatformColorValueTypes.js +15 -0
- package/Libraries/StyleSheet/PlatformColorValueTypesIOS.js +6 -0
- package/Libraries/StyleSheet/Rect.js +1 -0
- package/Libraries/StyleSheet/StyleSheet.js +31 -200
- package/Libraries/StyleSheet/StyleSheet.js.flow +188 -0
- package/Libraries/StyleSheet/StyleSheetExports.js +210 -0
- package/Libraries/StyleSheet/StyleSheetExports.js.flow +112 -0
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +130 -52
- package/Libraries/StyleSheet/flattenStyle.js +14 -4
- package/Libraries/StyleSheet/private/_TransformStyle.js +49 -21
- package/Libraries/StyleSheet/processBackgroundImage.js +670 -214
- package/Libraries/Text/Text.d.ts +2 -5
- package/Libraries/Text/Text.js +3 -3
- package/Libraries/Text/Text.windows.js +3 -3
- package/Libraries/Text/TextNativeComponent.js +0 -4
- package/Libraries/Text/TextProps.js +5 -33
- package/Libraries/Text/TextProps.windows.js +5 -32
- package/Libraries/Types/CodegenTypesNamespace.d.ts +45 -0
- package/Libraries/{Blob/__mocks__/BlobModule.js → Types/CodegenTypesNamespace.js} +4 -6
- package/Libraries/Types/CoreEventTypes.d.ts +6 -1
- package/Libraries/Types/CoreEventTypes.js +1 -1
- package/Libraries/Types/CoreEventTypes.windows.js +1 -1
- package/Libraries/Utilities/Appearance.js +2 -0
- package/Libraries/Utilities/BackHandler.js +17 -0
- package/Libraries/Utilities/DeviceInfo.js +2 -0
- package/Libraries/Utilities/Dimensions.js +1 -1
- package/Libraries/Utilities/Platform.js +17 -0
- package/Libraries/Utilities/PlatformTypes.js +11 -3
- package/Libraries/Utilities/ReactNativeTestTools.js +2 -2
- package/Libraries/Utilities/codegenNativeCommands.d.ts +18 -0
- package/Libraries/Utilities/codegenNativeComponent.d.ts +26 -0
- package/Libraries/WebSocket/WebSocket.js +313 -8
- package/Libraries/vendor/core/ErrorUtils.js +28 -2
- package/Libraries/vendor/emitter/EventEmitter.js +6 -2
- package/Microsoft.ReactNative/CompositionSwitcher.idl +8 -0
- package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +0 -6
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +197 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +34 -4
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +12 -0
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +36 -33
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +81 -0
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +5 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +148 -14
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +4 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.cpp +29 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.h +2 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +17 -34
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +9 -3
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +2 -0
- package/Microsoft.ReactNative/Fabric/ImageManager.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewEventEmitter.cpp +16 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewEventEmitter.h +1 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.cpp +9 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.h +1 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewTraitsInitializer.h +4 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/WindowsTextLayoutManager.cpp +36 -96
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/WindowsTextLayoutManager.h +1 -1
- package/Microsoft.ReactNative/Modules/SampleTurboModule.cpp +4 -0
- package/Microsoft.ReactNative/Modules/SampleTurboModule.h +3 -0
- package/Microsoft.ReactNative/TurboModulesProvider.h +1 -1
- package/Microsoft.ReactNative.Cxx/JSI/JsiApiContext.h +1 -1
- package/Microsoft.ReactNative.Cxx/JSI/LongLivedJsiValue.h +1 -1
- package/PropertySheets/Generated/PackageVersion.g.props +4 -4
- package/PropertySheets/React.Cpp.props +4 -0
- package/README.md +2 -2
- package/ReactCommon/ReactCommon.vcxproj +9 -4
- package/ReactCommon/ReactCommon.vcxproj.filters +6 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/CxxNativeModule.cpp +253 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +5 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +4 -8
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h +184 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp +22 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h +2 -4
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModuleWithJSIBindings.cpp +27 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +3 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityProps.cpp +308 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/DynamicEventPayload.cpp +42 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/css/CSSTokenizer.h +7 -51
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +10 -5
- package/Scripts/creaternwapp.cmd +9 -3
- package/Shared/Shared.vcxitems +3 -2
- package/Shared/Shared.vcxitems.filters +2 -1
- package/codegen/NativeAnimatedModuleSpec.g.h +2 -0
- package/codegen/NativeAnimatedTurboModuleSpec.g.h +2 -0
- package/codegen/NativePerformanceSpec.g.h +14 -0
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +151 -127
- package/codegen/NativeSampleTurboModuleSpec.g.h +14 -8
- package/codegen/react/components/rnwcore/EventEmitters.cpp +48 -48
- package/codegen/rnwcoreJSI-generated.cpp +159 -129
- package/codegen/rnwcoreJSI.h +534 -408
- package/index.js +51 -331
- package/index.windows.js +70 -352
- package/interface.js +0 -4
- package/jest/resolver.js +31 -0
- package/jest/setup.js +6 -2
- package/package.json +29 -28
- package/src/private/animated/NativeAnimatedHelper.js +21 -8
- package/src/private/animated/createAnimatedPropsHook.js +11 -16
- package/src/private/animated/createAnimatedPropsMemoHook.js +1 -2
- package/src/private/components/{SafeAreaView_INTERNAL_DO_NOT_USE.js → safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE.js} +6 -6
- package/src/private/components/{HScrollViewNativeComponents.js → scrollview/HScrollViewNativeComponents.js} +8 -8
- package/src/private/components/scrollview/VScrollViewNativeComponents.js +25 -0
- package/src/private/{devmenu → devsupport/devmenu}/DevMenu.js +1 -1
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/BorderBox.js +3 -3
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/BoxInspector.js +6 -5
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/ElementBox.js +8 -6
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/ElementProperties.js +11 -10
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/Inspector.js +14 -12
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/InspectorOverlay.js +5 -4
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/InspectorPanel.js +9 -8
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/NetworkOverlay.js +10 -9
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/ReactDevToolsOverlay.js +7 -7
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/StyleInspector.js +7 -6
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/XHRInterceptor.js +2 -2
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/getInspectorDataForViewAtPoint.js +4 -4
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/resolveBoxStyle.js +1 -1
- package/src/private/{inspector → devsupport/devmenu/perfmonitor}/PerformanceOverlay.js +6 -5
- package/src/private/{specs_DEPRECATED/modules → devsupport/devmenu/specs}/NativeDevMenu.js +2 -2
- package/src/private/{debugging → devsupport/rndevtools}/ReactDevToolsSettingsManager.android.js +1 -1
- package/src/private/{debugging → devsupport/rndevtools}/ReactDevToolsSettingsManager.ios.js +1 -1
- package/src/private/{debugging → devsupport/rndevtools}/ReactDevToolsSettingsManager.windows.js +1 -1
- package/src/private/{debugging → devsupport/rndevtools}/setUpFuseboxReactDevToolsDispatcher.js +1 -1
- package/src/private/{fusebox → devsupport/rndevtools}/specs/NativeReactDevToolsRuntimeSettingsModule.js +2 -2
- package/src/private/{specs_DEPRECATED/modules → devsupport/rndevtools/specs}/NativeReactDevToolsSettingsManager.js +2 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +82 -80
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +12 -1
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +17 -13
- package/src/private/renderer/errorhandling/ErrorHandlers.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeAnimatedModule.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeAnimatedTurboModule.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeSampleTurboModule.js +3 -0
- package/src/private/styles/composeStyles.js +12 -5
- package/src/private/types/HostComponent.js +1 -1
- package/src/private/types/HostInstance.js +67 -1
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +2 -5
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +5 -18
- package/src/private/webapis/dom/nodes/internals/NodeInternals.js +6 -0
- package/src/private/webapis/performance/Performance.js +1 -3
- package/src/private/webapis/performance/PerformanceEntry.js +6 -1
- package/src/private/webapis/performance/internals/RawPerformanceEntry.js +3 -0
- package/src/private/webapis/performance/specs/NativePerformance.js +10 -1
- package/src/types/globals.d.ts +42 -0
- package/stubs/double-conversion/double-conversion.h +3 -1
- package/templates/cpp-app/windows/MyApp/MyApp.vcxproj +4 -0
- package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +4 -0
- package/types/index.d.ts +6 -3
- package/types/public/ReactNativeTypes.d.ts +2 -2
- package/Libraries/BatchedBridge/__mocks__/MessageQueueTestConfig.js +0 -38
- package/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule.js +0 -22
- package/Libraries/Blob/FileReader_new.js +0 -231
- package/Libraries/Blob/FileReader_old.js +0 -186
- package/Libraries/Blob/__mocks__/FileReaderModule.js +0 -20
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +0 -32
- package/Libraries/Core/__mocks__/ErrorUtils.js +0 -33
- package/Libraries/Core/__mocks__/NativeExceptionsManager.js +0 -19
- package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +0 -49
- package/Libraries/Events/CustomEvent.js +0 -32
- package/Libraries/Events/EventPolyfill.js +0 -239
- package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +0 -118
- package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +0 -134
- package/Libraries/Network/XMLHttpRequest_new.js +0 -794
- package/Libraries/Network/XMLHttpRequest_old.js +0 -701
- package/Libraries/NewAppScreen/components/DebugInstructions.js +0 -41
- package/Libraries/NewAppScreen/components/DebugInstructions.windows.js +0 -30
- package/Libraries/NewAppScreen/components/Header.js +0 -77
- package/Libraries/NewAppScreen/components/HermesBadge.js +0 -53
- package/Libraries/NewAppScreen/components/LearnMoreLinks.js +0 -148
- package/Libraries/NewAppScreen/components/ReloadInstructions.js +0 -39
- package/Libraries/NewAppScreen/components/ReloadInstructions.windows.js +0 -31
- package/Libraries/NewAppScreen/components/logo.png +0 -0
- package/Libraries/NewAppScreen/index.js +0 -25
- package/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js +0 -58
- package/Libraries/Utilities/__mocks__/BackHandler.js +0 -45
- package/Libraries/Utilities/__mocks__/GlobalPerformanceLogger.js +0 -16
- package/Libraries/Utilities/__mocks__/PixelRatio.js +0 -25
- package/Libraries/WebSocket/WebSocketEvent.js +0 -30
- package/Libraries/WebSocket/WebSocket_new.js +0 -325
- package/Libraries/WebSocket/WebSocket_old.js +0 -297
- package/Libraries/WebSocket/__mocks__/event-target-shim.js +0 -27
- package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +0 -30
- package/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js +0 -81
- package/jest/__tests__/setup-test.js +0 -18
- package/src/private/components/VScrollViewNativeComponents.js +0 -25
- package/src/private/utilities/ensureInstance.js +0 -21
- package/src/private/webapis/performance/specs/__mocks__/NativePerformanceMock.js +0 -267
- package/types/modules/LaunchScreen.d.ts +0 -18
- /package/src/private/{devmenu → devsupport/devmenu}/DevMenu.d.ts +0 -0
- /package/src/private/{debugging → devsupport/rndevtools}/FuseboxSessionObserver.js +0 -0
|
@@ -14,20 +14,48 @@ import type {
|
|
|
14
14
|
KeyEvent, // Windows
|
|
15
15
|
MouseEvent, // Windows
|
|
16
16
|
GestureResponderEvent,
|
|
17
|
-
NativeSyntheticEvent,
|
|
18
17
|
ScrollEvent,
|
|
19
18
|
} from '../../Types/CoreEventTypes';
|
|
20
|
-
import type {
|
|
21
|
-
|
|
19
|
+
import type {
|
|
20
|
+
AutoCapitalize,
|
|
21
|
+
EnterKeyHintType,
|
|
22
|
+
EnterKeyHintTypeAndroid,
|
|
23
|
+
EnterKeyHintTypeIOS,
|
|
24
|
+
EnterKeyHintTypeOptions,
|
|
25
|
+
InputModeOptions,
|
|
26
|
+
KeyboardType,
|
|
27
|
+
KeyboardTypeAndroid,
|
|
28
|
+
KeyboardTypeIOS,
|
|
29
|
+
KeyboardTypeOptions,
|
|
30
|
+
ReturnKeyType,
|
|
31
|
+
ReturnKeyTypeAndroid,
|
|
32
|
+
ReturnKeyTypeIOS,
|
|
33
|
+
ReturnKeyTypeOptions,
|
|
34
|
+
Selection,
|
|
35
|
+
SubmitBehavior,
|
|
36
|
+
TextContentType,
|
|
37
|
+
TextInputAndroidProps,
|
|
38
|
+
TextInputBlurEvent,
|
|
39
|
+
TextInputChangeEvent,
|
|
40
|
+
TextInputContentSizeChangeEvent,
|
|
41
|
+
TextInputEditingEvent,
|
|
42
|
+
TextInputEndEditingEvent,
|
|
43
|
+
TextInputEvent,
|
|
44
|
+
TextInputFocusEvent,
|
|
45
|
+
TextInputInstance,
|
|
46
|
+
TextInputIOSProps,
|
|
47
|
+
TextInputKeyPressEvent,
|
|
48
|
+
TextInputProps,
|
|
49
|
+
TextInputSelectionChangeEvent,
|
|
50
|
+
TextInputSubmitEditingEvent,
|
|
51
|
+
TextInputType,
|
|
52
|
+
TextInputWindowsProps, // [Windows]
|
|
53
|
+
} from './TextInput.flow.windows';
|
|
54
|
+
import type {HandledKeyboardEvent} from '../View/ViewPropTypes';
|
|
22
55
|
|
|
23
|
-
import * as ReactNativeFeatureFlags from '../../../src/private/featureflags/ReactNativeFeatureFlags';
|
|
24
56
|
import usePressability from '../../Pressability/usePressability';
|
|
25
57
|
import flattenStyle from '../../StyleSheet/flattenStyle';
|
|
26
|
-
import StyleSheet, {
|
|
27
|
-
type ColorValue,
|
|
28
|
-
type TextStyleProp,
|
|
29
|
-
type ViewStyleProp,
|
|
30
|
-
} from '../../StyleSheet/StyleSheet';
|
|
58
|
+
import StyleSheet, {type TextStyleProp} from '../../StyleSheet/StyleSheet';
|
|
31
59
|
import Text from '../../Text/Text';
|
|
32
60
|
import TextAncestor from '../../Text/TextAncestor';
|
|
33
61
|
import Platform from '../../Utilities/Platform';
|
|
@@ -70,1001 +98,66 @@ else if (Platform.OS === 'windows') {
|
|
|
70
98
|
}
|
|
71
99
|
// Windows]
|
|
72
100
|
|
|
73
|
-
export type
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
export type TargetEvent = $ReadOnly<{
|
|
107
|
-
target: number,
|
|
108
|
-
}>;
|
|
109
|
-
|
|
110
|
-
export type TextInputFocusEventData = TargetEvent;
|
|
111
|
-
|
|
112
|
-
export type TextInputBlurEvent = NativeSyntheticEvent<TextInputFocusEventData>;
|
|
113
|
-
export type TextInputFocusEvent = NativeSyntheticEvent<TextInputFocusEventData>;
|
|
114
|
-
|
|
115
|
-
type Selection = $ReadOnly<{
|
|
116
|
-
start: number,
|
|
117
|
-
end: number,
|
|
118
|
-
}>;
|
|
119
|
-
|
|
120
|
-
export type TextInputSelectionChangeEventData = $ReadOnly<{
|
|
121
|
-
...TargetEvent,
|
|
122
|
-
selection: Selection,
|
|
123
|
-
}>;
|
|
124
|
-
|
|
125
|
-
export type TextInputSelectionChangeEvent =
|
|
126
|
-
NativeSyntheticEvent<TextInputSelectionChangeEventData>;
|
|
127
|
-
|
|
128
|
-
type TextInputKeyPressEventData = $ReadOnly<{
|
|
129
|
-
...TargetEvent,
|
|
130
|
-
key: string,
|
|
131
|
-
target?: ?number,
|
|
132
|
-
eventCount?: ?number,
|
|
133
|
-
}>;
|
|
134
|
-
|
|
135
|
-
export type TextInputKeyPressEvent =
|
|
136
|
-
NativeSyntheticEvent<TextInputKeyPressEventData>;
|
|
137
|
-
|
|
138
|
-
export type TextInputEndEditingEventData = $ReadOnly<{
|
|
139
|
-
...TargetEvent,
|
|
140
|
-
eventCount: number,
|
|
141
|
-
text: string,
|
|
142
|
-
}>;
|
|
143
|
-
|
|
144
|
-
export type TextInputEditingEvent =
|
|
145
|
-
NativeSyntheticEvent<TextInputEndEditingEventData>;
|
|
146
|
-
|
|
147
|
-
type DataDetectorTypesType =
|
|
148
|
-
| 'phoneNumber'
|
|
149
|
-
| 'link'
|
|
150
|
-
| 'address'
|
|
151
|
-
| 'calendarEvent'
|
|
152
|
-
| 'trackingNumber'
|
|
153
|
-
| 'flightNumber'
|
|
154
|
-
| 'lookupSuggestion'
|
|
155
|
-
| 'none'
|
|
156
|
-
| 'all';
|
|
157
|
-
|
|
158
|
-
export type KeyboardType =
|
|
159
|
-
| 'default'
|
|
160
|
-
| 'email-address'
|
|
161
|
-
| 'numeric'
|
|
162
|
-
| 'phone-pad'
|
|
163
|
-
| 'number-pad'
|
|
164
|
-
| 'decimal-pad'
|
|
165
|
-
| 'url';
|
|
166
|
-
|
|
167
|
-
export type KeyboardTypeIOS =
|
|
168
|
-
| 'ascii-capable'
|
|
169
|
-
| 'numbers-and-punctuation'
|
|
170
|
-
| 'name-phone-pad'
|
|
171
|
-
| 'twitter'
|
|
172
|
-
| 'web-search'
|
|
173
|
-
// iOS 10+ only
|
|
174
|
-
| 'ascii-capable-number-pad';
|
|
175
|
-
|
|
176
|
-
export type KeyboardTypeAndroid = 'visible-password';
|
|
177
|
-
|
|
178
|
-
export type KeyboardTypeOptions =
|
|
179
|
-
| KeyboardType
|
|
180
|
-
| KeyboardTypeIOS
|
|
181
|
-
| KeyboardTypeAndroid;
|
|
182
|
-
|
|
183
|
-
export type InputModeOptions =
|
|
184
|
-
| 'none'
|
|
185
|
-
| 'text'
|
|
186
|
-
| 'decimal'
|
|
187
|
-
| 'numeric'
|
|
188
|
-
| 'tel'
|
|
189
|
-
| 'search'
|
|
190
|
-
| 'email'
|
|
191
|
-
| 'url';
|
|
192
|
-
|
|
193
|
-
export type ReturnKeyType = 'done' | 'go' | 'next' | 'search' | 'send';
|
|
194
|
-
|
|
195
|
-
export type ReturnKeyTypeIOS =
|
|
196
|
-
| 'default'
|
|
197
|
-
| 'emergency-call'
|
|
198
|
-
| 'google'
|
|
199
|
-
| 'join'
|
|
200
|
-
| 'route'
|
|
201
|
-
| 'yahoo';
|
|
202
|
-
|
|
203
|
-
export type ReturnKeyTypeAndroid = 'none' | 'previous';
|
|
204
|
-
|
|
205
|
-
export type ReturnKeyTypeOptions =
|
|
206
|
-
| ReturnKeyType
|
|
207
|
-
| ReturnKeyTypeIOS
|
|
208
|
-
| ReturnKeyTypeAndroid;
|
|
209
|
-
|
|
210
|
-
export type SubmitBehavior = 'submit' | 'blurAndSubmit' | 'newline';
|
|
211
|
-
|
|
212
|
-
export type AutoCapitalize = 'none' | 'sentences' | 'words' | 'characters';
|
|
213
|
-
|
|
214
|
-
export type TextContentType =
|
|
215
|
-
| 'none'
|
|
216
|
-
| 'URL'
|
|
217
|
-
| 'addressCity'
|
|
218
|
-
| 'addressCityAndState'
|
|
219
|
-
| 'addressState'
|
|
220
|
-
| 'countryName'
|
|
221
|
-
| 'creditCardNumber'
|
|
222
|
-
| 'creditCardExpiration'
|
|
223
|
-
| 'creditCardExpirationMonth'
|
|
224
|
-
| 'creditCardExpirationYear'
|
|
225
|
-
| 'creditCardSecurityCode'
|
|
226
|
-
| 'creditCardType'
|
|
227
|
-
| 'creditCardName'
|
|
228
|
-
| 'creditCardGivenName'
|
|
229
|
-
| 'creditCardMiddleName'
|
|
230
|
-
| 'creditCardFamilyName'
|
|
231
|
-
| 'emailAddress'
|
|
232
|
-
| 'familyName'
|
|
233
|
-
| 'fullStreetAddress'
|
|
234
|
-
| 'givenName'
|
|
235
|
-
| 'jobTitle'
|
|
236
|
-
| 'location'
|
|
237
|
-
| 'middleName'
|
|
238
|
-
| 'name'
|
|
239
|
-
| 'namePrefix'
|
|
240
|
-
| 'nameSuffix'
|
|
241
|
-
| 'nickname'
|
|
242
|
-
| 'organizationName'
|
|
243
|
-
| 'postalCode'
|
|
244
|
-
| 'streetAddressLine1'
|
|
245
|
-
| 'streetAddressLine2'
|
|
246
|
-
| 'sublocality'
|
|
247
|
-
| 'telephoneNumber'
|
|
248
|
-
| 'username'
|
|
249
|
-
| 'password'
|
|
250
|
-
| 'newPassword'
|
|
251
|
-
| 'oneTimeCode'
|
|
252
|
-
| 'birthdate'
|
|
253
|
-
| 'birthdateDay'
|
|
254
|
-
| 'birthdateMonth'
|
|
255
|
-
| 'birthdateYear'
|
|
256
|
-
| 'cellularEID'
|
|
257
|
-
| 'cellularIMEI'
|
|
258
|
-
| 'dateTime'
|
|
259
|
-
| 'flightNumber'
|
|
260
|
-
| 'shipmentTrackingNumber';
|
|
261
|
-
|
|
262
|
-
export type EnterKeyHintTypeAndroid = 'previous';
|
|
263
|
-
|
|
264
|
-
export type EnterKeyHintTypeIOS = 'enter';
|
|
265
|
-
|
|
266
|
-
export type EnterKeyHintType = 'done' | 'go' | 'next' | 'search' | 'send';
|
|
267
|
-
|
|
268
|
-
export type EnterKeyHintTypeOptions =
|
|
269
|
-
| EnterKeyHintType
|
|
270
|
-
| EnterKeyHintTypeAndroid
|
|
271
|
-
| EnterKeyHintTypeIOS;
|
|
272
|
-
|
|
273
|
-
type PasswordRules = string;
|
|
274
|
-
|
|
275
|
-
export type TextInputIOSProps = $ReadOnly<{
|
|
276
|
-
/**
|
|
277
|
-
* If true, the keyboard shortcuts (undo/redo and copy buttons) are disabled. The default value is false.
|
|
278
|
-
* @platform ios
|
|
279
|
-
*/
|
|
280
|
-
disableKeyboardShortcuts?: ?boolean,
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* When the clear button should appear on the right side of the text view.
|
|
284
|
-
* This property is supported only for single-line TextInput component.
|
|
285
|
-
* @platform ios
|
|
286
|
-
*/
|
|
287
|
-
clearButtonMode?: ?('never' | 'while-editing' | 'unless-editing' | 'always'),
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* If `true`, clears the text field automatically when editing begins.
|
|
291
|
-
* @platform ios
|
|
292
|
-
*/
|
|
293
|
-
clearTextOnFocus?: ?boolean,
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* Determines the types of data converted to clickable URLs in the text input.
|
|
297
|
-
* Only valid if `multiline={true}` and `editable={false}`.
|
|
298
|
-
* By default no data types are detected.
|
|
299
|
-
*
|
|
300
|
-
* You can provide one type or an array of many types.
|
|
301
|
-
*
|
|
302
|
-
* Possible values for `dataDetectorTypes` are:
|
|
303
|
-
*
|
|
304
|
-
* - `'phoneNumber'`
|
|
305
|
-
* - `'link'`
|
|
306
|
-
* - `'address'`
|
|
307
|
-
* - `'calendarEvent'`
|
|
308
|
-
* - `'none'`
|
|
309
|
-
* - `'all'`
|
|
310
|
-
*
|
|
311
|
-
* @platform ios
|
|
312
|
-
*/
|
|
313
|
-
dataDetectorTypes?:
|
|
314
|
-
| ?DataDetectorTypesType
|
|
315
|
-
| $ReadOnlyArray<DataDetectorTypesType>,
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* If `true`, the keyboard disables the return key when there is no text and
|
|
319
|
-
* automatically enables it when there is text. The default value is `false`.
|
|
320
|
-
* @platform ios
|
|
321
|
-
*/
|
|
322
|
-
enablesReturnKeyAutomatically?: ?boolean,
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* An optional identifier which links a custom InputAccessoryView to
|
|
326
|
-
* this text input. The InputAccessoryView is rendered above the
|
|
327
|
-
* keyboard when this text input is focused.
|
|
328
|
-
* @platform ios
|
|
329
|
-
*/
|
|
330
|
-
inputAccessoryViewID?: ?string,
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* An optional label that overrides the default input accessory view button label.
|
|
334
|
-
* @platform ios
|
|
335
|
-
*/
|
|
336
|
-
inputAccessoryViewButtonLabel?: ?string,
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* Determines the color of the keyboard.
|
|
340
|
-
* @platform ios
|
|
341
|
-
*/
|
|
342
|
-
keyboardAppearance?: ?('default' | 'light' | 'dark'),
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
* Provide rules for your password.
|
|
346
|
-
* For example, say you want to require a password with at least eight characters consisting of a mix of uppercase and lowercase letters, at least one number, and at most two consecutive characters.
|
|
347
|
-
* "required: upper; required: lower; required: digit; max-consecutive: 2; minlength: 8;"
|
|
348
|
-
* @platform ios
|
|
349
|
-
*/
|
|
350
|
-
passwordRules?: ?PasswordRules,
|
|
351
|
-
|
|
352
|
-
/*
|
|
353
|
-
* If `true`, allows TextInput to pass touch events to the parent component.
|
|
354
|
-
* This allows components to be swipeable from the TextInput on iOS,
|
|
355
|
-
* as is the case on Android by default.
|
|
356
|
-
* If `false`, TextInput always asks to handle the input (except when disabled).
|
|
357
|
-
* @platform ios
|
|
358
|
-
*/
|
|
359
|
-
rejectResponderTermination?: ?boolean,
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* If `false`, scrolling of the text view will be disabled.
|
|
363
|
-
* The default value is `true`. Does only work with 'multiline={true}'.
|
|
364
|
-
* @platform ios
|
|
365
|
-
*/
|
|
366
|
-
scrollEnabled?: ?boolean,
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* If `false`, disables spell-check style (i.e. red underlines).
|
|
370
|
-
* The default value is inherited from `autoCorrect`.
|
|
371
|
-
* @platform ios
|
|
372
|
-
*/
|
|
373
|
-
spellCheck?: ?boolean,
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* Give the keyboard and the system information about the
|
|
377
|
-
* expected semantic meaning for the content that users enter.
|
|
378
|
-
* @platform ios
|
|
379
|
-
*/
|
|
380
|
-
textContentType?: ?TextContentType,
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
* Set line break strategy on iOS.
|
|
384
|
-
* @platform ios
|
|
385
|
-
*/
|
|
386
|
-
lineBreakStrategyIOS?: ?('none' | 'standard' | 'hangul-word' | 'push-out'),
|
|
387
|
-
|
|
388
|
-
/**
|
|
389
|
-
* Set line break mode on iOS.
|
|
390
|
-
* @platform ios
|
|
391
|
-
*/
|
|
392
|
-
lineBreakModeIOS?: ?(
|
|
393
|
-
| 'wordWrapping'
|
|
394
|
-
| 'char'
|
|
395
|
-
| 'clip'
|
|
396
|
-
| 'head'
|
|
397
|
-
| 'middle'
|
|
398
|
-
| 'tail'
|
|
399
|
-
),
|
|
400
|
-
|
|
401
|
-
/**
|
|
402
|
-
* If `false`, the iOS system will not insert an extra space after a paste operation
|
|
403
|
-
* neither delete one or two spaces after a cut or delete operation.
|
|
404
|
-
*
|
|
405
|
-
* The default value is `true`.
|
|
406
|
-
*
|
|
407
|
-
* @platform ios
|
|
408
|
-
*/
|
|
409
|
-
smartInsertDelete?: ?boolean,
|
|
410
|
-
}>;
|
|
411
|
-
|
|
412
|
-
export type TextInputAndroidProps = $ReadOnly<{
|
|
413
|
-
/**
|
|
414
|
-
* When provided it will set the color of the cursor (or "caret") in the component.
|
|
415
|
-
* Unlike the behavior of `selectionColor` the cursor color will be set independently
|
|
416
|
-
* from the color of the text selection box.
|
|
417
|
-
* @platform android
|
|
418
|
-
*/
|
|
419
|
-
cursorColor?: ?ColorValue,
|
|
420
|
-
|
|
421
|
-
/**
|
|
422
|
-
* When `false`, if there is a small amount of space available around a text input
|
|
423
|
-
* (e.g. landscape orientation on a phone), the OS may choose to have the user edit
|
|
424
|
-
* the text inside of a full screen text input mode. When `true`, this feature is
|
|
425
|
-
* disabled and users will always edit the text directly inside of the text input.
|
|
426
|
-
* Defaults to `false`.
|
|
427
|
-
* @platform android
|
|
428
|
-
*/
|
|
429
|
-
disableFullscreenUI?: ?boolean,
|
|
430
|
-
|
|
431
|
-
importantForAutofill?: ?(
|
|
432
|
-
| 'auto'
|
|
433
|
-
| 'no'
|
|
434
|
-
| 'noExcludeDescendants'
|
|
435
|
-
| 'yes'
|
|
436
|
-
| 'yesExcludeDescendants'
|
|
437
|
-
),
|
|
438
|
-
|
|
439
|
-
/**
|
|
440
|
-
* If defined, the provided image resource will be rendered on the left.
|
|
441
|
-
* The image resource must be inside `/android/app/src/main/res/drawable` and referenced
|
|
442
|
-
* like
|
|
443
|
-
* ```
|
|
444
|
-
* <TextInput
|
|
445
|
-
* inlineImageLeft='search_icon'
|
|
446
|
-
* />
|
|
447
|
-
* ```
|
|
448
|
-
* @platform android
|
|
449
|
-
*/
|
|
450
|
-
inlineImageLeft?: ?string,
|
|
451
|
-
|
|
452
|
-
/**
|
|
453
|
-
* Padding between the inline image, if any, and the text input itself.
|
|
454
|
-
* @platform android
|
|
455
|
-
*/
|
|
456
|
-
inlineImagePadding?: ?number,
|
|
457
|
-
|
|
458
|
-
/**
|
|
459
|
-
* Sets the number of lines for a `TextInput`. Use it with multiline set to
|
|
460
|
-
* `true` to be able to fill the lines.
|
|
461
|
-
* @platform android
|
|
462
|
-
*/
|
|
463
|
-
numberOfLines?: ?number,
|
|
464
|
-
|
|
465
|
-
/**
|
|
466
|
-
* Sets the return key to the label. Use it instead of `returnKeyType`.
|
|
467
|
-
* @platform android
|
|
468
|
-
*/
|
|
469
|
-
returnKeyLabel?: ?string,
|
|
470
|
-
|
|
471
|
-
/**
|
|
472
|
-
* Sets the number of rows for a `TextInput`. Use it with multiline set to
|
|
473
|
-
* `true` to be able to fill the lines.
|
|
474
|
-
* @platform android
|
|
475
|
-
*/
|
|
476
|
-
rows?: ?number,
|
|
477
|
-
|
|
478
|
-
/**
|
|
479
|
-
* When `false`, it will prevent the soft keyboard from showing when the field is focused.
|
|
480
|
-
* Defaults to `true`.
|
|
481
|
-
*/
|
|
482
|
-
showSoftInputOnFocus?: ?boolean,
|
|
483
|
-
|
|
484
|
-
/**
|
|
485
|
-
* Set text break strategy on Android API Level 23+, possible values are `simple`, `highQuality`, `balanced`
|
|
486
|
-
* The default value is `simple`.
|
|
487
|
-
* @platform android
|
|
488
|
-
*/
|
|
489
|
-
textBreakStrategy?: ?('simple' | 'highQuality' | 'balanced'),
|
|
490
|
-
|
|
491
|
-
/**
|
|
492
|
-
* The color of the `TextInput` underline.
|
|
493
|
-
* @platform android
|
|
494
|
-
*/
|
|
495
|
-
underlineColorAndroid?: ?ColorValue,
|
|
496
|
-
}>;
|
|
497
|
-
|
|
498
|
-
// [Windows
|
|
499
|
-
|
|
500
|
-
type SubmitKeyEvent = $ReadOnly<{|
|
|
501
|
-
altKey?: ?boolean,
|
|
502
|
-
ctrlKey?: ?boolean,
|
|
503
|
-
metaKey?: ?boolean,
|
|
504
|
-
shiftKey?: ?boolean,
|
|
505
|
-
code: string,
|
|
506
|
-
|}>;
|
|
507
|
-
|
|
508
|
-
type TextInputWindowsProps = $ReadOnly<{|
|
|
509
|
-
/**
|
|
510
|
-
* If `true`, clears the text field synchronously before `onSubmitEditing` is emitted.
|
|
511
|
-
* @platform windows
|
|
512
|
-
*/
|
|
513
|
-
clearTextOnSubmit?: ?boolean,
|
|
514
|
-
|
|
515
|
-
/**
|
|
516
|
-
* Configures keys that can be used to submit editing for the TextInput.
|
|
517
|
-
* @platform windows
|
|
518
|
-
*/
|
|
519
|
-
submitKeyEvents?: ?$ReadOnlyArray<SubmitKeyEvent>,
|
|
520
|
-
|
|
521
|
-
/**
|
|
522
|
-
* Specifies the Tooltip for the view
|
|
523
|
-
*/
|
|
524
|
-
tooltip?: string,
|
|
525
|
-
|
|
526
|
-
/**
|
|
527
|
-
* Indicates the TabIndex to use for this view
|
|
528
|
-
*/
|
|
529
|
-
tabIndex?: number,
|
|
530
|
-
|
|
531
|
-
/**
|
|
532
|
-
* Specifies if the control should show System focus visuals
|
|
533
|
-
*/
|
|
534
|
-
enableFocusRing?: boolean,
|
|
535
|
-
|
|
536
|
-
/**
|
|
537
|
-
* Event fired when the mouse leaves the view
|
|
538
|
-
*/
|
|
539
|
-
onMouseLeave?: (args: MouseEvent) => void,
|
|
540
|
-
|
|
541
|
-
/**
|
|
542
|
-
* Event fired when the mouse enters the view
|
|
543
|
-
*/
|
|
544
|
-
onMouseEnter?: (args: MouseEvent) => void,
|
|
545
|
-
|
|
546
|
-
onKeyDown?: (args: KeyEvent) => void,
|
|
547
|
-
onKeyDownCapture?: (args: KeyEvent) => void,
|
|
548
|
-
onKeyUp?: (args: KeyEvent) => void,
|
|
549
|
-
onKeyUpCapture?: (args: KeyEvent) => void,
|
|
550
|
-
|
|
551
|
-
keyDownEvents?: ?$ReadOnlyArray<HandledKeyboardEvent>,
|
|
552
|
-
keyUpEvents?: ?$ReadOnlyArray<HandledKeyboardEvent>,
|
|
553
|
-
|}>;
|
|
554
|
-
|
|
555
|
-
// Windows]
|
|
556
|
-
|
|
557
|
-
export type TextInputProps = $ReadOnly<{
|
|
558
|
-
...$Diff<ViewProps, $ReadOnly<{style: ?ViewStyleProp}>>,
|
|
559
|
-
...TextInputIOSProps,
|
|
560
|
-
...TextInputAndroidProps,
|
|
561
|
-
...TextInputWindowsProps, // [Windows]
|
|
562
|
-
|
|
563
|
-
/**
|
|
564
|
-
* String to be read by screenreaders to indicate an error state. The acceptable parameters
|
|
565
|
-
* of accessibilityErrorMessage is a string. Setting accessibilityInvalid to true activates
|
|
566
|
-
* the error message. Setting accessibilityInvalid to false removes the error message.
|
|
567
|
-
*/
|
|
568
|
-
accessibilityErrorMessage?: ?Stringish,
|
|
569
|
-
accessibilityInvalid?: ?boolean,
|
|
570
|
-
|
|
571
|
-
/**
|
|
572
|
-
* Can tell `TextInput` to automatically capitalize certain characters.
|
|
573
|
-
*
|
|
574
|
-
* - `characters`: all characters.
|
|
575
|
-
* - `words`: first letter of each word.
|
|
576
|
-
* - `sentences`: first letter of each sentence (*default*).
|
|
577
|
-
* - `none`: don't auto capitalize anything.
|
|
578
|
-
*/
|
|
579
|
-
autoCapitalize?: ?AutoCapitalize,
|
|
580
|
-
|
|
581
|
-
/**
|
|
582
|
-
* Specifies autocomplete hints for the system, so it can provide autofill.
|
|
583
|
-
* On Android, the system will always attempt to offer autofill by using heuristics to identify the type of content.
|
|
584
|
-
* To disable autocomplete, set autoComplete to off.
|
|
585
|
-
*
|
|
586
|
-
* The following values work across platforms:
|
|
587
|
-
*
|
|
588
|
-
* - `additional-name`
|
|
589
|
-
* - `address-line1`
|
|
590
|
-
* - `address-line2`
|
|
591
|
-
* - `birthdate-day` (iOS 17+)
|
|
592
|
-
* - `birthdate-full` (iOS 17+)
|
|
593
|
-
* - `birthdate-month` (iOS 17+)
|
|
594
|
-
* - `birthdate-year` (iOS 17+)
|
|
595
|
-
* - `cc-number`
|
|
596
|
-
* - `cc-csc` (iOS 17+)
|
|
597
|
-
* - `cc-exp` (iOS 17+)
|
|
598
|
-
* - `cc-exp-day` (iOS 17+)
|
|
599
|
-
* - `cc-exp-month` (iOS 17+)
|
|
600
|
-
* - `cc-exp-year` (iOS 17+)
|
|
601
|
-
* - `country`
|
|
602
|
-
* - `current-password`
|
|
603
|
-
* - `email`
|
|
604
|
-
* - `family-name`
|
|
605
|
-
* - `given-name`
|
|
606
|
-
* - `honorific-prefix`
|
|
607
|
-
* - `honorific-suffix`
|
|
608
|
-
* - `name`
|
|
609
|
-
* - `new-password`
|
|
610
|
-
* - `off`
|
|
611
|
-
* - `one-time-code`
|
|
612
|
-
* - `postal-code`
|
|
613
|
-
* - `street-address`
|
|
614
|
-
* - `tel`
|
|
615
|
-
* - `username`
|
|
616
|
-
*
|
|
617
|
-
* The following values work on iOS only:
|
|
618
|
-
*
|
|
619
|
-
* - `cc-name` (iOS 17+)
|
|
620
|
-
* - `cc-given-name` (iOS 17+)
|
|
621
|
-
* - `cc-middle-name` (iOS 17+)
|
|
622
|
-
* - `cc-family-name` (iOS 17+)
|
|
623
|
-
* - `cc-type` (iOS 17+)
|
|
624
|
-
* - `nickname`
|
|
625
|
-
* - `organization`
|
|
626
|
-
* - `organization-title`
|
|
627
|
-
* - `url`
|
|
628
|
-
*
|
|
629
|
-
* The following values work on Android only:
|
|
630
|
-
*
|
|
631
|
-
* - `gender`
|
|
632
|
-
* - `name-family`
|
|
633
|
-
* - `name-given`
|
|
634
|
-
* - `name-middle`
|
|
635
|
-
* - `name-middle-initial`
|
|
636
|
-
* - `name-prefix`
|
|
637
|
-
* - `name-suffix`
|
|
638
|
-
* - `password`
|
|
639
|
-
* - `password-new`
|
|
640
|
-
* - `postal-address`
|
|
641
|
-
* - `postal-address-country`
|
|
642
|
-
* - `postal-address-extended`
|
|
643
|
-
* - `postal-address-extended-postal-code`
|
|
644
|
-
* - `postal-address-locality`
|
|
645
|
-
* - `postal-address-region`
|
|
646
|
-
* - `sms-otp`
|
|
647
|
-
* - `tel-country-code`
|
|
648
|
-
* - `tel-national`
|
|
649
|
-
* - `tel-device`
|
|
650
|
-
* - `username-new`
|
|
651
|
-
*/
|
|
652
|
-
autoComplete?: ?(
|
|
653
|
-
| 'additional-name'
|
|
654
|
-
| 'address-line1'
|
|
655
|
-
| 'address-line2'
|
|
656
|
-
| 'birthdate-day'
|
|
657
|
-
| 'birthdate-full'
|
|
658
|
-
| 'birthdate-month'
|
|
659
|
-
| 'birthdate-year'
|
|
660
|
-
| 'cc-csc'
|
|
661
|
-
| 'cc-exp'
|
|
662
|
-
| 'cc-exp-day'
|
|
663
|
-
| 'cc-exp-month'
|
|
664
|
-
| 'cc-exp-year'
|
|
665
|
-
| 'cc-number'
|
|
666
|
-
| 'cc-name'
|
|
667
|
-
| 'cc-given-name'
|
|
668
|
-
| 'cc-middle-name'
|
|
669
|
-
| 'cc-family-name'
|
|
670
|
-
| 'cc-type'
|
|
671
|
-
| 'country'
|
|
672
|
-
| 'current-password'
|
|
673
|
-
| 'email'
|
|
674
|
-
| 'family-name'
|
|
675
|
-
| 'gender'
|
|
676
|
-
| 'given-name'
|
|
677
|
-
| 'honorific-prefix'
|
|
678
|
-
| 'honorific-suffix'
|
|
679
|
-
| 'name'
|
|
680
|
-
| 'name-family'
|
|
681
|
-
| 'name-given'
|
|
682
|
-
| 'name-middle'
|
|
683
|
-
| 'name-middle-initial'
|
|
684
|
-
| 'name-prefix'
|
|
685
|
-
| 'name-suffix'
|
|
686
|
-
| 'new-password'
|
|
687
|
-
| 'nickname'
|
|
688
|
-
| 'one-time-code'
|
|
689
|
-
| 'organization'
|
|
690
|
-
| 'organization-title'
|
|
691
|
-
| 'password'
|
|
692
|
-
| 'password-new'
|
|
693
|
-
| 'postal-address'
|
|
694
|
-
| 'postal-address-country'
|
|
695
|
-
| 'postal-address-extended'
|
|
696
|
-
| 'postal-address-extended-postal-code'
|
|
697
|
-
| 'postal-address-locality'
|
|
698
|
-
| 'postal-address-region'
|
|
699
|
-
| 'postal-code'
|
|
700
|
-
| 'street-address'
|
|
701
|
-
| 'sms-otp'
|
|
702
|
-
| 'tel'
|
|
703
|
-
| 'tel-country-code'
|
|
704
|
-
| 'tel-national'
|
|
705
|
-
| 'tel-device'
|
|
706
|
-
| 'url'
|
|
707
|
-
| 'username'
|
|
708
|
-
| 'username-new'
|
|
709
|
-
| 'off'
|
|
710
|
-
),
|
|
711
|
-
|
|
712
|
-
/**
|
|
713
|
-
* If `false`, disables auto-correct. The default value is `true`.
|
|
714
|
-
*/
|
|
715
|
-
autoCorrect?: ?boolean,
|
|
716
|
-
|
|
717
|
-
/**
|
|
718
|
-
* If `true`, focuses the input on `componentDidMount`.
|
|
719
|
-
* The default value is `false`.
|
|
720
|
-
*/
|
|
721
|
-
autoFocus?: ?boolean,
|
|
722
|
-
|
|
723
|
-
/**
|
|
724
|
-
* Specifies whether fonts should scale to respect Text Size accessibility settings. The
|
|
725
|
-
* default is `true`.
|
|
726
|
-
*/
|
|
727
|
-
allowFontScaling?: ?boolean,
|
|
728
|
-
|
|
729
|
-
/**
|
|
730
|
-
* If `true`, caret is hidden. The default value is `false`.
|
|
731
|
-
*
|
|
732
|
-
* On Android devices manufactured by Xiaomi with Android Q,
|
|
733
|
-
* when keyboardType equals 'email-address'this will be set
|
|
734
|
-
* in native to 'true' to prevent a system related crash. This
|
|
735
|
-
* will cause cursor to be disabled as a side-effect.
|
|
736
|
-
*
|
|
737
|
-
*/
|
|
738
|
-
caretHidden?: ?boolean,
|
|
739
|
-
|
|
740
|
-
/*
|
|
741
|
-
* If `true`, contextMenuHidden is hidden. The default value is `false`.
|
|
742
|
-
*/
|
|
743
|
-
contextMenuHidden?: ?boolean,
|
|
744
|
-
|
|
745
|
-
/**
|
|
746
|
-
* Provides an initial value that will change when the user starts typing.
|
|
747
|
-
* Useful for simple use-cases where you do not want to deal with listening
|
|
748
|
-
* to events and updating the value prop to keep the controlled state in sync.
|
|
749
|
-
*/
|
|
750
|
-
defaultValue?: ?Stringish,
|
|
751
|
-
|
|
752
|
-
/**
|
|
753
|
-
* If `false`, text is not editable. The default value is `true`.
|
|
754
|
-
*/
|
|
755
|
-
editable?: ?boolean,
|
|
756
|
-
|
|
757
|
-
forwardedRef?: ?React.RefSetter<TextInputInstance>,
|
|
758
|
-
|
|
759
|
-
/**
|
|
760
|
-
* `enterKeyHint` defines what action label (or icon) to present for the enter key on virtual keyboards.
|
|
761
|
-
*
|
|
762
|
-
* The following values is supported:
|
|
763
|
-
*
|
|
764
|
-
* - `enter`
|
|
765
|
-
* - `done`
|
|
766
|
-
* - `go`
|
|
767
|
-
* - `next`
|
|
768
|
-
* - `previous`
|
|
769
|
-
* - `search`
|
|
770
|
-
* - `send`
|
|
771
|
-
*/
|
|
772
|
-
enterKeyHint?: ?EnterKeyHintTypeOptions,
|
|
773
|
-
|
|
774
|
-
/**
|
|
775
|
-
* `inputMode` works like the `inputmode` attribute in HTML, it determines which
|
|
776
|
-
* keyboard to open, e.g.`numeric` and has precedence over keyboardType
|
|
777
|
-
*
|
|
778
|
-
* Support the following values:
|
|
779
|
-
*
|
|
780
|
-
* - `none`
|
|
781
|
-
* - `text`
|
|
782
|
-
* - `decimal`
|
|
783
|
-
* - `numeric`
|
|
784
|
-
* - `tel`
|
|
785
|
-
* - `search`
|
|
786
|
-
* - `email`
|
|
787
|
-
* - `url`
|
|
788
|
-
*/
|
|
789
|
-
inputMode?: ?InputModeOptions,
|
|
790
|
-
|
|
791
|
-
/**
|
|
792
|
-
* Determines which keyboard to open, e.g.`numeric`.
|
|
793
|
-
*
|
|
794
|
-
* The following values work across platforms:
|
|
795
|
-
*
|
|
796
|
-
* - `default`
|
|
797
|
-
* - `numeric`
|
|
798
|
-
* - `number-pad`
|
|
799
|
-
* - `decimal-pad`
|
|
800
|
-
* - `email-address`
|
|
801
|
-
* - `phone-pad`
|
|
802
|
-
* - `url`
|
|
803
|
-
*
|
|
804
|
-
* *iOS Only*
|
|
805
|
-
*
|
|
806
|
-
* The following values work on iOS only:
|
|
807
|
-
*
|
|
808
|
-
* - `ascii-capable`
|
|
809
|
-
* - `numbers-and-punctuation`
|
|
810
|
-
* - `name-phone-pad`
|
|
811
|
-
* - `twitter`
|
|
812
|
-
* - `web-search`
|
|
813
|
-
*
|
|
814
|
-
* *Android Only*
|
|
815
|
-
*
|
|
816
|
-
* The following values work on Android only:
|
|
817
|
-
*
|
|
818
|
-
* - `visible-password`
|
|
819
|
-
*
|
|
820
|
-
*/
|
|
821
|
-
keyboardType?: ?KeyboardTypeOptions,
|
|
822
|
-
|
|
823
|
-
/**
|
|
824
|
-
* Specifies largest possible scale a font can reach when `allowFontScaling` is enabled.
|
|
825
|
-
* Possible values:
|
|
826
|
-
* `null/undefined` (default): inherit from the parent node or the global default (0)
|
|
827
|
-
* `0`: no max, ignore parent/global default
|
|
828
|
-
* `>= 1`: sets the maxFontSizeMultiplier of this node to this value
|
|
829
|
-
*/
|
|
830
|
-
maxFontSizeMultiplier?: ?number,
|
|
831
|
-
|
|
832
|
-
/**
|
|
833
|
-
* Limits the maximum number of characters that can be entered. Use this
|
|
834
|
-
* instead of implementing the logic in JS to avoid flicker.
|
|
835
|
-
*/
|
|
836
|
-
maxLength?: ?number,
|
|
837
|
-
|
|
838
|
-
/**
|
|
839
|
-
* If `true`, the text input can be multiple lines.
|
|
840
|
-
* The default value is `false`.
|
|
841
|
-
*/
|
|
842
|
-
multiline?: ?boolean,
|
|
843
|
-
|
|
844
|
-
/**
|
|
845
|
-
* Callback that is called when the text input is blurred.
|
|
846
|
-
*/
|
|
847
|
-
onBlur?: ?(e: TextInputBlurEvent) => mixed,
|
|
848
|
-
|
|
849
|
-
/**
|
|
850
|
-
* Callback that is called when the text input's text changes.
|
|
851
|
-
*/
|
|
852
|
-
onChange?: ?(e: TextInputChangeEvent) => mixed,
|
|
853
|
-
|
|
854
|
-
/**
|
|
855
|
-
* Callback that is called when the text input's text changes.
|
|
856
|
-
* Changed text is passed as an argument to the callback handler.
|
|
857
|
-
*/
|
|
858
|
-
onChangeText?: ?(text: string) => mixed,
|
|
859
|
-
|
|
860
|
-
/**
|
|
861
|
-
* Callback that is called when the text input's content size changes.
|
|
862
|
-
* This will be called with
|
|
863
|
-
* `{ nativeEvent: { contentSize: { width, height } } }`.
|
|
864
|
-
*
|
|
865
|
-
* Only called for multiline text inputs.
|
|
866
|
-
*/
|
|
867
|
-
onContentSizeChange?: ?(e: TextInputContentSizeChangeEvent) => mixed,
|
|
868
|
-
|
|
869
|
-
/**
|
|
870
|
-
* Callback that is called when text input ends.
|
|
871
|
-
*/
|
|
872
|
-
onEndEditing?: ?(e: TextInputEditingEvent) => mixed,
|
|
873
|
-
|
|
874
|
-
/**
|
|
875
|
-
* Callback that is called when the text input is focused.
|
|
876
|
-
*/
|
|
877
|
-
onFocus?: ?(e: TextInputFocusEvent) => mixed,
|
|
878
|
-
|
|
879
|
-
/**
|
|
880
|
-
* Callback that is called when a key is pressed.
|
|
881
|
-
* This will be called with `{ nativeEvent: { key: keyValue } }`
|
|
882
|
-
* where `keyValue` is `'Enter'` or `'Backspace'` for respective keys and
|
|
883
|
-
* the typed-in character otherwise including `' '` for space.
|
|
884
|
-
* Fires before `onChange` callbacks.
|
|
885
|
-
*/
|
|
886
|
-
onKeyPress?: ?(e: TextInputKeyPressEvent) => mixed,
|
|
887
|
-
|
|
888
|
-
/**
|
|
889
|
-
* Called when a single tap gesture is detected.
|
|
890
|
-
*/
|
|
891
|
-
onPress?: ?(event: GestureResponderEvent) => mixed,
|
|
892
|
-
|
|
893
|
-
/**
|
|
894
|
-
* Called when a touch is engaged.
|
|
895
|
-
*/
|
|
896
|
-
onPressIn?: ?(event: GestureResponderEvent) => mixed,
|
|
897
|
-
|
|
898
|
-
/**
|
|
899
|
-
* Called when a touch is released.
|
|
900
|
-
*/
|
|
901
|
-
onPressOut?: ?(event: GestureResponderEvent) => mixed,
|
|
902
|
-
|
|
903
|
-
/**
|
|
904
|
-
* Callback that is called when the text input selection is changed.
|
|
905
|
-
* This will be called with
|
|
906
|
-
* `{ nativeEvent: { selection: { start, end } } }`.
|
|
907
|
-
*/
|
|
908
|
-
onSelectionChange?: ?(e: TextInputSelectionChangeEvent) => mixed,
|
|
909
|
-
|
|
910
|
-
/**
|
|
911
|
-
* Callback that is called when the text input's submit button is pressed.
|
|
912
|
-
* Invalid if `multiline={true}` is specified.
|
|
913
|
-
*/
|
|
914
|
-
onSubmitEditing?: ?(e: TextInputEditingEvent) => mixed,
|
|
915
|
-
|
|
916
|
-
/**
|
|
917
|
-
* Invoked on content scroll with `{ nativeEvent: { contentOffset: { x, y } } }`.
|
|
918
|
-
* May also contain other properties from ScrollEvent but on Android contentSize
|
|
919
|
-
* is not provided for performance reasons.
|
|
920
|
-
*/
|
|
921
|
-
onScroll?: ?(e: ScrollEvent) => mixed,
|
|
922
|
-
|
|
923
|
-
/**
|
|
924
|
-
* The string that will be rendered before text input has been entered.
|
|
925
|
-
*/
|
|
926
|
-
placeholder?: ?Stringish,
|
|
927
|
-
|
|
928
|
-
/**
|
|
929
|
-
* The text color of the placeholder string.
|
|
930
|
-
*/
|
|
931
|
-
placeholderTextColor?: ?ColorValue,
|
|
932
|
-
|
|
933
|
-
/** `readOnly` works like the `readonly` attribute in HTML.
|
|
934
|
-
* If `true`, text is not editable. The default value is `false`.
|
|
935
|
-
* See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly
|
|
936
|
-
* for more details.
|
|
937
|
-
*/
|
|
938
|
-
readOnly?: ?boolean,
|
|
939
|
-
|
|
940
|
-
/**
|
|
941
|
-
* Determines how the return key should look. On Android you can also use
|
|
942
|
-
* `returnKeyLabel`.
|
|
943
|
-
*
|
|
944
|
-
* *Cross platform*
|
|
945
|
-
*
|
|
946
|
-
* The following values work across platforms:
|
|
947
|
-
*
|
|
948
|
-
* - `done`
|
|
949
|
-
* - `go`
|
|
950
|
-
* - `next`
|
|
951
|
-
* - `search`
|
|
952
|
-
* - `send`
|
|
953
|
-
*
|
|
954
|
-
* *Android Only*
|
|
955
|
-
*
|
|
956
|
-
* The following values work on Android only:
|
|
957
|
-
*
|
|
958
|
-
* - `none`
|
|
959
|
-
* - `previous`
|
|
960
|
-
*
|
|
961
|
-
* *iOS Only*
|
|
962
|
-
*
|
|
963
|
-
* The following values work on iOS only:
|
|
964
|
-
*
|
|
965
|
-
* - `default`
|
|
966
|
-
* - `emergency-call`
|
|
967
|
-
* - `google`
|
|
968
|
-
* - `join`
|
|
969
|
-
* - `route`
|
|
970
|
-
* - `yahoo`
|
|
971
|
-
*/
|
|
972
|
-
returnKeyType?: ?ReturnKeyTypeOptions,
|
|
973
|
-
|
|
974
|
-
/**
|
|
975
|
-
* If `true`, the text input obscures the text entered so that sensitive text
|
|
976
|
-
* like passwords stay secure. The default value is `false`. Does not work with 'multiline={true}'.
|
|
977
|
-
*/
|
|
978
|
-
secureTextEntry?: ?boolean,
|
|
979
|
-
|
|
980
|
-
/**
|
|
981
|
-
* The start and end of the text input's selection. Set start and end to
|
|
982
|
-
* the same value to position the cursor.
|
|
983
|
-
*/
|
|
984
|
-
selection?: ?$ReadOnly<{
|
|
985
|
-
start: number,
|
|
986
|
-
end?: ?number,
|
|
987
|
-
}>,
|
|
988
|
-
|
|
989
|
-
/**
|
|
990
|
-
* The highlight and cursor color of the text input.
|
|
991
|
-
*/
|
|
992
|
-
selectionColor?: ?ColorValue,
|
|
993
|
-
|
|
994
|
-
/**
|
|
995
|
-
* The text selection handle color.
|
|
996
|
-
* @platform android
|
|
997
|
-
*/
|
|
998
|
-
selectionHandleColor?: ?ColorValue,
|
|
999
|
-
|
|
1000
|
-
/**
|
|
1001
|
-
* If `true`, all text will automatically be selected on focus.
|
|
1002
|
-
*/
|
|
1003
|
-
selectTextOnFocus?: ?boolean,
|
|
101
|
+
export type {
|
|
102
|
+
AutoCapitalize,
|
|
103
|
+
EnterKeyHintType,
|
|
104
|
+
EnterKeyHintTypeAndroid,
|
|
105
|
+
EnterKeyHintTypeIOS,
|
|
106
|
+
EnterKeyHintTypeOptions,
|
|
107
|
+
InputModeOptions,
|
|
108
|
+
KeyboardType,
|
|
109
|
+
KeyboardTypeAndroid,
|
|
110
|
+
KeyboardTypeIOS,
|
|
111
|
+
KeyboardTypeOptions,
|
|
112
|
+
ReturnKeyType,
|
|
113
|
+
ReturnKeyTypeAndroid,
|
|
114
|
+
ReturnKeyTypeIOS,
|
|
115
|
+
ReturnKeyTypeOptions,
|
|
116
|
+
SubmitBehavior,
|
|
117
|
+
TextContentType,
|
|
118
|
+
TextInputAndroidProps,
|
|
119
|
+
TextInputBlurEvent,
|
|
120
|
+
TextInputChangeEvent,
|
|
121
|
+
TextInputContentSizeChangeEvent,
|
|
122
|
+
TextInputEditingEvent,
|
|
123
|
+
TextInputEndEditingEvent,
|
|
124
|
+
TextInputEvent,
|
|
125
|
+
TextInputFocusEvent,
|
|
126
|
+
TextInputIOSProps,
|
|
127
|
+
TextInputKeyPressEvent,
|
|
128
|
+
TextInputProps,
|
|
129
|
+
TextInputSelectionChangeEvent,
|
|
130
|
+
TextInputSubmitEditingEvent,
|
|
131
|
+
TextInputWindowsProps, // [Windows]
|
|
132
|
+
};
|
|
1004
133
|
|
|
134
|
+
type TextInputStateType = $ReadOnly<{
|
|
1005
135
|
/**
|
|
1006
|
-
*
|
|
1007
|
-
*
|
|
1008
|
-
*
|
|
1009
|
-
* to `true` means that pressing return will blur the field and trigger the
|
|
1010
|
-
* `onSubmitEditing` event instead of inserting a newline into the field.
|
|
1011
|
-
*
|
|
1012
|
-
* @deprecated
|
|
1013
|
-
* Note that `submitBehavior` now takes the place of `blurOnSubmit` and will
|
|
1014
|
-
* override any behavior defined by `blurOnSubmit`.
|
|
1015
|
-
* @see submitBehavior
|
|
136
|
+
* @deprecated Use currentlyFocusedInput
|
|
137
|
+
* Returns the ID of the currently focused text field, if one exists
|
|
138
|
+
* If no text field is focused it returns null
|
|
1016
139
|
*/
|
|
1017
|
-
|
|
140
|
+
currentlyFocusedField: () => ?number,
|
|
1018
141
|
|
|
1019
142
|
/**
|
|
1020
|
-
*
|
|
1021
|
-
*
|
|
1022
|
-
* For single line inputs:
|
|
1023
|
-
*
|
|
1024
|
-
* - `'newline`' defaults to `'blurAndSubmit'`
|
|
1025
|
-
* - `undefined` defaults to `'blurAndSubmit'`
|
|
1026
|
-
*
|
|
1027
|
-
* For multiline inputs:
|
|
1028
|
-
*
|
|
1029
|
-
* - `'newline'` adds a newline
|
|
1030
|
-
* - `undefined` defaults to `'newline'`
|
|
1031
|
-
*
|
|
1032
|
-
* For both single line and multiline inputs:
|
|
1033
|
-
*
|
|
1034
|
-
* - `'submit'` will only send a submit event and not blur the input
|
|
1035
|
-
* - `'blurAndSubmit`' will both blur the input and send a submit event
|
|
143
|
+
* Returns the ref of the currently focused text field, if one exists
|
|
144
|
+
* If no text field is focused it returns null
|
|
1036
145
|
*/
|
|
1037
|
-
|
|
146
|
+
currentlyFocusedInput: () => ?HostInstance,
|
|
1038
147
|
|
|
1039
148
|
/**
|
|
1040
|
-
*
|
|
1041
|
-
*
|
|
1042
|
-
*
|
|
1043
|
-
* - `borderTopWidth`
|
|
1044
|
-
* - `borderRightWidth`
|
|
1045
|
-
* - `borderBottomWidth`
|
|
1046
|
-
* - `borderTopLeftRadius`
|
|
1047
|
-
* - `borderTopRightRadius`
|
|
1048
|
-
* - `borderBottomRightRadius`
|
|
1049
|
-
* - `borderBottomLeftRadius`
|
|
1050
|
-
*
|
|
1051
|
-
* see [Issue#7070](https://github.com/facebook/react-native/issues/7070)
|
|
1052
|
-
* for more detail.
|
|
1053
|
-
*
|
|
1054
|
-
* [Styles](docs/style.html)
|
|
149
|
+
* @param textField ref of the text field to focus
|
|
150
|
+
* Focuses the specified text field
|
|
151
|
+
* noop if the text field was already focused
|
|
1055
152
|
*/
|
|
1056
|
-
|
|
153
|
+
focusTextInput: (textField: ?HostInstance) => void,
|
|
1057
154
|
|
|
1058
155
|
/**
|
|
1059
|
-
*
|
|
1060
|
-
*
|
|
1061
|
-
*
|
|
1062
|
-
* cases this may cause flickering - one common cause is preventing edits
|
|
1063
|
-
* by keeping value the same. In addition to simply setting the same value,
|
|
1064
|
-
* either set `editable={false}`, or set/update `maxLength` to prevent
|
|
1065
|
-
* unwanted edits without flicker.
|
|
156
|
+
* @param textField ref of the text field to focus
|
|
157
|
+
* Unfocuses the specified text field
|
|
158
|
+
* noop if it wasn't focused
|
|
1066
159
|
*/
|
|
1067
|
-
|
|
160
|
+
blurTextInput: (textField: ?HostInstance) => void,
|
|
1068
161
|
}>;
|
|
1069
162
|
|
|
1070
163
|
type ViewCommands = $NonMaybeType<
|
|
@@ -1085,7 +178,7 @@ const emptyFunctionThatReturnsTrue = () => true;
|
|
|
1085
178
|
* in native and in JavaScript. This is necessary due to the asynchronous nature
|
|
1086
179
|
* of text input events.
|
|
1087
180
|
*/
|
|
1088
|
-
function
|
|
181
|
+
function useTextInputStateSynchronization({
|
|
1089
182
|
props,
|
|
1090
183
|
mostRecentEventCount,
|
|
1091
184
|
selection,
|
|
@@ -1161,94 +254,6 @@ function useTextInputStateSynchronization_STATE({
|
|
|
1161
254
|
return {setLastNativeText, setLastNativeSelection};
|
|
1162
255
|
}
|
|
1163
256
|
|
|
1164
|
-
/**
|
|
1165
|
-
* This hook handles the synchronization between the state of the text input
|
|
1166
|
-
* in native and in JavaScript. This is necessary due to the asynchronous nature
|
|
1167
|
-
* of text input events.
|
|
1168
|
-
*/
|
|
1169
|
-
function useTextInputStateSynchronization_REFS({
|
|
1170
|
-
props,
|
|
1171
|
-
mostRecentEventCount,
|
|
1172
|
-
selection,
|
|
1173
|
-
inputRef,
|
|
1174
|
-
text,
|
|
1175
|
-
viewCommands,
|
|
1176
|
-
}: {
|
|
1177
|
-
props: TextInputProps,
|
|
1178
|
-
mostRecentEventCount: number,
|
|
1179
|
-
selection: ?Selection,
|
|
1180
|
-
inputRef: React.RefObject<null | TextInputInstance>,
|
|
1181
|
-
text?: string,
|
|
1182
|
-
viewCommands: ViewCommands,
|
|
1183
|
-
}): {
|
|
1184
|
-
setLastNativeText: string => void,
|
|
1185
|
-
setLastNativeSelection: LastNativeSelection => void,
|
|
1186
|
-
} {
|
|
1187
|
-
const lastNativeTextRef = useRef<?Stringish>(props.value);
|
|
1188
|
-
const lastNativeSelectionRef = useRef<LastNativeSelection>({
|
|
1189
|
-
selection: {start: -1, end: -1},
|
|
1190
|
-
mostRecentEventCount: mostRecentEventCount,
|
|
1191
|
-
});
|
|
1192
|
-
|
|
1193
|
-
// This is necessary in case native updates the text and JS decides
|
|
1194
|
-
// that the update should be ignored and we should stick with the value
|
|
1195
|
-
// that we have in JS.
|
|
1196
|
-
useLayoutEffect(() => {
|
|
1197
|
-
const nativeUpdate: {text?: string, selection?: Selection} = {};
|
|
1198
|
-
|
|
1199
|
-
const lastNativeSelection = lastNativeSelectionRef.current.selection;
|
|
1200
|
-
|
|
1201
|
-
if (
|
|
1202
|
-
lastNativeTextRef.current !== props.value &&
|
|
1203
|
-
typeof props.value === 'string'
|
|
1204
|
-
) {
|
|
1205
|
-
nativeUpdate.text = props.value;
|
|
1206
|
-
lastNativeTextRef.current = props.value;
|
|
1207
|
-
}
|
|
1208
|
-
|
|
1209
|
-
if (
|
|
1210
|
-
selection &&
|
|
1211
|
-
lastNativeSelection &&
|
|
1212
|
-
(lastNativeSelection.start !== selection.start ||
|
|
1213
|
-
lastNativeSelection.end !== selection.end)
|
|
1214
|
-
) {
|
|
1215
|
-
nativeUpdate.selection = selection;
|
|
1216
|
-
lastNativeSelectionRef.current = {selection, mostRecentEventCount};
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
if (Object.keys(nativeUpdate).length === 0) {
|
|
1220
|
-
return;
|
|
1221
|
-
}
|
|
1222
|
-
|
|
1223
|
-
if (inputRef.current != null) {
|
|
1224
|
-
viewCommands.setTextAndSelection(
|
|
1225
|
-
inputRef.current,
|
|
1226
|
-
mostRecentEventCount,
|
|
1227
|
-
text,
|
|
1228
|
-
selection?.start ?? -1,
|
|
1229
|
-
selection?.end ?? -1,
|
|
1230
|
-
);
|
|
1231
|
-
}
|
|
1232
|
-
}, [
|
|
1233
|
-
mostRecentEventCount,
|
|
1234
|
-
inputRef,
|
|
1235
|
-
props.value,
|
|
1236
|
-
props.defaultValue,
|
|
1237
|
-
selection,
|
|
1238
|
-
text,
|
|
1239
|
-
viewCommands,
|
|
1240
|
-
]);
|
|
1241
|
-
|
|
1242
|
-
return {
|
|
1243
|
-
setLastNativeText: lastNativeText => {
|
|
1244
|
-
lastNativeTextRef.current = lastNativeText;
|
|
1245
|
-
},
|
|
1246
|
-
setLastNativeSelection: lastNativeSelection => {
|
|
1247
|
-
lastNativeSelectionRef.current = lastNativeSelection;
|
|
1248
|
-
},
|
|
1249
|
-
};
|
|
1250
|
-
}
|
|
1251
|
-
|
|
1252
257
|
/**
|
|
1253
258
|
* A foundational component for inputting text into the app via a
|
|
1254
259
|
* keyboard. Props provide configurability for several features, such as
|
|
@@ -1370,6 +375,12 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
1370
375
|
'aria-readonly': ariaReadOnly, // Windows
|
|
1371
376
|
'aria-multiselectable': ariaMultiselectable, // Windows
|
|
1372
377
|
'aria-required': ariaRequired, // Windows
|
|
378
|
+
'aria-level': ariaLevel, // Windows
|
|
379
|
+
'aria-posinset': ariaPosinset, // Windows
|
|
380
|
+
'aria-setsize': ariaSetsize, // Windows
|
|
381
|
+
accessibilityLevel, // Windows
|
|
382
|
+
accessibilityPosInSet, // Windows
|
|
383
|
+
accessibilitySetSize, // Windows
|
|
1373
384
|
accessibilityState,
|
|
1374
385
|
id,
|
|
1375
386
|
tabIndex,
|
|
@@ -1405,10 +416,6 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
1405
416
|
: RCTSinglelineTextInputNativeCommands);
|
|
1406
417
|
|
|
1407
418
|
const [mostRecentEventCount, setMostRecentEventCount] = useState<number>(0);
|
|
1408
|
-
const useTextInputStateSynchronization =
|
|
1409
|
-
ReactNativeFeatureFlags.useRefsForTextInputState()
|
|
1410
|
-
? useTextInputStateSynchronization_REFS
|
|
1411
|
-
: useTextInputStateSynchronization_STATE;
|
|
1412
419
|
const {setLastNativeText, setLastNativeSelection} =
|
|
1413
420
|
useTextInputStateSynchronization({
|
|
1414
421
|
props,
|
|
@@ -1693,6 +700,10 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
1693
700
|
props.onKeyUpCapture && props.onKeyUpCapture(event);
|
|
1694
701
|
};
|
|
1695
702
|
|
|
703
|
+
const _accessibilityLevel = ariaLevel ?? accessibilityLevel; // Windows
|
|
704
|
+
const _accessibilityPosInSet = ariaPosinset ?? accessibilityPosInSet; // Windows
|
|
705
|
+
const _accessibilitySetSize = ariaSetsize ?? accessibilitySetSize; // Windows
|
|
706
|
+
|
|
1696
707
|
let _accessibilityState;
|
|
1697
708
|
if (
|
|
1698
709
|
accessibilityState != null ||
|
|
@@ -1762,6 +773,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
1762
773
|
ref={(ref: $FlowFixMe)}
|
|
1763
774
|
{...otherProps}
|
|
1764
775
|
{...eventHandlers}
|
|
776
|
+
acceptDragAndDropTypes={props.experimental_acceptDragAndDropTypes}
|
|
1765
777
|
accessibilityErrorMessage={accessibilityErrorMessage}
|
|
1766
778
|
accessibilityState={_accessibilityState}
|
|
1767
779
|
accessible={accessible}
|
|
@@ -1830,6 +842,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
1830
842
|
accessibilityState={_accessibilityState}
|
|
1831
843
|
accessibilityLabelledBy={_accessibilityLabelledBy}
|
|
1832
844
|
accessible={accessible}
|
|
845
|
+
acceptDragAndDropTypes={props.experimental_acceptDragAndDropTypes}
|
|
1833
846
|
autoCapitalize={autoCapitalize}
|
|
1834
847
|
submitBehavior={submitBehavior}
|
|
1835
848
|
caretHidden={caretHidden}
|
|
@@ -1877,6 +890,10 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
1877
890
|
mostRecentEventCount={mostRecentEventCount}
|
|
1878
891
|
onBlur={_onBlur}
|
|
1879
892
|
onChange={_onChange}
|
|
893
|
+
accessibilityState={_accessibilityState}
|
|
894
|
+
accessibilityLevel={_accessibilityLevel}
|
|
895
|
+
accessibilityPosInSet={_accessibilityPosInSet}
|
|
896
|
+
accessibilitySetSize={_accessibilitySetSize}
|
|
1880
897
|
/* $FlowFixMe[incompatible-type] the types for WindowsTextInput
|
|
1881
898
|
* don't match up exactly with the props for TextInput. This will need
|
|
1882
899
|
* to get fixed */
|
|
@@ -2000,7 +1017,7 @@ const autoCompleteWebToTextContentTypeMap = {
|
|
|
2000
1017
|
};
|
|
2001
1018
|
|
|
2002
1019
|
const ExportedForwardRef: component(
|
|
2003
|
-
ref
|
|
1020
|
+
ref?: React.RefSetter<TextInputInstance>,
|
|
2004
1021
|
...props: React.ElementConfig<typeof InternalTextInput>
|
|
2005
1022
|
) = React.forwardRef(function TextInput(
|
|
2006
1023
|
{
|
|
@@ -2071,12 +1088,7 @@ ExportedForwardRef.State = {
|
|
|
2071
1088
|
};
|
|
2072
1089
|
|
|
2073
1090
|
export type TextInputComponentStatics = $ReadOnly<{
|
|
2074
|
-
State:
|
|
2075
|
-
currentlyFocusedInput: typeof TextInputState.currentlyFocusedInput,
|
|
2076
|
-
currentlyFocusedField: typeof TextInputState.currentlyFocusedField,
|
|
2077
|
-
focusTextInput: typeof TextInputState.focusTextInput,
|
|
2078
|
-
blurTextInput: typeof TextInputState.blurTextInput,
|
|
2079
|
-
}>,
|
|
1091
|
+
State: TextInputStateType,
|
|
2080
1092
|
}>;
|
|
2081
1093
|
|
|
2082
1094
|
const styles = StyleSheet.create({
|