@applicaster/zapp-react-dom-app 14.0.24-alpha.5957182363 → 14.0.24

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.
@@ -59,7 +59,7 @@ import { withBackToTopActionHOC, BackToTopAction } from "./hoc";
59
59
  const { withXray } = getXray();
60
60
  const globalAny: any = global;
61
61
 
62
- const { log_warning } = createLogger({
62
+ const { log_debug, log_warning, log_info } = createLogger({
63
63
  category: "InteractionManager",
64
64
  subsystem: "zapp-react-dom-app",
65
65
  });
@@ -164,7 +164,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
164
164
  }
165
165
 
166
166
  componentDidMount() {
167
- window.addEventListener("keydown", this.onKeyDownListener, false); // Let events bubble
167
+ window.addEventListener("keydown", this.onKeyDownListener, true);
168
168
  window.addEventListener("keyup", this.onKeyUp);
169
169
  window.addEventListener("mousemove", this.onMouseMoveListener);
170
170
 
@@ -406,6 +406,13 @@ class InteractionManagerClass extends React.Component<Props, State> {
406
406
  const { isDialogVisible } = confirmationDialogStore.getState();
407
407
  const { isKeyboardVisible } = this.state;
408
408
 
409
+ log_debug("onBackPress", {
410
+ eventCode: event.code,
411
+ displayState,
412
+ isDialogVisible,
413
+ isKeyboardVisible,
414
+ });
415
+
409
416
  if (isKeyboardVisible && shouldUseOnScreenKeyboard()) {
410
417
  this.handleKeyboardDismiss();
411
418
  event.preventDefault();
@@ -419,32 +426,44 @@ class InteractionManagerClass extends React.Component<Props, State> {
419
426
  switch (displayState) {
420
427
  case DISPLAY_STATES.DEFAULT:
421
428
  if (action === "PLATFORM_BACK") {
429
+ log_info(action);
430
+
422
431
  this.platformBack();
423
432
  }
424
433
 
425
434
  if (action === "GO_HOME") {
435
+ log_info(action);
436
+
426
437
  this.goToHome();
427
438
  }
428
439
 
429
440
  if (action === "FOCUS_ON_SELECTED_TOP_MENU_ITEM") {
441
+ log_info(action);
442
+
430
443
  // we don't have enough context at this point to set focus properly on selected top-menu-item, just emit event about it.
431
444
  // TopMenu component is supposed to handle this event.
432
445
  emitFocusOnSelectedTopMenuItem();
433
446
  }
434
447
 
435
448
  if (action === "FOCUS_ON_SELECTED_TAB_ITEM") {
449
+ log_info(action);
450
+
436
451
  // we don't have enough context at this point to set focus properly on selected tab-menu-item, just emit event about it
437
452
  // Tabs component is supposed to handle this event.
438
453
  emitFocusOnSelectedTab();
439
454
  }
440
455
 
441
456
  if (action === "GO_BACK") {
457
+ log_info(action);
458
+
442
459
  if (navigator.canGoBack()) {
443
460
  navigator.goBack();
444
461
  }
445
462
  }
446
463
 
447
464
  if (action === "FORCE_GO_BACK") {
465
+ log_info(action);
466
+
448
467
  const fallbackToHome = false;
449
468
  const fromHook = true;
450
469
 
@@ -482,13 +501,8 @@ class InteractionManagerClass extends React.Component<Props, State> {
482
501
 
483
502
  break;
484
503
  case DISPLAY_STATES.HUD:
485
- if (action === "GO_BACK" && navigator.canGoBack()) {
486
- navigator.goBack();
487
- } else {
488
- // IF transport controls are open, close them instead of closing player
489
- setDisplayState(DISPLAY_STATES.PLAYER);
490
- }
491
-
504
+ // IF transport controls are open, close them instead of closing player
505
+ setDisplayState(DISPLAY_STATES.PLAYER);
492
506
  break;
493
507
  default:
494
508
  setDisplayState(DISPLAY_STATES.PLAYER);
@@ -549,39 +563,6 @@ class InteractionManagerClass extends React.Component<Props, State> {
549
563
  displayState === DISPLAY_STATES.PLAYER ||
550
564
  displayState === DISPLAY_STATES.HUD
551
565
  ) {
552
- // TODO: find alternative, using this logic to allow events to be passed to player controls
553
- // Still handle other keys (back, play/pause, etc.) through InteractionManager
554
- const player = window?.applicaster?.player;
555
- const videoElement = player?.getVideoElement();
556
-
557
- const isNavigationKey =
558
- keyCode(event).matchesAny(...ARROW_KEYS) ||
559
- keyCode(event).matches(KEYS.Enter) ||
560
- (__DEV__ && keyCode(event).matches(KEYS.X));
561
-
562
- const isBrightcoveControlFocused = () => {
563
- const activeElement = document.activeElement;
564
- if (!activeElement || !videoElement) return false;
565
-
566
- const playerContainer = videoElement.closest(".video-js");
567
-
568
- return playerContainer?.contains(activeElement) ?? false;
569
- };
570
-
571
- const brightcoveControlHasFocus = isBrightcoveControlFocused();
572
-
573
- if (videoElement && isNavigationKey) {
574
- if (brightcoveControlHasFocus) {
575
- return;
576
- }
577
-
578
- if (displayState === DISPLAY_STATES.PLAYER) {
579
- setDisplayState(DISPLAY_STATES.HUD);
580
- }
581
-
582
- return;
583
- }
584
-
585
566
  /**
586
567
  registering native keys for playback
587
568
  */
@@ -644,10 +625,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
644
625
 
645
626
  focusManager.recoverFocus();
646
627
  this.resetHudTimeout();
647
- } else if (
648
- displayState !== DISPLAY_STATES.PLAYER &&
649
- displayState !== DISPLAY_STATES.HUD
650
- ) {
628
+ } else {
651
629
  focusManager.pressIn();
652
630
  focusManager.press();
653
631
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-dom-app",
3
- "version": "14.0.24-alpha.5957182363",
3
+ "version": "14.0.24",
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": "14.0.24-alpha.5957182363",
26
- "@applicaster/zapp-react-native-bridge": "14.0.24-alpha.5957182363",
27
- "@applicaster/zapp-react-native-redux": "14.0.24-alpha.5957182363",
28
- "@applicaster/zapp-react-native-ui-components": "14.0.24-alpha.5957182363",
29
- "@applicaster/zapp-react-native-utils": "14.0.24-alpha.5957182363",
25
+ "@applicaster/zapp-react-dom-ui-components": "14.0.24",
26
+ "@applicaster/zapp-react-native-bridge": "14.0.24",
27
+ "@applicaster/zapp-react-native-redux": "14.0.24",
28
+ "@applicaster/zapp-react-native-ui-components": "14.0.24",
29
+ "@applicaster/zapp-react-native-utils": "14.0.24",
30
30
  "abortcontroller-polyfill": "^1.7.5",
31
31
  "typeface-montserrat": "^0.0.54",
32
32
  "video.js": "7.14.3",