@applicaster/zapp-react-dom-app 13.0.10-rc.0 → 13.0.10-rc.2

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.
@@ -16,6 +16,7 @@ import {
16
16
  } from "@applicaster/zapp-react-native-utils/functionUtils";
17
17
 
18
18
  import {
19
+ AccessibilityManager,
19
20
  ARROW_KEYS,
20
21
  focusManager,
21
22
  keyCode,
@@ -83,8 +84,8 @@ interface State {
83
84
 
84
85
  type KeyCode = { code: string; keyCode: number | string };
85
86
 
86
- export const alertConfirmationMesage =
87
- "Are you sure you want to exit application?";
87
+ const VIDEO_PLAYER_CONTROLS_NAVIGATION_MESSAGE =
88
+ "Video player controls - use left/right to navigate";
88
89
 
89
90
  class InteractionManagerClass extends React.Component<Props, State> {
90
91
  onKeyDownListener: (keyCode: KeyCode) => void;
@@ -101,6 +102,8 @@ class InteractionManagerClass extends React.Component<Props, State> {
101
102
  private confirmDialog: ConfirmationDialogState =
102
103
  confirmationDialogStore.getState();
103
104
 
105
+ accessibilityManager: AccessibilityManager;
106
+
104
107
  state: State = {
105
108
  isKeyboardVisible: false,
106
109
  keyboardInput: "",
@@ -152,6 +155,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
152
155
  this.confirmDialog.setConfirmAction(this.performExit);
153
156
  this.confirmDialog.setCancelAction(this.onConfirmDialogClose);
154
157
  this.longPressDetector = new KeyboardLongPressManager();
158
+ this.accessibilityManager = AccessibilityManager.getInstance();
155
159
  }
156
160
 
157
161
  componentDidMount() {
@@ -257,7 +261,6 @@ class InteractionManagerClass extends React.Component<Props, State> {
257
261
  */
258
262
  showConfirmationDialog({
259
263
  title: "",
260
- message: alertConfirmationMesage,
261
264
  confirmCompletion: this.performExit,
262
265
  });
263
266
  }
@@ -280,7 +283,6 @@ class InteractionManagerClass extends React.Component<Props, State> {
280
283
  } else {
281
284
  showConfirmationDialog({
282
285
  title: "",
283
- message: alertConfirmationMesage,
284
286
  confirmCompletion: this.performExit,
285
287
  cancelCompletion: this.onConfirmDialogClose,
286
288
  });
@@ -327,6 +329,16 @@ class InteractionManagerClass extends React.Component<Props, State> {
327
329
  return homePath === navigator.currentRoute;
328
330
  }
329
331
 
332
+ isStartupHook() {
333
+ const { navigator } = this.props;
334
+
335
+ const isStartUpHook =
336
+ Array.isArray(navigator.startUpHooks) &&
337
+ navigator.startUpHooks.length > 0;
338
+
339
+ return isStartUpHook;
340
+ }
341
+
330
342
  goToHome() {
331
343
  const { navigator } = this.props;
332
344
  const { rivers } = this.props;
@@ -417,7 +429,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
417
429
  this.onConfirmDialogClose();
418
430
  } else if (navigator.canGoBack()) {
419
431
  navigator.goBack();
420
- } else if (this.isHomeScreen()) {
432
+ } else if (this.isHomeScreen() || this.isStartupHook()) {
421
433
  this.platformBack();
422
434
  } else if (navigator.currentRoute.includes("hook")) {
423
435
  // If code reaches this block navigator cant go back, it is not home,
@@ -551,6 +563,13 @@ class InteractionManagerClass extends React.Component<Props, State> {
551
563
  ) {
552
564
  if (displayState === DISPLAY_STATES.PLAYER) {
553
565
  setDisplayState(DISPLAY_STATES.HUD);
566
+
567
+ this.accessibilityManager.addHeading(
568
+ VIDEO_PLAYER_CONTROLS_NAVIGATION_MESSAGE
569
+ );
570
+
571
+ focusManager.recoverFocus();
572
+ this.resetHudTimeout();
554
573
  } else {
555
574
  focusManager.pressIn();
556
575
  focusManager.press();
@@ -595,6 +614,12 @@ class InteractionManagerClass extends React.Component<Props, State> {
595
614
  this.resetHudTimeout();
596
615
  }
597
616
 
617
+ if (displayState === DISPLAY_STATES.PLAYER) {
618
+ this.accessibilityManager.addHeading(
619
+ VIDEO_PLAYER_CONTROLS_NAVIGATION_MESSAGE
620
+ );
621
+ }
622
+
598
623
  return true;
599
624
  }
600
625
  }
@@ -1,4 +1,5 @@
1
1
  import * as React from "react";
2
+ import { createPortal } from "react-dom";
2
3
 
3
4
  import { Background } from "@applicaster/zapp-react-dom-ui-components/Components/Background";
4
5
  import { ConfirmDialog } from "@applicaster/zapp-react-dom-ui-components/Components/ConfirmDialog";
@@ -29,7 +30,7 @@ export function Layout({ children }: Props) {
29
30
  >
30
31
  {children}
31
32
  </LayoutComponent>
32
- <ConfirmDialog />
33
+ {createPortal(<ConfirmDialog />, document.body)}
33
34
  </>
34
35
  );
35
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-dom-app",
3
- "version": "13.0.10-rc.0",
3
+ "version": "13.0.10-rc.2",
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": "13.0.10-rc.0",
26
- "@applicaster/zapp-react-native-bridge": "13.0.10-rc.0",
27
- "@applicaster/zapp-react-native-redux": "13.0.10-rc.0",
28
- "@applicaster/zapp-react-native-ui-components": "13.0.10-rc.0",
29
- "@applicaster/zapp-react-native-utils": "13.0.10-rc.0",
25
+ "@applicaster/zapp-react-dom-ui-components": "13.0.10-rc.2",
26
+ "@applicaster/zapp-react-native-bridge": "13.0.10-rc.2",
27
+ "@applicaster/zapp-react-native-redux": "13.0.10-rc.2",
28
+ "@applicaster/zapp-react-native-ui-components": "13.0.10-rc.2",
29
+ "@applicaster/zapp-react-native-utils": "13.0.10-rc.2",
30
30
  "abortcontroller-polyfill": "^1.7.5",
31
31
  "react-router-dom": "^5.1.2",
32
32
  "typeface-montserrat": "^0.0.54",