@midscene/visualizer 0.26.2 → 0.26.3-beta-20250813021342.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/blank_polyfill.mjs +2 -0
- package/dist/es/component/blackboard.css +12 -5
- package/dist/es/component/blackboard.mjs +266 -0
- package/dist/es/component/color.mjs +35 -0
- package/dist/es/component/describer.css +9 -5
- package/dist/es/component/describer.mjs +128 -0
- package/dist/es/component/env-config.mjs +112 -0
- package/dist/es/component/github-star.css +1 -0
- package/dist/es/component/github-star.mjs +20 -0
- package/dist/es/component/logo.css +5 -3
- package/dist/es/component/logo.mjs +20 -0
- package/dist/es/component/misc.mjs +54 -0
- package/dist/es/component/pixi-loader.mjs +16 -0
- package/dist/es/component/player.css +88 -70
- package/dist/es/component/player.mjs +628 -0
- package/dist/es/component/playground/ConfigSelector.mjs +53 -0
- package/dist/es/component/playground/ContextPreview.mjs +39 -0
- package/dist/es/component/playground/HistorySelector.mjs +193 -0
- package/dist/es/component/playground/PlaygroundResult.mjs +60 -0
- package/dist/es/component/playground/PromptInput.mjs +225 -0
- package/dist/es/component/playground/ServiceModeControl.mjs +100 -0
- package/dist/es/component/playground/index.css +140 -98
- package/dist/es/component/playground/playground-constants.mjs +45 -0
- package/dist/es/component/playground/playground-utils.mjs +89 -0
- package/dist/es/component/playground/useServerValid.mjs +27 -0
- package/dist/es/component/playground/useStaticPageAgent.mjs +12 -0
- package/dist/es/component/replay-scripts.mjs +271 -0
- package/dist/es/component/shiny-text.css +33 -22
- package/dist/es/component/shiny-text.mjs +15 -0
- package/dist/es/component/store/history.mjs +55 -0
- package/dist/es/component/store/store.mjs +128 -0
- package/dist/es/icons/close.mjs +19 -0
- package/dist/es/icons/history.mjs +30 -0
- package/dist/es/icons/magnifying-glass.mjs +39 -0
- package/dist/es/icons/setting.mjs +20 -0
- package/dist/es/index.mjs +21 -0
- package/dist/es/init.mjs +10 -0
- package/dist/es/{utils.js → utils.mjs} +51 -75
- package/dist/lib/blank_polyfill.js +34 -38
- package/dist/lib/component/blackboard.css +12 -5
- package/dist/lib/component/blackboard.js +293 -306
- package/dist/lib/component/color.js +64 -74
- package/dist/lib/component/describer.css +9 -5
- package/dist/lib/component/describer.js +158 -198
- package/dist/lib/component/env-config.js +142 -147
- package/dist/lib/component/github-star.css +1 -0
- package/dist/lib/component/github-star.js +51 -62
- package/dist/lib/component/logo.css +5 -3
- package/dist/lib/component/logo.js +53 -56
- package/dist/lib/component/misc.js +85 -84
- package/dist/lib/component/pixi-loader.js +49 -80
- package/dist/lib/component/player.css +88 -70
- package/dist/lib/component/player.js +627 -738
- package/dist/lib/component/playground/ConfigSelector.js +91 -92
- package/dist/lib/component/playground/ContextPreview.js +80 -72
- package/dist/lib/component/playground/HistorySelector.js +234 -197
- package/dist/lib/component/playground/PlaygroundResult.js +100 -103
- package/dist/lib/component/playground/PromptInput.js +250 -237
- package/dist/lib/component/playground/ServiceModeControl.js +124 -124
- package/dist/lib/component/playground/index.css +140 -98
- package/dist/lib/component/playground/playground-constants.js +97 -73
- package/dist/lib/component/playground/playground-types.js +17 -31
- package/dist/lib/component/playground/playground-utils.js +140 -168
- package/dist/lib/component/playground/useServerValid.js +55 -86
- package/dist/lib/component/playground/useStaticPageAgent.js +45 -51
- package/dist/lib/component/replay-scripts.js +291 -373
- package/dist/lib/component/shiny-text.css +33 -22
- package/dist/lib/component/shiny-text.js +46 -57
- package/dist/lib/component/store/history.js +58 -64
- package/dist/lib/component/store/store.js +132 -128
- package/dist/lib/icons/close.js +53 -0
- package/dist/lib/icons/history.js +64 -0
- package/dist/lib/icons/magnifying-glass.js +73 -0
- package/dist/lib/icons/setting.js +54 -0
- package/dist/lib/index.js +158 -124
- package/dist/lib/init.js +39 -46
- package/dist/lib/utils.js +105 -109
- package/dist/types/blank_polyfill.d.ts +2 -2
- package/dist/types/component/playground/ConfigSelector.d.ts +1 -0
- package/dist/types/component/playground/ContextPreview.d.ts +1 -0
- package/dist/types/component/playground/HistorySelector.d.ts +1 -0
- package/dist/types/component/playground/PlaygroundResult.d.ts +1 -0
- package/dist/types/component/playground/PromptInput.d.ts +1 -0
- package/dist/types/component/playground/ServiceModeControl.d.ts +1 -0
- package/package.json +16 -18
- package/dist/es/assets/close.909351c0.svg +0 -4
- package/dist/es/assets/history.164a4eab.svg +0 -4
- package/dist/es/assets/magnifying-glass.9498e70e.svg +0 -12
- package/dist/es/assets/setting.80ab7285.svg +0 -11
- package/dist/es/blank_polyfill.js +0 -10
- package/dist/es/component/blackboard.js +0 -286
- package/dist/es/component/color.js +0 -49
- package/dist/es/component/describer.js +0 -173
- package/dist/es/component/env-config.js +0 -117
- package/dist/es/component/github-star.js +0 -31
- package/dist/es/component/logo.js +0 -25
- package/dist/es/component/misc.js +0 -63
- package/dist/es/component/pixi-loader.js +0 -51
- package/dist/es/component/player.js +0 -746
- package/dist/es/component/playground/ConfigSelector.js +0 -64
- package/dist/es/component/playground/ContextPreview.js +0 -42
- package/dist/es/component/playground/HistorySelector.js +0 -168
- package/dist/es/component/playground/PlaygroundResult.js +0 -73
- package/dist/es/component/playground/PromptInput.js +0 -212
- package/dist/es/component/playground/ServiceModeControl.js +0 -100
- package/dist/es/component/playground/playground-constants.js +0 -39
- package/dist/es/component/playground/playground-types.js +0 -6
- package/dist/es/component/playground/playground-utils.js +0 -141
- package/dist/es/component/playground/useServerValid.js +0 -58
- package/dist/es/component/playground/useStaticPageAgent.js +0 -20
- package/dist/es/component/replay-scripts.js +0 -361
- package/dist/es/component/shiny-text.js +0 -30
- package/dist/es/component/store/history.js +0 -34
- package/dist/es/component/store/store.js +0 -99
- package/dist/es/index.js +0 -79
- package/dist/es/init.js +0 -17
- package/dist/index.css +0 -595
- package/dist/index.js +0 -1
- package/dist/lib/assets/close.909351c0.svg +0 -4
- package/dist/lib/assets/history.164a4eab.svg +0 -4
- package/dist/lib/assets/magnifying-glass.9498e70e.svg +0 -12
- package/dist/lib/assets/setting.80ab7285.svg +0 -11
- package/dist/lib/component/common.css +0 -0
- /package/dist/es/component/{common.css → playground/playground-types.mjs} +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ArrowRightOutlined, CheckOutlined, ClockCircleOutlined, CloseOutlined, LogoutOutlined, MinusOutlined, WarningOutlined } from "@ant-design/icons";
|
|
3
|
+
function timeCostStrElement(timeCost) {
|
|
4
|
+
let str;
|
|
5
|
+
str = 'number' != typeof timeCost ? '-' : `${(timeCost / 1000).toFixed(2)}s`;
|
|
6
|
+
return /*#__PURE__*/ jsx("span", {
|
|
7
|
+
style: {
|
|
8
|
+
fontVariantNumeric: 'tabular-nums',
|
|
9
|
+
fontFeatureSettings: 'tnum'
|
|
10
|
+
},
|
|
11
|
+
children: str
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
const iconForStatus = (status)=>{
|
|
15
|
+
switch(status){
|
|
16
|
+
case 'finished':
|
|
17
|
+
case 'passed':
|
|
18
|
+
case 'success':
|
|
19
|
+
case 'connected':
|
|
20
|
+
return /*#__PURE__*/ jsx("span", {
|
|
21
|
+
style: {
|
|
22
|
+
color: '#00AD4B'
|
|
23
|
+
},
|
|
24
|
+
children: /*#__PURE__*/ jsx(CheckOutlined, {})
|
|
25
|
+
});
|
|
26
|
+
case 'finishedWithWarning':
|
|
27
|
+
return /*#__PURE__*/ jsx("span", {
|
|
28
|
+
style: {
|
|
29
|
+
color: '#f7bb05'
|
|
30
|
+
},
|
|
31
|
+
children: /*#__PURE__*/ jsx(WarningOutlined, {})
|
|
32
|
+
});
|
|
33
|
+
case 'failed':
|
|
34
|
+
case 'closed':
|
|
35
|
+
case 'timedOut':
|
|
36
|
+
case 'interrupted':
|
|
37
|
+
return /*#__PURE__*/ jsx("span", {
|
|
38
|
+
style: {
|
|
39
|
+
color: '#FF0A0A'
|
|
40
|
+
},
|
|
41
|
+
children: /*#__PURE__*/ jsx(CloseOutlined, {})
|
|
42
|
+
});
|
|
43
|
+
case 'pending':
|
|
44
|
+
return /*#__PURE__*/ jsx(ClockCircleOutlined, {});
|
|
45
|
+
case 'cancelled':
|
|
46
|
+
case 'skipped':
|
|
47
|
+
return /*#__PURE__*/ jsx(LogoutOutlined, {});
|
|
48
|
+
case 'running':
|
|
49
|
+
return /*#__PURE__*/ jsx(ArrowRightOutlined, {});
|
|
50
|
+
default:
|
|
51
|
+
return /*#__PURE__*/ jsx(MinusOutlined, {});
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
export { iconForStatus, timeCostStrElement };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "pixi.js/unsafe-eval";
|
|
2
|
+
import { Assets } from "pixi.js";
|
|
3
|
+
const globalTextureMap = new Map();
|
|
4
|
+
const loadTexture = async (img)=>{
|
|
5
|
+
if (globalTextureMap.has(img)) return;
|
|
6
|
+
return Assets.load(img).then((texture)=>{
|
|
7
|
+
globalTextureMap.set(img, texture);
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
const getTextureFromCache = (name)=>globalTextureMap.get(name);
|
|
11
|
+
const getTexture = async (name)=>{
|
|
12
|
+
if (globalTextureMap.has(name)) return globalTextureMap.get(name);
|
|
13
|
+
await loadTexture(name);
|
|
14
|
+
return globalTextureMap.get(name);
|
|
15
|
+
};
|
|
16
|
+
export { getTexture, getTextureFromCache, loadTexture };
|
|
@@ -1,167 +1,185 @@
|
|
|
1
1
|
.player-container {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
background: #f2f4f7;
|
|
4
|
+
border: 1px solid #f2f4f7;
|
|
5
|
+
border-radius: 8px;
|
|
6
|
+
flex-direction: column;
|
|
2
7
|
width: 100%;
|
|
3
|
-
height: 100%;
|
|
4
8
|
max-width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
min-height: 300px;
|
|
5
11
|
max-height: 100%;
|
|
12
|
+
margin: 0 auto;
|
|
6
13
|
padding: 12px;
|
|
7
|
-
background: #F2F4F7;
|
|
8
|
-
box-sizing: border-box;
|
|
9
|
-
border: 1px solid #F2F4F7;
|
|
10
|
-
border-radius: 8px;
|
|
11
14
|
line-height: 100%;
|
|
12
|
-
margin: 0 auto;
|
|
13
15
|
display: flex;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
overflow: visible;
|
|
16
|
-
min-height: 300px;
|
|
17
16
|
position: relative;
|
|
17
|
+
overflow: visible;
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
|
|
20
|
+
.player-container[data-fit-mode="height"] {
|
|
20
21
|
background: #fff;
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
|
|
24
|
+
.player-container[data-fit-mode="height"] .canvas-container {
|
|
25
|
+
background-color: #f2f4f7;
|
|
24
26
|
}
|
|
27
|
+
|
|
25
28
|
.player-container .canvas-container {
|
|
26
|
-
flex: 0 0 auto;
|
|
27
|
-
min-height: 200px;
|
|
28
29
|
width: 100%;
|
|
29
|
-
|
|
30
|
+
min-height: 200px;
|
|
31
|
+
aspect-ratio: var(--canvas-aspect-ratio, 16 / 9);
|
|
32
|
+
background-color: #fff;
|
|
33
|
+
border-top-left-radius: 16px;
|
|
34
|
+
border-top-right-radius: 16px;
|
|
35
|
+
flex: none;
|
|
30
36
|
justify-content: center;
|
|
31
37
|
align-items: center;
|
|
32
|
-
|
|
38
|
+
display: flex;
|
|
33
39
|
position: relative;
|
|
34
|
-
|
|
35
|
-
border-top-right-radius: 16px;
|
|
36
|
-
border-top-left-radius: 16px;
|
|
37
|
-
aspect-ratio: var(--canvas-aspect-ratio, 16/9);
|
|
40
|
+
overflow: hidden;
|
|
38
41
|
}
|
|
42
|
+
|
|
39
43
|
.player-container .canvas-container canvas {
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
object-fit: contain;
|
|
46
|
+
border: none;
|
|
40
47
|
width: 100%;
|
|
41
|
-
height: auto;
|
|
42
48
|
max-width: 100%;
|
|
49
|
+
height: auto;
|
|
43
50
|
max-height: 100%;
|
|
44
|
-
box-sizing: border-box;
|
|
45
|
-
display: block;
|
|
46
51
|
margin: 0 auto;
|
|
47
|
-
|
|
48
|
-
border: none;
|
|
52
|
+
display: block;
|
|
49
53
|
}
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
|
|
55
|
+
.player-container .canvas-container[data-fit-mode="height"] {
|
|
52
56
|
aspect-ratio: unset;
|
|
53
|
-
|
|
57
|
+
flex: auto;
|
|
54
58
|
height: auto;
|
|
59
|
+
min-height: 0;
|
|
55
60
|
}
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
|
|
62
|
+
.player-container .canvas-container[data-fit-mode="height"] canvas {
|
|
58
63
|
width: auto;
|
|
59
64
|
max-width: 100%;
|
|
65
|
+
height: 100%;
|
|
60
66
|
max-height: 100%;
|
|
61
67
|
}
|
|
62
|
-
|
|
63
|
-
|
|
68
|
+
|
|
69
|
+
.player-container .canvas-container[data-fit-mode="width"] {
|
|
70
|
+
aspect-ratio: var(--canvas-aspect-ratio, 16 / 9);
|
|
64
71
|
}
|
|
65
|
-
|
|
72
|
+
|
|
73
|
+
.player-container .canvas-container[data-fit-mode="width"] canvas {
|
|
66
74
|
width: 100%;
|
|
67
75
|
height: auto;
|
|
68
76
|
}
|
|
77
|
+
|
|
69
78
|
.player-container .player-timeline-wrapper {
|
|
79
|
+
flex: none;
|
|
70
80
|
width: 100%;
|
|
71
81
|
height: 4px;
|
|
72
|
-
flex: none;
|
|
73
82
|
margin-bottom: 2px;
|
|
74
83
|
position: relative;
|
|
75
84
|
}
|
|
85
|
+
|
|
76
86
|
.player-container .player-timeline {
|
|
87
|
+
background: #666;
|
|
88
|
+
flex-shrink: 0;
|
|
77
89
|
width: 100%;
|
|
78
90
|
height: 4px;
|
|
79
|
-
background: #666;
|
|
80
91
|
position: relative;
|
|
81
|
-
flex-shrink: 0;
|
|
82
92
|
}
|
|
93
|
+
|
|
83
94
|
.player-container .player-timeline .player-timeline-progress {
|
|
95
|
+
background: #2b83ff;
|
|
96
|
+
height: 4px;
|
|
84
97
|
transition-timing-function: linear;
|
|
85
98
|
position: absolute;
|
|
86
99
|
top: 0;
|
|
87
100
|
left: 0;
|
|
88
|
-
height: 4px;
|
|
89
|
-
background: #2B83FF;
|
|
90
101
|
}
|
|
102
|
+
|
|
91
103
|
.player-container .player-tools-wrapper {
|
|
104
|
+
box-sizing: border-box;
|
|
105
|
+
flex: none;
|
|
92
106
|
width: 100%;
|
|
93
107
|
height: 72px;
|
|
94
|
-
|
|
108
|
+
padding: 15px 16px;
|
|
95
109
|
position: relative;
|
|
96
|
-
padding-top: 15px;
|
|
97
|
-
padding-bottom: 15px;
|
|
98
|
-
padding-left: 16px;
|
|
99
|
-
padding-right: 16px;
|
|
100
|
-
box-sizing: border-box;
|
|
101
110
|
}
|
|
111
|
+
|
|
102
112
|
.player-container .player-tools {
|
|
103
|
-
width: 100%;
|
|
104
|
-
height: 42px;
|
|
105
|
-
max-width: 100%;
|
|
106
|
-
overflow: hidden;
|
|
107
113
|
color: #000;
|
|
108
|
-
font-size: 14px;
|
|
109
114
|
box-sizing: border-box;
|
|
110
|
-
display: flex;
|
|
111
115
|
flex-direction: row;
|
|
112
|
-
justify-content: space-between;
|
|
113
116
|
flex-shrink: 0;
|
|
117
|
+
justify-content: space-between;
|
|
118
|
+
width: 100%;
|
|
119
|
+
max-width: 100%;
|
|
120
|
+
height: 42px;
|
|
121
|
+
font-size: 14px;
|
|
122
|
+
display: flex;
|
|
123
|
+
overflow: hidden;
|
|
114
124
|
}
|
|
125
|
+
|
|
115
126
|
.player-container .player-tools .ant-spin {
|
|
116
127
|
color: #333;
|
|
117
128
|
}
|
|
129
|
+
|
|
118
130
|
.player-container .player-tools .player-control {
|
|
119
|
-
flex-grow: 1;
|
|
120
|
-
display: flex;
|
|
121
131
|
flex-direction: row;
|
|
132
|
+
flex-grow: 1;
|
|
122
133
|
align-items: center;
|
|
134
|
+
display: flex;
|
|
123
135
|
overflow: hidden;
|
|
124
136
|
}
|
|
137
|
+
|
|
125
138
|
.player-container .player-tools .status-icon {
|
|
126
|
-
transition: 0.2s;
|
|
127
|
-
width: 32px;
|
|
128
|
-
height: 32px;
|
|
129
139
|
border-radius: 8px;
|
|
130
|
-
display: flex;
|
|
131
|
-
align-items: center;
|
|
132
|
-
justify-content: center;
|
|
133
140
|
flex-shrink: 0;
|
|
141
|
+
justify-content: center;
|
|
142
|
+
align-items: center;
|
|
143
|
+
width: 32px;
|
|
144
|
+
height: 32px;
|
|
134
145
|
margin-left: 10px;
|
|
146
|
+
transition: all .2s;
|
|
147
|
+
display: flex;
|
|
135
148
|
}
|
|
149
|
+
|
|
136
150
|
.player-container .player-tools .status-icon:hover {
|
|
137
151
|
cursor: pointer;
|
|
138
|
-
background: #
|
|
152
|
+
background: #f0f0f0;
|
|
139
153
|
}
|
|
154
|
+
|
|
140
155
|
.player-container .player-tools .status-text {
|
|
156
|
+
flex-direction: column;
|
|
141
157
|
flex-grow: 1;
|
|
142
158
|
flex-shrink: 1;
|
|
159
|
+
justify-content: space-between;
|
|
160
|
+
width: 0;
|
|
143
161
|
min-width: 0;
|
|
144
|
-
overflow: hidden;
|
|
145
|
-
position: relative;
|
|
146
162
|
height: 100%;
|
|
147
163
|
display: flex;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
width: 0;
|
|
164
|
+
position: relative;
|
|
165
|
+
overflow: hidden;
|
|
151
166
|
}
|
|
167
|
+
|
|
152
168
|
.player-container .player-tools .title {
|
|
153
169
|
font-weight: 600;
|
|
154
170
|
}
|
|
155
|
-
|
|
156
|
-
.player-container .player-tools .subtitle {
|
|
171
|
+
|
|
172
|
+
.player-container .player-tools .title, .player-container .player-tools .subtitle {
|
|
157
173
|
text-overflow: ellipsis;
|
|
158
|
-
overflow: hidden;
|
|
159
174
|
white-space: nowrap;
|
|
160
175
|
width: 100%;
|
|
176
|
+
overflow: hidden;
|
|
161
177
|
}
|
|
178
|
+
|
|
162
179
|
.player-container .player-tools .player-tools-item {
|
|
163
|
-
height: 100%;
|
|
164
|
-
display: flex;
|
|
165
180
|
flex-direction: column;
|
|
166
181
|
justify-content: center;
|
|
182
|
+
height: 100%;
|
|
183
|
+
display: flex;
|
|
167
184
|
}
|
|
185
|
+
|