@applicaster/zapp-react-native-utils 12.0.0-rc.3 → 12.0.0-rc.30
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/orientationHelper.ts +1 -1
- package/appUtils/playerManager/OverlayObserver/OverlaysObserver.ts +53 -0
- package/appUtils/playerManager/player.ts +12 -4
- package/appUtils/playerManager/playerFactory.ts +13 -1
- package/appUtils/playerManager/playerNative.ts +26 -0
- 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 +42 -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 +11 -7
- package/reactHooks/cell-click/__tests__/index.test.js +6 -2
- package/reactHooks/cell-click/index.ts +2 -2
- package/reactHooks/device/index.ts +0 -1
- package/reactHooks/device/useIsTablet.tsx +28 -3
- package/reactHooks/device/useMemoizedIsTablet.ts +1 -1
- package/reactHooks/device/useOrientation.tsx +3 -1
- 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/index.ts +2 -1
- 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/state/useRivers.ts +3 -1
- package/reactHooks/videoModal/hooks/useVideoModalScreenData.tsx +10 -9
- package/riverComponetsMeasurementProvider/index.tsx +2 -2
- package/screenState/index.ts +8 -0
- package/zappFrameworkUtils/loginPluginUtils.ts +12 -2
- package/reactHooks/device/useIsTablet.android.tsx +0 -14
- package/reactHooks/device/useIsTablet.ios.tsx +0 -7
- package/reactHooks/device/useIsTablet.web.tsx +0 -3
|
@@ -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
|
};
|
|
@@ -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
|
+
}));
|
|
@@ -2,7 +2,7 @@ import * as R from "ramda";
|
|
|
2
2
|
import { createLogger } from "../logger";
|
|
3
3
|
import { requiresAuthentication } from "../configurationUtils";
|
|
4
4
|
import { PresentHookPluginOneTime } from "./presentPluginOneTime";
|
|
5
|
-
import { skipHook } from "./hooksPresentation";
|
|
5
|
+
import { isPlayerHook, skipHook } from "./hooksPresentation";
|
|
6
6
|
type LoginPluginUtils = {
|
|
7
7
|
pluginId: string;
|
|
8
8
|
};
|
|
@@ -36,10 +36,20 @@ const isAuthenticationRequired = ({ payload, logs }) => {
|
|
|
36
36
|
return requires_authentication;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
const isPlayer = isPlayerHook(payload);
|
|
40
|
+
|
|
41
|
+
if (isPlayer) {
|
|
42
|
+
log_info(
|
|
43
|
+
"isAuthenticationRequired: Payload is player screen, authentication not required"
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
39
49
|
const _isPayloadScreen = isPayloadScreen({ payload });
|
|
40
50
|
|
|
41
51
|
log_info(
|
|
42
|
-
`isAuthenticationRequired: Payload is screen,
|
|
52
|
+
`isAuthenticationRequired: Payload is screen, authentication required: ${_isPayloadScreen}`
|
|
43
53
|
);
|
|
44
54
|
|
|
45
55
|
return _isPayloadScreen;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { useWindowDimensions } from "react-native";
|
|
2
|
-
import { useOrientation } from "./useOrientation";
|
|
3
|
-
import { isTablet } from "../layout";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Determines weather the given device is a tablet based on dimensions, orientation, and platform
|
|
7
|
-
* @returns {Boolean} isTablet - returns whether the given device is a tablet
|
|
8
|
-
*/
|
|
9
|
-
export const useIsTablet = (): boolean => {
|
|
10
|
-
const dimensions = useWindowDimensions();
|
|
11
|
-
const orientation = useOrientation();
|
|
12
|
-
|
|
13
|
-
return isTablet(dimensions, orientation);
|
|
14
|
-
};
|