react-native-tvos 0.76.1-0 → 0.76.2-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/AppDelegate/React-RCTAppDelegate.podspec +1 -1
- package/Libraries/Components/Pressable/Pressable.d.ts +9 -1
- package/Libraries/Components/Pressable/Pressable.js +4 -16
- package/Libraries/Components/TV/TVViewPropTypes.js +2 -1
- package/Libraries/Components/TextInput/TextInput.d.ts +1 -1
- package/Libraries/Components/Touchable/Touchable.js +0 -43
- package/Libraries/Components/Touchable/TouchableBounce.js +0 -33
- package/Libraries/Components/Touchable/TouchableHighlight.js +12 -47
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +0 -33
- package/Libraries/Components/Touchable/TouchableOpacity.js +12 -44
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +0 -19
- package/Libraries/Components/View/ViewNativeComponent.js +6 -0
- package/Libraries/Components/View/ViewPropTypes.d.ts +12 -1
- package/Libraries/Components/View/ViewPropTypes.js +7 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpErrorHandling.js +1 -7
- package/Libraries/LogBox/Data/LogBoxData.js +2 -2
- package/Libraries/NativeComponent/BaseViewConfig.android.js +19 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +6 -0
- package/Libraries/NativeComponent/TVViewConfig.js +4 -0
- package/Libraries/Pressability/Pressability.js +45 -28
- package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +1 -0
- package/Libraries/Types/CoreEventTypes.d.ts +21 -0
- package/Libraries/Types/CoreEventTypes.js +6 -0
- package/README.md +9 -7
- package/React/Base/RCTTVRemoteHandler.m +0 -19
- package/React/Base/RCTTVRemoteSelectHandler.h +27 -0
- package/React/Base/RCTTVRemoteSelectHandler.m +120 -0
- package/React/Base/RCTVersion.m +1 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +12 -8
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +47 -3
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h +8 -0
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +51 -44
- package/React/Views/RCTTVView.h +19 -6
- package/React/Views/RCTTVView.m +63 -55
- package/React/Views/RCTViewManager.m +4 -0
- package/React/Views/ScrollView/RCTScrollView.m +12 -8
- package/ReactAndroid/api/ReactAndroid.api +0 -1
- package/ReactAndroid/cmake-utils/ReactNative-application.cmake +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/TimingModule.kt +0 -8
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +16 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java +20 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/BlurEvent.kt +16 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FocusEvent.kt +16 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/PressInEvent.kt +16 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/PressOutEvent.kt +16 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt +11 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +212 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.java +47 -4
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/react/renderer/components/textinput/platform/ios/react/renderer/components/iostextinput/TextInputShadowNode.cpp +3 -2
- package/ReactCommon/react/renderer/components/view/BaseViewEventEmitter.cpp +18 -0
- package/ReactCommon/react/renderer/components/view/BaseViewEventEmitter.h +8 -0
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h +12 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +165 -2
- package/cli.js +1 -1
- package/index.js +0 -4
- package/package.json +8 -8
- package/scripts/codegen/generate-artifacts-executor.js +3 -3
- package/sdks/.hermesversion +1 -1
- 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/types/modules/Codegen.d.ts +6 -0
- package/types/public/ReactNativeTVTypes.d.ts +2 -2
- package/Libraries/Components/TabBarIOS/RCTTabBarItemNativeComponent.js +0 -99
- package/Libraries/Components/TabBarIOS/RCTTabBarNativeComponent.js +0 -32
- package/Libraries/Components/TabBarIOS/TabBarIOS.ios.js +0 -59
- package/Libraries/Components/TabBarIOS/TabBarIOS.js +0 -52
- package/Libraries/Components/TabBarIOS/TabBarIOSProps.js +0 -52
- package/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js +0 -177
- package/Libraries/Components/TabBarIOS/TabBarItemIOS.js +0 -55
- package/Libraries/Components/Touchable/TVTouchable.js +0 -71
- package/React/Views/RCTTabBar.h +0 -22
- package/React/Views/RCTTabBar.m +0 -237
- package/React/Views/RCTTabBarItem.h +0 -35
- package/React/Views/RCTTabBarItem.m +0 -139
- package/React/Views/RCTTabBarItemManager.h +0 -12
- package/React/Views/RCTTabBarItemManager.m +0 -38
- package/React/Views/RCTTabBarManager.h +0 -12
- package/React/Views/RCTTabBarManager.m +0 -81
|
@@ -35,6 +35,24 @@ using namespace facebook::react;
|
|
|
35
35
|
_weakEventEmitter.reset();
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
- (BOOL)isEqual:(id)object
|
|
39
|
+
{
|
|
40
|
+
// We consider the underlying EventEmitter as the identity
|
|
41
|
+
if (![object isKindOfClass:[self class]]) {
|
|
42
|
+
return NO;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
auto thisEventEmitter = [self eventEmitter];
|
|
46
|
+
auto otherEventEmitter = [((RCTWeakEventEmitterWrapper *)object) eventEmitter];
|
|
47
|
+
return thisEventEmitter == otherEventEmitter;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
- (NSUInteger)hash
|
|
51
|
+
{
|
|
52
|
+
// We consider the underlying EventEmitter as the identity
|
|
53
|
+
return (NSUInteger)_weakEventEmitter.lock().get();
|
|
54
|
+
}
|
|
55
|
+
|
|
38
56
|
@end
|
|
39
57
|
|
|
40
58
|
inline static UIFontWeight RCTUIFontWeightFromInteger(NSInteger fontWeight)
|
|
@@ -182,7 +200,8 @@ inline static UIColor *RCTEffectiveBackgroundColorFromTextAttributes(const TextA
|
|
|
182
200
|
return effectiveBackgroundColor ?: [UIColor clearColor];
|
|
183
201
|
}
|
|
184
202
|
|
|
185
|
-
|
|
203
|
+
NSMutableDictionary<NSAttributedStringKey, id> *RCTNSTextAttributesFromTextAttributes(
|
|
204
|
+
const TextAttributes &textAttributes)
|
|
186
205
|
{
|
|
187
206
|
NSMutableDictionary<NSAttributedStringKey, id> *attributes = [NSMutableDictionary dictionaryWithCapacity:10];
|
|
188
207
|
|
|
@@ -306,7 +325,7 @@ NSDictionary<NSAttributedStringKey, id> *RCTNSTextAttributesFromTextAttributes(c
|
|
|
306
325
|
attributes[RCTTextAttributesAccessibilityRoleAttributeName] = [NSString stringWithUTF8String:roleStr.c_str()];
|
|
307
326
|
}
|
|
308
327
|
|
|
309
|
-
return
|
|
328
|
+
return attributes;
|
|
310
329
|
}
|
|
311
330
|
|
|
312
331
|
void RCTApplyBaselineOffset(NSMutableAttributedString *attributedText)
|
|
@@ -470,3 +489,147 @@ NSString *RCTNSStringFromStringApplyingTextTransform(NSString *string, TextTrans
|
|
|
470
489
|
return string;
|
|
471
490
|
}
|
|
472
491
|
}
|
|
492
|
+
|
|
493
|
+
static BOOL RCTIsParagraphStyleEffectivelySame(
|
|
494
|
+
NSParagraphStyle *style1,
|
|
495
|
+
NSParagraphStyle *style2,
|
|
496
|
+
const TextAttributes &baseTextAttributes)
|
|
497
|
+
{
|
|
498
|
+
if (style1 == nil || style2 == nil) {
|
|
499
|
+
return style1 == nil && style2 == nil;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
// The NSParagraphStyle included as part of typingAttributes may eventually resolve "natural" directions to
|
|
503
|
+
// physical direction, so we should compare resolved directions
|
|
504
|
+
auto naturalAlignment =
|
|
505
|
+
baseTextAttributes.layoutDirection.value_or(LayoutDirection::LeftToRight) == LayoutDirection::LeftToRight
|
|
506
|
+
? NSTextAlignmentLeft
|
|
507
|
+
: NSTextAlignmentRight;
|
|
508
|
+
|
|
509
|
+
NSWritingDirection naturalBaseWritingDirection = baseTextAttributes.baseWritingDirection.has_value()
|
|
510
|
+
? RCTNSWritingDirectionFromWritingDirection(baseTextAttributes.baseWritingDirection.value())
|
|
511
|
+
: [NSParagraphStyle defaultWritingDirectionForLanguage:nil];
|
|
512
|
+
|
|
513
|
+
if (style1.alignment == NSTextAlignmentNatural || style1.baseWritingDirection == NSWritingDirectionNatural) {
|
|
514
|
+
NSMutableParagraphStyle *mutableStyle1 = [style1 mutableCopy];
|
|
515
|
+
style1 = mutableStyle1;
|
|
516
|
+
|
|
517
|
+
if (mutableStyle1.alignment == NSTextAlignmentNatural) {
|
|
518
|
+
mutableStyle1.alignment = naturalAlignment;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
if (mutableStyle1.baseWritingDirection == NSWritingDirectionNatural) {
|
|
522
|
+
mutableStyle1.baseWritingDirection = naturalBaseWritingDirection;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
if (style2.alignment == NSTextAlignmentNatural || style2.baseWritingDirection == NSWritingDirectionNatural) {
|
|
527
|
+
NSMutableParagraphStyle *mutableStyle2 = [style2 mutableCopy];
|
|
528
|
+
style2 = mutableStyle2;
|
|
529
|
+
|
|
530
|
+
if (mutableStyle2.alignment == NSTextAlignmentNatural) {
|
|
531
|
+
mutableStyle2.alignment = naturalAlignment;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
if (mutableStyle2.baseWritingDirection == NSWritingDirectionNatural) {
|
|
535
|
+
mutableStyle2.baseWritingDirection = naturalBaseWritingDirection;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
return [style1 isEqual:style2];
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
static BOOL RCTIsAttributeEffectivelySame(
|
|
543
|
+
NSAttributedStringKey attributeKey,
|
|
544
|
+
NSDictionary<NSAttributedStringKey, id> *attributes1,
|
|
545
|
+
NSDictionary<NSAttributedStringKey, id> *attributes2,
|
|
546
|
+
NSDictionary<NSAttributedStringKey, id> *insensitiveAttributes,
|
|
547
|
+
const TextAttributes &baseTextAttributes)
|
|
548
|
+
{
|
|
549
|
+
id attribute1 = attributes1[attributeKey] ?: insensitiveAttributes[attributeKey];
|
|
550
|
+
id attribute2 = attributes2[attributeKey] ?: insensitiveAttributes[attributeKey];
|
|
551
|
+
|
|
552
|
+
// Normalize attributes which can inexact but still effectively the same
|
|
553
|
+
if ([attributeKey isEqualToString:NSParagraphStyleAttributeName]) {
|
|
554
|
+
return RCTIsParagraphStyleEffectivelySame(attribute1, attribute2, baseTextAttributes);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
// Otherwise rely on built-in comparison
|
|
558
|
+
return [attribute1 isEqual:attribute2];
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
BOOL RCTIsAttributedStringEffectivelySame(
|
|
562
|
+
NSAttributedString *text1,
|
|
563
|
+
NSAttributedString *text2,
|
|
564
|
+
NSDictionary<NSAttributedStringKey, id> *insensitiveAttributes,
|
|
565
|
+
const TextAttributes &baseTextAttributes)
|
|
566
|
+
{
|
|
567
|
+
if (![text1.string isEqualToString:text2.string]) {
|
|
568
|
+
return NO;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
// We check that for every fragment in the old string
|
|
572
|
+
// 1. The new string's fragment overlapping the first spans the same characters
|
|
573
|
+
// 2. The attributes of each matching fragment are the same, ignoring those which match insensitive attibutes
|
|
574
|
+
__block BOOL areAttributesSame = YES;
|
|
575
|
+
[text1 enumerateAttributesInRange:NSMakeRange(0, text1.length)
|
|
576
|
+
options:0
|
|
577
|
+
usingBlock:^(
|
|
578
|
+
NSDictionary<NSAttributedStringKey, id> *text1Attributes,
|
|
579
|
+
NSRange text1Range,
|
|
580
|
+
BOOL *text1Stop) {
|
|
581
|
+
[text2 enumerateAttributesInRange:text1Range
|
|
582
|
+
options:0
|
|
583
|
+
usingBlock:^(
|
|
584
|
+
NSDictionary<NSAttributedStringKey, id> *text2Attributes,
|
|
585
|
+
NSRange text2Range,
|
|
586
|
+
BOOL *text2Stop) {
|
|
587
|
+
if (!NSEqualRanges(text1Range, text2Range)) {
|
|
588
|
+
areAttributesSame = NO;
|
|
589
|
+
*text1Stop = YES;
|
|
590
|
+
*text2Stop = YES;
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
// Compare every attribute in text1 to the corresponding attribute
|
|
595
|
+
// in text2, or the set of insensitive attributes if not present
|
|
596
|
+
for (NSAttributedStringKey key in text1Attributes) {
|
|
597
|
+
if (!RCTIsAttributeEffectivelySame(
|
|
598
|
+
key,
|
|
599
|
+
text1Attributes,
|
|
600
|
+
text2Attributes,
|
|
601
|
+
insensitiveAttributes,
|
|
602
|
+
baseTextAttributes)) {
|
|
603
|
+
areAttributesSame = NO;
|
|
604
|
+
*text1Stop = YES;
|
|
605
|
+
*text2Stop = YES;
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
for (NSAttributedStringKey key in text2Attributes) {
|
|
611
|
+
// We have already compared this attribute if it is present in
|
|
612
|
+
// both
|
|
613
|
+
if (text1Attributes[key] != nil) {
|
|
614
|
+
continue;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
// But we still need to compare attributes if it is only present
|
|
618
|
+
// in text 2, to compare against insensitive attributes
|
|
619
|
+
if (!RCTIsAttributeEffectivelySame(
|
|
620
|
+
key,
|
|
621
|
+
text1Attributes,
|
|
622
|
+
text2Attributes,
|
|
623
|
+
insensitiveAttributes,
|
|
624
|
+
baseTextAttributes)) {
|
|
625
|
+
areAttributesSame = NO;
|
|
626
|
+
*text1Stop = YES;
|
|
627
|
+
*text2Stop = YES;
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}];
|
|
632
|
+
}];
|
|
633
|
+
|
|
634
|
+
return areAttributesSame;
|
|
635
|
+
}
|
package/cli.js
CHANGED
package/index.js
CHANGED
|
@@ -89,7 +89,6 @@ import typeof DevSettings from './Libraries/Utilities/DevSettings';
|
|
|
89
89
|
import typeof Dimensions from './Libraries/Utilities/Dimensions';
|
|
90
90
|
import typeof PixelRatio from './Libraries/Utilities/PixelRatio';
|
|
91
91
|
import typeof Platform from './Libraries/Utilities/Platform';
|
|
92
|
-
// import typeof TabBarIOS from './Libraries/Components/TabBarIOS/TabBarIOS';
|
|
93
92
|
import typeof TVEventHandler from './Libraries/Components/TV/TVEventHandler';
|
|
94
93
|
import typeof TVFocusGuideView from './Libraries/Components/TV/TVFocusGuideView';
|
|
95
94
|
import typeof TVEventControl from './Libraries/Components/TV/TVEventControl';
|
|
@@ -176,9 +175,6 @@ module.exports = {
|
|
|
176
175
|
get Switch(): Switch {
|
|
177
176
|
return require('./Libraries/Components/Switch/Switch').default;
|
|
178
177
|
},
|
|
179
|
-
get TabBarIOS(): any {
|
|
180
|
-
return require('./Libraries/Components/TabBarIOS/TabBarIOS');
|
|
181
|
-
},
|
|
182
178
|
get Text(): Text {
|
|
183
179
|
return require('./Libraries/Text/Text');
|
|
184
180
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-tvos",
|
|
3
|
-
"version": "0.76.
|
|
3
|
+
"version": "0.76.2-0",
|
|
4
4
|
"description": "A framework for building native apps using React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -110,13 +110,13 @@
|
|
|
110
110
|
},
|
|
111
111
|
"dependencies": {
|
|
112
112
|
"@jest/create-cache-key-function": "^29.6.3",
|
|
113
|
-
"@react-native/assets-registry": "0.76.
|
|
114
|
-
"@react-native/codegen": "0.76.
|
|
115
|
-
"@react-native/community-cli-plugin": "0.76.
|
|
116
|
-
"@react-native/gradle-plugin": "0.76.
|
|
117
|
-
"@react-native/js-polyfills": "0.76.
|
|
118
|
-
"@react-native/normalize-colors": "0.76.
|
|
119
|
-
"@react-native-tvos/virtualized-lists": "0.76.
|
|
113
|
+
"@react-native/assets-registry": "0.76.2",
|
|
114
|
+
"@react-native/codegen": "0.76.2",
|
|
115
|
+
"@react-native/community-cli-plugin": "0.76.2",
|
|
116
|
+
"@react-native/gradle-plugin": "0.76.2",
|
|
117
|
+
"@react-native/js-polyfills": "0.76.2",
|
|
118
|
+
"@react-native/normalize-colors": "0.76.2",
|
|
119
|
+
"@react-native-tvos/virtualized-lists": "0.76.2-0",
|
|
120
120
|
"abort-controller": "^3.0.0",
|
|
121
121
|
"anser": "^1.4.9",
|
|
122
122
|
"ansi-regex": "^5.0.0",
|
|
@@ -493,7 +493,7 @@ function rootCodegenTargetNeedsThirdPartyComponentProvider(pkgJson, platform) {
|
|
|
493
493
|
function dependencyNeedsThirdPartyComponentProvider(
|
|
494
494
|
schemaInfo,
|
|
495
495
|
platform,
|
|
496
|
-
|
|
496
|
+
appCodegenConfigSpec,
|
|
497
497
|
) {
|
|
498
498
|
// Filter the react native core library out.
|
|
499
499
|
// In the future, core library and third party library should
|
|
@@ -504,7 +504,7 @@ function dependencyNeedsThirdPartyComponentProvider(
|
|
|
504
504
|
// the symbols defined in the app.
|
|
505
505
|
return (
|
|
506
506
|
!isReactNativeCoreLibrary(schemaInfo.library.config.name, platform) &&
|
|
507
|
-
schemaInfo.library.config.name !==
|
|
507
|
+
schemaInfo.library.config.name !== appCodegenConfigSpec
|
|
508
508
|
);
|
|
509
509
|
}
|
|
510
510
|
|
|
@@ -720,7 +720,7 @@ function execute(projectRoot, targetPlatform, baseOutputPath) {
|
|
|
720
720
|
dependencyNeedsThirdPartyComponentProvider(
|
|
721
721
|
schemaInfo,
|
|
722
722
|
platform,
|
|
723
|
-
pkgJson.codegenConfig?.
|
|
723
|
+
pkgJson.codegenConfig?.name,
|
|
724
724
|
),
|
|
725
725
|
);
|
|
726
726
|
const schemas = filteredSchemas.map(schemaInfo => schemaInfo.schema);
|
package/sdks/.hermesversion
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
hermes-2024-
|
|
1
|
+
hermes-2024-11-12-RNv0.76.2-5b4aa20c719830dcf5684832b89a6edb95ac3d64
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -41,6 +41,7 @@ declare module 'react-native/Libraries/Utilities/codegenNativeComponent' {
|
|
|
41
41
|
|
|
42
42
|
declare module 'react-native/Libraries/Types/CodegenTypes' {
|
|
43
43
|
import type {NativeSyntheticEvent} from 'react-native';
|
|
44
|
+
import type {EventSubscription} from 'react-native/Libraries/vendor/emitter/EventEmitter';
|
|
44
45
|
|
|
45
46
|
// Event types
|
|
46
47
|
// We're not using the PaperName, it is only used to codegen view config settings
|
|
@@ -59,6 +60,7 @@ declare module 'react-native/Libraries/Types/CodegenTypes' {
|
|
|
59
60
|
export type Float = number;
|
|
60
61
|
export type Int32 = number;
|
|
61
62
|
export type UnsafeObject = object;
|
|
63
|
+
export type UnsafeMixed = unknown;
|
|
62
64
|
|
|
63
65
|
type DefaultTypes = number | boolean | string | ReadonlyArray<string>;
|
|
64
66
|
// Default handling, ignore the unused value
|
|
@@ -71,4 +73,8 @@ declare module 'react-native/Libraries/Types/CodegenTypes' {
|
|
|
71
73
|
Type extends DefaultTypes,
|
|
72
74
|
Value extends Type | string | undefined | null,
|
|
73
75
|
> = Type | undefined | null;
|
|
76
|
+
|
|
77
|
+
export type EventEmitter<T> = (
|
|
78
|
+
handler: (arg: T) => void | Promise<void>,
|
|
79
|
+
) => EventSubscription;
|
|
74
80
|
}
|
|
@@ -100,7 +100,7 @@ declare module 'react-native' {
|
|
|
100
100
|
pressDuration?: number | undefined,
|
|
101
101
|
|
|
102
102
|
/**
|
|
103
|
-
*
|
|
103
|
+
* @deprecated No longer used
|
|
104
104
|
*/
|
|
105
105
|
pressDelay?: number | undefined,
|
|
106
106
|
};
|
|
@@ -166,7 +166,7 @@ declare module 'react-native' {
|
|
|
166
166
|
* https://github.com/react-native-tvos/react-native-tvos/blob/tvos-v0.69.8/packages/rn-tester/js/examples/TVFocusGuide/TVFocusGuideAutoFocusExample.js
|
|
167
167
|
*/
|
|
168
168
|
export const TVFocusGuideView: React.ForwardRefExoticComponent<FocusGuideProps & React.RefAttributes<View & FocusGuideMethods>>;
|
|
169
|
-
export interface TVTextScrollViewProps extends ScrollViewProps {
|
|
169
|
+
export interface TVTextScrollViewProps extends Omit<ScrollViewProps, 'onFocus' | 'onBlur'> {
|
|
170
170
|
/**
|
|
171
171
|
* The duration of the scroll animation when a swipe is detected.
|
|
172
172
|
* Default value is 0.3 s
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @noflow
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
'use strict';
|
|
12
|
-
|
|
13
|
-
const requireNativeComponent = require('../../ReactNative/requireNativeComponent').default;
|
|
14
|
-
|
|
15
|
-
import type {ViewProps} from '../View/ViewPropTypes';
|
|
16
|
-
import type {ColorValue} from '../../StyleSheet/StyleSheetTypes';
|
|
17
|
-
import type {SyntheticEvent} from '../../Types/CoreEventTypes';
|
|
18
|
-
import type {ImageSource} from '../../Image/ImageSource';
|
|
19
|
-
|
|
20
|
-
type TabBarItemEvent = SyntheticEvent<null>;
|
|
21
|
-
|
|
22
|
-
export type NativeProps = $ReadOnly< {|
|
|
23
|
-
...ViewProps,
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Little red bubble that sits at the top right of the icon.
|
|
27
|
-
*/
|
|
28
|
-
badge?: ?(string | number),
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Background color for the badge. Available since iOS 10.
|
|
32
|
-
*/
|
|
33
|
-
badgeColor?: ColorValue,
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Items comes with a few predefined system icons. Note that if you are
|
|
37
|
-
* using them, the title and selectedIcon will be overridden with the
|
|
38
|
-
* system ones.
|
|
39
|
-
*/
|
|
40
|
-
systemIcon?: ?(
|
|
41
|
-
| 'bookmarks'
|
|
42
|
-
| 'contacts'
|
|
43
|
-
| 'downloads'
|
|
44
|
-
| 'favorites'
|
|
45
|
-
| 'featured'
|
|
46
|
-
| 'history'
|
|
47
|
-
| 'more'
|
|
48
|
-
| 'most-recent'
|
|
49
|
-
| 'most-viewed'
|
|
50
|
-
| 'recents'
|
|
51
|
-
| 'search'
|
|
52
|
-
| 'top-rated'
|
|
53
|
-
),
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* A custom icon for the tab. It is ignored when a system icon is defined.
|
|
57
|
-
*/
|
|
58
|
-
icon?: ?ImageSource,
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* A custom icon when the tab is selected. It is ignored when a system
|
|
62
|
-
* icon is defined. If left empty, the icon will be tinted in blue.
|
|
63
|
-
*/
|
|
64
|
-
selectedIcon?: ?ImageSource,
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Callback when this tab is being selected, you should change the state of your
|
|
68
|
-
* component to set selected={true}.
|
|
69
|
-
*/
|
|
70
|
-
onPress?: ?(event: TabBarItemEvent) => mixed,
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* If set to true it renders the image as original,
|
|
74
|
-
* it defaults to being displayed as a template
|
|
75
|
-
*/
|
|
76
|
-
renderAsOriginal?: ?boolean,
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* It specifies whether the children are visible or not. If you see a
|
|
80
|
-
* blank content, you probably forgot to add a selected one.
|
|
81
|
-
*/
|
|
82
|
-
selected?: ?boolean,
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Text that appears under the icon. It is ignored when a system icon
|
|
86
|
-
* is defined.
|
|
87
|
-
*/
|
|
88
|
-
title?: ?string,
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* *(Apple TV only)* When set to true, this view will be focusable
|
|
92
|
-
* and navigable using the Apple TV remote.
|
|
93
|
-
*
|
|
94
|
-
* @platform ios
|
|
95
|
-
*/
|
|
96
|
-
isTVSelectable?: ?boolean,
|
|
97
|
-
|} >;
|
|
98
|
-
|
|
99
|
-
module.exports = requireNativeComponent('RCTTabBarItem');
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @noflow
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
'use strict';
|
|
12
|
-
|
|
13
|
-
const requireNativeComponent =
|
|
14
|
-
require('../../ReactNative/requireNativeComponent').default;
|
|
15
|
-
|
|
16
|
-
import type {ViewProps} from '../View/ViewPropTypes';
|
|
17
|
-
import type {ColorValue} from '../../StyleSheet/StyleSheetTypes';
|
|
18
|
-
|
|
19
|
-
type NativeProps = $ReadOnly<{|
|
|
20
|
-
...ViewProps,
|
|
21
|
-
unselectedTintColor?: ColorValue,
|
|
22
|
-
tintColor?: ColorValue,
|
|
23
|
-
unselectedItemTintColor?: ColorValue,
|
|
24
|
-
barTintColor?: ColorValue,
|
|
25
|
-
barStyle?: ?('default' | 'black'),
|
|
26
|
-
translucent?: ?boolean,
|
|
27
|
-
itemPositioning?: ?('fill' | 'center' | 'auto'),
|
|
28
|
-
|}>;
|
|
29
|
-
|
|
30
|
-
// type RCTTabBarNativeType = Class<NativeComponent<NativeProps>>;
|
|
31
|
-
|
|
32
|
-
module.exports = (requireNativeComponent<NativeProps>('RCTTabBar'): any);
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @noflow
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
'use strict';
|
|
12
|
-
|
|
13
|
-
import type {TabBarIOSProps} from './TabBarIOSProps';
|
|
14
|
-
|
|
15
|
-
const StyleSheet = require('../../StyleSheet/StyleSheet');
|
|
16
|
-
const RCTTabBar = require('./RCTTabBarNativeComponent');
|
|
17
|
-
const TabBarItemIOS = require('./TabBarItemIOS');
|
|
18
|
-
const React = require('react');
|
|
19
|
-
|
|
20
|
-
let showedDeprecationWarning = true;
|
|
21
|
-
|
|
22
|
-
class TabBarIOS extends React.Component<TabBarIOSProps> {
|
|
23
|
-
static Item: React.Node = TabBarItemIOS;
|
|
24
|
-
|
|
25
|
-
componentDidMount() {
|
|
26
|
-
if (!showedDeprecationWarning) {
|
|
27
|
-
console.warn(
|
|
28
|
-
'TabBarIOS and TabBarItemIOS are deprecated and will be removed in a future release. ' +
|
|
29
|
-
'Please use react-native-tab-view instead.',
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
showedDeprecationWarning = true;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
render(): React.Node {
|
|
37
|
-
return (
|
|
38
|
-
<RCTTabBar
|
|
39
|
-
style={[styles.tabGroup, this.props.style]}
|
|
40
|
-
unselectedTintColor={this.props.unselectedTintColor}
|
|
41
|
-
unselectedItemTintColor={this.props.unselectedItemTintColor}
|
|
42
|
-
tintColor={this.props.tintColor}
|
|
43
|
-
barTintColor={this.props.barTintColor}
|
|
44
|
-
barStyle={this.props.barStyle}
|
|
45
|
-
itemPositioning={this.props.itemPositioning}
|
|
46
|
-
translucent={this.props.translucent !== false}>
|
|
47
|
-
{this.props.children}
|
|
48
|
-
</RCTTabBar>
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const styles = StyleSheet.create({
|
|
54
|
-
tabGroup: {
|
|
55
|
-
flex: 1,
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
module.exports = TabBarIOS;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @flow
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
'use strict';
|
|
12
|
-
|
|
13
|
-
import type {TabBarIOSProps} from './TabBarIOSProps';
|
|
14
|
-
|
|
15
|
-
import React from 'react';
|
|
16
|
-
|
|
17
|
-
const StyleSheet = require('../../StyleSheet/StyleSheet');
|
|
18
|
-
const View = require('../View/View');
|
|
19
|
-
const TabBarItemIOS = require('./TabBarItemIOS');
|
|
20
|
-
|
|
21
|
-
let showedDeprecationWarning = false;
|
|
22
|
-
|
|
23
|
-
class TabBarIOS extends React.Component<TabBarIOSProps> {
|
|
24
|
-
static Item: any = TabBarItemIOS;
|
|
25
|
-
|
|
26
|
-
componentDidMount() {
|
|
27
|
-
if (!showedDeprecationWarning) {
|
|
28
|
-
console.warn(
|
|
29
|
-
'TabBarIOS and TabBarItemIOS are deprecated and will be removed in a future release. ' +
|
|
30
|
-
'Please use react-native-tab-view instead.',
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
showedDeprecationWarning = true;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
render(): React.Node {
|
|
38
|
-
return (
|
|
39
|
-
<View style={[this.props.style, styles.tabGroup]}>
|
|
40
|
-
{this.props.children}
|
|
41
|
-
</View>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const styles = StyleSheet.create({
|
|
47
|
-
tabGroup: {
|
|
48
|
-
flex: 1,
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
module.exports = TabBarIOS;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @flow
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { ViewProps } from '../View/ViewPropTypes';
|
|
6
|
-
|
|
7
|
-
export type TabBarIOSProps = $ReadOnly<{|
|
|
8
|
-
...ViewProps,
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Color of text on unselected tabs
|
|
12
|
-
*/
|
|
13
|
-
unselectedTintColor?: string,
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Color of the currently selected tab icon
|
|
17
|
-
*/
|
|
18
|
-
tintColor?: string,
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Color of unselected tab icons. Available since iOS 10.
|
|
22
|
-
*/
|
|
23
|
-
unselectedItemTintColor?: string,
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Background color of the tab bar
|
|
27
|
-
*/
|
|
28
|
-
barTintColor?: string,
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* The style of the tab bar. Supported values are 'default', 'black'.
|
|
32
|
-
* Use 'black' instead of setting `barTintColor` to black. This produces
|
|
33
|
-
* a tab bar with the native iOS style with higher translucency.
|
|
34
|
-
*/
|
|
35
|
-
barStyle?: ?('default' | 'black'),
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* A Boolean value that indicates whether the tab bar is translucent
|
|
39
|
-
*/
|
|
40
|
-
translucent?: ?boolean,
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Specifies tab bar item positioning. Available values are:
|
|
44
|
-
* - fill - distributes items across the entire width of the tab bar
|
|
45
|
-
* - center - centers item in the available tab bar space
|
|
46
|
-
* - auto (default) - distributes items dynamically according to the
|
|
47
|
-
* user interface idiom. In a horizontally compact environment (e.g. iPhone 5)
|
|
48
|
-
* this value defaults to `fill`, in a horizontally regular one (e.g. iPad)
|
|
49
|
-
* it defaults to center.
|
|
50
|
-
*/
|
|
51
|
-
itemPositioning?: ?('fill' | 'center' | 'auto'),
|
|
52
|
-
|}>;
|