@midscene/visualizer 1.0.2 → 1.0.3-beta-20251223004639.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.
|
@@ -248,13 +248,14 @@ function usePlaygroundExecution(playgroundSDK, storage, actionSpace, loading, se
|
|
|
248
248
|
const handleStop = useCallback(()=>_async_to_generator(function*() {
|
|
249
249
|
const thisRunningId = currentRunningIdRef.current;
|
|
250
250
|
if (thisRunningId && playgroundSDK && playgroundSDK.cancelExecution) try {
|
|
251
|
+
const cancelResult = yield playgroundSDK.cancelExecution(thisRunningId.toString());
|
|
251
252
|
let executionData = null;
|
|
252
|
-
if (
|
|
253
|
+
if (cancelResult) executionData = cancelResult;
|
|
254
|
+
else if (playgroundSDK.getCurrentExecutionData) try {
|
|
253
255
|
executionData = yield playgroundSDK.getCurrentExecutionData();
|
|
254
256
|
} catch (error) {
|
|
255
257
|
console.error('Failed to get execution data before stop:', error);
|
|
256
258
|
}
|
|
257
|
-
yield playgroundSDK.cancelExecution(thisRunningId.toString());
|
|
258
259
|
interruptedFlagRef.current[thisRunningId] = true;
|
|
259
260
|
setLoading(false);
|
|
260
261
|
if (playgroundSDK.onProgressUpdate) playgroundSDK.onProgressUpdate(()=>{});
|
|
@@ -276,13 +276,14 @@ function usePlaygroundExecution(playgroundSDK, storage, actionSpace, loading, se
|
|
|
276
276
|
const handleStop = (0, external_react_namespaceObject.useCallback)(()=>_async_to_generator(function*() {
|
|
277
277
|
const thisRunningId = currentRunningIdRef.current;
|
|
278
278
|
if (thisRunningId && playgroundSDK && playgroundSDK.cancelExecution) try {
|
|
279
|
+
const cancelResult = yield playgroundSDK.cancelExecution(thisRunningId.toString());
|
|
279
280
|
let executionData = null;
|
|
280
|
-
if (
|
|
281
|
+
if (cancelResult) executionData = cancelResult;
|
|
282
|
+
else if (playgroundSDK.getCurrentExecutionData) try {
|
|
281
283
|
executionData = yield playgroundSDK.getCurrentExecutionData();
|
|
282
284
|
} catch (error) {
|
|
283
285
|
console.error('Failed to get execution data before stop:', error);
|
|
284
286
|
}
|
|
285
|
-
yield playgroundSDK.cancelExecution(thisRunningId.toString());
|
|
286
287
|
interruptedFlagRef.current[thisRunningId] = true;
|
|
287
288
|
setLoading(false);
|
|
288
289
|
if (playgroundSDK.onProgressUpdate) playgroundSDK.onProgressUpdate(()=>{});
|
package/dist/types/types.d.ts
CHANGED
|
@@ -110,7 +110,10 @@ export interface PlaygroundSDKLike {
|
|
|
110
110
|
getActionSpace(context?: any): Promise<DeviceAction<unknown>[]>;
|
|
111
111
|
onProgressUpdate?: (callback: ProgressCallback) => void;
|
|
112
112
|
onDumpUpdate?: (callback: (dump: string, executionDump?: ExecutionDump) => void) => void;
|
|
113
|
-
cancelExecution?(requestId: string): Promise<
|
|
113
|
+
cancelExecution?(requestId: string): Promise<{
|
|
114
|
+
dump: ExecutionDump | null;
|
|
115
|
+
reportHTML: string | null;
|
|
116
|
+
} | null>;
|
|
114
117
|
getCurrentExecutionData?(): Promise<{
|
|
115
118
|
dump: ExecutionDump | null;
|
|
116
119
|
reportHTML: string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/visualizer",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3-beta-20251223004639.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",
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"antd": "^5.21.6",
|
|
61
61
|
"buffer": "6.0.3",
|
|
62
62
|
"dayjs": "^1.11.11",
|
|
63
|
-
"@midscene/
|
|
64
|
-
"@midscene/shared": "1.0.
|
|
65
|
-
"@midscene/
|
|
66
|
-
"@midscene/web": "1.0.
|
|
63
|
+
"@midscene/core": "1.0.3-beta-20251223004639.0",
|
|
64
|
+
"@midscene/shared": "1.0.3-beta-20251223004639.0",
|
|
65
|
+
"@midscene/playground": "1.0.3-beta-20251223004639.0",
|
|
66
|
+
"@midscene/web": "1.0.3-beta-20251223004639.0"
|
|
67
67
|
},
|
|
68
68
|
"license": "MIT",
|
|
69
69
|
"scripts": {
|