@zhongqian97-code/ecode 0.5.46 → 0.5.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/index.js
CHANGED
|
@@ -923,6 +923,6 @@ Node.js 16/18 \u8BF7\u4F7F\u7528 --web \u6216 --pipe \u6A21\u5F0F\u3002
|
|
|
923
923
|
);
|
|
924
924
|
process.exit(1);
|
|
925
925
|
}
|
|
926
|
-
const { App, React, render } = await import("./ui-
|
|
926
|
+
const { App, React, render } = await import("./ui-6WIYQZ7Y.js");
|
|
927
927
|
render(React.createElement(App, { config: finalConfig, version: VERSION, autoMode, registry, trustedSkillDirs, initialMessages }));
|
|
928
928
|
}
|
|
@@ -758,35 +758,6 @@ function confirmSelection(inputText, selectedPath) {
|
|
|
758
758
|
return `${prefix}@${selectedPath} `;
|
|
759
759
|
}
|
|
760
760
|
|
|
761
|
-
// src/ui/mouseInput.ts
|
|
762
|
-
var SGR_MOUSE_RE = /^\x1b\[<(\d+);\d+;\d+[Mm]/;
|
|
763
|
-
function mouseEventLength(data) {
|
|
764
|
-
const s = typeof data === "string" ? data : data.toString("binary");
|
|
765
|
-
if (!s) return 0;
|
|
766
|
-
const sgrMatch = SGR_MOUSE_RE.exec(s);
|
|
767
|
-
if (sgrMatch) return sgrMatch[0].length;
|
|
768
|
-
if (s.length >= 6 && s.charCodeAt(0) === 27 && s[1] === "[" && s[2] === "M") return 6;
|
|
769
|
-
return 0;
|
|
770
|
-
}
|
|
771
|
-
function parseMouseScroll(data) {
|
|
772
|
-
const s = typeof data === "string" ? data : data.toString("binary");
|
|
773
|
-
if (!s) return null;
|
|
774
|
-
const sgrMatch = SGR_MOUSE_RE.exec(s);
|
|
775
|
-
if (sgrMatch) {
|
|
776
|
-
const cb = parseInt(sgrMatch[1], 10);
|
|
777
|
-
if (cb === 64) return { direction: "up" };
|
|
778
|
-
if (cb === 65) return { direction: "down" };
|
|
779
|
-
return null;
|
|
780
|
-
}
|
|
781
|
-
if (s.length >= 6 && s.charCodeAt(0) === 27 && s[1] === "[" && s[2] === "M") {
|
|
782
|
-
const buttonByte = s.charCodeAt(3);
|
|
783
|
-
if (buttonByte === 96) return { direction: "up" };
|
|
784
|
-
if (buttonByte === 97) return { direction: "down" };
|
|
785
|
-
return null;
|
|
786
|
-
}
|
|
787
|
-
return null;
|
|
788
|
-
}
|
|
789
|
-
|
|
790
761
|
// src/ui/App.tsx
|
|
791
762
|
import { homedir as homedir2 } from "os";
|
|
792
763
|
import { join as join4 } from "path";
|
|
@@ -2424,44 +2395,6 @@ function App({ config, version, autoMode = false, registry, trustedSkillDirs = [
|
|
|
2424
2395
|
automationManagerRef.current.stop();
|
|
2425
2396
|
};
|
|
2426
2397
|
}, []);
|
|
2427
|
-
useEffect3(() => {
|
|
2428
|
-
if (!stdin || !stdout) return;
|
|
2429
|
-
stdout.write("\x1B[?1000h\x1B[?1006h");
|
|
2430
|
-
const origEmit = stdin.emit;
|
|
2431
|
-
stdin.emit = function(event, ...args) {
|
|
2432
|
-
if (event === "readable") {
|
|
2433
|
-
const chunk = stdin.read();
|
|
2434
|
-
if (chunk !== null) {
|
|
2435
|
-
const s = typeof chunk === "string" ? chunk : chunk.toString("binary");
|
|
2436
|
-
const mouseLen = mouseEventLength(s);
|
|
2437
|
-
if (mouseLen > 0) {
|
|
2438
|
-
const mouseStr = s.slice(0, mouseLen);
|
|
2439
|
-
const scrollEvent = parseMouseScroll(mouseStr);
|
|
2440
|
-
if (scrollEvent) {
|
|
2441
|
-
if (scrollEvent.direction === "up") {
|
|
2442
|
-
setScrollOffset((prev) => Math.min(prev + 3, Math.max(0, totalLinesRef.current - 1)));
|
|
2443
|
-
} else {
|
|
2444
|
-
setScrollOffset((prev) => Math.max(0, prev - 3));
|
|
2445
|
-
}
|
|
2446
|
-
}
|
|
2447
|
-
const remainder = s.slice(mouseLen);
|
|
2448
|
-
if (remainder.length > 0) {
|
|
2449
|
-
stdin.unshift(
|
|
2450
|
-
typeof chunk === "string" ? remainder : Buffer.from(remainder, "binary")
|
|
2451
|
-
);
|
|
2452
|
-
}
|
|
2453
|
-
} else {
|
|
2454
|
-
stdin.unshift(chunk);
|
|
2455
|
-
}
|
|
2456
|
-
}
|
|
2457
|
-
}
|
|
2458
|
-
return origEmit.apply(stdin, [event, ...args]);
|
|
2459
|
-
};
|
|
2460
|
-
return () => {
|
|
2461
|
-
stdout.write("\x1B[?1000l\x1B[?1006l");
|
|
2462
|
-
stdin.emit = origEmit;
|
|
2463
|
-
};
|
|
2464
|
-
}, [stdin, stdout]);
|
|
2465
2398
|
useEffect3(() => {
|
|
2466
2399
|
const atFragment = extractAtQuery(fileAcState.query);
|
|
2467
2400
|
if (atFragment === null) {
|