@applicaster/zapp-react-native-ui-components 14.0.0-alpha.6242515303 → 14.0.0-alpha.6461844364

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.
Files changed (34) hide show
  1. package/Components/AnimatedInOut/index.tsx +5 -3
  2. package/Components/Cell/Cell.tsx +8 -3
  3. package/Components/Focusable/Focusable.tsx +5 -3
  4. package/Components/Focusable/FocusableTvOS.tsx +3 -3
  5. package/Components/FocusableList/index.tsx +4 -0
  6. package/Components/HandlePlayable/HandlePlayable.tsx +14 -8
  7. package/Components/MasterCell/elementMapper.tsx +1 -2
  8. package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +13 -18
  9. package/Components/OfflineHandler/__tests__/__snapshots__/index.test.tsx.snap +9 -0
  10. package/Components/PlayerContainer/PlayerContainer.tsx +41 -28
  11. package/Components/River/ComponentsMap/ComponentsMap.tsx +0 -1
  12. package/Components/River/TV/withTVEventHandler.tsx +1 -1
  13. package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +2 -0
  14. package/Components/Tabs/TV/Tabs.android.tsx +0 -2
  15. package/Components/TextInputTv/__tests__/__snapshots__/TextInputTv.test.js.snap +13 -0
  16. package/Components/TextInputTv/index.tsx +11 -0
  17. package/Components/Touchable/__tests__/__snapshots__/touchable.test.tsx.snap +34 -0
  18. package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +15 -9
  19. package/Components/VideoLive/animationUtils.ts +3 -3
  20. package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +3 -9
  21. package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +9 -1
  22. package/Components/VideoModal/PlayerDetails.tsx +24 -2
  23. package/Components/VideoModal/PlayerWrapper.tsx +26 -142
  24. package/Components/VideoModal/VideoModal.tsx +3 -17
  25. package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +1 -7
  26. package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +44 -240
  27. package/Components/VideoModal/hooks/index.ts +0 -2
  28. package/Components/VideoModal/hooks/useModalSize.ts +18 -2
  29. package/Components/VideoModal/utils.ts +6 -0
  30. package/Components/Viewport/ViewportAware/__tests__/viewportAware.test.js +12 -16
  31. package/Components/Viewport/ViewportTracker/__tests__/viewportTracker.test.js +84 -24
  32. package/Decorators/ConfigurationWrapper/withConfigurationProvider.tsx +2 -2
  33. package/package.json +5 -6
  34. package/Components/VideoModal/hooks/useBackgroundColor.ts +0 -10
@@ -4,9 +4,11 @@ import { usePrevious } from "@applicaster/zapp-react-native-utils/reactHooks/uti
4
4
  import { toBooleanWithDefaultFalse } from "@applicaster/zapp-react-native-utils/booleanUtils";
5
5
  import { noop } from "@applicaster/zapp-react-native-utils/functionUtils";
6
6
 
7
- type AnimatedInterpolatedStyle =
8
- | Animated.AnimatedInterpolation
9
- | [{ [Key: string]: Animated.AnimatedInterpolation }];
7
+ type AnimatedInterpolatedStyle = any;
8
+
9
+ // type AnimatedInterpolatedStyle =
10
+ // | Animated.AnimatedInterpolation
11
+ // | [{ [Key: string]: Animated.AnimatedInterpolation }];
10
12
 
