react-native-tvos 0.76.3-0 → 0.76.6-0
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/Components/Pressable/Pressable.d.ts +1 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Pressability/Pressability.js +2 -2
- package/Libraries/Text/TextInput/RCTBaseTextInputView.mm +2 -1
- package/React/Base/RCTConvert.mm +3 -1
- package/React/Base/RCTVersion.m +1 -1
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +8 -18
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +3 -0
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +17 -18
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +12 -2
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +12 -9
- package/React/Views/RCTFont.h +2 -0
- package/React/Views/RCTFont.mm +4 -5
- package/React/Views/ScrollView/RCTScrollView.h +3 -1
- package/React/Views/ScrollView/RCTScrollView.m +6 -0
- package/ReactAndroid/api/ReactAndroid.api +2 -0
- package/ReactAndroid/cmake-utils/ReactNative-application.cmake +18 -3
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/HeadlessJsTaskService.java +12 -13
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +8 -2
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +1 -7
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +1 -11
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +1 -3
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +1 -3
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +1 -12
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +1 -3
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +11 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +11 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewHelper.kt +25 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +1 -0
- package/ReactAndroid/src/main/jni/react/fabric/Binding.cpp +17 -19
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +1 -15
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +1 -4
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +1 -5
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +1 -6
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +47 -65
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +2 -4
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +1 -5
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +1 -2
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +1 -6
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +1 -3
- package/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h +2 -3
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +2 -0
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTFontUtils.mm +10 -10
- package/ReactCommon/react/renderer/uimanager/UIManager.cpp +29 -8
- package/ReactCommon/react/runtime/ReactInstance.cpp +39 -35
- package/ReactCommon/react/runtime/ReactInstance.h +2 -1
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +3 -2
- package/jest/setup.js +5 -1
- package/package.json +8 -8
- package/scripts/cocoapods/utils.rb +6 -6
- package/scripts/codegen/generate-artifacts-executor.js +68 -7
- package/sdks/hermesc/osx-bin/hermes +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +1 -6
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +1 -2
- package/types/public/ReactNativeTVTypes.d.ts +9 -7
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
import {View} from '../View/View';
|
|
21
21
|
import {AccessibilityProps} from '../View/ViewAccessibility';
|
|
22
22
|
import {ViewProps} from '../View/ViewPropTypes';
|
|
23
|
-
import {TVParallaxProperties} from '../../../types/
|
|
23
|
+
import {TVParallaxProperties} from '../../../types/index';
|
|
24
24
|
|
|
25
25
|
export interface PressableStateCallbackType {
|
|
26
26
|
readonly pressed: boolean;
|
|
@@ -440,7 +440,7 @@ export default class Pressability {
|
|
|
440
440
|
_createEventHandlers(): EventHandlers {
|
|
441
441
|
const tvPressEventHandlers = {
|
|
442
442
|
onPressIn: (evt: any): void => {
|
|
443
|
-
if (this._config.disabled ===
|
|
443
|
+
if (this._config.disabled === true) {
|
|
444
444
|
return;
|
|
445
445
|
}
|
|
446
446
|
|
|
@@ -461,7 +461,7 @@ export default class Pressability {
|
|
|
461
461
|
}, delayLongPress + delayPressIn);
|
|
462
462
|
},
|
|
463
463
|
onPressOut: (evt: any): void => {
|
|
464
|
-
if (this._config.disabled ===
|
|
464
|
+
if (this._config.disabled === true) {
|
|
465
465
|
return;
|
|
466
466
|
}
|
|
467
467
|
this._cancelLongPressDelayTimeout();
|
|
@@ -36,6 +36,7 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
|
|
36
36
|
{
|
|
37
37
|
if (![self isDescendantOfView:scrollView]) {
|
|
38
38
|
// View is outside scroll view
|
|
39
|
+
scrollView.firstResponderViewOutsideScrollView = self.backedTextInputView;
|
|
39
40
|
return;
|
|
40
41
|
}
|
|
41
42
|
|
|
@@ -460,7 +461,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
|
|
460
461
|
_maxLength.integerValue - (NSInteger)backedTextInputView.attributedText.string.length + (NSInteger)range.length,
|
|
461
462
|
0);
|
|
462
463
|
|
|
463
|
-
if (text.length >
|
|
464
|
+
if (text.length > allowedLength) {
|
|
464
465
|
// If we typed/pasted more than one character, limit the text inputted.
|
|
465
466
|
if (text.length > 1) {
|
|
466
467
|
if (allowedLength > 0) {
|
package/React/Base/RCTConvert.mm
CHANGED
|
@@ -528,17 +528,19 @@ RCT_ENUM_CONVERTER(
|
|
|
528
528
|
}),
|
|
529
529
|
NSNotFound,
|
|
530
530
|
unsignedIntegerValue)
|
|
531
|
+
#endif
|
|
531
532
|
RCT_ENUM_CONVERTER(
|
|
532
533
|
UIModalPresentationStyle,
|
|
533
534
|
(@{
|
|
534
535
|
@"fullScreen" : @(UIModalPresentationFullScreen),
|
|
536
|
+
#if !TARGET_OS_TV
|
|
535
537
|
@"pageSheet" : @(UIModalPresentationPageSheet),
|
|
536
538
|
@"formSheet" : @(UIModalPresentationFormSheet),
|
|
539
|
+
#endif
|
|
537
540
|
@"overFullScreen" : @(UIModalPresentationOverFullScreen),
|
|
538
541
|
}),
|
|
539
542
|
UIModalPresentationFullScreen,
|
|
540
543
|
integerValue)
|
|
541
|
-
#endif
|
|
542
544
|
|
|
543
545
|
RCT_ENUM_CONVERTER(
|
|
544
546
|
UIViewContentMode,
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
/**
|
|
11
11
|
* UIView class for root <ModalHostView> component.
|
|
12
12
|
*/
|
|
13
|
-
@interface RCTModalHostViewComponentView : RCTViewComponentView
|
|
13
|
+
@interface RCTModalHostViewComponentView : RCTViewComponentView <UIAdaptivePresentationControllerDelegate>
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Subclasses may override this method and present the modal on different view controller.
|
|
@@ -189,9 +189,7 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
|
|
|
189
189
|
completion:(void (^)(void))completion
|
|
190
190
|
{
|
|
191
191
|
UIViewController *controller = [self reactViewController];
|
|
192
|
-
[
|
|
193
|
-
animated:animated
|
|
194
|
-
completion:completion];
|
|
192
|
+
[controller presentViewController:modalViewController animated:animated completion:completion];
|
|
195
193
|
}
|
|
196
194
|
|
|
197
195
|
- (void)dismissViewController:(UIViewController *)modalViewController
|
|
@@ -206,6 +204,8 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
|
|
|
206
204
|
{
|
|
207
205
|
BOOL shouldBePresented = !_isPresented && _shouldPresent && self.window;
|
|
208
206
|
if (shouldBePresented) {
|
|
207
|
+
self.viewController.presentationController.delegate = self;
|
|
208
|
+
|
|
209
209
|
_isPresented = YES;
|
|
210
210
|
[self presentViewController:self.viewController
|
|
211
211
|
animated:_shouldAnimatePresentation
|
|
@@ -331,24 +331,14 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
|
|
|
331
331
|
[childComponentView removeFromSuperview];
|
|
332
332
|
}
|
|
333
333
|
|
|
334
|
-
#pragma mark -
|
|
334
|
+
#pragma mark - UIAdaptivePresentationControllerDelegate
|
|
335
335
|
|
|
336
|
-
- (
|
|
336
|
+
- (void)presentationControllerDidAttemptToDismiss:(UIPresentationController *)controller
|
|
337
337
|
{
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
}
|
|
342
|
-
if ([topController isKindOfClass:[UINavigationController class]]) {
|
|
343
|
-
UINavigationController *navigationController = (UINavigationController *)topController;
|
|
344
|
-
topController = navigationController.visibleViewController;
|
|
345
|
-
return [self _topMostViewControllerFrom:topController];
|
|
346
|
-
} else if ([topController isKindOfClass:[UITabBarController class]]) {
|
|
347
|
-
UITabBarController *tabBarController = (UITabBarController *)topController;
|
|
348
|
-
topController = tabBarController.selectedViewController;
|
|
349
|
-
return [self _topMostViewControllerFrom:topController];
|
|
338
|
+
auto eventEmitter = [self modalEventEmitter];
|
|
339
|
+
if (eventEmitter) {
|
|
340
|
+
eventEmitter->onRequestClose({});
|
|
350
341
|
}
|
|
351
|
-
return topController;
|
|
352
342
|
}
|
|
353
343
|
|
|
354
344
|
@end
|
|
@@ -38,6 +38,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
38
38
|
/** Focus area of newly-activated text input relative to the window to compare against UIKeyboardFrameBegin/End */
|
|
39
39
|
@property (nonatomic, assign) CGRect firstResponderFocus;
|
|
40
40
|
|
|
41
|
+
/** newly-activated text input outside of the scroll view */
|
|
42
|
+
@property (nonatomic, weak) UIView *firstResponderViewOutsideScrollView;
|
|
43
|
+
|
|
41
44
|
/*
|
|
42
45
|
* Returns the subview of the scroll view that the component uses to mount all subcomponents into. That's useful to
|
|
43
46
|
* separate component views from auxiliary views to be able to reliably implement pull-to-refresh- and RTL-related
|
|
@@ -194,16 +194,18 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInt
|
|
|
194
194
|
UIViewAnimationCurve curve =
|
|
195
195
|
(UIViewAnimationCurve)[notification.userInfo[UIKeyboardAnimationCurveUserInfoKey] unsignedIntegerValue];
|
|
196
196
|
CGRect keyboardEndFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
|
|
197
|
+
CGRect keyboardBeginFrame = [notification.userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue];
|
|
197
198
|
|
|
198
199
|
CGPoint absoluteViewOrigin = [self convertPoint:self.bounds.origin toView:nil];
|
|
199
200
|
CGFloat scrollViewLowerY = isInverted ? absoluteViewOrigin.y : absoluteViewOrigin.y + self.bounds.size.height;
|
|
200
201
|
|
|
201
202
|
UIEdgeInsets newEdgeInsets = _scrollView.contentInset;
|
|
202
203
|
CGFloat inset = MAX(scrollViewLowerY - keyboardEndFrame.origin.y, 0);
|
|
204
|
+
const auto &props = static_cast<const ScrollViewProps &>(*_props);
|
|
203
205
|
if (isInverted) {
|
|
204
|
-
newEdgeInsets.top = MAX(inset,
|
|
206
|
+
newEdgeInsets.top = MAX(inset, props.contentInset.top);
|
|
205
207
|
} else {
|
|
206
|
-
newEdgeInsets.bottom = MAX(inset,
|
|
208
|
+
newEdgeInsets.bottom = MAX(inset, props.contentInset.bottom);
|
|
207
209
|
}
|
|
208
210
|
|
|
209
211
|
CGPoint newContentOffset = _scrollView.contentOffset;
|
|
@@ -215,21 +217,18 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInt
|
|
|
215
217
|
from:self
|
|
216
218
|
forEvent:nil]) {
|
|
217
219
|
if (CGRectEqualToRect(_firstResponderFocus, CGRectNull)) {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
if (focusEnd > keyboardEndFrame.origin.y) {
|
|
231
|
-
// Text field active region is below visible area with keyboard - update diff to bring into view
|
|
232
|
-
contentDiff = keyboardEndFrame.origin.y - focusEnd;
|
|
220
|
+
UIView *inputAccessoryView = _firstResponderViewOutsideScrollView.inputAccessoryView;
|
|
221
|
+
if (inputAccessoryView) {
|
|
222
|
+
// Text input view is within the inputAccessoryView.
|
|
223
|
+
contentDiff = keyboardEndFrame.origin.y - keyboardBeginFrame.origin.y;
|
|
224
|
+
}
|
|
225
|
+
} else {
|
|
226
|
+
// Inner text field focused
|
|
227
|
+
CGFloat focusEnd = CGRectGetMaxY(self.firstResponderFocus);
|
|
228
|
+
if (focusEnd > keyboardEndFrame.origin.y) {
|
|
229
|
+
// Text field active region is below visible area with keyboard - update diff to bring into view
|
|
230
|
+
contentDiff = keyboardEndFrame.origin.y - focusEnd;
|
|
231
|
+
}
|
|
233
232
|
}
|
|
234
233
|
}
|
|
235
234
|
|
|
@@ -255,7 +254,7 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInt
|
|
|
255
254
|
animations:^{
|
|
256
255
|
self->_scrollView.contentInset = newEdgeInsets;
|
|
257
256
|
self->_scrollView.verticalScrollIndicatorInsets = newEdgeInsets;
|
|
258
|
-
[self
|
|
257
|
+
[self scrollTo:newContentOffset.x y:newContentOffset.y animated:NO];
|
|
259
258
|
}
|
|
260
259
|
completion:nil];
|
|
261
260
|
}
|
|
@@ -99,9 +99,11 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
|
|
99
99
|
NSMutableDictionary<NSAttributedStringKey, id> *defaultAttributes =
|
|
100
100
|
[_backedTextInputView.defaultTextAttributes mutableCopy];
|
|
101
101
|
|
|
102
|
+
#if !TARGET_OS_MACCATALYST
|
|
102
103
|
RCTWeakEventEmitterWrapper *eventEmitterWrapper = [RCTWeakEventEmitterWrapper new];
|
|
103
104
|
eventEmitterWrapper.eventEmitter = _eventEmitter;
|
|
104
105
|
defaultAttributes[RCTAttributedStringEventEmitterKey] = eventEmitterWrapper;
|
|
106
|
+
#endif
|
|
105
107
|
|
|
106
108
|
_backedTextInputView.defaultTextAttributes = defaultAttributes;
|
|
107
109
|
}
|
|
@@ -126,6 +128,7 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
|
|
126
128
|
{
|
|
127
129
|
if (![self isDescendantOfView:scrollView.scrollView] || !_backedTextInputView.isFirstResponder) {
|
|
128
130
|
// View is outside scroll view or it's not a first responder.
|
|
131
|
+
scrollView.firstResponderViewOutsideScrollView = _backedTextInputView;
|
|
129
132
|
return;
|
|
130
133
|
}
|
|
131
134
|
|
|
@@ -260,8 +263,10 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
|
|
260
263
|
if (newTextInputProps.textAttributes != oldTextInputProps.textAttributes) {
|
|
261
264
|
NSMutableDictionary<NSAttributedStringKey, id> *defaultAttributes =
|
|
262
265
|
RCTNSTextAttributesFromTextAttributes(newTextInputProps.getEffectiveTextAttributes(RCTFontSizeMultiplier()));
|
|
266
|
+
#if !TARGET_OS_MACCATALYST
|
|
263
267
|
defaultAttributes[RCTAttributedStringEventEmitterKey] =
|
|
264
268
|
_backedTextInputView.defaultTextAttributes[RCTAttributedStringEventEmitterKey];
|
|
269
|
+
#endif
|
|
265
270
|
_backedTextInputView.defaultTextAttributes = defaultAttributes;
|
|
266
271
|
}
|
|
267
272
|
|
|
@@ -443,10 +448,15 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
|
|
443
448
|
|
|
444
449
|
- (void)textInputDidChangeSelection
|
|
445
450
|
{
|
|
446
|
-
[self _updateTypingAttributes];
|
|
447
451
|
if (_comingFromJS) {
|
|
448
452
|
return;
|
|
449
453
|
}
|
|
454
|
+
|
|
455
|
+
// T207198334: Setting a new AttributedString (_comingFromJS) will trigger a selection change before the backing
|
|
456
|
+
// string is updated, so indicies won't point to what we want yet. Only respond to user selection change, and let
|
|
457
|
+
// `_setAttributedString` handle updating typing attributes if content changes.
|
|
458
|
+
[self _updateTypingAttributes];
|
|
459
|
+
|
|
450
460
|
const auto &props = static_cast<const TextInputProps &>(*_props);
|
|
451
461
|
if (props.traits.multiline && ![_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) {
|
|
452
462
|
[self textInputDidChange];
|
|
@@ -716,7 +726,7 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
|
|
716
726
|
// https://github.com/facebook/react-native/blob/3102a58df38d96f3dacef0530e4dbb399037fcd2/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/SetSpanOperation.kt#L30
|
|
717
727
|
- (void)_updateTypingAttributes
|
|
718
728
|
{
|
|
719
|
-
if (_backedTextInputView.attributedText.length > 0) {
|
|
729
|
+
if (_backedTextInputView.attributedText.length > 0 && _backedTextInputView.selectedTextRange != nil) {
|
|
720
730
|
NSUInteger offsetStart = [_backedTextInputView offsetFromPosition:_backedTextInputView.beginningOfDocument
|
|
721
731
|
toPosition:_backedTextInputView.selectedTextRange.start];
|
|
722
732
|
|
|
@@ -1656,15 +1656,10 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
|
|
|
1656
1656
|
}
|
|
1657
1657
|
|
|
1658
1658
|
// clipping
|
|
1659
|
+
self.currentContainerView.layer.mask = nil;
|
|
1659
1660
|
if (self.currentContainerView.clipsToBounds) {
|
|
1660
1661
|
BOOL clipToPaddingBox = ReactNativeFeatureFlags::enableIOSViewClipToPaddingBox();
|
|
1661
|
-
if (clipToPaddingBox) {
|
|
1662
|
-
CALayer *maskLayer = [self createMaskLayer:RCTCGRectFromRect(_layoutMetrics.getPaddingFrame())
|
|
1663
|
-
cornerInsets:RCTGetCornerInsets(
|
|
1664
|
-
RCTCornerRadiiFromBorderRadii(borderMetrics.borderRadii),
|
|
1665
|
-
RCTUIEdgeInsetsFromEdgeInsets(borderMetrics.borderWidths))];
|
|
1666
|
-
self.currentContainerView.layer.mask = maskLayer;
|
|
1667
|
-
} else {
|
|
1662
|
+
if (!clipToPaddingBox) {
|
|
1668
1663
|
if (borderMetrics.borderRadii.isUniform()) {
|
|
1669
1664
|
self.currentContainerView.layer.cornerRadius = borderMetrics.borderRadii.topLeft.horizontal;
|
|
1670
1665
|
} else {
|
|
@@ -1686,9 +1681,17 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
|
|
|
1686
1681
|
subview.layer.mask = [self createMaskLayer:subview.bounds cornerInsets:cornerInsets];
|
|
1687
1682
|
}
|
|
1688
1683
|
}
|
|
1684
|
+
} else if (
|
|
1685
|
+
!borderMetrics.borderWidths.isUniform() || borderMetrics.borderWidths.left != 0 ||
|
|
1686
|
+
!borderMetrics.borderRadii.isUniform()) {
|
|
1687
|
+
CALayer *maskLayer = [self createMaskLayer:RCTCGRectFromRect(_layoutMetrics.getPaddingFrame())
|
|
1688
|
+
cornerInsets:RCTGetCornerInsets(
|
|
1689
|
+
RCTCornerRadiiFromBorderRadii(borderMetrics.borderRadii),
|
|
1690
|
+
RCTUIEdgeInsetsFromEdgeInsets(borderMetrics.borderWidths))];
|
|
1691
|
+
self.currentContainerView.layer.mask = maskLayer;
|
|
1692
|
+
} else {
|
|
1693
|
+
self.currentContainerView.layer.cornerRadius = borderMetrics.borderRadii.topLeft.horizontal;
|
|
1689
1694
|
}
|
|
1690
|
-
} else {
|
|
1691
|
-
self.currentContainerView.layer.mask = nil;
|
|
1692
1695
|
}
|
|
1693
1696
|
}
|
|
1694
1697
|
|
package/React/Views/RCTFont.h
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
#import <React/RCTConvert.h>
|
|
11
11
|
|
|
12
12
|
typedef UIFont * (^RCTFontHandler)(CGFloat fontSize, NSString *fontWeightDescription);
|
|
13
|
+
typedef CGFloat RCTFontWeight;
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* React Native will use the System font for rendering by default. If you want to
|
|
@@ -19,6 +20,7 @@ typedef UIFont * (^RCTFontHandler)(CGFloat fontSize, NSString *fontWeightDescrip
|
|
|
19
20
|
*/
|
|
20
21
|
RCT_EXTERN void RCTSetDefaultFontHandler(RCTFontHandler handler);
|
|
21
22
|
RCT_EXTERN BOOL RCTHasFontHandlerSet(void);
|
|
23
|
+
RCT_EXTERN RCTFontWeight RCTGetFontWeight(UIFont *font);
|
|
22
24
|
|
|
23
25
|
@interface RCTFont : NSObject
|
|
24
26
|
|
package/React/Views/RCTFont.mm
CHANGED
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
#import <CoreText/CoreText.h>
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
static RCTFontWeight weightOfFont(UIFont *font)
|
|
14
|
+
RCTFontWeight RCTGetFontWeight(UIFont *font)
|
|
16
15
|
{
|
|
17
16
|
static NSArray<NSString *> *weightSuffixes;
|
|
18
17
|
static NSArray<NSNumber *> *fontWeights;
|
|
@@ -405,7 +404,7 @@ RCT_ARRAY_CONVERTER(RCTFontVariantDescriptor)
|
|
|
405
404
|
if (font) {
|
|
406
405
|
familyName = font.familyName ?: defaultFontFamily;
|
|
407
406
|
fontSize = font.pointSize ?: defaultFontSize;
|
|
408
|
-
fontWeight =
|
|
407
|
+
fontWeight = RCTGetFontWeight(font);
|
|
409
408
|
isItalic = isItalicFont(font);
|
|
410
409
|
isCondensed = isCondensedFont(font);
|
|
411
410
|
}
|
|
@@ -453,7 +452,7 @@ RCT_ARRAY_CONVERTER(RCTFontVariantDescriptor)
|
|
|
453
452
|
// It's actually a font name, not a font family name,
|
|
454
453
|
// but we'll do what was meant, not what was said.
|
|
455
454
|
familyName = font.familyName;
|
|
456
|
-
fontWeight = weight ? fontWeight :
|
|
455
|
+
fontWeight = weight ? fontWeight : RCTGetFontWeight(font);
|
|
457
456
|
isItalic = style ? isItalic : isItalicFont(font);
|
|
458
457
|
isCondensed = isCondensedFont(font);
|
|
459
458
|
} else {
|
|
@@ -476,7 +475,7 @@ RCT_ARRAY_CONVERTER(RCTFontVariantDescriptor)
|
|
|
476
475
|
for (NSString *name in names) {
|
|
477
476
|
UIFont *match = [UIFont fontWithName:name size:fontSize];
|
|
478
477
|
if (isItalic == isItalicFont(match) && isCondensed == isCondensedFont(match)) {
|
|
479
|
-
CGFloat testWeight =
|
|
478
|
+
CGFloat testWeight = RCTGetFontWeight(match);
|
|
480
479
|
if (ABS(testWeight - fontWeight) < ABS(closestWeight - fontWeight)) {
|
|
481
480
|
font = match;
|
|
482
481
|
closestWeight = testWeight;
|
|
@@ -56,9 +56,11 @@
|
|
|
56
56
|
@property (nonatomic, assign) BOOL snapToEnd;
|
|
57
57
|
@property (nonatomic, copy) NSString *snapToAlignment;
|
|
58
58
|
@property (nonatomic, assign) BOOL inverted;
|
|
59
|
+
@property (nonatomic, assign) BOOL showsScrollIndex;
|
|
59
60
|
/** Focus area of newly-activated text input relative to the window to compare against UIKeyboardFrameBegin/End */
|
|
60
61
|
@property (nonatomic, assign) CGRect firstResponderFocus;
|
|
61
|
-
|
|
62
|
+
/** newly-activated text input outside of the scroll view */
|
|
63
|
+
@property (nonatomic, weak) UIView *firstResponderViewOutsideScrollView;
|
|
62
64
|
|
|
63
65
|
// NOTE: currently these event props are only declared so we can export the
|
|
64
66
|
// event names to JS - we don't call the blocks directly because scroll events
|
|
@@ -363,6 +363,12 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
|
|
|
363
363
|
if (!didFocusExternalTextField && focusEnd > endFrame.origin.y) {
|
|
364
364
|
// Text field active region is below visible area with keyboard - update diff to bring into view
|
|
365
365
|
contentDiff = endFrame.origin.y - focusEnd;
|
|
366
|
+
} else {
|
|
367
|
+
UIView *inputAccessoryView = _firstResponderViewOutsideScrollView.inputAccessoryView;
|
|
368
|
+
if (inputAccessoryView) {
|
|
369
|
+
// Text input view is within the inputAccessoryView.
|
|
370
|
+
contentDiff = endFrame.origin.y - beginFrame.origin.y;
|
|
371
|
+
}
|
|
366
372
|
}
|
|
367
373
|
} else if (endFrame.origin.y <= beginFrame.origin.y) {
|
|
368
374
|
// Keyboard opened for other reason
|
|
@@ -7280,6 +7280,8 @@ public final class com/facebook/react/views/scroll/ReactScrollViewHelper {
|
|
|
7280
7280
|
public static final field SNAP_ALIGNMENT_END I
|
|
7281
7281
|
public static final field SNAP_ALIGNMENT_START I
|
|
7282
7282
|
public static final fun addScrollListener (Lcom/facebook/react/views/scroll/ReactScrollViewHelper$ScrollListener;)V
|
|
7283
|
+
public static final fun dispatchMomentumEndOnAnimationEnd (Landroid/view/ViewGroup;)V
|
|
7284
|
+
public static final fun emitLayoutChangeEvent (Landroid/view/ViewGroup;)V
|
|
7283
7285
|
public static final fun emitLayoutEvent (Landroid/view/ViewGroup;)V
|
|
7284
7286
|
public static final fun emitScrollBeginDragEvent (Landroid/view/ViewGroup;)V
|
|
7285
7287
|
public static final fun emitScrollEndDragEvent (Landroid/view/ViewGroup;FF)V
|
|
@@ -34,9 +34,24 @@ set(BUILD_DIR ${PROJECT_BUILD_DIR})
|
|
|
34
34
|
file(TO_CMAKE_PATH "${BUILD_DIR}" BUILD_DIR)
|
|
35
35
|
file(TO_CMAKE_PATH "${REACT_ANDROID_DIR}" REACT_ANDROID_DIR)
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
if (PROJECT_ROOT_DIR)
|
|
38
|
+
# This empty `if` is just to silence a CMake warning and make sure the `PROJECT_ROOT_DIR`
|
|
39
|
+
# variable is defined if user need to access it.
|
|
40
|
+
endif ()
|
|
41
|
+
|
|
42
|
+
file(GLOB override_cpp_SRC CONFIGURE_DEPENDS *.cpp)
|
|
43
|
+
# We check if the user is providing a custom OnLoad.cpp file. If so, we pick that
|
|
44
|
+
# for compilation. Otherwise we fallback to using the `default-app-setup/OnLoad.cpp`
|
|
45
|
+
# file instead.
|
|
46
|
+
if(override_cpp_SRC)
|
|
47
|
+
file(GLOB input_SRC CONFIGURE_DEPENDS
|
|
48
|
+
*.cpp
|
|
49
|
+
${BUILD_DIR}/generated/autolinking/src/main/jni/*.cpp)
|
|
50
|
+
else()
|
|
51
|
+
file(GLOB input_SRC CONFIGURE_DEPENDS
|
|
52
|
+
${REACT_ANDROID_DIR}/cmake-utils/default-app-setup/*.cpp
|
|
53
|
+
${BUILD_DIR}/generated/autolinking/src/main/jni/*.cpp)
|
|
54
|
+
endif()
|
|
40
55
|
|
|
41
56
|
add_library(${CMAKE_PROJECT_NAME} SHARED ${input_SRC})
|
|
42
57
|
|
|
@@ -179,31 +179,30 @@ public abstract class HeadlessJsTaskService extends Service implements HeadlessJ
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
private void createReactContextAndScheduleTask(final HeadlessJsTaskConfig taskConfig) {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
final ReactInstanceManager reactInstanceManager =
|
|
186
|
-
getReactNativeHost().getReactInstanceManager();
|
|
187
|
-
|
|
188
|
-
reactInstanceManager.addReactInstanceEventListener(
|
|
182
|
+
if (ReactFeatureFlags.enableBridgelessArchitecture) {
|
|
183
|
+
final ReactHost reactHost = getReactHost();
|
|
184
|
+
reactHost.addReactInstanceEventListener(
|
|
189
185
|
new ReactInstanceEventListener() {
|
|
190
186
|
@Override
|
|
191
187
|
public void onReactContextInitialized(@NonNull ReactContext reactContext) {
|
|
192
188
|
invokeStartTask(reactContext, taskConfig);
|
|
193
|
-
|
|
189
|
+
reactHost.removeReactInstanceEventListener(this);
|
|
194
190
|
}
|
|
195
191
|
});
|
|
196
|
-
|
|
197
|
-
} else {
|
|
198
|
-
|
|
192
|
+
reactHost.start();
|
|
193
|
+
} else {
|
|
194
|
+
final ReactInstanceManager reactInstanceManager =
|
|
195
|
+
getReactNativeHost().getReactInstanceManager();
|
|
196
|
+
|
|
197
|
+
reactInstanceManager.addReactInstanceEventListener(
|
|
199
198
|
new ReactInstanceEventListener() {
|
|
200
199
|
@Override
|
|
201
200
|
public void onReactContextInitialized(@NonNull ReactContext reactContext) {
|
|
202
201
|
invokeStartTask(reactContext, taskConfig);
|
|
203
|
-
|
|
202
|
+
reactInstanceManager.removeReactInstanceEventListener(this);
|
|
204
203
|
}
|
|
205
204
|
});
|
|
206
|
-
|
|
205
|
+
reactInstanceManager.createReactContextInBackground();
|
|
207
206
|
}
|
|
208
207
|
}
|
|
209
208
|
}
|
|
@@ -449,12 +449,18 @@ public class FabricUIManager
|
|
|
449
449
|
|
|
450
450
|
@Override
|
|
451
451
|
public void markActiveTouchForTag(int surfaceId, int reactTag) {
|
|
452
|
-
mMountingManager.getSurfaceManager(surfaceId)
|
|
452
|
+
SurfaceMountingManager surfaceMountingManager = mMountingManager.getSurfaceManager(surfaceId);
|
|
453
|
+
if (surfaceMountingManager != null) {
|
|
454
|
+
surfaceMountingManager.markActiveTouchForTag(reactTag);
|
|
455
|
+
}
|
|
453
456
|
}
|
|
454
457
|
|
|
455
458
|
@Override
|
|
456
459
|
public void sweepActiveTouchForTag(int surfaceId, int reactTag) {
|
|
457
|
-
mMountingManager.getSurfaceManager(surfaceId)
|
|
460
|
+
SurfaceMountingManager surfaceMountingManager = mMountingManager.getSurfaceManager(surfaceId);
|
|
461
|
+
if (surfaceMountingManager != null) {
|
|
462
|
+
surfaceMountingManager.sweepActiveTouchForTag(reactTag);
|
|
463
|
+
}
|
|
458
464
|
}
|
|
459
465
|
|
|
460
466
|
/**
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<89491eb63a7ca59b17419ed4432a4f88>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -34,12 +34,6 @@ public object ReactNativeFeatureFlags {
|
|
|
34
34
|
@JvmStatic
|
|
35
35
|
public fun commonTestFlag(): Boolean = accessor.commonTestFlag()
|
|
36
36
|
|
|
37
|
-
/**
|
|
38
|
-
* Adds support for recursively processing commits that mount synchronously (Android only).
|
|
39
|
-
*/
|
|
40
|
-
@JvmStatic
|
|
41
|
-
public fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean = accessor.allowRecursiveCommitsWithSynchronousMountOnAndroid()
|
|
42
|
-
|
|
43
37
|
/**
|
|
44
38
|
* When enabled, the RuntimeScheduler processing the event loop will batch all rendering updates and dispatch them together at the end of each iteration of the loop.
|
|
45
39
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<9f741ec3df7cd5ecd8d5c3c099c86aba>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -21,7 +21,6 @@ package com.facebook.react.internal.featureflags
|
|
|
21
21
|
|
|
22
22
|
public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccessor {
|
|
23
23
|
private var commonTestFlagCache: Boolean? = null
|
|
24
|
-
private var allowRecursiveCommitsWithSynchronousMountOnAndroidCache: Boolean? = null
|
|
25
24
|
private var batchRenderingUpdatesInEventLoopCache: Boolean? = null
|
|
26
25
|
private var completeReactInstanceCreationOnBgThreadOnAndroidCache: Boolean? = null
|
|
27
26
|
private var destroyFabricSurfacesInReactInstanceManagerCache: Boolean? = null
|
|
@@ -78,15 +77,6 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
|
|
|
78
77
|
return cached
|
|
79
78
|
}
|
|
80
79
|
|
|
81
|
-
override fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean {
|
|
82
|
-
var cached = allowRecursiveCommitsWithSynchronousMountOnAndroidCache
|
|
83
|
-
if (cached == null) {
|
|
84
|
-
cached = ReactNativeFeatureFlagsCxxInterop.allowRecursiveCommitsWithSynchronousMountOnAndroid()
|
|
85
|
-
allowRecursiveCommitsWithSynchronousMountOnAndroidCache = cached
|
|
86
|
-
}
|
|
87
|
-
return cached
|
|
88
|
-
}
|
|
89
|
-
|
|
90
80
|
override fun batchRenderingUpdatesInEventLoop(): Boolean {
|
|
91
81
|
var cached = batchRenderingUpdatesInEventLoopCache
|
|
92
82
|
if (cached == null) {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<774337b6aee6f528b0852704271ed96f>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -30,8 +30,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
|
|
30
30
|
|
|
31
31
|
@DoNotStrip @JvmStatic public external fun commonTestFlag(): Boolean
|
|
32
32
|
|
|
33
|
-
@DoNotStrip @JvmStatic public external fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean
|
|
34
|
-
|
|
35
33
|
@DoNotStrip @JvmStatic public external fun batchRenderingUpdatesInEventLoop(): Boolean
|
|
36
34
|
|
|
37
35
|
@DoNotStrip @JvmStatic public external fun completeReactInstanceCreationOnBgThreadOnAndroid(): Boolean
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<43c4ba7a6c4f5a12ada181c081f91bfc>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -25,8 +25,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
|
|
25
25
|
|
|
26
26
|
override fun commonTestFlag(): Boolean = false
|
|
27
27
|
|
|
28
|
-
override fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean = false
|
|
29
|
-
|
|
30
28
|
override fun batchRenderingUpdatesInEventLoop(): Boolean = false
|
|
31
29
|
|
|
32
30
|
override fun completeReactInstanceCreationOnBgThreadOnAndroid(): Boolean = false
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<0ca6ebf7ef1418d721b6f183f89b96a2>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -25,7 +25,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
|
|
|
25
25
|
private val accessedFeatureFlags = mutableSetOf<String>()
|
|
26
26
|
|
|
27
27
|
private var commonTestFlagCache: Boolean? = null
|
|
28
|
-
private var allowRecursiveCommitsWithSynchronousMountOnAndroidCache: Boolean? = null
|
|
29
28
|
private var batchRenderingUpdatesInEventLoopCache: Boolean? = null
|
|
30
29
|
private var completeReactInstanceCreationOnBgThreadOnAndroidCache: Boolean? = null
|
|
31
30
|
private var destroyFabricSurfacesInReactInstanceManagerCache: Boolean? = null
|
|
@@ -83,16 +82,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
|
|
|
83
82
|
return cached
|
|
84
83
|
}
|
|
85
84
|
|
|
86
|
-
override fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean {
|
|
87
|
-
var cached = allowRecursiveCommitsWithSynchronousMountOnAndroidCache
|
|
88
|
-
if (cached == null) {
|
|
89
|
-
cached = currentProvider.allowRecursiveCommitsWithSynchronousMountOnAndroid()
|
|
90
|
-
accessedFeatureFlags.add("allowRecursiveCommitsWithSynchronousMountOnAndroid")
|
|
91
|
-
allowRecursiveCommitsWithSynchronousMountOnAndroidCache = cached
|
|
92
|
-
}
|
|
93
|
-
return cached
|
|
94
|
-
}
|
|
95
|
-
|
|
96
85
|
override fun batchRenderingUpdatesInEventLoop(): Boolean {
|
|
97
86
|
var cached = batchRenderingUpdatesInEventLoopCache
|
|
98
87
|
if (cached == null) {
|