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

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 (49) 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 +155 -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/arrayUtils/index.ts +11 -0
  19. package/cellUtils/index.ts +38 -5
  20. package/focusManager/FocusManager.ts +20 -5
  21. package/focusManager/__tests__/FocusManager.test.ts +0 -1
  22. package/functionUtils/index.ts +38 -0
  23. package/index.d.ts +15 -0
  24. package/manifestUtils/defaultManifestConfigurations/player.js +121 -0
  25. package/manifestUtils/keys.js +2 -1
  26. package/navigationUtils/index.ts +49 -1
  27. package/numberUtils/__tests__/toNumber.test.ts +2 -2
  28. package/numberUtils/__tests__/toPositiveNumberWithDefault.test.ts +66 -0
  29. package/numberUtils/__tests__/toPositiveNumberWithDefaultZero.test.ts +66 -0
  30. package/numberUtils/index.ts +20 -0
  31. package/package.json +2 -2
  32. package/playerUtils/configurationGenerator.ts +120 -0
  33. package/playerUtils/imaScriptDom.ts +59 -0
  34. package/pluginUtils/index.ts +9 -0
  35. package/reactHooks/cell-click/index.ts +17 -3
  36. package/reactHooks/debugging/__tests__/index.test.js +81 -11
  37. package/reactHooks/feed/__tests__/useBatchLoading.test.tsx +69 -6
  38. package/reactHooks/feed/useBatchLoading.ts +52 -28
  39. package/reactHooks/layout/useDimensions/__tests__/useDimensions.test.ts +134 -0
  40. package/reactHooks/layout/useDimensions/useDimensions.ts +2 -0
  41. package/reactHooks/navigation/index.ts +5 -1
  42. package/reactHooks/player/useAutoSeek.tsx +9 -7
  43. package/reactHooks/resolvers/useCellResolver.ts +5 -1
  44. package/reactHooks/useConfiguration.ts +2 -2
  45. package/reactUtils/index.ts +1 -2
  46. package/testUtils/index.tsx +42 -9
  47. package/appUtils/focusManager/FocusableEvents.ts +0 -8
  48. package/appUtils/focusManager/treeDataStructure/Utils/__tests__/Utils_android.test.js +0 -1094
  49. package/appUtils/focusManager/treeDataStructure/Utils/index.android.js +0 -261
@@ -7,9 +7,11 @@ import { Provider } from "react-redux";
7
7
  import thunk from "redux-thunk";
8
8
  import configureStore from "redux-mock-store";
9
9
  import { SafeAreaProvider } from "react-native-safe-area-context";
10
+ import { appStore } from "@applicaster/zapp-react-native-redux/AppStore";
10
11
 
11
12
  import { render } from "@testing-library/react-native";
12
13
  import { AnalyticsProvider } from "../analyticsUtils";
14
+ import { ThemeContext } from "../theme";
13
15
 
14
16
  export { getByTestId } from "./getByTestId";
15
17
 
@@ -59,7 +61,9 @@ const initialState = {
59
61
  appSettings: {},
60
62
  plugins: [],
61
63
  appState: { appReady: true, appLaunched: true },
64
+ pluginConfigurations: {},
62
65
  appData: { layoutVersion: "v1" },
66
+ zappPipes: {},
63
67
  contentTypes: null,
64
68
  };
65
69
 
@@ -68,20 +72,49 @@ export const WrappedWithProviders = ({
68
72
  store: storeObj = {},
69
73
  }: any) => {
70
74
  const _store = configureStore([thunk])(
71
- R.mergeDeepWith(R.concat, { ...initialState }, storeObj)
75
+ R.mergeDeepRight(initialState, { ...storeObj })
72
76
  );
73
77
 
78
+ appStore.set(_store);
79
+
74
80
  return (
75
- <SafeAreaProvider
76
- initialMetrics={{
77
- insets: { top: 0, left: 0, right: 0, bottom: 0 },
78
- frame: { x: 0, y: 0, width: 0, height: 0 },
81
+ <ThemeContext.Provider
82
+ value={{
83
+ themes: {
84
+ light: {
85
+ component_margin_top: 0,
86
+ component_margin_bottom: 0,
87
+ component_margin_left: 0,
88
+ component_margin_right: 0,
89
+ component_padding_top: 0,
90
+ component_padding_bottom: 0,
91
+ component_padding_left: 0,
92
+ component_padding_right: 0,
93
+ component_gutter_vertical: 0,
94
+ component_gutter_horizontal: 0,
95
+ component_corner_radius: 0,
96
+ app_background_color: "rgba(0,0,0,0)",
97
+ screen_margin_top: 0,
98
+ screen_margin_bottom: 0,
99
+ component_anchor_point_y: 0,
100
+ assets: "",
101
+ },
102
+ },
103
+ selectedThemeId: "light",
104
+ setSelectedThemeId: () => {},
79
105
  }}
80
106
  >
81
- <Provider store={_store}>
82
- <AnalyticsProvider>{children}</AnalyticsProvider>
83
- </Provider>
84
- </SafeAreaProvider>
107
+ <SafeAreaProvider
108
+ initialMetrics={{
109
+ insets: { top: 0, left: 0, right: 0, bottom: 0 },
110
+ frame: { x: 0, y: 0, width: 0, height: 0 },
111
+ }}
112
+ >
113
+ <Provider store={_store}>
114
+ <AnalyticsProvider>{children}</AnalyticsProvider>
115
+ </Provider>
116
+ </SafeAreaProvider>
117
+ </ThemeContext.Provider>
85
118
  );
86
119
  };
87
120
 
@@ -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
- };