@opentui/core 0.8.0 → 0.8.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.
Files changed (36) hide show
  1. package/NativeScene.d.ts +10 -2
  2. package/NativeSession.d.ts +22 -2
  3. package/buffer.d.ts +2 -0
  4. package/{chunk-bun-6kxdhkdc.js → chunk-bun-vd3rj9kv.js} +451 -74
  5. package/{chunk-bun-6kxdhkdc.js.map → chunk-bun-vd3rj9kv.js.map} +10 -10
  6. package/{chunk-bun-x6cz4jyg.js → chunk-bun-wdetc10w.js} +222 -10
  7. package/chunk-bun-wdetc10w.js.map +35 -0
  8. package/{chunk-node-y0w0hq5m.js → chunk-node-m8mjyx7h.js} +222 -10
  9. package/chunk-node-m8mjyx7h.js.map +34 -0
  10. package/{chunk-node-q5ccgbk5.js → chunk-node-s9be55eh.js} +451 -74
  11. package/{chunk-node-q5ccgbk5.js.map → chunk-node-s9be55eh.js.map} +10 -10
  12. package/index.bun.js +684 -415
  13. package/index.bun.js.map +13 -12
  14. package/index.d.ts +1 -1
  15. package/index.node.js +684 -415
  16. package/index.node.js.map +13 -11
  17. package/native-abi.generated.d.ts +171 -3
  18. package/package.json +9 -9
  19. package/renderables/Image.d.ts +13 -1
  20. package/renderables/LineNumberRenderable.d.ts +1 -1
  21. package/renderables/Markdown.d.ts +1 -6
  22. package/renderables/ScrollBox.d.ts +1 -1
  23. package/renderables/Select.d.ts +0 -2
  24. package/renderables/TabSelect.d.ts +0 -3
  25. package/renderables/TextTable.d.ts +1 -8
  26. package/renderables/Video.d.ts +126 -0
  27. package/renderables/index.d.ts +1 -0
  28. package/renderables/markdown-parser.d.ts +1 -0
  29. package/renderer.d.ts +23 -2
  30. package/testing.bun.js +2 -2
  31. package/testing.js +2 -2
  32. package/yoga.bun.js +1 -1
  33. package/yoga.js +1 -1
  34. package/zig.d.ts +54 -2
  35. package/chunk-bun-x6cz4jyg.js.map +0 -35
  36. package/chunk-node-y0w0hq5m.js.map +0 -34
package/testing.js CHANGED
@@ -3,10 +3,10 @@ import {
3
3
  TreeSitterClient2,
4
4
  ANSI,
5
5
  CliRenderer2
6
- } from "./chunk-node-q5ccgbk5.js";
6
+ } from "./chunk-node-s9be55eh.js";
7
7
  import {
8
8
  nativeConstants
9
- } from "./chunk-node-y0w0hq5m.js";
9
+ } from "./chunk-node-m8mjyx7h.js";
10
10
 
11
11
  // src/testing/mock-keys.ts
12
12
  import { Buffer as Buffer2 } from "node:buffer";
