@applicaster/zapp-react-native-ui-components 14.0.0-alpha.1661204539 → 14.0.0-alpha.2332850672
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/AudioPlayer/Artwork.tsx +17 -12
- package/Components/AudioPlayer/AudioPlayer.tsx +48 -11
- package/Components/AudioPlayer/AudioPlayerMobileLayout.tsx +61 -0
- package/Components/AudioPlayer/{AudioPlayerLayout.tsx → AudioPlayerTVLayout.tsx} +31 -72
- package/Components/AudioPlayer/Runtime.tsx +2 -1
- package/Components/AudioPlayer/Summary.tsx +12 -9
- package/Components/AudioPlayer/Title.tsx +12 -9
- package/Components/AudioPlayer/__tests__/__snapshots__/Runtime.test.js.snap +2 -2
- package/Components/AudioPlayer/__tests__/__snapshots__/artWork.test.js.snap +9 -4
- package/Components/AudioPlayer/__tests__/__snapshots__/{audioPlayerLayout.test.js.snap → audioPlayerMobileLayout.test.js.snap} +2 -2
- package/Components/AudioPlayer/__tests__/__snapshots__/summary.test.js.snap +1 -1
- package/Components/AudioPlayer/__tests__/__snapshots__/title.test.js.snap +1 -1
- package/Components/AudioPlayer/__tests__/audioPlayerMobileLayout.test.js +18 -0
- package/Components/AudioPlayer/helpers.tsx +2 -2
- package/Components/GeneralContentScreen/GeneralContentScreen.tsx +0 -2
- package/Components/MasterCell/DefaultComponents/Text/index.tsx +1 -0
- package/Components/MasterCell/utils/behaviorProvider.ts +12 -67
- package/Components/MasterCell/utils/index.ts +3 -13
- package/Components/PlayerContainer/PlayerContainer.tsx +24 -38
- package/Components/River/ComponentsMap/ComponentsMap.tsx +1 -5
- package/Components/River/RiverItem.tsx +8 -8
- package/Components/River/TV/River.tsx +0 -3
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +0 -6
- package/Components/TopMarginApplicator/TopMarginApplicator.tsx +16 -15
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +60 -0
- package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +17 -55
- package/Components/VideoModal/hooks/useDelayedPlayerDetails.ts +15 -26
- package/Decorators/RiverFeedLoader/index.tsx +2 -8
- package/Decorators/RiverFeedLoader/utils/index.ts +2 -7
- package/Decorators/ZappPipesDataConnector/index.tsx +2 -16
- package/index.d.ts +0 -1
- package/package.json +5 -5
- package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +0 -26
|
@@ -1,13 +1,23 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
3
|
-
import { withTimeout$ } from "@applicaster/zapp-react-native-utils/idleUtils";
|
|
4
2
|
|
|
5
3
|
import { showDetails } from "./utils";
|
|
6
4
|
|
|
7
|
-
const TIMEOUT = 100; // ms
|
|
8
|
-
|
|
9
5
|
type Props = { isInline: boolean; isDocked: boolean; isPip: boolean };
|
|
10
6
|
|
|
7
|
+
const showPlayerDetails = (
|
|
8
|
+
isInline: boolean,
|
|
9
|
+
isDocked: boolean,
|
|
10
|
+
isPip: boolean,
|
|
11
|
+
isTablet: boolean
|
|
12
|
+
) => {
|
|
13
|
+
return showDetails({
|
|
14
|
+
isMobile: !isTablet,
|
|
15
|
+
isInline,
|
|
16
|
+
isDocked,
|
|
17
|
+
isPip,
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
11
21
|
/**
|
|
12
22
|
* Custom hook to determine whether to show player details with a delay.
|
|
13
23
|
*
|
|
@@ -22,28 +32,7 @@ export const useDelayedPlayerDetails = ({
|
|
|
22
32
|
isDocked,
|
|
23
33
|
isPip,
|
|
24
34
|
}: Props): boolean => {
|
|
25
|
-
const [shouldShowDetails, setShouldShowDetails] = React.useState(false);
|
|
26
|
-
|
|
27
35
|
const isTablet = useIsTablet();
|
|
28
36
|
|
|
29
|
-
|
|
30
|
-
const subscription = withTimeout$(TIMEOUT).subscribe({
|
|
31
|
-
next: () => {
|
|
32
|
-
setShouldShowDetails(() => {
|
|
33
|
-
return showDetails({
|
|
34
|
-
isMobile: !isTablet,
|
|
35
|
-
isInline,
|
|
36
|
-
isDocked,
|
|
37
|
-
isPip,
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
return () => {
|
|
44
|
-
subscription.unsubscribe();
|
|
45
|
-
};
|
|
46
|
-
}, [isDocked, isTablet, isInline, isPip]);
|
|
47
|
-
|
|
48
|
-
return shouldShowDetails;
|
|
37
|
+
return showPlayerDetails(isInline, isDocked, isPip, isTablet);
|
|
49
38
|
};
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
loadDatasources,
|
|
14
14
|
usePipesContexts,
|
|
15
15
|
} from "./utils";
|
|
16
|
-
import { useScreenResolvers } from "@applicaster/zapp-react-native-utils/actionsExecutor/screenResolver";
|
|
17
16
|
|
|
18
17
|
type RiverProps = {
|
|
19
18
|
dispatch: DispatchProp;
|
|
@@ -26,7 +25,7 @@ export function WithRiverFeedLoader(Component: ZappComponent) {
|
|
|
26
25
|
return function WrappedWithRiverFeedLoader(props: RiverProps) {
|
|
27
26
|
const { river } = props;
|
|
28
27
|
const { screenData, pathname } = useRoute();
|
|
29
|
-
|
|
28
|
+
|
|
30
29
|
const pipesContexts = usePipesContexts(river.id, pathname);
|
|
31
30
|
|
|
32
31
|
const componentsToLoad = ignoreComponentsWithClearCacheFlag(
|
|
@@ -50,12 +49,7 @@ export function WithRiverFeedLoader(Component: ZappComponent) {
|
|
|
50
49
|
item?.filter((item2) => item2 !== undefined)
|
|
51
50
|
);
|
|
52
51
|
|
|
53
|
-
loadDatasources(
|
|
54
|
-
nonEmptyDataSources,
|
|
55
|
-
river?.id,
|
|
56
|
-
props.dispatch,
|
|
57
|
-
resolvers
|
|
58
|
-
);
|
|
52
|
+
loadDatasources(nonEmptyDataSources, river?.id, props.dispatch);
|
|
59
53
|
}, []);
|
|
60
54
|
|
|
61
55
|
return <Component {...props} />;
|
|
@@ -12,16 +12,11 @@ export { getDatasourceUrl } from "./getDatasourceUrl";
|
|
|
12
12
|
|
|
13
13
|
export const DATASOURCE_CHUNKS = 10;
|
|
14
14
|
|
|
15
|
-
export async function loadDatasources(
|
|
16
|
-
urls: string[][],
|
|
17
|
-
riverId,
|
|
18
|
-
dispatch,
|
|
19
|
-
resolvers
|
|
20
|
-
) {
|
|
15
|
+
export async function loadDatasources(urls: string[][], riverId, dispatch) {
|
|
21
16
|
return reducePromises<string, void>(
|
|
22
17
|
mapPromises<string, void>((url) => {
|
|
23
18
|
if (url) {
|
|
24
|
-
return dispatch(loadPipesData(url, { riverId
|
|
19
|
+
return dispatch(loadPipesData(url, { riverId }));
|
|
25
20
|
}
|
|
26
21
|
}),
|
|
27
22
|
undefined,
|
|
@@ -19,10 +19,7 @@ import { ZappPipesSearchContext } from "@applicaster/zapp-react-native-ui-compon
|
|
|
19
19
|
import { useScreenContext } from "@applicaster/zapp-react-native-utils/reactHooks/screen/useScreenContext";
|
|
20
20
|
|
|
21
21
|
import { isVerticalListOrGrid } from "./utils";
|
|
22
|
-
import {
|
|
23
|
-
subscribeForUrlContextKeyChanges,
|
|
24
|
-
subscribeForUrlScreenKeyChanges,
|
|
25
|
-
} from "@applicaster/zapp-pipes-v2-client";
|
|
22
|
+
import { subscribeForUrlContextKeyChanges } from "@applicaster/zapp-pipes-v2-client";
|
|
26
23
|
|
|
27
24
|
type Props = {
|
|
28
25
|
component: ZappUIComponent;
|
|
@@ -207,7 +204,7 @@ export function zappPipesDataConnector(
|
|
|
207
204
|
Component: React.FC<any> | React.ComponentClass<any>
|
|
208
205
|
) {
|
|
209
206
|
return function WrappedWithZappPipesData(props: Props) {
|
|
210
|
-
const { screenData
|
|
207
|
+
const { screenData } = useRoute();
|
|
211
208
|
const { plugins } = usePickFromState(["plugins"]);
|
|
212
209
|
|
|
213
210
|
const screenContextData = useScreenContext();
|
|
@@ -289,17 +286,6 @@ export function zappPipesDataConnector(
|
|
|
289
286
|
componentIndex
|
|
290
287
|
);
|
|
291
288
|
|
|
292
|
-
useEffect(() => {
|
|
293
|
-
if (!(dataSourceUrl?.includes("pipesv2://") && reloadData)) {
|
|
294
|
-
return subscribeForUrlScreenKeyChanges(
|
|
295
|
-
dataSourceUrl,
|
|
296
|
-
pathname,
|
|
297
|
-
{},
|
|
298
|
-
reloadData
|
|
299
|
-
);
|
|
300
|
-
}
|
|
301
|
-
}, [dataSourceUrl, reloadData]);
|
|
302
|
-
|
|
303
289
|
useEffect(() => {
|
|
304
290
|
if (dataSourceUrl?.includes("pipesv2://") && reloadData) {
|
|
305
291
|
const addListener = getListenerFromPlugin(dataSourceUrl, plugins);
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "14.0.0-alpha.
|
|
3
|
+
"version": "14.0.0-alpha.2332850672",
|
|
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",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"redux-mock-store": "^1.5.3"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@applicaster/applicaster-types": "14.0.0-alpha.
|
|
35
|
-
"@applicaster/zapp-react-native-bridge": "14.0.0-alpha.
|
|
36
|
-
"@applicaster/zapp-react-native-redux": "14.0.0-alpha.
|
|
37
|
-
"@applicaster/zapp-react-native-utils": "14.0.0-alpha.
|
|
34
|
+
"@applicaster/applicaster-types": "14.0.0-alpha.2332850672",
|
|
35
|
+
"@applicaster/zapp-react-native-bridge": "14.0.0-alpha.2332850672",
|
|
36
|
+
"@applicaster/zapp-react-native-redux": "14.0.0-alpha.2332850672",
|
|
37
|
+
"@applicaster/zapp-react-native-utils": "14.0.0-alpha.2332850672",
|
|
38
38
|
"promise": "^8.3.0",
|
|
39
39
|
"url": "^0.11.0",
|
|
40
40
|
"uuid": "^3.3.2"
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render } from "@testing-library/react-native";
|
|
3
|
-
|
|
4
|
-
import { AudioPlayerLayout } from "../AudioPlayerLayout";
|
|
5
|
-
|
|
6
|
-
const audioPlayerLayoutProps = {
|
|
7
|
-
artwork: "string",
|
|
8
|
-
config: {
|
|
9
|
-
titleColor: "white",
|
|
10
|
-
summaryColor: "white",
|
|
11
|
-
backgroundColor: "black",
|
|
12
|
-
backgroundImage: "https://example.com",
|
|
13
|
-
isRTL: true,
|
|
14
|
-
},
|
|
15
|
-
children: [],
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
describe("<AudioPlayerLayout />", () => {
|
|
19
|
-
it("renders correctly", () => {
|
|
20
|
-
const { toJSON } = render(
|
|
21
|
-
<AudioPlayerLayout {...audioPlayerLayoutProps} />
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
expect(toJSON()).toMatchSnapshot();
|
|
25
|
-
});
|
|
26
|
-
});
|