@loglayer/transport-pretty-terminal 6.1.0 → 6.2.0
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.cjs +23 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +7 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,6 @@ import chalk$1 from "chalk";
|
|
|
4
4
|
import wrap from "wrap-ansi";
|
|
5
5
|
import truncate from "cli-truncate";
|
|
6
6
|
import keypress from "keypress";
|
|
7
|
-
|
|
8
7
|
//#region src/vendor/utils.js
|
|
9
8
|
/**
|
|
10
9
|
* Creates a string with the same length as `numSpaces` parameter
|
|
@@ -29,7 +28,6 @@ function isIsoStringDate(isoString) {
|
|
|
29
28
|
const testDate = new Date(isoString);
|
|
30
29
|
return !Number.isNaN(testDate.getTime());
|
|
31
30
|
}
|
|
32
|
-
|
|
33
31
|
//#endregion
|
|
34
32
|
//#region src/vendor/prettyjson.js
|
|
35
33
|
const conflictChars = /[^\w\s\n\r\v\t.,]/i;
|
|
@@ -196,7 +194,6 @@ function render(data, options, indentation) {
|
|
|
196
194
|
options = validateOptionsAndSetDefaults(options);
|
|
197
195
|
return renderToArray(data, options, indentation).join("\n");
|
|
198
196
|
}
|
|
199
|
-
|
|
200
197
|
//#endregion
|
|
201
198
|
//#region src/views/utils.ts
|
|
202
199
|
/**
|
|
@@ -244,7 +241,6 @@ function formatInlineData(data, config, maxDepth, maxLength, expanded = false) {
|
|
|
244
241
|
const result = pairs.join(" ");
|
|
245
242
|
return expanded ? result : truncate(result, maxLength);
|
|
246
243
|
}
|
|
247
|
-
|
|
248
244
|
//#endregion
|
|
249
245
|
//#region src/views/DetailView.ts
|
|
250
246
|
/**
|
|
@@ -361,7 +357,6 @@ var DetailView = class {
|
|
|
361
357
|
return Math.max(0, this.detailViewContent.length - availableHeight);
|
|
362
358
|
}
|
|
363
359
|
};
|
|
364
|
-
|
|
365
360
|
//#endregion
|
|
366
361
|
//#region src/views/SelectionView.ts
|
|
367
362
|
/**
|
|
@@ -415,7 +410,6 @@ var SelectionView = class {
|
|
|
415
410
|
}
|
|
416
411
|
}
|
|
417
412
|
};
|
|
418
|
-
|
|
419
413
|
//#endregion
|
|
420
414
|
//#region src/views/SimpleView.ts
|
|
421
415
|
/**
|
|
@@ -468,7 +462,6 @@ var SimpleView = class {
|
|
|
468
462
|
throw new Error("SimpleView.render() should not be called directly. Use renderLogLine() instead.");
|
|
469
463
|
}
|
|
470
464
|
};
|
|
471
|
-
|
|
472
465
|
//#endregion
|
|
473
466
|
//#region src/LogRenderer.ts
|
|
474
467
|
/**
|
|
@@ -654,7 +647,6 @@ var LogRenderer = class {
|
|
|
654
647
|
return this.viewMode;
|
|
655
648
|
}
|
|
656
649
|
};
|
|
657
|
-
|
|
658
650
|
//#endregion
|
|
659
651
|
//#region src/LogStorage.ts
|
|
660
652
|
/**
|
|
@@ -778,7 +770,6 @@ var LogStorage = class {
|
|
|
778
770
|
this.db.close();
|
|
779
771
|
}
|
|
780
772
|
};
|
|
781
|
-
|
|
782
773
|
//#endregion
|
|
783
774
|
//#region src/themes.ts
|
|
784
775
|
/**
|
|
@@ -1078,7 +1069,6 @@ const pastel = {
|
|
|
1078
1069
|
}
|
|
1079
1070
|
}
|
|
1080
1071
|
};
|
|
1081
|
-
|
|
1082
1072
|
//#endregion
|
|
1083
1073
|
//#region src/UIManager.ts
|
|
1084
1074
|
/**
|
|
@@ -1110,6 +1100,8 @@ const pastel = {
|
|
|
1110
1100
|
* Handles all keyboard input and view transitions.
|
|
1111
1101
|
*/
|
|
1112
1102
|
var UIManager = class {
|
|
1103
|
+
renderer;
|
|
1104
|
+
storage;
|
|
1113
1105
|
/** Whether the UI is in log selection mode */
|
|
1114
1106
|
isSelectionMode = false;
|
|
1115
1107
|
/** Whether the UI is showing detailed log view */
|
|
@@ -1208,7 +1200,8 @@ var UIManager = class {
|
|
|
1208
1200
|
}
|
|
1209
1201
|
const totalCount = this.filterText ? this.storage.getFilteredLogCount(this.filterText) : this.storage.getLogCount();
|
|
1210
1202
|
if (totalCount !== this.logs.length) {
|
|
1211
|
-
|
|
1203
|
+
const storedLogs = this.filterText ? this.storage.searchLogs(this.filterText) : this.storage.getAllLogs();
|
|
1204
|
+
this.logs = storedLogs;
|
|
1212
1205
|
const entry = this.logs[this.selectedIndex];
|
|
1213
1206
|
const prevEntry = this.selectedIndex > 0 ? this.logs[this.selectedIndex - 1] : null;
|
|
1214
1207
|
const nextEntry = this.selectedIndex < this.logs.length - 1 ? this.logs[this.selectedIndex + 1] : null;
|
|
@@ -1297,7 +1290,8 @@ var UIManager = class {
|
|
|
1297
1290
|
this.isSelectionMode = true;
|
|
1298
1291
|
this.filterText = "";
|
|
1299
1292
|
this.isPaused = true;
|
|
1300
|
-
|
|
1293
|
+
const storedLogs = this.storage.getAllLogs();
|
|
1294
|
+
this.logs = storedLogs;
|
|
1301
1295
|
this.selectedIndex = key.name === "up" ? Math.max(0, this.logs.length - 1) : Math.max(0, this.logs.length - 1);
|
|
1302
1296
|
this.renderer.renderSelectionView(this.logs, this.selectedIndex, this.filterText, this.selectionBuffer.length);
|
|
1303
1297
|
this.startSelectionViewPolling();
|
|
@@ -1487,7 +1481,6 @@ var UIManager = class {
|
|
|
1487
1481
|
}
|
|
1488
1482
|
}
|
|
1489
1483
|
};
|
|
1490
|
-
|
|
1491
1484
|
//#endregion
|
|
1492
1485
|
//#region src/PrettyTerminalTransport.ts
|
|
1493
1486
|
/**
|
|
@@ -1638,13 +1631,12 @@ var PrettyTerminalTransport = class PrettyTerminalTransport extends LoggerlessTr
|
|
|
1638
1631
|
return messages;
|
|
1639
1632
|
}
|
|
1640
1633
|
};
|
|
1641
|
-
|
|
1642
1634
|
//#endregion
|
|
1643
1635
|
//#region src/index.ts
|
|
1644
1636
|
function getPrettyTerminal(config) {
|
|
1645
1637
|
return PrettyTerminalTransport.getInstance(config);
|
|
1646
1638
|
}
|
|
1647
|
-
|
|
1648
1639
|
//#endregion
|
|
1649
1640
|
export { PrettyTerminalTransport, chalk, getPrettyTerminal, moonlight, nature, neon, pastel, sunlight };
|
|
1641
|
+
|
|
1650
1642
|
//# sourceMappingURL=index.mjs.map
|