@orkestrel/console 0.0.10 → 0.0.11
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/src/core/index.cjs +5 -2
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +4 -1
- package/dist/src/core/index.d.ts +4 -1
- package/dist/src/core/index.js +5 -2
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.js.map +1 -1
- package/package.json +15 -10
|
@@ -1582,7 +1582,10 @@ export declare function renderBar(options: ProgressBarOptions): string;
|
|
|
1582
1582
|
* styled content stays aligned inside the frame. Pure: same {@link BoxOptions} → same string.
|
|
1583
1583
|
*
|
|
1584
1584
|
* @remarks
|
|
1585
|
-
* - **Lines.** `content` is split on `\n
|
|
1585
|
+
* - **Lines.** `content` is split on `\n` OR `\r\n`, so caller text written on Windows frames
|
|
1586
|
+
* exactly as the same text written on POSIX; a LONE `\r` is kept inside its line (it is a
|
|
1587
|
+
* cursor control — the animation frame prefix — not a line separator). Each line is padded
|
|
1588
|
+
* (left-aligned) to the inner
|
|
1586
1589
|
* width by {@link align} — measured on VISIBLE width, so a styled line never breaks the
|
|
1587
1590
|
* right edge. The inner width is the widest line's visible width (or `width − borders −
|
|
1588
1591
|
* 2·padding` when an explicit `width` is given and is wider), plus `padding` blank cells
|
package/dist/src/core/index.d.ts
CHANGED
|
@@ -1582,7 +1582,10 @@ export declare function renderBar(options: ProgressBarOptions): string;
|
|
|
1582
1582
|
* styled content stays aligned inside the frame. Pure: same {@link BoxOptions} → same string.
|
|
1583
1583
|
*
|
|
1584
1584
|
* @remarks
|
|
1585
|
-
* - **Lines.** `content` is split on `\n
|
|
1585
|
+
* - **Lines.** `content` is split on `\n` OR `\r\n`, so caller text written on Windows frames
|
|
1586
|
+
* exactly as the same text written on POSIX; a LONE `\r` is kept inside its line (it is a
|
|
1587
|
+
* cursor control — the animation frame prefix — not a line separator). Each line is padded
|
|
1588
|
+
* (left-aligned) to the inner
|
|
1586
1589
|
* width by {@link align} — measured on VISIBLE width, so a styled line never breaks the
|
|
1587
1590
|
* right edge. The inner width is the widest line's visible width (or `width − borders −
|
|
1588
1591
|
* 2·padding` when an explicit `width` is given and is wider), plus `padding` blank cells
|
package/dist/src/core/index.js
CHANGED
|
@@ -934,7 +934,10 @@ function renderSeparator(options) {
|
|
|
934
934
|
* styled content stays aligned inside the frame. Pure: same {@link BoxOptions} → same string.
|
|
935
935
|
*
|
|
936
936
|
* @remarks
|
|
937
|
-
* - **Lines.** `content` is split on `\n
|
|
937
|
+
* - **Lines.** `content` is split on `\n` OR `\r\n`, so caller text written on Windows frames
|
|
938
|
+
* exactly as the same text written on POSIX; a LONE `\r` is kept inside its line (it is a
|
|
939
|
+
* cursor control — the animation frame prefix — not a line separator). Each line is padded
|
|
940
|
+
* (left-aligned) to the inner
|
|
938
941
|
* width by {@link align} — measured on VISIBLE width, so a styled line never breaks the
|
|
939
942
|
* right edge. The inner width is the widest line's visible width (or `width − borders −
|
|
940
943
|
* 2·padding` when an explicit `width` is given and is wider), plus `padding` blank cells
|
|
@@ -954,7 +957,7 @@ function renderBox(options) {
|
|
|
954
957
|
const chars = BORDER_CHARS[options.border ?? "single"];
|
|
955
958
|
const padding = Math.max(0, Math.trunc(options.padding ?? 1));
|
|
956
959
|
const styler = options.styler;
|
|
957
|
-
const lines = options.content.split(
|
|
960
|
+
const lines = options.content.split(/\r\n|\n/);
|
|
958
961
|
const titleRoom = options.title === void 0 ? 0 : width(options.title) + 2 + 1 - padding * 2;
|
|
959
962
|
const budget = options.width === void 0 ? 0 : options.width - 2 - padding * 2;
|
|
960
963
|
const inner = lines.reduce((max, line) => Math.max(max, width(line)), Math.max(0, titleRoom, budget));
|