@midscene/visualizer 1.7.7 → 1.7.10-beta-20260507030203.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 (34) 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/universal-playground/empty-state.mjs +5 -0
  6. package/dist/es/component/universal-playground/index.css +8 -0
  7. package/dist/es/component/universal-playground/index.mjs +53 -1
  8. package/dist/es/icons/action-chevron.mjs +61 -0
  9. package/dist/es/icons/prompt-history.mjs +70 -0
  10. package/dist/es/utils/empty-state-scroll.mjs +8 -0
  11. package/dist/es/utils/playground-utils.mjs +1 -18
  12. package/dist/es/utils/prompt-input-utils.mjs +9 -1
  13. package/dist/es/utils/prompt-placeholder.mjs +19 -0
  14. package/dist/lib/component/playground/index.css +61 -11
  15. package/dist/lib/component/prompt-input/index.css +61 -11
  16. package/dist/lib/component/prompt-input/index.js +145 -111
  17. package/dist/lib/component/screenshot-viewer/index.css +6 -0
  18. package/dist/lib/component/universal-playground/empty-state.js +39 -0
  19. package/dist/lib/component/universal-playground/index.css +8 -0
  20. package/dist/lib/component/universal-playground/index.js +53 -1
  21. package/dist/lib/icons/action-chevron.js +95 -0
  22. package/dist/lib/icons/prompt-history.js +104 -0
  23. package/dist/lib/utils/empty-state-scroll.js +42 -0
  24. package/dist/lib/utils/playground-utils.js +2 -19
  25. package/dist/lib/utils/prompt-input-utils.js +12 -1
  26. package/dist/lib/utils/prompt-placeholder.js +53 -0
  27. package/dist/types/component/prompt-input/index.d.ts +1 -2
  28. package/dist/types/component/universal-playground/empty-state.d.ts +3 -0
  29. package/dist/types/types.d.ts +6 -0
  30. package/dist/types/utils/empty-state-scroll.d.ts +11 -0
  31. package/dist/types/utils/playground-utils.d.ts +1 -1
  32. package/dist/types/utils/prompt-input-utils.d.ts +1 -0
  33. package/dist/types/utils/prompt-placeholder.d.ts +1 -0
  34. package/package.json +13 -6
@@ -37,10 +37,14 @@ __webpack_require__.d(__webpack_exports__, {
37
37
  });
38
38
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
39
39
  const icons_namespaceObject = require("@ant-design/icons");
40
- require("./index.css");
41
40
  const external_antd_namespaceObject = require("antd");
42
41
  const external_react_namespaceObject = require("react");
43
42
  var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
43
+ const useMinimalTypeGate_js_namespaceObject = require("../../hooks/useMinimalTypeGate.js");
44
+ const action_chevron_js_namespaceObject = require("../../icons/action-chevron.js");
45
+ var action_chevron_js_default = /*#__PURE__*/ __webpack_require__.n(action_chevron_js_namespaceObject);
46
+ const prompt_history_js_namespaceObject = require("../../icons/prompt-history.js");
47
+ var prompt_history_js_default = /*#__PURE__*/ __webpack_require__.n(prompt_history_js_namespaceObject);
44
48
  const history_js_namespaceObject = require("../../store/history.js");
45
49
  const external_types_js_namespaceObject = require("../../types.js");
46
50
  const action_label_js_namespaceObject = require("../../utils/action-label.js");
@@ -48,12 +52,11 @@ const constants_js_namespaceObject = require("../../utils/constants.js");
48
52
  const device_capabilities_js_namespaceObject = require("../../utils/device-capabilities.js");
49
53
  const playground_utils_js_namespaceObject = require("../../utils/playground-utils.js");
50
54
  const prompt_input_utils_js_namespaceObject = require("../../utils/prompt-input-utils.js");
55
+ const prompt_placeholder_js_namespaceObject = require("../../utils/prompt-placeholder.js");
51
56
  const index_js_namespaceObject = require("../config-selector/index.js");
52
57
  const external_form_field_index_js_namespaceObject = require("../form-field/index.js");
53
58
  const external_history_selector_index_js_namespaceObject = require("../history-selector/index.js");
