react-native-macos 0.0.0-3a2426fff → 0.0.0-3b6429a3b
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/Core/ReactNativeVersion.js +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 +0 -4
- package/React/Base/RCTUIKit.h +11 -0
- package/React/Base/RCTVersion.m +1 -1
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +0 -1
- package/React/CoreModules/RCTLogBox.mm +26 -9
- package/React/CoreModules/RCTLogBoxView.h +5 -0
- package/React/CoreModules/RCTLogBoxView.mm +36 -0
- 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 +1 -1
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +6 -6
- 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/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/RCTScrollViewComponentView.h +4 -4
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +22 -22
- 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 +3 -3
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h +3 -3
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +2 -2
- 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 +18 -18
- 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/RCTComponentViewProtocol.h +3 -3
- 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 +10 -9
- package/React/Fabric/Mounting/RCTMountingManagerDelegate.h +1 -1
- package/React/Fabric/Mounting/RCTMountingTransactionObserving.h +1 -1
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +5 -5
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +5 -5
- 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 +1 -1
- package/React/Fabric/RCTSurfacePresenter.h +8 -2
- package/React/Fabric/RCTSurfacePresenter.mm +13 -5
- 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/Utils/RCTGenericDelegateSplitter.h +1 -1
- package/React/Modules/RCTSurfacePresenterStub.h +4 -0
- package/React/Views/RCTMaskedView.h +1 -1
- package/React/Views/RCTModalHostView.h +2 -2
- package/React/Views/RCTModalHostViewController.h +1 -1
- package/React/Views/RCTModalManager.h +1 -1
- package/React/Views/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/RCTScrollableProtocol.h +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +3 -3
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +3 -3
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +3 -3
- 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/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 +7 -7
- 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/package.json +4 -1
- package/template/Gemfile.lock +1 -1
- package/template/package.json +1 -1
|
@@ -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/RCTDefines.h>
|
|
11
11
|
#import <React/RCTGenericDelegateSplitter.h>
|
|
@@ -28,19 +28,19 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
28
28
|
/*
|
|
29
29
|
* Finds and returns the closet RCTScrollViewComponentView component to the given view
|
|
30
30
|
*/
|
|
31
|
-
+ (nullable RCTScrollViewComponentView *)findScrollViewComponentViewForView:(
|
|
31
|
+
+ (nullable RCTScrollViewComponentView *)findScrollViewComponentViewForView:(RCTUIView *)view; // TODO(macOS GH#774)
|
|
32
32
|
|
|
33
33
|
/*
|
|
34
34
|
* Returns an actual UIScrollView that this component uses under the hood.
|
|
35
35
|
*/
|
|
36
|
-
@property (nonatomic, strong, readonly)
|
|
36
|
+
@property (nonatomic, strong, readonly) RCTUIScrollView *scrollView; // TODO(macOS GH#774)
|
|
37
37
|
|
|
38
38
|
/*
|
|
39
39
|
* Returns the subview of the scroll view that the component uses to mount all subcomponents into. That's useful to
|
|
40
40
|
* separate component views from auxiliary views to be able to reliably implement pull-to-refresh- and RTL-related
|
|
41
41
|
* functionality.
|
|
42
42
|
*/
|
|
43
|
-
@property (nonatomic, strong, readonly)
|
|
43
|
+
@property (nonatomic, strong, readonly) RCTUIView *containerView; // TODO(macOS GH#774)
|
|
44
44
|
|
|
45
45
|
/*
|
|
46
46
|
* Returns a delegate splitter that can be used to subscribe for UIScrollView delegate.
|
|
@@ -56,7 +56,7 @@ static UIScrollViewIndicatorStyle RCTUIScrollViewIndicatorStyleFromProps(ScrollV
|
|
|
56
56
|
// This is just a workaround to allow animations based on onScroll event.
|
|
57
57
|
// This is only used to animate sticky headers in ScrollViews, and only the contentOffset and tag is used.
|
|
58
58
|
// TODO: T116850910 [Fabric][iOS] Make Fabric not use legacy RCTEventDispatcher for native-driven AnimatedEvents
|
|
59
|
-
static void RCTSendScrollEventForNativeAnimations_DEPRECATED(
|
|
59
|
+
static void RCTSendScrollEventForNativeAnimations_DEPRECATED(RCTUIScrollView *scrollView, NSInteger tag) // TODO(macOS GH#774)
|
|
60
60
|
{
|
|
61
61
|
static uint16_t coalescingKey = 0;
|
|
62
62
|
RCTScrollEvent *scrollEvent = [[RCTScrollEvent alloc] initWithEventName:@"onScroll"
|
|
@@ -102,7 +102,7 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
102
102
|
CGPoint _contentOffsetWhenClipped;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
+ (RCTScrollViewComponentView *_Nullable)findScrollViewComponentViewForView:(
|
|
105
|
+
+ (RCTScrollViewComponentView *_Nullable)findScrollViewComponentViewForView:(RCTUIView *)view // TODO(macOS GH#774)
|
|
106
106
|
{
|
|
107
107
|
do {
|
|
108
108
|
view = view.superview;
|
|
@@ -124,7 +124,7 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
124
124
|
_shouldUpdateContentInsetAdjustmentBehavior = YES;
|
|
125
125
|
[self addSubview:_scrollView];
|
|
126
126
|
|
|
127
|
-
_containerView = [[
|
|
127
|
+
_containerView = [[RCTUIView alloc] initWithFrame:CGRectZero]; // TODO(macOS GH#774)
|
|
128
128
|
[_scrollView addSubview:_containerView];
|
|
129
129
|
|
|
130
130
|
[self.scrollViewDelegateSplitter addDelegate:self];
|
|
@@ -334,12 +334,12 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
334
334
|
[((RCTEnhancedScrollView *)_scrollView) preserveContentOffsetWithBlock:block];
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
- (void)mountChildComponentView:(
|
|
337
|
+
- (void)mountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
|
|
338
338
|
{
|
|
339
339
|
[_containerView insertSubview:childComponentView atIndex:index];
|
|
340
340
|
}
|
|
341
341
|
|
|
342
|
-
- (void)unmountChildComponentView:(
|
|
342
|
+
- (void)unmountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
|
|
343
343
|
{
|
|
344
344
|
[childComponentView removeFromSuperview];
|
|
345
345
|
}
|
|
@@ -350,11 +350,11 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
350
350
|
*/
|
|
351
351
|
- (BOOL)_shouldDisableScrollInteraction
|
|
352
352
|
{
|
|
353
|
-
|
|
353
|
+
RCTUIView *ancestorView = self.superview; // TODO(macOS GH#774)
|
|
354
354
|
|
|
355
355
|
while (ancestorView) {
|
|
356
356
|
if ([ancestorView respondsToSelector:@selector(isJSResponder)]) {
|
|
357
|
-
BOOL isJSResponder = ((
|
|
357
|
+
BOOL isJSResponder = ((RCTUIView<RCTComponentViewProtocol> *)ancestorView).isJSResponder; // TODO(macOS GH#774)
|
|
358
358
|
if (isJSResponder) {
|
|
359
359
|
return YES;
|
|
360
360
|
}
|
|
@@ -409,14 +409,14 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
409
409
|
|
|
410
410
|
#pragma mark - UIScrollViewDelegate
|
|
411
411
|
|
|
412
|
-
- (BOOL)touchesShouldCancelInContentView:(__unused
|
|
412
|
+
- (BOOL)touchesShouldCancelInContentView:(__unused RCTUIView *)view // TODO(macOS GH#774)
|
|
413
413
|
{
|
|
414
414
|
// Historically, `UIScrollView`s in React Native do not cancel touches
|
|
415
415
|
// started on `UIControl`-based views (as normal iOS `UIScrollView`s do).
|
|
416
416
|
return ![self _shouldDisableScrollInteraction];
|
|
417
417
|
}
|
|
418
418
|
|
|
419
|
-
- (void)scrollViewDidScroll:(
|
|
419
|
+
- (void)scrollViewDidScroll:(RCTUIScrollView *)scrollView // TODO(macOS GH#774)
|
|
420
420
|
{
|
|
421
421
|
if (!_isUserTriggeredScrolling) {
|
|
422
422
|
[self _updateStateWithContentOffset];
|
|
@@ -435,24 +435,24 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
435
435
|
[self _remountChildrenIfNeeded];
|
|
436
436
|
}
|
|
437
437
|
|
|
438
|
-
- (void)scrollViewDidZoom:(
|
|
438
|
+
- (void)scrollViewDidZoom:(RCTUIScrollView *)scrollView // TODO(macOS GH#774)
|
|
439
439
|
{
|
|
440
440
|
[self scrollViewDidScroll:scrollView];
|
|
441
441
|
}
|
|
442
442
|
|
|
443
|
-
- (BOOL)scrollViewShouldScrollToTop:(
|
|
443
|
+
- (BOOL)scrollViewShouldScrollToTop:(RCTUIScrollView *)scrollView // TODO(macOS GH#774)
|
|
444
444
|
{
|
|
445
445
|
_isUserTriggeredScrolling = YES;
|
|
446
446
|
return YES;
|
|
447
447
|
}
|
|
448
448
|
|
|
449
|
-
- (void)scrollViewDidScrollToTop:(
|
|
449
|
+
- (void)scrollViewDidScrollToTop:(RCTUIScrollView *)scrollView // TODO(macOS GH#774)
|
|
450
450
|
{
|
|
451
451
|
_isUserTriggeredScrolling = NO;
|
|
452
452
|
[self _updateStateWithContentOffset];
|
|
453
453
|
}
|
|
454
454
|
|
|
455
|
-
- (void)scrollViewWillBeginDragging:(
|
|
455
|
+
- (void)scrollViewWillBeginDragging:(RCTUIScrollView *)scrollView // TODO(macOS GH#774)
|
|
456
456
|
{
|
|
457
457
|
[self _forceDispatchNextScrollEvent];
|
|
458
458
|
|
|
@@ -464,7 +464,7 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
464
464
|
_isUserTriggeredScrolling = YES;
|
|
465
465
|
}
|
|
466
466
|
|
|
467
|
-
- (void)scrollViewDidEndDragging:(
|
|
467
|
+
- (void)scrollViewDidEndDragging:(RCTUIScrollView *)scrollView willDecelerate:(BOOL)decelerate // TODO(macOS GH#774)
|
|
468
468
|
{
|
|
469
469
|
[self _forceDispatchNextScrollEvent];
|
|
470
470
|
|
|
@@ -476,7 +476,7 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
476
476
|
[self _updateStateWithContentOffset];
|
|
477
477
|
}
|
|
478
478
|
|
|
479
|
-
- (void)scrollViewWillBeginDecelerating:(
|
|
479
|
+
- (void)scrollViewWillBeginDecelerating:(RCTUIScrollView *)scrollView // TODO(macOS GH#774)
|
|
480
480
|
{
|
|
481
481
|
[self _forceDispatchNextScrollEvent];
|
|
482
482
|
|
|
@@ -488,7 +488,7 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
488
488
|
->onMomentumScrollBegin([self _scrollViewMetrics]);
|
|
489
489
|
}
|
|
490
490
|
|
|
491
|
-
- (void)scrollViewDidEndDecelerating:(
|
|
491
|
+
- (void)scrollViewDidEndDecelerating:(RCTUIScrollView *)scrollView // TODO(macOS GH#774)
|
|
492
492
|
{
|
|
493
493
|
[self _forceDispatchNextScrollEvent];
|
|
494
494
|
|
|
@@ -501,12 +501,12 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
501
501
|
_isUserTriggeredScrolling = NO;
|
|
502
502
|
}
|
|
503
503
|
|
|
504
|
-
- (void)scrollViewDidEndScrollingAnimation:(
|
|
504
|
+
- (void)scrollViewDidEndScrollingAnimation:(RCTUIScrollView *)scrollView // TODO(macOS GH#774)
|
|
505
505
|
{
|
|
506
506
|
[self _handleFinishedScrolling:scrollView];
|
|
507
507
|
}
|
|
508
508
|
|
|
509
|
-
- (void)_handleFinishedScrolling:(
|
|
509
|
+
- (void)_handleFinishedScrolling:(RCTUIScrollView *)scrollView // TODO(macOS GH#774)
|
|
510
510
|
{
|
|
511
511
|
[self _forceDispatchNextScrollEvent];
|
|
512
512
|
[self scrollViewDidScroll:scrollView];
|
|
@@ -519,7 +519,7 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
519
519
|
[self _updateStateWithContentOffset];
|
|
520
520
|
}
|
|
521
521
|
|
|
522
|
-
- (void)scrollViewWillBeginZooming:(
|
|
522
|
+
- (void)scrollViewWillBeginZooming:(RCTUIScrollView *)scrollView withView:(nullable RCTUIView *)view // TODO(macOS GH#774)
|
|
523
523
|
{
|
|
524
524
|
[self _forceDispatchNextScrollEvent];
|
|
525
525
|
|
|
@@ -530,7 +530,7 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
530
530
|
std::static_pointer_cast<ScrollViewEventEmitter const>(_eventEmitter)->onScrollBeginDrag([self _scrollViewMetrics]);
|
|
531
531
|
}
|
|
532
532
|
|
|
533
|
-
- (void)scrollViewDidEndZooming:(
|
|
533
|
+
- (void)scrollViewDidEndZooming:(RCTUIScrollView *)scrollView withView:(nullable RCTUIView *)view atScale:(CGFloat)scale // TODO(macOS GH#774)
|
|
534
534
|
{
|
|
535
535
|
[self _forceDispatchNextScrollEvent];
|
|
536
536
|
|
|
@@ -542,7 +542,7 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
542
542
|
[self _updateStateWithContentOffset];
|
|
543
543
|
}
|
|
544
544
|
|
|
545
|
-
- (
|
|
545
|
+
- (RCTUIView *)viewForZoomingInScrollView:(__unused RCTUIScrollView *)scrollView // TODO(macOS GH#774)
|
|
546
546
|
{
|
|
547
547
|
return _containerView;
|
|
548
548
|
}
|
|
@@ -610,7 +610,7 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
|
|
610
610
|
|
|
611
611
|
#pragma mark - Child views mounting
|
|
612
612
|
|
|
613
|
-
- (void)updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(
|
|
613
|
+
- (void)updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(RCTUIView *)clipView // TODO(macOS GH#774)
|
|
614
614
|
{
|
|
615
615
|
// Do nothing. ScrollView manages its subview clipping individually in `_remountChildren`.
|
|
616
616
|
}
|
|
@@ -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
|
|
|
@@ -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>
|
|
@@ -30,7 +30,7 @@ using namespace facebook::react;
|
|
|
30
30
|
|
|
31
31
|
@implementation RCTTextInputComponentView {
|
|
32
32
|
TextInputShadowNode::ConcreteState::Shared _state;
|
|
33
|
-
|
|
33
|
+
RCTUIView<RCTBackedTextInputViewProtocol> *_backedTextInputView; // TODO(macOS GH#774)
|
|
34
34
|
NSUInteger _mostRecentEventCount;
|
|
35
35
|
NSAttributedString *_lastStringStateWasUpdatedWith;
|
|
36
36
|
|
|
@@ -409,7 +409,7 @@ using namespace facebook::react;
|
|
|
409
409
|
|
|
410
410
|
#pragma mark - RCTBackedTextInputDelegate (UIScrollViewDelegate)
|
|
411
411
|
|
|
412
|
-
- (void)scrollViewDidScroll:(
|
|
412
|
+
- (void)scrollViewDidScroll:(RCTUIScrollView *)scrollView // TODO(macOS GH#774)
|
|
413
413
|
{
|
|
414
414
|
if (_eventEmitter) {
|
|
415
415
|
std::static_pointer_cast<TextInputEventEmitter const>(_eventEmitter)->onScroll([self _textInputMetrics]);
|
|
@@ -603,7 +603,7 @@ using namespace facebook::react;
|
|
|
603
603
|
- (void)_setMultiline:(BOOL)multiline
|
|
604
604
|
{
|
|
605
605
|
[_backedTextInputView removeFromSuperview];
|
|
606
|
-
|
|
606
|
+
RCTUIView<RCTBackedTextInputViewProtocol> *backedTextInputView = multiline ? [RCTUITextView new] : [RCTUITextField new]; // TODO(macOS GH#774)
|
|
607
607
|
backedTextInputView.frame = _backedTextInputView.frame;
|
|
608
608
|
RCTCopyBackedTextInput(_backedTextInputView, backedTextInputView);
|
|
609
609
|
_backedTextInputView = backedTextInputView;
|
|
@@ -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 <optional>
|
|
11
11
|
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
NS_ASSUME_NONNULL_BEGIN
|
|
16
16
|
|
|
17
17
|
void RCTCopyBackedTextInput(
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
RCTUIView<RCTBackedTextInputViewProtocol> *fromTextInput,
|
|
19
|
+
RCTUIView<RCTBackedTextInputViewProtocol> *toTextInput); // TODO(macOS GH#774)
|
|
20
20
|
|
|
21
21
|
UITextAutocorrectionType RCTUITextAutocorrectionTypeFromOptionalBool(std::optional<bool> autoCorrect);
|
|
22
22
|
|
|
@@ -19,8 +19,8 @@ static NSAttributedString *RCTSanitizeAttributedString(NSAttributedString *attri
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
void RCTCopyBackedTextInput(
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
RCTUIView<RCTBackedTextInputViewProtocol> *fromTextInput,
|
|
23
|
+
RCTUIView<RCTBackedTextInputViewProtocol> *toTextInput) // TODO(macOS GH#774)
|
|
24
24
|
{
|
|
25
25
|
toTextInput.attributedText = RCTSanitizeAttributedString(fromTextInput.attributedText);
|
|
26
26
|
toTextInput.placeholder = fromTextInput.placeholder;
|
|
@@ -25,12 +25,12 @@ using namespace facebook::react;
|
|
|
25
25
|
|
|
26
26
|
CGRect bounds = self.bounds;
|
|
27
27
|
_label = [[UILabel alloc] initWithFrame:bounds];
|
|
28
|
-
_label.backgroundColor = [
|
|
28
|
+
_label.backgroundColor = [RCTUIColor colorWithRed:1.0 green:0.0 blue:0.0 alpha:0.3]; // TODO(macOS GH#774)
|
|
29
29
|
_label.layoutMargins = UIEdgeInsetsMake(12, 12, 12, 12);
|
|
30
30
|
_label.lineBreakMode = NSLineBreakByWordWrapping;
|
|
31
31
|
_label.numberOfLines = 0;
|
|
32
32
|
_label.textAlignment = NSTextAlignmentCenter;
|
|
33
|
-
_label.textColor = [
|
|
33
|
+
_label.textColor = [RCTUIColor whiteColor]; // TODO(macOS GH#774)
|
|
34
34
|
|
|
35
35
|
self.contentView = _label;
|
|
36
36
|
}
|
package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm
CHANGED
|
@@ -31,11 +31,11 @@ using namespace facebook::react;
|
|
|
31
31
|
_props = defaultProps;
|
|
32
32
|
|
|
33
33
|
_label = [[UILabel alloc] initWithFrame:self.bounds];
|
|
34
|
-
_label.backgroundColor = [
|
|
34
|
+
_label.backgroundColor = [RCTUIColor colorWithRed:1.0 green:0.0 blue:0.0 alpha:0.3]; // TODO(macOS GH#774)
|
|
35
35
|
_label.lineBreakMode = NSLineBreakByCharWrapping;
|
|
36
36
|
_label.numberOfLines = 0;
|
|
37
37
|
_label.textAlignment = NSTextAlignmentCenter;
|
|
38
|
-
_label.textColor = [
|
|
38
|
+
_label.textColor = [RCTUIColor whiteColor]; // TODO(macOS GH#774)
|
|
39
39
|
_label.allowsDefaultTighteningForTruncation = YES;
|
|
40
40
|
_label.adjustsFontSizeToFitWidth = YES;
|
|
41
41
|
|
|
@@ -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
|
#import <React/RCTConstants.h>
|
|
@@ -22,12 +22,12 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
22
22
|
/**
|
|
23
23
|
* UIView class for <View> component.
|
|
24
24
|
*/
|
|
25
|
-
@interface RCTViewComponentView :
|
|
25
|
+
@interface RCTViewComponentView : RCTUIView <RCTComponentViewProtocol, RCTTouchableComponentViewProtocol> {
|
|
26
26
|
@protected
|
|
27
27
|
facebook::react::LayoutMetrics _layoutMetrics;
|
|
28
28
|
facebook::react::SharedViewProps _props;
|
|
29
29
|
facebook::react::SharedViewEventEmitter _eventEmitter;
|
|
30
|
-
}
|
|
30
|
+
} // TODO(macOS GH#774)
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Represents the `UIView` instance that is being automatically attached to
|
|
@@ -37,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
37
37
|
* to embed/bridge pure native views as component views.
|
|
38
38
|
* Defaults to `nil`. Assign `nil` to remove view as subview.
|
|
39
39
|
*/
|
|
40
|
-
@property (nonatomic, strong, nullable)
|
|
40
|
+
@property (nonatomic, strong, nullable) RCTUIView *contentView; // TODO(macOS GH#774)
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Provides access to `nativeId` prop of the component.
|
|
@@ -52,7 +52,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
52
52
|
* Provides access to `foregroundColor` prop of the component.
|
|
53
53
|
* Must be used by subclasses only.
|
|
54
54
|
*/
|
|
55
|
-
@property (nonatomic, strong, nullable)
|
|
55
|
+
@property (nonatomic, strong, nullable) RCTUIColor *foregroundColor; // TODO(macOS GH#774)
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
58
|
* Returns the object - usually (sub)view - which represents this
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
using namespace facebook::react;
|
|
22
22
|
|
|
23
23
|
@implementation RCTViewComponentView {
|
|
24
|
-
|
|
24
|
+
RCTUIColor *_backgroundColor; // TODO(macOS GH#774)
|
|
25
25
|
CALayer *_borderLayer;
|
|
26
26
|
BOOL _needsInvalidateLayer;
|
|
27
27
|
BOOL _isJSResponder;
|
|
28
28
|
BOOL _removeClippedSubviews;
|
|
29
|
-
NSMutableArray<
|
|
29
|
+
NSMutableArray<RCTUIView *> *_reactSubviews; // TODO(macOS GH#774)
|
|
30
30
|
NSSet<NSString *> *_Nullable _propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN;
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -48,7 +48,7 @@ using namespace facebook::react;
|
|
|
48
48
|
return _props;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
- (void)setContentView:(
|
|
51
|
+
- (void)setContentView:(RCTUIView *)contentView // TODO(macOS GH#774)
|
|
52
52
|
{
|
|
53
53
|
if (_contentView) {
|
|
54
54
|
[_contentView removeFromSuperview];
|
|
@@ -71,12 +71,12 @@ using namespace facebook::react;
|
|
|
71
71
|
return CGRectContainsPoint(hitFrame, point);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
- (
|
|
74
|
+
- (RCTUIColor *)backgroundColor // TODO(macOS GH#774)
|
|
75
75
|
{
|
|
76
76
|
return _backgroundColor;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
- (void)setBackgroundColor:(
|
|
79
|
+
- (void)setBackgroundColor:(RCTUIColor *)backgroundColor // TODO(macOS GH#774)
|
|
80
80
|
{
|
|
81
81
|
_backgroundColor = backgroundColor;
|
|
82
82
|
}
|
|
@@ -92,7 +92,7 @@ using namespace facebook::react;
|
|
|
92
92
|
return concreteComponentDescriptorProvider<ViewComponentDescriptor>();
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
- (void)mountChildComponentView:(
|
|
95
|
+
- (void)mountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
|
|
96
96
|
{
|
|
97
97
|
RCTAssert(
|
|
98
98
|
childComponentView.superview == nil,
|
|
@@ -109,7 +109,7 @@ using namespace facebook::react;
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
- (void)unmountChildComponentView:(
|
|
112
|
+
- (void)unmountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index // TODO(macOS GH#774)
|
|
113
113
|
{
|
|
114
114
|
if (_removeClippedSubviews) {
|
|
115
115
|
[_reactSubviews removeObjectAtIndex:index];
|
|
@@ -133,7 +133,7 @@ using namespace facebook::react;
|
|
|
133
133
|
[childComponentView removeFromSuperview];
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
- (void)updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(
|
|
136
|
+
- (void)updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(RCTUIView *)clipView // TODO(macOS GH#774)
|
|
137
137
|
{
|
|
138
138
|
if (!_removeClippedSubviews) {
|
|
139
139
|
// Use default behavior if unmounting is disabled
|
|
@@ -154,7 +154,7 @@ using namespace facebook::react;
|
|
|
154
154
|
clipRect = [clipView convertRect:clipRect toView:self];
|
|
155
155
|
|
|
156
156
|
// Mount / unmount views
|
|
157
|
-
for (
|
|
157
|
+
for (RCTUIView *view in _reactSubviews) { // TODO(macOS GH#774)
|
|
158
158
|
if (CGRectIntersectsRect(clipRect, view.frame)) {
|
|
159
159
|
// View is at least partially visible, so remount it if unmounted
|
|
160
160
|
[self addSubview:view];
|
|
@@ -203,13 +203,13 @@ using namespace facebook::react;
|
|
|
203
203
|
|
|
204
204
|
// `backgroundColor`
|
|
205
205
|
if (oldViewProps.backgroundColor != newViewProps.backgroundColor) {
|
|
206
|
-
self.backgroundColor = RCTUIColorFromSharedColor(newViewProps.backgroundColor);
|
|
206
|
+
self.backgroundColor = RCTUIColorFromSharedColor(newViewProps.backgroundColor); // TODO(macOS GH#774)
|
|
207
207
|
needsInvalidateLayer = YES;
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
// `foregroundColor`
|
|
211
211
|
if (oldViewProps.foregroundColor != newViewProps.foregroundColor) {
|
|
212
|
-
self.foregroundColor = RCTUIColorFromSharedColor(newViewProps.foregroundColor);
|
|
212
|
+
self.foregroundColor = RCTUIColorFromSharedColor(newViewProps.foregroundColor); // TODO(macOS GH#774)
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
// `shadowColor`
|
|
@@ -438,7 +438,7 @@ using namespace facebook::react;
|
|
|
438
438
|
return _propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN;
|
|
439
439
|
}
|
|
440
440
|
|
|
441
|
-
- (
|
|
441
|
+
- (RCTUIView *)betterHitTest:(CGPoint)point withEvent:(UIEvent *)event // TODO(macOS GH#774)
|
|
442
442
|
{
|
|
443
443
|
// This is a classic textbook implementation of `hitTest:` with a couple of improvements:
|
|
444
444
|
// * It does not stop algorithm if some touch is outside the view
|
|
@@ -460,8 +460,8 @@ using namespace facebook::react;
|
|
|
460
460
|
return nil;
|
|
461
461
|
}
|
|
462
462
|
|
|
463
|
-
for (
|
|
464
|
-
|
|
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)
|
|
465
465
|
if (hitView) {
|
|
466
466
|
return hitView;
|
|
467
467
|
}
|
|
@@ -470,7 +470,7 @@ using namespace facebook::react;
|
|
|
470
470
|
return isPointInside ? self : nil;
|
|
471
471
|
}
|
|
472
472
|
|
|
473
|
-
- (
|
|
473
|
+
- (RCTUIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event // TODO(macOS GH#774)
|
|
474
474
|
{
|
|
475
475
|
switch (_props->pointerEvents) {
|
|
476
476
|
case PointerEventsMode::Auto:
|
|
@@ -480,7 +480,7 @@ using namespace facebook::react;
|
|
|
480
480
|
case PointerEventsMode::BoxOnly:
|
|
481
481
|
return [self pointInside:point withEvent:event] ? self : nil;
|
|
482
482
|
case PointerEventsMode::BoxNone:
|
|
483
|
-
|
|
483
|
+
RCTUIView *view = [self betterHitTest:point withEvent:event]; // TODO(macOS GH#774)
|
|
484
484
|
return view != self ? view : nil;
|
|
485
485
|
}
|
|
486
486
|
}
|
|
@@ -662,10 +662,10 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
|
|
|
662
662
|
return self;
|
|
663
663
|
}
|
|
664
664
|
|
|
665
|
-
static NSString *RCTRecursiveAccessibilityLabel(
|
|
665
|
+
static NSString *RCTRecursiveAccessibilityLabel(RCTUIView *view) // TODO(macOS GH#774)
|
|
666
666
|
{
|
|
667
667
|
NSMutableString *result = [NSMutableString stringWithString:@""];
|
|
668
|
-
for (
|
|
668
|
+
for (RCTUIView *subview in view.subviews) { // TODO(macOS GH#774)
|
|
669
669
|
NSString *label = subview.accessibilityLabel;
|
|
670
670
|
if (!label) {
|
|
671
671
|
label = RCTRecursiveAccessibilityLabel(subview);
|