@midscene/visualizer 1.7.5-beta-20260421030751.0 → 1.7.5

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.
Files changed (28) hide show
  1. package/dist/es/component/config-selector/index.mjs +7 -1
  2. package/dist/es/component/history-selector/index.css +1 -3
  3. package/dist/es/component/history-selector/index.mjs +33 -5
  4. package/dist/es/component/playground/index.css +9 -1
  5. package/dist/es/component/prompt-input/index.css +9 -1
  6. package/dist/es/component/prompt-input/index.mjs +44 -45
  7. package/dist/es/component/universal-playground/index.css +129 -0
  8. package/dist/es/component/universal-playground/index.mjs +13 -8
  9. package/dist/es/hooks/useMinimalTypeGate.mjs +47 -0
  10. package/dist/es/hooks/usePlaygroundExecution.mjs +1 -0
  11. package/dist/es/utils/progress-action-icon.mjs +49 -0
  12. package/dist/lib/component/config-selector/index.js +7 -1
  13. package/dist/lib/component/history-selector/index.css +1 -3
  14. package/dist/lib/component/history-selector/index.js +33 -5
  15. package/dist/lib/component/playground/index.css +9 -1
  16. package/dist/lib/component/prompt-input/index.css +9 -1
  17. package/dist/lib/component/prompt-input/index.js +44 -46
  18. package/dist/lib/component/universal-playground/index.css +129 -0
  19. package/dist/lib/component/universal-playground/index.js +13 -8
  20. package/dist/lib/hooks/useMinimalTypeGate.js +81 -0
  21. package/dist/lib/hooks/usePlaygroundExecution.js +1 -0
  22. package/dist/lib/utils/progress-action-icon.js +86 -0
  23. package/dist/types/component/config-selector/index.d.ts +1 -0
  24. package/dist/types/component/history-selector/index.d.ts +1 -0
  25. package/dist/types/hooks/useMinimalTypeGate.d.ts +72 -0
  26. package/dist/types/types.d.ts +32 -9
  27. package/dist/types/utils/progress-action-icon.d.ts +16 -0
  28. package/package.json +5 -5
@@ -0,0 +1,49 @@
1
+ import { AimOutlined, CheckCircleOutlined, EditOutlined, ExperimentOutlined, FileSearchOutlined, HourglassOutlined, PlayCircleOutlined, QuestionCircleOutlined, SearchOutlined, SelectOutlined, SwapOutlined, ThunderboltOutlined } from "@ant-design/icons";
2
+ import { createElement } from "react";
3
+ function defaultProgressActionIcon(kind) {
4
+ switch(kind){
5
+ case 'Planning':
6
+ return /*#__PURE__*/ createElement(ExperimentOutlined);
7
+ case 'Locate':
8
+ case 'Insight':
9
+ return /*#__PURE__*/ createElement(SearchOutlined);
10
+ case 'Tap':
11
+ case 'Click':
12
+ case 'DoubleClick':
13
+ case 'RightClick':
14
+ return /*#__PURE__*/ createElement(AimOutlined);
15
+ case 'Hover':
16
+ return /*#__PURE__*/ createElement(SelectOutlined);
17
+ case 'Input':
18
+ case 'KeyboardPress':
19
+ return /*#__PURE__*/ createElement(EditOutlined);
20
+ case 'Scroll':
21
+ case 'Swipe':
22
+ case 'PullGesture':
23
+ return /*#__PURE__*/ createElement(SwapOutlined);
24
+ case 'WaitFor':
25
+ return /*#__PURE__*/ createElement(HourglassOutlined);
26
+ case 'Assert':
27
+ case 'Boolean':
28
+ return /*#__PURE__*/ createElement(CheckCircleOutlined);
29
+ case 'Query':
30
+ case 'Number':
31
+ case 'String':
32
+ return /*#__PURE__*/ createElement(FileSearchOutlined);
33
+ case 'Ask':
34
+ return /*#__PURE__*/ createElement(QuestionCircleOutlined);
35
+ case 'Act':
36
+ return /*#__PURE__*/ createElement(PlayCircleOutlined);
37
+ default:
38
+ return /*#__PURE__*/ createElement(ThunderboltOutlined);
39
+ }
40
+ }
41
+ function resolveProgressActionIcon(kind, override) {
42
+ if (!kind) return null;
43
+ if (override) {
44
+ const custom = override(kind);
45
+ if (void 0 !== custom) return custom;
46
+ }
47
+ return defaultProgressActionIcon(kind);
48
+ }
49
+ export { defaultProgressActionIcon, resolveProgressActionIcon };
@@ -42,7 +42,7 @@ var setting_js_default = /*#__PURE__*/ __webpack_require__.n(setting_js_namespac
42
42
  const store_js_namespaceObject = require("../../store/store.js");
43
43
  const constants_js_namespaceObject = require("../../utils/constants.js");
44
44
  const device_capabilities_js_namespaceObject = require("../../utils/device-capabilities.js");
45
- const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = false, enableTracking = false, showDataExtractionOptions = false, hideDomAndScreenshotOptions = false, deviceType, trigger })=>{
45
+ const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = false, enableTracking = false, showDataExtractionOptions = false, hideDomAndScreenshotOptions = false, deviceType, trigger, popupPlacement = 'bottomRight' })=>{
46
46
  const forceSameTabNavigation = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.forceSameTabNavigation);
