@midscene/visualizer 0.15.0 → 0.15.1

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.
@@ -90,7 +90,6 @@
90
90
  flex-direction: row;
91
91
  align-items: center;
92
92
  overflow: hidden;
93
- max-width: calc(100% - 50px);
94
93
  }
95
94
  .player-container .player-tools .status-icon {
96
95
  transition: 0.2s;
@@ -59,6 +59,7 @@ const PromptInput = ({
59
59
  }) => {
60
60
  const [hoveringSettings, setHoveringSettings] = (0, import_react.useState)(false);
61
61
  const placeholder = (0, import_playground_utils.getPlaceholderForType)(selectedType);
62
+ const textAreaRef = (0, import_react.useRef)(null);
62
63
  const history = (0, import_history.useHistoryStore)((state) => state.history);
63
64
  const addHistory = (0, import_history.useHistoryStore)((state) => state.addHistory);
64
65
  const lastHistory = history[0];
@@ -105,6 +106,14 @@ const PromptInput = ({
105
106
  },
106
107
  [handleRunWithHistory]
107
108
  );
109
+ const handleChange = (0, import_react.useCallback)(() => {
110
+ setTimeout(() => {
111
+ if (textAreaRef.current) {
112
+ const textarea = textAreaRef.current.resizableTextArea.textArea;
113
+ textarea.scrollTop = textarea.scrollHeight;
114
+ }
115
+ }, 0);
116
+ }, []);
108
117
  const handleMouseEnter = (0, import_react.useCallback)(() => {
109
118
  setHoveringSettings(true);
110
119
  }, []);
@@ -166,37 +175,45 @@ const PromptInput = ({
166
175
  ) }),
167
176
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_HistorySelector.HistorySelector, { onSelect: handleSelectHistory })
168
177
  ] }),
169
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "main-side-console-input", children: [
170
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Form.Item, { name: "prompt", style: { margin: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
171
- TextArea,
172
- {
173
- className: "main-side-console-input-textarea",
174
- disabled: !runButtonEnabled,
175
- rows: 4,
176
- placeholder,
177
- autoFocus: true,
178
- onKeyDown: handleKeyDown
179
- }
180
- ) }),
181
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "form-controller-wrapper", children: [
182
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
183
- "div",
184
- {
185
- className: hoveringSettings ? "settings-wrapper settings-wrapper-hover" : "settings-wrapper",
186
- onMouseEnter: handleMouseEnter,
187
- onMouseLeave: handleMouseLeave,
188
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
189
- import_ConfigSelector.ConfigSelector,
178
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
179
+ "div",
180
+ {
181
+ className: `main-side-console-input ${!runButtonEnabled ? "disabled" : ""}`,
182
+ children: [
183
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Form.Item, { name: "prompt", style: { margin: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
184
+ TextArea,
185
+ {
186
+ className: "main-side-console-input-textarea",
187
+ disabled: !runButtonEnabled,
188
+ rows: 2,
189
+ placeholder,
190
+ autoFocus: true,
191
+ onKeyDown: handleKeyDown,
192
+ onChange: handleChange,
193
+ ref: textAreaRef
194
+ }
195
+ ) }),
196
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "form-controller-wrapper", children: [
197
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
198
+ "div",
190
199
  {
191
- enableTracking: serviceMode === "In-Browser-Extension",
192
- showDeepThinkOption: selectedType === "aiTap"
200
+ className: hoveringSettings ? "settings-wrapper settings-wrapper-hover" : "settings-wrapper",
201
+ onMouseEnter: handleMouseEnter,
202
+ onMouseLeave: handleMouseLeave,
203
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
204
+ import_ConfigSelector.ConfigSelector,
205
+ {
206
+ enableTracking: serviceMode === "In-Browser-Extension",
207
+ showDeepThinkOption: selectedType === "aiTap"
208
+ }
209
+ )
193
210
  }
194
- )
195
- }
196
- ),
197
- renderActionButton()
198
- ] })
199
- ] })
211
+ ),
212
+ renderActionButton()
213
+ ] })
214
+ ]
215
+ }
216
+ )
200
217
  ] });
201
218
  };
202
219
  // Annotate the CommonJS export names for ESM import in node:
@@ -155,26 +155,44 @@ body {
155
155
  margin-top: 10px;
156
156
  }
157
157
  .input-wrapper .main-side-console-input .main-side-console-input-textarea {
158
- height: 90px;
159
158
  border-radius: 12px;
160
159
  border: 1px solid rgba(0, 0, 0, 0.12);
161
- padding: 12px 16px;
160
+ padding: 12px 16px 52px 16px;
161
+ transition: background-color 0.2s ease;
162
+ overflow-y: auto;
163
+ white-space: pre-wrap;
164
+ line-height: 21px;
165
+ max-height: 150px;
166
+ scrollbar-width: thin;
167
+ }
168
+ .input-wrapper .main-side-console-input .main-side-console-input-textarea::-webkit-scrollbar {
169
+ width: 6px;
170
+ }
171
+ .input-wrapper .main-side-console-input .main-side-console-input-textarea::-webkit-scrollbar-thumb {
172
+ background-color: rgba(0, 0, 0, 0.2);
173
+ border-radius: 3px;
174
+ }
175
+ .input-wrapper .main-side-console-input.disabled .form-controller-wrapper {
176
+ background-color: transparent;
162
177
  }
163
178
  .input-wrapper .ant-input {
164
179
  padding-bottom: 40px;
165
180
  }
166
181
  .input-wrapper .form-controller-wrapper {
167
182
  position: absolute;
168
- bottom: 8px;
169
- padding: 0 12px;
170
- left: 0px;
171
183
  display: flex;
172
184
  flex-direction: row;
173
185
  justify-content: space-between;
174
- width: 100%;
186
+ width: calc(100% - 32px);
175
187
  box-sizing: border-box;
176
188
  align-items: flex-end;
177
189
  gap: 8px;
190
+ background-color: #FFF;
191
+ left: 16px;
192
+ bottom: 0.5px;
193
+ padding: 8px 0;
194
+ line-height: 32px;
195
+ transition: background-color 0.2s ease;
178
196
  }
179
197
  .input-wrapper .settings-wrapper {
180
198
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/visualizer",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "repository": "https://github.com/web-infra-dev/midscene",
5
5
  "homepage": "https://midscenejs.com/",
6
6
  "types": "./dist/types/index.d.ts",
@@ -71,9 +71,9 @@
71
71
  "@ant-design/icons": "^5.3.1",
72
72
  "antd": "^5.21.6",
73
73
  "dayjs": "1.11.11",
74
- "@midscene/core": "0.15.0",
75
- "@midscene/shared": "0.15.0",
76
- "@midscene/web": "0.15.0"
74
+ "@midscene/core": "0.15.1",
75
+ "@midscene/shared": "0.15.1",
76
+ "@midscene/web": "0.15.1"
77
77
  },
78
78
  "scripts": {
79
79
  "dev": "npm run build && npx npm-watch",