@midscene/visualizer 1.5.7 → 1.5.8-beta-20260324073120.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/component/config-selector/index.mjs +8 -6
- package/dist/es/component/playground/index.css +20 -0
- package/dist/es/component/playground-result/index.css +20 -0
- package/dist/es/component/prompt-input/index.mjs +2 -1
- package/dist/es/utils/device-capabilities.mjs +13 -0
- package/dist/lib/component/config-selector/index.js +8 -6
- package/dist/lib/component/playground/index.css +20 -0
- package/dist/lib/component/playground-result/index.css +20 -0
- package/dist/lib/component/prompt-input/index.js +2 -1
- package/dist/lib/utils/device-capabilities.js +50 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types.d.ts +10 -2
- package/dist/types/utils/device-capabilities.d.ts +9 -0
- package/package.json +5 -5
|
@@ -3,6 +3,7 @@ import { Checkbox, Dropdown, Radio, Tooltip } from "antd";
|
|
|
3
3
|
import setting from "../../icons/setting.mjs";
|
|
4
4
|
import { useEnvConfig } from "../../store/store.mjs";
|
|
5
5
|
import { alwaysRefreshScreenInfoTip, autoDismissKeyboardTip, deepLocateTip, deepThinkTip, domIncludedTip, imeStrategyTip, keyboardDismissStrategyTip, screenshotIncludedTip, trackingTip } from "../../utils/constants.mjs";
|
|
6
|
+
import { getDeviceCapabilities, hasDeviceSpecificConfig } from "../../utils/device-capabilities.mjs";
|
|
6
7
|
const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = false, enableTracking = false, showDataExtractionOptions = false, hideDomAndScreenshotOptions = false, deviceType })=>{
|
|
7
8
|
const forceSameTabNavigation = useEnvConfig((state)=>state.forceSameTabNavigation);
|
|
8
9
|
const setForceSameTabNavigation = useEnvConfig((state)=>state.setForceSameTabNavigation);
|
|
@@ -22,7 +23,8 @@ const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = fa
|
|
|
22
23
|
const setKeyboardDismissStrategy = useEnvConfig((state)=>state.setKeyboardDismissStrategy);
|
|
23
24
|
const alwaysRefreshScreenInfo = useEnvConfig((state)=>state.alwaysRefreshScreenInfo);
|
|
24
25
|
const setAlwaysRefreshScreenInfo = useEnvConfig((state)=>state.setAlwaysRefreshScreenInfo);
|
|
25
|
-
const
|
|
26
|
+
const deviceCapabilities = getDeviceCapabilities(deviceType);
|
|
27
|
+
const hasDeviceOptions = hasDeviceSpecificConfig(deviceType);
|
|
26
28
|
if (!enableTracking && !showDeepLocateOption && !showDeepThinkOption && !showDataExtractionOptions && !hasDeviceOptions) return null;
|
|
27
29
|
const configItems = buildConfigItems();
|
|
28
30
|
return /*#__PURE__*/ jsx("div", {
|
|
@@ -147,7 +149,7 @@ const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = fa
|
|
|
147
149
|
key: 'dom-included-config'
|
|
148
150
|
});
|
|
149
151
|
}
|
|
150
|
-
if (
|
|
152
|
+
if (deviceCapabilities.supportsImeStrategy) {
|
|
151
153
|
items.push({
|
|
152
154
|
label: /*#__PURE__*/ jsxs("div", {
|
|
153
155
|
style: {
|
|
@@ -180,7 +182,7 @@ const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = fa
|
|
|
180
182
|
}),
|
|
181
183
|
key: 'ime-strategy-config'
|
|
182
184
|
});
|
|
183
|
-
items.push({
|
|
185
|
+
if (deviceCapabilities.supportsAutoDismissKeyboard) items.push({
|
|
184
186
|
label: /*#__PURE__*/ jsx(Checkbox, {
|
|
185
187
|
onChange: (e)=>setAutoDismissKeyboard(e.target.checked),
|
|
186
188
|
checked: autoDismissKeyboard,
|
|
@@ -188,7 +190,7 @@ const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = fa
|
|
|
188
190
|
}),
|
|
189
191
|
key: 'auto-dismiss-keyboard-config'
|
|
190
192
|
});
|
|
191
|
-
items.push({
|
|
193
|
+
if (deviceCapabilities.supportsKeyboardDismissStrategy) items.push({
|
|
192
194
|
label: /*#__PURE__*/ jsxs("div", {
|
|
193
195
|
style: {
|
|
194
196
|
padding: '4px 0'
|
|
@@ -220,7 +222,7 @@ const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = fa
|
|
|
220
222
|
}),
|
|
221
223
|
key: 'keyboard-dismiss-strategy-config'
|
|
222
224
|
});
|
|
223
|
-
items.push({
|
|
225
|
+
if (deviceCapabilities.supportsAlwaysRefreshScreenInfo) items.push({
|
|
224
226
|
label: /*#__PURE__*/ jsx(Checkbox, {
|
|
225
227
|
onChange: (e)=>setAlwaysRefreshScreenInfo(e.target.checked),
|
|
226
228
|
checked: alwaysRefreshScreenInfo,
|
|
@@ -229,7 +231,7 @@ const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = fa
|
|
|
229
231
|
key: 'always-refresh-screen-info-config'
|
|
230
232
|
});
|
|
231
233
|
}
|
|
232
|
-
if (
|
|
234
|
+
if (!deviceCapabilities.supportsImeStrategy && deviceCapabilities.supportsAutoDismissKeyboard) items.push({
|
|
233
235
|
label: /*#__PURE__*/ jsx(Checkbox, {
|
|
234
236
|
onChange: (e)=>setAutoDismissKeyboard(e.target.checked),
|
|
235
237
|
checked: autoDismissKeyboard,
|
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
.result-wrapper {
|
|
2
2
|
justify-content: center;
|
|
3
|
+
align-items: flex-start;
|
|
3
4
|
height: 100%;
|
|
4
5
|
margin: 4px 0;
|
|
5
6
|
display: flex;
|
|
6
7
|
}
|
|
7
8
|
|
|
9
|
+
.result-wrapper .player-container {
|
|
10
|
+
width: 100%;
|
|
11
|
+
max-width: 500px;
|
|
12
|
+
height: auto;
|
|
13
|
+
min-height: 0;
|
|
14
|
+
max-height: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.result-wrapper .player-container .canvas-container {
|
|
18
|
+
height: 60vh;
|
|
19
|
+
min-height: 0;
|
|
20
|
+
max-height: 60vh;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.result-wrapper .player-container .player-wrapper {
|
|
24
|
+
max-width: 100%;
|
|
25
|
+
max-height: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
8
28
|
.result-wrapper .loading-container {
|
|
9
29
|
flex-direction: column;
|
|
10
30
|
justify-content: center;
|
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
.result-wrapper {
|
|
2
2
|
justify-content: center;
|
|
3
|
+
align-items: flex-start;
|
|
3
4
|
height: 100%;
|
|
4
5
|
margin: 4px 0;
|
|
5
6
|
display: flex;
|
|
6
7
|
}
|
|
7
8
|
|
|
9
|
+
.result-wrapper .player-container {
|
|
10
|
+
width: 100%;
|
|
11
|
+
max-width: 500px;
|
|
12
|
+
height: auto;
|
|
13
|
+
min-height: 0;
|
|
14
|
+
max-height: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.result-wrapper .player-container .canvas-container {
|
|
18
|
+
height: 60vh;
|
|
19
|
+
min-height: 0;
|
|
20
|
+
max-height: 60vh;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.result-wrapper .player-container .player-wrapper {
|
|
24
|
+
max-width: 100%;
|
|
25
|
+
max-height: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
8
28
|
.result-wrapper .loading-container {
|
|
9
29
|
flex-direction: column;
|
|
10
30
|
justify-content: center;
|
|
@@ -6,6 +6,7 @@ import react, { useCallback, useEffect, useMemo, useRef, useState } from "react"
|
|
|
6
6
|
import { useHistoryStore } from "../../store/history.mjs";
|
|
7
7
|
import { extractDefaultValue, isLocateField, isZodObjectSchema, unwrapZodType } from "../../types.mjs";
|
|
8
8
|
import { apiMetadata, defaultMainButtons } from "../../utils/constants.mjs";
|
|
9
|
+
import { hasDeviceSpecificConfig } from "../../utils/device-capabilities.mjs";
|
|
9
10
|
import { actionNameForType, getPlaceholderForType, isRunButtonEnabled as playground_utils_mjs_isRunButtonEnabled } from "../../utils/playground-utils.mjs";
|
|
10
11
|
import { ConfigSelector } from "../config-selector/index.mjs";
|
|
11
12
|
import { BooleanField, EnumField, LocateField, NumberField, TextField } from "../form-field/index.mjs";
|
|
@@ -130,7 +131,7 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
|
|
|
130
131
|
const hasDeepLocate = showDeepLocateOption;
|
|
131
132
|
const hasDeepThink = showDeepThinkOption;
|
|
132
133
|
const hasDataExtraction = showDataExtractionOptions && !hideDomAndScreenshotOptions;
|
|
133
|
-
const hasDeviceOptions =
|
|
134
|
+
const hasDeviceOptions = hasDeviceSpecificConfig(deviceType);
|
|
134
135
|
return hasTracking || hasDeepLocate || hasDeepThink || hasDataExtraction || hasDeviceOptions;
|
|
135
136
|
}, [
|
|
136
137
|
serviceMode,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function getDeviceCapabilities(deviceType) {
|
|
2
|
+
return {
|
|
3
|
+
supportsImeStrategy: 'android' === deviceType,
|
|
4
|
+
supportsKeyboardDismissStrategy: 'android' === deviceType,
|
|
5
|
+
supportsAutoDismissKeyboard: 'android' === deviceType || 'ios' === deviceType || 'harmony' === deviceType,
|
|
6
|
+
supportsAlwaysRefreshScreenInfo: 'android' === deviceType
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
function hasDeviceSpecificConfig(deviceType) {
|
|
10
|
+
const capabilities = getDeviceCapabilities(deviceType);
|
|
11
|
+
return Object.values(capabilities).some(Boolean);
|
|
12
|
+
}
|
|
13
|
+
export { getDeviceCapabilities, hasDeviceSpecificConfig };
|
|
@@ -41,6 +41,7 @@ const setting_js_namespaceObject = require("../../icons/setting.js");
|
|
|
41
41
|
var setting_js_default = /*#__PURE__*/ __webpack_require__.n(setting_js_namespaceObject);
|
|
42
42
|
const store_js_namespaceObject = require("../../store/store.js");
|
|
43
43
|
const constants_js_namespaceObject = require("../../utils/constants.js");
|
|
44
|
+
const device_capabilities_js_namespaceObject = require("../../utils/device-capabilities.js");
|
|
44
45
|
const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = false, enableTracking = false, showDataExtractionOptions = false, hideDomAndScreenshotOptions = false, deviceType })=>{
|
|
45
46
|
const forceSameTabNavigation = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.forceSameTabNavigation);
|
|
46
47
|
const setForceSameTabNavigation = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.setForceSameTabNavigation);
|
|
@@ -60,7 +61,8 @@ const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = fa
|
|
|
60
61
|
const setKeyboardDismissStrategy = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.setKeyboardDismissStrategy);
|
|
61
62
|
const alwaysRefreshScreenInfo = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.alwaysRefreshScreenInfo);
|
|
62
63
|
const setAlwaysRefreshScreenInfo = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.setAlwaysRefreshScreenInfo);
|
|
63
|
-
const
|
|
64
|
+
const deviceCapabilities = (0, device_capabilities_js_namespaceObject.getDeviceCapabilities)(deviceType);
|
|
65
|
+
const hasDeviceOptions = (0, device_capabilities_js_namespaceObject.hasDeviceSpecificConfig)(deviceType);
|
|
64
66
|
if (!enableTracking && !showDeepLocateOption && !showDeepThinkOption && !showDataExtractionOptions && !hasDeviceOptions) return null;
|
|
65
67
|
const configItems = buildConfigItems();
|
|
66
68
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
@@ -185,7 +187,7 @@ const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = fa
|
|
|
185
187
|
key: 'dom-included-config'
|
|
186
188
|
});
|
|
187
189
|
}
|
|
188
|
-
if (
|
|
190
|
+
if (deviceCapabilities.supportsImeStrategy) {
|
|
189
191
|
items.push({
|
|
190
192
|
label: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
191
193
|
style: {
|
|
@@ -218,7 +220,7 @@ const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = fa
|
|
|
218
220
|
}),
|
|
219
221
|
key: 'ime-strategy-config'
|
|
220
222
|
});
|
|
221
|
-
items.push({
|
|
223
|
+
if (deviceCapabilities.supportsAutoDismissKeyboard) items.push({
|
|
222
224
|
label: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Checkbox, {
|
|
223
225
|
onChange: (e)=>setAutoDismissKeyboard(e.target.checked),
|
|
224
226
|
checked: autoDismissKeyboard,
|
|
@@ -226,7 +228,7 @@ const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = fa
|
|
|
226
228
|
}),
|
|
227
229
|
key: 'auto-dismiss-keyboard-config'
|
|
228
230
|
});
|
|
229
|
-
items.push({
|
|
231
|
+
if (deviceCapabilities.supportsKeyboardDismissStrategy) items.push({
|
|
230
232
|
label: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
231
233
|
style: {
|
|
232
234
|
padding: '4px 0'
|
|
@@ -258,7 +260,7 @@ const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = fa
|
|
|
258
260
|
}),
|
|
259
261
|
key: 'keyboard-dismiss-strategy-config'
|
|
260
262
|
});
|
|
261
|
-
items.push({
|
|
263
|
+
if (deviceCapabilities.supportsAlwaysRefreshScreenInfo) items.push({
|
|
262
264
|
label: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Checkbox, {
|
|
263
265
|
onChange: (e)=>setAlwaysRefreshScreenInfo(e.target.checked),
|
|
264
266
|
checked: alwaysRefreshScreenInfo,
|
|
@@ -267,7 +269,7 @@ const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = fa
|
|
|
267
269
|
key: 'always-refresh-screen-info-config'
|
|
268
270
|
});
|
|
269
271
|
}
|
|
270
|
-
if (
|
|
272
|
+
if (!deviceCapabilities.supportsImeStrategy && deviceCapabilities.supportsAutoDismissKeyboard) items.push({
|
|
271
273
|
label: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Checkbox, {
|
|
272
274
|
onChange: (e)=>setAutoDismissKeyboard(e.target.checked),
|
|
273
275
|
checked: autoDismissKeyboard,
|
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
.result-wrapper {
|
|
2
2
|
justify-content: center;
|
|
3
|
+
align-items: flex-start;
|
|
3
4
|
height: 100%;
|
|
4
5
|
margin: 4px 0;
|
|
5
6
|
display: flex;
|
|
6
7
|
}
|
|
7
8
|
|
|
9
|
+
.result-wrapper .player-container {
|
|
10
|
+
width: 100%;
|
|
11
|
+
max-width: 500px;
|
|
12
|
+
height: auto;
|
|
13
|
+
min-height: 0;
|
|
14
|
+
max-height: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.result-wrapper .player-container .canvas-container {
|
|
18
|
+
height: 60vh;
|
|
19
|
+
min-height: 0;
|
|
20
|
+
max-height: 60vh;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.result-wrapper .player-container .player-wrapper {
|
|
24
|
+
max-width: 100%;
|
|
25
|
+
max-height: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
8
28
|
.result-wrapper .loading-container {
|
|
9
29
|
flex-direction: column;
|
|
10
30
|
justify-content: center;
|
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
.result-wrapper {
|
|
2
2
|
justify-content: center;
|
|
3
|
+
align-items: flex-start;
|
|
3
4
|
height: 100%;
|
|
4
5
|
margin: 4px 0;
|
|
5
6
|
display: flex;
|
|
6
7
|
}
|
|
7
8
|
|
|
9
|
+
.result-wrapper .player-container {
|
|
10
|
+
width: 100%;
|
|
11
|
+
max-width: 500px;
|
|
12
|
+
height: auto;
|
|
13
|
+
min-height: 0;
|
|
14
|
+
max-height: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.result-wrapper .player-container .canvas-container {
|
|
18
|
+
height: 60vh;
|
|
19
|
+
min-height: 0;
|
|
20
|
+
max-height: 60vh;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.result-wrapper .player-container .player-wrapper {
|
|
24
|
+
max-width: 100%;
|
|
25
|
+
max-height: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
8
28
|
.result-wrapper .loading-container {
|
|
9
29
|
flex-direction: column;
|
|
10
30
|
justify-content: center;
|
|
@@ -44,6 +44,7 @@ var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_
|
|
|
44
44
|
const history_js_namespaceObject = require("../../store/history.js");
|
|
45
45
|
const external_types_js_namespaceObject = require("../../types.js");
|
|
46
46
|
const constants_js_namespaceObject = require("../../utils/constants.js");
|
|
47
|
+
const device_capabilities_js_namespaceObject = require("../../utils/device-capabilities.js");
|
|
47
48
|
const playground_utils_js_namespaceObject = require("../../utils/playground-utils.js");
|
|
48
49
|
const index_js_namespaceObject = require("../config-selector/index.js");
|
|
49
50
|
const external_form_field_index_js_namespaceObject = require("../form-field/index.js");
|
|
@@ -168,7 +169,7 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
|
|
|
168
169
|
const hasDeepLocate = showDeepLocateOption;
|
|
169
170
|
const hasDeepThink = showDeepThinkOption;
|
|
170
171
|
const hasDataExtraction = showDataExtractionOptions && !hideDomAndScreenshotOptions;
|
|
171
|
-
const hasDeviceOptions =
|
|
172
|
+
const hasDeviceOptions = (0, device_capabilities_js_namespaceObject.hasDeviceSpecificConfig)(deviceType);
|
|
172
173
|
return hasTracking || hasDeepLocate || hasDeepThink || hasDataExtraction || hasDeviceOptions;
|
|
173
174
|
}, [
|
|
174
175
|
serviceMode,
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
getDeviceCapabilities: ()=>getDeviceCapabilities,
|
|
28
|
+
hasDeviceSpecificConfig: ()=>hasDeviceSpecificConfig
|
|
29
|
+
});
|
|
30
|
+
function getDeviceCapabilities(deviceType) {
|
|
31
|
+
return {
|
|
32
|
+
supportsImeStrategy: 'android' === deviceType,
|
|
33
|
+
supportsKeyboardDismissStrategy: 'android' === deviceType,
|
|
34
|
+
supportsAutoDismissKeyboard: 'android' === deviceType || 'ios' === deviceType || 'harmony' === deviceType,
|
|
35
|
+
supportsAlwaysRefreshScreenInfo: 'android' === deviceType
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function hasDeviceSpecificConfig(deviceType) {
|
|
39
|
+
const capabilities = getDeviceCapabilities(deviceType);
|
|
40
|
+
return Object.values(capabilities).some(Boolean);
|
|
41
|
+
}
|
|
42
|
+
exports.getDeviceCapabilities = __webpack_exports__.getDeviceCapabilities;
|
|
43
|
+
exports.hasDeviceSpecificConfig = __webpack_exports__.hasDeviceSpecificConfig;
|
|
44
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
45
|
+
"getDeviceCapabilities",
|
|
46
|
+
"hasDeviceSpecificConfig"
|
|
47
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
48
|
+
Object.defineProperty(exports, '__esModule', {
|
|
49
|
+
value: true
|
|
50
|
+
});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -22,6 +22,6 @@ export { actionNameForType, staticAgentFromContext, getPlaceholderForType, } fro
|
|
|
22
22
|
export { timeStr, filterBase64Value } from './utils';
|
|
23
23
|
export { default as ShinyText } from './component/shiny-text';
|
|
24
24
|
export { UniversalPlayground, default as UniversalPlaygroundDefault, } from './component/universal-playground';
|
|
25
|
-
export type { UniversalPlaygroundProps, PlaygroundSDKLike, StorageProvider, ContextProvider, UniversalPlaygroundConfig, PlaygroundBranding, InfoListItem, FormValue, ExecutionOptions, ProgressCallback, } from './types';
|
|
25
|
+
export type { UniversalPlaygroundProps, PlaygroundSDKLike, StorageProvider, ContextProvider, UniversalPlaygroundConfig, PlaygroundBranding, InfoListItem, FormValue, ExecutionOptions, ProgressCallback, DeviceType, ExecutionUxHint, ExecutionUxConfig, } from './types';
|
|
26
26
|
export { LocalStorageProvider, MemoryStorageProvider, NoOpStorageProvider, IndexedDBStorageProvider, createStorageProvider, detectBestStorageType, StorageType, } from './component/universal-playground/providers/storage-provider';
|
|
27
27
|
export { BaseContextProvider, AgentContextProvider, StaticContextProvider, NoOpContextProvider, } from './component/universal-playground/providers/context-provider';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ export declare const unwrapZodType: (field: ZodType) => {
|
|
|
72
72
|
};
|
|
73
73
|
export declare const extractDefaultValue: (field: ZodType) => unknown;
|
|
74
74
|
import type { ExecutionDump, IExecutionDump } from '@midscene/core';
|
|
75
|
-
import type { ExecutionOptions, PlaygroundAgent } from '@midscene/playground';
|
|
75
|
+
import type { BeforeActionHook, ExecutionOptions, PlaygroundAgent, PlaygroundRuntimeInfo } from '@midscene/playground';
|
|
76
76
|
export interface PlaygroundResult {
|
|
77
77
|
result: any;
|
|
78
78
|
dump?: ExecutionDump | IExecutionDump | null;
|
|
@@ -89,7 +89,8 @@ export interface StaticPlaygroundProps {
|
|
|
89
89
|
context: UIContext | null;
|
|
90
90
|
}
|
|
91
91
|
export type ServiceModeType = 'Server' | 'In-Browser' | 'In-Browser-Extension';
|
|
92
|
-
export type DeviceType = 'web' | 'android' | 'ios';
|
|
92
|
+
export type DeviceType = 'web' | 'android' | 'ios' | 'harmony' | 'computer';
|
|
93
|
+
export type ExecutionUxHint = 'countdown-before-run';
|
|
93
94
|
export type RunType = 'aiAct' | 'aiQuery' | 'aiAssert' | 'aiTap' | 'aiDoubleClick' | 'aiHover' | 'aiInput' | 'aiRightClick' | 'aiKeyboardPress' | 'aiScroll' | 'aiLocate' | 'aiBoolean' | 'aiNumber' | 'aiString' | 'aiAsk' | 'aiWaitFor';
|
|
94
95
|
export interface ReplayScriptsInfo {
|
|
95
96
|
scripts: any[];
|
|
@@ -121,8 +122,14 @@ export interface PlaygroundSDKLike {
|
|
|
121
122
|
overrideConfig?(config: any): Promise<void>;
|
|
122
123
|
checkStatus?(): Promise<boolean>;
|
|
123
124
|
getServiceMode?(): 'In-Browser-Extension' | 'Server';
|
|
125
|
+
getRuntimeInfo?(): Promise<PlaygroundRuntimeInfo | null>;
|
|
126
|
+
setBeforeActionHook?(hook?: BeforeActionHook): void;
|
|
124
127
|
id?: string;
|
|
125
128
|
}
|
|
129
|
+
export interface ExecutionUxConfig {
|
|
130
|
+
hints?: ExecutionUxHint[];
|
|
131
|
+
countdownSeconds?: number;
|
|
132
|
+
}
|
|
126
133
|
export interface StorageProvider {
|
|
127
134
|
saveMessages?(messages: InfoListItem[]): Promise<void>;
|
|
128
135
|
loadMessages?(): Promise<InfoListItem[]>;
|
|
@@ -155,6 +162,7 @@ export interface UniversalPlaygroundConfig {
|
|
|
155
162
|
serverMode?: boolean;
|
|
156
163
|
showEnvConfigReminder?: boolean;
|
|
157
164
|
deviceType?: DeviceType;
|
|
165
|
+
executionUx?: ExecutionUxConfig;
|
|
158
166
|
}
|
|
159
167
|
export interface PlaygroundBranding {
|
|
160
168
|
title?: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DeviceType } from '../types';
|
|
2
|
+
export interface DeviceCapabilities {
|
|
3
|
+
supportsImeStrategy: boolean;
|
|
4
|
+
supportsKeyboardDismissStrategy: boolean;
|
|
5
|
+
supportsAutoDismissKeyboard: boolean;
|
|
6
|
+
supportsAlwaysRefreshScreenInfo: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function getDeviceCapabilities(deviceType?: DeviceType): DeviceCapabilities;
|
|
9
|
+
export declare function hasDeviceSpecificConfig(deviceType?: DeviceType): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/visualizer",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.8-beta-20260324073120.0",
|
|
4
4
|
"repository": "https://github.com/web-infra-dev/midscene",
|
|
5
5
|
"homepage": "https://midscenejs.com/",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
"antd": "^5.21.6",
|
|
59
59
|
"buffer": "6.0.3",
|
|
60
60
|
"dayjs": "^1.11.11",
|
|
61
|
-
"@midscene/core": "1.5.
|
|
62
|
-
"@midscene/
|
|
63
|
-
"@midscene/
|
|
64
|
-
"@midscene/
|
|
61
|
+
"@midscene/core": "1.5.8-beta-20260324073120.0",
|
|
62
|
+
"@midscene/shared": "1.5.8-beta-20260324073120.0",
|
|
63
|
+
"@midscene/web": "1.5.8-beta-20260324073120.0",
|
|
64
|
+
"@midscene/playground": "1.5.8-beta-20260324073120.0"
|
|
65
65
|
},
|
|
66
66
|
"license": "MIT",
|
|
67
67
|
"scripts": {
|