47
47
  const setForceSameTabNavigation = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.setForceSameTabNavigation);
48
48
  const deepLocate = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.deepLocate);
@@ -68,9 +68,15 @@ const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = fa
68
68
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
69
69
  className: "selector-trigger",
70
70
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Dropdown, {
71
+ getPopupContainer: (triggerNode)=>triggerNode.ownerDocument.body,
71
72
  menu: {
72
73
  items: configItems
73
74
  },
75
+ overlayClassName: "config-selector-dropdown",
76
+ overlayStyle: {
77
+ zIndex: 10010
78
+ },
79
+ placement: popupPlacement,
74
80
  trigger: [
75
81
  'click'
76
82
  ],
@@ -8,11 +8,9 @@
8
8
  border: 1px solid rgba(0, 0, 0, .08);
9
9
  border-radius: 12px;
10
10
  width: 320px;
11
+ max-width: min(320px, 100vw - 32px);
11
12
  height: 400px;
12
13
  position: fixed;
13
- top: auto;
14
- bottom: 20px;
15
- right: 20px;
16
14
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
17
15
  }
18
16
 
@@ -38,6 +38,7 @@ __webpack_require__.d(__webpack_exports__, {
38
38
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
39
39
  const external_antd_namespaceObject = require("antd");
40
40
  const external_react_namespaceObject = require("react");
41
+ const external_react_dom_namespaceObject = require("react-dom");
41
42
  const close_js_namespaceObject = require("../../icons/close.js");
42
43
  var close_js_default = /*#__PURE__*/ __webpack_require__.n(close_js_namespaceObject);
43
44
  const history_js_namespaceObject = require("../../icons/history.js");
@@ -47,11 +48,17 @@ var magnifying_glass_js_default = /*#__PURE__*/ __webpack_require__.n(magnifying
47
48
  const external_store_history_js_namespaceObject = require("../../store/history.js");
48
49
  require("./index.css");
49
50
  const { Text } = external_antd_namespaceObject.Typography;
50
- const HistorySelector = ({ onSelect, history, currentType, trigger })=>{
51
+ const HISTORY_MODAL_WIDTH = 320;
52
+ const HISTORY_MODAL_HEIGHT = 400;
53
+ const HISTORY_MODAL_GUTTER = 16;
54
+ const HISTORY_MODAL_OFFSET = 8;
55
+ const HistorySelector = ({ onSelect, history, currentType, trigger, popupPlacement = 'bottom' })=>{
51
56
  const [isModalOpen, setIsModalOpen] = (0, external_react_namespaceObject.useState)(false);
52
57
  const [searchText, setSearchText] = (0, external_react_namespaceObject.useState)('');
53
58
  const clearHistory = (0, external_store_history_js_namespaceObject.useHistoryStore)((state)=>state.clearHistory);
54
59
  const modalRef = (0, external_react_namespaceObject.useRef)(null);
60
+ const triggerRef = (0, external_react_namespaceObject.useRef)(null);
61
+ const [overlayPosition, setOverlayPosition] = (0, external_react_namespaceObject.useState)(null);
55
62
  const groupedHistory = (0, external_react_namespaceObject.useMemo)(()=>{
56
63
  const now = Date.now();
57
64
  const sevenDaysAgo = now - 604800000;
@@ -78,18 +85,37 @@ const HistorySelector = ({ onSelect, history, currentType, trigger })=>{
78
85
  };
79
86
  (0, external_react_namespaceObject.useEffect)(()=>{
80
87
  if (!isModalOpen) return;
88
+ const updateOverlayPosition = ()=>{
89
+ if (!triggerRef.current) return;
90
+ const triggerRect = triggerRef.current.getBoundingClientRect();
91
+ const maxLeft = Math.max(HISTORY_MODAL_GUTTER, window.innerWidth - HISTORY_MODAL_WIDTH - HISTORY_MODAL_GUTTER);
92
+ const maxTop = Math.max(HISTORY_MODAL_GUTTER, window.innerHeight - HISTORY_MODAL_HEIGHT - HISTORY_MODAL_GUTTER);
93
+ const left = Math.min(Math.max(HISTORY_MODAL_GUTTER, triggerRect.right - HISTORY_MODAL_WIDTH), maxLeft);
94
+ const preferredTop = 'top' === popupPlacement ? triggerRect.top - HISTORY_MODAL_HEIGHT - HISTORY_MODAL_OFFSET : triggerRect.bottom + HISTORY_MODAL_OFFSET;
95
+ const top = Math.min(Math.max(HISTORY_MODAL_GUTTER, preferredTop), maxTop);
96
+ setOverlayPosition({
97
+ left,
98
+ top
99
+ });
100
+ };
81
101
  const handleClickOutside = (event)=>{
82
- if (modalRef.current && !modalRef.current.contains(event.target)) setIsModalOpen(false);
102
+ if (modalRef.current && !modalRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) setIsModalOpen(false);
83
103
  };
104
+ updateOverlayPosition();
84
105
  const timer = setTimeout(()=>{
85
106
  document.addEventListener('click', handleClickOutside);
86
107
  }, 100);
108
+ window.addEventListener('resize', updateOverlayPosition);
109
+ window.addEventListener('scroll', updateOverlayPosition, true);
87
110
  return ()=>{
88
111
  clearTimeout(timer);
89
112
  document.removeEventListener('click', handleClickOutside);
113
+ window.removeEventListener('resize', updateOverlayPosition);
114
+ window.removeEventListener('scroll', updateOverlayPosition, true);
90
115
  };
91
116
  }, [
92
- isModalOpen
117
+ isModalOpen,
118
+ popupPlacement
93
119
  ]);
94
120
  const renderHistoryGroup = (title, items)=>{
95
121
  if (0 === items.length) return null;
@@ -114,14 +140,16 @@ const HistorySelector = ({ onSelect, history, currentType, trigger })=>{
114
140
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
115
141
  className: "selector-trigger",
116
142
  onClick: ()=>setIsModalOpen(true),
143
+ ref: triggerRef,
117
144
  children: null != trigger ? trigger : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(history_js_default(), {
118
145
  width: 24,
119
146
  height: 24
120
147
  })
121
148
  }),
122
- isModalOpen && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
149
+ isModalOpen && overlayPosition && /*#__PURE__*/ (0, external_react_dom_namespaceObject.createPortal)(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
123
150
  className: "history-modal-overlay",
124
151
  ref: modalRef,
152
+ style: overlayPosition,
125
153
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
126
154
  className: "history-modal-container",
127
155
  children: [
@@ -202,7 +230,7 @@ const HistorySelector = ({ onSelect, history, currentType, trigger })=>{
202
230
  })
203
231
  ]
204
232
  })
205
- })
233
+ }), document.body)
206
234
  ]
