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