54
- const useMinimalTypeGate_js_namespaceObject = require("../../hooks/useMinimalTypeGate.js");
55
- const external_icons_history_js_namespaceObject = require("../../icons/history.js");
56
- var external_icons_history_js_default = /*#__PURE__*/ __webpack_require__.n(external_icons_history_js_namespaceObject);
59
+ require("./index.css");
57
60
  function _define_property(obj, key, value) {
58
61
  if (key in obj) Object.defineProperty(obj, key, {
59
62
  value: value,
@@ -84,10 +87,10 @@ const STUDIO_MINIMAL_PROMPT_ICONS = {
84
87
  settings: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAAaFJREFUeAHtlt9tgzAQxi8EJa/pBMkIHYENygalG7RvSQQKlfjz2I5ANkg3oBukG6QbtI9IIPq5ihHQOBXmFImqPwnZBvtsf9ydTfQPA77vz4IguCENDGJgOp3ux+PxLgxDnzrCsgAw/zZmGPOO48iUFci4wE42xITKXlEUO9d1X34s4NjZISZU9qCSjeKqastKWZYpMaKyNxqNto02MRDHcXmsJqvV6q7LWBYnxK4+SBOTeHDw2HAwn4aGlg9EUfQE2e+xYwchtaUeaPmAmFyUyH4W9aThA9jZ7alOiN39crl8O/FpoRpzjrq96hcgj2/wwVcNQlxb6/X6VdRrYaeNtGfUVvXbgE9iRNprOCHktPF/Z+3OeZ4fPM9LZbumgHjX2Qnr9rSioE/ma6MVBZDvWWQ/cbLR0GE5jEQoQhFLpGIkpvcuY1nOAkyeiBKJSRSXPw37UCkgbrWmaSZwsBkxoLInHBgJ6EG2KwUgn801+Tl78hyRVApkWfaIexxp4rRfqOzBUdN6+29cyYAMvQN1hCUMIbc1mUyu4VzDz4wX5wvRfah9kIOcwwAAAABJRU5ErkJggg=='
85
88
  };
86
89
  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;
90
+ var _chrome_icons, _chrome_icons1, _chrome_icons2, _chrome_icons3;
88
91
  const [hoveringSettings, setHoveringSettings] = (0, external_react_namespaceObject.useState)(false);
89
92
  const [promptValue, setPromptValue] = (0, external_react_namespaceObject.useState)('');
90
- const placeholder = (0, playground_utils_js_namespaceObject.getPlaceholderForType)(selectedType);
93
+ const placeholder = (0, prompt_placeholder_js_namespaceObject.getPlaceholderForType)(selectedType);
91
94
  const isMinimalChrome = (null == chrome ? void 0 : chrome.variant) === 'minimal';
92
95
  const resolvedPlaceholder = (null == chrome ? void 0 : chrome.placeholder) || placeholder;
93
96
  const actionButtonLabel = (0, action_label_js_namespaceObject.getPromptInputActionLabel)(selectedType, null == chrome ? void 0 : chrome.primaryActionLabel);
@@ -276,7 +279,7 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
276
279
  buildApiMenuItem
277
280
  ]);
278
281
  const actionDropdownMenu = (0, external_react_namespaceObject.useMemo)(()=>{
279
- const primaryActions = constants_js_namespaceObject.defaultMainButtons.filter((api)=>'aiAct' === api || availableDropdownMethods.includes(api));
282
+ const primaryActions = constants_js_namespaceObject.defaultMainButtons.filter((api)=>availableDropdownMethods.includes(api));
280
283
  const items = [];
281
284
  if (primaryActions.length > 0) items.push({
282
285
  key: 'primary-group',
@@ -714,6 +717,36 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
714
717
  selectedType,
715
718
  stoppable
716
719
  ]);
720
+ const renderMinimalActionButton = (0, external_react_namespaceObject.useCallback)(()=>{
721
+ const runButton = (ariaLabel)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
722
+ "aria-label": ariaLabel,
723
+ className: "minimal-run-trigger",
724
+ type: "primary",
725
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ArrowUpOutlined, {}),
726
+ onClick: handleRunWithHistory,
727
+ disabled: !isRunButtonEnabled,
728
+ loading: loading
729
+ });
730
+ if (dryMode) return 'aiAct' === selectedType ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Tooltip, {
731
+ title: "Start executing until some interaction actions need to be performed. You can see the process of planning and locating.",
732
+ children: runButton('Dry run')
733
+ }) : runButton('Run');
734
+ if (stoppable) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
735
+ "aria-label": "Stop running",
736
+ className: "minimal-run-trigger minimal-run-trigger-stop",
737
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.BorderOutlined, {}),
738
+ onClick: onStop
739
+ });
740
+ return runButton('Run');
741
+ }, [
742
+ dryMode,
743
+ loading,
744
+ handleRunWithHistory,
745
+ isRunButtonEnabled,
746
+ onStop,
747
+ selectedType,
748
+ stoppable
749
+ ]);
717
750
  const inputContent = needsAnyInput ? needsStructuredParams ? minimalInlineFieldConfig ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Form.Item, {
718
751
  name: [
719
752
  'params',
@@ -757,121 +790,122 @@ const PromptInput = ({ runButtonEnabled, form, serviceMode, selectedType, dryMod
757
790
  });
758
791
  var _chrome_icons_action;
759
792
  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;
793
+ const minimalActionChevronSrc = null == chrome ? void 0 : null == (_chrome_icons1 = chrome.icons) ? void 0 : _chrome_icons1.actionChevron;
762
794
  var _chrome_icons_settings;
763
795
  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;
764
- if (isMinimalChrome) {
765
- var _chrome_icons3;
766
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
767
- className: "prompt-input-wrapper prompt-input-wrapper-minimal",
768
- children: [
769
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Form.Item, {
770
- hidden: true,
771
- name: "type",
772
- style: {
773
- margin: 0
774
- },
775
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Input, {})
776
- }),
777
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
778
- className: `main-side-console-input minimal-main-side-console-input ${!runButtonEnabled ? 'disabled' : ''} ${loading ? 'loading' : ''}`,
779
- children: [
780
- inputContent,
781
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
782
- className: "minimal-toolbar-row",
783
- children: [
784
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
785
- className: "minimal-toolbar-left",
786
- children: [
787
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Dropdown, {
788
- menu: actionDropdownMenu,
789
- placement: "topLeft",
790
- trigger: [
791
- 'click'
792
- ],
796
+ const minimalHistoryIconSrc = null == chrome ? void 0 : null == (_chrome_icons3 = chrome.icons) ? void 0 : _chrome_icons3.history;
797
+ if (isMinimalChrome) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
798
+ className: "prompt-input-wrapper prompt-input-wrapper-minimal",
799
+ children: [
800
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Form.Item, {
801
+ hidden: true,
802
+ name: "type",
803
+ style: {
804
+ margin: 0
805
+ },
806
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Input, {})
807
+ }),
808
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
809
+ className: `main-side-console-input minimal-main-side-console-input ${!runButtonEnabled ? 'disabled' : ''} ${loading ? 'loading' : ''}`,
810
+ children: [
811
+ inputContent,
812
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
813
+ className: "minimal-toolbar-row",
814
+ children: [
815
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
816
+ className: "minimal-toolbar-left",
817
+ children: [
818
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Dropdown, {
819
+ menu: actionDropdownMenu,
820
+ placement: "topLeft",
821
+ trigger: [
822
+ 'click'
823
+ ],
824
+ disabled: !runButtonEnabled,
825
+ overlayClassName: "more-apis-dropdown",
826
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("button", {
827
+ "aria-label": `Select action type (current: ${actionButtonLabel})`,
828
+ className: "minimal-action-trigger",
793
829
  disabled: !runButtonEnabled,
794
- overlayClassName: "more-apis-dropdown",
795
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("button", {
796
- "aria-label": `Select action type (current: ${actionButtonLabel})`,
797
- className: "minimal-action-trigger",
798
- disabled: !runButtonEnabled,
799
- type: "button",
800
- children: [
801
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
802
- alt: "",
803
- className: "minimal-action-icon",
804
- src: minimalActionIconSrc
805
- }),
806
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
807
- className: "minimal-action-label",
808
- children: actionButtonLabel
809
- }),
810
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
811
- alt: "",
812
- className: "minimal-action-chevron",
813
- src: minimalActionChevronSrc
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
- popupPlacement: "top",
830
+ type: "button",
831
+ children: [
832
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
833
+ alt: "",
834
+ className: "minimal-action-icon",
835
+ src: minimalActionIconSrc
836
+ }),
837
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
838
+ className: "minimal-action-label",
839
+ children: actionButtonLabel
840
+ }),
841
+ minimalActionChevronSrc ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
842
+ alt: "",
843
+ className: "minimal-action-chevron",
844
+ src: minimalActionChevronSrc
845
+ }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(action_chevron_js_default(), {
846
+ "aria-hidden": "true",
847
+ className: "minimal-action-chevron",
848
+ focusable: "false"
849
+ })
850
+ ]
851
+ })
852
+ }),
853
+ hasConfigOptions ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
854
+ className: hoveringSettings ? 'settings-wrapper settings-wrapper-hover' : 'settings-wrapper',
855
+ onMouseEnter: handleMouseEnter,
856
+ onMouseLeave: handleMouseLeave,
857
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.ConfigSelector, {
858
+ enableTracking: 'In-Browser-Extension' === serviceMode,
859
+ showDeepLocateOption: showDeepLocateOption,
860
+ showDeepThinkOption: showDeepThinkOption,
861
+ showDataExtractionOptions: showDataExtractionOptions,
862
+ hideDomAndScreenshotOptions: hideDomAndScreenshotOptions,
863
+ deviceType: deviceType,
864
+ popupPlacement: "topRight",
823
865
  trigger: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
824
- "aria-label": "Open prompt history",
866
+ "aria-label": "Open run configuration",
825
867
  className: "minimal-icon-trigger",
826
868
  type: "button",
827
- children: (null == chrome ? void 0 : null == (_chrome_icons3 = chrome.icons) ? void 0 : _chrome_icons3.history) ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
869
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
828
870
  alt: "",
829
871
  className: "minimal-toolbar-icon",
830
- src: chrome.icons.history
831
- }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_icons_history_js_default(), {
832
- className: "minimal-toolbar-icon minimal-toolbar-icon-history minimal-toolbar-icon-fallback",
833
- width: 18,
834
- height: 18
872
+ src: minimalSettingsIconSrc
835
873
  })
