@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.
@@ -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`; each line is padded (left-aligned) to the inner
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("\n");
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));