@midscene/visualizer 0.26.5-beta-20250814080504.0 → 0.26.5-beta-20250814125155.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/player.mjs +138 -4
- package/dist/es/component/playground/PlaygroundResult.mjs +3 -2
- package/dist/es/icons/global-perspective.mjs +16 -0
- package/dist/es/icons/player-setting.mjs +26 -0
- package/dist/lib/component/player.js +147 -3
- package/dist/lib/component/playground/PlaygroundResult.js +3 -2
- package/dist/lib/icons/global-perspective.js +50 -0
- package/dist/lib/icons/player-setting.js +60 -0
- package/dist/types/component/player.d.ts +1 -0
- package/dist/types/component/playground/PlaygroundResult.d.ts +1 -0
- package/package.json +4 -4
|
@@ -7,7 +7,8 @@ import "./player.css";
|
|
|
7
7
|
import { mouseLoading, mousePointer } from "../utils.mjs";
|
|
8
8
|
import { CaretRightOutlined, DownloadOutlined, ExportOutlined, LoadingOutlined } from "@ant-design/icons";
|
|
9
9
|
import { treeToList } from "@midscene/shared/extractor";
|
|
10
|
-
import { Spin, Tooltip } from "antd";
|
|
10
|
+
import { Dropdown, Spin, Switch, Tooltip } from "antd";
|
|
11
|
+
import global_perspective from "../icons/global-perspective.mjs";
|
|
11
12
|
import { rectMarkForItem } from "./blackboard.mjs";
|
|
12
13
|
import { getTextureFromCache, loadTexture } from "./pixi-loader.mjs";
|
|
13
14
|
function _define_property(obj, key, value) {
|
|
@@ -115,6 +116,12 @@ function Player(props) {
|
|
|
115
116
|
var _scripts_;
|
|
116
117
|
const [titleText, setTitleText] = useState('');
|
|
117
118
|
const [subTitleText, setSubTitleText] = useState('');
|
|
119
|
+
const [autoZoom, setAutoZoom] = useState((null == props ? void 0 : props.autoZoom) !== void 0 ? props.autoZoom : true);
|
|
120
|
+
useEffect(()=>{
|
|
121
|
+
if ((null == props ? void 0 : props.autoZoom) !== void 0) setAutoZoom(props.autoZoom);
|
|
122
|
+
}, [
|
|
123
|
+
null == props ? void 0 : props.autoZoom
|
|
124
|
+
]);
|
|
118
125
|
const scripts = null == props ? void 0 : props.replayScripts;
|
|
119
126
|
const imageWidth = (null == props ? void 0 : props.imageWidth) || 1920;
|
|
120
127
|
const imageHeight = (null == props ? void 0 : props.imageHeight) || 1080;
|
|
@@ -232,10 +239,10 @@ function Player(props) {
|
|
|
232
239
|
};
|
|
233
240
|
const updateCamera = (state)=>{
|
|
234
241
|
cameraState.current = state;
|
|
235
|
-
const newScale = Math.max(1, imageWidth / state.width);
|
|
242
|
+
const newScale = autoZoom ? Math.max(1, imageWidth / state.width) : 1;
|
|
236
243
|
windowContentContainer.scale.set(newScale);
|
|
237
|
-
windowContentContainer.x = Math.round(canvasPaddingLeft - state.left * newScale);
|
|
238
|
-
windowContentContainer.y = Math.round(canvasPaddingTop - state.top * newScale);
|
|
244
|
+
windowContentContainer.x = autoZoom ? Math.round(canvasPaddingLeft - state.left * newScale) : canvasPaddingLeft;
|
|
245
|
+
windowContentContainer.y = autoZoom ? Math.round(canvasPaddingTop - state.top * newScale) : canvasPaddingTop;
|
|
239
246
|
const pointer = windowContentContainer.getChildByLabel('pointer');
|
|
240
247
|
if (pointer) {
|
|
241
248
|
pointer.scale.set(1 / newScale);
|
|
@@ -246,6 +253,33 @@ function Player(props) {
|
|
|
246
253
|
}
|
|
247
254
|
};
|
|
248
255
|
const cameraAnimation = async (targetState, duration, frame)=>{
|
|
256
|
+
if (!autoZoom) {
|
|
257
|
+
const currentState = {
|
|
258
|
+
...cameraState.current
|
|
259
|
+
};
|
|
260
|
+
const startPointerLeft = currentState.pointerLeft;
|
|
261
|
+
const startPointerTop = currentState.pointerTop;
|
|
262
|
+
const startTime = performance.now();
|
|
263
|
+
const shouldMovePointer = 'number' == typeof targetState.pointerLeft && 'number' == typeof targetState.pointerTop && (targetState.pointerLeft !== startPointerLeft || targetState.pointerTop !== startPointerTop);
|
|
264
|
+
if (!shouldMovePointer) return;
|
|
265
|
+
await new Promise((resolve)=>{
|
|
266
|
+
const animate = (currentTime)=>{
|
|
267
|
+
const elapsedTime = currentTime - startTime;
|
|
268
|
+
const rawProgress = Math.min(elapsedTime / duration, 1);
|
|
269
|
+
const progress = cubicMouse(rawProgress);
|
|
270
|
+
const nextState = {
|
|
271
|
+
...currentState,
|
|
272
|
+
pointerLeft: startPointerLeft + (targetState.pointerLeft - startPointerLeft) * progress,
|
|
273
|
+
pointerTop: startPointerTop + (targetState.pointerTop - startPointerTop) * progress
|
|
274
|
+
};
|
|
275
|
+
updateCamera(nextState);
|
|
276
|
+
if (elapsedTime < duration) frame(animate);
|
|
277
|
+
else resolve();
|
|
278
|
+
};
|
|
279
|
+
frame(animate);
|
|
280
|
+
});
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
249
283
|
const currentState = {
|
|
250
284
|
...cameraState.current
|
|
251
285
|
};
|
|
@@ -502,6 +536,7 @@ function Player(props) {
|
|
|
502
536
|
replayMark
|
|
503
537
|
]);
|
|
504
538
|
const [mouseOverStatusIcon, setMouseOverStatusIcon] = useState(false);
|
|
539
|
+
const [mouseOverSettingsIcon, setMouseOverSettingsIcon] = useState(false);
|
|
505
540
|
const progressString = Math.round(100 * animationProgress);
|
|
506
541
|
const transitionStyle = 0 === animationProgress ? 'none' : '0.3s';
|
|
507
542
|
const canReplayNow = 1 === animationProgress;
|
|
@@ -617,6 +652,105 @@ function Player(props) {
|
|
|
617
652
|
percent: progressString
|
|
618
653
|
}) : /*#__PURE__*/ jsx(ExportOutlined, {})
|
|
619
654
|
})
|
|
655
|
+
}),
|
|
656
|
+
/*#__PURE__*/ jsx(Dropdown, {
|
|
657
|
+
trigger: [
|
|
658
|
+
'hover'
|
|
659
|
+
],
|
|
660
|
+
placement: "bottomRight",
|
|
661
|
+
overlayStyle: {
|
|
662
|
+
minWidth: '148px'
|
|
663
|
+
},
|
|
664
|
+
dropdownRender: (menu)=>/*#__PURE__*/ jsx("div", {
|
|
665
|
+
style: {
|
|
666
|
+
borderRadius: '8px',
|
|
667
|
+
border: '1px solid rgba(0, 0, 0, 0.08)',
|
|
668
|
+
backgroundColor: '#fff',
|
|
669
|
+
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.08)',
|
|
670
|
+
overflow: 'hidden'
|
|
671
|
+
},
|
|
672
|
+
children: menu
|
|
673
|
+
}),
|
|
674
|
+
menu: {
|
|
675
|
+
style: {
|
|
676
|
+
borderRadius: '8px',
|
|
677
|
+
padding: 0
|
|
678
|
+
},
|
|
679
|
+
items: [
|
|
680
|
+
{
|
|
681
|
+
key: 'autoZoom',
|
|
682
|
+
style: {
|
|
683
|
+
height: '39px',
|
|
684
|
+
margin: 0,
|
|
685
|
+
padding: '0 12px'
|
|
686
|
+
},
|
|
687
|
+
label: /*#__PURE__*/ jsxs("div", {
|
|
688
|
+
style: {
|
|
689
|
+
display: 'flex',
|
|
690
|
+
alignItems: 'center',
|
|
691
|
+
justifyContent: 'space-between',
|
|
692
|
+
width: '100%',
|
|
693
|
+
height: '39px'
|
|
694
|
+
},
|
|
695
|
+
children: [
|
|
696
|
+
/*#__PURE__*/ jsxs("div", {
|
|
697
|
+
style: {
|
|
698
|
+
display: 'flex',
|
|
699
|
+
alignItems: 'center',
|
|
700
|
+
gap: '4px'
|
|
701
|
+
},
|
|
702
|
+
children: [
|
|
703
|
+
/*#__PURE__*/ jsx(global_perspective, {
|
|
704
|
+
style: {
|
|
705
|
+
width: '16px',
|
|
706
|
+
height: '16px'
|
|
707
|
+
}
|
|
708
|
+
}),
|
|
709
|
+
/*#__PURE__*/ jsx("span", {
|
|
710
|
+
style: {
|
|
711
|
+
fontSize: '12px',
|
|
712
|
+
marginRight: '16px'
|
|
713
|
+
},
|
|
714
|
+
children: "Focus on Cursor"
|
|
715
|
+
})
|
|
716
|
+
]
|
|
717
|
+
}),
|
|
718
|
+
/*#__PURE__*/ jsx(Switch, {
|
|
719
|
+
size: "small",
|
|
720
|
+
checked: autoZoom,
|
|
721
|
+
onChange: (checked)=>{
|
|
722
|
+
setAutoZoom(checked);
|
|
723
|
+
triggerReplay();
|
|
724
|
+
},
|
|
725
|
+
onClick: (_, e)=>{
|
|
726
|
+
var _e_stopPropagation;
|
|
727
|
+
return null == e ? void 0 : null == (_e_stopPropagation = e.stopPropagation) ? void 0 : _e_stopPropagation.call(e);
|
|
728
|
+
}
|
|
729
|
+
})
|
|
730
|
+
]
|
|
731
|
+
})
|
|
732
|
+
}
|
|
733
|
+
]
|
|
734
|
+
},
|
|
735
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
736
|
+
className: "status-icon",
|
|
737
|
+
onMouseEnter: ()=>setMouseOverSettingsIcon(true),
|
|
738
|
+
onMouseLeave: ()=>setMouseOverSettingsIcon(false),
|
|
739
|
+
style: {
|
|
740
|
+
cursor: 'pointer',
|
|
741
|
+
display: 'flex',
|
|
742
|
+
alignItems: 'center',
|
|
743
|
+
justifyContent: 'center',
|
|
744
|
+
opacity: mouseOverSettingsIcon ? 1 : 0.7,
|
|
745
|
+
transition: 'opacity 0.2s'
|
|
746
|
+
},
|
|
747
|
+
children: /*#__PURE__*/ jsx(global_perspective, {
|
|
748
|
+
style: {
|
|
749
|
+
width: '16px',
|
|
750
|
+
height: '16px'
|
|
751
|
+
}
|
|
752
|
+
})
|
|
753
|
+
})
|
|
620
754
|
})
|
|
621
755
|
]
|
|
622
756
|
})
|
|
@@ -6,7 +6,7 @@ import shiny_text from "../shiny-text.mjs";
|
|
|
6
6
|
import { emptyResultTip, serverLaunchTip } from "./playground-constants.mjs";
|
|
7
7
|
import "./index.css";
|
|
8
8
|
const PlaygroundResultView = (param)=>{
|
|
9
|
-
let { result, loading, serverValid, serviceMode, replayScriptsInfo, replayCounter, loadingProgressText, verticalMode = false, notReadyMessage, fitMode } = param;
|
|
9
|
+
let { result, loading, serverValid, serviceMode, replayScriptsInfo, replayCounter, loadingProgressText, verticalMode = false, notReadyMessage, fitMode, autoZoom } = param;
|
|
10
10
|
let resultWrapperClassName = 'result-wrapper';
|
|
11
11
|
if (verticalMode) resultWrapperClassName += ' vertical-mode-result';
|
|
12
12
|
if (replayScriptsInfo && verticalMode) resultWrapperClassName += ' result-wrapper-compact';
|
|
@@ -35,7 +35,8 @@ const PlaygroundResultView = (param)=>{
|
|
|
35
35
|
imageWidth: replayScriptsInfo.width,
|
|
36
36
|
imageHeight: replayScriptsInfo.height,
|
|
37
37
|
reportFileContent: ('In-Browser-Extension' === serviceMode || 'Server' === serviceMode) && (null == result ? void 0 : result.reportHTML) ? null == result ? void 0 : result.reportHTML : null,
|
|
38
|
-
fitMode: fitMode
|
|
38
|
+
fitMode: fitMode,
|
|
39
|
+
autoZoom: autoZoom
|
|
39
40
|
}, replayCounter);
|
|
40
41
|
else if (null == result ? void 0 : result.error) resultDataToShow = /*#__PURE__*/ jsx("pre", {
|
|
41
42
|
children: null == result ? void 0 : result.error
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
const SvgGlobalPerspective = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
+
width: 16,
|
|
6
|
+
height: 16,
|
|
7
|
+
fill: "none",
|
|
8
|
+
viewBox: "0 0 16 16",
|
|
9
|
+
...props,
|
|
10
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
11
|
+
fill: "#333",
|
|
12
|
+
d: "M1.333 13v-2.5a.667.667 0 0 1 1.334 0V13c0 .184.149.333.333.333h2.5a.667.667 0 0 1 0 1.334H3c-.92 0-1.667-.746-1.667-1.667m12 0v-2.5a.667.667 0 0 1 1.334 0V13c0 .92-.746 1.667-1.667 1.667h-2.5a.667.667 0 0 1 0-1.334H13a.333.333 0 0 0 .333-.333m-12-7.5V3c0-.92.747-1.667 1.667-1.667h2.5a.667.667 0 0 1 0 1.334H3A.333.333 0 0 0 2.667 3v2.5a.667.667 0 0 1-1.334 0m12 0V3A.333.333 0 0 0 13 2.667h-2.5a.667.667 0 0 1 0-1.334H13c.92 0 1.667.747 1.667 1.667v2.5a.667.667 0 0 1-1.334 0M5.667 10.333h4.666V5.667H5.667zm6 .167c0 .644-.523 1.167-1.167 1.167h-5A1.167 1.167 0 0 1 4.333 10.5v-5c0-.644.523-1.167 1.167-1.167h5c.644 0 1.167.523 1.167 1.167z"
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
const global_perspective = SvgGlobalPerspective;
|
|
16
|
+
export { global_perspective as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
const SvgPlayerSetting = (props)=>/*#__PURE__*/ jsxs("svg", {
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
+
width: 16,
|
|
6
|
+
height: 16,
|
|
7
|
+
fill: "none",
|
|
8
|
+
viewBox: "0 0 16 16",
|
|
9
|
+
...props,
|
|
10
|
+
children: [
|
|
11
|
+
/*#__PURE__*/ jsx("path", {
|
|
12
|
+
stroke: "#333",
|
|
13
|
+
strokeLinejoin: "round",
|
|
14
|
+
strokeWidth: 1.333,
|
|
15
|
+
d: "M11.333 13.667 14.667 8l-3.334-5.667H4.667L1.333 8l3.334 5.667z"
|
|
16
|
+
}),
|
|
17
|
+
/*#__PURE__*/ jsx("path", {
|
|
18
|
+
stroke: "#333",
|
|
19
|
+
strokeLinejoin: "round",
|
|
20
|
+
strokeWidth: 1.333,
|
|
21
|
+
d: "M8 9.667a1.667 1.667 0 1 0 0-3.334 1.667 1.667 0 0 0 0 3.334Z"
|
|
22
|
+
})
|
|
23
|
+
]
|
|
24
|
+
});
|
|
25
|
+
const player_setting = SvgPlayerSetting;
|
|
26
|
+
export { player_setting as default };
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.n = (module)=>{
|
|
6
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
7
|
+
__webpack_require__.d(getter, {
|
|
8
|
+
a: getter
|
|
9
|
+
});
|
|
10
|
+
return getter;
|
|
11
|
+
};
|
|
12
|
+
})();
|
|
4
13
|
(()=>{
|
|
5
14
|
__webpack_require__.d = (exports1, definition)=>{
|
|
6
15
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
@@ -36,6 +45,8 @@ const external_utils_js_namespaceObject = require("../utils.js");
|
|
|
36
45
|
const icons_namespaceObject = require("@ant-design/icons");
|
|
37
46
|
const extractor_namespaceObject = require("@midscene/shared/extractor");
|
|
38
47
|
const external_antd_namespaceObject = require("antd");
|
|
48
|
+
const global_perspective_js_namespaceObject = require("../icons/global-perspective.js");
|
|
49
|
+
var global_perspective_js_default = /*#__PURE__*/ __webpack_require__.n(global_perspective_js_namespaceObject);
|
|
39
50
|
const external_blackboard_js_namespaceObject = require("./blackboard.js");
|
|
40
51
|
const external_pixi_loader_js_namespaceObject = require("./pixi-loader.js");
|
|
41
52
|
function _define_property(obj, key, value) {
|
|
@@ -143,6 +154,12 @@ function Player(props) {
|
|
|
143
154
|
var _scripts_;
|
|
144
155
|
const [titleText, setTitleText] = (0, external_react_namespaceObject.useState)('');
|
|
145
156
|
const [subTitleText, setSubTitleText] = (0, external_react_namespaceObject.useState)('');
|
|
157
|
+
const [autoZoom, setAutoZoom] = (0, external_react_namespaceObject.useState)((null == props ? void 0 : props.autoZoom) !== void 0 ? props.autoZoom : true);
|
|
158
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
159
|
+
if ((null == props ? void 0 : props.autoZoom) !== void 0) setAutoZoom(props.autoZoom);
|
|
160
|
+
}, [
|
|
161
|
+
null == props ? void 0 : props.autoZoom
|
|
162
|
+
]);
|
|
146
163
|
const scripts = null == props ? void 0 : props.replayScripts;
|
|
147
164
|
const imageWidth = (null == props ? void 0 : props.imageWidth) || 1920;
|
|
148
165
|
const imageHeight = (null == props ? void 0 : props.imageHeight) || 1080;
|
|
@@ -260,10 +277,10 @@ function Player(props) {
|
|
|
260
277
|
};
|
|
261
278
|
const updateCamera = (state)=>{
|
|
262
279
|
cameraState.current = state;
|
|
263
|
-
const newScale = Math.max(1, imageWidth / state.width);
|
|
280
|
+
const newScale = autoZoom ? Math.max(1, imageWidth / state.width) : 1;
|
|
264
281
|
windowContentContainer.scale.set(newScale);
|
|
265
|
-
windowContentContainer.x = Math.round(canvasPaddingLeft - state.left * newScale);
|
|
266
|
-
windowContentContainer.y = Math.round(canvasPaddingTop - state.top * newScale);
|
|
282
|
+
windowContentContainer.x = autoZoom ? Math.round(canvasPaddingLeft - state.left * newScale) : canvasPaddingLeft;
|
|
283
|
+
windowContentContainer.y = autoZoom ? Math.round(canvasPaddingTop - state.top * newScale) : canvasPaddingTop;
|
|
267
284
|
const pointer = windowContentContainer.getChildByLabel('pointer');
|
|
268
285
|
if (pointer) {
|
|
269
286
|
pointer.scale.set(1 / newScale);
|
|
@@ -274,6 +291,33 @@ function Player(props) {
|
|
|
274
291
|
}
|
|
275
292
|
};
|
|
276
293
|
const cameraAnimation = async (targetState, duration, frame)=>{
|
|
294
|
+
if (!autoZoom) {
|
|
295
|
+
const currentState = {
|
|
296
|
+
...cameraState.current
|
|
297
|
+
};
|
|
298
|
+
const startPointerLeft = currentState.pointerLeft;
|
|
299
|
+
const startPointerTop = currentState.pointerTop;
|
|
300
|
+
const startTime = performance.now();
|
|
301
|
+
const shouldMovePointer = 'number' == typeof targetState.pointerLeft && 'number' == typeof targetState.pointerTop && (targetState.pointerLeft !== startPointerLeft || targetState.pointerTop !== startPointerTop);
|
|
302
|
+
if (!shouldMovePointer) return;
|
|
303
|
+
await new Promise((resolve)=>{
|
|
304
|
+
const animate = (currentTime)=>{
|
|
305
|
+
const elapsedTime = currentTime - startTime;
|
|
306
|
+
const rawProgress = Math.min(elapsedTime / duration, 1);
|
|
307
|
+
const progress = cubicMouse(rawProgress);
|
|
308
|
+
const nextState = {
|
|
309
|
+
...currentState,
|
|
310
|
+
pointerLeft: startPointerLeft + (targetState.pointerLeft - startPointerLeft) * progress,
|
|
311
|
+
pointerTop: startPointerTop + (targetState.pointerTop - startPointerTop) * progress
|
|
312
|
+
};
|
|
313
|
+
updateCamera(nextState);
|
|
314
|
+
if (elapsedTime < duration) frame(animate);
|
|
315
|
+
else resolve();
|
|
316
|
+
};
|
|
317
|
+
frame(animate);
|
|
318
|
+
});
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
277
321
|
const currentState = {
|
|
278
322
|
...cameraState.current
|
|
279
323
|
};
|
|
@@ -530,6 +574,7 @@ function Player(props) {
|
|
|
530
574
|
replayMark
|
|
531
575
|
]);
|
|
532
576
|
const [mouseOverStatusIcon, setMouseOverStatusIcon] = (0, external_react_namespaceObject.useState)(false);
|
|
577
|
+
const [mouseOverSettingsIcon, setMouseOverSettingsIcon] = (0, external_react_namespaceObject.useState)(false);
|
|
533
578
|
const progressString = Math.round(100 * animationProgress);
|
|
534
579
|
const transitionStyle = 0 === animationProgress ? 'none' : '0.3s';
|
|
535
580
|
const canReplayNow = 1 === animationProgress;
|
|
@@ -645,6 +690,105 @@ function Player(props) {
|
|
|
645
690
|
percent: progressString
|
|
646
691
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ExportOutlined, {})
|
|
647
692
|
})
|
|
693
|
+
}),
|
|
694
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Dropdown, {
|
|
695
|
+
trigger: [
|
|
696
|
+
'hover'
|
|
697
|
+
],
|
|
698
|
+
placement: "bottomRight",
|
|
699
|
+
overlayStyle: {
|
|
700
|
+
minWidth: '148px'
|
|
701
|
+
},
|
|
702
|
+
dropdownRender: (menu)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
703
|
+
style: {
|
|
704
|
+
borderRadius: '8px',
|
|
705
|
+
border: '1px solid rgba(0, 0, 0, 0.08)',
|
|
706
|
+
backgroundColor: '#fff',
|
|
707
|
+
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.08)',
|
|
708
|
+
overflow: 'hidden'
|
|
709
|
+
},
|
|
710
|
+
children: menu
|
|
711
|
+
}),
|
|
712
|
+
menu: {
|
|
713
|
+
style: {
|
|
714
|
+
borderRadius: '8px',
|
|
715
|
+
padding: 0
|
|
716
|
+
},
|
|
717
|
+
items: [
|
|
718
|
+
{
|
|
719
|
+
key: 'autoZoom',
|
|
720
|
+
style: {
|
|
721
|
+
height: '39px',
|
|
722
|
+
margin: 0,
|
|
723
|
+
padding: '0 12px'
|
|
724
|
+
},
|
|
725
|
+
label: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
726
|
+
style: {
|
|
727
|
+
display: 'flex',
|
|
728
|
+
alignItems: 'center',
|
|
729
|
+
justifyContent: 'space-between',
|
|
730
|
+
width: '100%',
|
|
731
|
+
height: '39px'
|
|
732
|
+
},
|
|
733
|
+
children: [
|
|
734
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
735
|
+
style: {
|
|
736
|
+
display: 'flex',
|
|
737
|
+
alignItems: 'center',
|
|
738
|
+
gap: '4px'
|
|
739
|
+
},
|
|
740
|
+
children: [
|
|
741
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(global_perspective_js_default(), {
|
|
742
|
+
style: {
|
|
743
|
+
width: '16px',
|
|
744
|
+
height: '16px'
|
|
745
|
+
}
|
|
746
|
+
}),
|
|
747
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
748
|
+
style: {
|
|
749
|
+
fontSize: '12px',
|
|
750
|
+
marginRight: '16px'
|
|
751
|
+
},
|
|
752
|
+
children: "Focus on Cursor"
|
|
753
|
+
})
|
|
754
|
+
]
|
|
755
|
+
}),
|
|
756
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Switch, {
|
|
757
|
+
size: "small",
|
|
758
|
+
checked: autoZoom,
|
|
759
|
+
onChange: (checked)=>{
|
|
760
|
+
setAutoZoom(checked);
|
|
761
|
+
triggerReplay();
|
|
762
|
+
},
|
|
763
|
+
onClick: (_, e)=>{
|
|
764
|
+
var _e_stopPropagation;
|
|
765
|
+
return null == e ? void 0 : null == (_e_stopPropagation = e.stopPropagation) ? void 0 : _e_stopPropagation.call(e);
|
|
766
|
+
}
|
|
767
|
+
})
|
|
768
|
+
]
|
|
769
|
+
})
|
|
770
|
+
}
|
|
771
|
+
]
|
|
772
|
+
},
|
|
773
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
774
|
+
className: "status-icon",
|
|
775
|
+
onMouseEnter: ()=>setMouseOverSettingsIcon(true),
|
|
776
|
+
onMouseLeave: ()=>setMouseOverSettingsIcon(false),
|
|
777
|
+
style: {
|
|
778
|
+
cursor: 'pointer',
|
|
779
|
+
display: 'flex',
|
|
780
|
+
alignItems: 'center',
|
|
781
|
+
justifyContent: 'center',
|
|
782
|
+
opacity: mouseOverSettingsIcon ? 1 : 0.7,
|
|
783
|
+
transition: 'opacity 0.2s'
|
|
784
|
+
},
|
|
785
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(global_perspective_js_default(), {
|
|
786
|
+
style: {
|
|
787
|
+
width: '16px',
|
|
788
|
+
height: '16px'
|
|
789
|
+
}
|
|
790
|
+
})
|
|
791
|
+
})
|
|
648
792
|
})
|
|
649
793
|
]
|
|
650
794
|
})
|
|
@@ -44,7 +44,7 @@ var external_shiny_text_js_default = /*#__PURE__*/ __webpack_require__.n(externa
|
|
|
44
44
|
const external_playground_constants_js_namespaceObject = require("./playground-constants.js");
|
|
45
45
|
require("./index.css");
|
|
46
46
|
const PlaygroundResultView = (param)=>{
|
|
47
|
-
let { result, loading, serverValid, serviceMode, replayScriptsInfo, replayCounter, loadingProgressText, verticalMode = false, notReadyMessage, fitMode } = param;
|
|
47
|
+
let { result, loading, serverValid, serviceMode, replayScriptsInfo, replayCounter, loadingProgressText, verticalMode = false, notReadyMessage, fitMode, autoZoom } = param;
|
|
48
48
|
let resultWrapperClassName = 'result-wrapper';
|
|
49
49
|
if (verticalMode) resultWrapperClassName += ' vertical-mode-result';
|
|
50
50
|
if (replayScriptsInfo && verticalMode) resultWrapperClassName += ' result-wrapper-compact';
|
|
@@ -73,7 +73,8 @@ const PlaygroundResultView = (param)=>{
|
|
|
73
73
|
imageWidth: replayScriptsInfo.width,
|
|
74
74
|
imageHeight: replayScriptsInfo.height,
|
|
75
75
|
reportFileContent: ('In-Browser-Extension' === serviceMode || 'Server' === serviceMode) && (null == result ? void 0 : result.reportHTML) ? null == result ? void 0 : result.reportHTML : null,
|
|
76
|
-
fitMode: fitMode
|
|
76
|
+
fitMode: fitMode,
|
|
77
|
+
autoZoom: autoZoom
|
|
77
78
|
}, replayCounter);
|
|
78
79
|
else if (null == result ? void 0 : result.error) resultDataToShow = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("pre", {
|
|
79
80
|
children: null == result ? void 0 : result.error
|
|
@@ -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
|
+
default: ()=>global_perspective
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
require("react");
|
|
31
|
+
const SvgGlobalPerspective = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("svg", {
|
|
32
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
33
|
+
width: 16,
|
|
34
|
+
height: 16,
|
|
35
|
+
fill: "none",
|
|
36
|
+
viewBox: "0 0 16 16",
|
|
37
|
+
...props,
|
|
38
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
|
|
39
|
+
fill: "#333",
|
|
40
|
+
d: "M1.333 13v-2.5a.667.667 0 0 1 1.334 0V13c0 .184.149.333.333.333h2.5a.667.667 0 0 1 0 1.334H3c-.92 0-1.667-.746-1.667-1.667m12 0v-2.5a.667.667 0 0 1 1.334 0V13c0 .92-.746 1.667-1.667 1.667h-2.5a.667.667 0 0 1 0-1.334H13a.333.333 0 0 0 .333-.333m-12-7.5V3c0-.92.747-1.667 1.667-1.667h2.5a.667.667 0 0 1 0 1.334H3A.333.333 0 0 0 2.667 3v2.5a.667.667 0 0 1-1.334 0m12 0V3A.333.333 0 0 0 13 2.667h-2.5a.667.667 0 0 1 0-1.334H13c.92 0 1.667.747 1.667 1.667v2.5a.667.667 0 0 1-1.334 0M5.667 10.333h4.666V5.667H5.667zm6 .167c0 .644-.523 1.167-1.167 1.167h-5A1.167 1.167 0 0 1 4.333 10.5v-5c0-.644.523-1.167 1.167-1.167h5c.644 0 1.167.523 1.167 1.167z"
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
const global_perspective = SvgGlobalPerspective;
|
|
44
|
+
exports["default"] = __webpack_exports__["default"];
|
|
45
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
46
|
+
"default"
|
|
47
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
48
|
+
Object.defineProperty(exports, '__esModule', {
|
|
49
|
+
value: true
|
|
50
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
default: ()=>player_setting
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
require("react");
|
|
31
|
+
const SvgPlayerSetting = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("svg", {
|
|
32
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
33
|
+
width: 16,
|
|
34
|
+
height: 16,
|
|
35
|
+
fill: "none",
|
|
36
|
+
viewBox: "0 0 16 16",
|
|
37
|
+
...props,
|
|
38
|
+
children: [
|
|
39
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
|
|
40
|
+
stroke: "#333",
|
|
41
|
+
strokeLinejoin: "round",
|
|
42
|
+
strokeWidth: 1.333,
|
|
43
|
+
d: "M11.333 13.667 14.667 8l-3.334-5.667H4.667L1.333 8l3.334 5.667z"
|
|
44
|
+
}),
|
|
45
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
|
|
46
|
+
stroke: "#333",
|
|
47
|
+
strokeLinejoin: "round",
|
|
48
|
+
strokeWidth: 1.333,
|
|
49
|
+
d: "M8 9.667a1.667 1.667 0 1 0 0-3.334 1.667 1.667 0 0 0 0 3.334Z"
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
});
|
|
53
|
+
const player_setting = SvgPlayerSetting;
|
|
54
|
+
exports["default"] = __webpack_exports__["default"];
|
|
55
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
56
|
+
"default"
|
|
57
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
58
|
+
Object.defineProperty(exports, '__esModule', {
|
|
59
|
+
value: true
|
|
60
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/visualizer",
|
|
3
|
-
"version": "0.26.5-beta-
|
|
3
|
+
"version": "0.26.5-beta-20250814125155.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",
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"antd": "^5.21.6",
|
|
71
71
|
"buffer": "6.0.3",
|
|
72
72
|
"dayjs": "^1.11.11",
|
|
73
|
-
"@midscene/
|
|
74
|
-
"@midscene/
|
|
75
|
-
"@midscene/
|
|
73
|
+
"@midscene/shared": "0.26.5-beta-20250814125155.0",
|
|
74
|
+
"@midscene/core": "0.26.5-beta-20250814125155.0",
|
|
75
|
+
"@midscene/web": "0.26.5-beta-20250814125155.0"
|
|
76
76
|
},
|
|
77
77
|
"license": "MIT",
|
|
78
78
|
"scripts": {
|