836
874
  })
837
- }),
838
- hasConfigOptions ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
839
- className: hoveringSettings ? 'settings-wrapper settings-wrapper-hover' : 'settings-wrapper',
840
- onMouseEnter: handleMouseEnter,
841
- onMouseLeave: handleMouseLeave,
842
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.ConfigSelector, {
843
- enableTracking: 'In-Browser-Extension' === serviceMode,
844
- showDeepLocateOption: showDeepLocateOption,
845
- showDeepThinkOption: showDeepThinkOption,
846
- showDataExtractionOptions: showDataExtractionOptions,
847
- hideDomAndScreenshotOptions: hideDomAndScreenshotOptions,
848
- deviceType: deviceType,
849
- popupPlacement: "topRight",
850
- trigger: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
851
- "aria-label": "Open run configuration",
852
- className: "minimal-icon-trigger",
853
- type: "button",
854
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
855
- alt: "",
856
- className: "minimal-toolbar-icon",
857
- src: minimalSettingsIconSrc
858
- })
859
- })
875
+ })
876
+ }) : null,
877
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_history_selector_index_js_namespaceObject.HistorySelector, {
878
+ onSelect: handleSelectHistory,
879
+ history: historyForSelectedType,
880
+ currentType: selectedType,
881
+ popupPlacement: "top",
882
+ trigger: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
883
+ "aria-label": "Open prompt history",
884
+ className: "minimal-icon-trigger",
885
+ type: "button",
886
+ children: minimalHistoryIconSrc ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
887
+ alt: "",
888
+ className: "minimal-toolbar-icon minimal-toolbar-icon-history",
889
+ src: minimalHistoryIconSrc
890
+ }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(prompt_history_js_default(), {
891
+ "aria-hidden": "true",
892
+ className: "minimal-toolbar-icon minimal-toolbar-icon-history",
893
+ focusable: "false"
860
894
  })
