@opentui/core 0.7.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 +18 -4
- package/NativeSession.d.ts +22 -2
- package/Renderable.d.ts +20 -2
- package/animation/Timeline.d.ts +9 -0
- package/buffer.d.ts +8 -2
- package/{chunk-bun-zevtbcf6.js → chunk-bun-ved2tpxm.js} +834 -320
- package/chunk-bun-ved2tpxm.js.map +70 -0
- package/{chunk-bun-qkpm62w1.js → chunk-bun-wdetc10w.js} +483 -29
- package/chunk-bun-wdetc10w.js.map +35 -0
- package/{chunk-node-mzgnr3sw.js → chunk-node-m8mjyx7h.js} +483 -29
- package/chunk-node-m8mjyx7h.js.map +34 -0
- package/{chunk-node-7bcmqh18.js → chunk-node-tpjmjvn7.js} +834 -320
- package/chunk-node-tpjmjvn7.js.map +70 -0
- package/edit-buffer.d.ts +4 -0
- package/index.bun.js +1453 -859
- package/index.bun.js.map +15 -13
- package/index.d.ts +1 -1
- package/index.node.js +1453 -859
- package/index.node.js.map +16 -12
- package/lib/extmarks.d.ts +3 -1
- package/lib/stdin-parser-native.d.ts +2 -0
- package/lib/stdin-parser.d.ts +2 -0
- package/lib/terminal-capability-detection.d.ts +6 -1
- package/native-abi.generated.d.ts +478 -6
- package/package.json +9 -9
- package/renderables/FrameBuffer.d.ts +1 -0
- package/renderables/Image.d.ts +13 -1
- package/renderables/LineNumberRenderable.d.ts +1 -1
- package/renderables/Markdown.d.ts +1 -1
- package/renderables/ScrollBar.d.ts +6 -0
- package/renderables/ScrollBox.d.ts +84 -44
- package/renderables/ScrollBoxParts.d.ts +165 -0
- 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 +2 -1
- package/renderer-theme-mode.d.ts +1 -6
- package/renderer.d.ts +44 -5
- package/testing/test-renderer.d.ts +2 -0
- package/testing.bun.js +7 -6
- package/testing.bun.js.map +3 -3
- package/testing.js +7 -6
- package/testing.js.map +3 -3
- package/types.d.ts +11 -0
- package/yoga.bun.js +1 -1
- package/yoga.internal.d.ts +3 -3
- package/yoga.js +1 -1
- package/zig-structs.d.ts +1 -0
- package/zig.d.ts +132 -10
- package/chunk-bun-qkpm62w1.js.map +0 -35
- package/chunk-bun-zevtbcf6.js.map +0 -70
- package/chunk-node-7bcmqh18.js.map +0 -70
- package/chunk-node-mzgnr3sw.js.map +0 -34
|
@@ -174,6 +174,11 @@ var nativeSymbols = {
|
|
|
174
174
|
ot_scene_set_surface: { args: ["ptr", "buffer", "ptr"], returns: "i32" },
|
|
175
175
|
ot_scene_set_box_details: { args: ["ptr", "buffer", "buffer", "ptr", "u32", "ptr", "u32"], returns: "i32" },
|
|
176
176
|
ot_scene_set_viewport: { args: ["ptr", "buffer", "ptr"], returns: "i32" },
|
|
177
|
+
ot_scene_set_scroll: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
|
|
178
|
+
ot_scene_set_scroll_arrow: { args: ["ptr", "buffer", "u32", "u32", "buffer", "ptr", "u32"], returns: "i32" },
|
|
179
|
+
ot_scene_scroll_to: { args: ["ptr", "buffer", "f64", "f64", "u32", "ptr"], returns: "i32" },
|
|
180
|
+
ot_scene_scroll_request: { args: ["ptr", "buffer", "u32", "ptr", "u32", "u32", "ptr"], returns: "i32" },
|
|
181
|
+
ot_scene_get_scroll: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
|
|
177
182
|
ot_scene_set_focus: { args: ["ptr", "buffer", "u32"], returns: "i32" },
|
|
178
183
|
ot_scene_set_slider: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
|
|
179
184
|
ot_scene_set_arrow: { args: ["ptr", "buffer", "buffer", "ptr", "u32"], returns: "i32" },
|
|
@@ -290,6 +295,19 @@ var nativeSymbols = {
|
|
|
290
295
|
ot_image_take_pixels: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
|
|
291
296
|
ot_image_pixels_release: { args: ["ptr", "buffer"], returns: "i32" },
|
|
292
297
|
ot_scene_set_image: { args: ["ptr", "buffer", "ptr", "u32", "u32", "ptr"], returns: "i32" },
|
|
298
|
+
ot_scene_set_crop: { args: ["ptr", "buffer", "u32", "u32", "u32", "u32"], returns: "i32" },
|
|
299
|
+
ot_scene_set_video: { args: ["ptr", "buffer", "u32", "ptr"], returns: "i32" },
|
|
300
|
+
ot_video_open: { args: ["ptr", "buffer", "ptr", "u32", "u32", "buffer"], returns: "i32" },
|
|
301
|
+
ot_video_play: { args: ["ptr", "buffer"], returns: "i32" },
|
|
302
|
+
ot_video_pause: { args: ["ptr", "buffer"], returns: "i32" },
|
|
303
|
+
ot_video_seek: { args: ["ptr", "buffer", "i64"], returns: "i32" },
|
|
304
|
+
ot_video_set_loop: { args: ["ptr", "buffer", "u32"], returns: "i32" },
|
|
305
|
+
ot_video_set_muted: { args: ["ptr", "buffer", "u32"], returns: "i32" },
|
|
306
|
+
ot_video_set_volume: { args: ["ptr", "buffer", "f32"], returns: "i32" },
|
|
307
|
+
ot_video_set_av_sync_offset: { args: ["ptr", "buffer", "i64"], returns: "i32" },
|
|
308
|
+
ot_video_set_max_fps: { args: ["ptr", "buffer", "u32"], returns: "i32" },
|
|
309
|
+
ot_video_get_state: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
|
|
310
|
+
ot_video_get_error: { args: ["ptr", "buffer", "ptr", "u32", "buffer"], returns: "i32" },
|
|
293
311
|
ot_buffer_draw_image: { args: ["ptr", "buffer", "ptr", "buffer", "buffer", "buffer"], returns: "i32" },
|
|
294
312
|
ot_session_set_image_resolution: { args: ["ptr", "buffer", "u32", "u32", "u32", "u32"], returns: "i32" },
|
|
295
313
|
ot_session_set_kitty_image_transport: { args: ["ptr", "buffer", "u32"], returns: "i32" },
|
|
@@ -330,7 +348,7 @@ var nativeSymbols = {
|
|
|
330
348
|
ot_scene_set_text_view_paint: { args: ["ptr", "buffer", "u32"], returns: "i32" },
|
|
331
349
|
ot_buffer_draw_text_view: { args: ["ptr", "buffer", "ptr", "buffer", "i32", "i32"], returns: "i32" },
|
|
332
350
|
ot_buffer_draw_editor_view: { args: ["ptr", "buffer", "ptr", "buffer", "i32", "i32"], returns: "i32" },
|
|
333
|
-
|
|
351
|
+
ot_buffer_draw_scene_body: { args: ["ptr", "buffer", "ptr", "buffer", "i32", "i32"], returns: "i32" },
|
|
334
352
|
ot_scene_frame_acquire_buffer_lease: { args: ["ptr", "buffer", "buffer", "u32", "buffer"], returns: "i32" },
|
|
335
353
|
ot_scene_frame_commit: { args: ["ptr", "buffer", "buffer", "u32", "buffer"], returns: "i32" },
|
|
336
354
|
ot_context_abi_version: { args: [], returns: "u32" },
|
|
@@ -404,8 +422,10 @@ var nativeSymbols = {
|
|
|
404
422
|
ot_session_read_output: { args: ["ptr", "buffer", "ptr", "u32", "buffer"], returns: "i32" },
|
|
405
423
|
ot_session_drain_output: { args: ["ptr", "buffer", "u32", "buffer", "ptr", "ptr"], returns: "i32" },
|
|
406
424
|
ot_session_drain_stdout: { args: ["ptr", "buffer", "u32", "buffer"], returns: "i32" },
|
|
425
|
+
ot_session_post_stdout: { args: ["ptr", "buffer", "u32", "u32", "buffer", "buffer"], returns: "i32" },
|
|
407
426
|
ot_session_complete_output: { args: ["ptr", "buffer", "buffer", "u32"], returns: "i32" },
|
|
408
427
|
ot_session_close: { args: ["ptr", "buffer"], returns: "i32" },
|
|
428
|
+
ot_session_drop_output: { args: ["ptr", "buffer"], returns: "i32" },
|
|
409
429
|
ot_session_pump_exit: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
|
|
410
430
|
ot_terminal_flush_input: { args: [], returns: "i32" },
|
|
411
431
|
ot_session_cancel: { args: ["ptr", "buffer"], returns: "i32" },
|
|
@@ -660,7 +680,7 @@ var nativeLayouts = {
|
|
|
660
680
|
full_path_reasons: { offset: 208, size: 4, alignment: 4, type: "u32" },
|
|
661
681
|
host_requests: { offset: 212, size: 4, alignment: 4, type: "u32" },
|
|
662
682
|
layout_rounds: { offset: 216, size: 4, alignment: 4, type: "u32" },
|
|
663
|
-
|
|
683
|
+
damage_rows: { offset: 220, size: 4, alignment: 4, type: "u32" }
|
|
664
684
|
}
|
|
665
685
|
},
|
|
666
686
|
ot_scene_cursor_state: {
|
|
@@ -780,6 +800,66 @@ var nativeLayouts = {
|
|
|
780
800
|
reserved: { offset: 12, size: 4, alignment: 4, type: "u32" }
|
|
781
801
|
}
|
|
782
802
|
},
|
|
803
|
+
ot_scene_scroll_bar_options: {
|
|
804
|
+
size: 40,
|
|
805
|
+
alignment: 4,
|
|
806
|
+
fields: {
|
|
807
|
+
policy: { offset: 0, size: 4, alignment: 4, type: "u32" },
|
|
808
|
+
placement: { offset: 4, size: 4, alignment: 4, type: "u32" },
|
|
809
|
+
thickness: { offset: 8, size: 4, alignment: 4, type: "u32" },
|
|
810
|
+
gap: { offset: 12, size: 4, alignment: 4, type: "u32" },
|
|
811
|
+
arrows: { offset: 16, size: 4, alignment: 4, type: "u32" },
|
|
812
|
+
reserved: { offset: 20, size: 4, alignment: 4, type: "u32" },
|
|
813
|
+
track_foreground: { offset: 24, size: 8, alignment: 2, type: "[4]u16" },
|
|
814
|
+
track_background: { offset: 32, size: 8, alignment: 2, type: "[4]u16" }
|
|
815
|
+
}
|
|
816
|
+
},
|
|
817
|
+
ot_scene_scroll_options: {
|
|
818
|
+
size: 144,
|
|
819
|
+
alignment: 4,
|
|
820
|
+
fields: {
|
|
821
|
+
struct_size: { offset: 0, size: 4, alignment: 4, type: "u32" },
|
|
822
|
+
abi_version: { offset: 4, size: 4, alignment: 4, type: "u32" },
|
|
823
|
+
axes: { offset: 8, size: 4, alignment: 4, type: "u32" },
|
|
824
|
+
follow: { offset: 12, size: 4, alignment: 4, type: "u32" },
|
|
825
|
+
culling: { offset: 16, size: 4, alignment: 4, type: "u32" },
|
|
826
|
+
fills: { offset: 20, size: 4, alignment: 4, type: "u32" },
|
|
827
|
+
padding: { offset: 24, size: 16, alignment: 4, type: "[4]f32" },
|
|
828
|
+
wrapper_background: { offset: 40, size: 8, alignment: 2, type: "[4]u16" },
|
|
829
|
+
viewport_background: { offset: 48, size: 8, alignment: 2, type: "[4]u16" },
|
|
830
|
+
content_background: { offset: 56, size: 8, alignment: 2, type: "[4]u16" },
|
|
831
|
+
bars: { offset: 64, size: 80, alignment: 4, type: "[2]ot_scene_scroll_bar_options" }
|
|
832
|
+
}
|
|
833
|
+
},
|
|
834
|
+
ot_scene_scroll_bar_state: {
|
|
835
|
+
size: 120,
|
|
836
|
+
alignment: 8,
|
|
837
|
+
fields: {
|
|
838
|
+
visible: { offset: 0, size: 4, alignment: 4, type: "u32" },
|
|
839
|
+
reserved: { offset: 4, size: 4, alignment: 4, type: "u32" },
|
|
840
|
+
track: { offset: 8, size: 32, alignment: 8, type: "[4]f64" },
|
|
841
|
+
start_arrow: { offset: 40, size: 32, alignment: 8, type: "[4]f64" },
|
|
842
|
+
end_arrow: { offset: 72, size: 32, alignment: 8, type: "[4]f64" },
|
|
843
|
+
thumb_start: { offset: 104, size: 8, alignment: 8, type: "f64" },
|
|
844
|
+
thumb_size: { offset: 112, size: 8, alignment: 8, type: "f64" }
|
|
845
|
+
}
|
|
846
|
+
},
|
|
847
|
+
ot_scene_scroll_state: {
|
|
848
|
+
size: 360,
|
|
849
|
+
alignment: 8,
|
|
850
|
+
fields: {
|
|
851
|
+
struct_size: { offset: 0, size: 4, alignment: 4, type: "u32" },
|
|
852
|
+
abi_version: { offset: 4, size: 4, alignment: 4, type: "u32" },
|
|
853
|
+
stuck: { offset: 8, size: 4, alignment: 4, type: "u32" },
|
|
854
|
+
changes: { offset: 12, size: 4, alignment: 4, type: "u32" },
|
|
855
|
+
generation: { offset: 16, size: 8, alignment: 8, type: "u64" },
|
|
856
|
+
offset: { offset: 24, size: 16, alignment: 8, type: "[2]f64" },
|
|
857
|
+
max: { offset: 40, size: 16, alignment: 8, type: "[2]f64" },
|
|
858
|
+
content: { offset: 56, size: 32, alignment: 8, type: "[4]f64" },
|
|
859
|
+
viewport: { offset: 88, size: 32, alignment: 8, type: "[4]f64" },
|
|
860
|
+
bars: { offset: 120, size: 240, alignment: 8, type: "[2]ot_scene_scroll_bar_state" }
|
|
861
|
+
}
|
|
862
|
+
},
|
|
783
863
|
ot_session_options: {
|
|
784
864
|
size: 32,
|
|
785
865
|
alignment: 8,
|
|
@@ -849,7 +929,7 @@ var nativeLayouts = {
|
|
|
849
929
|
}
|
|
850
930
|
},
|
|
851
931
|
ot_session_renderer_state: {
|
|
852
|
-
size:
|
|
932
|
+
size: 40,
|
|
853
933
|
alignment: 8,
|
|
854
934
|
fields: {
|
|
855
935
|
struct_size: { offset: 0, size: 4, alignment: 4, type: "u32" },
|
|
@@ -858,7 +938,9 @@ var nativeLayouts = {
|
|
|
858
938
|
height: { offset: 12, size: 4, alignment: 4, type: "u32" },
|
|
859
939
|
frame_count: { offset: 16, size: 8, alignment: 8, type: "u64" },
|
|
860
940
|
frame_pending: { offset: 24, size: 4, alignment: 4, type: "u32" },
|
|
861
|
-
|
|
941
|
+
image_uploads_pending: { offset: 28, size: 4, alignment: 4, type: "u32" },
|
|
942
|
+
dropped_frames: { offset: 32, size: 4, alignment: 4, type: "u32" },
|
|
943
|
+
dropped_frame_bytes: { offset: 36, size: 4, alignment: 4, type: "u32" }
|
|
862
944
|
}
|
|
863
945
|
},
|
|
864
946
|
ot_buffer_options: {
|
|
@@ -1112,6 +1194,29 @@ var nativeLayouts = {
|
|
|
1112
1194
|
byte_count: { offset: 24, size: 8, alignment: 8, type: "u64" }
|
|
1113
1195
|
}
|
|
1114
1196
|
},
|
|
1197
|
+
ot_video_info: {
|
|
1198
|
+
size: 32,
|
|
1199
|
+
alignment: 8,
|
|
1200
|
+
fields: {
|
|
1201
|
+
duration_us: { offset: 0, size: 8, alignment: 8, type: "i64" },
|
|
1202
|
+
width: { offset: 8, size: 4, alignment: 4, type: "u32" },
|
|
1203
|
+
height: { offset: 12, size: 4, alignment: 4, type: "u32" },
|
|
1204
|
+
fps_num: { offset: 16, size: 4, alignment: 4, type: "u32" },
|
|
1205
|
+
fps_den: { offset: 20, size: 4, alignment: 4, type: "u32" },
|
|
1206
|
+
has_audio: { offset: 24, size: 4, alignment: 4, type: "u32" },
|
|
1207
|
+
reserved: { offset: 28, size: 4, alignment: 4, type: "u32" }
|
|
1208
|
+
}
|
|
1209
|
+
},
|
|
1210
|
+
ot_video_state: {
|
|
1211
|
+
size: 24,
|
|
1212
|
+
alignment: 8,
|
|
1213
|
+
fields: {
|
|
1214
|
+
current_time_us: { offset: 0, size: 8, alignment: 8, type: "i64" },
|
|
1215
|
+
frame_pts_us: { offset: 8, size: 8, alignment: 8, type: "i64" },
|
|
1216
|
+
flags: { offset: 16, size: 4, alignment: 4, type: "u32" },
|
|
1217
|
+
quality_tier: { offset: 20, size: 4, alignment: 4, type: "u32" }
|
|
1218
|
+
}
|
|
1219
|
+
},
|
|
1115
1220
|
ot_image_draw_options: {
|
|
1116
1221
|
size: 64,
|
|
1117
1222
|
alignment: 4,
|
|
@@ -1215,7 +1320,7 @@ var nativeLayouts = {
|
|
|
1215
1320
|
}
|
|
1216
1321
|
},
|
|
1217
1322
|
ot_buffer_draw_text_record: {
|
|
1218
|
-
size:
|
|
1323
|
+
size: 48,
|
|
1219
1324
|
alignment: 4,
|
|
1220
1325
|
fields: {
|
|
1221
1326
|
header: { offset: 0, size: 16, alignment: 4, type: "ot_buffer_draw_header" },
|
|
@@ -1223,7 +1328,8 @@ var nativeLayouts = {
|
|
|
1223
1328
|
y: { offset: 20, size: 4, alignment: 4, type: "i32" },
|
|
1224
1329
|
attributes: { offset: 24, size: 4, alignment: 4, type: "u32" },
|
|
1225
1330
|
foreground: { offset: 28, size: 8, alignment: 2, type: "[4]u16" },
|
|
1226
|
-
background: { offset: 36, size: 8, alignment: 2, type: "[4]u16" }
|
|
1331
|
+
background: { offset: 36, size: 8, alignment: 2, type: "[4]u16" },
|
|
1332
|
+
max_width: { offset: 44, size: 4, alignment: 4, type: "u32" }
|
|
1227
1333
|
}
|
|
1228
1334
|
},
|
|
1229
1335
|
ot_buffer_draw_cell: {
|
|
@@ -1637,6 +1743,7 @@ var nativeConstants = {
|
|
|
1637
1743
|
OT_IMAGE_OUTPUT_TOO_SMALL: -45,
|
|
1638
1744
|
OT_IMAGE_UNSUPPORTED_FEATURE: -46,
|
|
1639
1745
|
OT_IMAGE_BUSY: -47,
|
|
1746
|
+
OT_VIDEO_FAILED: -60,
|
|
1640
1747
|
OT_SCENE_ROOT: 0,
|
|
1641
1748
|
OT_SCENE_BOX: 1,
|
|
1642
1749
|
OT_SCENE_TEXT: 2,
|
|
@@ -1646,6 +1753,7 @@ var nativeConstants = {
|
|
|
1646
1753
|
OT_SCENE_CUSTOM: 6,
|
|
1647
1754
|
OT_SCENE_TEXT_VIEW: 7,
|
|
1648
1755
|
OT_SCENE_IMAGE: 8,
|
|
1756
|
+
OT_SCENE_VIDEO: 9,
|
|
1649
1757
|
OT_SCENE_WRAP_NONE: 0,
|
|
1650
1758
|
OT_SCENE_WRAP_CHAR: 1,
|
|
1651
1759
|
OT_SCENE_WRAP_WORD: 2,
|
|
@@ -1660,6 +1768,7 @@ var nativeConstants = {
|
|
|
1660
1768
|
OT_STYLE_BORDER_WIDTH: 0,
|
|
1661
1769
|
OT_STYLE_FLAGS_NONE: 0,
|
|
1662
1770
|
OT_STYLE_DISABLE_FLEX_SHRINK: 1,
|
|
1771
|
+
OT_STYLE_CONTENT: 2,
|
|
1663
1772
|
OT_STYLE_ENUM_DIRECTION: 0,
|
|
1664
1773
|
OT_STYLE_ENUM_FLEX_DIRECTION: 1,
|
|
1665
1774
|
OT_STYLE_ENUM_JUSTIFY_CONTENT: 2,
|
|
@@ -1787,6 +1896,10 @@ var nativeConstants = {
|
|
|
1787
1896
|
OT_SCENE_FULL_PATH_FORCED: 1,
|
|
1788
1897
|
OT_SCENE_FULL_PATH_SCREEN: 2,
|
|
1789
1898
|
OT_SCENE_FULL_PATH_IMAGES: 4,
|
|
1899
|
+
OT_SCENE_FULL_PATH_TAINTED: 8,
|
|
1900
|
+
OT_SCENE_FULL_PATH_UNRETAINED: 16,
|
|
1901
|
+
OT_SCENE_FULL_PATH_OPTIONS: 32,
|
|
1902
|
+
OT_SCENE_FULL_PATH_NON_LOCAL: 64,
|
|
1790
1903
|
OT_SCENE_HOOK_UPDATE: 1,
|
|
1791
1904
|
OT_SCENE_HOOK_RESIZE: 2,
|
|
1792
1905
|
OT_SCENE_HOOK_LAYOUT_CHANGED: 4,
|
|
@@ -1794,11 +1907,13 @@ var nativeConstants = {
|
|
|
1794
1907
|
OT_SCENE_HOOK_RENDER_AFTER: 16,
|
|
1795
1908
|
OT_SCENE_HOOK_RENDER_SELF: 32,
|
|
1796
1909
|
OT_SCENE_HOOK_IDLE_UPDATE: 64,
|
|
1910
|
+
OT_SCENE_HOOK_SCROLL: 128,
|
|
1797
1911
|
OT_SCENE_FRAME_DONE: 0,
|
|
1798
1912
|
OT_SCENE_FRAME_UPDATE: 1,
|
|
1799
1913
|
OT_SCENE_FRAME_RESIZE: 2,
|
|
1800
1914
|
OT_SCENE_FRAME_LAYOUT_CHANGED: 3,
|
|
1801
1915
|
OT_SCENE_FRAME_RECORD: 4,
|
|
1916
|
+
OT_SCENE_FRAME_SCROLL: 5,
|
|
1802
1917
|
OT_SCENE_GEOMETRY_PAINT: 1,
|
|
1803
1918
|
OT_SCENE_GEOMETRY_PUBLIC: 2,
|
|
1804
1919
|
OT_SCENE_PROPERTY_Z_INDEX: 1,
|
|
@@ -1816,7 +1931,37 @@ var nativeConstants = {
|
|
|
1816
1931
|
OT_SCENE_PROPERTY_RESET_BORDER_CHARACTERS: 4096,
|
|
1817
1932
|
OT_SCENE_PROPERTY_RECORD_MAX: 88,
|
|
1818
1933
|
OT_SCENE_PROPERTY_BYTES_MAX: 360448,
|
|
1934
|
+
OT_SCENE_SCROLL_X: 1,
|
|
1935
|
+
OT_SCENE_SCROLL_Y: 2,
|
|
1936
|
+
OT_SCENE_SCROLL_FOLLOW_NONE: 0,
|
|
1937
|
+
OT_SCENE_SCROLL_FOLLOW_TOP: 1,
|
|
1938
|
+
OT_SCENE_SCROLL_FOLLOW_BOTTOM: 2,
|
|
1939
|
+
OT_SCENE_SCROLL_FOLLOW_LEFT: 3,
|
|
1940
|
+
OT_SCENE_SCROLL_FOLLOW_RIGHT: 4,
|
|
1941
|
+
OT_SCENE_SCROLL_FILL_WRAPPER: 1,
|
|
1942
|
+
OT_SCENE_SCROLL_FILL_VIEWPORT: 2,
|
|
1943
|
+
OT_SCENE_SCROLL_FILL_CONTENT: 4,
|
|
1944
|
+
OT_SCENE_SCROLL_BAR_AUTO: 0,
|
|
1945
|
+
OT_SCENE_SCROLL_BAR_ALWAYS: 1,
|
|
1946
|
+
OT_SCENE_SCROLL_BAR_NEVER: 2,
|
|
1947
|
+
OT_SCENE_SCROLL_BAR_INSET: 0,
|
|
1948
|
+
OT_SCENE_SCROLL_BAR_OVERLAY: 1,
|
|
1949
|
+
OT_SCENE_SCROLL_RELATIVE_X: 1,
|
|
1950
|
+
OT_SCENE_SCROLL_RELATIVE_Y: 2,
|
|
1951
|
+
OT_SCENE_SCROLL_REAPPLY: 4,
|
|
1952
|
+
OT_SCENE_SCROLL_REQUEST_INTO_VIEW: 0,
|
|
1953
|
+
OT_SCENE_SCROLL_REQUEST_ANCHOR: 1,
|
|
1954
|
+
OT_SCENE_SCROLL_REQUEST_LAYOUT: 2,
|
|
1955
|
+
OT_SCENE_SCROLL_ALIGN_NEAREST: 0,
|
|
1956
|
+
OT_SCENE_SCROLL_ALIGN_START: 1,
|
|
1957
|
+
OT_SCENE_SCROLL_ALIGN_END: 2,
|
|
1958
|
+
OT_SCENE_SCROLL_CHANGED_OFFSET_X: 1,
|
|
1959
|
+
OT_SCENE_SCROLL_CHANGED_OFFSET_Y: 2,
|
|
1960
|
+
OT_SCENE_SCROLL_CHANGED_CONTENT: 4,
|
|
1961
|
+
OT_SCENE_SCROLL_CHANGED_VIEWPORT: 8,
|
|
1962
|
+
OT_SCENE_SCROLL_CHANGED_LAYOUT: 16,
|
|
1819
1963
|
OT_SCENE_DEBUG_FULL_FRAME: 1,
|
|
1964
|
+
OT_SCENE_DEBUG_VERIFY: 2,
|
|
1820
1965
|
OT_SESSION_OPEN: 0,
|
|
1821
1966
|
OT_SESSION_CLOSING: 1,
|
|
1822
1967
|
OT_SESSION_CLOSED_STATE: 2,
|
|
@@ -1903,6 +2048,8 @@ var nativeConstants = {
|
|
|
1903
2048
|
OT_EDIT_POSITION_OFFSET: 4,
|
|
1904
2049
|
OT_EDIT_POSITION_COORDS: 5,
|
|
1905
2050
|
OT_EDIT_POSITION_LINE_START: 6,
|
|
2051
|
+
OT_EDIT_POSITION_END: 7,
|
|
2052
|
+
OT_EDIT_POSITION_PREV_CHAR: 8,
|
|
1906
2053
|
OT_EDITOR_STYLE_FOREGROUND: 1,
|
|
1907
2054
|
OT_EDITOR_STYLE_BACKGROUND: 2,
|
|
1908
2055
|
OT_EDITOR_STYLE_ATTRIBUTES: 4,
|
|
@@ -1982,6 +2129,13 @@ var nativeConstants = {
|
|
|
1982
2129
|
OT_IMAGE_BLEND_SOURCE_OVER: 0,
|
|
1983
2130
|
OT_IMAGE_BLEND_SOURCE: 1,
|
|
1984
2131
|
OT_IMAGE_BLEND_DESTINATION_OVER: 2,
|
|
2132
|
+
OT_VIDEO_OPEN_NO_AUDIO: 1,
|
|
2133
|
+
OT_VIDEO_PLAYING: 1,
|
|
2134
|
+
OT_VIDEO_ENDED: 2,
|
|
2135
|
+
OT_VIDEO_BUFFERING: 4,
|
|
2136
|
+
OT_VIDEO_AUDIO: 8,
|
|
2137
|
+
OT_VIDEO_HAS_FRAME: 16,
|
|
2138
|
+
OT_VIDEO_ERROR: 32,
|
|
1985
2139
|
OT_TEXT_VIEW_WRAP_WIDTH: 0,
|
|
1986
2140
|
OT_TEXT_VIEW_WRAP_MODE: 1,
|
|
1987
2141
|
OT_TEXT_VIEW_FIRST_LINE_OFFSET: 2,
|
|
@@ -2005,6 +2159,7 @@ var nativeConstants = {
|
|
|
2005
2159
|
OT_BUFFER_DRAW_HAS_BACKGROUND: 1,
|
|
2006
2160
|
OT_BUFFER_DRAW_HAS_SOURCE_WIDTH: 2,
|
|
2007
2161
|
OT_BUFFER_DRAW_HAS_SOURCE_HEIGHT: 4,
|
|
2162
|
+
OT_BUFFER_DRAW_FIT_ELLIPSIS: 16,
|
|
2008
2163
|
OT_BUFFER_STACK_DEPTH_MAX: 256,
|
|
2009
2164
|
OT_BUFFER_STACK_GET_OPACITY: 0,
|
|
2010
2165
|
OT_BUFFER_STACK_PUSH_SCISSOR: 1,
|
|
@@ -2020,6 +2175,10 @@ var nativeConstants = {
|
|
|
2020
2175
|
OT_TERMINAL_MOUSE: 2,
|
|
2021
2176
|
OT_TERMINAL_MOUSE_MOVEMENT: 4,
|
|
2022
2177
|
OT_TERMINAL_CLEAR_ON_CLOSE: 8,
|
|
2178
|
+
OT_TERMINAL_REPLY_SENTINEL: 16,
|
|
2179
|
+
OT_TERMINAL_SYNC_ALWAYS: 32,
|
|
2180
|
+
OT_TERMINAL_SYNC_NEVER: 64,
|
|
2181
|
+
OT_TERMINAL_HOST_MULTIPLEXER: 128,
|
|
2023
2182
|
OT_CONTROL_CAPABILITY_RESPONSE: 1,
|
|
2024
2183
|
OT_CONTROL_TITLE: 2,
|
|
2025
2184
|
OT_CONTROL_MOUSE: 3,
|
|
@@ -2079,6 +2238,8 @@ var nativeConstants = {
|
|
|
2079
2238
|
OT_PUMP_OUTPUT_PENDING: 2,
|
|
2080
2239
|
OT_PUMP_WAIT_UNTIL: 3,
|
|
2081
2240
|
OT_PUMP_CLOSED: 4,
|
|
2241
|
+
OT_STDOUT_IDLE: 0,
|
|
2242
|
+
OT_STDOUT_IN_FLIGHT: 1,
|
|
2082
2243
|
OT_INPUT_KEY: 1,
|
|
2083
2244
|
OT_INPUT_MOUSE: 2,
|
|
2084
2245
|
OT_INPUT_PASTE: 3,
|
|
@@ -2187,6 +2348,7 @@ var nativeConstants = {
|
|
|
2187
2348
|
OT_INPUT_EXPECT_REPLIES: 1,
|
|
2188
2349
|
OT_INPUT_EXPECT_KITTY_KEYBOARD: 2,
|
|
2189
2350
|
OT_INPUT_EXPECT_CURSOR_POSITION: 4,
|
|
2351
|
+
OT_INPUT_EXPECT_SENTINEL: 8,
|
|
2190
2352
|
OT_INPUT_EVENTS_MIN: 4,
|
|
2191
2353
|
OT_INPUT_PAYLOAD_BYTES_MIN: 4384,
|
|
2192
2354
|
OT_INPUT_TIMEOUT_NS: 20000000,
|
|
@@ -2206,7 +2368,7 @@ var nativeConstants = {
|
|
|
2206
2368
|
OT_SCENE_RECORD_COLOR_MATRIX: 7,
|
|
2207
2369
|
OT_SCENE_RECORD_TEXT_VIEW: 8,
|
|
2208
2370
|
OT_SCENE_RECORD_EDITOR_VIEW: 9,
|
|
2209
|
-
|
|
2371
|
+
OT_SCENE_RECORD_SCENE_BODY: 10,
|
|
2210
2372
|
OT_SCENE_RECORD_IMAGE: 11,
|
|
2211
2373
|
OT_SCENE_RECORD_UNICODE: 12,
|
|
2212
2374
|
OT_SCENE_RECORD_GRAYSCALE_FOREGROUND: 1,
|
|
@@ -3928,21 +4090,21 @@ var YogaValueKind = {
|
|
|
3928
4090
|
Position: nativeConstants.OT_STYLE_VALUE_POSITION,
|
|
3929
4091
|
Gap: nativeConstants.OT_STYLE_VALUE_GAP
|
|
3930
4092
|
};
|
|
3931
|
-
function sceneSetEnum(scene, node, kind, value) {
|
|
3932
|
-
scene.setStyle(node, NativeStyleGroup.Enum, kind, NATIVE_EDGE_NONE2, Unit2.Undefined, value);
|
|
4093
|
+
function sceneSetEnum(scene, node, kind, value, flags = NativeStyleFlags.None) {
|
|
4094
|
+
scene.setStyle(node, NativeStyleGroup.Enum, kind, NATIVE_EDGE_NONE2, Unit2.Undefined, value, flags);
|
|
3933
4095
|
}
|
|
3934
4096
|
function sceneGetEnum(scene, node, kind) {
|
|
3935
4097
|
return scene.getStyle(node, NativeStyleGroup.Enum, kind, NATIVE_EDGE_NONE2).value;
|
|
3936
4098
|
}
|
|
3937
|
-
function sceneSetFloat(scene, node, kind, value) {
|
|
3938
|
-
scene.setStyle(node, NativeStyleGroup.Float, kind, NATIVE_EDGE_NONE2, Unit2.Undefined, value ?? NaN);
|
|
4099
|
+
function sceneSetFloat(scene, node, kind, value, flags = NativeStyleFlags.None) {
|
|
4100
|
+
scene.setStyle(node, NativeStyleGroup.Float, kind, NATIVE_EDGE_NONE2, Unit2.Undefined, value ?? NaN, flags);
|
|
3939
4101
|
}
|
|
3940
4102
|
function sceneGetFloat(scene, node, kind) {
|
|
3941
4103
|
return scene.getStyle(node, NativeStyleGroup.Float, kind, NATIVE_EDGE_NONE2).value;
|
|
3942
4104
|
}
|
|
3943
|
-
function sceneSetValue(scene, node, kind, edge, valueInput) {
|
|
4105
|
+
function sceneSetValue(scene, node, kind, edge, valueInput, flags = NativeStyleFlags.None) {
|
|
3944
4106
|
const value = parseYogaValue(valueInput);
|
|
3945
|
-
scene.setStyle(node, NativeStyleGroup.Value, kind, edge, value.unit, value.value);
|
|
4107
|
+
scene.setStyle(node, NativeStyleGroup.Value, kind, edge, value.unit, value.value, flags);
|
|
3946
4108
|
}
|
|
3947
4109
|
function sceneGetValue(scene, node, kind, edge) {
|
|
3948
4110
|
return scene.getStyle(node, NativeStyleGroup.Value, kind, edge);
|
|
@@ -5641,6 +5803,8 @@ var NativeEditPositionQuery2;
|
|
|
5641
5803
|
NativeEditPositionQuery[NativeEditPositionQuery["Offset"] = 4] = "Offset";
|
|
5642
5804
|
NativeEditPositionQuery[NativeEditPositionQuery["Coords"] = 5] = "Coords";
|
|
5643
5805
|
NativeEditPositionQuery[NativeEditPositionQuery["LineStart"] = 6] = "LineStart";
|
|
5806
|
+
NativeEditPositionQuery[NativeEditPositionQuery["End"] = 7] = "End";
|
|
5807
|
+
NativeEditPositionQuery[NativeEditPositionQuery["PrevChar"] = 8] = "PrevChar";
|
|
5644
5808
|
})(NativeEditPositionQuery2 ||= {});
|
|
5645
5809
|
var NativeEditorStyleMask2;
|
|
5646
5810
|
((NativeEditorStyleMask) => {
|
|
@@ -5708,6 +5872,7 @@ var NativeStyleFlags;
|
|
|
5708
5872
|
((NativeStyleFlags) => {
|
|
5709
5873
|
NativeStyleFlags[NativeStyleFlags["None"] = nativeConstants.OT_STYLE_FLAGS_NONE] = "None";
|
|
5710
5874
|
NativeStyleFlags[NativeStyleFlags["DisableFlexShrink"] = nativeConstants.OT_STYLE_DISABLE_FLEX_SHRINK] = "DisableFlexShrink";
|
|
5875
|
+
NativeStyleFlags[NativeStyleFlags["Content"] = nativeConstants.OT_STYLE_CONTENT] = "Content";
|
|
5711
5876
|
})(NativeStyleFlags ||= {});
|
|
5712
5877
|
var NATIVE_EDGE_NONE2 = nativeConstants.OT_EDGE_NONE;
|
|
5713
5878
|
var NativeBorder2;
|
|
@@ -5728,6 +5893,7 @@ var NativeSceneHook2;
|
|
|
5728
5893
|
NativeSceneHook[NativeSceneHook["RenderAfter"] = nativeConstants.OT_SCENE_HOOK_RENDER_AFTER] = "RenderAfter";
|
|
5729
5894
|
NativeSceneHook[NativeSceneHook["RenderSelf"] = nativeConstants.OT_SCENE_HOOK_RENDER_SELF] = "RenderSelf";
|
|
5730
5895
|
NativeSceneHook[NativeSceneHook["IdleUpdate"] = nativeConstants.OT_SCENE_HOOK_IDLE_UPDATE] = "IdleUpdate";
|
|
5896
|
+
NativeSceneHook[NativeSceneHook["Scroll"] = nativeConstants.OT_SCENE_HOOK_SCROLL] = "Scroll";
|
|
5731
5897
|
})(NativeSceneHook2 ||= {});
|
|
5732
5898
|
var NativeSceneFrame2;
|
|
5733
5899
|
((NativeSceneFrame) => {
|
|
@@ -5736,6 +5902,7 @@ var NativeSceneFrame2;
|
|
|
5736
5902
|
NativeSceneFrame[NativeSceneFrame["Resize"] = nativeConstants.OT_SCENE_FRAME_RESIZE] = "Resize";
|
|
5737
5903
|
NativeSceneFrame[NativeSceneFrame["LayoutChanged"] = nativeConstants.OT_SCENE_FRAME_LAYOUT_CHANGED] = "LayoutChanged";
|
|
5738
5904
|
NativeSceneFrame[NativeSceneFrame["Record"] = nativeConstants.OT_SCENE_FRAME_RECORD] = "Record";
|
|
5905
|
+
NativeSceneFrame[NativeSceneFrame["Scroll"] = nativeConstants.OT_SCENE_FRAME_SCROLL] = "Scroll";
|
|
5739
5906
|
})(NativeSceneFrame2 ||= {});
|
|
5740
5907
|
var NativeScenePaintPhase2;
|
|
5741
5908
|
((NativeScenePaintPhase) => {
|
|
@@ -5743,6 +5910,42 @@ var NativeScenePaintPhase2;
|
|
|
5743
5910
|
NativeScenePaintPhase[NativeScenePaintPhase["Self"] = nativeConstants.OT_SCENE_RECORD_PHASE_SELF] = "Self";
|
|
5744
5911
|
NativeScenePaintPhase[NativeScenePaintPhase["After"] = nativeConstants.OT_SCENE_RECORD_PHASE_AFTER] = "After";
|
|
5745
5912
|
})(NativeScenePaintPhase2 ||= {});
|
|
5913
|
+
var SCENE_SCROLL_FOLLOW = ["none", "top", "bottom", "left", "right"];
|
|
5914
|
+
var SCENE_SCROLL_BAR_POLICY = ["auto", "always", "never"];
|
|
5915
|
+
var SCENE_SCROLL_REQUESTS = ["into-view", "anchor", "layout"];
|
|
5916
|
+
var SCENE_SCROLL_ALIGNS = ["nearest", "start", "end"];
|
|
5917
|
+
function readSceneRect(values, index) {
|
|
5918
|
+
return { x: values[index], y: values[index + 1], width: values[index + 2], height: values[index + 3] };
|
|
5919
|
+
}
|
|
5920
|
+
function emptySceneScrollState() {
|
|
5921
|
+
return readSceneScrollState(new Uint32Array(nativeLayouts.ot_scene_scroll_state.size / 4));
|
|
5922
|
+
}
|
|
5923
|
+
function readSceneScrollState(record) {
|
|
5924
|
+
const { fields } = nativeLayouts.ot_scene_scroll_state;
|
|
5925
|
+
const bar = nativeLayouts.ot_scene_scroll_bar_state;
|
|
5926
|
+
const values = new Float64Array(record.buffer);
|
|
5927
|
+
const readBar = (axis) => {
|
|
5928
|
+
const base = fields.bars.offset + axis * bar.size;
|
|
5929
|
+
return {
|
|
5930
|
+
visible: record[(base + bar.fields.visible.offset) / 4] !== 0,
|
|
5931
|
+
track: readSceneRect(values, (base + bar.fields.track.offset) / 8),
|
|
5932
|
+
startArrow: readSceneRect(values, (base + bar.fields.start_arrow.offset) / 8),
|
|
5933
|
+
endArrow: readSceneRect(values, (base + bar.fields.end_arrow.offset) / 8),
|
|
5934
|
+
thumbStart: values[(base + bar.fields.thumb_start.offset) / 8],
|
|
5935
|
+
thumbSize: values[(base + bar.fields.thumb_size.offset) / 8]
|
|
5936
|
+
};
|
|
5937
|
+
};
|
|
5938
|
+
const offset = fields.offset.offset / 8;
|
|
5939
|
+
const max = fields.max.offset / 8;
|
|
5940
|
+
return {
|
|
5941
|
+
changes: record[fields.changes.offset / 4],
|
|
5942
|
+
offset: [values[offset], values[offset + 1]],
|
|
5943
|
+
max: [values[max], values[max + 1]],
|
|
5944
|
+
content: readSceneRect(values, fields.content.offset / 8),
|
|
5945
|
+
viewport: readSceneRect(values, fields.viewport.offset / 8),
|
|
5946
|
+
bars: [readBar(0), readBar(1)]
|
|
5947
|
+
};
|
|
5948
|
+
}
|
|
5746
5949
|
var NATIVE_BUFFER_TEXT_BYTES_MAX2 = nativeConstants.OT_BUFFER_TEXT_BYTES_MAX;
|
|
5747
5950
|
var NativeSessionState2;
|
|
5748
5951
|
((NativeSessionState) => {
|
|
@@ -5812,6 +6015,7 @@ var NativeStatus2;
|
|
|
5812
6015
|
NativeStatus[NativeStatus["LayoutLimit"] = -26] = "LayoutLimit";
|
|
5813
6016
|
NativeStatus[NativeStatus["FrameBusy"] = -27] = "FrameBusy";
|
|
5814
6017
|
NativeStatus[NativeStatus["FrameRequestLimit"] = -28] = "FrameRequestLimit";
|
|
6018
|
+
NativeStatus[NativeStatus["VideoFailed"] = -60] = "VideoFailed";
|
|
5815
6019
|
})(NativeStatus2 ||= {});
|
|
5816
6020
|
|
|
5817
6021
|
class NativeError2 extends Error {
|
|
@@ -5943,6 +6147,12 @@ registerEnvVar2({
|
|
|
5943
6147
|
type: "string",
|
|
5944
6148
|
required: false
|
|
5945
6149
|
});
|
|
6150
|
+
registerEnvVar2({
|
|
6151
|
+
name: "OPENTUI_EXPERIMENTAL_VIDEO_HWACCEL",
|
|
6152
|
+
description: "Experimental: decode video with VideoToolbox on macOS when set to exactly 1 or true; otherwise or on failure, decode in software",
|
|
6153
|
+
type: "string",
|
|
6154
|
+
required: false
|
|
6155
|
+
});
|
|
5946
6156
|
var CURSOR_STYLE_TO_ID = { block: 0, line: 1, underline: 2, default: 3 };
|
|
5947
6157
|
var CURSOR_ID_TO_STYLE = ["block", "line", "underline", "default"];
|
|
5948
6158
|
var PROGRAM_STATE_TO_ID = {
|
|
@@ -5999,7 +6209,18 @@ var MOUSE_STYLE_TO_ID = {
|
|
|
5999
6209
|
var SCENE_BORDER_STYLES = ["single", "double", "rounded", "heavy"];
|
|
6000
6210
|
var SCENE_TEXT_WRAP_MODES = ["none", "char", "word"];
|
|
6001
6211
|
var SCENE_TEXT_ALIGNS = ["left", "center", "right"];
|
|
6002
|
-
var SCENE_NODE_KINDS = [
|
|
6212
|
+
var SCENE_NODE_KINDS = [
|
|
6213
|
+
"root",
|
|
6214
|
+
"box",
|
|
6215
|
+
"text",
|
|
6216
|
+
"slider",
|
|
6217
|
+
"arrow",
|
|
6218
|
+
"editor",
|
|
6219
|
+
"custom",
|
|
6220
|
+
"text_view",
|
|
6221
|
+
"image",
|
|
6222
|
+
"video"
|
|
6223
|
+
];
|
|
6003
6224
|
var IMAGE_PROTOCOL_TO_ID = { auto: 0, kitty: 1, sixel: 2, blocks: 3 };
|
|
6004
6225
|
var IMAGE_FITS = ["fit", "cover", "fill"];
|
|
6005
6226
|
var BUFFER_DRAW_OPERATIONS = new Map([
|
|
@@ -6032,8 +6253,6 @@ function readFrameWork(layout, output, words) {
|
|
|
6032
6253
|
const result = {};
|
|
6033
6254
|
let counting = false;
|
|
6034
6255
|
for (const [field, { offset, type }] of Object.entries(layout.fields)) {
|
|
6035
|
-
if (field === "reserved")
|
|
6036
|
-
break;
|
|
6037
6256
|
counting ||= field === "work_frame_id";
|
|
6038
6257
|
if (!counting)
|
|
6039
6258
|
continue;
|
|
@@ -6081,6 +6300,11 @@ function toFFIBool(value, label) {
|
|
|
6081
6300
|
throw new TypeError(`${label} must be a boolean`);
|
|
6082
6301
|
return ffiBool(value);
|
|
6083
6302
|
}
|
|
6303
|
+
var SYNCHRONIZED_OUTPUT_FLAGS = {
|
|
6304
|
+
auto: 0,
|
|
6305
|
+
always: nativeConstants.OT_TERMINAL_SYNC_ALWAYS,
|
|
6306
|
+
never: nativeConstants.OT_TERMINAL_SYNC_NEVER
|
|
6307
|
+
};
|
|
6084
6308
|
function toFFIF32(value, label, allowNaN = false) {
|
|
6085
6309
|
if (allowNaN && Number.isNaN(value))
|
|
6086
6310
|
return value;
|
|
@@ -6373,8 +6597,8 @@ function encodeBufferDrawRecord(context, options, words, signed, colors, base, s
|
|
|
6373
6597
|
const fields = nativeLayouts.ot_buffer_draw_text_record.fields;
|
|
6374
6598
|
encodeDrawPosition(signed, fields, options, base);
|
|
6375
6599
|
words[word + fields.attributes.offset / 4] = toSafeFFIU32Length(options.attributes ?? 0, "Buffer attributes");
|
|
6376
|
-
|
|
6377
|
-
|
|
6600
|
+
words[word + fields.max_width.offset / 4] = toSafeFFIU32Length(options.maxWidth ?? 0, "Buffer text width");
|
|
6601
|
+
words[word + header.flags.offset / 4] = (encodeDrawColors(colors, fields, options, base) ? nativeConstants.OT_BUFFER_DRAW_HAS_BACKGROUND : 0) | (options.ellipsis ? nativeConstants.OT_BUFFER_DRAW_FIT_ELLIPSIS : 0);
|
|
6378
6602
|
break;
|
|
6379
6603
|
}
|
|
6380
6604
|
case "cell":
|
|
@@ -7209,7 +7433,7 @@ class NativePaintRecorder {
|
|
|
7209
7433
|
view(operation, source, x, y) {
|
|
7210
7434
|
this.transaction(() => {
|
|
7211
7435
|
const layout = nativeLayouts.ot_scene_record_view;
|
|
7212
|
-
const base = this.reserve(operation === "text" ? nativeConstants.OT_SCENE_RECORD_TEXT_VIEW : operation === "editor" ? nativeConstants.OT_SCENE_RECORD_EDITOR_VIEW : nativeConstants.
|
|
7436
|
+
const base = this.reserve(operation === "text" ? nativeConstants.OT_SCENE_RECORD_TEXT_VIEW : operation === "editor" ? nativeConstants.OT_SCENE_RECORD_EDITOR_VIEW : nativeConstants.OT_SCENE_RECORD_SCENE_BODY, layout.size);
|
|
7213
7437
|
this.encodeHandle(source, base + layout.fields.source.offset);
|
|
7214
7438
|
this.signed[(base + layout.fields.x.offset) / 4] = toFFII32(x, "View x");
|
|
7215
7439
|
this.signed[(base + layout.fields.y.offset) / 4] = toFFII32(y, "View y");
|
|
@@ -7911,6 +8135,8 @@ class FFIRenderLib2 {
|
|
|
7911
8135
|
sceneFlushApplied = new Uint32Array(1);
|
|
7912
8136
|
editorSelectionRecord = createEditorSelectionRecord();
|
|
7913
8137
|
editorViewInfoRecord = createContextRecord(nativeLayouts.ot_editor_view_info);
|
|
8138
|
+
videoStateRecord = new Uint8Array(nativeLayouts.ot_video_state.size);
|
|
8139
|
+
videoStateView = new DataView(this.videoStateRecord.buffer);
|
|
7914
8140
|
selectionResetRecord = encodeEditorSelection({ operation: 2 /* Reset */ });
|
|
7915
8141
|
localSelectionResetRecord = encodeEditorSelection({
|
|
7916
8142
|
operation: 5 /* LocalReset */
|
|
@@ -8721,15 +8947,15 @@ class FFIRenderLib2 {
|
|
|
8721
8947
|
const pointer = this.nativeContextPointer(context, "ot_buffer_draw_editor_view");
|
|
8722
8948
|
nativeResult("ot_buffer_draw_editor_view", this.opentui.symbols.ot_buffer_draw_editor_view(pointer, destination, request, source, column, row));
|
|
8723
8949
|
}
|
|
8724
|
-
|
|
8950
|
+
contextDrawSceneBody({ context, target, frame }, node, x, y) {
|
|
8725
8951
|
this.getYogaHost().assertMutable();
|
|
8726
8952
|
const destination = encodeContextHandle(context, target);
|
|
8727
8953
|
const request = frame === null ? null : encodeSceneFrameRequest(context, frame);
|
|
8728
8954
|
const source = encodeContextHandle(context, node);
|
|
8729
|
-
const column = toFFII32(x, "Scene
|
|
8730
|
-
const row = toFFII32(y, "Scene
|
|
8731
|
-
const pointer = this.nativeContextPointer(context, "
|
|
8732
|
-
nativeResult("
|
|
8955
|
+
const column = toFFII32(x, "Scene body x");
|
|
8956
|
+
const row = toFFII32(y, "Scene body y");
|
|
8957
|
+
const pointer = this.nativeContextPointer(context, "ot_buffer_draw_scene_body");
|
|
8958
|
+
nativeResult("ot_buffer_draw_scene_body", this.opentui.symbols.ot_buffer_draw_scene_body(pointer, destination, request, source, column, row));
|
|
8733
8959
|
}
|
|
8734
8960
|
createContextEditBuffer(context, options = {}) {
|
|
8735
8961
|
const layout = nativeLayouts.ot_edit_buffer_options;
|
|
@@ -9256,6 +9482,129 @@ class FFIRenderLib2 {
|
|
|
9256
9482
|
nativeResult("ot_scene_set_image", this.opentui.symbols.ot_scene_set_image(pointer, handle, source, fitId, protocolId, storage));
|
|
9257
9483
|
});
|
|
9258
9484
|
}
|
|
9485
|
+
sceneSetVideo(context, node, fit, buffer) {
|
|
9486
|
+
const handle = encodeContextHandle(context, node);
|
|
9487
|
+
const storage = buffer === null ? null : encodeContextHandle(context, buffer);
|
|
9488
|
+
const fitId = IMAGE_FITS.indexOf(fit);
|
|
9489
|
+
if (fitId < 0)
|
|
9490
|
+
throw new TypeError("Unknown video fit");
|
|
9491
|
+
this.getYogaHost().runMutation(() => {
|
|
9492
|
+
const pointer = this.nativeContextPointer(context, "ot_scene_set_video");
|
|
9493
|
+
nativeResult("ot_scene_set_video", this.opentui.symbols.ot_scene_set_video(pointer, handle, fitId, storage));
|
|
9494
|
+
});
|
|
9495
|
+
}
|
|
9496
|
+
sceneSetCrop(context, node, crop) {
|
|
9497
|
+
const handle = encodeContextHandle(context, node);
|
|
9498
|
+
const { left = 0, top = 0, width = 0, height = 0 } = crop ?? {};
|
|
9499
|
+
this.getYogaHost().runMutation(() => {
|
|
9500
|
+
const pointer = this.nativeContextPointer(context, "ot_scene_set_crop");
|
|
9501
|
+
nativeResult("ot_scene_set_crop", this.opentui.symbols.ot_scene_set_crop(pointer, handle, left, top, width, height));
|
|
9502
|
+
});
|
|
9503
|
+
}
|
|
9504
|
+
videoOpen(context, node, path, audio) {
|
|
9505
|
+
const handle = encodeContextHandle(context, node);
|
|
9506
|
+
const bytes = path.length === 0 ? null : sessionBytes(this.encoder.encode(path), "Video path length");
|
|
9507
|
+
const layout = nativeLayouts.ot_video_info;
|
|
9508
|
+
const output = new Uint8Array(layout.size);
|
|
9509
|
+
const flags = audio ? 0 : nativeConstants.OT_VIDEO_OPEN_NO_AUDIO;
|
|
9510
|
+
this.getYogaHost().runMutation(() => {
|
|
9511
|
+
const pointer = this.nativeContextPointer(context, "ot_video_open");
|
|
9512
|
+
nativeResult("ot_video_open", this.opentui.symbols.ot_video_open(pointer, handle, bytes, bytes?.byteLength ?? 0, flags, output));
|
|
9513
|
+
});
|
|
9514
|
+
const view = new DataView(output.buffer);
|
|
9515
|
+
const fields = layout.fields;
|
|
9516
|
+
return {
|
|
9517
|
+
durationUs: view.getBigInt64(fields.duration_us.offset, true),
|
|
9518
|
+
width: view.getUint32(fields.width.offset, true),
|
|
9519
|
+
height: view.getUint32(fields.height.offset, true),
|
|
9520
|
+
fpsNum: view.getUint32(fields.fps_num.offset, true),
|
|
9521
|
+
fpsDen: view.getUint32(fields.fps_den.offset, true),
|
|
9522
|
+
hasAudio: view.getUint32(fields.has_audio.offset, true) !== 0
|
|
9523
|
+
};
|
|
9524
|
+
}
|
|
9525
|
+
videoCall(context, node, operation) {
|
|
9526
|
+
const handle = encodeContextHandle(context, node);
|
|
9527
|
+
this.getYogaHost().runMutation(() => {
|
|
9528
|
+
const pointer = this.nativeContextPointer(context, operation);
|
|
9529
|
+
nativeResult(operation, this.opentui.symbols[operation](pointer, handle));
|
|
9530
|
+
});
|
|
9531
|
+
}
|
|
9532
|
+
videoSeek(context, node, timeUs) {
|
|
9533
|
+
const handle = encodeContextHandle(context, node);
|
|
9534
|
+
this.getYogaHost().runMutation(() => {
|
|
9535
|
+
const pointer = this.nativeContextPointer(context, "ot_video_seek");
|
|
9536
|
+
nativeResult("ot_video_seek", this.opentui.symbols.ot_video_seek(pointer, handle, timeUs));
|
|
9537
|
+
});
|
|
9538
|
+
}
|
|
9539
|
+
videoSetLoop(context, node, loop) {
|
|
9540
|
+
const handle = encodeContextHandle(context, node);
|
|
9541
|
+
const value = toFFIBool(loop, "Video loop");
|
|
9542
|
+
this.getYogaHost().runMutation(() => {
|
|
9543
|
+
const pointer = this.nativeContextPointer(context, "ot_video_set_loop");
|
|
9544
|
+
nativeResult("ot_video_set_loop", this.opentui.symbols.ot_video_set_loop(pointer, handle, value));
|
|
9545
|
+
});
|
|
9546
|
+
}
|
|
9547
|
+
videoSetMuted(context, node, muted) {
|
|
9548
|
+
const handle = encodeContextHandle(context, node);
|
|
9549
|
+
const value = toFFIBool(muted, "Video muted");
|
|
9550
|
+
this.getYogaHost().runMutation(() => {
|
|
9551
|
+
const pointer = this.nativeContextPointer(context, "ot_video_set_muted");
|
|
9552
|
+
nativeResult("ot_video_set_muted", this.opentui.symbols.ot_video_set_muted(pointer, handle, value));
|
|
9553
|
+
});
|
|
9554
|
+
}
|
|
9555
|
+
videoSetVolume(context, node, volume) {
|
|
9556
|
+
const handle = encodeContextHandle(context, node);
|
|
9557
|
+
const value = toFFIF32(volume, "Video volume");
|
|
9558
|
+
this.getYogaHost().runMutation(() => {
|
|
9559
|
+
const pointer = this.nativeContextPointer(context, "ot_video_set_volume");
|
|
9560
|
+
nativeResult("ot_video_set_volume", this.opentui.symbols.ot_video_set_volume(pointer, handle, value));
|
|
9561
|
+
});
|
|
9562
|
+
}
|
|
9563
|
+
videoSetAvSyncOffset(context, node, offsetUs) {
|
|
9564
|
+
const handle = encodeContextHandle(context, node);
|
|
9565
|
+
this.getYogaHost().runMutation(() => {
|
|
9566
|
+
const pointer = this.nativeContextPointer(context, "ot_video_set_av_sync_offset");
|
|
9567
|
+
nativeResult("ot_video_set_av_sync_offset", this.opentui.symbols.ot_video_set_av_sync_offset(pointer, handle, offsetUs));
|
|
9568
|
+
});
|
|
9569
|
+
}
|
|
9570
|
+
videoSetMaxFps(context, node, fps) {
|
|
9571
|
+
const handle = encodeContextHandle(context, node);
|
|
9572
|
+
if (!isFFIU32(fps))
|
|
9573
|
+
throw new RangeError("Video maxFps must be a u32");
|
|
9574
|
+
this.getYogaHost().runMutation(() => {
|
|
9575
|
+
const pointer = this.nativeContextPointer(context, "ot_video_set_max_fps");
|
|
9576
|
+
nativeResult("ot_video_set_max_fps", this.opentui.symbols.ot_video_set_max_fps(pointer, handle, fps));
|
|
9577
|
+
});
|
|
9578
|
+
}
|
|
9579
|
+
videoGetState(context, node) {
|
|
9580
|
+
const handle = encodeContextHandle(context, node);
|
|
9581
|
+
const layout = nativeLayouts.ot_video_state;
|
|
9582
|
+
const output = this.videoStateRecord;
|
|
9583
|
+
this.getYogaHost().runMutation(() => {
|
|
9584
|
+
const pointer = this.nativeContextPointer(context, "ot_video_get_state");
|
|
9585
|
+
nativeResult("ot_video_get_state", this.opentui.symbols.ot_video_get_state(pointer, handle, output));
|
|
9586
|
+
});
|
|
9587
|
+
const view = this.videoStateView;
|
|
9588
|
+
const flags = view.getUint32(layout.fields.flags.offset, true);
|
|
9589
|
+
return {
|
|
9590
|
+
currentTimeUs: view.getBigInt64(layout.fields.current_time_us.offset, true),
|
|
9591
|
+
framePtsUs: view.getBigInt64(layout.fields.frame_pts_us.offset, true),
|
|
9592
|
+
playing: (flags & nativeConstants.OT_VIDEO_PLAYING) !== 0,
|
|
9593
|
+
ended: (flags & nativeConstants.OT_VIDEO_ENDED) !== 0,
|
|
9594
|
+
buffering: (flags & nativeConstants.OT_VIDEO_BUFFERING) !== 0,
|
|
9595
|
+
audio: (flags & nativeConstants.OT_VIDEO_AUDIO) !== 0,
|
|
9596
|
+
hasFrame: (flags & nativeConstants.OT_VIDEO_HAS_FRAME) !== 0,
|
|
9597
|
+
failed: (flags & nativeConstants.OT_VIDEO_ERROR) !== 0,
|
|
9598
|
+
qualityTier: view.getUint32(layout.fields.quality_tier.offset, true)
|
|
9599
|
+
};
|
|
9600
|
+
}
|
|
9601
|
+
videoGetError(context, node) {
|
|
9602
|
+
const handle = encodeContextHandle(context, node);
|
|
9603
|
+
return this.getYogaHost().runMutation(() => {
|
|
9604
|
+
const pointer = this.nativeContextPointer(context, "ot_video_get_error");
|
|
9605
|
+
return this.readText("ot_video_get_error", (bytes, capacity, count) => this.opentui.symbols.ot_video_get_error(pointer, handle, bytes, capacity, count));
|
|
9606
|
+
});
|
|
9607
|
+
}
|
|
9259
9608
|
contextDrawImage({ context, target, frame }, image, options) {
|
|
9260
9609
|
const layout = nativeLayouts.ot_image_draw_options;
|
|
9261
9610
|
const handle = encodeContextHandle(context, target);
|
|
@@ -9608,7 +9957,10 @@ class FFIRenderLib2 {
|
|
|
9608
9957
|
width: words[layout.fields.width.offset / 4],
|
|
9609
9958
|
height: words[layout.fields.height.offset / 4],
|
|
9610
9959
|
frameCount: output[layout.fields.frame_count.offset / 8],
|
|
9611
|
-
framePending: words[layout.fields.frame_pending.offset / 4] !== 0
|
|
9960
|
+
framePending: words[layout.fields.frame_pending.offset / 4] !== 0,
|
|
9961
|
+
imageUploadsPending: words[layout.fields.image_uploads_pending.offset / 4],
|
|
9962
|
+
droppedFrames: words[layout.fields.dropped_frames.offset / 4],
|
|
9963
|
+
droppedFrameBytes: words[layout.fields.dropped_frame_bytes.offset / 4]
|
|
9612
9964
|
};
|
|
9613
9965
|
}
|
|
9614
9966
|
sessionAcquireBufferLease(context, session, which) {
|
|
@@ -9685,8 +10037,12 @@ class FFIRenderLib2 {
|
|
|
9685
10037
|
sessionSetupTerminal(context, session, options = {}) {
|
|
9686
10038
|
const layout = nativeLayouts.ot_session_terminal_options;
|
|
9687
10039
|
const handle = encodeContextHandle(context, session);
|
|
10040
|
+
const synchronizedOutput = options.synchronizedOutput ?? "auto";
|
|
10041
|
+
if (!Object.hasOwn(SYNCHRONIZED_OUTPUT_FLAGS, synchronizedOutput)) {
|
|
10042
|
+
throw new TypeError("Session synchronizedOutput must be auto, always, or never");
|
|
10043
|
+
}
|
|
9688
10044
|
const flag = (value, label, bit) => toFFIBool(value ?? true, `Session ${label}`) ? bit : 0;
|
|
9689
|
-
const flags = flag(options.useAlternateScreen, "useAlternateScreen", nativeConstants.OT_TERMINAL_ALTERNATE_SCREEN) | flag(options.mouse, "mouse", nativeConstants.OT_TERMINAL_MOUSE) | flag(options.mouseMovement, "mouseMovement", nativeConstants.OT_TERMINAL_MOUSE_MOVEMENT) | flag(options.clearOnClose, "clearOnClose", nativeConstants.OT_TERMINAL_CLEAR_ON_CLOSE);
|
|
10045
|
+
const flags = flag(options.useAlternateScreen, "useAlternateScreen", nativeConstants.OT_TERMINAL_ALTERNATE_SCREEN) | flag(options.mouse, "mouse", nativeConstants.OT_TERMINAL_MOUSE) | flag(options.mouseMovement, "mouseMovement", nativeConstants.OT_TERMINAL_MOUSE_MOVEMENT) | flag(options.clearOnClose, "clearOnClose", nativeConstants.OT_TERMINAL_CLEAR_ON_CLOSE) | (options.replySentinel ? nativeConstants.OT_TERMINAL_REPLY_SENTINEL : 0) | SYNCHRONIZED_OUTPUT_FLAGS[synchronizedOutput] | (options.hostMultiplexer ? nativeConstants.OT_TERMINAL_HOST_MULTIPLEXER : 0);
|
|
9690
10046
|
const record = createContextRecord(layout);
|
|
9691
10047
|
record[layout.fields.flags.offset / 4] = flags;
|
|
9692
10048
|
record[layout.fields.kitty_keyboard_flags.offset / 4] = toSafeFFIU32Length(options.kittyKeyboardFlags ?? 5, "Session kittyKeyboardFlags");
|
|
@@ -9820,6 +10176,7 @@ class FFIRenderLib2 {
|
|
|
9820
10176
|
break;
|
|
9821
10177
|
case "query-pixel-resolution":
|
|
9822
10178
|
record[kind] = nativeConstants.OT_CONTROL_QUERY_PIXEL_RESOLUTION;
|
|
10179
|
+
record[layout.fields.argument.offset / 4] = command.sentinel ? 1 : 0;
|
|
9823
10180
|
break;
|
|
9824
10181
|
case "query-theme-colors":
|
|
9825
10182
|
record[kind] = nativeConstants.OT_CONTROL_QUERY_THEME_COLORS;
|
|
@@ -9984,6 +10341,15 @@ class FFIRenderLib2 {
|
|
|
9984
10341
|
nativeResult("ot_session_drain_stdout", this.opentui.symbols.ot_session_drain_stdout(pointer, handle, limit, output));
|
|
9985
10342
|
return output[0];
|
|
9986
10343
|
}
|
|
10344
|
+
sessionPostStdout(context, session, maxBytes, wait) {
|
|
10345
|
+
const handle = encodeContextHandle(context, session);
|
|
10346
|
+
const limit = toSafeFFIU32Length(maxBytes, "Stdout byte limit");
|
|
10347
|
+
const state = new Uint32Array(1);
|
|
10348
|
+
const written = new Uint32Array(1);
|
|
10349
|
+
const pointer = this.nativeContextPointer(context, "ot_session_post_stdout");
|
|
10350
|
+
nativeResult("ot_session_post_stdout", this.opentui.symbols.ot_session_post_stdout(pointer, handle, limit, wait ? 1 : 0, state, written));
|
|
10351
|
+
return { written: written[0], inFlight: state[0] === 1 };
|
|
10352
|
+
}
|
|
9987
10353
|
sessionCompleteOutput(context, session, ticket, success) {
|
|
9988
10354
|
const layout = nativeLayouts.ot_output_ticket;
|
|
9989
10355
|
const written = toFFIBool(success, "Session output success");
|
|
@@ -9999,6 +10365,10 @@ class FFIRenderLib2 {
|
|
|
9999
10365
|
const handle = encodeContextHandle(context, session);
|
|
10000
10366
|
nativeResult("ot_session_close", this.opentui.symbols.ot_session_close(this.nativeContextPointer(context, "ot_session_close"), handle));
|
|
10001
10367
|
}
|
|
10368
|
+
sessionDropOutput(context, session) {
|
|
10369
|
+
const handle = encodeContextHandle(context, session);
|
|
10370
|
+
nativeResult("ot_session_drop_output", this.opentui.symbols.ot_session_drop_output(this.nativeContextPointer(context, "ot_session_drop_output"), handle));
|
|
10371
|
+
}
|
|
10002
10372
|
sessionCancel(context, session) {
|
|
10003
10373
|
const handle = encodeContextHandle(context, session);
|
|
10004
10374
|
nativeResult("ot_session_cancel", this.opentui.symbols.ot_session_cancel(this.nativeContextPointer(context, "ot_session_cancel"), handle));
|
|
@@ -10379,6 +10749,90 @@ class FFIRenderLib2 {
|
|
|
10379
10749
|
const pointer = this.nativeContextPointer(context, "ot_scene_set_arrow");
|
|
10380
10750
|
nativeResult("ot_scene_set_arrow", this.opentui.symbols.ot_scene_set_arrow(pointer, handle, record, bytes?.length === 0 ? new Uint8Array(1) : bytes, bytes?.length ?? 0));
|
|
10381
10751
|
}
|
|
10752
|
+
sceneSetScroll(context, node, options) {
|
|
10753
|
+
const layout = nativeLayouts.ot_scene_scroll_options;
|
|
10754
|
+
const bar = nativeLayouts.ot_scene_scroll_bar_options;
|
|
10755
|
+
this.getYogaHost().assertMutable();
|
|
10756
|
+
const handle = encodeContextHandle(context, node);
|
|
10757
|
+
const record = createContextRecord(layout);
|
|
10758
|
+
const floats = new Float32Array(record.buffer);
|
|
10759
|
+
const colors = new Uint16Array(record.buffer);
|
|
10760
|
+
const follow = SCENE_SCROLL_FOLLOW.indexOf(options.follow);
|
|
10761
|
+
if (follow < 0)
|
|
10762
|
+
throw new TypeError("Unknown scene scroll follow edge");
|
|
10763
|
+
const fields = layout.fields;
|
|
10764
|
+
record[fields.axes.offset / 4] = (options.scrollX ? nativeConstants.OT_SCENE_SCROLL_X : 0) | (options.scrollY ? nativeConstants.OT_SCENE_SCROLL_Y : 0);
|
|
10765
|
+
record[fields.follow.offset / 4] = follow;
|
|
10766
|
+
record[fields.culling.offset / 4] = toFFIBool(options.culling, "Scene scroll culling");
|
|
10767
|
+
for (let edge = 0;edge < 4; edge++)
|
|
10768
|
+
floats[fields.padding.offset / 4 + edge] = options.padding[edge];
|
|
10769
|
+
let fills = 0;
|
|
10770
|
+
for (const [index, field] of ["wrapper_background", "viewport_background", "content_background"].entries()) {
|
|
10771
|
+
const color = options.fills[index];
|
|
10772
|
+
if (!color)
|
|
10773
|
+
continue;
|
|
10774
|
+
fills |= 1 << index;
|
|
10775
|
+
contextBufferColor(color, colors, fields[field].offset / 2);
|
|
10776
|
+
}
|
|
10777
|
+
record[fields.fills.offset / 4] = fills;
|
|
10778
|
+
for (let axis = 0;axis < 2; axis++) {
|
|
10779
|
+
const base = fields.bars.offset + axis * bar.size;
|
|
10780
|
+
const value = options.bars[axis];
|
|
10781
|
+
const policy = SCENE_SCROLL_BAR_POLICY.indexOf(value.policy);
|
|
10782
|
+
if (policy < 0)
|
|
10783
|
+
throw new TypeError("Unknown scene scroll bar policy");
|
|
10784
|
+
record[(base + bar.fields.policy.offset) / 4] = policy;
|
|
10785
|
+
record[(base + bar.fields.placement.offset) / 4] = toFFIBool(value.overlay, "Scene scroll bar overlay");
|
|
10786
|
+
record[(base + bar.fields.thickness.offset) / 4] = toSafeFFIU32Length(value.thickness, "Scene scroll bar thickness");
|
|
10787
|
+
record[(base + bar.fields.gap.offset) / 4] = toSafeFFIU32Length(value.gap, "Scene scroll bar gap");
|
|
10788
|
+
record[(base + bar.fields.arrows.offset) / 4] = toFFIBool(value.arrows, "Scene scroll bar arrows");
|
|
10789
|
+
contextBufferColor(value.foregroundColor, colors, (base + bar.fields.track_foreground.offset) / 2);
|
|
10790
|
+
contextBufferColor(value.backgroundColor, colors, (base + bar.fields.track_background.offset) / 2);
|
|
10791
|
+
}
|
|
10792
|
+
const pointer = this.nativeContextPointer(context, "ot_scene_set_scroll");
|
|
10793
|
+
nativeResult("ot_scene_set_scroll", this.opentui.symbols.ot_scene_set_scroll(pointer, handle, record));
|
|
10794
|
+
}
|
|
10795
|
+
sceneSetScrollArrow(context, node, axis, end, options) {
|
|
10796
|
+
const layout = nativeLayouts.ot_scene_arrow_options;
|
|
10797
|
+
this.getYogaHost().assertMutable();
|
|
10798
|
+
const handle = encodeContextHandle(context, node);
|
|
10799
|
+
const record = createContextRecord(layout);
|
|
10800
|
+
record[layout.fields.attributes.offset / 4] = toSafeFFIU32Length(options.attributes, "Scene arrow attributes");
|
|
10801
|
+
const colors = new Uint16Array(record.buffer);
|
|
10802
|
+
contextBufferColor(options.foregroundColor, colors, layout.fields.foreground.offset / 2);
|
|
10803
|
+
contextBufferColor(options.backgroundColor, colors, layout.fields.background.offset / 2);
|
|
10804
|
+
const text = options.text;
|
|
10805
|
+
const bytes = text === undefined ? null : sessionBytes(this.encoder.encode(text), "Scene arrow text length");
|
|
10806
|
+
if (bytes && bytes.length > NATIVE_BUFFER_TEXT_BYTES_MAX2)
|
|
10807
|
+
throw new RangeError("Scene arrow text is too long");
|
|
10808
|
+
const pointer = this.nativeContextPointer(context, "ot_scene_set_scroll_arrow");
|
|
10809
|
+
nativeResult("ot_scene_set_scroll_arrow", this.opentui.symbols.ot_scene_set_scroll_arrow(pointer, handle, toSafeFFIU32Length(axis, "Scene scroll axis"), toSafeFFIU32Length(end, "Scene scroll arrow end"), record, bytes?.length === 0 ? new Uint8Array(1) : bytes, bytes?.length ?? 0));
|
|
10810
|
+
}
|
|
10811
|
+
sceneScrollTo(context, node, x, y, relativeX, relativeY, reapply = false) {
|
|
10812
|
+
this.getYogaHost().assertMutable();
|
|
10813
|
+
const handle = encodeContextHandle(context, node);
|
|
10814
|
+
const output = createContextRecord(nativeLayouts.ot_scene_scroll_state);
|
|
10815
|
+
const flags = (relativeX ? nativeConstants.OT_SCENE_SCROLL_RELATIVE_X : 0) | (relativeY ? nativeConstants.OT_SCENE_SCROLL_RELATIVE_Y : 0) | (reapply ? nativeConstants.OT_SCENE_SCROLL_REAPPLY : 0);
|
|
10816
|
+
const pointer = this.nativeContextPointer(context, "ot_scene_scroll_to");
|
|
10817
|
+
nativeResult("ot_scene_scroll_to", this.opentui.symbols.ot_scene_scroll_to(pointer, handle, x, y, flags, output));
|
|
10818
|
+
return readSceneScrollState(output);
|
|
10819
|
+
}
|
|
10820
|
+
sceneScrollRequest(context, node, kind, target, align = "nearest", inset = 0) {
|
|
10821
|
+
this.getYogaHost().assertMutable();
|
|
10822
|
+
const handle = encodeContextHandle(context, node);
|
|
10823
|
+
const encodedTarget = target === null ? null : encodeContextHandle(context, target);
|
|
10824
|
+
const output = createContextRecord(nativeLayouts.ot_scene_scroll_state);
|
|
10825
|
+
const pointer = this.nativeContextPointer(context, "ot_scene_scroll_request");
|
|
10826
|
+
nativeResult("ot_scene_scroll_request", this.opentui.symbols.ot_scene_scroll_request(pointer, handle, SCENE_SCROLL_REQUESTS.indexOf(kind), encodedTarget, SCENE_SCROLL_ALIGNS.indexOf(align), toSafeFFIU32Length(inset, "Scene scroll inset"), output));
|
|
10827
|
+
return readSceneScrollState(output);
|
|
10828
|
+
}
|
|
10829
|
+
sceneGetScroll(context, node) {
|
|
10830
|
+
const handle = encodeContextHandle(context, node);
|
|
10831
|
+
const output = createContextRecord(nativeLayouts.ot_scene_scroll_state);
|
|
10832
|
+
const pointer = this.nativeContextPointer(context, "ot_scene_get_scroll");
|
|
10833
|
+
nativeResult("ot_scene_get_scroll", this.opentui.symbols.ot_scene_get_scroll(pointer, handle, output));
|
|
10834
|
+
return readSceneScrollState(output);
|
|
10835
|
+
}
|
|
10382
10836
|
sceneSetTextOptions(context, node, options) {
|
|
10383
10837
|
const layout = nativeLayouts.ot_scene_text_options;
|
|
10384
10838
|
this.getYogaHost().assertMutable();
|
|
@@ -12795,7 +13249,7 @@ var Yoga = {
|
|
|
12795
13249
|
};
|
|
12796
13250
|
var yoga_default = Yoga;
|
|
12797
13251
|
|
|
12798
|
-
export { nativeLayouts, nativeConstants, toArrayBuffer, singleton, getSingleton, destroySingleton, envRegistry2, registerEnvVar2, clearEnvCache2, generateEnvMarkdown2, generateEnvColored2, env2, stringWidth, resolveBundledFilePath2, Worker, TextAttributes2, ATTRIBUTE_BASE_BITS2, ATTRIBUTE_BASE_MASK2, getBaseAttributes2, DebugOverlayCorner2, TargetChannel2, DEFAULT_FOREGROUND_RGB2, DEFAULT_BACKGROUND_RGB2, normalizeIndexedColorIndex2, ansi256IndexToRgb2, RGBA2, normalizeColorValue2, hexToRgb2, rgbToHex2, hsvToRgb2, parseColor2, createTextAttributes2, attributesWithLink2, getLinkId2, visualizeRenderableTree2, isStyledText2, StyledText2, stringToStyledText2, black2, red2, green2, yellow2, blue2, magenta2, cyan2, white2, brightBlack2, brightRed2, brightGreen2, brightYellow2, brightBlue2, brightMagenta2, brightCyan2, brightWhite2, bgBlack2, bgRed2, bgGreen2, bgYellow2, bgBlue2, bgMagenta2, bgCyan2, bgWhite2, bold2, italic2, underline2, strikethrough2, dim2, reverse2, blink2, fg2, bg2, link2, t2, YogaEnumKind, YogaFloatKind, YogaValueKind, sceneSetEnum, sceneGetEnum, sceneSetFloat, sceneGetFloat, sceneSetValue, sceneGetValue, sceneSetDimension, UNDEFINED_VALUE, parseYogaValue, SpanInfoStruct, NativeAudioStreamFormat2, NativeAudioStreamState2, NativeAudioStreamStateNames, NativeAudioStreamCloseReason2, isBunfsPath, normalizeBunfsPath, resolveDefaultParserAsset, resolveDefaultTreeSitterWorkerPath, resolveTreeSitterWasm, NativeAudioStreamState3, NativeAudioStreamCloseReason3, NativeAudioStreamFormat3, MAX_LINK_URL_BYTES2, NativeTextViewCommand2, NativeEditCommand2, NativeEditPositionQuery2, NativeEditorStyleMask2, NativeEditHighlightOperation2, NativeEditorCommand2, NativeEditorSelectionOperation2, NativeEditorPositionQuery2, NativeEditEvent2, NativeStyleGroup, NativeStyleFlags, NATIVE_EDGE_NONE2, NativeBorder2, NativeSceneHook2, NativeSceneFrame2, NativeScenePaintPhase2, NATIVE_BUFFER_TEXT_BYTES_MAX2, NativeSessionState2, NativeSessionRenderStatus2, NATIVE_SESSION_CONTROL_PACKET_BYTES2, NativeSessionTerminalPhase2, NativeSessionPumpStatus2, NativeStatus2, NativeError2, NativeClipboardOperationStatus2, NativeClipboardStartStatus2, NativeClipboardCancelStatus2, NativeClipboardCopyStatus2, NativeClipboardDestroyStatus2, NativeClipboardShutdownStatus2, SceneStaging, NativePaintRecorder, LogLevel2, FFIRenderLib2, setRenderLibPath2, resolveRenderLib2, Align2, BoxSizing2, Dimension2, Direction2, Display2, Edge2, Errata2, ExperimentalFeature2, FlexDirection2, Gutter2, Justify2, LogLevel3, MeasureMode2, NodeType2, Overflow2, PositionType2, Unit2, Wrap2, ALIGN_AUTO2, ALIGN_FLEX_START2, ALIGN_CENTER2, ALIGN_FLEX_END2, ALIGN_STRETCH2, ALIGN_BASELINE2, ALIGN_SPACE_BETWEEN2, ALIGN_SPACE_AROUND2, ALIGN_SPACE_EVENLY2, BOX_SIZING_BORDER_BOX2, BOX_SIZING_CONTENT_BOX2, DIMENSION_WIDTH2, DIMENSION_HEIGHT2, DIRECTION_INHERIT2, DIRECTION_LTR2, DIRECTION_RTL2, DISPLAY_FLEX2, DISPLAY_NONE2, DISPLAY_CONTENTS2, EDGE_LEFT2, EDGE_TOP2, EDGE_RIGHT2, EDGE_BOTTOM2, EDGE_START2, EDGE_END2, EDGE_HORIZONTAL2, EDGE_VERTICAL2, EDGE_ALL2, ERRATA_NONE2, ERRATA_STRETCH_FLEX_BASIS2, ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING2, ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE2, ERRATA_ALL2, ERRATA_CLASSIC2, EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS2, FLEX_DIRECTION_COLUMN2, FLEX_DIRECTION_COLUMN_REVERSE2, FLEX_DIRECTION_ROW2, FLEX_DIRECTION_ROW_REVERSE2, GUTTER_COLUMN2, GUTTER_ROW2, GUTTER_ALL2, JUSTIFY_FLEX_START2, JUSTIFY_CENTER2, JUSTIFY_FLEX_END2, JUSTIFY_SPACE_BETWEEN2, JUSTIFY_SPACE_AROUND2, JUSTIFY_SPACE_EVENLY2, LOG_LEVEL_ERROR2, LOG_LEVEL_WARN2, LOG_LEVEL_INFO2, LOG_LEVEL_DEBUG2, LOG_LEVEL_VERBOSE2, LOG_LEVEL_FATAL2, MEASURE_MODE_UNDEFINED2, MEASURE_MODE_EXACTLY2, MEASURE_MODE_AT_MOST2, NODE_TYPE_DEFAULT2, NODE_TYPE_TEXT2, OVERFLOW_VISIBLE2, OVERFLOW_HIDDEN2, OVERFLOW_SCROLL2, POSITION_TYPE_STATIC2, POSITION_TYPE_RELATIVE2, POSITION_TYPE_ABSOLUTE2, UNIT_UNDEFINED2, UNIT_POINT2, UNIT_PERCENT2, UNIT_AUTO2, WRAP_NO_WRAP2, WRAP_WRAP2, WRAP_WRAP_REVERSE2, YogaStatus2, YogaError2, Config2, Node2, exports_yoga, yoga_default };
|
|
13252
|
+
export { nativeLayouts, nativeConstants, toArrayBuffer, singleton, getSingleton, destroySingleton, envRegistry2, registerEnvVar2, clearEnvCache2, generateEnvMarkdown2, generateEnvColored2, env2, stringWidth, resolveBundledFilePath2, Worker, TextAttributes2, ATTRIBUTE_BASE_BITS2, ATTRIBUTE_BASE_MASK2, getBaseAttributes2, DebugOverlayCorner2, TargetChannel2, DEFAULT_FOREGROUND_RGB2, DEFAULT_BACKGROUND_RGB2, normalizeIndexedColorIndex2, ansi256IndexToRgb2, RGBA2, normalizeColorValue2, hexToRgb2, rgbToHex2, hsvToRgb2, parseColor2, createTextAttributes2, attributesWithLink2, getLinkId2, visualizeRenderableTree2, isStyledText2, StyledText2, stringToStyledText2, black2, red2, green2, yellow2, blue2, magenta2, cyan2, white2, brightBlack2, brightRed2, brightGreen2, brightYellow2, brightBlue2, brightMagenta2, brightCyan2, brightWhite2, bgBlack2, bgRed2, bgGreen2, bgYellow2, bgBlue2, bgMagenta2, bgCyan2, bgWhite2, bold2, italic2, underline2, strikethrough2, dim2, reverse2, blink2, fg2, bg2, link2, t2, YogaEnumKind, YogaFloatKind, YogaValueKind, sceneSetEnum, sceneGetEnum, sceneSetFloat, sceneGetFloat, sceneSetValue, sceneGetValue, sceneSetDimension, UNDEFINED_VALUE, parseYogaValue, SpanInfoStruct, NativeAudioStreamFormat2, NativeAudioStreamState2, NativeAudioStreamStateNames, NativeAudioStreamCloseReason2, isBunfsPath, normalizeBunfsPath, resolveDefaultParserAsset, resolveDefaultTreeSitterWorkerPath, resolveTreeSitterWasm, NativeAudioStreamState3, NativeAudioStreamCloseReason3, NativeAudioStreamFormat3, MAX_LINK_URL_BYTES2, NativeTextViewCommand2, NativeEditCommand2, NativeEditPositionQuery2, NativeEditorStyleMask2, NativeEditHighlightOperation2, NativeEditorCommand2, NativeEditorSelectionOperation2, NativeEditorPositionQuery2, NativeEditEvent2, NativeStyleGroup, NativeStyleFlags, NATIVE_EDGE_NONE2, NativeBorder2, NativeSceneHook2, NativeSceneFrame2, NativeScenePaintPhase2, emptySceneScrollState, NATIVE_BUFFER_TEXT_BYTES_MAX2, NativeSessionState2, NativeSessionRenderStatus2, NATIVE_SESSION_CONTROL_PACKET_BYTES2, NativeSessionTerminalPhase2, NativeSessionPumpStatus2, NativeStatus2, NativeError2, NativeClipboardOperationStatus2, NativeClipboardStartStatus2, NativeClipboardCancelStatus2, NativeClipboardCopyStatus2, NativeClipboardDestroyStatus2, NativeClipboardShutdownStatus2, SceneStaging, NativePaintRecorder, LogLevel2, FFIRenderLib2, setRenderLibPath2, resolveRenderLib2, Align2, BoxSizing2, Dimension2, Direction2, Display2, Edge2, Errata2, ExperimentalFeature2, FlexDirection2, Gutter2, Justify2, LogLevel3, MeasureMode2, NodeType2, Overflow2, PositionType2, Unit2, Wrap2, ALIGN_AUTO2, ALIGN_FLEX_START2, ALIGN_CENTER2, ALIGN_FLEX_END2, ALIGN_STRETCH2, ALIGN_BASELINE2, ALIGN_SPACE_BETWEEN2, ALIGN_SPACE_AROUND2, ALIGN_SPACE_EVENLY2, BOX_SIZING_BORDER_BOX2, BOX_SIZING_CONTENT_BOX2, DIMENSION_WIDTH2, DIMENSION_HEIGHT2, DIRECTION_INHERIT2, DIRECTION_LTR2, DIRECTION_RTL2, DISPLAY_FLEX2, DISPLAY_NONE2, DISPLAY_CONTENTS2, EDGE_LEFT2, EDGE_TOP2, EDGE_RIGHT2, EDGE_BOTTOM2, EDGE_START2, EDGE_END2, EDGE_HORIZONTAL2, EDGE_VERTICAL2, EDGE_ALL2, ERRATA_NONE2, ERRATA_STRETCH_FLEX_BASIS2, ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING2, ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE2, ERRATA_ALL2, ERRATA_CLASSIC2, EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS2, FLEX_DIRECTION_COLUMN2, FLEX_DIRECTION_COLUMN_REVERSE2, FLEX_DIRECTION_ROW2, FLEX_DIRECTION_ROW_REVERSE2, GUTTER_COLUMN2, GUTTER_ROW2, GUTTER_ALL2, JUSTIFY_FLEX_START2, JUSTIFY_CENTER2, JUSTIFY_FLEX_END2, JUSTIFY_SPACE_BETWEEN2, JUSTIFY_SPACE_AROUND2, JUSTIFY_SPACE_EVENLY2, LOG_LEVEL_ERROR2, LOG_LEVEL_WARN2, LOG_LEVEL_INFO2, LOG_LEVEL_DEBUG2, LOG_LEVEL_VERBOSE2, LOG_LEVEL_FATAL2, MEASURE_MODE_UNDEFINED2, MEASURE_MODE_EXACTLY2, MEASURE_MODE_AT_MOST2, NODE_TYPE_DEFAULT2, NODE_TYPE_TEXT2, OVERFLOW_VISIBLE2, OVERFLOW_HIDDEN2, OVERFLOW_SCROLL2, POSITION_TYPE_STATIC2, POSITION_TYPE_RELATIVE2, POSITION_TYPE_ABSOLUTE2, UNIT_UNDEFINED2, UNIT_POINT2, UNIT_PERCENT2, UNIT_AUTO2, WRAP_NO_WRAP2, WRAP_WRAP2, WRAP_WRAP_REVERSE2, YogaStatus2, YogaError2, Config2, Node2, exports_yoga, yoga_default };
|
|
12799
13253
|
|
|
12800
|
-
//# debugId=
|
|
12801
|
-
//# sourceMappingURL=chunk-node-
|
|
13254
|
+
//# debugId=47188A1A60507D9B64756E2164756E21
|
|
13255
|
+
//# sourceMappingURL=chunk-node-m8mjyx7h.js.map
|