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/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java
DELETED
|
@@ -1,1411 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
package com.facebook.react.fabric.mounting;
|
|
9
|
-
|
|
10
|
-
import static com.facebook.infer.annotation.ThreadConfined.ANY;
|
|
11
|
-
import static com.facebook.infer.annotation.ThreadConfined.UI;
|
|
12
|
-
|
|
13
|
-
import android.annotation.SuppressLint;
|
|
14
|
-
import android.view.View;
|
|
15
|
-
import android.view.ViewGroup;
|
|
16
|
-
import android.view.ViewParent;
|
|
17
|
-
import androidx.annotation.AnyThread;
|
|
18
|
-
import androidx.annotation.NonNull;
|
|
19
|
-
import androidx.annotation.Nullable;
|
|
20
|
-
import androidx.annotation.UiThread;
|
|
21
|
-
import androidx.collection.SparseArrayCompat;
|
|
22
|
-
import com.facebook.common.logging.FLog;
|
|
23
|
-
import com.facebook.infer.annotation.Assertions;
|
|
24
|
-
import com.facebook.infer.annotation.ThreadConfined;
|
|
25
|
-
import com.facebook.react.bridge.GuardedRunnable;
|
|
26
|
-
import com.facebook.react.bridge.ReactNoCrashSoftException;
|
|
27
|
-
import com.facebook.react.bridge.ReactSoftExceptionLogger;
|
|
28
|
-
import com.facebook.react.bridge.ReadableArray;
|
|
29
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
30
|
-
import com.facebook.react.bridge.ReadableType;
|
|
31
|
-
import com.facebook.react.bridge.RetryableMountingLayerException;
|
|
32
|
-
import com.facebook.react.bridge.SoftAssertions;
|
|
33
|
-
import com.facebook.react.bridge.UiThreadUtil;
|
|
34
|
-
import com.facebook.react.bridge.WritableArray;
|
|
35
|
-
import com.facebook.react.bridge.WritableMap;
|
|
36
|
-
import com.facebook.react.bridge.WritableNativeArray;
|
|
37
|
-
import com.facebook.react.bridge.WritableNativeMap;
|
|
38
|
-
import com.facebook.react.common.annotations.UnstableReactNativeAPI;
|
|
39
|
-
import com.facebook.react.common.build.ReactBuildConfig;
|
|
40
|
-
import com.facebook.react.common.mapbuffer.MapBuffer;
|
|
41
|
-
import com.facebook.react.fabric.events.EventEmitterWrapper;
|
|
42
|
-
import com.facebook.react.fabric.mounting.MountingManager.MountItemExecutor;
|
|
43
|
-
import com.facebook.react.fabric.mounting.mountitems.MountItem;
|
|
44
|
-
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags;
|
|
45
|
-
import com.facebook.react.touch.JSResponderHandler;
|
|
46
|
-
import com.facebook.react.uimanager.IViewGroupManager;
|
|
47
|
-
import com.facebook.react.uimanager.IllegalViewOperationException;
|
|
48
|
-
import com.facebook.react.uimanager.ReactOverflowViewWithInset;
|
|
49
|
-
import com.facebook.react.uimanager.ReactRoot;
|
|
50
|
-
import com.facebook.react.uimanager.ReactStylesDiffMap;
|
|
51
|
-
import com.facebook.react.uimanager.RootView;
|
|
52
|
-
import com.facebook.react.uimanager.RootViewManager;
|
|
53
|
-
import com.facebook.react.uimanager.StateWrapper;
|
|
54
|
-
import com.facebook.react.uimanager.ThemedReactContext;
|
|
55
|
-
import com.facebook.react.uimanager.ViewManager;
|
|
56
|
-
import com.facebook.react.uimanager.ViewManagerRegistry;
|
|
57
|
-
import com.facebook.react.uimanager.events.EventCategoryDef;
|
|
58
|
-
import com.facebook.systrace.Systrace;
|
|
59
|
-
import java.util.ArrayDeque;
|
|
60
|
-
import java.util.ArrayList;
|
|
61
|
-
import java.util.HashMap;
|
|
62
|
-
import java.util.HashSet;
|
|
63
|
-
import java.util.LinkedList;
|
|
64
|
-
import java.util.Map;
|
|
65
|
-
import java.util.Queue;
|
|
66
|
-
import java.util.Set;
|
|
67
|
-
import java.util.concurrent.ConcurrentHashMap;
|
|
68
|
-
|
|
69
|
-
public class SurfaceMountingManager {
|
|
70
|
-
public static final String TAG = SurfaceMountingManager.class.getSimpleName();
|
|
71
|
-
|
|
72
|
-
private static final boolean SHOW_CHANGED_VIEW_HIERARCHIES = ReactBuildConfig.DEBUG && false;
|
|
73
|
-
private static final String PROP_TRANSFORM = "transform";
|
|
74
|
-
private static final String PROP_OPACITY = "opacity";
|
|
75
|
-
|
|
76
|
-
private volatile boolean mIsStopped = false;
|
|
77
|
-
private volatile boolean mRootViewAttached = false;
|
|
78
|
-
|
|
79
|
-
@Nullable private ThemedReactContext mThemedReactContext;
|
|
80
|
-
|
|
81
|
-
// These are all non-null, until StopSurface is called
|
|
82
|
-
private ConcurrentHashMap<Integer, ViewState> mTagToViewState =
|
|
83
|
-
new ConcurrentHashMap<>(); // any thread
|
|
84
|
-
private final Queue<MountItem> mOnViewAttachMountItems = new ArrayDeque<>();
|
|
85
|
-
private JSResponderHandler mJSResponderHandler;
|
|
86
|
-
private final ViewManagerRegistry mViewManagerRegistry;
|
|
87
|
-
private RootViewManager mRootViewManager;
|
|
88
|
-
private MountItemExecutor mMountItemExecutor;
|
|
89
|
-
|
|
90
|
-
@ThreadConfined(UI)
|
|
91
|
-
private final Set<Integer> mErroneouslyReaddedReactTags = new HashSet<>();
|
|
92
|
-
|
|
93
|
-
// This set is used to keep track of views that are currently being interacted with (i.e.
|
|
94
|
-
// views that saw a ACTION_DOWN but not a ACTION_UP event yet). This is used to prevent
|
|
95
|
-
// views from being removed while they are being interacted with as their event emitter will
|
|
96
|
-
// also be removed, and `Pressables` will look "stuck".
|
|
97
|
-
@ThreadConfined(UI)
|
|
98
|
-
private final Set<Integer> mViewsWithActiveTouches = new HashSet<>();
|
|
99
|
-
|
|
100
|
-
// This set contains the views that are scheduled to be removed after their touch finishes.
|
|
101
|
-
@ThreadConfined(UI)
|
|
102
|
-
private final Set<Integer> mViewsToDeleteAfterTouchFinishes = new HashSet<>();
|
|
103
|
-
|
|
104
|
-
// This is null *until* StopSurface is called.
|
|
105
|
-
private SparseArrayCompat<Object> mTagSetForStoppedSurface;
|
|
106
|
-
|
|
107
|
-
// This is to make sure direct manipulation result will not be overridden by React update.
|
|
108
|
-
@ThreadConfined(UI)
|
|
109
|
-
private final SparseArrayCompat<Map<String, Object>> mTagToSynchronousMountProps =
|
|
110
|
-
new SparseArrayCompat<>();
|
|
111
|
-
|
|
112
|
-
private final int mSurfaceId;
|
|
113
|
-
|
|
114
|
-
public SurfaceMountingManager(
|
|
115
|
-
int surfaceId,
|
|
116
|
-
@NonNull JSResponderHandler jsResponderHandler,
|
|
117
|
-
@NonNull ViewManagerRegistry viewManagerRegistry,
|
|
118
|
-
@NonNull RootViewManager rootViewManager,
|
|
119
|
-
@NonNull MountItemExecutor mountItemExecutor,
|
|
120
|
-
@NonNull ThemedReactContext reactContext) {
|
|
121
|
-
mSurfaceId = surfaceId;
|
|
122
|
-
mJSResponderHandler = jsResponderHandler;
|
|
123
|
-
mViewManagerRegistry = viewManagerRegistry;
|
|
124
|
-
mRootViewManager = rootViewManager;
|
|
125
|
-
mMountItemExecutor = mountItemExecutor;
|
|
126
|
-
mThemedReactContext = reactContext;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
public boolean isStopped() {
|
|
130
|
-
return mIsStopped;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
public void attachRootView(View rootView, ThemedReactContext themedReactContext) {
|
|
134
|
-
mThemedReactContext = themedReactContext;
|
|
135
|
-
addRootView(rootView);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
public int getSurfaceId() {
|
|
139
|
-
return mSurfaceId;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
public boolean isRootViewAttached() {
|
|
143
|
-
return mRootViewAttached;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
@Nullable
|
|
147
|
-
public ThemedReactContext getContext() {
|
|
148
|
-
return mThemedReactContext;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
private static void logViewHierarchy(ViewGroup parent, boolean recurse) {
|
|
152
|
-
int parentTag = parent.getId();
|
|
153
|
-
FLog.e(TAG, " <ViewGroup tag=" + parentTag + " class=" + parent.getClass().toString() + ">");
|
|
154
|
-
for (int i = 0; i < parent.getChildCount(); i++) {
|
|
155
|
-
FLog.e(
|
|
156
|
-
TAG,
|
|
157
|
-
" <View idx="
|
|
158
|
-
+ i
|
|
159
|
-
+ " tag="
|
|
160
|
-
+ parent.getChildAt(i).getId()
|
|
161
|
-
+ " class="
|
|
162
|
-
+ parent.getChildAt(i).getClass().toString()
|
|
163
|
-
+ ">");
|
|
164
|
-
}
|
|
165
|
-
FLog.e(TAG, " </ViewGroup tag=" + parentTag + ">");
|
|
166
|
-
|
|
167
|
-
if (recurse) {
|
|
168
|
-
FLog.e(TAG, "Displaying Ancestors:");
|
|
169
|
-
ViewParent ancestor = parent.getParent();
|
|
170
|
-
while (ancestor != null) {
|
|
171
|
-
ViewGroup ancestorViewGroup = (ancestor instanceof ViewGroup ? (ViewGroup) ancestor : null);
|
|
172
|
-
int ancestorId = ancestorViewGroup == null ? View.NO_ID : ancestorViewGroup.getId();
|
|
173
|
-
FLog.e(
|
|
174
|
-
TAG,
|
|
175
|
-
"<ViewParent tag=" + ancestorId + " class=" + ancestor.getClass().toString() + ">");
|
|
176
|
-
ancestor = ancestor.getParent();
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
public boolean getViewExists(int tag) {
|
|
182
|
-
// If Surface stopped, check if tag *was* associated with this Surface, even though it's been
|
|
183
|
-
// deleted. This helps distinguish between scenarios where an invalid tag is referenced, vs
|
|
184
|
-
// race conditions where an imperative method is called on a tag during/just after StopSurface.
|
|
185
|
-
if (mTagSetForStoppedSurface != null && mTagSetForStoppedSurface.containsKey(tag)) {
|
|
186
|
-
return true;
|
|
187
|
-
}
|
|
188
|
-
if (mTagToViewState == null) {
|
|
189
|
-
return false;
|
|
190
|
-
}
|
|
191
|
-
return mTagToViewState.containsKey(tag);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
@UiThread
|
|
195
|
-
@ThreadConfined(UI)
|
|
196
|
-
public void scheduleMountItemOnViewAttach(MountItem item) {
|
|
197
|
-
mOnViewAttachMountItems.add(item);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
@AnyThread
|
|
201
|
-
private void addRootView(@NonNull final View rootView) {
|
|
202
|
-
if (isStopped()) {
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
mTagToViewState.put(mSurfaceId, new ViewState(mSurfaceId, rootView, mRootViewManager, true));
|
|
207
|
-
|
|
208
|
-
Runnable runnable =
|
|
209
|
-
new GuardedRunnable(Assertions.assertNotNull(mThemedReactContext)) {
|
|
210
|
-
@Override
|
|
211
|
-
public void runGuarded() {
|
|
212
|
-
// The CPU has ticked since `addRootView` was called, so the surface could technically
|
|
213
|
-
// have already stopped here.
|
|
214
|
-
if (isStopped()) {
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
if (rootView.getId() == mSurfaceId) {
|
|
219
|
-
ReactSoftExceptionLogger.logSoftException(
|
|
220
|
-
TAG,
|
|
221
|
-
new IllegalViewOperationException(
|
|
222
|
-
"Race condition in addRootView detected. Trying to set an id of ["
|
|
223
|
-
+ mSurfaceId
|
|
224
|
-
+ "] on the RootView, but that id has already been set. "));
|
|
225
|
-
} else if (rootView.getId() != View.NO_ID) {
|
|
226
|
-
FLog.e(
|
|
227
|
-
TAG,
|
|
228
|
-
"Trying to add RootTag to RootView that already has a tag: existing tag: [%d] new"
|
|
229
|
-
+ " tag: [%d]",
|
|
230
|
-
rootView.getId(),
|
|
231
|
-
mSurfaceId);
|
|
232
|
-
// This behavior can not be guaranteed in hybrid apps that have a native android layer
|
|
233
|
-
// over which reactRootViews are added and the native views need to have ids on them
|
|
234
|
-
// in order to work. Hence this can cause unnecessary crashes at runtime for hybrid
|
|
235
|
-
// apps. So converting this to a soft exception such that pure react-native devs can
|
|
236
|
-
// still see the warning while hybrid apps continue to run without crashes
|
|
237
|
-
ReactSoftExceptionLogger.logSoftException(
|
|
238
|
-
TAG,
|
|
239
|
-
new IllegalViewOperationException(
|
|
240
|
-
"Trying to add a root view with an explicit id already set. React Native uses"
|
|
241
|
-
+ " the id field to track react tags and will overwrite this field. If"
|
|
242
|
-
+ " that is fine, explicitly overwrite the id field to View.NO_ID before"
|
|
243
|
-
+ " calling addRootView."));
|
|
244
|
-
}
|
|
245
|
-
rootView.setId(mSurfaceId);
|
|
246
|
-
|
|
247
|
-
if (rootView instanceof ReactRoot) {
|
|
248
|
-
((ReactRoot) rootView).setRootViewTag(mSurfaceId);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
executeMountItemsOnViewAttach();
|
|
252
|
-
|
|
253
|
-
// By doing this after `executeMountItemsOnViewAttach`, we ensure that any operations
|
|
254
|
-
// scheduled while processing this queue are also added to the queue, instead of being
|
|
255
|
-
// processed immediately through the queue in `MountItemDispatcher`.
|
|
256
|
-
mRootViewAttached = true;
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
if (UiThreadUtil.isOnUiThread()) {
|
|
261
|
-
runnable.run();
|
|
262
|
-
} else {
|
|
263
|
-
UiThreadUtil.runOnUiThread(runnable);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
@UiThread
|
|
268
|
-
@ThreadConfined(UI)
|
|
269
|
-
private void executeMountItemsOnViewAttach() {
|
|
270
|
-
mMountItemExecutor.executeItems(mOnViewAttachMountItems);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
* Stop surface and all operations within it. Garbage-collect Views (caller is responsible for
|
|
275
|
-
* removing RootView from View layer).
|
|
276
|
-
*
|
|
277
|
-
* <p>Delete rootView from cache. Since RN does not control the RootView, in a sense, the fragment
|
|
278
|
-
* is responsible for actually removing the RootView from the hierarchy / tearing down the
|
|
279
|
-
* fragment.
|
|
280
|
-
*
|
|
281
|
-
* <p>In the original version(s) of this function, we recursively went through all children of the
|
|
282
|
-
* View and dropped those Views as well; ad infinitum. This was before we had a
|
|
283
|
-
* SurfaceMountingManager, and all tags were in one global map. Doing this was particularly
|
|
284
|
-
* important in the case of StopSurface, where race conditions between threads meant you couldn't
|
|
285
|
-
* rely on DELETE instructions actually deleting all Views in the Surface.
|
|
286
|
-
*
|
|
287
|
-
* <p>Now that we have SurfaceMountingManager, we can simply drop our local reference to the View.
|
|
288
|
-
* Since it will be removed from the View hierarchy entirely (outside of the scope of this class),
|
|
289
|
-
* garbage collection will take care of destroying it and all descendents.
|
|
290
|
-
*/
|
|
291
|
-
@AnyThread
|
|
292
|
-
public void stopSurface() {
|
|
293
|
-
FLog.e(TAG, "Stopping surface [" + mSurfaceId + "]");
|
|
294
|
-
if (isStopped()) {
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
// Prevent more views from being created, or the hierarchy from being manipulated at all. This
|
|
299
|
-
// causes further operations to noop.
|
|
300
|
-
mIsStopped = true;
|
|
301
|
-
|
|
302
|
-
// Reset all StateWrapper objects
|
|
303
|
-
// Since this can happen on any thread, is it possible to race between StateWrapper destruction
|
|
304
|
-
// and some accesses from View classes in the UI thread?
|
|
305
|
-
for (ViewState viewState : mTagToViewState.values()) {
|
|
306
|
-
if (viewState.mStateWrapper != null) {
|
|
307
|
-
viewState.mStateWrapper.destroyState();
|
|
308
|
-
viewState.mStateWrapper = null;
|
|
309
|
-
}
|
|
310
|
-
if (viewState.mEventEmitter != null) {
|
|
311
|
-
viewState.mEventEmitter.destroy();
|
|
312
|
-
viewState.mEventEmitter = null;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
Runnable runnable =
|
|
317
|
-
() -> {
|
|
318
|
-
if (ReactNativeFeatureFlags.enableViewRecycling()) {
|
|
319
|
-
mViewManagerRegistry.onSurfaceStopped(mSurfaceId);
|
|
320
|
-
}
|
|
321
|
-
mTagSetForStoppedSurface = new SparseArrayCompat<>();
|
|
322
|
-
for (Map.Entry<Integer, ViewState> entry : mTagToViewState.entrySet()) {
|
|
323
|
-
// Using this as a placeholder value in the map. We're using SparseArrayCompat
|
|
324
|
-
// since it can efficiently represent the list of pending tags
|
|
325
|
-
mTagSetForStoppedSurface.put(entry.getKey(), this);
|
|
326
|
-
|
|
327
|
-
// We must call `onDropViewInstance` on all remaining Views
|
|
328
|
-
onViewStateDeleted(entry.getValue());
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
// Evict all views from cache and memory
|
|
332
|
-
// TODO: clear instead of nulling out to simplify null-safety in this class
|
|
333
|
-
mTagToViewState = null;
|
|
334
|
-
mJSResponderHandler = null;
|
|
335
|
-
mRootViewManager = null;
|
|
336
|
-
mMountItemExecutor = null;
|
|
337
|
-
mThemedReactContext = null;
|
|
338
|
-
mOnViewAttachMountItems.clear();
|
|
339
|
-
mTagToSynchronousMountProps.clear();
|
|
340
|
-
|
|
341
|
-
FLog.e(TAG, "Surface [" + mSurfaceId + "] was stopped on SurfaceMountingManager.");
|
|
342
|
-
};
|
|
343
|
-
|
|
344
|
-
if (UiThreadUtil.isOnUiThread()) {
|
|
345
|
-
runnable.run();
|
|
346
|
-
} else {
|
|
347
|
-
UiThreadUtil.runOnUiThread(runnable);
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
@UiThread
|
|
352
|
-
public void addViewAt(final int parentTag, final int tag, final int index) {
|
|
353
|
-
UiThreadUtil.assertOnUiThread();
|
|
354
|
-
if (isStopped()) {
|
|
355
|
-
return;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
ViewState parentViewState = getViewState(parentTag);
|
|
359
|
-
if (!(parentViewState.mView instanceof ViewGroup)) {
|
|
360
|
-
String message =
|
|
361
|
-
"Unable to add a view into a view that is not a ViewGroup. ParentTag: "
|
|
362
|
-
+ parentTag
|
|
363
|
-
+ " - Tag: "
|
|
364
|
-
+ tag
|
|
365
|
-
+ " - Index: "
|
|
366
|
-
+ index;
|
|
367
|
-
FLog.e(TAG, message);
|
|
368
|
-
throw new IllegalStateException(message);
|
|
369
|
-
}
|
|
370
|
-
final ViewGroup parentView = (ViewGroup) parentViewState.mView;
|
|
371
|
-
ViewState viewState = getViewState(tag);
|
|
372
|
-
final View view = viewState.mView;
|
|
373
|
-
if (view == null) {
|
|
374
|
-
throw new IllegalStateException(
|
|
375
|
-
"Unable to find view for viewState " + viewState + " and tag " + tag);
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
// Display children before inserting
|
|
379
|
-
if (SHOW_CHANGED_VIEW_HIERARCHIES) {
|
|
380
|
-
FLog.e(TAG, "addViewAt: [" + tag + "] -> [" + parentTag + "] idx: " + index + " BEFORE");
|
|
381
|
-
logViewHierarchy(parentView, false);
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
ViewParent viewParent = view.getParent();
|
|
385
|
-
if (viewParent != null) {
|
|
386
|
-
int actualParentId =
|
|
387
|
-
viewParent instanceof ViewGroup ? ((ViewGroup) viewParent).getId() : View.NO_ID;
|
|
388
|
-
ReactSoftExceptionLogger.logSoftException(
|
|
389
|
-
TAG,
|
|
390
|
-
new IllegalStateException(
|
|
391
|
-
"addViewAt: cannot insert view ["
|
|
392
|
-
+ tag
|
|
393
|
-
+ "] into parent ["
|
|
394
|
-
+ parentTag
|
|
395
|
-
+ "]: View already has a parent: ["
|
|
396
|
-
+ actualParentId
|
|
397
|
-
+ "] "
|
|
398
|
-
+ " Parent: "
|
|
399
|
-
+ viewParent.getClass().getSimpleName()
|
|
400
|
-
+ " View: "
|
|
401
|
-
+ view.getClass().getSimpleName()));
|
|
402
|
-
|
|
403
|
-
// We've hit an error case, and `addView` will crash below
|
|
404
|
-
// if we don't take evasive action (it is an error to add a View
|
|
405
|
-
// to the hierarchy if it already has a parent).
|
|
406
|
-
// We don't know /why/ this happens yet, but it does happen
|
|
407
|
-
// very infrequently in production.
|
|
408
|
-
// Thus, we do three things here:
|
|
409
|
-
// (1) We logged a SoftException above, so if there's a crash later
|
|
410
|
-
// on, we might have some hints about what caused it.
|
|
411
|
-
// (2) We remove the View from its parent.
|
|
412
|
-
// (3) In case the View was removed from the hierarchy with the
|
|
413
|
-
// RemoveDeleteTree instruction, and is now being readded - which
|
|
414
|
-
// should be impossible - we mark this as a "readded" View and
|
|
415
|
-
// thus prevent the RemoveDeleteTree worker from deleting this
|
|
416
|
-
// View in the future.
|
|
417
|
-
if (viewParent instanceof ViewGroup) {
|
|
418
|
-
((ViewGroup) viewParent).removeView(view);
|
|
419
|
-
}
|
|
420
|
-
mErroneouslyReaddedReactTags.add(tag);
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
try {
|
|
424
|
-
getViewGroupManager(parentViewState).addView(parentView, view, index);
|
|
425
|
-
} catch (IllegalStateException | IndexOutOfBoundsException e) {
|
|
426
|
-
// Wrap error with more context for debugging
|
|
427
|
-
throw new IllegalStateException(
|
|
428
|
-
"addViewAt: failed to insert view ["
|
|
429
|
-
+ tag
|
|
430
|
-
+ "] into parent ["
|
|
431
|
-
+ parentTag
|
|
432
|
-
+ "] at index "
|
|
433
|
-
+ index,
|
|
434
|
-
e);
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
// Display children after inserting
|
|
438
|
-
if (SHOW_CHANGED_VIEW_HIERARCHIES) {
|
|
439
|
-
// Why are we calling `runOnUiThread`? We're already on the UI thread, right?!
|
|
440
|
-
// Yes - but if you get the children of the View here and display them, *it might show you
|
|
441
|
-
// the previous children*. Without getting too much into Android internals, basically if we
|
|
442
|
-
// wait a tick, everything is what we expect.
|
|
443
|
-
// tldr is that `parent.children == []; parent.addView(x); parent.children == []`
|
|
444
|
-
// and you need to wait a tick for `parent.children == [x]`.
|
|
445
|
-
UiThreadUtil.runOnUiThread(
|
|
446
|
-
new Runnable() {
|
|
447
|
-
@Override
|
|
448
|
-
public void run() {
|
|
449
|
-
FLog.e(
|
|
450
|
-
TAG, "addViewAt: [" + tag + "] -> [" + parentTag + "] idx: " + index + " AFTER");
|
|
451
|
-
logViewHierarchy(parentView, false);
|
|
452
|
-
}
|
|
453
|
-
});
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
@UiThread
|
|
458
|
-
public void removeViewAt(final int tag, final int parentTag, int index) {
|
|
459
|
-
if (isStopped()) {
|
|
460
|
-
return;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
// This is "impossible". See comments above.
|
|
464
|
-
if (mErroneouslyReaddedReactTags.contains(tag)) {
|
|
465
|
-
ReactSoftExceptionLogger.logSoftException(
|
|
466
|
-
TAG,
|
|
467
|
-
new IllegalViewOperationException(
|
|
468
|
-
"removeViewAt tried to remove a React View that was actually reused. This indicates a"
|
|
469
|
-
+ " bug in the Differ (specifically instruction ordering). ["
|
|
470
|
-
+ tag
|
|
471
|
-
+ "]"));
|
|
472
|
-
return;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
UiThreadUtil.assertOnUiThread();
|
|
476
|
-
ViewState parentViewState = getNullableViewState(parentTag);
|
|
477
|
-
|
|
478
|
-
// TODO: throw exception here?
|
|
479
|
-
if (parentViewState == null) {
|
|
480
|
-
ReactSoftExceptionLogger.logSoftException(
|
|
481
|
-
ReactSoftExceptionLogger.Categories.SURFACE_MOUNTING_MANAGER_MISSING_VIEWSTATE,
|
|
482
|
-
new IllegalStateException(
|
|
483
|
-
"Unable to find viewState for tag: [" + parentTag + "] for removeViewAt"));
|
|
484
|
-
return;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
if (!(parentViewState.mView instanceof ViewGroup)) {
|
|
488
|
-
String message =
|
|
489
|
-
"Unable to remove a view from a view that is not a ViewGroup. ParentTag: "
|
|
490
|
-
+ parentTag
|
|
491
|
-
+ " - Tag: "
|
|
492
|
-
+ tag
|
|
493
|
-
+ " - Index: "
|
|
494
|
-
+ index;
|
|
495
|
-
FLog.e(TAG, message);
|
|
496
|
-
throw new IllegalStateException(message);
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
final ViewGroup parentView = (ViewGroup) parentViewState.mView;
|
|
500
|
-
|
|
501
|
-
if (parentView == null) {
|
|
502
|
-
throw new IllegalStateException("Unable to find view for tag [" + parentTag + "]");
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
if (SHOW_CHANGED_VIEW_HIERARCHIES) {
|
|
506
|
-
// Display children before deleting any
|
|
507
|
-
FLog.e(TAG, "removeViewAt: [" + tag + "] -> [" + parentTag + "] idx: " + index + " BEFORE");
|
|
508
|
-
logViewHierarchy(parentView, false);
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
IViewGroupManager<ViewGroup> viewGroupManager = getViewGroupManager(parentViewState);
|
|
512
|
-
|
|
513
|
-
// Verify that the view we're about to remove has the same tag we expect
|
|
514
|
-
View view = viewGroupManager.getChildAt(parentView, index);
|
|
515
|
-
int actualTag = (view != null ? view.getId() : -1);
|
|
516
|
-
if (actualTag != tag) {
|
|
517
|
-
int tagActualIndex = -1;
|
|
518
|
-
int parentChildrenCount = parentView.getChildCount();
|
|
519
|
-
for (int i = 0; i < parentChildrenCount; i++) {
|
|
520
|
-
if (parentView.getChildAt(i).getId() == tag) {
|
|
521
|
-
tagActualIndex = i;
|
|
522
|
-
break;
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
// TODO T74425739: previously, we did not do this check and `removeViewAt` would be executed
|
|
527
|
-
// below, sometimes crashing there. *However*, interestingly enough, `removeViewAt` would not
|
|
528
|
-
// complain if you removed views from an already-empty parent. This seems necessary currently
|
|
529
|
-
// for certain ViewManagers that remove their own children - like BottomSheet?
|
|
530
|
-
// This workaround seems not-great, but for now, we just return here for
|
|
531
|
-
// backwards-compatibility. Essentially, if a view has already been removed from the
|
|
532
|
-
// hierarchy, we treat it as a noop.
|
|
533
|
-
if (tagActualIndex == -1) {
|
|
534
|
-
FLog.e(
|
|
535
|
-
TAG,
|
|
536
|
-
"removeViewAt: ["
|
|
537
|
-
+ tag
|
|
538
|
-
+ "] -> ["
|
|
539
|
-
+ parentTag
|
|
540
|
-
+ "] @"
|
|
541
|
-
+ index
|
|
542
|
-
+ ": view already removed from parent! Children in parent: "
|
|
543
|
-
+ parentChildrenCount);
|
|
544
|
-
return;
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
// Here we are guaranteed that the view is still in the View hierarchy, just
|
|
548
|
-
// at a different index. In debug mode we'll crash here; in production, we'll remove
|
|
549
|
-
// the child from the parent and move on.
|
|
550
|
-
// This is an issue that is safely recoverable 95% of the time. If this allows corruption
|
|
551
|
-
// of the view hierarchy and causes bugs or a crash after this point, there will be logs
|
|
552
|
-
// indicating that this happened.
|
|
553
|
-
// This is likely *only* necessary because of Fabric's LayoutAnimations implementation.
|
|
554
|
-
// If we can fix the bug there, or remove the need for LayoutAnimation index adjustment
|
|
555
|
-
// entirely, we can just throw this exception without regression user experience.
|
|
556
|
-
logViewHierarchy(parentView, true);
|
|
557
|
-
ReactSoftExceptionLogger.logSoftException(
|
|
558
|
-
TAG,
|
|
559
|
-
new IllegalStateException(
|
|
560
|
-
"Tried to remove view ["
|
|
561
|
-
+ tag
|
|
562
|
-
+ "] of parent ["
|
|
563
|
-
+ parentTag
|
|
564
|
-
+ "] at index "
|
|
565
|
-
+ index
|
|
566
|
-
+ ", but got view tag "
|
|
567
|
-
+ actualTag
|
|
568
|
-
+ " - actual index of view: "
|
|
569
|
-
+ tagActualIndex));
|
|
570
|
-
index = tagActualIndex;
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
try {
|
|
574
|
-
viewGroupManager.removeViewAt(parentView, index);
|
|
575
|
-
} catch (RuntimeException e) {
|
|
576
|
-
// Note: `getChildCount` may not always be accurate!
|
|
577
|
-
// We don't currently have a good explanation other than, in situations where you
|
|
578
|
-
// would empirically expect to see childCount > 0, the childCount is reported as 0.
|
|
579
|
-
// This is likely due to a ViewManager overriding getChildCount or some other methods
|
|
580
|
-
// in a way that is strictly incorrect, but potentially only visible here.
|
|
581
|
-
// The failure mode is actually that in `removeViewAt`, a NullPointerException is
|
|
582
|
-
// thrown when we try to perform an operation on a View that doesn't exist, and
|
|
583
|
-
// is therefore null.
|
|
584
|
-
// We try to add some extra diagnostics here, but we always try to remove the View
|
|
585
|
-
// from the hierarchy first because detecting by looking at childCount will not work.
|
|
586
|
-
//
|
|
587
|
-
// Note that the lesson here is that `getChildCount` is not /required/ to adhere to
|
|
588
|
-
// any invariants. If you add 9 children to a parent, the `getChildCount` of the parent
|
|
589
|
-
// may not be equal to 9. This apparently causes no issues with Android and is common
|
|
590
|
-
// enough that we shouldn't try to change this invariant, without a lot of thought.
|
|
591
|
-
int childCount = viewGroupManager.getChildCount(parentView);
|
|
592
|
-
|
|
593
|
-
logViewHierarchy(parentView, true);
|
|
594
|
-
|
|
595
|
-
throw new IllegalStateException(
|
|
596
|
-
"Cannot remove child at index "
|
|
597
|
-
+ index
|
|
598
|
-
+ " from parent ViewGroup ["
|
|
599
|
-
+ parentView.getId()
|
|
600
|
-
+ "], only "
|
|
601
|
-
+ childCount
|
|
602
|
-
+ " children in parent. Warning: childCount may be incorrect!",
|
|
603
|
-
e);
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
// Display children after deleting any
|
|
607
|
-
if (SHOW_CHANGED_VIEW_HIERARCHIES) {
|
|
608
|
-
final int finalIndex = index;
|
|
609
|
-
UiThreadUtil.runOnUiThread(
|
|
610
|
-
new Runnable() {
|
|
611
|
-
@Override
|
|
612
|
-
public void run() {
|
|
613
|
-
FLog.e(
|
|
614
|
-
TAG,
|
|
615
|
-
"removeViewAt: ["
|
|
616
|
-
+ tag
|
|
617
|
-
+ "] -> ["
|
|
618
|
-
+ parentTag
|
|
619
|
-
+ "] idx: "
|
|
620
|
-
+ finalIndex
|
|
621
|
-
+ " AFTER");
|
|
622
|
-
logViewHierarchy(parentView, false);
|
|
623
|
-
}
|
|
624
|
-
});
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
@UiThread
|
|
629
|
-
public void createView(
|
|
630
|
-
@NonNull String componentName,
|
|
631
|
-
int reactTag,
|
|
632
|
-
@Nullable ReadableMap props,
|
|
633
|
-
@Nullable StateWrapper stateWrapper,
|
|
634
|
-
@Nullable EventEmitterWrapper eventEmitterWrapper,
|
|
635
|
-
boolean isLayoutable) {
|
|
636
|
-
if (isStopped()) {
|
|
637
|
-
return;
|
|
638
|
-
}
|
|
639
|
-
// We treat this as a perf problem and not a logical error. View Preallocation or unexpected
|
|
640
|
-
// changes to Differ or C++ Binding could cause some redundant Create instructions.
|
|
641
|
-
// There are cases where preallocation happens and a node is recreated: if a node is
|
|
642
|
-
// preallocated and then committed with revision 2+, an extra CREATE instruction will be
|
|
643
|
-
// generated.
|
|
644
|
-
// This represents a perf issue only, not a correctness issue. In the future we need to
|
|
645
|
-
// refactor View preallocation to correct the currently incorrect assumptions.
|
|
646
|
-
ViewState viewState = getNullableViewState(reactTag);
|
|
647
|
-
if (viewState != null && viewState.mView != null) {
|
|
648
|
-
return;
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
createViewUnsafe(
|
|
652
|
-
componentName, reactTag, props, stateWrapper, eventEmitterWrapper, isLayoutable);
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
/**
|
|
656
|
-
* Perform view creation without any safety checks. You must ensure safety before calling this
|
|
657
|
-
* method (see existing callsites).
|
|
658
|
-
*
|
|
659
|
-
* @param componentName
|
|
660
|
-
* @param reactTag
|
|
661
|
-
* @param props
|
|
662
|
-
* @param stateWrapper
|
|
663
|
-
* @param eventEmitterWrapper
|
|
664
|
-
* @param isLayoutable
|
|
665
|
-
*/
|
|
666
|
-
@UiThread
|
|
667
|
-
public void createViewUnsafe(
|
|
668
|
-
@NonNull String componentName,
|
|
669
|
-
int reactTag,
|
|
670
|
-
@Nullable ReadableMap props,
|
|
671
|
-
@Nullable StateWrapper stateWrapper,
|
|
672
|
-
@Nullable EventEmitterWrapper eventEmitterWrapper,
|
|
673
|
-
boolean isLayoutable) {
|
|
674
|
-
Systrace.beginSection(
|
|
675
|
-
Systrace.TRACE_TAG_REACT,
|
|
676
|
-
"SurfaceMountingManager::createViewUnsafe(" + componentName + ")");
|
|
677
|
-
try {
|
|
678
|
-
ReactStylesDiffMap propMap = new ReactStylesDiffMap(props);
|
|
679
|
-
|
|
680
|
-
ViewState viewState = new ViewState(reactTag);
|
|
681
|
-
viewState.mCurrentProps = propMap;
|
|
682
|
-
viewState.mStateWrapper = stateWrapper;
|
|
683
|
-
viewState.mEventEmitter = eventEmitterWrapper;
|
|
684
|
-
mTagToViewState.put(reactTag, viewState);
|
|
685
|
-
|
|
686
|
-
if (isLayoutable) {
|
|
687
|
-
ViewManager viewManager = mViewManagerRegistry.get(componentName);
|
|
688
|
-
// View Managers are responsible for dealing with inital state and props.
|
|
689
|
-
viewState.mView =
|
|
690
|
-
viewManager.createView(
|
|
691
|
-
reactTag, mThemedReactContext, propMap, stateWrapper, mJSResponderHandler);
|
|
692
|
-
viewState.mViewManager = viewManager;
|
|
693
|
-
}
|
|
694
|
-
} finally {
|
|
695
|
-
Systrace.endSection(Systrace.TRACE_TAG_REACT);
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
private static void overridePropsReadableMap(
|
|
700
|
-
Map<String, Object> patchMap, WritableMap outputReadableMap) {
|
|
701
|
-
for (Map.Entry<String, Object> entry : patchMap.entrySet()) {
|
|
702
|
-
String propKey = entry.getKey();
|
|
703
|
-
if (outputReadableMap.hasKey(propKey)) {
|
|
704
|
-
Object propValue = entry.getValue();
|
|
705
|
-
if (propKey.equals(PROP_TRANSFORM)) {
|
|
706
|
-
assert (outputReadableMap.getType(propKey) == ReadableType.Array
|
|
707
|
-
&& propValue instanceof ArrayList);
|
|
708
|
-
WritableArray array = new WritableNativeArray();
|
|
709
|
-
for (Object item : (ArrayList<?>) propValue) {
|
|
710
|
-
if (item instanceof HashMap) {
|
|
711
|
-
WritableNativeMap itemMap = new WritableNativeMap();
|
|
712
|
-
for (Map.Entry<String, Object> itemEntry :
|
|
713
|
-
((HashMap<String, Object>) item).entrySet()) {
|
|
714
|
-
if (itemEntry.getValue() instanceof String) {
|
|
715
|
-
itemMap.putString(itemEntry.getKey(), (String) itemEntry.getValue());
|
|
716
|
-
} else if (itemEntry.getValue() instanceof Number) {
|
|
717
|
-
itemMap.putDouble(
|
|
718
|
-
itemEntry.getKey(), ((Number) itemEntry.getValue()).doubleValue());
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
array.pushMap(itemMap);
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
outputReadableMap.putArray(propKey, array);
|
|
725
|
-
} else if (propKey.equals(PROP_OPACITY)) {
|
|
726
|
-
assert (outputReadableMap.getType(propKey) == ReadableType.Number
|
|
727
|
-
&& propValue instanceof Number);
|
|
728
|
-
outputReadableMap.putDouble(propKey, ((Number) propValue).doubleValue());
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
private static Map<String, Object> getHashMapFromPropsReadableMap(ReadableMap readableMap) {
|
|
735
|
-
HashMap<String, Object> outputMap = new HashMap<>();
|
|
736
|
-
|
|
737
|
-
if (readableMap.hasKey(PROP_TRANSFORM)
|
|
738
|
-
&& readableMap.getType(PROP_TRANSFORM) == ReadableType.Array) {
|
|
739
|
-
ReadableArray transformArray = readableMap.getArray(PROP_TRANSFORM);
|
|
740
|
-
if (transformArray != null) {
|
|
741
|
-
ArrayList<HashMap<String, Object>> arrayList = new ArrayList<>(transformArray.size());
|
|
742
|
-
for (int i = 0; i < transformArray.size(); i++) {
|
|
743
|
-
ReadableMap map = transformArray.getMap(i);
|
|
744
|
-
if (map != null) {
|
|
745
|
-
arrayList.add(map.toHashMap());
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
outputMap.put(PROP_TRANSFORM, arrayList);
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
if (readableMap.hasKey(PROP_OPACITY)
|
|
753
|
-
&& readableMap.getType(PROP_OPACITY) == ReadableType.Number) {
|
|
754
|
-
outputMap.put(PROP_OPACITY, readableMap.getDouble(PROP_OPACITY));
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
return outputMap;
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
public void storeSynchronousMountPropsOverride(int reactTag, ReadableMap props) {
|
|
761
|
-
if (ReactNativeFeatureFlags.overrideBySynchronousMountPropsAtMountingAndroid()) {
|
|
762
|
-
Map<String, Object> propsMap = getHashMapFromPropsReadableMap(props);
|
|
763
|
-
if (mTagToSynchronousMountProps.containsKey(reactTag)) {
|
|
764
|
-
Map<String, Object> mergedPropsMap =
|
|
765
|
-
Assertions.assertNotNull(mTagToSynchronousMountProps.get(reactTag));
|
|
766
|
-
mergedPropsMap.putAll(propsMap);
|
|
767
|
-
mTagToSynchronousMountProps.put(reactTag, mergedPropsMap);
|
|
768
|
-
} else {
|
|
769
|
-
mTagToSynchronousMountProps.put(reactTag, propsMap);
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
public void updatePropsSynchronously(int reactTag, ReadableMap props) {
|
|
775
|
-
updateProps(reactTag, props, true);
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
public void updateProps(int reactTag, ReadableMap props) {
|
|
779
|
-
updateProps(reactTag, props, false);
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
@UiThread
|
|
783
|
-
private void updateProps(
|
|
784
|
-
int reactTag, ReadableMap props, Boolean shouldSkipSynchronousMountPropsOverride) {
|
|
785
|
-
if (isStopped()) {
|
|
786
|
-
return;
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
ViewState viewState = getViewState(reactTag);
|
|
790
|
-
|
|
791
|
-
if (ReactNativeFeatureFlags.overrideBySynchronousMountPropsAtMountingAndroid()
|
|
792
|
-
&& !shouldSkipSynchronousMountPropsOverride
|
|
793
|
-
&& mTagToSynchronousMountProps.containsKey(reactTag)) {
|
|
794
|
-
WritableMap modifiedProps = new WritableNativeMap();
|
|
795
|
-
modifiedProps.merge(props);
|
|
796
|
-
Map<String, Object> directPropsMap =
|
|
797
|
-
Assertions.assertNotNull(mTagToSynchronousMountProps.get(reactTag));
|
|
798
|
-
overridePropsReadableMap(directPropsMap, modifiedProps);
|
|
799
|
-
viewState.mCurrentProps = new ReactStylesDiffMap(modifiedProps);
|
|
800
|
-
} else {
|
|
801
|
-
viewState.mCurrentProps = new ReactStylesDiffMap(props);
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
View view = viewState.mView;
|
|
805
|
-
|
|
806
|
-
if (view == null) {
|
|
807
|
-
throw new IllegalStateException("Unable to find view for tag [" + reactTag + "]");
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
Assertions.assertNotNull(viewState.mViewManager)
|
|
811
|
-
.updateProperties(view, viewState.mCurrentProps);
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
/**
|
|
815
|
-
* This prefetch method is experimental, do not use it for production code. it will most likely
|
|
816
|
-
* change or be removed in the future.
|
|
817
|
-
*
|
|
818
|
-
* @param surfaceId surface ID
|
|
819
|
-
* @param componentName
|
|
820
|
-
* @param params prefetch request params defined in C++
|
|
821
|
-
*/
|
|
822
|
-
@SuppressLint("FunctionName")
|
|
823
|
-
@AnyThread
|
|
824
|
-
@UnstableReactNativeAPI
|
|
825
|
-
public void experimental_prefetchResources(
|
|
826
|
-
int surfaceId, String componentName, MapBuffer params) {
|
|
827
|
-
if (isStopped()) {
|
|
828
|
-
return;
|
|
829
|
-
}
|
|
830
|
-
mViewManagerRegistry
|
|
831
|
-
.get(componentName)
|
|
832
|
-
.experimental_prefetchResources(
|
|
833
|
-
surfaceId, Assertions.assertNotNull(mThemedReactContext), params);
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
@Deprecated
|
|
837
|
-
public void receiveCommand(int reactTag, int commandId, ReadableArray commandArgs) {
|
|
838
|
-
if (isStopped()) {
|
|
839
|
-
return;
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
ViewState viewState = getNullableViewState(reactTag);
|
|
843
|
-
|
|
844
|
-
// It's not uncommon for JS to send events as/after a component is being removed from the
|
|
845
|
-
// view hierarchy. For example, TextInput may send a "blur" command in response to the view
|
|
846
|
-
// disappearing. Throw `ReactNoCrashSoftException` so they're logged but don't crash in dev
|
|
847
|
-
// for now.
|
|
848
|
-
if (viewState == null) {
|
|
849
|
-
throw new RetryableMountingLayerException(
|
|
850
|
-
"Unable to find viewState for tag: [" + reactTag + "] for commandId: " + commandId);
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
if (viewState.mViewManager == null) {
|
|
854
|
-
throw new RetryableMountingLayerException("Unable to find viewManager for tag " + reactTag);
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
if (viewState.mView == null) {
|
|
858
|
-
throw new RetryableMountingLayerException(
|
|
859
|
-
"Unable to find viewState view for tag " + reactTag);
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
viewState.mViewManager.receiveCommand(viewState.mView, commandId, commandArgs);
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
public void receiveCommand(int reactTag, @NonNull String commandId, ReadableArray commandArgs) {
|
|
866
|
-
if (isStopped()) {
|
|
867
|
-
return;
|
|
868
|
-
}
|
|
869
|
-
|
|
870
|
-
ViewState viewState = getNullableViewState(reactTag);
|
|
871
|
-
|
|
872
|
-
// It's not uncommon for JS to send events as/after a component is being removed from the
|
|
873
|
-
// view hierarchy. For example, TextInput may send a "blur" command in response to the view
|
|
874
|
-
// disappearing. Throw `ReactNoCrashSoftException` so they're logged but don't crash in dev
|
|
875
|
-
// for now.
|
|
876
|
-
if (viewState == null) {
|
|
877
|
-
throw new RetryableMountingLayerException(
|
|
878
|
-
"Unable to find viewState for tag: " + reactTag + " for commandId: " + commandId);
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
if (viewState.mViewManager == null) {
|
|
882
|
-
throw new RetryableMountingLayerException(
|
|
883
|
-
"Unable to find viewState manager for tag " + reactTag);
|
|
884
|
-
}
|
|
885
|
-
|
|
886
|
-
if (viewState.mView == null) {
|
|
887
|
-
throw new RetryableMountingLayerException(
|
|
888
|
-
"Unable to find viewState view for tag " + reactTag);
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
viewState.mViewManager.receiveCommand(viewState.mView, commandId, commandArgs);
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
public void sendAccessibilityEvent(int reactTag, int eventType) {
|
|
895
|
-
if (isStopped()) {
|
|
896
|
-
return;
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
ViewState viewState = getViewState(reactTag);
|
|
900
|
-
|
|
901
|
-
if (viewState.mViewManager == null) {
|
|
902
|
-
throw new RetryableMountingLayerException(
|
|
903
|
-
"Unable to find viewState manager for tag " + reactTag);
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
if (viewState.mView == null) {
|
|
907
|
-
throw new RetryableMountingLayerException(
|
|
908
|
-
"Unable to find viewState view for tag " + reactTag);
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
viewState.mView.sendAccessibilityEvent(eventType);
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
@UiThread
|
|
915
|
-
public void updateLayout(
|
|
916
|
-
int reactTag,
|
|
917
|
-
int parentTag,
|
|
918
|
-
int x,
|
|
919
|
-
int y,
|
|
920
|
-
int width,
|
|
921
|
-
int height,
|
|
922
|
-
int displayType,
|
|
923
|
-
int layoutDirection) {
|
|
924
|
-
if (isStopped()) {
|
|
925
|
-
return;
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
ViewState viewState = getViewState(reactTag);
|
|
929
|
-
// Do not layout Root Views
|
|
930
|
-
if (viewState.mIsRoot) {
|
|
931
|
-
return;
|
|
932
|
-
}
|
|
933
|
-
|
|
934
|
-
View viewToUpdate = viewState.mView;
|
|
935
|
-
if (viewToUpdate == null) {
|
|
936
|
-
throw new IllegalStateException("Unable to find View for tag: " + reactTag);
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
viewToUpdate.setLayoutDirection(
|
|
940
|
-
layoutDirection == 1
|
|
941
|
-
? View.LAYOUT_DIRECTION_LTR
|
|
942
|
-
: layoutDirection == 2 ? View.LAYOUT_DIRECTION_RTL : View.LAYOUT_DIRECTION_INHERIT);
|
|
943
|
-
|
|
944
|
-
// Even though we have exact dimensions, we still call measure because some platform views (e.g.
|
|
945
|
-
// Switch) assume that method will always be called before onLayout and onDraw. They use it to
|
|
946
|
-
// calculate and cache information used in the draw pass. For most views, onMeasure can be
|
|
947
|
-
// stubbed out to only call setMeasuredDimensions. For ViewGroups, onLayout should be stubbed
|
|
948
|
-
// out to not recursively call layout on its children: React Native already handles doing
|
|
949
|
-
// that.
|
|
950
|
-
//
|
|
951
|
-
// Also, note measure and layout need to be called *after* all View properties have been updated
|
|
952
|
-
// because of caching and calculation that may occur in onMeasure and onLayout. Layout
|
|
953
|
-
// operations should also follow the native view hierarchy and go top to bottom for
|
|
954
|
-
// consistency with standard layout passes (some views may depend on this).
|
|
955
|
-
viewToUpdate.measure(
|
|
956
|
-
View.MeasureSpec.makeMeasureSpec(width, View.MeasureSpec.EXACTLY),
|
|
957
|
-
View.MeasureSpec.makeMeasureSpec(height, View.MeasureSpec.EXACTLY));
|
|
958
|
-
|
|
959
|
-
// We update the layout of the RootView when there is a change in the layout of its child. This
|
|
960
|
-
// is required to re-measure the size of the native View container (usually a FrameLayout) that
|
|
961
|
-
// is configured with layout_height = WRAP_CONTENT or layout_width = WRAP_CONTENT
|
|
962
|
-
//
|
|
963
|
-
// This code is going to be executed ONLY when there is a change in the size of the root view
|
|
964
|
-
// defined in the JS side. Changes in the layout of inner views will not trigger an update on
|
|
965
|
-
// the layout of the root view.
|
|
966
|
-
ViewParent parent = viewToUpdate.getParent();
|
|
967
|
-
if (parent instanceof RootView) {
|
|
968
|
-
parent.requestLayout();
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
// TODO T212247085: Make this non-nullable again after rolling out
|
|
972
|
-
// disableMountItemReorderingAndroid
|
|
973
|
-
ViewState parentViewState = getNullableViewState(parentTag);
|
|
974
|
-
IViewGroupManager<?> parentViewManager = null;
|
|
975
|
-
if (parentViewState == null) {
|
|
976
|
-
ReactSoftExceptionLogger.logSoftException(
|
|
977
|
-
ReactSoftExceptionLogger.Categories.SURFACE_MOUNTING_MANAGER_MISSING_VIEWSTATE,
|
|
978
|
-
new ReactNoCrashSoftException(
|
|
979
|
-
"Unable to find viewState for tag: " + parentTag + " for updateLayout"));
|
|
980
|
-
} else if (parentViewState.mViewManager != null) {
|
|
981
|
-
parentViewManager = (IViewGroupManager) parentViewState.mViewManager;
|
|
982
|
-
}
|
|
983
|
-
if (parentViewManager == null || !parentViewManager.needsCustomLayoutForChildren()) {
|
|
984
|
-
viewToUpdate.layout(x, y, x + width, y + height);
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
// displayType: 0 represents display: 'none'
|
|
988
|
-
int visibility = displayType == 0 ? View.INVISIBLE : View.VISIBLE;
|
|
989
|
-
if (viewToUpdate.getVisibility() != visibility) {
|
|
990
|
-
viewToUpdate.setVisibility(visibility);
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
@UiThread
|
|
995
|
-
public void updatePadding(int reactTag, int left, int top, int right, int bottom) {
|
|
996
|
-
UiThreadUtil.assertOnUiThread();
|
|
997
|
-
if (isStopped()) {
|
|
998
|
-
return;
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
ViewState viewState = getViewState(reactTag);
|
|
1002
|
-
// Do not layout Root Views
|
|
1003
|
-
if (viewState.mIsRoot) {
|
|
1004
|
-
return;
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
|
-
View viewToUpdate = viewState.mView;
|
|
1008
|
-
if (viewToUpdate == null) {
|
|
1009
|
-
throw new IllegalStateException("Unable to find View for tag: " + reactTag);
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
ViewManager viewManager = viewState.mViewManager;
|
|
1013
|
-
if (viewManager == null) {
|
|
1014
|
-
throw new IllegalStateException("Unable to find ViewManager for view: " + viewState);
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
//noinspection unchecked
|
|
1018
|
-
viewManager.setPadding(viewToUpdate, left, top, right, bottom);
|
|
1019
|
-
}
|
|
1020
|
-
|
|
1021
|
-
@UiThread
|
|
1022
|
-
public void updateOverflowInset(
|
|
1023
|
-
int reactTag,
|
|
1024
|
-
int overflowInsetLeft,
|
|
1025
|
-
int overflowInsetTop,
|
|
1026
|
-
int overflowInsetRight,
|
|
1027
|
-
int overflowInsetBottom) {
|
|
1028
|
-
if (isStopped()) {
|
|
1029
|
-
return;
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
|
-
ViewState viewState = getViewState(reactTag);
|
|
1033
|
-
// Do not layout Root Views
|
|
1034
|
-
if (viewState.mIsRoot) {
|
|
1035
|
-
return;
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
|
-
View viewToUpdate = viewState.mView;
|
|
1039
|
-
if (viewToUpdate == null) {
|
|
1040
|
-
throw new IllegalStateException("Unable to find View for tag: " + reactTag);
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
|
-
if (viewToUpdate instanceof ReactOverflowViewWithInset) {
|
|
1044
|
-
((ReactOverflowViewWithInset) viewToUpdate)
|
|
1045
|
-
.setOverflowInset(
|
|
1046
|
-
overflowInsetLeft, overflowInsetTop, overflowInsetRight, overflowInsetBottom);
|
|
1047
|
-
}
|
|
1048
|
-
}
|
|
1049
|
-
|
|
1050
|
-
@UiThread
|
|
1051
|
-
public void updateState(final int reactTag, @Nullable StateWrapper stateWrapper) {
|
|
1052
|
-
UiThreadUtil.assertOnUiThread();
|
|
1053
|
-
if (isStopped()) {
|
|
1054
|
-
return;
|
|
1055
|
-
}
|
|
1056
|
-
|
|
1057
|
-
ViewState viewState = getViewState(reactTag);
|
|
1058
|
-
|
|
1059
|
-
StateWrapper prevStateWrapper = viewState.mStateWrapper;
|
|
1060
|
-
viewState.mStateWrapper = stateWrapper;
|
|
1061
|
-
|
|
1062
|
-
ViewManager viewManager = viewState.mViewManager;
|
|
1063
|
-
|
|
1064
|
-
if (viewManager == null) {
|
|
1065
|
-
throw new IllegalStateException("Unable to find ViewManager for tag: " + reactTag);
|
|
1066
|
-
}
|
|
1067
|
-
Object extraData =
|
|
1068
|
-
viewManager.updateState(viewState.mView, viewState.mCurrentProps, stateWrapper);
|
|
1069
|
-
if (extraData != null) {
|
|
1070
|
-
viewManager.updateExtraData(viewState.mView, extraData);
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
// Immediately clear native side of previous state wrapper. This causes the State object in C++
|
|
1074
|
-
// to be destroyed immediately instead of waiting for Java GC to kick in.
|
|
1075
|
-
if (prevStateWrapper != null) {
|
|
1076
|
-
prevStateWrapper.destroyState();
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
/** We update the event emitter from the main thread when the view is mounted. */
|
|
1081
|
-
@UiThread
|
|
1082
|
-
public void updateEventEmitter(int reactTag, @NonNull EventEmitterWrapper eventEmitter) {
|
|
1083
|
-
UiThreadUtil.assertOnUiThread();
|
|
1084
|
-
if (isStopped()) {
|
|
1085
|
-
return;
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
ViewState viewState = mTagToViewState.get(reactTag);
|
|
1089
|
-
if (viewState == null) {
|
|
1090
|
-
// TODO T62717437 - Use a flag to determine that these event emitters belong to virtual nodes
|
|
1091
|
-
// only.
|
|
1092
|
-
viewState = new ViewState(reactTag);
|
|
1093
|
-
mTagToViewState.put(reactTag, viewState);
|
|
1094
|
-
}
|
|
1095
|
-
EventEmitterWrapper previousEventEmitterWrapper = viewState.mEventEmitter;
|
|
1096
|
-
viewState.mEventEmitter = eventEmitter;
|
|
1097
|
-
|
|
1098
|
-
// Immediately destroy native side of wrapper, instead of waiting for Java GC.
|
|
1099
|
-
if (previousEventEmitterWrapper != eventEmitter && previousEventEmitterWrapper != null) {
|
|
1100
|
-
previousEventEmitterWrapper.destroy();
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
Queue<PendingViewEvent> pendingEventQueue = viewState.mPendingEventQueue;
|
|
1104
|
-
if (pendingEventQueue != null) {
|
|
1105
|
-
// Invoke pending event queued to the view state
|
|
1106
|
-
for (PendingViewEvent viewEvent : pendingEventQueue) {
|
|
1107
|
-
viewEvent.dispatch(eventEmitter);
|
|
1108
|
-
}
|
|
1109
|
-
viewState.mPendingEventQueue = null;
|
|
1110
|
-
}
|
|
1111
|
-
}
|
|
1112
|
-
|
|
1113
|
-
@UiThread
|
|
1114
|
-
public synchronized void setJSResponder(
|
|
1115
|
-
int reactTag, int initialReactTag, boolean blockNativeResponder) {
|
|
1116
|
-
UiThreadUtil.assertOnUiThread();
|
|
1117
|
-
if (isStopped()) {
|
|
1118
|
-
return;
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
|
-
if (!blockNativeResponder) {
|
|
1122
|
-
mJSResponderHandler.setJSResponder(initialReactTag, null);
|
|
1123
|
-
return;
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
|
-
ViewState viewState = getViewState(reactTag);
|
|
1127
|
-
View view = viewState.mView;
|
|
1128
|
-
if (initialReactTag != reactTag && view instanceof ViewParent) {
|
|
1129
|
-
// In this case, initialReactTag corresponds to a virtual/layout-only View, and we already
|
|
1130
|
-
// have a parent of that View in reactTag, so we can use it.
|
|
1131
|
-
mJSResponderHandler.setJSResponder(initialReactTag, (ViewParent) view);
|
|
1132
|
-
return;
|
|
1133
|
-
} else if (view == null) {
|
|
1134
|
-
SoftAssertions.assertUnreachable("Cannot find view for tag [" + reactTag + "].");
|
|
1135
|
-
return;
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
|
-
if (viewState.mIsRoot) {
|
|
1139
|
-
SoftAssertions.assertUnreachable(
|
|
1140
|
-
"Cannot block native responder on [" + reactTag + "] that is a root view");
|
|
1141
|
-
}
|
|
1142
|
-
mJSResponderHandler.setJSResponder(initialReactTag, view.getParent());
|
|
1143
|
-
}
|
|
1144
|
-
|
|
1145
|
-
@UiThread
|
|
1146
|
-
private void onViewStateDeleted(ViewState viewState) {
|
|
1147
|
-
// Destroy state immediately instead of waiting for Java GC.
|
|
1148
|
-
if (viewState.mStateWrapper != null) {
|
|
1149
|
-
viewState.mStateWrapper.destroyState();
|
|
1150
|
-
viewState.mStateWrapper = null;
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1153
|
-
// Destroy EventEmitterWrapper immediately instead of waiting for Java GC.
|
|
1154
|
-
// Notably, this is also required to ensure that the EventEmitterWrapper is deallocated
|
|
1155
|
-
// before the JS VM is deallocated, since it holds onto a JSI::Pointer.
|
|
1156
|
-
if (viewState.mEventEmitter != null) {
|
|
1157
|
-
viewState.mEventEmitter.destroy();
|
|
1158
|
-
viewState.mEventEmitter = null;
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
// For non-root views we notify viewmanager with {@link ViewManager#onDropInstance}
|
|
1162
|
-
ViewManager viewManager = viewState.mViewManager;
|
|
1163
|
-
if (!viewState.mIsRoot && viewManager != null) {
|
|
1164
|
-
viewManager.onDropViewInstance(viewState.mView);
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
|
-
@UiThread
|
|
1169
|
-
public void deleteView(int reactTag) {
|
|
1170
|
-
UiThreadUtil.assertOnUiThread();
|
|
1171
|
-
if (isStopped()) {
|
|
1172
|
-
return;
|
|
1173
|
-
}
|
|
1174
|
-
|
|
1175
|
-
if (ReactNativeFeatureFlags.overrideBySynchronousMountPropsAtMountingAndroid()
|
|
1176
|
-
&& mTagToSynchronousMountProps.containsKey(reactTag)) {
|
|
1177
|
-
mTagToSynchronousMountProps.remove(reactTag);
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
ViewState viewState = getNullableViewState(reactTag);
|
|
1181
|
-
|
|
1182
|
-
if (viewState == null) {
|
|
1183
|
-
ReactSoftExceptionLogger.logSoftException(
|
|
1184
|
-
ReactSoftExceptionLogger.Categories.SURFACE_MOUNTING_MANAGER_MISSING_VIEWSTATE,
|
|
1185
|
-
new ReactNoCrashSoftException(
|
|
1186
|
-
"Unable to find viewState for tag: " + reactTag + " for deleteView"));
|
|
1187
|
-
return;
|
|
1188
|
-
}
|
|
1189
|
-
|
|
1190
|
-
if (mViewsWithActiveTouches.contains(reactTag)) {
|
|
1191
|
-
// If the view that went offscreen is still being touched, we can't delete it yet.
|
|
1192
|
-
// We have to delay the deletion till the touch is completed.
|
|
1193
|
-
// This is causing bugs like those otherwise:
|
|
1194
|
-
// - https://github.com/facebook/react-native/issues/44610
|
|
1195
|
-
// - https://github.com/facebook/react-native/issues/45126
|
|
1196
|
-
mViewsToDeleteAfterTouchFinishes.add(reactTag);
|
|
1197
|
-
} else {
|
|
1198
|
-
// To delete we simply remove the tag from the registry.
|
|
1199
|
-
// We want to rely on the correct set of MountInstructions being sent to the platform,
|
|
1200
|
-
// or StopSurface being called, so we do not handle deleting descendants of the View.
|
|
1201
|
-
mTagToViewState.remove(reactTag);
|
|
1202
|
-
|
|
1203
|
-
onViewStateDeleted(viewState);
|
|
1204
|
-
}
|
|
1205
|
-
}
|
|
1206
|
-
|
|
1207
|
-
@UiThread
|
|
1208
|
-
public void preallocateView(
|
|
1209
|
-
@NonNull String componentName,
|
|
1210
|
-
int reactTag,
|
|
1211
|
-
@Nullable ReadableMap props,
|
|
1212
|
-
@Nullable StateWrapper stateWrapper,
|
|
1213
|
-
boolean isLayoutable) {
|
|
1214
|
-
UiThreadUtil.assertOnUiThread();
|
|
1215
|
-
|
|
1216
|
-
if (isStopped()) {
|
|
1217
|
-
return;
|
|
1218
|
-
}
|
|
1219
|
-
// We treat this as a perf problem and not a logical error. View Preallocation or unexpected
|
|
1220
|
-
// changes to Differ or C++ Binding could cause some redundant Create instructions.
|
|
1221
|
-
if (getNullableViewState(reactTag) != null) {
|
|
1222
|
-
return;
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1225
|
-
createViewUnsafe(componentName, reactTag, props, stateWrapper, null, isLayoutable);
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
@AnyThread
|
|
1229
|
-
@ThreadConfined(ANY)
|
|
1230
|
-
public @Nullable EventEmitterWrapper getEventEmitter(int reactTag) {
|
|
1231
|
-
ViewState viewState = getNullableViewState(reactTag);
|
|
1232
|
-
return viewState == null ? null : viewState.mEventEmitter;
|
|
1233
|
-
}
|
|
1234
|
-
|
|
1235
|
-
@UiThread
|
|
1236
|
-
public View getView(int reactTag) {
|
|
1237
|
-
ViewState state = getNullableViewState(reactTag);
|
|
1238
|
-
View view = state == null ? null : state.mView;
|
|
1239
|
-
if (view == null) {
|
|
1240
|
-
throw new IllegalViewOperationException(
|
|
1241
|
-
"Trying to resolve view with tag " + reactTag + " which doesn't exist");
|
|
1242
|
-
}
|
|
1243
|
-
return view;
|
|
1244
|
-
}
|
|
1245
|
-
|
|
1246
|
-
private @NonNull ViewState getViewState(int tag) {
|
|
1247
|
-
ViewState viewState = mTagToViewState.get(tag);
|
|
1248
|
-
if (viewState == null) {
|
|
1249
|
-
throw new RetryableMountingLayerException(
|
|
1250
|
-
"Unable to find viewState for tag " + tag + ". Surface stopped: " + isStopped());
|
|
1251
|
-
}
|
|
1252
|
-
return viewState;
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
|
-
private @Nullable ViewState getNullableViewState(int tag) {
|
|
1256
|
-
ConcurrentHashMap<Integer, ViewState> viewStates = mTagToViewState;
|
|
1257
|
-
if (viewStates == null) {
|
|
1258
|
-
return null;
|
|
1259
|
-
}
|
|
1260
|
-
return viewStates.get(tag);
|
|
1261
|
-
}
|
|
1262
|
-
|
|
1263
|
-
@SuppressWarnings("unchecked") // prevents unchecked conversion warn of the <ViewGroup> type
|
|
1264
|
-
private static @NonNull IViewGroupManager<ViewGroup> getViewGroupManager(
|
|
1265
|
-
@NonNull ViewState viewState) {
|
|
1266
|
-
if (viewState.mViewManager == null) {
|
|
1267
|
-
throw new IllegalStateException("Unable to find ViewManager for view: " + viewState);
|
|
1268
|
-
}
|
|
1269
|
-
return (IViewGroupManager<ViewGroup>) viewState.mViewManager;
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
public void printSurfaceState() {
|
|
1273
|
-
FLog.e(TAG, "Views created for surface {%d}:", getSurfaceId());
|
|
1274
|
-
for (ViewState viewState : mTagToViewState.values()) {
|
|
1275
|
-
String viewManagerName =
|
|
1276
|
-
viewState.mViewManager != null ? viewState.mViewManager.getName() : null;
|
|
1277
|
-
@Nullable View view = viewState.mView;
|
|
1278
|
-
@Nullable View parent = view != null ? (View) view.getParent() : null;
|
|
1279
|
-
@Nullable Integer parentTag = parent != null ? parent.getId() : null;
|
|
1280
|
-
|
|
1281
|
-
FLog.e(
|
|
1282
|
-
TAG,
|
|
1283
|
-
"<%s id=%d parentTag=%s isRoot=%b />",
|
|
1284
|
-
viewManagerName,
|
|
1285
|
-
viewState.mReactTag,
|
|
1286
|
-
parentTag,
|
|
1287
|
-
viewState.mIsRoot);
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
|
|
1291
|
-
@AnyThread
|
|
1292
|
-
public void enqueuePendingEvent(
|
|
1293
|
-
int reactTag,
|
|
1294
|
-
String eventName,
|
|
1295
|
-
boolean canCoalesceEvent,
|
|
1296
|
-
@Nullable WritableMap params,
|
|
1297
|
-
@EventCategoryDef int eventCategory) {
|
|
1298
|
-
// When the surface stopped we will reset the view state map. We are not going to enqueue
|
|
1299
|
-
// pending events as they are not expected to be dispatched anyways.
|
|
1300
|
-
if (mTagToViewState == null) {
|
|
1301
|
-
return;
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
ViewState viewState = mTagToViewState.get(reactTag);
|
|
1305
|
-
if (viewState == null) {
|
|
1306
|
-
// Cannot queue event without view state. Do nothing here.
|
|
1307
|
-
return;
|
|
1308
|
-
}
|
|
1309
|
-
|
|
1310
|
-
PendingViewEvent viewEvent =
|
|
1311
|
-
new PendingViewEvent(eventName, params, eventCategory, canCoalesceEvent);
|
|
1312
|
-
UiThreadUtil.runOnUiThread(
|
|
1313
|
-
new Runnable() {
|
|
1314
|
-
@Override
|
|
1315
|
-
public void run() {
|
|
1316
|
-
if (viewState.mEventEmitter != null) {
|
|
1317
|
-
viewEvent.dispatch(viewState.mEventEmitter);
|
|
1318
|
-
} else {
|
|
1319
|
-
if (viewState.mPendingEventQueue == null) {
|
|
1320
|
-
viewState.mPendingEventQueue = new LinkedList<>();
|
|
1321
|
-
}
|
|
1322
|
-
viewState.mPendingEventQueue.add(viewEvent);
|
|
1323
|
-
}
|
|
1324
|
-
}
|
|
1325
|
-
});
|
|
1326
|
-
}
|
|
1327
|
-
|
|
1328
|
-
public void markActiveTouchForTag(int reactTag) {
|
|
1329
|
-
mViewsWithActiveTouches.add(reactTag);
|
|
1330
|
-
}
|
|
1331
|
-
|
|
1332
|
-
public void sweepActiveTouchForTag(int reactTag) {
|
|
1333
|
-
mViewsWithActiveTouches.remove(reactTag);
|
|
1334
|
-
if (mViewsToDeleteAfterTouchFinishes.contains(reactTag)) {
|
|
1335
|
-
mViewsToDeleteAfterTouchFinishes.remove(reactTag);
|
|
1336
|
-
deleteView(reactTag);
|
|
1337
|
-
}
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
|
-
/**
|
|
1341
|
-
* This class holds view state for react tags. Objects of this class are stored into the {@link
|
|
1342
|
-
* #mTagToViewState}, and they should be updated in the same thread.
|
|
1343
|
-
*/
|
|
1344
|
-
private static class ViewState {
|
|
1345
|
-
@Nullable View mView = null;
|
|
1346
|
-
final int mReactTag;
|
|
1347
|
-
final boolean mIsRoot;
|
|
1348
|
-
@Nullable ViewManager mViewManager = null;
|
|
1349
|
-
@Nullable ReactStylesDiffMap mCurrentProps = null;
|
|
1350
|
-
@Nullable StateWrapper mStateWrapper = null;
|
|
1351
|
-
@Nullable EventEmitterWrapper mEventEmitter = null;
|
|
1352
|
-
|
|
1353
|
-
@ThreadConfined(UI)
|
|
1354
|
-
@Nullable
|
|
1355
|
-
Queue<PendingViewEvent> mPendingEventQueue = null;
|
|
1356
|
-
|
|
1357
|
-
private ViewState(int reactTag) {
|
|
1358
|
-
this(reactTag, null, null, false);
|
|
1359
|
-
}
|
|
1360
|
-
|
|
1361
|
-
private ViewState(
|
|
1362
|
-
int reactTag, @Nullable View view, @Nullable ViewManager viewManager, boolean isRoot) {
|
|
1363
|
-
mReactTag = reactTag;
|
|
1364
|
-
mView = view;
|
|
1365
|
-
mIsRoot = isRoot;
|
|
1366
|
-
mViewManager = viewManager;
|
|
1367
|
-
}
|
|
1368
|
-
|
|
1369
|
-
@NonNull
|
|
1370
|
-
@Override
|
|
1371
|
-
public String toString() {
|
|
1372
|
-
boolean isLayoutOnly = mViewManager == null;
|
|
1373
|
-
return "ViewState ["
|
|
1374
|
-
+ mReactTag
|
|
1375
|
-
+ "] - isRoot: "
|
|
1376
|
-
+ mIsRoot
|
|
1377
|
-
+ " - props: "
|
|
1378
|
-
+ mCurrentProps
|
|
1379
|
-
+ " - viewManager: "
|
|
1380
|
-
+ mViewManager
|
|
1381
|
-
+ " - isLayoutOnly: "
|
|
1382
|
-
+ isLayoutOnly;
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
|
-
|
|
1386
|
-
private static class PendingViewEvent {
|
|
1387
|
-
private final String mEventName;
|
|
1388
|
-
private final boolean mCanCoalesceEvent;
|
|
1389
|
-
private final @EventCategoryDef int mEventCategory;
|
|
1390
|
-
private final @Nullable WritableMap mParams;
|
|
1391
|
-
|
|
1392
|
-
public PendingViewEvent(
|
|
1393
|
-
String eventName,
|
|
1394
|
-
@Nullable WritableMap params,
|
|
1395
|
-
@EventCategoryDef int eventCategory,
|
|
1396
|
-
boolean canCoalesceEvent) {
|
|
1397
|
-
mEventName = eventName;
|
|
1398
|
-
mParams = params;
|
|
1399
|
-
mEventCategory = eventCategory;
|
|
1400
|
-
mCanCoalesceEvent = canCoalesceEvent;
|
|
1401
|
-
}
|
|
1402
|
-
|
|
1403
|
-
public void dispatch(EventEmitterWrapper eventEmitter) {
|
|
1404
|
-
if (mCanCoalesceEvent) {
|
|
1405
|
-
eventEmitter.dispatchUnique(mEventName, mParams);
|
|
1406
|
-
} else {
|
|
1407
|
-
eventEmitter.dispatch(mEventName, mParams, mEventCategory);
|
|
1408
|
-
}
|
|
1409
|
-
}
|
|
1410
|
-
}
|
|
1411
|
-
}
|