nexrall-code 0.5.174 → 0.5.175
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 +12 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -157424,6 +157424,9 @@ function rowsOccupied(text, columns = process.stdout.columns || 80) {
|
|
|
157424
157424
|
function reserveBlockRows(previous, showing) {
|
|
157425
157425
|
return Math.max(0, previous, showing);
|
|
157426
157426
|
}
|
|
157427
|
+
function drainBlockRows(previous, printedRows) {
|
|
157428
|
+
return Math.max(0, previous - Math.max(0, printedRows));
|
|
157429
|
+
}
|
|
157427
157430
|
var LIVE_BLOCK_MAX_ROWS = 5;
|
|
157428
157431
|
function fillerRowCount(rowsAlreadyPrinted, footerTextValue = "", columns = process.stdout.columns ?? 80, rows = process.stdout.rows, reservedRows = 0, headroom = 2) {
|
|
157429
157432
|
if (!rows)
|
|
@@ -168736,6 +168739,7 @@ var App2 = ({ onReady }) => {
|
|
|
168736
168739
|
const menuDismissedRef = (0, import_react36.useRef)(null);
|
|
168737
168740
|
const menuReserveRef = (0, import_react36.useRef)(0);
|
|
168738
168741
|
const liveReserveRef = (0, import_react36.useRef)(0);
|
|
168742
|
+
const pendingPrintRowsRef = (0, import_react36.useRef)(0);
|
|
168739
168743
|
const searchReserveRef = (0, import_react36.useRef)(0);
|
|
168740
168744
|
const [, bumpMenu] = (0, import_react36.useState)(0);
|
|
168741
168745
|
const [, setPaintTick] = (0, import_react36.useState)(0);
|
|
@@ -168827,6 +168831,13 @@ var App2 = ({ onReady }) => {
|
|
|
168827
168831
|
if (opts?.isBanner)
|
|
168828
168832
|
bannerChunkRef.current = bufferRef.current.length;
|
|
168829
168833
|
bufferRef.current.append(text);
|
|
168834
|
+
if (!opts?.isBanner && !opts?.isFiller && !liveRef.current) {
|
|
168835
|
+
const rows = rowsOccupied(text, process.stdout.columns || 80);
|
|
168836
|
+
const pending = pendingPrintRowsRef.current;
|
|
168837
|
+
const paid = Math.min(pending, rows);
|
|
168838
|
+
pendingPrintRowsRef.current = pending - paid;
|
|
168839
|
+
liveReserveRef.current = drainBlockRows(liveReserveRef.current, rows - paid);
|
|
168840
|
+
}
|
|
168830
168841
|
setItems((prev) => {
|
|
168831
168842
|
return [...prev, { id: idCounter++, content: text, isBanner: opts?.isBanner, isFiller: opts?.isFiller }];
|
|
168832
168843
|
});
|
|
@@ -169533,6 +169544,7 @@ var App2 = ({ onReady }) => {
|
|
|
169533
169544
|
if (fullscreenRef.current)
|
|
169534
169545
|
return;
|
|
169535
169546
|
searchReserveRef.current = 0;
|
|
169547
|
+
pendingPrintRowsRef.current = Math.max(0, pendingRows);
|
|
169536
169548
|
setItems((prev) => {
|
|
169537
169549
|
const columns = process.stdout.columns || 80;
|
|
169538
169550
|
const withoutOldFiller = prev.filter((it) => !it.isFiller);
|