@applicaster/zapp-react-dom-app 13.0.0-alpha.4455522223 → 13.0.0-alpha.4534963565
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.
|
@@ -140,13 +140,16 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
140
140
|
this.onConfirmDialogOpen = this.onConfirmDialogOpen.bind(this);
|
|
141
141
|
this.onConfirmDialogClose = this.onConfirmDialogClose.bind(this);
|
|
142
142
|
|
|
143
|
+
this.handlePhysicalKeyboardDismiss =
|
|
144
|
+
this.handlePhysicalKeyboardDismiss.bind(this);
|
|
145
|
+
|
|
143
146
|
this.confirmDialog.setConfirmAction(this.performExit);
|
|
144
147
|
this.confirmDialog.setCancelAction(this.onConfirmDialogClose);
|
|
145
148
|
this.longPressDetector = new KeyboardLongPressManager();
|
|
146
149
|
}
|
|
147
150
|
|
|
148
151
|
componentDidMount() {
|
|
149
|
-
window.addEventListener("keydown", this.onKeyDownListener);
|
|
152
|
+
window.addEventListener("keydown", this.onKeyDownListener, true);
|
|
150
153
|
window.addEventListener("keyup", this.onKeyUp);
|
|
151
154
|
window.addEventListener("mousemove", this.onMouseMoveListener);
|
|
152
155
|
|
|
@@ -181,6 +184,11 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
181
184
|
"onLongPressRelease",
|
|
182
185
|
this.handleLongPressRelease.bind(this)
|
|
183
186
|
);
|
|
187
|
+
|
|
188
|
+
document.addEventListener(
|
|
189
|
+
"keyboardDismissedByPhysicalKeypress",
|
|
190
|
+
this.handlePhysicalKeyboardDismiss
|
|
191
|
+
);
|
|
184
192
|
}
|
|
185
193
|
|
|
186
194
|
componentWillUnmount() {
|
|
@@ -209,6 +217,11 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
209
217
|
"onLongPressRelease",
|
|
210
218
|
this.handleLongPressRelease
|
|
211
219
|
);
|
|
220
|
+
|
|
221
|
+
document.removeEventListener(
|
|
222
|
+
"keyboardDismissedByPhysicalKeypress",
|
|
223
|
+
this.handlePhysicalKeyboardDismiss
|
|
224
|
+
);
|
|
212
225
|
}
|
|
213
226
|
|
|
214
227
|
performExit() {
|
|
@@ -448,20 +461,13 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
448
461
|
}
|
|
449
462
|
|
|
450
463
|
/**
|
|
451
|
-
When pressing
|
|
464
|
+
When pressing escape or the Native "Back" button:
|
|
452
465
|
if on the transport controls: we show the player
|
|
453
466
|
if on the player : we show the UI
|
|
454
467
|
if on the UI : we exit the app
|
|
468
|
+
note: backspace affects the keyboard input, so it not handled here
|
|
455
469
|
*/
|
|
456
|
-
|
|
457
|
-
if (
|
|
458
|
-
keyCode(event).matchesAny(
|
|
459
|
-
KEYS.Back,
|
|
460
|
-
KEYS.Escape,
|
|
461
|
-
KEYS.EscapeDevice,
|
|
462
|
-
KEYS.Backspace
|
|
463
|
-
)
|
|
464
|
-
) {
|
|
470
|
+
if (keyCode(event).matchesAny(KEYS.Back, KEYS.Escape, KEYS.EscapeDevice)) {
|
|
465
471
|
switch (displayState) {
|
|
466
472
|
case DISPLAY_STATES.DEFAULT:
|
|
467
473
|
case DISPLAY_STATES.PLAYER:
|
|
@@ -542,12 +548,6 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
542
548
|
focusManager.moveFocus(direction);
|
|
543
549
|
}
|
|
544
550
|
|
|
545
|
-
if (!isDialogVisible) {
|
|
546
|
-
// run focus recovery on user interaction attempt
|
|
547
|
-
// probably we failed to set initial focus for some reason
|
|
548
|
-
focusManager.recoverFocus();
|
|
549
|
-
}
|
|
550
|
-
|
|
551
551
|
if (
|
|
552
552
|
displayState === DISPLAY_STATES.PLAYER ||
|
|
553
553
|
displayState === DISPLAY_STATES.HUD
|
|
@@ -652,7 +652,7 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
652
652
|
}
|
|
653
653
|
}
|
|
654
654
|
|
|
655
|
-
handleKeyboardDismiss
|
|
655
|
+
handleKeyboardDismiss() {
|
|
656
656
|
this.isDismissing = true;
|
|
657
657
|
|
|
658
658
|
this.setState(
|
|
@@ -663,9 +663,10 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
663
663
|
},
|
|
664
664
|
() => {
|
|
665
665
|
this.isDismissing = false;
|
|
666
|
+
focusManager.recoverFocus();
|
|
666
667
|
}
|
|
667
668
|
);
|
|
668
|
-
}
|
|
669
|
+
}
|
|
669
670
|
|
|
670
671
|
handleKeyboardInput = (value: string) => {
|
|
671
672
|
const { activeInputRef } = this.state;
|
|
@@ -761,6 +762,35 @@ class InteractionManagerClass extends React.Component<Props, State> {
|
|
|
761
762
|
].includes(event.code);
|
|
762
763
|
}
|
|
763
764
|
|
|
765
|
+
handlePhysicalKeyboardDismiss(event: CustomEvent) {
|
|
766
|
+
const { value, position, inputElement } = event.detail;
|
|
767
|
+
|
|
768
|
+
this.isDismissing = true;
|
|
769
|
+
|
|
770
|
+
this.setState(
|
|
771
|
+
{
|
|
772
|
+
isKeyboardVisible: false,
|
|
773
|
+
keyboardInput: "",
|
|
774
|
+
activeInputRef: null,
|
|
775
|
+
},
|
|
776
|
+
() => {
|
|
777
|
+
if (inputElement) {
|
|
778
|
+
inputElement.value = value;
|
|
779
|
+
inputElement.focus();
|
|
780
|
+
inputElement.setSelectionRange(position, position);
|
|
781
|
+
|
|
782
|
+
const keyboardEvent = new CustomEvent("keyboardUpdate", {
|
|
783
|
+
detail: { value },
|
|
784
|
+
});
|
|
785
|
+
|
|
786
|
+
document.dispatchEvent(keyboardEvent);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
this.isDismissing = false;
|
|
790
|
+
}
|
|
791
|
+
);
|
|
792
|
+
}
|
|
793
|
+
|
|
764
794
|
render() {
|
|
765
795
|
return (
|
|
766
796
|
(shouldUseOnScreenKeyboard() && this.state.isKeyboardVisible && (
|
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.4534963565",
|
|
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.4534963565",
|
|
26
|
+
"@applicaster/zapp-react-native-bridge": "13.0.0-alpha.4534963565",
|
|
27
|
+
"@applicaster/zapp-react-native-redux": "13.0.0-alpha.4534963565",
|
|
28
|
+
"@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.4534963565",
|
|
29
|
+
"@applicaster/zapp-react-native-utils": "13.0.0-alpha.4534963565",
|
|
30
30
|
"abortcontroller-polyfill": "^1.7.5",
|
|
31
31
|
"react-router-dom": "^5.1.2",
|
|
32
32
|
"typeface-montserrat": "^0.0.54",
|
package/App/Splash/Spinner.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import "./spinner-styles.css";
|
|
4
|
-
|
|
5
|
-
export const Spinner = (color) => {
|
|
6
|
-
const spinnerColor = {
|
|
7
|
-
background: color.color,
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
return (
|
|
11
|
-
<div>
|
|
12
|
-
<div id="progress">
|
|
13
|
-
<div className="spinner">
|
|
14
|
-
<div style={spinnerColor} className="bar1" />
|
|
15
|
-
<div style={spinnerColor} className="bar2" />
|
|
16
|
-
<div style={spinnerColor} className="bar3" />
|
|
17
|
-
<div style={spinnerColor} className="bar4" />
|
|
18
|
-
<div style={spinnerColor} className="bar5" />
|
|
19
|
-
<div style={spinnerColor} className="bar6" />
|
|
20
|
-
<div style={spinnerColor} className="bar7" />
|
|
21
|
-
<div style={spinnerColor} className="bar8" />
|
|
22
|
-
<div style={spinnerColor} className="bar9" />
|
|
23
|
-
<div style={spinnerColor} className="bar10" />
|
|
24
|
-
<div style={spinnerColor} className="bar11" />
|
|
25
|
-
<div style={spinnerColor} className="bar12" />
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
);
|
|
30
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
div.spinner {
|
|
2
|
-
position: absolute;
|
|
3
|
-
width: 100px;
|
|
4
|
-
height: 100px;
|
|
5
|
-
display: inline-block;
|
|
6
|
-
top: 50%;
|
|
7
|
-
left: 50%;
|
|
8
|
-
margin: -60px 0 0 -70px;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
div.spinner div {
|
|
12
|
-
width: 6%;
|
|
13
|
-
height: 16%;
|
|
14
|
-
position: absolute;
|
|
15
|
-
left: 49%;
|
|
16
|
-
top: 43%;
|
|
17
|
-
opacity: 0;
|
|
18
|
-
-webkit-border-radius: 50px;
|
|
19
|
-
-webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
|
|
20
|
-
-webkit-animation: fade 1s linear infinite;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@-webkit-keyframes fade {
|
|
24
|
-
from {
|
|
25
|
-
opacity: 1;
|
|
26
|
-
}
|
|
27
|
-
to {
|
|
28
|
-
opacity: 0.25;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
div.spinner div.bar1 {
|
|
33
|
-
-webkit-transform: rotate(0deg) translate(0, -130%);
|
|
34
|
-
-webkit-animation-delay: 0s;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
div.spinner div.bar2 {
|
|
38
|
-
-webkit-transform: rotate(30deg) translate(0, -130%);
|
|
39
|
-
-webkit-animation-delay: -0.9167s;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
div.spinner div.bar3 {
|
|
43
|
-
-webkit-transform: rotate(60deg) translate(0, -130%);
|
|
44
|
-
-webkit-animation-delay: -0.833s;
|
|
45
|
-
}
|
|
46
|
-
div.spinner div.bar4 {
|
|
47
|
-
-webkit-transform: rotate(90deg) translate(0, -130%);
|
|
48
|
-
-webkit-animation-delay: -0.7497s;
|
|
49
|
-
}
|
|
50
|
-
div.spinner div.bar5 {
|
|
51
|
-
-webkit-transform: rotate(120deg) translate(0, -130%);
|
|
52
|
-
-webkit-animation-delay: -0.667s;
|
|
53
|
-
}
|
|
54
|
-
div.spinner div.bar6 {
|
|
55
|
-
-webkit-transform: rotate(150deg) translate(0, -130%);
|
|
56
|
-
-webkit-animation-delay: -0.5837s;
|
|
57
|
-
}
|
|
58
|
-
div.spinner div.bar7 {
|
|
59
|
-
-webkit-transform: rotate(180deg) translate(0, -130%);
|
|
60
|
-
-webkit-animation-delay: -0.5s;
|
|
61
|
-
}
|
|
62
|
-
div.spinner div.bar8 {
|
|
63
|
-
-webkit-transform: rotate(210deg) translate(0, -130%);
|
|
64
|
-
-webkit-animation-delay: -0.4167s;
|
|
65
|
-
}
|
|
66
|
-
div.spinner div.bar9 {
|
|
67
|
-
-webkit-transform: rotate(240deg) translate(0, -130%);
|
|
68
|
-
-webkit-animation-delay: -0.333s;
|
|
69
|
-
}
|
|
70
|
-
div.spinner div.bar10 {
|
|
71
|
-
-webkit-transform: rotate(270deg) translate(0, -130%);
|
|
72
|
-
-webkit-animation-delay: -0.2497s;
|
|
73
|
-
}
|
|
74
|
-
div.spinner div.bar11 {
|
|
75
|
-
-webkit-transform: rotate(300deg) translate(0, -130%);
|
|
76
|
-
-webkit-animation-delay: -0.167s;
|
|
77
|
-
}
|
|
78
|
-
div.spinner div.bar12 {
|
|
79
|
-
-webkit-transform: rotate(330deg) translate(0, -130%);
|
|
80
|
-
-webkit-animation-delay: -0.0833s;
|
|
81
|
-
}
|