@applicaster/zapp-react-native-ui-components 13.0.0-alpha.9433330286 → 13.0.0-rc.10
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/Cell/Cell.tsx +9 -5
- package/Components/Cell/CellWithFocusable.tsx +1 -1
- package/Components/Cell/TvOSCellComponent.tsx +4 -3
- package/Components/NativeFocusables/{index.ts → index.js} +2 -4
- package/Components/VideoModal/PlayerWrapper.tsx +2 -18
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +6 -6
- package/Components/ZappFrameworkComponents/BarView/BarView.tsx +1 -0
- package/Contexts/FocusableGroupContext/withFocusableContext.tsx +18 -11
- package/Decorators/Analytics/{index.tsx → index.js} +11 -11
- package/package.json +5 -5
package/Components/Cell/Cell.tsx
CHANGED
|
@@ -14,7 +14,10 @@ import { BaseFocusable } from "../BaseFocusable";
|
|
|
14
14
|
import { AccessibilityManager } from "@applicaster/zapp-react-native-utils/appUtils/accessibilityManager";
|
|
15
15
|
|
|
16
16
|
type Props = {
|
|
17
|
-
item:
|
|
17
|
+
item: {
|
|
18
|
+
id: string;
|
|
19
|
+
title: string;
|
|
20
|
+
};
|
|
18
21
|
index: number;
|
|
19
22
|
shouldScrollHorizontally: (arg1: [any]) => boolean | null | undefined;
|
|
20
23
|
shouldScrollVertically: (...args: any) => boolean | null | undefined;
|
|
@@ -30,9 +33,10 @@ type Props = {
|
|
|
30
33
|
id: string;
|
|
31
34
|
};
|
|
32
35
|
selected?: boolean;
|
|
33
|
-
CellRenderer: React.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
CellRenderer: React.ComponentType<{
|
|
37
|
+
item: any;
|
|
38
|
+
state: string;
|
|
39
|
+
}> & { hasFocusableInside: (item: Record<string, string>) => boolean };
|
|
36
40
|
preferredFocus: boolean;
|
|
37
41
|
navigator: {
|
|
38
42
|
push: (arg1: Record<any, any>) => void;
|
|
@@ -272,7 +276,7 @@ export class CellComponent extends React.Component<Props, State> {
|
|
|
272
276
|
|
|
273
277
|
if (isFocused) {
|
|
274
278
|
const accessibilityManager = AccessibilityManager.getInstance();
|
|
275
|
-
accessibilityManager.readText({ text:
|
|
279
|
+
accessibilityManager.readText({ text: item.title });
|
|
276
280
|
}
|
|
277
281
|
|
|
278
282
|
return (
|
|
@@ -36,9 +36,10 @@ type Props = {
|
|
|
36
36
|
component_type: string;
|
|
37
37
|
};
|
|
38
38
|
selected: boolean;
|
|
39
|
-
CellRenderer: React.
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
CellRenderer: React.ComponentType<{
|
|
40
|
+
item: any;
|
|
41
|
+
state: string;
|
|
42
|
+
}> & { hasFocusableInside: (item: any) => boolean };
|
|
42
43
|
preferredFocus: boolean;
|
|
43
44
|
navigator: {
|
|
44
45
|
push: (arg1: Record<any, any>) => void;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { requireNativeComponent, View } from "react-native";
|
|
2
2
|
import { isAppleTV } from "@applicaster/zapp-react-native-ui-components/Helpers/Platform";
|
|
3
3
|
|
|
4
|
-
// @TODO define the types
|
|
5
4
|
export const FocusableGroupNative = isAppleTV()
|
|
6
|
-
? requireNativeComponent
|
|
5
|
+
? requireNativeComponent("FocusableGroupViewModule", null)
|
|
7
6
|
: View;
|
|
8
7
|
|
|
9
|
-
// @TODO define the types
|
|
10
8
|
export const FocusableItemNative = isAppleTV()
|
|
11
|
-
? requireNativeComponent
|
|
9
|
+
? requireNativeComponent("FocusableViewModule", null)
|
|
12
10
|
: View;
|
|
@@ -121,22 +121,6 @@ const getTabletWidth = (
|
|
|
121
121
|
return Number(width) - sidebarWidth;
|
|
122
122
|
};
|
|
123
123
|
|
|
124
|
-
const getStyles = (baseStyle, isMobile, isPortrait, pip) => {
|
|
125
|
-
if (pip) {
|
|
126
|
-
return baseStyle;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (isMobile && isPortrait) {
|
|
130
|
-
return { width: SCREEN_WIDTH, height: SCREEN_HEIGHT };
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (isMobile && !isPortrait) {
|
|
134
|
-
return { width: SCREEN_HEIGHT, height: SCREEN_WIDTH };
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
return baseStyle;
|
|
138
|
-
};
|
|
139
|
-
|
|
140
124
|
const showDetails = (
|
|
141
125
|
isMobile: boolean,
|
|
142
126
|
docked: boolean,
|
|
@@ -168,7 +152,7 @@ const showDetails = (
|
|
|
168
152
|
const PlayerWrapperComponent = (props: Props) => {
|
|
169
153
|
const {
|
|
170
154
|
entry,
|
|
171
|
-
style
|
|
155
|
+
style,
|
|
172
156
|
containerStyle,
|
|
173
157
|
inline,
|
|
174
158
|
docked,
|
|
@@ -183,7 +167,7 @@ const PlayerWrapperComponent = (props: Props) => {
|
|
|
183
167
|
|
|
184
168
|
const isInlineModal = inline && isModal;
|
|
185
169
|
|
|
186
|
-
const style = getStyles(baseStyle, !isTablet, isInlineModal, pip);
|
|
170
|
+
// const style = getStyles(baseStyle, !isTablet, isInlineModal, pip);
|
|
187
171
|
|
|
188
172
|
const isTabletLandscape = !isTV() && isTablet && !isTabletPortrait;
|
|
189
173
|
|
|
@@ -27,8 +27,8 @@ exports[`PlayerWrapper renders inline 1`] = `
|
|
|
27
27
|
"backgroundColor": "transparent",
|
|
28
28
|
},
|
|
29
29
|
Object {
|
|
30
|
-
"height":
|
|
31
|
-
"width":
|
|
30
|
+
"height": 800,
|
|
31
|
+
"width": 300,
|
|
32
32
|
},
|
|
33
33
|
Object {},
|
|
34
34
|
]
|
|
@@ -133,8 +133,8 @@ exports[`PlayerWrapper renders inline and docked 1`] = `
|
|
|
133
133
|
"backgroundColor": "transparent",
|
|
134
134
|
},
|
|
135
135
|
Object {
|
|
136
|
-
"height":
|
|
137
|
-
"width":
|
|
136
|
+
"height": undefined,
|
|
137
|
+
"width": 300,
|
|
138
138
|
},
|
|
139
139
|
Object {},
|
|
140
140
|
]
|
|
@@ -361,8 +361,8 @@ exports[`PlayerWrapper renders properly 1`] = `
|
|
|
361
361
|
"backgroundColor": "transparent",
|
|
362
362
|
},
|
|
363
363
|
Object {
|
|
364
|
-
"height":
|
|
365
|
-
"width":
|
|
364
|
+
"height": 800,
|
|
365
|
+
"width": 300,
|
|
366
366
|
},
|
|
367
367
|
Object {},
|
|
368
368
|
]
|
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { FocusableGroupContext } from "./FocusableGroupContext";
|
|
3
3
|
|
|
4
4
|
export const withFocusableContext = (Component) => {
|
|
5
5
|
// eslint-disable-next-line react/display-name
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
const WithFocusableContext = (
|
|
7
|
+
{ groupId, ...props }: Record<string, any>,
|
|
8
|
+
ref
|
|
9
|
+
) => {
|
|
10
|
+
return (
|
|
11
|
+
<FocusableGroupContext.Consumer>
|
|
12
|
+
{(groupIdContext: string) => {
|
|
13
|
+
// eslint-disable-next-line react/display-name
|
|
14
|
+
const propsGroupId = groupId || null;
|
|
15
|
+
const providedGroupId = propsGroupId || groupIdContext;
|
|
12
16
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
return <Component {...props} groupId={providedGroupId} ref={ref} />;
|
|
18
|
+
}}
|
|
19
|
+
</FocusableGroupContext.Consumer>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return React.forwardRef(WithFocusableContext);
|
|
17
24
|
};
|
|
@@ -5,18 +5,18 @@ import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
|
|
|
5
5
|
|
|
6
6
|
type ComponentProps = {
|
|
7
7
|
component: {
|
|
8
|
-
id: string
|
|
9
|
-
rules: { item_limit: number
|
|
10
|
-
component_type: string
|
|
8
|
+
id: string,
|
|
9
|
+
rules: { item_limit: number, component_cells_selectable: boolean },
|
|
10
|
+
component_type: string,
|
|
11
11
|
styles: {
|
|
12
|
-
cell_style: string
|
|
13
|
-
header: { visible: boolean }
|
|
14
|
-
component_cells_selectable: boolean
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
zappPipesData: { url: string
|
|
18
|
-
selected: boolean
|
|
19
|
-
assets: { menu_button: string }
|
|
12
|
+
cell_style: string,
|
|
13
|
+
header: { visible: boolean },
|
|
14
|
+
component_cells_selectable: boolean,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
zappPipesData: { url: string, data: { title: string } },
|
|
18
|
+
selected: boolean,
|
|
19
|
+
assets: { menu_button: string },
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
function withAnalytics(Component) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "13.0.0-
|
|
3
|
+
"version": "13.0.0-rc.10",
|
|
4
4
|
"description": "Applicaster Zapp React Native ui components for the Quick Brick App",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"redux-mock-store": "^1.5.3"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@applicaster/applicaster-types": "13.0.0-
|
|
38
|
-
"@applicaster/zapp-react-native-bridge": "13.0.0-
|
|
39
|
-
"@applicaster/zapp-react-native-redux": "13.0.0-
|
|
40
|
-
"@applicaster/zapp-react-native-utils": "13.0.0-
|
|
37
|
+
"@applicaster/applicaster-types": "13.0.0-rc.10",
|
|
38
|
+
"@applicaster/zapp-react-native-bridge": "13.0.0-rc.10",
|
|
39
|
+
"@applicaster/zapp-react-native-redux": "13.0.0-rc.10",
|
|
40
|
+
"@applicaster/zapp-react-native-utils": "13.0.0-rc.10",
|
|
41
41
|
"promise": "^8.3.0",
|
|
42
42
|
"react-router-native": "^5.1.2",
|
|
43
43
|
"url": "^0.11.0",
|