@applicaster/zapp-react-dom-app 16.0.0-rc.2 → 16.0.0-rc.3
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.
|
@@ -64,14 +64,14 @@ describe("withBackToTopActionHOC - backToTopAction", () => {
|
|
|
64
64
|
});
|
|
65
65
|
});
|
|
66
66
|
|
|
67
|
-
it("returns
|
|
67
|
+
it("returns PLATFORM_TO_BACKGROUND for startup hook", () => {
|
|
68
68
|
expect.assertions(1);
|
|
69
69
|
|
|
70
70
|
(useCurrentScreenIsStartupHook as jest.Mock).mockReturnValue(true);
|
|
71
71
|
|
|
72
72
|
render(<Wrapped />);
|
|
73
73
|
|
|
74
|
-
expect(receivedProps.backToTopAction()).toBe("
|
|
74
|
+
expect(receivedProps.backToTopAction()).toBe("PLATFORM_TO_BACKGROUND");
|
|
75
75
|
});
|
|
76
76
|
|
|
77
77
|
it("returns GO_BACK_FROM_HOOK when isHook", () => {
|
|
@@ -94,7 +94,7 @@ describe("withBackToTopActionHOC - backToTopAction", () => {
|
|
|
94
94
|
expect(receivedProps.backToTopAction()).toBe("GO_HOME");
|
|
95
95
|
});
|
|
96
96
|
|
|
97
|
-
it("returns
|
|
97
|
+
it("returns PLATFORM_TO_BACKGROUND when root + menu focus + home", () => {
|
|
98
98
|
expect.assertions(1);
|
|
99
99
|
|
|
100
100
|
(useCurrentScreenIsRoot as jest.Mock).mockReturnValue(true);
|
|
@@ -106,7 +106,7 @@ describe("withBackToTopActionHOC - backToTopAction", () => {
|
|
|
106
106
|
|
|
107
107
|
render(<Wrapped />);
|
|
108
108
|
|
|
109
|
-
expect(receivedProps.backToTopAction()).toBe("
|
|
109
|
+
expect(receivedProps.backToTopAction()).toBe("PLATFORM_TO_BACKGROUND");
|
|
110
110
|
});
|
|
111
111
|
|
|
112
112
|
it("returns GO_HOME when root + menu focus + NOT home", () => {
|
|
@@ -38,7 +38,7 @@ export function withBackToTopActionHOC(Component) {
|
|
|
38
38
|
|
|
39
39
|
const backToTopAction = React.useCallback((): BackToTopAction => {
|
|
40
40
|
if (isStartUpHook) {
|
|
41
|
-
return "
|
|
41
|
+
return "PLATFORM_TO_BACKGROUND";
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
if (isHook) {
|
|
@@ -51,7 +51,7 @@ export function withBackToTopActionHOC(Component) {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
if (isRoot && focusManager.isFocusOnMenu() && isHome) {
|
|
54
|
-
return "
|
|
54
|
+
return "PLATFORM_TO_BACKGROUND";
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
if (isRoot && focusManager.isFocusOnMenu() && !isHome) {
|
|
@@ -3,11 +3,6 @@ import * as R from "ramda";
|
|
|
3
3
|
|
|
4
4
|
import { connectToStore } from "@applicaster/zapp-react-native-redux/utils/connectToStore";
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
QUICK_BRICK_EVENTS,
|
|
8
|
-
sendQuickBrickEvent,
|
|
9
|
-
} from "@applicaster/zapp-react-native-bridge/QuickBrick";
|
|
10
|
-
|
|
11
6
|
import { toBooleanWithDefaultFalse } from "@applicaster/zapp-react-native-utils/booleanUtils";
|
|
12
7
|
|
|
13
8
|
import {
|
|
@@ -50,6 +45,8 @@ import {
|
|
|
50
45
|
isVizioPlatform,
|
|
51
46
|
} from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
52
47
|
|
|
48
|
+
import { platformToBackground as sendAppToBackground } from "@applicaster/zapp-react-native-utils/appUtils/platform";
|
|
49
|
+
|
|
53
50
|
import { OnScreenKeyboard } from "@applicaster/zapp-react-dom-ui-components/Components/OnScreenKeyboard";
|
|
54
51
|
import { KeyboardLongPressManager } from "@applicaster/zapp-react-dom-ui-components/Utils/KeyboardLongPressManager";
|
|
55
52
|
import { KeyInputHandler } from "@applicaster/zapp-react-native-utils/appUtils/keyInputHandler/KeyInputHandler";
|
|
@@ -242,7 +239,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
242
239
|
performExit() {
|
|
243
240
|
if (isSamsungPlatform()) {
|
|
244
241
|
this.onConfirmDialogClose();
|
|
245
|
-
|
|
242
|
+
sendAppToBackground();
|
|
246
243
|
}
|
|
247
244
|
|
|
248
245
|
if (isLgPlatform()) {
|
|
@@ -256,7 +253,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
256
253
|
}
|
|
257
254
|
|
|
258
255
|
handleWebOsBack() {
|
|
259
|
-
const systemBack = globalAny?.webOS?.
|
|
256
|
+
const systemBack = globalAny?.webOS?.platformToBackground;
|
|
260
257
|
|
|
261
258
|
if (systemBack) {
|
|
262
259
|
systemBack();
|
|
@@ -277,7 +274,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
277
274
|
* WebOS behavior depends on the SDK version, WebOS 4 would pull up the launcher menu
|
|
278
275
|
* following versions would show a native exit prompt
|
|
279
276
|
*/
|
|
280
|
-
|
|
277
|
+
platformToBackground() {
|
|
281
278
|
try {
|
|
282
279
|
// TODO: temporary hack until this code is refactored
|
|
283
280
|
if (isSamsungPlatform() || isVizioPlatform()) {
|
|
@@ -294,9 +291,11 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
294
291
|
}
|
|
295
292
|
} else if (isLgPlatform()) {
|
|
296
293
|
this.handleWebOsBack();
|
|
294
|
+
} else {
|
|
295
|
+
sendAppToBackground();
|
|
297
296
|
}
|
|
298
297
|
} catch (e) {
|
|
299
|
-
log_warning("Failed to execute
|
|
298
|
+
log_warning("Failed to execute platformToBackground", e);
|
|
300
299
|
}
|
|
301
300
|
}
|
|
302
301
|
|
|
@@ -425,10 +424,10 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
425
424
|
|
|
426
425
|
switch (displayState) {
|
|
427
426
|
case DISPLAY_STATES.DEFAULT:
|
|
428
|
-
if (action === "
|
|
427
|
+
if (action === "PLATFORM_TO_BACKGROUND") {
|
|
429
428
|
log_info(action);
|
|
430
429
|
|
|
431
|
-
this.
|
|
430
|
+
this.platformToBackground();
|
|
432
431
|
}
|
|
433
432
|
|
|
434
433
|
if (action === "GO_HOME") {
|
|
@@ -477,11 +476,11 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
477
476
|
} else if (navigator.canGoBack()) {
|
|
478
477
|
navigator.goBack();
|
|
479
478
|
} else if (this.isHomeScreen()) {
|
|
480
|
-
this.
|
|
479
|
+
this.platformToBackground();
|
|
481
480
|
} else if (navigator.currentRoute.includes("hook")) {
|
|
482
481
|
// If code reaches this block navigator cant go back, it is not home,
|
|
483
482
|
// and this is a login plugin that was pushed on top of the home
|
|
484
|
-
// Treat it like a home screen and run
|
|
483
|
+
// Treat it like a home screen and run platformToBackground()
|
|
485
484
|
const entryData = navigator?.data?.entry;
|
|
486
485
|
const isHookInHomescreen = entryData?.payload?.home;
|
|
487
486
|
|
|
@@ -491,7 +490,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
491
490
|
: entryData?.hookPlugin?.module?.isFlowBlocker;
|
|
492
491
|
|
|
493
492
|
if (isHookInHomescreen && isHookFlowBlocker) {
|
|
494
|
-
this.
|
|
493
|
+
this.platformToBackground();
|
|
495
494
|
} else {
|
|
496
495
|
navigator.goBack(false, true);
|
|
497
496
|
}
|
|
@@ -640,7 +639,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
640
639
|
return;
|
|
641
640
|
}
|
|
642
641
|
|
|
643
|
-
this.
|
|
642
|
+
this.platformToBackground();
|
|
644
643
|
}
|
|
645
644
|
|
|
646
645
|
if (keyCode(event).matchesAny(...ARROW_KEYS)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-dom-app",
|
|
3
|
-
"version": "16.0.0-rc.
|
|
3
|
+
"version": "16.0.0-rc.3",
|
|
4
4
|
"description": "Zapp App Component for Applicaster's Quick Brick React Native App",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
},
|
|
23
23
|
"homepage": "https://github.com/applicaster/zapp-react-dom-app#readme",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@applicaster/zapp-react-dom-ui-components": "16.0.0-rc.
|
|
26
|
-
"@applicaster/zapp-react-native-bridge": "16.0.0-rc.
|
|
27
|
-
"@applicaster/zapp-react-native-redux": "16.0.0-rc.
|
|
28
|
-
"@applicaster/zapp-react-native-ui-components": "16.0.0-rc.
|
|
29
|
-
"@applicaster/zapp-react-native-utils": "16.0.0-rc.
|
|
25
|
+
"@applicaster/zapp-react-dom-ui-components": "16.0.0-rc.3",
|
|
26
|
+
"@applicaster/zapp-react-native-bridge": "16.0.0-rc.3",
|
|
27
|
+
"@applicaster/zapp-react-native-redux": "16.0.0-rc.3",
|
|
28
|
+
"@applicaster/zapp-react-native-ui-components": "16.0.0-rc.3",
|
|
29
|
+
"@applicaster/zapp-react-native-utils": "16.0.0-rc.3",
|
|
30
30
|
"abortcontroller-polyfill": "^1.7.5",
|
|
31
31
|
"typeface-montserrat": "^0.0.54",
|
|
32
32
|
"video.js": "7.14.3",
|