react-native-macos 0.0.0-8a4ade21e → 0.0.0-8a587199c
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/Alert/Alert.js +115 -6
- package/Libraries/Alert/NativeAlertManager.js +1 -19
- package/Libraries/Blob/React-RCTBlob.podspec +1 -1
- package/Libraries/Components/ScrollView/ScrollView.js +11 -0
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
- package/Libraries/Components/TextInput/TextInput.js +79 -1
- package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
- package/Libraries/Components/View/ViewAccessibility.js +0 -5
- package/Libraries/Components/View/ViewPropTypes.js +102 -112
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Image/RCTImageView.mm +14 -10
- package/Libraries/Image/React-RCTImage.podspec +1 -1
- package/Libraries/LinkingIOS/React-RCTLinking.podspec +1 -1
- package/Libraries/Lists/FlatList.js +1 -2
- package/Libraries/Lists/VirtualizedList.js +26 -9
- 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/Network/React-RCTNetwork.podspec +1 -1
- package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +1 -1
- package/Libraries/Settings/React-RCTSettings.podspec +1 -1
- package/Libraries/Text/BaseText/RCTBaseTextViewManager.m +8 -0
- package/Libraries/Text/RCTTextAttributes.h +11 -3
- package/Libraries/Text/RCTTextAttributes.m +26 -0
- 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 +0 -14
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.h +8 -0
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m +57 -4
- 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 +69 -2
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegate.h +7 -1
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +12 -3
- package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +2 -2
- package/Libraries/Text/TextInput/RCTBaseTextInputView.h +4 -1
- package/Libraries/Text/TextInput/RCTBaseTextInputView.m +91 -2
- package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m +6 -1
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.m +33 -0
- package/Libraries/Text/TextNativeComponent.js +2 -0
- package/Libraries/Text/TextProps.js +29 -0
- package/Libraries/TypeSafety/RCTTypeSafety.podspec +1 -1
- package/Libraries/Vibration/React-RCTVibration.podspec +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 +7 -4
- package/React/Base/RCTEventDispatcherProtocol.h +5 -0
- package/React/Base/RCTTouchHandler.m +4 -0
- package/React/Base/RCTUIKit.h +62 -13
- package/React/Base/RCTUtils.m +6 -3
- package/React/Base/RCTVersion.m +1 -1
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +0 -1
- package/React/Base/macOS/RCTUIKit.m +71 -0
- package/React/CoreModules/RCTAlertManager.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 +5 -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 +1 -1
- package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.mm +1 -1
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.h +2 -2
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.mm +2 -2
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +3 -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 +31 -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 +28 -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 +15 -7
- package/React/Fabric/RCTImageResponseDelegate.h +1 -1
- 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 +1 -1
- package/React/Fabric/Utils/RCTGenericDelegateSplitter.h +1 -1
- package/React/Modules/RCTSurfacePresenterStub.h +4 -0
- package/React/Modules/RCTUIManager.m +2 -1
- package/React/React-RCTFabric.podspec +2 -2
- package/React/Views/RCTActivityIndicatorView.m +2 -1
- 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 +1 -0
- package/React/Views/RCTView.m +51 -17
- package/React/Views/RCTViewManager.m +3 -2
- 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 +6 -0
- package/React/Views/ScrollView/RCTScrollContentViewManager.m +2 -0
- package/React/Views/ScrollView/RCTScrollView.h +2 -0
- package/React/Views/ScrollView/RCTScrollView.m +16 -31
- package/React/Views/ScrollView/RCTScrollViewManager.m +1 -0
- package/React/Views/ScrollView/RCTScrollableProtocol.h +1 -1
- package/React/Views/UIView+React.h +2 -0
- package/React/Views/UIView+React.m +22 -13
- package/ReactAndroid/gradle.properties +1 -1
- 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/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/local-cli/generator-macos/templates/macos/HelloWorld-macOS/ViewController.m +1 -1
- package/package.json +4 -1
- package/scripts/generate-artifacts.js +21 -17
- package/scripts/react_native_pods.rb +1 -4
- package/template/Gemfile.lock +5 -5
- package/template/package.json +1 -1
- package/Libraries/Alert/AlertMacOS.js +0 -211
- 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
|
|
|
@@ -42,12 +43,12 @@ 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
|
}
|
|
49
50
|
|
|
50
|
-
- (void)setContentView:(
|
|
51
|
+
- (void)setContentView:(RCTUIView *)contentView // TODO(macOS GH#774)
|
|
51
52
|
{
|
|
52
53
|
if (_contentView) {
|
|
53
54
|
[_contentView removeFromSuperview];
|
|
@@ -70,12 +71,12 @@ using namespace facebook::react;
|
|
|
70
71
|
return CGRectContainsPoint(hitFrame, point);
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
- (
|
|
74
|
+
- (RCTUIColor *)backgroundColor // TODO(macOS GH#774)
|
|
74
75
|
{
|
|
75
76
|
return _backgroundColor;
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
- (void)setBackgroundColor:(
|
|
79
|
+
- (void)setBackgroundColor:(RCTUIColor *)backgroundColor // TODO(macOS GH#774)
|
|
79
80
|
{
|
|
80
81
|
_backgroundColor = backgroundColor;
|
|
81
82
|
}
|
|
@@ -91,7 +92,7 @@ using namespace facebook::react;
|
|
|
91
92
|
return concreteComponentDescriptorProvider<ViewComponentDescriptor>();
|
|
92
93
|
}
|
|
93
94
|
|
|
94
|
-
- (void)mountChildComponentView:(
|
|
95
|
+
- (void)mountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
|
|
95
96
|
{
|
|
96
97
|
RCTAssert(
|
|
97
98
|
childComponentView.superview == nil,
|
|
@@ -108,7 +109,7 @@ using namespace facebook::react;
|
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
|
|
111
|
-
- (void)unmountChildComponentView:(
|
|
112
|
+
- (void)unmountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
|
|
112
113
|
{
|
|
113
114
|
if (_removeClippedSubviews) {
|
|
114
115
|
[_reactSubviews removeObjectAtIndex:index];
|
|
@@ -132,7 +133,7 @@ using namespace facebook::react;
|
|
|
132
133
|
[childComponentView removeFromSuperview];
|
|
133
134
|
}
|
|
134
135
|
|
|
135
|
-
- (void)updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(
|
|
136
|
+
- (void)updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(RCTUIView *)clipView // TODO(macOS GH#774)
|
|
136
137
|
{
|
|
137
138
|
if (!_removeClippedSubviews) {
|
|
138
139
|
// Use default behavior if unmounting is disabled
|
|
@@ -153,7 +154,7 @@ using namespace facebook::react;
|
|
|
153
154
|
clipRect = [clipView convertRect:clipRect toView:self];
|
|
154
155
|
|
|
155
156
|
// Mount / unmount views
|
|
156
|
-
for (
|
|
157
|
+
for (RCTUIView *view in _reactSubviews) { // TODO(macOS GH#774)
|
|
157
158
|
if (CGRectIntersectsRect(clipRect, view.frame)) {
|
|
158
159
|
// View is at least partially visible, so remount it if unmounted
|
|
159
160
|
[self addSubview:view];
|
|
@@ -202,13 +203,13 @@ using namespace facebook::react;
|
|
|
202
203
|
|
|
203
204
|
// `backgroundColor`
|
|
204
205
|
if (oldViewProps.backgroundColor != newViewProps.backgroundColor) {
|
|
205
|
-
self.backgroundColor = RCTUIColorFromSharedColor(newViewProps.backgroundColor);
|
|
206
|
+
self.backgroundColor = RCTUIColorFromSharedColor(newViewProps.backgroundColor); // TODO(macOS GH#774)
|
|
206
207
|
needsInvalidateLayer = YES;
|
|
207
208
|
}
|
|
208
209
|
|
|
209
210
|
// `foregroundColor`
|
|
210
211
|
if (oldViewProps.foregroundColor != newViewProps.foregroundColor) {
|
|
211
|
-
self.foregroundColor = RCTUIColorFromSharedColor(newViewProps.foregroundColor);
|
|
212
|
+
self.foregroundColor = RCTUIColorFromSharedColor(newViewProps.foregroundColor); // TODO(macOS GH#774)
|
|
212
213
|
}
|
|
213
214
|
|
|
214
215
|
// `shadowColor`
|
|
@@ -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 =
|
|
@@ -437,7 +438,7 @@ using namespace facebook::react;
|
|
|
437
438
|
return _propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN;
|
|
438
439
|
}
|
|
439
440
|
|
|
440
|
-
- (
|
|
441
|
+
- (RCTUIView *)betterHitTest:(CGPoint)point withEvent:(UIEvent *)event // TODO(macOS GH#774)
|
|
441
442
|
{
|
|
442
443
|
// This is a classic textbook implementation of `hitTest:` with a couple of improvements:
|
|
443
444
|
// * It does not stop algorithm if some touch is outside the view
|
|
@@ -459,8 +460,8 @@ using namespace facebook::react;
|
|
|
459
460
|
return nil;
|
|
460
461
|
}
|
|
461
462
|
|
|
462
|
-
for (
|
|
463
|
-
|
|
463
|
+
for (RCTUIView *subview in [self.subviews reverseObjectEnumerator]) { // TODO(macOS GH#774)
|
|
464
|
+
RCTUIView *hitView = [subview hitTest:[subview convertPoint:point fromView:self] withEvent:event]; // TODO(macOS GH#774)
|
|
464
465
|
if (hitView) {
|
|
465
466
|
return hitView;
|
|
466
467
|
}
|
|
@@ -469,7 +470,7 @@ using namespace facebook::react;
|
|
|
469
470
|
return isPointInside ? self : nil;
|
|
470
471
|
}
|
|
471
472
|
|
|
472
|
-
- (
|
|
473
|
+
- (RCTUIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event // TODO(macOS GH#774)
|
|
473
474
|
{
|
|
474
475
|
switch (_props->pointerEvents) {
|
|
475
476
|
case PointerEventsMode::Auto:
|
|
@@ -479,7 +480,7 @@ using namespace facebook::react;
|
|
|
479
480
|
case PointerEventsMode::BoxOnly:
|
|
480
481
|
return [self pointInside:point withEvent:event] ? self : nil;
|
|
481
482
|
case PointerEventsMode::BoxNone:
|
|
482
|
-
|
|
483
|
+
RCTUIView *view = [self betterHitTest:point withEvent:event]; // TODO(macOS GH#774)
|
|
483
484
|
return view != self ? view : nil;
|
|
484
485
|
}
|
|
485
486
|
}
|
|
@@ -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
|
|
|
@@ -654,10 +662,10 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
|
|
|
654
662
|
return self;
|
|
655
663
|
}
|
|
656
664
|
|
|
657
|
-
static NSString *RCTRecursiveAccessibilityLabel(
|
|
665
|
+
static NSString *RCTRecursiveAccessibilityLabel(RCTUIView *view) // TODO(macOS GH#774)
|
|
658
666
|
{
|
|
659
667
|
NSMutableString *result = [NSMutableString stringWithString:@""];
|
|
660
|
-
for (
|
|
668
|
+
for (RCTUIView *subview in view.subviews) { // TODO(macOS GH#774)
|
|
661
669
|
NSString *label = subview.accessibilityLabel;
|
|
662
670
|
if (!label) {
|
|
663
671
|
label = RCTRecursiveAccessibilityLabel(subview);
|
|
@@ -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,14 +332,14 @@ 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)
|
|
334
343
|
UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, componentView);
|
|
335
344
|
}
|
|
336
345
|
}
|
|
@@ -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
|
}
|
|
@@ -5,9 +5,9 @@
|
|
|
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
|
+
#include <react/renderer/mounting/MountingTransaction.h>
|
|
11
11
|
|
|
12
12
|
NS_ASSUME_NONNULL_BEGIN
|
|
13
13
|
|
|
@@ -50,14 +50,16 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
50
50
|
* Is not being called for a component view which is being mounted as part of the transaction (because the view is not
|
|
51
51
|
* registered as an observer yet).
|
|
52
52
|
*/
|
|
53
|
-
- (void)
|
|
53
|
+
- (void)mountingTransactionWillMount:(facebook::react::MountingTransaction const &)transaction
|
|
54
|
+
withSurfaceTelemetry:(facebook::react::SurfaceTelemetry const &)surfaceTelemetry;
|
|
54
55
|
|
|
55
56
|
/*
|
|
56
57
|
* Called right after the last mutation instruction is executed.
|
|
57
58
|
* Is not being called for a component view which was being unmounted as part of the transaction (because the view is
|
|
58
59
|
* not registered as an observer already).
|
|
59
60
|
*/
|
|
60
|
-
- (void)
|
|
61
|
+
- (void)mountingTransactionDidMount:(facebook::react::MountingTransaction const &)transaction
|
|
62
|
+
withSurfaceTelemetry:(facebook::react::SurfaceTelemetry const &)surfaceTelemetry;
|
|
61
63
|
|
|
62
64
|
@end
|
|
63
65
|
|