207
235
  });
208
236
  };
@@ -624,6 +624,14 @@
624
624
  height: 16px;
625
625
  }
626
626
 
627
+ .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-action-icon-fallback {
628
+ color: #878787;
629
+ flex-shrink: 0;
630
+ width: 16px;
631
+ height: 16px;
632
+ display: block;
633
+ }
634
+
627
635
  .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-action-label {
628
636
  color: #878787;
629
637
  white-space: nowrap;
@@ -805,7 +813,7 @@
805
813
  background: none !important;
806
814
  }
807
815
 
808
- [data-theme="dark"] .prompt-input-wrapper.prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-toolbar-icon-fallback {
816
+ [data-theme="dark"] .prompt-input-wrapper.prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-toolbar-icon-fallback, [data-theme="dark"] .prompt-input-wrapper.prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-action-icon-fallback {
809
817
  color: rgba(255, 255, 255, .72) !important;
810
818
  }
811
819
 
@@ -532,6 +532,14 @@
532
532
  height: 16px;
533
533
  }
534
534
 
535
+ .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-action-icon-fallback {
536
+ color: #878787;
537
+ flex-shrink: 0;
538
+ width: 16px;
539
+ height: 16px;
540
+ display: block;
541
+ }
542
+
535
543
  .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-action-label {
536
544
  color: #878787;
537
545
  white-space: nowrap;
@@ -713,7 +721,7 @@
713
721
  background: none !important;
714
722
  }
715
723
 
