@tooee/renderers 0.12.0 → 0.14.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.
- package/dist/chooser/choose-filter.d.ts.map +1 -1
- package/dist/chooser/choose-filter.js.map +1 -1
- package/dist/chooser/choose-highlighted-text.d.ts.map +1 -1
- package/dist/chooser/choose-highlighted-text.js.map +1 -1
- package/dist/chooser/choose-list.d.ts.map +1 -1
- package/dist/chooser/choose-list.js.map +1 -1
- package/dist/chooser/choose-store.d.ts +3 -3
- package/dist/chooser/choose-store.d.ts.map +1 -1
- package/dist/chooser/choose-store.js.map +1 -1
- package/dist/chooser/chooser.d.ts.map +1 -1
- package/dist/chooser/chooser.js.map +1 -1
- package/dist/chooser/source.d.ts.map +1 -1
- package/dist/chooser/source.js.map +1 -1
- package/dist/chooser/use-choose.d.ts.map +1 -1
- package/dist/chooser/use-choose.js.map +1 -1
- package/dist/code-blocks.d.ts.map +1 -1
- package/dist/code-blocks.js.map +1 -1
- package/dist/command-palette.d.ts.map +1 -1
- package/dist/command-palette.js.map +1 -1
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/markdown/blocks/blockquote.d.ts.map +1 -1
- package/dist/markdown/blocks/blockquote.js.map +1 -1
- package/dist/markdown/blocks/flat-block.d.ts.map +1 -1
- package/dist/markdown/blocks/flat-block.js +38 -33
- package/dist/markdown/blocks/flat-block.js.map +1 -1
- package/dist/markdown/blocks/heading.d.ts.map +1 -1
- package/dist/markdown/blocks/heading.js.map +1 -1
- package/dist/markdown/blocks/list-line.d.ts +2 -2
- package/dist/markdown/blocks/list-line.d.ts.map +1 -1
- package/dist/markdown/blocks/list-line.js +2 -3
- package/dist/markdown/blocks/list-line.js.map +1 -1
- package/dist/markdown/blocks/paragraph.d.ts.map +1 -1
- package/dist/markdown/blocks/paragraph.js.map +1 -1
- package/dist/markdown/blocks/table.d.ts +17 -3
- package/dist/markdown/blocks/table.d.ts.map +1 -1
- package/dist/markdown/blocks/table.js +29 -29
- package/dist/markdown/blocks/table.js.map +1 -1
- package/dist/markdown/links.d.ts +10 -0
- package/dist/markdown/links.d.ts.map +1 -1
- package/dist/markdown/links.js +30 -18
- package/dist/markdown/links.js.map +1 -1
- package/dist/markdown/plain-text.d.ts.map +1 -1
- package/dist/markdown/plain-text.js.map +1 -1
- package/dist/markdown/table-layout.d.ts +28 -0
- package/dist/markdown/table-layout.d.ts.map +1 -0
- package/dist/markdown/table-layout.js +100 -0
- package/dist/markdown/table-layout.js.map +1 -0
- package/dist/markdown/table-links.d.ts +5 -4
- package/dist/markdown/table-links.d.ts.map +1 -1
- package/dist/markdown/table-links.js +6 -23
- package/dist/markdown/table-links.js.map +1 -1
- package/dist/markdown/tokens.d.ts +2 -0
- package/dist/markdown/tokens.d.ts.map +1 -1
- package/dist/markdown/tokens.js.map +1 -1
- package/dist/markdown/visit-inline.d.ts.map +1 -1
- package/dist/markdown/visit-inline.js.map +1 -1
- package/dist/markdown-blocks.d.ts +72 -14
- package/dist/markdown-blocks.d.ts.map +1 -1
- package/dist/markdown-blocks.js +137 -77
- package/dist/markdown-blocks.js.map +1 -1
- package/dist/markdown-images.d.ts.map +1 -1
- package/dist/markdown-images.js +5 -8
- package/dist/markdown-images.js.map +1 -1
- package/dist/markdown-view.d.ts +0 -1
- package/dist/markdown-view.d.ts.map +1 -1
- package/dist/markdown-view.js +0 -1
- package/dist/markdown-view.js.map +1 -1
- package/dist/mermaid.d.ts.map +1 -1
- package/dist/mermaid.js +8 -4
- package/dist/mermaid.js.map +1 -1
- package/dist/parsers.d.ts.map +1 -1
- package/dist/parsers.js.map +1 -1
- package/dist/row-document-renderable.d.ts.map +1 -1
- package/dist/row-document-renderable.js.map +1 -1
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js.map +1 -1
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js.map +1 -1
- package/package.json +6 -6
- package/src/chooser/choose-filter.tsx +1 -0
- package/src/chooser/choose-highlighted-text.tsx +2 -0
- package/src/chooser/choose-list.tsx +6 -0
- package/src/chooser/choose-store.ts +20 -3
- package/src/chooser/chooser.tsx +2 -0
- package/src/chooser/source.ts +5 -0
- package/src/chooser/use-choose.ts +44 -0
- package/src/code-blocks.tsx +14 -0
- package/src/command-palette.tsx +4 -0
- package/src/context-menu.tsx +13 -0
- package/src/index.ts +56 -1
- package/src/markdown/blocks/blockquote.tsx +2 -0
- package/src/markdown/blocks/flat-block.tsx +113 -80
- package/src/markdown/blocks/heading.tsx +1 -0
- package/src/markdown/blocks/list-line.tsx +6 -6
- package/src/markdown/blocks/paragraph.tsx +1 -0
- package/src/markdown/blocks/table.tsx +84 -49
- package/src/markdown/links.ts +69 -25
- package/src/markdown/plain-text.ts +5 -0
- package/src/markdown/table-layout.ts +156 -0
- package/src/markdown/table-links.ts +17 -25
- package/src/markdown/tokens.ts +4 -0
- package/src/markdown/visit-inline.ts +20 -0
- package/src/markdown-blocks.ts +298 -100
- package/src/markdown-images.ts +30 -9
- package/src/markdown-view.tsx +4 -1
- package/src/mermaid.ts +21 -4
- package/src/parsers.ts +39 -0
- package/src/row-document-renderable.ts +53 -0
- package/src/source.ts +18 -0
- package/src/table.tsx +32 -0
- package/dist/text-table-internals.d.ts +0 -34
- package/dist/text-table-internals.d.ts.map +0 -1
- package/dist/text-table-internals.js +0 -68
- package/dist/text-table-internals.js.map +0 -1
- package/dist/text-table.d.ts +0 -7
- package/dist/text-table.d.ts.map +0 -1
- package/dist/text-table.js +0 -4
- package/dist/text-table.js.map +0 -1
- package/src/text-table-internals.ts +0 -124
- package/src/text-table.ts +0 -10
|
@@ -71,10 +71,12 @@ const colorCache = new Map<string, RGBA>();
|
|
|
71
71
|
|
|
72
72
|
const cachedColor = function cachedColor(hex: string): RGBA {
|
|
73
73
|
let c = colorCache.get(hex);
|
|
74
|
+
|
|
74
75
|
if (!c) {
|
|
75
76
|
c = RGBA.fromHex(hex);
|
|
76
77
|
colorCache.set(hex, c);
|
|
77
78
|
}
|
|
79
|
+
|
|
78
80
|
return c;
|
|
79
81
|
};
|
|
80
82
|
|
|
@@ -93,6 +95,7 @@ const normalizeDecorationLayers = function normalizeDecorationLayers(
|
|
|
93
95
|
if (!layers || layers.length === 0) {
|
|
94
96
|
return [];
|
|
95
97
|
}
|
|
98
|
+
|
|
96
99
|
return [...layers].toSorted((a, b) => a.priority - b.priority);
|
|
97
100
|
};
|
|
98
101
|
|
|
@@ -105,6 +108,7 @@ const maxGutterNumber = function maxGutterNumber(opts: {
|
|
|
105
108
|
if (opts.rowNumbers && opts.rowNumbers.length > 0) {
|
|
106
109
|
return Math.max(...opts.rowNumbers);
|
|
107
110
|
}
|
|
111
|
+
|
|
108
112
|
return (opts.lineNumberStart ?? 1) + opts.rowCount - 1;
|
|
109
113
|
};
|
|
110
114
|
|
|
@@ -117,11 +121,14 @@ export const computeRowDocumentGutterWidth = function computeRowDocumentGutterWi
|
|
|
117
121
|
gutterPaddingRight?: number;
|
|
118
122
|
}): number {
|
|
119
123
|
let width = 0;
|
|
124
|
+
|
|
120
125
|
if (opts.showLineNumbers) {
|
|
121
126
|
width += Math.max(String(maxGutterNumber(opts)).length, 1);
|
|
122
127
|
}
|
|
128
|
+
|
|
123
129
|
width += opts.signColumnWidth ?? 0;
|
|
124
130
|
width += opts.gutterPaddingRight ?? 1;
|
|
131
|
+
|
|
125
132
|
return width;
|
|
126
133
|
};
|
|
127
134
|
|
|
@@ -248,6 +255,7 @@ export class RowDocumentRenderable extends ScrollBoxRenderable {
|
|
|
248
255
|
if (row < 0 || row >= this._rowCount) {
|
|
249
256
|
return null;
|
|
250
257
|
}
|
|
258
|
+
|
|
251
259
|
return {
|
|
252
260
|
row,
|
|
253
261
|
virtualHeight: this._rowVirtualHeights[row],
|
|
@@ -258,16 +266,20 @@ export class RowDocumentRenderable extends ScrollBoxRenderable {
|
|
|
258
266
|
getRowAtVirtualY(y: number): number {
|
|
259
267
|
const clamped = Math.max(0, Math.min(y, this._virtualRowToRow.length - 1));
|
|
260
268
|
const row = this._virtualRowToRow[clamped];
|
|
269
|
+
|
|
261
270
|
if (row >= 0) {
|
|
262
271
|
return row;
|
|
263
272
|
}
|
|
273
|
+
|
|
264
274
|
// Gap row — search backward for nearest valid row
|
|
265
275
|
for (let i = clamped - 1; i >= 0; i -= 1) {
|
|
266
276
|
const r = this._virtualRowToRow[i];
|
|
277
|
+
|
|
267
278
|
if (r >= 0) {
|
|
268
279
|
return r;
|
|
269
280
|
}
|
|
270
281
|
}
|
|
282
|
+
|
|
271
283
|
return 0;
|
|
272
284
|
}
|
|
273
285
|
|
|
@@ -285,22 +297,28 @@ export class RowDocumentRenderable extends ScrollBoxRenderable {
|
|
|
285
297
|
*/
|
|
286
298
|
getRowAtScreenY(screenY: number): number | null {
|
|
287
299
|
const localY = screenY - this.viewport.y;
|
|
300
|
+
|
|
288
301
|
if (localY < 0 || localY >= this.viewport.height) {
|
|
289
302
|
return null;
|
|
290
303
|
}
|
|
304
|
+
|
|
291
305
|
const virtualY = Math.floor(this.scrollTop) + localY;
|
|
306
|
+
|
|
292
307
|
if (virtualY < 0 || virtualY >= this._virtualRowToRow.length) {
|
|
293
308
|
return null;
|
|
294
309
|
}
|
|
310
|
+
|
|
295
311
|
if (virtualY >= this._contentVirtualEnd) {
|
|
296
312
|
return null;
|
|
297
313
|
}
|
|
314
|
+
|
|
298
315
|
return this.getRowAtVirtualY(virtualY);
|
|
299
316
|
}
|
|
300
317
|
|
|
301
318
|
getVisibleRange(): VisibleRowRange {
|
|
302
319
|
const top = Math.floor(this.scrollTop);
|
|
303
320
|
const bottom = top + this.viewport.height;
|
|
321
|
+
|
|
304
322
|
return {
|
|
305
323
|
firstRow: this.getRowAtVirtualY(top),
|
|
306
324
|
lastRow: this.getRowAtVirtualY(bottom - 1),
|
|
@@ -331,6 +349,7 @@ export class RowDocumentRenderable extends ScrollBoxRenderable {
|
|
|
331
349
|
*/
|
|
332
350
|
scrollToRow(row: number, align: RowScrollAlign = "nearest", margin = 0): void {
|
|
333
351
|
const metrics = this.getRowMetrics(row);
|
|
352
|
+
|
|
334
353
|
if (!metrics) {
|
|
335
354
|
return;
|
|
336
355
|
}
|
|
@@ -346,22 +365,27 @@ export class RowDocumentRenderable extends ScrollBoxRenderable {
|
|
|
346
365
|
target = virtualTop - gap;
|
|
347
366
|
break;
|
|
348
367
|
}
|
|
368
|
+
|
|
349
369
|
case "center": {
|
|
350
370
|
target = virtualTop - (vpHeight - virtualHeight) / 2;
|
|
351
371
|
break;
|
|
352
372
|
}
|
|
373
|
+
|
|
353
374
|
case "end": {
|
|
354
375
|
target = virtualTop + virtualHeight - vpHeight + gap;
|
|
355
376
|
break;
|
|
356
377
|
}
|
|
378
|
+
|
|
357
379
|
case "nearest": {
|
|
358
380
|
if (virtualTop - gap < this.scrollTop) {
|
|
359
381
|
target = virtualTop - gap;
|
|
360
382
|
} else if (virtualTop + virtualHeight + gap > this.scrollTop + vpHeight) {
|
|
361
383
|
target = virtualTop + virtualHeight - vpHeight + gap;
|
|
362
384
|
}
|
|
385
|
+
|
|
363
386
|
break;
|
|
364
387
|
}
|
|
388
|
+
|
|
365
389
|
default: {
|
|
366
390
|
break;
|
|
367
391
|
}
|
|
@@ -376,8 +400,10 @@ export class RowDocumentRenderable extends ScrollBoxRenderable {
|
|
|
376
400
|
// extend the scroll to include it
|
|
377
401
|
if (row + 1 === this._rowCount - 1) {
|
|
378
402
|
const next = this.getRowMetrics(row + 1);
|
|
403
|
+
|
|
379
404
|
if (next) {
|
|
380
405
|
const bottomEdge = next.virtualTop + next.virtualHeight;
|
|
406
|
+
|
|
381
407
|
if (bottomEdge > target + vpHeight) {
|
|
382
408
|
target = bottomEdge - vpHeight;
|
|
383
409
|
}
|
|
@@ -403,6 +429,7 @@ export class RowDocumentRenderable extends ScrollBoxRenderable {
|
|
|
403
429
|
|
|
404
430
|
// Paint decorations and gutter on top
|
|
405
431
|
this._paintDecorations(buffer);
|
|
432
|
+
|
|
406
433
|
if (this._showGutter) {
|
|
407
434
|
this._paintGutter(buffer);
|
|
408
435
|
}
|
|
@@ -416,20 +443,24 @@ export class RowDocumentRenderable extends ScrollBoxRenderable {
|
|
|
416
443
|
if (this._mode === "multi") {
|
|
417
444
|
return "multi";
|
|
418
445
|
}
|
|
446
|
+
|
|
419
447
|
if (this._mode === "provider") {
|
|
420
448
|
return "provider";
|
|
421
449
|
}
|
|
422
450
|
|
|
423
451
|
// Auto-detect: single child with LineInfoProvider → provider mode
|
|
424
452
|
const children = this.getChildren();
|
|
453
|
+
|
|
425
454
|
if (children.length === 1 && isRowContentProvider(children[0])) {
|
|
426
455
|
return "provider";
|
|
427
456
|
}
|
|
457
|
+
|
|
428
458
|
return "multi";
|
|
429
459
|
}
|
|
430
460
|
|
|
431
461
|
private _computeGeometry(): void {
|
|
432
462
|
const mode = this._detectMode();
|
|
463
|
+
|
|
433
464
|
if (mode === "provider") {
|
|
434
465
|
this._computeFromProvider();
|
|
435
466
|
} else {
|
|
@@ -445,6 +476,7 @@ export class RowDocumentRenderable extends ScrollBoxRenderable {
|
|
|
445
476
|
|
|
446
477
|
if (totalHeight === 0 || children.length <= offset) {
|
|
447
478
|
this._finishGeometry([], [], [], [], 0);
|
|
479
|
+
|
|
448
480
|
return;
|
|
449
481
|
}
|
|
450
482
|
|
|
@@ -465,6 +497,7 @@ export class RowDocumentRenderable extends ScrollBoxRenderable {
|
|
|
465
497
|
|
|
466
498
|
for (let r = 0; r < h; r += 1) {
|
|
467
499
|
const vRow = childStart + r;
|
|
500
|
+
|
|
468
501
|
if (vRow >= 0 && vRow < totalHeight) {
|
|
469
502
|
virtualRowToRow[vRow] = row;
|
|
470
503
|
virtualRowWraps[vRow] = r === 0 ? 0 : 1;
|
|
@@ -483,11 +516,13 @@ export class RowDocumentRenderable extends ScrollBoxRenderable {
|
|
|
483
516
|
|
|
484
517
|
private _computeFromProvider(): void {
|
|
485
518
|
const children = this.getChildren();
|
|
519
|
+
|
|
486
520
|
if (children.length === 0) {
|
|
487
521
|
return;
|
|
488
522
|
}
|
|
489
523
|
|
|
490
524
|
const [provider] = children;
|
|
525
|
+
|
|
491
526
|
if (!isRowContentProvider(provider)) {
|
|
492
527
|
return;
|
|
493
528
|
}
|
|
@@ -513,6 +548,7 @@ export class RowDocumentRenderable extends ScrollBoxRenderable {
|
|
|
513
548
|
if (currentRow >= 0) {
|
|
514
549
|
rowVirtualHeights[currentRow] = v - rowVirtualStarts[currentRow];
|
|
515
550
|
}
|
|
551
|
+
|
|
516
552
|
rowVirtualStarts[row] = v;
|
|
517
553
|
currentRow = row;
|
|
518
554
|
rowCount = Math.max(rowCount, row + 1);
|
|
@@ -541,16 +577,20 @@ export class RowDocumentRenderable extends ScrollBoxRenderable {
|
|
|
541
577
|
rowCount: number
|
|
542
578
|
): void {
|
|
543
579
|
let contentVirtualEnd = 0;
|
|
580
|
+
|
|
544
581
|
for (let row = 0; row < rowCount; row += 1) {
|
|
545
582
|
const end = rowVirtualStarts[row] + rowVirtualHeights[row];
|
|
583
|
+
|
|
546
584
|
if (end > contentVirtualEnd) {
|
|
547
585
|
contentVirtualEnd = end;
|
|
548
586
|
}
|
|
549
587
|
}
|
|
588
|
+
|
|
550
589
|
this._contentVirtualEnd = contentVirtualEnd;
|
|
551
590
|
|
|
552
591
|
// Change detection via hash
|
|
553
592
|
const hash = rowVirtualStarts.join(",");
|
|
593
|
+
|
|
554
594
|
if (hash !== this._lastGeometryHash) {
|
|
555
595
|
this._rowVirtualStarts = rowVirtualStarts;
|
|
556
596
|
this._rowVirtualHeights = rowVirtualHeights;
|
|
@@ -614,9 +654,11 @@ export class RowDocumentRenderable extends ScrollBoxRenderable {
|
|
|
614
654
|
if (deco.background !== undefined && deco.background !== "") {
|
|
615
655
|
rowBgs.set(deco.row, deco.background);
|
|
616
656
|
}
|
|
657
|
+
|
|
617
658
|
if (deco.gutterBackground !== undefined && deco.gutterBackground !== "") {
|
|
618
659
|
rowGutterBgs.set(deco.row, deco.gutterBackground);
|
|
619
660
|
}
|
|
661
|
+
|
|
620
662
|
if (deco.sign) {
|
|
621
663
|
rowSigns.set(deco.row, deco.sign);
|
|
622
664
|
}
|
|
@@ -625,18 +667,23 @@ export class RowDocumentRenderable extends ScrollBoxRenderable {
|
|
|
625
667
|
|
|
626
668
|
for (let screenY = 0; screenY < vpHeight; screenY += 1) {
|
|
627
669
|
const vRow = top + screenY;
|
|
670
|
+
|
|
628
671
|
if (vRow >= this._virtualRowToRow.length) {
|
|
629
672
|
break;
|
|
630
673
|
}
|
|
631
674
|
|
|
632
675
|
const row = this._virtualRowToRow[vRow];
|
|
676
|
+
|
|
633
677
|
if (row < 0) {
|
|
634
678
|
continue;
|
|
635
679
|
}
|
|
680
|
+
|
|
636
681
|
const bg = rowBgs.get(row);
|
|
682
|
+
|
|
637
683
|
if (bg === undefined || bg === "") {
|
|
638
684
|
continue;
|
|
639
685
|
}
|
|
686
|
+
|
|
640
687
|
buffer.fillRect(vpX, vpY + screenY, vpWidth, 1, cachedColor(bg));
|
|
641
688
|
}
|
|
642
689
|
|
|
@@ -650,6 +697,7 @@ export class RowDocumentRenderable extends ScrollBoxRenderable {
|
|
|
650
697
|
|
|
651
698
|
private _paintGutter(buffer: OptimizedBuffer): void {
|
|
652
699
|
const gutterWidth = this._computeGutterWidth();
|
|
700
|
+
|
|
653
701
|
if (gutterWidth === 0) {
|
|
654
702
|
return;
|
|
655
703
|
}
|
|
@@ -680,14 +728,17 @@ export class RowDocumentRenderable extends ScrollBoxRenderable {
|
|
|
680
728
|
|
|
681
729
|
for (let screenY = 0; screenY < vpHeight; screenY += 1) {
|
|
682
730
|
const vRow = top + screenY;
|
|
731
|
+
|
|
683
732
|
if (vRow >= this._virtualRowToRow.length) {
|
|
684
733
|
break;
|
|
685
734
|
}
|
|
686
735
|
|
|
687
736
|
const row = this._virtualRowToRow[vRow];
|
|
737
|
+
|
|
688
738
|
if (row < 0) {
|
|
689
739
|
continue;
|
|
690
740
|
}
|
|
741
|
+
|
|
691
742
|
const isFirstLine = this._virtualRowWraps[vRow] === 0;
|
|
692
743
|
|
|
693
744
|
if (!isFirstLine) {
|
|
@@ -698,8 +749,10 @@ export class RowDocumentRenderable extends ScrollBoxRenderable {
|
|
|
698
749
|
let col = 0;
|
|
699
750
|
|
|
700
751
|
const rowGutterHex = this._layerGutterBgs.get(row);
|
|
752
|
+
|
|
701
753
|
const effectiveGutterBg =
|
|
702
754
|
rowGutterHex !== undefined && rowGutterHex !== "" ? cachedColor(rowGutterHex) : gutterBg;
|
|
755
|
+
|
|
703
756
|
if (rowGutterHex !== undefined && rowGutterHex !== "") {
|
|
704
757
|
buffer.fillRect(drawX, vpY + screenY, gutterWidth, 1, effectiveGutterBg);
|
|
705
758
|
}
|
package/src/source.ts
CHANGED
|
@@ -56,16 +56,19 @@ export interface DocumentRowAnchor<T> {
|
|
|
56
56
|
// ---------------------------------------------------------------------------
|
|
57
57
|
|
|
58
58
|
const LINE_FEED_CODE = 10;
|
|
59
|
+
|
|
59
60
|
const CARRIAGE_RETURN_CODE = 13;
|
|
60
61
|
|
|
61
62
|
/** Offsets of the first character of every physical line. */
|
|
62
63
|
const buildLineStarts = function buildLineStarts(text: string): number[] {
|
|
63
64
|
const starts = [0];
|
|
65
|
+
|
|
64
66
|
for (let i = 0; i < text.length; i += 1) {
|
|
65
67
|
if (text.codePointAt(i) === LINE_FEED_CODE) {
|
|
66
68
|
starts.push(i + 1);
|
|
67
69
|
}
|
|
68
70
|
}
|
|
71
|
+
|
|
69
72
|
return starts;
|
|
70
73
|
};
|
|
71
74
|
|
|
@@ -90,19 +93,23 @@ export class SourceIndex {
|
|
|
90
93
|
const starts = this.lineStarts;
|
|
91
94
|
let lo = 0;
|
|
92
95
|
let hi = starts.length - 1;
|
|
96
|
+
|
|
93
97
|
while (lo < hi) {
|
|
94
98
|
const mid = Math.floor((lo + hi + 1) / 2);
|
|
99
|
+
|
|
95
100
|
if (starts[mid] <= offset) {
|
|
96
101
|
lo = mid;
|
|
97
102
|
} else {
|
|
98
103
|
hi = mid - 1;
|
|
99
104
|
}
|
|
100
105
|
}
|
|
106
|
+
|
|
101
107
|
return lo;
|
|
102
108
|
}
|
|
103
109
|
|
|
104
110
|
point(offset: number): SourcePoint {
|
|
105
111
|
const line = this.lineAt(offset);
|
|
112
|
+
|
|
106
113
|
return { column: offset - this.lineStarts[line], line, offset };
|
|
107
114
|
}
|
|
108
115
|
|
|
@@ -111,12 +118,15 @@ export class SourceIndex {
|
|
|
111
118
|
const starts = this.lineStarts;
|
|
112
119
|
const nextStart = line + 1 < starts.length ? starts[line + 1] : this.text.length;
|
|
113
120
|
let end = nextStart;
|
|
121
|
+
|
|
114
122
|
if (end > starts[line] && this.text.codePointAt(end - 1) === LINE_FEED_CODE) {
|
|
115
123
|
end -= 1;
|
|
124
|
+
|
|
116
125
|
if (end > starts[line] && this.text.codePointAt(end - 1) === CARRIAGE_RETURN_CODE) {
|
|
117
126
|
end -= 1;
|
|
118
127
|
}
|
|
119
128
|
}
|
|
129
|
+
|
|
120
130
|
return end;
|
|
121
131
|
}
|
|
122
132
|
|
|
@@ -128,14 +138,17 @@ export class SourceIndex {
|
|
|
128
138
|
*/
|
|
129
139
|
span(rawStart: number, rawEnd: number, trimTrailingNewlines = true): SourceSpan {
|
|
130
140
|
let end = rawEnd;
|
|
141
|
+
|
|
131
142
|
if (trimTrailingNewlines) {
|
|
132
143
|
while (end > rawStart && this.text.codePointAt(end - 1) === 10) {
|
|
133
144
|
end -= 1;
|
|
145
|
+
|
|
134
146
|
if (end > rawStart && this.text.codePointAt(end - 1) === 13) {
|
|
135
147
|
end -= 1;
|
|
136
148
|
}
|
|
137
149
|
}
|
|
138
150
|
}
|
|
151
|
+
|
|
139
152
|
if (end < rawStart) {
|
|
140
153
|
end = rawStart;
|
|
141
154
|
}
|
|
@@ -143,6 +156,7 @@ export class SourceIndex {
|
|
|
143
156
|
const start = this.point(rawStart);
|
|
144
157
|
const endPoint = this.point(end);
|
|
145
158
|
const lastLine = end > rawStart ? this.lineAt(end - 1) : start.line;
|
|
159
|
+
|
|
146
160
|
const span: SourceSpan = {
|
|
147
161
|
end: endPoint,
|
|
148
162
|
lastLine,
|
|
@@ -150,9 +164,11 @@ export class SourceIndex {
|
|
|
150
164
|
start,
|
|
151
165
|
text: this.text.slice(rawStart, end),
|
|
152
166
|
};
|
|
167
|
+
|
|
153
168
|
if (this.sourceId !== undefined) {
|
|
154
169
|
span.sourceId = this.sourceId;
|
|
155
170
|
}
|
|
171
|
+
|
|
156
172
|
return span;
|
|
157
173
|
}
|
|
158
174
|
}
|
|
@@ -179,6 +195,7 @@ export const sourceLines = function sourceLines(
|
|
|
179
195
|
): SourceLineRow[] {
|
|
180
196
|
const index = new SourceIndex(source, options?.sourceId);
|
|
181
197
|
const rows: SourceLineRow[] = [];
|
|
198
|
+
|
|
182
199
|
for (let line = 0; line < index.lineStarts.length; line += 1) {
|
|
183
200
|
const start = index.lineStarts[line];
|
|
184
201
|
const end = index.lineContentEnd(line);
|
|
@@ -187,6 +204,7 @@ export const sourceLines = function sourceLines(
|
|
|
187
204
|
text: source.slice(start, end),
|
|
188
205
|
});
|
|
189
206
|
}
|
|
207
|
+
|
|
190
208
|
return rows;
|
|
191
209
|
};
|
|
192
210
|
|
package/src/table.tsx
CHANGED
|
@@ -38,9 +38,13 @@ export interface TableProps {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
const PADDING = 1;
|
|
41
|
+
|
|
41
42
|
const TABLE_MARGIN = 1;
|
|
43
|
+
|
|
42
44
|
const DEFAULT_MIN_COL_WIDTH = 4;
|
|
45
|
+
|
|
43
46
|
const DEFAULT_MAX_COL_WIDTH = 80;
|
|
47
|
+
|
|
44
48
|
const DEFAULT_SAMPLE_SIZE = 100;
|
|
45
49
|
|
|
46
50
|
const isNumeric = function isNumeric(value: string): boolean {
|
|
@@ -58,12 +62,15 @@ const sampleRows = function sampleRows(rows: string[][], sampleSize: number): st
|
|
|
58
62
|
if (rows.length <= sampleSize) {
|
|
59
63
|
return rows;
|
|
60
64
|
}
|
|
65
|
+
|
|
61
66
|
// Sample evenly distributed rows for representative widths
|
|
62
67
|
const step = rows.length / sampleSize;
|
|
63
68
|
const sampled: string[][] = [];
|
|
69
|
+
|
|
64
70
|
for (let i = 0; i < sampleSize; i += 1) {
|
|
65
71
|
sampled.push(rows[Math.floor(i * step)]);
|
|
66
72
|
}
|
|
73
|
+
|
|
67
74
|
return sampled;
|
|
68
75
|
};
|
|
69
76
|
|
|
@@ -85,15 +92,18 @@ const computeColumnWidths = function computeColumnWidths(
|
|
|
85
92
|
const headerLen = Bun.stringWidth(header);
|
|
86
93
|
let maxRowLen = 0;
|
|
87
94
|
const sampledRowCount = sampledRows.length;
|
|
95
|
+
|
|
88
96
|
for (let rowIndex = 0; rowIndex < sampledRowCount; rowIndex += 1) {
|
|
89
97
|
if (rowIndex in sampledRows) {
|
|
90
98
|
const row = sampledRows[rowIndex];
|
|
91
99
|
maxRowLen = Math.max(maxRowLen, Bun.stringWidth(row[col] ?? ""));
|
|
92
100
|
}
|
|
93
101
|
}
|
|
102
|
+
|
|
94
103
|
const contentWidth = Math.max(headerLen, maxRowLen);
|
|
95
104
|
// Apply min/max constraints before adding padding
|
|
96
105
|
const constrainedWidth = Math.min(maxColumnWidth, Math.max(minColumnWidth, contentWidth));
|
|
106
|
+
|
|
97
107
|
return constrainedWidth + PADDING * 2;
|
|
98
108
|
});
|
|
99
109
|
|
|
@@ -106,8 +116,10 @@ const computeColumnWidths = function computeColumnWidths(
|
|
|
106
116
|
const extra = maxWidth - totalNatural;
|
|
107
117
|
const perCol = Math.floor(extra / colCount);
|
|
108
118
|
const remainder = extra - perCol * colCount;
|
|
119
|
+
|
|
109
120
|
return naturalWidths.map((w, i) => w + perCol + (i < remainder ? 1 : 0));
|
|
110
121
|
}
|
|
122
|
+
|
|
111
123
|
return naturalWidths;
|
|
112
124
|
}
|
|
113
125
|
|
|
@@ -130,6 +142,7 @@ const computeColumnWidths = function computeColumnWidths(
|
|
|
130
142
|
if (longTotal === 0 || remaining <= 0) {
|
|
131
143
|
// All compact or no space left -- distribute evenly
|
|
132
144
|
const total = naturalWidths.reduce((a, b) => a + b, 0);
|
|
145
|
+
|
|
133
146
|
return naturalWidths.map((w) =>
|
|
134
147
|
Math.max(minColWidthWithPadding, Math.floor((w / total) * available))
|
|
135
148
|
);
|
|
@@ -139,6 +152,7 @@ const computeColumnWidths = function computeColumnWidths(
|
|
|
139
152
|
if (compact[i]) {
|
|
140
153
|
return w;
|
|
141
154
|
}
|
|
155
|
+
|
|
142
156
|
return Math.max(minColWidthWithPadding, Math.floor((w / longTotal) * remaining));
|
|
143
157
|
});
|
|
144
158
|
};
|
|
@@ -148,36 +162,46 @@ export const formatTableCell = function formatTableCell(value: TableRow[string])
|
|
|
148
162
|
if (value === null || value === undefined) {
|
|
149
163
|
return "";
|
|
150
164
|
}
|
|
165
|
+
|
|
151
166
|
if (value instanceof Date) {
|
|
152
167
|
return value.toISOString();
|
|
153
168
|
}
|
|
169
|
+
|
|
154
170
|
const valueTag = Object.prototype.toString.call(value);
|
|
171
|
+
|
|
155
172
|
switch (valueTag) {
|
|
156
173
|
case "[object String]": {
|
|
157
174
|
return String.prototype.toString.call(value);
|
|
158
175
|
}
|
|
176
|
+
|
|
159
177
|
case "[object Number]": {
|
|
160
178
|
return Number.prototype.toString.call(value);
|
|
161
179
|
}
|
|
180
|
+
|
|
162
181
|
case "[object BigInt]": {
|
|
163
182
|
return BigInt.prototype.toString.call(value);
|
|
164
183
|
}
|
|
184
|
+
|
|
165
185
|
case "[object Boolean]": {
|
|
166
186
|
return Boolean.prototype.toString.call(value);
|
|
167
187
|
}
|
|
188
|
+
|
|
168
189
|
case "[object Symbol]": {
|
|
169
190
|
return Symbol.prototype.toString.call(value);
|
|
170
191
|
}
|
|
192
|
+
|
|
171
193
|
case "[object Function]":
|
|
172
194
|
case "[object AsyncFunction]":
|
|
173
195
|
case "[object GeneratorFunction]":
|
|
174
196
|
case "[object AsyncGeneratorFunction]": {
|
|
175
197
|
return Function.prototype.toString.call(value);
|
|
176
198
|
}
|
|
199
|
+
|
|
177
200
|
default: {
|
|
178
201
|
break;
|
|
179
202
|
}
|
|
180
203
|
}
|
|
204
|
+
|
|
181
205
|
try {
|
|
182
206
|
return JSON.stringify(value);
|
|
183
207
|
} catch {
|
|
@@ -212,12 +236,14 @@ export const Table = function Table({
|
|
|
212
236
|
}),
|
|
213
237
|
[showLineNumbers, rows.length]
|
|
214
238
|
);
|
|
239
|
+
|
|
215
240
|
const effectiveMaxWidth = Math.max(
|
|
216
241
|
0,
|
|
217
242
|
(maxWidth ?? terminalWidth) - TABLE_MARGIN * 2 - gutterWidth
|
|
218
243
|
);
|
|
219
244
|
|
|
220
245
|
const headers = useMemo(() => columns.map((column) => column.header ?? column.key), [columns]);
|
|
246
|
+
|
|
221
247
|
const normalizedRows = useMemo(
|
|
222
248
|
() => rows.map((row) => columns.map((column) => formatTableCell(row[column.key]))),
|
|
223
249
|
[columns, rows]
|
|
@@ -249,11 +275,14 @@ export const Table = function Table({
|
|
|
249
275
|
if (column.align === "right") {
|
|
250
276
|
return true;
|
|
251
277
|
}
|
|
278
|
+
|
|
252
279
|
if (column.align === "left") {
|
|
253
280
|
return false;
|
|
254
281
|
}
|
|
282
|
+
|
|
255
283
|
const sampleValues = normalizedRows.slice(0, 10).map((row) => row[colIdx] ?? "");
|
|
256
284
|
const numericCount = sampleValues.filter(isNumeric).length;
|
|
285
|
+
|
|
257
286
|
return numericCount > sampleValues.length / 2;
|
|
258
287
|
}),
|
|
259
288
|
[columns, normalizedRows]
|
|
@@ -266,10 +295,12 @@ export const Table = function Table({
|
|
|
266
295
|
{row.map((cell, j): ReactNode => {
|
|
267
296
|
const contentWidth = colWidths[j] - PADDING * 2;
|
|
268
297
|
const cellWidth = Bun.stringWidth(cell);
|
|
298
|
+
|
|
269
299
|
const displayCell =
|
|
270
300
|
alignments[j] && cellWidth <= contentWidth
|
|
271
301
|
? " ".repeat(contentWidth - cellWidth) + cell
|
|
272
302
|
: cell;
|
|
303
|
+
|
|
273
304
|
return (
|
|
274
305
|
<text
|
|
275
306
|
key={j}
|
|
@@ -344,4 +375,5 @@ export const Table = function Table({
|
|
|
344
375
|
|
|
345
376
|
// Exported for testing and MarkdownView
|
|
346
377
|
export { computeColumnWidths, isNumeric, sampleRows };
|
|
378
|
+
|
|
347
379
|
export type { ColumnWidthOptions };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { TextBufferView } from "@opentui/core";
|
|
2
|
-
import type { Renderable } from "@opentui/core";
|
|
3
|
-
interface TextTableInternals {
|
|
4
|
-
readonly cellPaddingX: number;
|
|
5
|
-
readonly cellPaddingY: number;
|
|
6
|
-
readonly _layout: {
|
|
7
|
-
readonly columnOffsets: readonly number[];
|
|
8
|
-
readonly columnWidths: readonly number[];
|
|
9
|
-
readonly rowHeights: readonly number[];
|
|
10
|
-
readonly rowOffsets: readonly number[];
|
|
11
|
-
};
|
|
12
|
-
readonly _cells: readonly (readonly ({
|
|
13
|
-
readonly textBufferView: TextBufferView;
|
|
14
|
-
} | undefined)[])[];
|
|
15
|
-
}
|
|
16
|
-
/** Private `TextTableRenderable` members that the cell hit test reads. */
|
|
17
|
-
export declare const hasTextTableInternals: (table: Renderable) => table is Renderable & TextTableInternals;
|
|
18
|
-
/** A pointer position inside one table cell, in the cell's own text coordinates. */
|
|
19
|
-
export interface TextTableCellHit {
|
|
20
|
-
row: number;
|
|
21
|
-
column: number;
|
|
22
|
-
/** Logical line inside the cell text. */
|
|
23
|
-
line: number;
|
|
24
|
-
/** Display column inside that logical line. */
|
|
25
|
-
offset: number;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Map a screen position to a cell of a rendered text table and to a text position in that cell.
|
|
29
|
-
* Wrapped cells map each visual line back to its logical line. Returns null for borders, padding,
|
|
30
|
-
* and blank space after the text on a line.
|
|
31
|
-
*/
|
|
32
|
-
export declare const textTableCellAt: (table: Renderable, x: number, y: number) => TextTableCellHit | null;
|
|
33
|
-
export {};
|
|
34
|
-
//# sourceMappingURL=text-table-internals.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text-table-internals.d.ts","sourceRoot":"","sources":["../src/text-table-internals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAUhD,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;QAC1C,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;QACzC,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;QACvC,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;KACxC,CAAC;IACF,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,SAAS,CAChC;QAAE,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAA;KAAE,GAC3C,SAAS,CACZ,EAAE,CAAC,EAAE,CAAC;CACR;AAED,0EAA0E;AAC1E,eAAO,MAAM,qBAAqB,UACzB,UAAU,KAChB,KAAK,IAAI,UAAU,GAAG,kBAqBxB,CAAC;AA2BF,oFAAoF;AACpF,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,UACnB,UAAU,KACd,MAAM,KACN,MAAM,KACR,gBAAgB,GAAG,IA2BrB,CAAC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { TextBufferView } from "@opentui/core";
|
|
2
|
-
/** Private `TextTableRenderable` members that the cell hit test reads. */
|
|
3
|
-
export const hasTextTableInternals = function hasTextTableInternals(table) {
|
|
4
|
-
if (!("_layout" in table && "_cells" in table && "cellPaddingX" in table && "cellPaddingY" in table)) {
|
|
5
|
-
return false;
|
|
6
|
-
}
|
|
7
|
-
const { _layout: layout } = table;
|
|
8
|
-
return (Array.isArray(table._cells) &&
|
|
9
|
-
Number.isInteger(table.cellPaddingX) &&
|
|
10
|
-
Number.isInteger(table.cellPaddingY) &&
|
|
11
|
-
layout instanceof Object &&
|
|
12
|
-
"columnOffsets" in layout &&
|
|
13
|
-
"columnWidths" in layout &&
|
|
14
|
-
"rowHeights" in layout &&
|
|
15
|
-
"rowOffsets" in layout &&
|
|
16
|
-
Array.isArray(layout.columnOffsets) &&
|
|
17
|
-
Array.isArray(layout.columnWidths) &&
|
|
18
|
-
Array.isArray(layout.rowHeights) &&
|
|
19
|
-
Array.isArray(layout.rowOffsets));
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Find the row or column that holds a local coordinate. Each offset marks the border or gap
|
|
23
|
-
* before its span, so the span starts one cell later. This matches OpenTUI's own private
|
|
24
|
-
* `getCellAtLocalPosition`.
|
|
25
|
-
*/
|
|
26
|
-
const spanAt = function spanAt(offsets, sizes, local) {
|
|
27
|
-
for (const [index, size] of sizes.entries()) {
|
|
28
|
-
const inside = local - (offsets[index] ?? 0) - 1;
|
|
29
|
-
if (inside >= 0 && inside < size) {
|
|
30
|
-
return { index, inside };
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return null;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Map a screen position to a cell of a rendered text table and to a text position in that cell.
|
|
37
|
-
* Wrapped cells map each visual line back to its logical line. Returns null for borders, padding,
|
|
38
|
-
* and blank space after the text on a line.
|
|
39
|
-
*/
|
|
40
|
-
export const textTableCellAt = function textTableCellAt(table, x, y) {
|
|
41
|
-
if (!hasTextTableInternals(table)) {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
const { columnOffsets, columnWidths, rowHeights, rowOffsets } = table._layout;
|
|
45
|
-
const row = spanAt(rowOffsets, rowHeights, y - table.y);
|
|
46
|
-
const column = spanAt(columnOffsets, columnWidths, x - table.x);
|
|
47
|
-
if (row === null || column === null) {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
const view = table._cells[row.index]?.[column.index]?.textBufferView;
|
|
51
|
-
if (!(view instanceof TextBufferView)) {
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
const cellX = column.inside - table.cellPaddingX;
|
|
55
|
-
const visualLine = row.inside - table.cellPaddingY;
|
|
56
|
-
const { lineSources, lineStartCols, lineWidthCols } = view.lineInfo;
|
|
57
|
-
const line = lineSources[visualLine];
|
|
58
|
-
const start = lineStartCols[visualLine];
|
|
59
|
-
const width = lineWidthCols[visualLine];
|
|
60
|
-
if (line === undefined || start === undefined || width === undefined) {
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
if (cellX < 0 || cellX >= width) {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
return { column: column.index, line, offset: start + cellX, row: row.index };
|
|
67
|
-
};
|
|
68
|
-
//# sourceMappingURL=text-table-internals.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text-table-internals.js","sourceRoot":"","sources":["../src/text-table-internals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AA0B/C,0EAA0E;AAC1E,MAAM,CAAC,MAAM,qBAAqB,GAAG,SAAS,qBAAqB,CACjE,KAAiB;IAEjB,IACE,CAAC,CAAC,SAAS,IAAI,KAAK,IAAI,QAAQ,IAAI,KAAK,IAAI,cAAc,IAAI,KAAK,IAAI,cAAc,IAAI,KAAK,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