react-native-macos 0.0.0-7e8402d33 → 0.0.0-7fbfa751a
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/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/ViewPropTypes.js +10 -0
- 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 -1
- 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/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 +19 -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 +33 -0
- 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/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 +0 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +3 -3
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +4 -4
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +1 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +4 -4
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +56 -30
- 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/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 +5 -5
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h +7 -6
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +4 -4
- package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.h +2 -1
- package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.mm +2 -2
- package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm +2 -2
- 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/RCTView.h +7 -0
- package/React/Views/RCTView.m +92 -28
- package/React/Views/RCTViewManager.m +11 -1
- 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/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/package.json +4 -1
- package/scripts/react_native_pods.rb +1 -4
- package/template/Gemfile.lock +5 -5
- package/template/package.json +1 -1
- 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
|
@@ -156,7 +156,8 @@ RCT_EXPORT_MODULE()
|
|
|
156
156
|
|
|
157
157
|
- (void)setBridge:(RCTBridge *)bridge
|
|
158
158
|
{
|
|
159
|
-
|
|
159
|
+
RCTEnforceNewArchitectureValidation(
|
|
160
|
+
RCTNotAllowedInBridgeless, self, @"RCTUIManager must not be initialized for the new architecture");
|
|
160
161
|
|
|
161
162
|
RCTAssert(_bridge == nil, @"Should not re-use same UIManager instance");
|
|
162
163
|
_bridge = bridge;
|
|
@@ -28,7 +28,7 @@ Pod::Spec.new do |s|
|
|
|
28
28
|
s.homepage = "https://reactnative.dev/"
|
|
29
29
|
s.license = package["license"]
|
|
30
30
|
s.author = "Facebook, Inc. and its affiliates"
|
|
31
|
-
s.platforms = { :ios => "11.0" }
|
|
31
|
+
s.platforms = { :ios => "11.0", :osx => "10.15" } # TODO(macOS GH#774)
|
|
32
32
|
s.source = source
|
|
33
33
|
s.source_files = "Fabric/**/*.{c,h,m,mm,S,cpp}"
|
|
34
34
|
s.exclude_files = "**/tests/*",
|
|
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
|
|
|
37
37
|
s.header_dir = "React"
|
|
38
38
|
s.framework = "JavaScriptCore"
|
|
39
39
|
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/Headers/Private/React-Core\" \"$(PODS_ROOT)/Headers/Public/React-Codegen\"" }
|
|
40
|
-
s.xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/RCT-Folly\"",
|
|
40
|
+
s.xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/RCT-Folly\"", "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
|
41
41
|
"OTHER_CFLAGS" => "$(inherited) -DRN_FABRIC_ENABLED" + " " + folly_flags }
|
|
42
42
|
|
|
43
43
|
s.dependency "React-Core", version
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
#import "RCTActivityIndicatorView.h"
|
|
9
9
|
|
|
10
10
|
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
11
|
-
#import <
|
|
11
|
+
#import <CoreImage/CIFilter.h>
|
|
12
|
+
#import <CoreImage/CIVector.h>
|
|
12
13
|
|
|
13
14
|
@interface RCTActivityIndicatorView ()
|
|
14
15
|
@property (nonatomic, readwrite, getter=isAnimating) BOOL animating;
|
|
@@ -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/RCTInvalidating.h>
|
|
11
11
|
#import <React/RCTModalHostViewManager.h>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
@protocol RCTModalHostViewInteractor;
|
|
18
18
|
|
|
19
|
-
@interface RCTModalHostView :
|
|
19
|
+
@interface RCTModalHostView : RCTUIView <RCTInvalidating, UIAdaptivePresentationControllerDelegate> // TODO(macOS GH#774)
|
|
20
20
|
|
|
21
21
|
@property (nonatomic, copy) NSString *animationType;
|
|
22
22
|
@property (nonatomic, assign) UIModalPresentationStyle presentationStyle;
|
package/React/Views/RCTView.h
CHANGED
|
@@ -31,6 +31,7 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait;
|
|
|
31
31
|
- (BOOL)resignFirstResponder;
|
|
32
32
|
|
|
33
33
|
#if TARGET_OS_OSX
|
|
34
|
+
- (NSDictionary*)dataTransferInfoFromPasteboard:(NSPasteboard*)pasteboard;
|
|
34
35
|
- (BOOL)handleKeyboardEvent:(NSEvent *)event;
|
|
35
36
|
#endif
|
|
36
37
|
// ]TODO(OSS Candidate ISS#2710739)
|
|
@@ -144,6 +145,12 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait;
|
|
|
144
145
|
@property (nonatomic, copy) RCTDirectEventBlock onKeyUp;
|
|
145
146
|
@property (nonatomic, copy) NSArray<NSString*> *validKeysDown;
|
|
146
147
|
@property (nonatomic, copy) NSArray<NSString*> *validKeysUp;
|
|
148
|
+
|
|
149
|
+
// Shadow Properties
|
|
150
|
+
@property (nonatomic, strong) NSColor *shadowColor;
|
|
151
|
+
@property (nonatomic, assign) CGFloat shadowOpacity;
|
|
152
|
+
@property (nonatomic, assign) CGFloat shadowRadius;
|
|
153
|
+
@property (nonatomic, assign) CGSize shadowOffset;
|
|
147
154
|
#endif // ]TODO(macOS GH#774)
|
|
148
155
|
|
|
149
156
|
/**
|
package/React/Views/RCTView.m
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
#import "RCTView.h"
|
|
9
9
|
|
|
10
|
-
#import <QuartzCore/QuartzCore.h>
|
|
10
|
+
#import <QuartzCore/QuartzCore.h>
|
|
11
11
|
|
|
12
12
|
#import "RCTAutoInsetsProtocol.h"
|
|
13
13
|
#import "RCTBorderDrawing.h"
|
|
@@ -165,6 +165,7 @@ static NSString *RCTRecursiveAccessibilityLabel(RCTUIView *view) // TODO(macOS I
|
|
|
165
165
|
_hitTestEdgeInsets = UIEdgeInsetsZero;
|
|
166
166
|
#if TARGET_OS_OSX // TODO(macOS GH#774)
|
|
167
167
|
_transform3D = CATransform3DIdentity;
|
|
168
|
+
_shadowColor = nil;
|
|
168
169
|
#endif // TODO(macOS GH#774)
|
|
169
170
|
|
|
170
171
|
_backgroundColor = super.backgroundColor;
|
|
@@ -716,20 +717,49 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
|
|
|
716
717
|
#endif // TODO(macOS GH#774)
|
|
717
718
|
|
|
718
719
|
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
719
|
-
|
|
720
|
-
- (NSShadow*)shadow
|
|
720
|
+
- (void)setShadowColor:(NSColor *)shadowColor
|
|
721
721
|
{
|
|
722
|
-
|
|
723
|
-
|
|
722
|
+
if (_shadowColor != shadowColor)
|
|
723
|
+
{
|
|
724
|
+
_shadowColor = shadowColor;
|
|
725
|
+
[self didUpdateShadow];
|
|
726
|
+
}
|
|
727
|
+
}
|
|
724
728
|
|
|
725
|
-
|
|
726
|
-
|
|
729
|
+
- (void)setShadowOffset:(CGSize)shadowOffset
|
|
730
|
+
{
|
|
731
|
+
if (!CGSizeEqualToSize(_shadowOffset, shadowOffset))
|
|
732
|
+
{
|
|
733
|
+
_shadowOffset = shadowOffset;
|
|
734
|
+
[self didUpdateShadow];
|
|
735
|
+
}
|
|
736
|
+
}
|
|
727
737
|
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
738
|
+
- (void)setShadowOpacity:(CGFloat)shadowOpacity
|
|
739
|
+
{
|
|
740
|
+
if (_shadowOpacity != shadowOpacity)
|
|
741
|
+
{
|
|
742
|
+
_shadowOpacity = shadowOpacity;
|
|
743
|
+
[self didUpdateShadow];
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
- (void)setShadowRadius:(CGFloat)shadowRadius
|
|
748
|
+
{
|
|
749
|
+
if (_shadowRadius != shadowRadius)
|
|
750
|
+
{
|
|
751
|
+
_shadowRadius = shadowRadius;
|
|
752
|
+
[self didUpdateShadow];
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
-(void)didUpdateShadow
|
|
757
|
+
{
|
|
758
|
+
NSShadow *shadow = [NSShadow new];
|
|
759
|
+
shadow.shadowColor = [[self shadowColor] colorWithAlphaComponent:[self shadowOpacity]];
|
|
760
|
+
shadow.shadowOffset = [self shadowOffset];
|
|
761
|
+
shadow.shadowBlurRadius = [self shadowRadius];
|
|
762
|
+
[self setShadow:shadow];
|
|
733
763
|
}
|
|
734
764
|
|
|
735
765
|
- (void)viewDidMoveToWindow
|
|
@@ -749,6 +779,9 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
|
|
|
749
779
|
name:NSViewBoundsDidChangeNotification
|
|
750
780
|
object:[[self enclosingScrollView] contentView]];
|
|
751
781
|
}
|
|
782
|
+
|
|
783
|
+
[self reactViewDidMoveToWindow]; // TODO(macOS GH#1412)
|
|
784
|
+
|
|
752
785
|
[super viewDidMoveToWindow];
|
|
753
786
|
}
|
|
754
787
|
|
|
@@ -1407,9 +1440,14 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
|
|
|
1407
1440
|
}
|
|
1408
1441
|
}
|
|
1409
1442
|
|
|
1443
|
+
- (BOOL)needsPanelToBecomeKey {
|
|
1444
|
+
// We need to override this so that mouse clicks don't move keyboard focus on focusable views by default.
|
|
1445
|
+
return false;
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1410
1448
|
- (BOOL)acceptsFirstResponder
|
|
1411
1449
|
{
|
|
1412
|
-
|
|
1450
|
+
return [self focusable] || [super acceptsFirstResponder];
|
|
1413
1451
|
}
|
|
1414
1452
|
|
|
1415
1453
|
- (void)updateTrackingAreas
|
|
@@ -1494,13 +1532,9 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
|
|
|
1494
1532
|
block(body);
|
|
1495
1533
|
}
|
|
1496
1534
|
|
|
1497
|
-
- (NSDictionary*)
|
|
1535
|
+
- (NSDictionary*)dataTransferInfoFromPasteboard:(NSPasteboard*)pasteboard
|
|
1498
1536
|
{
|
|
1499
|
-
|
|
1500
|
-
return @{};
|
|
1501
|
-
}
|
|
1502
|
-
|
|
1503
|
-
NSArray *fileNames = [pastboard propertyListForType:NSFilenamesPboardType];
|
|
1537
|
+
NSArray *fileNames = [pasteboard propertyListForType:NSFilenamesPboardType] ?: @[];
|
|
1504
1538
|
NSMutableArray *files = [[NSMutableArray alloc] initWithCapacity:fileNames.count];
|
|
1505
1539
|
NSMutableArray *items = [[NSMutableArray alloc] initWithCapacity:fileNames.count];
|
|
1506
1540
|
NSMutableArray *types = [[NSMutableArray alloc] initWithCapacity:fileNames.count];
|
|
@@ -1526,11 +1560,21 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
|
|
|
1526
1560
|
BOOL success = [fileURL getResourceValue:&fileSizeValue
|
|
1527
1561
|
forKey:NSURLFileSizeKey
|
|
1528
1562
|
error:&fileSizeError];
|
|
1529
|
-
|
|
1563
|
+
|
|
1564
|
+
NSNumber *width = nil;
|
|
1565
|
+
NSNumber *height = nil;
|
|
1566
|
+
if ([MIMETypeString hasPrefix:@"image/"]) {
|
|
1567
|
+
NSImage *image = [[NSImage alloc] initWithContentsOfURL:fileURL];
|
|
1568
|
+
width = @(image.size.width);
|
|
1569
|
+
height = @(image.size.height);
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1530
1572
|
[files addObject:@{@"name": RCTNullIfNil(fileURL.lastPathComponent),
|
|
1531
1573
|
@"type": RCTNullIfNil(MIMETypeString),
|
|
1532
|
-
@"uri": RCTNullIfNil(fileURL.
|
|
1533
|
-
@"size": success ? fileSizeValue : (id)kCFNull
|
|
1574
|
+
@"uri": RCTNullIfNil(fileURL.path),
|
|
1575
|
+
@"size": success ? fileSizeValue : (id)kCFNull,
|
|
1576
|
+
@"width": RCTNullIfNil(width),
|
|
1577
|
+
@"height": RCTNullIfNil(height)
|
|
1534
1578
|
}];
|
|
1535
1579
|
|
|
1536
1580
|
[items addObject:@{@"kind": @"file",
|
|
@@ -1540,7 +1584,27 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
|
|
|
1540
1584
|
[types addObject:RCTNullIfNil(MIMETypeString)];
|
|
1541
1585
|
}
|
|
1542
1586
|
}
|
|
1543
|
-
|
|
1587
|
+
|
|
1588
|
+
NSPasteboardType imageType = [pasteboard availableTypeFromArray:@[NSPasteboardTypePNG, NSPasteboardTypeTIFF]];
|
|
1589
|
+
if (imageType && fileNames.count == 0) {
|
|
1590
|
+
NSString *MIMETypeString = imageType == NSPasteboardTypePNG ? @"image/png" : @"image/tiff";
|
|
1591
|
+
NSData *imageData = [pasteboard dataForType:imageType];
|
|
1592
|
+
NSImage *image = [[NSImage alloc] initWithData:imageData];
|
|
1593
|
+
|
|
1594
|
+
[files addObject:@{@"type": RCTNullIfNil(MIMETypeString),
|
|
1595
|
+
@"uri": RCTDataURL(MIMETypeString, imageData).absoluteString,
|
|
1596
|
+
@"size": @(imageData.length),
|
|
1597
|
+
@"width": @(image.size.width),
|
|
1598
|
+
@"height": @(image.size.height),
|
|
1599
|
+
}];
|
|
1600
|
+
|
|
1601
|
+
[items addObject:@{@"kind": @"image",
|
|
1602
|
+
@"type": RCTNullIfNil(MIMETypeString),
|
|
1603
|
+
}];
|
|
1604
|
+
|
|
1605
|
+
[types addObject:RCTNullIfNil(MIMETypeString)];
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1544
1608
|
return @{@"dataTransfer": @{@"files": files,
|
|
1545
1609
|
@"items": items,
|
|
1546
1610
|
@"types": types}};
|
|
@@ -1565,9 +1629,9 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
|
|
|
1565
1629
|
[self sendMouseEventWithBlock:self.onDragEnter
|
|
1566
1630
|
locationInfo:[self locationInfoFromDraggingLocation:sender.draggingLocation]
|
|
1567
1631
|
modifierFlags:0
|
|
1568
|
-
additionalData:[self
|
|
1569
|
-
|
|
1570
|
-
if ([pboard
|
|
1632
|
+
additionalData:[self dataTransferInfoFromPasteboard:pboard]];
|
|
1633
|
+
|
|
1634
|
+
if ([pboard availableTypeFromArray:self.registeredDraggedTypes]) {
|
|
1571
1635
|
if (sourceDragMask & NSDragOperationLink) {
|
|
1572
1636
|
return NSDragOperationLink;
|
|
1573
1637
|
} else if (sourceDragMask & NSDragOperationCopy) {
|
|
@@ -1582,7 +1646,7 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
|
|
|
1582
1646
|
[self sendMouseEventWithBlock:self.onDragLeave
|
|
1583
1647
|
locationInfo:[self locationInfoFromDraggingLocation:sender.draggingLocation]
|
|
1584
1648
|
modifierFlags:0
|
|
1585
|
-
additionalData:[self
|
|
1649
|
+
additionalData:[self dataTransferInfoFromPasteboard:sender.draggingPasteboard]];
|
|
1586
1650
|
}
|
|
1587
1651
|
|
|
1588
1652
|
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
|
|
@@ -1590,7 +1654,7 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
|
|
|
1590
1654
|
[self sendMouseEventWithBlock:self.onDrop
|
|
1591
1655
|
locationInfo:[self locationInfoFromDraggingLocation:sender.draggingLocation]
|
|
1592
1656
|
modifierFlags:0
|
|
1593
|
-
additionalData:[self
|
|
1657
|
+
additionalData:[self dataTransferInfoFromPasteboard:sender.draggingPasteboard]];
|
|
1594
1658
|
return YES;
|
|
1595
1659
|
}
|
|
1596
1660
|
#endif // ]TODO(macOS GH#774)
|
|
@@ -95,7 +95,8 @@ RCT_EXPORT_MODULE()
|
|
|
95
95
|
|
|
96
96
|
- (void)setBridge:(RCTBridge *)bridge
|
|
97
97
|
{
|
|
98
|
-
|
|
98
|
+
RCTErrorNewArchitectureValidation(
|
|
99
|
+
RCTNotAllowedInBridgeless, self, @"RCTViewManager must not be initialized for the new architecture");
|
|
99
100
|
_bridge = bridge;
|
|
100
101
|
}
|
|
101
102
|
|
|
@@ -196,10 +197,19 @@ RCT_REMAP_VIEW_PROPERTY(opacity, alpha, CGFloat)
|
|
|
196
197
|
#else // [TODO(macOS GH#774)
|
|
197
198
|
RCT_REMAP_VIEW_PROPERTY(opacity, alphaValue, CGFloat)
|
|
198
199
|
#endif // ]TODO(macOS GH#774)
|
|
200
|
+
|
|
201
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
199
202
|
RCT_REMAP_VIEW_PROPERTY(shadowColor, layer.shadowColor, CGColor)
|
|
200
203
|
RCT_REMAP_VIEW_PROPERTY(shadowOffset, layer.shadowOffset, CGSize)
|
|
201
204
|
RCT_REMAP_VIEW_PROPERTY(shadowOpacity, layer.shadowOpacity, float)
|
|
202
205
|
RCT_REMAP_VIEW_PROPERTY(shadowRadius, layer.shadowRadius, CGFloat)
|
|
206
|
+
#else // [TODO(macOS GH#774)
|
|
207
|
+
RCT_EXPORT_VIEW_PROPERTY(shadowColor, NSColor)
|
|
208
|
+
RCT_EXPORT_VIEW_PROPERTY(shadowOffset, CGSize)
|
|
209
|
+
RCT_EXPORT_VIEW_PROPERTY(shadowOpacity, CGFloat)
|
|
210
|
+
RCT_EXPORT_VIEW_PROPERTY(shadowRadius, CGFloat)
|
|
211
|
+
#endif // ]TODO(macOS GH#774)
|
|
212
|
+
|
|
203
213
|
RCT_REMAP_VIEW_PROPERTY(needsOffscreenAlphaCompositing, layer.allowsGroupOpacity, BOOL)
|
|
204
214
|
RCT_CUSTOM_VIEW_PROPERTY(overflow, YGOverflow, RCTView)
|
|
205
215
|
{
|
|
@@ -5,12 +5,12 @@
|
|
|
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
|
@class RCTWrapperViewController;
|
|
11
11
|
|
|
12
12
|
@interface RCTWrapperViewController : UIViewController
|
|
13
13
|
|
|
14
|
-
- (instancetype)initWithContentView:(
|
|
14
|
+
- (instancetype)initWithContentView:(RCTUIView *)contentView NS_DESIGNATED_INITIALIZER; // TODO(macOS GH#774)
|
|
15
15
|
|
|
16
16
|
@end
|
|
@@ -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/RCTComponent.h>
|
|
11
11
|
#import <React/RCTScrollableProtocol.h>
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
|
|
15
15
|
@property (nonatomic, copy) NSString *title;
|
|
16
16
|
@property (nonatomic, copy) RCTDirectEventBlock onRefresh;
|
|
17
|
-
@property (nonatomic, weak)
|
|
17
|
+
@property (nonatomic, weak) RCTUIScrollView *scrollView; // TODO(macOS GH#774)
|
|
18
18
|
|
|
19
19
|
@end
|
|
@@ -18,6 +18,12 @@
|
|
|
18
18
|
#import "RCTScrollView.h"
|
|
19
19
|
|
|
20
20
|
@implementation RCTScrollContentView
|
|
21
|
+
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
22
|
+
- (BOOL)isFlipped
|
|
23
|
+
{
|
|
24
|
+
return !self.inverted;
|
|
25
|
+
}
|
|
26
|
+
#endif // ]TODO(macOS GH#774)
|
|
21
27
|
|
|
22
28
|
- (void)reactSetFrame:(CGRect)frame
|
|
23
29
|
{
|
|
@@ -67,6 +67,8 @@
|
|
|
67
67
|
@property (nonatomic, copy) RCTDirectEventBlock onMomentumScrollEnd;
|
|
68
68
|
@property (nonatomic, copy) RCTDirectEventBlock onPreferredScrollerStyleDidChange; // TODO(macOS GH#774)
|
|
69
69
|
|
|
70
|
+
@property (nonatomic, copy) RCTDirectEventBlock onInvertedDidChange; // TODO(macOS GH#774)
|
|
71
|
+
|
|
70
72
|
- (void)flashScrollIndicators; // TODO(macOS GH#774)
|
|
71
73
|
|
|
72
74
|
@end
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
@property (nonatomic, assign) BOOL pinchGestureEnabled;
|
|
46
46
|
#else // [TODO(macOS GH#774)
|
|
47
47
|
+ (BOOL)isCompatibleWithResponsiveScrolling;
|
|
48
|
+
@property (nonatomic, assign, getter=isInverted) BOOL inverted;
|
|
48
49
|
@property (nonatomic, assign, getter=isScrollEnabled) BOOL scrollEnabled;
|
|
49
50
|
@property (nonatomic, strong) NSPanGestureRecognizer *panGestureRecognizer;
|
|
50
51
|
#endif // ]TODO(macOS GH#774)
|
|
@@ -108,9 +109,14 @@
|
|
|
108
109
|
return YES;
|
|
109
110
|
}
|
|
110
111
|
|
|
112
|
+
- (BOOL)isFlipped
|
|
113
|
+
{
|
|
114
|
+
return !self.inverted;
|
|
115
|
+
}
|
|
116
|
+
|
|
111
117
|
- (void)scrollWheel:(NSEvent *)theEvent
|
|
112
118
|
{
|
|
113
|
-
if (!self.
|
|
119
|
+
if (!self.isScrollEnabled) {
|
|
114
120
|
[[self nextResponder] scrollWheel:theEvent];
|
|
115
121
|
return;
|
|
116
122
|
}
|
|
@@ -333,21 +339,6 @@
|
|
|
333
339
|
#endif // TODO(macOS GH#774)
|
|
334
340
|
|
|
335
341
|
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
336
|
-
- (BOOL)canBecomeFirstResponder
|
|
337
|
-
{
|
|
338
|
-
return YES;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
- (BOOL)becomeFirstResponder
|
|
342
|
-
{
|
|
343
|
-
return YES;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
- (BOOL)resignFirstResponder
|
|
347
|
-
{
|
|
348
|
-
return YES;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
342
|
- (void)setAccessibilityLabel:(NSString *)accessibilityLabel
|
|
352
343
|
{
|
|
353
344
|
[super setAccessibilityLabel:accessibilityLabel];
|
|
@@ -532,21 +523,6 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
|
|
|
532
523
|
return _scrollView.documentView;
|
|
533
524
|
}
|
|
534
525
|
|
|
535
|
-
- (BOOL)canBecomeFirstResponder
|
|
536
|
-
{
|
|
537
|
-
return [_scrollView canBecomeFirstResponder];
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
- (BOOL)becomeFirstResponder
|
|
541
|
-
{
|
|
542
|
-
return [_scrollView becomeFirstResponder];
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
- (BOOL)resignFirstResponder
|
|
546
|
-
{
|
|
547
|
-
return [_scrollView resignFirstResponder];
|
|
548
|
-
}
|
|
549
|
-
|
|
550
526
|
- (void)setAccessibilityLabel:(NSString *)accessibilityLabel
|
|
551
527
|
{
|
|
552
528
|
[_scrollView setAccessibilityLabel:accessibilityLabel];
|
|
@@ -556,6 +532,15 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
|
|
|
556
532
|
{
|
|
557
533
|
[_scrollView setAccessibilityRole:accessibilityRole];
|
|
558
534
|
}
|
|
535
|
+
|
|
536
|
+
- (void)setInverted:(BOOL)inverted
|
|
537
|
+
{
|
|
538
|
+
BOOL changed = _inverted != inverted;
|
|
539
|
+
_inverted = inverted;
|
|
540
|
+
if (changed && _onInvertedDidChange) {
|
|
541
|
+
_onInvertedDidChange(@{});
|
|
542
|
+
}
|
|
543
|
+
}
|
|
559
544
|
#endif // ]TODO(macOS GH#774)
|
|
560
545
|
|
|
561
546
|
RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
|
@@ -99,6 +99,7 @@ RCT_EXPORT_VIEW_PROPERTY(onScrollToTop, RCTDirectEventBlock)
|
|
|
99
99
|
RCT_EXPORT_VIEW_PROPERTY(onScrollEndDrag, RCTDirectEventBlock)
|
|
100
100
|
RCT_EXPORT_VIEW_PROPERTY(onMomentumScrollBegin, RCTDirectEventBlock)
|
|
101
101
|
RCT_EXPORT_VIEW_PROPERTY(onMomentumScrollEnd, RCTDirectEventBlock)
|
|
102
|
+
RCT_EXPORT_OSX_VIEW_PROPERTY(onInvertedDidChange, RCTDirectEventBlock) // TODO(macOS GH#774)
|
|
102
103
|
RCT_EXPORT_OSX_VIEW_PROPERTY(onPreferredScrollerStyleDidChange, RCTDirectEventBlock) // TODO(macOS GH#774)
|
|
103
104
|
RCT_EXPORT_VIEW_PROPERTY(inverted, BOOL)
|
|
104
105
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* __IPHONE_13_0 */
|
|
@@ -267,18 +267,17 @@
|
|
|
267
267
|
}
|
|
268
268
|
#endif // TODO(macOS GH#774)
|
|
269
269
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
*/
|
|
273
|
-
- (BOOL)reactIsFocusNeeded
|
|
270
|
+
// [TODO(macOS GH#1412)
|
|
271
|
+
- (void)reactViewDidMoveToWindow
|
|
274
272
|
{
|
|
275
|
-
|
|
273
|
+
[self reactFocusIfNeeded];
|
|
276
274
|
}
|
|
275
|
+
// TODO(macOS GH#1412)]
|
|
277
276
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
277
|
+
/**
|
|
278
|
+
* Focus manipulation.
|
|
279
|
+
*/
|
|
280
|
+
static __weak RCTPlatformView *_pendingFocusView; // TODO(macOS GH#1412)
|
|
282
281
|
|
|
283
282
|
- (void)reactFocus
|
|
284
283
|
{
|
|
@@ -287,19 +286,23 @@
|
|
|
287
286
|
#else
|
|
288
287
|
if (![self becomeFirstResponder]) {
|
|
289
288
|
#endif // TODO(macOS GH#774)]
|
|
290
|
-
|
|
291
|
-
|
|
289
|
+
// [TODO(macOS GH#1412)
|
|
290
|
+
_pendingFocusView = self;
|
|
291
|
+
} else {
|
|
292
|
+
_pendingFocusView = nil;
|
|
293
|
+
}
|
|
294
|
+
// TODO(macOS GH#1412)]
|
|
292
295
|
}
|
|
293
296
|
|
|
294
297
|
- (void)reactFocusIfNeeded
|
|
295
298
|
{
|
|
296
|
-
if (self
|
|
299
|
+
if ([self isEqual:_pendingFocusView]) { // TODO(macOS GH#1412)
|
|
297
300
|
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
298
301
|
if ([[self window] makeFirstResponder:self]) {
|
|
299
302
|
#else
|
|
300
303
|
if ([self becomeFirstResponder]) {
|
|
301
304
|
#endif // TODO(macOS GH#774)]
|
|
302
|
-
|
|
305
|
+
_pendingFocusView = nil; // TODO(macOS GH#1412)
|
|
303
306
|
}
|
|
304
307
|
}
|
|
305
308
|
}
|
|
@@ -313,6 +316,12 @@
|
|
|
313
316
|
#else
|
|
314
317
|
[self resignFirstResponder];
|
|
315
318
|
#endif // TODO(macOS GH#774)]
|
|
319
|
+
|
|
320
|
+
// [TODO(macOS GH#1412)
|
|
321
|
+
if ([self isEqual:_pendingFocusView]) {
|
|
322
|
+
_pendingFocusView = nil;
|
|
323
|
+
}
|
|
324
|
+
// TODO(macOS GH#1412)]
|
|
316
325
|
}
|
|
317
326
|
|
|
318
327
|
#pragma mark - Layout
|