861
- }) : null
862
- ]
863
- }),
864
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
865
- className: "form-controller-wrapper",
866
- children: renderActionButton()
867
- })
868
- ]
869
- })
870
- ]
871
- })
872
- ]
873
- });
874
- }
895
+ })
896
+ })
897
+ ]
898
+ }),
899
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
900
+ className: "form-controller-wrapper",
901
+ children: renderMinimalActionButton()
902
+ })
903
+ ]
904
+ })
905
+ ]
906
+ })
907
+ ]
908
+ });
875
909
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
876
910
  className: "prompt-input-wrapper",
877
911
  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 {
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ shouldRenderCustomEmptyState: ()=>shouldRenderCustomEmptyState
28
+ });
29
+ function shouldRenderCustomEmptyState(infoList, emptyState) {
30
+ var _infoList_;
31
+ return void 0 !== emptyState && 1 === infoList.length && (null == (_infoList_ = infoList[0]) ? void 0 : _infoList_.id) === 'welcome';
32
+ }
33
+ exports.shouldRenderCustomEmptyState = __webpack_exports__.shouldRenderCustomEmptyState;
34
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
35
+ "shouldRenderCustomEmptyState"
36
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
37
+ Object.defineProperty(exports, '__esModule', {
38
+ value: true
39
+ });
@@ -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);
@@ -51,10 +51,13 @@ 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 empty_state_scroll_js_namespaceObject = require("../../utils/empty-state-scroll.js");
54
55
  const progress_action_icon_js_namespaceObject = require("../../utils/progress-action-icon.js");
