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

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