wormclaude 1.0.47 → 1.0.48
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/theme.js +1 -1
- package/dist/tui.js +24 -11
- package/package.json +1 -1
package/dist/theme.js
CHANGED
package/dist/tui.js
CHANGED
|
@@ -55,15 +55,32 @@ export async function runTui() {
|
|
|
55
55
|
const displayItems = [{ kind: 'banner' }];
|
|
56
56
|
let inputBuf = '', busy = false, streamChars = 0, spin = 0;
|
|
57
57
|
const SPIN = ['·', '✢', '✳', '✶', '✻', '✽', '✶', '✳', '✢'];
|
|
58
|
-
//
|
|
58
|
+
// Giriş kutusunu genişliğe göre ÇOK SATIRA sar (uzun mesaj/kod sağa taşmaz, alta iner).
|
|
59
|
+
const MAX_INPUT_LINES = 10;
|
|
60
|
+
const inputBoxLines = (W) => {
|
|
61
|
+
const inner = Math.max(4, W - 2); // "✶ " önek payı
|
|
62
|
+
const wrapped = [];
|
|
63
|
+
let cur = '';
|
|
64
|
+
for (const ch of inputBuf) {
|
|
65
|
+
if (vis(cur + ch) > inner) {
|
|
66
|
+
wrapped.push(cur);
|
|
67
|
+
cur = ch;
|
|
68
|
+
}
|
|
69
|
+
else
|
|
70
|
+
cur += ch;
|
|
71
|
+
}
|
|
72
|
+
wrapped.push(cur);
|
|
73
|
+
const shown = wrapped.length > MAX_INPUT_LINES ? wrapped.slice(-MAX_INPUT_LINES) : wrapped; // çok uzunsa sonu göster
|
|
74
|
+
return shown.map((ln, i) => (i === 0 ? paint('✶ ', theme.redBright, true) : ' ') + paint(ln, theme.white) + (i === shown.length - 1 ? paint('▌', theme.greyDim) : ''));
|
|
75
|
+
};
|
|
76
|
+
// Footer yüksekliği DİNAMİK: izin=4; değilse (durum/menü) + çizgi + giriş-satırları + çizgi.
|
|
59
77
|
let prevFH = 4;
|
|
60
78
|
const footerHeight = () => {
|
|
61
79
|
if (perm)
|
|
62
80
|
return 4;
|
|
63
81
|
const m = cmdMatches();
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return 4;
|
|
82
|
+
const statusLines = m.length ? Math.min(8, m.length) : 1;
|
|
83
|
+
return statusLines + 2 + inputBoxLines(Math.max(8, cols())).length;
|
|
67
84
|
};
|
|
68
85
|
// Yükseklik değiştiyse scroll-region'ı + içeriği yeniden bas; değişmediyse sadece footer'ı çiz.
|
|
69
86
|
const refresh = () => { const fh = footerHeight(); if (fh !== prevFH)
|
|
@@ -150,11 +167,7 @@ export async function runTui() {
|
|
|
150
167
|
body = [line, q, opts, line];
|
|
151
168
|
}
|
|
152
169
|
else {
|
|
153
|
-
|
|
154
|
-
const avail = W - 3;
|
|
155
|
-
if (vis(shown) > avail)
|
|
156
|
-
shown = '…' + shown.slice(-(avail - 1));
|
|
157
|
-
const inputLine = paint('✶ ', theme.redBright, true) + paint(shown, theme.white) + paint('▌', theme.greyDim);
|
|
170
|
+
const inputLines = inputBoxLines(W); // çok-satırlı giriş (sarılmış)
|
|
158
171
|
const m = cmdMatches();
|
|
159
172
|
if (m.length) {
|
|
160
173
|
// DİKEY slash menü (alt alta), seçili kırmızı — kutunun üstünde.
|
|
@@ -164,13 +177,13 @@ export async function runTui() {
|
|
|
164
177
|
const on = i === sel;
|
|
165
178
|
return ' ' + paint((on ? '✶ ' : ' ') + c.name.padEnd(13), on ? theme.redBright : theme.grey) + paint(cmdDesc(c.name) || c.desc || '', theme.greyDim);
|
|
166
179
|
});
|
|
167
|
-
body = [...menu, line,
|
|
180
|
+
body = [...menu, line, ...inputLines, line];
|
|
168
181
|
}
|
|
169
182
|
else {
|
|
170
183
|
const status = busy
|
|
171
184
|
? paint(` ${SPIN[spin % SPIN.length]} çalışıyor…${streamChars ? ' ' + streamChars + ' karakter' : ''}`, theme.grey)
|
|
172
185
|
: paint(' / komutlar · ↑↓ geçmiş · /kopyala · Ctrl+C çıkış', theme.greyDim);
|
|
173
|
-
body = [status, line,
|
|
186
|
+
body = [status, line, ...inputLines, line];
|
|
174
187
|
}
|
|
175
188
|
}
|
|
176
189
|
let out = '\x1b7'; // imleci kaydet
|