react-native-tvos 0.76.1-1 → 0.76.3-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 +8 -0
- package/Libraries/Components/Pressable/Pressable.js +4 -1
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Core/setUpErrorHandling.js +1 -7
- package/Libraries/LogBox/Data/LogBoxData.js +2 -2
- package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +1 -0
- package/Libraries/Types/CoreEventTypes.d.ts +3 -3
- 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 +2 -2
- 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 +35 -42
- package/React/Views/RCTTVView.h +9 -14
- package/React/Views/RCTTVView.m +34 -46
- package/React/Views/RCTView.h +19 -0
- package/React/Views/ScrollView/RCTScrollView.m +12 -8
- package/ReactAndroid/api/ReactAndroid.api +0 -1
- package/ReactAndroid/cmake-utils/ReactNative-application.cmake +3 -4
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/hermes-engine/build.gradle.kts +4 -0
- 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 +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt +11 -3
- package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
- package/ReactCommon/react/renderer/components/textinput/platform/ios/react/renderer/components/iostextinput/TextInputShadowNode.cpp +3 -2
- 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/sdks/hermesc/win64-bin/msvcp140.dll +0 -0
- package/sdks/hermesc/win64-bin/vcruntime140.dll +0 -0
- package/sdks/hermesc/win64-bin/vcruntime140_1.dll +0 -0
- package/types/modules/Codegen.d.ts +6 -0
- package/types/public/ReactNativeTVTypes.d.ts +1 -1
- 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/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
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.3-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.3",
|
|
114
|
+
"@react-native/codegen": "0.76.3",
|
|
115
|
+
"@react-native/community-cli-plugin": "0.76.3",
|
|
116
|
+
"@react-native/gradle-plugin": "0.76.3",
|
|
117
|
+
"@react-native/js-polyfills": "0.76.3",
|
|
118
|
+
"@react-native/normalize-colors": "0.76.3",
|
|
119
|
+
"@react-native-tvos/virtualized-lists": "0.76.3-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
|
|
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
|
}
|
|
@@ -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
|
-
|}>;
|
|
@@ -1,177 +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 React from 'react';
|
|
14
|
-
// const StaticContainer = require('../StaticContainer.react');
|
|
15
|
-
const StyleSheet = require('../../StyleSheet/StyleSheet');
|
|
16
|
-
const View = require('../View/View');
|
|
17
|
-
const RCTTabBarItemNativeComponent = require('./RCTTabBarItemNativeComponent');
|
|
18
|
-
|
|
19
|
-
import type {ViewProps} from '../View/ViewPropTypes';
|
|
20
|
-
import type {ColorValue} from '../../StyleSheet/StyleSheetTypes';
|
|
21
|
-
import type {SyntheticEvent} from '../../Types/CoreEventTypes';
|
|
22
|
-
import type {ImageSource} from '../../Image/ImageSource';
|
|
23
|
-
|
|
24
|
-
type Props = $ReadOnly<{|
|
|
25
|
-
...ViewProps,
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Little red bubble that sits at the top right of the icon.
|
|
29
|
-
*/
|
|
30
|
-
badge?: ?(string | number),
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Background color for the badge. Available since iOS 10.
|
|
34
|
-
*/
|
|
35
|
-
badgeColor?: ColorValue,
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Items comes with a few predefined system icons. Note that if you are
|
|
39
|
-
* using them, the title and selectedIcon will be overridden with the
|
|
40
|
-
* system ones.
|
|
41
|
-
*/
|
|
42
|
-
systemIcon?: ?(
|
|
43
|
-
| 'bookmarks'
|
|
44
|
-
| 'contacts'
|
|
45
|
-
| 'downloads'
|
|
46
|
-
| 'favorites'
|
|
47
|
-
| 'featured'
|
|
48
|
-
| 'history'
|
|
49
|
-
| 'more'
|
|
50
|
-
| 'most-recent'
|
|
51
|
-
| 'most-viewed'
|
|
52
|
-
| 'recents'
|
|
53
|
-
| 'search'
|
|
54
|
-
| 'top-rated'
|
|
55
|
-
),
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* A custom icon for the tab. It is ignored when a system icon is defined.
|
|
59
|
-
*/
|
|
60
|
-
icon?: ?ImageSource,
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* A custom icon when the tab is selected. It is ignored when a system
|
|
64
|
-
* icon is defined. If left empty, the icon will be tinted in blue.
|
|
65
|
-
*/
|
|
66
|
-
selectedIcon?: ?ImageSource,
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Callback when this tab is being selected, you should change the state of your
|
|
70
|
-
* component to set selected={true}.
|
|
71
|
-
*/
|
|
72
|
-
onPress?: ?(event: SyntheticEvent<null>) => mixed,
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* If set to true it renders the image as original,
|
|
76
|
-
* it defaults to being displayed as a template
|
|
77
|
-
*/
|
|
78
|
-
renderAsOriginal?: ?boolean,
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* It specifies whether the children are visible or not. If you see a
|
|
82
|
-
* blank content, you probably forgot to add a selected one.
|
|
83
|
-
*/
|
|
84
|
-
selected?: ?boolean,
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Text that appears under the icon. It is ignored when a system icon
|
|
88
|
-
* is defined.
|
|
89
|
-
*/
|
|
90
|
-
title?: ?string,
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* *(Apple TV only)* When set to true, this view will be focusable
|
|
94
|
-
* and navigable using the Apple TV remote.
|
|
95
|
-
*
|
|
96
|
-
* @platform ios
|
|
97
|
-
*/
|
|
98
|
-
isTVSelectable?: ?boolean,
|
|
99
|
-
|}>;
|
|
100
|
-
|
|
101
|
-
type State = {|
|
|
102
|
-
hasBeenSelected: boolean,
|
|
103
|
-
|};
|
|
104
|
-
|
|
105
|
-
let showedDeprecationWarning = true;
|
|
106
|
-
|
|
107
|
-
class TabBarItemIOS extends React.Component<Props, State> {
|
|
108
|
-
state = {
|
|
109
|
-
hasBeenSelected: false,
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
UNSAFE_componentWillMount() {
|
|
113
|
-
if (this.props.selected) {
|
|
114
|
-
this.setState({hasBeenSelected: true});
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
UNSAFE_componentWillReceiveProps(nextProps: Props) {
|
|
119
|
-
if (this.state.hasBeenSelected || nextProps.selected) {
|
|
120
|
-
this.setState({hasBeenSelected: true});
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
componentDidMount() {
|
|
125
|
-
if (!showedDeprecationWarning) {
|
|
126
|
-
console.warn(
|
|
127
|
-
'TabBarIOS and TabBarItemIOS are deprecated and will be removed in a future release. ' +
|
|
128
|
-
'Please use react-native-tab-view instead.',
|
|
129
|
-
);
|
|
130
|
-
|
|
131
|
-
showedDeprecationWarning = true;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
render() {
|
|
136
|
-
const {style, children, ...props} = this.props;
|
|
137
|
-
|
|
138
|
-
/*
|
|
139
|
-
// if the tab has already been shown once, always continue to show it so we
|
|
140
|
-
// preserve state between tab transitions
|
|
141
|
-
let tabContents;
|
|
142
|
-
if (this.state.hasBeenSelected) {
|
|
143
|
-
tabContents = (
|
|
144
|
-
<StaticContainer shouldUpdate={this.props.selected}>
|
|
145
|
-
{children}
|
|
146
|
-
</StaticContainer>
|
|
147
|
-
);
|
|
148
|
-
} else {
|
|
149
|
-
tabContents = <View />;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return (
|
|
153
|
-
<RCTTabBarItemNativeComponent {...props} style={[styles.tab, style]}>
|
|
154
|
-
{tabContents}
|
|
155
|
-
</RCTTabBarItemNativeComponent>
|
|
156
|
-
);
|
|
157
|
-
*/
|
|
158
|
-
// TODO: properly replace StaticContainer
|
|
159
|
-
return (
|
|
160
|
-
<RCTTabBarItemNativeComponent {...props} style={[styles.tab, style]}>
|
|
161
|
-
{children}
|
|
162
|
-
</RCTTabBarItemNativeComponent>
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
const styles = StyleSheet.create({
|
|
168
|
-
tab: {
|
|
169
|
-
position: 'absolute',
|
|
170
|
-
top: 0,
|
|
171
|
-
right: 0,
|
|
172
|
-
bottom: 0,
|
|
173
|
-
left: 0,
|
|
174
|
-
},
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
module.exports = TabBarItemIOS;
|
|
@@ -1,55 +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 React from 'react';
|
|
14
|
-
|
|
15
|
-
const StyleSheet = require('../../StyleSheet/StyleSheet');
|
|
16
|
-
const View = require('../View/View');
|
|
17
|
-
|
|
18
|
-
let showedDeprecationWarning = false;
|
|
19
|
-
|
|
20
|
-
class DummyTab extends React.Component {
|
|
21
|
-
componentDidMount() {
|
|
22
|
-
if (!showedDeprecationWarning) {
|
|
23
|
-
console.warn(
|
|
24
|
-
'TabBarIOS and TabBarItemIOS are deprecated and will be removed in a future release. ' +
|
|
25
|
-
'Please use react-native-tab-view instead.',
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
showedDeprecationWarning = true;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
render() {
|
|
33
|
-
if (!this.props.selected) {
|
|
34
|
-
return <View />;
|
|
35
|
-
}
|
|
36
|
-
return (
|
|
37
|
-
<View style={[this.props.style, styles.tab]}>{this.props.children}</View>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const styles = StyleSheet.create({
|
|
43
|
-
tab: {
|
|
44
|
-
// TODO(5405356): Implement overflow: visible so position: absolute isn't useless
|
|
45
|
-
// position: 'absolute',
|
|
46
|
-
top: 0,
|
|
47
|
-
right: 0,
|
|
48
|
-
bottom: 0,
|
|
49
|
-
left: 0,
|
|
50
|
-
borderColor: 'red',
|
|
51
|
-
borderWidth: 1,
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
module.exports = DummyTab;
|
package/React/Views/RCTTabBar.h
DELETED
|
@@ -1,22 +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
|
-
|
|
8
|
-
#import <UIKit/UIKit.h>
|
|
9
|
-
|
|
10
|
-
@interface RCTTabBar : UIView
|
|
11
|
-
|
|
12
|
-
@property (nonatomic, strong) UIColor *unselectedTintColor;
|
|
13
|
-
@property (nonatomic, strong) UIColor *tintColor;
|
|
14
|
-
@property (nonatomic, strong) UIColor *barTintColor;
|
|
15
|
-
@property (nonatomic, assign) BOOL translucent;
|
|
16
|
-
#if !TARGET_OS_TV
|
|
17
|
-
@property (nonatomic, assign) UIBarStyle barStyle;
|
|
18
|
-
#endif
|
|
19
|
-
|
|
20
|
-
- (void)uiManagerDidPerformMounting;
|
|
21
|
-
|
|
22
|
-
@end
|