@midscene/visualizer 1.7.9 → 1.7.10-beta-20260507123827.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.
Files changed (37) hide show
  1. package/dist/es/component/playground/index.css +61 -11
  2. package/dist/es/component/prompt-input/index.css +61 -11
  3. package/dist/es/component/prompt-input/index.mjs +144 -111
  4. package/dist/es/component/screenshot-viewer/index.css +6 -0
  5. package/dist/es/component/screenshot-viewer/index.mjs +7 -3
  6. package/dist/es/component/universal-playground/empty-state.mjs +5 -0
  7. package/dist/es/component/universal-playground/index.css +8 -0
  8. package/dist/es/component/universal-playground/index.mjs +53 -1
  9. package/dist/es/icons/action-chevron.mjs +61 -0
  10. package/dist/es/icons/prompt-history.mjs +70 -0
  11. package/dist/es/utils/empty-state-scroll.mjs +8 -0
  12. package/dist/es/utils/playground-utils.mjs +1 -18
  13. package/dist/es/utils/prompt-input-utils.mjs +9 -1
  14. package/dist/es/utils/prompt-placeholder.mjs +19 -0
  15. package/dist/lib/component/playground/index.css +61 -11
  16. package/dist/lib/component/prompt-input/index.css +61 -11
  17. package/dist/lib/component/prompt-input/index.js +145 -111
  18. package/dist/lib/component/screenshot-viewer/index.css +6 -0
  19. package/dist/lib/component/screenshot-viewer/index.js +7 -3
  20. package/dist/lib/component/universal-playground/empty-state.js +39 -0
  21. package/dist/lib/component/universal-playground/index.css +8 -0
  22. package/dist/lib/component/universal-playground/index.js +53 -1
  23. package/dist/lib/icons/action-chevron.js +95 -0
  24. package/dist/lib/icons/prompt-history.js +104 -0
  25. package/dist/lib/utils/empty-state-scroll.js +42 -0
  26. package/dist/lib/utils/playground-utils.js +2 -19
  27. package/dist/lib/utils/prompt-input-utils.js +12 -1
  28. package/dist/lib/utils/prompt-placeholder.js +53 -0
  29. package/dist/types/component/prompt-input/index.d.ts +1 -2
  30. package/dist/types/component/screenshot-viewer/index.d.ts +4 -0
  31. package/dist/types/component/universal-playground/empty-state.d.ts +3 -0
  32. package/dist/types/types.d.ts +6 -0
  33. package/dist/types/utils/empty-state-scroll.d.ts +11 -0
  34. package/dist/types/utils/playground-utils.d.ts +1 -1
  35. package/dist/types/utils/prompt-input-utils.d.ts +1 -0
  36. package/dist/types/utils/prompt-placeholder.d.ts +1 -0
  37. package/package.json +13 -6
@@ -586,7 +586,7 @@
586
586
 
587
587
  .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-toolbar-left {
588
588
  align-items: center;
589
- gap: 4px;
589
+ gap: 2px;
590
590
  min-width: 0;
591
591
  display: flex;
592
592
  }
@@ -606,11 +606,12 @@
606
606
  border-radius: 32px;
607
607
  gap: 4px;
608
608
  height: 32px;
609
- padding: 4px 8px;
609
+ margin-right: 16px;
610
+ padding: 4px 0;
610
611
  }
611
612
 
612
613
  .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-action-trigger:hover {
613
- background: rgba(0, 0, 0, .03);
614
+ color: #5f6368;
614
615
  }
615
616
 
