esp32tool 1.6.6 → 1.6.7
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/apple-touch-icon.png +0 -0
- package/css/style.css +325 -25
- package/dist/util/console-color.js +3 -3
- package/dist/util/timestamp-transformer.js +24 -1
- package/electron/cli-main.cjs +19 -19
- package/electron/main.cjs +167 -148
- package/electron/preload.js +16 -18
- package/icons/icon-128.png +0 -0
- package/icons/icon-144.png +0 -0
- package/icons/icon-152.png +0 -0
- package/icons/icon-192.png +0 -0
- package/icons/icon-384.png +0 -0
- package/icons/icon-512.png +0 -0
- package/icons/icon-72.png +0 -0
- package/icons/icon-96.png +0 -0
- package/js/console.js +21 -12
- package/js/hex-editor.js +216 -163
- package/js/improv.js +59 -21
- package/js/nvs-editor.js +1189 -182
- package/js/script.js +1048 -845
- package/js/util/console-color.js +3 -3
- package/js/util/timestamp-transformer.js +24 -1
- package/js/webusb-serial.js +1075 -950
- package/package.cli.json +2 -2
- package/package.json +11 -12
- package/screenshots/desktop.png +0 -0
- package/screenshots/mobile.png +0 -0
- package/src/util/console-color.ts +3 -3
- package/src/util/timestamp-transformer.ts +27 -1
- package/sw.js +1 -1
package/js/util/console-color.js
CHANGED
|
@@ -86,8 +86,6 @@ export class ColoredConsole {
|
|
|
86
86
|
const lineSpan = document.createElement("span");
|
|
87
87
|
lineSpan.classList.add("line");
|
|
88
88
|
const addSpan = (content) => {
|
|
89
|
-
if (content === "")
|
|
90
|
-
return;
|
|
91
89
|
const span = document.createElement("span");
|
|
92
90
|
if (this.state.bold)
|
|
93
91
|
span.classList.add("log-bold");
|
|
@@ -175,7 +173,8 @@ export class ColoredConsole {
|
|
|
175
173
|
}
|
|
176
174
|
if (invalidSgr)
|
|
177
175
|
continue;
|
|
178
|
-
|
|
176
|
+
let ci = 0;
|
|
177
|
+
while (ci < codes.length) {
|
|
179
178
|
const code = codes[ci];
|
|
180
179
|
switch (code) {
|
|
181
180
|
case 0:
|
|
@@ -454,6 +453,7 @@ export class ColoredConsole {
|
|
|
454
453
|
this.state.bgRgb = ANSI_256[15];
|
|
455
454
|
break;
|
|
456
455
|
}
|
|
456
|
+
ci++;
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
459
|
addSpan(line.substring(i));
|
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
// [HH:MM:SS.mmm] wall-clock bracket with millis
|
|
8
8
|
// HH:MM:SS.mmm plain wall-clock
|
|
9
9
|
const DEVICE_TIMESTAMP_RE = /^\s*(?:\[\d{2}:\d{2}:\d{2}(?:\.\d+)?\]|(?:\d{2}:){2}\d{2}\.\d)/;
|
|
10
|
+
// Matches leading ANSI SGR (color/style) codes at the start of a string
|
|
11
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: ANSI escape sequences
|
|
12
|
+
// eslint-disable-next-line no-control-regex
|
|
13
|
+
const LEADING_ANSI_RE = /^(\x1b\[(?:\d+;)*\d*m)+/;
|
|
10
14
|
export class TimestampTransformer {
|
|
11
15
|
constructor() {
|
|
12
16
|
this.deviceHasTimestamps = false;
|
|
@@ -25,11 +29,30 @@ export class TimestampTransformer {
|
|
|
25
29
|
controller.enqueue(chunk);
|
|
26
30
|
return;
|
|
27
31
|
}
|
|
32
|
+
// Extract leading ANSI codes to preserve them across line splits
|
|
33
|
+
const ansiMatch = chunk.match(LEADING_ANSI_RE);
|
|
34
|
+
const leadingAnsi = ansiMatch ? ansiMatch[0] : "";
|
|
35
|
+
const contentWithoutAnsi = leadingAnsi
|
|
36
|
+
? chunk.slice(leadingAnsi.length)
|
|
37
|
+
: chunk;
|
|
28
38
|
const date = new Date();
|
|
29
39
|
const h = date.getHours().toString().padStart(2, "0");
|
|
30
40
|
const m = date.getMinutes().toString().padStart(2, "0");
|
|
31
41
|
const s = date.getSeconds().toString().padStart(2, "0");
|
|
32
|
-
|
|
42
|
+
const timestamp = `[${h}:${m}:${s}]`;
|
|
43
|
+
// For multi-line chunks, we need to preserve ANSI codes on each line
|
|
44
|
+
// Split on newlines, but keep the newline characters
|
|
45
|
+
const lines = contentWithoutAnsi.split(/(\r?\n)/);
|
|
46
|
+
let result = "";
|
|
47
|
+
for (const part of lines) {
|
|
48
|
+
if (part === "\n" || part === "\r\n") {
|
|
49
|
+
result += part;
|
|
50
|
+
}
|
|
51
|
+
else if (part !== "") {
|
|
52
|
+
result += leadingAnsi + timestamp + " " + part;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
controller.enqueue(result);
|
|
33
56
|
}
|
|
34
57
|
reset() {
|
|
35
58
|
this.deviceHasTimestamps = false;
|