@promptctl/rich-js 0.7.0 → 0.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.
Files changed (137) hide show
  1. package/README.md +31 -30
  2. package/dist/core/box.d.ts +3 -3
  3. package/dist/core/box.d.ts.map +1 -1
  4. package/dist/core/box.js.map +1 -1
  5. package/dist/core/cells.d.ts +46 -1
  6. package/dist/core/cells.d.ts.map +1 -1
  7. package/dist/core/cells.js +55 -14
  8. package/dist/core/cells.js.map +1 -1
  9. package/dist/core/console.d.ts +28 -10
  10. package/dist/core/console.d.ts.map +1 -1
  11. package/dist/core/console.js +141 -80
  12. package/dist/core/console.js.map +1 -1
  13. package/dist/core/markup.d.ts +0 -2
  14. package/dist/core/markup.d.ts.map +1 -1
  15. package/dist/core/markup.js +31 -17
  16. package/dist/core/markup.js.map +1 -1
  17. package/dist/core/measure.d.ts +11 -0
  18. package/dist/core/measure.d.ts.map +1 -1
  19. package/dist/core/measure.js +15 -3
  20. package/dist/core/measure.js.map +1 -1
  21. package/dist/core/oklch.d.ts +22 -0
  22. package/dist/core/oklch.d.ts.map +1 -1
  23. package/dist/core/oklch.js +62 -18
  24. package/dist/core/oklch.js.map +1 -1
  25. package/dist/core/pretty.d.ts +87 -0
  26. package/dist/core/pretty.d.ts.map +1 -0
  27. package/dist/core/pretty.js +304 -0
  28. package/dist/core/pretty.js.map +1 -0
  29. package/dist/core/protocol.d.ts +64 -0
  30. package/dist/core/protocol.d.ts.map +1 -1
  31. package/dist/core/protocol.js +72 -0
  32. package/dist/core/protocol.js.map +1 -1
  33. package/dist/core/segment.d.ts +21 -0
  34. package/dist/core/segment.d.ts.map +1 -1
  35. package/dist/core/segment.js +40 -1
  36. package/dist/core/segment.js.map +1 -1
  37. package/dist/core/subscription.d.ts +13 -0
  38. package/dist/core/subscription.d.ts.map +1 -0
  39. package/dist/core/subscription.js +13 -0
  40. package/dist/core/subscription.js.map +1 -0
  41. package/dist/core/text.d.ts.map +1 -1
  42. package/dist/core/text.js +45 -13
  43. package/dist/core/text.js.map +1 -1
  44. package/dist/host/host-stream.d.ts +31 -0
  45. package/dist/host/host-stream.d.ts.map +1 -0
  46. package/dist/host/host-stream.js +36 -0
  47. package/dist/host/host-stream.js.map +1 -0
  48. package/dist/host/index.d.ts +4 -0
  49. package/dist/host/index.d.ts.map +1 -0
  50. package/dist/host/index.js +3 -0
  51. package/dist/host/index.js.map +1 -0
  52. package/dist/host/terminal-host.d.ts +144 -0
  53. package/dist/host/terminal-host.d.ts.map +1 -0
  54. package/dist/host/terminal-host.js +133 -0
  55. package/dist/host/terminal-host.js.map +1 -0
  56. package/dist/index.d.ts +10 -33
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +33 -21
  59. package/dist/index.js.map +1 -1
  60. package/dist/node/terminal-host.d.ts +85 -0
  61. package/dist/node/terminal-host.d.ts.map +1 -0
  62. package/dist/node/terminal-host.js +161 -0
  63. package/dist/node/terminal-host.js.map +1 -0
  64. package/dist/node/traceback.d.ts +28 -0
  65. package/dist/node/traceback.d.ts.map +1 -0
  66. package/dist/node/traceback.js +113 -0
  67. package/dist/node/traceback.js.map +1 -0
  68. package/dist/renderables/columns.d.ts +24 -2
  69. package/dist/renderables/columns.d.ts.map +1 -1
  70. package/dist/renderables/columns.js +91 -32
  71. package/dist/renderables/columns.js.map +1 -1
  72. package/dist/renderables/layout.d.ts +61 -5
  73. package/dist/renderables/layout.d.ts.map +1 -1
  74. package/dist/renderables/layout.js +191 -19
  75. package/dist/renderables/layout.js.map +1 -1
  76. package/dist/renderables/padding.d.ts +15 -2
  77. package/dist/renderables/padding.d.ts.map +1 -1
  78. package/dist/renderables/padding.js +92 -37
  79. package/dist/renderables/padding.js.map +1 -1
  80. package/dist/renderables/panel.d.ts +44 -3
  81. package/dist/renderables/panel.d.ts.map +1 -1
  82. package/dist/renderables/panel.js +149 -80
  83. package/dist/renderables/panel.js.map +1 -1
  84. package/dist/renderables/table.d.ts +40 -4
  85. package/dist/renderables/table.d.ts.map +1 -1
  86. package/dist/renderables/table.js +276 -158
  87. package/dist/renderables/table.js.map +1 -1
  88. package/dist/renderables/traceback.d.ts +6 -2
  89. package/dist/renderables/traceback.d.ts.map +1 -1
  90. package/dist/renderables/traceback.js +6 -10
  91. package/dist/renderables/traceback.js.map +1 -1
  92. package/dist/renderables/tree.d.ts +27 -2
  93. package/dist/renderables/tree.d.ts.map +1 -1
  94. package/dist/renderables/tree.js +82 -23
  95. package/dist/renderables/tree.js.map +1 -1
  96. package/dist/template-bindings/color-funcs.d.ts +3 -3
  97. package/dist/template-bindings/color-funcs.js +3 -3
  98. package/dist/template-bindings/index.d.ts +6 -7
  99. package/dist/template-bindings/index.d.ts.map +1 -1
  100. package/dist/template-bindings/index.js +6 -7
  101. package/dist/template-bindings/index.js.map +1 -1
  102. package/dist/template-bindings/palette-funcs.d.ts +17 -5
  103. package/dist/template-bindings/palette-funcs.d.ts.map +1 -1
  104. package/dist/template-bindings/palette-funcs.js +69 -6
  105. package/dist/template-bindings/palette-funcs.js.map +1 -1
  106. package/dist/template-bindings/style-funcs.d.ts +1 -1
  107. package/dist/template-bindings/style-funcs.js +1 -1
  108. package/dist/themes/ramp.d.ts +84 -0
  109. package/dist/themes/ramp.d.ts.map +1 -0
  110. package/dist/themes/ramp.js +123 -0
  111. package/dist/themes/ramp.js.map +1 -0
  112. package/dist/widgets/dropdown.d.ts +1 -1
  113. package/dist/widgets/dropdown.js +1 -1
  114. package/dist/widgets/event-router.d.ts +3 -2
  115. package/dist/widgets/event-router.d.ts.map +1 -1
  116. package/dist/widgets/focus-manager.d.ts +2 -1
  117. package/dist/widgets/focus-manager.d.ts.map +1 -1
  118. package/dist/widgets/index.d.ts +3 -6
  119. package/dist/widgets/index.d.ts.map +1 -1
  120. package/dist/widgets/index.js +4 -3
  121. package/dist/widgets/index.js.map +1 -1
  122. package/dist/widgets/screen.d.ts +1 -1
  123. package/dist/widgets/screen.d.ts.map +1 -1
  124. package/dist/widgets/terminal-host.d.ts +13 -63
  125. package/dist/widgets/terminal-host.d.ts.map +1 -1
  126. package/dist/widgets/terminal-host.js +11 -142
  127. package/dist/widgets/terminal-host.js.map +1 -1
  128. package/dist/widgets/text-input.d.ts +2 -3
  129. package/dist/widgets/text-input.d.ts.map +1 -1
  130. package/dist/widgets/text-input.js +4 -12
  131. package/dist/widgets/text-input.js.map +1 -1
  132. package/dist/widgets/types.d.ts +1 -1
  133. package/dist/widgets/types.d.ts.map +1 -1
  134. package/dist/widgets/types.js.map +1 -1
  135. package/dist/widgets/widget-base.d.ts +2 -1
  136. package/dist/widgets/widget-base.d.ts.map +1 -1
  137. package/package.json +20 -4
