@applicaster/zapp-react-native-ui-components 12.0.0-alpha.5353184830 → 12.0.0-alpha.5432134741
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/Image/Image.android.tsx +0 -1
- package/Components/River/River.tsx +8 -5
- package/Components/River/useScreenConfiguration.ts +3 -4
- package/Components/Screen/__tests__/Screen.test.tsx +16 -29
- package/Components/Screen/index.tsx +0 -1
- package/Components/VideoLive/LiveImageManager.ts +5 -3
- package/Components/VideoModal/PlayerWrapper.tsx +3 -1
- package/Decorators/RiverResolver/index.tsx +0 -4
- package/Decorators/index.tsx +0 -4
- package/package.json +5 -6
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as R from "ramda";
|
|
3
|
+
import { GeneralContentScreen } from "@applicaster/zapp-react-native-ui-components/Components/GeneralContentScreen";
|
|
3
4
|
|
|
4
5
|
import { FeedLoader } from "../FeedLoader";
|
|
5
6
|
import { ScreenResolver } from "../ScreenResolver";
|
|
6
7
|
|
|
7
|
-
import type { ZappScreenProps } from "@applicaster/zapp-react-native-flow-types";
|
|
8
|
-
|
|
9
|
-
import { GeneralContentScreen } from "../GeneralContentScreen";
|
|
10
|
-
|
|
11
8
|
type Props = ZappScreenProps & {
|
|
12
9
|
feedUrl?: string;
|
|
13
10
|
isInsideContainer?: boolean;
|
|
@@ -18,6 +15,12 @@ type Props = ZappScreenProps & {
|
|
|
18
15
|
| import("react-native").FlatListProps<any>
|
|
19
16
|
) &
|
|
20
17
|
Record<string, any>;
|
|
18
|
+
appData: AppDataKeys;
|
|
19
|
+
screenTitle: string;
|
|
20
|
+
screenSummary: string;
|
|
21
|
+
setIsScreenWrappedInContainer: (isInsideContainer: boolean) => void;
|
|
22
|
+
screenContext: ZappRiver;
|
|
23
|
+
river: ZappRiver;
|
|
21
24
|
};
|
|
22
25
|
|
|
23
26
|
type State = {
|
|
@@ -27,7 +30,7 @@ type State = {
|
|
|
27
30
|
export class RiverComponent extends React.Component<Props, State> {
|
|
28
31
|
private currentScreenTitle: string;
|
|
29
32
|
private currentScreenSummary: string;
|
|
30
|
-
constructor(props) {
|
|
33
|
+
constructor(props: Props) {
|
|
31
34
|
super(props);
|
|
32
35
|
|
|
33
36
|
this.state = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as R from "ramda";
|
|
2
2
|
|
|
3
3
|
import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
|
|
4
|
-
import {
|
|
4
|
+
import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
5
5
|
import { toCamelCase } from "@applicaster/zapp-react-native-utils/stringUtils";
|
|
6
6
|
import { useMemo } from "react";
|
|
7
7
|
import { isNilOrEmpty } from "@applicaster/zapp-react-native-utils/reactUtils/helpers";
|
|
@@ -47,7 +47,7 @@ const stylingKeys = [
|
|
|
47
47
|
|
|
48
48
|
export function useScreenConfiguration(screenId: string): ScreenConfiguration {
|
|
49
49
|
const { rivers } = usePickFromState(["rivers"]);
|
|
50
|
-
const
|
|
50
|
+
const isTablet = useIsTablet();
|
|
51
51
|
|
|
52
52
|
return useMemo(() => {
|
|
53
53
|
const config = {} as ScreenConfiguration;
|
|
@@ -56,8 +56,7 @@ export function useScreenConfiguration(screenId: string): ScreenConfiguration {
|
|
|
56
56
|
if (screenData) {
|
|
57
57
|
const { styles } = screenData;
|
|
58
58
|
|
|
59
|
-
const keyPrefix =
|
|
60
|
-
deviceInfo?.isTablet && styles?.tablet_theme ? "tablet_" : "";
|
|
59
|
+
const keyPrefix = isTablet && styles?.tablet_theme ? "tablet_" : "";
|
|
61
60
|
|
|
62
61
|
stylingKeys.forEach(([key, castFn]) => {
|
|
63
62
|
const styleKey = `${keyPrefix}${key}`;
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { create, act } from "react-test-renderer";
|
|
4
|
-
import { Provider } from "react-redux";
|
|
5
|
-
import configureStore from "redux-mock-store";
|
|
6
|
-
|
|
7
|
-
const mockStore = configureStore();
|
|
8
|
-
|
|
9
|
-
const plugins = [];
|
|
10
|
-
const store = mockStore({ plugins });
|
|
11
|
-
|
|
12
|
-
import { ORIENTATIONS } from "@applicaster/zapp-react-native-utils/appUtils/orientationHelper";
|
|
13
4
|
|
|
14
5
|
const Mocked_RouteManager = jest.fn((props) => (
|
|
15
6
|
<View testID="routeManager" {...props} />
|
|
@@ -124,11 +115,7 @@ describe("<Screen Component />", () => {
|
|
|
124
115
|
|
|
125
116
|
describe("when the navbar should show", () => {
|
|
126
117
|
act(() => {
|
|
127
|
-
wrapper = create(
|
|
128
|
-
<Provider store={store}>
|
|
129
|
-
<Screen {...screenProps} />{" "}
|
|
130
|
-
</Provider>
|
|
131
|
-
);
|
|
118
|
+
wrapper = create(<Screen {...screenProps} />);
|
|
132
119
|
});
|
|
133
120
|
|
|
134
121
|
it("renders correctly", () => {
|
|
@@ -136,24 +123,24 @@ describe("<Screen Component />", () => {
|
|
|
136
123
|
});
|
|
137
124
|
});
|
|
138
125
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
126
|
+
describe("when the navbar should be hidden", () => {
|
|
127
|
+
beforeEach(() => {
|
|
128
|
+
mock_navBarVisibleFlag = false;
|
|
129
|
+
wrapper = create(<Screen {...screenProps} />);
|
|
130
|
+
});
|
|
144
131
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
132
|
+
afterEach(() => {
|
|
133
|
+
mock_navBarVisibleFlag = true;
|
|
134
|
+
});
|
|
148
135
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
136
|
+
it("renders correctly", () => {
|
|
137
|
+
act(() => {
|
|
138
|
+
wrapper = create(<Screen {...screenProps} />);
|
|
139
|
+
});
|
|
153
140
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
141
|
+
expect(wrapper.toJSON()).toMatchSnapshot();
|
|
142
|
+
});
|
|
143
|
+
});
|
|
157
144
|
|
|
158
145
|
// it("invokes the orientation hook when the route changes", () => {
|
|
159
146
|
// act(() => {
|
|
@@ -7,7 +7,6 @@ import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
|
|
|
7
7
|
import { useScreenOrientationHandler } from "./orientationHandler";
|
|
8
8
|
import { useScreenConfiguration } from "../River/useScreenConfiguration";
|
|
9
9
|
import { useCurrentScreenData } from "@applicaster/zapp-react-native-utils/reactHooks/screen";
|
|
10
|
-
import type { ZappNavigationProps } from "@applicaster/zapp-react-native-flow-types/index";
|
|
11
10
|
import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
|
|
12
11
|
import { ScreenContextProvider } from "../../Contexts/ScreenContext";
|
|
13
12
|
|
|
@@ -379,7 +379,9 @@ export class LiveImageManager implements PlayerLifecycleListener {
|
|
|
379
379
|
onLiveImageError = (item: LiveImage, error: Error) => {
|
|
380
380
|
item.setMode(LiveImageType.Image);
|
|
381
381
|
|
|
382
|
-
|
|
382
|
+
const currentItem = this.currentlyPlaying;
|
|
383
|
+
|
|
384
|
+
if (currentItem === item) {
|
|
383
385
|
this.currentlyPlaying = null;
|
|
384
386
|
// TODO: ...Maybe player some other item
|
|
385
387
|
}
|
|
@@ -389,8 +391,8 @@ export class LiveImageManager implements PlayerLifecycleListener {
|
|
|
389
391
|
event: {
|
|
390
392
|
item,
|
|
391
393
|
error,
|
|
392
|
-
playerId:
|
|
393
|
-
primaryPlayerId:
|
|
394
|
+
playerId: currentItem?.playerId,
|
|
395
|
+
primaryPlayerId: currentItem?.playerId,
|
|
394
396
|
},
|
|
395
397
|
});
|
|
396
398
|
};
|
|
@@ -33,6 +33,7 @@ type Props = {
|
|
|
33
33
|
containerStyle?: ViewStyle;
|
|
34
34
|
inline?: boolean;
|
|
35
35
|
docked?: boolean;
|
|
36
|
+
pip?: boolean;
|
|
36
37
|
isModal?: boolean;
|
|
37
38
|
fullscreen?: boolean;
|
|
38
39
|
isTabletPortrait?: boolean;
|
|
@@ -135,6 +136,7 @@ export const PlayerWrapper = (props: Props) => {
|
|
|
135
136
|
children,
|
|
136
137
|
isTabletPortrait,
|
|
137
138
|
configuration,
|
|
139
|
+
pip,
|
|
138
140
|
} = props;
|
|
139
141
|
|
|
140
142
|
const isTablet = useIsTablet();
|
|
@@ -158,7 +160,7 @@ export const PlayerWrapper = (props: Props) => {
|
|
|
158
160
|
() => ({
|
|
159
161
|
...baseDimensions,
|
|
160
162
|
width: isInlineModal && docked ? undefined : baseDimensions.width,
|
|
161
|
-
aspectRatio: !isInlineModal ? getScreenAspectRatio() : 16 / 9,
|
|
163
|
+
aspectRatio: !isInlineModal && !pip ? getScreenAspectRatio() : 16 / 9,
|
|
162
164
|
}),
|
|
163
165
|
[baseDimensions, isInlineModal]
|
|
164
166
|
);
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
import type {
|
|
4
|
-
ZappComponent,
|
|
5
|
-
ZappRivers,
|
|
6
|
-
} from "@applicaster/zapp-react-native-flow-types";
|
|
7
3
|
import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
|
|
8
4
|
import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
9
5
|
import { usePathname } from "@applicaster/zapp-react-native-utils/reactHooks/navigation";
|
package/Decorators/index.tsx
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "12.0.0-alpha.
|
|
3
|
+
"version": "12.0.0-alpha.5432134741",
|
|
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",
|
|
@@ -29,16 +29,15 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@applicaster/zapp-react-native-flow-types": "1.5.0",
|
|
33
32
|
"@types/react": "17.0.2",
|
|
34
33
|
"@types/react-native": "0.69.6",
|
|
35
34
|
"redux-mock-store": "^1.5.3"
|
|
36
35
|
},
|
|
37
36
|
"dependencies": {
|
|
38
|
-
"@applicaster/applicaster-types": "12.0.0-alpha.
|
|
39
|
-
"@applicaster/zapp-react-native-bridge": "12.0.0-alpha.
|
|
40
|
-
"@applicaster/zapp-react-native-redux": "12.0.0-alpha.
|
|
41
|
-
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.
|
|
37
|
+
"@applicaster/applicaster-types": "12.0.0-alpha.5432134741",
|
|
38
|
+
"@applicaster/zapp-react-native-bridge": "12.0.0-alpha.5432134741",
|
|
39
|
+
"@applicaster/zapp-react-native-redux": "12.0.0-alpha.5432134741",
|
|
40
|
+
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.5432134741",
|
|
42
41
|
"promise": "^8.3.0",
|
|
43
42
|
"react-router-native": "^5.1.2",
|
|
44
43
|
"url": "^0.11.0",
|