@midscene/harmony 1.10.1 → 1.10.2-beta-20260706032158.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.
- package/dist/es/bin.mjs +8 -2
- package/dist/es/cli.mjs +9 -3
- package/dist/es/index.mjs +8 -2
- package/dist/lib/bin.js +8 -2
- package/dist/lib/cli.js +9 -3
- package/dist/lib/index.js +8 -2
- package/package.json +4 -4
- package/static/index.html +1 -1
- package/static/static/js/{index.3146a384.js → index.4b541d73.js} +16 -16
- package/static/static/js/index.4b541d73.js.map +1 -0
- package/static/static/js/index.3146a384.js.map +0 -1
- /package/static/static/js/{index.3146a384.js.LICENSE.txt → index.4b541d73.js.LICENSE.txt} +0 -0
package/dist/es/bin.mjs
CHANGED
|
@@ -537,6 +537,7 @@ class device_HarmonyDevice {
|
|
|
537
537
|
async typeText(text, element, shouldReplace, options) {
|
|
538
538
|
if (!text) return;
|
|
539
539
|
const hdc = await this.getHdc();
|
|
540
|
+
const typeDelay = options?.keyboardTypeDelay ?? this.options?.keyboardTypeDelay;
|
|
540
541
|
let x;
|
|
541
542
|
let y;
|
|
542
543
|
if (element) [x, y] = element.center;
|
|
@@ -555,7 +556,11 @@ class device_HarmonyDevice {
|
|
|
555
556
|
if (length > 0) await hdc.clearTextField(length);
|
|
556
557
|
await sleep(100);
|
|
557
558
|
}
|
|
558
|
-
|
|
559
|
+
if (typeDelay && typeDelay > 0) for (const ch of text){
|
|
560
|
+
await hdc.inputText(x, y, ch);
|
|
561
|
+
await sleep(typeDelay);
|
|
562
|
+
}
|
|
563
|
+
else await hdc.inputText(x, y, text);
|
|
559
564
|
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard ?? true;
|
|
560
565
|
if (shouldAutoDismissKeyboard) await this.hideKeyboard(options);
|
|
561
566
|
}
|
|
@@ -802,7 +807,8 @@ class device_HarmonyDevice {
|
|
|
802
807
|
const harmonyOpts = opts;
|
|
803
808
|
return harmonyOpts?.focusOnly ? Promise.resolve() : this.typeText(value, harmonyOpts?.target, harmonyOpts?.replace ?? true, {
|
|
804
809
|
autoDismissKeyboard: harmonyOpts?.autoDismissKeyboard,
|
|
805
|
-
keyboardDismissStrategy: harmonyOpts?.keyboardDismissStrategy
|
|
810
|
+
keyboardDismissStrategy: harmonyOpts?.keyboardDismissStrategy,
|
|
811
|
+
keyboardTypeDelay: harmonyOpts?.keyboardTypeDelay
|
|
806
812
|
});
|
|
807
813
|
},
|
|
808
814
|
clearInput: (target)=>this.clearInput(target),
|
package/dist/es/cli.mjs
CHANGED
|
@@ -535,6 +535,7 @@ class HarmonyDevice {
|
|
|
535
535
|
async typeText(text, element, shouldReplace, options) {
|
|
536
536
|
if (!text) return;
|
|
537
537
|
const hdc = await this.getHdc();
|
|
538
|
+
const typeDelay = options?.keyboardTypeDelay ?? this.options?.keyboardTypeDelay;
|
|
538
539
|
let x;
|
|
539
540
|
let y;
|
|
540
541
|
if (element) [x, y] = element.center;
|
|
@@ -553,7 +554,11 @@ class HarmonyDevice {
|
|
|
553
554
|
if (length > 0) await hdc.clearTextField(length);
|
|
554
555
|
await sleep(100);
|
|
555
556
|
}
|
|
556
|
-
|
|
557
|
+
if (typeDelay && typeDelay > 0) for (const ch of text){
|
|
558
|
+
await hdc.inputText(x, y, ch);
|
|
559
|
+
await sleep(typeDelay);
|
|
560
|
+
}
|
|
561
|
+
else await hdc.inputText(x, y, text);
|
|
557
562
|
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard ?? true;
|
|
558
563
|
if (shouldAutoDismissKeyboard) await this.hideKeyboard(options);
|
|
559
564
|
}
|
|
@@ -800,7 +805,8 @@ class HarmonyDevice {
|
|
|
800
805
|
const harmonyOpts = opts;
|
|
801
806
|
return harmonyOpts?.focusOnly ? Promise.resolve() : this.typeText(value, harmonyOpts?.target, harmonyOpts?.replace ?? true, {
|
|
802
807
|
autoDismissKeyboard: harmonyOpts?.autoDismissKeyboard,
|
|
803
|
-
keyboardDismissStrategy: harmonyOpts?.keyboardDismissStrategy
|
|
808
|
+
keyboardDismissStrategy: harmonyOpts?.keyboardDismissStrategy,
|
|
809
|
+
keyboardTypeDelay: harmonyOpts?.keyboardTypeDelay
|
|
804
810
|
});
|
|
805
811
|
},
|
|
806
812
|
clearInput: (target)=>this.clearInput(target),
|
|
@@ -1087,7 +1093,7 @@ class HarmonyMidsceneTools extends BaseMidsceneTools {
|
|
|
1087
1093
|
const tools = new HarmonyMidsceneTools();
|
|
1088
1094
|
runToolsCLI(tools, 'midscene-harmony', {
|
|
1089
1095
|
stripPrefix: 'harmony_',
|
|
1090
|
-
version: "1.10.
|
|
1096
|
+
version: "1.10.2-beta-20260706032158.0",
|
|
1091
1097
|
extraCommands: createReportCliCommands()
|
|
1092
1098
|
}).catch((e)=>{
|
|
1093
1099
|
process.exit(reportCLIError(e));
|
package/dist/es/index.mjs
CHANGED
|
@@ -506,6 +506,7 @@ class HarmonyDevice {
|
|
|
506
506
|
async typeText(text, element, shouldReplace, options) {
|
|
507
507
|
if (!text) return;
|
|
508
508
|
const hdc = await this.getHdc();
|
|
509
|
+
const typeDelay = options?.keyboardTypeDelay ?? this.options?.keyboardTypeDelay;
|
|
509
510
|
let x;
|
|
510
511
|
let y;
|
|
511
512
|
if (element) [x, y] = element.center;
|
|
@@ -524,7 +525,11 @@ class HarmonyDevice {
|
|
|
524
525
|
if (length > 0) await hdc.clearTextField(length);
|
|
525
526
|
await sleep(100);
|
|
526
527
|
}
|
|
527
|
-
|
|
528
|
+
if (typeDelay && typeDelay > 0) for (const ch of text){
|
|
529
|
+
await hdc.inputText(x, y, ch);
|
|
530
|
+
await sleep(typeDelay);
|
|
531
|
+
}
|
|
532
|
+
else await hdc.inputText(x, y, text);
|
|
528
533
|
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard ?? true;
|
|
529
534
|
if (shouldAutoDismissKeyboard) await this.hideKeyboard(options);
|
|
530
535
|
}
|
|
@@ -771,7 +776,8 @@ class HarmonyDevice {
|
|
|
771
776
|
const harmonyOpts = opts;
|
|
772
777
|
return harmonyOpts?.focusOnly ? Promise.resolve() : this.typeText(value, harmonyOpts?.target, harmonyOpts?.replace ?? true, {
|
|
773
778
|
autoDismissKeyboard: harmonyOpts?.autoDismissKeyboard,
|
|
774
|
-
keyboardDismissStrategy: harmonyOpts?.keyboardDismissStrategy
|
|
779
|
+
keyboardDismissStrategy: harmonyOpts?.keyboardDismissStrategy,
|
|
780
|
+
keyboardTypeDelay: harmonyOpts?.keyboardTypeDelay
|
|
775
781
|
});
|
|
776
782
|
},
|
|
777
783
|
clearInput: (target)=>this.clearInput(target),
|
package/dist/lib/bin.js
CHANGED
|
@@ -563,6 +563,7 @@ class device_HarmonyDevice {
|
|
|
563
563
|
async typeText(text, element, shouldReplace, options) {
|
|
564
564
|
if (!text) return;
|
|
565
565
|
const hdc = await this.getHdc();
|
|
566
|
+
const typeDelay = options?.keyboardTypeDelay ?? this.options?.keyboardTypeDelay;
|
|
566
567
|
let x;
|
|
567
568
|
let y;
|
|
568
569
|
if (element) [x, y] = element.center;
|
|
@@ -581,7 +582,11 @@ class device_HarmonyDevice {
|
|
|
581
582
|
if (length > 0) await hdc.clearTextField(length);
|
|
582
583
|
await (0, core_utils_namespaceObject.sleep)(100);
|
|
583
584
|
}
|
|
584
|
-
|
|
585
|
+
if (typeDelay && typeDelay > 0) for (const ch of text){
|
|
586
|
+
await hdc.inputText(x, y, ch);
|
|
587
|
+
await (0, core_utils_namespaceObject.sleep)(typeDelay);
|
|
588
|
+
}
|
|
589
|
+
else await hdc.inputText(x, y, text);
|
|
585
590
|
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard ?? true;
|
|
586
591
|
if (shouldAutoDismissKeyboard) await this.hideKeyboard(options);
|
|
587
592
|
}
|
|
@@ -828,7 +833,8 @@ class device_HarmonyDevice {
|
|
|
828
833
|
const harmonyOpts = opts;
|
|
829
834
|
return harmonyOpts?.focusOnly ? Promise.resolve() : this.typeText(value, harmonyOpts?.target, harmonyOpts?.replace ?? true, {
|
|
830
835
|
autoDismissKeyboard: harmonyOpts?.autoDismissKeyboard,
|
|
831
|
-
keyboardDismissStrategy: harmonyOpts?.keyboardDismissStrategy
|
|
836
|
+
keyboardDismissStrategy: harmonyOpts?.keyboardDismissStrategy,
|
|
837
|
+
keyboardTypeDelay: harmonyOpts?.keyboardTypeDelay
|
|
832
838
|
});
|
|
833
839
|
},
|
|
834
840
|
clearInput: (target)=>this.clearInput(target),
|
package/dist/lib/cli.js
CHANGED
|
@@ -560,6 +560,7 @@ class HarmonyDevice {
|
|
|
560
560
|
async typeText(text, element, shouldReplace, options) {
|
|
561
561
|
if (!text) return;
|
|
562
562
|
const hdc = await this.getHdc();
|
|
563
|
+
const typeDelay = options?.keyboardTypeDelay ?? this.options?.keyboardTypeDelay;
|
|
563
564
|
let x;
|
|
564
565
|
let y;
|
|
565
566
|
if (element) [x, y] = element.center;
|
|
@@ -578,7 +579,11 @@ class HarmonyDevice {
|
|
|
578
579
|
if (length > 0) await hdc.clearTextField(length);
|
|
579
580
|
await (0, core_utils_namespaceObject.sleep)(100);
|
|
580
581
|
}
|
|
581
|
-
|
|
582
|
+
if (typeDelay && typeDelay > 0) for (const ch of text){
|
|
583
|
+
await hdc.inputText(x, y, ch);
|
|
584
|
+
await (0, core_utils_namespaceObject.sleep)(typeDelay);
|
|
585
|
+
}
|
|
586
|
+
else await hdc.inputText(x, y, text);
|
|
582
587
|
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard ?? true;
|
|
583
588
|
if (shouldAutoDismissKeyboard) await this.hideKeyboard(options);
|
|
584
589
|
}
|
|
@@ -825,7 +830,8 @@ class HarmonyDevice {
|
|
|
825
830
|
const harmonyOpts = opts;
|
|
826
831
|
return harmonyOpts?.focusOnly ? Promise.resolve() : this.typeText(value, harmonyOpts?.target, harmonyOpts?.replace ?? true, {
|
|
827
832
|
autoDismissKeyboard: harmonyOpts?.autoDismissKeyboard,
|
|
828
|
-
keyboardDismissStrategy: harmonyOpts?.keyboardDismissStrategy
|
|
833
|
+
keyboardDismissStrategy: harmonyOpts?.keyboardDismissStrategy,
|
|
834
|
+
keyboardTypeDelay: harmonyOpts?.keyboardTypeDelay
|
|
829
835
|
});
|
|
830
836
|
},
|
|
831
837
|
clearInput: (target)=>this.clearInput(target),
|
|
@@ -1112,7 +1118,7 @@ class HarmonyMidsceneTools extends base_tools_namespaceObject.BaseMidsceneTools
|
|
|
1112
1118
|
const tools = new HarmonyMidsceneTools();
|
|
1113
1119
|
(0, cli_namespaceObject.runToolsCLI)(tools, 'midscene-harmony', {
|
|
1114
1120
|
stripPrefix: 'harmony_',
|
|
1115
|
-
version: "1.10.
|
|
1121
|
+
version: "1.10.2-beta-20260706032158.0",
|
|
1116
1122
|
extraCommands: (0, core_namespaceObject.createReportCliCommands)()
|
|
1117
1123
|
}).catch((e)=>{
|
|
1118
1124
|
process.exit((0, cli_namespaceObject.reportCLIError)(e));
|
package/dist/lib/index.js
CHANGED
|
@@ -542,6 +542,7 @@ class HarmonyDevice {
|
|
|
542
542
|
async typeText(text, element, shouldReplace, options) {
|
|
543
543
|
if (!text) return;
|
|
544
544
|
const hdc = await this.getHdc();
|
|
545
|
+
const typeDelay = options?.keyboardTypeDelay ?? this.options?.keyboardTypeDelay;
|
|
545
546
|
let x;
|
|
546
547
|
let y;
|
|
547
548
|
if (element) [x, y] = element.center;
|
|
@@ -560,7 +561,11 @@ class HarmonyDevice {
|
|
|
560
561
|
if (length > 0) await hdc.clearTextField(length);
|
|
561
562
|
await (0, utils_namespaceObject.sleep)(100);
|
|
562
563
|
}
|
|
563
|
-
|
|
564
|
+
if (typeDelay && typeDelay > 0) for (const ch of text){
|
|
565
|
+
await hdc.inputText(x, y, ch);
|
|
566
|
+
await (0, utils_namespaceObject.sleep)(typeDelay);
|
|
567
|
+
}
|
|
568
|
+
else await hdc.inputText(x, y, text);
|
|
564
569
|
const shouldAutoDismissKeyboard = options?.autoDismissKeyboard ?? this.options?.autoDismissKeyboard ?? true;
|
|
565
570
|
if (shouldAutoDismissKeyboard) await this.hideKeyboard(options);
|
|
566
571
|
}
|
|
@@ -807,7 +812,8 @@ class HarmonyDevice {
|
|
|
807
812
|
const harmonyOpts = opts;
|
|
808
813
|
return harmonyOpts?.focusOnly ? Promise.resolve() : this.typeText(value, harmonyOpts?.target, harmonyOpts?.replace ?? true, {
|
|
809
814
|
autoDismissKeyboard: harmonyOpts?.autoDismissKeyboard,
|
|
810
|
-
keyboardDismissStrategy: harmonyOpts?.keyboardDismissStrategy
|
|
815
|
+
keyboardDismissStrategy: harmonyOpts?.keyboardDismissStrategy,
|
|
816
|
+
keyboardTypeDelay: harmonyOpts?.keyboardTypeDelay
|
|
811
817
|
});
|
|
812
818
|
},
|
|
813
819
|
clearInput: (target)=>this.clearInput(target),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/harmony",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.2-beta-20260706032158.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/midscene.git",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@inquirer/prompts": "^7.8.6",
|
|
43
43
|
"open": "10.1.0",
|
|
44
|
-
"@midscene/
|
|
45
|
-
"@midscene/
|
|
46
|
-
"@midscene/shared": "1.10.
|
|
44
|
+
"@midscene/core": "1.10.2-beta-20260706032158.0",
|
|
45
|
+
"@midscene/playground": "1.10.2-beta-20260706032158.0",
|
|
46
|
+
"@midscene/shared": "1.10.2-beta-20260706032158.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@rslib/core": "^0.18.3",
|
package/static/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html><head><link rel="icon" href="/favicon.ico"><title>Midscene Playground</title><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><script defer src="/static/js/lib-react.7b1abe58.js"></script><script defer src="/static/js/905.8d12588e.js"></script><script defer src="/static/js/index.
|
|
1
|
+
<!doctype html><html><head><link rel="icon" href="/favicon.ico"><title>Midscene Playground</title><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><script defer src="/static/js/lib-react.7b1abe58.js"></script><script defer src="/static/js/905.8d12588e.js"></script><script defer src="/static/js/index.4b541d73.js"></script><link href="/static/css/index.1293237f.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
|