@applicaster/zapp-react-dom-app 13.0.0-alpha.2635505531 → 13.0.0-alpha.3244448100
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 +37 -44
- package/package.json +6 -6
|
@@ -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
|
|
|
@@ -344,14 +335,37 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
344
335
|
}
|
|
345
336
|
|
|
346
337
|
onKeyUp(event: KeyboardEvent) {
|
|
338
|
+
const { setDisplayState } = this.props;
|
|
339
|
+
|
|
347
340
|
if (this.keySupportsLongPress(event)) {
|
|
348
341
|
this.longPressDetector.endKeyPressMonitoring(event.code);
|
|
349
342
|
}
|
|
343
|
+
|
|
344
|
+
if (
|
|
345
|
+
keyCode(event).matches(KEYS.Enter) ||
|
|
346
|
+
(__DEV__ && keyCode(event).matches(KEYS.X))
|
|
347
|
+
) {
|
|
348
|
+
focusManager.pressOut();
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
if (
|
|
352
|
+
keyCode(event).matches(KEYS.Forward) ||
|
|
353
|
+
(__DEV__ && keyCode(event).matches(KEYS.C))
|
|
354
|
+
) {
|
|
355
|
+
setDisplayState(DISPLAY_STATES.HUD);
|
|
356
|
+
KeyInputHandler.getInstance().onForwardPressOut();
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
if (
|
|
360
|
+
keyCode(event).matches(KEYS.Rewind) ||
|
|
361
|
+
(__DEV__ && keyCode(event).matches(KEYS.Z))
|
|
362
|
+
) {
|
|
363
|
+
setDisplayState(DISPLAY_STATES.HUD);
|
|
364
|
+
KeyInputHandler.getInstance().onRewindPressOut();
|
|
365
|
+
}
|
|
350
366
|
}
|
|
351
367
|
|
|
352
368
|
onKeyDown(event) {
|
|
353
|
-
// console.log("Anton: event", event);
|
|
354
|
-
// debugger;
|
|
355
369
|
const { displayState, setDisplayState, navigator } = this.props;
|
|
356
370
|
const { isKeyboardVisible } = this.state;
|
|
357
371
|
|
|
@@ -414,20 +428,20 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
414
428
|
|
|
415
429
|
if (
|
|
416
430
|
keyCode(event).matches(KEYS.Forward) ||
|
|
417
|
-
keyCode(event).matches(KEYS.C)
|
|
431
|
+
(__DEV__ && keyCode(event).matches(KEYS.C))
|
|
418
432
|
) {
|
|
419
433
|
setDisplayState(DISPLAY_STATES.HUD);
|
|
420
|
-
|
|
434
|
+
KeyInputHandler.getInstance().onForwardPress();
|
|
421
435
|
|
|
422
436
|
return;
|
|
423
437
|
}
|
|
424
438
|
|
|
425
439
|
if (
|
|
426
440
|
keyCode(event).matches(KEYS.Rewind) ||
|
|
427
|
-
keyCode(event).matches(KEYS.Z)
|
|
441
|
+
(__DEV__ && keyCode(event).matches(KEYS.Z))
|
|
428
442
|
) {
|
|
429
443
|
setDisplayState(DISPLAY_STATES.HUD);
|
|
430
|
-
|
|
444
|
+
KeyInputHandler.getInstance().onRewindPress();
|
|
431
445
|
|
|
432
446
|
return;
|
|
433
447
|
}
|
|
@@ -487,7 +501,10 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
487
501
|
}
|
|
488
502
|
}
|
|
489
503
|
|
|
490
|
-
if (
|
|
504
|
+
if (
|
|
505
|
+
keyCode(event).matches(KEYS.Enter) ||
|
|
506
|
+
(__DEV__ && keyCode(event).matches(KEYS.X))
|
|
507
|
+
) {
|
|
491
508
|
if (displayState === DISPLAY_STATES.PLAYER) {
|
|
492
509
|
setDisplayState(DISPLAY_STATES.HUD);
|
|
493
510
|
} else {
|
|
@@ -702,26 +719,13 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
702
719
|
}, SEQUENCE_ENTRY_TIME);
|
|
703
720
|
}
|
|
704
721
|
|
|
722
|
+
// TODO: Delete it on next PR if not needed
|
|
705
723
|
private handleLongPress = (event: CustomEvent) => {
|
|
706
724
|
const { keyCode } = event.detail;
|
|
707
|
-
const { displayState } = this.props;
|
|
708
|
-
const playerState = displayState === DISPLAY_STATES.PLAYER;
|
|
709
|
-
const hudState = displayState === DISPLAY_STATES.HUD;
|
|
710
|
-
const playbackState = playerState || hudState;
|
|
711
725
|
this.longPressActive = true;
|
|
712
726
|
this.cancelHudTimeout();
|
|
713
727
|
|
|
714
728
|
switch (keyCode) {
|
|
715
|
-
case KEYS.Forward.code:
|
|
716
|
-
case KEYS.C.code:
|
|
717
|
-
playbackState && this.props.seekMethods.onForwardLongPress();
|
|
718
|
-
break;
|
|
719
|
-
|
|
720
|
-
case KEYS.Rewind.code:
|
|
721
|
-
case KEYS.Z.code:
|
|
722
|
-
playbackState && this.props.seekMethods.onRewindLongPress();
|
|
723
|
-
break;
|
|
724
|
-
|
|
725
729
|
case KEYS.Enter.code:
|
|
726
730
|
case KEYS.X.code:
|
|
727
731
|
focusManager.longPress();
|
|
@@ -729,26 +733,16 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
729
733
|
}
|
|
730
734
|
};
|
|
731
735
|
|
|
736
|
+
// TODO: Delete it on next PR if not needed
|
|
732
737
|
private handleLongPressRelease = (event: CustomEvent) => {
|
|
733
738
|
const { keyCode } = event.detail;
|
|
734
739
|
this.longPressActive = false;
|
|
735
740
|
this.resetHudTimeout();
|
|
736
|
-
// debugger;
|
|
737
741
|
|
|
738
742
|
switch (keyCode) {
|
|
739
|
-
case KEYS.Forward.code:
|
|
740
|
-
case KEYS.C.code:
|
|
741
|
-
this.props.seekMethods.onForwardPressOut();
|
|
742
|
-
break;
|
|
743
|
-
|
|
744
|
-
case KEYS.Rewind.code:
|
|
745
|
-
case KEYS.Z.code:
|
|
746
|
-
this.props.seekMethods.onRewindPressOut();
|
|
747
|
-
break;
|
|
748
|
-
|
|
749
743
|
case KEYS.Enter.code:
|
|
750
744
|
case KEYS.X.code:
|
|
751
|
-
focusManager.pressOut();
|
|
745
|
+
// focusManager.pressOut();
|
|
752
746
|
break;
|
|
753
747
|
}
|
|
754
748
|
};
|
|
@@ -780,7 +774,6 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
780
774
|
|
|
781
775
|
export const InteractionManager = R.compose(
|
|
782
776
|
withNavigator,
|
|
783
|
-
withUseSeek,
|
|
784
777
|
withXray,
|
|
785
778
|
connectToStore(R.pick(["rivers"])),
|
|
786
779
|
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.3244448100",
|
|
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.3244448100",
|
|
26
|
+
"@applicaster/zapp-react-native-bridge": "13.0.0-alpha.3244448100",
|
|
27
|
+
"@applicaster/zapp-react-native-redux": "13.0.0-alpha.3244448100",
|
|
28
|
+
"@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.3244448100",
|
|
29
|
+
"@applicaster/zapp-react-native-utils": "13.0.0-alpha.3244448100",
|
|
30
30
|
"abortcontroller-polyfill": "^1.7.5",
|
|
31
31
|
"history": "^4.7.2",
|
|
32
32
|
"react-router-dom": "^5.1.2",
|