package/yoga.bun.js CHANGED
@@ -95,7 +95,7 @@ import {
95
95
  Config2,
96
96
  Node2,
97
97
  yoga_default
98
- } from "./chunk-bun-x6cz4jyg.js";
98
+ } from "./chunk-bun-wdetc10w.js";
99
99
  export {
100
100
  ALIGN_AUTO2 as ALIGN_AUTO,
101
101
  ALIGN_BASELINE2 as ALIGN_BASELINE,
package/yoga.js CHANGED
@@ -94,7 +94,7 @@ import {
94
94
  Config2,
95
95
  Node2,
96
96
  yoga_default
97
- } from "./chunk-node-y0w0hq5m.js";
97
+ } from "./chunk-node-m8mjyx7h.js";
98
98
  export {
99
99
  ALIGN_AUTO2 as ALIGN_AUTO,
100
100
  ALIGN_BASELINE2 as ALIGN_BASELINE,
package/zig.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { type FFICallbackInstance, type Pointer, type PointerInput } from "./platform/ffi.js";
2
2
  import { type CursorStyle, type CursorStyleOptions, type SelectionOccupancy, type SelectionBehavior, type DebugOverlayCorner, type WidthMethod, type TerminalCapabilities, type Highlight, type LineInfo, type MousePointerStyle, type ImageRenderProtocol, type ProgramStatus } from "./types.js";
3
3
  export type { LineInfo, AllocatorStats, AudioStreamCreateOptions, BuildOptions, NativeAudioCaptureStats, NativeAudioStreamStats, NativeFrameWork, NativeRenderStats, };
4
+ import type { ExtractOptions } from "./image.js";
4
5
  import { RGBA } from "./lib/RGBA.js";
5
6
  import { type StyledText } from "./lib/styled-text.js";
6
7
  import { type MeasureFunction } from "./yoga.js";
@@ -441,6 +442,8 @@ export type NativeBufferDraw = {
441
442
  operation: "text";
442
443
  text?: string;
443
444
  attributes?: number;
445
+ maxWidth?: number;
446
+ ellipsis?: boolean;
444
447
  }) | (BufferDrawPosition & BufferDrawColors & {
445
448
  operation: "cell" | "cellBlend" | "char";
446
449
  char?: number;
@@ -611,6 +614,12 @@ export interface NativeSessionRendererState {
611
614
  height: number;
612
615
  frameCount: bigint;
613
616
  framePending: boolean;
617
+ /** Presented Kitty and Sixel placements whose image a later frame still sends. */
618
+ imageUploadsPending: number;
619
+ /** Distinct frame contents dropped because their output is larger than the write limit. */
620
+ droppedFrames: number;
621
+ /** The size of the last attempt's frame when it was dropped for size, else 0. */
622
+ droppedFrameBytes: number;
614
623
  }
615
624
  export interface NativeSessionKittyImageTransportStatus {
616
625
  requested: number;
@@ -728,7 +737,27 @@ export declare enum NativeStatus {
728
737
  StaleFrame = -25,
729
738
  LayoutLimit = -26,
730
739
  FrameBusy = -27,
731
- FrameRequestLimit = -28
740
+ FrameRequestLimit = -28,
741
+ VideoFailed = -60
742
+ }
743
+ export interface NativeVideoInfo {
744
+ durationUs: bigint;
745
+ width: number;
746
+ height: number;
747
+ fpsNum: number;
748
+ fpsDen: number;
749
+ hasAudio: boolean;
750
+ }
751
+ export interface NativeVideoState {
752
+ currentTimeUs: bigint;
753
+ framePtsUs: bigint;
754
+ playing: boolean;
755
+ ended: boolean;
756
+ buffering: boolean;
757
+ audio: boolean;
758
+ hasFrame: boolean;
759
+ failed: boolean;
760
+ qualityTier: number;
732
761
  }
733
762
  export declare class NativeError extends Error {
734
763
  readonly operation: string;
@@ -817,7 +846,7 @@ export type EmbeddedTerminalMouse = {
817
846
  y: number;
818
847
  anyButtonPressed?: boolean;
819
848
  };
820
- declare const SCENE_NODE_KINDS: readonly ["root", "box", "text", "slider", "arrow", "editor", "custom", "text_view", "image"];
849
+ declare const SCENE_NODE_KINDS: readonly ["root", "box", "text", "slider", "arrow", "editor", "custom", "text_view", "image", "video"];
821
850
  /** One ordered property stream, stored in native wire layout. Visual writes coalesce
822
851
  * at the node's latest visual record; last write wins per field. New or changed
823
852
  * translations only merge into the last record so prepared coordinates observe
@@ -1005,6 +1034,8 @@ export declare class FFIRenderLib {
1005
1034
  private sceneFlushApplied;
1006
1035
  private editorSelectionRecord;
1007
1036
  private readonly editorViewInfoRecord;
1037
+ private readonly videoStateRecord;
1038
+ private readonly videoStateView;
1008
1039
  private readonly selectionResetRecord;
1009
1040
  private readonly localSelectionResetRecord;
1010
1041
  private readonly selectionResetChanged;
@@ -1176,6 +1207,20 @@ export declare class FFIRenderLib {
1176
1207
  sceneSetEditorOptions(context: NativeContextHandle, node: SceneNodeHandle, options: NativeSceneEditorOptions): void;
1177
1208
  destroyContextImage(context: NativeContextHandle, image: ContextImageHandle): void;
1178
1209
  sceneSetImage(context: NativeContextHandle, node: SceneNodeHandle, image: ContextImageHandle | null, fit: "fit" | "cover" | "fill", protocol: ImageRenderProtocol, buffer: ContextBufferHandle | null): void;
1210
+ sceneSetVideo(context: NativeContextHandle, node: SceneNodeHandle, fit: "fit" | "cover" | "fill", buffer: ContextBufferHandle | null): void;
1211
+ /** Sets the source region an image or video node shows; undefined shows the whole source. */
1212
+ sceneSetCrop(context: NativeContextHandle, node: SceneNodeHandle, crop: ExtractOptions | undefined): void;
1213
+ /** Replaces the node's player; an empty path closes it. Without audio, playback opens no audio device. */
1214
+ videoOpen(context: NativeContextHandle, node: SceneNodeHandle, path: string, audio: boolean): NativeVideoInfo;
1215
+ videoCall(context: NativeContextHandle, node: SceneNodeHandle, operation: "ot_video_play" | "ot_video_pause"): void;
1216
+ videoSeek(context: NativeContextHandle, node: SceneNodeHandle, timeUs: bigint): void;
1217
+ videoSetLoop(context: NativeContextHandle, node: SceneNodeHandle, loop: boolean): void;
1218
+ videoSetMuted(context: NativeContextHandle, node: SceneNodeHandle, muted: boolean): void;
1219
+ videoSetVolume(context: NativeContextHandle, node: SceneNodeHandle, volume: number): void;
1220
+ videoSetAvSyncOffset(context: NativeContextHandle, node: SceneNodeHandle, offsetUs: bigint): void;
1221
+ videoSetMaxFps(context: NativeContextHandle, node: SceneNodeHandle, fps: number): void;
1222
+ videoGetState(context: NativeContextHandle, node: SceneNodeHandle): NativeVideoState;
1223
+ videoGetError(context: NativeContextHandle, node: SceneNodeHandle): string;
1179
1224
  contextDrawImage({ context, target, frame }: NativeDrawingTarget, image: ContextImageHandle, options: NativeContextImageDraw): boolean;
1180
1225
  sessionSetImageResolution(context: NativeContextHandle, session: SessionHandle, terminalWidth: number, terminalHeight: number, pixelWidth: number, pixelHeight: number): void;
1181
1226
  sessionSetKittyImageTransport(context: NativeContextHandle, session: SessionHandle, mode: number): void;
@@ -1236,8 +1281,15 @@ export declare class FFIRenderLib {
1236
1281
  sessionGetCapabilities(context: NativeContextHandle, session: SessionHandle): NativeSessionCapabilities;
1237
1282
  sessionReadOutput(context: NativeContextHandle, session: SessionHandle, bytes: Uint8Array): NativeOutputTicket | null;
1238
1283
  sessionDrainStdout(context: NativeContextHandle, session: SessionHandle, maxBytes?: number): number;
1284
+ /** Collects a finished stdout writer copy and, when `maxBytes` is positive, starts the next. `wait` waits for
1285
+ * the running copy (process exit). */
1286
+ sessionPostStdout(context: NativeContextHandle, session: SessionHandle, maxBytes: number, wait: boolean): {
1287
+ written: number;
1288
+ inFlight: boolean;
1289
+ };
1239
1290
  sessionCompleteOutput(context: NativeContextHandle, session: SessionHandle, ticket: NativeOutputTicket, success: boolean): void;
1240
1291
  sessionClose(context: NativeContextHandle, session: SessionHandle): void;
1292
+ sessionDropOutput(context: NativeContextHandle, session: SessionHandle): void;
1241
1293
  sessionCancel(context: NativeContextHandle, session: SessionHandle): void;
1242
1294
  sessionGetState(context: NativeContextHandle, session: SessionHandle): NativeSessionState;
1243
1295
  destroySession(context: NativeContextHandle, session: SessionHandle): void;