@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.
- package/dist/es/component/player.css +0 -1
- package/dist/es/component/playground/PromptInput.js +47 -30
- package/dist/es/component/playground/index.css +24 -6
- package/dist/index.css +24 -7
- package/dist/index.js +1 -1
- package/dist/lib/component/player.css +0 -1
- package/dist/lib/component/playground/PromptInput.js +46 -29
- package/dist/lib/component/playground/index.css +24 -6
- package/package.json +4 -4
|
@@ -7,7 +7,7 @@ var buffer = {
|
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { BorderOutlined, SendOutlined } from "@ant-design/icons";
|
|
9
9
|
import { Button, Form, Input, Radio, Space, Tooltip } from "antd";
|
|
10
|
-
import { useCallback, useEffect, useState } from "react";
|
|
10
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
11
11
|
import { useHistoryStore } from "../store/history";
|
|
12
12
|
import { ConfigSelector } from "./ConfigSelector";
|
|
13
13
|
import { HistorySelector } from "./HistorySelector";
|
|
@@ -26,6 +26,7 @@ const PromptInput = ({
|
|
|
26
26
|
}) => {
|
|
27
27
|
const [hoveringSettings, setHoveringSettings] = useState(false);
|
|
28
28
|
const placeholder = getPlaceholderForType(selectedType);
|
|
29
|
+
const textAreaRef = useRef(null);
|
|
29
30
|
const history = useHistoryStore((state) => state.history);
|
|
30
31
|
const addHistory = useHistoryStore((state) => state.addHistory);
|
|
31
32
|
const lastHistory = history[0];
|
|
@@ -72,6 +73,14 @@ const PromptInput = ({
|
|
|
72
73
|
},
|
|
73
74
|
[handleRunWithHistory]
|
|
74
75
|
);
|
|
76
|
+
const handleChange = useCallback(() => {
|
|
77
|
+
setTimeout(() => {
|
|
78
|
+
if (textAreaRef.current) {
|
|
79
|
+
const textarea = textAreaRef.current.resizableTextArea.textArea;
|
|
80
|
+
textarea.scrollTop = textarea.scrollHeight;
|
|
81
|
+
}
|
|
82
|
+
}, 0);
|
|
83
|
+
}, []);
|
|
75
84
|
const handleMouseEnter = useCallback(() => {
|
|
76
85
|
setHoveringSettings(true);
|
|
77
86
|
}, []);
|
|
@@ -133,37 +142,45 @@ const PromptInput = ({
|
|
|
133
142
|
) }),
|
|
134
143
|
/* @__PURE__ */ jsx(HistorySelector, { onSelect: handleSelectHistory })
|
|
135
144
|
] }),
|
|
136
|
-
/* @__PURE__ */ jsxs(
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
{
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
145
|
+
/* @__PURE__ */ jsxs(
|
|
146
|
+
"div",
|
|
147
|
+
{
|
|
148
|
+
className: `main-side-console-input ${!runButtonEnabled ? "disabled" : ""}`,
|
|
149
|
+
children: [
|
|
150
|
+
/* @__PURE__ */ jsx(Form.Item, { name: "prompt", style: { margin: 0 }, children: /* @__PURE__ */ jsx(
|
|
151
|
+
TextArea,
|
|
152
|
+
{
|
|
153
|
+
className: "main-side-console-input-textarea",
|
|
154
|
+
disabled: !runButtonEnabled,
|
|
155
|
+
rows: 2,
|
|
156
|
+
placeholder,
|
|
157
|
+
autoFocus: true,
|
|
158
|
+
onKeyDown: handleKeyDown,
|
|
159
|
+
onChange: handleChange,
|
|
160
|
+
ref: textAreaRef
|
|
161
|
+
}
|
|
162
|
+
) }),
|
|
163
|
+
/* @__PURE__ */ jsxs("div", { className: "form-controller-wrapper", children: [
|
|
164
|
+
/* @__PURE__ */ jsx(
|
|
165
|
+
"div",
|
|
157
166
|
{
|
|
158
|
-
|
|
159
|
-
|
|
167
|
+
className: hoveringSettings ? "settings-wrapper settings-wrapper-hover" : "settings-wrapper",
|
|
168
|
+
onMouseEnter: handleMouseEnter,
|
|
169
|
+
onMouseLeave: handleMouseLeave,
|
|
170
|
+
children: /* @__PURE__ */ jsx(
|
|
171
|
+
ConfigSelector,
|
|
172
|
+
{
|
|
173
|
+
enableTracking: serviceMode === "In-Browser-Extension",
|
|
174
|
+
showDeepThinkOption: selectedType === "aiTap"
|
|
175
|
+
}
|
|
176
|
+
)
|
|
160
177
|
}
|
|
161
|
-
)
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
178
|
+
),
|
|
179
|
+
renderActionButton()
|
|
180
|
+
] })
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
)
|
|
167
184
|
] });
|
|
168
185
|
};
|
|
169
186
|
export {
|
|
@@ -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/dist/index.css
CHANGED
|
@@ -156,26 +156,44 @@ body {
|
|
|
156
156
|
margin-top: 10px;
|
|
157
157
|
}
|
|
158
158
|
.input-wrapper .main-side-console-input .main-side-console-input-textarea {
|
|
159
|
-
height: 90px;
|
|
160
159
|
border-radius: 12px;
|
|
161
160
|
border: 1px solid rgba(0, 0, 0, 0.12);
|
|
162
|
-
padding: 12px 16px;
|
|
161
|
+
padding: 12px 16px 52px 16px;
|
|
162
|
+
transition: background-color 0.2s ease;
|
|
163
|
+
overflow-y: auto;
|
|
164
|
+
white-space: pre-wrap;
|
|
165
|
+
line-height: 21px;
|
|
166
|
+
max-height: 150px;
|
|
167
|
+
scrollbar-width: thin;
|
|
168
|
+
}
|
|
169
|
+
.input-wrapper .main-side-console-input .main-side-console-input-textarea::-webkit-scrollbar {
|
|
170
|
+
width: 6px;
|
|
171
|
+
}
|
|
172
|
+
.input-wrapper .main-side-console-input .main-side-console-input-textarea::-webkit-scrollbar-thumb {
|
|
173
|
+
background-color: rgba(0, 0, 0, 0.2);
|
|
174
|
+
border-radius: 3px;
|
|
175
|
+
}
|
|
176
|
+
.input-wrapper .main-side-console-input.disabled .form-controller-wrapper {
|
|
177
|
+
background-color: transparent;
|
|
163
178
|
}
|
|
164
179
|
.input-wrapper .ant-input {
|
|
165
180
|
padding-bottom: 40px;
|
|
166
181
|
}
|
|
167
182
|
.input-wrapper .form-controller-wrapper {
|
|
168
183
|
position: absolute;
|
|
169
|
-
bottom: 8px;
|
|
170
|
-
padding: 0 12px;
|
|
171
|
-
left: 0px;
|
|
172
184
|
display: flex;
|
|
173
185
|
flex-direction: row;
|
|
174
186
|
justify-content: space-between;
|
|
175
|
-
width: 100
|
|
187
|
+
width: calc(100% - 32px);
|
|
176
188
|
box-sizing: border-box;
|
|
177
189
|
align-items: flex-end;
|
|
178
190
|
gap: 8px;
|
|
191
|
+
background-color: #FFF;
|
|
192
|
+
left: 16px;
|
|
193
|
+
bottom: 0.5px;
|
|
194
|
+
padding: 8px 0;
|
|
195
|
+
line-height: 32px;
|
|
196
|
+
transition: background-color 0.2s ease;
|
|
179
197
|
}
|
|
180
198
|
.input-wrapper .settings-wrapper {
|
|
181
199
|
display: flex;
|
|
@@ -281,7 +299,6 @@ body {
|
|
|
281
299
|
flex-direction: row;
|
|
282
300
|
align-items: center;
|
|
283
301
|
overflow: hidden;
|
|
284
|
-
max-width: calc(100% - 50px);
|
|
285
302
|
}
|
|
286
303
|
.player-container .player-tools .status-icon {
|
|
287
304
|
transition: 0.2s;
|