56
+ const prompt_input_utils_js_namespaceObject = require("../../utils/prompt-input-utils.js");
55
57
  const external_prompt_input_index_js_namespaceObject = require("../prompt-input/index.js");
56
58
  const external_shiny_text_index_js_namespaceObject = require("../shiny-text/index.js");
57
59
  var external_shiny_text_index_js_default = /*#__PURE__*/ __webpack_require__.n(external_shiny_text_index_js_namespaceObject);
60
+ const external_empty_state_js_namespaceObject = require("./empty-state.js");
58
61
  const storage_provider_js_namespaceObject = require("./providers/storage-provider.js");
59
62
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
60
63
  try {
@@ -236,6 +239,52 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
236
239
  }, [
237
240
  infoList
238
241
  ]);
242
+ const renderCustomEmptyState = (0, external_empty_state_js_namespaceObject.shouldRenderCustomEmptyState)(visibleInfoList, componentConfig.emptyState);
243
+ const shouldOffsetEmptyStateForPrompt = (0, external_react_namespaceObject.useMemo)(()=>renderCustomEmptyState && (0, prompt_input_utils_js_namespaceObject.shouldOffsetEmptyStateForPromptInput)(actionSpace, selectedType), [
244
+ actionSpace,
245
+ renderCustomEmptyState,
246
+ selectedType
247
+ ]);
248
+ (0, external_react_namespaceObject.useEffect)(()=>{
249
+ if (!shouldOffsetEmptyStateForPrompt) return;
250
+ const adjustEmptyStateScroll = ()=>{
251
+ const container = infoListRef.current;
252
+ if (!container) return;
253
+ const wrapper = container.querySelector('.playground-empty-state-wrapper');
254
+ const contentStart = null == wrapper ? void 0 : wrapper.querySelector('[data-playground-empty-state-content-start]');
255
+ const contentEnd = null == wrapper ? void 0 : wrapper.querySelector('[data-playground-empty-state-content-end]');
256
+ if (!(contentStart instanceof HTMLElement) || !(contentEnd instanceof HTMLElement)) return;
257
+ const containerRect = container.getBoundingClientRect();
258
+ const startRect = contentStart.getBoundingClientRect();
259
+ const endRect = contentEnd.getBoundingClientRect();
260
+ const top = (0, empty_state_scroll_js_namespaceObject.calculateEmptyStatePromptScrollTop)({
261
+ currentScrollTop: container.scrollTop,
262
+ maxScrollTop: Math.max(0, container.scrollHeight - container.clientHeight),
263
+ containerTop: containerRect.top,
264
+ containerBottom: containerRect.bottom,
265
+ contentStartTop: startRect.top,
266
+ contentEndBottom: endRect.bottom
267
+ });
268
+ container.scrollTo({
269
+ top,
270
+ behavior: 'auto'
271
+ });
272
+ };
273
+ const animationFrameId = window.requestAnimationFrame(adjustEmptyStateScroll);
274
+ const timeoutId = window.setTimeout(adjustEmptyStateScroll, 160);
275
+ return ()=>{
276
+ window.cancelAnimationFrame(animationFrameId);
277
+ window.clearTimeout(timeoutId);
278
+ };
279
+ }, [
280
+ infoListRef,
281
+ selectedType,
282
+ shouldOffsetEmptyStateForPrompt
283
+ ]);
284
+ const emptyStateWrapperClassName = [
285
+ 'playground-empty-state-wrapper',
286
+ shouldOffsetEmptyStateForPrompt ? 'playground-empty-state-wrapper-offset-for-prompt' : ''
287
+ ].filter(Boolean).join(' ');
239
288
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
240
289
  className: `playground-container ${layout}-mode ${className}`.trim(),