716
- [data-theme="dark"] .prompt-input-wrapper.prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-toolbar-icon-fallback {
724
+ [data-theme="dark"] .prompt-input-wrapper.prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-toolbar-icon-fallback, [data-theme="dark"] .prompt-input-wrapper.prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-action-icon-fallback {
717
725
  color: rgba(255, 255, 255, .72) !important;
718
726
  }
719
727
 
@@ -51,10 +51,9 @@ const prompt_input_utils_js_namespaceObject = require("../../utils/prompt-input-
51
51
  const index_js_namespaceObject = require("../config-selector/index.js");
52
52
  const external_form_field_index_js_namespaceObject = require("../form-field/index.js");
53
53
  const external_history_selector_index_js_namespaceObject = require("../history-selector/index.js");
54
+ const useMinimalTypeGate_js_namespaceObject = require("../../hooks/useMinimalTypeGate.js");
54
55
  const external_icons_history_js_namespaceObject = require("../../icons/history.js");
55
56
  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);
58
57
  function _define_property(obj, key, value) {
59
58
  if (key in obj) Object.defineProperty(obj, key, {
60
59
  value: value,
@@ -79,10 +78,15 @@ function _object_spread(target) {
79
78
  return target;
80
79
  }
81
80
  const { TextArea } = external_antd_namespaceObject.Input;
81
+ const STUDIO_MINIMAL_PROMPT_ICONS = {
82
+ action: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAASdJREFUeAHtlt3NgjAUhg8/CVx+G8gGX5xAnUDdQMcgkIgJBLbQEXQD3MAR6gZewgXgOUn9iRp6vAC96JM07YG36Zv+nBZAwySO4ymWgUoXRdEfaYGJyRElSbKyLGuHJVdpHcc5khb7RMCAZcA0TU82PYZ8IPsoZ4ttoEu0ga8bMB6DNE1X8H6jTUBuLmQL7SxkLbDkzz/ruhZBEKxfDGRZNm2aZgc9UFXVLAzDPbVvS1AUxQGrE3SPwHK8BganBy7NBuTU+r5vKLSNbG5RuwQF+hRoA9rA76RifMl4+JjI4Z5yu0KUZTnE8c4U3GbAdd3/HgYnPNu2R9eg98uIvmOGfL2M2tCpWBv4BQPiqW7j9IGWZ4CODT7X5pRAVFrUjEn7eNQ0bVwAyWpjMDlJKpAAAAAASUVORK5CYII=',
83
+ actionChevron: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAAUxJREFUeAHtUztOw0AQ3V1SuLCldP4VuEyHuQE34Aqho0tugHKCwBFyApwTYEoqyAlwCsufKkgu3NjmjfkoCDu7KSP5SaNZ774Zv9nZYWzAgH2MAdu2z4+J4apEy7I8uBDWlGV5uQNU4gRTBOd8CUfqPU3THlXjzlRIUH8HdwuLYB8wX9d1XhRFKIuVXpHjONd1XQdN0+yEED48h72iojGOr9I0fT4ULyTKPSR/aJVwPk+SZIuEET6n33uBrOmyHoTs694XSLz62cyybI3k96iEqgjodbFjAWVLVNDAnvo4dEYc4vZxOiswTXMGdXMsIyidsn7cwLbExU9mXQTeocqDe28POffo3tkBuK57UVXVG63RLz/P8w3rq2BvmH6byiSI43hD3DaZEP/68WcODMOg9z5BySs0dcEUgXl4wVzQ0h+NRhN8r9mAAaeDT7K0eaMcqhtVAAAAAElFTkSuQmCC',
84
+ settings: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAAaFJREFUeAHtlt9tgzAQxi8EJa/pBMkIHYENygalG7RvSQQKlfjz2I5ANkg3oBukG6QbtI9IIPq5ihHQOBXmFImqPwnZBvtsf9ydTfQPA77vz4IguCENDGJgOp3ux+PxLgxDnzrCsgAw/zZmGPOO48iUFci4wE42xITKXlEUO9d1X34s4NjZISZU9qCSjeKqastKWZYpMaKyNxqNto02MRDHcXmsJqvV6q7LWBYnxK4+SBOTeHDw2HAwn4aGlg9EUfQE2e+xYwchtaUeaPmAmFyUyH4W9aThA9jZ7alOiN39crl8O/FpoRpzjrq96hcgj2/wwVcNQlxb6/X6VdRrYaeNtGfUVvXbgE9iRNprOCHktPF/Z+3OeZ4fPM9LZbumgHjX2Qnr9rSioE/ma6MVBZDvWWQ/cbLR0GE5jEQoQhFLpGIkpvcuY1nOAkyeiBKJSRSXPw37UCkgbrWmaSZwsBkxoLInHBgJ6EG2KwUgn801+Tl78hyRVApkWfaIexxp4rRfqOzBUdN6+29cyYAMvQN1hCUMIbc1mUyu4VzDz4wX5wvRfah9kIOcwwAAAABJRU5ErkJggg=='
85
+ };
82
86
  const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMode, stoppable, loading, onRun, onStop, clearPromptAfterRun = true, actionSpace, hideDomAndScreenshotOptions = false, deviceType, chrome })=>{
87
+ var _chrome_icons, _chrome_icons1, _chrome_icons2;
83
88
  const [hoveringSettings, setHoveringSettings] = (0, external_react_namespaceObject.useState)(false);
84
89
  const [promptValue, setPromptValue] = (0, external_react_namespaceObject.useState)('');
85
- const [minimalHasExplicitTypeSelection, setMinimalHasExplicitTypeSelection] = (0, external_react_namespaceObject.useState)(false);
86
90
  const placeholder = (0, playground_utils_js_namespaceObject.getPlaceholderForType)(selectedType);
87
91
  const isMinimalChrome = (null == chrome ? void 0 : chrome.variant) === 'minimal';
88
92
  const resolvedPlaceholder = (null == chrome ? void 0 : chrome.placeholder) || placeholder;
@@ -99,7 +103,16 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
99
103
  history,
100
104
  selectedType
101
105
  ]);
102
- const skipMinimalSyncRef = (0, external_react_namespaceObject.useRef)(false);
106
+ const handleMinimalTypeGateReset = (0, external_react_namespaceObject.useCallback)(()=>{
107
+ lastHistoryRef.current = null;
108
+ setPromptValue('');
109
+ }, []);
110
+ const { markExplicitSelection, skipNextRestore, shouldSkipRestoreOnce } = (0, useMinimalTypeGate_js_namespaceObject.useMinimalTypeGate)({
111
+ enabled: isMinimalChrome,
112
+ form,
113
+ selectedType,
114
+ onAfterReset: handleMinimalTypeGateReset
115
+ });
103
116
  const needsStructuredParams = (0, external_react_namespaceObject.useMemo)(()=>{
104
117
  if (actionSpace) {
105
118
  const action = actionSpace.find((a)=>a.interfaceAlias === selectedType || a.name === selectedType);
@@ -197,11 +210,11 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
197
210
  availableDropdownMethods
198
211
  ]);
199
212
  const handleTypeSelect = (0, external_react_namespaceObject.useCallback)((api)=>{
200
- if (isMinimalChrome) setMinimalHasExplicitTypeSelection(true);
213
+ markExplicitSelection();
201
214
  form.setFieldValue('type', api);
202
215
  }, [
203
216
  form,
204
- isMinimalChrome
217
+ markExplicitSelection
205
218
  ]);
206
219
  const apiGroupDefinitions = (0, external_react_namespaceObject.useMemo)(()=>[
207
220
  {
@@ -285,22 +298,6 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
285
298
  }), [
286
299
  hiddenApiGroupItems
287
300
  ]);
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: {}
296
- });
297
- setPromptValue('');
298
- }, [
299
- form,
300
- minimalHasExplicitTypeSelection,
301
- isMinimalChrome,
302
- selectedType
303
- ]);
304
301
  const getDefaultParams = (0, external_react_namespaceObject.useCallback)(()=>{
305
302
  if (!needsStructuredParams || !actionSpace) return {};
306
303
  const action = actionSpace.find((a)=>a.interfaceAlias === selectedType || a.name === selectedType);
@@ -358,10 +355,7 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
358
355
  }
359
356
  }, []);
