@applicaster/zapp-react-native-ui-components 14.0.0-rc.9 → 14.0.0-rc.91
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/Components/AnimatedInOut/index.tsx +68 -23
- package/Components/AudioPlayer/index.tsx +15 -0
- package/Components/AudioPlayer/mobile/Layout.tsx +66 -0
- package/Components/AudioPlayer/{__tests__/__snapshots__/audioPlayer.test.js.snap → mobile/__tests__/__snapshots__/audioPlayerMobileLayout.test.js.snap} +2 -2
- package/Components/AudioPlayer/mobile/__tests__/audioPlayerMobileLayout.test.js +18 -0
- package/Components/AudioPlayer/mobile/index.tsx +18 -0
- package/Components/AudioPlayer/{Artwork.tsx → tv/Artwork.tsx} +3 -2
- package/Components/AudioPlayer/{Channel.tsx → tv/Channel.tsx} +7 -7
- package/Components/AudioPlayer/tv/Layout.tsx +168 -0
- package/Components/AudioPlayer/{Runtime.tsx → tv/Runtime.tsx} +7 -1
- package/Components/AudioPlayer/{Summary.tsx → tv/Summary.tsx} +6 -2
- package/Components/AudioPlayer/{Title.tsx → tv/Title.tsx} +6 -2
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/Runtime.test.js.snap +2 -2
- package/Components/AudioPlayer/tv/__tests__/__snapshots__/audioPlayer.test.js.snap +164 -0
- package/Components/AudioPlayer/tv/__tests__/__snapshots__/channel.test.js.snap +19 -0
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/summary.test.js.snap +1 -2
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/title.test.js.snap +1 -2
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/audioPlayer.test.js +7 -3
- package/Components/AudioPlayer/{helpers.tsx → tv/helpers.tsx} +11 -5
- package/Components/AudioPlayer/{AudioPlayer.tsx → tv/index.tsx} +17 -58
- package/Components/AudioPlayer/types.ts +40 -0
- package/Components/BaseFocusable/index.tsx +23 -12
- package/Components/Cell/Cell.tsx +91 -64
- package/Components/Cell/CellWithFocusable.tsx +3 -0
- package/Components/Cell/FocusableWrapper.tsx +44 -0
- package/Components/Cell/TvOSCellComponent.tsx +92 -17
- package/Components/Cell/__tests__/CellWIthFocusable.test.js +3 -2
- package/Components/Cell/index.js +7 -3
- package/Components/ComponentResolver/index.ts +1 -1
- package/Components/FeedLoader/FeedLoader.tsx +7 -16
- package/Components/FeedLoader/FeedLoaderHOC.tsx +21 -0
- package/Components/FeedLoader/index.js +2 -8
- package/Components/Focusable/Focusable.tsx +12 -3
- package/Components/Focusable/FocusableTvOS.tsx +5 -5
- package/Components/Focusable/FocusableiOS.tsx +2 -2
- package/Components/Focusable/Touchable.tsx +5 -3
- package/Components/Focusable/__tests__/index.android.test.tsx +3 -0
- package/Components/Focusable/index.android.tsx +19 -11
- package/Components/Focusable/index.tsx +1 -1
- package/Components/FocusableGroup/FocusableTvOS.tsx +1 -1
- package/Components/FocusableList/FocusableItem.tsx +4 -3
- package/Components/FocusableList/FocusableListItemWrapper.tsx +2 -1
- package/Components/FocusableList/hooks/useCellState.android.ts +13 -3
- package/Components/FocusableList/index.tsx +20 -9
- package/Components/FreezeWithCallback/__tests__/index.test.tsx +67 -43
- package/Components/GeneralContentScreen/utils/__tests__/useCurationAPI.test.js +42 -59
- package/Components/GeneralContentScreen/utils/useCurationAPI.ts +22 -21
- package/Components/HandlePlayable/HandlePlayable.tsx +39 -74
- package/Components/HandlePlayable/const.ts +3 -0
- package/Components/HandlePlayable/utils.ts +74 -0
- package/Components/Layout/TV/LayoutBackground.tsx +1 -1
- package/Components/Layout/TV/__tests__/index.test.tsx +0 -1
- package/Components/MasterCell/DefaultComponents/ActionButton.tsx +6 -2
- package/Components/MasterCell/DefaultComponents/Button.tsx +1 -1
- package/Components/MasterCell/DefaultComponents/FocusableView/index.tsx +4 -39
- package/Components/MasterCell/DefaultComponents/Image/hoc/withDimensions.tsx +1 -1
- package/Components/MasterCell/DefaultComponents/ImageContainer/index.tsx +1 -1
- package/Components/MasterCell/DefaultComponents/SecondaryImage/Image.tsx +65 -17
- package/Components/MasterCell/DefaultComponents/SecondaryImage/__tests__/Image.test.tsx +21 -3
- package/Components/MasterCell/DefaultComponents/SecondaryImage/__tests__/__snapshots__/Image.test.tsx.snap +6 -3
- package/Components/MasterCell/DefaultComponents/Text/index.tsx +26 -6
- package/Components/MasterCell/DefaultComponents/__tests__/image.test.js +10 -10
- package/Components/MasterCell/DefaultComponents/__tests__/text.test.tsx +18 -18
- package/Components/MasterCell/SharedUI/CollapsibleTextContainer/__tests__/index.test.tsx +10 -10
- package/Components/MasterCell/elementMapper.tsx +1 -2
- package/Components/MasterCell/index.tsx +1 -1
- package/Components/MasterCell/utils/behaviorProvider.ts +82 -14
- package/Components/MasterCell/utils/index.ts +11 -5
- package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +13 -18
- package/Components/OfflineHandler/__tests__/__snapshots__/index.test.tsx.snap +9 -0
- package/Components/OfflineHandler/__tests__/index.test.tsx +26 -35
- package/Components/PlayerContainer/ErrorDisplay/index.ts +1 -1
- package/Components/PlayerContainer/PlayerContainer.tsx +45 -47
- package/Components/PlayerContainer/ProgramInfo/index.tsx +1 -1
- package/Components/PlayerContainer/index.ts +1 -1
- package/Components/PlayerImageBackground/index.tsx +4 -23
- package/Components/River/ComponentsMap/ComponentsMap.tsx +49 -43
- package/Components/River/ComponentsMap/ContextProviders/ComponentsMapHeightContext.ts +8 -0
- package/Components/River/ComponentsMap/ContextProviders/ComponentsMapRefContext.ts +8 -0
- package/Components/River/ComponentsMap/hooks/__tests__/useLoadingState.test.ts +378 -0
- package/Components/River/ComponentsMap/hooks/useLoadingState.ts +2 -2
- package/Components/River/RefreshControl.tsx +11 -17
- package/Components/River/TV/River.tsx +2 -17
- package/Components/River/TV/index.tsx +3 -1
- package/Components/River/TV/withPipesV1DataLoader.tsx +43 -0
- package/Components/River/TV/withRiverDataLoader.tsx +17 -0
- package/Components/River/TV/withTVEventHandler.tsx +1 -1
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +2 -0
- package/Components/River/__tests__/river.test.js +12 -26
- package/Components/River/index.tsx +1 -1
- package/Components/Screen/TV/hooks/useInitialFocus.ts +14 -4
- package/Components/Screen/__tests__/Screen.test.tsx +28 -29
- package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +2 -0
- package/Components/Screen/__tests__/navigationHandler.test.ts +133 -22
- package/Components/Screen/index.tsx +22 -5
- package/Components/Screen/navigationHandler.ts +20 -2
- package/Components/ScreenRevealManager/ScreenRevealManager.ts +76 -0
- package/Components/ScreenRevealManager/__tests__/ScreenRevealManager.test.ts +107 -0
- package/Components/ScreenRevealManager/__tests__/withScreenRevealManager.test.tsx +96 -0
- package/Components/ScreenRevealManager/index.ts +1 -0
- package/Components/ScreenRevealManager/utils/index.ts +23 -0
- package/Components/ScreenRevealManager/withScreenRevealManager.tsx +109 -0
- package/Components/Tabs/TV/Tabs.android.tsx +1 -3
- package/Components/Tabs/Tabs.tsx +2 -3
- package/Components/TextInputTv/__tests__/__snapshots__/TextInputTv.test.js.snap +13 -0
- package/Components/TextInputTv/index.tsx +11 -0
- package/Components/Touchable/__tests__/__snapshots__/touchable.test.tsx.snap +34 -0
- package/Components/Touchable/__tests__/touchable.test.tsx +12 -17
- package/Components/Transitioner/Scene.tsx +15 -2
- package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +15 -9
- package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +1 -0
- package/Components/VideoLive/animationUtils.ts +3 -3
- package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +120 -133
- package/Components/VideoModal/ModalAnimation/index.ts +2 -13
- package/Components/VideoModal/ModalAnimation/utils.ts +1 -327
- package/Components/VideoModal/PlayerDetails.tsx +29 -7
- package/Components/VideoModal/PlayerWrapper.tsx +25 -215
- package/Components/VideoModal/VideoModal.tsx +4 -22
- package/Components/VideoModal/__tests__/PlayerDetails.test.tsx +5 -5
- package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +2 -7
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +44 -240
- package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +9 -1
- package/Components/VideoModal/hooks/index.ts +0 -2
- package/Components/VideoModal/hooks/useDelayedPlayerDetails.ts +40 -15
- package/Components/VideoModal/hooks/useModalSize.ts +23 -2
- package/Components/VideoModal/hooks/utils/__tests__/showDetails.test.ts +2 -2
- package/Components/VideoModal/hooks/utils/index.ts +4 -0
- package/Components/VideoModal/playerWrapperStyle.ts +70 -0
- package/Components/VideoModal/playerWrapperUtils.ts +91 -0
- package/Components/VideoModal/utils.ts +13 -0
- package/Components/Viewport/ViewportAware/__tests__/viewportAware.test.js +12 -16
- package/Components/Viewport/ViewportTracker/__tests__/viewportTracker.test.js +84 -24
- package/Components/Viewport/VisibilitySensor/VisibilitySensor.tsx +3 -3
- package/Components/default-cell-renderer/viewTrees/tv/DefaultCell/index.ts +3 -3
- package/Contexts/CellFocusedStateContext/index.tsx +27 -0
- package/Contexts/ConfigutaionContext/__tests__/ConfigurationProvider.test.tsx +3 -3
- package/Contexts/ScreenContext/index.tsx +46 -6
- package/Decorators/ConfigurationWrapper/__tests__/withConfigurationProvider.test.tsx +3 -3
- package/Decorators/ConfigurationWrapper/withConfigurationProvider.tsx +2 -2
- package/Decorators/RiverFeedLoader/__tests__/__snapshots__/riverFeedLoader.test.tsx.snap +221 -209
- package/Decorators/RiverFeedLoader/__tests__/riverFeedLoader.test.tsx +14 -16
- package/Decorators/RiverFeedLoader/__tests__/utils.test.ts +0 -20
- package/Decorators/RiverFeedLoader/index.tsx +22 -4
- package/Decorators/RiverFeedLoader/utils/getDatasourceUrl.ts +6 -10
- package/Decorators/RiverFeedLoader/utils/index.ts +0 -18
- package/Decorators/RiverResolver/__tests__/riverResolver.test.tsx +3 -6
- package/Decorators/ZappPipesDataConnector/ResolverSelector.tsx +25 -0
- package/Decorators/ZappPipesDataConnector/__tests__/NullFeedResolver.test.tsx +78 -0
- package/Decorators/ZappPipesDataConnector/__tests__/ResolverSelector.test.tsx +205 -0
- package/Decorators/ZappPipesDataConnector/__tests__/StaticFeedResolver.test.tsx +251 -0
- package/Decorators/ZappPipesDataConnector/__tests__/UrlFeedResolver.test.tsx +368 -0
- package/Decorators/ZappPipesDataConnector/__tests__/utils.test.ts +39 -0
- package/Decorators/ZappPipesDataConnector/index.tsx +26 -293
- package/Decorators/ZappPipesDataConnector/resolvers/NullFeedResolver.tsx +25 -0
- package/Decorators/ZappPipesDataConnector/resolvers/StaticFeedResolver.tsx +87 -0
- package/Decorators/ZappPipesDataConnector/resolvers/UrlFeedResolver.tsx +266 -0
- package/Decorators/ZappPipesDataConnector/types.ts +29 -0
- package/Decorators/ZappPipesDataConnector/utils/mongoFilter.ts +738 -0
- package/Decorators/ZappPipesDataConnector/utils/useFilter.tsx +157 -0
- package/events/index.ts +3 -0
- package/package.json +5 -10
- package/Components/AudioPlayer/AudioPlayerLayout.tsx +0 -202
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +0 -66
- package/Components/AudioPlayer/__tests__/__snapshots__/channel.test.js.snap +0 -28
- package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +0 -26
- package/Components/AudioPlayer/index.ts +0 -1
- package/Components/River/__tests__/__snapshots__/river.test.js.snap +0 -27
- package/Components/VideoModal/ModalAnimation/AnimatedPlayerModalWrapper.tsx +0 -60
- package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +0 -421
- package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +0 -176
- package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +0 -500
- package/Components/VideoModal/ModalAnimation/__tests__/getMoveUpValue.test.ts +0 -108
- package/Components/VideoModal/hooks/useBackgroundColor.ts +0 -10
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/Runtime.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/artWork.test.js.snap +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/artWork.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/channel.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/summary.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/title.test.js +0 -0
package/Components/Cell/Cell.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import { getItemType } from "@applicaster/zapp-react-native-utils/navigationUtil
|
|
|
8
8
|
import { SCREEN_TYPES } from "@applicaster/zapp-react-native-utils/navigationUtils/itemTypes";
|
|
9
9
|
import { sendSelectCellEvent } from "@applicaster/zapp-react-native-utils/analyticsUtils";
|
|
10
10
|
import { noop } from "@applicaster/zapp-react-native-utils/functionUtils";
|
|
11
|
+
import { CellFocusedStateContextProvider } from "@applicaster/zapp-react-native-ui-components/Contexts/CellFocusedStateContext";
|
|
11
12
|
|
|
12
13
|
import { CellWithFocusable } from "./CellWithFocusable";
|
|
13
14
|
import { BaseFocusable } from "../BaseFocusable";
|
|
@@ -15,6 +16,7 @@ import { AccessibilityManager } from "@applicaster/zapp-react-native-utils/appUt
|
|
|
15
16
|
import { styles } from "./styles";
|
|
16
17
|
|
|
17
18
|
type Props = {
|
|
19
|
+
dataLength: number;
|
|
18
20
|
item: ZappEntry;
|
|
19
21
|
index: number;
|
|
20
22
|
shouldScrollHorizontally: (arg1: [any]) => boolean | null | undefined;
|
|
@@ -67,9 +69,12 @@ type Props = {
|
|
|
67
69
|
|
|
68
70
|
type State = {
|
|
69
71
|
hasFocusableInside: boolean;
|
|
72
|
+
cellFocused: boolean;
|
|
70
73
|
};
|
|
71
74
|
|
|
72
75
|
export class CellComponent extends React.Component<Props, State> {
|
|
76
|
+
accessibilityManager: AccessibilityManager;
|
|
77
|
+
|
|
73
78
|
constructor(props) {
|
|
74
79
|
super(props);
|
|
75
80
|
this.onPress = this.onPress.bind(this);
|
|
@@ -79,10 +84,14 @@ export class CellComponent extends React.Component<Props, State> {
|
|
|
79
84
|
this.hasReceivedFocus = this.hasReceivedFocus.bind(this);
|
|
80
85
|
this.scrollVertically = this.scrollVertically.bind(this);
|
|
81
86
|
this.scrollToIndex = this.scrollToIndex.bind(this);
|
|
87
|
+
this.handleAccessibilityFocus = this.handleAccessibilityFocus.bind(this);
|
|
82
88
|
|
|
83
89
|
this.state = {
|
|
84
90
|
hasFocusableInside: props.CellRenderer.hasFocusableInside?.(props.item),
|
|
91
|
+
cellFocused: false,
|
|
85
92
|
};
|
|
93
|
+
|
|
94
|
+
this.accessibilityManager = AccessibilityManager.getInstance();
|
|
86
95
|
}
|
|
87
96
|
|
|
88
97
|
setScreenLayout(componentAnchorPointY, screenLayout) {
|
|
@@ -130,6 +139,8 @@ export class CellComponent extends React.Component<Props, State> {
|
|
|
130
139
|
} = this.props;
|
|
131
140
|
|
|
132
141
|
if (isFocusable) {
|
|
142
|
+
this.setState({ cellFocused: true });
|
|
143
|
+
|
|
133
144
|
if (
|
|
134
145
|
shouldUpdate &&
|
|
135
146
|
shouldScrollVertically?.(mouse, focusable, id, title)
|
|
@@ -139,7 +150,9 @@ export class CellComponent extends React.Component<Props, State> {
|
|
|
139
150
|
}
|
|
140
151
|
}
|
|
141
152
|
|
|
142
|
-
onBlur() {
|
|
153
|
+
onBlur() {
|
|
154
|
+
this.setState({ cellFocused: false });
|
|
155
|
+
}
|
|
143
156
|
|
|
144
157
|
willReceiveFocus() {}
|
|
145
158
|
|
|
@@ -183,6 +196,25 @@ export class CellComponent extends React.Component<Props, State> {
|
|
|
183
196
|
return !isFocusable ? false : focused || focusableFocused;
|
|
184
197
|
}
|
|
185
198
|
|
|
199
|
+
handleAccessibilityFocus(index, dataLength) {
|
|
200
|
+
// For loop scrolling, calculate the correct logical index
|
|
201
|
+
const logicalIndex = dataLength ? index % dataLength : index;
|
|
202
|
+
|
|
203
|
+
const positionLabel = dataLength
|
|
204
|
+
? `item ${logicalIndex + 1} of ${dataLength}`
|
|
205
|
+
: "";
|
|
206
|
+
|
|
207
|
+
if (this.state.hasFocusableInside) {
|
|
208
|
+
this.accessibilityManager.readText({
|
|
209
|
+
text: " ",
|
|
210
|
+
});
|
|
211
|
+
} else {
|
|
212
|
+
this.accessibilityManager.readText({
|
|
213
|
+
text: `${positionLabel}`,
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
186
218
|
componentDidUpdate(prevProps: Readonly<Props>) {
|
|
187
219
|
if (prevProps.item !== this.props.item) {
|
|
188
220
|
this.setState({
|
|
@@ -191,6 +223,8 @@ export class CellComponent extends React.Component<Props, State> {
|
|
|
191
223
|
),
|
|
192
224
|
});
|
|
193
225
|
}
|
|
226
|
+
|
|
227
|
+
this.handleAccessibilityFocus(this.props.index, this.props.dataLength);
|
|
194
228
|
}
|
|
195
229
|
|
|
196
230
|
render() {
|
|
@@ -212,7 +246,6 @@ export class CellComponent extends React.Component<Props, State> {
|
|
|
212
246
|
} = this.props;
|
|
213
247
|
|
|
214
248
|
const { id } = item;
|
|
215
|
-
|
|
216
249
|
const focusableId = join("-", [component?.id, id, index]);
|
|
217
250
|
|
|
218
251
|
const handleFocus = (focusable, mouse) => {
|
|
@@ -223,73 +256,67 @@ export class CellComponent extends React.Component<Props, State> {
|
|
|
223
256
|
|
|
224
257
|
if (this.state.hasFocusableInside) {
|
|
225
258
|
return (
|
|
226
|
-
<
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
259
|
+
<CellFocusedStateContextProvider cellFocused={this.state.cellFocused}>
|
|
260
|
+
<CellWithFocusable
|
|
261
|
+
CellRenderer={CellRenderer}
|
|
262
|
+
item={item}
|
|
263
|
+
id={focusableId}
|
|
264
|
+
groupId={groupId || component?.id}
|
|
265
|
+
onFocus={handleFocus}
|
|
266
|
+
onBlur={onBlur || this.onBlur}
|
|
267
|
+
index={index}
|
|
268
|
+
scrollTo={this.scrollToIndex()}
|
|
269
|
+
isFocusable={isFocusable}
|
|
270
|
+
skipFocusManagerRegistration={skipFocusManagerRegistration}
|
|
271
|
+
behavior={behavior}
|
|
272
|
+
/>
|
|
273
|
+
</CellFocusedStateContextProvider>
|
|
238
274
|
);
|
|
239
275
|
}
|
|
240
276
|
|
|
241
277
|
return (
|
|
242
|
-
<
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
<Focusable
|
|
248
|
-
id={focusableId}
|
|
249
|
-
groupId={groupId || component?.id}
|
|
250
|
-
onFocus={handleFocus}
|
|
251
|
-
onBlur={onBlur || this.onBlur}
|
|
252
|
-
onPress={this.onPress}
|
|
253
|
-
willReceiveFocus={willReceiveFocus || this.willReceiveFocus}
|
|
254
|
-
hasReceivedFocus={hasReceivedFocus || this.hasReceivedFocus}
|
|
255
|
-
preferredFocus={preferredFocus}
|
|
256
|
-
offsetUpdater={offsetUpdater}
|
|
257
|
-
style={styles.baseCell}
|
|
258
|
-
isFocusable={isFocusable}
|
|
259
|
-
skipFocusManagerRegistration={skipFocusManagerRegistration}
|
|
278
|
+
<CellFocusedStateContextProvider cellFocused={this.state.cellFocused}>
|
|
279
|
+
<View
|
|
280
|
+
testID={`${component?.id}-${id}`}
|
|
281
|
+
accessible={false}
|
|
282
|
+
style={styles.touchableCell}
|
|
260
283
|
>
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
284
|
+
<Focusable
|
|
285
|
+
id={focusableId}
|
|
286
|
+
groupId={groupId || component?.id}
|
|
287
|
+
onFocus={handleFocus}
|
|
288
|
+
onBlur={onBlur || this.onBlur}
|
|
289
|
+
onPress={this.onPress}
|
|
290
|
+
willReceiveFocus={willReceiveFocus || this.willReceiveFocus}
|
|
291
|
+
hasReceivedFocus={hasReceivedFocus || this.hasReceivedFocus}
|
|
292
|
+
preferredFocus={preferredFocus}
|
|
293
|
+
offsetUpdater={offsetUpdater}
|
|
294
|
+
style={styles.baseCell}
|
|
295
|
+
isFocusable={isFocusable}
|
|
296
|
+
skipFocusManagerRegistration={skipFocusManagerRegistration}
|
|
297
|
+
{...this.accessibilityManager.getButtonAccessibilityProps(
|
|
298
|
+
item?.extensions?.accessibility?.label || item?.title
|
|
299
|
+
)}
|
|
300
|
+
>
|
|
301
|
+
{(focused, event) => {
|
|
302
|
+
const isFocused = this.isCellFocused(focused);
|
|
303
|
+
|
|
304
|
+
return (
|
|
305
|
+
<FocusableCell
|
|
306
|
+
{...{
|
|
307
|
+
index,
|
|
308
|
+
CellRenderer,
|
|
309
|
+
item,
|
|
310
|
+
focused: isFocused,
|
|
311
|
+
scrollTo: this.scrollToIndex(event),
|
|
312
|
+
behavior,
|
|
313
|
+
}}
|
|
314
|
+
/>
|
|
315
|
+
);
|
|
316
|
+
}}
|
|
317
|
+
</Focusable>
|
|
318
|
+
</View>
|
|
319
|
+
</CellFocusedStateContextProvider>
|
|
293
320
|
);
|
|
294
321
|
}
|
|
295
322
|
}
|
|
@@ -14,6 +14,7 @@ type Props = {
|
|
|
14
14
|
id: string;
|
|
15
15
|
groupId: string;
|
|
16
16
|
onFocus: Function;
|
|
17
|
+
onBlur?: Function;
|
|
17
18
|
index: number;
|
|
18
19
|
scrollTo: Function;
|
|
19
20
|
preferredFocus?: boolean;
|
|
@@ -33,6 +34,7 @@ export function CellWithFocusable(props: Props) {
|
|
|
33
34
|
id,
|
|
34
35
|
groupId,
|
|
35
36
|
onFocus,
|
|
37
|
+
onBlur = noop,
|
|
36
38
|
scrollTo = noop,
|
|
37
39
|
preferredFocus,
|
|
38
40
|
skipFocusManagerRegistration,
|
|
@@ -78,6 +80,7 @@ export function CellWithFocusable(props: Props) {
|
|
|
78
80
|
const onGroupBlur = React.useCallback(() => {
|
|
79
81
|
if (!skipFocusManagerRegistration) {
|
|
80
82
|
setIsFocused(false);
|
|
83
|
+
onBlur?.();
|
|
81
84
|
}
|
|
82
85
|
}, [skipFocusManagerRegistration]);
|
|
83
86
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Focusable } from "@applicaster/zapp-react-native-ui-components/Components/Focusable/FocusableTvOS";
|
|
3
|
+
import { noop } from "@applicaster/zapp-react-native-utils/functionUtils";
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
id: string;
|
|
7
|
+
groupId: string;
|
|
8
|
+
isParallaxDisabled: boolean;
|
|
9
|
+
applyWrapper: boolean;
|
|
10
|
+
children: (focused: boolean) => React.ReactNode;
|
|
11
|
+
onFocus: (arg1: any, index?: number) => void;
|
|
12
|
+
onBlur: Callback;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const FocusableWrapper = ({
|
|
16
|
+
id,
|
|
17
|
+
groupId,
|
|
18
|
+
isParallaxDisabled,
|
|
19
|
+
children,
|
|
20
|
+
applyWrapper,
|
|
21
|
+
onFocus,
|
|
22
|
+
onBlur,
|
|
23
|
+
}: Props) => {
|
|
24
|
+
if (applyWrapper) {
|
|
25
|
+
return (
|
|
26
|
+
<Focusable
|
|
27
|
+
id={id}
|
|
28
|
+
groupId={groupId}
|
|
29
|
+
isParallaxDisabled={isParallaxDisabled}
|
|
30
|
+
onFocus={onFocus}
|
|
31
|
+
onBlur={onBlur}
|
|
32
|
+
willReceiveFocus={noop}
|
|
33
|
+
hasReceivedFocus={noop}
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
offsetUpdater={noop}
|
|
36
|
+
isFocusable
|
|
37
|
+
>
|
|
38
|
+
{(focused) => children(focused)}
|
|
39
|
+
</Focusable>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return <>{children(false)}</>;
|
|
44
|
+
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as R from "ramda";
|
|
3
3
|
import { View, StyleSheet } from "react-native";
|
|
4
|
+
import { first, filter } from "rxjs/operators";
|
|
5
|
+
|
|
6
|
+
import { compose } from "@applicaster/zapp-react-native-utils/utils";
|
|
4
7
|
|
|
5
8
|
import { Focusable } from "@applicaster/zapp-react-native-ui-components/Components/Focusable/FocusableTvOS";
|
|
6
9
|
import { FocusableCell } from "@applicaster/zapp-react-native-ui-components/Components/FocusableCell";
|
|
@@ -9,7 +12,12 @@ import { SCREEN_TYPES } from "@applicaster/zapp-react-native-utils/navigationUti
|
|
|
9
12
|
import { focusManager } from "@applicaster/zapp-react-native-utils/appUtils/focusManager";
|
|
10
13
|
import { sendSelectCellEvent } from "@applicaster/zapp-react-native-utils/analyticsUtils";
|
|
11
14
|
import { noop } from "@applicaster/zapp-react-native-utils/functionUtils";
|
|
15
|
+
import { toBooleanWithDefaultTrue } from "@applicaster/zapp-react-native-utils/booleanUtils";
|
|
12
16
|
import { CellWithFocusable } from "./CellWithFocusable";
|
|
17
|
+
import { FocusableWrapper } from "./FocusableWrapper";
|
|
18
|
+
|
|
19
|
+
import { focusableButtonsRegistration$ } from "@applicaster/zapp-react-native-utils/appUtils/focusManagerAux/utils/utils.ios";
|
|
20
|
+
import { toNumberWithDefaultZero } from "@applicaster/zapp-react-native-utils/numberUtils";
|
|
13
21
|
|
|
14
22
|
type Props = {
|
|
15
23
|
item: ZappEntry;
|
|
@@ -30,6 +38,9 @@ type Props = {
|
|
|
30
38
|
component: {
|
|
31
39
|
id: number | string;
|
|
32
40
|
component_type: string;
|
|
41
|
+
styles?: {
|
|
42
|
+
component_margin_top?: number;
|
|
43
|
+
};
|
|
33
44
|
};
|
|
34
45
|
selected: boolean;
|
|
35
46
|
CellRenderer: React.FunctionComponent<any> & {
|
|
@@ -66,6 +77,8 @@ type Props = {
|
|
|
66
77
|
shouldUpdate: boolean;
|
|
67
78
|
behavior: Behavior;
|
|
68
79
|
componentsMapOffset: number;
|
|
80
|
+
applyFocusableWrapper: boolean;
|
|
81
|
+
hasFocusableInside: boolean;
|
|
69
82
|
};
|
|
70
83
|
|
|
71
84
|
type State = {
|
|
@@ -82,7 +95,7 @@ const baseCellStyles = {
|
|
|
82
95
|
flex: 1,
|
|
83
96
|
} as const;
|
|
84
97
|
|
|
85
|
-
|
|
98
|
+
class TvOSCell extends React.Component<Props, State> {
|
|
86
99
|
cell: any;
|
|
87
100
|
target: any;
|
|
88
101
|
layout: any;
|
|
@@ -195,11 +208,16 @@ export class TvOSCellComponent extends React.Component<Props, State> {
|
|
|
195
208
|
const extraAnchorPointYOffset =
|
|
196
209
|
screenLayout?.extraAnchorPointYOffset || 0;
|
|
197
210
|
|
|
211
|
+
const componentMarginTop = toNumberWithDefaultZero(
|
|
212
|
+
component?.styles?.component_margin_top
|
|
213
|
+
);
|
|
214
|
+
|
|
198
215
|
const totalOffset =
|
|
199
216
|
headerOffset +
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
217
|
+
(componentAnchorPointY || 0) +
|
|
218
|
+
extraAnchorPointYOffset -
|
|
219
|
+
(componentsMapOffset || 0) +
|
|
220
|
+
componentMarginTop;
|
|
203
221
|
|
|
204
222
|
mainOffsetUpdater?.(
|
|
205
223
|
{ tag: this.target },
|
|
@@ -239,6 +257,8 @@ export class TvOSCellComponent extends React.Component<Props, State> {
|
|
|
239
257
|
groupId,
|
|
240
258
|
isFocusable,
|
|
241
259
|
behavior,
|
|
260
|
+
applyFocusableWrapper,
|
|
261
|
+
hasFocusableInside,
|
|
242
262
|
} = this.props;
|
|
243
263
|
|
|
244
264
|
const { id } = item;
|
|
@@ -254,24 +274,33 @@ export class TvOSCellComponent extends React.Component<Props, State> {
|
|
|
254
274
|
this.onFocus(arg1, index);
|
|
255
275
|
};
|
|
256
276
|
|
|
257
|
-
const hasFocusableInside = CellRenderer.hasFocusableInside?.(item);
|
|
258
|
-
|
|
259
277
|
if (hasFocusableInside) {
|
|
260
278
|
return (
|
|
261
279
|
<View onLayout={this.onLayout}>
|
|
262
|
-
<
|
|
263
|
-
CellRenderer={CellRenderer}
|
|
264
|
-
item={item}
|
|
280
|
+
<FocusableWrapper
|
|
265
281
|
id={focusableId}
|
|
266
|
-
groupId={(groupId || component?.id)
|
|
282
|
+
groupId={String(groupId || component?.id)}
|
|
283
|
+
isParallaxDisabled={this.layout?.width > 1740}
|
|
267
284
|
onFocus={handleFocus}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
285
|
+
onBlur={onBlur || this.onBlur}
|
|
286
|
+
applyWrapper={applyFocusableWrapper}
|
|
287
|
+
>
|
|
288
|
+
{(focused) => (
|
|
289
|
+
<CellWithFocusable
|
|
290
|
+
CellRenderer={CellRenderer}
|
|
291
|
+
item={item}
|
|
292
|
+
id={focusableId}
|
|
293
|
+
groupId={(groupId || component?.id).toString()}
|
|
294
|
+
onFocus={handleFocus}
|
|
295
|
+
index={index}
|
|
296
|
+
scrollTo={this.scrollTo}
|
|
297
|
+
preferredFocus={preferredFocus}
|
|
298
|
+
focused={focused || this.props.focused}
|
|
299
|
+
behavior={behavior}
|
|
300
|
+
isFocusable={isFocusable}
|
|
301
|
+
/>
|
|
302
|
+
)}
|
|
303
|
+
</FocusableWrapper>
|
|
275
304
|
</View>
|
|
276
305
|
);
|
|
277
306
|
}
|
|
@@ -309,3 +338,49 @@ export class TvOSCellComponent extends React.Component<Props, State> {
|
|
|
309
338
|
);
|
|
310
339
|
}
|
|
311
340
|
}
|
|
341
|
+
|
|
342
|
+
export function withFocusableWrapperHOC(Component) {
|
|
343
|
+
return function WrappedComponent(props) {
|
|
344
|
+
const [focusableViewIsRendered, setFocusableViewIsRendered] =
|
|
345
|
+
React.useState(false);
|
|
346
|
+
|
|
347
|
+
const { CellRenderer, item, groupId, component } = props;
|
|
348
|
+
|
|
349
|
+
const isFocusable = toBooleanWithDefaultTrue(props?.isFocusable);
|
|
350
|
+
|
|
351
|
+
const focusableGroupId = String(groupId || component?.id);
|
|
352
|
+
|
|
353
|
+
const hasFocusableInside = CellRenderer.hasFocusableInside?.(item);
|
|
354
|
+
|
|
355
|
+
React.useEffect(() => {
|
|
356
|
+
// start waiting any first registration of FocusableButton inside this focusableGroup
|
|
357
|
+
// after it we could get rid of applying focusable-wrapper
|
|
358
|
+
const subscription = focusableButtonsRegistration$(focusableGroupId)
|
|
359
|
+
.pipe(
|
|
360
|
+
filter(() => isFocusable),
|
|
361
|
+
first()
|
|
362
|
+
)
|
|
363
|
+
.subscribe(() => {
|
|
364
|
+
setFocusableViewIsRendered(true);
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
return () => {
|
|
368
|
+
subscription.unsubscribe();
|
|
369
|
+
};
|
|
370
|
+
}, [isFocusable, focusableGroupId]);
|
|
371
|
+
|
|
372
|
+
const applyFocusableWrapper = React.useMemo(() => {
|
|
373
|
+
return isFocusable && hasFocusableInside && !focusableViewIsRendered;
|
|
374
|
+
}, [isFocusable, hasFocusableInside, focusableViewIsRendered]);
|
|
375
|
+
|
|
376
|
+
return (
|
|
377
|
+
<Component
|
|
378
|
+
{...props}
|
|
379
|
+
applyFocusableWrapper={applyFocusableWrapper}
|
|
380
|
+
hasFocusableInside={hasFocusableInside}
|
|
381
|
+
/>
|
|
382
|
+
);
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export const TvOSCellComponent = compose(withFocusableWrapperHOC)(TvOSCell);
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { View } from "react-native";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { act
|
|
3
|
+
import { act } from "@testing-library/react-native";
|
|
4
4
|
import { CellWithFocusable } from "../CellWithFocusable.tsx";
|
|
5
5
|
|
|
6
6
|
import { focusManager } from "@applicaster/zapp-react-native-utils/appUtils/focusManager";
|
|
7
|
+
import { renderWithProviders } from "@applicaster/zapp-react-native-utils/testUtils/index.tsx";
|
|
7
8
|
|
|
8
9
|
const renderWith = (props) => {
|
|
9
|
-
return
|
|
10
|
+
return renderWithProviders(<CellWithFocusable {...props} />);
|
|
10
11
|
};
|
|
11
12
|
|
|
12
13
|
describe("CellWithFocusable", () => {
|
package/Components/Cell/index.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import * as R from "ramda";
|
|
2
2
|
|
|
3
|
-
import { connectToStore } from "@applicaster/zapp-react-native-redux";
|
|
3
|
+
import { connectToStore } from "@applicaster/zapp-react-native-redux/utils/connectToStore";
|
|
4
4
|
import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
HorizontalScrollContext,
|
|
8
|
+
RiverOffsetContext,
|
|
9
|
+
ScreenScrollingContext,
|
|
10
|
+
} from "../../Contexts";
|
|
11
|
+
|
|
7
12
|
import { CellComponent } from "./Cell";
|
|
8
13
|
import { TvOSCellComponent } from "./TvOSCellComponent";
|
|
9
14
|
import { withConsumer } from "../../Contexts/HeaderOffsetContext";
|
|
10
|
-
import { ScreenScrollingContext } from "../../Contexts/ScreenScrollingContext";
|
|
11
15
|
|
|
12
16
|
import { ScreenLayoutContextConsumer } from "../../Contexts/ScreenLayoutContext";
|
|
13
17
|
import { createContext } from "@applicaster/zapp-react-native-utils/reactUtils/createContext";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as R from "ramda";
|
|
2
2
|
|
|
3
|
-
import { connectToStore } from "@applicaster/zapp-react-native-redux";
|
|
3
|
+
import { connectToStore } from "@applicaster/zapp-react-native-redux/utils/connectToStore";
|
|
4
4
|
|
|
5
5
|
import { ComponentResolverComponent } from "./ComponentResolver";
|
|
6
6
|
|
|
@@ -1,25 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import * as R from "ramda";
|
|
3
|
+
import { selectZappPipes } from "@applicaster/zapp-react-native-redux";
|
|
3
4
|
|
|
4
5
|
type Props = {
|
|
5
|
-
zappPipes:
|
|
6
|
-
loadPipesData:
|
|
7
|
-
feed
|
|
8
|
-
|
|
9
|
-
clearCache: boolean;
|
|
10
|
-
meta: any;
|
|
11
|
-
loadLocalFavorites: boolean;
|
|
12
|
-
silentRefresh: boolean;
|
|
13
|
-
parentFeed: ZappFeed;
|
|
14
|
-
callback: () => void;
|
|
15
|
-
bodyParams: any;
|
|
16
|
-
riverId: string;
|
|
17
|
-
}>
|
|
18
|
-
) => void;
|
|
6
|
+
zappPipes: ReturnType<typeof selectZappPipes>;
|
|
7
|
+
loadPipesData: ReturnType<
|
|
8
|
+
typeof import("@applicaster/zapp-react-native-utils/reactHooks/feed").useLoadPipesDataDispatch
|
|
9
|
+
>;
|
|
19
10
|
feedUrl: string;
|
|
20
|
-
children: (feed: ZappFeed) => React.
|
|
11
|
+
children: (feed: ZappFeed) => React.ReactNode;
|
|
21
12
|
onFeedLoaded: (feed: ZappFeed) => {};
|
|
22
|
-
onError: (
|
|
13
|
+
onError: (error: ZappPipesData["error"]) => {};
|
|
23
14
|
refreshing: boolean;
|
|
24
15
|
refreshCallback: () => void;
|
|
25
16
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
selectZappPipes,
|
|
4
|
+
useAppSelector,
|
|
5
|
+
} from "@applicaster/zapp-react-native-redux";
|
|
6
|
+
import { useLoadPipesDataDispatch } from "@applicaster/zapp-react-native-utils/reactHooks/feed";
|
|
7
|
+
|
|
8
|
+
export const FeedLoaderHOC = (_Component: any) => {
|
|
9
|
+
return function FeedLoaderHOC(props: any) {
|
|
10
|
+
const zappPipes = useAppSelector(selectZappPipes);
|
|
11
|
+
const loadPipesData = useLoadPipesDataDispatch();
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<_Component
|
|
15
|
+
{...props}
|
|
16
|
+
zappPipes={zappPipes}
|
|
17
|
+
loadPipesData={loadPipesData}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import * as R from "ramda";
|
|
2
|
-
|
|
3
|
-
import { connectToStore } from "@applicaster/zapp-react-native-redux";
|
|
4
|
-
import { loadPipesData } from "@applicaster/zapp-react-native-redux/ZappPipes";
|
|
5
|
-
|
|
6
1
|
import { FeedLoaderComponent } from "./FeedLoader";
|
|
2
|
+
import { FeedLoaderHOC } from "./FeedLoaderHOC";
|
|
7
3
|
|
|
8
|
-
export const FeedLoader =
|
|
9
|
-
loadPipesData,
|
|
10
|
-
})(FeedLoaderComponent);
|
|
4
|
+
export const FeedLoader = FeedLoaderHOC(FeedLoaderComponent);
|
|
@@ -5,6 +5,8 @@ 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";
|
|
9
|
+
import { AccessibilityManager } from "@applicaster/zapp-react-native-utils/appUtils/accessibilityManager";
|
|
8
10
|
|
|
9
11
|
type Props = {
|
|
10
12
|
initialFocus?: boolean;
|
|
@@ -19,15 +21,16 @@ type Props = {
|
|
|
19
21
|
onPressOut?: () => void;
|
|
20
22
|
onLongPress?: () => void;
|
|
21
23
|
handleFocus?: ({ mouse }: { mouse: boolean }) => void;
|
|
22
|
-
children: (boolean, string) => React.
|
|
24
|
+
children: (boolean, string) => React.ReactNode;
|
|
23
25
|
selected?: boolean;
|
|
24
|
-
style?:
|
|
26
|
+
style?: ViewStyle[] | ViewStyle;
|
|
25
27
|
};
|
|
26
28
|
|
|
27
29
|
class Focusable extends BaseFocusable<Props> {
|
|
28
30
|
isGroup: boolean;
|
|
29
31
|
mouse: boolean;
|
|
30
32
|
longPressTimeout = null;
|
|
33
|
+
accessibilityManager: AccessibilityManager;
|
|
31
34
|
|
|
32
35
|
constructor(props) {
|
|
33
36
|
super(props);
|
|
@@ -42,6 +45,8 @@ class Focusable extends BaseFocusable<Props> {
|
|
|
42
45
|
this.resetLongPressTimeout = this.resetLongPressTimeout.bind(this);
|
|
43
46
|
this.longPress = this.longPress.bind(this);
|
|
44
47
|
this.press = this.press.bind(this);
|
|
48
|
+
|
|
49
|
+
this.accessibilityManager = AccessibilityManager.getInstance();
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
/**
|
|
@@ -128,6 +133,9 @@ class Focusable extends BaseFocusable<Props> {
|
|
|
128
133
|
const id = this.getId();
|
|
129
134
|
const focusableId = `focusable-${id}`;
|
|
130
135
|
|
|
136
|
+
const accessibilityProps =
|
|
137
|
+
this.accessibilityManager.getWebAccessibilityProps(this.props);
|
|
138
|
+
|
|
131
139
|
return (
|
|
132
140
|
<div
|
|
133
141
|
id={focusableId}
|
|
@@ -139,7 +147,8 @@ class Focusable extends BaseFocusable<Props> {
|
|
|
139
147
|
onMouseUp={this.pressOut}
|
|
140
148
|
data-testid={focusableId}
|
|
141
149
|
focused-teststate={focused ? "focused" : "default"}
|
|
142
|
-
style={style}
|
|
150
|
+
style={StyleSheet.flatten(style) as any as React.CSSProperties}
|
|
151
|
+
{...accessibilityProps}
|
|
143
152
|
>
|
|
144
153
|
{children(focused, { mouse: this.mouse })}
|
|
145
154
|
</div>
|
|
@@ -16,10 +16,10 @@ function noop() {}
|
|
|
16
16
|
type Props = {
|
|
17
17
|
id: string;
|
|
18
18
|
groupId: string;
|
|
19
|
-
onPress?: (nativeEvent:
|
|
20
|
-
onFocus?: (nativeEvent:
|
|
21
|
-
onBlur?: (nativeEvent:
|
|
22
|
-
children: (focused?: boolean) => React.ReactNode;
|
|
19
|
+
onPress?: (nativeEvent: any) => void;
|
|
20
|
+
onFocus?: (nativeEvent: any) => void;
|
|
21
|
+
onBlur?: (nativeEvent: any) => void;
|
|
22
|
+
children: ((focused?: boolean) => React.ReactNode) | React.ReactNode;
|
|
23
23
|
isParallaxDisabled: boolean;
|
|
24
24
|
preferredFocus?: boolean;
|
|
25
25
|
selected?: boolean;
|
|
@@ -204,7 +204,7 @@ export class Focusable extends BaseFocusable<Props> {
|
|
|
204
204
|
{...this.nextFocusableReactTags}
|
|
205
205
|
{...otherProps}
|
|
206
206
|
>
|
|
207
|
-
{
|
|
207
|
+
{typeof children === "function" ? children(focused) : children}
|
|
208
208
|
</FocusableItemNative>
|
|
209
209
|
);
|
|
210
210
|
}
|