react-native-tvos 0.82.0-0rc4 → 0.82.0-0rc5
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/Animated/nodes/AnimatedValue.js +0 -8
- package/Libraries/Components/Pressable/Pressable.d.ts +1 -1
- package/Libraries/Components/Pressable/Pressable.js +14 -12
- package/Libraries/Components/TV/TVParallaxProperties.d.ts +42 -0
- package/Libraries/Components/TV/TVViewPropTypes.js +45 -8
- package/Libraries/Components/Touchable/TouchableHighlight.js +5 -29
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +5 -49
- package/Libraries/Components/Touchable/TouchableOpacity.js +5 -55
- package/Libraries/Components/View/View.js +12 -0
- package/Libraries/Components/View/ViewPropTypes.d.ts +59 -37
- package/Libraries/Components/View/ViewPropTypes.js +5 -86
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Interaction/PanResponder.js +6 -51
- package/React/Base/RCTBridge.mm +16 -0
- package/React/Base/RCTVersion.m +1 -1
- package/React/Fabric/Mounting/RCTComponentViewProtocol.h +6 -0
- package/React/Fabric/Mounting/RCTComponentViewRegistry.mm +1 -0
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +2 -0
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +5 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.kt +9 -10
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/index.js +6 -0
- package/package.json +8 -8
- package/sdks/hermes-engine/version.properties +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/public/ReactNativeTVTypes.d.ts +1 -43
|
@@ -18,7 +18,6 @@ import type {AnimatedNodeConfig} from './AnimatedNode';
|
|
|
18
18
|
import type AnimatedTracking from './AnimatedTracking';
|
|
19
19
|
|
|
20
20
|
import NativeAnimatedHelper from '../../../src/private/animated/NativeAnimatedHelper';
|
|
21
|
-
import InteractionManager from '../../Interaction/InteractionManager';
|
|
22
21
|
import AnimatedInterpolation from './AnimatedInterpolation';
|
|
23
22
|
import AnimatedWithChildren from './AnimatedWithChildren';
|
|
24
23
|
|
|
@@ -312,10 +311,6 @@ export default class AnimatedValue extends AnimatedWithChildren {
|
|
|
312
311
|
* See https://reactnative.dev/docs/animatedvalue#animate
|
|
313
312
|
*/
|
|
314
313
|
animate(animation: Animation, callback: ?EndCallback): void {
|
|
315
|
-
let handle = null;
|
|
316
|
-
if (animation.__isInteraction) {
|
|
317
|
-
handle = InteractionManager.createInteractionHandle();
|
|
318
|
-
}
|
|
319
314
|
const previousAnimation = this._animation;
|
|
320
315
|
this._animation && this._animation.stop();
|
|
321
316
|
this._animation = animation;
|
|
@@ -328,9 +323,6 @@ export default class AnimatedValue extends AnimatedWithChildren {
|
|
|
328
323
|
},
|
|
329
324
|
result => {
|
|
330
325
|
this._animation = null;
|
|
331
|
-
if (handle !== null) {
|
|
332
|
-
InteractionManager.clearInteractionHandle(handle);
|
|
333
|
-
}
|
|
334
326
|
callback && callback(result);
|
|
335
327
|
},
|
|
336
328
|
previousAnimation,
|
|
@@ -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 '
|
|
23
|
+
import {TVParallaxProperties} from '../TV/TVParallaxProperties';
|
|
24
24
|
|
|
25
25
|
export interface PressableStateCallbackType {
|
|
26
26
|
readonly pressed: boolean;
|
|
@@ -251,7 +251,7 @@ function Pressable({
|
|
|
251
251
|
const android_rippleConfig = useAndroidRippleForView(android_ripple, viewRef);
|
|
252
252
|
|
|
253
253
|
const [pressed, setPressed] = usePressState(testOnly_pressed === true);
|
|
254
|
-
const [focused, setFocused] =
|
|
254
|
+
const [focused, setFocused] = useState(false);
|
|
255
255
|
|
|
256
256
|
const shouldUpdatePressed =
|
|
257
257
|
typeof children === 'function' || typeof style === 'function';
|
|
@@ -287,9 +287,6 @@ function Pressable({
|
|
|
287
287
|
accessibilityLiveRegion,
|
|
288
288
|
accessibilityLabel,
|
|
289
289
|
accessibilityState: _accessibilityState,
|
|
290
|
-
focusable:
|
|
291
|
-
focusable !== false && disabled !== true && ariaDisabled !== true,
|
|
292
|
-
isTVSelectable: isTVSelectable !== false && accessible !== false,
|
|
293
290
|
accessibilityValue,
|
|
294
291
|
hitSlop,
|
|
295
292
|
};
|
|
@@ -376,6 +373,16 @@ function Pressable({
|
|
|
376
373
|
|
|
377
374
|
const eventHandlers = usePressability(config);
|
|
378
375
|
|
|
376
|
+
const computedStyle = useMemo(() => {
|
|
377
|
+
return typeof style === 'function' ? style({pressed, focused}) : style;
|
|
378
|
+
}, [pressed, focused, style]);
|
|
379
|
+
|
|
380
|
+
const computedChildren = useMemo(() => {
|
|
381
|
+
return typeof children === 'function'
|
|
382
|
+
? children({pressed, focused})
|
|
383
|
+
: children;
|
|
384
|
+
}, [pressed, focused, children]);
|
|
385
|
+
|
|
379
386
|
return (
|
|
380
387
|
<View
|
|
381
388
|
{...restPropsWithDefaults}
|
|
@@ -386,16 +393,11 @@ function Pressable({
|
|
|
386
393
|
nextFocusLeft={tagForComponentOrHandle(props.nextFocusLeft)}
|
|
387
394
|
nextFocusRight={tagForComponentOrHandle(props.nextFocusRight)}
|
|
388
395
|
nextFocusUp={tagForComponentOrHandle(props.nextFocusUp)}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
accessible !== false &&
|
|
392
|
-
disabled !== true &&
|
|
393
|
-
ariaDisabled !== true
|
|
394
|
-
}
|
|
395
|
-
style={typeof style === 'function' ? style({pressed, focused}) : style}
|
|
396
|
+
focusable={focusable !== false && isTVSelectable !== false}
|
|
397
|
+
style={computedStyle}
|
|
396
398
|
tvParallaxProperties={tvParallaxProperties}
|
|
397
399
|
collapsable={false}>
|
|
398
|
-
{
|
|
400
|
+
{computedChildren}
|
|
399
401
|
{__DEV__ ? <PressabilityDebugView color="red" hitSlop={hitSlop} /> : null}
|
|
400
402
|
</View>
|
|
401
403
|
);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export type TVParallaxProperties = {
|
|
2
|
+
/**
|
|
3
|
+
* If true, parallax effects are enabled. Defaults to true.
|
|
4
|
+
*/
|
|
5
|
+
enabled?: boolean | undefined,
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Defaults to 2.0.
|
|
9
|
+
*/
|
|
10
|
+
shiftDistanceX?: number | undefined,
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Defaults to 2.0.
|
|
14
|
+
*/
|
|
15
|
+
shiftDistanceY?: number | undefined,
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Defaults to 0.05.
|
|
19
|
+
*/
|
|
20
|
+
tiltAngle?: number | undefined,
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Defaults to 1.0
|
|
24
|
+
*/
|
|
25
|
+
magnification?: number | undefined,
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Defaults to 1.0
|
|
29
|
+
*/
|
|
30
|
+
pressMagnification?: number | undefined,
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Defaults to 0.3
|
|
34
|
+
*/
|
|
35
|
+
pressDuration?: number | undefined,
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated No longer used
|
|
39
|
+
*/
|
|
40
|
+
pressDelay?: number | undefined,
|
|
41
|
+
};
|
|
42
|
+
|
|
@@ -53,30 +53,36 @@ export type TVParallaxPropertiesType = $ReadOnly<{|
|
|
|
53
53
|
|}>;
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
56
|
+
* These props are for both Apple TV and Android TV.
|
|
57
|
+
* TODO: update `@react-native/eslint-plugin` so that the
|
|
58
|
+
* name can be changed to TVViewProps
|
|
57
59
|
*/
|
|
58
60
|
export type TVViewProps = $ReadOnly<{|
|
|
59
61
|
/**
|
|
60
|
-
*
|
|
61
|
-
* and navigable using the Apple TV remote.
|
|
62
|
+
* @deprecated Replaced by `focusable`.
|
|
62
63
|
*
|
|
63
64
|
* @platform ios
|
|
64
65
|
*/
|
|
65
|
-
isTVSelectable?: boolean,
|
|
66
|
+
isTVSelectable?: ?boolean,
|
|
66
67
|
|
|
67
68
|
/**
|
|
68
|
-
*
|
|
69
|
+
* Whether this `View` should be focusable with a non-touch input device, eg. receive focus with a hardware keyboard.
|
|
69
70
|
*
|
|
70
|
-
* @platform ios
|
|
71
71
|
*/
|
|
72
|
-
|
|
72
|
+
focusable?: ?boolean,
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* May be set to true to force the focus engine to move focus to this view.
|
|
76
|
+
*
|
|
77
|
+
*/
|
|
78
|
+
hasTVPreferredFocus?: ?boolean,
|
|
73
79
|
|
|
74
80
|
/**
|
|
75
81
|
* *(Apple TV only)* Object with properties to control Apple TV parallax effects.
|
|
76
82
|
*
|
|
77
83
|
* @platform ios
|
|
78
84
|
*/
|
|
79
|
-
tvParallaxProperties?: TVParallaxPropertiesType,
|
|
85
|
+
tvParallaxProperties?: ?TVParallaxPropertiesType,
|
|
80
86
|
|
|
81
87
|
/**
|
|
82
88
|
* Additional properties needed for flow checks on TVFocusGuideView
|
|
@@ -87,4 +93,35 @@ export type TVViewProps = $ReadOnly<{|
|
|
|
87
93
|
safePadding?: string | null,
|
|
88
94
|
onPressIn?: (event: any) => void,
|
|
89
95
|
onPressOut?: (event: any) => void,
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* TV next focus forward (see documentation for the View component).
|
|
99
|
+
*
|
|
100
|
+
* @platform android
|
|
101
|
+
*/
|
|
102
|
+
nextFocusForward?: ?number,
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* TV next focus down (see documentation for the View component).
|
|
106
|
+
*
|
|
107
|
+
*/
|
|
108
|
+
nextFocusDown?: ?number,
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* TV next focus left (see documentation for the View component).
|
|
112
|
+
*
|
|
113
|
+
*/
|
|
114
|
+
nextFocusLeft?: ?number,
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* TV next focus right (see documentation for the View component).
|
|
118
|
+
*
|
|
119
|
+
*/
|
|
120
|
+
nextFocusRight?: ?number,
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* TV next focus up (see documentation for the View component).
|
|
124
|
+
*
|
|
125
|
+
*/
|
|
126
|
+
nextFocusUp?: ?number,
|
|
90
127
|
|}>;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {ColorValue} from '../../StyleSheet/StyleSheet';
|
|
12
|
-
import type {
|
|
12
|
+
import type {TVViewProps} from '../TV/TVViewPropTypes';
|
|
13
13
|
import type {AccessibilityState} from '../View/ViewAccessibility';
|
|
14
14
|
import type {TouchableWithoutFeedbackProps} from './TouchableWithoutFeedback';
|
|
15
15
|
|
|
@@ -24,25 +24,6 @@ import tagForComponentOrHandle from '../TV/tagForComponentOrHandle';
|
|
|
24
24
|
import * as React from 'react';
|
|
25
25
|
import {cloneElement} from 'react';
|
|
26
26
|
|
|
27
|
-
type AndroidProps = $ReadOnly<{
|
|
28
|
-
nextFocusDown?: ?number,
|
|
29
|
-
nextFocusForward?: ?number,
|
|
30
|
-
nextFocusLeft?: ?number,
|
|
31
|
-
nextFocusRight?: ?number,
|
|
32
|
-
nextFocusUp?: ?number,
|
|
33
|
-
}>;
|
|
34
|
-
|
|
35
|
-
type IOSProps = $ReadOnly<{
|
|
36
|
-
hasTVPreferredFocus?: ?boolean,
|
|
37
|
-
isTVSelectable?: ?boolean,
|
|
38
|
-
tvParallaxProperties?: TVParallaxPropertiesType,
|
|
39
|
-
nextFocusDown?: ?number,
|
|
40
|
-
nextFocusForward?: ?number,
|
|
41
|
-
nextFocusLeft?: ?number,
|
|
42
|
-
nextFocusRight?: ?number,
|
|
43
|
-
nextFocusUp?: ?number,
|
|
44
|
-
}>;
|
|
45
|
-
|
|
46
27
|
type TouchableHighlightBaseProps = $ReadOnly<{
|
|
47
28
|
/**
|
|
48
29
|
* Determines what the opacity of the wrapped view should be when touch is active.
|
|
@@ -71,8 +52,7 @@ type TouchableHighlightBaseProps = $ReadOnly<{
|
|
|
71
52
|
|
|
72
53
|
export type TouchableHighlightProps = $ReadOnly<{
|
|
73
54
|
...TouchableWithoutFeedbackProps,
|
|
74
|
-
...
|
|
75
|
-
...IOSProps,
|
|
55
|
+
...TVViewProps,
|
|
76
56
|
...TouchableHighlightBaseProps,
|
|
77
57
|
}>;
|
|
78
58
|
|
|
@@ -371,8 +351,9 @@ class TouchableHighlightImpl extends React.Component<
|
|
|
371
351
|
onLayout={this.props.onLayout}
|
|
372
352
|
hitSlop={this.props.hitSlop}
|
|
373
353
|
hasTVPreferredFocus={this.props.hasTVPreferredFocus === true}
|
|
374
|
-
|
|
375
|
-
this.props.
|
|
354
|
+
focusable={
|
|
355
|
+
this.props.focusable !== false &&
|
|
356
|
+
this.props.isTVSelectable !== false
|
|
376
357
|
}
|
|
377
358
|
tvParallaxProperties={this.props.tvParallaxProperties}
|
|
378
359
|
nextFocusDown={tagForComponentOrHandle(this.props.nextFocusDown)}
|
|
@@ -380,11 +361,6 @@ class TouchableHighlightImpl extends React.Component<
|
|
|
380
361
|
nextFocusLeft={tagForComponentOrHandle(this.props.nextFocusLeft)}
|
|
381
362
|
nextFocusRight={tagForComponentOrHandle(this.props.nextFocusRight)}
|
|
382
363
|
nextFocusUp={tagForComponentOrHandle(this.props.nextFocusUp)}
|
|
383
|
-
focusable={
|
|
384
|
-
this.props.focusable !== false &&
|
|
385
|
-
this.props.onPress !== undefined &&
|
|
386
|
-
!this.props.disabled
|
|
387
|
-
}
|
|
388
364
|
nativeID={this.props.id ?? this.props.nativeID}
|
|
389
365
|
testID={this.props.testID}
|
|
390
366
|
ref={this.props.hostRef}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {GestureResponderEvent} from '../../Types/CoreEventTypes';
|
|
12
|
+
import type {TVViewProps} from '../TV/TVViewPropTypes';
|
|
12
13
|
import type {TouchableWithoutFeedbackProps} from './TouchableWithoutFeedback';
|
|
13
14
|
|
|
14
15
|
import View from '../../Components/View/View';
|
|
@@ -25,53 +26,9 @@ import invariant from 'invariant';
|
|
|
25
26
|
import * as React from 'react';
|
|
26
27
|
import {cloneElement} from 'react';
|
|
27
28
|
|
|
28
|
-
type TouchableNativeFeedbackTVProps = {
|
|
29
|
-
/**
|
|
30
|
-
* *(Apple TV only)* TV preferred focus (see documentation for the View component).
|
|
31
|
-
*
|
|
32
|
-
* @platform ios
|
|
33
|
-
*/
|
|
34
|
-
hasTVPreferredFocus?: ?boolean,
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Designates the next view to receive focus when the user navigates down. See the Android documentation.
|
|
38
|
-
*
|
|
39
|
-
* @platform android
|
|
40
|
-
*/
|
|
41
|
-
nextFocusDown?: ?number,
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Designates the next view to receive focus when the user navigates forward. See the Android documentation.
|
|
45
|
-
*
|
|
46
|
-
* @platform android
|
|
47
|
-
*/
|
|
48
|
-
nextFocusForward?: ?number,
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Designates the next view to receive focus when the user navigates left. See the Android documentation.
|
|
52
|
-
*
|
|
53
|
-
* @platform android
|
|
54
|
-
*/
|
|
55
|
-
nextFocusLeft?: ?number,
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Designates the next view to receive focus when the user navigates right. See the Android documentation.
|
|
59
|
-
*
|
|
60
|
-
* @platform android
|
|
61
|
-
*/
|
|
62
|
-
nextFocusRight?: ?number,
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Designates the next view to receive focus when the user navigates up. See the Android documentation.
|
|
66
|
-
*
|
|
67
|
-
* @platform android
|
|
68
|
-
*/
|
|
69
|
-
nextFocusUp?: ?number,
|
|
70
|
-
};
|
|
71
|
-
|
|
72
29
|
export type TouchableNativeFeedbackProps = $ReadOnly<{
|
|
73
30
|
...TouchableWithoutFeedbackProps,
|
|
74
|
-
...
|
|
31
|
+
...TVViewProps,
|
|
75
32
|
/**
|
|
76
33
|
* Determines the type of background drawable that's going to be used to display feedback.
|
|
77
34
|
* It takes an object with type property and extra data depending on the type.
|
|
@@ -366,16 +323,15 @@ class TouchableNativeFeedback extends React.Component<
|
|
|
366
323
|
this.props['aria-hidden'] ?? this.props.accessibilityElementsHidden,
|
|
367
324
|
hasTVPreferredFocus: this.props.hasTVPreferredFocus,
|
|
368
325
|
hitSlop: this.props.hitSlop,
|
|
369
|
-
focusable:
|
|
370
|
-
this.props.focusable !== false &&
|
|
371
|
-
this.props.onPress !== undefined &&
|
|
372
|
-
!this.props.disabled,
|
|
373
326
|
nativeID: this.props.id ?? this.props.nativeID,
|
|
374
327
|
nextFocusDown: tagForComponentOrHandle(this.props.nextFocusDown),
|
|
375
328
|
nextFocusForward: tagForComponentOrHandle(this.props.nextFocusForward),
|
|
376
329
|
nextFocusLeft: tagForComponentOrHandle(this.props.nextFocusLeft),
|
|
377
330
|
nextFocusRight: tagForComponentOrHandle(this.props.nextFocusRight),
|
|
378
331
|
nextFocusUp: tagForComponentOrHandle(this.props.nextFocusUp),
|
|
332
|
+
focusable:
|
|
333
|
+
this.props.focusable !== false &&
|
|
334
|
+
this.props.isTVSelectable !== false,
|
|
379
335
|
onLayout: this.props.onLayout,
|
|
380
336
|
testID: this.props.testID,
|
|
381
337
|
},
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {ViewStyleProp} from '../../StyleSheet/StyleSheet';
|
|
12
|
-
import type {
|
|
12
|
+
import type {TVViewProps} from '../TV/TVViewPropTypes';
|
|
13
13
|
import type {TouchableWithoutFeedbackProps} from './TouchableWithoutFeedback';
|
|
14
14
|
|
|
15
15
|
import Animated from '../../Animated/Animated';
|
|
@@ -23,52 +23,6 @@ import Platform from '../../Utilities/Platform';
|
|
|
23
23
|
import tagForComponentOrHandle from '../TV/tagForComponentOrHandle';
|
|
24
24
|
import * as React from 'react';
|
|
25
25
|
|
|
26
|
-
export type TouchableOpacityTVProps = $ReadOnly<{
|
|
27
|
-
/**
|
|
28
|
-
* *(Apple TV only)* TV preferred focus (see documentation for the View component).
|
|
29
|
-
*
|
|
30
|
-
* @platform ios
|
|
31
|
-
*/
|
|
32
|
-
hasTVPreferredFocus?: ?boolean,
|
|
33
|
-
isTVSelectable?: ?boolean,
|
|
34
|
-
tvParallaxProperties?: TVParallaxPropertiesType,
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Designates the next view to receive focus when the user navigates down. See the Android documentation.
|
|
38
|
-
*
|
|
39
|
-
* @platform android
|
|
40
|
-
*/
|
|
41
|
-
nextFocusDown?: ?number,
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Designates the next view to receive focus when the user navigates forward. See the Android documentation.
|
|
45
|
-
*
|
|
46
|
-
* @platform android
|
|
47
|
-
*/
|
|
48
|
-
nextFocusForward?: ?number,
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Designates the next view to receive focus when the user navigates left. See the Android documentation.
|
|
52
|
-
*
|
|
53
|
-
* @platform android
|
|
54
|
-
*/
|
|
55
|
-
nextFocusLeft?: ?number,
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Designates the next view to receive focus when the user navigates right. See the Android documentation.
|
|
59
|
-
*
|
|
60
|
-
* @platform android
|
|
61
|
-
*/
|
|
62
|
-
nextFocusRight?: ?number,
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Designates the next view to receive focus when the user navigates up. See the Android documentation.
|
|
66
|
-
*
|
|
67
|
-
* @platform android
|
|
68
|
-
*/
|
|
69
|
-
nextFocusUp?: ?number,
|
|
70
|
-
}>;
|
|
71
|
-
|
|
72
26
|
type TouchableOpacityBaseProps = $ReadOnly<{
|
|
73
27
|
/**
|
|
74
28
|
* Determines what the opacity of the wrapped view should be when touch is active.
|
|
@@ -82,7 +36,7 @@ type TouchableOpacityBaseProps = $ReadOnly<{
|
|
|
82
36
|
|
|
83
37
|
export type TouchableOpacityProps = $ReadOnly<{
|
|
84
38
|
...TouchableWithoutFeedbackProps,
|
|
85
|
-
...
|
|
39
|
+
...TVViewProps,
|
|
86
40
|
...TouchableOpacityBaseProps,
|
|
87
41
|
}>;
|
|
88
42
|
|
|
@@ -338,16 +292,12 @@ class TouchableOpacity extends React.Component<
|
|
|
338
292
|
nextFocusRight={tagForComponentOrHandle(this.props.nextFocusRight)}
|
|
339
293
|
nextFocusUp={tagForComponentOrHandle(this.props.nextFocusUp)}
|
|
340
294
|
hasTVPreferredFocus={this.props.hasTVPreferredFocus === true}
|
|
341
|
-
isTVSelectable={
|
|
342
|
-
this.props.isTVSelectable !== false && this.props.accessible !== false
|
|
343
|
-
}
|
|
344
|
-
tvParallaxProperties={this.props.tvParallaxProperties}
|
|
345
|
-
hitSlop={this.props.hitSlop}
|
|
346
295
|
focusable={
|
|
347
296
|
this.props.focusable !== false &&
|
|
348
|
-
this.props.
|
|
349
|
-
!this.props.disabled
|
|
297
|
+
this.props.isTVSelectable !== false
|
|
350
298
|
}
|
|
299
|
+
tvParallaxProperties={this.props.tvParallaxProperties}
|
|
300
|
+
hitSlop={this.props.hitSlop}
|
|
351
301
|
// $FlowFixMe[prop-missing]
|
|
352
302
|
ref={this.props.hostRef}
|
|
353
303
|
{...eventHandlers}>
|
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import type {HostInstance} from '../../../src/private/types/HostInstance';
|
|
11
12
|
import type {ViewProps} from './ViewPropTypes';
|
|
12
13
|
|
|
13
14
|
import TextAncestorContext from '../../Text/TextAncestorContext';
|
|
15
|
+
import Platform from '../../Utilities/Platform';
|
|
14
16
|
import useMergeRefs from '../../Utilities/useMergeRefs';
|
|
15
17
|
import ViewNativeComponent from './ViewNativeComponent';
|
|
16
18
|
import {Commands} from './ViewNativeComponent';
|
|
@@ -59,6 +61,8 @@ component View(
|
|
|
59
61
|
const {
|
|
60
62
|
accessibilityState,
|
|
61
63
|
accessibilityValue,
|
|
64
|
+
isTVSelectable,
|
|
65
|
+
focusable,
|
|
62
66
|
'aria-busy': ariaBusy,
|
|
63
67
|
'aria-checked': ariaChecked,
|
|
64
68
|
'aria-disabled': ariaDisabled,
|
|
@@ -141,6 +145,14 @@ component View(
|
|
|
141
145
|
};
|
|
142
146
|
}
|
|
143
147
|
|
|
148
|
+
if (Platform.OS === 'ios') {
|
|
149
|
+
processedProps.isTVSelectable = focusable ?? isTVSelectable ?? false;
|
|
150
|
+
delete processedProps.focusable;
|
|
151
|
+
} else {
|
|
152
|
+
processedProps.focusable = focusable ?? false;
|
|
153
|
+
delete processedProps.isTVSelectable;
|
|
154
|
+
}
|
|
155
|
+
|
|
144
156
|
const actualView =
|
|
145
157
|
ref == null ? (
|
|
146
158
|
<ViewNativeComponent {...processedProps} />
|
|
@@ -26,52 +26,92 @@ import {Touchable} from '../Touchable/Touchable';
|
|
|
26
26
|
import {AccessibilityProps} from './ViewAccessibility';
|
|
27
27
|
import type {BubblingEventHandler} from 'react-native/Libraries/Types/CodegenTypes';
|
|
28
28
|
|
|
29
|
-
export
|
|
29
|
+
export type TVParallaxProperties = {
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
|
|
31
|
+
* If true, parallax effects are enabled. Defaults to true.
|
|
32
|
+
*/
|
|
33
|
+
enabled?: boolean | undefined;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Defaults to 2.0.
|
|
37
|
+
*/
|
|
38
|
+
shiftDistanceX?: number | undefined;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Defaults to 2.0.
|
|
42
|
+
*/
|
|
43
|
+
shiftDistanceY?: number | undefined;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Defaults to 0.05.
|
|
47
|
+
*/
|
|
48
|
+
tiltAngle?: number | undefined;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Defaults to 1.0
|
|
52
|
+
*/
|
|
53
|
+
magnification?: number | undefined;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Defaults to 1.0
|
|
57
|
+
*/
|
|
58
|
+
pressMagnification?: number | undefined;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Defaults to 0.3
|
|
62
|
+
*/
|
|
63
|
+
pressDuration?: number | undefined;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated No longer used
|
|
67
|
+
*/
|
|
68
|
+
pressDelay?: number | undefined;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export interface TVViewProps {
|
|
72
|
+
/**
|
|
73
|
+
* Callback that is called when the view is blurred.
|
|
33
74
|
*
|
|
34
|
-
*
|
|
75
|
+
* Note: This will only be called if the view is focusable.
|
|
35
76
|
*/
|
|
36
|
-
|
|
77
|
+
onBlur?: ((e: BlurEvent) => void) | null | undefined;
|
|
37
78
|
|
|
38
79
|
/**
|
|
39
|
-
*
|
|
80
|
+
* Callback that is called when the view is focused.
|
|
40
81
|
*
|
|
41
|
-
*
|
|
82
|
+
* Note: This will only be called if the view is focusable.
|
|
42
83
|
*/
|
|
43
|
-
|
|
84
|
+
onFocus?: ((e: FocusEvent) => void) | null | undefined;
|
|
44
85
|
|
|
45
86
|
/**
|
|
46
|
-
*
|
|
87
|
+
* @deprecated Replaced by `focusable`.
|
|
47
88
|
*
|
|
48
89
|
* @platform ios
|
|
49
90
|
*/
|
|
50
|
-
|
|
91
|
+
isTVSelectable?: boolean | undefined;
|
|
51
92
|
|
|
52
93
|
/**
|
|
53
|
-
* *(Apple TV
|
|
94
|
+
* *(Apple TV and Android TV)* May be set to true to force the Apple TV focus engine to move focus to this view.
|
|
54
95
|
*
|
|
55
96
|
* @platform ios
|
|
56
97
|
*/
|
|
57
|
-
|
|
98
|
+
hasTVPreferredFocus?: boolean | undefined;
|
|
58
99
|
|
|
59
100
|
/**
|
|
60
|
-
*
|
|
101
|
+
* Whether this `View` should be focusable with a non-touch input device, eg. receive focus with a hardware keyboard.
|
|
61
102
|
*
|
|
62
|
-
* @platform ios
|
|
63
103
|
*/
|
|
64
|
-
|
|
104
|
+
focusable?: boolean | undefined;
|
|
65
105
|
|
|
66
106
|
/**
|
|
67
|
-
* *(Apple TV only)*
|
|
107
|
+
* *(Apple TV only)* Object with properties to control Apple TV parallax effects.
|
|
68
108
|
*
|
|
69
109
|
* @platform ios
|
|
70
110
|
*/
|
|
71
|
-
|
|
111
|
+
tvParallaxProperties?: TVParallaxProperties | undefined;
|
|
72
112
|
}
|
|
73
113
|
|
|
74
|
-
export interface ViewPropsIOS
|
|
114
|
+
export interface ViewPropsIOS {
|
|
75
115
|
/**
|
|
76
116
|
* Whether this view should be rendered as a bitmap before compositing.
|
|
77
117
|
*
|
|
@@ -86,20 +126,6 @@ export interface ViewPropsIOS extends TVViewPropsIOS {
|
|
|
86
126
|
}
|
|
87
127
|
|
|
88
128
|
export interface ViewPropsAndroid {
|
|
89
|
-
/**
|
|
90
|
-
* Callback that is called when the view is blurred.
|
|
91
|
-
*
|
|
92
|
-
* Note: This will only be called if the view is focusable.
|
|
93
|
-
*/
|
|
94
|
-
onBlur?: ((e: BlurEvent) => void) | null | undefined;
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Callback that is called when the view is focused.
|
|
98
|
-
*
|
|
99
|
-
* Note: This will only be called if the view is focusable.
|
|
100
|
-
*/
|
|
101
|
-
onFocus?: ((e: FocusEvent) => void) | null | undefined;
|
|
102
|
-
|
|
103
129
|
/**
|
|
104
130
|
* Whether this view should render itself (and all of its children) into a single hardware texture on the GPU.
|
|
105
131
|
*
|
|
@@ -109,11 +135,6 @@ export interface ViewPropsAndroid {
|
|
|
109
135
|
*/
|
|
110
136
|
renderToHardwareTextureAndroid?: boolean | undefined;
|
|
111
137
|
|
|
112
|
-
/**
|
|
113
|
-
* Whether this `View` should be focusable with a non-touch input device, eg. receive focus with a hardware keyboard.
|
|
114
|
-
*/
|
|
115
|
-
focusable?: boolean | undefined;
|
|
116
|
-
|
|
117
138
|
/**
|
|
118
139
|
* Indicates whether this `View` should be focusable with a non-touch input device, eg. receive focus with a hardware keyboard.
|
|
119
140
|
* See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
|
|
@@ -132,6 +153,7 @@ export interface ViewPropsAndroid {
|
|
|
132
153
|
export interface ViewProps
|
|
133
154
|
extends ViewPropsAndroid,
|
|
134
155
|
ViewPropsIOS,
|
|
156
|
+
TVViewProps,
|
|
135
157
|
GestureResponderHandlers,
|
|
136
158
|
Touchable,
|
|
137
159
|
PointerEvents,
|
|
@@ -283,20 +283,6 @@ export type ViewPropsAndroid = $ReadOnly<{
|
|
|
283
283
|
*/
|
|
284
284
|
renderToHardwareTextureAndroid?: ?boolean,
|
|
285
285
|
|
|
286
|
-
/**
|
|
287
|
-
* TV next focus forward (see documentation for the View component).
|
|
288
|
-
*
|
|
289
|
-
* @platform android
|
|
290
|
-
*/
|
|
291
|
-
nextFocusForward?: ?number,
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Whether this `View` should be focusable with a non-touch input device, eg. receive focus with a hardware keyboard.
|
|
295
|
-
*
|
|
296
|
-
* @platform android
|
|
297
|
-
*/
|
|
298
|
-
focusable?: ?boolean,
|
|
299
|
-
|
|
300
286
|
/**
|
|
301
287
|
* Indicates whether this `View` should be focusable with a non-touch input device, eg. receive focus with a hardware keyboard.
|
|
302
288
|
* See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
|
|
@@ -318,51 +304,6 @@ export type ViewPropsAndroid = $ReadOnly<{
|
|
|
318
304
|
onClick?: ?(event: GestureResponderEvent) => mixed,
|
|
319
305
|
}>;
|
|
320
306
|
|
|
321
|
-
export type TVViewPropsIOS = $ReadOnly<{
|
|
322
|
-
/**
|
|
323
|
-
* *(Apple TV only)* When set to true, this view will be focusable
|
|
324
|
-
* and navigable using the Apple TV remote.
|
|
325
|
-
*
|
|
326
|
-
* @platform ios
|
|
327
|
-
*/
|
|
328
|
-
isTVSelectable?: boolean,
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* *(Apple TV and Android TV)* May be set to true to force the Apple TV focus engine to move focus to this view.
|
|
332
|
-
*
|
|
333
|
-
* @platform ios
|
|
334
|
-
*/
|
|
335
|
-
hasTVPreferredFocus?: boolean,
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus. Defaults to 2.0.
|
|
339
|
-
*
|
|
340
|
-
* @platform ios
|
|
341
|
-
*/
|
|
342
|
-
tvParallaxShiftDistanceX?: number,
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
* *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus. Defaults to 2.0.
|
|
346
|
-
*
|
|
347
|
-
* @platform ios
|
|
348
|
-
*/
|
|
349
|
-
tvParallaxShiftDistanceY?: number,
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus. Defaults to 0.05.
|
|
353
|
-
*
|
|
354
|
-
* @platform ios
|
|
355
|
-
*/
|
|
356
|
-
tvParallaxTiltAngle?: number,
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus. Defaults to 1.0.
|
|
360
|
-
*
|
|
361
|
-
* @platform ios
|
|
362
|
-
*/
|
|
363
|
-
tvParallaxMagnification?: number,
|
|
364
|
-
}>;
|
|
365
|
-
|
|
366
307
|
export type ViewPropsIOS = $ReadOnly<{
|
|
367
308
|
/**
|
|
368
309
|
* Whether this `View` should be rendered as a bitmap before compositing.
|
|
@@ -374,32 +315,6 @@ export type ViewPropsIOS = $ReadOnly<{
|
|
|
374
315
|
shouldRasterizeIOS?: ?boolean,
|
|
375
316
|
}>;
|
|
376
317
|
|
|
377
|
-
type NextFocusProps = $ReadOnly<{
|
|
378
|
-
/**
|
|
379
|
-
* TV next focus down (see documentation for the View component).
|
|
380
|
-
*
|
|
381
|
-
*/
|
|
382
|
-
nextFocusDown?: ?number,
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
* TV next focus left (see documentation for the View component).
|
|
386
|
-
*
|
|
387
|
-
*/
|
|
388
|
-
nextFocusLeft?: ?number,
|
|
389
|
-
|
|
390
|
-
/**
|
|
391
|
-
* TV next focus right (see documentation for the View component).
|
|
392
|
-
*
|
|
393
|
-
*/
|
|
394
|
-
nextFocusRight?: ?number,
|
|
395
|
-
|
|
396
|
-
/**
|
|
397
|
-
* TV next focus up (see documentation for the View component).
|
|
398
|
-
*
|
|
399
|
-
*/
|
|
400
|
-
nextFocusUp?: ?number,
|
|
401
|
-
}>;
|
|
402
|
-
|
|
403
318
|
type ViewBaseProps = $ReadOnly<{
|
|
404
319
|
children?: React.Node,
|
|
405
320
|
style?: ?ViewStyleProp,
|
|
@@ -496,6 +411,11 @@ type ViewBaseProps = $ReadOnly<{
|
|
|
496
411
|
experimental_accessibilityOrder?: ?Array<string>,
|
|
497
412
|
}>;
|
|
498
413
|
|
|
414
|
+
// For compatibility with legacy types
|
|
415
|
+
export type TVViewPropsIOS = $ReadOnly<{|
|
|
416
|
+
...TVViewProps,
|
|
417
|
+
|}>;
|
|
418
|
+
|
|
499
419
|
export type ViewProps = $ReadOnly<{
|
|
500
420
|
...DirectEventProps,
|
|
501
421
|
...GestureResponderHandlers,
|
|
@@ -508,6 +428,5 @@ export type ViewProps = $ReadOnly<{
|
|
|
508
428
|
...AccessibilityProps,
|
|
509
429
|
...ViewBaseProps,
|
|
510
430
|
...TVViewProps,
|
|
511
|
-
...NextFocusProps,
|
|
512
431
|
...PressEventProps,
|
|
513
432
|
}>;
|
|
@@ -29,7 +29,7 @@ export default class ReactNativeVersion {
|
|
|
29
29
|
static major: number = 0;
|
|
30
30
|
static minor: number = 82;
|
|
31
31
|
static patch: number = 0;
|
|
32
|
-
static prerelease: string | null = '
|
|
32
|
+
static prerelease: string | null = '0rc5';
|
|
33
33
|
|
|
34
34
|
static getVersionString(): string {
|
|
35
35
|
return `${this.major}.${this.minor}.${this.patch}${this.prerelease != null ? `-${this.prerelease}` : ''}`;
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
import type {GestureResponderEvent} from '../Types/CoreEventTypes';
|
|
14
14
|
|
|
15
|
-
const InteractionManager = require('./InteractionManager').default;
|
|
16
15
|
const TouchHistoryMath = require('./TouchHistoryMath').default;
|
|
17
16
|
|
|
18
17
|
const currentCentroidXOfTouchesChangedAfter =
|
|
@@ -31,9 +30,6 @@ const currentCentroidY = TouchHistoryMath.currentCentroidY;
|
|
|
31
30
|
* single-touch gestures resilient to extra touches, and can be used to
|
|
32
31
|
* recognize simple multi-touch gestures.
|
|
33
32
|
*
|
|
34
|
-
* By default, `PanResponder` holds an `InteractionManager` handle to block
|
|
35
|
-
* long-running JS events from interrupting active gestures.
|
|
36
|
-
*
|
|
37
33
|
* It provides a predictable wrapper of the responder handlers provided by the
|
|
38
34
|
* [gesture responder system](docs/gesture-responder-system.html).
|
|
39
35
|
* For each handler, it provides a new `gestureState` object alongside the
|
|
@@ -405,9 +401,6 @@ const PanResponder = {
|
|
|
405
401
|
getInteractionHandle: () => ?number,
|
|
406
402
|
panHandlers: GestureResponderHandlerMethods,
|
|
407
403
|
} {
|
|
408
|
-
const interactionState = {
|
|
409
|
-
handle: (null: ?number),
|
|
410
|
-
};
|
|
411
404
|
const gestureState: PanResponderGestureState = {
|
|
412
405
|
// Useful for debugging
|
|
413
406
|
stateID: Math.random(),
|
|
@@ -464,10 +457,6 @@ const PanResponder = {
|
|
|
464
457
|
},
|
|
465
458
|
|
|
466
459
|
onResponderGrant(event: GestureResponderEvent): boolean {
|
|
467
|
-
if (!interactionState.handle) {
|
|
468
|
-
interactionState.handle =
|
|
469
|
-
InteractionManager.createInteractionHandle();
|
|
470
|
-
}
|
|
471
460
|
gestureState.x0 = currentCentroidX(event.touchHistory);
|
|
472
461
|
gestureState.y0 = currentCentroidY(event.touchHistory);
|
|
473
462
|
gestureState.dx = 0;
|
|
@@ -482,21 +471,11 @@ const PanResponder = {
|
|
|
482
471
|
},
|
|
483
472
|
|
|
484
473
|
onResponderReject(event: GestureResponderEvent): void {
|
|
485
|
-
|
|
486
|
-
interactionState,
|
|
487
|
-
config.onPanResponderReject,
|
|
488
|
-
event,
|
|
489
|
-
gestureState,
|
|
490
|
-
);
|
|
474
|
+
config.onPanResponderReject?.call(undefined, event, gestureState);
|
|
491
475
|
},
|
|
492
476
|
|
|
493
477
|
onResponderRelease(event: GestureResponderEvent): void {
|
|
494
|
-
|
|
495
|
-
interactionState,
|
|
496
|
-
config.onPanResponderRelease,
|
|
497
|
-
event,
|
|
498
|
-
gestureState,
|
|
499
|
-
);
|
|
478
|
+
config.onPanResponderRelease?.call(undefined, event, gestureState);
|
|
500
479
|
PanResponder._initializeGestureState(gestureState);
|
|
501
480
|
},
|
|
502
481
|
|
|
@@ -529,21 +508,11 @@ const PanResponder = {
|
|
|
529
508
|
onResponderEnd(event: GestureResponderEvent): void {
|
|
530
509
|
const touchHistory = event.touchHistory;
|
|
531
510
|
gestureState.numberActiveTouches = touchHistory.numberActiveTouches;
|
|
532
|
-
|
|
533
|
-
interactionState,
|
|
534
|
-
config.onPanResponderEnd,
|
|
535
|
-
event,
|
|
536
|
-
gestureState,
|
|
537
|
-
);
|
|
511
|
+
config.onPanResponderEnd?.call(undefined, event, gestureState);
|
|
538
512
|
},
|
|
539
513
|
|
|
540
514
|
onResponderTerminate(event: GestureResponderEvent): void {
|
|
541
|
-
|
|
542
|
-
interactionState,
|
|
543
|
-
config.onPanResponderTerminate,
|
|
544
|
-
event,
|
|
545
|
-
gestureState,
|
|
546
|
-
);
|
|
515
|
+
config.onPanResponderTerminate?.call(undefined, event, gestureState);
|
|
547
516
|
PanResponder._initializeGestureState(gestureState);
|
|
548
517
|
},
|
|
549
518
|
|
|
@@ -556,27 +525,13 @@ const PanResponder = {
|
|
|
556
525
|
return {
|
|
557
526
|
panHandlers,
|
|
558
527
|
getInteractionHandle(): ?number {
|
|
559
|
-
|
|
528
|
+
// TODO: Deprecate and delete this method.
|
|
529
|
+
return null;
|
|
560
530
|
},
|
|
561
531
|
};
|
|
562
532
|
},
|
|
563
533
|
};
|
|
564
534
|
|
|
565
|
-
function clearInteractionHandle(
|
|
566
|
-
interactionState: {handle: ?number, ...},
|
|
567
|
-
callback: ?(ActiveCallback | PassiveCallback),
|
|
568
|
-
event: GestureResponderEvent,
|
|
569
|
-
gestureState: PanResponderGestureState,
|
|
570
|
-
) {
|
|
571
|
-
if (interactionState.handle) {
|
|
572
|
-
InteractionManager.clearInteractionHandle(interactionState.handle);
|
|
573
|
-
interactionState.handle = null;
|
|
574
|
-
}
|
|
575
|
-
if (callback) {
|
|
576
|
-
callback(event, gestureState);
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
|
|
580
535
|
export type PanResponderInstance = ReturnType<(typeof PanResponder)['create']>;
|
|
581
536
|
|
|
582
537
|
export default PanResponder;
|
package/React/Base/RCTBridge.mm
CHANGED
|
@@ -380,6 +380,11 @@ static RCTBridge *RCTCurrentBridgeInstance = nil;
|
|
|
380
380
|
moduleProvider:(RCTBridgeModuleListProvider)block
|
|
381
381
|
launchOptions:(NSDictionary *)launchOptions
|
|
382
382
|
{
|
|
383
|
+
// Only enabld this assertion in OSS
|
|
384
|
+
#if COCOAPODS
|
|
385
|
+
[RCTBridge throwIfOnLegacyArch];
|
|
386
|
+
#endif
|
|
387
|
+
|
|
383
388
|
if (self = [super init]) {
|
|
384
389
|
RCTEnforceNewArchitectureValidation(RCTNotAllowedInBridgeless, self, nil);
|
|
385
390
|
_delegate = delegate;
|
|
@@ -393,6 +398,17 @@ static RCTBridge *RCTCurrentBridgeInstance = nil;
|
|
|
393
398
|
return self;
|
|
394
399
|
}
|
|
395
400
|
|
|
401
|
+
// Wrap the exception throwing in a static method to avoid the warning: "The code following the exception will never be
|
|
402
|
+
// executed". This might create build failures internally where we treat warnings as errors.
|
|
403
|
+
+ (void)throwIfOnLegacyArch
|
|
404
|
+
{
|
|
405
|
+
@throw [NSException
|
|
406
|
+
exceptionWithName:NSInternalInconsistencyException
|
|
407
|
+
reason:
|
|
408
|
+
@"You are trying to initialize the legacy architecture. This is not supported anymore and will be removed in the next version of React Native. Please use the New Architecture instead."
|
|
409
|
+
userInfo:nil];
|
|
410
|
+
}
|
|
411
|
+
|
|
396
412
|
RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
|
397
413
|
|
|
398
414
|
- (void)dealloc
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -111,6 +111,12 @@ typedef NS_OPTIONS(NSInteger, RNComponentViewUpdateMask) {
|
|
|
111
111
|
*/
|
|
112
112
|
- (void)prepareForRecycle;
|
|
113
113
|
|
|
114
|
+
/*
|
|
115
|
+
* Called for unmounted components that won't be moved to a recycle pool.
|
|
116
|
+
* Useful for releasing any associated resources.
|
|
117
|
+
*/
|
|
118
|
+
- (void)invalidate;
|
|
119
|
+
|
|
114
120
|
/*
|
|
115
121
|
* Read the last props used to update the view.
|
|
116
122
|
*/
|
|
@@ -108,6 +108,7 @@ const NSInteger RCTComponentViewRegistryRecyclePoolMaxSize = 1024;
|
|
|
108
108
|
auto &recycledViews = _recyclePool[componentHandle];
|
|
109
109
|
|
|
110
110
|
if (recycledViews.size() > RCTComponentViewRegistryRecyclePoolMaxSize || !componentViewDescriptor.shouldBeRecycled) {
|
|
111
|
+
[componentViewDescriptor.view invalidate];
|
|
111
112
|
return;
|
|
112
113
|
}
|
|
113
114
|
|
|
@@ -129,6 +129,11 @@ using namespace facebook::react;
|
|
|
129
129
|
// Default implementation does nothing.
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
- (void)invalidate
|
|
133
|
+
{
|
|
134
|
+
// Default implementation does nothing.
|
|
135
|
+
}
|
|
136
|
+
|
|
132
137
|
- (facebook::react::Props::Shared)props
|
|
133
138
|
{
|
|
134
139
|
RCTAssert(NO, @"props access should be implemented by RCTViewComponentView.");
|
|
@@ -1360,7 +1360,8 @@ public open class ReactViewGroup public constructor(context: Context?) :
|
|
|
1360
1360
|
}
|
|
1361
1361
|
|
|
1362
1362
|
override fun onFocusChanged(gainFocus: Boolean, direction: Int, previouslyFocusedRect: Rect?) {
|
|
1363
|
-
super
|
|
1363
|
+
// Calling the super method causes duplicate events
|
|
1364
|
+
// super.onFocusChanged(gainFocus, direction, previouslyFocusedRect)
|
|
1364
1365
|
|
|
1365
1366
|
val mEventDispatcher: EventDispatcher? =
|
|
1366
1367
|
UIManagerHelper.getEventDispatcherForReactTag(
|
|
@@ -98,16 +98,7 @@ public open class ReactViewManager : ReactClippingViewManager<ReactViewGroup>()
|
|
|
98
98
|
|
|
99
99
|
@ReactProp(name = "accessible")
|
|
100
100
|
public open fun setAccessible(view: ReactViewGroup, accessible: Boolean) {
|
|
101
|
-
|
|
102
|
-
// This is required to handle Android TV/ Fire TV Devices that are Touch Enabled as well as LeanBack
|
|
103
|
-
// https://developer.android.com/reference/android/view/View#requestFocus(int,%20android.graphics.Rect)
|
|
104
|
-
// ** A view will not actually take focus if it is not focusable (isFocusable() returns false), **
|
|
105
|
-
// ** or if it is focusable and it is not focusable in touch mode (isFocusableInTouchMode()) **
|
|
106
|
-
// ** while the device is in touch mode. **
|
|
107
|
-
if (hasTouchScreen(view.context)) {
|
|
108
|
-
view.isFocusableInTouchMode = accessible
|
|
109
|
-
}
|
|
110
|
-
|
|
101
|
+
// TODO: determine if any AxOrder changes should be put here
|
|
111
102
|
}
|
|
112
103
|
|
|
113
104
|
@ReactProp(name = "tvFocusable")
|
|
@@ -419,6 +410,14 @@ public open class ReactViewManager : ReactClippingViewManager<ReactViewGroup>()
|
|
|
419
410
|
// Don't set view.setFocusable(false) because we might still want it to be focusable for
|
|
420
411
|
// accessibility reasons
|
|
421
412
|
}
|
|
413
|
+
// This is required to handle Android TV/ Fire TV Devices that are Touch Enabled as well as LeanBack
|
|
414
|
+
// https://developer.android.com/reference/android/view/View#requestFocus(int,%20android.graphics.Rect)
|
|
415
|
+
// ** A view will not actually take focus if it is not focusable (isFocusable() returns false), **
|
|
416
|
+
// ** or if it is focusable and it is not focusable in touch mode (isFocusableInTouchMode()) **
|
|
417
|
+
// ** while the device is in touch mode. **
|
|
418
|
+
if (hasTouchScreen(view.context)) {
|
|
419
|
+
view.isFocusableInTouchMode = focusable
|
|
420
|
+
}
|
|
422
421
|
}
|
|
423
422
|
|
|
424
423
|
@ReactProp(name = ViewProps.OVERFLOW)
|
package/index.js
CHANGED
|
@@ -224,6 +224,12 @@ module.exports = {
|
|
|
224
224
|
* @deprecated
|
|
225
225
|
*/
|
|
226
226
|
get InteractionManager() {
|
|
227
|
+
warnOnce(
|
|
228
|
+
'interaction-manager-deprecated',
|
|
229
|
+
'InteractionManager has been deprecated and will be removed in a ' +
|
|
230
|
+
'future release. Please refactor long tasks into smaller ones, and ' +
|
|
231
|
+
" use 'requestIdleCallback' instead.",
|
|
232
|
+
);
|
|
227
233
|
return require('./Libraries/Interaction/InteractionManager').default;
|
|
228
234
|
},
|
|
229
235
|
get Keyboard() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-tvos",
|
|
3
|
-
"version": "0.82.0-
|
|
3
|
+
"version": "0.82.0-0rc5",
|
|
4
4
|
"description": "A framework for building native apps using React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -166,12 +166,12 @@
|
|
|
166
166
|
},
|
|
167
167
|
"dependencies": {
|
|
168
168
|
"@jest/create-cache-key-function": "^29.7.0",
|
|
169
|
-
"@react-native/assets-registry": "0.82.0-rc.
|
|
170
|
-
"@react-native/codegen": "0.82.0-rc.
|
|
171
|
-
"@react-native/community-cli-plugin": "0.82.0-rc.
|
|
172
|
-
"@react-native/gradle-plugin": "0.82.0-rc.
|
|
173
|
-
"@react-native/js-polyfills": "0.82.0-rc.
|
|
174
|
-
"@react-native/normalize-colors": "0.82.0-rc.
|
|
169
|
+
"@react-native/assets-registry": "0.82.0-rc.5",
|
|
170
|
+
"@react-native/codegen": "0.82.0-rc.5",
|
|
171
|
+
"@react-native/community-cli-plugin": "0.82.0-rc.5",
|
|
172
|
+
"@react-native/gradle-plugin": "0.82.0-rc.5",
|
|
173
|
+
"@react-native/js-polyfills": "0.82.0-rc.5",
|
|
174
|
+
"@react-native/normalize-colors": "0.82.0-rc.5",
|
|
175
175
|
"abort-controller": "^3.0.0",
|
|
176
176
|
"anser": "^1.4.9",
|
|
177
177
|
"ansi-regex": "^5.0.0",
|
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
"whatwg-fetch": "^3.0.0",
|
|
200
200
|
"ws": "^6.2.3",
|
|
201
201
|
"yargs": "^17.6.2",
|
|
202
|
-
"@react-native-tvos/virtualized-lists": "0.82.0-
|
|
202
|
+
"@react-native-tvos/virtualized-lists": "0.82.0-0rc5"
|
|
203
203
|
},
|
|
204
204
|
"codegenConfig": {
|
|
205
205
|
"libraries": [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
HERMES_V1_VERSION_NAME=250829098.0.
|
|
1
|
+
HERMES_V1_VERSION_NAME=250829098.0.1
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { View, ScrollViewProps, HostComponent, EventSubscription } from 'react-native';
|
|
2
|
+
import type { View, ScrollViewProps, HostComponent, EventSubscription, TVParallaxProperties } from 'react-native';
|
|
3
3
|
|
|
4
4
|
declare module 'react-native' {
|
|
5
5
|
export type FocusDestination = null | number | React.Component<any, any> | React.ComponentClass<any>;
|
|
@@ -65,48 +65,6 @@ declare module 'react-native' {
|
|
|
65
65
|
} | undefined
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
-
export type TVParallaxProperties = {
|
|
69
|
-
/**
|
|
70
|
-
* If true, parallax effects are enabled. Defaults to true.
|
|
71
|
-
*/
|
|
72
|
-
enabled?: boolean | undefined,
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Defaults to 2.0.
|
|
76
|
-
*/
|
|
77
|
-
shiftDistanceX?: number | undefined,
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Defaults to 2.0.
|
|
81
|
-
*/
|
|
82
|
-
shiftDistanceY?: number | undefined,
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Defaults to 0.05.
|
|
86
|
-
*/
|
|
87
|
-
tiltAngle?: number | undefined,
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Defaults to 1.0
|
|
91
|
-
*/
|
|
92
|
-
magnification?: number | undefined,
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Defaults to 1.0
|
|
96
|
-
*/
|
|
97
|
-
pressMagnification?: number | undefined,
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Defaults to 0.3
|
|
101
|
-
*/
|
|
102
|
-
pressDuration?: number | undefined,
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* @deprecated No longer used
|
|
106
|
-
*/
|
|
107
|
-
pressDelay?: number | undefined,
|
|
108
|
-
};
|
|
109
|
-
|
|
110
68
|
export const TVEventHandler: {
|
|
111
69
|
addListener: (listener: (event: HWEvent) => void) => EventSubscription | undefined
|
|
112
70
|
};
|