@midscene/visualizer 0.1.4 → 0.2.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/LICENSE +21 -0
- package/README.md +4 -21
- package/dist/es/component/blackboard.js +32 -8
- package/dist/es/component/color.js +2 -4
- package/dist/es/component/detail-panel.js +28 -14
- package/dist/es/component/detail-side.css +1 -1
- package/dist/es/component/detail-side.js +99 -28
- package/dist/es/component/global-hover-preview.css +2 -2
- package/dist/es/component/global-hover-preview.js +25 -12
- package/dist/es/component/panel-title.css +3 -3
- package/dist/es/component/sidebar.css +7 -12
- package/dist/es/component/sidebar.js +31 -19
- package/dist/es/component/store.js +8 -2
- package/dist/es/component/timeline.css +1 -1
- package/dist/es/component/timeline.js +52 -19
- package/dist/es/demo-dump.json +1 -0
- package/dist/es/index.css +13 -9
- package/dist/es/index.js +44 -26
- package/dist/es/utils.js +9 -10
- package/dist/lib/component/blackboard.js +31 -7
- package/dist/lib/component/color.js +2 -4
- package/dist/lib/component/detail-panel.js +23 -13
- package/dist/lib/component/detail-side.css +1 -1
- package/dist/lib/component/detail-side.js +98 -27
- package/dist/lib/component/global-hover-preview.css +2 -2
- package/dist/lib/component/global-hover-preview.js +26 -13
- package/dist/lib/component/panel-title.css +3 -3
- package/dist/lib/component/sidebar.css +7 -12
- package/dist/lib/component/sidebar.js +31 -19
- package/dist/lib/component/store.js +8 -2
- package/dist/lib/component/timeline.css +1 -1
- package/dist/lib/component/timeline.js +52 -19
- package/dist/lib/demo-dump.json +1 -0
- package/dist/lib/index.css +13 -9
- package/dist/lib/index.js +43 -25
- package/dist/lib/utils.js +9 -10
- package/dist/types/component/store.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils.d.ts +1 -1
- package/package.json +9 -9
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021-present Midscene.js
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,24 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
## Documentation
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
See https://midscenejs.com/ for details.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
运行和调试组件
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
pnpm run dev
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
按照社区规范和最佳实践,生成构建产物
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
pnpm run build
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
继续创建更多项目要素
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
pnpm run new
|
|
23
|
-
```
|
|
5
|
+
## License
|
|
24
6
|
|
|
7
|
+
Midscene is MIT licensed.
|
|
@@ -20,10 +20,10 @@ var __async = (__this, __arguments, generator) => {
|
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
23
|
+
import { Checkbox } from "antd";
|
|
23
24
|
import * as PIXI from "pixi.js";
|
|
24
25
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
25
|
-
import {
|
|
26
|
-
import { highlightColorForType, colorForName } from "./color";
|
|
26
|
+
import { colorForName, highlightColorForType } from "./color";
|
|
27
27
|
import "./blackboard.css";
|
|
28
28
|
import { useBlackboardPreference, useInsightDump } from "./store";
|
|
29
29
|
const itemFillAlpha = 0.3;
|
|
@@ -33,9 +33,15 @@ const noop = () => {
|
|
|
33
33
|
};
|
|
34
34
|
const BlackBoard = () => {
|
|
35
35
|
const dump = useInsightDump((store) => store.data);
|
|
36
|
-
const setHighlightSectionNames = useInsightDump(
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
const setHighlightSectionNames = useInsightDump(
|
|
37
|
+
(store) => store.setHighlightSectionNames
|
|
38
|
+
);
|
|
39
|
+
const setHighlightElements = useInsightDump(
|
|
40
|
+
(store) => store.setHighlightElements
|
|
41
|
+
);
|
|
42
|
+
const highlightSectionNames = useInsightDump(
|
|
43
|
+
(store) => store.highlightSectionNames
|
|
44
|
+
);
|
|
39
45
|
const highlightElements = useInsightDump((store) => store.highlightElements);
|
|
40
46
|
const { context, matchedSection: sections, matchedElement: elements } = dump;
|
|
41
47
|
const { size, screenshotBase64 } = context;
|
|
@@ -54,7 +60,11 @@ const BlackBoard = () => {
|
|
|
54
60
|
if (!domRef.current || !screenWidth) {
|
|
55
61
|
return;
|
|
56
62
|
}
|
|
57
|
-
yield app.init({
|
|
63
|
+
yield app.init({
|
|
64
|
+
width: screenWidth,
|
|
65
|
+
height: screenHeight,
|
|
66
|
+
background: 16777215
|
|
67
|
+
});
|
|
58
68
|
const canvasEl = domRef.current;
|
|
59
69
|
domRef.current.appendChild(app.canvas);
|
|
60
70
|
const { clientWidth } = domRef.current.parentElement;
|
|
@@ -147,7 +157,14 @@ const BlackBoard = () => {
|
|
|
147
157
|
if (elements.includes(element)) {
|
|
148
158
|
return;
|
|
149
159
|
}
|
|
150
|
-
const [graphics, texts] = rectMarkForItem(
|
|
160
|
+
const [graphics, texts] = rectMarkForItem(
|
|
161
|
+
rect,
|
|
162
|
+
"",
|
|
163
|
+
highlightColorForType("element"),
|
|
164
|
+
1,
|
|
165
|
+
noop,
|
|
166
|
+
noop
|
|
167
|
+
);
|
|
151
168
|
itemMarkContainer.addChild(graphics);
|
|
152
169
|
textContainer.addChild(texts);
|
|
153
170
|
});
|
|
@@ -243,7 +260,14 @@ const BlackBoard = () => {
|
|
|
243
260
|
] }) });
|
|
244
261
|
}
|
|
245
262
|
return /* @__PURE__ */ jsxs("div", { className: "blackboard", children: [
|
|
246
|
-
/* @__PURE__ */ jsx(
|
|
263
|
+
/* @__PURE__ */ jsx(
|
|
264
|
+
"div",
|
|
265
|
+
{
|
|
266
|
+
className: "blackboard-main-content",
|
|
267
|
+
style: { width: "100%" },
|
|
268
|
+
ref: domRef
|
|
269
|
+
}
|
|
270
|
+
),
|
|
247
271
|
/* @__PURE__ */ jsx("div", { className: "blackboard-filter", children: /* @__PURE__ */ jsxs("div", { className: "overlay-control", children: [
|
|
248
272
|
/* @__PURE__ */ jsx(Checkbox, { checked: bgVisible, onChange: onSetBg, children: "Screenshot" }),
|
|
249
273
|
/* @__PURE__ */ jsx(Checkbox, { checked: textsVisible, onChange: onSetTextsVisible, children: "Text Mark" })
|
|
@@ -17,16 +17,14 @@ function colorForName(type, name) {
|
|
|
17
17
|
const hashNumber = djb2Hash(name);
|
|
18
18
|
if (type === "section") {
|
|
19
19
|
return sectionColor[hashNumber % sectionColor.length];
|
|
20
|
-
} else {
|
|
21
|
-
return elementColor[hashNumber % elementColor.length];
|
|
22
20
|
}
|
|
21
|
+
return elementColor[hashNumber % elementColor.length];
|
|
23
22
|
}
|
|
24
23
|
function highlightColorForType(type) {
|
|
25
24
|
if (type === "section") {
|
|
26
25
|
return highlightColorForSection;
|
|
27
|
-
} else {
|
|
28
|
-
return highlightColorForElement;
|
|
29
26
|
}
|
|
27
|
+
return highlightColorForElement;
|
|
30
28
|
}
|
|
31
29
|
export {
|
|
32
30
|
colorForName,
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import "./detail-panel.css";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useExecutionDump, useInsightDump } from "./store";
|
|
5
|
+
import { filterBase64Value, timeStr } from "../utils";
|
|
6
|
+
import {
|
|
7
|
+
CameraOutlined,
|
|
8
|
+
FileTextOutlined,
|
|
9
|
+
ScheduleOutlined
|
|
10
|
+
} from "@ant-design/icons";
|
|
11
|
+
import { ConfigProvider, Segmented } from "antd";
|
|
6
12
|
import { useEffect, useState } from "react";
|
|
7
13
|
import BlackBoard from "./blackboard";
|
|
8
|
-
import { useExecutionDump, useInsightDump } from "./store";
|
|
9
|
-
import { timeStr, filterBase64Value } from "../utils";
|
|
10
14
|
const ScreenshotItem = (props) => {
|
|
11
15
|
return /* @__PURE__ */ jsxs("div", { className: "screenshot-item", children: [
|
|
12
16
|
/* @__PURE__ */ jsx("div", { className: "screenshot-item-title", children: props.time }),
|
|
13
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("img", { src: props.img }) })
|
|
17
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("img", { src: props.img, alt: "screenshot" }) })
|
|
14
18
|
] });
|
|
15
19
|
};
|
|
16
20
|
const VIEW_TYPE_BLACKBOARD = "blackboard";
|
|
@@ -18,18 +22,19 @@ const VIEW_TYPE_SCREENSHOT = "screenshot";
|
|
|
18
22
|
const VIEW_TYPE_JSON = "json";
|
|
19
23
|
const DetailPanel = () => {
|
|
20
24
|
var _a;
|
|
25
|
+
const dumpContext = useInsightDump((store) => store.data);
|
|
21
26
|
const dumpId = useInsightDump((store) => store._loadId);
|
|
22
|
-
const blackboardViewAvailable = Boolean(
|
|
27
|
+
const blackboardViewAvailable = Boolean(dumpContext);
|
|
23
28
|
const activeTask = useExecutionDump((store) => store.activeTask);
|
|
24
29
|
const [preferredViewType, setViewType] = useState(VIEW_TYPE_BLACKBOARD);
|
|
25
|
-
const viewType = preferredViewType === VIEW_TYPE_BLACKBOARD && !
|
|
30
|
+
const viewType = preferredViewType === VIEW_TYPE_BLACKBOARD && !blackboardViewAvailable ? VIEW_TYPE_SCREENSHOT : preferredViewType;
|
|
26
31
|
let content;
|
|
27
32
|
if (!activeTask) {
|
|
28
33
|
content = /* @__PURE__ */ jsx("div", { children: "please select a task" });
|
|
29
34
|
} else if (viewType === VIEW_TYPE_JSON) {
|
|
30
35
|
content = /* @__PURE__ */ jsx("div", { className: "json-content", children: filterBase64Value(JSON.stringify(activeTask, void 0, 2)) });
|
|
31
36
|
} else if (viewType === VIEW_TYPE_BLACKBOARD) {
|
|
32
|
-
if (
|
|
37
|
+
if (blackboardViewAvailable) {
|
|
33
38
|
content = /* @__PURE__ */ jsx(BlackBoard, {}, `${dumpId}`);
|
|
34
39
|
} else {
|
|
35
40
|
content = /* @__PURE__ */ jsx("div", { children: "invalid view" });
|
|
@@ -53,7 +58,9 @@ const DetailPanel = () => {
|
|
|
53
58
|
} else if (viewType === VIEW_TYPE_SCREENSHOT) {
|
|
54
59
|
setViewType(VIEW_TYPE_JSON);
|
|
55
60
|
} else {
|
|
56
|
-
setViewType(
|
|
61
|
+
setViewType(
|
|
62
|
+
blackboardViewAvailable ? VIEW_TYPE_BLACKBOARD : VIEW_TYPE_SCREENSHOT
|
|
63
|
+
);
|
|
57
64
|
}
|
|
58
65
|
e.preventDefault();
|
|
59
66
|
}
|
|
@@ -64,11 +71,19 @@ const DetailPanel = () => {
|
|
|
64
71
|
};
|
|
65
72
|
});
|
|
66
73
|
const options = [
|
|
67
|
-
{
|
|
74
|
+
{
|
|
75
|
+
label: "Screenshots",
|
|
76
|
+
value: VIEW_TYPE_SCREENSHOT,
|
|
77
|
+
icon: /* @__PURE__ */ jsx(CameraOutlined, {})
|
|
78
|
+
},
|
|
68
79
|
{ label: "JSON View", value: VIEW_TYPE_JSON, icon: /* @__PURE__ */ jsx(FileTextOutlined, {}) }
|
|
69
80
|
];
|
|
70
81
|
if (blackboardViewAvailable) {
|
|
71
|
-
options.unshift({
|
|
82
|
+
options.unshift({
|
|
83
|
+
label: "Visualization",
|
|
84
|
+
value: VIEW_TYPE_BLACKBOARD,
|
|
85
|
+
icon: /* @__PURE__ */ jsx(ScheduleOutlined, {})
|
|
86
|
+
});
|
|
72
87
|
}
|
|
73
88
|
return /* @__PURE__ */ jsxs("div", { className: "detail-panel", children: [
|
|
74
89
|
/* @__PURE__ */ jsx("div", { className: "view-switcher", children: /* @__PURE__ */ jsx(
|
|
@@ -77,11 +92,10 @@ const DetailPanel = () => {
|
|
|
77
92
|
theme: {
|
|
78
93
|
components: {
|
|
79
94
|
Segmented: {
|
|
80
|
-
itemSelectedBg: "#
|
|
95
|
+
itemSelectedBg: "#bfc4da50",
|
|
81
96
|
itemSelectedColor: "#000000"
|
|
82
97
|
// itemHoverColor: '#ffffff',
|
|
83
|
-
// itemHoverBg: '#A3D6D2',
|
|
84
|
-
/* 这里是你的组件 token */
|
|
98
|
+
// itemHoverBg: '#A3D6D2',
|
|
85
99
|
}
|
|
86
100
|
}
|
|
87
101
|
},
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
line-height: 1.5;
|
|
19
19
|
}
|
|
20
20
|
.detail-side .meta-kv .meta .meta-key {
|
|
21
|
-
font-weight: bold;
|
|
22
21
|
width: 100px;
|
|
23
22
|
text-align: right;
|
|
24
23
|
padding-right: 16px;
|
|
@@ -82,6 +81,7 @@
|
|
|
82
81
|
font-size: 14px;
|
|
83
82
|
margin-top: 10px;
|
|
84
83
|
white-space: break-spaces;
|
|
84
|
+
word-wrap: break-word;
|
|
85
85
|
margin: 0;
|
|
86
86
|
}
|
|
87
87
|
.detail-side .item-list .element-button:hover {
|
|
@@ -17,18 +17,34 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
};
|
|
18
18
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
19
19
|
import "./detail-side.css";
|
|
20
|
+
import { timeStr, typeStr } from "../utils";
|
|
20
21
|
import { RadiusSettingOutlined } from "@ant-design/icons";
|
|
21
|
-
import {
|
|
22
|
+
import { Tag, Timeline, Tooltip } from "antd";
|
|
22
23
|
import { highlightColorForType } from "./color";
|
|
23
|
-
import { useExecutionDump, useInsightDump } from "./store";
|
|
24
|
-
import PanelTitle from "./panel-title";
|
|
25
24
|
import { timeCostStrElement } from "./misc";
|
|
26
|
-
import
|
|
25
|
+
import PanelTitle from "./panel-title";
|
|
26
|
+
import { useExecutionDump, useInsightDump } from "./store";
|
|
27
27
|
const noop = () => {
|
|
28
28
|
};
|
|
29
29
|
const Card = (props) => {
|
|
30
|
-
const {
|
|
31
|
-
|
|
30
|
+
const {
|
|
31
|
+
highlightWithColor,
|
|
32
|
+
title,
|
|
33
|
+
subtitle,
|
|
34
|
+
onMouseEnter,
|
|
35
|
+
onMouseLeave,
|
|
36
|
+
content,
|
|
37
|
+
characteristic
|
|
38
|
+
} = props;
|
|
39
|
+
const titleTag = props.characteristic ? /* @__PURE__ */ jsx("div", { className: "item-extra", children: /* @__PURE__ */ jsx("div", { className: "title-tag", children: /* @__PURE__ */ jsx(
|
|
40
|
+
Tooltip,
|
|
41
|
+
{
|
|
42
|
+
placement: "bottomRight",
|
|
43
|
+
title: characteristic,
|
|
44
|
+
mouseEnterDelay: 0,
|
|
45
|
+
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(RadiusSettingOutlined, {}) })
|
|
46
|
+
}
|
|
47
|
+
) }) }) : null;
|
|
32
48
|
const titleRightPaddingClass = props.characteristic ? "title-right-padding" : "";
|
|
33
49
|
const modeClass = props.liteMode ? "item-lite" : "";
|
|
34
50
|
const highlightStyle = highlightWithColor ? { backgroundColor: highlightWithColor } : {};
|
|
@@ -40,12 +56,33 @@ const Card = (props) => {
|
|
|
40
56
|
onMouseEnter,
|
|
41
57
|
onMouseLeave,
|
|
42
58
|
children: [
|
|
43
|
-
/* @__PURE__ */ jsxs(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
59
|
+
/* @__PURE__ */ jsxs(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: `title ${titleRightPaddingClass}`,
|
|
63
|
+
style: { display: title ? "block" : "none" },
|
|
64
|
+
children: [
|
|
65
|
+
title,
|
|
66
|
+
titleTag
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ jsx(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
className: `subtitle ${titleRightPaddingClass}`,
|
|
74
|
+
style: { display: subtitle ? "block" : "none" },
|
|
75
|
+
children: subtitle
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
"div",
|
|
80
|
+
{
|
|
81
|
+
className: "description",
|
|
82
|
+
style: { display: content ? "block" : "none" },
|
|
83
|
+
children: content
|
|
84
|
+
}
|
|
85
|
+
)
|
|
49
86
|
]
|
|
50
87
|
}
|
|
51
88
|
);
|
|
@@ -65,27 +102,33 @@ const objectWithoutKeys = (obj, keys) => Object.keys(obj).reduce((acc, key) => {
|
|
|
65
102
|
return acc;
|
|
66
103
|
}, {});
|
|
67
104
|
const DetailSide = () => {
|
|
68
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
105
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
69
106
|
const task = useExecutionDump((store) => store.activeTask);
|
|
70
107
|
const dump = useInsightDump((store) => store.data);
|
|
71
108
|
const { matchedSection: sections, matchedElement: elements } = dump || {};
|
|
72
|
-
const highlightSectionNames = useInsightDump(
|
|
109
|
+
const highlightSectionNames = useInsightDump(
|
|
110
|
+
(store) => store.highlightSectionNames
|
|
111
|
+
);
|
|
73
112
|
const highlightElements = useInsightDump((store) => store.highlightElements);
|
|
74
|
-
const setHighlightSectionNames = useInsightDump(
|
|
75
|
-
|
|
76
|
-
|
|
113
|
+
const setHighlightSectionNames = useInsightDump(
|
|
114
|
+
(store) => store.setHighlightSectionNames
|
|
115
|
+
);
|
|
116
|
+
const setHighlightElements = useInsightDump(
|
|
117
|
+
(store) => store.setHighlightElements
|
|
118
|
+
);
|
|
119
|
+
const setHighlightSectionName = (name) => {
|
|
77
120
|
setHighlightSectionNames([name]);
|
|
78
121
|
};
|
|
79
|
-
const setHighlightElement =
|
|
122
|
+
const setHighlightElement = (element) => {
|
|
80
123
|
setHighlightElements([element]);
|
|
81
124
|
};
|
|
82
|
-
const unhighlightSection =
|
|
125
|
+
const unhighlightSection = () => {
|
|
83
126
|
setHighlightSectionNames([]);
|
|
84
127
|
};
|
|
85
|
-
const unhighlightElement =
|
|
128
|
+
const unhighlightElement = () => {
|
|
86
129
|
setHighlightElements([]);
|
|
87
130
|
};
|
|
88
|
-
const kv =
|
|
131
|
+
const kv = (data) => {
|
|
89
132
|
const isElementItem = (value) => Boolean(value) && typeof value === "object" && typeof value.content !== "undefined" && Boolean(value.center) && Boolean(value.rect);
|
|
90
133
|
const isSectionItem = (value) => Boolean(value) && typeof (value == null ? void 0 : value.sectionCharacteristics) !== "undefined" && typeof (value == null ? void 0 : value.rect) !== "undefined";
|
|
91
134
|
const elementEl = (value) => /* @__PURE__ */ jsx(
|
|
@@ -149,6 +192,10 @@ const DetailSide = () => {
|
|
|
149
192
|
{
|
|
150
193
|
key: "time cost",
|
|
151
194
|
content: timeCostStrElement((_c = task == null ? void 0 : task.timing) == null ? void 0 : _c.cost)
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
key: "cache",
|
|
198
|
+
content: (task == null ? void 0 : task.cache) ? JSON.stringify(task == null ? void 0 : task.cache) : "false"
|
|
152
199
|
}
|
|
153
200
|
]
|
|
154
201
|
});
|
|
@@ -157,7 +204,10 @@ const DetailSide = () => {
|
|
|
157
204
|
taskParam = MetaKV({
|
|
158
205
|
data: [
|
|
159
206
|
{ key: "type", content: task && typeStr(task) || "" },
|
|
160
|
-
{
|
|
207
|
+
{
|
|
208
|
+
key: "param",
|
|
209
|
+
content: (_d = task == null ? void 0 : task.param) == null ? void 0 : _d.userPrompt
|
|
210
|
+
}
|
|
161
211
|
]
|
|
162
212
|
});
|
|
163
213
|
} else if ((task == null ? void 0 : task.type) === "Insight") {
|
|
@@ -167,7 +217,7 @@ const DetailSide = () => {
|
|
|
167
217
|
{
|
|
168
218
|
key: "param",
|
|
169
219
|
content: JSON.stringify(
|
|
170
|
-
((_e = task == null ? void 0 : task.param) == null ? void 0 : _e.prompt) || ((_f = task == null ? void 0 : task.param) == null ? void 0 : _f.dataDemand)
|
|
220
|
+
((_e = task == null ? void 0 : task.param) == null ? void 0 : _e.prompt) || ((_f = task == null ? void 0 : task.param) == null ? void 0 : _f.dataDemand) || ((_g = task == null ? void 0 : task.param) == null ? void 0 : _g.assertion)
|
|
171
221
|
)
|
|
172
222
|
}
|
|
173
223
|
]
|
|
@@ -178,7 +228,11 @@ const DetailSide = () => {
|
|
|
178
228
|
{ key: "type", content: task && typeStr(task) || "" },
|
|
179
229
|
{
|
|
180
230
|
key: "value",
|
|
181
|
-
content: JSON.stringify(
|
|
231
|
+
content: JSON.stringify(
|
|
232
|
+
(_h = task == null ? void 0 : task.param) == null ? void 0 : _h.value,
|
|
233
|
+
void 0,
|
|
234
|
+
2
|
|
235
|
+
)
|
|
182
236
|
}
|
|
183
237
|
]
|
|
184
238
|
});
|
|
@@ -237,14 +291,14 @@ const DetailSide = () => {
|
|
|
237
291
|
idx
|
|
238
292
|
);
|
|
239
293
|
}) : null;
|
|
240
|
-
const errorSection = (
|
|
294
|
+
const errorSection = (task == null ? void 0 : task.error) ? /* @__PURE__ */ jsx(
|
|
241
295
|
Card,
|
|
242
296
|
{
|
|
243
297
|
liteMode: true,
|
|
244
298
|
title: "Error",
|
|
245
299
|
onMouseEnter: noop,
|
|
246
300
|
onMouseLeave: noop,
|
|
247
|
-
content: /* @__PURE__ */ jsx("pre", { className: "description-content", style: { color: "#F00" }, children:
|
|
301
|
+
content: /* @__PURE__ */ jsx("pre", { className: "description-content", style: { color: "#F00" }, children: task.error })
|
|
248
302
|
}
|
|
249
303
|
) : null;
|
|
250
304
|
const dataCard = (dump == null ? void 0 : dump.data) ? /* @__PURE__ */ jsx(
|
|
@@ -256,8 +310,24 @@ const DetailSide = () => {
|
|
|
256
310
|
content: /* @__PURE__ */ jsx("pre", { children: JSON.stringify(dump.data, void 0, 2) })
|
|
257
311
|
}
|
|
258
312
|
) : null;
|
|
259
|
-
|
|
260
|
-
|
|
313
|
+
let assertionCard = null;
|
|
314
|
+
if ((task == null ? void 0 : task.type) === "Insight" && task.subType === "Assert") {
|
|
315
|
+
assertionCard = /* @__PURE__ */ jsx(
|
|
316
|
+
Card,
|
|
317
|
+
{
|
|
318
|
+
liteMode: true,
|
|
319
|
+
title: "Assert",
|
|
320
|
+
onMouseEnter: noop,
|
|
321
|
+
onMouseLeave: noop,
|
|
322
|
+
content: /* @__PURE__ */ jsx("pre", { className: "description-content", children: JSON.stringify(
|
|
323
|
+
task.output,
|
|
324
|
+
void 0,
|
|
325
|
+
2
|
|
326
|
+
) })
|
|
327
|
+
}
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
const plans = (_i = task == null ? void 0 : task.output) == null ? void 0 : _i.plans;
|
|
261
331
|
let timelineData = [];
|
|
262
332
|
if (plans) {
|
|
263
333
|
timelineData = timelineData.concat(
|
|
@@ -282,6 +352,7 @@ const DetailSide = () => {
|
|
|
282
352
|
/* @__PURE__ */ jsxs("div", { className: "item-list item-list-space-up", children: [
|
|
283
353
|
errorSection,
|
|
284
354
|
dataCard,
|
|
355
|
+
assertionCard,
|
|
285
356
|
matchedSectionsEl,
|
|
286
357
|
matchedElementsEl,
|
|
287
358
|
/* @__PURE__ */ jsx(Timeline, { items: timelineData })
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
overflow: hidden;
|
|
7
7
|
z-index: 10;
|
|
8
8
|
text-align: center;
|
|
9
|
-
border: 1px solid #
|
|
9
|
+
border: 1px solid #E5E5E5;
|
|
10
10
|
box-sizing: border-box;
|
|
11
|
-
background: #
|
|
11
|
+
background: #F8F8F8;
|
|
12
12
|
box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.2);
|
|
13
13
|
}
|
|
14
14
|
.global-hover-preview img {
|
|
@@ -8,7 +8,9 @@ const GlobalHoverPreview = () => {
|
|
|
8
8
|
const wrapperRef = useRef(null);
|
|
9
9
|
const hoverTask = useExecutionDump((store) => store.hoverTask);
|
|
10
10
|
const hoverTimestamp = useExecutionDump((store) => store.hoverTimestamp);
|
|
11
|
-
const hoverPreviewConfig = useExecutionDump(
|
|
11
|
+
const hoverPreviewConfig = useExecutionDump(
|
|
12
|
+
(store) => store.hoverPreviewConfig
|
|
13
|
+
);
|
|
12
14
|
const [imageW, setImageW] = useState(size);
|
|
13
15
|
const [imageH, setImageH] = useState(size);
|
|
14
16
|
const images = (_a = hoverTask == null ? void 0 : hoverTask.recorder) == null ? void 0 : _a.filter((item) => {
|
|
@@ -29,19 +31,30 @@ const GlobalHoverPreview = () => {
|
|
|
29
31
|
left = x + widthInPractice > clientWidth ? clientWidth - widthInPractice : x;
|
|
30
32
|
top = y + heightInPractice > clientHeight ? clientHeight - heightInPractice : y;
|
|
31
33
|
}
|
|
32
|
-
return shouldShow ? /* @__PURE__ */ jsx(
|
|
33
|
-
"
|
|
34
|
+
return shouldShow ? /* @__PURE__ */ jsx(
|
|
35
|
+
"div",
|
|
34
36
|
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
className: "global-hover-preview",
|
|
38
|
+
style: { left, top },
|
|
39
|
+
ref: wrapperRef,
|
|
40
|
+
children: (images == null ? void 0 : images.length) ? (
|
|
41
|
+
// biome-ignore lint/a11y/useAltText: <explanation>
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
"img",
|
|
44
|
+
{
|
|
45
|
+
src: images[0],
|
|
46
|
+
onLoad: (img) => {
|
|
47
|
+
const imgElement = img.target;
|
|
48
|
+
const width = imgElement.naturalWidth;
|
|
49
|
+
const height = imgElement.naturalHeight;
|
|
50
|
+
setImageW(width);
|
|
51
|
+
setImageH(height);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
) : null
|
|
43
56
|
}
|
|
44
|
-
) : null
|
|
57
|
+
) : null;
|
|
45
58
|
};
|
|
46
59
|
var global_hover_preview_default = GlobalHoverPreview;
|
|
47
60
|
export {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
.task-list-name {
|
|
2
2
|
padding: 2px 10px;
|
|
3
3
|
font-weight: bold;
|
|
4
|
-
background: #
|
|
5
|
-
border-top: 1px solid #
|
|
6
|
-
border-bottom: 1px solid #
|
|
4
|
+
background: #F8F8F8;
|
|
5
|
+
border-top: 1px solid #E5E5E5;
|
|
6
|
+
border-bottom: 1px solid #E5E5E5;
|
|
7
7
|
margin-top: -1px;
|
|
8
8
|
}
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
justify-content: space-between;
|
|
5
5
|
width: 100%;
|
|
6
6
|
height: 100%;
|
|
7
|
-
border-right: 1px solid #
|
|
7
|
+
border-right: 1px solid #E5E5E5;
|
|
8
8
|
overflow: auto;
|
|
9
|
-
background: #
|
|
9
|
+
background: #F8F8F8;
|
|
10
10
|
}
|
|
11
11
|
.side-bar .brand {
|
|
12
12
|
padding: 10px 5px;
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
border-top: 1px solid none;
|
|
26
26
|
}
|
|
27
27
|
.side-bar .side-seperator.side-seperator-line {
|
|
28
|
-
border-top: 1px solid #
|
|
28
|
+
border-top: 1px solid #E5E5E5;
|
|
29
29
|
}
|
|
30
30
|
.side-bar .side-seperator.side-seperator-space-up {
|
|
31
31
|
margin-top: 10px;
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
}
|
|
36
36
|
.side-bar .side-sub-title {
|
|
37
37
|
padding: 0 10px;
|
|
38
|
-
|
|
38
|
+
margin-bottom: 6px;
|
|
39
39
|
}
|
|
40
40
|
.side-bar .side-item {
|
|
41
41
|
cursor: pointer;
|
|
@@ -43,15 +43,10 @@
|
|
|
43
43
|
padding: 2px 0;
|
|
44
44
|
}
|
|
45
45
|
.side-bar .side-item:hover {
|
|
46
|
-
background: #
|
|
47
|
-
color: #333;
|
|
46
|
+
background: #dcdcdc80;
|
|
48
47
|
}
|
|
49
48
|
.side-bar .side-item.selected {
|
|
50
|
-
background: #
|
|
51
|
-
color: #ffffff;
|
|
52
|
-
}
|
|
53
|
-
.side-bar .side-item.selected .status-text {
|
|
54
|
-
color: #ffffff;
|
|
49
|
+
background: #bfc4da80;
|
|
55
50
|
}
|
|
56
51
|
.side-bar .side-item .side-item-content {
|
|
57
52
|
padding: 0 10px 0 calc(10px + 16px);
|
|
@@ -73,7 +68,7 @@
|
|
|
73
68
|
margin-top: -5px;
|
|
74
69
|
}
|
|
75
70
|
.side-bar .side-item-name .status-icon-success {
|
|
76
|
-
color: #
|
|
71
|
+
color: #2B8243;
|
|
77
72
|
}
|
|
78
73
|
.side-bar .side-item-name .status-icon-fail {
|
|
79
74
|
color: #ff0a0a;
|