@opentui/core 0.8.0 → 0.8.1
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/NativeScene.d.ts +10 -2
- package/NativeSession.d.ts +22 -2
- package/buffer.d.ts +2 -0
- package/{chunk-bun-6kxdhkdc.js → chunk-bun-ved2tpxm.js} +430 -64
- package/{chunk-bun-6kxdhkdc.js.map → chunk-bun-ved2tpxm.js.map} +10 -10
- package/{chunk-bun-x6cz4jyg.js → chunk-bun-wdetc10w.js} +222 -10
- package/chunk-bun-wdetc10w.js.map +35 -0
- package/{chunk-node-y0w0hq5m.js → chunk-node-m8mjyx7h.js} +222 -10
- package/chunk-node-m8mjyx7h.js.map +34 -0
- package/{chunk-node-q5ccgbk5.js → chunk-node-tpjmjvn7.js} +430 -64
- package/{chunk-node-q5ccgbk5.js.map → chunk-node-tpjmjvn7.js.map} +10 -10
- package/index.bun.js +670 -391
- package/index.bun.js.map +11 -10
- package/index.d.ts +1 -1
- package/index.node.js +670 -391
- package/index.node.js.map +11 -9
- package/native-abi.generated.d.ts +171 -3
- package/package.json +9 -9
- package/renderables/Image.d.ts +13 -1
- package/renderables/LineNumberRenderable.d.ts +1 -1
- package/renderables/Markdown.d.ts +1 -1
- package/renderables/ScrollBox.d.ts +1 -1
- package/renderables/Select.d.ts +0 -2
- package/renderables/TabSelect.d.ts +0 -3
- package/renderables/TextTable.d.ts +1 -8
- package/renderables/Video.d.ts +126 -0
- package/renderables/index.d.ts +1 -0
- package/renderer.d.ts +22 -2
- package/testing.bun.js +2 -2
- package/testing.js +2 -2
- package/yoga.bun.js +1 -1
- package/yoga.js +1 -1
- package/zig.d.ts +54 -2
- package/chunk-bun-x6cz4jyg.js.map +0 -35
- package/chunk-node-y0w0hq5m.js.map +0 -34
package/yoga.bun.js
CHANGED
package/yoga.js
CHANGED
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;
|