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