@midscene/visualizer 1.7.4 → 1.7.5-beta-20260420031652.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/config-selector/index.mjs +2 -2
- package/dist/es/component/history-selector/index.css +83 -16
- package/dist/es/component/history-selector/index.mjs +2 -2
- package/dist/es/component/playground/index.css +193 -1
- package/dist/es/component/playground-result/index.css +28 -0
- package/dist/es/component/playground-result/index.mjs +39 -54
- package/dist/es/component/prompt-input/index.css +165 -1
- package/dist/es/component/prompt-input/index.mjs +305 -130
- package/dist/es/component/universal-playground/index.css +47 -15
- package/dist/es/component/universal-playground/index.mjs +162 -102
- package/dist/es/utils/action-label.mjs +14 -0
- package/dist/es/utils/playground-utils.mjs +1 -9
- package/dist/es/utils/prompt-input-utils.mjs +45 -0
- package/dist/lib/component/config-selector/index.js +2 -2
- package/dist/lib/component/history-selector/index.css +83 -16
- package/dist/lib/component/history-selector/index.js +2 -2
- package/dist/lib/component/playground/index.css +193 -1
- package/dist/lib/component/playground-result/index.css +28 -0
- package/dist/lib/component/playground-result/index.js +39 -54
- package/dist/lib/component/prompt-input/index.css +165 -1
- package/dist/lib/component/prompt-input/index.js +307 -130
- package/dist/lib/component/universal-playground/index.css +47 -15
- package/dist/lib/component/universal-playground/index.js +161 -101
- package/dist/lib/utils/action-label.js +51 -0
- package/dist/lib/utils/playground-utils.js +2 -10
- package/dist/lib/utils/prompt-input-utils.js +82 -0
- package/dist/types/component/config-selector/index.d.ts +2 -0
- package/dist/types/component/history-selector/index.d.ts +2 -0
- package/dist/types/component/prompt-input/index.d.ts +2 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types.d.ts +50 -0
- package/dist/types/utils/action-label.d.ts +11 -0
- package/dist/types/utils/playground-utils.d.ts +6 -1
- package/dist/types/utils/prompt-input-utils.d.ts +24 -0
- package/package.json +5 -5
|
@@ -43,12 +43,18 @@ const external_react_namespaceObject = require("react");
|
|
|
43
43
|
var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
|
|
44
44
|
const history_js_namespaceObject = require("../../store/history.js");
|
|
45
45
|
const external_types_js_namespaceObject = require("../../types.js");
|
|
46
|
+
const action_label_js_namespaceObject = require("../../utils/action-label.js");
|
|
46
47
|
const constants_js_namespaceObject = require("../../utils/constants.js");
|
|
47
48
|
const device_capabilities_js_namespaceObject = require("../../utils/device-capabilities.js");
|
|
48
49
|
const playground_utils_js_namespaceObject = require("../../utils/playground-utils.js");
|
|
50
|
+
const prompt_input_utils_js_namespaceObject = require("../../utils/prompt-input-utils.js");
|
|
49
51
|
const index_js_namespaceObject = require("../config-selector/index.js");
|
|
50
52
|
const external_form_field_index_js_namespaceObject = require("../form-field/index.js");
|
|
51
53
|
const external_history_selector_index_js_namespaceObject = require("../history-selector/index.js");
|
|
54
|
+
const external_icons_history_js_namespaceObject = require("../../icons/history.js");
|
|
55
|
+
var external_icons_history_js_default = /*#__PURE__*/ __webpack_require__.n(external_icons_history_js_namespaceObject);
|
|
56
|
+
const setting_js_namespaceObject = require("../../icons/setting.js");
|
|
57
|
+
var setting_js_default = /*#__PURE__*/ __webpack_require__.n(setting_js_namespaceObject);
|
|
52
58
|
function _define_property(obj, key, value) {
|
|
53
59
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
54
60
|
value: value,
|
|
@@ -73,10 +79,14 @@ function _object_spread(target) {
|
|
|
73
79
|
return target;
|
|
74
80
|
}
|
|
75
81
|
const { TextArea } = external_antd_namespaceObject.Input;
|
|
76
|
-
const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMode, stoppable, loading, onRun, onStop, clearPromptAfterRun = true, actionSpace, hideDomAndScreenshotOptions = false, deviceType })=>{
|
|
82
|
+
const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMode, stoppable, loading, onRun, onStop, clearPromptAfterRun = true, actionSpace, hideDomAndScreenshotOptions = false, deviceType, chrome })=>{
|
|
77
83
|
const [hoveringSettings, setHoveringSettings] = (0, external_react_namespaceObject.useState)(false);
|
|
78
84
|
const [promptValue, setPromptValue] = (0, external_react_namespaceObject.useState)('');
|
|
85
|
+
const [minimalHasExplicitTypeSelection, setMinimalHasExplicitTypeSelection] = (0, external_react_namespaceObject.useState)(false);
|
|
79
86
|
const placeholder = (0, playground_utils_js_namespaceObject.getPlaceholderForType)(selectedType);
|
|
87
|
+
const isMinimalChrome = (null == chrome ? void 0 : chrome.variant) === 'minimal';
|
|
88
|
+
const resolvedPlaceholder = (null == chrome ? void 0 : chrome.placeholder) || placeholder;
|
|
89
|
+
const actionButtonLabel = (0, action_label_js_namespaceObject.getPromptInputActionLabel)(selectedType, null == chrome ? void 0 : chrome.primaryActionLabel);
|
|
80
90
|
const textAreaRef = (0, external_react_namespaceObject.useRef)(null);
|
|
81
91
|
const modeRadioGroupRef = (0, external_react_namespaceObject.useRef)(null);
|
|
82
92
|
const params = external_antd_namespaceObject.Form.useWatch('params', form);
|
|
@@ -89,6 +99,7 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
|
|
|
89
99
|
history,
|
|
90
100
|
selectedType
|
|
91
101
|
]);
|
|
102
|
+
const skipMinimalSyncRef = (0, external_react_namespaceObject.useRef)(false);
|
|
92
103
|
const needsStructuredParams = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
93
104
|
if (actionSpace) {
|
|
94
105
|
const action = actionSpace.find((a)=>a.interfaceAlias === selectedType || a.name === selectedType);
|
|
@@ -179,22 +190,116 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
|
|
|
179
190
|
hideDomAndScreenshotOptions,
|
|
180
191
|
deviceType
|
|
181
192
|
]);
|
|
182
|
-
const availableDropdownMethods = (0, external_react_namespaceObject.useMemo)(()=>
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
193
|
+
const availableDropdownMethods = (0, external_react_namespaceObject.useMemo)(()=>(0, prompt_input_utils_js_namespaceObject.getAvailablePromptActionTypes)(actionSpace), [
|
|
194
|
+
actionSpace
|
|
195
|
+
]);
|
|
196
|
+
const hiddenDropdownAPIs = (0, external_react_namespaceObject.useMemo)(()=>availableDropdownMethods.filter((api)=>!constants_js_namespaceObject.defaultMainButtons.includes(api)), [
|
|
197
|
+
availableDropdownMethods
|
|
198
|
+
]);
|
|
199
|
+
const handleTypeSelect = (0, external_react_namespaceObject.useCallback)((api)=>{
|
|
200
|
+
if (isMinimalChrome) setMinimalHasExplicitTypeSelection(true);
|
|
201
|
+
form.setFieldValue('type', api);
|
|
202
|
+
}, [
|
|
203
|
+
form,
|
|
204
|
+
isMinimalChrome
|
|
205
|
+
]);
|
|
206
|
+
const apiGroupDefinitions = (0, external_react_namespaceObject.useMemo)(()=>[
|
|
207
|
+
{
|
|
208
|
+
key: 'interaction-group',
|
|
209
|
+
label: 'Interaction APIs',
|
|
210
|
+
match: (api)=>{
|
|
211
|
+
var _apiMetadata_api;
|
|
212
|
+
return (null == (_apiMetadata_api = constants_js_namespaceObject.apiMetadata[api]) ? void 0 : _apiMetadata_api.group) === 'interaction';
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
key: 'extraction-group',
|
|
217
|
+
label: 'Data Extraction APIs',
|
|
218
|
+
match: (api)=>{
|
|
219
|
+
var _apiMetadata_api;
|
|
220
|
+
return (null == (_apiMetadata_api = constants_js_namespaceObject.apiMetadata[api]) ? void 0 : _apiMetadata_api.group) === 'extraction';
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
key: 'validation-group',
|
|
225
|
+
label: 'Validation APIs',
|
|
226
|
+
match: (api)=>{
|
|
227
|
+
var _apiMetadata_api;
|
|
228
|
+
return (null == (_apiMetadata_api = constants_js_namespaceObject.apiMetadata[api]) ? void 0 : _apiMetadata_api.group) === 'validation';
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
key: 'device-specific-group',
|
|
233
|
+
label: 'Device-Specific APIs',
|
|
234
|
+
match: (api)=>!constants_js_namespaceObject.apiMetadata[api]
|
|
235
|
+
}
|
|
236
|
+
], []);
|
|
237
|
+
const buildApiMenuItem = (0, external_react_namespaceObject.useCallback)((api)=>{
|
|
238
|
+
var _apiMetadata_api;
|
|
239
|
+
return {
|
|
240
|
+
key: api,
|
|
241
|
+
label: (0, playground_utils_js_namespaceObject.actionNameForType)(api),
|
|
242
|
+
title: (null == (_apiMetadata_api = constants_js_namespaceObject.apiMetadata[api]) ? void 0 : _apiMetadata_api.title) || '',
|
|
243
|
+
onClick: ()=>handleTypeSelect(api)
|
|
244
|
+
};
|
|
245
|
+
}, [
|
|
246
|
+
handleTypeSelect
|
|
247
|
+
]);
|
|
248
|
+
const hiddenApiGroupItems = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
249
|
+
const items = [];
|
|
250
|
+
for (const group of apiGroupDefinitions){
|
|
251
|
+
const apisInGroup = hiddenDropdownAPIs.filter(group.match);
|
|
252
|
+
if (0 !== apisInGroup.length) items.push({
|
|
253
|
+
key: group.key,
|
|
254
|
+
type: 'group',
|
|
255
|
+
label: group.label,
|
|
256
|
+
children: apisInGroup.map(buildApiMenuItem)
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
return items;
|
|
260
|
+
}, [
|
|
261
|
+
apiGroupDefinitions,
|
|
262
|
+
hiddenDropdownAPIs,
|
|
263
|
+
buildApiMenuItem
|
|
264
|
+
]);
|
|
265
|
+
const actionDropdownMenu = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
266
|
+
const primaryActions = constants_js_namespaceObject.defaultMainButtons.filter((api)=>'aiAct' === api || availableDropdownMethods.includes(api));
|
|
267
|
+
const items = [];
|
|
268
|
+
if (primaryActions.length > 0) items.push({
|
|
269
|
+
key: 'primary-group',
|
|
270
|
+
type: 'group',
|
|
271
|
+
label: 'Primary APIs',
|
|
272
|
+
children: primaryActions.map(buildApiMenuItem)
|
|
191
273
|
});
|
|
192
|
-
|
|
193
|
-
|
|
274
|
+
items.push(...hiddenApiGroupItems);
|
|
275
|
+
return {
|
|
276
|
+
items
|
|
277
|
+
};
|
|
278
|
+
}, [
|
|
279
|
+
availableDropdownMethods,
|
|
280
|
+
buildApiMenuItem,
|
|
281
|
+
hiddenApiGroupItems
|
|
282
|
+
]);
|
|
283
|
+
const moreApisDropdownMenu = (0, external_react_namespaceObject.useMemo)(()=>({
|
|
284
|
+
items: hiddenApiGroupItems
|
|
285
|
+
}), [
|
|
286
|
+
hiddenApiGroupItems
|
|
287
|
+
]);
|
|
288
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
289
|
+
if (!isMinimalChrome || minimalHasExplicitTypeSelection || !selectedType || 'aiAct' === selectedType) return;
|
|
290
|
+
skipMinimalSyncRef.current = false;
|
|
291
|
+
lastHistoryRef.current = null;
|
|
292
|
+
form.setFieldsValue({
|
|
293
|
+
type: 'aiAct',
|
|
294
|
+
prompt: '',
|
|
295
|
+
params: {}
|
|
194
296
|
});
|
|
195
|
-
|
|
297
|
+
setPromptValue('');
|
|
196
298
|
}, [
|
|
197
|
-
|
|
299
|
+
form,
|
|
300
|
+
minimalHasExplicitTypeSelection,
|
|
301
|
+
isMinimalChrome,
|
|
302
|
+
selectedType
|
|
198
303
|
]);
|
|
199
304
|
const getDefaultParams = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
200
305
|
if (!needsStructuredParams || !actionSpace) return {};
|
|
@@ -217,15 +322,17 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
|
|
|
217
322
|
actionSpace
|
|
218
323
|
]);
|
|
219
324
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
220
|
-
if (!form.getFieldValue('type') && lastSelectedType) form.setFieldValue('type', lastSelectedType);
|
|
325
|
+
if (!isMinimalChrome && !form.getFieldValue('type') && lastSelectedType) form.setFieldValue('type', lastSelectedType);
|
|
221
326
|
}, [
|
|
222
327
|
form,
|
|
328
|
+
isMinimalChrome,
|
|
223
329
|
lastSelectedType
|
|
224
330
|
]);
|
|
225
331
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
226
|
-
if (selectedType && selectedType !== lastSelectedType) setLastSelectedType(selectedType);
|
|
332
|
+
if (!isMinimalChrome && selectedType && selectedType !== lastSelectedType) setLastSelectedType(selectedType);
|
|
227
333
|
}, [
|
|
228
334
|
selectedType,
|
|
335
|
+
isMinimalChrome,
|
|
229
336
|
lastSelectedType,
|
|
230
337
|
setLastSelectedType
|
|
231
338
|
]);
|
|
@@ -251,6 +358,20 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
|
|
|
251
358
|
}
|
|
252
359
|
}, []);
|
|
253
360
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
361
|
+
if (skipMinimalSyncRef.current) {
|
|
362
|
+
skipMinimalSyncRef.current = false;
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
if (isMinimalChrome) {
|
|
366
|
+
const defaultParams = getDefaultParams();
|
|
367
|
+
form.setFieldsValue({
|
|
368
|
+
prompt: '',
|
|
369
|
+
params: defaultParams
|
|
370
|
+
});
|
|
371
|
+
setPromptValue('');
|
|
372
|
+
lastHistoryRef.current = null;
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
254
375
|
const lastHistory = historyForSelectedType[0];
|
|
255
376
|
if (lastHistory && lastHistoryRef.current && lastHistory.timestamp === lastHistoryRef.current.timestamp) return;
|
|
256
377
|
if (lastHistory) {
|
|
@@ -274,7 +395,8 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
|
|
|
274
395
|
selectedType,
|
|
275
396
|
historyForSelectedType,
|
|
276
397
|
form,
|
|
277
|
-
getDefaultParams
|
|
398
|
+
getDefaultParams,
|
|
399
|
+
isMinimalChrome
|
|
278
400
|
]);
|
|
279
401
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
280
402
|
const timeoutId = setTimeout(()=>{
|
|
@@ -293,6 +415,8 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
|
|
|
293
415
|
promptValue
|
|
294
416
|
]);
|
|
295
417
|
const handleSelectHistory = (0, external_react_namespaceObject.useCallback)((historyItem)=>{
|
|
418
|
+
if (isMinimalChrome) setMinimalHasExplicitTypeSelection(true);
|
|
419
|
+
skipMinimalSyncRef.current = historyItem.type !== selectedType;
|
|
296
420
|
form.setFieldsValue({
|
|
297
421
|
prompt: historyItem.prompt,
|
|
298
422
|
type: historyItem.type,
|
|
@@ -300,7 +424,9 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
|
|
|
300
424
|
});
|
|
301
425
|
setPromptValue(historyItem.prompt);
|
|
302
426
|
}, [
|
|
303
|
-
form
|
|
427
|
+
form,
|
|
428
|
+
isMinimalChrome,
|
|
429
|
+
selectedType
|
|
304
430
|
]);
|
|
305
431
|
const handlePromptChange = (0, external_react_namespaceObject.useCallback)((e)=>{
|
|
306
432
|
const value = e.target.value;
|
|
@@ -320,6 +446,11 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
|
|
|
320
446
|
needsStructuredParams,
|
|
321
447
|
actionSpace
|
|
322
448
|
]);
|
|
449
|
+
const minimalInlineFieldConfig = (0, external_react_namespaceObject.useMemo)(()=>isMinimalChrome ? (0, prompt_input_utils_js_namespaceObject.getInlineStructuredFieldConfig)(actionSpace, selectedType) : null, [
|
|
450
|
+
actionSpace,
|
|
451
|
+
isMinimalChrome,
|
|
452
|
+
selectedType
|
|
453
|
+
]);
|
|
323
454
|
const isRunButtonEnabled = (0, external_react_namespaceObject.useMemo)(()=>(0, playground_utils_js_namespaceObject.isRunButtonEnabled)(runButtonEnabled, !!needsStructuredParams, params, actionSpace, selectedType, promptValue), [
|
|
324
455
|
runButtonEnabled,
|
|
325
456
|
needsStructuredParams,
|
|
@@ -587,6 +718,162 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
|
|
|
587
718
|
selectedType,
|
|
588
719
|
stoppable
|
|
589
720
|
]);
|
|
721
|
+
const inputContent = needsAnyInput ? needsStructuredParams ? minimalInlineFieldConfig ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Form.Item, {
|
|
722
|
+
name: [
|
|
723
|
+
'params',
|
|
724
|
+
minimalInlineFieldConfig.name
|
|
725
|
+
],
|
|
726
|
+
style: {
|
|
727
|
+
margin: 0
|
|
728
|
+
},
|
|
729
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(TextArea, {
|
|
730
|
+
className: "main-side-console-input-textarea",
|
|
731
|
+
disabled: !runButtonEnabled,
|
|
732
|
+
rows: 3,
|
|
733
|
+
placeholder: 'prompt' === minimalInlineFieldConfig.name ? resolvedPlaceholder : minimalInlineFieldConfig.placeholder,
|
|
734
|
+
autoFocus: true,
|
|
735
|
+
onKeyDown: handleStructuredKeyDown
|
|
736
|
+
})
|
|
737
|
+
}) : hasSingleStructuredParam ? renderStructuredParams() : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
738
|
+
className: "structured-params-container",
|
|
739
|
+
children: renderStructuredParams()
|
|
740
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Form.Item, {
|
|
741
|
+
name: "prompt",
|
|
742
|
+
style: {
|
|
743
|
+
margin: 0
|
|
744
|
+
},
|
|
745
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(TextArea, {
|
|
746
|
+
className: "main-side-console-input-textarea",
|
|
747
|
+
disabled: !runButtonEnabled,
|
|
748
|
+
rows: 3,
|
|
749
|
+
placeholder: resolvedPlaceholder,
|
|
750
|
+
autoFocus: true,
|
|
751
|
+
onKeyDown: handleKeyDown,
|
|
752
|
+
onChange: handlePromptChange,
|
|
753
|
+
ref: textAreaRef
|
|
754
|
+
})
|
|
755
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
756
|
+
className: "no-input-method",
|
|
757
|
+
children: [
|
|
758
|
+
'Click "Run" to execute ',
|
|
759
|
+
(0, playground_utils_js_namespaceObject.actionNameForType)(selectedType)
|
|
760
|
+
]
|
|
761
|
+
});
|
|
762
|
+
if (isMinimalChrome) {
|
|
763
|
+
var _chrome_icons, _chrome_icons1, _chrome_icons2, _chrome_icons3;
|
|
764
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
765
|
+
className: "prompt-input-wrapper prompt-input-wrapper-minimal",
|
|
766
|
+
children: [
|
|
767
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Form.Item, {
|
|
768
|
+
hidden: true,
|
|
769
|
+
name: "type",
|
|
770
|
+
style: {
|
|
771
|
+
margin: 0
|
|
772
|
+
},
|
|
773
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Input, {})
|
|
774
|
+
}),
|
|
775
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
776
|
+
className: `main-side-console-input minimal-main-side-console-input ${!runButtonEnabled ? 'disabled' : ''} ${loading ? 'loading' : ''}`,
|
|
777
|
+
children: [
|
|
778
|
+
inputContent,
|
|
779
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
780
|
+
className: "minimal-toolbar-row",
|
|
781
|
+
children: [
|
|
782
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
783
|
+
className: "minimal-toolbar-left",
|
|
784
|
+
children: [
|
|
785
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Dropdown, {
|
|
786
|
+
menu: actionDropdownMenu,
|
|
787
|
+
placement: "topLeft",
|
|
788
|
+
trigger: [
|
|
789
|
+
'click'
|
|
790
|
+
],
|
|
791
|
+
disabled: !runButtonEnabled,
|
|
792
|
+
overlayClassName: "more-apis-dropdown",
|
|
793
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("button", {
|
|
794
|
+
"aria-label": `Select action type (current: ${actionButtonLabel})`,
|
|
795
|
+
className: "minimal-action-trigger",
|
|
796
|
+
disabled: !runButtonEnabled,
|
|
797
|
+
type: "button",
|
|
798
|
+
children: [
|
|
799
|
+
(null == chrome ? void 0 : null == (_chrome_icons = chrome.icons) ? void 0 : _chrome_icons.action) ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
|
|
800
|
+
alt: "",
|
|
801
|
+
className: "minimal-action-icon",
|
|
802
|
+
src: chrome.icons.action
|
|
803
|
+
}) : null,
|
|
804
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
805
|
+
className: "minimal-action-label",
|
|
806
|
+
children: actionButtonLabel
|
|
807
|
+
}),
|
|
808
|
+
(null == chrome ? void 0 : null == (_chrome_icons1 = chrome.icons) ? void 0 : _chrome_icons1.actionChevron) ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
|
|
809
|
+
alt: "",
|
|
810
|
+
className: "minimal-action-chevron",
|
|
811
|
+
src: chrome.icons.actionChevron
|
|
812
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.DownOutlined, {
|
|
813
|
+
className: "minimal-action-chevron-fallback"
|
|
814
|
+
})
|
|
815
|
+
]
|
|
816
|
+
})
|
|
817
|
+
}),
|
|
818
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_history_selector_index_js_namespaceObject.HistorySelector, {
|
|
819
|
+
onSelect: handleSelectHistory,
|
|
820
|
+
history: historyForSelectedType,
|
|
821
|
+
currentType: selectedType,
|
|
822
|
+
trigger: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
823
|
+
"aria-label": "Open prompt history",
|
|
824
|
+
className: "minimal-icon-trigger",
|
|
825
|
+
type: "button",
|
|
826
|
+
children: (null == chrome ? void 0 : null == (_chrome_icons2 = chrome.icons) ? void 0 : _chrome_icons2.history) ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
|
|
827
|
+
alt: "",
|
|
828
|
+
className: "minimal-toolbar-icon",
|
|
829
|
+
src: chrome.icons.history
|
|
830
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_icons_history_js_default(), {
|
|
831
|
+
className: "minimal-toolbar-icon minimal-toolbar-icon-history minimal-toolbar-icon-fallback",
|
|
832
|
+
width: 18,
|
|
833
|
+
height: 18
|
|
834
|
+
})
|
|
835
|
+
})
|
|
836
|
+
}),
|
|
837
|
+
hasConfigOptions ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
838
|
+
className: hoveringSettings ? 'settings-wrapper settings-wrapper-hover' : 'settings-wrapper',
|
|
839
|
+
onMouseEnter: handleMouseEnter,
|
|
840
|
+
onMouseLeave: handleMouseLeave,
|
|
841
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.ConfigSelector, {
|
|
842
|
+
enableTracking: 'In-Browser-Extension' === serviceMode,
|
|
843
|
+
showDeepLocateOption: showDeepLocateOption,
|
|
844
|
+
showDeepThinkOption: showDeepThinkOption,
|
|
845
|
+
showDataExtractionOptions: showDataExtractionOptions,
|
|
846
|
+
hideDomAndScreenshotOptions: hideDomAndScreenshotOptions,
|
|
847
|
+
deviceType: deviceType,
|
|
848
|
+
trigger: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
849
|
+
"aria-label": "Open run configuration",
|
|
850
|
+
className: "minimal-icon-trigger",
|
|
851
|
+
type: "button",
|
|
852
|
+
children: (null == chrome ? void 0 : null == (_chrome_icons3 = chrome.icons) ? void 0 : _chrome_icons3.settings) ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
|
|
853
|
+
alt: "",
|
|
854
|
+
className: "minimal-toolbar-icon",
|
|
855
|
+
src: chrome.icons.settings
|
|
856
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(setting_js_default(), {
|
|
857
|
+
className: "minimal-toolbar-icon minimal-toolbar-icon-fallback",
|
|
858
|
+
width: 16,
|
|
859
|
+
height: 16
|
|
860
|
+
})
|
|
861
|
+
})
|
|
862
|
+
})
|
|
863
|
+
}) : null
|
|
864
|
+
]
|
|
865
|
+
}),
|
|
866
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
867
|
+
className: "form-controller-wrapper",
|
|
868
|
+
children: renderActionButton()
|
|
869
|
+
})
|
|
870
|
+
]
|
|
871
|
+
})
|
|
872
|
+
]
|
|
873
|
+
})
|
|
874
|
+
]
|
|
875
|
+
});
|
|
876
|
+
}
|
|
590
877
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
591
878
|
className: "prompt-input-wrapper",
|
|
592
879
|
children: [
|
|
@@ -618,87 +905,7 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
|
|
|
618
905
|
})
|
|
619
906
|
}),
|
|
620
907
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Dropdown, {
|
|
621
|
-
menu:
|
|
622
|
-
const hiddenAPIs = availableDropdownMethods.filter((api)=>!constants_js_namespaceObject.defaultMainButtons.includes(api));
|
|
623
|
-
const groupedItems = [];
|
|
624
|
-
const interactionAPIs = hiddenAPIs.filter((api)=>{
|
|
625
|
-
var _apiMetadata_api;
|
|
626
|
-
return (null == (_apiMetadata_api = constants_js_namespaceObject.apiMetadata[api]) ? void 0 : _apiMetadata_api.group) === 'interaction';
|
|
627
|
-
});
|
|
628
|
-
if (interactionAPIs.length > 0) groupedItems.push({
|
|
629
|
-
key: 'interaction-group',
|
|
630
|
-
type: 'group',
|
|
631
|
-
label: 'Interaction APIs',
|
|
632
|
-
children: interactionAPIs.map((api)=>{
|
|
633
|
-
var _apiMetadata_api;
|
|
634
|
-
return {
|
|
635
|
-
key: api,
|
|
636
|
-
label: (0, playground_utils_js_namespaceObject.actionNameForType)(api),
|
|
637
|
-
title: (null == (_apiMetadata_api = constants_js_namespaceObject.apiMetadata[api]) ? void 0 : _apiMetadata_api.title) || '',
|
|
638
|
-
onClick: ()=>{
|
|
639
|
-
form.setFieldValue('type', api);
|
|
640
|
-
}
|
|
641
|
-
};
|
|
642
|
-
})
|
|
643
|
-
});
|
|
644
|
-
const extractionAPIs = hiddenAPIs.filter((api)=>{
|
|
645
|
-
var _apiMetadata_api;
|
|
646
|
-
return (null == (_apiMetadata_api = constants_js_namespaceObject.apiMetadata[api]) ? void 0 : _apiMetadata_api.group) === 'extraction';
|
|
647
|
-
});
|
|
648
|
-
if (extractionAPIs.length > 0) groupedItems.push({
|
|
649
|
-
key: 'extraction-group',
|
|
650
|
-
type: 'group',
|
|
651
|
-
label: 'Data Extraction APIs',
|
|
652
|
-
children: extractionAPIs.map((api)=>{
|
|
653
|
-
var _apiMetadata_api;
|
|
654
|
-
return {
|
|
655
|
-
key: api,
|
|
656
|
-
label: (0, playground_utils_js_namespaceObject.actionNameForType)(api),
|
|
657
|
-
title: (null == (_apiMetadata_api = constants_js_namespaceObject.apiMetadata[api]) ? void 0 : _apiMetadata_api.title) || '',
|
|
658
|
-
onClick: ()=>{
|
|
659
|
-
form.setFieldValue('type', api);
|
|
660
|
-
}
|
|
661
|
-
};
|
|
662
|
-
})
|
|
663
|
-
});
|
|
664
|
-
const validationAPIs = hiddenAPIs.filter((api)=>{
|
|
665
|
-
var _apiMetadata_api;
|
|
666
|
-
return (null == (_apiMetadata_api = constants_js_namespaceObject.apiMetadata[api]) ? void 0 : _apiMetadata_api.group) === 'validation';
|
|
667
|
-
});
|
|
668
|
-
if (validationAPIs.length > 0) groupedItems.push({
|
|
669
|
-
key: 'validation-group',
|
|
670
|
-
type: 'group',
|
|
671
|
-
label: 'Validation APIs',
|
|
672
|
-
children: validationAPIs.map((api)=>{
|
|
673
|
-
var _apiMetadata_api;
|
|
674
|
-
return {
|
|
675
|
-
key: api,
|
|
676
|
-
label: (0, playground_utils_js_namespaceObject.actionNameForType)(api),
|
|
677
|
-
title: (null == (_apiMetadata_api = constants_js_namespaceObject.apiMetadata[api]) ? void 0 : _apiMetadata_api.title) || '',
|
|
678
|
-
onClick: ()=>{
|
|
679
|
-
form.setFieldValue('type', api);
|
|
680
|
-
}
|
|
681
|
-
};
|
|
682
|
-
})
|
|
683
|
-
});
|
|
684
|
-
const deviceSpecificAPIs = hiddenAPIs.filter((api)=>!constants_js_namespaceObject.apiMetadata[api]);
|
|
685
|
-
if (deviceSpecificAPIs.length > 0) groupedItems.push({
|
|
686
|
-
key: 'device-specific-group',
|
|
687
|
-
type: 'group',
|
|
688
|
-
label: 'Device-Specific APIs',
|
|
689
|
-
children: deviceSpecificAPIs.map((api)=>({
|
|
690
|
-
key: api,
|
|
691
|
-
label: (0, playground_utils_js_namespaceObject.actionNameForType)(api),
|
|
692
|
-
title: '',
|
|
693
|
-
onClick: ()=>{
|
|
694
|
-
form.setFieldValue('type', api);
|
|
695
|
-
}
|
|
696
|
-
}))
|
|
697
|
-
});
|
|
698
|
-
return {
|
|
699
|
-
items: groupedItems
|
|
700
|
-
};
|
|
701
|
-
})(),
|
|
908
|
+
menu: moreApisDropdownMenu,
|
|
702
909
|
placement: "bottomLeft",
|
|
703
910
|
trigger: [
|
|
704
911
|
'click'
|
|
@@ -748,37 +955,7 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
|
|
|
748
955
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
749
956
|
className: `main-side-console-input ${!runButtonEnabled ? 'disabled' : ''} ${loading ? 'loading' : ''}`,
|
|
750
957
|
children: [
|
|
751
|
-
|
|
752
|
-
className: "structured-params-container",
|
|
753
|
-
children: renderStructuredParams()
|
|
754
|
-
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Form.Item, {
|
|
755
|
-
name: "prompt",
|
|
756
|
-
style: {
|
|
757
|
-
margin: 0
|
|
758
|
-
},
|
|
759
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(TextArea, {
|
|
760
|
-
className: "main-side-console-input-textarea",
|
|
761
|
-
disabled: !runButtonEnabled,
|
|
762
|
-
rows: 3,
|
|
763
|
-
placeholder: placeholder,
|
|
764
|
-
autoFocus: true,
|
|
765
|
-
onKeyDown: handleKeyDown,
|
|
766
|
-
onChange: handlePromptChange,
|
|
767
|
-
ref: textAreaRef
|
|
768
|
-
})
|
|
769
|
-
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
770
|
-
className: "no-input-method",
|
|
771
|
-
style: {
|
|
772
|
-
padding: '20px',
|
|
773
|
-
textAlign: 'center',
|
|
774
|
-
color: '#666',
|
|
775
|
-
fontSize: '14px'
|
|
776
|
-
},
|
|
777
|
-
children: [
|
|
778
|
-
'Click "Run" to execute ',
|
|
779
|
-
(0, playground_utils_js_namespaceObject.actionNameForType)(selectedType)
|
|
780
|
-
]
|
|
781
|
-
}),
|
|
958
|
+
inputContent,
|
|
782
959
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
783
960
|
className: "form-controller-wrapper",
|
|
784
961
|
children: renderActionButton()
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
.playground-container {
|
|
2
|
-
background: #fff;
|
|
3
|
-
flex-direction: column;
|
|
2
|
+
background: var(--midscene-surface, #fff);
|
|
4
3
|
width: 100%;
|
|
5
4
|
height: 100vh;
|
|
5
|
+
color: var(--midscene-text-primary, inherit);
|
|
6
|
+
flex-direction: column;
|
|
6
7
|
display: flex;
|
|
7
8
|
position: relative;
|
|
8
9
|
}
|
|
@@ -90,8 +91,8 @@
|
|
|
90
91
|
|
|
91
92
|
.playground-container .middle-dialog-area .scroll-to-bottom-button {
|
|
92
93
|
z-index: 10;
|
|
93
|
-
background: #fff;
|
|
94
|
-
border: 1px solid rgba(0, 0, 0, .08);
|
|
94
|
+
background: var(--midscene-surface-elevated, #fff);
|
|
95
|
+
border: 1px solid var(--midscene-border-strong, rgba(0, 0, 0, .08));
|
|
95
96
|
position: absolute;
|
|
96
97
|
bottom: 10px;
|
|
97
98
|
right: 0;
|
|
@@ -118,9 +119,9 @@
|
|
|
118
119
|
}
|
|
119
120
|
|
|
120
121
|
.playground-container .user-message-container .user-message-bubble {
|
|
121
|
-
|
|
122
|
+
background: var(--midscene-surface-muted, #f2f4f7);
|
|
123
|
+
color: var(--midscene-text-primary, rgba(0, 0, 0, .85));
|
|
122
124
|
text-align: left;
|
|
123
|
-
background: #f2f4f7;
|
|
124
125
|
border-radius: 12px;
|
|
125
126
|
max-width: 80%;
|
|
126
127
|
padding: 12px 16px;
|
|
@@ -130,8 +131,8 @@
|
|
|
130
131
|
}
|
|
131
132
|
|
|
132
133
|
.playground-container .progress-action-item {
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
background: var(--midscene-surface-muted, #f2f4f7);
|
|
135
|
+
color: var(--midscene-text-primary, #000);
|
|
135
136
|
border-radius: 8px;
|
|
136
137
|
justify-content: space-between;
|
|
137
138
|
height: 36px;
|
|
@@ -185,12 +186,12 @@
|
|
|
185
186
|
}
|
|
186
187
|
|
|
187
188
|
.playground-container .system-message-container .system-message-content {
|
|
188
|
-
color: rgba(0, 0, 0, .85);
|
|
189
|
+
color: var(--midscene-text-primary, rgba(0, 0, 0, .85));
|
|
189
190
|
font-size: 14px;
|
|
190
191
|
}
|
|
191
192
|
|
|
192
193
|
.playground-container .system-message-container .system-message-content .system-message-text {
|
|
193
|
-
color: rgba(0, 0, 0, .85);
|
|
194
|
+
color: var(--midscene-text-primary, rgba(0, 0, 0, .85));
|
|
194
195
|
font-size: 14px;
|
|
195
196
|
line-height: 25px;
|
|
196
197
|
}
|
|
@@ -237,7 +238,7 @@
|
|
|
237
238
|
}
|
|
238
239
|
|
|
239
240
|
.playground-container .new-conversation-separator .separator-line {
|
|
240
|
-
background-color: #e8e8e8;
|
|
241
|
+
background-color: var(--midscene-divider, #e8e8e8);
|
|
241
242
|
height: 1px;
|
|
242
243
|
position: absolute;
|
|
243
244
|
top: 50%;
|
|
@@ -246,20 +247,51 @@
|
|
|
246
247
|
}
|
|
247
248
|
|
|
248
249
|
.playground-container .new-conversation-separator .separator-text-container {
|
|
250
|
+
background-color: var(--midscene-surface, #fff);
|
|
249
251
|
z-index: 1;
|
|
250
|
-
background-color: #fff;
|
|
251
252
|
padding: 0 16px;
|
|
252
253
|
position: relative;
|
|
253
254
|
}
|
|
254
255
|
|
|
255
256
|
.playground-container .new-conversation-separator .separator-text-container .separator-text {
|
|
256
|
-
color: #999;
|
|
257
|
-
background-color: #fff;
|
|
257
|
+
color: var(--midscene-text-tertiary, #999);
|
|
258
|
+
background-color: var(--midscene-surface, #fff);
|
|
258
259
|
font-size: 12px;
|
|
259
260
|
}
|
|
260
261
|
|
|
262
|
+
.playground-container .progress-group-toggle {
|
|
263
|
+
cursor: pointer;
|
|
264
|
+
color: var(--midscene-text-tertiary, rgba(0, 0, 0, .5));
|
|
265
|
+
-webkit-user-select: none;
|
|
266
|
+
-moz-user-select: none;
|
|
267
|
+
user-select: none;
|
|
268
|
+
background: none;
|
|
269
|
+
border: 0;
|
|
270
|
+
align-items: center;
|
|
271
|
+
gap: 8px;
|
|
272
|
+
margin: 0 0 8px;
|
|
273
|
+
padding: 0 4px;
|
|
274
|
+
font-size: 12px;
|
|
275
|
+
font-weight: 500;
|
|
276
|
+
line-height: 15px;
|
|
277
|
+
display: inline-flex;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.playground-container .progress-group-toggle:hover {
|
|
281
|
+
color: var(--midscene-text-secondary, rgba(0, 0, 0, .7));
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.playground-container .progress-group-toggle .progress-group-toggle-chevron {
|
|
285
|
+
font-size: 10px;
|
|
286
|
+
transition: transform .15s ease-out;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.playground-container .progress-group-toggle.is-collapsed .progress-group-toggle-chevron {
|
|
290
|
+
transform: rotate(180deg);
|
|
291
|
+
}
|
|
292
|
+
|
|
261
293
|
.playground-container .bottom-input-section {
|
|
262
|
-
background-color: #fff;
|
|
294
|
+
background-color: var(--midscene-surface, #fff);
|
|
263
295
|
flex-shrink: 0;
|
|
264
296
|
padding: 16px 0 0;
|
|
265
297
|
}
|