@applicaster/zapp-react-native-ui-components 12.0.0-rc.30 → 12.0.0-rc.32
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/ErrorScreen/index.tsx +1 -1
- package/Components/HookRenderer/index.tsx +1 -3
- package/Components/Image/Image.android.tsx +3 -25
- package/Components/Image/Image.tsx +18 -2
- package/Components/Image/utils/index.ts +29 -0
- package/Components/Layout/TV/__tests__/__snapshots__/index.test.tsx.snap +41 -1
- package/Components/Layout/TV/__tests__/index.test.tsx +1 -13
- package/Components/Layout/TV/index.tsx +1 -1
- package/Components/MasterCell/DefaultComponents/Image/Image.android.tsx +9 -26
- package/Components/MasterCell/DefaultComponents/Image/hooks/useImageSize.ts +65 -0
- package/Components/MasterCell/DefaultComponents/LiveImage/index.tsx +3 -1
- package/Components/MasterCell/DefaultComponents/SecondaryImage/Image.tsx +3 -2
- package/Components/MasterCell/utils/index.ts +2 -2
- package/Components/PlayerContainer/ProgramInfo/index.tsx +3 -1
- package/Components/RouteManager/index.tsx +2 -2
- package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +2 -0
- package/Components/Screen/index.tsx +11 -4
- package/Components/VideoLive/PlayerLiveImageComponent.tsx +31 -28
- package/Components/VideoLive/__tests__/PlayerLiveImageComponent.test.tsx +25 -3
- package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +22 -27
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +211 -163
- package/package.json +5 -5
|
@@ -3,7 +3,6 @@ import * as R from "ramda";
|
|
|
3
3
|
import {
|
|
4
4
|
View,
|
|
5
5
|
StyleSheet,
|
|
6
|
-
Image,
|
|
7
6
|
Text,
|
|
8
7
|
ViewStyle,
|
|
9
8
|
TextStyle,
|
|
@@ -13,6 +12,7 @@ import {
|
|
|
13
12
|
import { defaultAsset } from "./defaultAsset";
|
|
14
13
|
import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
15
14
|
import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
15
|
+
import { QBImage as Image } from "@applicaster/zapp-react-native-ui-components/Components/Image";
|
|
16
16
|
import { Button } from "./Button";
|
|
17
17
|
|
|
18
18
|
type ButtonProp = {
|
|
@@ -3,32 +3,10 @@ import FastImage, {
|
|
|
3
3
|
FastImageProps,
|
|
4
4
|
} from "@applicaster/react-native-fast-image";
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
const source = React.useMemo(() => {
|
|
8
|
-
if (typeof props.source === "number") {
|
|
9
|
-
return props.source;
|
|
10
|
-
}
|
|
6
|
+
import { useImageSource } from "./utils";
|
|
11
7
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
headers: props.source.headers,
|
|
15
|
-
priority: props.source.priority,
|
|
16
|
-
cache: props.source.cache,
|
|
17
|
-
maxWidth: props.source.maxWidth,
|
|
18
|
-
maxHeight: props.source.maxHeight,
|
|
19
|
-
};
|
|
20
|
-
}, [
|
|
21
|
-
...(typeof props.source === "object"
|
|
22
|
-
? [
|
|
23
|
-
props.source?.uri,
|
|
24
|
-
props.source?.priority,
|
|
25
|
-
props.source?.cache,
|
|
26
|
-
props.source?.headers,
|
|
27
|
-
props.source?.maxWidth,
|
|
28
|
-
props.source?.maxHeight,
|
|
29
|
-
]
|
|
30
|
-
: []),
|
|
31
|
-
]);
|
|
8
|
+
export const QBImage = (props: FastImageProps) => {
|
|
9
|
+
const source = useImageSource(props.source);
|
|
32
10
|
|
|
33
11
|
return <FastImage {...props} source={source} />;
|
|
34
12
|
};
|
|
@@ -1,8 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
Image,
|
|
4
|
+
ImageBackground,
|
|
5
|
+
ImageProps,
|
|
6
|
+
ImageStyle,
|
|
7
|
+
StyleProp,
|
|
8
|
+
} from "react-native";
|
|
2
9
|
|
|
3
10
|
export interface Props extends ImageProps {
|
|
4
11
|
style?: StyleProp<ImageStyle> | undefined;
|
|
5
12
|
}
|
|
6
13
|
|
|
7
14
|
// TODO - React.FC<Props> QBImage should process incoming url and apply any transformations if needed
|
|
8
|
-
export const QBImage =
|
|
15
|
+
export const QBImage = ({
|
|
16
|
+
children,
|
|
17
|
+
...props
|
|
18
|
+
}: Props & { children?: React.ReactNode }) => {
|
|
19
|
+
if (children) {
|
|
20
|
+
return <ImageBackground {...props}>{children}</ImageBackground>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return <Image {...props} />;
|
|
24
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
|
|
3
|
+
export const useImageSource = (source) => {
|
|
4
|
+
return useMemo(() => {
|
|
5
|
+
if (typeof source === "number") {
|
|
6
|
+
return source;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return {
|
|
10
|
+
uri: source.uri,
|
|
11
|
+
headers: source.headers,
|
|
12
|
+
priority: source.priority,
|
|
13
|
+
cache: source.cache,
|
|
14
|
+
maxWidth: source.maxWidth,
|
|
15
|
+
maxHeight: source.maxHeight,
|
|
16
|
+
};
|
|
17
|
+
}, [
|
|
18
|
+
...(typeof source === "object"
|
|
19
|
+
? [
|
|
20
|
+
source?.uri,
|
|
21
|
+
source?.priority,
|
|
22
|
+
source?.cache,
|
|
23
|
+
source?.headers,
|
|
24
|
+
source?.maxWidth,
|
|
25
|
+
source?.maxHeight,
|
|
26
|
+
]
|
|
27
|
+
: []),
|
|
28
|
+
]);
|
|
29
|
+
};
|
|
@@ -14,6 +14,46 @@ exports[`Layout TV renders 1`] = `
|
|
|
14
14
|
<View
|
|
15
15
|
backgroundImageUrl="http://applicaster.com"
|
|
16
16
|
testID="background-component"
|
|
17
|
-
|
|
17
|
+
>
|
|
18
|
+
<View
|
|
19
|
+
style={
|
|
20
|
+
Array [
|
|
21
|
+
Object {
|
|
22
|
+
"position": "absolute",
|
|
23
|
+
"top": 0,
|
|
24
|
+
"width": 1920,
|
|
25
|
+
"zIndex": 10,
|
|
26
|
+
},
|
|
27
|
+
Object {
|
|
28
|
+
"maxHeight": 10,
|
|
29
|
+
},
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
testID="nav-bar-container"
|
|
33
|
+
>
|
|
34
|
+
<View
|
|
35
|
+
isVisible={true}
|
|
36
|
+
menuPlugin={
|
|
37
|
+
Object {
|
|
38
|
+
"module": [Function],
|
|
39
|
+
"name": "resolved-menu-plug",
|
|
40
|
+
"type": "menu",
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
navigationProps={
|
|
44
|
+
Object {
|
|
45
|
+
"assets": undefined,
|
|
46
|
+
"home": undefined,
|
|
47
|
+
"nav_items": undefined,
|
|
48
|
+
"rules": undefined,
|
|
49
|
+
"selected": undefined,
|
|
50
|
+
"styles": undefined,
|
|
51
|
+
"title": "",
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
testID="nav-bar-component"
|
|
55
|
+
/>
|
|
56
|
+
</View>
|
|
57
|
+
</View>
|
|
18
58
|
</View>
|
|
19
59
|
`;
|
|
@@ -12,19 +12,7 @@ jest.mock("@applicaster/quick-brick-core/App/ActionSetters", () => ({
|
|
|
12
12
|
useRiverInitialState: () => ({}),
|
|
13
13
|
}));
|
|
14
14
|
|
|
15
|
-
jest.mock("@applicaster/zapp-react-native-utils/reactHooks/screen"
|
|
16
|
-
useCurrentScreenData: jest.fn(() => ({
|
|
17
|
-
navigations: [
|
|
18
|
-
{
|
|
19
|
-
category: "menu",
|
|
20
|
-
navigation_type: "menu",
|
|
21
|
-
styles: {
|
|
22
|
-
hide_secondary_level_menu: false,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
})),
|
|
27
|
-
}));
|
|
15
|
+
jest.mock("@applicaster/zapp-react-native-utils/reactHooks/screen");
|
|
28
16
|
|
|
29
17
|
const Layout = require("..").default;
|
|
30
18
|
|
|
@@ -118,7 +118,7 @@ const Layout = ({ Components, ComponentsExtraProps, children }: Props) => {
|
|
|
118
118
|
) : null}
|
|
119
119
|
{/** Render NavBarContainer over ScreenContainer to let tvOS native
|
|
120
120
|
focus manager works correctly to focus nav bar items first **/}
|
|
121
|
-
{
|
|
121
|
+
{isTVOS ? navBarContainer : null}
|
|
122
122
|
<TransitionOverlay />
|
|
123
123
|
</Components.Background>
|
|
124
124
|
</ScreenLayoutContextProvider>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { ImageStyle, View } from "react-native";
|
|
3
3
|
import * as R from "ramda";
|
|
4
|
-
import
|
|
4
|
+
import { QBImage } from "@applicaster/zapp-react-native-ui-components/Components/Image";
|
|
5
5
|
import { toBooleanWithDefaultFalse } from "@applicaster/zapp-react-native-utils/booleanUtils";
|
|
6
|
-
import { toFiniteNumberWithDefault } from "@applicaster/zapp-react-native-utils/numberUtils";
|
|
7
6
|
|
|
8
7
|
import { useImageSourceWithDefault, useCheckFailedUri } from "./hooks";
|
|
8
|
+
import useImageSize from "./hooks/useImageSize";
|
|
9
9
|
|
|
10
10
|
type Source = {
|
|
11
11
|
uri: string;
|
|
@@ -19,32 +19,13 @@ type Props = Record<string, any> & {
|
|
|
19
19
|
withDimensions: (source: Source) => Source;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
const MemoizedImage = React.memo(
|
|
23
|
-
|
|
24
|
-
const normalize = Math.ceil;
|
|
22
|
+
const MemoizedImage = React.memo(QBImage, R.equals);
|
|
25
23
|
|
|
26
24
|
const isValidExternalSource = (source): boolean =>
|
|
27
25
|
source?.uri?.startsWith("http") ||
|
|
28
26
|
source?.uri?.startsWith("data:image") ||
|
|
29
27
|
source?.uri?.startsWith("file://");
|
|
30
28
|
|
|
31
|
-
const isValidSize = (size: unknown): boolean =>
|
|
32
|
-
toFiniteNumberWithDefault(0, size) > 0;
|
|
33
|
-
|
|
34
|
-
const getSourceWithMaxSizes = (applyMaxSize, style, source) => {
|
|
35
|
-
const { width, height } = style;
|
|
36
|
-
|
|
37
|
-
if (!applyMaxSize || !isValidSize(width) || !isValidSize(height)) {
|
|
38
|
-
return source;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return {
|
|
42
|
-
...source,
|
|
43
|
-
maxWidth: normalize(width),
|
|
44
|
-
maxHeight: normalize(height),
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
|
|
48
29
|
export default function Image({
|
|
49
30
|
style,
|
|
50
31
|
uri,
|
|
@@ -82,10 +63,12 @@ export default function Image({
|
|
|
82
63
|
|
|
83
64
|
const applyMaxSize = toBooleanWithDefaultFalse(otherProps?.applyMaxSize);
|
|
84
65
|
|
|
85
|
-
const sourceWithMaxSizes =
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
66
|
+
const sourceWithMaxSizes = useImageSize({
|
|
67
|
+
style,
|
|
68
|
+
applyMaxSize,
|
|
69
|
+
source,
|
|
70
|
+
withDimensions,
|
|
71
|
+
});
|
|
89
72
|
|
|
90
73
|
if (isFailedToLoadUri(uri) || !isValidExternalSource(source)) {
|
|
91
74
|
return <View style={style} />;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ImageStyle } from "react-native";
|
|
3
|
+
import { toFiniteNumberWithDefault } from "@applicaster/zapp-react-native-utils/numberUtils";
|
|
4
|
+
|
|
5
|
+
type Source = {
|
|
6
|
+
uri: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type Props = Record<string, any> & {
|
|
10
|
+
style: ImageStyle;
|
|
11
|
+
uri?: string;
|
|
12
|
+
placeholderImage?: string;
|
|
13
|
+
entry?: ZappEntry | ZappFeed;
|
|
14
|
+
withDimensions: (source: Source) => Source;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const normalize = Math.ceil;
|
|
18
|
+
|
|
19
|
+
const isValidSize = (size: unknown): boolean =>
|
|
20
|
+
toFiniteNumberWithDefault(0, size) > 0;
|
|
21
|
+
|
|
22
|
+
type WidthDimensions = { aspectRatio?: number; width: number; height?: number };
|
|
23
|
+
type HeightDimensions = {
|
|
24
|
+
aspectRatio?: number;
|
|
25
|
+
width?: number;
|
|
26
|
+
height: number;
|
|
27
|
+
};
|
|
28
|
+
type FullDimensions = { aspectRatio?: number; width: number; height: number };
|
|
29
|
+
type Dimensions = WidthDimensions | HeightDimensions | FullDimensions;
|
|
30
|
+
|
|
31
|
+
const calculateDimensions = ({ aspectRatio, width, height }: Dimensions) => {
|
|
32
|
+
if (aspectRatio) {
|
|
33
|
+
return {
|
|
34
|
+
width: width || height * aspectRatio,
|
|
35
|
+
height: height || width / aspectRatio,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return { width, height };
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const getSourceWithMaxSizes = (applyMaxSize, style, source) => {
|
|
43
|
+
const { width, height } = calculateDimensions(style);
|
|
44
|
+
|
|
45
|
+
if (!applyMaxSize || !isValidSize(width) || !isValidSize(height)) {
|
|
46
|
+
return source;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
...source,
|
|
51
|
+
maxWidth: normalize(width),
|
|
52
|
+
maxHeight: normalize(height),
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export default function useImageSize(props: Props) {
|
|
57
|
+
const { style, applyMaxSize, source, withDimensions } = props;
|
|
58
|
+
|
|
59
|
+
const sourceWithMaxSizes = React.useMemo(
|
|
60
|
+
() => withDimensions(getSourceWithMaxSizes(applyMaxSize, style, source)),
|
|
61
|
+
[applyMaxSize, style?.height, style?.width, source?.uri, withDimensions]
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
return sourceWithMaxSizes;
|
|
65
|
+
}
|
|
@@ -18,6 +18,7 @@ type LiveImageProps = {
|
|
|
18
18
|
imageKey?: string;
|
|
19
19
|
state: "focused" | "unfocused" | "selected";
|
|
20
20
|
audio_muted_by_default?: boolean;
|
|
21
|
+
uri: string; // cover image url
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
const DEFAULT_PLAYER_IDENTIFIER = "QuickBrickPlayerPlugin";
|
|
@@ -209,10 +210,11 @@ const LiveImageComponent = (props: LiveImageProps) => {
|
|
|
209
210
|
|
|
210
211
|
return (
|
|
211
212
|
<>
|
|
212
|
-
<Image {...props} />
|
|
213
|
+
<Image {...props} applyMaxSize />
|
|
213
214
|
{isShouldRender && (
|
|
214
215
|
<View style={[style, positionAbsolute]}>
|
|
215
216
|
<PlayerLiveImage
|
|
217
|
+
uri={props.uri}
|
|
216
218
|
playerId={cellUUID}
|
|
217
219
|
playerPluginId={playerPluginId}
|
|
218
220
|
screenConfig={screenConfig}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { isNil } from "ramda";
|
|
3
|
-
import {
|
|
3
|
+
import { ImageStyle, View } from "react-native";
|
|
4
4
|
import {
|
|
5
5
|
FIT_POSITION,
|
|
6
6
|
IMAGE_SIZING_FIT,
|
|
7
7
|
IMAGE_SIZING_FILL,
|
|
8
8
|
} from "@applicaster/zapp-react-native-utils/manifestUtils/secondaryImage";
|
|
9
|
+
import { QBImage as Image } from "@applicaster/zapp-react-native-ui-components/Components/Image";
|
|
9
10
|
|
|
10
11
|
import { useGetImageDimensions } from "./hooks";
|
|
11
12
|
import {
|
|
@@ -59,7 +60,7 @@ const SecondaryImageComponent = (props: Props) => {
|
|
|
59
60
|
|
|
60
61
|
return (
|
|
61
62
|
<View style={style} onLayout={onAsyncRender}>
|
|
62
|
-
<
|
|
63
|
+
<Image
|
|
63
64
|
{...props}
|
|
64
65
|
source={{ uri }}
|
|
65
66
|
style={{
|
|
@@ -4,7 +4,9 @@ import { styleKeys } from "@applicaster/zapp-react-native-utils/styleKeysUtils";
|
|
|
4
4
|
import { transformColorCode as fixColorHexCode } from "@applicaster/zapp-react-native-utils/transform";
|
|
5
5
|
import * as R from "ramda";
|
|
6
6
|
import * as React from "react";
|
|
7
|
-
import {
|
|
7
|
+
import { Text, TextStyle, View, ViewStyle } from "react-native";
|
|
8
|
+
import { QBImage as Image } from "@applicaster/zapp-react-native-ui-components/Components/Image";
|
|
9
|
+
|
|
8
10
|
import * as programStyles from "./styles";
|
|
9
11
|
|
|
10
12
|
type Props = {
|
|
@@ -14,7 +14,7 @@ type Props = { pathname: string; screenData: Record<string, any> };
|
|
|
14
14
|
* @param {Props}: see props above
|
|
15
15
|
*/
|
|
16
16
|
export function RouteManager(props: Props) {
|
|
17
|
-
const { pathname, screenData } = useRoute();
|
|
17
|
+
const { pathname, screenData: _screenData } = useRoute();
|
|
18
18
|
const pathAttributes = getPathAttributes({ pathname });
|
|
19
19
|
|
|
20
20
|
const { screenType, screenId } = R.last(pathAttributes);
|
|
@@ -25,7 +25,7 @@ export function RouteManager(props: Props) {
|
|
|
25
25
|
screenType={screenType}
|
|
26
26
|
screenId={screenId}
|
|
27
27
|
{...props}
|
|
28
|
-
screenData={screenData}
|
|
28
|
+
screenData={props.screenData}
|
|
29
29
|
/>
|
|
30
30
|
</TestId>
|
|
31
31
|
);
|
|
@@ -19,6 +19,7 @@ exports[`<Screen Component /> when the navbar should be hidden renders correctly
|
|
|
19
19
|
<View>
|
|
20
20
|
<View
|
|
21
21
|
pathname="/river/testId"
|
|
22
|
+
screenData={Object {}}
|
|
22
23
|
testID="routeManager"
|
|
23
24
|
/>
|
|
24
25
|
</View>
|
|
@@ -44,6 +45,7 @@ exports[`<Screen Component /> when the navbar should show renders correctly 1`]
|
|
|
44
45
|
<View>
|
|
45
46
|
<View
|
|
46
47
|
pathname="/river/testId"
|
|
48
|
+
screenData={Object {}}
|
|
47
49
|
testID="routeManager"
|
|
48
50
|
/>
|
|
49
51
|
</View>
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
useCurrentScreenData,
|
|
15
15
|
useNavbarState,
|
|
16
16
|
useScreenData,
|
|
17
|
+
useNavigation,
|
|
17
18
|
} from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
18
19
|
import { getNavigationPluginModule } from "@applicaster/zapp-react-native-app/App/Layout/layoutHelpers";
|
|
19
20
|
|
|
@@ -41,13 +42,18 @@ function isValidColor(string) {
|
|
|
41
42
|
|
|
42
43
|
type Props = {
|
|
43
44
|
pathname: string;
|
|
44
|
-
screenData:
|
|
45
|
+
screenData: Record<string, any>;
|
|
45
46
|
setToggleMenu: () => void;
|
|
46
47
|
setCloseMenu: () => void;
|
|
47
48
|
};
|
|
48
49
|
|
|
49
|
-
export function Screen({
|
|
50
|
+
export function Screen({
|
|
51
|
+
setToggleMenu,
|
|
52
|
+
setCloseMenu,
|
|
53
|
+
screenData: _screenData,
|
|
54
|
+
}: Props) {
|
|
50
55
|
const theme = useTheme<BaseThemePropertiesMobile>();
|
|
56
|
+
const navigation = useNavigation();
|
|
51
57
|
const { plugins } = usePickFromState(["plugins"]);
|
|
52
58
|
|
|
53
59
|
// Gets the data for the current screen configuration
|
|
@@ -63,7 +69,8 @@ export function Screen({ setToggleMenu, setCloseMenu }: Props) {
|
|
|
63
69
|
|
|
64
70
|
const currentRiver = useScreenData(
|
|
65
71
|
(routeData.screenData as ZappRiver)?.targetScreen
|
|
66
|
-
? (routeData.screenData as ZappRiver)?.targetScreen
|
|
72
|
+
? (routeData.screenData as ZappRiver)?.targetScreen?.id ??
|
|
73
|
+
navigation.activeRiver.id
|
|
67
74
|
: (routeData.screenData as ZappRiver)?.screen_id
|
|
68
75
|
);
|
|
69
76
|
|
|
@@ -130,7 +137,7 @@ export function Screen({ setToggleMenu, setCloseMenu }: Props) {
|
|
|
130
137
|
|
|
131
138
|
<OfflineFallbackScreen screenData={screenData}>
|
|
132
139
|
{/* @TODO RouteManager doesn't use props, can they be removed ? */}
|
|
133
|
-
<RouteManager pathname={pathname} screenData={
|
|
140
|
+
<RouteManager pathname={pathname} screenData={_screenData} />
|
|
134
141
|
</OfflineFallbackScreen>
|
|
135
142
|
</View>
|
|
136
143
|
</ScreenContextProvider>
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
15
15
|
import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils/playerManager";
|
|
16
16
|
import { getUserCellPlayerMutedPreference } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/userCellPlayerMutedPreference";
|
|
17
|
-
import
|
|
17
|
+
import Image from "@applicaster/zapp-react-native-ui-components/Components/MasterCell/DefaultComponents/Image";
|
|
18
18
|
import { LiveImage, LiveImageManager, LiveImageType } from "./LiveImageManager";
|
|
19
19
|
|
|
20
20
|
import { AnimatedInOut } from "@applicaster/zapp-react-native-ui-components/Components/AnimatedInOut";
|
|
@@ -39,12 +39,13 @@ type Props = {
|
|
|
39
39
|
imageKey?: string;
|
|
40
40
|
screenConfig: Record<string, any>;
|
|
41
41
|
audioMutedByDefault?: boolean;
|
|
42
|
+
uri: string; // cover image url
|
|
42
43
|
};
|
|
43
44
|
|
|
44
45
|
const PlayerLiveImageComponent = (props: Props) => {
|
|
45
46
|
const dimensions = useDimensions("screen", { fullDimensions: true });
|
|
46
47
|
|
|
47
|
-
const { item, style, playerId
|
|
48
|
+
const { item, style, playerId } = props;
|
|
48
49
|
|
|
49
50
|
const timeoutRef = React.useRef<NodeJS.Timeout | null>(null);
|
|
50
51
|
const [mode, setMode] = React.useState(LiveImageType.Image);
|
|
@@ -63,24 +64,27 @@ const PlayerLiveImageComponent = (props: Props) => {
|
|
|
63
64
|
*
|
|
64
65
|
* @param type video or image
|
|
65
66
|
*/
|
|
66
|
-
const setModeDebounced = React.useCallback(
|
|
67
|
-
|
|
68
|
-
if (type ===
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
const setModeDebounced = React.useCallback(
|
|
68
|
+
(type: LiveImageType) => {
|
|
69
|
+
if (type === LiveImageType.Video) {
|
|
70
|
+
if (type === mode) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
timeoutRef.current = setTimeout(() => {
|
|
75
|
+
setMode(type);
|
|
76
|
+
}, 1000) as unknown as NodeJS.Timeout;
|
|
77
|
+
} else {
|
|
78
|
+
if (timeoutRef.current) {
|
|
79
|
+
clearTimeout(timeoutRef.current);
|
|
80
|
+
timeoutRef.current = null;
|
|
81
|
+
}
|
|
71
82
|
|
|
72
|
-
timeoutRef.current = setTimeout(() => {
|
|
73
83
|
setMode(type);
|
|
74
|
-
}, 1000) as unknown as NodeJS.Timeout;
|
|
75
|
-
} else {
|
|
76
|
-
if (timeoutRef.current) {
|
|
77
|
-
clearTimeout(timeoutRef.current);
|
|
78
|
-
timeoutRef.current = null;
|
|
79
84
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}, [mode]);
|
|
85
|
+
},
|
|
86
|
+
[mode]
|
|
87
|
+
);
|
|
84
88
|
|
|
85
89
|
const { screenConfig, playerPluginId } = props;
|
|
86
90
|
|
|
@@ -100,7 +104,7 @@ const PlayerLiveImageComponent = (props: Props) => {
|
|
|
100
104
|
return new LiveImage({
|
|
101
105
|
playerId,
|
|
102
106
|
player: playerFactoryItem.controller,
|
|
103
|
-
component: playerFactoryItem?.Component
|
|
107
|
+
component: playerFactoryItem?.Component,
|
|
104
108
|
});
|
|
105
109
|
} else {
|
|
106
110
|
throw new Error("Player factory item is null");
|
|
@@ -111,10 +115,7 @@ const PlayerLiveImageComponent = (props: Props) => {
|
|
|
111
115
|
liveImageItem.setMode = setModeDebounced;
|
|
112
116
|
}, [setModeDebounced, liveImageItem]);
|
|
113
117
|
|
|
114
|
-
const { start, end } = React.useMemo(
|
|
115
|
-
() => getAutoplaySettings(item),
|
|
116
|
-
[item]
|
|
117
|
-
);
|
|
118
|
+
const { start, end } = React.useMemo(() => getAutoplaySettings(item), [item]);
|
|
118
119
|
|
|
119
120
|
const controller = liveImageItem.getPlayer();
|
|
120
121
|
const player = usePlayer(playerId);
|
|
@@ -239,7 +240,12 @@ const PlayerLiveImageComponent = (props: Props) => {
|
|
|
239
240
|
|
|
240
241
|
const onPositionUpdated = React.useCallback(
|
|
241
242
|
(data) => {
|
|
242
|
-
const normalizedRect = (rect: {
|
|
243
|
+
const normalizedRect = (rect: {
|
|
244
|
+
left: number;
|
|
245
|
+
right: number;
|
|
246
|
+
top: number;
|
|
247
|
+
bottom: number;
|
|
248
|
+
}) => {
|
|
243
249
|
if (!rect) {
|
|
244
250
|
return null;
|
|
245
251
|
}
|
|
@@ -283,6 +289,7 @@ const PlayerLiveImageComponent = (props: Props) => {
|
|
|
283
289
|
const videoStyles = { ...style, position: "absolute", zIndex: -100 };
|
|
284
290
|
const Player: any = liveImageItem.component || BufferAnimation;
|
|
285
291
|
|
|
292
|
+
// TODO: nice to have - resolve imageKey when imageUrl is not provided
|
|
286
293
|
return (
|
|
287
294
|
<TrackedView
|
|
288
295
|
testId={`tracked-view-${playerId}-${item.title}`}
|
|
@@ -307,11 +314,7 @@ const PlayerLiveImageComponent = (props: Props) => {
|
|
|
307
314
|
animationConfig={overlayFadeIn}
|
|
308
315
|
staticStyles={style}
|
|
309
316
|
>
|
|
310
|
-
<
|
|
311
|
-
entry={item}
|
|
312
|
-
style={style}
|
|
313
|
-
imageKey={imageKey}
|
|
314
|
-
/>
|
|
317
|
+
<Image {...props} resizeMode="cover" style={style} applyMaxSize />
|
|
315
318
|
</AnimatedInOut>
|
|
316
319
|
}
|
|
317
320
|
</TrackedView>
|
|
@@ -3,6 +3,8 @@ import * as React from "react";
|
|
|
3
3
|
import { render } from "@testing-library/react-native";
|
|
4
4
|
import * as PlayerFactory from "@applicaster/zapp-react-native-utils/appUtils/playerManager/playerFactory";
|
|
5
5
|
import { Player } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/player";
|
|
6
|
+
import { ThemeContext } from "@applicaster/zapp-react-native-utils/theme";
|
|
7
|
+
|
|
6
8
|
import { PlayerLiveImage } from "../PlayerLiveImageComponent";
|
|
7
9
|
|
|
8
10
|
const seekTo = jest.fn();
|
|
@@ -16,6 +18,14 @@ jest.mock(
|
|
|
16
18
|
})
|
|
17
19
|
);
|
|
18
20
|
|
|
21
|
+
const Wrapper = ({ children }: { children: React.ReactChildren }) => (
|
|
22
|
+
<ThemeContext.Provider
|
|
23
|
+
value={{ themes: { myTheme: {} }, selectedThemeId: "myTheme" }}
|
|
24
|
+
>
|
|
25
|
+
{children}
|
|
26
|
+
</ThemeContext.Provider>
|
|
27
|
+
);
|
|
28
|
+
|
|
19
29
|
describe("PlayerLiveImageComponent", () => {
|
|
20
30
|
const defaultProps = {
|
|
21
31
|
item: { id: "1", title: "Test", type: { value: "" } },
|
|
@@ -39,7 +49,11 @@ describe("PlayerLiveImageComponent", () => {
|
|
|
39
49
|
});
|
|
40
50
|
|
|
41
51
|
it("should render correctly with default props", () => {
|
|
42
|
-
const component = render(
|
|
52
|
+
const component = render(
|
|
53
|
+
<Wrapper>
|
|
54
|
+
<PlayerLiveImage {...defaultProps} />
|
|
55
|
+
</Wrapper>
|
|
56
|
+
);
|
|
43
57
|
|
|
44
58
|
expect(component.toJSON()).toMatchSnapshot();
|
|
45
59
|
});
|
|
@@ -53,7 +67,11 @@ describe("PlayerLiveImageComponent", () => {
|
|
|
53
67
|
},
|
|
54
68
|
};
|
|
55
69
|
|
|
56
|
-
render(
|
|
70
|
+
render(
|
|
71
|
+
<Wrapper>
|
|
72
|
+
<PlayerLiveImage {...props} />
|
|
73
|
+
</Wrapper>
|
|
74
|
+
);
|
|
57
75
|
|
|
58
76
|
// TODO: implement this test
|
|
59
77
|
});
|
|
@@ -67,7 +85,11 @@ describe("PlayerLiveImageComponent", () => {
|
|
|
67
85
|
},
|
|
68
86
|
};
|
|
69
87
|
|
|
70
|
-
render(
|
|
88
|
+
render(
|
|
89
|
+
<Wrapper>
|
|
90
|
+
<PlayerLiveImage {...props} />
|
|
91
|
+
</Wrapper>
|
|
92
|
+
);
|
|
71
93
|
|
|
72
94
|
// TODO: implement this test
|
|
73
95
|
});
|
|
@@ -13,35 +13,30 @@ exports[`PlayerLiveImageComponent should render correctly with default props 1`]
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
>
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
<Image
|
|
17
|
+
applyMaxSize={true}
|
|
18
|
+
audioMutedByDefault={false}
|
|
19
|
+
imageKey="image1"
|
|
20
|
+
item={
|
|
21
|
+
Object {
|
|
22
|
+
"id": "1",
|
|
23
|
+
"title": "Test",
|
|
24
|
+
"type": Object {
|
|
25
|
+
"value": "",
|
|
26
|
+
},
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
Object {
|
|
37
|
-
"height": undefined,
|
|
38
|
-
"width": undefined,
|
|
39
|
-
},
|
|
40
|
-
undefined,
|
|
41
|
-
]
|
|
28
|
+
}
|
|
29
|
+
onError={[Function]}
|
|
30
|
+
playerId="player1"
|
|
31
|
+
resizeMode="cover"
|
|
32
|
+
screenConfig={Object {}}
|
|
33
|
+
source={
|
|
34
|
+
Object {
|
|
35
|
+
"uri": "",
|
|
42
36
|
}
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
}
|
|
38
|
+
style={Object {}}
|
|
39
|
+
/>
|
|
45
40
|
</View>
|
|
46
41
|
</TrackedView>
|
|
47
42
|
`;
|
|
@@ -1,249 +1,297 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`PlayerWrapper renders inline 1`] = `
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
Object {
|
|
7
|
-
"bottom": "off",
|
|
8
|
-
"left": "off",
|
|
9
|
-
"right": "off",
|
|
10
|
-
"top": "additive",
|
|
11
|
-
}
|
|
12
|
-
}
|
|
4
|
+
<RNCSafeAreaProvider
|
|
5
|
+
onInsetsChange={[Function]}
|
|
13
6
|
style={
|
|
14
7
|
Array [
|
|
15
8
|
Object {
|
|
16
|
-
"
|
|
17
|
-
},
|
|
18
|
-
Object {
|
|
19
|
-
"backgroundColor": "transparent",
|
|
20
|
-
},
|
|
21
|
-
Object {
|
|
22
|
-
"height": 800,
|
|
23
|
-
"width": 300,
|
|
9
|
+
"flex": 1,
|
|
24
10
|
},
|
|
25
|
-
|
|
11
|
+
undefined,
|
|
26
12
|
]
|
|
27
13
|
}
|
|
28
14
|
>
|
|
29
|
-
<
|
|
15
|
+
<RNCSafeAreaView
|
|
16
|
+
edges={
|
|
17
|
+
Object {
|
|
18
|
+
"bottom": "off",
|
|
19
|
+
"left": "off",
|
|
20
|
+
"right": "off",
|
|
21
|
+
"top": "additive",
|
|
22
|
+
}
|
|
23
|
+
}
|
|
30
24
|
style={
|
|
31
25
|
Array [
|
|
32
26
|
Object {
|
|
33
|
-
"
|
|
34
|
-
"position": "relative",
|
|
35
|
-
"zIndex": 200,
|
|
27
|
+
"flexDirection": "column",
|
|
36
28
|
},
|
|
37
29
|
Object {
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
"backgroundColor": "transparent",
|
|
31
|
+
},
|
|
32
|
+
Object {
|
|
33
|
+
"height": 800,
|
|
34
|
+
"width": 300,
|
|
41
35
|
},
|
|
42
|
-
Object {},
|
|
43
36
|
Object {},
|
|
44
37
|
]
|
|
45
38
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
>
|
|
40
|
+
<View
|
|
41
|
+
style={
|
|
42
|
+
Array [
|
|
43
|
+
Object {
|
|
44
|
+
"alignSelf": "center",
|
|
45
|
+
"position": "relative",
|
|
46
|
+
"zIndex": 200,
|
|
47
|
+
},
|
|
48
|
+
Object {
|
|
49
|
+
"aspectRatio": 1.7777777777777777,
|
|
50
|
+
"height": undefined,
|
|
51
|
+
"width": "100%",
|
|
52
|
+
},
|
|
53
|
+
Object {},
|
|
54
|
+
Object {},
|
|
55
|
+
]
|
|
53
56
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
testID="test-player-container"
|
|
58
|
+
/>
|
|
59
|
+
<View
|
|
60
|
+
configuration={
|
|
61
|
+
Object {
|
|
62
|
+
"tablet_landscape_player_container_background_color": "red",
|
|
63
|
+
"tablet_landscape_sidebar_width": "35%",
|
|
64
|
+
}
|
|
58
65
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"flex": 1,
|
|
64
|
-
"paddingTop": 20,
|
|
66
|
+
entry={
|
|
67
|
+
Object {
|
|
68
|
+
"id": "test",
|
|
69
|
+
}
|
|
65
70
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
isTabletLandscape={false}
|
|
72
|
+
style={
|
|
73
|
+
Object {
|
|
74
|
+
"flex": 1,
|
|
75
|
+
"paddingTop": 20,
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/>
|
|
79
|
+
</RNCSafeAreaView>
|
|
80
|
+
</RNCSafeAreaProvider>
|
|
69
81
|
`;
|
|
70
82
|
|
|
71
83
|
exports[`PlayerWrapper renders inline and docked 1`] = `
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
Object {
|
|
75
|
-
"bottom": "additive",
|
|
76
|
-
"left": "off",
|
|
77
|
-
"right": "off",
|
|
78
|
-
"top": "off",
|
|
79
|
-
}
|
|
80
|
-
}
|
|
84
|
+
<RNCSafeAreaProvider
|
|
85
|
+
onInsetsChange={[Function]}
|
|
81
86
|
style={
|
|
82
87
|
Array [
|
|
83
88
|
Object {
|
|
84
|
-
"
|
|
85
|
-
},
|
|
86
|
-
Object {
|
|
87
|
-
"backgroundColor": "transparent",
|
|
88
|
-
},
|
|
89
|
-
Object {
|
|
90
|
-
"height": 50,
|
|
91
|
-
"width": 300,
|
|
89
|
+
"flex": 1,
|
|
92
90
|
},
|
|
93
|
-
|
|
91
|
+
undefined,
|
|
94
92
|
]
|
|
95
93
|
}
|
|
96
94
|
>
|
|
97
|
-
<
|
|
95
|
+
<RNCSafeAreaView
|
|
96
|
+
edges={
|
|
97
|
+
Object {
|
|
98
|
+
"bottom": "additive",
|
|
99
|
+
"left": "off",
|
|
100
|
+
"right": "off",
|
|
101
|
+
"top": "off",
|
|
102
|
+
}
|
|
103
|
+
}
|
|
98
104
|
style={
|
|
99
105
|
Array [
|
|
100
106
|
Object {
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
|
|
107
|
+
"flexDirection": "column",
|
|
108
|
+
},
|
|
109
|
+
Object {
|
|
110
|
+
"backgroundColor": "transparent",
|
|
104
111
|
},
|
|
105
112
|
Object {
|
|
106
|
-
"aspectRatio": undefined,
|
|
107
113
|
"height": 50,
|
|
108
|
-
"width":
|
|
114
|
+
"width": 300,
|
|
109
115
|
},
|
|
110
116
|
Object {},
|
|
111
|
-
Object {},
|
|
112
117
|
]
|
|
113
118
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
>
|
|
120
|
+
<View
|
|
121
|
+
style={
|
|
122
|
+
Array [
|
|
123
|
+
Object {
|
|
124
|
+
"alignSelf": "center",
|
|
125
|
+
"position": "relative",
|
|
126
|
+
"zIndex": 200,
|
|
127
|
+
},
|
|
128
|
+
Object {
|
|
129
|
+
"aspectRatio": undefined,
|
|
130
|
+
"height": 50,
|
|
131
|
+
"width": "100%",
|
|
132
|
+
},
|
|
133
|
+
Object {},
|
|
134
|
+
Object {},
|
|
135
|
+
]
|
|
121
136
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
137
|
+
testID="test-player-container"
|
|
138
|
+
/>
|
|
139
|
+
<View
|
|
140
|
+
style={
|
|
141
|
+
Object {
|
|
142
|
+
"flex": 1,
|
|
143
|
+
"paddingTop": 20,
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/>
|
|
147
|
+
</RNCSafeAreaView>
|
|
148
|
+
</RNCSafeAreaProvider>
|
|
125
149
|
`;
|
|
126
150
|
|
|
127
151
|
exports[`PlayerWrapper renders inline on tablet in landscape orientation 1`] = `
|
|
128
|
-
<
|
|
129
|
-
|
|
130
|
-
Object {
|
|
131
|
-
"bottom": "off",
|
|
132
|
-
"left": "off",
|
|
133
|
-
"right": "off",
|
|
134
|
-
"top": "additive",
|
|
135
|
-
}
|
|
136
|
-
}
|
|
152
|
+
<RNCSafeAreaProvider
|
|
153
|
+
onInsetsChange={[Function]}
|
|
137
154
|
style={
|
|
138
155
|
Array [
|
|
139
156
|
Object {
|
|
140
|
-
"
|
|
141
|
-
},
|
|
142
|
-
Object {
|
|
143
|
-
"backgroundColor": "red",
|
|
144
|
-
},
|
|
145
|
-
Object {
|
|
146
|
-
"height": 800,
|
|
147
|
-
"width": 300,
|
|
157
|
+
"flex": 1,
|
|
148
158
|
},
|
|
149
|
-
|
|
159
|
+
undefined,
|
|
150
160
|
]
|
|
151
161
|
}
|
|
152
162
|
>
|
|
153
|
-
<
|
|
163
|
+
<RNCSafeAreaView
|
|
164
|
+
edges={
|
|
165
|
+
Object {
|
|
166
|
+
"bottom": "off",
|
|
167
|
+
"left": "off",
|
|
168
|
+
"right": "off",
|
|
169
|
+
"top": "additive",
|
|
170
|
+
}
|
|
171
|
+
}
|
|
154
172
|
style={
|
|
155
173
|
Array [
|
|
156
174
|
Object {
|
|
157
|
-
"
|
|
158
|
-
"position": "relative",
|
|
159
|
-
"zIndex": 200,
|
|
175
|
+
"flexDirection": "row",
|
|
160
176
|
},
|
|
161
177
|
Object {
|
|
162
|
-
"
|
|
163
|
-
|
|
164
|
-
|
|
178
|
+
"backgroundColor": "red",
|
|
179
|
+
},
|
|
180
|
+
Object {
|
|
181
|
+
"height": 800,
|
|
182
|
+
"width": 300,
|
|
165
183
|
},
|
|
166
|
-
Object {},
|
|
167
184
|
Object {},
|
|
168
185
|
]
|
|
169
186
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
187
|
+
>
|
|
188
|
+
<View
|
|
189
|
+
style={
|
|
190
|
+
Array [
|
|
191
|
+
Object {
|
|
192
|
+
"alignSelf": "center",
|
|
193
|
+
"position": "relative",
|
|
194
|
+
"zIndex": 200,
|
|
195
|
+
},
|
|
196
|
+
Object {
|
|
197
|
+
"aspectRatio": 1.7777777777777777,
|
|
198
|
+
"height": undefined,
|
|
199
|
+
"width": 195,
|
|
200
|
+
},
|
|
201
|
+
Object {},
|
|
202
|
+
Object {},
|
|
203
|
+
]
|
|
177
204
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
205
|
+
testID="test-player-container"
|
|
206
|
+
/>
|
|
207
|
+
<View
|
|
208
|
+
configuration={
|
|
209
|
+
Object {
|
|
210
|
+
"tablet_landscape_player_container_background_color": "red",
|
|
211
|
+
"tablet_landscape_sidebar_width": "35%",
|
|
212
|
+
}
|
|
182
213
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
"flex": 1,
|
|
188
|
-
"paddingTop": 20,
|
|
214
|
+
entry={
|
|
215
|
+
Object {
|
|
216
|
+
"id": "test",
|
|
217
|
+
}
|
|
189
218
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
219
|
+
isTabletLandscape={true}
|
|
220
|
+
style={
|
|
221
|
+
Object {
|
|
222
|
+
"flex": 1,
|
|
223
|
+
"paddingTop": 20,
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
/>
|
|
227
|
+
</RNCSafeAreaView>
|
|
228
|
+
</RNCSafeAreaProvider>
|
|
193
229
|
`;
|
|
194
230
|
|
|
195
231
|
exports[`PlayerWrapper renders properly 1`] = `
|
|
196
|
-
<
|
|
197
|
-
|
|
198
|
-
Object {
|
|
199
|
-
"bottom": "off",
|
|
200
|
-
"left": "off",
|
|
201
|
-
"right": "off",
|
|
202
|
-
"top": "additive",
|
|
203
|
-
}
|
|
204
|
-
}
|
|
232
|
+
<RNCSafeAreaProvider
|
|
233
|
+
onInsetsChange={[Function]}
|
|
205
234
|
style={
|
|
206
235
|
Array [
|
|
207
236
|
Object {
|
|
208
|
-
"
|
|
209
|
-
},
|
|
210
|
-
Object {
|
|
211
|
-
"backgroundColor": "transparent",
|
|
212
|
-
},
|
|
213
|
-
Object {
|
|
214
|
-
"height": 800,
|
|
215
|
-
"width": 300,
|
|
237
|
+
"flex": 1,
|
|
216
238
|
},
|
|
217
|
-
|
|
239
|
+
undefined,
|
|
218
240
|
]
|
|
219
241
|
}
|
|
220
242
|
>
|
|
221
|
-
<
|
|
243
|
+
<RNCSafeAreaView
|
|
244
|
+
edges={
|
|
245
|
+
Object {
|
|
246
|
+
"bottom": "off",
|
|
247
|
+
"left": "off",
|
|
248
|
+
"right": "off",
|
|
249
|
+
"top": "additive",
|
|
250
|
+
}
|
|
251
|
+
}
|
|
222
252
|
style={
|
|
223
253
|
Array [
|
|
224
254
|
Object {
|
|
225
|
-
"
|
|
226
|
-
"position": "relative",
|
|
227
|
-
"zIndex": 200,
|
|
255
|
+
"flexDirection": "column",
|
|
228
256
|
},
|
|
229
257
|
Object {
|
|
230
|
-
"
|
|
231
|
-
|
|
232
|
-
|
|
258
|
+
"backgroundColor": "transparent",
|
|
259
|
+
},
|
|
260
|
+
Object {
|
|
261
|
+
"height": 800,
|
|
262
|
+
"width": 300,
|
|
233
263
|
},
|
|
234
|
-
Object {},
|
|
235
264
|
Object {},
|
|
236
265
|
]
|
|
237
266
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
267
|
+
>
|
|
268
|
+
<View
|
|
269
|
+
style={
|
|
270
|
+
Array [
|
|
271
|
+
Object {
|
|
272
|
+
"alignSelf": "center",
|
|
273
|
+
"position": "relative",
|
|
274
|
+
"zIndex": 200,
|
|
275
|
+
},
|
|
276
|
+
Object {
|
|
277
|
+
"aspectRatio": 1.7786666666666666,
|
|
278
|
+
"height": undefined,
|
|
279
|
+
"width": "100%",
|
|
280
|
+
},
|
|
281
|
+
Object {},
|
|
282
|
+
Object {},
|
|
283
|
+
]
|
|
245
284
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
285
|
+
testID="test-player-container"
|
|
286
|
+
/>
|
|
287
|
+
<View
|
|
288
|
+
style={
|
|
289
|
+
Object {
|
|
290
|
+
"flex": 1,
|
|
291
|
+
"paddingTop": 20,
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
/>
|
|
295
|
+
</RNCSafeAreaView>
|
|
296
|
+
</RNCSafeAreaProvider>
|
|
249
297
|
`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "12.0.0-rc.
|
|
3
|
+
"version": "12.0.0-rc.32",
|
|
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": "12.0.0-rc.
|
|
38
|
-
"@applicaster/zapp-react-native-bridge": "12.0.0-rc.
|
|
39
|
-
"@applicaster/zapp-react-native-redux": "12.0.0-rc.
|
|
40
|
-
"@applicaster/zapp-react-native-utils": "12.0.0-rc.
|
|
37
|
+
"@applicaster/applicaster-types": "12.0.0-rc.32",
|
|
38
|
+
"@applicaster/zapp-react-native-bridge": "12.0.0-rc.32",
|
|
39
|
+
"@applicaster/zapp-react-native-redux": "12.0.0-rc.32",
|
|
40
|
+
"@applicaster/zapp-react-native-utils": "12.0.0-rc.32",
|
|
41
41
|
"promise": "^8.3.0",
|
|
42
42
|
"react-router-native": "^5.1.2",
|
|
43
43
|
"url": "^0.11.0",
|