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

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)
@@ -339,12 +335,39 @@ class InteractionManagerClass extends React.Component<Props, State> {
339
335
  }
340
336
 
341
337
  onKeyUp(event: KeyboardEvent) {
338
+ const { setDisplayState } = this.props;
339
+
342
340
  if (this.keySupportsLongPress(event)) {
343
341
  this.longPressDetector.endKeyPressMonitoring(event.code);
344
342
  }
343
+
344
+ if (keyCode(event).matches(KEYS.Enter) || keyCode(event).matches(KEYS.X)) {
345
+ focusManager.pressOut();
346
+ }
347
+
348
+ if (
349
+ keyCode(event).matches(KEYS.Forward) ||
350
+ keyCode(event).matches(KEYS.C)
351
+ ) {
352
+ setDisplayState(DISPLAY_STATES.HUD);
353
+ KeyInputHandler.getInstance().onForwardPressOut();
354
+
355
+ return;
356
+ }
357
+
358
+ if (
359
+ keyCode(event).matches(KEYS.Rewind) ||
360
+ keyCode(event).matches(KEYS.Z)
361
+ ) {
362
+ setDisplayState(DISPLAY_STATES.HUD);
363
+ KeyInputHandler.getInstance().onRewindPressOut();
364
+ }
345
365
  }
346
366
 
347
367
  onKeyDown(event) {
368
+ console.log("Anton event", event);
369
+ // console.log("Anton: event", event);
370
+ // debugger;
348
371
  const { displayState, setDisplayState, navigator } = this.props;
349
372
  const { isKeyboardVisible } = this.state;
350
373
 
@@ -372,6 +395,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
372
395
  When the player is displayed, we listen to Native Play / Pause / Stop
373
396
  buttons. Any other key press will display the transport controls
374
397
  */
398
+
375
399
  if (
376
400
  displayState === DISPLAY_STATES.PLAYER ||
377
401
  displayState === DISPLAY_STATES.HUD
@@ -404,16 +428,22 @@ class InteractionManagerClass extends React.Component<Props, State> {
404
428
  return;
405
429
  }
406
430
 
407
- if (keyCode(event).matches(KEYS.Forward)) {
431
+ if (
432
+ keyCode(event).matches(KEYS.Forward) ||
433
+ keyCode(event).matches(KEYS.C)
434
+ ) {
408
435
  setDisplayState(DISPLAY_STATES.HUD);
409
- this.props.seekMethods.onForwardPress();
436
+ KeyInputHandler.getInstance().onForwardPress();
410
437
 
411
438
  return;
412
439
  }
413
440
 
414
- if (keyCode(event).matches(KEYS.Rewind)) {
441
+ if (
442
+ keyCode(event).matches(KEYS.Rewind) ||
443
+ keyCode(event).matches(KEYS.Z)
444
+ ) {
415
445
  setDisplayState(DISPLAY_STATES.HUD);
416
- this.props.seekMethods.onRewindPress();
446
+ KeyInputHandler.getInstance().onRewindPress();
417
447
 
418
448
  return;
419
449
  }
@@ -473,7 +503,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
473
503
  }
474
504
  }
475
505
 
476
- if (keyCode(event).matches(KEYS.Enter)) {
506
+ if (keyCode(event).matches(KEYS.Enter) || keyCode(event).matches(KEYS.X)) {
477
507
  if (displayState === DISPLAY_STATES.PLAYER) {
478
508
  setDisplayState(DISPLAY_STATES.HUD);
479
509
  } else {
@@ -699,14 +729,18 @@ class InteractionManagerClass extends React.Component<Props, State> {
699
729
 
700
730
  switch (keyCode) {
701
731
  case KEYS.Forward.code:
702
- playbackState && this.props.seekMethods.onForwardLongPress();
732
+ case KEYS.C.code:
733
+ // playbackState && KeyInputHandler.getInstance().onForwardLongPress();
734
+
703
735
  break;
704
736
 
705
737
  case KEYS.Rewind.code:
706
- playbackState && this.props.seekMethods.onRewindLongPress();
738
+ case KEYS.Z.code:
739
+ // playbackState && KeyInputHandler.getInstance().onRewindLongPress();
707
740
  break;
708
741
 
709
742
  case KEYS.Enter.code:
743
+ case KEYS.X.code:
710
744
  focusManager.longPress();
711
745
  break;
712
746
  }
@@ -716,26 +750,35 @@ class InteractionManagerClass extends React.Component<Props, State> {
716
750
  const { keyCode } = event.detail;
717
751
  this.longPressActive = false;
718
752
  this.resetHudTimeout();
753
+ // debugger;
719
754
 
720
755
  switch (keyCode) {
721
756
  case KEYS.Forward.code:
722
- this.props.seekMethods.onForwardPressOut();
757
+ case KEYS.C.code:
758
+ // KeyInputHandler.getInstance().onForwardPressOut();
723
759
  break;
724
760
 
725
761
  case KEYS.Rewind.code:
726
- this.props.seekMethods.onRewindPressOut();
762
+ case KEYS.Z.code:
763
+ // KeyInputHandler.getInstance().onRewindPressOut();
727
764
  break;
728
765
 
729
766
  case KEYS.Enter.code:
730
- focusManager.pressOut();
767
+ case KEYS.X.code:
768
+ // focusManager.pressOut();
731
769
  break;
732
770
  }
733
771
  };
734
772
 
735
773
  private keySupportsLongPress(event: KeyboardEvent): boolean {
736
- return [KEYS.Forward.code, KEYS.Rewind.code, KEYS.Enter.code].includes(
737
- event.code
738
- );
774
+ return [
775
+ KEYS.Forward.code,
776
+ KEYS.Rewind.code,
777
+ KEYS.Enter.code,
778
+ KEYS.Z.code,
779
+ KEYS.X.code,
780
+ KEYS.C.code,
781
+ ].includes(event.code);
739
782
  }
740
783
 
741
784
  render() {
@@ -754,7 +797,6 @@ class InteractionManagerClass extends React.Component<Props, State> {
754
797
 
755
798
  export const InteractionManager = R.compose(
756
799
  withNavigator,
757
- withUseSeek,
758
800
  withXray,
759
801
  connectToStore(R.pick(["rivers"])),
760
802
  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.7210171818",
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.7210171818",
26
+ "@applicaster/zapp-react-native-bridge": "13.0.0-alpha.7210171818",
27
+ "@applicaster/zapp-react-native-redux": "13.0.0-alpha.7210171818",
28
+ "@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.7210171818",
29
+ "@applicaster/zapp-react-native-utils": "13.0.0-alpha.7210171818",
30
30
  "abortcontroller-polyfill": "^1.7.5",
31
31
  "history": "^4.7.2",
32
32
  "react-router-dom": "^5.1.2",