@applicaster/zapp-react-dom-app 16.0.0-alpha.6593152532 → 16.0.0-alpha.7128076344

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 PLATFORM_TO_BACKGROUND for startup hook", () => {
67
+ it("returns PLATFORM_BACK 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("PLATFORM_TO_BACKGROUND");
74
+ expect(receivedProps.backToTopAction()).toBe("PLATFORM_BACK");
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 PLATFORM_TO_BACKGROUND when root + menu focus + home", () => {
97
+ it("returns PLATFORM_BACK 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("PLATFORM_TO_BACKGROUND");
109
+ expect(receivedProps.backToTopAction()).toBe("PLATFORM_BACK");
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 "PLATFORM_TO_BACKGROUND";
41
+ return "PLATFORM_BACK";
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 "PLATFORM_TO_BACKGROUND";
54
+ return "PLATFORM_BACK";
55
55
  }
56
56
 
57
57
  if (isRoot && focusManager.isFocusOnMenu() && !isHome) {
@@ -3,6 +3,11 @@ 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
+
6
11
  import { toBooleanWithDefaultFalse } from "@applicaster/zapp-react-native-utils/booleanUtils";
7
12
 
8
13
  import {
@@ -45,8 +50,6 @@ import {
45
50
  isVizioPlatform,
46
51
  } from "@applicaster/zapp-react-native-utils/reactUtils";
47
52
 
48
- import { platformToBackground as sendAppToBackground } from "@applicaster/zapp-react-native-utils/appUtils/platform";
49
-
50
53
  import { OnScreenKeyboard } from "@applicaster/zapp-react-dom-ui-components/Components/OnScreenKeyboard";
51
54
  import { KeyboardLongPressManager } from "@applicaster/zapp-react-dom-ui-components/Utils/KeyboardLongPressManager";
52
55
  import { KeyInputHandler } from "@applicaster/zapp-react-native-utils/appUtils/keyInputHandler/KeyInputHandler";
@@ -239,7 +242,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
239
242
  performExit() {
240
243
  if (isSamsungPlatform()) {
241
244
  this.onConfirmDialogClose();
242
- sendAppToBackground();
245
+ sendQuickBrickEvent(QUICK_BRICK_EVENTS.MOVE_APP_TO_BACKGROUND);
243
246
  }
244
247
 
245
248
  if (isLgPlatform()) {
@@ -253,7 +256,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
253
256
  }
254
257
 
255
258
  handleWebOsBack() {
256
- const systemBack = globalAny?.webOS?.platformToBackground;
259
+ const systemBack = globalAny?.webOS?.platformBack;
257
260
 
258
261
  if (systemBack) {
259
262
  systemBack();
@@ -274,7 +277,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
274
277
  * WebOS behavior depends on the SDK version, WebOS 4 would pull up the launcher menu
275
278
  * following versions would show a native exit prompt
276
279
  */
277
- platformToBackground() {
280
+ platformBack() {
278
281
  try {
279
282
  // TODO: temporary hack until this code is refactored
280
283
  if (isSamsungPlatform() || isVizioPlatform()) {
@@ -291,11 +294,9 @@ class InteractionManagerClass extends React.Component<Props, State> {
291
294
  }
292
295
  } else if (isLgPlatform()) {
293
296
  this.handleWebOsBack();
294
- } else {
295
- sendAppToBackground();
296
297
  }
297
298
  } catch (e) {
298
- log_warning("Failed to execute platformToBackground", e);
299
+ log_warning("Failed to execute platformBack", e);
299
300
  }
300
301
  }
301
302
 
@@ -424,10 +425,10 @@ class InteractionManagerClass extends React.Component<Props, State> {
424
425
 
425
426
  switch (displayState) {
426
427
  case DISPLAY_STATES.DEFAULT:
427
- if (action === "PLATFORM_TO_BACKGROUND") {
428
+ if (action === "PLATFORM_BACK") {
428
429
  log_info(action);
429
430
 
430
- this.platformToBackground();
431
+ this.platformBack();
431
432
  }
432
433
 
433
434
  if (action === "GO_HOME") {
@@ -476,11 +477,11 @@ class InteractionManagerClass extends React.Component<Props, State> {
476
477
  } else if (navigator.canGoBack()) {
477
478
  navigator.goBack();
478
479
  } else if (this.isHomeScreen()) {
479
- this.platformToBackground();
480
+ this.platformBack();
480
481
  } else if (navigator.currentRoute.includes("hook")) {
481
482
  // If code reaches this block navigator cant go back, it is not home,
482
483
  // and this is a login plugin that was pushed on top of the home
483
- // Treat it like a home screen and run platformToBackground()
484
+ // Treat it like a home screen and run platformBack()
484
485
  const entryData = navigator?.data?.entry;
485
486
  const isHookInHomescreen = entryData?.payload?.home;
486
487
 
@@ -490,7 +491,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
490
491
  : entryData?.hookPlugin?.module?.isFlowBlocker;
491
492
 
492
493
  if (isHookInHomescreen && isHookFlowBlocker) {
493
- this.platformToBackground();
494
+ this.platformBack();
494
495
  } else {
495
496
  navigator.goBack(false, true);
496
497
  }
@@ -639,7 +640,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
639
640
  return;
640
641
  }
641
642
 
642
- this.platformToBackground();
643
+ this.platformBack();
643
644
  }
644
645
 
645
646
  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-alpha.6593152532",
3
+ "version": "16.0.0-alpha.7128076344",
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-alpha.6593152532",
26
- "@applicaster/zapp-react-native-bridge": "16.0.0-alpha.6593152532",
27
- "@applicaster/zapp-react-native-redux": "16.0.0-alpha.6593152532",
28
- "@applicaster/zapp-react-native-ui-components": "16.0.0-alpha.6593152532",
29
- "@applicaster/zapp-react-native-utils": "16.0.0-alpha.6593152532",
25
+ "@applicaster/zapp-react-dom-ui-components": "16.0.0-alpha.7128076344",
26
+ "@applicaster/zapp-react-native-bridge": "16.0.0-alpha.7128076344",
27
+ "@applicaster/zapp-react-native-redux": "16.0.0-alpha.7128076344",
28
+ "@applicaster/zapp-react-native-ui-components": "16.0.0-alpha.7128076344",
29
+ "@applicaster/zapp-react-native-utils": "16.0.0-alpha.7128076344",
30
30
  "abortcontroller-polyfill": "^1.7.5",
31
31
  "typeface-montserrat": "^0.0.54",
32
32
  "video.js": "7.14.3",