@midscene/web 0.8.14 → 0.8.16

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/appium.js CHANGED
@@ -1255,8 +1255,8 @@ var PageTaskExecutor = class {
1255
1255
  await this.page.scrollUntilRight(startingPoint);
1256
1256
  } else if (scrollToEventName === "untilLeft") {
1257
1257
  await this.page.scrollUntilLeft(startingPoint);
1258
- } else if (scrollToEventName === "once") {
1259
- if (taskParam.direction === "down") {
1258
+ } else if (scrollToEventName === "once" || !scrollToEventName) {
1259
+ if (taskParam.direction === "down" || !taskParam.direction) {
1260
1260
  await this.page.scrollDown(
1261
1261
  taskParam.distance || void 0,
1262
1262
  startingPoint
@@ -873,8 +873,8 @@ var PageTaskExecutor = class {
873
873
  await this.page.scrollUntilRight(startingPoint);
874
874
  } else if (scrollToEventName === "untilLeft") {
875
875
  await this.page.scrollUntilLeft(startingPoint);
876
- } else if (scrollToEventName === "once") {
877
- if (taskParam.direction === "down") {
876
+ } else if (scrollToEventName === "once" || !scrollToEventName) {
877
+ if (taskParam.direction === "down" || !taskParam.direction) {
878
878
  await this.page.scrollDown(
879
879
  taskParam.distance || void 0,
880
880
  startingPoint
package/dist/es/index.js CHANGED
@@ -1266,8 +1266,8 @@ var PageTaskExecutor = class {
1266
1266
  await this.page.scrollUntilRight(startingPoint);
1267
1267
  } else if (scrollToEventName === "untilLeft") {
1268
1268
  await this.page.scrollUntilLeft(startingPoint);
1269
- } else if (scrollToEventName === "once") {
1270
- if (taskParam.direction === "down") {
1269
+ } else if (scrollToEventName === "once" || !scrollToEventName) {
1270
+ if (taskParam.direction === "down" || !taskParam.direction) {
1271
1271
  await this.page.scrollDown(
1272
1272
  taskParam.distance || void 0,
1273
1273
  startingPoint
@@ -2804,7 +2804,7 @@ function paramStr(task) {
2804
2804
  } else if (scrollType) {
2805
2805
  const scrollDirection = (_h = task == null ? void 0 : task.param) == null ? void 0 : _h.direction;
2806
2806
  const scrollDistance = (_i = task == null ? void 0 : task.param) == null ? void 0 : _i.distance;
2807
- value = `${scrollDirection}, ${scrollType}, ${scrollDistance || "distance-not-set"}`;
2807
+ value = `${scrollDirection || "down"}, ${scrollType || "once"}, ${scrollDistance || "distance-not-set"}`;
2808
2808
  } else {
2809
2809
  value = ((_j = task == null ? void 0 : task.param) == null ? void 0 : _j.value) || ((_k = task == null ? void 0 : task.param) == null ? void 0 : _k.scrollType);
2810
2810
  }
@@ -1188,8 +1188,8 @@ var PageTaskExecutor = class {
1188
1188
  await this.page.scrollUntilRight(startingPoint);
1189
1189
  } else if (scrollToEventName === "untilLeft") {
1190
1190
  await this.page.scrollUntilLeft(startingPoint);
1191
- } else if (scrollToEventName === "once") {
1192
- if (taskParam.direction === "down") {
1191
+ } else if (scrollToEventName === "once" || !scrollToEventName) {
1192
+ if (taskParam.direction === "down" || !taskParam.direction) {
1193
1193
  await this.page.scrollDown(
1194
1194
  taskParam.distance || void 0,
1195
1195
  startingPoint
@@ -851,8 +851,8 @@ var PageTaskExecutor = class {
851
851
  await this.page.scrollUntilRight(startingPoint);
852
852
  } else if (scrollToEventName === "untilLeft") {
853
853
  await this.page.scrollUntilLeft(startingPoint);
854
- } else if (scrollToEventName === "once") {
855
- if (taskParam.direction === "down") {
854
+ } else if (scrollToEventName === "once" || !scrollToEventName) {
855
+ if (taskParam.direction === "down" || !taskParam.direction) {
856
856
  await this.page.scrollDown(
857
857
  taskParam.distance || void 0,
858
858
  startingPoint
@@ -741,8 +741,8 @@ var PageTaskExecutor = class {
741
741
  await this.page.scrollUntilRight(startingPoint);
742
742
  } else if (scrollToEventName === "untilLeft") {
743
743
  await this.page.scrollUntilLeft(startingPoint);
744
- } else if (scrollToEventName === "once") {
745
- if (taskParam.direction === "down") {
744
+ } else if (scrollToEventName === "once" || !scrollToEventName) {
745
+ if (taskParam.direction === "down" || !taskParam.direction) {
746
746
  await this.page.scrollDown(
747
747
  taskParam.distance || void 0,
748
748
  startingPoint
@@ -738,8 +738,8 @@ var PageTaskExecutor = class {
738
738
  await this.page.scrollUntilRight(startingPoint);
739
739
  } else if (scrollToEventName === "untilLeft") {
740
740
  await this.page.scrollUntilLeft(startingPoint);
741
- } else if (scrollToEventName === "once") {
742
- if (taskParam.direction === "down") {
741
+ } else if (scrollToEventName === "once" || !scrollToEventName) {
742
+ if (taskParam.direction === "down" || !taskParam.direction) {
743
743
  await this.page.scrollDown(
744
744
  taskParam.distance || void 0,
745
745
  startingPoint
@@ -44,7 +44,7 @@ function paramStr(task) {
44
44
  } else if (scrollType) {
45
45
  const scrollDirection = (_h = task == null ? void 0 : task.param) == null ? void 0 : _h.direction;
46
46
  const scrollDistance = (_i = task == null ? void 0 : task.param) == null ? void 0 : _i.distance;
47
- value = `${scrollDirection}, ${scrollType}, ${scrollDistance || "distance-not-set"}`;
47
+ value = `${scrollDirection || "down"}, ${scrollType || "once"}, ${scrollDistance || "distance-not-set"}`;
48
48
  } else {
49
49
  value = ((_j = task == null ? void 0 : task.param) == null ? void 0 : _j.value) || ((_k = task == null ? void 0 : task.param) == null ? void 0 : _k.scrollType);
50
50
  }
package/dist/es/yaml.js CHANGED
@@ -63,7 +63,7 @@ function paramStr(task) {
63
63
  } else if (scrollType) {
64
64
  const scrollDirection = (_h = task == null ? void 0 : task.param) == null ? void 0 : _h.direction;
65
65
  const scrollDistance = (_i = task == null ? void 0 : task.param) == null ? void 0 : _i.distance;
66
- value = `${scrollDirection}, ${scrollType}, ${scrollDistance || "distance-not-set"}`;
66
+ value = `${scrollDirection || "down"}, ${scrollType || "once"}, ${scrollDistance || "distance-not-set"}`;
67
67
  } else {
68
68
  value = ((_j = task == null ? void 0 : task.param) == null ? void 0 : _j.value) || ((_k = task == null ? void 0 : task.param) == null ? void 0 : _k.scrollType);
69
69
  }
@@ -1255,8 +1255,8 @@ var PageTaskExecutor = class {
1255
1255
  await this.page.scrollUntilRight(startingPoint);
1256
1256
  } else if (scrollToEventName === "untilLeft") {
1257
1257
  await this.page.scrollUntilLeft(startingPoint);
1258
- } else if (scrollToEventName === "once") {
1259
- if (taskParam.direction === "down") {
1258
+ } else if (scrollToEventName === "once" || !scrollToEventName) {
1259
+ if (taskParam.direction === "down" || !taskParam.direction) {
1260
1260
  await this.page.scrollDown(
1261
1261
  taskParam.distance || void 0,
1262
1262
  startingPoint
@@ -873,8 +873,8 @@ var PageTaskExecutor = class {
873
873
  await this.page.scrollUntilRight(startingPoint);
874
874
  } else if (scrollToEventName === "untilLeft") {
875
875
  await this.page.scrollUntilLeft(startingPoint);
876
- } else if (scrollToEventName === "once") {
877
- if (taskParam.direction === "down") {
876
+ } else if (scrollToEventName === "once" || !scrollToEventName) {
877
+ if (taskParam.direction === "down" || !taskParam.direction) {
878
878
  await this.page.scrollDown(
879
879
  taskParam.distance || void 0,
880
880
  startingPoint
package/dist/lib/index.js CHANGED
@@ -1266,8 +1266,8 @@ var PageTaskExecutor = class {
1266
1266
  await this.page.scrollUntilRight(startingPoint);
1267
1267
  } else if (scrollToEventName === "untilLeft") {
1268
1268
  await this.page.scrollUntilLeft(startingPoint);
1269
- } else if (scrollToEventName === "once") {
1270
- if (taskParam.direction === "down") {
1269
+ } else if (scrollToEventName === "once" || !scrollToEventName) {
1270
+ if (taskParam.direction === "down" || !taskParam.direction) {
1271
1271
  await this.page.scrollDown(
1272
1272
  taskParam.distance || void 0,
1273
1273
  startingPoint
@@ -2804,7 +2804,7 @@ function paramStr(task) {
2804
2804
  } else if (scrollType) {
2805
2805
  const scrollDirection = (_h = task == null ? void 0 : task.param) == null ? void 0 : _h.direction;
2806
2806
  const scrollDistance = (_i = task == null ? void 0 : task.param) == null ? void 0 : _i.distance;
2807
- value = `${scrollDirection}, ${scrollType}, ${scrollDistance || "distance-not-set"}`;
2807
+ value = `${scrollDirection || "down"}, ${scrollType || "once"}, ${scrollDistance || "distance-not-set"}`;
2808
2808
  } else {
2809
2809
  value = ((_j = task == null ? void 0 : task.param) == null ? void 0 : _j.value) || ((_k = task == null ? void 0 : task.param) == null ? void 0 : _k.scrollType);
2810
2810
  }
@@ -1188,8 +1188,8 @@ var PageTaskExecutor = class {
1188
1188
  await this.page.scrollUntilRight(startingPoint);
1189
1189
  } else if (scrollToEventName === "untilLeft") {
1190
1190
  await this.page.scrollUntilLeft(startingPoint);
1191
- } else if (scrollToEventName === "once") {
1192
- if (taskParam.direction === "down") {
1191
+ } else if (scrollToEventName === "once" || !scrollToEventName) {
1192
+ if (taskParam.direction === "down" || !taskParam.direction) {
1193
1193
  await this.page.scrollDown(
1194
1194
  taskParam.distance || void 0,
1195
1195
  startingPoint
@@ -851,8 +851,8 @@ var PageTaskExecutor = class {
851
851
  await this.page.scrollUntilRight(startingPoint);
852
852
  } else if (scrollToEventName === "untilLeft") {
853
853
  await this.page.scrollUntilLeft(startingPoint);
854
- } else if (scrollToEventName === "once") {
855
- if (taskParam.direction === "down") {
854
+ } else if (scrollToEventName === "once" || !scrollToEventName) {
855
+ if (taskParam.direction === "down" || !taskParam.direction) {
856
856
  await this.page.scrollDown(
857
857
  taskParam.distance || void 0,
858
858
  startingPoint
@@ -741,8 +741,8 @@ var PageTaskExecutor = class {
741
741
  await this.page.scrollUntilRight(startingPoint);
742
742
  } else if (scrollToEventName === "untilLeft") {
743
743
  await this.page.scrollUntilLeft(startingPoint);
744
- } else if (scrollToEventName === "once") {
745
- if (taskParam.direction === "down") {
744
+ } else if (scrollToEventName === "once" || !scrollToEventName) {
745
+ if (taskParam.direction === "down" || !taskParam.direction) {
746
746
  await this.page.scrollDown(
747
747
  taskParam.distance || void 0,
748
748
  startingPoint
@@ -738,8 +738,8 @@ var PageTaskExecutor = class {
738
738
  await this.page.scrollUntilRight(startingPoint);
739
739
  } else if (scrollToEventName === "untilLeft") {
740
740
  await this.page.scrollUntilLeft(startingPoint);
741
- } else if (scrollToEventName === "once") {
742
- if (taskParam.direction === "down") {
741
+ } else if (scrollToEventName === "once" || !scrollToEventName) {
742
+ if (taskParam.direction === "down" || !taskParam.direction) {
743
743
  await this.page.scrollDown(
744
744
  taskParam.distance || void 0,
745
745
  startingPoint
@@ -44,7 +44,7 @@ function paramStr(task) {
44
44
  } else if (scrollType) {
45
45
  const scrollDirection = (_h = task == null ? void 0 : task.param) == null ? void 0 : _h.direction;
46
46
  const scrollDistance = (_i = task == null ? void 0 : task.param) == null ? void 0 : _i.distance;
47
- value = `${scrollDirection}, ${scrollType}, ${scrollDistance || "distance-not-set"}`;
47
+ value = `${scrollDirection || "down"}, ${scrollType || "once"}, ${scrollDistance || "distance-not-set"}`;
48
48
  } else {
49
49
  value = ((_j = task == null ? void 0 : task.param) == null ? void 0 : _j.value) || ((_k = task == null ? void 0 : task.param) == null ? void 0 : _k.scrollType);
50
50
  }
package/dist/lib/yaml.js CHANGED
@@ -63,7 +63,7 @@ function paramStr(task) {
63
63
  } else if (scrollType) {
64
64
  const scrollDirection = (_h = task == null ? void 0 : task.param) == null ? void 0 : _h.direction;
65
65
  const scrollDistance = (_i = task == null ? void 0 : task.param) == null ? void 0 : _i.distance;
66
- value = `${scrollDirection}, ${scrollType}, ${scrollDistance || "distance-not-set"}`;
66
+ value = `${scrollDirection || "down"}, ${scrollType || "once"}, ${scrollDistance || "distance-not-set"}`;
67
67
  } else {
68
68
  value = ((_j = task == null ? void 0 : task.param) == null ? void 0 : _j.value) || ((_k = task == null ? void 0 : task.param) == null ? void 0 : _k.scrollType);
69
69
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@midscene/web",
3
3
  "description": "An AI-powered automation SDK can control the page, perform assertions, and extract data in JSON format using natural language. See https://midscenejs.com/ for details.",
4
- "version": "0.8.14",
4
+ "version": "0.8.16",
5
5
  "repository": "https://github.com/web-infra-dev/midscene",
6
6
  "homepage": "https://midscenejs.com/",
7
7
  "jsnext:source": "./src/index.ts",
@@ -76,8 +76,8 @@
76
76
  "express": "4.21.1",
77
77
  "inquirer": "10.1.5",
78
78
  "openai": "4.57.1",
79
- "@midscene/shared": "0.8.14",
80
- "@midscene/core": "0.8.14"
79
+ "@midscene/core": "0.8.16",
80
+ "@midscene/shared": "0.8.16"
81
81
  },
82
82
  "devDependencies": {
83
83
  "@types/js-yaml": "4.0.9",