@applicaster/zapp-react-dom-app 13.0.0-alpha.1632352572 → 13.0.0-alpha.1909212433
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 +36 -54
- 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,32 +339,9 @@ 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) ||
|
|
345
|
-
(__DEV__ && keyCode(event).matches(KEYS.X))) {
|
|
346
|
-
focusManager.pressOut();
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
if (
|
|
350
|
-
keyCode(event).matches(KEYS.Forward) ||
|
|
351
|
-
(__DEV__ && keyCode(event).matches(KEYS.C))
|
|
352
|
-
) {
|
|
353
|
-
setDisplayState(DISPLAY_STATES.HUD);
|
|
354
|
-
KeyInputHandler.getInstance().onForwardPressOut();
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
if (
|
|
358
|
-
keyCode(event).matches(KEYS.Rewind) ||
|
|
359
|
-
(__DEV__ && keyCode(event).matches(KEYS.Z))
|
|
360
|
-
) {
|
|
361
|
-
setDisplayState(DISPLAY_STATES.HUD);
|
|
362
|
-
KeyInputHandler.getInstance().onRewindPressOut();
|
|
363
|
-
}
|
|
364
345
|
}
|
|
365
346
|
|
|
366
347
|
onKeyDown(event) {
|
|
@@ -391,7 +372,6 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
391
372
|
When the player is displayed, we listen to Native Play / Pause / Stop
|
|
392
373
|
buttons. Any other key press will display the transport controls
|
|
393
374
|
*/
|
|
394
|
-
|
|
395
375
|
if (
|
|
396
376
|
displayState === DISPLAY_STATES.PLAYER ||
|
|
397
377
|
displayState === DISPLAY_STATES.HUD
|
|
@@ -424,22 +404,16 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
424
404
|
return;
|
|
425
405
|
}
|
|
426
406
|
|
|
427
|
-
if (
|
|
428
|
-
keyCode(event).matches(KEYS.Forward) ||
|
|
429
|
-
(__DEV__ && keyCode(event).matches(KEYS.C))
|
|
430
|
-
) {
|
|
407
|
+
if (keyCode(event).matches(KEYS.Forward)) {
|
|
431
408
|
setDisplayState(DISPLAY_STATES.HUD);
|
|
432
|
-
|
|
409
|
+
this.props.seekMethods.onForwardPress();
|
|
433
410
|
|
|
434
411
|
return;
|
|
435
412
|
}
|
|
436
413
|
|
|
437
|
-
if (
|
|
438
|
-
keyCode(event).matches(KEYS.Rewind) ||
|
|
439
|
-
(__DEV__ && keyCode(event).matches(KEYS.Z))
|
|
440
|
-
) {
|
|
414
|
+
if (keyCode(event).matches(KEYS.Rewind)) {
|
|
441
415
|
setDisplayState(DISPLAY_STATES.HUD);
|
|
442
|
-
|
|
416
|
+
this.props.seekMethods.onRewindPress();
|
|
443
417
|
|
|
444
418
|
return;
|
|
445
419
|
}
|
|
@@ -499,7 +473,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
499
473
|
}
|
|
500
474
|
}
|
|
501
475
|
|
|
502
|
-
if (keyCode(event).matches(KEYS.Enter)
|
|
476
|
+
if (keyCode(event).matches(KEYS.Enter)) {
|
|
503
477
|
if (displayState === DISPLAY_STATES.PLAYER) {
|
|
504
478
|
setDisplayState(DISPLAY_STATES.HUD);
|
|
505
479
|
} else {
|
|
@@ -714,7 +688,6 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
714
688
|
}, SEQUENCE_ENTRY_TIME);
|
|
715
689
|
}
|
|
716
690
|
|
|
717
|
-
// TODO: Delete it on next PR if not needed
|
|
718
691
|
private handleLongPress = (event: CustomEvent) => {
|
|
719
692
|
const { keyCode } = event.detail;
|
|
720
693
|
const { displayState } = this.props;
|
|
@@ -725,36 +698,44 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
725
698
|
this.cancelHudTimeout();
|
|
726
699
|
|
|
727
700
|
switch (keyCode) {
|
|
701
|
+
case KEYS.Forward.code:
|
|
702
|
+
playbackState && this.props.seekMethods.onForwardLongPress();
|
|
703
|
+
break;
|
|
704
|
+
|
|
705
|
+
case KEYS.Rewind.code:
|
|
706
|
+
playbackState && this.props.seekMethods.onRewindLongPress();
|
|
707
|
+
break;
|
|
708
|
+
|
|
728
709
|
case KEYS.Enter.code:
|
|
729
|
-
case KEYS.X.code:
|
|
730
710
|
focusManager.longPress();
|
|
731
711
|
break;
|
|
732
712
|
}
|
|
733
713
|
};
|
|
734
714
|
|
|
735
|
-
// TODO: Delete it on next PR if not needed
|
|
736
715
|
private handleLongPressRelease = (event: CustomEvent) => {
|
|
737
716
|
const { keyCode } = event.detail;
|
|
738
717
|
this.longPressActive = false;
|
|
739
718
|
this.resetHudTimeout();
|
|
740
719
|
|
|
741
720
|
switch (keyCode) {
|
|
721
|
+
case KEYS.Forward.code:
|
|
722
|
+
this.props.seekMethods.onForwardPressOut();
|
|
723
|
+
break;
|
|
724
|
+
|
|
725
|
+
case KEYS.Rewind.code:
|
|
726
|
+
this.props.seekMethods.onRewindPressOut();
|
|
727
|
+
break;
|
|
728
|
+
|
|
742
729
|
case KEYS.Enter.code:
|
|
743
|
-
|
|
744
|
-
// focusManager.pressOut();
|
|
730
|
+
focusManager.pressOut();
|
|
745
731
|
break;
|
|
746
732
|
}
|
|
747
733
|
};
|
|
748
734
|
|
|
749
735
|
private keySupportsLongPress(event: KeyboardEvent): boolean {
|
|
750
|
-
return [
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
KEYS.Enter.code,
|
|
754
|
-
KEYS.Z.code,
|
|
755
|
-
KEYS.X.code,
|
|
756
|
-
KEYS.C.code,
|
|
757
|
-
].includes(event.code);
|
|
736
|
+
return [KEYS.Forward.code, KEYS.Rewind.code, KEYS.Enter.code].includes(
|
|
737
|
+
event.code
|
|
738
|
+
);
|
|
758
739
|
}
|
|
759
740
|
|
|
760
741
|
render() {
|
|
@@ -773,6 +754,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
773
754
|
|
|
774
755
|
export const InteractionManager = R.compose(
|
|
775
756
|
withNavigator,
|
|
757
|
+
withUseSeek,
|
|
776
758
|
withXray,
|
|
777
759
|
connectToStore(R.pick(["rivers"])),
|
|
778
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.1909212433",
|
|
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.1909212433",
|
|
26
|
+
"@applicaster/zapp-react-native-bridge": "13.0.0-alpha.1909212433",
|
|
27
|
+
"@applicaster/zapp-react-native-redux": "13.0.0-alpha.1909212433",
|
|
28
|
+
"@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.1909212433",
|
|
29
|
+
"@applicaster/zapp-react-native-utils": "13.0.0-alpha.1909212433",
|
|
30
30
|
"abortcontroller-polyfill": "^1.7.5",
|
|
31
31
|
"history": "^4.7.2",
|
|
32
32
|
"react-router-dom": "^5.1.2",
|