react-native-tvos 0.71.7-0rc0 → 0.71.8-0rc0
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/Touchable/TVTouchable.js +9 -1
- package/Libraries/Components/Touchable/Touchable.js +1 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +3 -3
- package/Libraries/Utilities/Platform.ios.js +5 -0
- package/React/Base/RCTVersion.m +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/package.json +4 -3
- package/sdks/hermesc/linux64-bin/hermesc +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/template/android/app/build.gradle +2 -2
- package/template/android/gradle.properties +0 -4
- package/template/package.json +1 -1
- package/tvos-types.d.ts +6 -0
- package/types/index.d.ts +2 -0
- package/types/public/ReactNativeTVTypes.d.ts +192 -0
- package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +0 -2119
- package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +0 -2573
- package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +0 -6037
|
@@ -29,13 +29,18 @@ type TVTouchableConfig = $ReadOnly<{|
|
|
|
29
29
|
|}>;
|
|
30
30
|
|
|
31
31
|
export default class TVTouchable {
|
|
32
|
-
_tvEventHandler: TVEventHandler;
|
|
32
|
+
_tvEventHandler: TVEventHandler = null;
|
|
33
|
+
_enabled: boolean = false;
|
|
33
34
|
|
|
34
35
|
constructor(component: any, config: TVTouchableConfig) {
|
|
35
36
|
invariant(Platform.isTV, 'TVTouchable: Requires `Platform.isTV`.');
|
|
36
37
|
this._tvEventHandler = new TVEventHandler();
|
|
38
|
+
const _tvtouchable = this;
|
|
37
39
|
this._tvEventHandler.enable(component, (_, tvData) => {
|
|
38
40
|
tvData.dispatchConfig = {};
|
|
41
|
+
if (!_tvtouchable._enabled) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
39
44
|
if (ReactNative.findNodeHandle(component) === tvData.tag) {
|
|
40
45
|
if (tvData.eventType === 'focus') {
|
|
41
46
|
config.onFocus(tvData);
|
|
@@ -52,9 +57,12 @@ export default class TVTouchable {
|
|
|
52
57
|
}
|
|
53
58
|
}
|
|
54
59
|
});
|
|
60
|
+
this._enabled = true;
|
|
55
61
|
}
|
|
56
62
|
|
|
57
63
|
destroy(): void {
|
|
64
|
+
this._enabled = false;
|
|
58
65
|
this._tvEventHandler.disable();
|
|
66
|
+
this._tvEventHandler = null;
|
|
59
67
|
}
|
|
60
68
|
}
|
|
@@ -13,6 +13,7 @@ import type {ColorValue} from '../../StyleSheet/StyleSheet';
|
|
|
13
13
|
import type {PressEvent} from '../../Types/CoreEventTypes';
|
|
14
14
|
import type {TouchableType} from './Touchable.flow';
|
|
15
15
|
|
|
16
|
+
import ReactNative from '../../Renderer/shims/ReactNative';
|
|
16
17
|
import {PressabilityDebugView} from '../../Pressability/PressabilityDebug';
|
|
17
18
|
import UIManager from '../../ReactNative/UIManager';
|
|
18
19
|
import Platform from '../../Utilities/Platform';
|
|
@@ -256,21 +256,21 @@ static void *TextFieldSelectionObservingContext = &TextFieldSelectionObservingCo
|
|
|
256
256
|
|
|
257
257
|
- (void)textViewDidChange:(__unused UITextView *)textView
|
|
258
258
|
{
|
|
259
|
-
if (_ignoreNextTextInputCall
|
|
259
|
+
if (_ignoreNextTextInputCall) {
|
|
260
260
|
_ignoreNextTextInputCall = NO;
|
|
261
261
|
return;
|
|
262
262
|
}
|
|
263
|
-
_lastStringStateWasUpdatedWith = _backedTextInputView.attributedText;
|
|
264
263
|
_textDidChangeIsComing = NO;
|
|
265
264
|
[_backedTextInputView.textInputDelegate textInputDidChange];
|
|
266
265
|
}
|
|
267
266
|
|
|
268
267
|
- (void)textViewDidChangeSelection:(__unused UITextView *)textView
|
|
269
268
|
{
|
|
270
|
-
if (![_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) {
|
|
269
|
+
if (_lastStringStateWasUpdatedWith && ![_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) {
|
|
271
270
|
[self textViewDidChange:_backedTextInputView];
|
|
272
271
|
_ignoreNextTextInputCall = YES;
|
|
273
272
|
}
|
|
273
|
+
_lastStringStateWasUpdatedWith = _backedTextInputView.attributedText;
|
|
274
274
|
[self textViewProbablyDidChangeSelection];
|
|
275
275
|
}
|
|
276
276
|
|
|
@@ -58,6 +58,11 @@ const Platform = {
|
|
|
58
58
|
return this.constants.interfaceIdiom === 'tv';
|
|
59
59
|
},
|
|
60
60
|
// $FlowFixMe[unsafe-getters-setters]
|
|
61
|
+
get isTVOS(): boolean {
|
|
62
|
+
// $FlowFixMe[object-this-reference]
|
|
63
|
+
return this.constants.interfaceIdiom === 'tv';
|
|
64
|
+
},
|
|
65
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
61
66
|
get isTesting(): boolean {
|
|
62
67
|
if (__DEV__) {
|
|
63
68
|
// $FlowFixMe[object-this-reference]
|
package/React/Base/RCTVersion.m
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-tvos",
|
|
3
|
-
"version": "0.71.
|
|
3
|
+
"version": "0.71.8-0rc0",
|
|
4
4
|
"bin": "./cli.js",
|
|
5
5
|
"description": "A framework for building native apps using React",
|
|
6
6
|
"license": "MIT",
|
|
@@ -73,6 +73,7 @@
|
|
|
73
73
|
"!template/package-lock.json",
|
|
74
74
|
"!template/yarn.lock",
|
|
75
75
|
"third-party-podspecs",
|
|
76
|
+
"tvos-types.d.ts",
|
|
76
77
|
"types"
|
|
77
78
|
],
|
|
78
79
|
"scripts": {
|
|
@@ -140,7 +141,7 @@
|
|
|
140
141
|
"pretty-format": "^26.5.2",
|
|
141
142
|
"promise": "^8.3.0",
|
|
142
143
|
"react-devtools-core": "^4.26.1",
|
|
143
|
-
"react-native-gradle-plugin": "^0.71.
|
|
144
|
+
"react-native-gradle-plugin": "^0.71.18",
|
|
144
145
|
"react-refresh": "^0.4.0",
|
|
145
146
|
"react-shallow-renderer": "^16.15.0",
|
|
146
147
|
"regenerator-runtime": "^0.13.2",
|
|
@@ -195,7 +196,7 @@
|
|
|
195
196
|
"mkdirp": "^0.5.1",
|
|
196
197
|
"mock-fs": "^5.1.4",
|
|
197
198
|
"prettier": "^2.4.1",
|
|
198
|
-
"react-native-core": "npm:react-native@0.71.
|
|
199
|
+
"react-native-core": "npm:react-native@0.71.8",
|
|
199
200
|
"shelljs": "^0.8.5",
|
|
200
201
|
"signedsource": "^1.0.0",
|
|
201
202
|
"typescript": "4.1.3",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -156,7 +156,7 @@ dependencies {
|
|
|
156
156
|
// in gradle.properties for now
|
|
157
157
|
// We also use the io.github.react-native-tvos group for the react-android and hermes-android dependencies
|
|
158
158
|
|
|
159
|
-
implementation("io.github.react-native-tvos:react-android
|
|
159
|
+
implementation("io.github.react-native-tvos:react-android")
|
|
160
160
|
|
|
161
161
|
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
|
|
162
162
|
|
|
@@ -167,7 +167,7 @@ dependencies {
|
|
|
167
167
|
|
|
168
168
|
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
|
|
169
169
|
if (hermesEnabled.toBoolean()) {
|
|
170
|
-
implementation("io.github.react-native-tvos:hermes-android
|
|
170
|
+
implementation("io.github.react-native-tvos:hermes-android")
|
|
171
171
|
} else {
|
|
172
172
|
implementation jscFlavor
|
|
173
173
|
}
|
|
@@ -42,7 +42,3 @@ newArchEnabled=false
|
|
|
42
42
|
# Use this property to enable or disable the Hermes JS engine.
|
|
43
43
|
# If set to false, you will be using JSC instead.
|
|
44
44
|
hermesEnabled=true
|
|
45
|
-
|
|
46
|
-
# react-native-gradle-plugin does not yet set the version automatically
|
|
47
|
-
# for the TV repo, so we set the version here
|
|
48
|
-
REACT_NATIVE_TV_VERSION_STRING=0.71.7-0rc0
|
package/template/package.json
CHANGED
package/tvos-types.d.ts
ADDED
package/types/index.d.ts
CHANGED
|
@@ -157,6 +157,8 @@ export * from './public/Insets';
|
|
|
157
157
|
export * from './public/ReactNativeRenderer';
|
|
158
158
|
export * from './public/ReactNativeTypes';
|
|
159
159
|
|
|
160
|
+
export * from './public/ReactNativeTVTypes';
|
|
161
|
+
|
|
160
162
|
import type {ErrorUtils} from '../Libraries/vendor/core/ErrorUtils';
|
|
161
163
|
|
|
162
164
|
declare global {
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewProps, ScrollViewProps } from 'react-native';
|
|
3
|
+
|
|
4
|
+
declare module 'react-native' {
|
|
5
|
+
interface ViewProps {
|
|
6
|
+
/**
|
|
7
|
+
* TV next focus down (see documentation for the View component).
|
|
8
|
+
*/
|
|
9
|
+
nextFocusDown?: number,
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* TV next focus forward (see documentation for the View component).
|
|
13
|
+
*
|
|
14
|
+
* @platform android
|
|
15
|
+
*/
|
|
16
|
+
nextFocusForward?: number,
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* TV next focus left (see documentation for the View component).
|
|
20
|
+
*/
|
|
21
|
+
nextFocusLeft?: number,
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* TV next focus right (see documentation for the View component).
|
|
25
|
+
*/
|
|
26
|
+
nextFocusRight?: number,
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* TV next focus up (see documentation for the View component).
|
|
30
|
+
*/
|
|
31
|
+
nextFocusUp?: number,
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface View {
|
|
35
|
+
requestTVFocus(): void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const useTVEventHandler: (handleEvent: (event: HWEvent) => void) => void;
|
|
39
|
+
|
|
40
|
+
export const TVEventControl: {
|
|
41
|
+
enableTVMenuKey(): void;
|
|
42
|
+
disableTVMenuKey(): void;
|
|
43
|
+
enableTVPanGesture(): void;
|
|
44
|
+
disableTVPanGesture(): void;
|
|
45
|
+
enableGestureHandlersCancelTouches(): void;
|
|
46
|
+
disableGestureHandlersCancelTouches(): void;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export type HWEvent = {
|
|
50
|
+
eventType: 'up' | 'down' | 'right' | 'left' | 'longUp' | 'longDown' | 'longRight' | 'longLeft' | 'blur' | 'focus' | 'pan' | string;
|
|
51
|
+
eventKeyAction?: -1 | 1 | 0 | number;
|
|
52
|
+
tag?: number;
|
|
53
|
+
body?: {
|
|
54
|
+
state: "Began" | "Changed" | "Ended",
|
|
55
|
+
x: number,
|
|
56
|
+
y: number,
|
|
57
|
+
velocityx: number,
|
|
58
|
+
velocityy: number
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export class TVEventHandler {
|
|
63
|
+
enable<T extends React.Component<unknown>>(
|
|
64
|
+
component?: T,
|
|
65
|
+
callback?: (component: T, data: HWEvent) => void
|
|
66
|
+
): void;
|
|
67
|
+
disable(): void;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface FocusGuideProps extends ViewProps {
|
|
71
|
+
/**
|
|
72
|
+
* If the view should be "visible". display "flex" if visible, otherwise "none".
|
|
73
|
+
* Defaults to true
|
|
74
|
+
*/
|
|
75
|
+
enabled?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Array of `Component`s to register as destinations with `UIFocusGuide`
|
|
78
|
+
*/
|
|
79
|
+
destinations?: (null | number | React.Component<any, any> | React.ComponentClass<any>)[];
|
|
80
|
+
/**
|
|
81
|
+
* If true, `TVFocusGuide` will automatically manage focus for you.
|
|
82
|
+
* It will redirect the focus to the first focusable child on the first visit.
|
|
83
|
+
* It also remembers the last focused child and redirects the focus
|
|
84
|
+
* to it on the subsequent visits.
|
|
85
|
+
*
|
|
86
|
+
* `destinations` prop takes precedence over this prop when used together.
|
|
87
|
+
*
|
|
88
|
+
* @default false
|
|
89
|
+
*/
|
|
90
|
+
autoFocus?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Enables focus trapping for the focus guide (see README).
|
|
93
|
+
*/
|
|
94
|
+
trapFocusUp?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Enables focus trapping for the focus guide (see README).
|
|
97
|
+
*/
|
|
98
|
+
trapFocusDown?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Enables focus trapping for the focus guide (see README).
|
|
101
|
+
*/
|
|
102
|
+
trapFocusLeft?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Enables focus trapping for the focus guide (see README).
|
|
105
|
+
*/
|
|
106
|
+
trapFocusRight?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* @deprecated Don't use it, no longer necessary.
|
|
109
|
+
*/
|
|
110
|
+
safePadding?: 'both' | 'vertical' | 'horizontal' | null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export type FocusGuideMethods = {
|
|
114
|
+
setDestinations: (
|
|
115
|
+
destinations: (React.ElementRef<HostComponent<unknown>> | null | undefined)[],
|
|
116
|
+
) => void;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* This component provides support for Apple's `UIFocusGuide` API,
|
|
121
|
+
* to help ensure that focusable controls can be navigated to,
|
|
122
|
+
* even if they are not directly in line with other controls on both tvOS and Android.
|
|
123
|
+
* An example is provided in `RNTester` that shows different ways of using this component.
|
|
124
|
+
* https://github.com/react-native-tvos/react-native-tvos/blob/tvos-v0.69.8/packages/rn-tester/js/examples/TVFocusGuide/TVFocusGuideAutoFocusExample.js
|
|
125
|
+
*/
|
|
126
|
+
export const TVFocusGuideView: React.ForwardRefExoticComponent<FocusGuideProps & React.RefAttributes<View & FocusGuideMethods>>;
|
|
127
|
+
export interface TVTextScrollViewProps extends ScrollViewProps {
|
|
128
|
+
/**
|
|
129
|
+
* The duration of the scroll animation when a swipe is detected.
|
|
130
|
+
* Default value is 0.3 s
|
|
131
|
+
*/
|
|
132
|
+
scrollDuration?: number;
|
|
133
|
+
/**
|
|
134
|
+
* Scrolling distance when a swipe is detected
|
|
135
|
+
* Default value is half the visible height (vertical scroller)
|
|
136
|
+
* or width (horizontal scroller)
|
|
137
|
+
*/
|
|
138
|
+
pageSize?: number;
|
|
139
|
+
/**
|
|
140
|
+
* If true, will scroll to start when focus moves out past the beginning
|
|
141
|
+
* of the scroller
|
|
142
|
+
* Defaults to true
|
|
143
|
+
*/
|
|
144
|
+
snapToStart?: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* If true, will scroll to end when focus moves out past the end of the
|
|
147
|
+
* scroller
|
|
148
|
+
* Defaults to true
|
|
149
|
+
*/
|
|
150
|
+
snapToEnd?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Called when the scroller comes into focus (e.g. for highlighting)
|
|
153
|
+
*/
|
|
154
|
+
onFocus?(evt: HWEvent): void;
|
|
155
|
+
/**
|
|
156
|
+
* Called when the scroller goes out of focus
|
|
157
|
+
*/
|
|
158
|
+
onBlur?(evt: HWEvent): void;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export class TVTextScrollView extends React.Component<TVTextScrollViewProps> {}
|
|
162
|
+
|
|
163
|
+
export interface PressableStateCallbackType {
|
|
164
|
+
readonly focused: boolean;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface TouchableWithoutFeedbackPropsIOS {
|
|
168
|
+
/**
|
|
169
|
+
* *(Apple TV only)* TV preferred focus (see documentation for the View component).
|
|
170
|
+
*
|
|
171
|
+
* @platform ios
|
|
172
|
+
*/
|
|
173
|
+
hasTVPreferredFocus?: boolean;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* *(Apple TV only)* Object with properties to control Apple TV parallax effects.
|
|
177
|
+
*
|
|
178
|
+
* enabled: If true, parallax effects are enabled. Defaults to true.
|
|
179
|
+
* shiftDistanceX: Defaults to 2.0.
|
|
180
|
+
* shiftDistanceY: Defaults to 2.0.
|
|
181
|
+
* tiltAngle: Defaults to 0.05.
|
|
182
|
+
* magnification: Defaults to 1.0.
|
|
183
|
+
* pressMagnification: Defaults to 1.0.
|
|
184
|
+
* pressDuration: Defaults to 0.3.
|
|
185
|
+
* pressDelay: Defaults to 0.0.
|
|
186
|
+
*
|
|
187
|
+
* @platform ios
|
|
188
|
+
*/
|
|
189
|
+
tvParallaxProperties?: TVParallaxProperties;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
}
|