@applicaster/zapp-react-native-utils 13.0.0-alpha.2060875348 → 13.0.0-alpha.2082004638
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 +93 -6
- package/appUtils/HooksManager/index.ts +1 -1
- package/appUtils/contextKeysManager/contextResolver.ts +1 -12
- package/appUtils/focusManager/index.ts +1 -10
- package/appUtils/orientationHelper.ts +11 -13
- package/appUtils/playerManager/player.ts +24 -12
- package/appUtils/playerManager/playerNative.ts +18 -3
- package/focusManager/index.ts +9 -1
- package/functionUtils/index.ts +21 -8
- package/manifestUtils/defaultManifestConfigurations/player.js +8 -0
- package/manifestUtils/fonts/index.js +5 -6
- package/numberUtils/index.ts +7 -5
- package/package.json +2 -6
- package/playerUtils/configurationGenerator.ts +8 -0
- package/reactHooks/app/useAppState.ts +2 -2
- package/reactHooks/autoscrolling/__tests__/useTrackedView.test.tsx +5 -7
- package/reactHooks/autoscrolling/useTrackedView.ts +12 -1
- package/reactHooks/feed/useFeedLoader.tsx +4 -2
- package/reactHooks/hookModal/hooks/useHookModalScreenData.ts +39 -0
- package/reactHooks/navigation/__tests__/index.test.tsx +6 -17
- package/reactHooks/navigation/index.ts +6 -4
- package/reactHooks/navigation/useRoute.ts +2 -4
- package/services/js2native.ts +673 -0
- package/time/BackgroundTimer.ts +55 -0
- package/time/Timer.ts +6 -6
- package/zappFrameworkUtils/loginPluginUtils.ts +6 -2
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { reactHooksLogger } from "../../logger";
|
|
2
|
+
import { useZappHooksModalState } from "@applicaster/zapp-react-dom-ui-components/Components/ZappHooksModal/hooks/useZappHooksModalState";
|
|
3
|
+
|
|
4
|
+
const logger = reactHooksLogger.addSubsystem("useHookModalScreenData");
|
|
5
|
+
|
|
6
|
+
type VariousScreenData = LegacyNavigationScreenData | ZappRiver | ZappEntry;
|
|
7
|
+
|
|
8
|
+
export const useHookModalScreenData = (): VariousScreenData | undefined => {
|
|
9
|
+
const hookModalState = useZappHooksModalState();
|
|
10
|
+
|
|
11
|
+
if (!hookModalState.state?.screenData) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
try {
|
|
16
|
+
const screenData = hookModalState.state.screenData?.payload;
|
|
17
|
+
const hookPlugin = hookModalState.state.screenData.hookPlugin;
|
|
18
|
+
|
|
19
|
+
if (hookPlugin?.screen_id) {
|
|
20
|
+
return {
|
|
21
|
+
...screenData,
|
|
22
|
+
targetScreen: hookPlugin,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return hookModalState.state.screenData?.payload;
|
|
27
|
+
} catch (error) {
|
|
28
|
+
logger.error({
|
|
29
|
+
message: "Hook modal screen data creation failed",
|
|
30
|
+
data: {
|
|
31
|
+
error,
|
|
32
|
+
hookModalState,
|
|
33
|
+
},
|
|
34
|
+
jsOnly: true,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
return hookModalState.state.screenData?.payload;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
@@ -310,14 +310,14 @@ describe("navigation", () => {
|
|
|
310
310
|
expect(navBarVisible).toBe(false);
|
|
311
311
|
});
|
|
312
312
|
|
|
313
|
-
it("returns false if it's secondary nav bar and
|
|
313
|
+
it("returns false if it's secondary nav bar and show_secondary_level_menu is false", () => {
|
|
314
314
|
const navBarVisible = isNavBarVisible(
|
|
315
315
|
"",
|
|
316
316
|
{
|
|
317
317
|
navigations: [
|
|
318
318
|
{
|
|
319
319
|
styles: {
|
|
320
|
-
|
|
320
|
+
show_secondary_level_menu: false,
|
|
321
321
|
},
|
|
322
322
|
},
|
|
323
323
|
],
|
|
@@ -329,14 +329,14 @@ describe("navigation", () => {
|
|
|
329
329
|
expect(navBarVisible).toBe(false);
|
|
330
330
|
});
|
|
331
331
|
|
|
332
|
-
it("returns true if it's secondary nav bar and
|
|
332
|
+
it("returns true if it's secondary nav bar and show_secondary_level_menu is true", () => {
|
|
333
333
|
const navBarVisible = isNavBarVisible(
|
|
334
334
|
"",
|
|
335
335
|
{
|
|
336
336
|
navigations: [
|
|
337
337
|
{
|
|
338
338
|
styles: {
|
|
339
|
-
|
|
339
|
+
show_secondary_level_menu: true,
|
|
340
340
|
},
|
|
341
341
|
},
|
|
342
342
|
],
|
|
@@ -348,14 +348,14 @@ describe("navigation", () => {
|
|
|
348
348
|
expect(navBarVisible).toBe(true);
|
|
349
349
|
});
|
|
350
350
|
|
|
351
|
-
it("returns true if it's first level menu and
|
|
351
|
+
it("returns true if it's first level menu and show_secondary_level_menu is false", () => {
|
|
352
352
|
const navBarVisible = isNavBarVisible(
|
|
353
353
|
"",
|
|
354
354
|
{
|
|
355
355
|
navigations: [
|
|
356
356
|
{
|
|
357
357
|
styles: {
|
|
358
|
-
|
|
358
|
+
show_secondary_level_menu: false,
|
|
359
359
|
},
|
|
360
360
|
},
|
|
361
361
|
],
|
|
@@ -366,16 +366,5 @@ describe("navigation", () => {
|
|
|
366
366
|
|
|
367
367
|
expect(navBarVisible).toBe(true);
|
|
368
368
|
});
|
|
369
|
-
|
|
370
|
-
it("returns true otherwise", () => {
|
|
371
|
-
const navBarVisible = isNavBarVisible(
|
|
372
|
-
"",
|
|
373
|
-
{ navigations: [] } as any,
|
|
374
|
-
true,
|
|
375
|
-
true
|
|
376
|
-
);
|
|
377
|
-
|
|
378
|
-
expect(navBarVisible).toBe(true);
|
|
379
|
-
});
|
|
380
369
|
});
|
|
381
370
|
});
|
|
@@ -108,11 +108,13 @@ export function isNavBarVisible(
|
|
|
108
108
|
return false;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
const
|
|
112
|
-
(
|
|
113
|
-
|
|
111
|
+
const showSecondaryLevel =
|
|
112
|
+
!isTV() ||
|
|
113
|
+
screenData?.navigations?.some(
|
|
114
|
+
(navigation) => navigation.styles?.show_secondary_level_menu
|
|
115
|
+
);
|
|
114
116
|
|
|
115
|
-
if (canGoBack &&
|
|
117
|
+
if (canGoBack && !showSecondaryLevel) {
|
|
116
118
|
return false;
|
|
117
119
|
}
|
|
118
120
|
|
|
@@ -7,9 +7,8 @@ import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
|
|
|
7
7
|
|
|
8
8
|
import { legacyScreenData } from "@applicaster/quick-brick-core/App/NavigationProvider/utils";
|
|
9
9
|
|
|
10
|
-
import { useZappHooksModalState } from "@applicaster/zapp-react-dom-ui-components/Components/ZappHooksModal/hooks/useZappHooksModalState";
|
|
11
|
-
|
|
12
10
|
import { getTargetScreenData } from "../screen/useTargetScreenData";
|
|
11
|
+
import { useHookModalScreenData } from "../hookModal/hooks/useHookModalScreenData";
|
|
13
12
|
|
|
14
13
|
import { useNavigation } from "./useNavigation";
|
|
15
14
|
import { useModalStore } from "../../modalState";
|
|
@@ -45,11 +44,10 @@ export const useRoute = (): {
|
|
|
45
44
|
]);
|
|
46
45
|
|
|
47
46
|
const { modalState } = useModalStore();
|
|
48
|
-
const hookModalState = useZappHooksModalState();
|
|
49
47
|
|
|
50
48
|
const modalScreenData = modalState.screen;
|
|
51
49
|
|
|
52
|
-
const hookModalScreenData =
|
|
50
|
+
const hookModalScreenData = useHookModalScreenData();
|
|
53
51
|
|
|
54
52
|
const videoModalScreenData =
|
|
55
53
|
navigator?.videoModalState?.item &&
|