@@ -2,17 +2,70 @@
2
2
  * Padding — wraps a renderable with whitespace padding on all four sides.
3
3
  */
4
4
  import { Segment } from "../core/segment.js";
5
+ import { cellCount } from "../core/cells.js";
5
6
  import { Style, NULL_STYLE } from "../core/style.js";
6
7
  import { Measurement } from "../core/measure.js";
7
- import { isMeasurable } from "../core/protocol.js";
8
- function normalizePadding(padding) {
9
- if (typeof padding === "number") {
10
- return [padding, padding, padding, padding];
11
- }
12
- if (padding.length === 2) {
13
- return [padding[0], padding[1], padding[0], padding[1]];
14
- }
15
- return padding;
8
+ import { isMeasurable, withBoundedWidth, withCellWidth } from "../core/protocol.js";
9
+ /**
10
+ * Parses the shapes a caller may write padding in — one number, a vertical/
11
+ * horizontal pair, or all four sides — into the four-sided form every
12
+ * renderable indexes by, flooring each side at zero.
13
+ *
14
+ * [LAW:parse-dont-validate] This is the one crossing between the public
15
+ * padding vocabulary and the internal tuple, which is why the floor lives
16
+ * here and nowhere downstream: past this point `" ".repeat(left)` is safe in
17
+ * any renderable without asking what the caller passed. A negative side used
18
+ * to reach the renderers, where `Panel` drew content rows wider than its own
19
+ * border and `Table` threw outright.
20
+ */
21
+ export function normalizePadding(padding) {
22
+ // A padding side is a count of cells like any other, so it is parsed by the
23
+ // same rule rather than by a second copy of it: a fractional side reaches
24
+ // `" ".repeat`, which truncates, while the rows around it are measured
25
+ // arithmetically — so the padding and the border disagree and the frame
26
+ // breaks. `cellCount`'s header carries why the comparison, not `Math.max`.
27
+ //
28
+ // `Infinity` is where a side stops being an offer and the rule needs the one
29
+ // addition. An unbounded *offer* is a question a renderable can answer, so
30
+ // `cellCount` passes it through; an unbounded *side* is a quantity and there
31
+ // is nothing to draw. Unparsed it reached `budget -= got` as
32
+ // `Infinity - Infinity`, and `new Padding(text, Infinity).measure(...)`
33
+ // handed back `{NaN, NaN}` from a public API.
34
+ const side = (n) => (Number.isFinite(n) ? cellCount(n) : 0);
35
+ const sides = typeof padding === "number"
36
+ ? [padding, padding, padding, padding]
37
+ : padding.length === 2
38
+ ? [padding[0], padding[1], padding[0], padding[1]]
39
+ : padding;
40
+ return [side(sides[0]), side(sides[1]), side(sides[2]), side(sides[3])];
41
+ }
42
+ /**
43
+ * Divides the requested width once into the three spans a padded row is made
44
+ * of, in the order they are worth spending cells on.
45
+ *
46
+ * The three used to be derived separately and disagree where it matters:
47
+ * `render` took the canvas as `Math.max(1, maxWidth - left - right)`, which
48
+ * clamps *up*, so a padding of 1 inside a 2-cell request drew 3-cell content
49
+ * rows beside 2-cell blank rows — an open frame the terminal then soft-wraps.
50
+ * Content takes its first cell before padding takes any, for the reason
51
+ * `layoutPanel` gives: a squeeze should cost you the decoration, not the thing
52
+ * being decorated.
53
+ */
54
+ function layoutPadding(outerWidth, leftWanted, rightWanted) {
55
+ let budget = cellCount(outerWidth);
56
+ const take = (want) => {
57
+ const got = Math.min(want, budget);
58
+ budget -= got;
59
+ return got;
60
+ };
61
+ const firstContentCell = take(1);
62
+ const left = take(leftWanted);
63
+ const right = take(rightWanted);
64
+ return { left, contentWidth: firstContentCell + budget, right };
65
+ }
66
+ /** The full width of a padded row — the division, added back up. */
67
+ function rowWidth(geometry) {
68
+ return geometry.left + geometry.contentWidth + geometry.right;
16
69
  }
17
70
  export class Padding {
18
71
  renderable;
@@ -32,54 +85,56 @@ export class Padding {
32
85
  this.style = resolveStyle(options?.style);
33
86
  this.expand = options?.expand !== false;
34
87
  }
35
- *render(options) {
36
- const maxWidth = options.maxWidth;
37
- const horizontalPad = this.left + this.right;
38
- const innerWidth = Math.max(1, maxWidth - horizontalPad);
88
+ *render(rawOptions) {
89
+ const options = withBoundedWidth(rawOptions, this);
90
+ const geometry = layoutPadding(options.maxWidth, this.left, this.right);
39
91
  const innerOptions = {
40
92
  ...options,
41
- maxWidth: innerWidth,
93
+ maxWidth: geometry.contentWidth,
42
94
  };
43
95
  const segments = [...this.renderable.render(innerOptions)];
44
96
  const lines = Segment.splitLines(segments);
45
97
  const style = this.style.isNull ? undefined : this.style;
46
- const leftPadStr = " ".repeat(this.left);
47
- const blankLine = " ".repeat(maxWidth);
48
- // Top padding
98
+ // Zero-length spans need no branch to suppress: the wire boundary drops
99
+ // empty segments, so a padding the width could not afford emits nothing.
100
+ const leftPad = new Segment(" ".repeat(geometry.left), style);
101
+ const rightPad = new Segment(" ".repeat(geometry.right), style);
102
+ const blankLine = new Segment(" ".repeat(rowWidth(geometry)), style);
49
103
  for (let i = 0; i < this.top; i++) {
50
- yield new Segment(blankLine, style);
104
+ yield blankLine;
51
105
  yield Segment.line();
52
106
  }
53
- // Content lines with left/right padding
54
107
  for (const line of lines) {
55
- if (this.left > 0)
56
- yield new Segment(leftPadStr, style);
57
- yield* line;
58
- // Pad to fill remaining width
59
- const lineWidth = Segment.getLineLength(line);
60
- const remaining = this.expand
61
- ? innerWidth - lineWidth + this.right
62
- : this.right;
63
- if (remaining > 0)
64
- yield new Segment(" ".repeat(remaining), style);
108
+ yield leftPad;
109
+ // `expand` is the pad half of this call; the crop half is unconditional,
110
+ // because a child that ignored the canvas it was handed (a Table at its
111
+ // natural width) would otherwise burst the padding around it.
112
+ yield* Segment.adjustLineLength(line, geometry.contentWidth, style, this.expand);
113
+ yield rightPad;
65
114
  yield Segment.line();
66
115
  }
67
- // Bottom padding
68
116
  for (let i = 0; i < this.bottom; i++) {
69
- yield new Segment(blankLine, style);
117
+ yield blankLine;
70
118
  yield Segment.line();
71
119
  }
72
120
  }
73
- measure(options) {
74
- const horizontalPad = this.left + this.right;
121
+ measure(rawOptions) {
122
+ const options = withCellWidth(rawOptions);
123
+ const geometry = layoutPadding(options.maxWidth, this.left, this.right);
124
+ const overhead = geometry.left + geometry.right;
75
125
  if (isMeasurable(this.renderable)) {
76
- const measurement = Measurement.get(options, this.renderable);
126
+ const measurement = Measurement.get({ ...options, maxWidth: geometry.contentWidth }, this.renderable);
127
+ // The ceiling is what was offered, and it wins over what the child asks
128
+ // for: a range whose floor sits above its own ceiling — this returned
129
+ // {8, 8} for three cells of padding inside a two-cell offer — is one no
130
+ // parent layout can divide.
131
+ const maximum = Math.min(options.maxWidth, measurement.maximum + overhead);
77
132
  return {
78
- minimum: measurement.minimum + horizontalPad,
79
- maximum: measurement.maximum + horizontalPad,
133
+ minimum: Math.min(measurement.minimum + overhead, maximum),
134
+ maximum,
80
135
  };
81
136
  }
82
- return { minimum: horizontalPad, maximum: options.maxWidth };
137
+ return { minimum: overhead, maximum: options.maxWidth };
83
138
  }
84
139
  }
85
140
  function resolveStyle(style) {
@@ -1 +1 @@
1
- {"version":3,"file":"padding.js","sourceRoot":"","sources":["../../src/renderables/padding.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAOnD,SAAS,gBAAgB,CACvB,OAA0B;IAE1B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC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1D,OAAO;aACR,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;IAC1D,CAAC;CACF;AAED,SAAS,YAAY,CAAC,KAAiC;IACrD,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,UAAU,CAAC;IAC3C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACzD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -61,16 +61,57 @@ export declare class Panel implements Renderable, Measurable {
61
61
  readonly width: number | undefined;
62
62
  readonly padding: [number, number, number, number];
63
63
  constructor(content: string | RichText | Renderable, options?: PanelOptions);
64
- render(options: RenderOptions): Iterable<Segment>;
65
- measure(options: RenderOptions): {
64
+ render(rawOptions: RenderOptions): Iterable<Segment>;
65
+ /**
66
+ * The wrapped renderable's lines, laid out on a canvas `contentWidth` cells
67
+ * wide. Below width 3 a panel is all frame and the canvas holds no lines —
68
+ * but the render still happens, because a `bottomRightAccessory` thunk
69
+ * fires at every width and reads state this render populates.
70
+ */
71
+ private _renderContent;
72
+ /**
73
+ * One row of the panel body: frame column, span, frame column.
74
+ *
75
+ * [LAW:single-enforcer] `adjustLineLength` is the one place a width is
76
+ * decided here, and it runs twice against two different widths. The first
77
+ * pass crops content that rendered wider than the canvas it was handed (a
78
+ * `Table` at its natural width, say) back to the canvas, so an oversized
79
+ * child is trimmed rather than allowed to eat the right-hand padding. The
80
+ * second fills the rest of the span, which is the trailing padding and any
81
+ * shortfall in one stroke.
82
+ */
83
+ private _renderRow;
84
+ measure(rawOptions: RenderOptions): {
66
85
  minimum: number;
67
86
  maximum: number;
68
87
  };
88
+ /**
89
+ * The width this panel wants when nothing declared one for it: its content
90
+ * plus its own frame, both read off the division it will render against.
91
+ *
92
+ * [LAW:one-source-of-truth] `measure` and `_getPanelWidth` ask this same
93
+ * question, and each used to work it out itself — the same `layoutPanel`, the
94
+ * same `frameOverhead`, the same `Math.min(maxWidth, maximum + overhead)`,
95
+ * written twice. That is the pattern `_declaredWidth` below was extracted to
96
+ * stop, left standing for the fit case; changing how overhead is derived in
97
+ * one copy is all it would take to put `measure` and `render` back into the
98
+ * disagreement this epic spent itself closing.
99
+ */
100
+ private _fitRange;
101
+ /**
102
+ * The width this panel was told to be, as a count of cells.
103
+ *
104
+ * [LAW:one-source-of-truth] `measure` and `_getPanelWidth` answer the same
105
+ * question about the same field, so they read it from here. Answered
106
+ * separately, `measure` reported nine cells of content while `render` drew the
107
+ * declared twelve, and the parent that divided space from the range got a
108
+ * panel three cells wider than the share it granted.
109
+ */
110
+ private get _declaredWidth();
69
111
  private _getPanelWidth;
70
112
  private _renderTopBorder;
71
113
  private _renderBottomBorder;
72
114
  private _resolveAccessory;
73
- private _renderBlankLine;
74
115
  static fit(content: string | RichText | Renderable, options?: Omit<PanelOptions, "expand">): Panel;
75
116
  }
76
117
  //# sourceMappingURL=panel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../src/renderables/panel.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAc,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,GAAG,EAAW,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,aAAa,EACd,MAAM,qBAAqB,CAAC;AAG7B;;;;;;;;;GASG;AACH,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,QAAQ,GACR,CAAC,MAAM,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC,CAAC;AAE1C,MAAM,WAAW,YAAY;IAC3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ACvC,OAAO,CAAC,EAAE,YAAY;IAgBvB,MAAM,CAAC,UAAU,EAAE,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC;IA+BrD;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAYtB;;;;;;;;;;OAUG;IACH,OAAO,CAAE,UAAU;IAenB,OAAO,CAAC,UAAU,EAAE,aAAa,GAAG;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;IAkBxE;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,SAAS;IAuBjB;;;;;;;;OAQG;IACH,OAAO,KAAK,cAAc,GAEzB;IAED,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAE,gBAAgB;IA2CzB,OAAO,CAAE,mBAAmB;IA8D5B,OAAO,CAAC,iBAAiB;IAUzB,MAAM,CAAC,GAAG,CACR,OAAO,EAAE,MAAM,GAAG,QAAQ,GAAG,UAAU,EACvC,OAAO,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,GACrC,KAAK;CAGT"}
@@ -1,21 +1,51 @@
1
1
  /**
2
2
  * Panel — a bordered box that wraps content, with optional title and subtitle.
3
3
  */
4
- import { cellLen, setCellSize, asCellCol } from "../core/cells.js";
4
+ import { cellLen, setCellSize, asCellCol, cellCount } from "../core/cells.js";
5
5
  import { Segment } from "../core/segment.js";
6
6
  import { Style, NULL_STYLE } from "../core/style.js";
7
7
  import { ROUNDED } from "../core/box.js";
8
8
  import { Measurement } from "../core/measure.js";
9
9
  import { RichText } from "../core/text.js";
10
- import { isMeasurable } from "../core/protocol.js";
11
- function normalizePadding(padding) {
12
- if (padding === undefined)
13
- return [0, 1, 0, 1];
14
- if (typeof padding === "number")
15
- return [padding, padding, padding, padding];
16
- if (padding.length === 2)
17
- return [padding[0], padding[1], padding[0], padding[1]];
18
- return padding;
10
+ import { normalizePadding } from "./padding.js";
11
+ import { isMeasurable, withBoundedWidth, withCellWidth } from "../core/protocol.js";
12
+ function layoutPanel(outerWidth, padding) {
13
+ const [, padRightWanted, , padLeftWanted] = padding;
14
+ // Panel's one division point, and the width reaching it is not always one
15
+ // this file produced: `_getPanelWidth` derives the fit-mode width from
16
+ // `Measurement.get` on an arbitrary `Measurable`, so a renderable reporting a
17
+ // negative maximum arrives here unparsed and reaches `repeat` as a negative
18
+ // count.
19
+ let budget = cellCount(outerWidth);
20
+ const take = (want) => {
21
+ const got = Math.min(want, budget);
22
+ budget -= got;
23
+ return got;
24
+ };
25
+ const left = take(1);
26
+ const right = take(1);
27
+ const firstContentCell = take(1);
28
+ const padLeft = take(padLeftWanted);
29
+ const padRight = take(padRightWanted);
30
+ const contentWidth = firstContentCell + budget;
31
+ return {
32
+ left,
33
+ right,
34
+ padLeft,
35
+ contentWidth,
36
+ padRight,
37
+ spanWidth: padLeft + contentWidth + padRight,
38
+ };
39
+ }
40
+ /**
41
+ * Every cell of a panel that is not content canvas. Read off the geometry
42
+ * rather than recomputed as `2 + padLeft + padRight`, because the two differ
43
+ * exactly where this panel is squeezed: a width that cannot afford its right
44
+ * frame column or its padding does not spend cells on them, and a measurement
45
+ * that assumed it did would report a minimum larger than its own maximum.
46
+ */
47
+ function frameOverhead(geometry) {
48
+ return geometry.left + geometry.right + geometry.padLeft + geometry.padRight;
19
49
  }
20
50
  function resolveStyle(style) {
21
51
  if (style === undefined)
@@ -56,92 +86,137 @@ export class Panel {
56
86
  this.titleStyle = options?.titleStyle === undefined ? undefined : resolveStyle(options.titleStyle);
57
87
  this.subtitleStyle = options?.subtitleStyle === undefined ? undefined : resolveStyle(options.subtitleStyle);
58
88
  this.width = options?.width;
59
- this.padding = normalizePadding(options?.padding);
89
+ this.padding = normalizePadding(options?.padding ?? [0, 1, 0, 1]);
60
90
  }
61
- *render(options) {
91
+ *render(rawOptions) {
92
+ const options = withBoundedWidth(rawOptions, this);
62
93
  const box = options.asciiOnly ? this.box.substitute({ asciiOnly: true }) : this.box;
63
94
  const border = this.borderStyle.isNull ? undefined : this.borderStyle;
64
95
  const contentStyle = this.style.isNull ? undefined : this.style;
65
- // Determine panel width
66
- const panelWidth = this._getPanelWidth(options);
67
- const [padTop, padRight, padBottom, padLeft] = this.padding;
68
- const innerWidth = Math.max(1, panelWidth - 2 - padLeft - padRight); // 2 for border chars
69
- // Render content
70
- const innerOptions = {
71
- ...options,
72
- maxWidth: innerWidth,
73
- };
74
- const contentSegments = [...this.renderable.render(innerOptions)];
75
- const contentLines = Segment.splitLines(contentSegments);
96
+ const geometry = layoutPanel(this._getPanelWidth(options), this.padding);
97
+ const [padTop, , padBottom] = this.padding;
98
+ const contentLines = this._renderContent(options, geometry.contentWidth);
76
99
  // Top border (with optional title)
77
- yield* this._renderTopBorder(box, panelWidth, border);
78
- // Top padding
100
+ yield* this._renderTopBorder(box, geometry, border);
101
+ // Top padding — a padding row is a content row whose content is nothing.
79
102
  for (let i = 0; i < padTop; i++) {
80
- yield* this._renderBlankLine(box, panelWidth, padLeft, padRight, innerWidth, border, contentStyle);
103
+ yield* this._renderRow(box, geometry, [], border, contentStyle);
81
104
  }
82
- // Content lines
83
105
  for (const line of contentLines) {
84
- yield new Segment(box.left, border);
85
- if (padLeft > 0)
86
- yield new Segment(" ".repeat(padLeft), contentStyle);
87
- yield* line;
88
- // Pad to fill inner width
89
- const lineWidth = Segment.getLineLength(line);
90
- const rightPad = innerWidth - lineWidth + padRight;
91
- if (rightPad > 0)
92
- yield new Segment(" ".repeat(rightPad), contentStyle);
93
- yield new Segment(box.right, border);
94
- yield Segment.line();
106
+ yield* this._renderRow(box, geometry, line, border, contentStyle);
95
107
  }
96
- // Bottom padding
97
108
  for (let i = 0; i < padBottom; i++) {
98
- yield* this._renderBlankLine(box, panelWidth, padLeft, padRight, innerWidth, border, contentStyle);
109
+ yield* this._renderRow(box, geometry, [], border, contentStyle);
99
110
  }
100
111
  // Bottom border (with optional subtitle)
101
- yield* this._renderBottomBorder(box, panelWidth, border);
112
+ yield* this._renderBottomBorder(box, geometry, border);
113
+ }
114
+ /**
115
+ * The wrapped renderable's lines, laid out on a canvas `contentWidth` cells
116
+ * wide. Below width 3 a panel is all frame and the canvas holds no lines —
117
+ * but the render still happens, because a `bottomRightAccessory` thunk
118
+ * fires at every width and reads state this render populates.
119
+ */
120
+ _renderContent(options, contentWidth) {
121
+ const innerOptions = {
122
+ ...options,
123
+ maxWidth: contentWidth,
124
+ };
125
+ const lines = Segment.splitLines([...this.renderable.render(innerOptions)]);
126
+ return contentWidth === 0 ? [] : lines;
127
+ }
128
+ /**
129
+ * One row of the panel body: frame column, span, frame column.
130
+ *
131
+ * [LAW:single-enforcer] `adjustLineLength` is the one place a width is
132
+ * decided here, and it runs twice against two different widths. The first
133
+ * pass crops content that rendered wider than the canvas it was handed (a
134
+ * `Table` at its natural width, say) back to the canvas, so an oversized
135
+ * child is trimmed rather than allowed to eat the right-hand padding. The
136
+ * second fills the rest of the span, which is the trailing padding and any
137
+ * shortfall in one stroke.
138
+ */
139
+ *_renderRow(box, geometry, line, border, contentStyle) {
140
+ yield new Segment(box.left.repeat(geometry.left), border);
141
+ const content = Segment.adjustLineLength(line, geometry.contentWidth, contentStyle, false);
142
+ const span = [new Segment(" ".repeat(geometry.padLeft), contentStyle), ...content];
143
+ yield* Segment.adjustLineLength(span, geometry.spanWidth, contentStyle);
144
+ yield new Segment(box.right.repeat(geometry.right), border);
145
+ yield Segment.line();
146
+ }
147
+ measure(rawOptions) {
148
+ const options = withCellWidth(rawOptions);
149
+ const declared = this._declaredWidth;
150
+ if (declared !== undefined) {
151
+ // A declared width is not a ceiling on the content, it is the answer:
152
+ // `_getPanelWidth` returns it before measuring anything, so the panel
153
+ // draws at this width whatever the content wants. Reported with a
154
+ // content-derived floor instead, `{width: 20}` around "hi" offered 100
155
+ // cells answered 6..20 and then drew 20 every time, and a parent
156
+ // dividing space from the floor under-provisioned it.
157
+ const width = Math.min(options.maxWidth, declared);
158
+ return { minimum: width, maximum: width };
159
+ }
160
+ return this._fitRange(options);
102
161
  }
103
- measure(options) {
104
- const [_padTop, padRight, _padBottom, padLeft] = this.padding;
105
- const borderWidth = 2; // left + right border chars
106
- const horizontalPad = padLeft + padRight;
162
+ /**
163
+ * The width this panel wants when nothing declared one for it: its content
164
+ * plus its own frame, both read off the division it will render against.
165
+ *
166
+ * [LAW:one-source-of-truth] `measure` and `_getPanelWidth` ask this same
167
+ * question, and each used to work it out itself — the same `layoutPanel`, the
168
+ * same `frameOverhead`, the same `Math.min(maxWidth, maximum + overhead)`,
169
+ * written twice. That is the pattern `_declaredWidth` below was extracted to
170
+ * stop, left standing for the fit case; changing how overhead is derived in
171
+ * one copy is all it would take to put `measure` and `render` back into the
172
+ * disagreement this epic spent itself closing.
173
+ */
174
+ _fitRange(options) {
175
+ const geometry = layoutPanel(options.maxWidth, this.padding);
176
+ const overhead = frameOverhead(geometry);
107
177
  if (isMeasurable(this.renderable)) {
108
178
  const innerOptions = {
109
179
  ...options,
110
- maxWidth: Math.max(1, options.maxWidth - borderWidth - horizontalPad),
180
+ maxWidth: geometry.contentWidth,
111
181
  };
112
182
  const measurement = Measurement.get(innerOptions, this.renderable);
183
+ const maximum = Math.min(options.maxWidth, measurement.maximum + overhead);
113
184
  return {
114
- minimum: Math.max(borderWidth + horizontalPad, measurement.minimum + borderWidth + horizontalPad),
115
- maximum: Math.min(options.maxWidth, measurement.maximum + borderWidth + horizontalPad),
185
+ minimum: Math.min(measurement.minimum + overhead, maximum),
186
+ maximum,
116
187
  };
117
188
  }
118
- return { minimum: borderWidth + horizontalPad, maximum: options.maxWidth };
189
+ // Content that cannot measure itself leaves the panel with nothing to want,
190
+ // so it wants the offer — unbounded included, which `withBoundedWidth`
191
+ // reports rather than turning into a number nobody can defend.
192
+ return { minimum: Math.min(overhead, options.maxWidth), maximum: options.maxWidth };
193
+ }
194
+ /**
195
+ * The width this panel was told to be, as a count of cells.
196
+ *
197
+ * [LAW:one-source-of-truth] `measure` and `_getPanelWidth` answer the same
198
+ * question about the same field, so they read it from here. Answered
199
+ * separately, `measure` reported nine cells of content while `render` drew the
200
+ * declared twelve, and the parent that divided space from the range got a
201
+ * panel three cells wider than the share it granted.
202
+ */
203
+ get _declaredWidth() {
204
+ return this.width === undefined ? undefined : cellCount(this.width);
119
205
  }
120
206
  _getPanelWidth(options) {
121
- if (this.width !== undefined)
122
- return Math.min(this.width, options.maxWidth);
207
+ const declared = this._declaredWidth;
208
+ if (declared !== undefined)
209
+ return Math.min(declared, options.maxWidth);
123
210
  if (this.expand)
124
211
  return options.maxWidth;
125
- // Fit mode: measure content
126
- const [_padTop, padRight, _padBottom, padLeft] = this.padding;
127
- const borderWidth = 2;
128
- const horizontalPad = padLeft + padRight;
129
- if (isMeasurable(this.renderable)) {
130
- const innerOptions = {
131
- ...options,
132
- maxWidth: Math.max(1, options.maxWidth - borderWidth - horizontalPad),
133
- };
134
- const measurement = Measurement.get(innerOptions, this.renderable);
135
- return Math.min(options.maxWidth, measurement.maximum + borderWidth + horizontalPad);
136
- }
137
- return options.maxWidth;
212
+ return this._fitRange(options).maximum;
138
213
  }
139
- *_renderTopBorder(box, panelWidth, border) {
140
- const innerBorderWidth = panelWidth - 2; // minus left/right corner
214
+ *_renderTopBorder(box, geometry, border) {
215
+ const innerBorderWidth = geometry.spanWidth;
141
216
  if (!this.title) {
142
- yield new Segment(box.topLeft, border);
217
+ yield new Segment(box.topLeft.repeat(geometry.left), border);
143
218
  yield new Segment(box.top.repeat(innerBorderWidth), border);
144
- yield new Segment(box.topRight, border);
219
+ yield new Segment(box.topRight.repeat(geometry.right), border);
145
220
  yield Segment.line();
146
221
  return;
147
222
  }
@@ -151,7 +226,7 @@ export class Panel {
151
226
  // Title gets its own style when set, else inherits the border style —
152
227
  // single source of truth for "what color is the title text in".
153
228
  const titleSeg = this.titleStyle ?? border;
154
- yield new Segment(box.topLeft, border);
229
+ yield new Segment(box.topLeft.repeat(geometry.left), border);
155
230
  if (titleWidth >= innerBorderWidth) {
156
231
  // Title fills the border. [LAW:one-source-of-truth] cellLen / setCellSize
157
232
  // are the cell-width authority — plain .slice would miscount wide chars
@@ -168,11 +243,11 @@ export class Panel {
168
243
  if (rightRuleWidth > 0)
169
244
  yield new Segment(box.top.repeat(rightRuleWidth), border);
170
245
  }
171
- yield new Segment(box.topRight, border);
246
+ yield new Segment(box.topRight.repeat(geometry.right), border);
172
247
  yield Segment.line();
173
248
  }
174
- *_renderBottomBorder(box, panelWidth, border) {
175
- const innerBorderWidth = panelWidth - 2;
249
+ *_renderBottomBorder(box, geometry, border) {
250
+ const innerBorderWidth = geometry.spanWidth;
176
251
  // Resolve the right accessory *now*. Function form evaluates after
177
252
  // content has been rendered (Panel.render collects content segments
178
253
  // before yielding any borders), so the thunk sees fresh widget state.
@@ -186,7 +261,7 @@ export class Panel {
186
261
  const accessoryStyle = accessory instanceof RichText && !accessory.style.isNull
187
262
  ? accessory.style
188
263
  : border;
189
- yield new Segment(box.bottomLeft, border);
264
+ yield new Segment(box.bottomLeft.repeat(geometry.left), border);
190
265
  // Space available for the centered subtitle / rule fill — the accessory
191
266
  // (if any) hugs the right edge and the subtitle treats the remainder
192
267
  // as its centering canvas.
@@ -221,7 +296,7 @@ export class Panel {
221
296
  : accessoryDisplay;
222
297
  yield new Segment(fit, accessoryStyle);
223
298
  }
224
- yield new Segment(box.bottomRight, border);
299
+ yield new Segment(box.bottomRight.repeat(geometry.right), border);
225
300
  yield Segment.line();
226
301
  }
227
302
  _resolveAccessory(a) {
@@ -231,12 +306,6 @@ export class Panel {
231
306
  return a();
232
307
  return a;
233
308
  }
234
- *_renderBlankLine(box, _panelWidth, padLeft, padRight, innerWidth, border, contentStyle) {
235
- yield new Segment(box.left, border);
236
- yield new Segment(" ".repeat(padLeft + innerWidth + padRight), contentStyle);
237
- yield new Segment(box.right, border);
238
- yield Segment.line();
239
- }
240
309
  // --- Static factory ---
241
310
  static fit(content, options) {
242
311
  return new Panel(content, { ...options, expand: false });
@@ -1 +1 @@
1
- {"version":3,"file":"panel.js","sourceRoot":"","sources":["../../src/renderables/panel.ts"],"names":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