@applicaster/zapp-react-native-utils 14.0.0-alpha.7104619551 → 14.0.0-alpha.7434241446
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 +1 -1
- package/analyticsUtils/AnalyticsEvents/helper.ts +81 -0
- package/analyticsUtils/AnalyticsEvents/sendHeaderClickEvent.ts +1 -1
- package/analyticsUtils/AnalyticsEvents/sendMenuClickEvent.ts +2 -1
- package/analyticsUtils/AnalyticsEvents/sendOnClickEvent.ts +14 -4
- package/analyticsUtils/__tests__/analyticsUtils.test.js +14 -0
- package/analyticsUtils/events.ts +8 -0
- package/analyticsUtils/index.tsx +3 -4
- package/analyticsUtils/manager.ts +1 -1
- package/appUtils/HooksManager/Hook.ts +4 -4
- package/appUtils/HooksManager/index.ts +11 -1
- package/appUtils/accessibilityManager/index.ts +5 -5
- package/appUtils/focusManager/treeDataStructure/Tree/index.js +1 -1
- package/appUtils/playerManager/OverlayObserver/OverlaysObserver.ts +0 -15
- package/appUtils/playerManager/useChapterMarker.tsx +0 -1
- package/appUtils/playerManager/usePlayerControllerSetup.tsx +16 -0
- package/arrayUtils/__tests__/isEmptyArray.test.ts +63 -0
- package/arrayUtils/__tests__/isFilledArray.test.ts +1 -1
- package/arrayUtils/index.ts +8 -3
- package/audioPlayerUtils/__tests__/getArtworkImage.test.ts +144 -0
- package/audioPlayerUtils/__tests__/getBackgroundImage.test.ts +72 -0
- package/audioPlayerUtils/__tests__/getImageFromEntry.test.ts +110 -0
- package/audioPlayerUtils/assets/index.ts +2 -0
- package/audioPlayerUtils/index.ts +242 -0
- package/componentsUtils/__tests__/isTabsScreen.test.ts +38 -0
- package/componentsUtils/index.ts +4 -1
- package/conf/player/__tests__/selectors.test.ts +34 -0
- package/conf/player/selectors.ts +10 -0
- package/configurationUtils/__tests__/configurationUtils.test.js +0 -31
- package/configurationUtils/__tests__/getMediaItems.test.ts +65 -0
- package/configurationUtils/__tests__/imageSrcFromMediaItem.test.ts +34 -0
- package/configurationUtils/__tests__/manifestKeyParser.test.ts +547 -0
- package/configurationUtils/index.ts +63 -34
- package/configurationUtils/manifestKeyParser.ts +57 -32
- package/focusManager/FocusManager.ts +26 -16
- package/focusManager/Tree.ts +25 -21
- package/focusManager/__tests__/FocusManager.test.ts +50 -8
- package/index.d.ts +0 -9
- package/manifestUtils/_internals/getDefaultConfiguration.js +28 -0
- package/manifestUtils/{_internals.js → _internals/index.js} +2 -25
- package/manifestUtils/createConfig.js +4 -1
- package/manifestUtils/defaultManifestConfigurations/player.js +1239 -200
- package/manifestUtils/progressBar/__tests__/mobileProgressBar.test.js +0 -30
- package/navigationUtils/__tests__/mapContentTypesToRivers.test.ts +130 -0
- package/navigationUtils/index.ts +6 -4
- package/package.json +2 -3
- package/playerUtils/__tests__/configurationUtils.test.ts +1 -65
- package/playerUtils/__tests__/getPlayerActionButtons.test.ts +54 -0
- package/playerUtils/_internals/__tests__/utils.test.ts +71 -0
- package/playerUtils/_internals/index.ts +1 -0
- package/playerUtils/_internals/utils.ts +31 -0
- package/playerUtils/configurationUtils.ts +0 -44
- package/playerUtils/getPlayerActionButtons.ts +17 -0
- package/playerUtils/index.ts +2 -0
- package/playerUtils/useValidatePlayerConfig.tsx +22 -19
- package/reactHooks/autoscrolling/__tests__/useTrackedView.test.tsx +15 -14
- package/reactHooks/feed/__tests__/useBatchLoading.test.tsx +39 -88
- package/reactHooks/feed/useBatchLoading.ts +11 -9
- package/reactHooks/feed/useFeedLoader.tsx +12 -8
- package/reactHooks/feed/usePipesCacheReset.ts +3 -3
- package/reactHooks/flatList/useSequentialRenderItem.tsx +3 -3
- package/reactHooks/layout/__tests__/index.test.tsx +3 -1
- package/reactHooks/layout/isTablet/index.ts +12 -5
- package/reactHooks/layout/useDimensions/__tests__/useDimensions.test.ts +34 -36
- package/reactHooks/layout/useDimensions/useDimensions.ts +2 -3
- package/reactHooks/layout/useLayoutVersion.ts +5 -5
- package/reactHooks/navigation/index.ts +7 -5
- package/reactHooks/navigation/useIsScreenActive.ts +9 -5
- package/reactHooks/resolvers/__tests__/useCellResolver.test.tsx +4 -0
- package/reactHooks/screen/useScreenContext.ts +1 -1
- package/reactHooks/state/__tests__/ZStoreProvider.test.tsx +2 -1
- package/reactHooks/state/useRivers.ts +7 -8
- package/riverComponetsMeasurementProvider/index.tsx +1 -1
- package/services/js2native.ts +1 -0
- package/testUtils/index.tsx +7 -8
- package/time/BackgroundTimer.ts +6 -4
- package/utils/index.ts +17 -1
- package/playerUtils/configurationGenerator.ts +0 -2572
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ROUTE_TYPES } from "@applicaster/zapp-react-native-utils/navigationUtils/routeTypes";
|
|
1
2
|
import { useNavigation } from "./useNavigation";
|
|
2
3
|
import { usePathname } from "./usePathname";
|
|
3
4
|
|
|
@@ -6,11 +7,14 @@ export const useIsScreenActive = () => {
|
|
|
6
7
|
const pathname = usePathname();
|
|
7
8
|
const { currentRoute, videoModalState } = useNavigation();
|
|
8
9
|
|
|
9
|
-
if (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
if (videoModalState.visible) {
|
|
11
|
+
if (pathname.includes(ROUTE_TYPES.VIDEO_MODAL)) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (["FULLSCREEN", "MAXIMIZED", "PIP"].includes(videoModalState.mode)) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
return pathname === currentRoute;
|
|
@@ -14,6 +14,10 @@ jest.mock("@applicaster/zapp-react-native-utils/localizationUtils", () => ({
|
|
|
14
14
|
|
|
15
15
|
jest.mock("@applicaster/zapp-react-native-utils/reactHooks/navigation");
|
|
16
16
|
|
|
17
|
+
jest.mock(
|
|
18
|
+
"@applicaster/zapp-react-native-utils/reactHooks/navigation/useNavigation"
|
|
19
|
+
);
|
|
20
|
+
|
|
17
21
|
const { useCellResolver } = require("../useCellResolver");
|
|
18
22
|
|
|
19
23
|
describe("cellResolver", () => {
|
|
@@ -2,7 +2,7 @@ import { useContext, useMemo } from "react";
|
|
|
2
2
|
|
|
3
3
|
import { useModalNavigationContext } from "@applicaster/zapp-react-native-ui-components/Contexts/ModalNavigationContext";
|
|
4
4
|
import { useNestedNavigationContext } from "@applicaster/zapp-react-native-ui-components/Contexts/NestedNavigationContext";
|
|
5
|
-
import { useNavigation } from "../navigation
|
|
5
|
+
import { useNavigation } from "../navigation";
|
|
6
6
|
|
|
7
7
|
import { ScreenContext } from "@applicaster/zapp-react-native-ui-components/Contexts/ScreenContext";
|
|
8
8
|
import { ScreenDataContext } from "@applicaster/zapp-react-native-ui-components/Contexts/ScreenDataContext";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { render, screen } from "@testing-library/react-native";
|
|
3
4
|
import { Text } from "react-native";
|
|
4
|
-
import {
|
|
5
|
+
import { useZStore, ZStoreProvider } from "../ZStoreProvider";
|
|
5
6
|
import { useStore } from "zustand";
|
|
6
7
|
|
|
7
8
|
interface TestState {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
useAppSelector,
|
|
3
|
+
selectRivers,
|
|
4
|
+
} from "@applicaster/zapp-react-native-redux";
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const { rivers } = usePickFromState(riversSelector as any);
|
|
7
|
-
|
|
8
|
-
return rivers;
|
|
9
|
-
};
|
|
6
|
+
export function useRivers(): Record<string, ZappRiver> {
|
|
7
|
+
return useAppSelector(selectRivers);
|
|
8
|
+
}
|
|
@@ -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 { useRivers } from "../reactHooks
|
|
6
|
+
import { useRivers } from "../reactHooks";
|
|
7
7
|
|
|
8
8
|
const layoutReducer = (state, { payload }) => {
|
|
9
9
|
return state.map((item, index, _state) => ({
|
package/services/js2native.ts
CHANGED
|
@@ -496,6 +496,7 @@ async function removeStorageListenerHandler(payload: { listenerId?: string }) {
|
|
|
496
496
|
function log({ level, messages }) {
|
|
497
497
|
try {
|
|
498
498
|
const parsedMessages = parseJsonIfNeeded(messages);
|
|
499
|
+
// eslint-disable-next-line no-console
|
|
499
500
|
const logFn = console[level] || console.log;
|
|
500
501
|
|
|
501
502
|
if (Array.isArray(parsedMessages)) {
|
package/testUtils/index.tsx
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
2
|
+
import { render } from "@testing-library/react-native";
|
|
3
3
|
import React, { PropsWithChildren } from "react";
|
|
4
|
-
import
|
|
5
|
-
|
|
4
|
+
import configureStore from "redux-mock-store";
|
|
6
5
|
import { Provider } from "react-redux";
|
|
6
|
+
import { View } from "react-native";
|
|
7
7
|
import thunk from "redux-thunk";
|
|
8
|
-
import
|
|
9
|
-
|
|
8
|
+
import * as R from "ramda";
|
|
9
|
+
|
|
10
10
|
import { appStore } from "@applicaster/zapp-react-native-redux/AppStore";
|
|
11
11
|
|
|
12
|
-
import { render } from "@testing-library/react-native";
|
|
13
|
-
import { AnalyticsProvider } from "../analyticsUtils";
|
|
14
12
|
import { ThemeContext } from "../theme";
|
|
13
|
+
import { AnalyticsProvider } from "../analyticsUtils";
|
|
15
14
|
|
|
16
15
|
export { getByTestId } from "./getByTestId";
|
|
17
16
|
|
package/time/BackgroundTimer.ts
CHANGED
|
@@ -11,15 +11,17 @@ class BackgroundTimer {
|
|
|
11
11
|
this.uniqueId = 0;
|
|
12
12
|
this.callbacks = {};
|
|
13
13
|
|
|
14
|
-
const EventEmitter = platformSelect({
|
|
14
|
+
const EventEmitter: typeof DeviceEventEmitter | undefined = platformSelect({
|
|
15
15
|
android: DeviceEventEmitter,
|
|
16
|
-
|
|
16
|
+
android_tv: DeviceEventEmitter,
|
|
17
|
+
amazon: DeviceEventEmitter, // probably does not exist and uses android_tv
|
|
17
18
|
default: undefined,
|
|
18
19
|
});
|
|
19
20
|
|
|
20
21
|
EventEmitter?.addListener("BackgroundTimer.timer.fired", (id: number) => {
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
const callback = this.callbacks[id];
|
|
23
|
+
|
|
24
|
+
if (callback) {
|
|
23
25
|
delete this.callbacks[id];
|
|
24
26
|
callback();
|
|
25
27
|
}
|
package/utils/index.ts
CHANGED
|
@@ -2,4 +2,20 @@ export { chunk } from "./chunk";
|
|
|
2
2
|
|
|
3
3
|
export { times } from "./times";
|
|
4
4
|
|
|
5
|
-
export {
|
|
5
|
+
export {
|
|
6
|
+
cloneDeep as clone,
|
|
7
|
+
flatten,
|
|
8
|
+
drop,
|
|
9
|
+
size,
|
|
10
|
+
isNil,
|
|
11
|
+
isEmpty,
|
|
12
|
+
get,
|
|
13
|
+
has,
|
|
14
|
+
flatMap,
|
|
15
|
+
difference,
|
|
16
|
+
take,
|
|
17
|
+
pick,
|
|
18
|
+
map,
|
|
19
|
+
trim,
|
|
20
|
+
toString,
|
|
21
|
+
} from "lodash";
|