@applicaster/zapp-react-native-utils 12.0.0-alpha.3510522252 → 12.0.0-alpha.3977160850
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/actionsExecutor/ActionExecutorContext.tsx +16 -8
- package/analyticsUtils/__tests__/analyticsManager.test.js +75 -73
- package/analyticsUtils/helpers/hooks.ts +1 -1
- package/appUtils/keyCodes/__tests__/__snapshots__/keyCodes.test.js.snap +1 -1
- package/appUtils/keyCodes/__tests__/keyCodes.test.js +80 -85
- package/appUtils/keyCodes/keys.web.js +1 -0
- package/appUtils/playerManager/OverlayObserver/OverlaysObserver.ts +53 -0
- package/appUtils/playerManager/player.ts +13 -7
- package/appUtils/playerManager/playerNative.ts +26 -3
- package/appUtils/playerManager/usePlayerState.tsx +13 -1
- package/appUtils/playerManager/usePlayerTitleSummaryOverlay.tsx +50 -0
- package/cellUtils/__tests__/cellUtils.test.ts +59 -0
- package/cellUtils/__tests__/fixtures.ts +13 -0
- package/cellUtils/index.ts +29 -0
- package/focusManager/index.ts +1 -1
- package/functionUtils/__tests__/__snapshots__/functionUtils.test.js.snap +2 -2
- package/functionUtils/__tests__/functionUtils.test.js +244 -248
- package/localizationUtils/__tests__/localizationUtils.test.ts +17 -13
- package/localizationUtils/index.ts +6 -3
- package/logger/index.ts +1 -1
- package/manifestUtils/defaultManifestConfigurations/player.js +8 -0
- package/modalState/index.ts +57 -0
- package/navigationUtils/index.ts +52 -7
- package/package.json +3 -2
- package/playerUtils/configurationGenerator.ts +8 -0
- package/pluginUtils/index.ts +2 -2
- package/reactHooks/flatList/useLoadNextPageIfNeeded.ts +16 -9
- package/reactHooks/index.ts +2 -0
- package/reactHooks/layout/__tests__/index.test.js +22 -30
- package/reactHooks/layout/useDimensions/helpers/__tests__/getInitialDimensions.native.test.js +11 -16
- package/reactHooks/layout/useDimensions/helpers/__tests__/getInitialDimensions.test.js +12 -14
- package/reactHooks/navigation/__tests__/index.test.tsx +216 -75
- package/reactHooks/navigation/index.ts +201 -85
- package/reactHooks/screen/index.ts +2 -0
- package/reactHooks/screen/useTargetScreenData.ts +0 -7
- package/reactHooks/state/useRivers.ts +3 -1
- package/reactHooks/videoModal/hooks/useVideoModalScreenData.tsx +10 -9
- package/reactHooks/videoModal/index.ts +3 -0
- package/riverComponetsMeasurementProvider/index.tsx +2 -2
- package/screenState/index.ts +8 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
|
|
3
3
|
import * as R from "ramda";
|
|
4
|
-
import { appStore } from "@applicaster/zapp-react-native-redux/AppStore";
|
|
5
4
|
|
|
6
5
|
export function getTargetScreenData(
|
|
7
6
|
entry: ZappEntry,
|
|
@@ -36,12 +35,6 @@ export function getTargetScreenData(
|
|
|
36
35
|
return rivers?.[screenId];
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
export function getTargetScreenDataFromEntry(entry: ZappEntry): ZappRiver {
|
|
40
|
-
const { rivers, contentTypes } = appStore.get(["rivers", "contentTypes"]);
|
|
41
|
-
|
|
42
|
-
return getTargetScreenData(entry, rivers, contentTypes);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
38
|
export const useTargetScreenData = (entry: ZappEntry) => {
|
|
46
39
|
const { rivers, contentTypes } = usePickFromState(["rivers", "contentTypes"]);
|
|
47
40
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
|
|
2
2
|
|
|
3
|
+
const riversSelector = ["rivers"];
|
|
4
|
+
|
|
3
5
|
export const useRivers = () => {
|
|
4
|
-
const { rivers } = usePickFromState(
|
|
6
|
+
const { rivers } = usePickFromState(riversSelector as any);
|
|
5
7
|
|
|
6
8
|
return rivers;
|
|
7
9
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
usePickFromState,
|
|
4
|
-
} from "@applicaster/zapp-react-native-redux/hooks";
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useContentTypes } from "@applicaster/zapp-react-native-redux/hooks";
|
|
5
3
|
import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
4
|
+
import { useRivers } from "../../state";
|
|
6
5
|
|
|
7
6
|
export const useVideoModalScreenData = ():
|
|
8
7
|
| (ZappEntry & { targetScreen: any }) // TODO: fix ZappEntry type ( was ZappRiver but conflict )
|
|
@@ -12,11 +11,13 @@ export const useVideoModalScreenData = ():
|
|
|
12
11
|
} = useNavigation();
|
|
13
12
|
|
|
14
13
|
const contentTypes = useContentTypes();
|
|
15
|
-
const
|
|
14
|
+
const rivers = useRivers();
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
return React.useMemo(() => {
|
|
17
|
+
if (item?.type?.value) {
|
|
18
|
+
const screenId = contentTypes[item?.type?.value].screen_id;
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
return { ...item, targetScreen: rivers?.[screenId] };
|
|
21
|
+
}
|
|
22
|
+
}, [item]);
|
|
22
23
|
};
|
|
@@ -2,6 +2,9 @@ import * as R from "ramda";
|
|
|
2
2
|
import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
3
3
|
import { useMemoizedIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks/device";
|
|
4
4
|
|
|
5
|
+
import { LogBox } from "react-native";
|
|
6
|
+
LogBox.ignoreAllLogs();
|
|
7
|
+
|
|
5
8
|
import { useMobileOrientationEffect } from "./useMobileOrientationEffect";
|
|
6
9
|
import { noop } from "./utils";
|
|
7
10
|
|
|
@@ -3,7 +3,7 @@ import { NativeModules, StyleSheet, View } from "react-native";
|
|
|
3
3
|
import { getXray } from "@applicaster/zapp-react-native-utils/logger";
|
|
4
4
|
|
|
5
5
|
import { isApplePlatform, isWeb } from "../reactUtils";
|
|
6
|
-
import {
|
|
6
|
+
import { useRivers } from "../reactHooks/state";
|
|
7
7
|
|
|
8
8
|
const layoutReducer = (state, { payload }) => {
|
|
9
9
|
return state.map((item, index, _state) => ({
|
|
@@ -58,7 +58,7 @@ export const ScreenLoadingMeasurements = ({
|
|
|
58
58
|
numberOfComponents,
|
|
59
59
|
riverId,
|
|
60
60
|
}: Props) => {
|
|
61
|
-
const
|
|
61
|
+
const rivers = useRivers();
|
|
62
62
|
const screenData = rivers?.[riverId];
|
|
63
63
|
|
|
64
64
|
const [itemsLayout, dispatchItemLayout] = React.useReducer(
|
package/screenState/index.ts
CHANGED
|
@@ -49,3 +49,11 @@ export function useScreenState(
|
|
|
49
49
|
setSelectedEntry: (entryId) => setSelectedEntry(screenId, entryId),
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
+
|
|
53
|
+
export const useScreenScrollStore = create<{
|
|
54
|
+
scrollPosition: number;
|
|
55
|
+
scrollingVelocity: number;
|
|
56
|
+
}>(() => ({
|
|
57
|
+
scrollPosition: 0,
|
|
58
|
+
scrollingVelocity: 0,
|
|
59
|
+
}));
|