241
290
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_antd_namespaceObject.Form, {
@@ -267,7 +316,10 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
267
316
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
268
317
  ref: infoListRef,
269
318
  className: "info-list-container",
270
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.List, {
319
+ children: renderCustomEmptyState ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
320
+ className: emptyStateWrapperClassName,
321
+ children: componentConfig.emptyState
322
+ }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.List, {
271
323
  itemLayout: "vertical",
272
324
  dataSource: visibleInfoList,
273
325
  renderItem: (item)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_antd_namespaceObject.List.Item, {
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ default: ()=>action_chevron
28
+ });
29
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
+ require("react");
31
+ function _define_property(obj, key, value) {
32
+ if (key in obj) Object.defineProperty(obj, key, {
33
+ value: value,
34
+ enumerable: true,
35
+ configurable: true,
36
+ writable: true
37
+ });
38
+ else obj[key] = value;
39
+ return obj;
40
+ }
41
+ function _object_spread(target) {
42
+ for(var i = 1; i < arguments.length; i++){
43
+ var source = null != arguments[i] ? arguments[i] : {};
44
+ var ownKeys = Object.keys(source);
45
+ if ("function" == typeof Object.getOwnPropertySymbols) ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
46
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
47
+ }));
48
+ ownKeys.forEach(function(key) {
49
+ _define_property(target, key, source[key]);
50
+ });
51
+ }
52
+ return target;
53
+ }
54
+ function action_chevron_ownKeys(object, enumerableOnly) {
55
+ var keys = Object.keys(object);
56
+ if (Object.getOwnPropertySymbols) {
57
+ var symbols = Object.getOwnPropertySymbols(object);
58
+ if (enumerableOnly) symbols = symbols.filter(function(sym) {
59
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
60
+ });
61
+ keys.push.apply(keys, symbols);
62
+ }
63
+ return keys;
64
+ }
65
+ function _object_spread_props(target, source) {
66
+ source = null != source ? source : {};
67
+ if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
68
+ else action_chevron_ownKeys(Object(source)).forEach(function(key) {
69
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
70
+ });
71
+ return target;
72
+ }
73
+ const SvgActionChevron = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("svg", _object_spread_props(_object_spread({
74
+ xmlns: "http://www.w3.org/2000/svg",
75
+ width: 6,
76
+ height: 10,
77
+ fill: "none",
78
+ viewBox: "0 0 6 10"
79
+ }, props), {
80
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
81
+ fill: "#000",
82
+ fillOpacity: 0.25,
83
+ fillRule: "evenodd",
84
+ d: "M.195 9.138a.667.667 0 0 1 0-.943l3.529-3.528L.195 1.138a.667.667 0 0 1 .943-.943l4 4c.26.26.26.683 0 .943l-4 4a.667.667 0 0 1-.943 0",
85
+ clipRule: "evenodd"
86
+ })
87
+ }));
88
+ const action_chevron = SvgActionChevron;
89
+ exports["default"] = __webpack_exports__["default"];
90
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
91
+ "default"
92
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
93
+ Object.defineProperty(exports, '__esModule', {
94
+ value: true
95
+ });