@midscene/visualizer 1.0.1-beta-20251104101357.0 → 1.0.1-beta-20251107042357.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.
|
@@ -557,6 +557,8 @@ function Player(props) {
|
|
|
557
557
|
}
|
|
558
558
|
})().catch((e)=>{
|
|
559
559
|
console.error('player error', e);
|
|
560
|
+
if ((null == e ? void 0 : e.message) === ERROR_FRAME_CANCEL) return void console.log('Animation cancelled (expected behavior)');
|
|
561
|
+
const wasRecording = !!recorderSessionRef.current;
|
|
560
562
|
if (recorderSessionRef.current) {
|
|
561
563
|
try {
|
|
562
564
|
recorderSessionRef.current.stop();
|
|
@@ -566,7 +568,7 @@ function Player(props) {
|
|
|
566
568
|
recorderSessionRef.current = null;
|
|
567
569
|
}
|
|
568
570
|
setIsRecording(false);
|
|
569
|
-
message.error('Failed to export video. Please try again.');
|
|
571
|
+
if (wasRecording) message.error('Failed to export video. Please try again.');
|
|
570
572
|
}));
|
|
571
573
|
return ()=>{
|
|
572
574
|
null == cancelFn || cancelFn();
|
|
@@ -144,22 +144,7 @@ const generateAnimationScripts = (execution, task, imageWidth, imageHeight)=>{
|
|
|
144
144
|
tasksIncluded.forEach((task, index)=>{
|
|
145
145
|
if (errorStateFlag) return;
|
|
146
146
|
if (0 === index) initSubTitle = paramStr(task);
|
|
147
|
-
if ('Planning' === task.type) {
|
|
148
|
-
const planningTask = task;
|
|
149
|
-
if (planningTask.recorder && planningTask.recorder.length > 0) {
|
|
150
|
-
var _planningTask_recorder_, _planningTask_recorder, _task_uiContext_size, _task_uiContext, _task_uiContext_size1, _task_uiContext1;
|
|
151
|
-
scripts.push({
|
|
152
|
-
type: 'img',
|
|
153
|
-
img: null == (_planningTask_recorder = planningTask.recorder) ? void 0 : null == (_planningTask_recorder_ = _planningTask_recorder[0]) ? void 0 : _planningTask_recorder_.screenshot,
|
|
154
|
-
camera: 0 === index ? fullPageCameraState : void 0,
|
|
155
|
-
duration: stillDuration,
|
|
156
|
-
title: typeStr(task),
|
|
157
|
-
subTitle: paramStr(task),
|
|
158
|
-
imageWidth: (null == (_task_uiContext = task.uiContext) ? void 0 : null == (_task_uiContext_size = _task_uiContext.size) ? void 0 : _task_uiContext_size.width) || imageWidth,
|
|
159
|
-
imageHeight: (null == (_task_uiContext1 = task.uiContext) ? void 0 : null == (_task_uiContext_size1 = _task_uiContext1.size) ? void 0 : _task_uiContext_size1.height) || imageHeight
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
} else if ('Planning' === task.type && 'Locate' === task.subType) {
|
|
147
|
+
if ('Planning' === task.type && 'Locate' === task.subType) {
|
|
163
148
|
var _serviceTask_output;
|
|
164
149
|
const serviceTask = task;
|
|
165
150
|
const resultElement = null == (_serviceTask_output = serviceTask.output) ? void 0 : _serviceTask_output.element;
|
|
@@ -211,6 +196,21 @@ const generateAnimationScripts = (execution, task, imageWidth, imageHeight)=>{
|
|
|
211
196
|
});
|
|
212
197
|
insightOnTop = true;
|
|
213
198
|
}
|
|
199
|
+
} else if ('Planning' === task.type) {
|
|
200
|
+
const planningTask = task;
|
|
201
|
+
if (planningTask.recorder && planningTask.recorder.length > 0) {
|
|
202
|
+
var _planningTask_recorder_, _planningTask_recorder, _task_uiContext_size, _task_uiContext, _task_uiContext_size1, _task_uiContext1;
|
|
203
|
+
scripts.push({
|
|
204
|
+
type: 'img',
|
|
205
|
+
img: null == (_planningTask_recorder = planningTask.recorder) ? void 0 : null == (_planningTask_recorder_ = _planningTask_recorder[0]) ? void 0 : _planningTask_recorder_.screenshot,
|
|
206
|
+
camera: 0 === index ? fullPageCameraState : void 0,
|
|
207
|
+
duration: stillDuration,
|
|
208
|
+
title: typeStr(task),
|
|
209
|
+
subTitle: paramStr(task),
|
|
210
|
+
imageWidth: (null == (_task_uiContext = task.uiContext) ? void 0 : null == (_task_uiContext_size = _task_uiContext.size) ? void 0 : _task_uiContext_size.width) || imageWidth,
|
|
211
|
+
imageHeight: (null == (_task_uiContext1 = task.uiContext) ? void 0 : null == (_task_uiContext_size1 = _task_uiContext1.size) ? void 0 : _task_uiContext_size1.height) || imageHeight
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
214
|
} else if ('Action Space' === task.type && 'FalsyConditionStatement' !== task.subType) {
|
|
215
215
|
var _task_recorder_, _task_recorder, _task_uiContext_size2, _task_uiContext2, _task_uiContext_size3, _task_uiContext3, _task_recorder_1, _task_recorder1;
|
|
216
216
|
const title = typeStr(task);
|
|
@@ -597,6 +597,8 @@ function Player(props) {
|
|
|
597
597
|
}
|
|
598
598
|
})().catch((e)=>{
|
|
599
599
|
console.error('player error', e);
|
|
600
|
+
if ((null == e ? void 0 : e.message) === ERROR_FRAME_CANCEL) return void console.log('Animation cancelled (expected behavior)');
|
|
601
|
+
const wasRecording = !!recorderSessionRef.current;
|
|
600
602
|
if (recorderSessionRef.current) {
|
|
601
603
|
try {
|
|
602
604
|
recorderSessionRef.current.stop();
|
|
@@ -606,7 +608,7 @@ function Player(props) {
|
|
|
606
608
|
recorderSessionRef.current = null;
|
|
607
609
|
}
|
|
608
610
|
setIsRecording(false);
|
|
609
|
-
external_antd_namespaceObject.message.error('Failed to export video. Please try again.');
|
|
611
|
+
if (wasRecording) external_antd_namespaceObject.message.error('Failed to export video. Please try again.');
|
|
610
612
|
}));
|
|
611
613
|
return ()=>{
|
|
612
614
|
null == cancelFn || cancelFn();
|
|
@@ -175,22 +175,7 @@ const generateAnimationScripts = (execution, task, imageWidth, imageHeight)=>{
|
|
|
175
175
|
tasksIncluded.forEach((task, index)=>{
|
|
176
176
|
if (errorStateFlag) return;
|
|
177
177
|
if (0 === index) initSubTitle = (0, agent_namespaceObject.paramStr)(task);
|
|
178
|
-
if ('Planning' === task.type) {
|
|
179
|
-
const planningTask = task;
|
|
180
|
-
if (planningTask.recorder && planningTask.recorder.length > 0) {
|
|
181
|
-
var _planningTask_recorder_, _planningTask_recorder, _task_uiContext_size, _task_uiContext, _task_uiContext_size1, _task_uiContext1;
|
|
182
|
-
scripts.push({
|
|
183
|
-
type: 'img',
|
|
184
|
-
img: null == (_planningTask_recorder = planningTask.recorder) ? void 0 : null == (_planningTask_recorder_ = _planningTask_recorder[0]) ? void 0 : _planningTask_recorder_.screenshot,
|
|
185
|
-
camera: 0 === index ? fullPageCameraState : void 0,
|
|
186
|
-
duration: stillDuration,
|
|
187
|
-
title: (0, agent_namespaceObject.typeStr)(task),
|
|
188
|
-
subTitle: (0, agent_namespaceObject.paramStr)(task),
|
|
189
|
-
imageWidth: (null == (_task_uiContext = task.uiContext) ? void 0 : null == (_task_uiContext_size = _task_uiContext.size) ? void 0 : _task_uiContext_size.width) || imageWidth,
|
|
190
|
-
imageHeight: (null == (_task_uiContext1 = task.uiContext) ? void 0 : null == (_task_uiContext_size1 = _task_uiContext1.size) ? void 0 : _task_uiContext_size1.height) || imageHeight
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
} else if ('Planning' === task.type && 'Locate' === task.subType) {
|
|
178
|
+
if ('Planning' === task.type && 'Locate' === task.subType) {
|
|
194
179
|
var _serviceTask_output;
|
|
195
180
|
const serviceTask = task;
|
|
196
181
|
const resultElement = null == (_serviceTask_output = serviceTask.output) ? void 0 : _serviceTask_output.element;
|
|
@@ -242,6 +227,21 @@ const generateAnimationScripts = (execution, task, imageWidth, imageHeight)=>{
|
|
|
242
227
|
});
|
|
243
228
|
insightOnTop = true;
|
|
244
229
|
}
|
|
230
|
+
} else if ('Planning' === task.type) {
|
|
231
|
+
const planningTask = task;
|
|
232
|
+
if (planningTask.recorder && planningTask.recorder.length > 0) {
|
|
233
|
+
var _planningTask_recorder_, _planningTask_recorder, _task_uiContext_size, _task_uiContext, _task_uiContext_size1, _task_uiContext1;
|
|
234
|
+
scripts.push({
|
|
235
|
+
type: 'img',
|
|
236
|
+
img: null == (_planningTask_recorder = planningTask.recorder) ? void 0 : null == (_planningTask_recorder_ = _planningTask_recorder[0]) ? void 0 : _planningTask_recorder_.screenshot,
|
|
237
|
+
camera: 0 === index ? fullPageCameraState : void 0,
|
|
238
|
+
duration: stillDuration,
|
|
239
|
+
title: (0, agent_namespaceObject.typeStr)(task),
|
|
240
|
+
subTitle: (0, agent_namespaceObject.paramStr)(task),
|
|
241
|
+
imageWidth: (null == (_task_uiContext = task.uiContext) ? void 0 : null == (_task_uiContext_size = _task_uiContext.size) ? void 0 : _task_uiContext_size.width) || imageWidth,
|
|
242
|
+
imageHeight: (null == (_task_uiContext1 = task.uiContext) ? void 0 : null == (_task_uiContext_size1 = _task_uiContext1.size) ? void 0 : _task_uiContext_size1.height) || imageHeight
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
245
|
} else if ('Action Space' === task.type && 'FalsyConditionStatement' !== task.subType) {
|
|
246
246
|
var _task_recorder_, _task_recorder, _task_uiContext_size2, _task_uiContext2, _task_uiContext_size3, _task_uiContext3, _task_recorder_1, _task_recorder1;
|
|
247
247
|
const title = (0, agent_namespaceObject.typeStr)(task);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/visualizer",
|
|
3
|
-
"version": "1.0.1-beta-
|
|
3
|
+
"version": "1.0.1-beta-20251107042357.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/
|
|
65
|
-
"@midscene/
|
|
66
|
-
"@midscene/
|
|
63
|
+
"@midscene/shared": "1.0.1-beta-20251107042357.0",
|
|
64
|
+
"@midscene/web": "1.0.1-beta-20251107042357.0",
|
|
65
|
+
"@midscene/core": "1.0.1-beta-20251107042357.0",
|
|
66
|
+
"@midscene/playground": "1.0.1-beta-20251107042357.0"
|
|
67
67
|
},
|
|
68
68
|
"license": "MIT",
|
|
69
69
|
"scripts": {
|