@absolutejs/absolute 0.19.0-beta.679 → 0.19.0-beta.680
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/cli/index.js +24 -3
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -2577,6 +2577,13 @@ var padLine = (value, width) => {
|
|
|
2577
2577
|
}
|
|
2578
2578
|
return `${value}${" ".repeat(width - plainLength)}`;
|
|
2579
2579
|
};
|
|
2580
|
+
var replaceRightEdge = (value, width, marker) => {
|
|
2581
|
+
if (width <= 0) {
|
|
2582
|
+
return "";
|
|
2583
|
+
}
|
|
2584
|
+
const padded = padLine(truncateText(value, width), width);
|
|
2585
|
+
return `${padded.slice(0, Math.max(0, width - 1))}${marker}`;
|
|
2586
|
+
};
|
|
2580
2587
|
var wrapText = (value, width) => {
|
|
2581
2588
|
if (width <= 0) {
|
|
2582
2589
|
return [""];
|
|
@@ -2807,11 +2814,25 @@ var createWorkspaceTui = ({
|
|
|
2807
2814
|
const start3 = Math.max(0, end - logHeight);
|
|
2808
2815
|
return contentLines.slice(start3, end);
|
|
2809
2816
|
})();
|
|
2810
|
-
|
|
2811
|
-
|
|
2817
|
+
const maxLogScrollOffset = !helpVisible ? Math.max(0, contentLines.length - logHeight) : 0;
|
|
2818
|
+
const shouldShowScrollbar = !helpVisible && maxLogScrollOffset > 0;
|
|
2819
|
+
const scrollbarThumbHeight = shouldShowScrollbar ? Math.max(1, Math.min(logHeight, Math.round(logHeight / contentLines.length * logHeight))) : 0;
|
|
2820
|
+
const scrollbarMaxTop = Math.max(0, logHeight - scrollbarThumbHeight);
|
|
2821
|
+
const scrollbarTop = shouldShowScrollbar && maxLogScrollOffset > 0 ? Math.round((maxLogScrollOffset - logScrollOffset) / maxLogScrollOffset * scrollbarMaxTop) : 0;
|
|
2822
|
+
const getScrollbarMarker = (index) => {
|
|
2823
|
+
if (!shouldShowScrollbar) {
|
|
2824
|
+
return null;
|
|
2825
|
+
}
|
|
2826
|
+
const inThumb = index >= scrollbarTop && index < scrollbarTop + scrollbarThumbHeight;
|
|
2827
|
+
return inThumb ? `${colors.cyan}\u2588${colors.reset}` : `${colors.dim}\u2502${colors.reset}`;
|
|
2828
|
+
};
|
|
2829
|
+
for (let index = 0;index < visibleContent.length; index++) {
|
|
2830
|
+
const marker = getScrollbarMarker(index);
|
|
2831
|
+
rows.push(marker ? replaceRightEdge(visibleContent[index] ?? "", width, marker) : padLine(visibleContent[index] ?? "", width));
|
|
2812
2832
|
}
|
|
2813
2833
|
for (let index = visibleContent.length;index < logHeight; index++) {
|
|
2814
|
-
|
|
2834
|
+
const marker = getScrollbarMarker(index);
|
|
2835
|
+
rows.push(marker ? replaceRightEdge("", width, marker) : " ".repeat(width));
|
|
2815
2836
|
}
|
|
2816
2837
|
rows.push(divider);
|
|
2817
2838
|
const logState = !helpVisible && logScrollOffset > 0 ? `logs scrolled back ${logScrollOffset} line${logScrollOffset === 1 ? "" : "s"} \xB7 End for latest` : "live logs";
|
package/package.json
CHANGED