@teaui/core 1.5.8 → 1.7.8
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/Screen.d.ts +6 -6
- package/.dist/Screen.js +9 -8
- package/.dist/Screen.js.map +1 -1
- package/.dist/Viewport.d.ts +12 -1
- package/.dist/Viewport.js +17 -2
- package/.dist/Viewport.js.map +1 -1
- package/.dist/components/Accordion.js +1 -1
- package/.dist/components/Accordion.js.map +1 -1
- package/.dist/components/Breadcrumb.d.ts +93 -0
- package/.dist/components/Breadcrumb.js +287 -0
- package/.dist/components/Breadcrumb.js.map +1 -0
- package/.dist/components/Button.js +23 -11
- package/.dist/components/Button.js.map +1 -1
- package/.dist/components/Calendar.d.ts +36 -0
- package/.dist/components/Calendar.js +721 -0
- package/.dist/components/Calendar.js.map +1 -0
- package/.dist/components/Canvas.d.ts +48 -0
- package/.dist/components/Canvas.js +230 -0
- package/.dist/components/Canvas.js.map +1 -0
- package/.dist/components/Checkbox.d.ts +3 -2
- package/.dist/components/Checkbox.js +31 -9
- package/.dist/components/Checkbox.js.map +1 -1
- package/.dist/components/Digits.js +18 -6
- package/.dist/components/Digits.js.map +1 -1
- package/.dist/components/Dropdown.d.ts +1 -1
- package/.dist/components/Dropdown.js +14 -6
- package/.dist/components/Dropdown.js.map +1 -1
- package/.dist/components/Geometry.d.ts +29 -0
- package/.dist/components/Geometry.js +40 -0
- package/.dist/components/Geometry.js.map +1 -0
- package/.dist/components/HotKey.js +3 -4
- package/.dist/components/HotKey.js.map +1 -1
- package/.dist/components/Input.js +4 -0
- package/.dist/components/Input.js.map +1 -1
- package/.dist/components/Keyboard.d.ts +20 -0
- package/.dist/components/Keyboard.js +31 -0
- package/.dist/components/Keyboard.js.map +1 -0
- package/.dist/components/Log.js +1 -1
- package/.dist/components/Log.js.map +1 -1
- package/.dist/components/Logo.d.ts +19 -0
- package/.dist/components/Logo.js +204 -0
- package/.dist/components/Logo.js.map +1 -0
- package/.dist/components/Modal.d.ts +74 -0
- package/.dist/components/Modal.js +113 -0
- package/.dist/components/Modal.js.map +1 -0
- package/.dist/components/Mouse.d.ts +25 -0
- package/.dist/components/Mouse.js +46 -0
- package/.dist/components/Mouse.js.map +1 -0
- package/.dist/components/Pane.d.ts +43 -0
- package/.dist/components/Pane.js +321 -0
- package/.dist/components/Pane.js.map +1 -0
- package/.dist/components/Pin.d.ts +25 -0
- package/.dist/components/Pin.js +80 -0
- package/.dist/components/Pin.js.map +1 -0
- package/.dist/components/Plot.d.ts +25 -0
- package/.dist/components/Plot.js +171 -0
- package/.dist/components/Plot.js.map +1 -0
- package/.dist/components/Scrollable.d.ts +6 -0
- package/.dist/components/Scrollable.js +14 -2
- package/.dist/components/Scrollable.js.map +1 -1
- package/.dist/components/ScrollableList.d.ts +2 -2
- package/.dist/components/ScrollableList.js +4 -4
- package/.dist/components/ScrollableList.js.map +1 -1
- package/.dist/components/Slider.d.ts +2 -0
- package/.dist/components/Slider.js +11 -1
- package/.dist/components/Slider.js.map +1 -1
- package/.dist/components/Table.d.ts +79 -0
- package/.dist/components/Table.js +603 -0
- package/.dist/components/Table.js.map +1 -0
- package/.dist/components/Tabs.d.ts +2 -0
- package/.dist/components/Tabs.js +14 -1
- package/.dist/components/Tabs.js.map +1 -1
- package/.dist/components/ZStack.d.ts +19 -0
- package/.dist/components/ZStack.js +34 -0
- package/.dist/components/ZStack.js.map +1 -0
- package/.dist/components/charts/BarChart.d.ts +27 -0
- package/.dist/components/charts/BarChart.js +122 -0
- package/.dist/components/charts/BarChart.js.map +1 -0
- package/.dist/components/charts/Chart.d.ts +43 -0
- package/.dist/components/charts/Chart.js +41 -0
- package/.dist/components/charts/Chart.js.map +1 -0
- package/.dist/components/charts/LineChart.d.ts +23 -0
- package/.dist/components/charts/LineChart.js +109 -0
- package/.dist/components/charts/LineChart.js.map +1 -0
- package/.dist/components/charts/index.d.ts +3 -0
- package/.dist/components/charts/index.js +4 -0
- package/.dist/components/charts/index.js.map +1 -0
- package/.dist/components/index.d.ts +14 -0
- package/.dist/components/index.js +14 -0
- package/.dist/components/index.js.map +1 -1
- package/.dist/iTerm2.js +1 -3
- package/.dist/iTerm2.js.map +1 -1
- package/.dist/inspect.js +1 -1
- package/.dist/inspect.js.map +1 -1
- package/.dist/managers/FocusManager.d.ts +5 -0
- package/.dist/managers/FocusManager.js +16 -0
- package/.dist/managers/FocusManager.js.map +1 -1
- package/.dist/managers/ModalManager.d.ts +2 -1
- package/.dist/managers/ModalManager.js +23 -51
- package/.dist/managers/ModalManager.js.map +1 -1
- package/.dist/renderToAnsi.js +1 -0
- package/.dist/renderToAnsi.js.map +1 -1
- package/.dist/testing.d.ts +5 -0
- package/.dist/testing.js +22 -3
- package/.dist/testing.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import { Container } from '../Container.js';
|
|
2
|
+
import { Rect, Point, Size } from '../geometry.js';
|
|
3
|
+
import { isMousePressStart, isMousePressEnd, } from '../events/index.js';
|
|
4
|
+
import { Style } from '../Style.js';
|
|
5
|
+
/** Minimum width when collapsible — below this threshold the pane will collapse on release. */
|
|
6
|
+
const COLLAPSE_THRESHOLD = 3;
|
|
7
|
+
/** Minimum width when NOT collapsible. */
|
|
8
|
+
const MIN_PANE_WIDTH_NOT_COLLAPSIBLE = 4;
|
|
9
|
+
/** Absolute minimum width during drag when collapsible (allows dragging into the collapse zone). */
|
|
10
|
+
const MIN_PANE_WIDTH_DRAG = 1;
|
|
11
|
+
/** Default minimum width (non-drag). */
|
|
12
|
+
const MIN_PANE_WIDTH = 5;
|
|
13
|
+
const SEPARATOR_WIDTH = 1;
|
|
14
|
+
/**
|
|
15
|
+
* A split-pane container for index/detail layouts. The first N-1 children are
|
|
16
|
+
* collapsible "browser" panes with draggable separators. The last child is the
|
|
17
|
+
* "detail" pane that takes remaining space.
|
|
18
|
+
*/
|
|
19
|
+
export class Pane extends Container {
|
|
20
|
+
#border = false;
|
|
21
|
+
#collapsible = true;
|
|
22
|
+
#browserPanes = [];
|
|
23
|
+
// Drag state
|
|
24
|
+
#dragSeparator = -1;
|
|
25
|
+
#dragStartX = 0;
|
|
26
|
+
#dragStartWidth = 0;
|
|
27
|
+
// Hover state
|
|
28
|
+
#hoverSeparator = -1;
|
|
29
|
+
// Cached layout info for mouse hit-testing
|
|
30
|
+
#separatorPositions = [];
|
|
31
|
+
#borderInset = 0;
|
|
32
|
+
#lastAvailableWidth = 80;
|
|
33
|
+
constructor(props = {}) {
|
|
34
|
+
super(props);
|
|
35
|
+
this.#update(props);
|
|
36
|
+
}
|
|
37
|
+
update(props) {
|
|
38
|
+
this.#update(props);
|
|
39
|
+
super.update(props);
|
|
40
|
+
}
|
|
41
|
+
get border() {
|
|
42
|
+
return this.#border;
|
|
43
|
+
}
|
|
44
|
+
set border(value) {
|
|
45
|
+
if (value === this.#border)
|
|
46
|
+
return;
|
|
47
|
+
this.#border = value;
|
|
48
|
+
this.invalidateSize();
|
|
49
|
+
}
|
|
50
|
+
#update({ border, collapsible }) {
|
|
51
|
+
this.#border = border ?? false;
|
|
52
|
+
this.#collapsible = collapsible ?? true;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Returns the browser panes (all children except the last).
|
|
56
|
+
*/
|
|
57
|
+
get browserViews() {
|
|
58
|
+
const children = this.children;
|
|
59
|
+
if (children.length <= 1)
|
|
60
|
+
return [];
|
|
61
|
+
return children.slice(0, -1);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Returns the detail pane (the last child).
|
|
65
|
+
*/
|
|
66
|
+
get detailView() {
|
|
67
|
+
const children = this.children;
|
|
68
|
+
return children.length > 0 ? children[children.length - 1] : undefined;
|
|
69
|
+
}
|
|
70
|
+
#ensurePaneState() {
|
|
71
|
+
const browserCount = Math.max(0, this.children.length - 1);
|
|
72
|
+
while (this.#browserPanes.length < browserCount) {
|
|
73
|
+
this.#browserPanes.push({ width: 20, collapsed: false });
|
|
74
|
+
}
|
|
75
|
+
if (this.#browserPanes.length > browserCount) {
|
|
76
|
+
this.#browserPanes.length = browserCount;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
naturalSize(available) {
|
|
80
|
+
this.#ensurePaneState();
|
|
81
|
+
const borderInset = this.#border ? 2 : 0;
|
|
82
|
+
const innerAvailable = available.shrink(borderInset, borderInset);
|
|
83
|
+
const browsers = this.browserViews;
|
|
84
|
+
let usedWidth = 0;
|
|
85
|
+
for (let i = 0; i < browsers.length; i++) {
|
|
86
|
+
const ns = browsers[i].naturalSize(innerAvailable);
|
|
87
|
+
// Initialize widths from natural size on first layout
|
|
88
|
+
if (this.#browserPanes[i].width === 20) {
|
|
89
|
+
this.#browserPanes[i].width = Math.max(MIN_PANE_WIDTH, Math.min(ns.width, Math.floor(innerAvailable.width / 3)));
|
|
90
|
+
}
|
|
91
|
+
usedWidth +=
|
|
92
|
+
(this.#browserPanes[i].collapsed ? 0 : this.#browserPanes[i].width) +
|
|
93
|
+
SEPARATOR_WIDTH;
|
|
94
|
+
}
|
|
95
|
+
const detailNs = this.detailView?.naturalSize(innerAvailable.shrink(usedWidth, 0));
|
|
96
|
+
const detailWidth = detailNs?.width ?? 0;
|
|
97
|
+
const totalWidth = usedWidth + detailWidth + borderInset;
|
|
98
|
+
return new Size(Math.min(available.width, Math.max(totalWidth, MIN_PANE_WIDTH)), available.height);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Hit-test: given an absolute x position in viewport coordinates,
|
|
102
|
+
* find which separator index (if any) was hit.
|
|
103
|
+
*/
|
|
104
|
+
#hitTestSeparator(x) {
|
|
105
|
+
for (let i = 0; i < this.#separatorPositions.length; i++) {
|
|
106
|
+
if (x === this.#separatorPositions[i]) {
|
|
107
|
+
return i;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return -1;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Whether a given browser pane is in the "will collapse" zone during a drag.
|
|
114
|
+
*/
|
|
115
|
+
#isInCollapseZone(index) {
|
|
116
|
+
if (!this.#collapsible)
|
|
117
|
+
return false;
|
|
118
|
+
const pane = this.#browserPanes[index];
|
|
119
|
+
return !pane.collapsed && pane.width <= COLLAPSE_THRESHOLD;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Whether a given mouse event is part of an ongoing button-drag gesture.
|
|
123
|
+
* This includes dragInside, dragOutside, exit (leaving the region while
|
|
124
|
+
* dragging), and the initial down event itself.
|
|
125
|
+
*/
|
|
126
|
+
#isDragGesture(event) {
|
|
127
|
+
if (!event.name.startsWith('mouse.button.'))
|
|
128
|
+
return false;
|
|
129
|
+
// up and cancel end the gesture
|
|
130
|
+
if (event.name.endsWith('.up') || event.name.endsWith('.cancel'))
|
|
131
|
+
return false;
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
receiveMouse(event, system) {
|
|
135
|
+
super.receiveMouse(event, system);
|
|
136
|
+
const x = event.position.x;
|
|
137
|
+
// During a drag, always track the dragged separator
|
|
138
|
+
if (this.#dragSeparator >= 0) {
|
|
139
|
+
if (this.#isDragGesture(event)) {
|
|
140
|
+
const dx = x - this.#dragStartX;
|
|
141
|
+
const maxWidth = Math.floor(this.#lastAvailableWidth / 2);
|
|
142
|
+
const pane = this.#browserPanes[this.#dragSeparator];
|
|
143
|
+
if (!pane.collapsed) {
|
|
144
|
+
const minDrag = this.#collapsible
|
|
145
|
+
? MIN_PANE_WIDTH_DRAG
|
|
146
|
+
: MIN_PANE_WIDTH_NOT_COLLAPSIBLE;
|
|
147
|
+
pane.width = Math.max(minDrag, Math.min(maxWidth, this.#dragStartWidth + dx));
|
|
148
|
+
}
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (isMousePressEnd(event)) {
|
|
152
|
+
const pane = this.#browserPanes[this.#dragSeparator];
|
|
153
|
+
const dx = Math.abs(x - this.#dragStartX);
|
|
154
|
+
if (this.#collapsible &&
|
|
155
|
+
!pane.collapsed &&
|
|
156
|
+
this.#isInCollapseZone(this.#dragSeparator)) {
|
|
157
|
+
// Released in collapse zone — collapse and restore width
|
|
158
|
+
pane.collapsed = true;
|
|
159
|
+
pane.width = this.#dragStartWidth;
|
|
160
|
+
}
|
|
161
|
+
else if (dx <= 1) {
|
|
162
|
+
// Click without drag — toggle collapse (only if collapsible)
|
|
163
|
+
if (this.#collapsible) {
|
|
164
|
+
pane.collapsed = !pane.collapsed;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
this.#dragSeparator = -1;
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
const separatorIndex = this.#hitTestSeparator(x);
|
|
172
|
+
// Handle hover
|
|
173
|
+
if (event.name === 'mouse.move.in' || event.name === 'mouse.move.enter') {
|
|
174
|
+
this.#hoverSeparator = separatorIndex;
|
|
175
|
+
}
|
|
176
|
+
else if (event.name === 'mouse.move.exit') {
|
|
177
|
+
this.#hoverSeparator = -1;
|
|
178
|
+
}
|
|
179
|
+
// Handle drag start on a separator
|
|
180
|
+
if (isMousePressStart(event) && separatorIndex >= 0) {
|
|
181
|
+
this.#dragSeparator = separatorIndex;
|
|
182
|
+
this.#dragStartX = x;
|
|
183
|
+
this.#dragStartWidth = this.#browserPanes[separatorIndex].width;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
render(viewport) {
|
|
187
|
+
if (viewport.isEmpty) {
|
|
188
|
+
return super.render(viewport);
|
|
189
|
+
}
|
|
190
|
+
this.#ensurePaneState();
|
|
191
|
+
this.#borderInset = this.#border ? 1 : 0;
|
|
192
|
+
const innerSize = viewport.contentSize.shrink(this.#borderInset * 2, this.#borderInset * 2);
|
|
193
|
+
this.#lastAvailableWidth = innerSize.width;
|
|
194
|
+
// Draw border if enabled
|
|
195
|
+
if (this.#border) {
|
|
196
|
+
this.#renderBorder(viewport);
|
|
197
|
+
}
|
|
198
|
+
// Panes get the full width minus left/right border, but full height
|
|
199
|
+
// so that #renderSeparator can draw border junctions on the top/bottom rows.
|
|
200
|
+
const panesRect = this.#border
|
|
201
|
+
? new Rect(new Point(this.#borderInset, 0), viewport.contentSize.shrink(this.#borderInset * 2, 0))
|
|
202
|
+
: viewport.contentRect;
|
|
203
|
+
viewport.clipped(panesRect, inner => {
|
|
204
|
+
this.#renderPanes(inner);
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
#renderPanes(viewport) {
|
|
208
|
+
const browsers = this.browserViews;
|
|
209
|
+
const detail = this.detailView;
|
|
210
|
+
const fullHeight = viewport.contentSize.height;
|
|
211
|
+
// Child content is inset from top/bottom border rows
|
|
212
|
+
const contentTop = this.#borderInset;
|
|
213
|
+
const contentHeight = fullHeight - this.#borderInset * 2;
|
|
214
|
+
let x = 0;
|
|
215
|
+
this.#separatorPositions = [];
|
|
216
|
+
for (let i = 0; i < browsers.length; i++) {
|
|
217
|
+
const pane = this.#browserPanes[i];
|
|
218
|
+
// Render browser pane content (if not collapsed)
|
|
219
|
+
if (!pane.collapsed) {
|
|
220
|
+
const paneWidth = pane.width;
|
|
221
|
+
const paneRect = new Rect(new Point(x, contentTop), new Size(paneWidth, contentHeight));
|
|
222
|
+
viewport.clipped(paneRect, inner => {
|
|
223
|
+
browsers[i].render(inner);
|
|
224
|
+
});
|
|
225
|
+
x += paneWidth;
|
|
226
|
+
}
|
|
227
|
+
// Render separator (full height, including border rows)
|
|
228
|
+
this.#separatorPositions.push(x);
|
|
229
|
+
this.#renderSeparator(viewport, i, x, fullHeight, pane.collapsed);
|
|
230
|
+
x += SEPARATOR_WIDTH;
|
|
231
|
+
}
|
|
232
|
+
// Render detail pane (fills remaining space)
|
|
233
|
+
if (detail) {
|
|
234
|
+
const detailWidth = Math.max(0, viewport.contentSize.width - x);
|
|
235
|
+
if (detailWidth > 0) {
|
|
236
|
+
const detailRect = new Rect(new Point(x, contentTop), new Size(detailWidth, contentHeight));
|
|
237
|
+
viewport.clipped(detailRect, inner => {
|
|
238
|
+
detail.render(inner);
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
#renderSeparator(viewport, index, x, fullHeight, collapsed) {
|
|
244
|
+
const isHover = this.#hoverSeparator === index;
|
|
245
|
+
const isDragging = this.#dragSeparator === index;
|
|
246
|
+
const willCollapse = isDragging && this.#isInCollapseZone(index);
|
|
247
|
+
const style = isHover || isDragging ? this.theme.ui({ isHover: true }) : Style.NONE;
|
|
248
|
+
const separatorRect = new Rect(new Point(x, 0), new Size(SEPARATOR_WIDTH, fullHeight));
|
|
249
|
+
viewport.registerMouse(['mouse.move', 'mouse.button.left'], separatorRect);
|
|
250
|
+
const topRow = this.#border ? 0 : -1;
|
|
251
|
+
const bottomRow = this.#border ? fullHeight - 1 : -1;
|
|
252
|
+
const point = new Point(x, 0).mutableCopy();
|
|
253
|
+
viewport.usingPen(style, () => {
|
|
254
|
+
for (point.y = 0; point.y < fullHeight; point.y++) {
|
|
255
|
+
let char;
|
|
256
|
+
if (point.y === topRow) {
|
|
257
|
+
char = collapsed ? BORDER_TOP_COLLAPSED : BORDER_TOP_SEP;
|
|
258
|
+
}
|
|
259
|
+
else if (point.y === bottomRow) {
|
|
260
|
+
char = collapsed ? BORDER_BOTTOM_COLLAPSED : BORDER_BOTTOM_SEP;
|
|
261
|
+
}
|
|
262
|
+
else if (collapsed) {
|
|
263
|
+
char = SEP_COLLAPSED;
|
|
264
|
+
}
|
|
265
|
+
else if (willCollapse) {
|
|
266
|
+
char = point.y % 2 === 1 ? SEP_WILL_COLLAPSE : SEP_DEFAULT;
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
char = SEP_DEFAULT;
|
|
270
|
+
}
|
|
271
|
+
viewport.write(char, point);
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
#renderBorder(viewport) {
|
|
276
|
+
const w = viewport.contentSize.width;
|
|
277
|
+
const h = viewport.contentSize.height;
|
|
278
|
+
const point = new Point(0, 0).mutableCopy();
|
|
279
|
+
// Top edge
|
|
280
|
+
point.y = 0;
|
|
281
|
+
for (point.x = 1; point.x < w - 1; point.x++) {
|
|
282
|
+
viewport.write(BORDER_HORIZONTAL, point);
|
|
283
|
+
}
|
|
284
|
+
// Bottom edge
|
|
285
|
+
point.y = h - 1;
|
|
286
|
+
for (point.x = 1; point.x < w - 1; point.x++) {
|
|
287
|
+
viewport.write(BORDER_HORIZONTAL, point);
|
|
288
|
+
}
|
|
289
|
+
// Left & right edges
|
|
290
|
+
for (point.y = 1; point.y < h - 1; point.y++) {
|
|
291
|
+
point.x = 0;
|
|
292
|
+
viewport.write(BORDER_VERTICAL, point);
|
|
293
|
+
point.x = w - 1;
|
|
294
|
+
viewport.write(BORDER_VERTICAL, point);
|
|
295
|
+
}
|
|
296
|
+
// Corners
|
|
297
|
+
viewport.write(BORDER_TOP_LEFT, new Point(0, 0));
|
|
298
|
+
viewport.write(BORDER_TOP_RIGHT, new Point(w - 1, 0));
|
|
299
|
+
viewport.write(BORDER_BOTTOM_LEFT, new Point(0, h - 1));
|
|
300
|
+
viewport.write(BORDER_BOTTOM_RIGHT, new Point(w - 1, h - 1));
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
////
|
|
304
|
+
/// Drawing constants
|
|
305
|
+
//
|
|
306
|
+
// Separator characters
|
|
307
|
+
const SEP_DEFAULT = '┃';
|
|
308
|
+
const SEP_COLLAPSED = '║';
|
|
309
|
+
const SEP_WILL_COLLAPSE = '←';
|
|
310
|
+
// Border characters
|
|
311
|
+
const BORDER_HORIZONTAL = '─';
|
|
312
|
+
const BORDER_VERTICAL = '│';
|
|
313
|
+
const BORDER_TOP_LEFT = '╭';
|
|
314
|
+
const BORDER_TOP_RIGHT = '╮';
|
|
315
|
+
const BORDER_BOTTOM_LEFT = '╰';
|
|
316
|
+
const BORDER_BOTTOM_RIGHT = '╯';
|
|
317
|
+
const BORDER_TOP_SEP = '┰';
|
|
318
|
+
const BORDER_BOTTOM_SEP = '┸';
|
|
319
|
+
const BORDER_TOP_COLLAPSED = '╥';
|
|
320
|
+
const BORDER_BOTTOM_COLLAPSED = '╨';
|
|
321
|
+
//# sourceMappingURL=Pane.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pane.js","sourceRoot":"","sources":["../../lib/components/Pane.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,SAAS,EAA+B,MAAM,iBAAiB,CAAA;AACvE,OAAO,EAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAEL,iBAAiB,EACjB,eAAe,GAChB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAgBjC,+FAA+F;AAC/F,MAAM,kBAAkB,GAAG,CAAC,CAAA;AAC5B,0CAA0C;AAC1C,MAAM,8BAA8B,GAAG,CAAC,CAAA;AACxC,oGAAoG;AACpG,MAAM,mBAAmB,GAAG,CAAC,CAAA;AAC7B,wCAAwC;AACxC,MAAM,cAAc,GAAG,CAAC,CAAA;AACxB,MAAM,eAAe,GAAG,CAAC,CAAA;AAOzB;;;;GAIG;AACH,MAAM,OAAO,IAAK,SAAQ,SAAS;IACjC,OAAO,GAAY,KAAK,CAAA;IACxB,YAAY,GAAY,IAAI,CAAA;IAC5B,aAAa,GAAkB,EAAE,CAAA;IAEjC,aAAa;IACb,cAAc,GAAW,CAAC,CAAC,CAAA;IAC3B,WAAW,GAAW,CAAC,CAAA;IACvB,eAAe,GAAW,CAAC,CAAA;IAE3B,cAAc;IACd,eAAe,GAAW,CAAC,CAAC,CAAA;IAE5B,2CAA2C;IAC3C,mBAAmB,GAAa,EAAE,CAAA;IAClC,YAAY,GAAW,CAAC,CAAA;IACxB,mBAAmB,GAAW,EAAE,CAAA;IAEhC,YAAY,QAAe,EAAE;QAC3B,KAAK,CAAC,KAAK,CAAC,CAAA;QACZ,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IACrB,C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AAE,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAC9D,CAAC;CACF;AAED,IAAI;AACJ,qBAAqB;AACrB,EAAE;AAEF,uBAAuB;AACvB,MAAM,WAAW,GAAG,GAAG,CAAA;AACvB,MAAM,aAAa,GAAG,GAAG,CAAA;AACzB,MAAM,iBAAiB,GAAG,GAAG,CAAA;AAE7B,oBAAoB;AACpB,MAAM,iBAAiB,GAAG,GAAG,CAAA;AAC7B,MAAM,eAAe,GAAG,GAAG,CAAA;AAC3B,MAAM,eAAe,GAAG,GAAG,CAAA;AAC3B,MAAM,gBAAgB,GAAG,GAAG,CAAA;AAC5B,MAAM,kBAAkB,GAAG,GAAG,CAAA;AAC9B,MAAM,mBAAmB,GAAG,GAAG,CAAA;AAC/B,MAAM,cAAc,GAAG,GAAG,CAAA;AAC1B,MAAM,iBAAiB,GAAG,GAAG,CAAA;AAC7B,MAAM,oBAAoB,GAAG,GAAG,CAAA;AAChC,MAAM,uBAAuB,GAAG,GAAG,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Viewport } from '../Viewport.js';
|
|
2
|
+
import { type Props as ViewProps } from '../View.js';
|
|
3
|
+
import { Container } from '../Container.js';
|
|
4
|
+
import { Size } from '../geometry.js';
|
|
5
|
+
export type PinLocation = 'top-left' | 'top-center' | 'top-right' | 'left' | 'center' | 'right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
6
|
+
interface Props extends ViewProps {
|
|
7
|
+
location?: PinLocation;
|
|
8
|
+
children?: import('../View.js').View[];
|
|
9
|
+
child?: import('../View.js').View;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Positions its children at a specific location within the available space.
|
|
13
|
+
* Takes up all available space (like a flex container) and places children
|
|
14
|
+
* at the specified grid position.
|
|
15
|
+
*/
|
|
16
|
+
export declare class Pin extends Container {
|
|
17
|
+
#private;
|
|
18
|
+
constructor(props?: Props);
|
|
19
|
+
get location(): PinLocation;
|
|
20
|
+
set location(value: PinLocation);
|
|
21
|
+
update(props: Props): void;
|
|
22
|
+
naturalSize(available: Size): Size;
|
|
23
|
+
render(viewport: Viewport): void;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Container } from '../Container.js';
|
|
2
|
+
import { Rect, Point } from '../geometry.js';
|
|
3
|
+
/**
|
|
4
|
+
* Positions its children at a specific location within the available space.
|
|
5
|
+
* Takes up all available space (like a flex container) and places children
|
|
6
|
+
* at the specified grid position.
|
|
7
|
+
*/
|
|
8
|
+
export class Pin extends Container {
|
|
9
|
+
#location = 'top-left';
|
|
10
|
+
constructor(props = {}) {
|
|
11
|
+
super(props);
|
|
12
|
+
this.#update(props);
|
|
13
|
+
}
|
|
14
|
+
get location() {
|
|
15
|
+
return this.#location;
|
|
16
|
+
}
|
|
17
|
+
set location(value) {
|
|
18
|
+
if (value === this.#location)
|
|
19
|
+
return;
|
|
20
|
+
this.#location = value;
|
|
21
|
+
this.invalidateSize();
|
|
22
|
+
}
|
|
23
|
+
update(props) {
|
|
24
|
+
this.#update(props);
|
|
25
|
+
super.update(props);
|
|
26
|
+
}
|
|
27
|
+
#update({ location }) {
|
|
28
|
+
this.#location = location ?? 'top-left';
|
|
29
|
+
}
|
|
30
|
+
naturalSize(available) {
|
|
31
|
+
return available;
|
|
32
|
+
}
|
|
33
|
+
render(viewport) {
|
|
34
|
+
if (viewport.isEmpty) {
|
|
35
|
+
return super.render(viewport);
|
|
36
|
+
}
|
|
37
|
+
for (const child of this.children) {
|
|
38
|
+
if (!child.isVisible)
|
|
39
|
+
continue;
|
|
40
|
+
const childSize = child.naturalSize(viewport.contentSize);
|
|
41
|
+
const origin = this.#computeOrigin(viewport.contentSize, childSize);
|
|
42
|
+
viewport.clipped(new Rect(origin, childSize), inside => {
|
|
43
|
+
child.render(inside);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
#computeOrigin(available, childSize) {
|
|
48
|
+
let x, y;
|
|
49
|
+
// horizontal
|
|
50
|
+
if (this.#location === 'top-left' ||
|
|
51
|
+
this.#location === 'left' ||
|
|
52
|
+
this.#location === 'bottom-left') {
|
|
53
|
+
x = 0;
|
|
54
|
+
}
|
|
55
|
+
else if (this.#location === 'top-center' ||
|
|
56
|
+
this.#location === 'center' ||
|
|
57
|
+
this.#location === 'bottom-center') {
|
|
58
|
+
x = Math.round((available.width - childSize.width) / 2);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
x = available.width - childSize.width;
|
|
62
|
+
}
|
|
63
|
+
// vertical
|
|
64
|
+
if (this.#location === 'top-left' ||
|
|
65
|
+
this.#location === 'top-center' ||
|
|
66
|
+
this.#location === 'top-right') {
|
|
67
|
+
y = 0;
|
|
68
|
+
}
|
|
69
|
+
else if (this.#location === 'left' ||
|
|
70
|
+
this.#location === 'center' ||
|
|
71
|
+
this.#location === 'right') {
|
|
72
|
+
y = Math.round((available.height - childSize.height) / 2);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
y = available.height - childSize.height;
|
|
76
|
+
}
|
|
77
|
+
return new Point(Math.max(0, x), Math.max(0, y));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=Pin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pin.js","sourceRoot":"","sources":["../../lib/components/Pin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAA;AACzC,OAAO,EAAC,IAAI,EAAE,KAAK,EAAO,MAAM,gBAAgB,CAAA;AAmBhD;;;;GAIG;AACH,MAAM,OAAO,GAAI,SAAQ,SAAS;IAChC,SAAS,GAAgB,UAAU,CAAA;IAEnC,YAAY,QAAe,EAAE;QAC3B,KAAK,CAAC,KAAK,CAAC,CAAA;QACZ,IAAI,CAAC,OAAO,CAAC,KAAK,C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
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Viewport } from '../Viewport.js';
|
|
2
|
+
import type { Props as ViewProps } from '../View.js';
|
|
3
|
+
import { View } from '../View.js';
|
|
4
|
+
import { Size } from '../geometry.js';
|
|
5
|
+
import { Chart } from './charts/Chart.js';
|
|
6
|
+
interface Props extends ViewProps {
|
|
7
|
+
/** Title displayed above the chart */
|
|
8
|
+
title?: string;
|
|
9
|
+
/** Show x-axis tick labels (default true) */
|
|
10
|
+
xAxisLabels?: boolean;
|
|
11
|
+
/** Show y-axis tick labels (default true) */
|
|
12
|
+
yAxisLabels?: boolean;
|
|
13
|
+
/** Show border/axes lines (default true) */
|
|
14
|
+
showAxes?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare class Plot extends View {
|
|
17
|
+
#private;
|
|
18
|
+
constructor(props?: Props);
|
|
19
|
+
update(props: Props): void;
|
|
20
|
+
add(chart: Chart): void;
|
|
21
|
+
remove(chart: Chart): void;
|
|
22
|
+
naturalSize(available: Size): Size;
|
|
23
|
+
render(viewport: Viewport): void;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { View } from '../View.js';
|
|
2
|
+
import { Point, Rect, Size } from '../geometry.js';
|
|
3
|
+
import { Style } from '../Style.js';
|
|
4
|
+
export class Plot extends View {
|
|
5
|
+
#charts = [];
|
|
6
|
+
#title;
|
|
7
|
+
#xAxisLabels = true;
|
|
8
|
+
#yAxisLabels = true;
|
|
9
|
+
#showAxes = true;
|
|
10
|
+
constructor(props = {}) {
|
|
11
|
+
super(props);
|
|
12
|
+
this.#update(props);
|
|
13
|
+
}
|
|
14
|
+
update(props) {
|
|
15
|
+
this.#update(props);
|
|
16
|
+
super.update(props);
|
|
17
|
+
}
|
|
18
|
+
#update({ title, xAxisLabels, yAxisLabels, showAxes }) {
|
|
19
|
+
this.#title = title;
|
|
20
|
+
this.#xAxisLabels = xAxisLabels ?? true;
|
|
21
|
+
this.#yAxisLabels = yAxisLabels ?? true;
|
|
22
|
+
this.#showAxes = showAxes ?? true;
|
|
23
|
+
}
|
|
24
|
+
add(chart) {
|
|
25
|
+
this.#charts.push(chart);
|
|
26
|
+
this.invalidateRender();
|
|
27
|
+
}
|
|
28
|
+
remove(chart) {
|
|
29
|
+
const idx = this.#charts.indexOf(chart);
|
|
30
|
+
if (idx !== -1) {
|
|
31
|
+
this.#charts.splice(idx, 1);
|
|
32
|
+
this.invalidateRender();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
naturalSize(available) {
|
|
36
|
+
return available;
|
|
37
|
+
}
|
|
38
|
+
render(viewport) {
|
|
39
|
+
if (viewport.isEmpty || this.#charts.length === 0)
|
|
40
|
+
return;
|
|
41
|
+
const textStyle = this.theme.text();
|
|
42
|
+
const totalW = viewport.contentSize.width;
|
|
43
|
+
const totalH = viewport.contentSize.height;
|
|
44
|
+
// Compute combined data ranges from all charts
|
|
45
|
+
const xRange = this.#combinedXRange();
|
|
46
|
+
const yRange = this.#combinedYRange();
|
|
47
|
+
// Layout regions
|
|
48
|
+
let titleHeight = 0;
|
|
49
|
+
if (this.#title) {
|
|
50
|
+
titleHeight = 1;
|
|
51
|
+
}
|
|
52
|
+
// Y-axis labels on the left
|
|
53
|
+
let yLabelWidth = 0;
|
|
54
|
+
let yLabels = [];
|
|
55
|
+
const chartHeight = totalH -
|
|
56
|
+
titleHeight -
|
|
57
|
+
(this.#xAxisLabels ? 1 : 0) -
|
|
58
|
+
(this.#showAxes ? 1 : 0);
|
|
59
|
+
if (this.#yAxisLabels && chartHeight > 0) {
|
|
60
|
+
// Get labels from first chart
|
|
61
|
+
const labelCount = Math.max(2, Math.min(chartHeight, 8));
|
|
62
|
+
yLabels = this.#charts[0].getYLabels(labelCount);
|
|
63
|
+
yLabelWidth = Math.max(0, ...yLabels.map(l => l.length)) + 1; // +1 for space
|
|
64
|
+
}
|
|
65
|
+
// Axis line takes 1 column if shown
|
|
66
|
+
const axisLineWidth = this.#showAxes ? 1 : 0;
|
|
67
|
+
const chartX = yLabelWidth + axisLineWidth;
|
|
68
|
+
const chartY = titleHeight;
|
|
69
|
+
const chartW = Math.max(0, totalW - chartX);
|
|
70
|
+
const chartH = Math.max(0, chartHeight);
|
|
71
|
+
if (chartW <= 0 || chartH <= 0)
|
|
72
|
+
return;
|
|
73
|
+
// Draw title
|
|
74
|
+
if (this.#title && titleHeight > 0) {
|
|
75
|
+
const titleX = chartX + Math.max(0, Math.floor((chartW - this.#title.length) / 2));
|
|
76
|
+
viewport.write(this.#title.slice(0, totalW), new Point(titleX, 0), new Style({ bold: true }).merge(textStyle));
|
|
77
|
+
}
|
|
78
|
+
// Draw y-axis labels
|
|
79
|
+
if (this.#yAxisLabels && yLabels.length > 0 && chartH > 0) {
|
|
80
|
+
for (let i = 0; i < yLabels.length; i++) {
|
|
81
|
+
const labelY = chartY +
|
|
82
|
+
Math.round((i * (chartH - 1)) / Math.max(1, yLabels.length - 1));
|
|
83
|
+
if (labelY < chartY + chartH) {
|
|
84
|
+
const label = yLabels[i].padStart(yLabelWidth - 1);
|
|
85
|
+
viewport.write(label, new Point(0, labelY), textStyle);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// Draw axes lines
|
|
90
|
+
if (this.#showAxes) {
|
|
91
|
+
const axisX = yLabelWidth;
|
|
92
|
+
const pt = new Point(0, 0).mutableCopy();
|
|
93
|
+
// Vertical axis line
|
|
94
|
+
for (let y = chartY; y < chartY + chartH; y++) {
|
|
95
|
+
pt.x = axisX;
|
|
96
|
+
pt.y = y;
|
|
97
|
+
viewport.write('│', pt, textStyle);
|
|
98
|
+
}
|
|
99
|
+
// Bottom-left corner
|
|
100
|
+
pt.x = axisX;
|
|
101
|
+
pt.y = chartY + chartH;
|
|
102
|
+
viewport.write('└', pt, textStyle);
|
|
103
|
+
// Horizontal axis line
|
|
104
|
+
for (let x = axisX + 1; x < totalW; x++) {
|
|
105
|
+
pt.x = x;
|
|
106
|
+
pt.y = chartY + chartH;
|
|
107
|
+
viewport.write('─', pt, textStyle);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// Draw x-axis labels
|
|
111
|
+
if (this.#xAxisLabels && this.#charts.length > 0) {
|
|
112
|
+
const xLabels = this.#charts[0].getXLabels();
|
|
113
|
+
if (xLabels.length > 0) {
|
|
114
|
+
const xAxisY = chartY + chartH + (this.#showAxes ? 1 : 0);
|
|
115
|
+
if (xAxisY < totalH) {
|
|
116
|
+
// Distribute labels evenly
|
|
117
|
+
const labelCount = Math.min(xLabels.length, Math.floor(chartW / 4));
|
|
118
|
+
for (let i = 0; i < labelCount; i++) {
|
|
119
|
+
const dataIdx = Math.round((i * (xLabels.length - 1)) / Math.max(1, labelCount - 1));
|
|
120
|
+
const label = xLabels[dataIdx];
|
|
121
|
+
const labelX = chartX +
|
|
122
|
+
Math.round((i * (chartW - 1)) / Math.max(1, labelCount - 1));
|
|
123
|
+
const truncated = label.slice(0, Math.min(label.length, chartW - (labelX - chartX)));
|
|
124
|
+
viewport.write(truncated, new Point(labelX, xAxisY), textStyle);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
// Render charts in the chart area
|
|
130
|
+
const chartRect = new Rect(new Point(chartX, chartY), new Size(chartW, chartH));
|
|
131
|
+
for (const chart of this.#charts) {
|
|
132
|
+
viewport.clipped(chartRect, clippedViewport => {
|
|
133
|
+
chart.renderChart(clippedViewport, {
|
|
134
|
+
width: chartW,
|
|
135
|
+
height: chartH,
|
|
136
|
+
xRange,
|
|
137
|
+
yRange,
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
#combinedXRange() {
|
|
143
|
+
let min = Infinity;
|
|
144
|
+
let max = -Infinity;
|
|
145
|
+
for (const chart of this.#charts) {
|
|
146
|
+
const range = chart.getXRange();
|
|
147
|
+
if (range.min < min)
|
|
148
|
+
min = range.min;
|
|
149
|
+
if (range.max > max)
|
|
150
|
+
max = range.max;
|
|
151
|
+
}
|
|
152
|
+
if (!isFinite(min))
|
|
153
|
+
return { min: 0, max: 1 };
|
|
154
|
+
return { min, max };
|
|
155
|
+
}
|
|
156
|
+
#combinedYRange() {
|
|
157
|
+
let min = Infinity;
|
|
158
|
+
let max = -Infinity;
|
|
159
|
+
for (const chart of this.#charts) {
|
|
160
|
+
const range = chart.getYRange();
|
|
161
|
+
if (range.min < min)
|
|
162
|
+
min = range.min;
|
|
163
|
+
if (range.max > max)
|
|
164
|
+
max = range.max;
|
|
165
|
+
}
|
|
166
|
+
if (!isFinite(min))
|
|
167
|
+
return { min: 0, max: 1 };
|
|
168
|
+
return { min, max };
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=Plot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plot.js","sourceRoot":"","sources":["../../lib/components/Plot.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,IAAI,EAAC,MAAM,YAAY,CAAA;AAC/B,OAAO,EAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAcjC,MAAM,OAAO,IAAK,SAAQ,IAAI;IAC5B,OAAO,GAAY,EAAE,CAAA;IACrB,MAAM,CAAoB;IAC1B,YAAY,GAAY,IAAI,CAAA;IAC5B,YAAY,GAAY,IAAI,CAAA;IAC5B,SAAS,GAAY,IAAI,CAAA;IAEzB,YAAY,QAAe,EAAE;QAC3B,KAAK,CAAC,KAAK,CAAC,CAAA;QACZ,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IACrB,CAAC;IAED,MAAM,CAAC,KAAY;QACjB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QACnB,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IACrB,CAAC;IAED,OAAO,CAA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