@midscene/visualizer 0.2.2 → 0.2.3-beta-20240815085544.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/assets/logo-plain.0f78df8a.png +0 -0
- package/dist/es/component/blackboard.js +32 -104
- package/dist/es/component/detail-panel.css +6 -0
- package/dist/es/component/detail-panel.js +1 -1
- package/dist/es/component/misc.js +29 -0
- package/dist/es/component/panel-title.css +5 -3
- package/dist/es/component/panel-title.js +6 -2
- package/dist/es/component/sidebar.css +1 -11
- package/dist/es/component/sidebar.js +5 -47
- package/dist/es/component/store.js +18 -20
- package/dist/es/index.css +42 -0
- package/dist/es/index.js +160 -34
- package/dist/es/utils.js +1 -1
- package/dist/index.css +445 -0
- package/dist/index.js +1 -0
- package/dist/lib/assets/logo-plain.0f78df8a.png +0 -0
- package/dist/lib/component/blackboard.js +32 -104
- package/dist/lib/component/detail-panel.css +6 -0
- package/dist/lib/component/detail-panel.js +1 -1
- package/dist/lib/component/misc.js +23 -0
- package/dist/lib/component/panel-title.css +5 -3
- package/dist/lib/component/panel-title.js +5 -1
- package/dist/lib/component/sidebar.css +1 -11
- package/dist/lib/component/sidebar.js +3 -37
- package/dist/lib/component/store.js +31 -23
- package/dist/lib/index.css +42 -0
- package/dist/lib/index.js +159 -33
- package/dist/lib/utils.js +1 -1
- package/dist/report/demo.html +5449 -0
- package/dist/report/index.css +445 -0
- package/dist/report/index.html +479 -0
- package/dist/report/index.js +1 -0
- package/dist/report/multi.html +24279 -0
- package/dist/types/component/misc.d.ts +1 -0
- package/dist/types/component/panel-title.d.ts +1 -0
- package/dist/types/component/sidebar.d.ts +0 -1
- package/dist/types/component/store.d.ts +7 -6
- package/dist/types/index.d.ts +11 -3
- package/html/tpl.html +29 -0
- package/package.json +20 -11
- package/dist/es/component/assets/logo-plain.js +0 -128
- package/dist/es/component/assets/logo-plain2.js +0 -128
- package/dist/es/demo-dump.json +0 -1
- package/dist/lib/component/assets/logo-plain.js +0 -156
- package/dist/lib/component/assets/logo-plain2.js +0 -156
- package/dist/lib/demo-dump.json +0 -1
|
Binary file
|
|
@@ -66,9 +66,6 @@ const noop = () => {
|
|
|
66
66
|
};
|
|
67
67
|
const BlackBoard = () => {
|
|
68
68
|
const dump = (0, import_store.useInsightDump)((store) => store.data);
|
|
69
|
-
const setHighlightSectionNames = (0, import_store.useInsightDump)(
|
|
70
|
-
(store) => store.setHighlightSectionNames
|
|
71
|
-
);
|
|
72
69
|
const setHighlightElements = (0, import_store.useInsightDump)(
|
|
73
70
|
(store) => store.setHighlightElements
|
|
74
71
|
);
|
|
@@ -76,17 +73,18 @@ const BlackBoard = () => {
|
|
|
76
73
|
(store) => store.highlightSectionNames
|
|
77
74
|
);
|
|
78
75
|
const highlightElements = (0, import_store.useInsightDump)((store) => store.highlightElements);
|
|
79
|
-
const
|
|
76
|
+
const highlightIds = highlightElements.map((e) => e.id);
|
|
77
|
+
const { context } = dump;
|
|
80
78
|
const { size, screenshotBase64 } = context;
|
|
81
79
|
const screenWidth = size.width;
|
|
82
80
|
const screenHeight = size.height;
|
|
83
81
|
const domRef = (0, import_react.useRef)(null);
|
|
84
82
|
const app = (0, import_react.useMemo)(() => new PIXI.Application(), []);
|
|
85
83
|
const [appInitialed, setAppInitialed] = (0, import_react.useState)(false);
|
|
86
|
-
const
|
|
87
|
-
const
|
|
84
|
+
const highlightContainer = (0, import_react.useMemo)(() => new PIXI.Container(), []);
|
|
85
|
+
const elementMarkContainer = (0, import_react.useMemo)(() => new PIXI.Container(), []);
|
|
88
86
|
const pixiBgRef = (0, import_react.useRef)();
|
|
89
|
-
const { bgVisible, setBgVisible,
|
|
87
|
+
const { bgVisible, setBgVisible, elementsVisible, setTextsVisible } = (0, import_store.useBlackboardPreference)();
|
|
90
88
|
(0, import_react.useEffect)(() => {
|
|
91
89
|
Promise.resolve(
|
|
92
90
|
(() => __async(void 0, null, function* () {
|
|
@@ -108,8 +106,8 @@ const BlackBoard = () => {
|
|
|
108
106
|
canvasEl.style.width = `${Math.floor(screenWidth * ratio)}px`;
|
|
109
107
|
canvasEl.style.height = `${Math.floor(screenHeight * ratio)}px`;
|
|
110
108
|
}
|
|
111
|
-
app.stage.addChild(
|
|
112
|
-
app.stage.addChild(
|
|
109
|
+
app.stage.addChild(highlightContainer);
|
|
110
|
+
app.stage.addChild(elementMarkContainer);
|
|
113
111
|
setAppInitialed(true);
|
|
114
112
|
}))()
|
|
115
113
|
);
|
|
@@ -159,52 +157,25 @@ const BlackBoard = () => {
|
|
|
159
157
|
texts.y = Math.max(top - (nameFontSize + 4), 0);
|
|
160
158
|
return [graphics, texts];
|
|
161
159
|
};
|
|
162
|
-
const {
|
|
163
|
-
const highlightSectionRects2 = [];
|
|
160
|
+
const { highlightElementRects } = (0, import_react.useMemo)(() => {
|
|
164
161
|
const highlightElementRects2 = [];
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
const
|
|
162
|
+
highlightContainer.removeChildren();
|
|
163
|
+
elementMarkContainer.removeChildren();
|
|
164
|
+
context.content.forEach((element) => {
|
|
165
|
+
const { rect, content, id } = element;
|
|
166
|
+
const ifHighlight = highlightIds.includes(id);
|
|
169
167
|
if (ifHighlight) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
},
|
|
180
|
-
() => {
|
|
181
|
-
setHighlightSectionNames([]);
|
|
182
|
-
}
|
|
183
|
-
);
|
|
184
|
-
itemMarkContainer.addChild(graphics);
|
|
185
|
-
textContainer.addChild(texts);
|
|
186
|
-
});
|
|
187
|
-
highlightElements.forEach((element) => {
|
|
188
|
-
const { rect } = element;
|
|
189
|
-
highlightElementRects2.push(rect);
|
|
190
|
-
if (elements.includes(element)) {
|
|
191
|
-
return;
|
|
168
|
+
const [graphics2] = rectMarkForItem(
|
|
169
|
+
rect,
|
|
170
|
+
content,
|
|
171
|
+
ifHighlight ? (0, import_color.highlightColorForType)("element") : (0, import_color.colorForName)("element", content),
|
|
172
|
+
ifHighlight ? 1 : itemFillAlpha,
|
|
173
|
+
noop,
|
|
174
|
+
noop
|
|
175
|
+
);
|
|
176
|
+
highlightContainer.addChild(graphics2);
|
|
192
177
|
}
|
|
193
|
-
const [graphics
|
|
194
|
-
rect,
|
|
195
|
-
"",
|
|
196
|
-
(0, import_color.highlightColorForType)("element"),
|
|
197
|
-
1,
|
|
198
|
-
noop,
|
|
199
|
-
noop
|
|
200
|
-
);
|
|
201
|
-
itemMarkContainer.addChild(graphics);
|
|
202
|
-
textContainer.addChild(texts);
|
|
203
|
-
});
|
|
204
|
-
elements.forEach((element) => {
|
|
205
|
-
const { rect, content } = element;
|
|
206
|
-
const ifHighlight = highlightElements.includes(element);
|
|
207
|
-
const [graphics, texts] = rectMarkForItem(
|
|
178
|
+
const [graphics] = rectMarkForItem(
|
|
208
179
|
rect,
|
|
209
180
|
content,
|
|
210
181
|
ifHighlight ? (0, import_color.highlightColorForType)("element") : (0, import_color.colorForName)("element", content),
|
|
@@ -216,47 +187,19 @@ const BlackBoard = () => {
|
|
|
216
187
|
setHighlightElements([]);
|
|
217
188
|
}
|
|
218
189
|
);
|
|
219
|
-
|
|
220
|
-
textContainer.addChild(texts);
|
|
221
|
-
});
|
|
222
|
-
sections.forEach((section) => {
|
|
223
|
-
const { content } = section;
|
|
224
|
-
const ifHighlight = highlightSectionNames.includes(section.name);
|
|
225
|
-
const sectionTheme = ifHighlight ? "#FFFFFF" : (0, import_color.colorForName)("section", section.name);
|
|
226
|
-
content.forEach((text) => {
|
|
227
|
-
const { content: content2, rect } = text;
|
|
228
|
-
const { left, top } = rect;
|
|
229
|
-
const style = new PIXI.TextStyle({
|
|
230
|
-
wordWrap: true,
|
|
231
|
-
wordWrapWidth: rect.width,
|
|
232
|
-
fontSize: 18,
|
|
233
|
-
fill: sectionTheme
|
|
234
|
-
});
|
|
235
|
-
const textElement = new PIXI.Text(content2, style);
|
|
236
|
-
textElement.x = left;
|
|
237
|
-
textElement.y = top;
|
|
238
|
-
textContainer.addChild(textElement);
|
|
239
|
-
const textBorder = new PIXI.Graphics();
|
|
240
|
-
textBorder.beginFill(11184810, 0.2);
|
|
241
|
-
textBorder.lineStyle(1, 0, 1);
|
|
242
|
-
textBorder.drawRect(left, top, rect.width, rect.height);
|
|
243
|
-
textBorder.endFill();
|
|
244
|
-
textContainer.addChild(textBorder);
|
|
245
|
-
});
|
|
190
|
+
elementMarkContainer.addChild(graphics);
|
|
246
191
|
});
|
|
247
|
-
|
|
192
|
+
elementMarkContainer.visible = elementsVisible;
|
|
248
193
|
return {
|
|
249
|
-
highlightSectionRects: highlightSectionRects2,
|
|
250
194
|
highlightElementRects: highlightElementRects2
|
|
251
195
|
};
|
|
252
196
|
}, [
|
|
253
197
|
app,
|
|
254
198
|
appInitialed,
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
highlightElements
|
|
199
|
+
highlightElements,
|
|
200
|
+
context.content
|
|
258
201
|
// bgVisible,
|
|
259
|
-
//
|
|
202
|
+
// elementsVisible,
|
|
260
203
|
]);
|
|
261
204
|
const onSetBg = (e) => {
|
|
262
205
|
setBgVisible(e.target.checked);
|
|
@@ -264,9 +207,9 @@ const BlackBoard = () => {
|
|
|
264
207
|
pixiBgRef.current.alpha = e.target.checked ? bgOnAlpha : bgOffAlpha;
|
|
265
208
|
}
|
|
266
209
|
};
|
|
267
|
-
const
|
|
210
|
+
const onSetElementsVisible = (e) => {
|
|
268
211
|
setTextsVisible(e.target.checked);
|
|
269
|
-
|
|
212
|
+
elementMarkContainer.visible = e.target.checked;
|
|
270
213
|
};
|
|
271
214
|
let bottomTipA = null;
|
|
272
215
|
if (highlightElementRects.length === 1) {
|
|
@@ -280,18 +223,6 @@ const BlackBoard = () => {
|
|
|
280
223
|
JSON.stringify(highlightElementRects)
|
|
281
224
|
] }) });
|
|
282
225
|
}
|
|
283
|
-
let bottomTipB = null;
|
|
284
|
-
if (highlightSectionRects.length === 1) {
|
|
285
|
-
bottomTipB = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "bottom-tip", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "bottom-tip-item", children: [
|
|
286
|
-
"Section: ",
|
|
287
|
-
JSON.stringify(highlightSectionRects[0])
|
|
288
|
-
] }) });
|
|
289
|
-
} else if (highlightSectionRects.length > 1) {
|
|
290
|
-
bottomTipB = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "bottom-tip", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "bottom-tip-item", children: [
|
|
291
|
-
"Sections: ",
|
|
292
|
-
JSON.stringify(highlightSectionRects)
|
|
293
|
-
] }) });
|
|
294
|
-
}
|
|
295
226
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "blackboard", children: [
|
|
296
227
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
297
228
|
"div",
|
|
@@ -303,12 +234,9 @@ const BlackBoard = () => {
|
|
|
303
234
|
),
|
|
304
235
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "blackboard-filter", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "overlay-control", children: [
|
|
305
236
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Checkbox, { checked: bgVisible, onChange: onSetBg, children: "Screenshot" }),
|
|
306
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Checkbox, { checked:
|
|
237
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Checkbox, { checked: elementsVisible, onChange: onSetElementsVisible, children: "Elements" })
|
|
307
238
|
] }) }),
|
|
308
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
309
|
-
bottomTipA,
|
|
310
|
-
bottomTipB
|
|
311
|
-
] })
|
|
239
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "bottom-tip", children: bottomTipA })
|
|
312
240
|
] });
|
|
313
241
|
};
|
|
314
242
|
var blackboard_default = BlackBoard;
|
|
@@ -22,6 +22,12 @@
|
|
|
22
22
|
.detail-panel .blackboard {
|
|
23
23
|
margin: 0 auto;
|
|
24
24
|
}
|
|
25
|
+
.detail-panel .screenshot-item-wrapper {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-wrap: wrap;
|
|
28
|
+
justify-content: space-around;
|
|
29
|
+
align-items: center;
|
|
30
|
+
}
|
|
25
31
|
.detail-panel .screenshot-item {
|
|
26
32
|
margin-bottom: 10px;
|
|
27
33
|
}
|
|
@@ -70,7 +70,7 @@ const DetailPanel = () => {
|
|
|
70
70
|
}
|
|
71
71
|
} else if (viewType === VIEW_TYPE_SCREENSHOT) {
|
|
72
72
|
if ((_a = activeTask.recorder) == null ? void 0 : _a.length) {
|
|
73
|
-
content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: activeTask.recorder.filter((item) => item.screenshot).map((item, index) => {
|
|
73
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "screenshot-item-wrapper", children: activeTask.recorder.filter((item) => item.screenshot).map((item, index) => {
|
|
74
74
|
const fullTime = (0, import_utils.timeStr)(item.ts);
|
|
75
75
|
const str = item.timing ? `${fullTime} / ${item.timing}` : fullTime;
|
|
76
76
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScreenshotItem, { time: str, img: item.screenshot }, index);
|
|
@@ -18,10 +18,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var misc_exports = {};
|
|
20
20
|
__export(misc_exports, {
|
|
21
|
+
iconForStatus: () => iconForStatus,
|
|
21
22
|
timeCostStrElement: () => timeCostStrElement
|
|
22
23
|
});
|
|
23
24
|
module.exports = __toCommonJS(misc_exports);
|
|
24
25
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_icons = require("@ant-design/icons");
|
|
25
27
|
function timeCostStrElement(timeCost) {
|
|
26
28
|
let str;
|
|
27
29
|
if (typeof timeCost !== "number") {
|
|
@@ -42,7 +44,28 @@ function timeCostStrElement(timeCost) {
|
|
|
42
44
|
}
|
|
43
45
|
);
|
|
44
46
|
}
|
|
47
|
+
const iconForStatus = (status) => {
|
|
48
|
+
switch (status) {
|
|
49
|
+
case "success":
|
|
50
|
+
case "passed":
|
|
51
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: { color: "#2B8243" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CheckCircleFilled, {}) });
|
|
52
|
+
case "failed":
|
|
53
|
+
case "timedOut":
|
|
54
|
+
case "interrupted":
|
|
55
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: { color: "#FF0A0A" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CloseCircleFilled, {}) });
|
|
56
|
+
case "pending":
|
|
57
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ClockCircleFilled, {});
|
|
58
|
+
case "cancelled":
|
|
59
|
+
case "skipped":
|
|
60
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.LogoutOutlined, {});
|
|
61
|
+
case "running":
|
|
62
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ArrowRightOutlined, {});
|
|
63
|
+
default:
|
|
64
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.MinusOutlined, {});
|
|
65
|
+
}
|
|
66
|
+
};
|
|
45
67
|
// Annotate the CommonJS export names for ESM import in node:
|
|
46
68
|
0 && (module.exports = {
|
|
69
|
+
iconForStatus,
|
|
47
70
|
timeCostStrElement
|
|
48
71
|
});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
.
|
|
2
|
-
padding: 2px 10px;
|
|
3
|
-
font-weight: bold;
|
|
1
|
+
.panel-title {
|
|
4
2
|
background: #F8F8F8;
|
|
5
3
|
border-top: 1px solid #E5E5E5;
|
|
6
4
|
border-bottom: 1px solid #E5E5E5;
|
|
7
5
|
margin-top: -1px;
|
|
6
|
+
padding: 2px 10px;
|
|
7
|
+
}
|
|
8
|
+
.panel-title .task-list-name {
|
|
9
|
+
font-weight: bold;
|
|
8
10
|
}
|
|
@@ -24,6 +24,10 @@ module.exports = __toCommonJS(panel_title_exports);
|
|
|
24
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
25
|
var import_panel_title = require("./panel-title.css");
|
|
26
26
|
const PanelTitle = (props) => {
|
|
27
|
-
|
|
27
|
+
const subTitleEl = props.subTitle ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "task-list-sub-name", children: props.subTitle }) : null;
|
|
28
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "panel-title", children: [
|
|
29
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "task-list-name", children: props.title }),
|
|
30
|
+
subTitleEl
|
|
31
|
+
] });
|
|
28
32
|
};
|
|
29
33
|
var panel_title_default = PanelTitle;
|
|
@@ -7,11 +7,7 @@
|
|
|
7
7
|
border-right: 1px solid #E5E5E5;
|
|
8
8
|
overflow: auto;
|
|
9
9
|
background: #F8F8F8;
|
|
10
|
-
|
|
11
|
-
.side-bar .brand {
|
|
12
|
-
padding: 10px 5px;
|
|
13
|
-
cursor: pointer;
|
|
14
|
-
display: flex;
|
|
10
|
+
box-sizing: border-box;
|
|
15
11
|
}
|
|
16
12
|
.side-bar .task-meta-section {
|
|
17
13
|
margin-top: 6px;
|
|
@@ -72,12 +68,6 @@
|
|
|
72
68
|
top: 50%;
|
|
73
69
|
margin-top: -5px;
|
|
74
70
|
}
|
|
75
|
-
.side-bar .side-item-name .status-icon-success {
|
|
76
|
-
color: #2B8243;
|
|
77
|
-
}
|
|
78
|
-
.side-bar .side-item-name .status-icon-fail {
|
|
79
|
-
color: #ff0a0a;
|
|
80
|
-
}
|
|
81
71
|
.side-bar .side-item-name .status-text {
|
|
82
72
|
color: #777;
|
|
83
73
|
}
|
|
@@ -38,25 +38,12 @@ var import_utils = require("../utils");
|
|
|
38
38
|
var import_icons = require("@ant-design/icons");
|
|
39
39
|
var import_antd = require("antd");
|
|
40
40
|
var import_react = require("react");
|
|
41
|
-
var import_logo_plain2 = __toESM(require("./assets/logo-plain2.js"));
|
|
42
41
|
var import_misc = require("./misc");
|
|
43
42
|
var import_panel_title = __toESM(require("./panel-title"));
|
|
44
43
|
const SideItem = (props) => {
|
|
45
44
|
var _a;
|
|
46
45
|
const { task, onClick, selected } = props;
|
|
47
46
|
const selectedClass = selected ? "selected" : "";
|
|
48
|
-
let statusIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.MinusOutlined, {});
|
|
49
|
-
if (task.status === "success") {
|
|
50
|
-
statusIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CheckCircleFilled, {});
|
|
51
|
-
} else if (task.status === "fail") {
|
|
52
|
-
statusIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CloseCircleFilled, {});
|
|
53
|
-
} else if (task.status === "pending") {
|
|
54
|
-
statusIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ClockCircleFilled, {});
|
|
55
|
-
} else if (task.status === "cancelled") {
|
|
56
|
-
statusIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.LogoutOutlined, {});
|
|
57
|
-
} else if (task.status === "running") {
|
|
58
|
-
statusIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ArrowRightOutlined, {});
|
|
59
|
-
}
|
|
60
47
|
let statusText = task.status;
|
|
61
48
|
if ((_a = task.timing) == null ? void 0 : _a.cost) {
|
|
62
49
|
statusText = (0, import_misc.timeCostStrElement)(task.timing.cost);
|
|
@@ -80,7 +67,7 @@ const SideItem = (props) => {
|
|
|
80
67
|
children: [
|
|
81
68
|
" ",
|
|
82
69
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "side-item-name", children: [
|
|
83
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className:
|
|
70
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "status-icon", children: (0, import_misc.iconForStatus)(task.status) }),
|
|
84
71
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "title", children: (0, import_utils.typeStr)(task) }),
|
|
85
72
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "status-text", children: statusText })
|
|
86
73
|
] })
|
|
@@ -89,7 +76,7 @@ const SideItem = (props) => {
|
|
|
89
76
|
);
|
|
90
77
|
};
|
|
91
78
|
const Sidebar = (props) => {
|
|
92
|
-
const
|
|
79
|
+
const groupedDump = (0, import_store.useExecutionDump)((store) => store.dump);
|
|
93
80
|
const setActiveTask = (0, import_store.useExecutionDump)((store) => store.setActiveTask);
|
|
94
81
|
const activeTask = (0, import_store.useExecutionDump)((store) => store.activeTask);
|
|
95
82
|
const setHoverTask = (0, import_store.useExecutionDump)((store) => store.setHoverTask);
|
|
@@ -129,7 +116,7 @@ const Sidebar = (props) => {
|
|
|
129
116
|
document.removeEventListener("keydown", handleKeyDown);
|
|
130
117
|
};
|
|
131
118
|
}, [currentSelectedIndex, allTasks, setActiveTask]);
|
|
132
|
-
const sideList =
|
|
119
|
+
const sideList = groupedDump ? [groupedDump].map((group, groupIndex) => {
|
|
133
120
|
const executions = group.executions.map((execution, indexOfExecution) => {
|
|
134
121
|
const { tasks } = execution;
|
|
135
122
|
const taskList = tasks.map((task, index) => {
|
|
@@ -179,27 +166,6 @@ const Sidebar = (props) => {
|
|
|
179
166
|
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "no tasks" });
|
|
180
167
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "side-bar", children: [
|
|
181
168
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "top-controls", children: [
|
|
182
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
183
|
-
"div",
|
|
184
|
-
{
|
|
185
|
-
className: "brand",
|
|
186
|
-
onClick: reset,
|
|
187
|
-
style: { display: (props == null ? void 0 : props.hideLogo) ? "none" : "flex" },
|
|
188
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
189
|
-
import_logo_plain2.default,
|
|
190
|
-
{
|
|
191
|
-
style: { width: 70, height: 70, margin: "auto" },
|
|
192
|
-
onClick: () => {
|
|
193
|
-
if (props.logoAction) {
|
|
194
|
-
props.logoAction();
|
|
195
|
-
} else {
|
|
196
|
-
location.reload();
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
)
|
|
201
|
-
}
|
|
202
|
-
),
|
|
203
169
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "task-list", children: sideList }),
|
|
204
170
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "side-seperator side-seperator-line side-seperator-space-up" }),
|
|
205
171
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "task-meta-section", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "task-meta", children: "switch: Command + Up / Down" }) })
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __defProps = Object.defineProperties;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
8
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
10
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
11
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
12
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -32,6 +34,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
32
34
|
}
|
|
33
35
|
return to;
|
|
34
36
|
};
|
|
37
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
38
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
39
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
40
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
41
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
42
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
43
|
+
mod
|
|
44
|
+
));
|
|
35
45
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
46
|
var store_exports = {};
|
|
37
47
|
__export(store_exports, {
|
|
@@ -41,18 +51,19 @@ __export(store_exports, {
|
|
|
41
51
|
useInsightDump: () => useInsightDump
|
|
42
52
|
});
|
|
43
53
|
module.exports = __toCommonJS(store_exports);
|
|
44
|
-
var
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
54
|
+
var Z = __toESM(require("zustand"));
|
|
55
|
+
const { create } = Z;
|
|
56
|
+
const useBlackboardPreference = create((set) => ({
|
|
57
|
+
bgVisible: true,
|
|
58
|
+
elementsVisible: false,
|
|
48
59
|
setBgVisible: (visible) => {
|
|
49
60
|
set({ bgVisible: visible });
|
|
50
61
|
},
|
|
51
62
|
setTextsVisible: (visible) => {
|
|
52
|
-
set({
|
|
63
|
+
set({ elementsVisible: visible });
|
|
53
64
|
}
|
|
54
65
|
}));
|
|
55
|
-
const useExecutionDump =
|
|
66
|
+
const useExecutionDump = create((set, get) => {
|
|
56
67
|
const initData = {
|
|
57
68
|
dump: null,
|
|
58
69
|
activeTask: null,
|
|
@@ -71,14 +82,12 @@ const useExecutionDump = (0, import_zustand.create)((set, get) => {
|
|
|
71
82
|
return __spreadProps(__spreadValues({}, initData), {
|
|
72
83
|
setGroupedDump: (dump) => {
|
|
73
84
|
console.log("will set ExecutionDump", dump);
|
|
74
|
-
set({
|
|
85
|
+
set(__spreadProps(__spreadValues({}, initData), {
|
|
75
86
|
dump
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
break;
|
|
81
|
-
}
|
|
87
|
+
}));
|
|
88
|
+
resetInsightDump();
|
|
89
|
+
if (dump.executions.length > 0 && dump.executions[0].tasks.length > 0) {
|
|
90
|
+
get().setActiveTask(dump.executions[0].tasks[0]);
|
|
82
91
|
}
|
|
83
92
|
},
|
|
84
93
|
setActiveTask(task) {
|
|
@@ -113,17 +122,16 @@ const useExecutionDump = (0, import_zustand.create)((set, get) => {
|
|
|
113
122
|
});
|
|
114
123
|
});
|
|
115
124
|
const useAllCurrentTasks = () => {
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return allTasks;
|
|
125
|
+
const groupedDump = useExecutionDump((store) => store.dump);
|
|
126
|
+
if (!groupedDump)
|
|
127
|
+
return [];
|
|
128
|
+
const tasksInside = groupedDump.executions.reduce(
|
|
129
|
+
(acc2, execution) => acc2.concat(execution.tasks),
|
|
130
|
+
[]
|
|
131
|
+
);
|
|
132
|
+
return tasksInside;
|
|
125
133
|
};
|
|
126
|
-
const useInsightDump =
|
|
134
|
+
const useInsightDump = create((set) => {
|
|
127
135
|
let loadId = 0;
|
|
128
136
|
const initData = {
|
|
129
137
|
_loadId: 0,
|
package/dist/lib/index.css
CHANGED
|
@@ -2,6 +2,7 @@ html,
|
|
|
2
2
|
body {
|
|
3
3
|
padding: 0;
|
|
4
4
|
margin: 0;
|
|
5
|
+
line-height: 1;
|
|
5
6
|
}
|
|
6
7
|
.rspress-nav {
|
|
7
8
|
transition: 0.2s;
|
|
@@ -46,6 +47,46 @@ footer.mt-8 {
|
|
|
46
47
|
font-size: 14px;
|
|
47
48
|
border-top: 1px solid #E5E5E5;
|
|
48
49
|
border-bottom: 1px solid #E5E5E5;
|
|
50
|
+
font-synthesis: style;
|
|
51
|
+
text-rendering: optimizelegibility;
|
|
52
|
+
-webkit-font-smoothing: antialiased;
|
|
53
|
+
line-height: 1.5;
|
|
54
|
+
}
|
|
55
|
+
.page-container blockquote,
|
|
56
|
+
.page-container dl,
|
|
57
|
+
.page-container dd,
|
|
58
|
+
.page-container h1,
|
|
59
|
+
.page-container h2,
|
|
60
|
+
.page-container h3,
|
|
61
|
+
.page-container h4,
|
|
62
|
+
.page-container h5,
|
|
63
|
+
.page-container h6,
|
|
64
|
+
.page-container hr,
|
|
65
|
+
.page-container figure,
|
|
66
|
+
.page-container p,
|
|
67
|
+
.page-container pre {
|
|
68
|
+
margin: 0;
|
|
69
|
+
}
|
|
70
|
+
.page-nav {
|
|
71
|
+
height: 30px;
|
|
72
|
+
padding: 10px;
|
|
73
|
+
border-bottom: 1px solid #E5E5E5;
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: row;
|
|
76
|
+
}
|
|
77
|
+
.page-nav .logo img {
|
|
78
|
+
height: 20px;
|
|
79
|
+
line-height: 30px;
|
|
80
|
+
vertical-align: baseline;
|
|
81
|
+
vertical-align: -webkit-baseline-middle;
|
|
82
|
+
}
|
|
83
|
+
.page-nav .playwright-case-selector {
|
|
84
|
+
margin-left: 20px;
|
|
85
|
+
line-height: 30px;
|
|
86
|
+
width: 320px;
|
|
87
|
+
}
|
|
88
|
+
.cost-str {
|
|
89
|
+
color: #777;
|
|
49
90
|
}
|
|
50
91
|
.ant-layout {
|
|
51
92
|
flex-grow: 1;
|
|
@@ -91,6 +132,7 @@ footer.mt-8 {
|
|
|
91
132
|
.main-right .main-side {
|
|
92
133
|
box-sizing: border-box;
|
|
93
134
|
overflow-y: scroll;
|
|
135
|
+
height: 100%;
|
|
94
136
|
}
|
|
95
137
|
.main-right .json-content {
|
|
96
138
|
word-wrap: break-word;
|