react-native-macos 0.0.0-ea192044d → 0.0.0-ea769f57f
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 +2 -2
- 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 +29 -67
- 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 +1 -0
- package/Libraries/Components/TextInput/TextInput.js +130 -12
- 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/ViewNativeComponent.js +3 -4
- package/Libraries/Components/View/ViewPropTypes.js +10 -6
- 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 -1
- 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 +1 -0
- package/Libraries/Text/RCTTextAttributes.h +2 -0
- package/Libraries/Text/RCTTextAttributes.m +29 -13
- package/Libraries/Text/Text/RCTDynamicTypeRamp.h +40 -0
- package/Libraries/Text/Text/RCTDynamicTypeRamp.m +77 -0
- package/Libraries/Text/Text/RCTTextView.m +123 -54
- package/Libraries/Text/Text.js +2 -9
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.h +8 -0
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m +58 -3
- 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 -5
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegate.h +13 -1
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +12 -3
- package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +1 -0
- 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 +12 -1
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.m +40 -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 +4 -0
- package/React/Base/RCTUIKit.h +8 -13
- package/React/Base/RCTUtils.m +33 -3
- package/React/Base/RCTVersion.m +1 -1
- package/React/Base/macOS/RCTUIKit.m +40 -0
- package/React/CoreModules/RCTAppearance.mm +21 -5
- package/React/CoreModules/RCTEventDispatcher.mm +6 -1
- package/React/CoreModules/RCTLogBox.h +1 -1
- package/React/CoreModules/RCTLogBox.mm +10 -11
- package/React/CoreModules/RCTLogBoxView.h +4 -6
- package/React/CoreModules/RCTLogBoxView.mm +29 -24
- 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/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h +1 -0
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +69 -19
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +2 -1
- package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm +0 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +1 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +35 -9
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +2 -2
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h +4 -3
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +2 -2
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +13 -5
- package/React/Fabric/Mounting/RCTComponentViewFactory.mm +12 -3
- package/React/Fabric/Mounting/RCTComponentViewProtocol.h +1 -1
- package/React/Fabric/Mounting/RCTMountingManager.h +1 -1
- package/React/Fabric/Mounting/RCTMountingManager.mm +19 -11
- package/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.h +5 -3
- package/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.mm +10 -8
- package/React/Fabric/Mounting/RCTMountingTransactionObserving.h +5 -3
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +1 -1
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +1 -1
- package/React/Fabric/RCTConversions.h +9 -1
- package/React/Fabric/RCTImageResponseObserverProxy.h +1 -0
- package/React/Fabric/RCTLocalizationProvider.mm +10 -4
- package/React/Fabric/RCTScheduler.h +7 -0
- package/React/Fabric/RCTScheduler.mm +15 -0
- package/React/Fabric/RCTSurfacePresenter.h +2 -0
- package/React/Fabric/RCTSurfacePresenter.mm +46 -22
- package/React/Fabric/RCTSurfaceTouchHandler.mm +0 -1
- package/React/Fabric/Surface/RCTFabricSurface.mm +1 -1
- 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/RCTView.h +16 -0
- package/React/Views/RCTView.m +142 -192
- package/React/Views/RCTViewKeyboardEvent.h +6 -28
- package/React/Views/RCTViewKeyboardEvent.m +66 -61
- package/React/Views/RCTViewManager.m +19 -13
- 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/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 -1
- 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 -1
- 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/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.mm +4 -2
- 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/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/RCTAttributedTextUtils.mm +8 -8
- 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/jest/assetFileTransformer.js +2 -2
- package/jest/preprocessor.js +2 -2
- package/jest/setup.js +3 -3
- package/package.json +22 -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 +7 -7
- package/template/android/gradlew.bat +89 -89
- package/template/ios/HelloWorldTests/HelloWorldTests.m +1 -0
- package/template/package.json +1 -1
- 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
|
@@ -11,15 +11,13 @@
|
|
|
11
11
|
|
|
12
12
|
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
13
13
|
|
|
14
|
-
@interface
|
|
14
|
+
@interface RCTLogBoxView : UIWindow
|
|
15
15
|
|
|
16
16
|
- (instancetype)initWithFrame:(CGRect)frame;
|
|
17
17
|
|
|
18
18
|
- (void)createRootViewController:(UIView *)view;
|
|
19
19
|
|
|
20
|
-
- (instancetype)
|
|
21
|
-
|
|
22
|
-
- (void)hide; // TODO(macOS GH#774)
|
|
20
|
+
- (instancetype)initWithWindow:(UIWindow *)window bridge:(RCTBridge *)bridge;
|
|
23
21
|
|
|
24
22
|
- (void)show;
|
|
25
23
|
|
|
@@ -27,11 +25,11 @@
|
|
|
27
25
|
|
|
28
26
|
#else // [TODO(macOS GH#774)
|
|
29
27
|
|
|
30
|
-
@interface
|
|
28
|
+
@interface RCTLogBoxView : NSWindow // TODO(macOS GH#774)
|
|
31
29
|
|
|
32
30
|
- (instancetype)initWithBridge:(RCTBridge *)bridge;
|
|
33
31
|
|
|
34
|
-
- (void)
|
|
32
|
+
- (void)setHidden:(BOOL)hidden;
|
|
35
33
|
|
|
36
34
|
- (void)show;
|
|
37
35
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
14
14
|
|
|
15
|
-
@implementation
|
|
15
|
+
@implementation RCTLogBoxView {
|
|
16
16
|
RCTSurface *_surface;
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -34,35 +34,38 @@
|
|
|
34
34
|
self.rootViewController = _rootViewController;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
- (instancetype)
|
|
37
|
+
- (instancetype)initWithWindow:(UIWindow *)window bridge:(RCTBridge *)bridge
|
|
38
38
|
{
|
|
39
|
-
if ((
|
|
40
|
-
self
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
if (@available(iOS 13.0, *)) {
|
|
40
|
+
self = [super initWithWindowScene:window.windowScene];
|
|
41
|
+
} else {
|
|
42
|
+
self = [super initWithFrame:window.frame];
|
|
43
|
+
}
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
self.windowLevel = UIWindowLevelStatusBar - 1;
|
|
46
|
+
self.backgroundColor = [UIColor clearColor];
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
48
|
+
_surface = [[RCTSurface alloc] initWithBridge:bridge moduleName:@"LogBox" initialProperties:@{}];
|
|
49
|
+
[_surface start];
|
|
51
50
|
|
|
52
|
-
|
|
51
|
+
if (![_surface synchronouslyWaitForStage:RCTSurfaceStageSurfaceDidInitialMounting timeout:1]) {
|
|
52
|
+
RCTLogInfo(@"Failed to mount LogBox within 1s");
|
|
53
53
|
}
|
|
54
|
+
[self createRootViewController:(UIView *)_surface.view];
|
|
55
|
+
|
|
54
56
|
return self;
|
|
55
57
|
}
|
|
56
58
|
|
|
57
|
-
- (void)
|
|
59
|
+
- (void)layoutSubviews
|
|
58
60
|
{
|
|
59
|
-
[
|
|
61
|
+
[super layoutSubviews];
|
|
62
|
+
[_surface setSize:self.frame.size];
|
|
60
63
|
}
|
|
61
64
|
|
|
62
|
-
- (void)
|
|
65
|
+
- (void)dealloc
|
|
63
66
|
{
|
|
64
|
-
[
|
|
65
|
-
}
|
|
67
|
+
[RCTSharedApplication().delegate.window makeKeyWindow];
|
|
68
|
+
}
|
|
66
69
|
|
|
67
70
|
- (void)show
|
|
68
71
|
{
|
|
@@ -74,7 +77,7 @@
|
|
|
74
77
|
|
|
75
78
|
#else // [TODO(macOS GH#774)
|
|
76
79
|
|
|
77
|
-
@implementation
|
|
80
|
+
@implementation RCTLogBoxView {
|
|
78
81
|
RCTSurface *_surface;
|
|
79
82
|
}
|
|
80
83
|
|
|
@@ -100,13 +103,15 @@
|
|
|
100
103
|
return self;
|
|
101
104
|
}
|
|
102
105
|
|
|
103
|
-
- (void)
|
|
106
|
+
- (void)setHidden:(BOOL)hidden // [TODO(macOS GH#774)
|
|
104
107
|
{
|
|
105
|
-
if (
|
|
106
|
-
|
|
108
|
+
if (hidden) {
|
|
109
|
+
if (NSApp.modalWindow == self) {
|
|
110
|
+
[NSApp stopModal];
|
|
111
|
+
}
|
|
112
|
+
[self orderOut:nil];
|
|
107
113
|
}
|
|
108
|
-
|
|
109
|
-
}
|
|
114
|
+
} // ]TODO(macOS GH#774)
|
|
110
115
|
|
|
111
116
|
- (void)show
|
|
112
117
|
{
|
|
@@ -176,7 +176,7 @@ RCT_EXPORT_MODULE()
|
|
|
176
176
|
{
|
|
177
177
|
if (!_devMenuItem) {
|
|
178
178
|
__weak __typeof__(self) weakSelf = self;
|
|
179
|
-
__weak RCTDevSettings *devSettings = [self
|
|
179
|
+
__weak RCTDevSettings *devSettings = [[self bridge] devSettings]; // TODO(macOS GH#774)
|
|
180
180
|
if (devSettings.isPerfMonitorShown) {
|
|
181
181
|
[weakSelf show];
|
|
182
182
|
}
|
|
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
|
|
|
37
37
|
s.header_dir = "CoreModules"
|
|
38
38
|
s.pod_target_xcconfig = {
|
|
39
39
|
"USE_HEADERMAP" => "YES",
|
|
40
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++
|
|
40
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
|
41
41
|
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/React/CoreModules\" \"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
#import "RCTLegacyViewManagerInteropComponentView.h"
|
|
9
9
|
|
|
10
10
|
#import <React/RCTAssert.h>
|
|
11
|
+
#import <React/RCTConstants.h>
|
|
11
12
|
#import <React/UIView+React.h>
|
|
12
13
|
#import <react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.h>
|
|
13
14
|
#import <react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropViewProps.h>
|
|
@@ -24,17 +25,17 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
|
|
|
24
25
|
NSMutableArray<UIView *> *_viewsToBeUnmounted;
|
|
25
26
|
RCTLegacyViewManagerInteropCoordinatorAdapter *_adapter;
|
|
26
27
|
LegacyViewManagerInteropShadowNode::ConcreteState::Shared _state;
|
|
28
|
+
BOOL _hasInvokedForwardingWarning;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
30
32
|
{
|
|
31
33
|
if (self = [super initWithFrame:frame]) {
|
|
32
|
-
RCTWarnNotAllowedForNewArchitecture(
|
|
33
|
-
self, @"ViewManager with interop layer is not allowed in the new architecture.");
|
|
34
34
|
static const auto defaultProps = std::make_shared<const LegacyViewManagerInteropViewProps>();
|
|
35
35
|
_props = defaultProps;
|
|
36
36
|
_viewsToBeMounted = [NSMutableArray new];
|
|
37
37
|
_viewsToBeUnmounted = [NSMutableArray new];
|
|
38
|
+
_hasInvokedForwardingWarning = NO;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
return self;
|
|
@@ -51,6 +52,41 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
|
|
|
51
52
|
return result;
|
|
52
53
|
}
|
|
53
54
|
|
|
55
|
+
- (RCTLegacyViewManagerInteropCoordinator *)_coordinator
|
|
56
|
+
{
|
|
57
|
+
if (_state != nullptr) {
|
|
58
|
+
const auto &state = _state->getData();
|
|
59
|
+
return unwrapManagedObject(state.coordinator);
|
|
60
|
+
} else {
|
|
61
|
+
return nil;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
- (NSString *)componentViewName_DO_NOT_USE_THIS_IS_BROKEN
|
|
66
|
+
{
|
|
67
|
+
const auto &state = _state->getData();
|
|
68
|
+
RCTLegacyViewManagerInteropCoordinator *coordinator = unwrapManagedObject(state.coordinator);
|
|
69
|
+
return coordinator.componentViewName;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
#pragma mark - Method forwarding
|
|
73
|
+
|
|
74
|
+
- (void)forwardInvocation:(NSInvocation *)anInvocation
|
|
75
|
+
{
|
|
76
|
+
if (!_hasInvokedForwardingWarning) {
|
|
77
|
+
_hasInvokedForwardingWarning = YES;
|
|
78
|
+
NSLog(
|
|
79
|
+
@"Invoked unsupported method on RCTLegacyViewManagerInteropComponentView. Resulting to noop instead of a crash.");
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector
|
|
84
|
+
{
|
|
85
|
+
return [super methodSignatureForSelector:aSelector] ?: [self.contentView methodSignatureForSelector:aSelector];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
#pragma mark - Supported ViewManagers
|
|
89
|
+
|
|
54
90
|
+ (NSMutableSet<NSString *> *)supportedViewManagers
|
|
55
91
|
{
|
|
56
92
|
static NSMutableSet<NSString *> *supported = [NSMutableSet setWithObjects:@"DatePicker",
|
|
@@ -65,31 +101,39 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
|
|
|
65
101
|
return supported;
|
|
66
102
|
}
|
|
67
103
|
|
|
68
|
-
+ (
|
|
104
|
+
+ (NSMutableSet<NSString *> *)supportedViewManagersPrefixes
|
|
69
105
|
{
|
|
70
|
-
|
|
106
|
+
static NSMutableSet<NSString *> *supported = [NSMutableSet new];
|
|
107
|
+
return supported;
|
|
71
108
|
}
|
|
72
109
|
|
|
73
|
-
+ (
|
|
110
|
+
+ (BOOL)isSupported:(NSString *)componentName
|
|
74
111
|
{
|
|
75
|
-
|
|
112
|
+
// Step 1: check if ViewManager with specified name is supported.
|
|
113
|
+
BOOL isComponentNameSupported =
|
|
114
|
+
[[RCTLegacyViewManagerInteropComponentView supportedViewManagers] containsObject:componentName];
|
|
115
|
+
if (isComponentNameSupported) {
|
|
116
|
+
return YES;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Step 2: check if component has supported prefix.
|
|
120
|
+
for (NSString *item in [RCTLegacyViewManagerInteropComponentView supportedViewManagersPrefixes]) {
|
|
121
|
+
if ([componentName hasPrefix:item]) {
|
|
122
|
+
return YES;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return NO;
|
|
76
127
|
}
|
|
77
128
|
|
|
78
|
-
|
|
129
|
+
+ (void)supportLegacyViewManagersWithPrefix:(NSString *)prefix
|
|
79
130
|
{
|
|
80
|
-
|
|
81
|
-
const auto &state = _state->getData();
|
|
82
|
-
return unwrapManagedObject(state.coordinator);
|
|
83
|
-
} else {
|
|
84
|
-
return nil;
|
|
85
|
-
}
|
|
131
|
+
[[RCTLegacyViewManagerInteropComponentView supportedViewManagersPrefixes] addObject:prefix];
|
|
86
132
|
}
|
|
87
133
|
|
|
88
|
-
|
|
134
|
+
+ (void)supportLegacyViewManagerWithName:(NSString *)componentName
|
|
89
135
|
{
|
|
90
|
-
|
|
91
|
-
RCTLegacyViewManagerInteropCoordinator *coordinator = unwrapManagedObject(state.coordinator);
|
|
92
|
-
return coordinator.componentViewName;
|
|
136
|
+
[[RCTLegacyViewManagerInteropComponentView supportedViewManagers] addObject:componentName];
|
|
93
137
|
}
|
|
94
138
|
|
|
95
139
|
#pragma mark - RCTComponentViewProtocol
|
|
@@ -101,6 +145,7 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
|
|
|
101
145
|
[_viewsToBeUnmounted removeAllObjects];
|
|
102
146
|
_state.reset();
|
|
103
147
|
self.contentView = nil;
|
|
148
|
+
_hasInvokedForwardingWarning = NO;
|
|
104
149
|
[super prepareForRecycle];
|
|
105
150
|
}
|
|
106
151
|
|
|
@@ -136,7 +181,7 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
|
|
|
136
181
|
[super finalizeUpdates:updateMask];
|
|
137
182
|
|
|
138
183
|
if (!_adapter) {
|
|
139
|
-
_adapter = [[RCTLegacyViewManagerInteropCoordinatorAdapter alloc] initWithCoordinator:self
|
|
184
|
+
_adapter = [[RCTLegacyViewManagerInteropCoordinatorAdapter alloc] initWithCoordinator:[self _coordinator]
|
|
140
185
|
reactTag:self.tag];
|
|
141
186
|
__weak __typeof(self) weakSelf = self;
|
|
142
187
|
_adapter.eventInterceptor = ^(std::string eventName, folly::dynamic event) {
|
|
@@ -153,7 +198,12 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
|
|
|
153
198
|
for (NSDictionary *mountInstruction in _viewsToBeMounted) {
|
|
154
199
|
NSNumber *index = mountInstruction[kRCTLegacyInteropChildIndexKey];
|
|
155
200
|
UIView *childView = mountInstruction[kRCTLegacyInteropChildComponentKey];
|
|
156
|
-
[
|
|
201
|
+
if ([childView isKindOfClass:[RCTLegacyViewManagerInteropComponentView class]]) {
|
|
202
|
+
UIView *target = ((RCTLegacyViewManagerInteropComponentView *)childView).contentView;
|
|
203
|
+
[_adapter.paperView insertReactSubview:target atIndex:index.integerValue];
|
|
204
|
+
} else {
|
|
205
|
+
[_adapter.paperView insertReactSubview:childView atIndex:index.integerValue];
|
|
206
|
+
}
|
|
157
207
|
}
|
|
158
208
|
|
|
159
209
|
[_viewsToBeMounted removeAllObjects];
|
|
@@ -192,7 +192,8 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
|
|
|
192
192
|
|
|
193
193
|
#pragma mark - RCTMountingTransactionObserving
|
|
194
194
|
|
|
195
|
-
- (void)
|
|
195
|
+
- (void)mountingTransactionWillMount:(MountingTransaction const &)transaction
|
|
196
|
+
withSurfaceTelemetry:(facebook::react::SurfaceTelemetry const &)surfaceTelemetry
|
|
196
197
|
{
|
|
197
198
|
_modalContentsSnapshot = [self.viewController.view snapshotViewAfterScreenUpdates:NO];
|
|
198
199
|
}
|
package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm
CHANGED
|
@@ -25,7 +25,7 @@ using namespace facebook::react;
|
|
|
25
25
|
|
|
26
26
|
@implementation RCTPullToRefreshViewComponentView {
|
|
27
27
|
UIRefreshControl *_refreshControl;
|
|
28
|
-
RCTScrollViewComponentView *_scrollViewComponentView;
|
|
28
|
+
RCTScrollViewComponentView *__weak _scrollViewComponentView;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
@@ -52,7 +52,11 @@ static UIScrollViewIndicatorStyle RCTUIScrollViewIndicatorStyleFromProps(ScrollV
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
// Once Fabric implements proper NativeAnimationDriver, this should be removed.
|
|
56
|
+
// This is just a workaround to allow animations based on onScroll event.
|
|
57
|
+
// This is only used to animate sticky headers in ScrollViews, and only the contentOffset and tag is used.
|
|
58
|
+
// TODO: T116850910 [Fabric][iOS] Make Fabric not use legacy RCTEventDispatcher for native-driven AnimatedEvents
|
|
59
|
+
static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInteger tag)
|
|
56
60
|
{
|
|
57
61
|
static uint16_t coalescingKey = 0;
|
|
58
62
|
RCTScrollEvent *scrollEvent = [[RCTScrollEvent alloc] initWithEventName:@"onScroll"
|
|
@@ -64,7 +68,15 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
|
|
|
64
68
|
scrollViewZoomScale:scrollView.zoomScale
|
|
65
69
|
userData:nil
|
|
66
70
|
coalescingKey:coalescingKey];
|
|
67
|
-
[
|
|
71
|
+
RCTBridge *bridge = [RCTBridge currentBridge];
|
|
72
|
+
if (bridge) {
|
|
73
|
+
[bridge.eventDispatcher sendEvent:scrollEvent];
|
|
74
|
+
} else {
|
|
75
|
+
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:scrollEvent, @"event", nil];
|
|
76
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:@"RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED"
|
|
77
|
+
object:nil
|
|
78
|
+
userInfo:userInfo];
|
|
79
|
+
}
|
|
68
80
|
}
|
|
69
81
|
|
|
70
82
|
@interface RCTScrollViewComponentView () <
|
|
@@ -85,6 +97,7 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
|
|
|
85
97
|
// This helps to only update state from `scrollViewDidScroll` in case
|
|
86
98
|
// some other part of the system scrolls scroll view.
|
|
87
99
|
BOOL _isUserTriggeredScrolling;
|
|
100
|
+
BOOL _shouldUpdateContentInsetAdjustmentBehavior;
|
|
88
101
|
|
|
89
102
|
CGPoint _contentOffsetWhenClipped;
|
|
90
103
|
}
|
|
@@ -108,6 +121,7 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
|
|
|
108
121
|
_scrollView.delaysContentTouches = NO;
|
|
109
122
|
((RCTEnhancedScrollView *)_scrollView).overridingDelegate = self;
|
|
110
123
|
_isUserTriggeredScrolling = NO;
|
|
124
|
+
_shouldUpdateContentInsetAdjustmentBehavior = YES;
|
|
111
125
|
[self addSubview:_scrollView];
|
|
112
126
|
|
|
113
127
|
_containerView = [[UIView alloc] initWithFrame:CGRectZero];
|
|
@@ -135,7 +149,8 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
|
|
|
135
149
|
|
|
136
150
|
#pragma mark - RCTMountingTransactionObserving
|
|
137
151
|
|
|
138
|
-
- (void)
|
|
152
|
+
- (void)mountingTransactionDidMount:(MountingTransaction const &)transaction
|
|
153
|
+
withSurfaceTelemetry:(facebook::react::SurfaceTelemetry const &)surfaceTelemetry
|
|
139
154
|
{
|
|
140
155
|
[self _remountChildren];
|
|
141
156
|
}
|
|
@@ -253,7 +268,8 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
|
|
|
253
268
|
}
|
|
254
269
|
}
|
|
255
270
|
|
|
256
|
-
if (oldScrollViewProps.contentInsetAdjustmentBehavior != newScrollViewProps.contentInsetAdjustmentBehavior)
|
|
271
|
+
if ((oldScrollViewProps.contentInsetAdjustmentBehavior != newScrollViewProps.contentInsetAdjustmentBehavior) ||
|
|
272
|
+
_shouldUpdateContentInsetAdjustmentBehavior) {
|
|
257
273
|
auto const contentInsetAdjustmentBehavior = newScrollViewProps.contentInsetAdjustmentBehavior;
|
|
258
274
|
if (contentInsetAdjustmentBehavior == ContentInsetAdjustmentBehavior::Never) {
|
|
259
275
|
scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
|
@@ -264,6 +280,7 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
|
|
|
264
280
|
} else if (contentInsetAdjustmentBehavior == ContentInsetAdjustmentBehavior::Always) {
|
|
265
281
|
scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentAlways;
|
|
266
282
|
}
|
|
283
|
+
_shouldUpdateContentInsetAdjustmentBehavior = NO;
|
|
267
284
|
}
|
|
268
285
|
|
|
269
286
|
MAP_SCROLL_VIEW_PROP(disableIntervalMomentum);
|
|
@@ -377,8 +394,16 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
|
|
|
377
394
|
{
|
|
378
395
|
const auto &props = *std::static_pointer_cast<const ScrollViewProps>(_props);
|
|
379
396
|
_scrollView.contentOffset = RCTCGPointFromPoint(props.contentOffset);
|
|
397
|
+
// We set the default behavior to "never" so that iOS
|
|
398
|
+
// doesn't do weird things to UIScrollView insets automatically
|
|
399
|
+
// and keeps it as an opt-in behavior.
|
|
400
|
+
_scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
|
401
|
+
_shouldUpdateContentInsetAdjustmentBehavior = YES;
|
|
380
402
|
_state.reset();
|
|
381
403
|
_isUserTriggeredScrolling = NO;
|
|
404
|
+
CGRect oldFrame = self.frame;
|
|
405
|
+
self.frame = CGRectZero;
|
|
406
|
+
self.frame = oldFrame;
|
|
382
407
|
[super prepareForRecycle];
|
|
383
408
|
}
|
|
384
409
|
|
|
@@ -403,9 +428,8 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
|
|
|
403
428
|
if (_eventEmitter) {
|
|
404
429
|
std::static_pointer_cast<ScrollViewEventEmitter const>(_eventEmitter)->onScroll([self _scrollViewMetrics]);
|
|
405
430
|
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
RCTSendPaperScrollEvent_DEPRECATED(scrollView, self.tag);
|
|
431
|
+
|
|
432
|
+
RCTSendScrollEventForNativeAnimations_DEPRECATED(scrollView, self.tag);
|
|
409
433
|
}
|
|
410
434
|
|
|
411
435
|
[self _remountChildrenIfNeeded];
|
|
@@ -566,7 +590,6 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
|
|
|
566
590
|
offset = CGPointMake(localX, localY);
|
|
567
591
|
}
|
|
568
592
|
|
|
569
|
-
[self _forceDispatchNextScrollEvent];
|
|
570
593
|
[self scrollToOffset:offset animated:animated];
|
|
571
594
|
}
|
|
572
595
|
|
|
@@ -621,12 +644,15 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
|
|
|
621
644
|
|
|
622
645
|
- (void)scrollToOffset:(CGPoint)offset
|
|
623
646
|
{
|
|
624
|
-
[self _forceDispatchNextScrollEvent];
|
|
625
647
|
[self scrollToOffset:offset animated:YES];
|
|
626
648
|
}
|
|
627
649
|
|
|
628
650
|
- (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated
|
|
629
651
|
{
|
|
652
|
+
if (CGPointEqualToPoint(_scrollView.contentOffset, offset)) {
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
|
|
630
656
|
[self _forceDispatchNextScrollEvent];
|
|
631
657
|
|
|
632
658
|
if (_layoutMetrics.layoutDirection == LayoutDirection::RightToLeft) {
|
|
@@ -566,8 +566,8 @@ using namespace facebook::react;
|
|
|
566
566
|
|
|
567
567
|
- (void)_restoreTextSelection
|
|
568
568
|
{
|
|
569
|
-
const
|
|
570
|
-
if (selection
|
|
569
|
+
auto const selection = std::dynamic_pointer_cast<TextInputProps const>(_props)->selection;
|
|
570
|
+
if (!selection.has_value()) {
|
|
571
571
|
return;
|
|
572
572
|
}
|
|
573
573
|
auto start = [_backedTextInputView positionFromPosition:_backedTextInputView.beginningOfDocument
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
#import <UIKit/UIKit.h>
|
|
9
9
|
|
|
10
|
+
#import <optional>
|
|
11
|
+
|
|
10
12
|
#import <React/RCTBackedTextInputViewProtocol.h>
|
|
11
|
-
#import <butter/optional.h>
|
|
12
13
|
#import <react/renderer/components/iostextinput/primitives.h>
|
|
13
14
|
|
|
14
15
|
NS_ASSUME_NONNULL_BEGIN
|
|
@@ -17,7 +18,7 @@ void RCTCopyBackedTextInput(
|
|
|
17
18
|
UIView<RCTBackedTextInputViewProtocol> *fromTextInput,
|
|
18
19
|
UIView<RCTBackedTextInputViewProtocol> *toTextInput);
|
|
19
20
|
|
|
20
|
-
UITextAutocorrectionType RCTUITextAutocorrectionTypeFromOptionalBool(
|
|
21
|
+
UITextAutocorrectionType RCTUITextAutocorrectionTypeFromOptionalBool(std::optional<bool> autoCorrect);
|
|
21
22
|
|
|
22
23
|
UITextAutocapitalizationType RCTUITextAutocapitalizationTypeFromAutocapitalizationType(
|
|
23
24
|
facebook::react::AutocapitalizationType autocapitalizationType);
|
|
@@ -25,7 +26,7 @@ UITextAutocapitalizationType RCTUITextAutocapitalizationTypeFromAutocapitalizati
|
|
|
25
26
|
UIKeyboardAppearance RCTUIKeyboardAppearanceFromKeyboardAppearance(
|
|
26
27
|
facebook::react::KeyboardAppearance keyboardAppearance);
|
|
27
28
|
|
|
28
|
-
UITextSpellCheckingType RCTUITextSpellCheckingTypeFromOptionalBool(
|
|
29
|
+
UITextSpellCheckingType RCTUITextSpellCheckingTypeFromOptionalBool(std::optional<bool> spellCheck);
|
|
29
30
|
|
|
30
31
|
UITextFieldViewMode RCTUITextFieldViewModeFromTextInputAccessoryVisibilityMode(
|
|
31
32
|
facebook::react::TextInputAccessoryVisibilityMode mode);
|
|
@@ -51,7 +51,7 @@ void RCTCopyBackedTextInput(
|
|
|
51
51
|
[toTextInput setSelectedTextRange:fromTextInput.selectedTextRange notifyDelegate:NO];
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
UITextAutocorrectionType RCTUITextAutocorrectionTypeFromOptionalBool(
|
|
54
|
+
UITextAutocorrectionType RCTUITextAutocorrectionTypeFromOptionalBool(std::optional<bool> autoCorrect)
|
|
55
55
|
{
|
|
56
56
|
return autoCorrect.has_value() ? (*autoCorrect ? UITextAutocorrectionTypeYes : UITextAutocorrectionTypeNo)
|
|
57
57
|
: UITextAutocorrectionTypeDefault;
|
|
@@ -84,7 +84,7 @@ UIKeyboardAppearance RCTUIKeyboardAppearanceFromKeyboardAppearance(KeyboardAppea
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
UITextSpellCheckingType RCTUITextSpellCheckingTypeFromOptionalBool(
|
|
87
|
+
UITextSpellCheckingType RCTUITextSpellCheckingTypeFromOptionalBool(std::optional<bool> spellCheck)
|
|
88
88
|
{
|
|
89
89
|
return spellCheck.has_value() ? (*spellCheck ? UITextSpellCheckingTypeYes : UITextSpellCheckingTypeNo)
|
|
90
90
|
: UITextSpellCheckingTypeDefault;
|
|
@@ -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>
|
|
@@ -42,7 +43,7 @@ using namespace facebook::react;
|
|
|
42
43
|
return self;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
- (facebook::react::
|
|
46
|
+
- (facebook::react::Props::Shared)props
|
|
46
47
|
{
|
|
47
48
|
return _props;
|
|
48
49
|
}
|
|
@@ -335,12 +336,12 @@ using namespace facebook::react;
|
|
|
335
336
|
|
|
336
337
|
// `accessibilityValue`
|
|
337
338
|
if (oldViewProps.accessibilityValue != newViewProps.accessibilityValue) {
|
|
338
|
-
if (newViewProps.accessibilityValue.text.
|
|
339
|
+
if (newViewProps.accessibilityValue.text.has_value()) {
|
|
339
340
|
self.accessibilityElement.accessibilityValue =
|
|
340
341
|
RCTNSStringFromStringNilIfEmpty(newViewProps.accessibilityValue.text.value());
|
|
341
342
|
} else if (
|
|
342
|
-
newViewProps.accessibilityValue.now.
|
|
343
|
-
newViewProps.accessibilityValue.max.
|
|
343
|
+
newViewProps.accessibilityValue.now.has_value() && newViewProps.accessibilityValue.min.has_value() &&
|
|
344
|
+
newViewProps.accessibilityValue.max.has_value()) {
|
|
344
345
|
CGFloat val = (CGFloat)(newViewProps.accessibilityValue.now.value()) /
|
|
345
346
|
(newViewProps.accessibilityValue.max.value() - newViewProps.accessibilityValue.min.value());
|
|
346
347
|
self.accessibilityElement.accessibilityValue =
|
|
@@ -591,6 +592,12 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
|
|
|
591
592
|
|
|
592
593
|
RCTBorderColors borderColors = RCTCreateRCTBorderColorsFromBorderColors(borderMetrics.borderColors);
|
|
593
594
|
|
|
595
|
+
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
596
|
+
CGFloat scaleFactor = self.window.backingScaleFactor;
|
|
597
|
+
#else
|
|
598
|
+
// On iOS setting the scaleFactor to 0.0 will default to the device's native scale factor.
|
|
599
|
+
CGFloat scaleFactor = 0.0;
|
|
600
|
+
#endif // ]TODO(macOS GH#774)
|
|
594
601
|
UIImage *image = RCTGetBorderImage(
|
|
595
602
|
RCTBorderStyleFromBorderStyle(borderMetrics.borderStyles.left),
|
|
596
603
|
layer.bounds.size,
|
|
@@ -598,7 +605,8 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
|
|
|
598
605
|
RCTUIEdgeInsetsFromEdgeInsets(borderMetrics.borderWidths),
|
|
599
606
|
borderColors,
|
|
600
607
|
_backgroundColor.CGColor,
|
|
601
|
-
self.clipsToBounds
|
|
608
|
+
self.clipsToBounds,
|
|
609
|
+
scaleFactor); // TODO(macOS GH#774)
|
|
602
610
|
|
|
603
611
|
RCTReleaseRCTBorderColors(borderColors);
|
|
604
612
|
|
|
@@ -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);
|
|
@@ -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;
|
|
@@ -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
|