@applicaster/zapp-react-native-utils 12.0.0-alpha.4054240460 → 12.0.0-alpha.4102526423

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.
Files changed (38) hide show
  1. package/analyticsUtils/AnalyticPlayerListener.ts +141 -0
  2. package/analyticsUtils/PlayerAnalyticsManager.ts +90 -0
  3. package/analyticsUtils/{analyticsTracker.ts → playerAnalyticsTracker.ts} +19 -10
  4. package/appUtils/accessibilityManager/const.ts +50 -0
  5. package/appUtils/accessibilityManager/hooks.ts +40 -0
  6. package/appUtils/accessibilityManager/index.ts +166 -0
  7. package/appUtils/accessibilityManager/logger.ts +5 -0
  8. package/appUtils/focusManager/treeDataStructure/Utils/index.js +1 -1
  9. package/appUtils/index.js +2 -0
  10. package/appUtils/platform/platformUtils.ts +40 -101
  11. package/appUtils/playerManager/conts.ts +1 -0
  12. package/appUtils/playerManager/index.ts +9 -27
  13. package/appUtils/playerManager/player.ts +9 -0
  14. package/appUtils/playerManager/playerHooks/usePlayerCurrentTime.tsx +57 -0
  15. package/appUtils/playerManager/playerNative.ts +1 -1
  16. package/appUtils/playerManager/usePlayerControllerSetup.tsx +2 -1
  17. package/appUtils/playerManager/usePlayerState.tsx +19 -34
  18. package/cellUtils/index.ts +38 -5
  19. package/functionUtils/index.ts +38 -0
  20. package/index.d.ts +15 -0
  21. package/manifestUtils/defaultManifestConfigurations/player.js +121 -0
  22. package/manifestUtils/keys.js +2 -1
  23. package/navigationUtils/index.ts +48 -0
  24. package/numberUtils/__tests__/toNumber.test.ts +2 -2
  25. package/package.json +2 -2
  26. package/playerUtils/configurationGenerator.ts +120 -0
  27. package/playerUtils/imaScriptDom.ts +59 -0
  28. package/pluginUtils/index.ts +9 -0
  29. package/reactHooks/debugging/__tests__/index.test.js +81 -11
  30. package/reactHooks/layout/useDimensions/useDimensions.ts +2 -0
  31. package/reactHooks/navigation/index.ts +4 -0
  32. package/reactHooks/player/useAutoSeek.tsx +9 -7
  33. package/reactHooks/resolvers/useCellResolver.ts +5 -1
  34. package/reactHooks/useConfiguration.ts +2 -2
  35. package/reactUtils/index.ts +1 -2
  36. package/appUtils/focusManager/FocusableEvents.ts +0 -8
  37. package/appUtils/focusManager/treeDataStructure/Utils/__tests__/Utils_android.test.js +0 -1094
  38. package/appUtils/focusManager/treeDataStructure/Utils/index.android.js +0 -261
@@ -1,5 +1,4 @@
1
1
  import React, { useEffect, useState } from "react";
2
- import * as R from "ramda";
3
2
  import { usePrevious } from "@applicaster/zapp-react-native-utils/reactHooks/utils";
4
3
  import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils/playerManager";
5
4
  import {
@@ -17,10 +16,6 @@ export const useAutoSeek = (resetHUDTimer = noop) => {
17
16
  const intervalTimer = React.useRef(null);
18
17
  const prevRunning = usePrevious(isRunning);
19
18
 
20
- const setIntervalTimer = (cb) => {
21
- intervalTimer.current = setInterval(cb, ON_HOLD_INTERVAL);
22
- };
23
-
24
19
  const clearIntervalTimer = () => {
25
20
  try {
26
21
  clearInterval(intervalTimer.current);
@@ -29,6 +24,11 @@ export const useAutoSeek = (resetHUDTimer = noop) => {
29
24
  }
30
25
  };
31
26
 
27
+ const setIntervalTimer = (cb) => {
28
+ clearIntervalTimer();
29
+ intervalTimer.current = setInterval(cb, ON_HOLD_INTERVAL);
30
+ };
31
+
32
32
  const resetState = () => {
33
33
  setIsRunning(false);
34
34
  setDirection(null);
@@ -42,7 +42,7 @@ export const useAutoSeek = (resetHUDTimer = noop) => {
42
42
  if (!player) return;
43
43
 
44
44
  if (direction) {
45
- player[direction](R.min(MAX_SEEK_TIME, SKIP_TIME_BASE * multiplier));
45
+ player[direction](Math.min(MAX_SEEK_TIME, SKIP_TIME_BASE * multiplier));
46
46
  resetHUDTimer();
47
47
  }
48
48
  }, [multiplier, direction]);
@@ -50,7 +50,9 @@ export const useAutoSeek = (resetHUDTimer = noop) => {
50
50
  useEffect(() => {
51
51
  if (isRunning && isRunning !== prevRunning) {
52
52
  setIntervalTimer(() => {
53
- setMultiplier(R.add(1));
53
+ setMultiplier((prev) => {
54
+ return prev + 1;
55
+ });
54
56
  });
55
57
  } else if (!isRunning && isRunning !== prevRunning) {
56
58
  resetState();
@@ -48,7 +48,11 @@ export function useCellResolver({
48
48
  ...cellResolverOptions
49
49
  }: Props) {
50
50
  let _component = Object.assign({}, component);
51
- const { width, height } = useDimensions("screen");
51
+
52
+ const { width, height } = useDimensions("screen", {
53
+ updateForInactiveScreens: false,
54
+ });
55
+
52
56
  const { plugins, cellStyles } = usePickFromState(["plugins", "cellStyles"]);
53
57
  const isRTL = useIsRTL();
54
58
 
@@ -67,7 +67,7 @@ export const useConfiguration = ({
67
67
  if (component) {
68
68
  const remappedStylesConfiguration = remapUpdatedKeys(
69
69
  pluginManifest,
70
- component.styles
70
+ component
71
71
  );
72
72
 
73
73
  R.forEachObjIndexed((value, key) => {
@@ -83,7 +83,7 @@ export const useConfiguration = ({
83
83
 
84
84
  const styles = populateConfigurationValues(
85
85
  pluginManifest?.styles?.fields,
86
- remappedStylesConfiguration,
86
+ remappedStylesConfiguration.styles,
87
87
  skipDefaults
88
88
  );
89
89
 
@@ -152,8 +152,7 @@ export const hasTizen = typeof window?.tizen !== "undefined";
152
152
  */
153
153
  export const hasWebOS = typeof window?.webOS !== "undefined";
154
154
 
155
- export const getUserAgent = () =>
156
- window?.navigator?.userAgent || global?.navigator?.userAgent;
155
+ export const getUserAgent = () => window?.navigator?.userAgent;
157
156
 
158
157
  export const isLgPlatform = () => {
159
158
  const userAgent = getUserAgent();
@@ -1,8 +0,0 @@
1
- export const FOCUSABLE_EVENTS = {
2
- IS_REGISTERED: "isRegistered",
3
- WILL_RECEIVE_FOCUS: "willReceiveFocus",
4
- HAS_RECEIVED_FOCUS: "hasReceivedFocus",
5
- WILL_LOSE_FOCUS: "willLoseFocus",
6
- HAS_LOST_FOCUS: "hasLostFocus",
7
- WILL_UNREGISTER: "willUnregister",
8
- };