@midscene/visualizer 0.30.10 → 1.0.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/blackboard/index.css +8 -0
- package/dist/es/component/blackboard/index.mjs +137 -68
- package/dist/es/component/config-selector/index.mjs +102 -4
- package/dist/es/component/context-preview/index.mjs +1 -2
- package/dist/es/component/env-config/index.mjs +1 -2
- package/dist/es/component/env-config-reminder/index.css +8 -0
- package/dist/es/component/env-config-reminder/index.mjs +1 -2
- package/dist/es/component/form-field/index.mjs +5 -10
- package/dist/es/component/history-selector/index.css +38 -1
- package/dist/es/component/history-selector/index.mjs +1 -2
- package/dist/es/component/logo/index.mjs +7 -3
- package/dist/es/component/misc/index.mjs +1 -4
- package/dist/es/component/nav-actions/index.mjs +1 -2
- package/dist/es/component/nav-actions/style.css +1 -1
- package/dist/es/component/player/index.css +26 -0
- package/dist/es/component/player/index.mjs +376 -364
- package/dist/es/component/playground/index.css +291 -31
- package/dist/es/component/playground-result/index.css +10 -0
- package/dist/es/component/playground-result/index.mjs +129 -10
- package/dist/es/component/prompt-input/index.css +281 -31
- package/dist/es/component/prompt-input/index.mjs +83 -25
- package/dist/es/component/screenshot-viewer/index.css +214 -0
- package/dist/es/component/screenshot-viewer/index.mjs +282 -0
- package/dist/es/component/service-mode-control/index.mjs +1 -2
- package/dist/es/component/shiny-text/index.css +35 -3
- package/dist/es/component/shiny-text/index.mjs +3 -3
- package/dist/es/component/universal-playground/index.css +61 -1
- package/dist/es/component/universal-playground/index.mjs +106 -83
- package/dist/es/component/universal-playground/providers/context-provider.mjs +56 -18
- package/dist/es/component/universal-playground/providers/indexeddb-storage-provider.mjs +213 -139
- package/dist/es/component/universal-playground/providers/storage-provider.mjs +199 -121
- package/dist/es/hooks/usePlaygroundExecution.mjs +297 -146
- package/dist/es/hooks/usePlaygroundState.mjs +141 -75
- package/dist/es/hooks/useSafeOverrideAIConfig.mjs +2 -6
- package/dist/es/hooks/useServerValid.mjs +37 -12
- package/dist/es/hooks/useTheme.mjs +25 -0
- package/dist/es/icons/avatar.mjs +46 -4
- package/dist/es/icons/close.mjs +46 -4
- package/dist/es/icons/global-perspective.mjs +47 -5
- package/dist/es/icons/history.mjs +48 -6
- package/dist/es/icons/magnifying-glass.mjs +47 -5
- package/dist/es/icons/player-setting.mjs +48 -6
- package/dist/es/icons/setting.mjs +47 -5
- package/dist/es/icons/show-marker.mjs +47 -5
- package/dist/es/index.mjs +4 -4
- package/dist/es/store/history.mjs +46 -7
- package/dist/es/store/store.mjs +68 -2
- package/dist/es/types.mjs +1 -1
- package/dist/es/utils/constants.mjs +7 -3
- package/dist/es/utils/index.mjs +4 -1
- package/dist/es/utils/pixi-loader.mjs +37 -11
- package/dist/es/utils/replay-scripts.mjs +160 -111
- package/dist/lib/component/blackboard/index.css +8 -0
- package/dist/lib/component/blackboard/index.js +139 -70
- package/dist/lib/component/config-selector/index.js +103 -5
- package/dist/lib/component/context-preview/index.js +3 -4
- package/dist/lib/component/env-config/index.js +3 -4
- package/dist/lib/component/env-config-reminder/index.css +8 -0
- package/dist/lib/component/env-config-reminder/index.js +3 -4
- package/dist/lib/component/form-field/index.js +10 -15
- package/dist/lib/component/history-selector/index.css +38 -1
- package/dist/lib/component/history-selector/index.js +3 -4
- package/dist/lib/component/index.js +6 -8
- package/dist/lib/component/logo/index.js +9 -5
- package/dist/lib/component/misc/index.js +6 -9
- package/dist/lib/component/nav-actions/index.js +3 -4
- package/dist/lib/component/nav-actions/style.css +1 -1
- package/dist/lib/component/player/index.css +26 -0
- package/dist/lib/component/player/index.js +376 -365
- package/dist/lib/component/playground/index.css +291 -31
- package/dist/lib/component/playground/index.js +31 -33
- package/dist/lib/component/playground-result/index.css +10 -0
- package/dist/lib/component/playground-result/index.js +131 -12
- package/dist/lib/component/prompt-input/index.css +281 -31
- package/dist/lib/component/prompt-input/index.js +84 -26
- package/dist/lib/component/screenshot-viewer/index.css +214 -0
- package/dist/lib/component/screenshot-viewer/index.js +316 -0
- package/dist/lib/component/service-mode-control/index.js +3 -4
- package/dist/lib/component/shiny-text/index.css +35 -3
- package/dist/lib/component/shiny-text/index.js +5 -5
- package/dist/lib/component/universal-playground/index.css +61 -1
- package/dist/lib/component/universal-playground/index.js +108 -84
- package/dist/lib/component/universal-playground/providers/context-provider.js +58 -20
- package/dist/lib/component/universal-playground/providers/indexeddb-storage-provider.js +217 -143
- package/dist/lib/component/universal-playground/providers/storage-provider.js +207 -129
- package/dist/lib/hooks/usePlaygroundExecution.js +299 -148
- package/dist/lib/hooks/usePlaygroundState.js +143 -77
- package/dist/lib/hooks/useSafeOverrideAIConfig.js +4 -8
- package/dist/lib/hooks/useServerValid.js +39 -14
- package/dist/lib/hooks/useTheme.js +59 -0
- package/dist/lib/icons/avatar.js +48 -6
- package/dist/lib/icons/close.js +48 -6
- package/dist/lib/icons/global-perspective.js +49 -7
- package/dist/lib/icons/history.js +50 -8
- package/dist/lib/icons/magnifying-glass.js +49 -7
- package/dist/lib/icons/player-setting.js +50 -8
- package/dist/lib/icons/setting.js +49 -7
- package/dist/lib/icons/show-marker.js +49 -7
- package/dist/lib/index.js +44 -34
- package/dist/lib/store/history.js +48 -9
- package/dist/lib/store/store.js +74 -8
- package/dist/lib/types.js +3 -3
- package/dist/lib/utils/color.js +2 -2
- package/dist/lib/utils/constants.js +20 -4
- package/dist/lib/utils/index.js +10 -4
- package/dist/lib/utils/pixi-loader.js +41 -15
- package/dist/lib/utils/playground-utils.js +4 -4
- package/dist/lib/utils/replay-scripts.js +164 -115
- package/dist/types/component/config-selector/index.d.ts +2 -0
- package/dist/types/component/player/index.d.ts +0 -1
- package/dist/types/component/playground-result/index.d.ts +1 -0
- package/dist/types/component/prompt-input/index.d.ts +2 -1
- package/dist/types/component/screenshot-viewer/index.d.ts +15 -0
- package/dist/types/hooks/usePlaygroundExecution.d.ts +1 -1
- package/dist/types/hooks/usePlaygroundState.d.ts +3 -3
- package/dist/types/hooks/useTheme.d.ts +7 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/types/store/store.d.ts +18 -1
- package/dist/types/types.d.ts +14 -4
- package/dist/types/utils/constants.d.ts +5 -1
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/replay-scripts.d.ts +1 -1
- package/package.json +12 -22
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
.prompt-input-wrapper {
|
|
2
|
+
box-sizing: border-box;
|
|
2
3
|
width: 100%;
|
|
4
|
+
padding: 0 4px;
|
|
3
5
|
}
|
|
4
6
|
|
|
5
7
|
.prompt-input-wrapper .mode-radio-group-wrapper {
|
|
@@ -145,35 +147,62 @@
|
|
|
145
147
|
}
|
|
146
148
|
|
|
147
149
|
.prompt-input-wrapper .main-side-console-input {
|
|
150
|
+
z-index: 1;
|
|
151
|
+
background: linear-gradient(#fff, #fff) padding-box padding-box, linear-gradient(135deg, #4285f4 0%, #06f 25%, #7b02c5 50%, #ea4335 75%, #ff7043 100%) border-box;
|
|
152
|
+
border: 1px solid rgba(0, 0, 0, 0);
|
|
153
|
+
border-radius: 12px;
|
|
148
154
|
margin-top: 10px;
|
|
155
|
+
padding-bottom: 56px;
|
|
149
156
|
position: relative;
|
|
150
157
|
}
|
|
151
158
|
|
|
159
|
+
@keyframes hue-shift {
|
|
160
|
+
0% {
|
|
161
|
+
-webkit-filter: hue-rotate();
|
|
162
|
+
filter: hue-rotate();
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
100% {
|
|
166
|
+
-webkit-filter: hue-rotate(360deg);
|
|
167
|
+
filter: hue-rotate(360deg);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.prompt-input-wrapper .main-side-console-input:focus-within {
|
|
172
|
+
z-index: 10;
|
|
173
|
+
box-shadow: 0 0 0 3px rgba(43, 131, 255, .16);
|
|
174
|
+
}
|
|
175
|
+
|
|
152
176
|
.prompt-input-wrapper .main-side-console-input .main-side-console-input-textarea {
|
|
177
|
+
resize: none;
|
|
153
178
|
white-space: pre-wrap;
|
|
154
179
|
scrollbar-width: thin;
|
|
155
|
-
background:
|
|
156
|
-
border:
|
|
157
|
-
border-radius:
|
|
180
|
+
background: none;
|
|
181
|
+
border: none;
|
|
182
|
+
border-radius: 0;
|
|
183
|
+
outline: none;
|
|
184
|
+
min-height: 120px;
|
|
158
185
|
padding: 12px 16px;
|
|
159
186
|
line-height: 21px;
|
|
160
187
|
transition: background-color .2s;
|
|
188
|
+
position: relative;
|
|
161
189
|
overflow-y: auto;
|
|
162
190
|
}
|
|
163
191
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
192
|
+
.prompt-input-wrapper .main-side-console-input .main-side-console-input-textarea:focus {
|
|
193
|
+
box-shadow: none;
|
|
194
|
+
border: none;
|
|
195
|
+
outline: none;
|
|
196
|
+
}
|
|
168
197
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
198
|
+
.prompt-input-wrapper .main-side-console-input .main-side-console-input-textarea:focus-visible {
|
|
199
|
+
box-shadow: none;
|
|
200
|
+
border: none;
|
|
201
|
+
outline: none;
|
|
172
202
|
}
|
|
173
203
|
|
|
174
|
-
.prompt-input-wrapper .main-side-console-input .main-side-console-input-textarea:
|
|
175
|
-
|
|
176
|
-
border: 1px solid rgba(0, 0, 0, 0);
|
|
204
|
+
.prompt-input-wrapper .main-side-console-input .main-side-console-input-textarea:after {
|
|
205
|
+
display: none;
|
|
177
206
|
}
|
|
178
207
|
|
|
179
208
|
.prompt-input-wrapper .main-side-console-input .main-side-console-input-textarea::-webkit-scrollbar {
|
|
@@ -185,20 +214,35 @@
|
|
|
185
214
|
border-radius: 3px;
|
|
186
215
|
}
|
|
187
216
|
|
|
188
|
-
.prompt-input-wrapper .main-side-console-input.loading
|
|
217
|
+
.prompt-input-wrapper .main-side-console-input.loading {
|
|
189
218
|
background: linear-gradient(#fff, #fff) padding-box padding-box, linear-gradient(135deg, #4285f4 0%, #06f 25%, #7b02c5 50%, #ea4335 75%, #ff7043 100%) border-box;
|
|
190
219
|
border: 1px solid rgba(0, 0, 0, 0);
|
|
191
|
-
animation: 5s linear infinite hue-shift;
|
|
192
220
|
}
|
|
193
221
|
|
|
194
|
-
.prompt-input-wrapper .main-side-console-input
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
222
|
+
.prompt-input-wrapper .main-side-console-input.loading:before {
|
|
223
|
+
content: "";
|
|
224
|
+
-webkit-mask-composite: xor;
|
|
225
|
+
pointer-events: none;
|
|
226
|
+
z-index: -1;
|
|
227
|
+
background: linear-gradient(135deg, #4285f4 0%, #06f 25%, #7b02c5 50%, #ea4335 75%, #ff7043 100%);
|
|
228
|
+
border-radius: 12px;
|
|
229
|
+
padding: 1px;
|
|
230
|
+
animation: 5s linear infinite hue-shift;
|
|
231
|
+
position: absolute;
|
|
232
|
+
top: -1px;
|
|
233
|
+
bottom: -1px;
|
|
234
|
+
left: -1px;
|
|
235
|
+
right: -1px;
|
|
236
|
+
-webkit-mask-image: linear-gradient(#fff 0, #fff 0), linear-gradient(#fff 0, #fff 0);
|
|
237
|
+
-webkit-mask-position: 0 0, 0 0;
|
|
238
|
+
-webkit-mask-size: auto, auto;
|
|
239
|
+
-webkit-mask-repeat: repeat, repeat;
|
|
240
|
+
-webkit-mask-clip: content-box, border-box;
|
|
241
|
+
-webkit-mask-origin: content-box, border-box;
|
|
242
|
+
-webkit-mask-composite: xor;
|
|
243
|
+
mask-composite: exclude;
|
|
244
|
+
-webkit-mask-source-type: auto, auto;
|
|
245
|
+
mask-mode: match-source, match-source;
|
|
202
246
|
}
|
|
203
247
|
|
|
204
248
|
.prompt-input-wrapper .main-side-console-input.disabled .form-controller-wrapper {
|
|
@@ -206,7 +250,7 @@
|
|
|
206
250
|
}
|
|
207
251
|
|
|
208
252
|
.prompt-input-wrapper .ant-form-item-with-help + .form-controller-wrapper {
|
|
209
|
-
bottom:
|
|
253
|
+
bottom: 14px;
|
|
210
254
|
}
|
|
211
255
|
|
|
212
256
|
.prompt-input-wrapper .ant-input {
|
|
@@ -215,21 +259,50 @@
|
|
|
215
259
|
|
|
216
260
|
.prompt-input-wrapper .form-controller-wrapper {
|
|
217
261
|
box-sizing: border-box;
|
|
218
|
-
|
|
262
|
+
z-index: 1000;
|
|
263
|
+
pointer-events: none;
|
|
264
|
+
background-color: rgba(0, 0, 0, 0);
|
|
219
265
|
flex-direction: row;
|
|
220
266
|
justify-content: flex-end;
|
|
221
267
|
align-items: flex-end;
|
|
222
268
|
gap: 8px;
|
|
223
269
|
width: calc(100% - 32px);
|
|
270
|
+
height: 56px;
|
|
224
271
|
padding: 12px 0;
|
|
225
272
|
line-height: 32px;
|
|
226
273
|
transition: background-color .2s;
|
|
227
274
|
display: flex;
|
|
228
275
|
position: absolute;
|
|
229
|
-
bottom:
|
|
276
|
+
bottom: 0;
|
|
230
277
|
left: 16px;
|
|
231
278
|
}
|
|
232
279
|
|
|
280
|
+
.prompt-input-wrapper .form-controller-wrapper > * {
|
|
281
|
+
pointer-events: auto;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.prompt-input-wrapper .form-controller-wrapper.with-strategy {
|
|
285
|
+
justify-content: space-between;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.prompt-input-wrapper .planning-strategy-selector {
|
|
289
|
+
color: #2b83ff;
|
|
290
|
+
cursor: pointer;
|
|
291
|
+
align-items: center;
|
|
292
|
+
font-size: 13px;
|
|
293
|
+
transition: opacity .2s;
|
|
294
|
+
display: inline-flex;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.prompt-input-wrapper .planning-strategy-selector:hover {
|
|
298
|
+
opacity: .8;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.prompt-input-wrapper .ant-dropdown-menu-item-selected {
|
|
302
|
+
color: #2b83ff !important;
|
|
303
|
+
background-color: #e6f4ff !important;
|
|
304
|
+
}
|
|
305
|
+
|
|
233
306
|
.prompt-input-wrapper .settings-wrapper {
|
|
234
307
|
color: #777;
|
|
235
308
|
flex-flow: wrap;
|
|
@@ -322,11 +395,6 @@
|
|
|
322
395
|
border-color: #40a9ff;
|
|
323
396
|
}
|
|
324
397
|
|
|
325
|
-
.prompt-input-wrapper .structured-params-container .structured-params .ant-input:focus, .prompt-input-wrapper .structured-params-container .structured-params .ant-input-number:focus, .prompt-input-wrapper .structured-params-container .structured-params .ant-select:focus, .prompt-input-wrapper .structured-params-container .structured-params .ant-input:focus-within, .prompt-input-wrapper .structured-params-container .structured-params .ant-input-number:focus-within, .prompt-input-wrapper .structured-params-container .structured-params .ant-select:focus-within {
|
|
326
|
-
border-color: #40a9ff;
|
|
327
|
-
box-shadow: 0 0 0 2px rgba(24, 144, 255, .2);
|
|
328
|
-
}
|
|
329
|
-
|
|
330
398
|
.prompt-input-wrapper .structured-params-container .structured-params textarea.ant-input {
|
|
331
399
|
padding-bottom: 5px;
|
|
332
400
|
}
|
|
@@ -389,3 +457,185 @@
|
|
|
389
457
|
color: #2b83ff;
|
|
390
458
|
}
|
|
391
459
|
|
|
460
|
+
.more-apis-dropdown .ant-dropdown-menu {
|
|
461
|
+
scrollbar-width: thin;
|
|
462
|
+
max-height: 400px;
|
|
463
|
+
overflow-y: auto;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
.more-apis-dropdown .ant-dropdown-menu::-webkit-scrollbar {
|
|
467
|
+
width: 6px;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
.more-apis-dropdown .ant-dropdown-menu::-webkit-scrollbar-track {
|
|
471
|
+
background: #f1f1f1;
|
|
472
|
+
border-radius: 3px;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.more-apis-dropdown .ant-dropdown-menu::-webkit-scrollbar-thumb {
|
|
476
|
+
background: #c1c1c1;
|
|
477
|
+
border-radius: 3px;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.more-apis-dropdown .ant-dropdown-menu::-webkit-scrollbar-thumb:hover {
|
|
481
|
+
background: #a8a8a8;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
[data-theme="dark"] .prompt-input-wrapper .mode-radio-group-wrapper .mode-radio-group .ant-radio-button-wrapper {
|
|
485
|
+
color: #f8fafd !important;
|
|
486
|
+
background-color: rgba(255, 255, 255, .08) !important;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
[data-theme="dark"] .prompt-input-wrapper .mode-radio-group-wrapper .mode-radio-group .ant-radio-button-wrapper.ant-radio-button-wrapper-checked {
|
|
490
|
+
color: #fff !important;
|
|
491
|
+
background-color: #2b83ff !important;
|
|
492
|
+
border-color: #2b83ff !important;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
[data-theme="dark"] .prompt-input-wrapper .mode-radio-group-wrapper .mode-radio-group .more-apis-button {
|
|
496
|
+
color: #f8fafd !important;
|
|
497
|
+
background-color: rgba(255, 255, 255, .08) !important;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
[data-theme="dark"] .prompt-input-wrapper .mode-radio-group-wrapper .mode-radio-group .more-apis-button:hover {
|
|
501
|
+
background-color: rgba(255, 255, 255, .12) !important;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
[data-theme="dark"] .prompt-input-wrapper .mode-radio-group-wrapper .mode-radio-group .more-apis-button.selected-from-dropdown {
|
|
505
|
+
color: #fff !important;
|
|
506
|
+
background-color: #2b83ff !important;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
[data-theme="dark"] .prompt-input-wrapper .mode-radio-group-wrapper .action-icons {
|
|
510
|
+
background: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(31, 31, 31, .5) 20%, rgba(31, 31, 31, .8) 40%, rgba(31, 31, 31, .95) 60%, #1f1f1f 70%) !important;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
[data-theme="dark"] .prompt-input-wrapper .main-side-console-input {
|
|
514
|
+
background: #1f1f1f !important;
|
|
515
|
+
border-color: rgba(255, 255, 255, .12) !important;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
[data-theme="dark"] .prompt-input-wrapper .main-side-console-input:focus-within {
|
|
519
|
+
background: linear-gradient(#1f1f1f, #1f1f1f) padding-box padding-box, linear-gradient(135deg, #4285f4 0%, #06f 25%, #7b02c5 50%, #ea4335 75%, #ff7043 100%) border-box !important;
|
|
520
|
+
border: 1px solid rgba(0, 0, 0, 0) !important;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
[data-theme="dark"] .prompt-input-wrapper .main-side-console-input .main-side-console-input-textarea {
|
|
524
|
+
color: #f8fafd !important;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
[data-theme="dark"] .prompt-input-wrapper .main-side-console-input.loading {
|
|
528
|
+
background: linear-gradient(#1f1f1f, #1f1f1f) padding-box padding-box, linear-gradient(135deg, #4285f4 0%, #06f 25%, #7b02c5 50%, #ea4335 75%, #ff7043 100%) border-box !important;
|
|
529
|
+
border: 1px solid rgba(0, 0, 0, 0) !important;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
[data-theme="dark"] .prompt-input-wrapper .ant-form-item-control-input-content .ant-input, [data-theme="dark"] .prompt-input-wrapper .ant-form-item-control-input-content textarea.ant-input {
|
|
533
|
+
color: #f8fafd !important;
|
|
534
|
+
background: rgba(255, 255, 255, .04) !important;
|
|
535
|
+
border-color: rgba(255, 255, 255, .12) !important;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
[data-theme="dark"] .prompt-input-wrapper .ant-form-item-control-input-content .ant-btn {
|
|
539
|
+
color: #f8fafd !important;
|
|
540
|
+
background-color: rgba(255, 255, 255, .08) !important;
|
|
541
|
+
border-color: rgba(255, 255, 255, .12) !important;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
[data-theme="dark"] .prompt-input-wrapper .ant-form-item-control-input-content .ant-btn.ant-btn-primary {
|
|
545
|
+
color: #fff !important;
|
|
546
|
+
background-color: #2b83ff !important;
|
|
547
|
+
border-color: #2b83ff !important;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
[data-theme="dark"] .prompt-input-wrapper .form-controller-wrapper {
|
|
551
|
+
background-color: rgba(0, 0, 0, 0) !important;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
[data-theme="dark"] .prompt-input-wrapper .planning-strategy-selector {
|
|
555
|
+
color: #2b83ff !important;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
[data-theme="dark"] .prompt-input-wrapper .planning-strategy-selector:hover {
|
|
559
|
+
opacity: .8;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
[data-theme="dark"] .prompt-input-wrapper .ant-dropdown-menu-item-selected {
|
|
563
|
+
color: #2b83ff !important;
|
|
564
|
+
background-color: rgba(43, 131, 255, .15) !important;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
[data-theme="dark"] .prompt-input-wrapper .structured-params-container {
|
|
568
|
+
background: linear-gradient(#1f1f1f, #1f1f1f) padding-box padding-box, linear-gradient(135deg, #4285f4 0%, #06f 25%, #7b02c5 50%, #ea4335 75%, #ff7043 100%) border-box !important;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
[data-theme="dark"] .prompt-input-wrapper .structured-params-container .structured-params .ant-form-item-label > label {
|
|
572
|
+
color: #f8fafd !important;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
[data-theme="dark"] .prompt-input-wrapper .structured-params-container .structured-params .ant-input, [data-theme="dark"] .prompt-input-wrapper .structured-params-container .structured-params .ant-input-number, [data-theme="dark"] .prompt-input-wrapper .structured-params-container .structured-params .ant-select, [data-theme="dark"] .prompt-input-wrapper .structured-params-container .structured-params .ant-radio-group .ant-radio-button-wrapper {
|
|
576
|
+
color: #f8fafd !important;
|
|
577
|
+
background-color: rgba(255, 255, 255, .04) !important;
|
|
578
|
+
border-color: rgba(255, 255, 255, .12) !important;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
[data-theme="dark"] .prompt-input-wrapper .structured-params-container .structured-params .ant-radio-group .ant-radio-button-wrapper.ant-radio-button-wrapper-checked {
|
|
582
|
+
color: #fff !important;
|
|
583
|
+
background-color: #2b83ff !important;
|
|
584
|
+
border-color: #2b83ff !important;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
[data-theme="dark"] .prompt-input .tip-button {
|
|
588
|
+
background-color: rgba(255, 255, 255, .08);
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
[data-theme="dark"] .prompt-input .tip-button.active {
|
|
592
|
+
color: #fff;
|
|
593
|
+
background-color: #2b83ff;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
[data-theme="dark"] .prompt-input .prompt-textarea-wrapper {
|
|
597
|
+
background-color: rgba(255, 255, 255, .04);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
[data-theme="dark"] .prompt-input .prompt-textarea-wrapper:hover, [data-theme="dark"] .prompt-input .prompt-textarea-wrapper.focused {
|
|
601
|
+
background-color: rgba(255, 255, 255, .08);
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
[data-theme="dark"] .prompt-input .btn-wrapper .btn-item {
|
|
605
|
+
color: #fff;
|
|
606
|
+
background-color: #2b83ff;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
[data-theme="dark"] .prompt-input .btn-wrapper .btn-item:hover {
|
|
610
|
+
background-color: #2b83ff;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
[data-theme="dark"] .prompt-input .dropdown-content {
|
|
614
|
+
background-color: #1f1f1f;
|
|
615
|
+
border-color: rgba(255, 255, 255, .12);
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
[data-theme="dark"] .prompt-input .param-label {
|
|
619
|
+
color: #f8fafd;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
[data-theme="dark"] .prompt-input .error-message {
|
|
623
|
+
color: #ff4d4f;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
[data-theme="dark"] .prompt-input .send-button-text {
|
|
627
|
+
color: #2b83ff;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
[data-theme="dark"] .more-apis-dropdown .ant-dropdown-menu::-webkit-scrollbar-track {
|
|
631
|
+
background: rgba(255, 255, 255, .08);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
[data-theme="dark"] .more-apis-dropdown .ant-dropdown-menu::-webkit-scrollbar-thumb {
|
|
635
|
+
background: rgba(255, 255, 255, .2);
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
[data-theme="dark"] .more-apis-dropdown .ant-dropdown-menu::-webkit-scrollbar-thumb:hover {
|
|
639
|
+
background: rgba(255, 255, 255, .3);
|
|
640
|
+
}
|
|
641
|
+
|
|
@@ -1,18 +1,41 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { BorderOutlined, DownOutlined, SendOutlined } from "@ant-design/icons";
|
|
3
3
|
import "./index.css";
|
|
4
|
-
import { Button, Dropdown, Form, Input, Radio, Tooltip } from "antd";
|
|
4
|
+
import { Button, Dropdown, Form, Input, Radio, Space, Tooltip } from "antd";
|
|
5
5
|
import react, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
import { useHistoryStore } from "../../store/history.mjs";
|
|
7
|
+
import { useEnvConfig } from "../../store/store.mjs";
|
|
7
8
|
import { extractDefaultValue, isLocateField, isZodObjectSchema, unwrapZodType } from "../../types.mjs";
|
|
8
9
|
import { apiMetadata, defaultMainButtons } from "../../utils/constants.mjs";
|
|
9
10
|
import { actionNameForType, getPlaceholderForType, isRunButtonEnabled as playground_utils_mjs_isRunButtonEnabled } from "../../utils/playground-utils.mjs";
|
|
10
11
|
import { ConfigSelector } from "../config-selector/index.mjs";
|
|
11
12
|
import { BooleanField, EnumField, LocateField, NumberField, TextField } from "../form-field/index.mjs";
|
|
12
13
|
import { HistorySelector } from "../history-selector/index.mjs";
|
|
14
|
+
function _define_property(obj, key, value) {
|
|
15
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
16
|
+
value: value,
|
|
17
|
+
enumerable: true,
|
|
18
|
+
configurable: true,
|
|
19
|
+
writable: true
|
|
20
|
+
});
|
|
21
|
+
else obj[key] = value;
|
|
22
|
+
return obj;
|
|
23
|
+
}
|
|
24
|
+
function _object_spread(target) {
|
|
25
|
+
for(var i = 1; i < arguments.length; i++){
|
|
26
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
27
|
+
var ownKeys = Object.keys(source);
|
|
28
|
+
if ("function" == typeof Object.getOwnPropertySymbols) ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
29
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
30
|
+
}));
|
|
31
|
+
ownKeys.forEach(function(key) {
|
|
32
|
+
_define_property(target, key, source[key]);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
}
|
|
13
37
|
const { TextArea } = Input;
|
|
14
|
-
const PromptInput = (
|
|
15
|
-
let { runButtonEnabled, form, serviceMode, selectedType, dryMode, stoppable, loading, onRun, onStop, clearPromptAfterRun = true, actionSpace, hideDomAndScreenshotOptions = false } = param;
|
|
38
|
+
const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMode, stoppable, loading, onRun, onStop, clearPromptAfterRun = true, actionSpace, hideDomAndScreenshotOptions = false, deviceType })=>{
|
|
16
39
|
const [hoveringSettings, setHoveringSettings] = useState(false);
|
|
17
40
|
const [promptValue, setPromptValue] = useState('');
|
|
18
41
|
const placeholder = getPlaceholderForType(selectedType);
|
|
@@ -24,6 +47,8 @@ const PromptInput = (param)=>{
|
|
|
24
47
|
const lastSelectedType = useHistoryStore((state)=>state.lastSelectedType);
|
|
25
48
|
const addHistory = useHistoryStore((state)=>state.addHistory);
|
|
26
49
|
const setLastSelectedType = useHistoryStore((state)=>state.setLastSelectedType);
|
|
50
|
+
const planningStrategy = useEnvConfig((state)=>state.planningStrategy);
|
|
51
|
+
const setPlanningStrategy = useEnvConfig((state)=>state.setPlanningStrategy);
|
|
27
52
|
const historyForSelectedType = useMemo(()=>history[selectedType] || [], [
|
|
28
53
|
history,
|
|
29
54
|
selectedType
|
|
@@ -104,12 +129,14 @@ const PromptInput = (param)=>{
|
|
|
104
129
|
const hasTracking = 'In-Browser-Extension' === serviceMode;
|
|
105
130
|
const hasDeepThink = showDeepThinkOption;
|
|
106
131
|
const hasDataExtraction = showDataExtractionOptions && !hideDomAndScreenshotOptions;
|
|
107
|
-
|
|
132
|
+
const hasDeviceOptions = 'android' === deviceType || 'ios' === deviceType;
|
|
133
|
+
return hasTracking || hasDeepThink || hasDataExtraction || hasDeviceOptions;
|
|
108
134
|
}, [
|
|
109
135
|
serviceMode,
|
|
110
136
|
showDeepThinkOption,
|
|
111
137
|
showDataExtractionOptions,
|
|
112
|
-
hideDomAndScreenshotOptions
|
|
138
|
+
hideDomAndScreenshotOptions,
|
|
139
|
+
deviceType
|
|
113
140
|
]);
|
|
114
141
|
const availableDropdownMethods = useMemo(()=>{
|
|
115
142
|
const metadataMethods = Object.keys(apiMetadata);
|
|
@@ -436,21 +463,11 @@ const PromptInput = (param)=>{
|
|
|
436
463
|
marginBottom,
|
|
437
464
|
placeholder
|
|
438
465
|
};
|
|
439
|
-
if (isLocateFieldFlag) fields.push(/*#__PURE__*/ jsx(LocateField, {
|
|
440
|
-
|
|
441
|
-
}, key));
|
|
442
|
-
else if ((null == (
|
|
443
|
-
|
|
444
|
-
}, key));
|
|
445
|
-
else if ((null == (_actualField__def1 = actualField._def) ? void 0 : _actualField__def1.typeName) === 'ZodNumber') fields.push(/*#__PURE__*/ jsx(NumberField, {
|
|
446
|
-
...fieldProps
|
|
447
|
-
}, key));
|
|
448
|
-
else if ((null == (_actualField__def2 = actualField._def) ? void 0 : _actualField__def2.typeName) === 'ZodBoolean') fields.push(/*#__PURE__*/ jsx(BooleanField, {
|
|
449
|
-
...fieldProps
|
|
450
|
-
}, key));
|
|
451
|
-
else fields.push(/*#__PURE__*/ jsx(TextField, {
|
|
452
|
-
...fieldProps
|
|
453
|
-
}, key));
|
|
466
|
+
if (isLocateFieldFlag) fields.push(/*#__PURE__*/ jsx(LocateField, _object_spread({}, fieldProps), key));
|
|
467
|
+
else if ((null == (_actualField__def = actualField._def) ? void 0 : _actualField__def.typeName) === 'ZodEnum') fields.push(/*#__PURE__*/ jsx(EnumField, _object_spread({}, fieldProps), key));
|
|
468
|
+
else if ((null == (_actualField__def1 = actualField._def) ? void 0 : _actualField__def1.typeName) === 'ZodNumber') fields.push(/*#__PURE__*/ jsx(NumberField, _object_spread({}, fieldProps), key));
|
|
469
|
+
else if ((null == (_actualField__def2 = actualField._def) ? void 0 : _actualField__def2.typeName) === 'ZodBoolean') fields.push(/*#__PURE__*/ jsx(BooleanField, _object_spread({}, fieldProps), key));
|
|
470
|
+
else fields.push(/*#__PURE__*/ jsx(TextField, _object_spread({}, fieldProps), key));
|
|
454
471
|
});
|
|
455
472
|
if ('aiScroll' === selectedType) {
|
|
456
473
|
const directionField = fields.find((field)=>/*#__PURE__*/ react.isValidElement(field) && 'direction' === field.props.name);
|
|
@@ -506,7 +523,7 @@ const PromptInput = (param)=>{
|
|
|
506
523
|
loading: loading,
|
|
507
524
|
children: text
|
|
508
525
|
});
|
|
509
|
-
if (dryMode) return '
|
|
526
|
+
if (dryMode) return 'aiAct' === selectedType ? /*#__PURE__*/ jsx(Tooltip, {
|
|
510
527
|
title: "Start executing until some interaction actions need to be performed. You can see the process of planning and locating.",
|
|
511
528
|
children: runButton('Dry Run')
|
|
512
529
|
}) : runButton('Run');
|
|
@@ -646,6 +663,7 @@ const PromptInput = (param)=>{
|
|
|
646
663
|
'click'
|
|
647
664
|
],
|
|
648
665
|
disabled: !runButtonEnabled,
|
|
666
|
+
overlayClassName: "more-apis-dropdown",
|
|
649
667
|
children: /*#__PURE__*/ jsxs(Button, {
|
|
650
668
|
className: `more-apis-button ${!defaultMainButtons.includes(selectedType) ? 'selected-from-dropdown' : ''}`,
|
|
651
669
|
children: [
|
|
@@ -672,7 +690,8 @@ const PromptInput = (param)=>{
|
|
|
672
690
|
enableTracking: 'In-Browser-Extension' === serviceMode,
|
|
673
691
|
showDeepThinkOption: showDeepThinkOption,
|
|
674
692
|
showDataExtractionOptions: showDataExtractionOptions,
|
|
675
|
-
hideDomAndScreenshotOptions: hideDomAndScreenshotOptions
|
|
693
|
+
hideDomAndScreenshotOptions: hideDomAndScreenshotOptions,
|
|
694
|
+
deviceType: deviceType
|
|
676
695
|
})
|
|
677
696
|
}),
|
|
678
697
|
/*#__PURE__*/ jsx(HistorySelector, {
|
|
@@ -718,9 +737,48 @@ const PromptInput = (param)=>{
|
|
|
718
737
|
actionNameForType(selectedType)
|
|
719
738
|
]
|
|
720
739
|
}),
|
|
721
|
-
/*#__PURE__*/
|
|
722
|
-
className:
|
|
723
|
-
children:
|
|
740
|
+
/*#__PURE__*/ jsxs("div", {
|
|
741
|
+
className: `form-controller-wrapper ${'aiAct' === selectedType ? 'with-strategy' : ''}`,
|
|
742
|
+
children: [
|
|
743
|
+
'aiAct' === selectedType && /*#__PURE__*/ jsx(Dropdown, {
|
|
744
|
+
menu: {
|
|
745
|
+
items: [
|
|
746
|
+
{
|
|
747
|
+
key: 'standard',
|
|
748
|
+
label: 'Standard',
|
|
749
|
+
onClick: ()=>setPlanningStrategy('standard')
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
key: 'fast',
|
|
753
|
+
label: 'Fast',
|
|
754
|
+
onClick: ()=>setPlanningStrategy('fast')
|
|
755
|
+
}
|
|
756
|
+
],
|
|
757
|
+
selectedKeys: [
|
|
758
|
+
planningStrategy
|
|
759
|
+
]
|
|
760
|
+
},
|
|
761
|
+
trigger: [
|
|
762
|
+
'click'
|
|
763
|
+
],
|
|
764
|
+
children: /*#__PURE__*/ jsx("a", {
|
|
765
|
+
onClick: (e)=>e.preventDefault(),
|
|
766
|
+
className: "planning-strategy-selector",
|
|
767
|
+
children: /*#__PURE__*/ jsxs(Space, {
|
|
768
|
+
size: 4,
|
|
769
|
+
children: [
|
|
770
|
+
'fast' === planningStrategy ? 'Fast' : 'Standard',
|
|
771
|
+
/*#__PURE__*/ jsx(DownOutlined, {
|
|
772
|
+
style: {
|
|
773
|
+
fontSize: 10
|
|
774
|
+
}
|
|
775
|
+
})
|
|
776
|
+
]
|
|
777
|
+
})
|
|
778
|
+
})
|
|
779
|
+
}),
|
|
780
|
+
renderActionButton()
|
|
781
|
+
]
|
|
724
782
|
})
|
|
725
783
|
]
|
|
726
784
|
})
|