@opentui/core 0.3.2 → 0.3.4

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.
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  createRuntimePlugin
4
- } from "./index-m0bc6bw1.js";
4
+ } from "./index-r49y8kdq.js";
5
5
 
6
6
  // src/runtime-plugin-support-configure.ts
7
7
  var {plugin: registerBunPlugin } = globalThis.Bun;
@@ -41,4 +41,4 @@ function ensureRuntimePluginSupport(options = {}) {
41
41
  export { ensureRuntimePluginSupport };
42
42
 
43
43
  //# debugId=09C0597CB92E654F64756E2164756E21
44
- //# sourceMappingURL=index-vdnak5x1.js.map
44
+ //# sourceMappingURL=index-8t841rbx.js.map
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  exports_src
4
- } from "./index-3mx8q5t1.js";
4
+ } from "./index-0nvgrgam.js";
5
5
  import {
6
6
  __require
7
- } from "./index-218h9p3f.js";
7
+ } from "./index-54s7pk0d.js";
8
8
 
9
9
  // src/runtime-plugin.ts
10
10
  import { existsSync, readFileSync, realpathSync } from "fs";
@@ -418,4 +418,4 @@ function createRuntimePlugin(input = {}) {
418
418
  export { isCoreRuntimeModuleSpecifier, runtimeModuleIdForSpecifier, createRuntimePlugin };
419
419
 
420
420
  //# debugId=4F4ECA92927B118964756E2164756E21
421
- //# sourceMappingURL=index-m0bc6bw1.js.map
421
+ //# sourceMappingURL=index-r49y8kdq.js.map
package/index.js CHANGED
@@ -72,7 +72,7 @@ import {
72
72
  resolveCoreSlot,
73
73
  setupAudio,
74
74
  vstyles
75
- } from "./index-3mx8q5t1.js";
75
+ } from "./index-0nvgrgam.js";
76
76
  import {
77
77
  ASCIIFontSelectionHelper,
78
78
  ATTRIBUTE_BASE_BITS,
@@ -247,7 +247,7 @@ import {
247
247
  white,
248
248
  wrapWithDelegates,
249
249
  yellow
250
- } from "./index-218h9p3f.js";
250
+ } from "./index-54s7pk0d.js";
251
251
  export {
252
252
  yellow,
253
253
  wrapWithDelegates,
@@ -1,5 +1,4 @@
1
- import type { Pointer } from "../platform/ffi.js";
2
- import type { RenderLib } from "../zig.js";
1
+ import type { RendererHandle, RenderLib } from "../zig.js";
3
2
  export declare enum ClipboardTarget {
4
3
  Clipboard = 0,
5
4
  Primary = 1,
@@ -10,7 +9,7 @@ export declare function encodeOsc52Payload(text: string, encoder?: TextEncoder):
10
9
  export declare class Clipboard {
11
10
  private lib;
12
11
  private rendererPtr;
13
- constructor(lib: RenderLib, rendererPtr: Pointer);
12
+ constructor(lib: RenderLib, rendererPtr: RendererHandle);
14
13
  copyToClipboardOSC52(text: string, target?: ClipboardTarget): boolean;
15
14
  clearClipboardOSC52(target?: ClipboardTarget): boolean;
16
15
  isOsc52Supported(): boolean;
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.3.2",
7
+ "version": "0.3.4",
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": {
@@ -69,13 +69,13 @@
69
69
  "web-tree-sitter": "0.25.10"
70
70
  },
71
71
  "optionalDependencies": {
72
- "@opentui/core-darwin-x64": "0.3.2",
73
- "@opentui/core-darwin-arm64": "0.3.2",
74
- "@opentui/core-linux-x64": "0.3.2",
75
- "@opentui/core-linux-arm64": "0.3.2",
76
- "@opentui/core-win32-x64": "0.3.2",
77
- "@opentui/core-win32-arm64": "0.3.2",
78
- "@opentui/core-linux-x64-musl": "0.3.2",
79
- "@opentui/core-linux-arm64-musl": "0.3.2"
72
+ "@opentui/core-darwin-x64": "0.3.4",
73
+ "@opentui/core-darwin-arm64": "0.3.4",
74
+ "@opentui/core-linux-x64": "0.3.4",
75
+ "@opentui/core-linux-arm64": "0.3.4",
76
+ "@opentui/core-win32-x64": "0.3.4",
77
+ "@opentui/core-win32-arm64": "0.3.4",
78
+ "@opentui/core-linux-x64-musl": "0.3.4",
79
+ "@opentui/core-linux-arm64-musl": "0.3.4"
80
80
  }
81
81
  }
@@ -11,6 +11,7 @@ export interface BoxOptions<TRenderable extends Renderable = BoxRenderable> exte
11
11
  customBorderChars?: BorderCharacters;
12
12
  shouldFill?: boolean;
13
13
  title?: string;
14
+ titleColor?: string | RGBA;
14
15
  titleAlignment?: "left" | "center" | "right";
15
16
  bottomTitle?: string;
16
17
  bottomTitleAlignment?: "left" | "center" | "right";
@@ -31,6 +32,7 @@ export declare class BoxRenderable extends Renderable {
31
32
  protected borderSides: BorderSidesConfig;
32
33
  shouldFill: boolean;
33
34
  protected _title?: string;
35
+ protected _titleColor?: RGBA;
34
36
  protected _titleAlignment: "left" | "center" | "right";
35
37
  protected _bottomTitle?: string;
36
38
  protected _bottomTitleAlignment: "left" | "center" | "right";
@@ -60,6 +62,8 @@ export declare class BoxRenderable extends Renderable {
60
62
  set focusedBorderColor(value: RGBA | string);
61
63
  get title(): string | undefined;
62
64
  set title(value: string | undefined);
65
+ get titleColor(): RGBA | undefined;
66
+ set titleColor(value: string | RGBA | undefined);
63
67
  get titleAlignment(): "left" | "center" | "right";
64
68
  set titleAlignment(value: "left" | "center" | "right");
65
69
  get bottomTitle(): string | undefined;
@@ -1,4 +1,5 @@
1
1
  import { type LineInfo, type RenderContext } from "../types.js";
2
+ import { StyledText } from "../lib/styled-text.js";
2
3
  import { SyntaxStyle } from "../syntax-style.js";
3
4
  import { TreeSitterClient } from "../lib/tree-sitter/index.js";
4
5
  import { TextBufferRenderable, type TextBufferOptions } from "./TextBufferRenderable.js";
@@ -23,6 +24,7 @@ export interface CodeOptions extends TextBufferOptions {
23
24
  conceal?: boolean;
24
25
  drawUnstyledText?: boolean;
25
26
  streaming?: boolean;
27
+ initialStyledText?: StyledText;
26
28
  baseHighlight?: string;
27
29
  onHighlight?: OnHighlightCallback;
28
30
  onChunks?: OnChunksCallback;
@@ -39,6 +41,7 @@ export declare class CodeRenderable extends TextBufferRenderable {
39
41
  private _drawUnstyledText;
40
42
  private _shouldRenderTextBuffer;
41
43
  private _streaming;
44
+ private _initialStyledText?;
42
45
  private _hadInitialContent;
43
46
  private _lastHighlights;
44
47
  private _baseHighlight?;
@@ -70,6 +73,7 @@ export declare class CodeRenderable extends TextBufferRenderable {
70
73
  get drawUnstyledText(): boolean;
71
74
  set drawUnstyledText(value: boolean);
72
75
  get streaming(): boolean;
76
+ set initialStyledText(value: StyledText | undefined);
73
77
  set streaming(value: boolean);
74
78
  get treeSitterClient(): TreeSitterClient;
75
79
  set treeSitterClient(value: TreeSitterClient);
@@ -179,6 +179,7 @@ export declare class MarkdownRenderable extends Renderable {
179
179
  private getStyle;
180
180
  private createChunk;
181
181
  private createDefaultChunk;
182
+ private createInitialStyledText;
182
183
  private renderInlineContent;
183
184
  private renderInlineToken;
184
185
  private renderInlineTokenWithStyle;
package/renderer.d.ts CHANGED
@@ -1,9 +1,8 @@
1
1
  import { Renderable, RootRenderable } from "./Renderable.js";
2
2
  import { DebugOverlayCorner, type CursorStyleOptions, type MousePointerStyle, type RenderContext, type TerminalCapabilities, type ThemeMode, type WidthMethod } from "./types.js";
3
3
  import { RGBA, type ColorInput } from "./lib/RGBA.js";
4
- import type { Pointer } from "./platform/ffi.js";
5
4
  import { OptimizedBuffer } from "./buffer.js";
6
- import { type NativeBufferedOutput, type NativeRenderStats } from "./zig.js";
5
+ import { type NativeBufferedOutput, type NativeRenderStats, type RendererHandle } from "./zig.js";
7
6
  import { TerminalConsole, type ConsoleOptions } from "./console.js";
8
7
  import { type MouseEventType, type RawMouseEvent, type ScrollInfo } from "./lib/parse.mouse.js";
9
8
  import { Selection } from "./lib/selection.js";
@@ -203,7 +202,7 @@ export declare enum RendererControlState {
203
202
  export declare class CliRenderer extends EventEmitter implements RenderContext {
204
203
  private static animationFrameId;
205
204
  private lib;
206
- rendererPtr: Pointer;
205
+ rendererPtr: RendererHandle;
207
206
  stdin: NodeJS.ReadStream;
208
207
  private stdout;
209
208
  private exitOnCtrlC;
@@ -1,13 +1,13 @@
1
1
  // @bun
2
2
  import {
3
3
  ensureRuntimePluginSupport
4
- } from "./index-vdnak5x1.js";
4
+ } from "./index-8t841rbx.js";
5
5
  import {
6
6
  createRuntimePlugin,
7
7
  runtimeModuleIdForSpecifier
8
- } from "./index-m0bc6bw1.js";
9
- import"./index-3mx8q5t1.js";
10
- import"./index-218h9p3f.js";
8
+ } from "./index-r49y8kdq.js";
9
+ import"./index-0nvgrgam.js";
10
+ import"./index-54s7pk0d.js";
11
11
  export {
12
12
  runtimeModuleIdForSpecifier,
13
13
  ensureRuntimePluginSupport,
@@ -1,13 +1,13 @@
1
1
  // @bun
2
2
  import {
3
3
  ensureRuntimePluginSupport
4
- } from "./index-vdnak5x1.js";
4
+ } from "./index-8t841rbx.js";
5
5
  import {
6
6
  createRuntimePlugin,
7
7
  runtimeModuleIdForSpecifier
8
- } from "./index-m0bc6bw1.js";
9
- import"./index-3mx8q5t1.js";
10
- import"./index-218h9p3f.js";
8
+ } from "./index-r49y8kdq.js";
9
+ import"./index-0nvgrgam.js";
10
+ import"./index-54s7pk0d.js";
11
11
  // src/runtime-plugin-support.ts
12
12
  ensureRuntimePluginSupport();
13
13
  export {
package/runtime-plugin.js CHANGED
@@ -3,9 +3,9 @@ import {
3
3
  createRuntimePlugin,
4
4
  isCoreRuntimeModuleSpecifier,
5
5
  runtimeModuleIdForSpecifier
6
- } from "./index-m0bc6bw1.js";
7
- import"./index-3mx8q5t1.js";
8
- import"./index-218h9p3f.js";
6
+ } from "./index-r49y8kdq.js";
7
+ import"./index-0nvgrgam.js";
8
+ import"./index-54s7pk0d.js";
9
9
  export {
10
10
  runtimeModuleIdForSpecifier,
11
11
  isCoreRuntimeModuleSpecifier,
package/syntax-style.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { RGBA, type ColorInput } from "./lib/RGBA.js";
2
- import { type RenderLib } from "./zig.js";
3
- import { type Pointer } from "./platform/ffi.js";
2
+ import { type RenderLib, type SyntaxStyleHandle } from "./zig.js";
4
3
  export interface StyleDefinition {
5
4
  fg?: RGBA;
6
5
  bg?: RGBA;
@@ -41,7 +40,7 @@ export declare class SyntaxStyle {
41
40
  private nameCache;
42
41
  private styleDefs;
43
42
  private mergedCache;
44
- constructor(lib: RenderLib, ptr: Pointer);
43
+ constructor(lib: RenderLib, ptr: SyntaxStyleHandle);
45
44
  static create(): SyntaxStyle;
46
45
  static fromTheme(theme: ThemeTokenStyle[]): SyntaxStyle;
47
46
  static fromStyles(styles: Record<string, StyleDefinitionInput>): SyntaxStyle;
@@ -49,7 +48,7 @@ export declare class SyntaxStyle {
49
48
  registerStyle(name: string, style: StyleDefinitionInput): number;
50
49
  resolveStyleId(name: string): number | null;
51
50
  getStyleId(name: string): number | null;
52
- get ptr(): Pointer;
51
+ get ptr(): SyntaxStyleHandle;
53
52
  getStyleCount(): number;
54
53
  clearNameCache(): void;
55
54
  getStyle(name: string): StyleDefinition | undefined;
package/testing.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  ANSI,
4
4
  CliRenderer,
5
5
  TreeSitterClient
6
- } from "./index-218h9p3f.js";
6
+ } from "./index-54s7pk0d.js";
7
7
 
8
8
  // src/testing/mock-keys.ts
9
9
  import { Buffer as Buffer2 } from "buffer";
@@ -1,16 +1,15 @@
1
1
  import { RGBA } from "./lib/RGBA.js";
2
- import { type LineInfo, type RenderLib } from "./zig.js";
3
- import { type Pointer } from "./platform/ffi.js";
2
+ import { type LineInfo, type RenderLib, type TextBufferViewHandle } from "./zig.js";
4
3
  import type { TextBuffer } from "./text-buffer.js";
5
4
  export declare class TextBufferView {
6
5
  private lib;
7
6
  private viewPtr;
8
7
  private textBuffer;
9
8
  private _destroyed;
10
- constructor(lib: RenderLib, ptr: Pointer, textBuffer: TextBuffer);
9
+ constructor(lib: RenderLib, ptr: TextBufferViewHandle, textBuffer: TextBuffer);
11
10
  static create(textBuffer: TextBuffer): TextBufferView;
12
11
  private guard;
13
- get ptr(): Pointer;
12
+ get ptr(): TextBufferViewHandle;
14
13
  setSelection(start: number, end: number, bgColor?: RGBA, fgColor?: RGBA): void;
15
14
  updateSelection(end: number, bgColor?: RGBA, fgColor?: RGBA): void;
16
15
  resetSelection(): void;
package/text-buffer.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import type { StyledText } from "./lib/styled-text.js";
2
2
  import { RGBA } from "./lib/RGBA.js";
3
- import { type RenderLib } from "./zig.js";
4
- import { type Pointer } from "./platform/ffi.js";
3
+ import { type RenderLib, type TextBufferHandle } from "./zig.js";
5
4
  import { type WidthMethod, type Highlight } from "./types.js";
6
5
  import type { SyntaxStyle } from "./syntax-style.js";
7
6
  export interface TextChunk {
@@ -25,7 +24,7 @@ export declare class TextBuffer {
25
24
  private _textBytes?;
26
25
  private _memId?;
27
26
  private _appendedChunks;
28
- constructor(lib: RenderLib, ptr: Pointer);
27
+ constructor(lib: RenderLib, ptr: TextBufferHandle);
29
28
  static create(widthMethod: WidthMethod): TextBuffer;
30
29
  private guard;
31
30
  setText(text: string): void;
@@ -39,7 +38,7 @@ export declare class TextBuffer {
39
38
  getLineCount(): number;
40
39
  get length(): number;
41
40
  get byteSize(): number;
42
- get ptr(): Pointer;
41
+ get ptr(): TextBufferHandle;
43
42
  getPlainText(): string;
44
43
  getTextRange(startOffset: number, endOffset: number): string;
45
44
  /**