@flighthq/device 0.5.1-next.731.0ae0aa4 → 0.5.1-next.799.62ef0c7
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 +2 -2
- package/dist/device.d.ts.map +1 -1
- package/dist/device.js +8 -7
- package/dist/device.js.map +1 -1
- package/package.json +4 -3
- package/src/device.test.ts +3 -2
package/README.md
CHANGED
|
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/device`. The `@fligh
|
|
|
13
13
|
This package is part of the locked-version Flight SDK graph. Applications may instead install and import `@flighthq/sdk` when package-level tree shaking is sufficient.
|
|
14
14
|
|
|
15
15
|
- [Flight project](https://github.com/flighthq/flight)
|
|
16
|
-
- [Source for @flighthq/device@0.5.1-next.
|
|
17
|
-
- [License](https://github.com/flighthq/flight/blob/
|
|
16
|
+
- [Source for @flighthq/device@0.5.1-next.799.62ef0c7](https://github.com/flighthq/flight/tree/62ef0c74f09f24177aac3695b2487b2d743d4fe6/packages/device)
|
|
17
|
+
- [License](https://github.com/flighthq/flight/blob/62ef0c74f09f24177aac3695b2487b2d743d4fe6/LICENSE.md)
|
package/dist/device.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../src/device.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../src/device.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,EACV,eAAe,EACf,cAAc,EACf,MAAM,0BAA0B,CAAC;AAGlC,wBAAgB,wBAAwB,IAAI,kBAAkB,CAM7D;AAED,wBAAgB,0BAA0B,IAAI,oBAAoB,CAUjE;AAED,wBAAgB,gBAAgB,IAAI,UAAU,CA4B7C;AAED,wBAAgB,oBAAoB,IAAI,cAAc,CAErD;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,kBAAkB,GAAG,kBAAkB,CAExG;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,oBAAoB,GAAG,oBAAoB,CAE9G;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAEzD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,UAAU,GAAG,UAAU,CAEhF;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,GAAG,cAAc,CAE5F;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,CAE7D"}
|
package/dist/device.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { createEntity } from '@flighthq/entity/contract';
|
|
1
2
|
import { DeviceFormFactorUnknown } from '@flighthq/types/contract';
|
|
2
3
|
export function createDeviceCapabilities() {
|
|
3
|
-
return {
|
|
4
|
+
return createEntity({
|
|
4
5
|
hasKeyboard: false,
|
|
5
6
|
hasMouse: false,
|
|
6
7
|
hasStylus: false,
|
|
7
|
-
};
|
|
8
|
+
});
|
|
8
9
|
}
|
|
9
10
|
export function createDeviceDisplayMetrics() {
|
|
10
|
-
return {
|
|
11
|
+
return createEntity({
|
|
11
12
|
colorDepth: -1,
|
|
12
13
|
densityDpi: -1,
|
|
13
14
|
logicalHeight: -1,
|
|
@@ -15,10 +16,10 @@ export function createDeviceDisplayMetrics() {
|
|
|
15
16
|
physicalHeight: -1,
|
|
16
17
|
physicalWidth: -1,
|
|
17
18
|
pixelRatio: -1,
|
|
18
|
-
};
|
|
19
|
+
});
|
|
19
20
|
}
|
|
20
21
|
export function createDeviceInfo() {
|
|
21
|
-
return {
|
|
22
|
+
return createEntity({
|
|
22
23
|
arch: '',
|
|
23
24
|
availableMemory: -1,
|
|
24
25
|
boardName: '',
|
|
@@ -44,10 +45,10 @@ export function createDeviceInfo() {
|
|
|
44
45
|
supportedAbis: [],
|
|
45
46
|
totalMemory: -1,
|
|
46
47
|
webViewVersion: '',
|
|
47
|
-
};
|
|
48
|
+
});
|
|
48
49
|
}
|
|
49
50
|
export function createSafeAreaInsets() {
|
|
50
|
-
return { bottom: 0, left: 0, right: 0, top: 0 };
|
|
51
|
+
return createEntity({ bottom: 0, left: 0, right: 0, top: 0 });
|
|
51
52
|
}
|
|
52
53
|
export function getDeviceCapabilities(host, out) {
|
|
53
54
|
return host.system.device.getCapabilities(out);
|
package/dist/device.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.js","sourceRoot":"","sources":["../src/device.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"device.js","sourceRoot":"","sources":["../src/device.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAQzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,MAAM,UAAU,wBAAwB;IACtC,OAAO,YAAY,CAAC;QAClB,WAAW,EAAE,KAAK;QAClB,QAAQ,EAAE,KAAK;QACf,SAAS,EAAE,KAAK;KACjB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,0BAA0B;IACxC,OAAO,YAAY,CAAC;QAClB,UAAU,EAAE,CAAC,CAAC;QACd,UAAU,EAAE,CAAC,CAAC;QACd,aAAa,EAAE,CAAC,CAAC;QACjB,YAAY,EAAE,CAAC,CAAC;QAChB,cAAc,EAAE,CAAC,CAAC;QAClB,aAAa,EAAE,CAAC,CAAC;QACjB,UAAU,EAAE,CAAC,CAAC;KACf,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,YAAY,CAAC;QAClB,IAAI,EAAE,EAAE;QACR,eAAe,EAAE,CAAC,CAAC;QACnB,SAAS,EAAE,EAAE;QACb,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,CAAC,CAAC;QACZ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AM,UAAU,iBAAiB,CAAC,IAAqB,EAAE,GAAmB;IAC1E,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAqB;IACrD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;AACjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/device",
|
|
3
|
-
"version": "0.5.1-next.
|
|
3
|
+
"version": "0.5.1-next.799.62ef0c7",
|
|
4
4
|
"author": "Joshua Granick and other contributors",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,8 +38,9 @@
|
|
|
38
38
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@flighthq/
|
|
42
|
-
"@flighthq/
|
|
41
|
+
"@flighthq/entity": "0.5.1-next.799.62ef0c7",
|
|
42
|
+
"@flighthq/types": "0.5.1-next.799.62ef0c7",
|
|
43
|
+
"@flighthq/useragent": "0.5.1-next.799.62ef0c7"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
46
|
"typescript": "^5.3.0"
|
package/src/device.test.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
HasSystemDevice,
|
|
7
7
|
SafeAreaInsets,
|
|
8
8
|
} from '@flighthq/types/contract';
|
|
9
|
-
import { DeviceFormFactorUnknown } from '@flighthq/types/contract';
|
|
9
|
+
import { DeviceFormFactorUnknown, EntityRuntimeKey } from '@flighthq/types/contract';
|
|
10
10
|
|
|
11
11
|
import * as deviceContract from './device';
|
|
12
12
|
import {
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
|
|
25
25
|
function fakeBackend(): DeviceBackend {
|
|
26
26
|
return {
|
|
27
|
+
[EntityRuntimeKey]: undefined,
|
|
27
28
|
getCapabilities(out: DeviceCapabilities): DeviceCapabilities {
|
|
28
29
|
out.hasKeyboard = true;
|
|
29
30
|
out.hasMouse = true;
|
|
@@ -140,7 +141,7 @@ describe('createDeviceInfo', () => {
|
|
|
140
141
|
|
|
141
142
|
describe('createSafeAreaInsets', () => {
|
|
142
143
|
it('allocates zeroed edges', () => {
|
|
143
|
-
expect(createSafeAreaInsets()).
|
|
144
|
+
expect(createSafeAreaInsets()).toMatchObject({ bottom: 0, left: 0, right: 0, top: 0 });
|
|
144
145
|
});
|
|
145
146
|
});
|
|
146
147
|
|