@applicaster/zapp-react-dom-app 13.0.0-alpha.6525006318 → 13.0.0-alpha.9270615060

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.
@@ -23,8 +23,6 @@ import {
23
23
 
24
24
  import { showConfirmationDialog } from "@applicaster/zapp-react-native-utils/alertUtils";
25
25
 
26
- import { withUseSeek } from "@applicaster/zapp-react-native-utils/reactHooks/player";
27
-
28
26
  import {
29
27
  DISPLAY_STATES,
30
28
  DisplayStateContext,
@@ -48,6 +46,7 @@ import {
48
46
 
49
47
  import { OnScreenKeyboard } from "@applicaster/zapp-react-dom-ui-components/Components/OnScreenKeyboard";
50
48
  import { KeyboardLongPressManager } from "@applicaster/zapp-react-dom-ui-components/Utils/KeyboardLongPressManager";
49
+ import { KeyInputHandler } from "@applicaster/zapp-react-native-utils/appUtils/keyInputHandler/KeyInputHandler";
51
50
 
52
51
  const { withXray } = getXray();
53
52
  const globalAny: any = global;
@@ -62,14 +61,6 @@ type Props = {
62
61
  navigator: QuickBrickAppNavigator;
63
62
  rivers: {};
64
63
  xray: XRayContext;
65
- seekMethods: {
66
- onRewindPress: () => void;
67
- onRewindLongPress: () => void;
68
- onForwardPress: () => void;
69
- onForwardLongPress: () => void;
70
- onRewindPressOut: () => void;
71
- onForwardPressOut: () => void;
72
- };
73
64
  confirmDialog: typeof confirmationDialogStore;
74
65
  };
75
66
 
@@ -181,6 +172,11 @@ class InteractionManagerClass extends React.Component<Props, State> {
181
172
 
182
173
  window.addEventListener("onLongPress", this.handleLongPress.bind(this));
183
174
 
175
+ window.addEventListener(
176
+ "onPressRelease",
177
+ this.handleLongPressRelease.bind(this)
178
+ );
179
+
184
180
  window.addEventListener(
185
181
  "onLongPressRelease",
186
182
  this.handleLongPressRelease.bind(this)
@@ -345,6 +341,8 @@ class InteractionManagerClass extends React.Component<Props, State> {
345
341
  }
346
342
 
347
343
  onKeyDown(event) {
344
+ // console.log("Anton: event", event);
345
+ // debugger;
348
346
  const { displayState, setDisplayState, navigator } = this.props;
349
347
  const { isKeyboardVisible } = this.state;
350
348
 
@@ -372,6 +370,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
372
370
  When the player is displayed, we listen to Native Play / Pause / Stop
373
371
  buttons. Any other key press will display the transport controls
374
372
  */
373
+
375
374
  if (
376
375
  displayState === DISPLAY_STATES.PLAYER ||
377
376
  displayState === DISPLAY_STATES.HUD
@@ -404,16 +403,22 @@ class InteractionManagerClass extends React.Component<Props, State> {
404
403
  return;
405
404
  }
406
405
 
407
- if (keyCode(event).matches(KEYS.Forward)) {
406
+ if (
407
+ keyCode(event).matches(KEYS.Forward) ||
408
+ keyCode(event).matches(KEYS.C)
409
+ ) {
408
410
  setDisplayState(DISPLAY_STATES.HUD);
409
- this.props.seekMethods.onForwardPress();
411
+ KeyInputHandler.getInstance().onForwardPress();
410
412
 
411
413
  return;
412
414
  }
413
415
 
414
- if (keyCode(event).matches(KEYS.Rewind)) {
416
+ if (
417
+ keyCode(event).matches(KEYS.Rewind) ||
418
+ keyCode(event).matches(KEYS.Z)
419
+ ) {
415
420
  setDisplayState(DISPLAY_STATES.HUD);
416
- this.props.seekMethods.onRewindPress();
421
+ KeyInputHandler.getInstance().onRewindPress();
417
422
 
418
423
  return;
419
424
  }
@@ -473,7 +478,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
473
478
  }
474
479
  }
475
480
 
476
- if (keyCode(event).matches(KEYS.Enter)) {
481
+ if (keyCode(event).matches(KEYS.Enter) || keyCode(event).matches(KEYS.X)) {
477
482
  if (displayState === DISPLAY_STATES.PLAYER) {
478
483
  setDisplayState(DISPLAY_STATES.HUD);
479
484
  } else {
@@ -699,14 +704,18 @@ class InteractionManagerClass extends React.Component<Props, State> {
699
704
 
700
705
  switch (keyCode) {
701
706
  case KEYS.Forward.code:
702
- playbackState && this.props.seekMethods.onForwardLongPress();
707
+ case KEYS.C.code:
708
+ playbackState && KeyInputHandler.getInstance().onForwardLongPress();
709
+
703
710
  break;
704
711
 
705
712
  case KEYS.Rewind.code:
706
- playbackState && this.props.seekMethods.onRewindLongPress();
713
+ case KEYS.Z.code:
714
+ playbackState && KeyInputHandler.getInstance().onRewindLongPress();
707
715
  break;
708
716
 
709
717
  case KEYS.Enter.code:
718
+ case KEYS.X.code:
710
719
  focusManager.longPress();
711
720
  break;
712
721
  }
@@ -716,26 +725,35 @@ class InteractionManagerClass extends React.Component<Props, State> {
716
725
  const { keyCode } = event.detail;
717
726
  this.longPressActive = false;
718
727
  this.resetHudTimeout();
728
+ // debugger;
719
729
 
720
730
  switch (keyCode) {
721
731
  case KEYS.Forward.code:
722
- this.props.seekMethods.onForwardPressOut();
732
+ case KEYS.C.code:
733
+ KeyInputHandler.getInstance().onForwardPressOut();
723
734
  break;
724
735
 
725
736
  case KEYS.Rewind.code:
726
- this.props.seekMethods.onRewindPressOut();
737
+ case KEYS.Z.code:
738
+ KeyInputHandler.getInstance().onRewindPressOut();
727
739
  break;
728
740
 
729
741
  case KEYS.Enter.code:
742
+ case KEYS.X.code:
730
743
  focusManager.pressOut();
731
744
  break;
732
745
  }
733
746
  };
734
747
 
735
748
  private keySupportsLongPress(event: KeyboardEvent): boolean {
736
- return [KEYS.Forward.code, KEYS.Rewind.code, KEYS.Enter.code].includes(
737
- event.code
738
- );
749
+ return [
750
+ KEYS.Forward.code,
751
+ KEYS.Rewind.code,
752
+ KEYS.Enter.code,
753
+ KEYS.Z.code,
754
+ KEYS.X.code,
755
+ KEYS.C.code,
756
+ ].includes(event.code);
739
757
  }
740
758
 
741
759
  render() {
@@ -754,7 +772,6 @@ class InteractionManagerClass extends React.Component<Props, State> {
754
772
 
755
773
  export const InteractionManager = R.compose(
756
774
  withNavigator,
757
- withUseSeek,
758
775
  withXray,
759
776
  connectToStore(R.pick(["rivers"])),
760
777
  PlayerContentContext.withConsumer,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-dom-app",
3
- "version": "13.0.0-alpha.6525006318",
3
+ "version": "13.0.0-alpha.9270615060",
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.0-alpha.6525006318",
26
- "@applicaster/zapp-react-native-bridge": "13.0.0-alpha.6525006318",
27
- "@applicaster/zapp-react-native-redux": "13.0.0-alpha.6525006318",
28
- "@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.6525006318",
29
- "@applicaster/zapp-react-native-utils": "13.0.0-alpha.6525006318",
25
+ "@applicaster/zapp-react-dom-ui-components": "13.0.0-alpha.9270615060",
26
+ "@applicaster/zapp-react-native-bridge": "13.0.0-alpha.9270615060",
27
+ "@applicaster/zapp-react-native-redux": "13.0.0-alpha.9270615060",
28
+ "@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.9270615060",
29
+ "@applicaster/zapp-react-native-utils": "13.0.0-alpha.9270615060",
30
30
  "abortcontroller-polyfill": "^1.7.5",
31
31
  "history": "^4.7.2",
32
32
  "react-router-dom": "^5.1.2",