@applicaster/zapp-react-native-utils 12.0.8 → 12.0.9-rc.0
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.
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import * as R from "ramda";
|
|
2
|
-
|
|
3
1
|
// more keys can be added here. Simply make sure
|
|
4
2
|
// the key matches the code value
|
|
5
3
|
|
|
@@ -32,12 +30,18 @@ export function keyCode(key) {
|
|
|
32
30
|
keyCode(keyEvent).matchesAny("Enter", "Backspace", KEYS.ArrowLeft, ...)
|
|
33
31
|
*/
|
|
34
32
|
|
|
35
|
-
const matches =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
const matches = (compareKey) => {
|
|
34
|
+
// If compareKey is a string, look it up in KEYS object
|
|
35
|
+
const keyToCompare =
|
|
36
|
+
typeof compareKey === "string" ? KEYS[compareKey] : compareKey;
|
|
37
|
+
|
|
38
|
+
// Compare either code or keyCode properties
|
|
39
|
+
return (
|
|
40
|
+
keyToCompare?.code === key.code || keyToCompare?.keyCode === key.keyCode
|
|
41
|
+
);
|
|
42
|
+
};
|
|
39
43
|
|
|
40
|
-
const matchesAny = (...args) =>
|
|
44
|
+
const matchesAny = (...args) => args.some(matches);
|
|
41
45
|
|
|
42
46
|
const direction = () =>
|
|
43
47
|
matchesAny(...ARROW_KEYS) ? directionHelper(key) : null;
|
|
@@ -452,7 +452,7 @@ export class PlayerManager {
|
|
|
452
452
|
if (this.castingReceiver) {
|
|
453
453
|
this.castingReceiver.closeNativePlayer();
|
|
454
454
|
} else {
|
|
455
|
-
this.getActivePlayer()
|
|
455
|
+
this.getActivePlayer()?.closeNativePlayer();
|
|
456
456
|
this.invokeHandler("close");
|
|
457
457
|
}
|
|
458
458
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-utils",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.9-rc.0",
|
|
4
4
|
"description": "Applicaster Zapp React Native utilities package",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@applicaster/applicaster-types": "12.0.
|
|
31
|
+
"@applicaster/applicaster-types": "12.0.9-rc.0",
|
|
32
32
|
"buffer": "^5.2.1",
|
|
33
33
|
"camelize": "^1.0.0",
|
|
34
34
|
"create-react-context": "^0.2.3",
|