@opentui/core 0.1.82 → 0.1.83

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/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "type": "module",
7
- "version": "0.1.82",
7
+ "version": "0.1.83",
8
8
  "description": "OpenTUI is a TypeScript library on a native Zig core for building terminal user interfaces (TUIs)",
9
9
  "license": "MIT",
10
10
  "repository": {
@@ -57,11 +57,11 @@
57
57
  "bun-webgpu": "0.1.5",
58
58
  "planck": "^1.4.2",
59
59
  "three": "0.177.0",
60
- "@opentui/core-darwin-x64": "0.1.82",
61
- "@opentui/core-darwin-arm64": "0.1.82",
62
- "@opentui/core-linux-x64": "0.1.82",
63
- "@opentui/core-linux-arm64": "0.1.82",
64
- "@opentui/core-win32-x64": "0.1.82",
65
- "@opentui/core-win32-arm64": "0.1.82"
60
+ "@opentui/core-darwin-x64": "0.1.83",
61
+ "@opentui/core-darwin-arm64": "0.1.83",
62
+ "@opentui/core-linux-x64": "0.1.83",
63
+ "@opentui/core-linux-arm64": "0.1.83",
64
+ "@opentui/core-win32-x64": "0.1.83",
65
+ "@opentui/core-win32-arm64": "0.1.83"
66
66
  }
67
67
  }
@@ -1,11 +1,49 @@
1
1
  import { Renderable, type RenderableOptions } from "../Renderable";
2
2
  import { type RenderContext } from "../types";
3
3
  import { SyntaxStyle } from "../syntax-style";
4
+ import type { BorderStyle } from "../lib/border";
5
+ import type { ColorInput } from "../lib/RGBA";
4
6
  import { type MarkedToken, type Token } from "marked";
5
- import { type TextTableContent } from "./TextTable";
7
+ import { type TextTableColumnWidthMode, type TextTableContent } from "./TextTable";
6
8
  import type { TreeSitterClient } from "../lib/tree-sitter";
7
9
  import { type ParseState } from "./markdown-parser";
8
10
  import type { OptimizedBuffer } from "../buffer";
11
+ export interface MarkdownTableOptions {
12
+ /**
13
+ * Strategy for sizing table columns.
14
+ * - "content": columns fit to intrinsic content width.
15
+ * - "fill": columns expand to fill available width.
16
+ */
17
+ widthMode?: TextTableColumnWidthMode;
18
+ /**
19
+ * Wrapping strategy for table cell content.
20
+ */
21
+ wrapMode?: "none" | "char" | "word";
22
+ /**
23
+ * Padding applied on all sides of each table cell.
24
+ */
25
+ cellPadding?: number;
26
+ /**
27
+ * Enables/disables table border rendering.
28
+ */
29
+ borders?: boolean;
30
+ /**
31
+ * Overrides outer border visibility. Defaults to `borders`.
32
+ */
33
+ outerBorder?: boolean;
34
+ /**
35
+ * Border style for markdown tables.
36
+ */
37
+ borderStyle?: BorderStyle;
38
+ /**
39
+ * Border color for markdown tables. Defaults to conceal style color.
40
+ */
41
+ borderColor?: ColorInput;
42
+ /**
43
+ * Enables/disables selection support on markdown tables.
44
+ */
45
+ selectable?: boolean;
46
+ }
9
47
  export interface MarkdownOptions extends RenderableOptions<MarkdownRenderable> {
10
48
  content?: string;
11
49
  syntaxStyle: SyntaxStyle;
@@ -16,6 +54,10 @@ export interface MarkdownOptions extends RenderableOptions<MarkdownRenderable> {
16
54
  * When true, trailing tokens are kept unstable to handle incomplete content.
17
55
  */
18
56
  streaming?: boolean;
57
+ /**
58
+ * Options for internally rendered markdown tables.
59
+ */
60
+ tableOptions?: MarkdownTableOptions;
19
61
  /**
20
62
  * Custom node renderer. Return a Renderable to override default rendering,
21
63
  * or undefined/null to use default rendering.
@@ -45,6 +87,7 @@ export declare class MarkdownRenderable extends Renderable {
45
87
  private _syntaxStyle;
46
88
  private _conceal;
47
89
  private _treeSitterClient?;
90
+ private _tableOptions?;
48
91
  private _renderNode?;
49
92
  _parseState: ParseState | null;
50
93
  private _streaming;
@@ -64,6 +107,8 @@ export declare class MarkdownRenderable extends Renderable {
64
107
  set conceal(value: boolean);
65
108
  get streaming(): boolean;
66
109
  set streaming(value: boolean);
110
+ get tableOptions(): MarkdownTableOptions | undefined;
111
+ set tableOptions(value: MarkdownTableOptions | undefined);
67
112
  private getStyle;
68
113
  private createChunk;
69
114
  private createDefaultChunk;
@@ -85,6 +130,9 @@ export declare class MarkdownRenderable extends Renderable {
85
130
  private createTableDataCellChunks;
86
131
  private createTableHeaderCellChunks;
87
132
  private buildTableContentCache;
133
+ private resolveTableRenderableOptions;
134
+ private applyTableRenderableOptions;
135
+ private applyTableOptionsToBlocks;
88
136
  private createTextTableRenderable;
89
137
  private createTableBlock;
90
138
  private createDefaultRenderable;
@@ -46,6 +46,7 @@ export declare class TextTableRenderable extends Renderable {
46
46
  private _selectionBg;
47
47
  private _selectionFg;
48
48
  private _lastLocalSelection;
49
+ private _lastSelectionMode;
49
50
  private _cells;
50
51
  private _prevCellContent;
51
52
  private _rowCount;
@@ -111,6 +112,9 @@ export declare class TextTableRenderable extends Renderable {
111
112
  private ensureLayoutReady;
112
113
  private getCellAtLocalPosition;
113
114
  private applySelectionToCells;
115
+ private resolveSelectionResolution;
116
+ private getColumnAtLocalX;
117
+ private getFullCellSelectionCoords;
114
118
  private findRowForLocalY;
115
119
  private getSelectionRowRange;
116
120
  private getDirtySelectionRowRange;
package/testing.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  CliRenderer,
5
5
  TreeSitterClient,
6
6
  resolveRenderLib
7
- } from "./index-fv58mb45.js";
7
+ } from "./index-a215gqtt.js";
8
8
 
9
9
  // src/testing/test-renderer.ts
10
10
  import { Readable } from "stream";