react-native-tvos 0.84.1-0 → 0.85.0-0
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/Libraries/ActionSheetIOS/ActionSheetIOS.js +3 -3
- package/Libraries/Animated/Animated.d.ts +8 -1
- package/Libraries/Animated/AnimatedEvent.js +4 -4
- package/Libraries/Animated/AnimatedImplementation.js +2 -2
- package/Libraries/Animated/animations/Animation.js +3 -3
- package/Libraries/Animated/animations/DecayAnimation.js +4 -4
- package/Libraries/Animated/animations/SpringAnimation.js +5 -5
- package/Libraries/Animated/animations/TimingAnimation.js +5 -5
- package/Libraries/Animated/createAnimatedComponent.js +7 -7
- package/Libraries/Animated/nodes/AnimatedColor.js +2 -2
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +12 -12
- package/Libraries/Animated/nodes/AnimatedNode.js +3 -3
- package/Libraries/Animated/nodes/AnimatedObject.js +3 -3
- package/Libraries/Animated/nodes/AnimatedProps.js +6 -6
- package/Libraries/Animated/nodes/AnimatedStyle.js +7 -7
- package/Libraries/Animated/nodes/AnimatedTransform.js +13 -13
- package/Libraries/Animated/nodes/AnimatedValue.js +1 -1
- package/Libraries/Animated/nodes/AnimatedValueXY.js +1 -1
- package/Libraries/Animated/nodes/AnimatedWithChildren.js +1 -1
- package/{jest/mocks/Vibration.js → Libraries/Animated/useAnimatedColor.d.ts} +5 -6
- package/Libraries/Animated/useAnimatedColor.js +25 -0
- package/{jest/mocks/Clipboard.js → Libraries/Animated/useAnimatedValueXY.d.ts} +5 -6
- package/Libraries/Animated/useAnimatedValueXY.js +26 -0
- package/Libraries/AppDelegate/RCTAppDelegate.mm +0 -8
- package/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm +1 -3
- package/Libraries/AppDelegate/RCTReactNativeFactory.mm +1 -0
- package/Libraries/AppDelegate/RCTRootViewFactory.mm +2 -6
- package/Libraries/AppState/AppState.js +1 -1
- package/Libraries/BatchedBridge/MessageQueue.js +3 -3
- package/Libraries/BatchedBridge/NativeModules.js +12 -10
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +30 -26
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +2 -2
- package/Libraries/Components/Button.js +2 -2
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.js +2 -2
- package/Libraries/Components/Keyboard/Keyboard.js +6 -6
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +1 -1
- package/Libraries/Components/LayoutConformance/LayoutConformance.js +1 -1
- package/Libraries/Components/LayoutConformance/LayoutConformanceNativeComponent.js +1 -1
- package/Libraries/Components/Pressable/Pressable.d.ts +5 -0
- package/Libraries/Components/Pressable/Pressable.js +3 -3
- package/Libraries/Components/Pressable/useAndroidRippleForView.js +4 -4
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +1 -1
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +3 -3
- package/Libraries/Components/RefreshControl/RefreshControl.js +5 -5
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +10 -12
- package/Libraries/Components/ScrollView/ScrollView.d.ts +18 -1
- package/Libraries/Components/ScrollView/ScrollView.js +33 -10
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +12 -18
- package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +7 -4
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
- package/Libraries/Components/StaticRenderer.js +1 -1
- package/Libraries/Components/StatusBar/StatusBar.js +8 -8
- package/Libraries/Components/Switch/Switch.js +3 -3
- package/Libraries/Components/TV/TVViewPropTypes.js +7 -0
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +33 -48
- package/Libraries/Components/TextInput/InputAccessoryView.js +1 -1
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +6 -11
- package/Libraries/Components/TextInput/TextInput.flow.js +21 -20
- package/Libraries/Components/TextInput/TextInput.js +8 -4
- package/Libraries/Components/Touchable/PooledClass.js +1 -1
- package/Libraries/Components/Touchable/Touchable.js +2 -2
- package/Libraries/Components/Touchable/TouchableBounce.js +4 -4
- package/Libraries/Components/Touchable/TouchableHighlight.js +6 -6
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +7 -7
- package/Libraries/Components/Touchable/TouchableOpacity.js +3 -3
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +1 -1
- package/Libraries/Components/UnimplementedViews/UnimplementedView.js +1 -1
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +68 -31
- package/Libraries/Components/View/View.js +6 -0
- package/Libraries/Components/View/ViewAccessibility.js +7 -7
- package/Libraries/Components/View/ViewPropTypes.js +15 -15
- package/Libraries/Core/Devtools/parseHermesStack.js +8 -8
- package/Libraries/Core/Devtools/symbolicateStackTrace.js +2 -2
- package/Libraries/Core/ExceptionsManager.js +2 -2
- package/Libraries/Core/ExtendedError.js +3 -3
- package/Libraries/Core/RawEventEmitter.js +1 -1
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Core/Timers/JSTimers.js +3 -2
- package/Libraries/Core/setUpDeveloperTools.js +1 -1
- package/Libraries/Core/setUpErrorHandling.js +4 -2
- package/Libraries/Core/setUpReactDevTools.js +23 -6
- package/Libraries/Core/setUpSegmentFetcher.js +1 -1
- package/Libraries/Debugging/DebuggingOverlay.js +2 -2
- package/Libraries/EventEmitter/NativeEventEmitter.js +7 -9
- package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +1 -1
- package/Libraries/FBLazyVector/FBLazyVector/FBLazyIterator.h +0 -6
- package/Libraries/Image/AssetSourceResolver.js +1 -1
- package/Libraries/Image/Image.android.js +172 -306
- package/Libraries/Image/ImageProps.js +9 -11
- package/Libraries/Image/ImageSource.js +2 -2
- package/Libraries/Image/ImageSourceUtils.js +8 -4
- package/Libraries/Image/ImageTypes.flow.js +2 -2
- package/Libraries/Image/ImageViewNativeComponent.js +7 -16
- package/Libraries/Image/RCTImageUtils.mm +37 -1
- package/Libraries/Image/nativeImageSource.js +1 -1
- package/Libraries/Interaction/InteractionManager.js +5 -4
- package/Libraries/Interaction/PanResponder.js +1 -1
- package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -2
- package/Libraries/Linking/Linking.js +1 -1
- package/Libraries/Lists/FlatList.js +3 -3
- package/Libraries/Lists/SectionList.js +1 -1
- package/Libraries/Lists/SectionListModern.js +2 -2
- package/Libraries/LogBox/Data/LogBoxData.js +38 -24
- package/Libraries/LogBox/Data/LogBoxLog.js +43 -112
- package/Libraries/LogBox/Data/parseLogBoxLog.js +21 -117
- package/Libraries/LogBox/LogBox.js +42 -19
- package/Libraries/LogBox/LogBoxInspectorContainer.js +2 -2
- package/Libraries/LogBox/LogBoxNotificationContainer.js +2 -2
- package/Libraries/LogBox/UI/LogBoxButton.js +28 -30
- package/Libraries/LogBox/UI/LogBoxInspector.js +2 -2
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +6 -9
- package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorFooterButton.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorHeaderButton.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorMessageHeader.js +10 -15
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +25 -18
- package/Libraries/LogBox/UI/LogBoxInspectorSection.js +5 -7
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +8 -10
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +8 -6
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +17 -29
- package/Libraries/LogBox/UI/LogBoxMessage.js +28 -37
- package/Libraries/LogBox/UI/LogBoxNotification.js +1 -1
- package/Libraries/Modal/Modal.js +3 -3
- package/Libraries/NativeComponent/BaseViewConfig.android.js +28 -52
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +19 -21
- package/Libraries/NativeComponent/TVViewConfig.js +1 -0
- package/Libraries/Network/RCTHTTPRequestHandler.h +9 -0
- package/Libraries/Network/RCTHTTPRequestHandler.mm +15 -1
- package/Libraries/Network/RCTNetworking.android.js +1 -1
- package/Libraries/Network/RCTNetworking.ios.js +1 -1
- package/Libraries/Network/RCTNetworking.js.flow +1 -1
- package/Libraries/Network/RCTNetworkingEventDefinitions.flow.js +1 -1
- package/Libraries/Network/XMLHttpRequest.js +1 -1
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +3 -3
- package/Libraries/Pressability/Pressability.js +12 -5
- package/Libraries/Pressability/PressabilityDebug.js +1 -1
- package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +1 -1
- package/Libraries/Pressability/usePressability.js +3 -14
- package/Libraries/PushNotificationIOS/PushNotificationIOS.js +2 -2
- package/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm +11 -21
- package/Libraries/ReactNative/AppContainer-dev.js +18 -1
- package/Libraries/ReactNative/AppContainer.js +1 -1
- package/Libraries/ReactNative/AppRegistry.flow.js +2 -2
- package/Libraries/ReactNative/AppRegistryImpl.js +2 -2
- package/Libraries/ReactNative/FabricUIManager.js +1 -1
- package/Libraries/ReactNative/RendererImplementation.js +4 -4
- package/Libraries/ReactNative/UIManagerProperties.js +1 -1
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +3 -2
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +3 -2
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +3 -2
- package/Libraries/Renderer/shims/ReactFabric.js +1 -3
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +1 -3
- package/Libraries/Renderer/shims/ReactNative.js +3 -2
- package/Libraries/Renderer/shims/ReactNativeTypes.js +1 -3
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +1 -3
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +1 -3
- package/Libraries/StyleSheet/PointPropType.js +1 -1
- package/Libraries/StyleSheet/Rect.js +1 -1
- package/Libraries/StyleSheet/StyleSheet.d.ts +0 -5
- package/Libraries/StyleSheet/StyleSheet.js +1 -1
- package/Libraries/StyleSheet/StyleSheet.js.flow +1 -1
- package/Libraries/StyleSheet/StyleSheetExports.js +16 -25
- package/Libraries/StyleSheet/StyleSheetExports.js.flow +2 -7
- package/Libraries/StyleSheet/StyleSheetTypes.js +33 -36
- package/Libraries/StyleSheet/private/_StyleSheetTypesOverrides.js +5 -5
- package/Libraries/StyleSheet/private/_TransformStyle.js +7 -7
- package/Libraries/StyleSheet/processBackgroundImage.js +7 -7
- package/Libraries/StyleSheet/processBackgroundPosition.js +4 -4
- package/Libraries/StyleSheet/processBackgroundRepeat.js +4 -4
- package/Libraries/StyleSheet/processBackgroundSize.js +4 -4
- package/Libraries/StyleSheet/processBoxShadow.js +44 -4
- package/Libraries/StyleSheet/processColorArray.js +2 -2
- package/Libraries/StyleSheet/processFilter.js +2 -2
- package/Libraries/Text/Text/RCTDynamicTypeRamp.mm +5 -4
- package/Libraries/Text/Text.js +295 -627
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.mm +7 -1
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.mm +14 -12
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.mm +1 -1
- package/Libraries/Text/TextNativeComponent.js +14 -7
- package/Libraries/Text/TextProps.js +4 -4
- package/Libraries/Types/CodegenTypes.js +1 -1
- package/Libraries/Types/CoreEventTypes.js +21 -21
- package/Libraries/Types/ReactDevToolsTypes.js +2 -2
- package/Libraries/Utilities/Appearance.js +6 -1
- package/Libraries/Utilities/Dimensions.js +1 -1
- package/Libraries/Utilities/HMRClient.js +4 -4
- package/Libraries/Utilities/IPerformanceLogger.js +4 -4
- package/Libraries/Utilities/codegenNativeCommands.js +4 -4
- package/Libraries/Utilities/codegenNativeComponent.d.ts +2 -0
- package/Libraries/Utilities/codegenNativeComponent.js +2 -2
- package/Libraries/Utilities/logError.js +1 -1
- package/Libraries/Utilities/stringifySafe.js +3 -3
- package/Libraries/Utilities/useMergeRefs.js +2 -2
- package/Libraries/WebSocket/RCTReconnectingWebSocket.m +4 -1
- package/Libraries/vendor/core/ErrorUtils.js +4 -4
- package/Libraries/vendor/emitter/EventEmitter.js +16 -20
- package/README.md +52 -0
- package/React/Base/RCTBridge.mm +1 -1
- package/React/Base/RCTBundleURLProvider.mm +29 -8
- package/React/Base/RCTConvert.mm +3 -18
- package/React/Base/RCTDefines.h +7 -8
- package/React/Base/RCTDevSupportHttpHeaders.h +24 -0
- package/React/Base/RCTDevSupportHttpHeaders.m +65 -0
- package/React/Base/RCTJavaScriptLoader.h +1 -0
- package/React/Base/RCTJavaScriptLoader.mm +6 -2
- package/React/Base/RCTMultipartDataTask.h +9 -0
- package/React/Base/RCTMultipartDataTask.m +19 -1
- package/React/Base/RCTTVColorSupport.h +17 -0
- package/React/Base/RCTTVColorSupport.mm +23 -0
- package/React/Base/RCTUtils.mm +15 -6
- package/React/Base/RCTVersion.m +2 -2
- package/React/CoreModules/RCTActionSheetManager.mm +28 -3
- package/React/CoreModules/RCTClipboard.mm +5 -5
- package/React/CoreModules/RCTDevLoadingView.mm +1 -1
- package/React/CoreModules/RCTDevSettings.mm +8 -0
- package/React/CoreModules/RCTDeviceInfo.mm +4 -3
- package/React/CoreModules/RCTKeyboardObserver.mm +9 -2
- package/React/CoreModules/RCTLogBoxView.mm +4 -8
- package/React/CoreModules/RCTPerfMonitor.mm +5 -0
- package/React/CoreModules/RCTStatusBarManager.h +2 -0
- package/React/CoreModules/RCTWebSocketModule.h +6 -0
- package/React/CoreModules/RCTWebSocketModule.mm +14 -1
- package/React/DevSupport/RCTInspectorDevServerHelper.mm +33 -22
- package/React/DevSupport/RCTInspectorNetworkHelper.mm +2 -0
- package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +66 -79
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/Props.cpp +8 -8
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/Props.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm +2 -2
- package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm +4 -0
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm +6 -0
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +8 -4
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +2 -0
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +81 -0
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +16 -4
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +145 -8
- package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm +10 -5
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +13 -0
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +9 -13
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h +2 -0
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +2 -0
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h +2 -0
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +42 -4
- package/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.h +2 -1
- package/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.mm +92 -163
- package/React/Fabric/Mounting/RCTMountingManager.mm +8 -3
- package/React/Fabric/RCTScheduler.h +2 -0
- package/React/Fabric/RCTScheduler.mm +57 -0
- package/React/Fabric/RCTSurfacePointerHandler.mm +15 -9
- package/React/Fabric/RCTSurfacePresenter.mm +9 -0
- package/React/Fabric/RCTSurfaceTouchHandler.mm +4 -2
- package/React/Fabric/Surface/RCTFabricSurface.mm +4 -0
- package/React/Fabric/Utils/RCTLinearGradient.mm +4 -9
- package/React/Inspector/RCTCxxInspectorWebSocketAdapter.mm +5 -1
- package/React/Modules/RCTLayoutAnimation.m +10 -0
- package/React/Modules/RCTUIManager.mm +2 -4
- package/React/Profiler/RCTProfile.m +2 -0
- package/React/React-RCTFabric.podspec +3 -0
- package/React/Views/RCTView.m +6 -1
- package/React/Views/ScrollView/RCTScrollViewManager.m +1 -0
- package/React-Core-prebuilt.podspec +1 -1
- package/ReactAndroid/api/ReactAndroid.api +120 -298
- package/ReactAndroid/build.gradle.kts +9 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +11 -101
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +10 -10
- package/ReactAndroid/src/main/java/com/facebook/react/animated/AnimationDriver.kt +1 -3
- package/ReactAndroid/src/main/java/com/facebook/react/animated/ColorAnimatedNode.kt +11 -11
- package/ReactAndroid/src/main/java/com/facebook/react/animated/DiffClampAnimatedNode.kt +11 -11
- package/ReactAndroid/src/main/java/com/facebook/react/animated/EventAnimationDriver.kt +0 -26
- package/ReactAndroid/src/main/java/com/facebook/react/animated/InterpolationAnimatedNode.kt +12 -0
- package/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.kt +11 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.kt +5 -5
- package/ReactAndroid/src/main/java/com/facebook/react/animated/PropsAnimatedNode.kt +5 -5
- package/ReactAndroid/src/main/java/com/facebook/react/animated/SpringAnimation.kt +19 -19
- package/ReactAndroid/src/main/java/com/facebook/react/animated/TrackingAnimatedNode.kt +5 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/DynamicFromArray.kt +9 -4
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaMethodWrapper.kt +15 -15
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaOnlyMap.kt +8 -6
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModuleRegistry.kt +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +10 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ScrollEndedListener.kt +70 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/assets/ReactFontManager.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/ReadableMapBuffer.kt +4 -4
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHost.kt +36 -34
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/BundleDownloader.kt +14 -9
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/CxxInspectorPackagerConnection.kt +2 -8
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DefaultDevLoadingViewImplementation.kt +3 -2
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.kt +17 -13
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.kt +5 -5
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/PackagerStatusCheck.kt +10 -19
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/RedBoxContentView.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/DevSupportHttpClient.kt +74 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/FrameTimingSequence.kt +2 -3
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/FrameTimingsObserver.kt +110 -80
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/InspectorNetworkHelper.kt +1 -12
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevBundleDownloadListener.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevLoadingViewManager.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/AnimationBackendChoreographer.kt +87 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +36 -7
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManagerBinding.kt +16 -2
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManagerProviderImpl.kt +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/LongStreamingStats.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/SurfaceHandlerBinding.kt +6 -6
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/events/EventBeatManager.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/events/FabricEventEmitter.kt +0 -29
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.kt +2 -8
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.kt +1258 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/FabricNameComponentMapping.kt +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/IntBufferBatchMountItem.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/MountItemFactory.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/PreAllocateViewMountItem.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +37 -55
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +66 -96
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +14 -20
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +15 -21
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +74 -107
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Experimental_Android.kt +5 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +14 -20
- package/ReactAndroid/src/main/java/com/facebook/react/internal/interop/InteropEventEmitter.kt +1 -15
- package/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleManager.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/accessibilityinfo/AccessibilityInfoModule.kt +4 -10
- package/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobModule.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.kt +4 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/I18nManagerModule.kt +4 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkEventUtil.kt +45 -74
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.kt +17 -13
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/ProgressRequestBody.kt +2 -5
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoHelpers.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.kt +3 -4
- package/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/JSPackagerClient.kt +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/ReconnectingWebSocket.kt +2 -8
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessAtomicRef.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessCatalystInstance.kt +9 -3
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessReactContext.kt +8 -8
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.kt +12 -12
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostInspectorTarget.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactInstance.kt +13 -7
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactSurfaceView.kt +14 -14
- package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.kt +14 -6
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BackgroundStyleApplicator.kt +42 -28
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +8 -49
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/DisplayMetricsHolder.kt +11 -8
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/GuardedFrameCallback.kt +17 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.java +13 -8
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutShadowNode.kt +751 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +104 -781
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyOptimizer.kt +18 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java +7 -9
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java +7 -31
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactZIndexedViewGroup.kt +11 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ThemedReactContext.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.kt +1 -4
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +103 -759
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerHelper.kt +14 -38
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +41 -170
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java +33 -962
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupDrawingOrderHelper.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/UIManagerType.kt +22 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/ViewUtil.kt +15 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.kt +1 -6
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/RCTEventEmitter.kt +2 -9
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/RCTModernEventEmitter.kt +12 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchEvent.kt +1 -16
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchesHelper.kt +0 -33
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BackgroundImageLayer.kt +27 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BackgroundPosition.kt +20 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BackgroundRepeat.kt +27 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BackgroundSize.kt +50 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BorderColors.kt +33 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BorderInsets.kt +25 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BorderRadiusStyle.kt +46 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BorderStyle.kt +14 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BoxShadow.kt +23 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/ColorStop.kt +45 -7
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/ComputedBorderRadius.kt +40 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/CornerRadii.kt +21 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/Gradient.kt +16 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/LinearGradient.kt +34 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/LogicalEdge.kt +33 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/OutlineStyle.kt +17 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/Overflow.kt +15 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/RadialGradient.kt +42 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/common/UiModeUtils.kt +20 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/ReactDrawerLayoutManager.kt +1 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.kt +9 -10
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ReactProgressBarViewManager.kt +6 -5
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +132 -16
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.kt +17 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollView.java +1647 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollViewManager.kt +466 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +104 -10
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewHelper.kt +71 -9
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.kt +17 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainer.kt +2 -35
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateClassic.kt +7 -30
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateExperimental.kt +20 -41
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/generate-nested-scroll-view.js +270 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/SwipeRefreshLayoutManager.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchManager.kt +7 -7
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayout.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextView.kt +39 -17
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextViewManager.kt +4 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextUpdate.kt +4 -65
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +86 -111
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewAccessibilityDelegate.kt +6 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.kt +243 -20
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTypefaceUtils.kt +1 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/SelectableTextViewManager.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.kt +1 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt +54 -77
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/DrawCommandSpan.kt +27 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/ReactClickableSpan.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/ReactLinkSpan.kt +10 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.kt +2 -75
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextChangedEvent.kt +8 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextContentSizeWatcher.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.kt +5 -38
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputTextWatcher.kt +3 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextScrollWatcher.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextSelectionWatcher.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ImportantForInteractionHelper.kt +55 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt +19 -60
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.kt +7 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualView.kt +150 -296
- package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualViewManager.kt +11 -13
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfig.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfigJNIBase.kt +64 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfigJNIFinalizer.java +4 -4
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDirection.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNative.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.kt +244 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaProps.kt +183 -0
- package/ReactAndroid/src/main/jni/CMakeLists.txt +6 -0
- package/ReactAndroid/src/main/jni/react/fabric/AndroidAnimationChoreographer.h +38 -0
- package/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp +4 -4
- package/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp +7 -0
- package/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.h +2 -0
- package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp +50 -2
- package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.h +11 -0
- package/ReactAndroid/src/main/jni/react/fabric/JAnimationBackendChoreographer.cpp +23 -0
- package/ReactAndroid/src/main/jni/react/fabric/JAnimationBackendChoreographer.h +37 -0
- package/ReactAndroid/src/main/jni/react/fabric/StateWrapperImpl.h +2 -1
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +89 -131
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +19 -28
- package/ReactAndroid/src/main/jni/react/jni/CMakeLists.txt +0 -1
- package/ReactAndroid/src/main/jni/react/jni/JavaModuleWrapper.cpp +1 -1
- package/ReactAndroid/src/main/jni/react/jni/OnLoad.cpp +0 -7
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactHostInspectorTarget.cpp +24 -60
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactHostInspectorTarget.h +12 -28
- package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManager.cpp +13 -6
- package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManager.h +2 -1
- package/{ReactCommon/react/renderer/components/text/ParagraphComponentDescriptor.cpp → ReactAndroid/src/main/jni/react/uimanager/StateWrapper.h} +7 -2
- package/ReactAndroid/src/main/res/views/uimanager/values/ids.xml +3 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-ne/strings.xml +2 -0
- package/ReactApple/RCTAnimatedModuleProvider/RCTAnimatedModuleProvider.mm +8 -1
- package/ReactApple/RCTSwiftUI/RCTSwiftUI.podspec +1 -1
- package/ReactApple/RCTSwiftUIWrapper/RCTSwiftUIWrapper.podspec +1 -2
- package/ReactCommon/React-Fabric.podspec +5 -6
- package/ReactCommon/React-FabricComponents.podspec +6 -8
- package/ReactCommon/cxxreact/ReactNativeVersion.h +8 -6
- package/ReactCommon/hermes/executor/HermesExecutorFactory.cpp +1 -1
- package/ReactCommon/hermes/inspector-modern/chrome/HermesRuntimeTargetDelegate.cpp +25 -16
- package/ReactCommon/hermes/inspector-modern/chrome/HermesRuntimeTargetDelegate.h +1 -1
- package/ReactCommon/jsinspector-modern/HostAgent.cpp +10 -30
- package/ReactCommon/jsinspector-modern/HostAgent.h +4 -11
- package/ReactCommon/jsinspector-modern/HostTarget.cpp +33 -33
- package/ReactCommon/jsinspector-modern/HostTarget.h +23 -24
- package/ReactCommon/jsinspector-modern/HostTargetTraceRecording.cpp +1 -2
- package/ReactCommon/jsinspector-modern/HostTargetTracing.h +89 -0
- package/ReactCommon/jsinspector-modern/InspectorInterfaces.cpp +4 -9
- package/ReactCommon/jsinspector-modern/InspectorInterfaces.h +0 -1
- package/ReactCommon/jsinspector-modern/InspectorPackagerConnection.cpp +164 -54
- package/ReactCommon/jsinspector-modern/InspectorPackagerConnectionImpl.h +39 -4
- package/ReactCommon/jsinspector-modern/NetworkIOAgent.cpp +12 -3
- package/ReactCommon/jsinspector-modern/NetworkIOAgent.h +13 -0
- package/ReactCommon/jsinspector-modern/RuntimeAgent.cpp +6 -0
- package/ReactCommon/jsinspector-modern/RuntimeTarget.cpp +34 -18
- package/ReactCommon/jsinspector-modern/RuntimeTarget.h +19 -0
- package/ReactCommon/jsinspector-modern/RuntimeTargetDebuggerSessionObserver.cpp +6 -95
- package/ReactCommon/jsinspector-modern/RuntimeTargetGlobalStateObserver.cpp +122 -0
- package/ReactCommon/jsinspector-modern/RuntimeTargetGlobalStateObserver.h +42 -0
- package/ReactCommon/jsinspector-modern/RuntimeTargetTracingStateObserver.cpp +27 -0
- package/ReactCommon/jsinspector-modern/RuntimeTargetTracingStateObserver.h +27 -0
- package/ReactCommon/jsinspector-modern/TracingAgent.cpp +7 -45
- package/ReactCommon/jsinspector-modern/TracingAgent.h +0 -11
- package/ReactCommon/jsinspector-modern/UniqueMonostate.h +0 -4
- package/ReactCommon/jsinspector-modern/WeakList.h +60 -1
- package/ReactCommon/jsinspector-modern/network/NetworkHandler.cpp +25 -21
- package/ReactCommon/jsinspector-modern/network/NetworkHandler.h +21 -15
- package/ReactCommon/jsinspector-modern/tests/GmockHelpers.h +1 -1
- package/ReactCommon/jsinspector-modern/tests/HostTargetTest.cpp +3 -3
- package/ReactCommon/jsinspector-modern/tests/InspectorPackagerConnectionMultiSessionTest.cpp +692 -0
- package/ReactCommon/jsinspector-modern/tests/InspectorPackagerConnectionTest.cpp +10 -123
- package/ReactCommon/jsinspector-modern/tests/InspectorPackagerConnectionTest.h +140 -0
- package/ReactCommon/jsinspector-modern/tests/JsiIntegrationTest.cpp +158 -6
- package/ReactCommon/jsinspector-modern/tests/NetworkReporterTest.cpp +34 -0
- package/ReactCommon/jsinspector-modern/tests/TracingTest.cpp +223 -4
- package/ReactCommon/jsinspector-modern/tests/WeakListTest.cpp +31 -1
- package/ReactCommon/jsinspector-modern/tests/engines/JsiIntegrationTestHermesEngineAdapter.cpp +1 -1
- package/ReactCommon/jsinspector-modern/tracing/FrameTimingSequence.h +6 -9
- package/ReactCommon/jsinspector-modern/tracing/HostTracingProfileSerializer.cpp +4 -6
- package/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.cpp +6 -17
- package/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.h +4 -5
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +27 -39
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +32 -47
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +153 -207
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +18 -24
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +26 -38
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +56 -83
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSExperimental.h +9 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +9 -12
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +3 -1
- package/ReactCommon/react/nativemodule/defaults/CMakeLists.txt +1 -0
- package/ReactCommon/react/nativemodule/defaults/DefaultTurboModules.cpp +10 -4
- package/ReactCommon/react/nativemodule/defaults/React-defaultsnativemodule.podspec +1 -0
- package/ReactCommon/react/nativemodule/fantomtestspecificmethods/NativeFantomTestSpecificMethods.cpp +32 -0
- package/ReactCommon/react/nativemodule/fantomtestspecificmethods/NativeFantomTestSpecificMethods.h +2 -0
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +32 -47
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +14 -20
- package/ReactCommon/react/renderer/animated/AnimatedModule.h +1 -1
- package/ReactCommon/react/renderer/animated/CMakeLists.txt +0 -1
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp +108 -151
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.h +16 -11
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManagerProvider.cpp +80 -86
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManagerProvider.h +0 -1
- package/ReactCommon/react/renderer/animated/event_drivers/EventAnimationDriver.h +0 -1
- package/ReactCommon/react/renderer/animated/internal/AnimatedMountingOverrideDelegate.h +0 -2
- package/ReactCommon/react/renderer/animated/internal/NativeAnimatedAllowlist.h +2 -2
- package/ReactCommon/react/renderer/animated/nodes/PropsAnimatedNode.cpp +32 -4
- package/ReactCommon/react/renderer/animated/nodes/PropsAnimatedNode.h +6 -0
- package/ReactCommon/react/renderer/animationbackend/AnimatedPropSerializer.cpp +14 -21
- package/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.cpp +3 -1
- package/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.h +6 -3
- package/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp +125 -63
- package/ReactCommon/react/renderer/animationbackend/AnimationBackend.h +33 -33
- package/ReactCommon/react/renderer/animationbackend/AnimationBackendCommitHook.cpp +18 -8
- package/ReactCommon/react/renderer/animationbackend/AnimationBackendCommitHook.h +1 -1
- package/ReactCommon/react/renderer/animationbackend/AnimationChoreographer.h +39 -0
- package/ReactCommon/react/renderer/animationbackend/CMakeLists.txt +0 -1
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +1 -2
- package/ReactCommon/react/renderer/attributedstring/AttributedString.h +0 -1
- package/ReactCommon/react/renderer/attributedstring/AttributedStringBox.cpp +0 -6
- package/ReactCommon/react/renderer/attributedstring/AttributedStringBox.h +0 -1
- package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp +0 -4
- package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.h +0 -1
- package/ReactCommon/react/renderer/attributedstring/conversions.h +60 -0
- package/ReactCommon/react/renderer/componentregistry/componentNameByReactViewName.cpp +3 -5
- package/ReactCommon/react/renderer/components/image/ImageProps.h +1 -1
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/{LegacyViewManagerInteropComponentDescriptor.mm → platform/ios/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm} +1 -1
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/{LegacyViewManagerInteropState.mm → platform/ios/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropState.mm} +1 -1
- package/ReactCommon/react/renderer/components/root/RootShadowNode.cpp +1 -1
- package/ReactCommon/react/renderer/components/scrollview/BaseScrollViewProps.cpp +20 -0
- package/ReactCommon/react/renderer/components/scrollview/BaseScrollViewProps.h +2 -0
- package/ReactCommon/react/renderer/components/scrollview/ScrollViewState.h +1 -1
- package/ReactCommon/react/renderer/components/scrollview/conversions.h +6 -0
- package/ReactCommon/react/renderer/components/scrollview/platform/android/react/renderer/components/scrollview/HostPlatformScrollViewProps.cpp +18 -1
- package/ReactCommon/react/renderer/components/scrollview/platform/android/react/renderer/components/scrollview/HostPlatformScrollViewProps.h +2 -0
- package/ReactCommon/react/renderer/components/scrollview/primitives.h +2 -11
- package/ReactCommon/react/renderer/components/scrollview/tests/ScrollViewTest.cpp +83 -3
- package/ReactCommon/react/renderer/components/text/BaseParagraphComponentDescriptor.h +49 -0
- package/ReactCommon/react/renderer/components/text/BaseTextProps.cpp +14 -14
- package/ReactCommon/react/renderer/components/text/ParagraphComponentDescriptor.h +3 -28
- package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.cpp +10 -10
- package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.h +4 -4
- package/ReactCommon/react/renderer/components/text/SelectableParagraphComponentDescriptor.h +24 -0
- package/ReactCommon/react/renderer/components/text/SelectableParagraphShadowNode.h +32 -0
- package/ReactCommon/react/renderer/components/text/platform/android/react/renderer/components/text/HostPlatformParagraphProps.cpp +1 -1
- package/ReactCommon/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.cpp +1 -1
- package/ReactCommon/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.h +2 -2
- package/ReactCommon/react/renderer/components/textinput/BaseTextInputShadowNode.h +13 -1
- package/ReactCommon/react/renderer/components/textinput/TextInputEventEmitter.cpp +2 -1
- package/ReactCommon/react/renderer/components/view/AccessibilityPrimitives.h +2 -21
- package/ReactCommon/react/renderer/components/view/BackgroundImagePropsConversions.cpp +15 -24
- package/ReactCommon/react/renderer/components/view/BaseTouch.h +7 -7
- package/ReactCommon/react/renderer/components/view/BaseViewProps.cpp +11 -1
- package/ReactCommon/react/renderer/components/view/BaseViewProps.h +4 -0
- package/ReactCommon/react/renderer/components/view/ConcreteViewShadowNode.h +0 -3
- package/ReactCommon/react/renderer/components/view/FilterPropsConversions.h +57 -53
- package/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp +1 -0
- package/ReactCommon/react/renderer/components/view/conversions.h +250 -2
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp +19 -63
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.h +1 -0
- package/ReactCommon/react/renderer/components/view/primitives.h +3 -86
- package/ReactCommon/react/renderer/components/view/tests/ConversionsTest.cpp +215 -0
- package/ReactCommon/react/renderer/components/view/tests/LayoutTest.cpp +1 -1
- package/ReactCommon/react/renderer/components/virtualview/VirtualViewComponentDescriptor.h +1 -1
- package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +1 -1
- package/ReactCommon/react/renderer/core/EventEmitter.cpp +2 -2
- package/ReactCommon/react/renderer/core/EventEmitter.h +8 -8
- package/ReactCommon/react/renderer/core/EventPipe.h +1 -1
- package/ReactCommon/react/renderer/core/EventTarget.cpp +3 -3
- package/ReactCommon/react/renderer/core/EventTarget.h +7 -7
- package/ReactCommon/react/renderer/core/LayoutConstraints.h +0 -5
- package/ReactCommon/react/renderer/core/LayoutContext.h +0 -5
- package/ReactCommon/react/renderer/core/LayoutMetrics.h +0 -2
- package/ReactCommon/react/renderer/core/RawPropsKey.cpp +11 -21
- package/ReactCommon/react/renderer/core/RawPropsKey.h +0 -1
- package/ReactCommon/react/renderer/core/RawPropsKeyMap.cpp +4 -1
- package/ReactCommon/react/renderer/core/RawPropsParser.cpp +1 -7
- package/ReactCommon/react/renderer/core/RawPropsParser.h +2 -6
- package/ReactCommon/react/renderer/core/RawValue.h +1 -2
- package/ReactCommon/react/renderer/core/ShadowNode.cpp +33 -31
- package/ReactCommon/react/renderer/core/ShadowNode.h +19 -29
- package/ReactCommon/react/renderer/core/ShadowNodeFamily.cpp +6 -6
- package/ReactCommon/react/renderer/core/ShadowNodeFamily.h +14 -14
- package/ReactCommon/react/renderer/core/ShadowNodeFragment.cpp +4 -2
- package/ReactCommon/react/renderer/core/ShadowNodeFragment.h +2 -2
- package/ReactCommon/react/renderer/core/tests/ShadowNodeTest.cpp +57 -2
- package/ReactCommon/react/renderer/css/CSSBackgroundImage.h +112 -140
- package/ReactCommon/react/renderer/css/CSSColor.h +7 -8
- package/ReactCommon/react/renderer/css/CSSColorFunction.h +38 -39
- package/ReactCommon/react/renderer/css/CSSCompoundDataType.h +23 -17
- package/ReactCommon/react/renderer/css/CSSDataType.h +15 -10
- package/ReactCommon/react/renderer/css/CSSFilter.h +12 -17
- package/ReactCommon/react/renderer/css/CSSKeyword.h +8 -0
- package/ReactCommon/react/renderer/css/CSSList.h +11 -11
- package/ReactCommon/react/renderer/css/CSSRatio.h +4 -4
- package/ReactCommon/react/renderer/css/CSSShadow.h +7 -7
- package/ReactCommon/react/renderer/css/CSSSyntaxParser.h +10 -6
- package/ReactCommon/react/renderer/css/CSSTokenizer.h +2 -0
- package/ReactCommon/react/renderer/css/CSSTransform.h +20 -20
- package/ReactCommon/react/renderer/css/CSSTransformOrigin.h +4 -5
- package/ReactCommon/react/renderer/css/CSSValueParser.h +71 -67
- package/ReactCommon/react/renderer/css/tests/CSSValueParserTest.cpp +11 -10
- package/ReactCommon/react/renderer/graphics/BackgroundPosition.h +0 -1
- package/ReactCommon/react/renderer/graphics/BackgroundRepeat.h +0 -1
- package/ReactCommon/react/renderer/graphics/BackgroundSize.h +0 -1
- package/ReactCommon/react/renderer/graphics/Filter.h +3 -2
- package/ReactCommon/react/renderer/graphics/LinearGradient.cpp +9 -15
- package/ReactCommon/react/renderer/graphics/LinearGradient.h +7 -19
- package/ReactCommon/react/renderer/graphics/Point.h +0 -2
- package/ReactCommon/react/renderer/graphics/RadialGradient.h +4 -35
- package/ReactCommon/react/renderer/graphics/React-graphics.podspec +1 -0
- package/ReactCommon/react/renderer/graphics/Rect.h +1 -9
- package/ReactCommon/react/renderer/graphics/RectangleCorners.h +1 -10
- package/ReactCommon/react/renderer/graphics/RectangleEdges.h +1 -10
- package/ReactCommon/react/renderer/graphics/Size.h +0 -5
- package/ReactCommon/react/renderer/graphics/Transform.cpp +0 -4
- package/ReactCommon/react/renderer/graphics/Transform.h +1 -13
- package/ReactCommon/react/renderer/graphics/TransformUtils.h +95 -0
- package/ReactCommon/react/renderer/graphics/ValueUnit.h +3 -11
- package/ReactCommon/react/renderer/graphics/fromRawValueShared.h +13 -1
- package/ReactCommon/react/renderer/imagemanager/ImageManager.h +0 -4
- package/ReactCommon/react/renderer/imagemanager/ImageResponseObserverCoordinator.cpp +11 -12
- package/ReactCommon/react/renderer/imagemanager/ImageResponseObserverCoordinator.h +4 -3
- package/ReactCommon/react/renderer/imagemanager/platform/android/react/renderer/imagemanager/ImageRequestParams.h +1 -36
- package/ReactCommon/react/renderer/imagemanager/platform/cxx/react/renderer/imagemanager/ImageRequestParams.h +1 -9
- package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/ImageRequestParams.h +1 -9
- package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/RCTSyncImageManager.mm +1 -1
- package/ReactCommon/react/renderer/imagemanager/primitives.h +0 -5
- package/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp +51 -30
- package/ReactCommon/react/renderer/mapbuffer/MapBuffer.h +2 -0
- package/ReactCommon/react/renderer/mounting/Differentiator.cpp +21 -38
- package/ReactCommon/react/renderer/mounting/ShadowTree.cpp +153 -18
- package/ReactCommon/react/renderer/mounting/ShadowTree.h +30 -6
- package/ReactCommon/react/renderer/mounting/ShadowTreeDelegate.h +11 -0
- package/ReactCommon/react/renderer/mounting/ShadowView.cpp +0 -4
- package/ReactCommon/react/renderer/mounting/ShadowView.h +0 -1
- package/ReactCommon/react/renderer/mounting/internal/DiffMap.h +170 -0
- package/ReactCommon/react/renderer/mounting/internal/ShadowViewNodePair.h +0 -5
- package/ReactCommon/react/renderer/mounting/internal/sliceChildShadowNodeViewPairs.h +3 -3
- package/ReactCommon/react/renderer/mounting/stubs/StubView.cpp +0 -4
- package/ReactCommon/react/renderer/mounting/stubs/StubView.h +0 -1
- package/ReactCommon/react/renderer/mounting/stubs/StubViewTree.cpp +0 -4
- package/ReactCommon/react/renderer/mounting/stubs/StubViewTree.h +0 -2
- package/ReactCommon/react/renderer/mounting/tests/StateReconciliationTest.cpp +6 -0
- package/ReactCommon/react/renderer/mounting/updateMountedFlag.cpp +12 -4
- package/ReactCommon/react/renderer/observers/intersection/IntersectionObserver.cpp +2 -1
- package/ReactCommon/react/renderer/observers/intersection/IntersectionObserverState.cpp +0 -5
- package/ReactCommon/react/renderer/observers/intersection/IntersectionObserverState.h +0 -1
- package/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +1 -1
- package/ReactCommon/react/renderer/scheduler/CMakeLists.txt +1 -0
- package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +28 -1
- package/ReactCommon/react/renderer/scheduler/Scheduler.h +2 -2
- package/ReactCommon/react/renderer/scheduler/SchedulerDelegate.h +6 -0
- package/ReactCommon/react/renderer/scheduler/SchedulerToolbox.h +7 -0
- package/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp +2 -2
- package/ReactCommon/react/renderer/textlayoutmanager/TextLayoutManagerExtended.h +18 -18
- package/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp +8 -7
- package/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.h +5 -5
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h +3 -3
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +4 -3
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.h +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +15 -5
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextPrimitivesConversions.h +2 -2
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/TextLayoutManager.mm +10 -1
- package/ReactCommon/react/renderer/uimanager/PointerEventsProcessor.cpp +1 -1
- package/ReactCommon/react/renderer/uimanager/PointerEventsProcessor.h +1 -3
- package/ReactCommon/react/renderer/uimanager/PointerHoverTracker.cpp +1 -1
- package/ReactCommon/react/renderer/uimanager/UIManager.cpp +68 -38
- package/ReactCommon/react/renderer/uimanager/UIManager.h +17 -8
- package/ReactCommon/react/renderer/uimanager/UIManagerAnimationBackend.h +17 -5
- package/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp +2 -2
- package/ReactCommon/react/renderer/uimanager/UIManagerBinding.h +2 -2
- package/ReactCommon/react/renderer/uimanager/UIManagerDelegate.h +10 -0
- package/ReactCommon/react/renderer/uimanager/consistency/LazyShadowTreeRevisionConsistencyManager.cpp +19 -23
- package/ReactCommon/react/renderer/uimanager/consistency/LazyShadowTreeRevisionConsistencyManager.h +2 -3
- package/ReactCommon/react/renderer/uimanager/consistency/tests/LazyShadowTreeRevisionConsistencyManagerTest.cpp +13 -5
- package/ReactCommon/react/renderer/uimanager/primitives.h +16 -7
- package/ReactCommon/react/renderer/uimanager/tests/FindShadowNodeByTagTest.cpp +287 -0
- package/ReactCommon/react/runtime/TimerManager.cpp +16 -2
- package/ReactCommon/react/runtime/hermes/HermesInstance.cpp +11 -6
- package/ReactCommon/react/runtime/iostests/RCTHostTests.mm +11 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.h +17 -3
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +8 -1
- package/ReactCommon/react/test_utils/shadowTreeGeneration.h +8 -5
- package/ReactCommon/react/utils/ContextContainer.h +0 -2
- package/ReactCommon/yoga/yoga/YGNode.cpp +14 -0
- package/ReactCommon/yoga/yoga/YGValue.h +0 -4
- package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp +7 -7
- package/ReactCommon/yoga/yoga/enums/YogaEnums.h +0 -1
- package/ReactCommon/yoga/yoga/node/LayoutResults.h +0 -3
- package/ReactCommon/yoga/yoga/numeric/FloatOptional.h +0 -9
- package/ReactCommon/yoga/yoga/style/Style.h +0 -4
- package/flow/bom.js.flow +18 -17
- package/flow/dom.js.flow +12 -5
- package/flow/global.js +1 -1
- package/gradle/libs.versions.toml +1 -1
- package/index.js +9 -0
- package/index.js.flow +8 -1
- package/jest-preset.js +14 -18
- package/package.json +17 -17
- package/scripts/cocoapods/rncore.rb +111 -2
- package/scripts/cocoapods/utils.rb +2 -0
- package/scripts/codegen/templates/Package.swift.template +7 -0
- package/scripts/react_native_pods.rb +13 -6
- package/scripts/replace-rncore-version.js +12 -3
- package/sdks/.hermesv1version +1 -1
- package/sdks/.hermesversion +1 -1
- package/sdks/hermes-engine/version.properties +2 -2
- package/src/private/animated/NativeAnimatedHelper.js +2 -2
- package/src/private/animated/createAnimatedPropsMemoHook.js +19 -19
- package/src/private/components/virtualview/VirtualView.js +14 -21
- package/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.js +11 -10
- package/src/private/components/virtualview/VirtualViewNativeComponent.js +4 -4
- package/src/private/devsupport/devmenu/elementinspector/BorderBox.js +2 -2
- package/src/private/devsupport/devmenu/elementinspector/BoxInspector.js +3 -3
- package/src/private/devsupport/devmenu/elementinspector/ElementBox.js +4 -4
- package/src/private/devsupport/devmenu/elementinspector/ElementProperties.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/Inspector.js +39 -17
- package/src/private/devsupport/devmenu/elementinspector/InspectorOverlay.js +15 -3
- package/src/private/devsupport/devmenu/elementinspector/InspectorPanel.js +2 -2
- package/src/private/devsupport/devmenu/elementinspector/ReactDevToolsOverlay.js +2 -8
- package/src/private/devsupport/devmenu/elementinspector/StyleInspector.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/resolveBoxStyle.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/useExternalInspection.js +102 -0
- package/src/private/devsupport/rndevtools/FuseboxSessionObserver.js +12 -25
- package/src/private/devsupport/rndevtools/GlobalStateObserver.js +56 -0
- package/src/private/devsupport/rndevtools/TracingStateObserver.js +28 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +49 -82
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +2 -2
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +9 -12
- package/src/private/specs_DEPRECATED/components/ActivityIndicatorViewNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/AndroidDrawerLayoutNativeComponent.js +3 -3
- package/src/private/specs_DEPRECATED/components/AndroidHorizontalScrollContentViewNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/AndroidSwipeRefreshLayoutNativeComponent.js +2 -2
- package/src/private/specs_DEPRECATED/components/AndroidSwitchNativeComponent.js +2 -2
- package/src/private/specs_DEPRECATED/components/DebuggingOverlayNativeComponent.js +3 -3
- package/src/private/specs_DEPRECATED/components/ProgressBarAndroidNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/PullToRefreshViewNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/RCTInputAccessoryViewNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/RCTModalHostViewNativeComponent.js +3 -3
- package/src/private/specs_DEPRECATED/components/RCTSafeAreaViewNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/SwitchNativeComponent.js +2 -2
- package/src/private/specs_DEPRECATED/components/UnimplementedNativeViewNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeImageLoaderIOS.js +1 -1
- package/src/private/styles/composeStyles.js +1 -1
- package/src/private/utilities/toError.js +27 -0
- package/src/private/utilities/toExtendedError.js +30 -0
- package/src/private/webapis/dom/events/Event.js +1 -1
- package/src/private/webapis/dom/events/EventHandlerAttributes.js +2 -2
- package/src/private/webapis/dom/events/EventTarget.js +3 -3
- package/src/private/webapis/dom/events/internals/EventInternals.js +2 -2
- package/src/private/webapis/dom/nodes/ReadOnlyElement.js +1 -1
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +2 -2
- package/src/private/webapis/dom/nodes/specs/NativeDOM.js +14 -14
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +2 -2
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js.flow +1 -1
- package/src/private/webapis/dom/oldstylecollections/NodeList.js +2 -2
- package/src/private/webapis/dom/oldstylecollections/NodeList.js.flow +1 -1
- package/src/private/webapis/geometry/DOMRectList.js +2 -2
- package/src/private/webapis/geometry/DOMRectList.js.flow +1 -1
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +8 -8
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +6 -6
- package/src/private/webapis/mutationobserver/MutationObserver.js +2 -2
- package/src/private/webapis/mutationobserver/MutationRecord.js +2 -2
- package/src/private/webapis/mutationobserver/internals/MutationObserverManager.js +1 -1
- package/src/private/webapis/mutationobserver/specs/NativeMutationObserver.js +3 -3
- package/src/private/webapis/performance/LongTasks.js +3 -3
- package/src/private/webapis/performance/Performance.js +4 -4
- package/src/private/webapis/performance/PerformanceEntry.js +1 -1
- package/src/private/webapis/performance/PerformanceObserver.js +2 -2
- package/src/private/webapis/performance/specs/NativePerformance.js +8 -8
- package/src/private/webapis/structuredClone/structuredClone.js +2 -2
- package/src/types/globals.d.ts +4 -4
- package/third-party-podspecs/RCT-Folly.podspec +1 -1
- package/third-party-podspecs/fmt.podspec +2 -2
- package/types/index.d.ts +2 -0
- package/types/public/ReactNativeTVTypes.d.ts +27 -2
- package/Libraries/Components/View/ReactNativeViewAttributes.js +0 -60
- package/Libraries/Image/TextInlineImageNativeComponent.js +0 -49
- package/React/Fabric/Mounting/ComponentViews/VirtualViewExperimental/RCTVirtualViewExperimentalComponentView.h +0 -25
- package/React/Fabric/Mounting/ComponentViews/VirtualViewExperimental/RCTVirtualViewExperimentalComponentView.mm +0 -321
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +0 -620
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java +0 -1411
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutShadowNode.java +0 -985
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyOptimizer.java +0 -403
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/EventDispatcherImpl.kt +0 -336
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/EventEmitterImpl.kt +0 -135
- package/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ProgressBarShadowNode.kt +0 -81
- package/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchShadowNode.kt +0 -72
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.kt +0 -677
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.kt +0 -218
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.kt +0 -369
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageShadowNode.kt +0 -156
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageSpan.kt +0 -174
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageViewManager.kt +0 -54
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/ReactTextInlineImageShadowNode.kt +0 -30
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/TextInlineImageSpan.kt +0 -58
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputShadowNode.kt +0 -228
- package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/viewexperimental/ReactVirtualViewExperimental.kt +0 -305
- package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/viewexperimental/ReactVirtualViewExperimentalManager.kt +0 -110
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfigJNIBase.java +0 -62
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDirection.java +0 -35
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.java +0 -279
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaProps.java +0 -197
- package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +0 -410
- package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h +0 -113
- package/ReactCommon/react/renderer/components/virtualviewexperimental/VirtualViewExperimentalComponentDescriptor.h +0 -19
- package/ReactCommon/react/renderer/components/virtualviewexperimental/VirtualViewExperimentalShadowNode.h +0 -38
- package/jest/MockNativeMethods.js +0 -27
- package/jest/RefreshControlMock.js +0 -32
- package/jest/assetFileTransformer.js +0 -33
- package/jest/local-setup.js +0 -29
- package/jest/mock.js +0 -39
- package/jest/mockComponent.js +0 -104
- package/jest/mockNativeComponent.js +0 -52
- package/jest/mocks/AccessibilityInfo.js +0 -62
- package/jest/mocks/ActivityIndicator.js +0 -23
- package/jest/mocks/AppState.js +0 -19
- package/jest/mocks/Image.js +0 -23
- package/jest/mocks/InitializeCore.js +0 -9
- package/jest/mocks/Linking.js +0 -28
- package/jest/mocks/Modal.js +0 -33
- package/jest/mocks/NativeComponentRegistry.js +0 -30
- package/jest/mocks/NativeModules.js +0 -239
- package/jest/mocks/RefreshControl.js +0 -31
- package/jest/mocks/RendererProxy.js +0 -45
- package/jest/mocks/ScrollView.js +0 -58
- package/jest/mocks/Text.js +0 -27
- package/jest/mocks/TextInput.js +0 -32
- package/jest/mocks/UIManager.js +0 -60
- package/jest/mocks/View.js +0 -27
- package/jest/mocks/ViewNativeComponent.js +0 -23
- package/jest/mocks/requireNativeComponent.js +0 -22
- package/jest/mocks/useColorScheme.js +0 -18
- package/jest/react-native-env.js +0 -17
- package/jest/renderer.js +0 -40
- package/jest/resolver.js +0 -32
- package/jest/setup.js +0 -140
- /package/React/Fabric/Mounting/ComponentViews/{VirtualViewExperimental → VirtualView}/RCTVirtualViewMode.h +0 -0
- /package/React/Fabric/Mounting/ComponentViews/{VirtualViewExperimental → VirtualView}/RCTVirtualViewRenderState.h +0 -0
- /package/ReactAndroid/src/main/java/com/facebook/react/fabric/internal/interop/{InteropUiBlockListener.kt → InteropUIBlockListener.kt} +0 -0
- /package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/{LegacyViewManagerInteropComponentDescriptor.h → platform/ios/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.h} +0 -0
- /package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/{RCTLegacyViewManagerInteropCoordinator.h → platform/ios/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h} +0 -0
- /package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/{RCTLegacyViewManagerInteropCoordinator.mm → platform/ios/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm} +0 -0
- /package/ReactCommon/react/renderer/components/scrollview/{RCTComponentViewHelpers.h → platform/ios/react/renderer/components/scrollview/RCTComponentViewHelpers.h} +0 -0
package/Libraries/Text/Text.js
CHANGED
|
@@ -19,16 +19,21 @@ import * as PressabilityDebug from '../Pressability/PressabilityDebug';
|
|
|
19
19
|
import usePressability from '../Pressability/usePressability';
|
|
20
20
|
import flattenStyle from '../StyleSheet/flattenStyle';
|
|
21
21
|
import processColor from '../StyleSheet/processColor';
|
|
22
|
+
import StyleSheet from '../StyleSheet/StyleSheet';
|
|
22
23
|
import Platform from '../Utilities/Platform';
|
|
23
24
|
import TextAncestorContext from './TextAncestorContext';
|
|
24
|
-
import {
|
|
25
|
+
import {
|
|
26
|
+
NativeSelectableText,
|
|
27
|
+
NativeText,
|
|
28
|
+
NativeVirtualText,
|
|
29
|
+
} from './TextNativeComponent';
|
|
25
30
|
import * as React from 'react';
|
|
26
31
|
import {useContext, useMemo, useState} from 'react';
|
|
27
32
|
|
|
28
33
|
export type {TextProps} from './TextProps';
|
|
29
34
|
|
|
30
35
|
type TextForwardRef = React.ElementRef<
|
|
31
|
-
typeof NativeText | typeof NativeVirtualText,
|
|
36
|
+
typeof NativeText | typeof NativeVirtualText | typeof NativeSelectableText,
|
|
32
37
|
>;
|
|
33
38
|
|
|
34
39
|
/**
|
|
@@ -36,638 +41,305 @@ type TextForwardRef = React.ElementRef<
|
|
|
36
41
|
*
|
|
37
42
|
* @see https://reactnative.dev/docs/text
|
|
38
43
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
expanded: ariaExpanded ?? _accessibilityState.expanded,
|
|
104
|
-
selected: ariaSelected ?? _accessibilityState.selected,
|
|
105
|
-
};
|
|
106
|
-
} else {
|
|
107
|
-
_accessibilityState = {
|
|
108
|
-
busy: ariaBusy,
|
|
109
|
-
checked: ariaChecked,
|
|
110
|
-
disabled: ariaDisabled,
|
|
111
|
-
expanded: ariaExpanded,
|
|
112
|
-
selected: ariaSelected,
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const _accessibilityStateDisabled = _accessibilityState?.disabled;
|
|
118
|
-
const _disabled = disabled ?? _accessibilityStateDisabled;
|
|
119
|
-
|
|
120
|
-
// If the disabled prop and accessibilityState.disabled are out of sync but not both in
|
|
121
|
-
// falsy states we need to update the accessibilityState object to use the disabled prop.
|
|
122
|
-
if (
|
|
123
|
-
_accessibilityState != null &&
|
|
124
|
-
_disabled !== _accessibilityStateDisabled &&
|
|
125
|
-
((_disabled != null && _disabled !== false) ||
|
|
126
|
-
(_accessibilityStateDisabled != null &&
|
|
127
|
-
_accessibilityStateDisabled !== false))
|
|
128
|
-
) {
|
|
129
|
-
_accessibilityState.disabled = _disabled;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (ariaHidden !== undefined) {
|
|
133
|
-
processedProps.accessibilityElementsHidden = ariaHidden;
|
|
134
|
-
if (ariaHidden === true) {
|
|
135
|
-
processedProps.importantForAccessibility = 'no-hide-descendants';
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
const _accessible = Platform.select({
|
|
140
|
-
ios: accessible !== false,
|
|
141
|
-
android:
|
|
142
|
-
accessible == null
|
|
143
|
-
? onPress != null || onLongPress != null
|
|
144
|
-
: accessible,
|
|
145
|
-
default: accessible,
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
const isPressable =
|
|
149
|
-
(onPress != null ||
|
|
150
|
-
onLongPress != null ||
|
|
151
|
-
onStartShouldSetResponder != null) &&
|
|
152
|
-
_disabled !== true;
|
|
153
|
-
|
|
154
|
-
const shouldUseLinkRole =
|
|
155
|
-
ReactNativeFeatureFlags.shouldUseLinkRoleForPressableText() &&
|
|
156
|
-
isPressable &&
|
|
157
|
-
accessibilityRole == null &&
|
|
158
|
-
role == null;
|
|
159
|
-
|
|
160
|
-
const _accessibilityRole =
|
|
161
|
-
accessibilityRole ?? (shouldUseLinkRole ? 'link' : undefined);
|
|
162
|
-
|
|
163
|
-
const _role = shouldUseLinkRole ? undefined : role;
|
|
164
|
-
|
|
165
|
-
// TODO: Move this processing to the view configuration.
|
|
166
|
-
const _selectionColor =
|
|
167
|
-
selectionColor != null ? processColor(selectionColor) : undefined;
|
|
168
|
-
|
|
169
|
-
let _style = style;
|
|
170
|
-
if (__DEV__) {
|
|
171
|
-
if (PressabilityDebug.isEnabled() && onPress != null) {
|
|
172
|
-
_style = [style, {color: 'magenta'}];
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
let _numberOfLines = numberOfLines;
|
|
177
|
-
if (_numberOfLines != null && !(_numberOfLines >= 0)) {
|
|
178
|
-
if (__DEV__) {
|
|
179
|
-
console.error(
|
|
180
|
-
`'numberOfLines' in <Text> must be a non-negative number, received: ${_numberOfLines}. The value will be set to 0.`,
|
|
181
|
-
);
|
|
182
|
-
}
|
|
183
|
-
_numberOfLines = 0;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
let _selectable = selectable;
|
|
187
|
-
|
|
188
|
-
let processedStyle = flattenStyle<TextStyleProp>(_style);
|
|
189
|
-
if (processedStyle != null) {
|
|
190
|
-
let overrides: ?{...TextStyleInternal} = null;
|
|
191
|
-
if (typeof processedStyle.fontWeight === 'number') {
|
|
192
|
-
overrides = overrides || ({}: {...TextStyleInternal});
|
|
193
|
-
overrides.fontWeight =
|
|
194
|
-
// $FlowFixMe[incompatible-type]
|
|
195
|
-
(String(processedStyle.fontWeight): TextStyleInternal['fontWeight']);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
if (processedStyle.userSelect != null) {
|
|
199
|
-
_selectable = userSelectToSelectableMap[processedStyle.userSelect];
|
|
200
|
-
overrides = overrides || ({}: {...TextStyleInternal});
|
|
201
|
-
overrides.userSelect = undefined;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
if (processedStyle.verticalAlign != null) {
|
|
205
|
-
overrides = overrides || ({}: {...TextStyleInternal});
|
|
206
|
-
overrides.textAlignVertical =
|
|
207
|
-
verticalAlignToTextAlignVerticalMap[processedStyle.verticalAlign];
|
|
208
|
-
overrides.verticalAlign = undefined;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
if (overrides != null) {
|
|
212
|
-
// $FlowFixMe[incompatible-type]
|
|
213
|
-
_style = [_style, overrides];
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
const _nativeID = id ?? nativeID;
|
|
218
|
-
|
|
219
|
-
if (_accessibilityLabel !== undefined) {
|
|
220
|
-
processedProps.accessibilityLabel = _accessibilityLabel;
|
|
221
|
-
}
|
|
222
|
-
if (_accessibilityRole !== undefined) {
|
|
223
|
-
processedProps.accessibilityRole = _accessibilityRole;
|
|
224
|
-
}
|
|
225
|
-
if (_accessibilityState !== undefined) {
|
|
226
|
-
processedProps.accessibilityState = _accessibilityState;
|
|
227
|
-
}
|
|
228
|
-
if (_nativeID !== undefined) {
|
|
229
|
-
processedProps.nativeID = _nativeID;
|
|
230
|
-
}
|
|
231
|
-
if (_numberOfLines !== undefined) {
|
|
232
|
-
processedProps.numberOfLines = _numberOfLines;
|
|
233
|
-
}
|
|
234
|
-
if (_selectable !== undefined) {
|
|
235
|
-
processedProps.selectable = _selectable;
|
|
236
|
-
}
|
|
237
|
-
if (_style !== undefined) {
|
|
238
|
-
processedProps.style = _style;
|
|
239
|
-
}
|
|
240
|
-
if (_selectionColor !== undefined) {
|
|
241
|
-
processedProps.selectionColor = _selectionColor;
|
|
242
|
-
}
|
|
243
|
-
if (_role !== undefined) {
|
|
244
|
-
processedProps.role = _role;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
let textPressabilityProps: ?TextPressabilityProps;
|
|
248
|
-
if (isPressable) {
|
|
249
|
-
textPressabilityProps = {
|
|
250
|
-
onLongPress,
|
|
251
|
-
onPress,
|
|
252
|
-
onPressIn,
|
|
253
|
-
onPressOut,
|
|
254
|
-
onResponderGrant,
|
|
255
|
-
onResponderMove,
|
|
256
|
-
onResponderRelease,
|
|
257
|
-
onResponderTerminate,
|
|
258
|
-
onResponderTerminationRequest,
|
|
259
|
-
onStartShouldSetResponder,
|
|
260
|
-
pressRetentionOffset,
|
|
261
|
-
suppressHighlighting,
|
|
44
|
+
const TextImpl: component(
|
|
45
|
+
ref?: React.RefSetter<TextForwardRef>,
|
|
46
|
+
...props: TextProps
|
|
47
|
+
) = ({
|
|
48
|
+
ref: forwardedRef,
|
|
49
|
+
accessible,
|
|
50
|
+
accessibilityLabel,
|
|
51
|
+
accessibilityRole,
|
|
52
|
+
accessibilityState,
|
|
53
|
+
allowFontScaling,
|
|
54
|
+
'aria-busy': ariaBusy,
|
|
55
|
+
'aria-checked': ariaChecked,
|
|
56
|
+
'aria-disabled': ariaDisabled,
|
|
57
|
+
'aria-expanded': ariaExpanded,
|
|
58
|
+
'aria-hidden': ariaHidden,
|
|
59
|
+
'aria-label': ariaLabel,
|
|
60
|
+
'aria-selected': ariaSelected,
|
|
61
|
+
children,
|
|
62
|
+
ellipsizeMode,
|
|
63
|
+
disabled,
|
|
64
|
+
id,
|
|
65
|
+
nativeID,
|
|
66
|
+
numberOfLines,
|
|
67
|
+
onLongPress,
|
|
68
|
+
onPress,
|
|
69
|
+
onPressIn,
|
|
70
|
+
onPressOut,
|
|
71
|
+
onResponderGrant,
|
|
72
|
+
onResponderMove,
|
|
73
|
+
onResponderRelease,
|
|
74
|
+
onResponderTerminate,
|
|
75
|
+
onResponderTerminationRequest,
|
|
76
|
+
onStartShouldSetResponder,
|
|
77
|
+
pressRetentionOffset,
|
|
78
|
+
role,
|
|
79
|
+
selectable,
|
|
80
|
+
selectionColor,
|
|
81
|
+
suppressHighlighting,
|
|
82
|
+
style,
|
|
83
|
+
...restProps
|
|
84
|
+
}: {
|
|
85
|
+
ref?: React.RefSetter<TextForwardRef>,
|
|
86
|
+
...TextProps,
|
|
87
|
+
}) => {
|
|
88
|
+
const processedProps = restProps as {
|
|
89
|
+
...NativeTextProps,
|
|
90
|
+
};
|
|
91
|
+
const _accessibilityLabel = ariaLabel ?? accessibilityLabel;
|
|
92
|
+
let _accessibilityState: ?TextProps['accessibilityState'] =
|
|
93
|
+
accessibilityState;
|
|
94
|
+
if (
|
|
95
|
+
ariaBusy != null ||
|
|
96
|
+
ariaChecked != null ||
|
|
97
|
+
ariaDisabled != null ||
|
|
98
|
+
ariaExpanded != null ||
|
|
99
|
+
ariaSelected != null
|
|
100
|
+
) {
|
|
101
|
+
if (_accessibilityState != null) {
|
|
102
|
+
_accessibilityState = {
|
|
103
|
+
busy: ariaBusy ?? _accessibilityState.busy,
|
|
104
|
+
checked: ariaChecked ?? _accessibilityState.checked,
|
|
105
|
+
disabled: ariaDisabled ?? _accessibilityState.disabled,
|
|
106
|
+
expanded: ariaExpanded ?? _accessibilityState.expanded,
|
|
107
|
+
selected: ariaSelected ?? _accessibilityState.selected,
|
|
262
108
|
};
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
const hasTextAncestor = useContext(TextAncestorContext);
|
|
266
|
-
if (hasTextAncestor) {
|
|
267
|
-
processedProps.disabled = disabled;
|
|
268
|
-
processedProps.children = children;
|
|
269
|
-
if (isPressable) {
|
|
270
|
-
return (
|
|
271
|
-
<NativePressableVirtualText
|
|
272
|
-
ref={forwardedRef}
|
|
273
|
-
textProps={processedProps}
|
|
274
|
-
textPressabilityProps={textPressabilityProps ?? {}}
|
|
275
|
-
/>
|
|
276
|
-
);
|
|
277
|
-
}
|
|
278
|
-
return <NativeVirtualText {...processedProps} ref={forwardedRef} />;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
let nativeText = null;
|
|
282
|
-
|
|
283
|
-
processedProps.accessible = _accessible;
|
|
284
|
-
processedProps.allowFontScaling = allowFontScaling !== false;
|
|
285
|
-
processedProps.disabled = _disabled;
|
|
286
|
-
processedProps.ellipsizeMode = ellipsizeMode ?? 'tail';
|
|
287
|
-
processedProps.children = children;
|
|
288
|
-
|
|
289
|
-
if (isPressable) {
|
|
290
|
-
nativeText = (
|
|
291
|
-
<NativePressableText
|
|
292
|
-
ref={forwardedRef}
|
|
293
|
-
textProps={processedProps}
|
|
294
|
-
textPressabilityProps={textPressabilityProps ?? {}}
|
|
295
|
-
/>
|
|
296
|
-
);
|
|
297
109
|
} else {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
// If the children do not contain a JSX element it would not be possible to have a
|
|
306
|
-
// nested `Text` component so we can skip adding the `TextAncestorContext` context wrapper
|
|
307
|
-
// which has a performance overhead. Since we do this for performance reasons we need
|
|
308
|
-
// to keep the check simple to avoid regressing overall perf. For this reason the
|
|
309
|
-
// `children.length` constant is set to `3`, this should be a reasonable tradeoff
|
|
310
|
-
// to capture the majority of `Text` uses but also not make this check too expensive.
|
|
311
|
-
if (Array.isArray(children) && children.length <= 3) {
|
|
312
|
-
let hasNonTextChild = false;
|
|
313
|
-
for (let child of children) {
|
|
314
|
-
if (child != null && typeof child === 'object') {
|
|
315
|
-
hasNonTextChild = true;
|
|
316
|
-
break;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
if (!hasNonTextChild) {
|
|
320
|
-
return nativeText;
|
|
321
|
-
}
|
|
322
|
-
} else if (typeof children !== 'object') {
|
|
323
|
-
return nativeText;
|
|
110
|
+
_accessibilityState = {
|
|
111
|
+
busy: ariaBusy,
|
|
112
|
+
checked: ariaChecked,
|
|
113
|
+
disabled: ariaDisabled,
|
|
114
|
+
expanded: ariaExpanded,
|
|
115
|
+
selected: ariaSelected,
|
|
116
|
+
};
|
|
324
117
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
'aria-busy': ariaBusy,
|
|
343
|
-
'aria-checked': ariaChecked,
|
|
344
|
-
'aria-disabled': ariaDisabled,
|
|
345
|
-
'aria-expanded': ariaExpanded,
|
|
346
|
-
'aria-hidden': ariaHidden,
|
|
347
|
-
'aria-label': ariaLabel,
|
|
348
|
-
'aria-selected': ariaSelected,
|
|
349
|
-
children,
|
|
350
|
-
ellipsizeMode,
|
|
351
|
-
disabled,
|
|
352
|
-
id,
|
|
353
|
-
nativeID,
|
|
354
|
-
numberOfLines,
|
|
355
|
-
onLongPress,
|
|
356
|
-
onPress,
|
|
357
|
-
onPressIn,
|
|
358
|
-
onPressOut,
|
|
359
|
-
onResponderGrant,
|
|
360
|
-
onResponderMove,
|
|
361
|
-
onResponderRelease,
|
|
362
|
-
onResponderTerminate,
|
|
363
|
-
onResponderTerminationRequest,
|
|
364
|
-
onStartShouldSetResponder,
|
|
365
|
-
pressRetentionOffset,
|
|
366
|
-
role,
|
|
367
|
-
selectable,
|
|
368
|
-
selectionColor,
|
|
369
|
-
suppressHighlighting,
|
|
370
|
-
style,
|
|
371
|
-
...restProps
|
|
372
|
-
}: {
|
|
373
|
-
ref?: React.RefSetter<TextForwardRef>,
|
|
374
|
-
...TextProps,
|
|
375
|
-
}) => {
|
|
376
|
-
const _accessibilityLabel = ariaLabel ?? accessibilityLabel;
|
|
377
|
-
|
|
378
|
-
let _accessibilityState: ?TextProps['accessibilityState'] =
|
|
379
|
-
accessibilityState;
|
|
380
|
-
if (
|
|
381
|
-
ariaBusy != null ||
|
|
382
|
-
ariaChecked != null ||
|
|
383
|
-
ariaDisabled != null ||
|
|
384
|
-
ariaExpanded != null ||
|
|
385
|
-
ariaSelected != null
|
|
386
|
-
) {
|
|
387
|
-
if (_accessibilityState != null) {
|
|
388
|
-
_accessibilityState = {
|
|
389
|
-
busy: ariaBusy ?? _accessibilityState.busy,
|
|
390
|
-
checked: ariaChecked ?? _accessibilityState.checked,
|
|
391
|
-
disabled: ariaDisabled ?? _accessibilityState.disabled,
|
|
392
|
-
expanded: ariaExpanded ?? _accessibilityState.expanded,
|
|
393
|
-
selected: ariaSelected ?? _accessibilityState.selected,
|
|
394
|
-
};
|
|
395
|
-
} else {
|
|
396
|
-
_accessibilityState = {
|
|
397
|
-
busy: ariaBusy,
|
|
398
|
-
checked: ariaChecked,
|
|
399
|
-
disabled: ariaDisabled,
|
|
400
|
-
expanded: ariaExpanded,
|
|
401
|
-
selected: ariaSelected,
|
|
402
|
-
};
|
|
403
|
-
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const _accessibilityStateDisabled = _accessibilityState?.disabled;
|
|
121
|
+
const _disabled = disabled ?? _accessibilityStateDisabled;
|
|
122
|
+
|
|
123
|
+
// If the disabled prop and accessibilityState.disabled are out of sync but not both in
|
|
124
|
+
// falsy states we need to update the accessibilityState object to use the disabled prop.
|
|
125
|
+
if (
|
|
126
|
+
_disabled !== _accessibilityStateDisabled &&
|
|
127
|
+
((_disabled != null && _disabled !== false) ||
|
|
128
|
+
(_accessibilityStateDisabled != null &&
|
|
129
|
+
_accessibilityStateDisabled !== false))
|
|
130
|
+
) {
|
|
131
|
+
if (_accessibilityState == null) {
|
|
132
|
+
_accessibilityState = {disabled};
|
|
133
|
+
} else {
|
|
134
|
+
_accessibilityState.disabled = _disabled;
|
|
404
135
|
}
|
|
136
|
+
}
|
|
405
137
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
let _accessibilityElementsHidden =
|
|
410
|
-
ariaHidden ?? accessibilityElementsHidden;
|
|
411
|
-
let _importantForAccessibility = importantForAccessibility;
|
|
138
|
+
if (ariaHidden !== undefined) {
|
|
139
|
+
processedProps.accessibilityElementsHidden = ariaHidden;
|
|
412
140
|
if (ariaHidden === true) {
|
|
413
|
-
|
|
141
|
+
processedProps.importantForAccessibility = 'no-hide-descendants';
|
|
414
142
|
}
|
|
143
|
+
}
|
|
415
144
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
145
|
+
const _accessible = Platform.select({
|
|
146
|
+
ios: accessible !== false,
|
|
147
|
+
android:
|
|
148
|
+
accessible == null ? onPress != null || onLongPress != null : accessible,
|
|
149
|
+
default: accessible,
|
|
150
|
+
});
|
|
421
151
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
152
|
+
const isPressable =
|
|
153
|
+
(onPress != null ||
|
|
154
|
+
onLongPress != null ||
|
|
155
|
+
onStartShouldSetResponder != null) &&
|
|
156
|
+
_disabled !== true;
|
|
427
157
|
|
|
428
|
-
|
|
429
|
-
|
|
158
|
+
const shouldUseLinkRole =
|
|
159
|
+
isPressable && accessibilityRole == null && role == null;
|
|
430
160
|
|
|
431
|
-
|
|
161
|
+
const _accessibilityRole =
|
|
162
|
+
accessibilityRole ?? (shouldUseLinkRole ? 'link' : undefined);
|
|
432
163
|
|
|
433
|
-
|
|
434
|
-
const _selectionColor =
|
|
435
|
-
selectionColor != null ? processColor(selectionColor) : undefined;
|
|
164
|
+
const _role = shouldUseLinkRole ? undefined : role;
|
|
436
165
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
_style = [style, {color: 'magenta'}];
|
|
441
|
-
}
|
|
442
|
-
}
|
|
166
|
+
// TODO: Move this processing to the view configuration.
|
|
167
|
+
const _selectionColor =
|
|
168
|
+
selectionColor != null ? processColor(selectionColor) : undefined;
|
|
443
169
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
`'numberOfLines' in <Text> must be a non-negative number, received: ${_numberOfLines}. The value will be set to 0.`,
|
|
449
|
-
);
|
|
450
|
-
}
|
|
451
|
-
_numberOfLines = 0;
|
|
170
|
+
let _style = style;
|
|
171
|
+
if (__DEV__) {
|
|
172
|
+
if (PressabilityDebug.isEnabled() && onPress != null) {
|
|
173
|
+
_style = [style, {color: 'magenta'}];
|
|
452
174
|
}
|
|
175
|
+
}
|
|
453
176
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
(processedStyle.fontWeight.toString(): TextStyleInternal['fontWeight']);
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
if (processedStyle.userSelect != null) {
|
|
467
|
-
_selectable = userSelectToSelectableMap[processedStyle.userSelect];
|
|
468
|
-
overrides = overrides || ({}: {...TextStyleInternal});
|
|
469
|
-
overrides.userSelect = undefined;
|
|
470
|
-
}
|
|
177
|
+
let _numberOfLines = numberOfLines;
|
|
178
|
+
if (_numberOfLines != null && !(_numberOfLines >= 0)) {
|
|
179
|
+
if (__DEV__) {
|
|
180
|
+
console.error(
|
|
181
|
+
`'numberOfLines' in <Text> must be a non-negative number, received: ${_numberOfLines}. The value will be set to 0.`,
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
_numberOfLines = 0;
|
|
185
|
+
}
|
|
471
186
|
|
|
472
|
-
|
|
473
|
-
overrides = overrides || ({}: {...TextStyleInternal});
|
|
474
|
-
overrides.textAlignVertical =
|
|
475
|
-
verticalAlignToTextAlignVerticalMap[processedStyle.verticalAlign];
|
|
476
|
-
overrides.verticalAlign = undefined;
|
|
477
|
-
}
|
|
187
|
+
let _selectable = selectable;
|
|
478
188
|
|
|
479
|
-
|
|
189
|
+
let processedStyle = flattenStyle<TextStyleProp>(_style);
|
|
190
|
+
if (processedStyle != null) {
|
|
191
|
+
let overrides: ?{...TextStyleInternal} = null;
|
|
192
|
+
if (typeof processedStyle.fontWeight === 'number') {
|
|
193
|
+
overrides = overrides || ({}: {...TextStyleInternal});
|
|
194
|
+
overrides.fontWeight =
|
|
480
195
|
// $FlowFixMe[incompatible-type]
|
|
481
|
-
|
|
482
|
-
}
|
|
196
|
+
(String(processedStyle.fontWeight): TextStyleInternal['fontWeight']);
|
|
483
197
|
}
|
|
484
198
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
if (isPressable) {
|
|
490
|
-
return (
|
|
491
|
-
<NativePressableVirtualText
|
|
492
|
-
ref={forwardedRef}
|
|
493
|
-
textProps={{
|
|
494
|
-
...restProps,
|
|
495
|
-
accessibilityElementsHidden: _accessibilityElementsHidden,
|
|
496
|
-
accessibilityLabel: _accessibilityLabel,
|
|
497
|
-
accessibilityRole: _accessibilityRole,
|
|
498
|
-
accessibilityState: _accessibilityState,
|
|
499
|
-
importantForAccessibility: _importantForAccessibility,
|
|
500
|
-
nativeID: _nativeID,
|
|
501
|
-
numberOfLines: _numberOfLines,
|
|
502
|
-
selectable: _selectable,
|
|
503
|
-
selectionColor: _selectionColor,
|
|
504
|
-
style: _style,
|
|
505
|
-
disabled: disabled,
|
|
506
|
-
role: _role,
|
|
507
|
-
children,
|
|
508
|
-
}}
|
|
509
|
-
textPressabilityProps={{
|
|
510
|
-
onLongPress,
|
|
511
|
-
onPress,
|
|
512
|
-
onPressIn,
|
|
513
|
-
onPressOut,
|
|
514
|
-
onResponderGrant,
|
|
515
|
-
onResponderMove,
|
|
516
|
-
onResponderRelease,
|
|
517
|
-
onResponderTerminate,
|
|
518
|
-
onResponderTerminationRequest,
|
|
519
|
-
onStartShouldSetResponder,
|
|
520
|
-
pressRetentionOffset,
|
|
521
|
-
suppressHighlighting,
|
|
522
|
-
}}
|
|
523
|
-
/>
|
|
524
|
-
);
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
return (
|
|
528
|
-
<NativeVirtualText
|
|
529
|
-
{...restProps}
|
|
530
|
-
accessibilityElementsHidden={_accessibilityElementsHidden}
|
|
531
|
-
accessibilityLabel={_accessibilityLabel}
|
|
532
|
-
accessibilityRole={_accessibilityRole}
|
|
533
|
-
accessibilityState={_accessibilityState}
|
|
534
|
-
importantForAccessibility={_importantForAccessibility}
|
|
535
|
-
nativeID={_nativeID}
|
|
536
|
-
numberOfLines={_numberOfLines}
|
|
537
|
-
ref={forwardedRef}
|
|
538
|
-
selectable={_selectable}
|
|
539
|
-
selectionColor={_selectionColor}
|
|
540
|
-
style={_style}
|
|
541
|
-
disabled={disabled}
|
|
542
|
-
role={_role}>
|
|
543
|
-
{children}
|
|
544
|
-
</NativeVirtualText>
|
|
545
|
-
);
|
|
199
|
+
if (processedStyle.userSelect != null) {
|
|
200
|
+
_selectable = userSelectToSelectableMap[processedStyle.userSelect];
|
|
201
|
+
overrides = overrides || ({}: {...TextStyleInternal});
|
|
202
|
+
overrides.userSelect = undefined;
|
|
546
203
|
}
|
|
547
204
|
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
(_accessibilityStateDisabled != null &&
|
|
554
|
-
_accessibilityStateDisabled !== false))
|
|
555
|
-
) {
|
|
556
|
-
_accessibilityState = {..._accessibilityState, disabled: _disabled};
|
|
205
|
+
if (processedStyle.verticalAlign != null) {
|
|
206
|
+
overrides = overrides || ({}: {...TextStyleInternal});
|
|
207
|
+
overrides.textAlignVertical =
|
|
208
|
+
verticalAlignToTextAlignVerticalMap[processedStyle.verticalAlign];
|
|
209
|
+
overrides.verticalAlign = undefined;
|
|
557
210
|
}
|
|
558
211
|
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
212
|
+
if (overrides != null) {
|
|
213
|
+
// $FlowFixMe[incompatible-type]
|
|
214
|
+
_style = [_style, overrides];
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (ReactNativeFeatureFlags.defaultTextToOverflowHidden()) {
|
|
219
|
+
_style = [styles.default, _style];
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const _nativeID = id ?? nativeID;
|
|
223
|
+
|
|
224
|
+
if (_accessibilityLabel !== undefined) {
|
|
225
|
+
processedProps.accessibilityLabel = _accessibilityLabel;
|
|
226
|
+
}
|
|
227
|
+
if (_accessibilityRole !== undefined) {
|
|
228
|
+
processedProps.accessibilityRole = _accessibilityRole;
|
|
229
|
+
}
|
|
230
|
+
if (_accessibilityState !== undefined) {
|
|
231
|
+
processedProps.accessibilityState = _accessibilityState;
|
|
232
|
+
}
|
|
233
|
+
if (_nativeID !== undefined) {
|
|
234
|
+
processedProps.nativeID = _nativeID;
|
|
235
|
+
}
|
|
236
|
+
if (_numberOfLines !== undefined) {
|
|
237
|
+
processedProps.numberOfLines = _numberOfLines;
|
|
238
|
+
}
|
|
239
|
+
if (_selectable !== undefined) {
|
|
240
|
+
processedProps.selectable = _selectable;
|
|
241
|
+
}
|
|
242
|
+
if (_style !== undefined) {
|
|
243
|
+
processedProps.style = _style;
|
|
244
|
+
}
|
|
245
|
+
if (_selectionColor !== undefined) {
|
|
246
|
+
processedProps.selectionColor = _selectionColor;
|
|
247
|
+
}
|
|
248
|
+
if (_role !== undefined) {
|
|
249
|
+
processedProps.role = _role;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
let textPressabilityProps: ?TextPressabilityProps;
|
|
253
|
+
if (isPressable) {
|
|
254
|
+
textPressabilityProps = {
|
|
255
|
+
onLongPress,
|
|
256
|
+
onPress,
|
|
257
|
+
onPressIn,
|
|
258
|
+
onPressOut,
|
|
259
|
+
onResponderGrant,
|
|
260
|
+
onResponderMove,
|
|
261
|
+
onResponderRelease,
|
|
262
|
+
onResponderTerminate,
|
|
263
|
+
onResponderTerminationRequest,
|
|
264
|
+
onStartShouldSetResponder,
|
|
265
|
+
pressRetentionOffset,
|
|
266
|
+
suppressHighlighting,
|
|
267
|
+
};
|
|
268
|
+
}
|
|
567
269
|
|
|
568
|
-
|
|
270
|
+
const hasTextAncestor = useContext(TextAncestorContext);
|
|
271
|
+
if (hasTextAncestor) {
|
|
272
|
+
processedProps.disabled = disabled;
|
|
273
|
+
processedProps.children = children;
|
|
569
274
|
if (isPressable) {
|
|
570
|
-
|
|
571
|
-
<
|
|
275
|
+
return (
|
|
276
|
+
<PressableVirtualText
|
|
572
277
|
ref={forwardedRef}
|
|
573
|
-
textProps={
|
|
574
|
-
|
|
575
|
-
accessibilityElementsHidden: _accessibilityElementsHidden,
|
|
576
|
-
accessibilityLabel: _accessibilityLabel,
|
|
577
|
-
accessibilityRole: _accessibilityRole,
|
|
578
|
-
accessibilityState: _accessibilityState,
|
|
579
|
-
accessible: _accessible,
|
|
580
|
-
allowFontScaling: allowFontScaling !== false,
|
|
581
|
-
disabled: _disabled,
|
|
582
|
-
ellipsizeMode: ellipsizeMode ?? 'tail',
|
|
583
|
-
importantForAccessibility: _importantForAccessibility,
|
|
584
|
-
nativeID: _nativeID,
|
|
585
|
-
numberOfLines: _numberOfLines,
|
|
586
|
-
selectable: _selectable,
|
|
587
|
-
selectionColor: _selectionColor,
|
|
588
|
-
style: _style,
|
|
589
|
-
role: _role,
|
|
590
|
-
children,
|
|
591
|
-
}}
|
|
592
|
-
textPressabilityProps={{
|
|
593
|
-
onLongPress,
|
|
594
|
-
onPress,
|
|
595
|
-
onPressIn,
|
|
596
|
-
onPressOut,
|
|
597
|
-
onResponderGrant,
|
|
598
|
-
onResponderMove,
|
|
599
|
-
onResponderRelease,
|
|
600
|
-
onResponderTerminate,
|
|
601
|
-
onResponderTerminationRequest,
|
|
602
|
-
onStartShouldSetResponder,
|
|
603
|
-
pressRetentionOffset,
|
|
604
|
-
suppressHighlighting,
|
|
605
|
-
}}
|
|
278
|
+
textProps={processedProps}
|
|
279
|
+
textPressabilityProps={textPressabilityProps ?? {}}
|
|
606
280
|
/>
|
|
607
281
|
);
|
|
608
|
-
} else {
|
|
609
|
-
nativeText = (
|
|
610
|
-
<NativeText
|
|
611
|
-
{...restProps}
|
|
612
|
-
accessibilityElementsHidden={_accessibilityElementsHidden}
|
|
613
|
-
accessibilityLabel={_accessibilityLabel}
|
|
614
|
-
accessibilityRole={_accessibilityRole}
|
|
615
|
-
accessibilityState={_accessibilityState}
|
|
616
|
-
accessible={_accessible}
|
|
617
|
-
allowFontScaling={allowFontScaling !== false}
|
|
618
|
-
disabled={_disabled}
|
|
619
|
-
ellipsizeMode={ellipsizeMode ?? 'tail'}
|
|
620
|
-
importantForAccessibility={_importantForAccessibility}
|
|
621
|
-
nativeID={_nativeID}
|
|
622
|
-
numberOfLines={_numberOfLines}
|
|
623
|
-
ref={forwardedRef}
|
|
624
|
-
selectable={_selectable}
|
|
625
|
-
selectionColor={_selectionColor}
|
|
626
|
-
style={_style}
|
|
627
|
-
role={_role}>
|
|
628
|
-
{children}
|
|
629
|
-
</NativeText>
|
|
630
|
-
);
|
|
631
282
|
}
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
283
|
+
return <NativeVirtualText {...processedProps} ref={forwardedRef} />;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
let nativeText = null;
|
|
287
|
+
|
|
288
|
+
processedProps.accessible = _accessible;
|
|
289
|
+
processedProps.allowFontScaling = allowFontScaling !== false;
|
|
290
|
+
processedProps.disabled = _disabled;
|
|
291
|
+
processedProps.ellipsizeMode = ellipsizeMode ?? 'tail';
|
|
292
|
+
processedProps.children = children;
|
|
293
|
+
|
|
294
|
+
if (isPressable) {
|
|
295
|
+
nativeText = (
|
|
296
|
+
<PressableText
|
|
297
|
+
ref={forwardedRef}
|
|
298
|
+
selectable={_selectable}
|
|
299
|
+
textProps={processedProps}
|
|
300
|
+
textPressabilityProps={textPressabilityProps ?? {}}
|
|
301
|
+
/>
|
|
302
|
+
);
|
|
303
|
+
} else {
|
|
304
|
+
nativeText =
|
|
305
|
+
_selectable === true ? (
|
|
306
|
+
<NativeSelectableText {...processedProps} ref={forwardedRef} />
|
|
307
|
+
) : (
|
|
308
|
+
<NativeText {...processedProps} ref={forwardedRef} />
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
if (children == null) {
|
|
313
|
+
return nativeText;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// If the children do not contain a JSX element it would not be possible to have a
|
|
317
|
+
// nested `Text` component so we can skip adding the `TextAncestorContext` context wrapper
|
|
318
|
+
// which has a performance overhead. Since we do this for performance reasons we need
|
|
319
|
+
// to keep the check simple to avoid regressing overall perf. For this reason the
|
|
320
|
+
// `children.length` constant is set to `3`, this should be a reasonable tradeoff
|
|
321
|
+
// to capture the majority of `Text` uses but also not make this check too expensive.
|
|
322
|
+
if (Array.isArray(children) && children.length <= 3) {
|
|
323
|
+
let hasNonTextChild = false;
|
|
324
|
+
for (let child of children) {
|
|
325
|
+
if (child != null && typeof child === 'object') {
|
|
326
|
+
hasNonTextChild = true;
|
|
327
|
+
break;
|
|
653
328
|
}
|
|
654
|
-
}
|
|
329
|
+
}
|
|
330
|
+
if (!hasNonTextChild) {
|
|
655
331
|
return nativeText;
|
|
656
332
|
}
|
|
333
|
+
} else if (typeof children !== 'object') {
|
|
334
|
+
return nativeText;
|
|
335
|
+
}
|
|
657
336
|
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
_TextImpl = TextImplLegacy;
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
const TextImpl: component(
|
|
664
|
-
ref?: React.RefSetter<TextForwardRef>,
|
|
665
|
-
...props: TextProps
|
|
666
|
-
) = _TextImpl;
|
|
337
|
+
return <TextAncestorContext value={true}>{nativeText}</TextAncestorContext>;
|
|
338
|
+
};
|
|
667
339
|
|
|
668
340
|
TextImpl.displayName = 'Text';
|
|
669
341
|
|
|
670
|
-
type TextPressabilityProps =
|
|
342
|
+
type TextPressabilityProps = Readonly<{
|
|
671
343
|
onLongPress?: ?(event: GestureResponderEvent) => unknown,
|
|
672
344
|
onPress?: ?(event: GestureResponderEvent) => unknown,
|
|
673
345
|
onPressIn?: ?(event: GestureResponderEvent) => unknown,
|
|
@@ -801,28 +473,17 @@ function useTextPressability({
|
|
|
801
473
|
);
|
|
802
474
|
}
|
|
803
475
|
|
|
804
|
-
type NativePressableTextProps = $ReadOnly<{
|
|
805
|
-
textProps: NativeTextProps,
|
|
806
|
-
textPressabilityProps: TextPressabilityProps,
|
|
807
|
-
}>;
|
|
808
|
-
|
|
809
476
|
/**
|
|
810
477
|
* Wrap the NativeVirtualText component and initialize pressability.
|
|
811
478
|
*
|
|
812
479
|
* This logic is split out from the main Text component to enable the more
|
|
813
480
|
* expensive pressability logic to be only initialized when needed.
|
|
814
481
|
*/
|
|
815
|
-
|
|
816
|
-
ref: React.RefSetter<TextForwardRef>,
|
|
817
|
-
...props: NativePressableTextProps
|
|
818
|
-
) = ({
|
|
819
|
-
ref: forwardedRef,
|
|
820
|
-
textProps,
|
|
821
|
-
textPressabilityProps,
|
|
822
|
-
}: {
|
|
482
|
+
component PressableVirtualText(
|
|
823
483
|
ref?: React.RefSetter<TextForwardRef>,
|
|
824
|
-
|
|
825
|
-
|
|
484
|
+
textProps: NativeTextProps,
|
|
485
|
+
textPressabilityProps: TextPressabilityProps,
|
|
486
|
+
) {
|
|
826
487
|
const [isHighlighted, eventHandlersForText] = useTextPressability(
|
|
827
488
|
textPressabilityProps,
|
|
828
489
|
);
|
|
@@ -833,42 +494,40 @@ const NativePressableVirtualText: component(
|
|
|
833
494
|
{...eventHandlersForText}
|
|
834
495
|
isHighlighted={isHighlighted}
|
|
835
496
|
isPressable={true}
|
|
836
|
-
ref={
|
|
497
|
+
ref={ref}
|
|
837
498
|
/>
|
|
838
499
|
);
|
|
839
|
-
}
|
|
500
|
+
}
|
|
840
501
|
|
|
841
502
|
/**
|
|
842
|
-
* Wrap
|
|
503
|
+
* Wrap a NativeText component and initialize pressability.
|
|
843
504
|
*
|
|
844
505
|
* This logic is split out from the main Text component to enable the more
|
|
845
506
|
* expensive pressability logic to be only initialized when needed.
|
|
846
507
|
*/
|
|
847
|
-
|
|
848
|
-
ref: React.RefSetter<TextForwardRef>,
|
|
849
|
-
...props: NativePressableTextProps
|
|
850
|
-
) = ({
|
|
851
|
-
ref: forwardedRef,
|
|
852
|
-
textProps,
|
|
853
|
-
textPressabilityProps,
|
|
854
|
-
}: {
|
|
508
|
+
component PressableText(
|
|
855
509
|
ref?: React.RefSetter<TextForwardRef>,
|
|
856
|
-
|
|
857
|
-
|
|
510
|
+
selectable?: ?boolean,
|
|
511
|
+
textProps: NativeTextProps,
|
|
512
|
+
textPressabilityProps: TextPressabilityProps,
|
|
513
|
+
) {
|
|
858
514
|
const [isHighlighted, eventHandlersForText] = useTextPressability(
|
|
859
515
|
textPressabilityProps,
|
|
860
516
|
);
|
|
861
517
|
|
|
518
|
+
const NativeComponent =
|
|
519
|
+
selectable === true ? NativeSelectableText : NativeText;
|
|
520
|
+
|
|
862
521
|
return (
|
|
863
|
-
<
|
|
522
|
+
<NativeComponent
|
|
864
523
|
{...textProps}
|
|
865
524
|
{...eventHandlersForText}
|
|
866
525
|
isHighlighted={isHighlighted}
|
|
867
526
|
isPressable={true}
|
|
868
|
-
ref={
|
|
527
|
+
ref={ref}
|
|
869
528
|
/>
|
|
870
529
|
);
|
|
871
|
-
}
|
|
530
|
+
}
|
|
872
531
|
|
|
873
532
|
const userSelectToSelectableMap = {
|
|
874
533
|
auto: true,
|
|
@@ -885,4 +544,13 @@ const verticalAlignToTextAlignVerticalMap = {
|
|
|
885
544
|
middle: 'center',
|
|
886
545
|
} as const;
|
|
887
546
|
|
|
547
|
+
const styles = StyleSheet.create({
|
|
548
|
+
// Native components have historically acted like overflow: 'hidden'. We set
|
|
549
|
+
// this, as part of the default style, to let client differentiate with
|
|
550
|
+
// overflow: 'visible'.
|
|
551
|
+
default: {
|
|
552
|
+
overflow: 'hidden',
|
|
553
|
+
},
|
|
554
|
+
});
|
|
555
|
+
|
|
888
556
|
export default TextImpl;
|