@24i/bigscreen-sdk 1.0.13-alpha.2266 → 1.0.13
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/README.md
CHANGED
|
@@ -8,7 +8,7 @@ sidebar_label: README
|
|
|
8
8
|
# SmartApps BIGscreen SDK
|
|
9
9
|
|
|
10
10
|
[](https://travis-ci.com/24i/smartapps-bigscreen-sdk)
|
|
11
|
-
[](https://coveralls.io/github/24i/smartapps-bigscreen-sdk?branch=development)
|
|
12
12
|
|
|
13
13
|
* [GitHub](https://github.com/24i/smartapps-bigscreen-sdk)
|
|
14
14
|
* [Confluence](https://24imedia.atlassian.net/wiki/spaces/PRDNGBIGSCR/overview)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@24i/bigscreen-sdk",
|
|
3
|
-
"version": "1.0.13
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "SmartApps BIGscreen SDK monorepo",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"lintcheck:cached": "npm run eslint -- --cache && npm run stylelint -- --cache",
|
|
18
18
|
"typecheck": "tsc --noEmit",
|
|
19
19
|
"typecheck:cached": "npm run typecheck -- --incremental",
|
|
20
|
-
"test": "npm run jest -- --no-cache
|
|
21
|
-
"test:cached": "npm run jest
|
|
20
|
+
"test": "npm run jest -- --no-cache",
|
|
21
|
+
"test:cached": "npm run jest",
|
|
22
22
|
"coverage": "npm run jest -- --runInBand --coverage && coveralls < coverage/lcov.info",
|
|
23
23
|
"branchlint": "branchlint",
|
|
24
24
|
"generate-changelog": "smartapps-bigscreen-changelog-generator",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"homepage": "https://github.com/24i/smartapps-bigscreen-sdk#readme",
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@24i/appstage-shared-analytics": "1.0.7",
|
|
41
|
-
"@24i/appstage-shared-events-manager": "1.0.
|
|
41
|
+
"@24i/appstage-shared-events-manager": "1.0.7",
|
|
42
42
|
"@24i/appstage-shared-perf-utils": "1.0.5",
|
|
43
43
|
"@24i/player-base": "6.10.0",
|
|
44
44
|
"@24i/smartapps-datalayer": "3.0.6-alpha.978",
|
|
@@ -55,15 +55,15 @@
|
|
|
55
55
|
"@24i/bigscreen-sdk": "file:.",
|
|
56
56
|
"@24i/eslint-config-smartapps-bigscreen-linters": "file:./libs/linters",
|
|
57
57
|
"@24i/smartapps-bigscreen-changelog-generator": "0.17.0",
|
|
58
|
-
"@babel/core": "^7.
|
|
58
|
+
"@babel/core": "^7.21.0",
|
|
59
59
|
"@babel/preset-env": "^7.20.2",
|
|
60
60
|
"@types/fs-extra": "^11.0.1",
|
|
61
61
|
"@types/inquirer": "^9.0.3",
|
|
62
62
|
"@types/jest": "^29.2.3",
|
|
63
63
|
"@types/minimist": "^1.2.2",
|
|
64
64
|
"@types/node": "^18.7.18",
|
|
65
|
-
"@types/react": "^18.0.
|
|
66
|
-
"babel-jest": "^29.4.
|
|
65
|
+
"@types/react": "^18.0.28",
|
|
66
|
+
"babel-jest": "^29.4.3",
|
|
67
67
|
"chalk": "^5.2.0",
|
|
68
68
|
"coveralls": "^3.1.1",
|
|
69
69
|
"cross-env": "^7.0.3",
|
|
@@ -12,21 +12,25 @@ export class Key {
|
|
|
12
12
|
|
|
13
13
|
alternativeKeyCodes: number[];
|
|
14
14
|
|
|
15
|
+
key: string;
|
|
16
|
+
|
|
15
17
|
constructor({
|
|
16
18
|
id,
|
|
17
19
|
code = '',
|
|
18
20
|
keyCode = 0,
|
|
19
21
|
alternativeCodes = [],
|
|
20
22
|
alternativeKeyCodes = [],
|
|
23
|
+
key = '',
|
|
21
24
|
}: Partial<KeyConfig> = {}) {
|
|
22
25
|
this.id = id!;
|
|
23
26
|
this.code = code;
|
|
24
27
|
this.keyCode = keyCode;
|
|
25
28
|
this.alternativeCodes = alternativeCodes;
|
|
26
29
|
this.alternativeKeyCodes = alternativeKeyCodes;
|
|
30
|
+
this.key = key;
|
|
27
31
|
}
|
|
28
32
|
|
|
29
|
-
is({ keyCode, code }: KeyboardEvent) {
|
|
33
|
+
is({ keyCode, code, key }: KeyboardEvent) {
|
|
30
34
|
return Boolean(
|
|
31
35
|
code && ( // empty string code means unknown/invalid --> should not compare
|
|
32
36
|
code === this.code
|
|
@@ -35,6 +39,9 @@ export class Key {
|
|
|
35
39
|
|| keyCode && ( // keyCode 0 means unknown/invalid --> should not compare
|
|
36
40
|
keyCode === this.keyCode
|
|
37
41
|
|| this.alternativeKeyCodes.length && includes(this.alternativeKeyCodes, keyCode)
|
|
42
|
+
)
|
|
43
|
+
|| key && ( // empty string code means unknown/invalid --> should not compare
|
|
44
|
+
key === this.key
|
|
38
45
|
),
|
|
39
46
|
);
|
|
40
47
|
}
|
|
@@ -6,11 +6,12 @@ import * as KeyMap from './KeyMap';
|
|
|
6
6
|
export const overrideValues = (map: Partial<Record<keyof KeycodeKeyMap, Partial<Key>>>) => {
|
|
7
7
|
// @ts-ignore - map and KeyMap have same keys
|
|
8
8
|
forEach(Object.entries(map), ([keyName, {
|
|
9
|
-
keyCode, code, alternativeKeyCodes, alternativeCodes,
|
|
9
|
+
keyCode, code, alternativeKeyCodes, alternativeCodes, key,
|
|
10
10
|
}]: [keyof typeof import('./KeyMap'), Partial<Key>]) => {
|
|
11
11
|
if (typeof keyCode === 'number') KeyMap[keyName].keyCode = keyCode;
|
|
12
12
|
if (typeof code === 'string') KeyMap[keyName].code = code;
|
|
13
13
|
if (alternativeKeyCodes) KeyMap[keyName].alternativeKeyCodes = alternativeKeyCodes;
|
|
14
14
|
if (alternativeCodes) KeyMap[keyName].alternativeCodes = alternativeCodes;
|
|
15
|
+
if (key) KeyMap[keyName].key = key;
|
|
15
16
|
});
|
|
16
17
|
};
|