@midscene/android 0.30.8-beta-20251103084157.0 → 0.30.8
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/dist/es/index.mjs +5 -9
- package/dist/lib/index.js +5 -9
- package/dist/types/index.d.ts +0 -1
- package/package.json +4 -4
package/dist/es/index.mjs
CHANGED
|
@@ -312,8 +312,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
312
312
|
const result = {
|
|
313
313
|
override: sizeStr,
|
|
314
314
|
physical: sizeStr,
|
|
315
|
-
orientation: rotation
|
|
316
|
-
isCurrentOrientation: true
|
|
315
|
+
orientation: rotation
|
|
317
316
|
};
|
|
318
317
|
if (shouldCache) this.cachedScreenSize = result;
|
|
319
318
|
return result;
|
|
@@ -336,8 +335,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
336
335
|
const result = {
|
|
337
336
|
override: sizeStr,
|
|
338
337
|
physical: sizeStr,
|
|
339
|
-
orientation: rotation
|
|
340
|
-
isCurrentOrientation: true
|
|
338
|
+
orientation: rotation
|
|
341
339
|
};
|
|
342
340
|
if (shouldCache) this.cachedScreenSize = result;
|
|
343
341
|
return result;
|
|
@@ -370,8 +368,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
370
368
|
if (size.override || size.physical) {
|
|
371
369
|
const result = {
|
|
372
370
|
...size,
|
|
373
|
-
orientation
|
|
374
|
-
isCurrentOrientation: false
|
|
371
|
+
orientation
|
|
375
372
|
};
|
|
376
373
|
if (shouldCache) this.cachedScreenSize = result;
|
|
377
374
|
return result;
|
|
@@ -457,9 +454,8 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
457
454
|
const match = (screenSize.override || screenSize.physical).match(/(\d+)x(\d+)/);
|
|
458
455
|
if (!match || match.length < 3) throw new Error(`Unable to parse screen size: ${screenSize}`);
|
|
459
456
|
const isLandscape = 1 === screenSize.orientation || 3 === screenSize.orientation;
|
|
460
|
-
const
|
|
461
|
-
const
|
|
462
|
-
const height = Number.parseInt(match[shouldSwap ? 1 : 2], 10);
|
|
457
|
+
const width = Number.parseInt(match[isLandscape ? 2 : 1], 10);
|
|
458
|
+
const height = Number.parseInt(match[isLandscape ? 1 : 2], 10);
|
|
463
459
|
const scale = (null == (_this_options = this.options) ? void 0 : _this_options.screenshotResizeScale) ?? 1 / this.devicePixelRatio;
|
|
464
460
|
this.scalingRatio = scale;
|
|
465
461
|
const logicalWidth = Math.round(width * scale);
|
package/dist/lib/index.js
CHANGED
|
@@ -358,8 +358,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
358
358
|
const result = {
|
|
359
359
|
override: sizeStr,
|
|
360
360
|
physical: sizeStr,
|
|
361
|
-
orientation: rotation
|
|
362
|
-
isCurrentOrientation: true
|
|
361
|
+
orientation: rotation
|
|
363
362
|
};
|
|
364
363
|
if (shouldCache) this.cachedScreenSize = result;
|
|
365
364
|
return result;
|
|
@@ -382,8 +381,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
382
381
|
const result = {
|
|
383
382
|
override: sizeStr,
|
|
384
383
|
physical: sizeStr,
|
|
385
|
-
orientation: rotation
|
|
386
|
-
isCurrentOrientation: true
|
|
384
|
+
orientation: rotation
|
|
387
385
|
};
|
|
388
386
|
if (shouldCache) this.cachedScreenSize = result;
|
|
389
387
|
return result;
|
|
@@ -416,8 +414,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
416
414
|
if (size.override || size.physical) {
|
|
417
415
|
const result = {
|
|
418
416
|
...size,
|
|
419
|
-
orientation
|
|
420
|
-
isCurrentOrientation: false
|
|
417
|
+
orientation
|
|
421
418
|
};
|
|
422
419
|
if (shouldCache) this.cachedScreenSize = result;
|
|
423
420
|
return result;
|
|
@@ -503,9 +500,8 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
503
500
|
const match = (screenSize.override || screenSize.physical).match(/(\d+)x(\d+)/);
|
|
504
501
|
if (!match || match.length < 3) throw new Error(`Unable to parse screen size: ${screenSize}`);
|
|
505
502
|
const isLandscape = 1 === screenSize.orientation || 3 === screenSize.orientation;
|
|
506
|
-
const
|
|
507
|
-
const
|
|
508
|
-
const height = Number.parseInt(match[shouldSwap ? 1 : 2], 10);
|
|
503
|
+
const width = Number.parseInt(match[isLandscape ? 2 : 1], 10);
|
|
504
|
+
const height = Number.parseInt(match[isLandscape ? 1 : 2], 10);
|
|
509
505
|
const scale = (null == (_this_options = this.options) ? void 0 : _this_options.screenshotResizeScale) ?? 1 / this.devicePixelRatio;
|
|
510
506
|
this.scalingRatio = scale;
|
|
511
507
|
const logicalWidth = Math.round(width * scale);
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/android",
|
|
3
|
-
"version": "0.30.8
|
|
3
|
+
"version": "0.30.8",
|
|
4
4
|
"description": "Android automation library for Midscene",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Android UI automation",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"appium-adb": "12.12.1",
|
|
30
|
-
"@midscene/core": "0.30.8
|
|
31
|
-
"@midscene/shared": "0.30.8
|
|
30
|
+
"@midscene/core": "0.30.8",
|
|
31
|
+
"@midscene/shared": "0.30.8"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@rslib/core": "^0.11.2",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"typescript": "^5.8.3",
|
|
38
38
|
"tsx": "^4.19.2",
|
|
39
39
|
"vitest": "3.0.5",
|
|
40
|
-
"@midscene/playground": "0.30.8
|
|
40
|
+
"@midscene/playground": "0.30.8"
|
|
41
41
|
},
|
|
42
42
|
"license": "MIT",
|
|
43
43
|
"scripts": {
|