@applicaster/zapp-react-native-utils 12.0.0-alpha.6115034951 → 12.0.0-alpha.6158046395
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/analyticsUtils/AnalyticPlayerListener.ts +141 -0
- package/analyticsUtils/PlayerAnalyticsManager.ts +90 -0
- package/analyticsUtils/{analyticsTracker.ts → playerAnalyticsTracker.ts} +19 -10
- package/appUtils/accessibilityManager/const.ts +50 -0
- package/appUtils/accessibilityManager/hooks.ts +40 -0
- package/appUtils/accessibilityManager/index.ts +155 -0
- package/appUtils/accessibilityManager/logger.ts +5 -0
- package/appUtils/focusManager/index.ts +0 -1
- package/appUtils/index.js +2 -0
- package/appUtils/platform/platformUtils.ts +74 -79
- package/appUtils/playerManager/index.ts +9 -27
- package/appUtils/playerManager/player.ts +1 -0
- package/appUtils/playerManager/playerHooks/usePlayerCurrentTime.tsx +57 -0
- package/appUtils/playerManager/playerNative.ts +1 -1
- package/appUtils/playerManager/usePlayerControllerSetup.tsx +2 -1
- package/appUtils/playerManager/usePlayerState.tsx +19 -34
- package/arrayUtils/index.ts +11 -0
- package/cellUtils/index.ts +38 -5
- package/focusManager/FocusManager.ts +20 -5
- package/focusManager/__tests__/FocusManager.test.ts +0 -1
- package/functionUtils/index.ts +38 -0
- package/index.d.ts +15 -0
- package/manifestUtils/defaultManifestConfigurations/player.js +121 -0
- package/manifestUtils/keys.js +2 -1
- package/navigationUtils/index.ts +1 -1
- package/numberUtils/__tests__/toNumber.test.ts +2 -2
- package/numberUtils/__tests__/toPositiveNumberWithDefault.test.ts +66 -0
- package/numberUtils/__tests__/toPositiveNumberWithDefaultZero.test.ts +66 -0
- package/numberUtils/index.ts +20 -0
- package/package.json +2 -2
- package/playerUtils/configurationGenerator.ts +120 -0
- package/playerUtils/imaScriptDom.ts +59 -0
- package/reactHooks/cell-click/index.ts +17 -3
- package/reactHooks/debugging/__tests__/index.test.js +81 -11
- package/reactHooks/feed/__tests__/useBatchLoading.test.tsx +69 -6
- package/reactHooks/feed/useBatchLoading.ts +52 -28
- package/reactHooks/layout/useDimensions/__tests__/useDimensions.test.ts +134 -0
- package/reactHooks/layout/useDimensions/useDimensions.ts +2 -0
- package/reactHooks/navigation/index.ts +1 -1
- package/reactHooks/player/useAutoSeek.tsx +9 -7
- package/reactHooks/resolvers/useCellResolver.ts +5 -1
- package/reactHooks/useConfiguration.ts +2 -2
- package/reactUtils/index.ts +4 -2
- package/testUtils/index.tsx +42 -9
package/testUtils/index.tsx
CHANGED
|
@@ -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.
|
|
75
|
+
R.mergeDeepRight(initialState, { ...storeObj })
|
|
72
76
|
);
|
|
73
77
|
|
|
78
|
+
appStore.set(_store);
|
|
79
|
+
|
|
74
80
|
return (
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
<
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
|