@oh-my-pi/pi-tui 4.6.0 → 4.8.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/package.json
CHANGED
|
@@ -136,10 +136,8 @@ export class Markdown implements Component {
|
|
|
136
136
|
if (bgFn) {
|
|
137
137
|
contentLines.push(applyBackgroundToLine(lineWithMargins, width, bgFn));
|
|
138
138
|
} else {
|
|
139
|
-
// No background -
|
|
140
|
-
|
|
141
|
-
const paddingNeeded = Math.max(0, width - visibleLen);
|
|
142
|
-
contentLines.push(lineWithMargins + " ".repeat(paddingNeeded));
|
|
139
|
+
// No background - don't pad (avoids trailing spaces when copying)
|
|
140
|
+
contentLines.push(lineWithMargins);
|
|
143
141
|
}
|
|
144
142
|
}
|
|
145
143
|
|
package/src/components/text.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Component } from "../tui";
|
|
2
|
-
import { applyBackgroundToLine,
|
|
2
|
+
import { applyBackgroundToLine, wrapTextWithAnsi } from "../utils";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Text component - displays multi-line text with word wrapping
|
|
@@ -83,10 +83,8 @@ export class Text implements Component {
|
|
|
83
83
|
if (this.customBgFn) {
|
|
84
84
|
contentLines.push(applyBackgroundToLine(lineWithMargins, width, this.customBgFn));
|
|
85
85
|
} else {
|
|
86
|
-
// No background -
|
|
87
|
-
|
|
88
|
-
const paddingNeeded = Math.max(0, width - visibleLen);
|
|
89
|
-
contentLines.push(lineWithMargins + " ".repeat(paddingNeeded));
|
|
86
|
+
// No background - don't pad (avoids trailing spaces when copying)
|
|
87
|
+
contentLines.push(lineWithMargins);
|
|
90
88
|
}
|
|
91
89
|
}
|
|
92
90
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Component } from "../tui";
|
|
2
|
-
import { truncateToWidth
|
|
2
|
+
import { truncateToWidth } from "../utils";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Text component that truncates to fit viewport width
|
|
@@ -48,12 +48,8 @@ export class TruncatedText implements Component {
|
|
|
48
48
|
const rightPadding = " ".repeat(this.paddingX);
|
|
49
49
|
const lineWithPadding = leftPadding + displayText + rightPadding;
|
|
50
50
|
|
|
51
|
-
//
|
|
52
|
-
|
|
53
|
-
const paddingNeeded = Math.max(0, width - lineVisibleWidth);
|
|
54
|
-
const finalLine = lineWithPadding + " ".repeat(paddingNeeded);
|
|
55
|
-
|
|
56
|
-
result.push(finalLine);
|
|
51
|
+
// Don't pad to full width - avoids trailing spaces when copying
|
|
52
|
+
result.push(lineWithPadding);
|
|
57
53
|
|
|
58
54
|
// Add vertical padding below
|
|
59
55
|
for (let i = 0; i < this.paddingY; i++) {
|