@opentui/core 0.5.0 → 0.5.2

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.
@@ -37,6 +37,9 @@ export declare class CodeRenderable extends TextBufferRenderable {
37
37
  private _treeSitterClient;
38
38
  private _highlightsDirty;
39
39
  private _highlightSnapshotId;
40
+ private _highlightLoopActive;
41
+ private _highlightPromise?;
42
+ private _highlightRerun;
40
43
  private _conceal;
41
44
  private _drawUnstyledText;
42
45
  private _shouldRenderTextBuffer;
@@ -58,6 +61,7 @@ export declare class CodeRenderable extends TextBufferRenderable {
58
61
  };
59
62
  constructor(ctx: RenderContext, options: CodeOptions);
60
63
  get content(): string;
64
+ private invalidateHighlights;
61
65
  set content(value: string);
62
66
  get lineInfo(): LineInfo;
63
67
  get wrapMode(): "none" | "char" | "word";
@@ -88,10 +92,13 @@ export declare class CodeRenderable extends TextBufferRenderable {
88
92
  protected transformChunks(chunks: TextChunk[], context: ChunkRenderContext): Promise<TextChunk[]>;
89
93
  private ensureVisibleTextBeforeHighlight;
90
94
  private startHighlight;
95
+ private runHighlights;
96
+ private clearPendingHighlight;
91
97
  private setRenderedLineSources;
92
98
  private static isIdentityLineSources;
93
99
  private static getMergedConcealLineRanges;
94
100
  private getConcealLinesSourceMap;
95
101
  getLineHighlights(lineIdx: number): import("../types.js").Highlight[];
96
102
  protected renderSelf(buffer: OptimizedBuffer): void;
103
+ destroy(): void;
97
104
  }
@@ -3,8 +3,9 @@ import { NativeImage, type ImageSource } from "../image.js";
3
3
  import type { OptimizedBuffer } from "../buffer.js";
4
4
  import type { ImageRenderProtocol, RenderContext, TerminalCapabilities } from "../types.js";
5
5
  export type ImageFit = "fit" | "cover" | "fill";
6
+ export type ImageRenderableSource = ImageSource | NativeImage;
6
7
  export interface ImageRenderableOptions extends RenderableOptions<ImageRenderable> {
7
- source?: ImageSource;
8
+ source?: ImageRenderableSource;
8
9
  fit?: ImageFit;
9
10
  protocol?: ImageRenderProtocol;
10
11
  onLoad?: (image: NativeImage) => void;
@@ -14,6 +15,7 @@ export declare function resolveImageRenderProtocol(requested: ImageRenderProtoco
14
15
  export declare class ImageRenderable extends Renderable {
15
16
  private _source;
16
17
  private _image;
18
+ private _pendingImage;
17
19
  private _loadError;
18
20
  private _loadController;
19
21
  onLoad?: (image: NativeImage) => void;
@@ -22,8 +24,8 @@ export declare class ImageRenderable extends Renderable {
22
24
  private _protocol;
23
25
  loadPromise: Promise<void> | null;
24
26
  constructor(ctx: RenderContext, options: ImageRenderableOptions);
25
- get source(): ImageSource | undefined;
26
- set source(source: ImageSource | undefined);
27
+ get source(): ImageRenderableSource | undefined;
28
+ set source(source: ImageRenderableSource | undefined);
27
29
  get image(): NativeImage | null;
28
30
  get fit(): ImageFit;
29
31
  set fit(value: ImageFit | null | undefined);
package/renderer.d.ts CHANGED
@@ -274,6 +274,7 @@ export declare class CliRenderer extends EventEmitter implements RenderContext {
274
274
  private animationRequest;
275
275
  private resizeTimeoutId;
276
276
  private capabilityTimeoutId;
277
+ private terminalKeepAliveTimer;
277
278
  private xtVersionWaiters;
278
279
  private splitStartupSeedTimeoutId;
279
280
  private pendingSplitStartupCursorSeed;
@@ -362,8 +363,8 @@ export declare class CliRenderer extends EventEmitter implements RenderContext {
362
363
  * - Calls `lib.createRenderer` → native Zig allocation
363
364
  * - Registers in the process-wide `rendererTracker`
364
365
  * - Adds `process.on(...)` listeners for SIGWINCH (process.stdout only),
365
- * "warning", "uncaughtException", "unhandledRejection", "beforeExit",
366
- * plus the configured `exitSignals`
366
+ * "warning", "uncaughtException", "unhandledRejection", plus the
367
+ * configured `exitSignals`
367
368
  * - Replaces `global.requestAnimationFrame` with the renderer's impl
368
369
  * - When `setupTerminal()` is called, it will put `stdin` in raw mode and
369
370
  * call `stdin.resume()`
@@ -374,6 +375,8 @@ export declare class CliRenderer extends EventEmitter implements RenderContext {
374
375
  */
375
376
  constructor(stdin: NodeJS.ReadStream, stdout: NodeJS.WriteStream, width: number, height: number, config?: CliRendererConfig);
376
377
  private addExitListeners;
378
+ private startTerminalKeepAlive;
379
+ private stopTerminalKeepAlive;
377
380
  private removeExitListeners;
378
381
  get isDestroyed(): boolean;
379
382
  registerLifecyclePass(renderable: Renderable): void;
package/testing.bun.js CHANGED
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  ANSI,
4
4
  CliRenderer
5
- } from "./chunk-bun-v3e63tzw.js";
5
+ } from "./chunk-bun-t68f2fmr.js";
6
6
  import {
7
7
  SystemClock,
8
8
  TreeSitterClient
9
- } from "./chunk-bun-ctxxvhwz.js";
9
+ } from "./chunk-bun-26r5c5w5.js";
10
10
 
11
11
  // src/testing/mock-keys.ts
12
12
  import { Buffer as Buffer2 } from "buffer";
package/testing.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  ANSI,
3
3
  CliRenderer
4
- } from "./chunk-node-1j69hr31.js";
4
+ } from "./chunk-node-kq7as74d.js";
5
5
  import {
6
6
  SystemClock,
7
7
  TreeSitterClient
8
- } from "./chunk-node-savhj5rp.js";
8
+ } from "./chunk-node-aj3n20gq.js";
9
9
 
10
10
  // src/testing/mock-keys.ts
11
11
  import { Buffer as Buffer2 } from "node:buffer";
@@ -0,0 +1 @@
1
+ export {};
package/yoga.bun.js CHANGED
@@ -93,7 +93,7 @@ import {
93
93
  WRAP_WRAP_REVERSE,
94
94
  Wrap,
95
95
  yoga_default
96
- } from "./chunk-bun-ctxxvhwz.js";
96
+ } from "./chunk-bun-26r5c5w5.js";
97
97
  export {
98
98
  yoga_default as default,
99
99
  Wrap,
package/yoga.js CHANGED
@@ -92,7 +92,7 @@ import {
92
92
  WRAP_WRAP_REVERSE,
93
93
  Wrap,
94
94
  yoga_default
95
- } from "./chunk-node-savhj5rp.js";
95
+ } from "./chunk-node-aj3n20gq.js";
96
96
  export {
97
97
  yoga_default as default,
98
98
  Wrap,
package/zig.d.ts CHANGED
@@ -40,6 +40,55 @@ export type EventSinkHandle = NativeHandle<"event_sink">;
40
40
  export type AudioEngineHandle = NativeHandle<"audio_engine">;
41
41
  export type NativeRenderableHandle = NativeHandle<"native_renderable">;
42
42
  export type ImageHandle = NativeHandle<"image">;
43
+ export type ClipboardServiceHandle = number & {
44
+ readonly __nativeHandle: "clipboard_service";
45
+ };
46
+ export type ClipboardOperationHandle = number & {
47
+ readonly __nativeHandle: "clipboard_operation";
48
+ };
49
+ export declare enum NativeClipboardOperationStatus {
50
+ Pending = 0,
51
+ Read = 1,
52
+ Empty = 2,
53
+ Written = 3,
54
+ Cleared = 4,
55
+ Unsupported = 5,
56
+ Cancelled = 6,
57
+ TimedOut = 7,
58
+ LimitExceeded = 8,
59
+ Failed = 9,
60
+ InvalidHandle = 10
61
+ }
62
+ export declare enum NativeClipboardStartStatus {
63
+ Ok = 0,
64
+ InvalidService = 1,
65
+ ShuttingDown = 2,
66
+ LimitExceeded = 3,
67
+ InvalidArgument = 4,
68
+ OutOfMemory = 5
69
+ }
70
+ export declare enum NativeClipboardCancelStatus {
71
+ Requested = 0,
72
+ AlreadyTerminal = 1,
73
+ InvalidHandle = 2
74
+ }
75
+ export declare enum NativeClipboardCopyStatus {
76
+ Ok = 0,
77
+ BufferTooSmall = 1,
78
+ InvalidHandle = 2,
79
+ InvalidState = 3,
80
+ InvalidArgument = 4
81
+ }
82
+ export declare enum NativeClipboardDestroyStatus {
83
+ Destroyed = 0,
84
+ NotReady = 1,
85
+ InvalidHandle = 2
86
+ }
87
+ export declare enum NativeClipboardShutdownStatus {
88
+ Pending = 0,
89
+ Ready = 1,
90
+ InvalidHandle = 2
91
+ }
43
92
  export declare enum LogLevel {
44
93
  Error = 0,
45
94
  Warn = 1,
@@ -237,6 +286,45 @@ export interface RenderLib extends AudioEngineLib {
237
286
  setTerminalTitle: (renderer: RendererHandle, title: string) => void;
238
287
  copyToClipboardOSC52: (renderer: RendererHandle, target: number, textUtf8: Uint8Array) => boolean;
239
288
  clearClipboardOSC52: (renderer: RendererHandle, target: number) => boolean;
289
+ clipboardServiceCreate: (maxConcurrentOperations: number, maxProviderTransfers: number, waylandSeat?: string) => ClipboardServiceHandle | null;
290
+ clipboardServiceBeginShutdown: (service: ClipboardServiceHandle) => NativeClipboardShutdownStatus;
291
+ clipboardServicePollShutdown: (service: ClipboardServiceHandle) => NativeClipboardShutdownStatus;
292
+ clipboardServiceDestroy: (service: ClipboardServiceHandle) => NativeClipboardDestroyStatus;
293
+ clipboardServiceDrain: (service: ClipboardServiceHandle) => number;
294
+ clipboardReadOperationStart: (service: ClipboardServiceHandle, request: Uint8Array, selection: number, maxBytes: number, maxImagePixels: number, maxConversionBytes: number, timeoutMs: number) => {
295
+ status: NativeClipboardStartStatus;
296
+ operation: ClipboardOperationHandle | null;
297
+ };
298
+ clipboardWriteOperationStart: (service: ClipboardServiceHandle, textUtf8: Uint8Array, selection: number, timeoutMs: number) => {
299
+ status: NativeClipboardStartStatus;
300
+ operation: ClipboardOperationHandle | null;
301
+ };
302
+ clipboardClearOperationStart: (service: ClipboardServiceHandle, selection: number, timeoutMs: number) => {
303
+ status: NativeClipboardStartStatus;
304
+ operation: ClipboardOperationHandle | null;
305
+ };
306
+ clipboardOperationPoll: (operation: ClipboardOperationHandle) => NativeClipboardOperationStatus;
307
+ clipboardOperationCancel: (operation: ClipboardOperationHandle) => NativeClipboardCancelStatus;
308
+ clipboardOperationResultMimeLength: (operation: ClipboardOperationHandle) => {
309
+ status: NativeClipboardCopyStatus;
310
+ length: number;
311
+ };
312
+ clipboardOperationResultMimeCopy: (operation: ClipboardOperationHandle, output: Uint8Array) => NativeClipboardCopyStatus;
313
+ clipboardOperationResultDataLength: (operation: ClipboardOperationHandle) => {
314
+ status: NativeClipboardCopyStatus;
315
+ length: number;
316
+ };
317
+ clipboardOperationResultDataCopy: (operation: ClipboardOperationHandle, output: Uint8Array) => NativeClipboardCopyStatus;
318
+ clipboardOperationResultErrorCode: (operation: ClipboardOperationHandle) => {
319
+ status: NativeClipboardCopyStatus;
320
+ errorCode: number;
321
+ };
322
+ clipboardOperationResultDiagnosticLength: (operation: ClipboardOperationHandle) => {
323
+ status: NativeClipboardCopyStatus;
324
+ length: number;
325
+ };
326
+ clipboardOperationResultDiagnosticCopy: (operation: ClipboardOperationHandle, output: Uint8Array) => NativeClipboardCopyStatus;
327
+ clipboardOperationDestroy: (operation: ClipboardOperationHandle) => NativeClipboardDestroyStatus;
240
328
  triggerNotification: (renderer: RendererHandle, message: string, title?: string) => boolean;
241
329
  addToHitGrid: (renderer: RendererHandle, x: number, y: number, width: number, height: number, id: number) => void;
242
330
  clearCurrentHitGrid: (renderer: RendererHandle) => void;
@@ -510,6 +598,9 @@ export interface RenderLib extends AudioEngineLib {
510
598
  status: number;
511
599
  info: NativeImageInfo;
512
600
  };
601
+ imageRetainIccCache: () => void;
602
+ imageReleaseIccCache: () => void;
603
+ imageTestFailIccProfileCopyAllocationOnce: () => void;
513
604
  imageDecode: (data: Uint8Array) => {
514
605
  status: number;
515
606
  handle: ImageHandle | null;
@@ -519,10 +610,16 @@ export interface RenderLib extends AudioEngineLib {
519
610
  handle: ImageHandle | null;
520
611
  };
521
612
  imageDestroy: (image: ImageHandle) => void;
613
+ imageRetain: (image: ImageHandle) => {
614
+ status: number;
615
+ handle: ImageHandle | null;
616
+ };
522
617
  imageGetInfo: (image: ImageHandle) => {
523
618
  status: number;
524
619
  info: NativeImageInfo;
525
620
  };
621
+ imageMaterialize: (image: ImageHandle) => number;
622
+ imageEnsureEncodedPng: (image: ImageHandle) => number;
526
623
  imageGetPixelsPtr: (image: ImageHandle) => Pointer | null;
527
624
  imageClone: (image: ImageHandle) => {
528
625
  status: number;