360
357
  (0, external_react_namespaceObject.useEffect)(()=>{
361
- if (skipMinimalSyncRef.current) {
362
- skipMinimalSyncRef.current = false;
363
- return;
364
- }
358
+ if (shouldSkipRestoreOnce()) return;
365
359
  if (isMinimalChrome) {
366
360
  const defaultParams = getDefaultParams();
367
361
  form.setFieldsValue({
@@ -396,7 +390,8 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
396
390
  historyForSelectedType,
397
391
  form,
398
392
  getDefaultParams,
399
- isMinimalChrome
393
+ isMinimalChrome,
394
+ shouldSkipRestoreOnce
400
395
  ]);
401
396
  (0, external_react_namespaceObject.useEffect)(()=>{
402
397
  const timeoutId = setTimeout(()=>{
@@ -415,8 +410,8 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
415
410
  promptValue
416
411
  ]);
417
412
  const handleSelectHistory = (0, external_react_namespaceObject.useCallback)((historyItem)=>{
418
- if (isMinimalChrome) setMinimalHasExplicitTypeSelection(true);
419
- skipMinimalSyncRef.current = historyItem.type !== selectedType;
413
+ markExplicitSelection();
414
+ if (historyItem.type !== selectedType) skipNextRestore();
420
415
  form.setFieldsValue({
421
416
  prompt: historyItem.prompt,
422
417
  type: historyItem.type,
@@ -425,8 +420,9 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
425
420
  setPromptValue(historyItem.prompt);
426
421
  }, [
427
422
  form,
428
- isMinimalChrome,
429
- selectedType
423
+ markExplicitSelection,
424
+ selectedType,
425
+ skipNextRestore
430
426
  ]);
431
427
  const handlePromptChange = (0, external_react_namespaceObject.useCallback)((e)=>{
432
428
  const value = e.target.value;
@@ -759,8 +755,14 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
759
755
  (0, playground_utils_js_namespaceObject.actionNameForType)(selectedType)
760
756
  ]
761
757
  });
758
+ var _chrome_icons_action;
759
+ const minimalActionIconSrc = null != (_chrome_icons_action = null == chrome ? void 0 : null == (_chrome_icons = chrome.icons) ? void 0 : _chrome_icons.action) ? _chrome_icons_action : STUDIO_MINIMAL_PROMPT_ICONS.action;
760
+ var _chrome_icons_actionChevron;
761
+ const minimalActionChevronSrc = null != (_chrome_icons_actionChevron = null == chrome ? void 0 : null == (_chrome_icons1 = chrome.icons) ? void 0 : _chrome_icons1.actionChevron) ? _chrome_icons_actionChevron : STUDIO_MINIMAL_PROMPT_ICONS.actionChevron;
762
+ var _chrome_icons_settings;
763
+ const minimalSettingsIconSrc = null != (_chrome_icons_settings = null == chrome ? void 0 : null == (_chrome_icons2 = chrome.icons) ? void 0 : _chrome_icons2.settings) ? _chrome_icons_settings : STUDIO_MINIMAL_PROMPT_ICONS.settings;
762
764
  if (isMinimalChrome) {
763
- var _chrome_icons, _chrome_icons1, _chrome_icons2, _chrome_icons3;
765
+ var _chrome_icons3;
764
766
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
765
767
  className: "prompt-input-wrapper prompt-input-wrapper-minimal",
766
768
  children: [
@@ -796,21 +798,19 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
796
798
  disabled: !runButtonEnabled,
797
799
  type: "button",
798
800
  children: [
799
- (null == chrome ? void 0 : null == (_chrome_icons = chrome.icons) ? void 0 : _chrome_icons.action) ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
801
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
800
802
  alt: "",
801
803
  className: "minimal-action-icon",
802
- src: chrome.icons.action
803
- }) : null,
804
+ src: minimalActionIconSrc
805
+ }),
804
806
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
805
807
  className: "minimal-action-label",
806
808
  children: actionButtonLabel
807
809
  }),
808
- (null == chrome ? void 0 : null == (_chrome_icons1 = chrome.icons) ? void 0 : _chrome_icons1.actionChevron) ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
810
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
809
811
  alt: "",
810
812
  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"
813
+ src: minimalActionChevronSrc
814
814
  })
815
815
  ]