616
617
  .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-action-trigger:disabled {
@@ -642,11 +643,11 @@
642
643
 
643
644
  .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-action-chevron {
644
645
  object-fit: contain;
645
- opacity: .25;
646
- width: 5.3px;
647
- height: 9.3px;
648
- margin-left: -2px;
649
- transform: rotate(-90deg);
646
+ opacity: 1;
647
+ width: 6px;
648
+ height: 10px;
649
+ margin-left: 0;
650
+ display: block;
650
651
  }
651
652
 
652
653
  .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-action-chevron-fallback {
@@ -669,7 +670,7 @@
669
670
  }
670
671
 
671
672
  .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-icon-trigger:hover {
672
- background: rgba(0, 0, 0, .03);
673
+ background: rgba(0, 0, 0, .04);
673
674
  }
674
675
 
675
676
  .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-toolbar-icon {
@@ -679,8 +680,8 @@
679
680
  }
680
681
 
681
682
  .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-toolbar-icon-history {
682
- width: 18px;
683
- height: 18px;
683
+ width: 16px;
684
+ height: 16px;
684
685
  }
685
686
 
686
687
  .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-toolbar-icon-fallback {
@@ -695,6 +696,55 @@
695
696
  position: static;
696
697
  }
697
698
 
699
+ .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-run-trigger {
700
+ width: 32px;
701
+ min-width: 32px;
702
+ height: 32px;
703
+ box-shadow: none;
704
+ color: #fff;
705
+ background: #1979ff;
706
+ border: none;
707
+ border-radius: 50%;
708
+ justify-content: center;
709
+ align-items: center;
710
+ padding: 0;
711
+ display: inline-flex;
712
+ }
713
+
714
+ .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-run-trigger:hover {
715
+ color: #fff;
716
+ background: #0f6ff0;
717
+ }
718
+
719
+ .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-run-trigger:focus-visible {
720
+ color: #fff;
721
+ background: #0f6ff0;
722
+ }
723
+
724
+ .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-run-trigger:disabled {
725
+ color: #bfbfbf;
726
+ background: #f0f0f0;
727
+ }
728
+
729
+ .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-run-trigger .anticon {
730
+ font-size: 16px;
731
+ }
732
+
733
+ .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-run-trigger-stop {
734
+ color: #666;
735
+ background: #f0f0f0;
736
+ }
737
+
738
+ .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-run-trigger-stop:hover {
739
+ color: #333;
740
+ background: #e6e6e6;
741
+ }
742
+
743
+ .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-run-trigger-stop:focus-visible {
744
+ color: #333;
745
+ background: #e6e6e6;
746
+ }
747
+
698
748
  .more-apis-dropdown .ant-dropdown-menu {
699
749
  scrollbar-width: thin;
700
750
  max-height: 400px;
@@ -494,7 +494,7 @@
494
494
 
495
495
  .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-toolbar-left {
496
496
  align-items: center;
497
- gap: 4px;
497
+ gap: 2px;
498
498
  min-width: 0;
499
499
  display: flex;
500
500
  }
@@ -514,11 +514,12 @@
514
514
  border-radius: 32px;
515
515
  gap: 4px;
516
516
  height: 32px;
517
- padding: 4px 8px;
517
+ margin-right: 16px;
518
+ padding: 4px 0;
518
519
  }
519
520
 
520
521
  .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-action-trigger:hover {
521
- background: rgba(0, 0, 0, .03);
522
+ color: #5f6368;
522
523
  }
523
524
 
524
525
  .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-action-trigger:disabled {
@@ -550,11 +551,11 @@
550
551
 
551
552
  .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-action-chevron {
552
553
  object-fit: contain;
553
- opacity: .25;
554
- width: 5.3px;
555
- height: 9.3px;
556
- margin-left: -2px;
557
- transform: rotate(-90deg);
554
+ opacity: 1;
555
+ width: 6px;
556
+ height: 10px;
557
+ margin-left: 0;
558
+ display: block;
558
559
  }
559
560
 
560
561
  .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-action-chevron-fallback {
@@ -577,7 +578,7 @@
577
578
  }
578
579
 
579
580
  .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-icon-trigger:hover {
580
- background: rgba(0, 0, 0, .03);
581
+ background: rgba(0, 0, 0, .04);
581
582
  }
582
583
 
583
584
  .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-toolbar-icon {
@@ -587,8 +588,8 @@
587
588
  }
588
589
 
589
590
  .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-toolbar-icon-history {
590
- width: 18px;
591
- height: 18px;
591
+ width: 16px;
592
+ height: 16px;
592
593
  }
593
594
 
594
595
  .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-toolbar-icon-fallback {
@@ -603,6 +604,55 @@
603
604
  position: static;
604
605
  }
605
606
 
607
+ .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-run-trigger {
608
+ width: 32px;
609
+ min-width: 32px;
610
+ height: 32px;
611
+ box-shadow: none;
612
+ color: #fff;
613
+ background: #1979ff;
614
+ border: none;
615
+ border-radius: 50%;
616
+ justify-content: center;
617
+ align-items: center;
618
+ padding: 0;
619
+ display: inline-flex;
620
+ }
621
+
622
+ .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-run-trigger:hover {
623
+ color: #fff;
624
+ background: #0f6ff0;
625
+ }
626
+
627
+ .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-run-trigger:focus-visible {
628
+ color: #fff;
629
+ background: #0f6ff0;
630
+ }
631
+
632
+ .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-run-trigger:disabled {
633
+ color: #bfbfbf;
634
+ background: #f0f0f0;
635
+ }
636
+
637
+ .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-run-trigger .anticon {
638
+ font-size: 16px;
639
+ }
640
+
641
+ .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-run-trigger-stop {
642
+ color: #666;
643
+ background: #f0f0f0;
644
+ }
645
+
646
+ .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-run-trigger-stop:hover {
647
+ color: #333;
648
+ background: #e6e6e6;
649
+ }
650
+
651
+ .prompt-input-wrapper-minimal .minimal-main-side-console-input .minimal-run-trigger-stop:focus-visible {
652
+ color: #333;
653
+ background: #e6e6e6;
654
+ }
655
+
606
656
  .more-apis-dropdown .ant-dropdown-menu {
607
657
  scrollbar-width: thin;
608
658
  max-height: 400px;
@@ -1,20 +1,22 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { BorderOutlined, DownOutlined, SendOutlined } from "@ant-design/icons";
3
- import "./index.css";
2
+ import { ArrowUpOutlined, BorderOutlined, DownOutlined, SendOutlined } from "@ant-design/icons";
4
3
  import { Button, Dropdown, Form, Input, Radio, Tooltip } from "antd";
5
4
  import react, { useCallback, useEffect, useMemo, useRef, useState } from "react";
5
+ import { useMinimalTypeGate } from "../../hooks/useMinimalTypeGate.mjs";
6
+ import action_chevron from "../../icons/action-chevron.mjs";
7
+ import prompt_history from "../../icons/prompt-history.mjs";
6
8
  import { useHistoryStore } from "../../store/history.mjs";
7
9
  import { extractDefaultValue, isLocateField, isZodObjectSchema, unwrapZodType } from "../../types.mjs";
8
10
  import { getPromptInputActionLabel } from "../../utils/action-label.mjs";
9
11
  import { apiMetadata, defaultMainButtons } from "../../utils/constants.mjs";
10
12
  import { hasDeviceSpecificConfig } from "../../utils/device-capabilities.mjs";
11
- import { actionNameForType, getPlaceholderForType, isRunButtonEnabled as playground_utils_mjs_isRunButtonEnabled } from "../../utils/playground-utils.mjs";
13
+ import { actionNameForType, isRunButtonEnabled as playground_utils_mjs_isRunButtonEnabled } from "../../utils/playground-utils.mjs";
12
14
  import { getAvailablePromptActionTypes, getInlineStructuredFieldConfig } from "../../utils/prompt-input-utils.mjs";
15
+ import { getPlaceholderForType } from "../../utils/prompt-placeholder.mjs";
13
16
  import { ConfigSelector } from "../config-selector/index.mjs";
14
17
  import { BooleanField, EnumField, LocateField, NumberField, TextField } from "../form-field/index.mjs";
15
18
  import { HistorySelector } from "../history-selector/index.mjs";
16
- import { useMinimalTypeGate } from "../../hooks/useMinimalTypeGate.mjs";
17
- import icons_history from "../../icons/history.mjs";
19
+ import "./index.css";
18
20
  function _define_property(obj, key, value) {
19
21
  if (key in obj) Object.defineProperty(obj, key, {
20
22
  value: value,
@@ -45,7 +47,7 @@ const STUDIO_MINIMAL_PROMPT_ICONS = {
45
47
  settings: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAAaFJREFUeAHtlt9tgzAQxi8EJa/pBMkIHYENygalG7RvSQQKlfjz2I5ANkg3oBukG6QbtI9IIPq5ihHQOBXmFImqPwnZBvtsf9ydTfQPA77vz4IguCENDGJgOp3ux+PxLgxDnzrCsgAw/zZmGPOO48iUFci4wE42xITKXlEUO9d1X34s4NjZISZU9qCSjeKqastKWZYpMaKyNxqNto02MRDHcXmsJqvV6q7LWBYnxK4+SBOTeHDw2HAwn4aGlg9EUfQE2e+xYwchtaUeaPmAmFyUyH4W9aThA9jZ7alOiN39crl8O/FpoRpzjrq96hcgj2/wwVcNQlxb6/X6VdRrYaeNtGfUVvXbgE9iRNprOCHktPF/Z+3OeZ4fPM9LZbumgHjX2Qnr9rSioE/ma6MVBZDvWWQ/cbLR0GE5jEQoQhFLpGIkpvcuY1nOAkyeiBKJSRSXPw37UCkgbrWmaSZwsBkxoLInHBgJ6EG2KwUgn801+Tl78hyRVApkWfaIexxp4rRfqOzBUdN6+29cyYAMvQN1hCUMIbc1mUyu4VzDz4wX5wvRfah9kIOcwwAAAABJRU5ErkJggg=='
46
48
  };
47
49
  const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMode, stoppable, loading, onRun, onStop, clearPromptAfterRun = true, actionSpace, hideDomAndScreenshotOptions = false, deviceType, chrome })=>{
48
- var _chrome_icons, _chrome_icons1, _chrome_icons2;
50
+ var _chrome_icons, _chrome_icons1, _chrome_icons2, _chrome_icons3;
49
51
  const [hoveringSettings, setHoveringSettings] = useState(false);
50
52
  const [promptValue, setPromptValue] = useState('');
51
53
  const placeholder = getPlaceholderForType(selectedType);
@@ -237,7 +239,7 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
237
239
  buildApiMenuItem
238
240
  ]);
239
241
  const actionDropdownMenu = useMemo(()=>{
240
- const primaryActions = defaultMainButtons.filter((api)=>'aiAct' === api || availableDropdownMethods.includes(api));
242
+ const primaryActions = defaultMainButtons.filter((api)=>availableDropdownMethods.includes(api));
241
243
  const items = [];
242
244
  if (primaryActions.length > 0) items.push({
243
245
  key: 'primary-group',
@@ -675,6 +677,36 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
675
677
  selectedType,
676
678
  stoppable
677
679
  ]);
680
+ const renderMinimalActionButton = useCallback(()=>{
681
+ const runButton = (ariaLabel)=>/*#__PURE__*/ jsx(Button, {
682
+ "aria-label": ariaLabel,
683
+ className: "minimal-run-trigger",
684
+ type: "primary",
685
+ icon: /*#__PURE__*/ jsx(ArrowUpOutlined, {}),
686
+ onClick: handleRunWithHistory,
687
+ disabled: !isRunButtonEnabled,
688
+ loading: loading
689
+ });
690
+ if (dryMode) return 'aiAct' === selectedType ? /*#__PURE__*/ jsx(Tooltip, {
691
+ title: "Start executing until some interaction actions need to be performed. You can see the process of planning and locating.",
692
+ children: runButton('Dry run')
693
+ }) : runButton('Run');
694
+ if (stoppable) return /*#__PURE__*/ jsx(Button, {
695
+ "aria-label": "Stop running",
696
+ className: "minimal-run-trigger minimal-run-trigger-stop",
697
+ icon: /*#__PURE__*/ jsx(BorderOutlined, {}),
698
+ onClick: onStop
699
+ });
700
+ return runButton('Run');
701
+ }, [
702
+ dryMode,
703
+ loading,
704
+ handleRunWithHistory,
705
+ isRunButtonEnabled,
706
+ onStop,
707
+ selectedType,
708
+ stoppable
709
+ ]);
678
710
  const inputContent = needsAnyInput ? needsStructuredParams ? minimalInlineFieldConfig ? /*#__PURE__*/ jsx(Form.Item, {
679
711
  name: [
680
712
  'params',
@@ -718,121 +750,122 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
718
750
  });
719
751
  var _chrome_icons_action;
720
752
  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;
721
- var _chrome_icons_actionChevron;
722
- 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;
753
+ const minimalActionChevronSrc = null == chrome ? void 0 : null == (_chrome_icons1 = chrome.icons) ? void 0 : _chrome_icons1.actionChevron;
723
754
  var _chrome_icons_settings;
724
755
  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;
725
- if (isMinimalChrome) {
726
- var _chrome_icons3;
727
- return /*#__PURE__*/ jsxs("div", {
728
- className: "prompt-input-wrapper prompt-input-wrapper-minimal",
729
- children: [
730
- /*#__PURE__*/ jsx(Form.Item, {
731
- hidden: true,
732
- name: "type",
733
- style: {
734
- margin: 0
735
- },
736
- children: /*#__PURE__*/ jsx(Input, {})
737
- }),
738
- /*#__PURE__*/ jsxs("div", {
739
- className: `main-side-console-input minimal-main-side-console-input ${!runButtonEnabled ? 'disabled' : ''} ${loading ? 'loading' : ''}`,
740
- children: [
741
- inputContent,
742
- /*#__PURE__*/ jsxs("div", {
743
- className: "minimal-toolbar-row",
744
- children: [
745
- /*#__PURE__*/ jsxs("div", {
746
- className: "minimal-toolbar-left",
747
- children: [
748
- /*#__PURE__*/ jsx(Dropdown, {
749
- menu: actionDropdownMenu,
750
- placement: "topLeft",
751
- trigger: [
752
- 'click'
753
- ],
756
+ const minimalHistoryIconSrc = null == chrome ? void 0 : null == (_chrome_icons3 = chrome.icons) ? void 0 : _chrome_icons3.history;
757
+ if (isMinimalChrome) return /*#__PURE__*/ jsxs("div", {
758
+ className: "prompt-input-wrapper prompt-input-wrapper-minimal",
759
+ children: [
760
+ /*#__PURE__*/ jsx(Form.Item, {
761
+ hidden: true,
762
+ name: "type",
763
+ style: {
764
+ margin: 0
765
+ },
766
+ children: /*#__PURE__*/ jsx(Input, {})
767
+ }),
768
+ /*#__PURE__*/ jsxs("div", {
769
+ className: `main-side-console-input minimal-main-side-console-input ${!runButtonEnabled ? 'disabled' : ''} ${loading ? 'loading' : ''}`,
770
+ children: [
771
+ inputContent,
772
+ /*#__PURE__*/ jsxs("div", {
773
+ className: "minimal-toolbar-row",
774
+ children: [
775
+ /*#__PURE__*/ jsxs("div", {
776
+ className: "minimal-toolbar-left",
777
+ children: [
778
+ /*#__PURE__*/ jsx(Dropdown, {
779
+ menu: actionDropdownMenu,
780
+ placement: "topLeft",
781
+ trigger: [
782
+ 'click'
783
+ ],
784
+ disabled: !runButtonEnabled,
785
+ overlayClassName: "more-apis-dropdown",
786
+ children: /*#__PURE__*/ jsxs("button", {
787
+ "aria-label": `Select action type (current: ${actionButtonLabel})`,
788
+ className: "minimal-action-trigger",
754
789
  disabled: !runButtonEnabled,
755
- overlayClassName: "more-apis-dropdown",
756
- children: /*#__PURE__*/ jsxs("button", {
757
- "aria-label": `Select action type (current: ${actionButtonLabel})`,
758
- className: "minimal-action-trigger",
759
- disabled: !runButtonEnabled,
760
- type: "button",
761
- children: [
762
- /*#__PURE__*/ jsx("img", {
763
- alt: "",
764
- className: "minimal-action-icon",
765
- src: minimalActionIconSrc
766
- }),
767
- /*#__PURE__*/ jsx("span", {
768
- className: "minimal-action-label",
769
- children: actionButtonLabel
770
- }),
771
- /*#__PURE__*/ jsx("img", {
772
- alt: "",
773
- className: "minimal-action-chevron",
774
- src: minimalActionChevronSrc
775
- })
776
- ]
777
- })
778
- }),
779
- /*#__PURE__*/ jsx(HistorySelector, {
780
- onSelect: handleSelectHistory,
781
- history: historyForSelectedType,
782
- currentType: selectedType,
783
- popupPlacement: "top",
790
+ type: "button",
791
+ children: [
792
+ /*#__PURE__*/ jsx("img", {
793
+ alt: "",
794
+ className: "minimal-action-icon",
795
+ src: minimalActionIconSrc
796
+ }),
797
+ /*#__PURE__*/ jsx("span", {
798
+ className: "minimal-action-label",
799
+ children: actionButtonLabel
800
+ }),
801
+ minimalActionChevronSrc ? /*#__PURE__*/ jsx("img", {
802
+ alt: "",
803
+ className: "minimal-action-chevron",
804
+ src: minimalActionChevronSrc
805
+ }) : /*#__PURE__*/ jsx(action_chevron, {
806
+ "aria-hidden": "true",
807
+ className: "minimal-action-chevron",
808
+ focusable: "false"
809
+ })
810
+ ]
811
+ })
812
+ }),
813
+ hasConfigOptions ? /*#__PURE__*/ jsx("div", {
814
+ className: hoveringSettings ? 'settings-wrapper settings-wrapper-hover' : 'settings-wrapper',
815
+ onMouseEnter: handleMouseEnter,
816
+ onMouseLeave: handleMouseLeave,
817
+ children: /*#__PURE__*/ jsx(ConfigSelector, {
818
+ enableTracking: 'In-Browser-Extension' === serviceMode,
819
+ showDeepLocateOption: showDeepLocateOption,
820
+ showDeepThinkOption: showDeepThinkOption,
821
+ showDataExtractionOptions: showDataExtractionOptions,
822
+ hideDomAndScreenshotOptions: hideDomAndScreenshotOptions,
823
+ deviceType: deviceType,
824
+ popupPlacement: "topRight",
784
825
  trigger: /*#__PURE__*/ jsx("button", {
785
- "aria-label": "Open prompt history",
826
+ "aria-label": "Open run configuration",
786
827
  className: "minimal-icon-trigger",
787
828
  type: "button",
788
- children: (null == chrome ? void 0 : null == (_chrome_icons3 = chrome.icons) ? void 0 : _chrome_icons3.history) ? /*#__PURE__*/ jsx("img", {
829
+ children: /*#__PURE__*/ jsx("img", {
789
830
  alt: "",
790
831
  className: "minimal-toolbar-icon",
791
- src: chrome.icons.history
792
- }) : /*#__PURE__*/ jsx(icons_history, {
793
- className: "minimal-toolbar-icon minimal-toolbar-icon-history minimal-toolbar-icon-fallback",
794
- width: 18,
795
- height: 18
832
+ src: minimalSettingsIconSrc
796
833
  })
797
834
  })
798
- }),
799
- hasConfigOptions ? /*#__PURE__*/ jsx("div", {
800
- className: hoveringSettings ? 'settings-wrapper settings-wrapper-hover' : 'settings-wrapper',
801
- onMouseEnter: handleMouseEnter,
802
- onMouseLeave: handleMouseLeave,
803
- children: /*#__PURE__*/ jsx(ConfigSelector, {
804
- enableTracking: 'In-Browser-Extension' === serviceMode,
805
- showDeepLocateOption: showDeepLocateOption,
806
- showDeepThinkOption: showDeepThinkOption,
807
- showDataExtractionOptions: showDataExtractionOptions,
808
- hideDomAndScreenshotOptions: hideDomAndScreenshotOptions,
809
- deviceType: deviceType,
810
- popupPlacement: "topRight",
811
- trigger: /*#__PURE__*/ jsx("button", {
812
- "aria-label": "Open run configuration",
813
- className: "minimal-icon-trigger",
814
- type: "button",
815
- children: /*#__PURE__*/ jsx("img", {
816
- alt: "",
817
- className: "minimal-toolbar-icon",
818
- src: minimalSettingsIconSrc
819
- })
820
- })
835
+ })
836
+ }) : null,
837
+ /*#__PURE__*/ jsx(HistorySelector, {
838
+ onSelect: handleSelectHistory,
839
+ history: historyForSelectedType,
840
+ currentType: selectedType,
841
+ popupPlacement: "top",
842
+ trigger: /*#__PURE__*/ jsx("button", {
843
+ "aria-label": "Open prompt history",
844
+ className: "minimal-icon-trigger",
845
+ type: "button",
846
+ children: minimalHistoryIconSrc ? /*#__PURE__*/ jsx("img", {
847
+ alt: "",
848
+ className: "minimal-toolbar-icon minimal-toolbar-icon-history",
849
+ src: minimalHistoryIconSrc
850
+ }) : /*#__PURE__*/ jsx(prompt_history, {
851
+ "aria-hidden": "true",
852
+ className: "minimal-toolbar-icon minimal-toolbar-icon-history",
853
+ focusable: "false"
821
854
  })
822
- }) : null
823
- ]
824
- }),
825
- /*#__PURE__*/ jsx("div", {
826
- className: "form-controller-wrapper",
827
- children: renderActionButton()
828
- })
829
- ]
830
- })
831
- ]
832
- })
833
- ]
834
- });
835
- }
855
+ })
856
+ })
857
+ ]
858
+ }),
859
+ /*#__PURE__*/ jsx("div", {
860
+ className: "form-controller-wrapper",
861
+ children: renderMinimalActionButton()
862
+ })
863
+ ]
864
+ })
865
+ ]
866
+ })
867
+ ]
868
+ });
836
869
  return /*#__PURE__*/ jsxs("div", {
837
870
  className: "prompt-input-wrapper",
838
871
  children: [
@@ -10,15 +10,21 @@
10
10
 
11
11
  .screenshot-viewer.screen-only > .screenshot-content {
12
12
  flex: 1;
13
+ justify-content: center;
14
+ align-items: center;
13
15
  min-height: 0;
16
+ display: flex;
14
17
  }
15
18
 
16
19
  .screenshot-viewer.screen-only > .screenshot-content .screenshot-image {
20
+ object-fit: contain;
21
+ object-position: center center;
17
22
  border-radius: 0;
18
23
  width: 100%;
19
24
  max-width: none;
20
25
  height: 100%;
21
26
  max-height: none;
27
+ display: block;
22
28
  }
23
29
 
24
30
  .screenshot-viewer.offline, .screenshot-viewer.loading, .screenshot-viewer.error {
@@ -35,6 +35,7 @@ function ScreenshotViewer({ getScreenshot, getInterfaceInfo, serverOnline, isUse
35
35
  const [error, setError] = useState(null);
36
36
  const [lastUpdateTime, setLastUpdateTime] = useState(0);
37
37
  const [interfaceInfo, setInterfaceInfo] = useState(null);
38
+ const [mjpegRetryToken, setMjpegRetryToken] = useState('');
38
39
  const isMjpeg = Boolean(mjpegUrl && serverOnline);
39
40
  const showChrome = 'screen-only' !== mode;
40
41
  const rootClassName = [
@@ -203,10 +204,13 @@ function ScreenshotViewer({ getScreenshot, getInterfaceInfo, serverOnline, isUse
203
204
  const screenshotContent = /*#__PURE__*/ jsx("div", {
204
205
  className: "screenshot-content",
205
206
  children: isMjpeg ? /*#__PURE__*/ jsx("img", {
206
- src: mjpegUrl,
207
+ src: mjpegRetryToken ? `${mjpegUrl}${(null == mjpegUrl ? void 0 : mjpegUrl.includes('?')) ? '&' : '?'}_mjpegRetry=${encodeURIComponent(mjpegRetryToken)}` : mjpegUrl,
207
208
  alt: "Device Live Stream",
208
- className: "screenshot-image"
209
- }) : screenshot ? /*#__PURE__*/ jsx("img", {
209
+ className: "screenshot-image",
210
+ onError: ()=>{
211
+ window.setTimeout(()=>setMjpegRetryToken(String(Date.now())), 500);
212
+ }
213
+ }, mjpegRetryToken || 'initial') : screenshot ? /*#__PURE__*/ jsx("img", {
210
214
  src: screenshot.startsWith('data:image/') ? screenshot : `data:image/png;base64,${screenshot}`,
211
215
  alt: "Device Screenshot",
212
216
  className: "screenshot-image",
@@ -0,0 +1,5 @@
1
+ function shouldRenderCustomEmptyState(infoList, emptyState) {
2
+ var _infoList_;
3
+ return void 0 !== emptyState && 1 === infoList.length && (null == (_infoList_ = infoList[0]) ? void 0 : _infoList_.id) === 'welcome';
4
+ }
5
+ export { shouldRenderCustomEmptyState };
@@ -89,6 +89,14 @@
89
89
  padding: 0;
90
90
  }
91
91
 
92
+ .playground-container .middle-dialog-area .info-list-container .playground-empty-state-wrapper {
93
+ min-height: 100%;
94
+ }
95
+
96
+ .playground-container .middle-dialog-area .info-list-container .playground-empty-state-wrapper-offset-for-prompt {
97
+ padding-bottom: 128px;
98
+ }
99
+
92
100
  .playground-container .middle-dialog-area .scroll-to-bottom-button {
93
101
  z-index: 10;
94
102
  background: var(--midscene-surface-elevated, #fff);