11
13
  type AnimationConfig = {
12
14
  duration: number;
@@ -70,6 +70,8 @@ type State = {
70
70
  };
71
71
 
72
72
  export class CellComponent extends React.Component<Props, State> {
73
+ accessibilityManager: AccessibilityManager;
74
+
73
75
  constructor(props) {
74
76
  super(props);
75
77
  this.onPress = this.onPress.bind(this);
@@ -83,6 +85,8 @@ export class CellComponent extends React.Component<Props, State> {
83
85
  this.state = {
84
86
  hasFocusableInside: props.CellRenderer.hasFocusableInside?.(props.item),
85
87
  };
88
+
89
+ this.accessibilityManager = AccessibilityManager.getInstance();
86
90
  }
87
91
 
88
92
  setScreenLayout(componentAnchorPointY, screenLayout) {
@@ -257,20 +261,21 @@ export class CellComponent extends React.Component<Props, State> {
257
261
  style={styles.baseCell}
258
262
  isFocusable={isFocusable}
259
263
  skipFocusManagerRegistration={skipFocusManagerRegistration}
264
+ {...this.accessibilityManager.getButtonAccessibilityProps(
265
+ item?.extensions?.accessibility?.label || item?.title
266
+ )}
260
267
  >
261
268
  {(focused, event) => {
262
269
  const isFocused = this.isCellFocused(focused);
263
270
 
264
271
  if (isFocused) {
265
- const accessibilityManager = AccessibilityManager.getInstance();
266
-
267
272
  const accessibilityTitle =
268
273
  item?.extensions?.accessibility?.label || item?.title || "";
269
274
 
270
275
  const accessibilityHint =
271
276
  item?.extensions?.accessibility?.hint || "";
272
277
 
273
- accessibilityManager.readText({
278
+ this.accessibilityManager.readText({
274
279
  text: `${accessibilityTitle} ${accessibilityHint}`,
275
280
  });
276
281
  }
@@ -5,6 +5,7 @@ import { BaseFocusable } from "../BaseFocusable";
5
5
  import { focusManager } from "@applicaster/zapp-react-native-utils/appUtils/focusManager";
6
6
  import { LONG_KEY_PRESS_TIMEOUT } from "@applicaster/quick-brick-core/const";
7
7
  import { withFocusableContext } from "../../Contexts/FocusableGroupContext/withFocusableContext";
8
+ import { StyleSheet, ViewStyle } from "react-native";
8
9
 
9
10
  type Props = {
10
11
  initialFocus?: boolean;
@@ -21,7 +22,7 @@ type Props = {
21
22
  handleFocus?: ({ mouse }: { mouse: boolean }) => void;
22
23
  children: (boolean, string) => React.ComponentType<any>;
23
24
  selected?: boolean;
24
- style?: React.CSSProperties;
25
+ style?: ViewStyle[] | ViewStyle;
25
26
  };
26
27
 
27
28
  class Focusable extends BaseFocusable<Props> {
@@ -122,7 +123,7 @@ class Focusable extends BaseFocusable<Props> {
122
123
  }
123
124
 
124
125
  render() {
125
- const { children, style } = this.props;
126
+ const { children, style, ...otherProps } = this.props;
126
127
  const { focused } = this.state;
127
128
 
128
129
  const id = this.getId();
@@ -139,7 +140,8 @@ class Focusable extends BaseFocusable<Props> {
139
140
  onMouseUp={this.pressOut}
140
141
  data-testid={focusableId}
141
142
  focused-teststate={focused ? "focused" : "default"}
142
- style={style}
143
+ style={StyleSheet.flatten(style) as any as React.CSSProperties}
144
+ {...otherProps}
143
145
  >
144
146
  {children(focused, { mouse: this.mouse })}
145
147
  </div>
@@ -16,9 +16,9 @@ function noop() {}
16
16
  type Props = {
17
17
  id: string;
18
18
  groupId: string;
19
- onPress?: (nativeEvent: React.SyntheticEvent) => void;
20
- onFocus?: (nativeEvent: React.SyntheticEvent) => void;
21
- onBlur?: (nativeEvent: React.SyntheticEvent) => void;
19
+ onPress?: (nativeEvent: any) => void;
20
+ onFocus?: (nativeEvent: any) => void;
21
+ onBlur?: (nativeEvent: any) => void;
22
22
  children: (focused?: boolean) => React.ReactNode;
23
23
  isParallaxDisabled: boolean;
24
24
  preferredFocus?: boolean;
@@ -91,6 +91,7 @@ function FocusableListComponent<ItemT>(props: Props<ItemT>, ref) {
91
91
  // eslint-disable-next-line unused-imports/no-unused-vars
92
92
  omitPropsPropagation = [],
93
93
  useScrollView = false,
94
+ onScrollToIndexFailed = noop,
94
95
  } = props;
95
96
 
96
97
  useCheckItemIdsForUnique({ componentId: props.id, items: data });
@@ -277,6 +278,7 @@ function FocusableListComponent<ItemT>(props: Props<ItemT>, ref) {
277
278
  "withStateMemory",
278
279
  "useSequentialLoading",
279
280
  "useScrollView",
281
+ "onScrollToIndexFailed",
280
282
  ...omitPropsPropagation,
281
283
  ],
282
284
  R.__
@@ -305,6 +307,7 @@ function FocusableListComponent<ItemT>(props: Props<ItemT>, ref) {
305
307
  {...getFlatListProps(props)}
306
308
  onEndReached={onEndReached}
307
309
  initialNumToRender={initialNumToRender}
310
+ onScrollToIndexFailed={onScrollToIndexFailed}
308
311
  renderItem={renderItem}
309
312
  focused={focused}
310
313
  data={data}
@@ -319,6 +322,7 @@ function FocusableListComponent<ItemT>(props: Props<ItemT>, ref) {
319
322
  renderItem={renderItem}
320
323
  onEndReached={onEndReached}
321
324
  initialNumToRender={initialNumToRender}
325
+ onScrollToIndexFailed={onScrollToIndexFailed}
322
326
  />
323
327
  )}
324
328
  </ChildrenFocusDeactivatorView>
@@ -14,6 +14,7 @@ import {
14
14
  import { BufferAnimation } from "../PlayerContainer/BufferAnimation";
15
15
  import { PlayerContainer } from "../PlayerContainer";
16
16
  import { useModalSize } from "../VideoModal/hooks";
17
+ import { ViewStyle } from "react-native";
17
18
  import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
18
19
 
19
20
  type Props = {
@@ -150,14 +151,19 @@ export function HandlePlayable({
150
151
  const modalSize = useModalSize();
151
152
 
152
153
  const style = React.useMemo(
153
- () => ({
154
- width: isModal ? modalSize.width : mode === "PIP" ? "100%" : screenWidth,
155
- height: isModal
156
- ? modalSize.height
157
- : mode === "PIP"
158
- ? "100%"
159
- : screenHeight,
160
- }),
154
+ () =>
155
+ ({
156
+ width: isModal
157
+ ? modalSize.width
158
+ : mode === "PIP"
159
+ ? "100%"
160
+ : screenWidth,
161
+ height: isModal
162
+ ? modalSize.height
163
+ : mode === "PIP"
164
+ ? "100%"
165
+ : screenHeight,
166
+ }) as ViewStyle,
161
167
  [screenWidth, screenHeight, modalSize, isModal, mode]
162
168
  );
163
169
 
@@ -73,7 +73,6 @@ export function elementMapper(
73
73
  : {};
74
74
 
75
75
  const componentProps = {
76
- key,
77
76
  style,
78
77
  skipButtons: otherProps?.skipButtons,
79
78
  emitAsyncElementRegistrate: otherProps?.emitAsyncElementRegistrate,
@@ -91,7 +90,7 @@ export function elementMapper(
91
90
  const fn = mapElementWithKey(elementMapper(components, otherProps));
92
91
 
93
92
  return (
94
- <Component {...componentProps}>
93
+ <Component key={key} {...componentProps}>
95
94
  {focusableTypes.has(type) && elements.length > 0
96
95
  ? elements.map(fn)
97
96
  : null}
@@ -1,9 +1,12 @@
1
1
  import React from "react";
2
2
  import { Text, Animated } from "react-native";
3
+ import { render } from "@testing-library/react-native";
3
4
 
4
- import renderer from "react-test-renderer";
5
-
6
- jest.useFakeTimers();
5
+ import {
6
+ NotificationView,
7
+ onlinePhrase,
8
+ offlinePhrase,
9
+ } from "../NotificationView";
7
10
 
8
11
  jest.mock("@applicaster/zapp-react-native-redux/hooks", () => ({
9
12
  usePickFromState: () => ({
@@ -32,39 +35,31 @@ jest.mock("react-native-safe-area-context", () => ({
32
35
 
33
36
  const dismiss = jest.fn();
34
37
 
35
- const {
36
- NotificationView,
37
- onlinePhrase,
38
- offlinePhrase,
39
- } = require("../NotificationView");
40
-
41
38
  describe("NotificationView", () => {
42
39
  it("Show online message when Online", () => {
43
- const component = renderer.create(
44
- <NotificationView online dismiss={dismiss} />
45
- );
40
+ const component = render(<NotificationView online dismiss={dismiss} />);
46
41
 
47
- expect(component.root.findByType(Text).props.children).toBe(onlinePhrase);
42
+ expect(component.UNSAFE_getByType(Text).props.children).toBe(onlinePhrase);
48
43
  });
49
44
 
50
45
  it("Show offline message when Online", () => {
51
- const component = renderer.create(
46
+ const component = render(
52
47
  <NotificationView online={false} dismiss={dismiss} />
53
48
  );
54
49
 
55
- expect(component.root.findByType(Text).props.children).toBe(offlinePhrase);
50
+ expect(component.UNSAFE_getByType(Text).props.children).toBe(offlinePhrase);
56
51
  });
57
52
 
58
53
  it("When hidden is false to true notification is visible", () => {
59
- const component = renderer.create(
54
+ const component = render(
60
55
  <NotificationView online={false} hidden={false} dismiss={dismiss} />
61
56
  );
62
57
 
63
- component.update(
58
+ component.rerender(
64
59
  <NotificationView online={false} hidden={true} dismiss={dismiss} />
65
60
  );
66
61
 
67
- const animatedView = component.root.findByType(Animated.View);
62
+ const animatedView = component.UNSAFE_getByType(Animated.View);
68
63
  const animatedViewStyles = animatedView.props.style;
69
64
 
70
65
  expect(animatedViewStyles.opacity).toBe(1);
@@ -21,6 +21,15 @@ exports[`OfflineHandler renders 1`] = `
21
21
  }
22
22
  >
23
23
  <View
24
+ accessibilityState={
25
+ {
26
+ "busy": undefined,
27
+ "checked": undefined,
28
+ "disabled": undefined,
29
+ "expanded": undefined,
30
+ "selected": undefined,
31
+ }
32
+ }
24
33
  accessible={true}
25
34
  collapsable={false}
26
35
  focusable={true}
@@ -1,7 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { useEffect, useReducer } from "react";
3
- // @ts-ignore
4
- import { TVMenuControl, View, ViewStyle } from "react-native";
3
+ import { View, ViewStyle } from "react-native";
5
4
  import * as R from "ramda";
6
5
  import uuid from "uuid/v4";
7
6
  import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils/playerManager";
@@ -62,6 +61,11 @@ import {
62
61
  useModalAnimationContext,
63
62
  } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
64
63
 
64
+ import {
65
+ PlayerNativeCommandTypes,
66
+ PlayerNativeSendCommand,
67
+ } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/playerNativeCommand";
68
+
65
69
  type Props = {
66
70
  Player: React.ComponentType<any>;
67
71
  PlayerLoadingView?: React.ComponentType<any>; // 👀 we are not receiving this prop
@@ -88,7 +92,7 @@ export const VideoModalMode = {
88
92
  MAXIMIZED: "MAXIMIZED",
89
93
  MINIMIZED: "MINIMIZED",
90
94
  FULLSCREEN: "FULLSCREEN",
91
- };
95
+ } as const;
92
96
 
93
97
  export type PlayNextData = {
94
98
  state: PlayNextState;
@@ -127,7 +131,7 @@ const webStyles = {
127
131
  playerScreen: {
128
132
  flex: 1,
129
133
  height: "100vh",
130
- background: "black",
134
+ backgroundColor: "black",
131
135
  },
132
136
  playerWrapper: {
133
137
  height: "100%",
@@ -145,7 +149,6 @@ const nativeStyles = {
145
149
  },
146
150
  playerScreen: {
147
151
  flex: 1,
148
- backgroundColor: "black",
149
152
  overflow: "hidden",
150
153
  },
151
154
  playerWrapper: {
@@ -260,9 +263,15 @@ const PlayerContainerComponent = (props: Props) => {
260
263
  return;
261
264
  }
262
265
 
266
+ // send command to clear and stop player
267
+ PlayerNativeSendCommand(
268
+ PlayerNativeCommandTypes.clearPlayerData,
269
+ state.playerId
270
+ );
271
+
263
272
  showNavBar(true);
264
273
  navigator.goBack();
265
- }, [isModal, navigator.goBack, showNavBar]);
274
+ }, [isModal, navigator.goBack, state.playerId, showNavBar]);
266
275
 
267
276
  const playEntry = (entry) => navigator.replaceTop(entry, { mode });
268
277
 
@@ -390,13 +399,17 @@ const PlayerContainerComponent = (props: Props) => {
390
399
  }
391
400
  };
392
401
 
393
- const playerRemoteHandler = (event, isLanguageOverlayVisible) => {
394
- const { eventType } = event;
402
+ const playerRemoteHandler = React.useCallback(
403
+ (isLanguageOverlayVisible = false) =>
404
+ (event) => {
405
+ const { eventType } = event;
395
406
 
396
- if (!isLanguageOverlayVisible && eventType === "menu") {
397
- close();
398
- }
399
- };
407
+ if (!isLanguageOverlayVisible && eventType === "menu") {
408
+ close();
409
+ }
410
+ },
411
+ [close]
412
+ );
400
413
 
401
414
  // Effects
402
415
  useEffect(() => {
@@ -509,16 +522,6 @@ const PlayerContainerComponent = (props: Props) => {
509
522
  }
510
523
  }, [isAudioContent]);
511
524
 
512
- // Needs to handle back button on Apple TV
513
- // https://github.com/facebook/react-native/issues/18930
514
- useEffect(() => {
515
- TVMenuControl?.enableTVMenuKey();
516
-
517
- return () => {
518
- TVMenuControl?.disableTVMenuKey();
519
- };
520
- }, []);
521
-
522
525
  useEffect(() => {
523
526
  playerEvent("source_changed", { item });
524
527
 
@@ -565,8 +568,9 @@ const PlayerContainerComponent = (props: Props) => {
565
568
  const isInlineTV = isInlineTVUtil(screenData);
566
569
 
567
570
  const inline =
568
- [VideoModalMode.MAXIMIZED, VideoModalMode.MINIMIZED].includes(mode) ||
569
- isInlineTV;
571
+ [VideoModalMode.MAXIMIZED, VideoModalMode.MINIMIZED].includes(
572
+ mode as any
573
+ ) || isInlineTV;
570
574
 
571
575
  const value = React.useMemo(
572
576
  () => ({ playerId: state.playerId }),
@@ -587,7 +591,11 @@ const PlayerContainerComponent = (props: Props) => {
587
591
  );
588
592
  }
589
593
 
590
- if (screen_background_color && mode !== VideoModalMode.FULLSCREEN) {
594
+ if (
595
+ screen_background_color &&
596
+ mode !== VideoModalMode.FULLSCREEN &&
597
+ isTV()
598
+ ) {
591
599
  updatedStyles.playerScreen.backgroundColor = screen_background_color;
592
600
  }
593
601
 
@@ -617,6 +625,8 @@ const PlayerContainerComponent = (props: Props) => {
617
625
  playNextData,
618
626
  };
619
627
 
628
+ const pointerEventsProp = mode === "MINIMIZED" ? "box-none" : "auto";
629
+
620
630
  return (
621
631
  <PlayerStateContext.Provider value={value}>
622
632
  <PlayerContainerContextProvider
@@ -627,9 +637,9 @@ const PlayerContainerComponent = (props: Props) => {
627
637
  <PlayerContainerContext.Consumer>
628
638
  {(context) => (
629
639
  <TVEventHandlerComponent
630
- tvEventHandler={(_component, event) =>
631
- playerRemoteHandler(event, context.isLanguageOverlayVisible)
632
- }
640
+ tvEventHandler={playerRemoteHandler(
641
+ context.isLanguageOverlayVisible
642
+ )}
633
643
  >
634
644
  <FocusableGroup
635
645
  id={FocusableGroupMainContainerId}
@@ -637,14 +647,17 @@ const PlayerContainerComponent = (props: Props) => {
637
647
  preferredFocus
638
648
  shouldUsePreferredFocus
639
649
  groupId={groupId}
650
+ pointerEvents={pointerEventsProp}
640
651
  >
641
652
  {/* Video player and components */}
642
653
  <View
643
654
  style={styles.playerScreen}
644
655
  testID={"player-screen-container"}
656
+ pointerEvents={pointerEventsProp}
645
657
  >
646
658
  {/* Player container */}
647
659
  <View
660
+ pointerEvents={pointerEventsProp}
648
661
  style={[
649
662
  styles.playerWrapper,
650
663
  // eslint-disable-next-line react-native/no-inline-styles, react-native/no-color-literals
@@ -286,7 +286,6 @@ function ComponentsMapComponent(props: Props) {
286
286
  initialNumToRender={3}
287
287
  maxToRenderPerBatch={10}
288
288
  windowSize={12}
289
- listKey={riverId}
290
289
  keyExtractor={keyExtractor}
291
290
  renderItem={renderRiverItem}
292
291
  data={riverComponents}
@@ -8,7 +8,7 @@ export const withTvEventHandler = (Component) => {
8
8
  return function WithTVEventHandler(props) {
9
9
  const navigator = useNavigation();
10
10
 
11
- const remoteHandler = (_, event) => {
11
+ const remoteHandler = (event) => {
12
12
  const { eventType } = event;
13
13
 
14
14
  const canGoBack = navigator.canGoBack();
@@ -159,6 +159,7 @@ exports[`componentsMap renders renders components map correctly 1`] = `
159
159
  >
160
160
  <View>
161
161
  <View
162
+ onFocusCapture={[Function]}
162
163
  onLayout={[Function]}
163
164
  style={null}
164
165
  >
@@ -174,6 +175,7 @@ exports[`componentsMap renders renders components map correctly 1`] = `
174
175
  </View>
175
176
  </View>
176
177
  <View
178
+ onFocusCapture={[Function]}
177
179
  onLayout={[Function]}
178
180
  style={null}
179
181
  >
@@ -7,7 +7,6 @@ import { isEmptyOrNil } from "@applicaster/zapp-react-native-utils/cellUtils";
7
7
 
8
8
  import Tab from "./Tab";
9
9
  import { Gutter } from "../Gutter";
10
- import { noop } from "@applicaster/zapp-react-native-utils/functionUtils";
11
10
  import { ImageBackground, View } from "react-native";
12
11
  import { getStyles } from "./styles";
13
12
  import {
@@ -100,7 +99,6 @@ const TabsComponent = ({
100
99
  >
101
100
  <FocusableList
102
101
  horizontal
103
- onScrollToIndexFailed={noop}
104
102
  onLayout={onLayoutChange}
105
103
  contentContainerStyle={tabsListContentContainer}
106
104
  ref={flatListRef}
@@ -2,6 +2,19 @@
2
2
 
3
3
  exports[`<TextInputTv /> renders 1`] = `
4
4
  <input
5
+ accessibilityProps={
6
+ {
7
+ "accessibilityHint": "Enter text into Search",
8
+ "accessibilityLabel": "Search",
9
+ "accessibilityRole": "textbox",
10
+ "accessible": true,
11
+ "aria-description": "Enter text into Search",
12
+ "aria-label": "Search",
13
+ "aria-role": "textbox",
14
+ "role": "textbox",
15
+ "tabindex": 0,
16
+ }
17
+ }
5
18
  testID="TextInput-tv"
6
19
  />
7
20
  `;
@@ -4,6 +4,7 @@ import { Appearance, Platform, StyleSheet, TextInput } from "react-native";
4
4
  import { isFunction } from "@applicaster/zapp-react-native-utils/functionUtils";
5
5
  import { isWeb } from "@applicaster/zapp-react-native-utils/reactUtils";
6
6
  import { useIsRTL } from "@applicaster/zapp-react-native-utils/localizationUtils";
7
+ import { useAccessibilityManager } from "@applicaster/zapp-react-native-utils/appUtils/accessibilityManager/hooks";
7
8
 
8
9
  type Props = Partial<{
9
10
  style: any;
@@ -42,6 +43,8 @@ function TextInputTV(props: Props, ref) {
42
43
  const [colorScheme, setColorScheme] = useState(getInitialColorScheme());
43
44
  const isRTL = useIsRTL();
44
45
 
46
+ const accessibilityManager = useAccessibilityManager({});
47
+
45
48
  const onColorChange = useCallback(
46
49
  ({ colorScheme: color }) => {
47
50
  if (color !== colorScheme) {
@@ -153,6 +156,13 @@ function TextInputTV(props: Props, ref) {
153
156
  ])
154
157
  )(props);
155
158
 
159
+ const getAccessibilityProps = () => {
160
+ return {
161
+ accessibilityProps:
162
+ accessibilityManager.getInputAccessibilityProps("Search"),
163
+ };
164
+ };
165
+
156
166
  const inputProps = {
157
167
  ...getProps(),
158
168
  ...getStyle(),
@@ -161,6 +171,7 @@ function TextInputTV(props: Props, ref) {
161
171
  ...getSecureTextEntry(),
162
172
  ...getOnEndEditing(),
163
173
  ...getOnPress(),
174
+ ...getAccessibilityProps(),
164
175
  };
165
176
 
166
177
  if (
@@ -3,6 +3,23 @@
3
3
  exports[`<Touchable /> when not running in automated tests environment renders correctly 1`] = `
4
4
  <View
5
5
  accessibilityLabel="some-test-id"
6
+ accessibilityState={
7
+ {
8
+ "busy": undefined,
9
+ "checked": undefined,
10
+ "disabled": undefined,
11
+ "expanded": undefined,
12
+ "selected": undefined,
13
+ }
14
+ }
15
+ accessibilityValue={
16
+ {
17
+ "max": undefined,
18
+ "min": undefined,
19
+ "now": undefined,
20
+ "text": undefined,
21
+ }
22
+ }
6
23
  accessible={true}
7
24
  collapsable={false}
8
25
  focusable={true}
@@ -29,6 +46,23 @@ exports[`<Touchable /> when not running in automated tests environment renders c
29
46
  exports[`<Touchable /> when running in automated tests environment has accessible flag set to false 1`] = `
30
47
  <View
31
48
  accessibilityLabel="some-test-id"
49
+ accessibilityState={
50
+ {
51
+ "busy": undefined,
52
+ "checked": undefined,
53
+ "disabled": undefined,
54
+ "expanded": undefined,
55
+ "selected": undefined,
56
+ }
57
+ }
58
+ accessibilityValue={
59
+ {
60
+ "max": undefined,
61
+ "min": undefined,
62
+ "now": undefined,
63
+ "text": undefined,
64
+ }
65
+ }
32
66
  accessible={false}
33
67
  collapsable={false}
34
68
  focusable={true}
@@ -6,15 +6,21 @@ exports[`<Scene /> renders correctly 1`] = `
6
6
  collapsable={false}
7
7
  pointerEvents="auto"
8
8
  style={
9
- {
10
- "flex": 1,
11
- "fontScale": 2,
12
- "height": 1334,
13
- "paddingBottom": 49,
14
- "scale": 2,
15
- "statusBarHeight": null,
16
- "width": 750,
17
- }
9
+ [
10
+ {
11
+ "flex": 1,
12
+ },
13
+ {
14
+ "paddingBottom": 49,
15
+ },
16
+ {
17
+ "fontScale": 2,
18
+ "height": 1334,
19
+ "scale": 2,
20
+ "statusBarHeight": null,
21
+ "width": 750,
22
+ },
23
+ ]
18
24
  }
19
25
  />
20
26
  </View>
@@ -1,8 +1,8 @@
1
1
  import { Animated, Easing, EasingFunction, StyleProp } from "react-native";
2
2
 
3
3
  type AnimatedInterpolatedStyle =
4
- | Animated.AnimatedInterpolation
5
- | [{ [Key: string]: Animated.AnimatedInterpolation }];
4
+ | Animated.AnimatedInterpolation<number>
5
+ | [{ [Key: string]: Animated.AnimatedInterpolation<number> }];
6
6
 
7
7
  type AnimationConfig = {
8
8
  duration: number;
@@ -31,7 +31,7 @@ const interpolate = (
31
31
  animatedValue: Animated.Value,
32
32
  from: number = 0,
33
33
  to: number = 1
34
- ): Animated.AnimatedInterpolation =>
34
+ ): Animated.AnimatedInterpolation<number> =>
35
35
  animatedValue.interpolate({
36
36
  inputRange: [0, 1],
37
37
  outputRange: [from, to],