816
816
  })
@@ -819,11 +819,12 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
819
819
  onSelect: handleSelectHistory,
820
820
  history: historyForSelectedType,
821
821
  currentType: selectedType,
822
+ popupPlacement: "top",
822
823
  trigger: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
823
824
  "aria-label": "Open prompt history",
824
825
  className: "minimal-icon-trigger",
825
826
  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
+ children: (null == chrome ? void 0 : null == (_chrome_icons3 = chrome.icons) ? void 0 : _chrome_icons3.history) ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
827
828
  alt: "",
828
829
  className: "minimal-toolbar-icon",
829
830
  src: chrome.icons.history
@@ -845,18 +846,15 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
845
846
  showDataExtractionOptions: showDataExtractionOptions,
846
847
  hideDomAndScreenshotOptions: hideDomAndScreenshotOptions,
847
848
  deviceType: deviceType,
849
+ popupPlacement: "topRight",
848
850
  trigger: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
849
851
  "aria-label": "Open run configuration",
850
852
  className: "minimal-icon-trigger",
851
853
  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", {
854
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
853
855
  alt: "",
854
856
  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
857
+ src: minimalSettingsIconSrc
860
858
  })
861
859
  })
862
860
  })
@@ -370,6 +370,135 @@
370
370
  text-decoration: underline;
371
371
  }
372
372
 
