react-native-macos 0.0.0-b1e6b9783 → 0.0.0-b2c5fa973
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/AddressSanitizerCrash/RCTAddressSanitizerCrash.js +2 -3
- package/Libraries/Alert/Alert.js +117 -8
- package/Libraries/Alert/NativeAlertManager.js +1 -19
- package/Libraries/Alert/RCTAlertManager.android.js +1 -1
- package/Libraries/Animated/AnimatedImplementation.js +53 -53
- package/Libraries/Animated/AnimatedMock.js +8 -8
- package/Libraries/Animated/NativeAnimatedHelper.js +23 -20
- package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
- package/Libraries/Animated/nodes/AnimatedNode.js +10 -9
- package/Libraries/Animated/nodes/AnimatedValueXY.js +1 -1
- package/Libraries/AppState/AppState.js +8 -7
- package/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule.js +2 -2
- package/Libraries/Blob/React-RCTBlob.podspec +1 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +22 -20
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +1 -2
- package/Libraries/Components/Button.js +1 -2
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +6 -7
- package/Libraries/Components/Keyboard/Keyboard.js +8 -7
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +5 -10
- package/Libraries/Components/Pressable/Pressable.js +1 -2
- package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js +2 -1
- package/Libraries/Components/RefreshControl/RefreshControl.js +2 -7
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +2 -3
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +2 -2
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +3 -5
- package/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +3 -5
- package/Libraries/Components/ScrollView/ScrollView.js +34 -68
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +5 -4
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -2
- package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js +2 -8
- package/Libraries/Components/Sound/SoundManager.js +1 -1
- package/Libraries/Components/TextInput/InputAccessoryView.js +1 -2
- package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +3 -5
- package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +3 -5
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +2 -0
- package/Libraries/Components/TextInput/TextInput.js +137 -11
- package/Libraries/Components/ToastAndroid/ToastAndroid.android.js +3 -3
- package/Libraries/Components/ToastAndroid/ToastAndroid.ios.js +3 -3
- package/Libraries/Components/Touchable/BoundingDimensions.js +2 -2
- package/Libraries/Components/Touchable/PooledClass.js +6 -6
- package/Libraries/Components/Touchable/Position.js +1 -1
- package/Libraries/Components/Touchable/Touchable.js +26 -25
- package/Libraries/Components/Touchable/TouchableBounce.js +1 -2
- package/Libraries/Components/Touchable/TouchableHighlight.js +1 -2
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +4 -11
- package/Libraries/Components/Touchable/TouchableOpacity.js +1 -2
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
- package/Libraries/Components/View/ReactNativeViewViewConfig.js +1 -0
- package/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js +3 -3
- package/Libraries/Components/View/View.js +0 -7
- package/Libraries/Components/View/ViewAccessibility.js +0 -5
- package/Libraries/Components/View/ViewNativeComponent.js +3 -4
- package/Libraries/Components/View/ViewPropTypes.js +101 -117
- package/Libraries/Core/Devtools/parseHermesStack.js +2 -1
- package/Libraries/Core/ExceptionsManager.js +2 -2
- package/Libraries/Core/NativeExceptionsManager.js +2 -3
- package/Libraries/Core/ReactNativeVersion.js +1 -5
- package/Libraries/Core/Timers/JSTimers.js +17 -13
- package/Libraries/Core/setUpAlert.js +1 -1
- package/Libraries/Core/setUpDeveloperTools.js +1 -1
- package/Libraries/Core/setUpPerformance.js +1 -1
- package/Libraries/Core/setUpRegeneratorRuntime.js +1 -1
- package/Libraries/Core/setUpSegmentFetcher.js +4 -4
- package/Libraries/EventEmitter/NativeEventEmitter.js +2 -1
- package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +2 -1
- package/Libraries/HeapCapture/HeapCapture.js +1 -1
- package/Libraries/Image/AssetSourceResolver.js +2 -4
- package/Libraries/Image/Image.android.js +4 -4
- package/Libraries/Image/Image.ios.js +3 -3
- package/Libraries/Image/ImageAnalyticsTagContext.js +2 -3
- package/Libraries/Image/ImageBackground.js +1 -2
- package/Libraries/Image/ImagePickerIOS.js +6 -6
- package/Libraries/Image/ImageViewNativeComponent.js +2 -4
- package/Libraries/Image/NativeImageLoaderAndroid.js +1 -3
- package/Libraries/Image/RCTImageCache.m +1 -1
- package/Libraries/Image/RCTImageView.mm +14 -10
- package/Libraries/Image/React-RCTImage.podspec +1 -1
- package/Libraries/Image/TextInlineImageNativeComponent.js +3 -5
- package/Libraries/Inspector/ElementProperties.js +2 -4
- package/Libraries/Inspector/InspectorOverlay.js +1 -2
- package/Libraries/Inspector/InspectorPanel.js +1 -2
- package/Libraries/Inspector/NetworkOverlay.js +5 -11
- package/Libraries/Interaction/BridgeSpyStallHandler.js +1 -1
- package/Libraries/Interaction/FrameRateLogger.js +2 -2
- package/Libraries/Interaction/InteractionManager.js +2 -4
- package/Libraries/Interaction/JSEventLoopWatchdog.js +4 -4
- package/Libraries/Interaction/PanResponder.js +3 -4
- package/Libraries/Interaction/TouchHistoryMath.js +7 -7
- package/Libraries/JSInspector/NetworkAgent.js +1 -6
- package/Libraries/LayoutAnimation/LayoutAnimation.js +3 -3
- package/Libraries/LinkingIOS/RCTLinkingManager.h +1 -0
- package/Libraries/LinkingIOS/React-RCTLinking.podspec +1 -1
- package/Libraries/LinkingIOS/macos/RCTLinkingManager.mm +12 -5
- package/Libraries/Lists/FillRateHelper.js +1 -3
- package/Libraries/Lists/FlatList.js +28 -5
- package/Libraries/Lists/ViewabilityHelper.js +4 -10
- package/Libraries/Lists/VirtualizeUtils.js +2 -6
- package/Libraries/Lists/VirtualizedList.js +136 -148
- package/Libraries/Lists/VirtualizedListContext.js +3 -5
- package/Libraries/Lists/VirtualizedSectionList.js +63 -68
- package/Libraries/LogBox/Data/LogBoxData.js +1 -1
- package/Libraries/LogBox/Data/parseLogBoxLog.js +12 -23
- package/Libraries/LogBox/UI/LogBoxButton.js +2 -4
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +2 -4
- package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +1 -2
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +1 -2
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +3 -6
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +1 -2
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +2 -4
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +2 -4
- package/Libraries/LogBox/UI/LogBoxNotification.js +2 -4
- package/Libraries/Modal/Modal.js +2 -4
- package/{ReactCommon/react/renderer/mounting/MountingTransactionMetadata.cpp → Libraries/NativeAnimation/Nodes/RCTColorAnimatedNode.h} +6 -4
- package/Libraries/NativeAnimation/Nodes/RCTColorAnimatedNode.m +30 -0
- package/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m +11 -6
- package/Libraries/NativeAnimation/Nodes/RCTStyleAnimatedNode.m +8 -4
- package/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.m +2 -0
- package/Libraries/NativeAnimation/React-RCTAnimation.podspec +2 -2
- package/Libraries/NativeComponent/NativeComponentRegistry.js +2 -4
- package/Libraries/Network/React-RCTNetwork.podspec +1 -1
- package/Libraries/Network/XHRInterceptor.js +5 -6
- package/Libraries/NewAppScreen/components/Header.js +2 -4
- package/Libraries/NewAppScreen/components/HermesBadge.js +1 -2
- package/Libraries/NewAppScreen/components/LearnMoreLinks.js +2 -4
- package/Libraries/Performance/SamplingProfiler.js +3 -3
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +4 -3
- package/Libraries/Pressability/Pressability.js +2 -2
- package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +4 -2
- package/Libraries/PushNotificationIOS/PushNotificationIOS.js +8 -7
- package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +1 -1
- package/Libraries/ReactNative/AppContainer.js +4 -6
- package/Libraries/ReactNative/AppRegistry.js +2 -3
- package/Libraries/ReactNative/I18nManager.js +2 -5
- package/Libraries/ReactNative/PaperUIManager.js +2 -3
- package/Libraries/ReactNative/RootTag.js +2 -3
- package/Libraries/ReactNative/renderApplication.js +1 -2
- package/Libraries/Settings/React-RCTSettings.podspec +1 -1
- package/Libraries/Storage/AsyncStorage.js +21 -21
- package/Libraries/StyleSheet/StyleSheet.js +2 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +26 -1
- package/Libraries/StyleSheet/processColor.js +2 -2
- package/Libraries/StyleSheet/splitLayoutProps.js +1 -3
- package/Libraries/Text/BaseText/RCTBaseTextViewManager.m +8 -0
- package/Libraries/Text/RCTTextAttributes.h +11 -3
- package/Libraries/Text/RCTTextAttributes.m +46 -13
- package/Libraries/Text/Text/RCTDynamicTypeRamp.h +40 -0
- package/Libraries/Text/Text/RCTDynamicTypeRamp.m +77 -0
- package/Libraries/Text/Text/RCTTextView.m +123 -58
- package/Libraries/Text/Text.js +2 -15
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.h +8 -0
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m +66 -1
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.m +13 -0
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.h +2 -1
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +89 -7
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegate.h +13 -1
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +12 -3
- package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +3 -2
- package/Libraries/Text/TextInput/RCTBaseTextInputShadowView.m +12 -0
- package/Libraries/Text/TextInput/RCTBaseTextInputView.h +9 -1
- package/Libraries/Text/TextInput/RCTBaseTextInputView.m +120 -2
- package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m +15 -3
- package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputView.m +4 -0
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.h +2 -0
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.m +64 -1
- package/Libraries/Text/TextNativeComponent.js +5 -5
- package/Libraries/Text/TextProps.js +29 -0
- package/Libraries/TypeSafety/RCTTypeSafety.podspec +1 -1
- package/Libraries/Types/CoreEventTypes.js +0 -1
- package/Libraries/Utilities/Appearance.js +8 -5
- package/Libraries/Utilities/BackHandler.android.js +4 -4
- package/Libraries/Utilities/HMRClient.js +2 -2
- package/Libraries/Utilities/JSDevSupportModule.js +3 -4
- package/Libraries/Utilities/MatrixMath.js +19 -19
- package/Libraries/Utilities/PerformanceLoggerContext.js +2 -3
- package/Libraries/Utilities/ReactNativeTestTools.js +2 -4
- package/Libraries/Utilities/SceneTracker.js +1 -3
- package/Libraries/Utilities/__mocks__/BackHandler.js +3 -3
- package/Libraries/Utilities/buildStyleInterpolator.js +9 -9
- package/Libraries/Utilities/codegenNativeComponent.js +4 -2
- package/Libraries/Utilities/differ/deepDiffer.js +1 -1
- package/Libraries/Utilities/differ/insetsDiffer.js +1 -1
- package/Libraries/Utilities/differ/matricesDiffer.js +1 -1
- package/Libraries/Utilities/differ/pointsDiffer.js +1 -1
- package/Libraries/Utilities/differ/sizesDiffer.js +1 -1
- package/Libraries/Utilities/logError.js +1 -1
- package/Libraries/Utilities/mergeIntoFast.js +1 -1
- package/Libraries/Utilities/truncate.js +1 -1
- package/Libraries/Vibration/React-RCTVibration.podspec +1 -1
- package/Libraries/Vibration/Vibration.js +2 -2
- package/Libraries/WebSocket/WebSocketInterceptor.js +4 -4
- package/Libraries/promiseRejectionTrackingOptions.js +1 -1
- package/Libraries/vendor/emitter/_EmitterSubscription.js +2 -1
- package/Libraries/vendor/emitter/_EventEmitter.js +2 -1
- package/Libraries/vendor/emitter/_EventSubscription.js +2 -1
- package/Libraries/vendor/emitter/_EventSubscriptionVendor.js +1 -1
- package/React/Base/RCTAssert.h +30 -15
- package/React/Base/RCTAssert.m +59 -19
- package/React/Base/RCTBridge.m +5 -3
- package/React/Base/RCTConstants.h +6 -0
- package/React/Base/RCTConstants.m +15 -0
- package/React/Base/RCTConvert.m +8 -4
- package/React/Base/RCTEventDispatcherProtocol.h +5 -0
- package/React/Base/RCTRootView.m +0 -51
- package/React/Base/RCTTouchHandler.m +15 -1
- package/React/Base/RCTUIKit.h +75 -15
- package/React/Base/RCTUtils.m +33 -3
- package/React/Base/RCTVersion.m +1 -5
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +0 -1
- package/React/Base/macOS/RCTPlatformDisplayLink.m +3 -1
- package/React/Base/macOS/RCTUIKit.m +102 -0
- package/React/CoreModules/RCTAlertManager.mm +1 -1
- package/React/CoreModules/RCTAppearance.mm +21 -5
- package/React/CoreModules/RCTDevLoadingView.mm +1 -1
- package/React/CoreModules/RCTEventDispatcher.mm +6 -1
- package/React/CoreModules/RCTLogBox.h +1 -1
- package/React/CoreModules/RCTLogBox.mm +35 -19
- package/React/CoreModules/RCTLogBoxView.h +8 -5
- package/React/CoreModules/RCTLogBoxView.mm +64 -23
- package/React/CoreModules/RCTPerfMonitor.mm +1 -1
- package/React/CoreModules/React-CoreModules.podspec +1 -1
- package/React/FBReactNativeSpec/FBReactNativeSpec.podspec +1 -1
- package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm +3 -2
- package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm +8 -8
- package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.h +2 -2
- package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.mm +3 -3
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h +2 -1
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +75 -25
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.mm +1 -1
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.h +2 -0
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +10 -5
- package/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm +10 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +5 -3
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +23 -6
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +17 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +6 -4
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +98 -34
- package/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm +19 -5
- package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm +3 -3
- package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.h +5 -1
- package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.mm +3 -1
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.h +4 -2
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.mm +6 -2
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +21 -0
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +39 -5
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h +9 -6
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +16 -4
- package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.h +2 -1
- package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.mm +6 -4
- package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm +14 -4
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h +5 -5
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +41 -23
- package/React/Fabric/Mounting/RCTComponentViewClassDescriptor.h +1 -1
- package/React/Fabric/Mounting/RCTComponentViewDescriptor.h +2 -2
- package/React/Fabric/Mounting/RCTComponentViewFactory.h +1 -1
- package/React/Fabric/Mounting/RCTComponentViewFactory.mm +12 -3
- package/React/Fabric/Mounting/RCTComponentViewProtocol.h +4 -4
- package/React/Fabric/Mounting/RCTComponentViewRegistry.h +2 -2
- package/React/Fabric/Mounting/RCTComponentViewRegistry.mm +3 -1
- package/React/Fabric/Mounting/RCTMountingManager.h +4 -4
- package/React/Fabric/Mounting/RCTMountingManager.mm +30 -19
- package/React/Fabric/Mounting/RCTMountingManagerDelegate.h +1 -1
- package/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.h +5 -3
- package/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.mm +10 -8
- package/React/Fabric/Mounting/RCTMountingTransactionObserving.h +6 -4
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +6 -6
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +6 -6
- package/React/Fabric/RCTConversions.h +17 -7
- package/React/Fabric/RCTImageResponseDelegate.h +1 -1
- package/React/Fabric/RCTImageResponseObserverProxy.h +1 -0
- package/React/Fabric/RCTLocalizationProvider.h +1 -1
- package/React/Fabric/RCTLocalizationProvider.mm +10 -4
- package/React/Fabric/RCTScheduler.h +8 -1
- package/React/Fabric/RCTScheduler.mm +15 -0
- package/React/Fabric/RCTSurfacePresenter.h +10 -2
- package/React/Fabric/RCTSurfacePresenter.mm +59 -27
- package/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +1 -1
- package/React/Fabric/RCTSurfaceRegistry.h +1 -1
- package/React/Fabric/RCTSurfaceTouchHandler.h +3 -3
- package/React/Fabric/RCTSurfaceTouchHandler.mm +8 -9
- package/React/Fabric/RCTTouchableComponentViewProtocol.h +1 -1
- package/React/Fabric/Surface/RCTFabricSurface.mm +3 -1
- package/React/Fabric/Utils/RCTGenericDelegateSplitter.h +1 -1
- package/React/Modules/RCTSurfacePresenterStub.h +4 -0
- package/React/Modules/RCTUIManager.m +29 -14
- package/React/React-RCTFabric.podspec +2 -2
- package/React/Views/RCTActivityIndicatorView.m +2 -1
- package/React/Views/RCTCursor.h +39 -0
- package/React/Views/RCTCursor.m +105 -0
- package/React/Views/RCTMaskedView.h +1 -1
- package/React/Views/RCTModalHostView.h +2 -2
- package/React/Views/RCTModalHostViewController.h +1 -1
- package/React/Views/RCTModalManager.h +1 -1
- package/React/Views/RCTSwitch.h +1 -10
- package/React/Views/RCTSwitch.m +0 -20
- package/React/Views/RCTSwitchManager.m +0 -4
- package/React/Views/RCTView.h +16 -0
- package/React/Views/RCTView.m +142 -189
- package/React/Views/RCTViewKeyboardEvent.h +6 -28
- package/React/Views/RCTViewKeyboardEvent.m +66 -61
- package/React/Views/RCTViewManager.m +19 -13
- package/React/Views/RCTWeakViewHolder.h +1 -1
- package/React/Views/RCTWrapperViewController.h +2 -2
- package/React/Views/RefreshControl/RCTRefreshControl.h +2 -2
- package/React/Views/RefreshControl/RCTRefreshableProtocol.h +1 -1
- package/React/Views/SafeAreaView/RCTSafeAreaView.h +1 -1
- package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h +1 -1
- package/React/Views/ScrollView/RCTScrollContentView.h +4 -0
- package/React/Views/ScrollView/RCTScrollContentView.m +18 -0
- package/React/Views/ScrollView/RCTScrollContentViewManager.m +2 -0
- package/React/Views/ScrollView/RCTScrollView.h +2 -1
- package/React/Views/ScrollView/RCTScrollView.m +66 -89
- package/React/Views/ScrollView/RCTScrollViewManager.m +1 -1
- package/React/Views/ScrollView/RCTScrollableProtocol.h +1 -1
- package/React/Views/UIView+React.h +2 -0
- package/React/Views/UIView+React.m +23 -14
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/androidTest/js/AnimatedTransformTestModule.js +1 -2
- package/ReactAndroid/src/androidTest/js/Asserts.js +2 -2
- package/ReactAndroid/src/androidTest/js/CatalystRootViewTestModule.js +1 -1
- package/ReactAndroid/src/androidTest/js/JSResponderTestApp.js +1 -2
- package/ReactAndroid/src/androidTest/js/LayoutEventsTestApp.js +1 -2
- package/ReactAndroid/src/androidTest/js/MeasureLayoutTestModule.js +54 -54
- package/ReactAndroid/src/androidTest/js/ProgressBarTestModule.js +1 -1
- package/ReactAndroid/src/androidTest/js/ScrollViewTestModule.js +6 -7
- package/ReactAndroid/src/androidTest/js/ShareTestModule.js +1 -1
- package/ReactAndroid/src/androidTest/js/SubviewsClippingTestModule.js +12 -19
- package/ReactAndroid/src/androidTest/js/SwipeRefreshLayoutTestModule.js +2 -3
- package/ReactAndroid/src/androidTest/js/TestJSLocaleModule.js +2 -2
- package/ReactAndroid/src/androidTest/js/TestJSToJavaParametersModule.js +17 -17
- package/ReactAndroid/src/androidTest/js/TestJavaToJSArgumentsModule.js +10 -10
- package/ReactAndroid/src/androidTest/js/TestJavaToJSReturnValuesModule.js +2 -2
- package/ReactAndroid/src/androidTest/js/TextInputTestModule.js +2 -3
- package/ReactAndroid/src/androidTest/js/TouchBubblingTestAppModule.js +3 -6
- package/ReactAndroid/src/androidTest/js/UIManagerTestModule.js +3 -6
- package/ReactAndroid/src/androidTest/js/ViewRenderingTestModule.js +5 -5
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/viewPropConversions.h +527 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -5
- package/ReactAndroid/src/main/jni/Application.mk +1 -1
- package/ReactAndroid/src/main/jni/first-party/fb/BUCK +1 -1
- package/ReactAndroid/src/main/jni/react/jni/Android.mk +2 -2
- package/ReactCommon/React-Fabric.podspec +1 -1
- package/ReactCommon/React-rncore.podspec +1 -1
- package/ReactCommon/ReactCommon.podspec +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -5
- package/ReactCommon/cxxreact/tests/BUCK +1 -1
- package/ReactCommon/hermes/inspector/tools/msggen/src/HeaderWriter.js +1 -1
- package/ReactCommon/hermes/inspector/tools/msggen/src/index.js +1 -1
- package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +3 -3
- package/ReactCommon/microprofiler/BUCK +1 -1
- package/ReactCommon/react/debug/react_native_assert.h +1 -1
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +6 -6
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h +4 -3
- package/ReactCommon/react/renderer/animations/conversions.h +11 -11
- package/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +1 -1
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +16 -16
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +14 -14
- package/ReactCommon/react/renderer/attributedstring/conversions.h +1 -1
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +5 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +3 -3
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +7 -5
- package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.h +1 -1
- package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.h +1 -1
- package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.cpp +1 -1
- package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.h +1 -1
- package/ReactCommon/react/renderer/components/textinput/iostextinput/primitives.h +3 -4
- package/ReactCommon/react/renderer/components/view/AccessibilityPrimitives.h +6 -6
- package/ReactCommon/react/renderer/components/view/ViewProps.h +3 -1
- package/ReactCommon/react/renderer/components/view/ViewPropsInterpolation.h +3 -3
- package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +16 -16
- package/ReactCommon/react/renderer/components/view/conversions.h +5 -6
- package/ReactCommon/react/renderer/components/view/primitives.h +4 -3
- package/ReactCommon/react/renderer/components/view/propsConversions.h +2 -0
- package/ReactCommon/react/renderer/core/ComponentDescriptor.h +5 -5
- package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +7 -7
- package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +2 -2
- package/ReactCommon/react/renderer/core/EventDispatcher.cpp +21 -0
- package/ReactCommon/react/renderer/core/EventDispatcher.h +15 -0
- package/ReactCommon/react/renderer/core/EventListener.cpp +39 -0
- package/ReactCommon/react/renderer/core/EventListener.h +44 -0
- package/ReactCommon/react/renderer/core/Props.h +0 -4
- package/ReactCommon/react/renderer/core/RawProps.h +1 -1
- package/ReactCommon/react/renderer/core/ShadowNode.cpp +2 -2
- package/ReactCommon/react/renderer/core/ShadowNode.h +5 -5
- package/ReactCommon/react/renderer/core/propsConversions.h +6 -5
- package/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp +3 -3
- package/ReactCommon/react/renderer/debug/debugStringConvertibleUtils.h +3 -3
- package/ReactCommon/react/renderer/graphics/React-graphics.podspec +1 -1
- package/ReactCommon/react/renderer/graphics/platform/ios/Color.h +1 -1
- package/ReactCommon/react/renderer/graphics/platform/ios/RCTPlatformColorUtils.mm +9 -9
- package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImageManager.h +1 -1
- package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImagePrimitivesConversions.h +1 -1
- package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTSyncImageManager.h +1 -1
- package/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp +2 -2
- package/ReactCommon/react/renderer/mounting/MountingCoordinator.h +3 -3
- package/ReactCommon/react/renderer/mounting/MountingOverrideDelegate.h +1 -1
- package/ReactCommon/react/renderer/mounting/ShadowTreeRevision.h +0 -2
- package/ReactCommon/react/renderer/mounting/StubView.h +1 -1
- package/ReactCommon/react/renderer/mounting/StubViewTree.cpp +1 -1
- package/ReactCommon/react/renderer/mounting/TelemetryController.cpp +6 -9
- package/ReactCommon/react/renderer/mounting/TelemetryController.h +7 -7
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +3 -2
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +7 -1
- package/ReactCommon/react/renderer/runtimescheduler/Task.h +3 -2
- package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +19 -2
- package/ReactCommon/react/renderer/scheduler/Scheduler.h +10 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/NSTextStorage+FontScaling.h +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm +15 -15
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontProperties.h +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontUtils.h +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.h +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.mm +5 -0
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextPrimitivesConversions.h +6 -6
- package/ReactCommon/react/utils/ContextContainer.h +2 -2
- package/ReactCommon/react/utils/ManagedObjectWrapper.h +1 -1
- package/ReactCommon/react/utils/ManagedObjectWrapper.mm +1 -3
- package/ReactCommon/react/utils/SimpleThreadSafeCache.h +2 -2
- package/ReactCommon/yoga/Yoga.podspec +1 -1
- package/index.js +0 -11
- package/jest/assetFileTransformer.js +2 -2
- package/jest/preprocessor.js +2 -2
- package/jest/setup.js +3 -3
- package/local-cli/generator-macos/templates/macos/HelloWorld-macOS/ViewController.m +1 -1
- package/package.json +25 -25
- package/scripts/generate-artifacts.js +21 -17
- package/scripts/react_native_pods.rb +1 -4
- package/template/App.js +4 -8
- package/template/Gemfile.lock +8 -8
- package/template/android/gradlew.bat +89 -89
- package/template/ios/HelloWorldTests/HelloWorldTests.m +1 -0
- package/template/package.json +1 -1
- package/Libraries/Alert/AlertMacOS.js +0 -211
- package/Libraries/Types/RootTagTypes.js~merged +0 -23
- package/ReactCommon/butter/optional.h +0 -38
- package/ReactCommon/react/renderer/mounting/MountingTransactionMetadata.h +0 -32
- package/third-party-podspecs/boost-for-react-native.podspec +0 -20
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
#import "RCTViewComponentView.h"
|
|
9
9
|
|
|
10
10
|
#import <CoreGraphics/CoreGraphics.h>
|
|
11
|
+
#import <QuartzCore/QuartzCore.h>
|
|
11
12
|
#import <objc/runtime.h>
|
|
12
13
|
|
|
13
14
|
#import <React/RCTAssert.h>
|
|
@@ -20,12 +21,12 @@
|
|
|
20
21
|
using namespace facebook::react;
|
|
21
22
|
|
|
22
23
|
@implementation RCTViewComponentView {
|
|
23
|
-
|
|
24
|
+
RCTUIColor *_backgroundColor; // TODO(macOS GH#774)
|
|
24
25
|
CALayer *_borderLayer;
|
|
25
26
|
BOOL _needsInvalidateLayer;
|
|
26
27
|
BOOL _isJSResponder;
|
|
27
28
|
BOOL _removeClippedSubviews;
|
|
28
|
-
NSMutableArray<
|
|
29
|
+
NSMutableArray<RCTUIView *> *_reactSubviews; // TODO(macOS GH#774)
|
|
29
30
|
NSSet<NSString *> *_Nullable _propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN;
|
|
30
31
|
}
|
|
31
32
|
|
|
@@ -37,17 +38,19 @@ using namespace facebook::react;
|
|
|
37
38
|
static auto const defaultProps = std::make_shared<ViewProps const>();
|
|
38
39
|
_props = defaultProps;
|
|
39
40
|
_reactSubviews = [NSMutableArray new];
|
|
41
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
40
42
|
self.multipleTouchEnabled = YES;
|
|
43
|
+
#endif // TODO(macOS GH#774)
|
|
41
44
|
}
|
|
42
45
|
return self;
|
|
43
46
|
}
|
|
44
47
|
|
|
45
|
-
- (facebook::react::
|
|
48
|
+
- (facebook::react::Props::Shared)props
|
|
46
49
|
{
|
|
47
50
|
return _props;
|
|
48
51
|
}
|
|
49
52
|
|
|
50
|
-
- (void)setContentView:(
|
|
53
|
+
- (void)setContentView:(RCTUIView *)contentView // TODO(macOS GH#774)
|
|
51
54
|
{
|
|
52
55
|
if (_contentView) {
|
|
53
56
|
[_contentView removeFromSuperview];
|
|
@@ -70,12 +73,12 @@ using namespace facebook::react;
|
|
|
70
73
|
return CGRectContainsPoint(hitFrame, point);
|
|
71
74
|
}
|
|
72
75
|
|
|
73
|
-
- (
|
|
76
|
+
- (RCTUIColor *)backgroundColor // TODO(macOS GH#774)
|
|
74
77
|
{
|
|
75
78
|
return _backgroundColor;
|
|
76
79
|
}
|
|
77
80
|
|
|
78
|
-
- (void)setBackgroundColor:(
|
|
81
|
+
- (void)setBackgroundColor:(RCTUIColor *)backgroundColor // TODO(macOS GH#774)
|
|
79
82
|
{
|
|
80
83
|
_backgroundColor = backgroundColor;
|
|
81
84
|
}
|
|
@@ -91,7 +94,7 @@ using namespace facebook::react;
|
|
|
91
94
|
return concreteComponentDescriptorProvider<ViewComponentDescriptor>();
|
|
92
95
|
}
|
|
93
96
|
|
|
94
|
-
- (void)mountChildComponentView:(
|
|
97
|
+
- (void)mountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
|
|
95
98
|
{
|
|
96
99
|
RCTAssert(
|
|
97
100
|
childComponentView.superview == nil,
|
|
@@ -108,7 +111,7 @@ using namespace facebook::react;
|
|
|
108
111
|
}
|
|
109
112
|
}
|
|
110
113
|
|
|
111
|
-
- (void)unmountChildComponentView:(
|
|
114
|
+
- (void)unmountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
|
|
112
115
|
{
|
|
113
116
|
if (_removeClippedSubviews) {
|
|
114
117
|
[_reactSubviews removeObjectAtIndex:index];
|
|
@@ -132,7 +135,7 @@ using namespace facebook::react;
|
|
|
132
135
|
[childComponentView removeFromSuperview];
|
|
133
136
|
}
|
|
134
137
|
|
|
135
|
-
- (void)updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(
|
|
138
|
+
- (void)updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(RCTUIView *)clipView // TODO(macOS GH#774)
|
|
136
139
|
{
|
|
137
140
|
if (!_removeClippedSubviews) {
|
|
138
141
|
// Use default behavior if unmounting is disabled
|
|
@@ -153,7 +156,7 @@ using namespace facebook::react;
|
|
|
153
156
|
clipRect = [clipView convertRect:clipRect toView:self];
|
|
154
157
|
|
|
155
158
|
// Mount / unmount views
|
|
156
|
-
for (
|
|
159
|
+
for (RCTUIView *view in _reactSubviews) { // TODO(macOS GH#774)
|
|
157
160
|
if (CGRectIntersectsRect(clipRect, view.frame)) {
|
|
158
161
|
// View is at least partially visible, so remount it if unmounted
|
|
159
162
|
[self addSubview:view];
|
|
@@ -202,13 +205,13 @@ using namespace facebook::react;
|
|
|
202
205
|
|
|
203
206
|
// `backgroundColor`
|
|
204
207
|
if (oldViewProps.backgroundColor != newViewProps.backgroundColor) {
|
|
205
|
-
self.backgroundColor = RCTUIColorFromSharedColor(newViewProps.backgroundColor);
|
|
208
|
+
self.backgroundColor = RCTUIColorFromSharedColor(newViewProps.backgroundColor); // TODO(macOS GH#774)
|
|
206
209
|
needsInvalidateLayer = YES;
|
|
207
210
|
}
|
|
208
211
|
|
|
209
212
|
// `foregroundColor`
|
|
210
213
|
if (oldViewProps.foregroundColor != newViewProps.foregroundColor) {
|
|
211
|
-
self.foregroundColor = RCTUIColorFromSharedColor(newViewProps.foregroundColor);
|
|
214
|
+
self.foregroundColor = RCTUIColorFromSharedColor(newViewProps.foregroundColor); // TODO(macOS GH#774)
|
|
212
215
|
}
|
|
213
216
|
|
|
214
217
|
// `shadowColor`
|
|
@@ -245,7 +248,11 @@ using namespace facebook::react;
|
|
|
245
248
|
// `shouldRasterize`
|
|
246
249
|
if (oldViewProps.shouldRasterize != newViewProps.shouldRasterize) {
|
|
247
250
|
self.layer.shouldRasterize = newViewProps.shouldRasterize;
|
|
251
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
248
252
|
self.layer.rasterizationScale = newViewProps.shouldRasterize ? [UIScreen mainScreen].scale : 1.0;
|
|
253
|
+
#else // [TODO(macOS GH#774)
|
|
254
|
+
self.layer.rasterizationScale = 1.0;
|
|
255
|
+
#endif // ]TODO(macOS GH#774)
|
|
249
256
|
}
|
|
250
257
|
|
|
251
258
|
// `pointerEvents`
|
|
@@ -286,6 +293,7 @@ using namespace facebook::react;
|
|
|
286
293
|
self.nativeId = RCTNSStringFromStringNilIfEmpty(newViewProps.nativeId);
|
|
287
294
|
}
|
|
288
295
|
|
|
296
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
289
297
|
// `accessible`
|
|
290
298
|
if (oldViewProps.accessible != newViewProps.accessible) {
|
|
291
299
|
self.accessibilityElement.isAccessibilityElement = newViewProps.accessible;
|
|
@@ -335,12 +343,12 @@ using namespace facebook::react;
|
|
|
335
343
|
|
|
336
344
|
// `accessibilityValue`
|
|
337
345
|
if (oldViewProps.accessibilityValue != newViewProps.accessibilityValue) {
|
|
338
|
-
if (newViewProps.accessibilityValue.text.
|
|
346
|
+
if (newViewProps.accessibilityValue.text.has_value()) {
|
|
339
347
|
self.accessibilityElement.accessibilityValue =
|
|
340
348
|
RCTNSStringFromStringNilIfEmpty(newViewProps.accessibilityValue.text.value());
|
|
341
349
|
} else if (
|
|
342
|
-
newViewProps.accessibilityValue.now.
|
|
343
|
-
newViewProps.accessibilityValue.max.
|
|
350
|
+
newViewProps.accessibilityValue.now.has_value() && newViewProps.accessibilityValue.min.has_value() &&
|
|
351
|
+
newViewProps.accessibilityValue.max.has_value()) {
|
|
344
352
|
CGFloat val = (CGFloat)(newViewProps.accessibilityValue.now.value()) /
|
|
345
353
|
(newViewProps.accessibilityValue.max.value() - newViewProps.accessibilityValue.min.value());
|
|
346
354
|
self.accessibilityElement.accessibilityValue =
|
|
@@ -350,6 +358,7 @@ using namespace facebook::react;
|
|
|
350
358
|
self.accessibilityElement.accessibilityValue = nil;
|
|
351
359
|
}
|
|
352
360
|
}
|
|
361
|
+
#endif // TODO(macOS GH#774)
|
|
353
362
|
|
|
354
363
|
// `testId`
|
|
355
364
|
if (oldViewProps.testId != newViewProps.testId) {
|
|
@@ -437,7 +446,7 @@ using namespace facebook::react;
|
|
|
437
446
|
return _propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN;
|
|
438
447
|
}
|
|
439
448
|
|
|
440
|
-
- (
|
|
449
|
+
- (RCTUIView *)betterHitTest:(CGPoint)point withEvent:(UIEvent *)event // TODO(macOS GH#774)
|
|
441
450
|
{
|
|
442
451
|
// This is a classic textbook implementation of `hitTest:` with a couple of improvements:
|
|
443
452
|
// * It does not stop algorithm if some touch is outside the view
|
|
@@ -459,8 +468,8 @@ using namespace facebook::react;
|
|
|
459
468
|
return nil;
|
|
460
469
|
}
|
|
461
470
|
|
|
462
|
-
for (
|
|
463
|
-
|
|
471
|
+
for (RCTUIView *subview in [self.subviews reverseObjectEnumerator]) { // TODO(macOS GH#774)
|
|
472
|
+
RCTUIView *hitView = [subview hitTest:[subview convertPoint:point fromView:self] withEvent:event]; // TODO(macOS GH#774)
|
|
464
473
|
if (hitView) {
|
|
465
474
|
return hitView;
|
|
466
475
|
}
|
|
@@ -469,7 +478,7 @@ using namespace facebook::react;
|
|
|
469
478
|
return isPointInside ? self : nil;
|
|
470
479
|
}
|
|
471
480
|
|
|
472
|
-
- (
|
|
481
|
+
- (RCTUIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event // TODO(macOS GH#774)
|
|
473
482
|
{
|
|
474
483
|
switch (_props->pointerEvents) {
|
|
475
484
|
case PointerEventsMode::Auto:
|
|
@@ -479,7 +488,7 @@ using namespace facebook::react;
|
|
|
479
488
|
case PointerEventsMode::BoxOnly:
|
|
480
489
|
return [self pointInside:point withEvent:event] ? self : nil;
|
|
481
490
|
case PointerEventsMode::BoxNone:
|
|
482
|
-
|
|
491
|
+
RCTUIView *view = [self betterHitTest:point withEvent:event]; // TODO(macOS GH#774)
|
|
483
492
|
return view != self ? view : nil;
|
|
484
493
|
}
|
|
485
494
|
}
|
|
@@ -591,6 +600,12 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
|
|
|
591
600
|
|
|
592
601
|
RCTBorderColors borderColors = RCTCreateRCTBorderColorsFromBorderColors(borderMetrics.borderColors);
|
|
593
602
|
|
|
603
|
+
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
604
|
+
CGFloat scaleFactor = self.window.backingScaleFactor;
|
|
605
|
+
#else
|
|
606
|
+
// On iOS setting the scaleFactor to 0.0 will default to the device's native scale factor.
|
|
607
|
+
CGFloat scaleFactor = 0.0;
|
|
608
|
+
#endif // ]TODO(macOS GH#774)
|
|
594
609
|
UIImage *image = RCTGetBorderImage(
|
|
595
610
|
RCTBorderStyleFromBorderStyle(borderMetrics.borderStyles.left),
|
|
596
611
|
layer.bounds.size,
|
|
@@ -598,7 +613,8 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
|
|
|
598
613
|
RCTUIEdgeInsetsFromEdgeInsets(borderMetrics.borderWidths),
|
|
599
614
|
borderColors,
|
|
600
615
|
_backgroundColor.CGColor,
|
|
601
|
-
self.clipsToBounds
|
|
616
|
+
self.clipsToBounds,
|
|
617
|
+
scaleFactor); // TODO(macOS GH#774)
|
|
602
618
|
|
|
603
619
|
RCTReleaseRCTBorderColors(borderColors);
|
|
604
620
|
|
|
@@ -654,10 +670,10 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
|
|
|
654
670
|
return self;
|
|
655
671
|
}
|
|
656
672
|
|
|
657
|
-
static NSString *RCTRecursiveAccessibilityLabel(
|
|
673
|
+
static NSString *RCTRecursiveAccessibilityLabel(RCTUIView *view) // TODO(macOS GH#774)
|
|
658
674
|
{
|
|
659
675
|
NSMutableString *result = [NSMutableString stringWithString:@""];
|
|
660
|
-
for (
|
|
676
|
+
for (RCTUIView *subview in view.subviews) { // TODO(macOS GH#774)
|
|
661
677
|
NSString *label = subview.accessibilityLabel;
|
|
662
678
|
if (!label) {
|
|
663
679
|
label = RCTRecursiveAccessibilityLabel(subview);
|
|
@@ -687,6 +703,7 @@ static NSString *RCTRecursiveAccessibilityLabel(UIView *view)
|
|
|
687
703
|
auto const &props = *std::static_pointer_cast<ViewProps const>(_props);
|
|
688
704
|
|
|
689
705
|
// Handle Switch.
|
|
706
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
690
707
|
if ((self.accessibilityTraits & AccessibilityTraitSwitch) == AccessibilityTraitSwitch) {
|
|
691
708
|
if (props.accessibilityState.checked == AccessibilityState::Checked) {
|
|
692
709
|
return @"1";
|
|
@@ -694,6 +711,7 @@ static NSString *RCTRecursiveAccessibilityLabel(UIView *view)
|
|
|
694
711
|
return @"0";
|
|
695
712
|
}
|
|
696
713
|
}
|
|
714
|
+
#endif // TODO(macOS GH#774)
|
|
697
715
|
|
|
698
716
|
// Handle states which haven't already been handled.
|
|
699
717
|
if (props.accessibilityState.checked == AccessibilityState::Checked) {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
#import <
|
|
8
|
+
#import <React/RCTUIKit.h> // TODO(macOS GH#774)
|
|
9
9
|
|
|
10
10
|
#import <React/RCTComponentViewProtocol.h>
|
|
11
11
|
|
|
@@ -21,7 +21,7 @@ class RCTComponentViewDescriptor final {
|
|
|
21
21
|
/*
|
|
22
22
|
* Associated (and owned) native view instance.
|
|
23
23
|
*/
|
|
24
|
-
__strong
|
|
24
|
+
__strong RCTUIView<RCTComponentViewProtocol> *view = nil; // TODO(macOS GH#774)
|
|
25
25
|
|
|
26
26
|
/*
|
|
27
27
|
* Indicates a requirement to call on the view methods from
|
|
@@ -95,9 +95,9 @@ static Class<RCTComponentViewProtocol> RCTComponentViewClassWithName(const char
|
|
|
95
95
|
{
|
|
96
96
|
.viewClass = viewClass,
|
|
97
97
|
.observesMountingTransactionWillMount =
|
|
98
|
-
(bool)class_respondsToSelector(viewClass, @selector(
|
|
98
|
+
(bool)class_respondsToSelector(viewClass, @selector(mountingTransactionWillMount:withSurfaceTelemetry:)),
|
|
99
99
|
.observesMountingTransactionDidMount =
|
|
100
|
-
(bool)class_respondsToSelector(viewClass, @selector(
|
|
100
|
+
(bool)class_respondsToSelector(viewClass, @selector(mountingTransactionDidMount:withSurfaceTelemetry:)),
|
|
101
101
|
};
|
|
102
102
|
#pragma clang diagnostic pop
|
|
103
103
|
}
|
|
@@ -117,7 +117,16 @@ static Class<RCTComponentViewProtocol> RCTComponentViewClassWithName(const char
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
// Fallback 2: Try to use Paper Interop.
|
|
120
|
-
|
|
120
|
+
NSString *componentNameString = RCTNSStringFromString(name);
|
|
121
|
+
if ([RCTLegacyViewManagerInteropComponentView isSupported:componentNameString]) {
|
|
122
|
+
RCTLogNewArchitectureValidation(
|
|
123
|
+
RCTNotAllowedInBridgeless,
|
|
124
|
+
self,
|
|
125
|
+
[NSString
|
|
126
|
+
stringWithFormat:
|
|
127
|
+
@"Legacy ViewManagers should be migrated to Fabric ComponentViews in the new architecture to reduce risk. Component using interop layer: %@",
|
|
128
|
+
componentNameString]);
|
|
129
|
+
|
|
121
130
|
auto flavor = std::make_shared<std::string const>(name);
|
|
122
131
|
auto componentName = ComponentName{flavor->c_str()};
|
|
123
132
|
auto componentHandle = reinterpret_cast<ComponentHandle>(componentName);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
#import <
|
|
8
|
+
#import <React/RCTUIKit.h> // TODO(macOS GH#774)
|
|
9
9
|
|
|
10
10
|
#import <react/renderer/componentregistry/ComponentDescriptorProvider.h>
|
|
11
11
|
#import <react/renderer/core/EventEmitter.h>
|
|
@@ -54,14 +54,14 @@ typedef NS_OPTIONS(NSInteger, RNComponentViewUpdateMask) {
|
|
|
54
54
|
* component view.
|
|
55
55
|
* Receiver must add `childComponentView` as a subview.
|
|
56
56
|
*/
|
|
57
|
-
- (void)mountChildComponentView:(
|
|
57
|
+
- (void)mountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index; // TODO(macOS GH#774)
|
|
58
58
|
|
|
59
59
|
/*
|
|
60
60
|
* Called for unmounting (detaching) a child component view from `self`
|
|
61
61
|
* component view.
|
|
62
62
|
* Receiver must remove `childComponentView` as a subview.
|
|
63
63
|
*/
|
|
64
|
-
- (void)unmountChildComponentView:(
|
|
64
|
+
- (void)unmountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index; // TODO(macOS GH#774)
|
|
65
65
|
|
|
66
66
|
/*
|
|
67
67
|
* Called for updating component's props.
|
|
@@ -114,7 +114,7 @@ typedef NS_OPTIONS(NSInteger, RNComponentViewUpdateMask) {
|
|
|
114
114
|
/*
|
|
115
115
|
* Read the last props used to update the view.
|
|
116
116
|
*/
|
|
117
|
-
- (facebook::react::
|
|
117
|
+
- (facebook::react::Props::Shared)props;
|
|
118
118
|
|
|
119
119
|
- (BOOL)isJSResponder;
|
|
120
120
|
- (void)setIsJSResponder:(BOOL)isJSResponder;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
#import <
|
|
8
|
+
#import <React/RCTUIKit.h> // TODO(macOS GH#774)
|
|
9
9
|
|
|
10
10
|
#import <React/RCTComponentViewDescriptor.h>
|
|
11
11
|
#import <React/RCTComponentViewFactory.h>
|
|
@@ -48,7 +48,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
48
48
|
* Finds a native component view by given `tag`.
|
|
49
49
|
* Returns `nil` if there is no registered component with the `tag`.
|
|
50
50
|
*/
|
|
51
|
-
- (nullable
|
|
51
|
+
- (nullable RCTUIView<RCTComponentViewProtocol> *)findComponentViewWithTag:(facebook::react::Tag)tag; // TODO(macOS GH#774)
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* Creates a component view with a given type and puts it to the recycle pool.
|
|
@@ -31,10 +31,12 @@ const NSInteger RCTComponentViewRegistryRecyclePoolMaxSize = 1024;
|
|
|
31
31
|
if (self = [super init]) {
|
|
32
32
|
_componentViewFactory = [RCTComponentViewFactory currentComponentViewFactory];
|
|
33
33
|
|
|
34
|
+
#if !TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
34
35
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
35
36
|
selector:@selector(handleApplicationDidReceiveMemoryWarningNotification)
|
|
36
37
|
name:UIApplicationDidReceiveMemoryWarningNotification
|
|
37
38
|
object:nil];
|
|
39
|
+
#endif // ]TODO(macOS GH#774)
|
|
38
40
|
|
|
39
41
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
40
42
|
// Calling this a bit later, when the main thread is probably idle while JavaScript thread is busy.
|
|
@@ -116,7 +118,7 @@ const NSInteger RCTComponentViewRegistryRecyclePoolMaxSize = 1024;
|
|
|
116
118
|
return iterator->second;
|
|
117
119
|
}
|
|
118
120
|
|
|
119
|
-
- (nullable
|
|
121
|
+
- (nullable RCTUIView<RCTComponentViewProtocol> *)findComponentViewWithTag:(Tag)tag // TODO(macOS GH#774)
|
|
120
122
|
{
|
|
121
123
|
RCTAssertMainQueue();
|
|
122
124
|
auto iterator = _registry.find(tag);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
#import <
|
|
8
|
+
#import <React/RCTUIKit.h> // TODO(macOS GH#774)
|
|
9
9
|
|
|
10
10
|
#import <React/RCTMountingManagerDelegate.h>
|
|
11
11
|
#import <React/RCTPrimitives.h>
|
|
@@ -36,12 +36,12 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
36
36
|
* influence the intrinsic size of the view and cannot be measured using UIView/UIKit layout API.
|
|
37
37
|
* Must be called on the main thead.
|
|
38
38
|
*/
|
|
39
|
-
- (void)attachSurfaceToView:(
|
|
39
|
+
- (void)attachSurfaceToView:(RCTUIView *)view surfaceId:(facebook::react::SurfaceId)surfaceId; // TODO(macOS GH#774)
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Stops designating the view as a rendering viewport of a React Native surface.
|
|
43
43
|
*/
|
|
44
|
-
- (void)detachSurfaceFromView:(
|
|
44
|
+
- (void)detachSurfaceFromView:(RCTUIView *)view surfaceId:(facebook::react::SurfaceId)surfaceId; // TODO(macOS GH#774)
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* Schedule a mounting transaction to be performed on the main thread.
|
|
@@ -63,7 +63,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
63
63
|
|
|
64
64
|
- (void)setIsJSResponder:(BOOL)isJSResponder
|
|
65
65
|
blockNativeResponder:(BOOL)blockNativeResponder
|
|
66
|
-
forShadowView:(facebook::react::ShadowView)shadowView;
|
|
66
|
+
forShadowView:(facebook::react::ShadowView const &)shadowView;
|
|
67
67
|
|
|
68
68
|
- (void)synchronouslyUpdateViewOnUIThread:(ReactTag)reactTag
|
|
69
69
|
changedProps:(NSDictionary *)props
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
#import "RCTMountingManager.h"
|
|
9
9
|
|
|
10
|
+
#import <QuartzCore/QuartzCore.h>
|
|
10
11
|
#import <butter/map.h>
|
|
11
12
|
|
|
12
13
|
#import <React/RCTAssert.h>
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
#import <React/RCTFollyConvert.h>
|
|
15
16
|
#import <React/RCTLog.h>
|
|
16
17
|
#import <React/RCTUtils.h>
|
|
18
|
+
#import <react/config/ReactNativeConfig.h>
|
|
17
19
|
#import <react/renderer/components/root/RootShadowNode.h>
|
|
18
20
|
#import <react/renderer/core/LayoutableShadowNode.h>
|
|
19
21
|
#import <react/renderer/core/RawProps.h>
|
|
@@ -27,7 +29,7 @@
|
|
|
27
29
|
|
|
28
30
|
using namespace facebook::react;
|
|
29
31
|
|
|
30
|
-
static SurfaceId RCTSurfaceIdForView(
|
|
32
|
+
static SurfaceId RCTSurfaceIdForView(RCTUIView *view) // TODO(macOS GH#774)
|
|
31
33
|
{
|
|
32
34
|
do {
|
|
33
35
|
if (RCTIsReactRootView(@(view.tag))) {
|
|
@@ -79,7 +81,7 @@ static void RCTPerformMountInstructions(
|
|
|
79
81
|
auto &newChildViewDescriptor = [registry componentViewDescriptorWithTag:newChildShadowView.tag];
|
|
80
82
|
auto &parentViewDescriptor = [registry componentViewDescriptorWithTag:parentShadowView.tag];
|
|
81
83
|
|
|
82
|
-
|
|
84
|
+
RCTUIView<RCTComponentViewProtocol> *newChildComponentView = newChildViewDescriptor.view; // TODO(macOS GH#774)
|
|
83
85
|
|
|
84
86
|
RCTAssert(newChildShadowView.props, @"`newChildShadowView.props` must not be null.");
|
|
85
87
|
|
|
@@ -107,7 +109,7 @@ static void RCTPerformMountInstructions(
|
|
|
107
109
|
auto &oldChildShadowView = mutation.oldChildShadowView;
|
|
108
110
|
auto &newChildShadowView = mutation.newChildShadowView;
|
|
109
111
|
auto &newChildViewDescriptor = [registry componentViewDescriptorWithTag:newChildShadowView.tag];
|
|
110
|
-
|
|
112
|
+
RCTUIView<RCTComponentViewProtocol> *newChildComponentView = newChildViewDescriptor.view; // TODO(macOS GH#774)
|
|
111
113
|
|
|
112
114
|
auto mask = RNComponentViewUpdateMask{};
|
|
113
115
|
|
|
@@ -166,7 +168,7 @@ static void RCTPerformMountInstructions(
|
|
|
166
168
|
_contextContainer = contextContainer;
|
|
167
169
|
}
|
|
168
170
|
|
|
169
|
-
- (void)attachSurfaceToView:(
|
|
171
|
+
- (void)attachSurfaceToView:(RCTUIView *)view surfaceId:(SurfaceId)surfaceId // TODO(macOS GH#774)
|
|
170
172
|
{
|
|
171
173
|
RCTAssertMainQueue();
|
|
172
174
|
|
|
@@ -177,7 +179,7 @@ static void RCTPerformMountInstructions(
|
|
|
177
179
|
[view addSubview:rootViewDescriptor.view];
|
|
178
180
|
}
|
|
179
181
|
|
|
180
|
-
- (void)detachSurfaceFromView:(
|
|
182
|
+
- (void)detachSurfaceFromView:(RCTUIView *)view surfaceId:(SurfaceId)surfaceId // TODO(macOS GH#774)
|
|
181
183
|
{
|
|
182
184
|
RCTAssertMainQueue();
|
|
183
185
|
RCTComponentViewDescriptor rootViewDescriptor = [_componentViewRegistry componentViewDescriptorWithTag:surfaceId];
|
|
@@ -265,26 +267,28 @@ static void RCTPerformMountInstructions(
|
|
|
265
267
|
auto surfaceId = mountingCoordinator->getSurfaceId();
|
|
266
268
|
|
|
267
269
|
mountingCoordinator->getTelemetryController().pullTransaction(
|
|
268
|
-
[&](
|
|
270
|
+
[&](MountingTransaction const &transaction, SurfaceTelemetry const &surfaceTelemetry) {
|
|
269
271
|
[self.delegate mountingManager:self willMountComponentsWithRootTag:surfaceId];
|
|
270
|
-
_observerCoordinator.notifyObserversMountingTransactionWillMount(
|
|
272
|
+
_observerCoordinator.notifyObserversMountingTransactionWillMount(transaction, surfaceTelemetry);
|
|
271
273
|
},
|
|
272
|
-
[&](
|
|
273
|
-
RCTPerformMountInstructions(
|
|
274
|
+
[&](MountingTransaction const &transaction, SurfaceTelemetry const &surfaceTelemetry) {
|
|
275
|
+
RCTPerformMountInstructions(
|
|
276
|
+
transaction.getMutations(), _componentViewRegistry, _observerCoordinator, surfaceId);
|
|
274
277
|
},
|
|
275
|
-
[&](
|
|
276
|
-
_observerCoordinator.notifyObserversMountingTransactionDidMount(
|
|
278
|
+
[&](MountingTransaction const &transaction, SurfaceTelemetry const &surfaceTelemetry) {
|
|
279
|
+
_observerCoordinator.notifyObserversMountingTransactionDidMount(transaction, surfaceTelemetry);
|
|
277
280
|
[self.delegate mountingManager:self didMountComponentsWithRootTag:surfaceId];
|
|
278
281
|
});
|
|
279
282
|
}
|
|
280
283
|
|
|
281
284
|
- (void)setIsJSResponder:(BOOL)isJSResponder
|
|
282
285
|
blockNativeResponder:(BOOL)blockNativeResponder
|
|
283
|
-
forShadowView:(facebook::react::ShadowView)shadowView
|
|
286
|
+
forShadowView:(facebook::react::ShadowView const &)shadowView
|
|
284
287
|
{
|
|
288
|
+
ReactTag reactTag = shadowView.tag;
|
|
285
289
|
RCTExecuteOnMainQueue(^{
|
|
286
|
-
|
|
287
|
-
[self->_componentViewRegistry findComponentViewWithTag:
|
|
290
|
+
RCTUIView<RCTComponentViewProtocol> *componentView =
|
|
291
|
+
[self->_componentViewRegistry findComponentViewWithTag:reactTag]; // TODO(macOS GH#774)
|
|
288
292
|
[componentView setIsJSResponder:isJSResponder];
|
|
289
293
|
});
|
|
290
294
|
}
|
|
@@ -294,10 +298,10 @@ static void RCTPerformMountInstructions(
|
|
|
294
298
|
componentDescriptor:(const ComponentDescriptor &)componentDescriptor
|
|
295
299
|
{
|
|
296
300
|
RCTAssertMainQueue();
|
|
297
|
-
|
|
301
|
+
RCTUIView<RCTComponentViewProtocol> *componentView = [_componentViewRegistry findComponentViewWithTag:reactTag]; // TODO(macOS GH#774)
|
|
298
302
|
SurfaceId surfaceId = RCTSurfaceIdForView(componentView);
|
|
299
|
-
|
|
300
|
-
|
|
303
|
+
Props::Shared oldProps = [componentView props];
|
|
304
|
+
Props::Shared newProps = componentDescriptor.cloneProps(
|
|
301
305
|
PropsParserContext{surfaceId, *_contextContainer.get()}, oldProps, RawProps(convertIdToFollyDynamic(props)));
|
|
302
306
|
|
|
303
307
|
NSSet<NSString *> *propKeys = componentView.propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN ?: [NSSet new];
|
|
@@ -316,6 +320,11 @@ static void RCTPerformMountInstructions(
|
|
|
316
320
|
if (props[@"opacity"] && componentView.layer.opacity != (float)newViewProps.opacity) {
|
|
317
321
|
componentView.layer.opacity = newViewProps.opacity;
|
|
318
322
|
}
|
|
323
|
+
|
|
324
|
+
auto reactNativeConfig = _contextContainer->at<std::shared_ptr<ReactNativeConfig const>>("ReactNativeConfig");
|
|
325
|
+
if (reactNativeConfig && reactNativeConfig->getBool("react_fabric:finalize_updates_on_synchronous_update_view_ios")) {
|
|
326
|
+
[componentView finalizeUpdates:RNComponentViewUpdateMaskProps];
|
|
327
|
+
}
|
|
319
328
|
}
|
|
320
329
|
|
|
321
330
|
- (void)synchronouslyDispatchCommandOnUIThread:(ReactTag)reactTag
|
|
@@ -323,15 +332,17 @@ static void RCTPerformMountInstructions(
|
|
|
323
332
|
args:(NSArray *)args
|
|
324
333
|
{
|
|
325
334
|
RCTAssertMainQueue();
|
|
326
|
-
|
|
335
|
+
RCTUIView<RCTComponentViewProtocol> *componentView = [_componentViewRegistry findComponentViewWithTag:reactTag]; // TODO(macOS GH#774)
|
|
327
336
|
[componentView handleCommand:commandName args:args];
|
|
328
337
|
}
|
|
329
338
|
|
|
330
339
|
- (void)synchronouslyDispatchAccessbilityEventOnUIThread:(ReactTag)reactTag eventType:(NSString *)eventType
|
|
331
340
|
{
|
|
332
341
|
if ([@"focus" isEqualToString:eventType]) {
|
|
333
|
-
|
|
342
|
+
RCTUIView<RCTComponentViewProtocol> *componentView = [_componentViewRegistry findComponentViewWithTag:reactTag]; // TODO(macOS GH#774)
|
|
343
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
334
344
|
UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, componentView);
|
|
345
|
+
#endif // TODO(macOS GH#774)
|
|
335
346
|
}
|
|
336
347
|
}
|
|
337
348
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#import <butter/map.h>
|
|
12
12
|
#import <butter/set.h>
|
|
13
13
|
|
|
14
|
-
#
|
|
14
|
+
#include <react/renderer/mounting/MountingTransaction.h>
|
|
15
15
|
|
|
16
16
|
class RCTMountingTransactionObserverCoordinator final {
|
|
17
17
|
public:
|
|
@@ -31,9 +31,11 @@ class RCTMountingTransactionObserverCoordinator final {
|
|
|
31
31
|
* To be called from `RCTMountingManager`.
|
|
32
32
|
*/
|
|
33
33
|
void notifyObserversMountingTransactionWillMount(
|
|
34
|
-
facebook::react::
|
|
34
|
+
facebook::react::MountingTransaction const &transaction,
|
|
35
|
+
facebook::react::SurfaceTelemetry const &surfaceTelemetry) const;
|
|
35
36
|
void notifyObserversMountingTransactionDidMount(
|
|
36
|
-
facebook::react::
|
|
37
|
+
facebook::react::MountingTransaction const &transaction,
|
|
38
|
+
facebook::react::SurfaceTelemetry const &surfaceTelemetry) const;
|
|
37
39
|
|
|
38
40
|
private:
|
|
39
41
|
facebook::butter::map<
|
|
@@ -40,9 +40,10 @@ void RCTMountingTransactionObserverCoordinator::unregisterViewComponentDescripto
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
void RCTMountingTransactionObserverCoordinator::notifyObserversMountingTransactionWillMount(
|
|
43
|
-
|
|
43
|
+
MountingTransaction const &transaction,
|
|
44
|
+
SurfaceTelemetry const &surfaceTelemetry) const
|
|
44
45
|
{
|
|
45
|
-
auto surfaceId =
|
|
46
|
+
auto surfaceId = transaction.getSurfaceId();
|
|
46
47
|
auto surfaceRegistryIterator = registry_.find(surfaceId);
|
|
47
48
|
if (surfaceRegistryIterator == registry_.end()) {
|
|
48
49
|
return;
|
|
@@ -50,16 +51,17 @@ void RCTMountingTransactionObserverCoordinator::notifyObserversMountingTransacti
|
|
|
50
51
|
auto &surfaceRegistry = surfaceRegistryIterator->second;
|
|
51
52
|
for (auto const &componentViewDescriptor : surfaceRegistry) {
|
|
52
53
|
if (componentViewDescriptor.observesMountingTransactionWillMount) {
|
|
53
|
-
[(id<RCTMountingTransactionObserving>)componentViewDescriptor.view
|
|
54
|
-
|
|
54
|
+
[(id<RCTMountingTransactionObserving>)componentViewDescriptor.view mountingTransactionWillMount:transaction
|
|
55
|
+
withSurfaceTelemetry:surfaceTelemetry];
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
void RCTMountingTransactionObserverCoordinator::notifyObserversMountingTransactionDidMount(
|
|
60
|
-
|
|
61
|
+
MountingTransaction const &transaction,
|
|
62
|
+
SurfaceTelemetry const &surfaceTelemetry) const
|
|
61
63
|
{
|
|
62
|
-
auto surfaceId =
|
|
64
|
+
auto surfaceId = transaction.getSurfaceId();
|
|
63
65
|
auto surfaceRegistryIterator = registry_.find(surfaceId);
|
|
64
66
|
if (surfaceRegistryIterator == registry_.end()) {
|
|
65
67
|
return;
|
|
@@ -67,8 +69,8 @@ void RCTMountingTransactionObserverCoordinator::notifyObserversMountingTransacti
|
|
|
67
69
|
auto &surfaceRegistry = surfaceRegistryIterator->second;
|
|
68
70
|
for (auto const &componentViewDescriptor : surfaceRegistry) {
|
|
69
71
|
if (componentViewDescriptor.observesMountingTransactionDidMount) {
|
|
70
|
-
[(id<RCTMountingTransactionObserving>)componentViewDescriptor.view
|
|
71
|
-
|
|
72
|
+
[(id<RCTMountingTransactionObserving>)componentViewDescriptor.view mountingTransactionDidMount:transaction
|
|
73
|
+
withSurfaceTelemetry:surfaceTelemetry];
|
|
72
74
|
}
|
|
73
75
|
}
|
|
74
76
|
}
|