react-native-macos 0.0.0-08d0c3b4f → 0.0.0-0c343d926
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/View/ViewAccessibility.js +0 -5
- package/Libraries/Components/View/ViewPropTypes.js +95 -115
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Image/React-RCTImage.podspec +1 -1
- package/Libraries/LinkingIOS/React-RCTLinking.podspec +1 -1
- package/Libraries/NativeAnimation/Nodes/RCTColorAnimatedNode.h +14 -0
- 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 +7 -0
- package/Libraries/Text/RCTTextAttributes.h +9 -3
- package/Libraries/Text/RCTTextAttributes.m +17 -0
- package/Libraries/Text/Text/RCTTextView.m +5 -11
- package/Libraries/Text/Text.js +0 -6
- package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +2 -2
- package/Libraries/TypeSafety/RCTTypeSafety.podspec +1 -1
- package/Libraries/Vibration/React-RCTVibration.podspec +1 -1
- package/React/Base/RCTAssert.h +30 -16
- package/React/Base/RCTAssert.m +53 -22
- package/React/Base/RCTBridge.m +5 -3
- package/React/Base/RCTEventDispatcherProtocol.h +5 -0
- package/React/Base/RCTUIKit.h +54 -0
- package/React/Base/RCTVersion.m +1 -1
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +0 -1
- package/React/Base/macOS/RCTUIKit.m +38 -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/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 -29
- 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 +8 -4
- 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 +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 +16 -0
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +6 -4
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +66 -28
- 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 +23 -22
- 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 +10 -1
- 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 +3 -3
- package/React/Fabric/Mounting/RCTMountingManager.mm +19 -11
- package/React/Fabric/Mounting/RCTMountingManagerDelegate.h +1 -1
- package/React/Fabric/Mounting/RCTMountingTransactionObserving.h +1 -1
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +6 -6
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +6 -6
- package/React/Fabric/RCTConversions.h +6 -6
- package/React/Fabric/RCTImageResponseDelegate.h +1 -1
- package/React/Fabric/RCTLocalizationProvider.h +1 -1
- package/React/Fabric/RCTScheduler.h +3 -1
- package/React/Fabric/RCTScheduler.mm +5 -0
- package/React/Fabric/RCTSurfacePresenter.h +8 -2
- package/React/Fabric/RCTSurfacePresenter.mm +47 -16
- 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 -8
- 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 +1 -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.m +1 -1
- package/React/Views/RCTViewManager.m +2 -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/RCTScrollView.m +0 -30
- package/React/Views/ScrollView/RCTScrollableProtocol.h +1 -1
- 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/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/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/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/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 +5 -2
- package/ReactCommon/react/renderer/scheduler/Scheduler.h +4 -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/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/react_native_pods.rb +1 -1
- package/template/Gemfile.lock +1 -1
- package/template/package.json +1 -1
- package/Libraries/Alert/AlertMacOS.js +0 -211
- package/ReactCommon/butter/optional.h +0 -38
|
@@ -28,6 +28,7 @@ using namespace facebook::react;
|
|
|
28
28
|
|
|
29
29
|
static CGFloat const kClippingLeeway = 44.0;
|
|
30
30
|
|
|
31
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
31
32
|
static UIScrollViewKeyboardDismissMode RCTUIKeyboardDismissModeFromProps(ScrollViewProps const &props)
|
|
32
33
|
{
|
|
33
34
|
switch (props.keyboardDismissMode) {
|
|
@@ -56,7 +57,7 @@ static UIScrollViewIndicatorStyle RCTUIScrollViewIndicatorStyleFromProps(ScrollV
|
|
|
56
57
|
// This is just a workaround to allow animations based on onScroll event.
|
|
57
58
|
// This is only used to animate sticky headers in ScrollViews, and only the contentOffset and tag is used.
|
|
58
59
|
// TODO: T116850910 [Fabric][iOS] Make Fabric not use legacy RCTEventDispatcher for native-driven AnimatedEvents
|
|
59
|
-
static void RCTSendScrollEventForNativeAnimations_DEPRECATED(
|
|
60
|
+
static void RCTSendScrollEventForNativeAnimations_DEPRECATED(RCTUIScrollView *scrollView, NSInteger tag) // TODO(macOS GH#774)
|
|
60
61
|
{
|
|
61
62
|
static uint16_t coalescingKey = 0;
|
|
62
63
|
RCTScrollEvent *scrollEvent = [[RCTScrollEvent alloc] initWithEventName:@"onScroll"
|
|
@@ -73,14 +74,17 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
73
74
|
[bridge.eventDispatcher sendEvent:scrollEvent];
|
|
74
75
|
} else {
|
|
75
76
|
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:scrollEvent, @"event", nil];
|
|
76
|
-
[[NSNotificationCenter defaultCenter] postNotificationName:@"
|
|
77
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:@"RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED"
|
|
77
78
|
object:nil
|
|
78
79
|
userInfo:userInfo];
|
|
79
80
|
}
|
|
80
81
|
}
|
|
82
|
+
#endif // TODO(macOS GH#774)
|
|
81
83
|
|
|
82
84
|
@interface RCTScrollViewComponentView () <
|
|
85
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
83
86
|
UIScrollViewDelegate,
|
|
87
|
+
#endif // TODO(macOS GH#774)
|
|
84
88
|
RCTScrollViewProtocol,
|
|
85
89
|
RCTScrollableProtocol,
|
|
86
90
|
RCTEnhancedScrollViewOverridingDelegate>
|
|
@@ -102,10 +106,10 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
102
106
|
CGPoint _contentOffsetWhenClipped;
|
|
103
107
|
}
|
|
104
108
|
|
|
105
|
-
+ (RCTScrollViewComponentView *_Nullable)findScrollViewComponentViewForView:(
|
|
109
|
+
+ (RCTScrollViewComponentView *_Nullable)findScrollViewComponentViewForView:(RCTUIView *)view // TODO(macOS GH#774)
|
|
106
110
|
{
|
|
107
111
|
do {
|
|
108
|
-
view = view.superview;
|
|
112
|
+
view = (RCTUIView *)view.superview; // TODO(macOS GH#774)
|
|
109
113
|
} while (view != nil && ![view isKindOfClass:[RCTScrollViewComponentView class]]);
|
|
110
114
|
return (RCTScrollViewComponentView *)view;
|
|
111
115
|
}
|
|
@@ -118,16 +122,19 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
118
122
|
|
|
119
123
|
_scrollView = [[RCTEnhancedScrollView alloc] initWithFrame:self.bounds];
|
|
120
124
|
_scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
|
125
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
121
126
|
_scrollView.delaysContentTouches = NO;
|
|
127
|
+
#endif // TODO(macOS GH#774)
|
|
122
128
|
((RCTEnhancedScrollView *)_scrollView).overridingDelegate = self;
|
|
123
129
|
_isUserTriggeredScrolling = NO;
|
|
124
130
|
_shouldUpdateContentInsetAdjustmentBehavior = YES;
|
|
125
131
|
[self addSubview:_scrollView];
|
|
126
132
|
|
|
127
|
-
_containerView = [[
|
|
133
|
+
_containerView = [[RCTUIView alloc] initWithFrame:CGRectZero]; // TODO(macOS GH#774)
|
|
128
134
|
[_scrollView addSubview:_containerView];
|
|
129
|
-
|
|
135
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
130
136
|
[self.scrollViewDelegateSplitter addDelegate:self];
|
|
137
|
+
#endif // TODO(macOS GH#774)
|
|
131
138
|
|
|
132
139
|
_scrollEventThrottle = INFINITY;
|
|
133
140
|
}
|
|
@@ -139,13 +146,17 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
139
146
|
{
|
|
140
147
|
// Removing all delegates from the splitter nils the actual delegate which prevents a crash on UIScrollView
|
|
141
148
|
// deallocation.
|
|
149
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
142
150
|
[self.scrollViewDelegateSplitter removeAllDelegates];
|
|
151
|
+
#endif // TODO(macOS GH#774)
|
|
143
152
|
}
|
|
144
153
|
|
|
154
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
145
155
|
- (RCTGenericDelegateSplitter<id<UIScrollViewDelegate>> *)scrollViewDelegateSplitter
|
|
146
156
|
{
|
|
147
157
|
return ((RCTEnhancedScrollView *)_scrollView).delegateSplitter;
|
|
148
158
|
}
|
|
159
|
+
#endif // TODO(macOS GH#774)
|
|
149
160
|
|
|
150
161
|
#pragma mark - RCTMountingTransactionObserving
|
|
151
162
|
|
|
@@ -172,7 +183,9 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
172
183
|
: CGAffineTransformMakeScale(-1, 1);
|
|
173
184
|
|
|
174
185
|
_containerView.transform = transform;
|
|
186
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
175
187
|
_scrollView.transform = transform;
|
|
188
|
+
#endif // TODO(macOS GH#774)
|
|
176
189
|
}
|
|
177
190
|
}
|
|
178
191
|
|
|
@@ -195,19 +208,25 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
195
208
|
// FIXME: Commented props are not supported yet.
|
|
196
209
|
MAP_SCROLL_VIEW_PROP(alwaysBounceHorizontal);
|
|
197
210
|
MAP_SCROLL_VIEW_PROP(alwaysBounceVertical);
|
|
211
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
198
212
|
MAP_SCROLL_VIEW_PROP(bounces);
|
|
199
213
|
MAP_SCROLL_VIEW_PROP(bouncesZoom);
|
|
200
214
|
MAP_SCROLL_VIEW_PROP(canCancelContentTouches);
|
|
215
|
+
#endif // TODO(macOS GH#774)
|
|
201
216
|
MAP_SCROLL_VIEW_PROP(centerContent);
|
|
202
217
|
// MAP_SCROLL_VIEW_PROP(automaticallyAdjustContentInsets);
|
|
218
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
203
219
|
MAP_SCROLL_VIEW_PROP(decelerationRate);
|
|
204
220
|
MAP_SCROLL_VIEW_PROP(directionalLockEnabled);
|
|
205
221
|
MAP_SCROLL_VIEW_PROP(maximumZoomScale);
|
|
206
222
|
MAP_SCROLL_VIEW_PROP(minimumZoomScale);
|
|
223
|
+
#endif // TODO(macOS GH#774)
|
|
207
224
|
MAP_SCROLL_VIEW_PROP(scrollEnabled);
|
|
225
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
208
226
|
MAP_SCROLL_VIEW_PROP(pagingEnabled);
|
|
209
227
|
MAP_SCROLL_VIEW_PROP(pinchGestureEnabled);
|
|
210
228
|
MAP_SCROLL_VIEW_PROP(scrollsToTop);
|
|
229
|
+
#endif // TODO(macOS GH#774)
|
|
211
230
|
MAP_SCROLL_VIEW_PROP(showsHorizontalScrollIndicator);
|
|
212
231
|
MAP_SCROLL_VIEW_PROP(showsVerticalScrollIndicator);
|
|
213
232
|
|
|
@@ -216,7 +235,9 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
216
235
|
}
|
|
217
236
|
|
|
218
237
|
if (oldScrollViewProps.indicatorStyle != newScrollViewProps.indicatorStyle) {
|
|
238
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
219
239
|
_scrollView.indicatorStyle = RCTUIScrollViewIndicatorStyleFromProps(newScrollViewProps);
|
|
240
|
+
#endif // TODO(macOS GH#774)
|
|
220
241
|
}
|
|
221
242
|
|
|
222
243
|
if (oldScrollViewProps.scrollEventThrottle != newScrollViewProps.scrollEventThrottle) {
|
|
@@ -260,6 +281,7 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
260
281
|
scrollView.snapToOffsets = snapToOffsets;
|
|
261
282
|
}
|
|
262
283
|
|
|
284
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
263
285
|
if (@available(iOS 13.0, *)) {
|
|
264
286
|
if (oldScrollViewProps.automaticallyAdjustsScrollIndicatorInsets !=
|
|
265
287
|
newScrollViewProps.automaticallyAdjustsScrollIndicatorInsets) {
|
|
@@ -282,12 +304,15 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
282
304
|
}
|
|
283
305
|
_shouldUpdateContentInsetAdjustmentBehavior = NO;
|
|
284
306
|
}
|
|
285
|
-
|
|
307
|
+
#endif // TODO(macOS GH#774)
|
|
308
|
+
|
|
286
309
|
MAP_SCROLL_VIEW_PROP(disableIntervalMomentum);
|
|
287
310
|
MAP_SCROLL_VIEW_PROP(snapToInterval);
|
|
288
311
|
|
|
289
312
|
if (oldScrollViewProps.keyboardDismissMode != newScrollViewProps.keyboardDismissMode) {
|
|
313
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
290
314
|
scrollView.keyboardDismissMode = RCTUIKeyboardDismissModeFromProps(newScrollViewProps);
|
|
315
|
+
#endif // TODO(macOS GH#774)
|
|
291
316
|
}
|
|
292
317
|
|
|
293
318
|
[super updateProps:props oldProps:oldProps];
|
|
@@ -334,12 +359,12 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
334
359
|
[((RCTEnhancedScrollView *)_scrollView) preserveContentOffsetWithBlock:block];
|
|
335
360
|
}
|
|
336
361
|
|
|
337
|
-
- (void)mountChildComponentView:(
|
|
362
|
+
- (void)mountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
|
|
338
363
|
{
|
|
339
364
|
[_containerView insertSubview:childComponentView atIndex:index];
|
|
340
365
|
}
|
|
341
366
|
|
|
342
|
-
- (void)unmountChildComponentView:(
|
|
367
|
+
- (void)unmountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
|
|
343
368
|
{
|
|
344
369
|
[childComponentView removeFromSuperview];
|
|
345
370
|
}
|
|
@@ -350,17 +375,17 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
350
375
|
*/
|
|
351
376
|
- (BOOL)_shouldDisableScrollInteraction
|
|
352
377
|
{
|
|
353
|
-
|
|
378
|
+
RCTUIView *ancestorView = (RCTUIView *)self.superview; // TODO(macOS GH#774)
|
|
354
379
|
|
|
355
380
|
while (ancestorView) {
|
|
356
381
|
if ([ancestorView respondsToSelector:@selector(isJSResponder)]) {
|
|
357
|
-
BOOL isJSResponder = ((
|
|
382
|
+
BOOL isJSResponder = ((RCTUIView<RCTComponentViewProtocol> *)ancestorView).isJSResponder; // TODO(macOS GH#774)
|
|
358
383
|
if (isJSResponder) {
|
|
359
384
|
return YES;
|
|
360
385
|
}
|
|
361
386
|
}
|
|
362
387
|
|
|
363
|
-
ancestorView = ancestorView.superview;
|
|
388
|
+
ancestorView = (RCTUIView *)ancestorView.superview;
|
|
364
389
|
}
|
|
365
390
|
|
|
366
391
|
return NO;
|
|
@@ -397,7 +422,9 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
397
422
|
// We set the default behavior to "never" so that iOS
|
|
398
423
|
// doesn't do weird things to UIScrollView insets automatically
|
|
399
424
|
// and keeps it as an opt-in behavior.
|
|
425
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
400
426
|
_scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
|
427
|
+
#endif // TODO(macOS GH#774)
|
|
401
428
|
_shouldUpdateContentInsetAdjustmentBehavior = YES;
|
|
402
429
|
_state.reset();
|
|
403
430
|
_isUserTriggeredScrolling = NO;
|
|
@@ -409,14 +436,14 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
409
436
|
|
|
410
437
|
#pragma mark - UIScrollViewDelegate
|
|
411
438
|
|
|
412
|
-
- (BOOL)touchesShouldCancelInContentView:(__unused
|
|
439
|
+
- (BOOL)touchesShouldCancelInContentView:(__unused RCTUIView *)view // TODO(macOS GH#774)
|
|
413
440
|
{
|
|
414
441
|
// Historically, `UIScrollView`s in React Native do not cancel touches
|
|
415
442
|
// started on `UIControl`-based views (as normal iOS `UIScrollView`s do).
|
|
416
443
|
return ![self _shouldDisableScrollInteraction];
|
|
417
444
|
}
|
|
418
445
|
|
|
419
|
-
- (void)scrollViewDidScroll:(
|
|
446
|
+
- (void)scrollViewDidScroll:(RCTUIScrollView *)scrollView // TODO(macOS GH#774)
|
|
420
447
|
{
|
|
421
448
|
if (!_isUserTriggeredScrolling) {
|
|
422
449
|
[self _updateStateWithContentOffset];
|
|
@@ -428,31 +455,32 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
428
455
|
if (_eventEmitter) {
|
|
429
456
|
std::static_pointer_cast<ScrollViewEventEmitter const>(_eventEmitter)->onScroll([self _scrollViewMetrics]);
|
|
430
457
|
}
|
|
431
|
-
|
|
458
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
432
459
|
RCTSendScrollEventForNativeAnimations_DEPRECATED(scrollView, self.tag);
|
|
460
|
+
#endif // TODO(macOS GH#774)
|
|
433
461
|
}
|
|
434
462
|
|
|
435
463
|
[self _remountChildrenIfNeeded];
|
|
436
464
|
}
|
|
437
465
|
|
|
438
|
-
- (void)scrollViewDidZoom:(
|
|
466
|
+
- (void)scrollViewDidZoom:(RCTUIScrollView *)scrollView // TODO(macOS GH#774)
|
|
439
467
|
{
|
|
440
468
|
[self scrollViewDidScroll:scrollView];
|
|
441
469
|
}
|
|
442
470
|
|
|
443
|
-
- (BOOL)scrollViewShouldScrollToTop:(
|
|
471
|
+
- (BOOL)scrollViewShouldScrollToTop:(RCTUIScrollView *)scrollView // TODO(macOS GH#774)
|
|
444
472
|
{
|
|
445
473
|
_isUserTriggeredScrolling = YES;
|
|
446
474
|
return YES;
|
|
447
475
|
}
|
|
448
476
|
|
|
449
|
-
- (void)scrollViewDidScrollToTop:(
|
|
477
|
+
- (void)scrollViewDidScrollToTop:(RCTUIScrollView *)scrollView // TODO(macOS GH#774)
|
|
450
478
|
{
|
|
451
479
|
_isUserTriggeredScrolling = NO;
|
|
452
480
|
[self _updateStateWithContentOffset];
|
|
453
481
|
}
|
|
454
482
|
|
|
455
|
-
- (void)scrollViewWillBeginDragging:(
|
|
483
|
+
- (void)scrollViewWillBeginDragging:(RCTUIScrollView *)scrollView // TODO(macOS GH#774)
|
|
456
484
|
{
|
|
457
485
|
[self _forceDispatchNextScrollEvent];
|
|
458
486
|
|
|
@@ -464,7 +492,7 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
464
492
|
_isUserTriggeredScrolling = YES;
|
|
465
493
|
}
|
|
466
494
|
|
|
467
|
-
- (void)scrollViewDidEndDragging:(
|
|
495
|
+
- (void)scrollViewDidEndDragging:(RCTUIScrollView *)scrollView willDecelerate:(BOOL)decelerate // TODO(macOS GH#774)
|
|
468
496
|
{
|
|
469
497
|
[self _forceDispatchNextScrollEvent];
|
|
470
498
|
|
|
@@ -476,7 +504,7 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
476
504
|
[self _updateStateWithContentOffset];
|
|
477
505
|
}
|
|
478
506
|
|
|
479
|
-
- (void)scrollViewWillBeginDecelerating:(
|
|
507
|
+
- (void)scrollViewWillBeginDecelerating:(RCTUIScrollView *)scrollView // TODO(macOS GH#774)
|
|
480
508
|
{
|
|
481
509
|
[self _forceDispatchNextScrollEvent];
|
|
482
510
|
|
|
@@ -488,7 +516,7 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
488
516
|
->onMomentumScrollBegin([self _scrollViewMetrics]);
|
|
489
517
|
}
|
|
490
518
|
|
|
491
|
-
- (void)scrollViewDidEndDecelerating:(
|
|
519
|
+
- (void)scrollViewDidEndDecelerating:(RCTUIScrollView *)scrollView // TODO(macOS GH#774)
|
|
492
520
|
{
|
|
493
521
|
[self _forceDispatchNextScrollEvent];
|
|
494
522
|
|
|
@@ -501,12 +529,12 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
501
529
|
_isUserTriggeredScrolling = NO;
|
|
502
530
|
}
|
|
503
531
|
|
|
504
|
-
- (void)scrollViewDidEndScrollingAnimation:(
|
|
532
|
+
- (void)scrollViewDidEndScrollingAnimation:(RCTUIScrollView *)scrollView // TODO(macOS GH#774)
|
|
505
533
|
{
|
|
506
534
|
[self _handleFinishedScrolling:scrollView];
|
|
507
535
|
}
|
|
508
536
|
|
|
509
|
-
- (void)_handleFinishedScrolling:(
|
|
537
|
+
- (void)_handleFinishedScrolling:(RCTUIScrollView *)scrollView // TODO(macOS GH#774)
|
|
510
538
|
{
|
|
511
539
|
[self _forceDispatchNextScrollEvent];
|
|
512
540
|
[self scrollViewDidScroll:scrollView];
|
|
@@ -519,7 +547,7 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
519
547
|
[self _updateStateWithContentOffset];
|
|
520
548
|
}
|
|
521
549
|
|
|
522
|
-
- (void)scrollViewWillBeginZooming:(
|
|
550
|
+
- (void)scrollViewWillBeginZooming:(RCTUIScrollView *)scrollView withView:(nullable RCTUIView *)view // TODO(macOS GH#774)
|
|
523
551
|
{
|
|
524
552
|
[self _forceDispatchNextScrollEvent];
|
|
525
553
|
|
|
@@ -530,7 +558,7 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
530
558
|
std::static_pointer_cast<ScrollViewEventEmitter const>(_eventEmitter)->onScrollBeginDrag([self _scrollViewMetrics]);
|
|
531
559
|
}
|
|
532
560
|
|
|
533
|
-
- (void)scrollViewDidEndZooming:(
|
|
561
|
+
- (void)scrollViewDidEndZooming:(RCTUIScrollView *)scrollView withView:(nullable RCTUIView *)view atScale:(CGFloat)scale // TODO(macOS GH#774)
|
|
534
562
|
{
|
|
535
563
|
[self _forceDispatchNextScrollEvent];
|
|
536
564
|
|
|
@@ -542,7 +570,7 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
542
570
|
[self _updateStateWithContentOffset];
|
|
543
571
|
}
|
|
544
572
|
|
|
545
|
-
- (
|
|
573
|
+
- (RCTUIView *)viewForZoomingInScrollView:(__unused RCTUIScrollView *)scrollView // TODO(macOS GH#774)
|
|
546
574
|
{
|
|
547
575
|
return _containerView;
|
|
548
576
|
}
|
|
@@ -563,7 +591,9 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
563
591
|
|
|
564
592
|
- (void)flashScrollIndicators
|
|
565
593
|
{
|
|
594
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
566
595
|
[_scrollView flashScrollIndicators];
|
|
596
|
+
#endif // TODO(macOS GH#774)
|
|
567
597
|
}
|
|
568
598
|
|
|
569
599
|
- (void)scrollTo:(double)x y:(double)y animated:(BOOL)animated
|
|
@@ -610,7 +640,7 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
610
640
|
|
|
611
641
|
#pragma mark - Child views mounting
|
|
612
642
|
|
|
613
|
-
- (void)updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(
|
|
643
|
+
- (void)updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(RCTUIView *)clipView // TODO(macOS GH#774)
|
|
614
644
|
{
|
|
615
645
|
// Do nothing. ScrollView manages its subview clipping individually in `_remountChildren`.
|
|
616
646
|
}
|
|
@@ -631,8 +661,10 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
631
661
|
|
|
632
662
|
- (void)_remountChildren
|
|
633
663
|
{
|
|
664
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
634
665
|
[_scrollView updateClippedSubviewsWithClipRect:CGRectInset(_scrollView.bounds, -kClippingLeeway, -kClippingLeeway)
|
|
635
666
|
relativeToView:_scrollView];
|
|
667
|
+
#endif // TODO(macOS GH#774)
|
|
636
668
|
}
|
|
637
669
|
|
|
638
670
|
#pragma mark - RCTScrollableProtocol
|
|
@@ -660,7 +692,9 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
660
692
|
offset.x = self.contentSize.width - _scrollView.frame.size.width - offset.x;
|
|
661
693
|
}
|
|
662
694
|
|
|
695
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
663
696
|
[_scrollView setContentOffset:offset animated:animated];
|
|
697
|
+
#endif // TODO(macOS GH#774)
|
|
664
698
|
|
|
665
699
|
if (!animated) {
|
|
666
700
|
// When not animated, the expected workflow in ``scrollViewDidEndScrollingAnimation`` after scrolling is not going
|
|
@@ -671,9 +705,12 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
671
705
|
|
|
672
706
|
- (void)zoomToRect:(CGRect)rect animated:(BOOL)animated
|
|
673
707
|
{
|
|
708
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
674
709
|
[_scrollView zoomToRect:rect animated:animated];
|
|
710
|
+
#endif // TODO(macOS GH#774)
|
|
675
711
|
}
|
|
676
712
|
|
|
713
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
677
714
|
- (void)addScrollListener:(NSObject<UIScrollViewDelegate> *)scrollListener
|
|
678
715
|
{
|
|
679
716
|
[self.scrollViewDelegateSplitter addDelegate:scrollListener];
|
|
@@ -683,6 +720,7 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
683
720
|
{
|
|
684
721
|
[self.scrollViewDelegateSplitter removeDelegate:scrollListener];
|
|
685
722
|
}
|
|
723
|
+
#endif // TODO(macOS GH#774)
|
|
686
724
|
|
|
687
725
|
@end
|
|
688
726
|
|
|
@@ -23,7 +23,7 @@ using namespace facebook::react;
|
|
|
23
23
|
@end
|
|
24
24
|
|
|
25
25
|
@implementation RCTSliderComponentView {
|
|
26
|
-
|
|
26
|
+
RCTUISlider *_sliderView; // TODO(macOS GH#774)
|
|
27
27
|
float _previousValue;
|
|
28
28
|
|
|
29
29
|
UIImage *_trackImage;
|
|
@@ -48,7 +48,7 @@ using namespace facebook::react;
|
|
|
48
48
|
static const auto defaultProps = std::make_shared<const SliderProps>();
|
|
49
49
|
_props = defaultProps;
|
|
50
50
|
|
|
51
|
-
_sliderView = [[
|
|
51
|
+
_sliderView = [[RCTUISlider alloc] initWithFrame:self.bounds]; // TODO(macOS GH#774)
|
|
52
52
|
|
|
53
53
|
[_sliderView addTarget:self action:@selector(onChange:) forControlEvents:UIControlEventValueChanged];
|
|
54
54
|
[_sliderView addTarget:self
|
|
@@ -284,17 +284,17 @@ using namespace facebook::react;
|
|
|
284
284
|
[_sliderView setThumbImage:thumbImage forState:UIControlStateNormal];
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
-
- (void)onChange:(
|
|
287
|
+
- (void)onChange:(RCTUISlider *)sender // TODO(macOS GH#774)
|
|
288
288
|
{
|
|
289
289
|
[self onChange:sender withContinuous:YES];
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
-
- (void)sliderTouchEnd:(
|
|
292
|
+
- (void)sliderTouchEnd:(RCTUISlider *)sender // TODO(macOS GH#774)
|
|
293
293
|
{
|
|
294
294
|
[self onChange:sender withContinuous:NO];
|
|
295
295
|
}
|
|
296
296
|
|
|
297
|
-
- (void)onChange:(
|
|
297
|
+
- (void)onChange:(RCTUISlider *)sender withContinuous:(BOOL)continuous // TODO(macOS GH#774)
|
|
298
298
|
{
|
|
299
299
|
float value = sender.value;
|
|
300
300
|
|
|
@@ -22,7 +22,7 @@ using namespace facebook::react;
|
|
|
22
22
|
@end
|
|
23
23
|
|
|
24
24
|
@implementation RCTSwitchComponentView {
|
|
25
|
-
|
|
25
|
+
RCTUISwitch *_switchView; // TODO(macOS GH#774)
|
|
26
26
|
BOOL _isInitialValueSet;
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -32,7 +32,7 @@ using namespace facebook::react;
|
|
|
32
32
|
static const auto defaultProps = std::make_shared<const SwitchProps>();
|
|
33
33
|
_props = defaultProps;
|
|
34
34
|
|
|
35
|
-
_switchView = [[
|
|
35
|
+
_switchView = [[RCTUISwitch alloc] initWithFrame:self.bounds]; // TODO(macOS GH#774)
|
|
36
36
|
|
|
37
37
|
[_switchView addTarget:self action:@selector(onChange:) forControlEvents:UIControlEventValueChanged];
|
|
38
38
|
|
|
@@ -90,7 +90,7 @@ using namespace facebook::react;
|
|
|
90
90
|
[super updateProps:props oldProps:oldProps];
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
- (void)onChange:(
|
|
93
|
+
- (void)onChange:(RCTUISwitch *)sender // TODO(macOS GH#774)
|
|
94
94
|
{
|
|
95
95
|
const auto &props = *std::static_pointer_cast<const SwitchProps>(_props);
|
|
96
96
|
if (props.value == sender.on) {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
- (CGRect)accessibilityFrame
|
|
13
13
|
{
|
|
14
|
-
|
|
14
|
+
RCTUIView *container = (RCTUIView *)self.accessibilityContainer; // TODO(macOS GH#774)
|
|
15
15
|
if (CGRectEqualToRect(_frame, CGRectZero)) {
|
|
16
16
|
return UIAccessibilityConvertFrameToScreenCoordinates(container.bounds, container);
|
|
17
17
|
} else {
|
package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.h
CHANGED
|
@@ -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/attributedstring/AttributedString.h>
|
|
11
11
|
#import <react/renderer/attributedstring/ParagraphAttributes.h>
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
layoutManager:(RCTTextLayoutManager *)layoutManager
|
|
20
20
|
paragraphAttributes:(facebook::react::ParagraphAttributes)paragraphAttributes
|
|
21
21
|
frame:(CGRect)frame
|
|
22
|
-
view:(
|
|
22
|
+
view:(RCTUIView *)view; // TODO(macOS GH#774)
|
|
23
23
|
|
|
24
24
|
/*
|
|
25
25
|
* Returns an array of `UIAccessibilityElement`s to be used for `UIAccessibilityContainer` implementation.
|
package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.mm
CHANGED
|
@@ -26,14 +26,14 @@ using namespace facebook::react;
|
|
|
26
26
|
RCTTextLayoutManager *_layoutManager;
|
|
27
27
|
ParagraphAttributes _paragraphAttributes;
|
|
28
28
|
CGRect _frame;
|
|
29
|
-
__weak
|
|
29
|
+
__weak RCTUIView *_view; // TODO(macOS GH#774)
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
- (instancetype)initWithString:(facebook::react::AttributedString)attributedString
|
|
33
33
|
layoutManager:(RCTTextLayoutManager *)layoutManager
|
|
34
34
|
paragraphAttributes:(ParagraphAttributes)paragraphAttributes
|
|
35
35
|
frame:(CGRect)frame
|
|
36
|
-
view:(
|
|
36
|
+
view:(RCTUIView *)view // TODO(macOS GH#774)
|
|
37
37
|
{
|
|
38
38
|
if (self = [super init]) {
|
|
39
39
|
_attributedString = attributedString;
|
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
#import "RCTParagraphComponentView.h"
|
|
9
9
|
#import "RCTParagraphComponentAccessibilityProvider.h"
|
|
10
10
|
|
|
11
|
+
#if !TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
11
12
|
#import <MobileCoreServices/UTCoreTypes.h>
|
|
13
|
+
#endif // ]TODO(macOS GH#774)
|
|
14
|
+
|
|
12
15
|
#import <react/renderer/components/text/ParagraphComponentDescriptor.h>
|
|
13
16
|
#import <react/renderer/components/text/ParagraphProps.h>
|
|
14
17
|
#import <react/renderer/components/text/ParagraphState.h>
|