373
+ .playground-container.playground-conversation-skin .middle-dialog-area .info-list-container {
374
+ padding: 20px 16px 32px;
375
+ }
376
+
377
+ .playground-container.playground-conversation-skin .middle-dialog-area .info-list-container .ant-list-items {
378
+ flex-direction: column;
379
+ gap: 16px;
380
+ display: flex;
381
+ }
382
+
383
+ .playground-container.playground-conversation-skin .middle-dialog-area .info-list-container .list-item {
384
+ padding: 0;
385
+ }
386
+
387
+ .playground-container.playground-conversation-skin .user-message-container {
388
+ margin: 0;
389
+ }
390
+
391
+ .playground-container.playground-conversation-skin .user-message-container .user-message-bubble {
392
+ border-radius: 12px;
393
+ max-width: min(80%, 280px);
394
+ padding: 8px 16px;
395
+ font-size: 14px;
396
+ line-height: 22px;
397
+ }
398
+
399
+ .playground-container.playground-conversation-skin .bottom-input-section {
400
+ border-top: 1px solid var(--midscene-border-subtle);
401
+ background: var(--midscene-surface);
402
+ flex-shrink: 0;
403
+ padding: 12px;
404
+ }
405
+
406
+ .playground-container.playground-conversation-skin .list-item:has(.progress-action-item) {
407
+ padding-left: 0;
408
+ position: relative;
409
+ }
410
+
411
+ .playground-container.playground-conversation-skin .list-item > div:has( > .progress-action-item) {
412
+ flex-direction: column;
413
+ align-items: flex-start;
414
+ gap: 8px;
415
+ display: flex;
416
+ }
417
+
418
+ .playground-container.playground-conversation-skin .progress-action-item {
419
+ color: rgba(0, 0, 0, .7);
420
+ background: rgba(0, 0, 0, .08);
421
+ border-radius: 38px;
422
+ flex-direction: row-reverse;
423
+ justify-content: flex-end;
424
+ align-items: center;
425
+ gap: 8px;
426
+ width: -moz-fit-content;
427
+ width: fit-content;
428
+ max-width: 100%;
429
+ height: 28px;
430
+ margin: 0 0 0 24px;
431
+ padding: 2px 12px 2px 4px;
432
+ font-size: 14px;
433
+ line-height: 22px;
434
+ display: flex;
435
+ }
436
+
437
+ .playground-container.playground-conversation-skin .progress-action-item .progress-status-icon {
438
+ justify-content: center;
439
+ align-items: center;
440
+ width: 24px;
441
+ height: 24px;
442
+ margin-left: 0;
443
+ font-size: 14px;
444
+ display: inline-flex;
445
+ }
446
+
447
+ .playground-container.playground-conversation-skin .progress-action-item + div {
448
+ width: 100%;
449
+ margin: 0;
450
+ padding-left: 20px;
451
+ }
452
+
453
+ .playground-container.playground-conversation-skin .progress-description {
454
+ color: rgba(0, 0, 0, .85);
455
+ margin: 0;
456
+ padding: 0;
457
+ }
458
+
459
+ .playground-container.playground-conversation-skin .system-message-content, .playground-container.playground-conversation-skin .system-message-content .system-message-text {
460
+ color: rgba(0, 0, 0, .85);
461
+ font-size: 14px;
462
+ line-height: 22px;
463
+ }
464
+
465
+ .playground-container.playground-conversation-skin .list-item:has(.progress-action-item) + .list-item:has(.progress-action-item) {
466
+ margin-top: -8px;
467
+ }
468
+
469
+ .playground-container.playground-conversation-skin .list-item:has(.progress-action-item):has( + .list-item .progress-action-item):after {
470
+ content: "";
471
+ pointer-events: none;
472
+ background: rgba(0, 0, 0, .08);
473
+ width: 1px;
474
+ position: absolute;
475
+ top: 23px;
476
+ bottom: -16px;
477
+ left: 12px;
478
+ }
479
+
480
+ .playground-container.playground-conversation-skin .list-item:has(.progress-action-item) + .list-item:has(.progress-action-item):has( + .list-item .progress-action-item):after {
481
+ top: 0;
482
+ }
483
+
484
+ .playground-container.playground-conversation-skin .progress-group-toggle {
485
+ margin: 0 0 8px;
486
+ padding-left: 4px;
487
+ }
488
+
489
+ [data-theme="dark"] .playground-container.playground-conversation-skin .progress-action-item {
490
+ color: rgba(255, 255, 255, .7);
491
+ background: rgba(255, 255, 255, .08);
492
+ }
493
+
494
+ [data-theme="dark"] .playground-container.playground-conversation-skin .list-item:has(.progress-action-item):has( + .list-item .progress-action-item):after {
495
+ background: rgba(255, 255, 255, .12);
496
+ }
497
+
498
+ [data-theme="dark"] .playground-container.playground-conversation-skin .system-message-content, [data-theme="dark"] .playground-container.playground-conversation-skin .system-message-content .system-message-text, [data-theme="dark"] .playground-container.playground-conversation-skin .progress-description {
499
+ color: var(--midscene-text-primary);
500
+ }
501
+
373
502
  [data-theme="dark"] .universal-playground .error-hint {
374
503
  color: rgba(255, 255, 255, .45);
375
504
  }
@@ -51,6 +51,7 @@ require("./index.css");
51
51
  const avatar_js_namespaceObject = require("../../icons/avatar.js");
52
52
  var avatar_js_default = /*#__PURE__*/ __webpack_require__.n(avatar_js_namespaceObject);
53
53
  const constants_js_namespaceObject = require("../../utils/constants.js");
54
+ const progress_action_icon_js_namespaceObject = require("../../utils/progress-action-icon.js");
54
55
  const external_prompt_input_index_js_namespaceObject = require("../prompt-input/index.js");
55
56
  const external_shiny_text_index_js_namespaceObject = require("../shiny-text/index.js");
56
57
  var external_shiny_text_index_js_default = /*#__PURE__*/ __webpack_require__.n(external_shiny_text_index_js_namespaceObject);
@@ -190,9 +191,11 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
190
191
  const layout = componentConfig.layout || 'vertical';
191
192
  const showVersionInfo = false !== componentConfig.showVersionInfo;
192
193
  const deviceType = componentConfig.deviceType;
193
- const collapsibleProgressGroup = true === componentConfig.collapsibleProgressGroup;
194
- var _componentConfig_progressGroupLabel;
195
- const progressGroupLabel = null != (_componentConfig_progressGroupLabel = componentConfig.progressGroupLabel) ? _componentConfig_progressGroupLabel : 'Execution Flow';
194
+ var _componentConfig_executionFlow;
195
+ const executionFlowConfig = null != (_componentConfig_executionFlow = componentConfig.executionFlow) ? _componentConfig_executionFlow : {};
196
+ const collapsibleProgressGroup = true === executionFlowConfig.collapsible;
197
+ var _executionFlowConfig_label;
198
+ const progressGroupLabel = null != (_executionFlowConfig_label = executionFlowConfig.label) ? _executionFlowConfig_label : 'Execution Flow';
196
199
  const [collapsedProgressGroups, setCollapsedProgressGroups] = (0, external_react_namespaceObject.useState)(()=>new Set());
197
200
  const toggleProgressGroup = (0, external_react_namespaceObject.useCallback)((groupId)=>{
198
201
  setCollapsedProgressGroups((prev)=>{
@@ -293,12 +296,14 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
293
296
  })
294
297
  }) : 'progress' === item.type ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
295
298
  children: (()=>{
296
- var _parts_, _item_result, _item_result1, _item_result2;
299
+ var _parts_, _item_result, _item_result1;
297
300
  const parts = item.content.split(' - ');
298
301
  const action = null == (_parts_ = parts[0]) ? void 0 : _parts_.trim();
299
302
  const description = parts.slice(1).join(' - ').trim();
300
303
  const isLatestProgress = item.id === latestProgressId;
301
304
  const shouldShowLoading = loading && isLatestProgress;
305
+ const state = shouldShowLoading ? 'loading' : (null == (_item_result = item.result) ? void 0 : _item_result.error) ? 'error' : 'completed';
306
+ const domainIcon = 'completed' === state ? (0, progress_action_icon_js_namespaceObject.resolveProgressActionIcon)(item.actionKind, executionFlowConfig.resolveActionIcon) : null;
302
307
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
303
308
  children: [
304
309
  action && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
@@ -306,10 +311,10 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
306
311
  children: [
307
312
  action,
308
313
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
309
- className: `progress-status-icon ${shouldShowLoading ? 'loading' : (null == (_item_result = item.result) ? void 0 : _item_result.error) ? 'error' : 'completed'}`,
310
- children: shouldShowLoading ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.LoadingOutlined, {
314
+ className: `progress-status-icon ${state}`,
315
+ children: 'loading' === state ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.LoadingOutlined, {
311
316
  spin: true
312
- }) : (null == (_item_result1 = item.result) ? void 0 : _item_result1.error) ? '✗' : '✓'
317
+ }) : 'error' === state ? '✗' : null !== domainIcon ? domainIcon : '✓'
313
318
  })
314
319
  ]
315
320
  }),
@@ -320,7 +325,7 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
320
325
  disabled: !shouldShowLoading
321
326
  })
322
327
  }),
323
- (null == (_item_result2 = item.result) ? void 0 : _item_result2.error) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ErrorMessage, {
328
+ (null == (_item_result1 = item.result) ? void 0 : _item_result1.error) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ErrorMessage, {
324
329
  error: item.result.error
325
330
  })
326
331
  ]