@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
|
@@ -136,6 +136,11 @@ var nativeSymbols = {
|
|
|
136
136
|
ot_scene_set_surface: { args: ["ptr", "buffer", "ptr"], returns: "i32" },
|
|
137
137
|
ot_scene_set_box_details: { args: ["ptr", "buffer", "buffer", "ptr", "u32", "ptr", "u32"], returns: "i32" },
|
|
138
138
|
ot_scene_set_viewport: { args: ["ptr", "buffer", "ptr"], returns: "i32" },
|
|
139
|
+
ot_scene_set_scroll: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
|
|
140
|
+
ot_scene_set_scroll_arrow: { args: ["ptr", "buffer", "u32", "u32", "buffer", "ptr", "u32"], returns: "i32" },
|
|
141
|
+
ot_scene_scroll_to: { args: ["ptr", "buffer", "f64", "f64", "u32", "ptr"], returns: "i32" },
|
|
142
|
+
ot_scene_scroll_request: { args: ["ptr", "buffer", "u32", "ptr", "u32", "u32", "ptr"], returns: "i32" },
|
|
143
|
+
ot_scene_get_scroll: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
|
|
139
144
|
ot_scene_set_focus: { args: ["ptr", "buffer", "u32"], returns: "i32" },
|
|
140
145
|
ot_scene_set_slider: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
|
|
141
146
|
ot_scene_set_arrow: { args: ["ptr", "buffer", "buffer", "ptr", "u32"], returns: "i32" },
|
|
@@ -252,6 +257,19 @@ var nativeSymbols = {
|
|
|
252
257
|
ot_image_take_pixels: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
|
|
253
258
|
ot_image_pixels_release: { args: ["ptr", "buffer"], returns: "i32" },
|
|
254
259
|
ot_scene_set_image: { args: ["ptr", "buffer", "ptr", "u32", "u32", "ptr"], returns: "i32" },
|
|
260
|
+
ot_scene_set_crop: { args: ["ptr", "buffer", "u32", "u32", "u32", "u32"], returns: "i32" },
|
|
261
|
+
ot_scene_set_video: { args: ["ptr", "buffer", "u32", "ptr"], returns: "i32" },
|
|
262
|
+
ot_video_open: { args: ["ptr", "buffer", "ptr", "u32", "u32", "buffer"], returns: "i32" },
|
|
263
|
+
ot_video_play: { args: ["ptr", "buffer"], returns: "i32" },
|
|
264
|
+
ot_video_pause: { args: ["ptr", "buffer"], returns: "i32" },
|
|
265
|
+
ot_video_seek: { args: ["ptr", "buffer", "i64"], returns: "i32" },
|
|
266
|
+
ot_video_set_loop: { args: ["ptr", "buffer", "u32"], returns: "i32" },
|
|
267
|
+
ot_video_set_muted: { args: ["ptr", "buffer", "u32"], returns: "i32" },
|
|
268
|
+
ot_video_set_volume: { args: ["ptr", "buffer", "f32"], returns: "i32" },
|
|
269
|
+
ot_video_set_av_sync_offset: { args: ["ptr", "buffer", "i64"], returns: "i32" },
|
|
270
|
+
ot_video_set_max_fps: { args: ["ptr", "buffer", "u32"], returns: "i32" },
|
|
271
|
+
ot_video_get_state: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
|
|
272
|
+
ot_video_get_error: { args: ["ptr", "buffer", "ptr", "u32", "buffer"], returns: "i32" },
|
|
255
273
|
ot_buffer_draw_image: { args: ["ptr", "buffer", "ptr", "buffer", "buffer", "buffer"], returns: "i32" },
|
|
256
274
|
ot_session_set_image_resolution: { args: ["ptr", "buffer", "u32", "u32", "u32", "u32"], returns: "i32" },
|
|
257
275
|
ot_session_set_kitty_image_transport: { args: ["ptr", "buffer", "u32"], returns: "i32" },
|
|
@@ -292,7 +310,7 @@ var nativeSymbols = {
|
|
|
292
310
|
ot_scene_set_text_view_paint: { args: ["ptr", "buffer", "u32"], returns: "i32" },
|
|
293
311
|
ot_buffer_draw_text_view: { args: ["ptr", "buffer", "ptr", "buffer", "i32", "i32"], returns: "i32" },
|
|
294
312
|
ot_buffer_draw_editor_view: { args: ["ptr", "buffer", "ptr", "buffer", "i32", "i32"], returns: "i32" },
|
|
295
|
-
|
|
313
|
+
ot_buffer_draw_scene_body: { args: ["ptr", "buffer", "ptr", "buffer", "i32", "i32"], returns: "i32" },
|
|
296
314
|
ot_scene_frame_acquire_buffer_lease: { args: ["ptr", "buffer", "buffer", "u32", "buffer"], returns: "i32" },
|
|
297
315
|
ot_scene_frame_commit: { args: ["ptr", "buffer", "buffer", "u32", "buffer"], returns: "i32" },
|
|
298
316
|
ot_context_abi_version: { args: [], returns: "u32" },
|
|
@@ -366,8 +384,10 @@ var nativeSymbols = {
|
|
|
366
384
|
ot_session_read_output: { args: ["ptr", "buffer", "ptr", "u32", "buffer"], returns: "i32" },
|
|
367
385
|
ot_session_drain_output: { args: ["ptr", "buffer", "u32", "buffer", "ptr", "ptr"], returns: "i32" },
|
|
368
386
|
ot_session_drain_stdout: { args: ["ptr", "buffer", "u32", "buffer"], returns: "i32" },
|
|
387
|
+
ot_session_post_stdout: { args: ["ptr", "buffer", "u32", "u32", "buffer", "buffer"], returns: "i32" },
|
|
369
388
|
ot_session_complete_output: { args: ["ptr", "buffer", "buffer", "u32"], returns: "i32" },
|
|
370
389
|
ot_session_close: { args: ["ptr", "buffer"], returns: "i32" },
|
|
390
|
+
ot_session_drop_output: { args: ["ptr", "buffer"], returns: "i32" },
|
|
371
391
|
ot_session_pump_exit: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
|
|
372
392
|
ot_terminal_flush_input: { args: [], returns: "i32" },
|
|
373
393
|
ot_session_cancel: { args: ["ptr", "buffer"], returns: "i32" },
|
|
@@ -622,7 +642,7 @@ var nativeLayouts = {
|
|
|
622
642
|
full_path_reasons: { offset: 208, size: 4, alignment: 4, type: "u32" },
|
|
623
643
|
host_requests: { offset: 212, size: 4, alignment: 4, type: "u32" },
|
|
624
644
|
layout_rounds: { offset: 216, size: 4, alignment: 4, type: "u32" },
|
|
625
|
-
|
|
645
|
+
damage_rows: { offset: 220, size: 4, alignment: 4, type: "u32" }
|
|
626
646
|
}
|
|
627
647
|
},
|
|
628
648
|
ot_scene_cursor_state: {
|
|
@@ -742,6 +762,66 @@ var nativeLayouts = {
|
|
|
742
762
|
reserved: { offset: 12, size: 4, alignment: 4, type: "u32" }
|
|
743
763
|
}
|
|
744
764
|
},
|
|
765
|
+
ot_scene_scroll_bar_options: {
|
|
766
|
+
size: 40,
|
|
767
|
+
alignment: 4,
|
|
768
|
+
fields: {
|
|
769
|
+
policy: { offset: 0, size: 4, alignment: 4, type: "u32" },
|
|
770
|
+
placement: { offset: 4, size: 4, alignment: 4, type: "u32" },
|
|
771
|
+
thickness: { offset: 8, size: 4, alignment: 4, type: "u32" },
|
|
772
|
+
gap: { offset: 12, size: 4, alignment: 4, type: "u32" },
|
|
773
|
+
arrows: { offset: 16, size: 4, alignment: 4, type: "u32" },
|
|
774
|
+
reserved: { offset: 20, size: 4, alignment: 4, type: "u32" },
|
|
775
|
+
track_foreground: { offset: 24, size: 8, alignment: 2, type: "[4]u16" },
|
|
776
|
+
track_background: { offset: 32, size: 8, alignment: 2, type: "[4]u16" }
|
|
777
|
+
}
|
|
778
|
+
},
|
|
779
|
+
ot_scene_scroll_options: {
|
|
780
|
+
size: 144,
|
|
781
|
+
alignment: 4,
|
|
782
|
+
fields: {
|
|
783
|
+
struct_size: { offset: 0, size: 4, alignment: 4, type: "u32" },
|
|
784
|
+
abi_version: { offset: 4, size: 4, alignment: 4, type: "u32" },
|
|
785
|
+
axes: { offset: 8, size: 4, alignment: 4, type: "u32" },
|
|
786
|
+
follow: { offset: 12, size: 4, alignment: 4, type: "u32" },
|
|
787
|
+
culling: { offset: 16, size: 4, alignment: 4, type: "u32" },
|
|
788
|
+
fills: { offset: 20, size: 4, alignment: 4, type: "u32" },
|
|
789
|
+
padding: { offset: 24, size: 16, alignment: 4, type: "[4]f32" },
|
|
790
|
+
wrapper_background: { offset: 40, size: 8, alignment: 2, type: "[4]u16" },
|
|
791
|
+
viewport_background: { offset: 48, size: 8, alignment: 2, type: "[4]u16" },
|
|
792
|
+
content_background: { offset: 56, size: 8, alignment: 2, type: "[4]u16" },
|
|
793
|
+
bars: { offset: 64, size: 80, alignment: 4, type: "[2]ot_scene_scroll_bar_options" }
|
|
794
|
+
}
|
|
795
|
+
},
|
|
796
|
+
ot_scene_scroll_bar_state: {
|
|
797
|
+
size: 120,
|
|
798
|
+
alignment: 8,
|
|
799
|
+
fields: {
|
|
800
|
+
visible: { offset: 0, size: 4, alignment: 4, type: "u32" },
|
|
801
|
+
reserved: { offset: 4, size: 4, alignment: 4, type: "u32" },
|
|
802
|
+
track: { offset: 8, size: 32, alignment: 8, type: "[4]f64" },
|
|
803
|
+
start_arrow: { offset: 40, size: 32, alignment: 8, type: "[4]f64" },
|
|
804
|
+
end_arrow: { offset: 72, size: 32, alignment: 8, type: "[4]f64" },
|
|
805
|
+
thumb_start: { offset: 104, size: 8, alignment: 8, type: "f64" },
|
|
806
|
+
thumb_size: { offset: 112, size: 8, alignment: 8, type: "f64" }
|
|
807
|
+
}
|
|
808
|
+
},
|
|
809
|
+
ot_scene_scroll_state: {
|
|
810
|
+
size: 360,
|
|
811
|
+
alignment: 8,
|
|
812
|
+
fields: {
|
|
813
|
+
struct_size: { offset: 0, size: 4, alignment: 4, type: "u32" },
|
|
814
|
+
abi_version: { offset: 4, size: 4, alignment: 4, type: "u32" },
|
|
815
|
+
stuck: { offset: 8, size: 4, alignment: 4, type: "u32" },
|
|
816
|
+
changes: { offset: 12, size: 4, alignment: 4, type: "u32" },
|
|
817
|
+
generation: { offset: 16, size: 8, alignment: 8, type: "u64" },
|
|
818
|
+
offset: { offset: 24, size: 16, alignment: 8, type: "[2]f64" },
|
|
819
|
+
max: { offset: 40, size: 16, alignment: 8, type: "[2]f64" },
|
|
820
|
+
content: { offset: 56, size: 32, alignment: 8, type: "[4]f64" },
|
|
821
|
+
viewport: { offset: 88, size: 32, alignment: 8, type: "[4]f64" },
|
|
822
|
+
bars: { offset: 120, size: 240, alignment: 8, type: "[2]ot_scene_scroll_bar_state" }
|
|
823
|
+
}
|
|
824
|
+
},
|
|
745
825
|
ot_session_options: {
|
|
746
826
|
size: 32,
|
|
747
827
|
alignment: 8,
|
|
@@ -811,7 +891,7 @@ var nativeLayouts = {
|
|
|
811
891
|
}
|
|
812
892
|
},
|
|
813
893
|
ot_session_renderer_state: {
|
|
814
|
-
size:
|
|
894
|
+
size: 40,
|
|
815
895
|
alignment: 8,
|
|
816
896
|
fields: {
|
|
817
897
|
struct_size: { offset: 0, size: 4, alignment: 4, type: "u32" },
|
|
@@ -820,7 +900,9 @@ var nativeLayouts = {
|
|
|
820
900
|
height: { offset: 12, size: 4, alignment: 4, type: "u32" },
|
|
821
901
|
frame_count: { offset: 16, size: 8, alignment: 8, type: "u64" },
|
|
822
902
|
frame_pending: { offset: 24, size: 4, alignment: 4, type: "u32" },
|
|
823
|
-
|
|
903
|
+
image_uploads_pending: { offset: 28, size: 4, alignment: 4, type: "u32" },
|
|
904
|
+
dropped_frames: { offset: 32, size: 4, alignment: 4, type: "u32" },
|
|
905
|
+
dropped_frame_bytes: { offset: 36, size: 4, alignment: 4, type: "u32" }
|
|
824
906
|
}
|
|
825
907
|
},
|
|
826
908
|
ot_buffer_options: {
|
|
@@ -1074,6 +1156,29 @@ var nativeLayouts = {
|
|
|
1074
1156
|
byte_count: { offset: 24, size: 8, alignment: 8, type: "u64" }
|
|
1075
1157
|
}
|
|
1076
1158
|
},
|
|
1159
|
+
ot_video_info: {
|
|
1160
|
+
size: 32,
|
|
1161
|
+
alignment: 8,
|
|
1162
|
+
fields: {
|
|
1163
|
+
duration_us: { offset: 0, size: 8, alignment: 8, type: "i64" },
|
|
1164
|
+
width: { offset: 8, size: 4, alignment: 4, type: "u32" },
|
|
1165
|
+
height: { offset: 12, size: 4, alignment: 4, type: "u32" },
|
|
1166
|
+
fps_num: { offset: 16, size: 4, alignment: 4, type: "u32" },
|
|
1167
|
+
fps_den: { offset: 20, size: 4, alignment: 4, type: "u32" },
|
|
1168
|
+
has_audio: { offset: 24, size: 4, alignment: 4, type: "u32" },
|
|
1169
|
+
reserved: { offset: 28, size: 4, alignment: 4, type: "u32" }
|
|
1170
|
+
}
|
|
1171
|
+
},
|
|
1172
|
+
ot_video_state: {
|
|
1173
|
+
size: 24,
|
|
1174
|
+
alignment: 8,
|
|
1175
|
+
fields: {
|
|
1176
|
+
current_time_us: { offset: 0, size: 8, alignment: 8, type: "i64" },
|
|
1177
|
+
frame_pts_us: { offset: 8, size: 8, alignment: 8, type: "i64" },
|
|
1178
|
+
flags: { offset: 16, size: 4, alignment: 4, type: "u32" },
|
|
1179
|
+
quality_tier: { offset: 20, size: 4, alignment: 4, type: "u32" }
|
|
1180
|
+
}
|
|
1181
|
+
},
|
|
1077
1182
|
ot_image_draw_options: {
|
|
1078
1183
|
size: 64,
|
|
1079
1184
|
alignment: 4,
|
|
@@ -1177,7 +1282,7 @@ var nativeLayouts = {
|
|
|
1177
1282
|
}
|
|
1178
1283
|
},
|
|
1179
1284
|
ot_buffer_draw_text_record: {
|
|
1180
|
-
size:
|
|
1285
|
+
size: 48,
|
|
1181
1286
|
alignment: 4,
|
|
1182
1287
|
fields: {
|
|
1183
1288
|
header: { offset: 0, size: 16, alignment: 4, type: "ot_buffer_draw_header" },
|
|
@@ -1185,7 +1290,8 @@ var nativeLayouts = {
|
|
|
1185
1290
|
y: { offset: 20, size: 4, alignment: 4, type: "i32" },
|
|
1186
1291
|
attributes: { offset: 24, size: 4, alignment: 4, type: "u32" },
|
|
1187
1292
|
foreground: { offset: 28, size: 8, alignment: 2, type: "[4]u16" },
|
|
1188
|
-
background: { offset: 36, size: 8, alignment: 2, type: "[4]u16" }
|
|
1293
|
+
background: { offset: 36, size: 8, alignment: 2, type: "[4]u16" },
|
|
1294
|
+
max_width: { offset: 44, size: 4, alignment: 4, type: "u32" }
|
|
1189
1295
|
}
|
|
1190
1296
|
},
|
|
1191
1297
|
ot_buffer_draw_cell: {
|
|
@@ -1599,6 +1705,7 @@ var nativeConstants = {
|
|
|
1599
1705
|
OT_IMAGE_OUTPUT_TOO_SMALL: -45,
|
|
1600
1706
|
OT_IMAGE_UNSUPPORTED_FEATURE: -46,
|
|
1601
1707
|
OT_IMAGE_BUSY: -47,
|
|
1708
|
+
OT_VIDEO_FAILED: -60,
|
|
1602
1709
|
OT_SCENE_ROOT: 0,
|
|
1603
1710
|
OT_SCENE_BOX: 1,
|
|
1604
1711
|
OT_SCENE_TEXT: 2,
|
|
@@ -1608,6 +1715,7 @@ var nativeConstants = {
|
|
|
1608
1715
|
OT_SCENE_CUSTOM: 6,
|
|
1609
1716
|
OT_SCENE_TEXT_VIEW: 7,
|
|
1610
1717
|
OT_SCENE_IMAGE: 8,
|
|
1718
|
+
OT_SCENE_VIDEO: 9,
|
|
1611
1719
|
OT_SCENE_WRAP_NONE: 0,
|
|
1612
1720
|
OT_SCENE_WRAP_CHAR: 1,
|
|
1613
1721
|
OT_SCENE_WRAP_WORD: 2,
|
|
@@ -1622,6 +1730,7 @@ var nativeConstants = {
|
|
|
1622
1730
|
OT_STYLE_BORDER_WIDTH: 0,
|
|
1623
1731
|
OT_STYLE_FLAGS_NONE: 0,
|
|
1624
1732
|
OT_STYLE_DISABLE_FLEX_SHRINK: 1,
|
|
1733
|
+
OT_STYLE_CONTENT: 2,
|
|
1625
1734
|
OT_STYLE_ENUM_DIRECTION: 0,
|
|
1626
1735
|
OT_STYLE_ENUM_FLEX_DIRECTION: 1,
|
|
1627
1736
|
OT_STYLE_ENUM_JUSTIFY_CONTENT: 2,
|
|
@@ -1749,6 +1858,10 @@ var nativeConstants = {
|
|
|
1749
1858
|
OT_SCENE_FULL_PATH_FORCED: 1,
|
|
1750
1859
|
OT_SCENE_FULL_PATH_SCREEN: 2,
|
|
1751
1860
|
OT_SCENE_FULL_PATH_IMAGES: 4,
|
|
1861
|
+
OT_SCENE_FULL_PATH_TAINTED: 8,
|
|
1862
|
+
OT_SCENE_FULL_PATH_UNRETAINED: 16,
|
|
1863
|
+
OT_SCENE_FULL_PATH_OPTIONS: 32,
|
|
1864
|
+
OT_SCENE_FULL_PATH_NON_LOCAL: 64,
|
|
1752
1865
|
OT_SCENE_HOOK_UPDATE: 1,
|
|
1753
1866
|
OT_SCENE_HOOK_RESIZE: 2,
|
|
1754
1867
|
OT_SCENE_HOOK_LAYOUT_CHANGED: 4,
|
|
@@ -1756,11 +1869,13 @@ var nativeConstants = {
|
|
|
1756
1869
|
OT_SCENE_HOOK_RENDER_AFTER: 16,
|
|
1757
1870
|
OT_SCENE_HOOK_RENDER_SELF: 32,
|
|
1758
1871
|
OT_SCENE_HOOK_IDLE_UPDATE: 64,
|
|
1872
|
+
OT_SCENE_HOOK_SCROLL: 128,
|
|
1759
1873
|
OT_SCENE_FRAME_DONE: 0,
|
|
1760
1874
|
OT_SCENE_FRAME_UPDATE: 1,
|
|
1761
1875
|
OT_SCENE_FRAME_RESIZE: 2,
|
|
1762
1876
|
OT_SCENE_FRAME_LAYOUT_CHANGED: 3,
|
|
1763
1877
|
OT_SCENE_FRAME_RECORD: 4,
|
|
1878
|
+
OT_SCENE_FRAME_SCROLL: 5,
|
|
1764
1879
|
OT_SCENE_GEOMETRY_PAINT: 1,
|
|
1765
1880
|
OT_SCENE_GEOMETRY_PUBLIC: 2,
|
|
1766
1881
|
OT_SCENE_PROPERTY_Z_INDEX: 1,
|
|
@@ -1778,7 +1893,37 @@ var nativeConstants = {
|
|
|
1778
1893
|
OT_SCENE_PROPERTY_RESET_BORDER_CHARACTERS: 4096,
|
|
1779
1894
|
OT_SCENE_PROPERTY_RECORD_MAX: 88,
|
|
1780
1895
|
OT_SCENE_PROPERTY_BYTES_MAX: 360448,
|
|
1896
|
+
OT_SCENE_SCROLL_X: 1,
|
|
1897
|
+
OT_SCENE_SCROLL_Y: 2,
|
|
1898
|
+
OT_SCENE_SCROLL_FOLLOW_NONE: 0,
|
|
1899
|
+
OT_SCENE_SCROLL_FOLLOW_TOP: 1,
|
|
1900
|
+
OT_SCENE_SCROLL_FOLLOW_BOTTOM: 2,
|
|
1901
|
+
OT_SCENE_SCROLL_FOLLOW_LEFT: 3,
|
|
1902
|
+
OT_SCENE_SCROLL_FOLLOW_RIGHT: 4,
|
|
1903
|
+
OT_SCENE_SCROLL_FILL_WRAPPER: 1,
|
|
1904
|
+
OT_SCENE_SCROLL_FILL_VIEWPORT: 2,
|
|
1905
|
+
OT_SCENE_SCROLL_FILL_CONTENT: 4,
|
|
1906
|
+
OT_SCENE_SCROLL_BAR_AUTO: 0,
|
|
1907
|
+
OT_SCENE_SCROLL_BAR_ALWAYS: 1,
|
|
1908
|
+
OT_SCENE_SCROLL_BAR_NEVER: 2,
|
|
1909
|
+
OT_SCENE_SCROLL_BAR_INSET: 0,
|
|
1910
|
+
OT_SCENE_SCROLL_BAR_OVERLAY: 1,
|
|
1911
|
+
OT_SCENE_SCROLL_RELATIVE_X: 1,
|
|
1912
|
+
OT_SCENE_SCROLL_RELATIVE_Y: 2,
|
|
1913
|
+
OT_SCENE_SCROLL_REAPPLY: 4,
|
|
1914
|
+
OT_SCENE_SCROLL_REQUEST_INTO_VIEW: 0,
|
|
1915
|
+
OT_SCENE_SCROLL_REQUEST_ANCHOR: 1,
|
|
1916
|
+
OT_SCENE_SCROLL_REQUEST_LAYOUT: 2,
|
|
1917
|
+
OT_SCENE_SCROLL_ALIGN_NEAREST: 0,
|
|
1918
|
+
OT_SCENE_SCROLL_ALIGN_START: 1,
|
|
1919
|
+
OT_SCENE_SCROLL_ALIGN_END: 2,
|
|
1920
|
+
OT_SCENE_SCROLL_CHANGED_OFFSET_X: 1,
|
|
1921
|
+
OT_SCENE_SCROLL_CHANGED_OFFSET_Y: 2,
|
|
1922
|
+
OT_SCENE_SCROLL_CHANGED_CONTENT: 4,
|
|
1923
|
+
OT_SCENE_SCROLL_CHANGED_VIEWPORT: 8,
|
|
1924
|
+
OT_SCENE_SCROLL_CHANGED_LAYOUT: 16,
|
|
1781
1925
|
OT_SCENE_DEBUG_FULL_FRAME: 1,
|
|
1926
|
+
OT_SCENE_DEBUG_VERIFY: 2,
|
|
1782
1927
|
OT_SESSION_OPEN: 0,
|
|
1783
1928
|
OT_SESSION_CLOSING: 1,
|
|
1784
1929
|
OT_SESSION_CLOSED_STATE: 2,
|
|
@@ -1865,6 +2010,8 @@ var nativeConstants = {
|
|
|
1865
2010
|
OT_EDIT_POSITION_OFFSET: 4,
|
|
1866
2011
|
OT_EDIT_POSITION_COORDS: 5,
|
|
1867
2012
|
OT_EDIT_POSITION_LINE_START: 6,
|
|
2013
|
+
OT_EDIT_POSITION_END: 7,
|
|
2014
|
+
OT_EDIT_POSITION_PREV_CHAR: 8,
|
|
1868
2015
|
OT_EDITOR_STYLE_FOREGROUND: 1,
|
|
1869
2016
|
OT_EDITOR_STYLE_BACKGROUND: 2,
|
|
1870
2017
|
OT_EDITOR_STYLE_ATTRIBUTES: 4,
|
|
@@ -1944,6 +2091,13 @@ var nativeConstants = {
|
|
|
1944
2091
|
OT_IMAGE_BLEND_SOURCE_OVER: 0,
|
|
1945
2092
|
OT_IMAGE_BLEND_SOURCE: 1,
|
|
1946
2093
|
OT_IMAGE_BLEND_DESTINATION_OVER: 2,
|
|
2094
|
+
OT_VIDEO_OPEN_NO_AUDIO: 1,
|
|
2095
|
+
OT_VIDEO_PLAYING: 1,
|
|
2096
|
+
OT_VIDEO_ENDED: 2,
|
|
2097
|
+
OT_VIDEO_BUFFERING: 4,
|
|
2098
|
+
OT_VIDEO_AUDIO: 8,
|
|
2099
|
+
OT_VIDEO_HAS_FRAME: 16,
|
|
2100
|
+
OT_VIDEO_ERROR: 32,
|
|
1947
2101
|
OT_TEXT_VIEW_WRAP_WIDTH: 0,
|
|
1948
2102
|
OT_TEXT_VIEW_WRAP_MODE: 1,
|
|
1949
2103
|
OT_TEXT_VIEW_FIRST_LINE_OFFSET: 2,
|
|
@@ -1967,6 +2121,7 @@ var nativeConstants = {
|
|
|
1967
2121
|
OT_BUFFER_DRAW_HAS_BACKGROUND: 1,
|
|
1968
2122
|
OT_BUFFER_DRAW_HAS_SOURCE_WIDTH: 2,
|
|
1969
2123
|
OT_BUFFER_DRAW_HAS_SOURCE_HEIGHT: 4,
|
|
2124
|
+
OT_BUFFER_DRAW_FIT_ELLIPSIS: 16,
|
|
1970
2125
|
OT_BUFFER_STACK_DEPTH_MAX: 256,
|
|
1971
2126
|
OT_BUFFER_STACK_GET_OPACITY: 0,
|
|
1972
2127
|
OT_BUFFER_STACK_PUSH_SCISSOR: 1,
|
|
@@ -1982,6 +2137,10 @@ var nativeConstants = {
|
|
|
1982
2137
|
OT_TERMINAL_MOUSE: 2,
|
|
1983
2138
|
OT_TERMINAL_MOUSE_MOVEMENT: 4,
|
|
1984
2139
|
OT_TERMINAL_CLEAR_ON_CLOSE: 8,
|
|
2140
|
+
OT_TERMINAL_REPLY_SENTINEL: 16,
|
|
2141
|
+
OT_TERMINAL_SYNC_ALWAYS: 32,
|
|
2142
|
+
OT_TERMINAL_SYNC_NEVER: 64,
|
|
2143
|
+
OT_TERMINAL_HOST_MULTIPLEXER: 128,
|
|
1985
2144
|
OT_CONTROL_CAPABILITY_RESPONSE: 1,
|
|
1986
2145
|
OT_CONTROL_TITLE: 2,
|
|
1987
2146
|
OT_CONTROL_MOUSE: 3,
|
|
@@ -2041,6 +2200,8 @@ var nativeConstants = {
|
|
|
2041
2200
|
OT_PUMP_OUTPUT_PENDING: 2,
|
|
2042
2201
|
OT_PUMP_WAIT_UNTIL: 3,
|
|
2043
2202
|
OT_PUMP_CLOSED: 4,
|
|
2203
|
+
OT_STDOUT_IDLE: 0,
|
|
2204
|
+
OT_STDOUT_IN_FLIGHT: 1,
|
|
2044
2205
|
OT_INPUT_KEY: 1,
|
|
2045
2206
|
OT_INPUT_MOUSE: 2,
|
|
2046
2207
|
OT_INPUT_PASTE: 3,
|
|
@@ -2149,6 +2310,7 @@ var nativeConstants = {
|
|
|
2149
2310
|
OT_INPUT_EXPECT_REPLIES: 1,
|
|
2150
2311
|
OT_INPUT_EXPECT_KITTY_KEYBOARD: 2,
|
|
2151
2312
|
OT_INPUT_EXPECT_CURSOR_POSITION: 4,
|
|
2313
|
+
OT_INPUT_EXPECT_SENTINEL: 8,
|
|
2152
2314
|
OT_INPUT_EVENTS_MIN: 4,
|
|
2153
2315
|
OT_INPUT_PAYLOAD_BYTES_MIN: 4384,
|
|
2154
2316
|
OT_INPUT_TIMEOUT_NS: 20000000,
|
|
@@ -2168,7 +2330,7 @@ var nativeConstants = {
|
|
|
2168
2330
|
OT_SCENE_RECORD_COLOR_MATRIX: 7,
|
|
2169
2331
|
OT_SCENE_RECORD_TEXT_VIEW: 8,
|
|
2170
2332
|
OT_SCENE_RECORD_EDITOR_VIEW: 9,
|
|
2171
|
-
|
|
2333
|
+
OT_SCENE_RECORD_SCENE_BODY: 10,
|
|
2172
2334
|
OT_SCENE_RECORD_IMAGE: 11,
|
|
2173
2335
|
OT_SCENE_RECORD_UNICODE: 12,
|
|
2174
2336
|
OT_SCENE_RECORD_GRAYSCALE_FOREGROUND: 1,
|
|
@@ -3894,21 +4056,21 @@ var YogaValueKind = {
|
|
|
3894
4056
|
Position: nativeConstants.OT_STYLE_VALUE_POSITION,
|
|
3895
4057
|
Gap: nativeConstants.OT_STYLE_VALUE_GAP
|
|
3896
4058
|
};
|
|
3897
|
-
function sceneSetEnum(scene, node, kind, value) {
|
|
3898
|
-
scene.setStyle(node, NativeStyleGroup.Enum, kind, NATIVE_EDGE_NONE2, Unit2.Undefined, value);
|
|
4059
|
+
function sceneSetEnum(scene, node, kind, value, flags = NativeStyleFlags.None) {
|
|
4060
|
+
scene.setStyle(node, NativeStyleGroup.Enum, kind, NATIVE_EDGE_NONE2, Unit2.Undefined, value, flags);
|
|
3899
4061
|
}
|
|
3900
4062
|
function sceneGetEnum(scene, node, kind) {
|
|
3901
4063
|
return scene.getStyle(node, NativeStyleGroup.Enum, kind, NATIVE_EDGE_NONE2).value;
|
|
3902
4064
|
}
|
|
3903
|
-
function sceneSetFloat(scene, node, kind, value) {
|
|
3904
|
-
scene.setStyle(node, NativeStyleGroup.Float, kind, NATIVE_EDGE_NONE2, Unit2.Undefined, value ?? NaN);
|
|
4065
|
+
function sceneSetFloat(scene, node, kind, value, flags = NativeStyleFlags.None) {
|
|
4066
|
+
scene.setStyle(node, NativeStyleGroup.Float, kind, NATIVE_EDGE_NONE2, Unit2.Undefined, value ?? NaN, flags);
|
|
3905
4067
|
}
|
|
3906
4068
|
function sceneGetFloat(scene, node, kind) {
|
|
3907
4069
|
return scene.getStyle(node, NativeStyleGroup.Float, kind, NATIVE_EDGE_NONE2).value;
|
|
3908
4070
|
}
|
|
3909
|
-
function sceneSetValue(scene, node, kind, edge, valueInput) {
|
|
4071
|
+
function sceneSetValue(scene, node, kind, edge, valueInput, flags = NativeStyleFlags.None) {
|
|
3910
4072
|
const value = parseYogaValue(valueInput);
|
|
3911
|
-
scene.setStyle(node, NativeStyleGroup.Value, kind, edge, value.unit, value.value);
|
|
4073
|
+
scene.setStyle(node, NativeStyleGroup.Value, kind, edge, value.unit, value.value, flags);
|
|
3912
4074
|
}
|
|
3913
4075
|
function sceneGetValue(scene, node, kind, edge) {
|
|
3914
4076
|
return scene.getStyle(node, NativeStyleGroup.Value, kind, edge);
|
|
@@ -5661,6 +5823,8 @@ var NativeEditPositionQuery2;
|
|
|
5661
5823
|
NativeEditPositionQuery[NativeEditPositionQuery["Offset"] = 4] = "Offset";
|
|
5662
5824
|
NativeEditPositionQuery[NativeEditPositionQuery["Coords"] = 5] = "Coords";
|
|
5663
5825
|
NativeEditPositionQuery[NativeEditPositionQuery["LineStart"] = 6] = "LineStart";
|
|
5826
|
+
NativeEditPositionQuery[NativeEditPositionQuery["End"] = 7] = "End";
|
|
5827
|
+
NativeEditPositionQuery[NativeEditPositionQuery["PrevChar"] = 8] = "PrevChar";
|
|
5664
5828
|
})(NativeEditPositionQuery2 ||= {});
|
|
5665
5829
|
var NativeEditorStyleMask2;
|
|
5666
5830
|
((NativeEditorStyleMask) => {
|
|
@@ -5728,6 +5892,7 @@ var NativeStyleFlags;
|
|
|
5728
5892
|
((NativeStyleFlags) => {
|
|
5729
5893
|
NativeStyleFlags[NativeStyleFlags["None"] = nativeConstants.OT_STYLE_FLAGS_NONE] = "None";
|
|
5730
5894
|
NativeStyleFlags[NativeStyleFlags["DisableFlexShrink"] = nativeConstants.OT_STYLE_DISABLE_FLEX_SHRINK] = "DisableFlexShrink";
|
|
5895
|
+
NativeStyleFlags[NativeStyleFlags["Content"] = nativeConstants.OT_STYLE_CONTENT] = "Content";
|
|
5731
5896
|
})(NativeStyleFlags ||= {});
|
|
5732
5897
|
var NATIVE_EDGE_NONE2 = nativeConstants.OT_EDGE_NONE;
|
|
5733
5898
|
var NativeBorder2;
|
|
@@ -5748,6 +5913,7 @@ var NativeSceneHook2;
|
|
|
5748
5913
|
NativeSceneHook[NativeSceneHook["RenderAfter"] = nativeConstants.OT_SCENE_HOOK_RENDER_AFTER] = "RenderAfter";
|
|
5749
5914
|
NativeSceneHook[NativeSceneHook["RenderSelf"] = nativeConstants.OT_SCENE_HOOK_RENDER_SELF] = "RenderSelf";
|
|
5750
5915
|
NativeSceneHook[NativeSceneHook["IdleUpdate"] = nativeConstants.OT_SCENE_HOOK_IDLE_UPDATE] = "IdleUpdate";
|
|
5916
|
+
NativeSceneHook[NativeSceneHook["Scroll"] = nativeConstants.OT_SCENE_HOOK_SCROLL] = "Scroll";
|
|
5751
5917
|
})(NativeSceneHook2 ||= {});
|
|
5752
5918
|
var NativeSceneFrame2;
|
|
5753
5919
|
((NativeSceneFrame) => {
|
|
@@ -5756,6 +5922,7 @@ var NativeSceneFrame2;
|
|
|
5756
5922
|
NativeSceneFrame[NativeSceneFrame["Resize"] = nativeConstants.OT_SCENE_FRAME_RESIZE] = "Resize";
|
|
5757
5923
|
NativeSceneFrame[NativeSceneFrame["LayoutChanged"] = nativeConstants.OT_SCENE_FRAME_LAYOUT_CHANGED] = "LayoutChanged";
|
|
5758
5924
|
NativeSceneFrame[NativeSceneFrame["Record"] = nativeConstants.OT_SCENE_FRAME_RECORD] = "Record";
|
|
5925
|
+
NativeSceneFrame[NativeSceneFrame["Scroll"] = nativeConstants.OT_SCENE_FRAME_SCROLL] = "Scroll";
|
|
5759
5926
|
})(NativeSceneFrame2 ||= {});
|
|
5760
5927
|
var NativeScenePaintPhase2;
|
|
5761
5928
|
((NativeScenePaintPhase) => {
|
|
@@ -5763,6 +5930,42 @@ var NativeScenePaintPhase2;
|
|
|
5763
5930
|
NativeScenePaintPhase[NativeScenePaintPhase["Self"] = nativeConstants.OT_SCENE_RECORD_PHASE_SELF] = "Self";
|
|
5764
5931
|
NativeScenePaintPhase[NativeScenePaintPhase["After"] = nativeConstants.OT_SCENE_RECORD_PHASE_AFTER] = "After";
|
|
5765
5932
|
})(NativeScenePaintPhase2 ||= {});
|
|
5933
|
+
var SCENE_SCROLL_FOLLOW = ["none", "top", "bottom", "left", "right"];
|
|
5934
|
+
var SCENE_SCROLL_BAR_POLICY = ["auto", "always", "never"];
|
|
5935
|
+
var SCENE_SCROLL_REQUESTS = ["into-view", "anchor", "layout"];
|
|
5936
|
+
var SCENE_SCROLL_ALIGNS = ["nearest", "start", "end"];
|
|
5937
|
+
function readSceneRect(values, index) {
|
|
5938
|
+
return { x: values[index], y: values[index + 1], width: values[index + 2], height: values[index + 3] };
|
|
5939
|
+
}
|
|
5940
|
+
function emptySceneScrollState() {
|
|
5941
|
+
return readSceneScrollState(new Uint32Array(nativeLayouts.ot_scene_scroll_state.size / 4));
|
|
5942
|
+
}
|
|
5943
|
+
function readSceneScrollState(record) {
|
|
5944
|
+
const { fields } = nativeLayouts.ot_scene_scroll_state;
|
|
5945
|
+
const bar = nativeLayouts.ot_scene_scroll_bar_state;
|
|
5946
|
+
const values = new Float64Array(record.buffer);
|
|
5947
|
+
const readBar = (axis) => {
|
|
5948
|
+
const base = fields.bars.offset + axis * bar.size;
|
|
5949
|
+
return {
|
|
5950
|
+
visible: record[(base + bar.fields.visible.offset) / 4] !== 0,
|
|
5951
|
+
track: readSceneRect(values, (base + bar.fields.track.offset) / 8),
|
|
5952
|
+
startArrow: readSceneRect(values, (base + bar.fields.start_arrow.offset) / 8),
|
|
5953
|
+
endArrow: readSceneRect(values, (base + bar.fields.end_arrow.offset) / 8),
|
|
5954
|
+
thumbStart: values[(base + bar.fields.thumb_start.offset) / 8],
|
|
5955
|
+
thumbSize: values[(base + bar.fields.thumb_size.offset) / 8]
|
|
5956
|
+
};
|
|
5957
|
+
};
|
|
5958
|
+
const offset = fields.offset.offset / 8;
|
|
5959
|
+
const max = fields.max.offset / 8;
|
|
5960
|
+
return {
|
|
5961
|
+
changes: record[fields.changes.offset / 4],
|
|
5962
|
+
offset: [values[offset], values[offset + 1]],
|
|
5963
|
+
max: [values[max], values[max + 1]],
|
|
5964
|
+
content: readSceneRect(values, fields.content.offset / 8),
|
|
5965
|
+
viewport: readSceneRect(values, fields.viewport.offset / 8),
|
|
5966
|
+
bars: [readBar(0), readBar(1)]
|
|
5967
|
+
};
|
|
5968
|
+
}
|
|
5766
5969
|
var NATIVE_BUFFER_TEXT_BYTES_MAX2 = nativeConstants.OT_BUFFER_TEXT_BYTES_MAX;
|
|
5767
5970
|
var NativeSessionState2;
|
|
5768
5971
|
((NativeSessionState) => {
|
|
@@ -5832,6 +6035,7 @@ var NativeStatus2;
|
|
|
5832
6035
|
NativeStatus[NativeStatus["LayoutLimit"] = -26] = "LayoutLimit";
|
|
5833
6036
|
NativeStatus[NativeStatus["FrameBusy"] = -27] = "FrameBusy";
|
|
5834
6037
|
NativeStatus[NativeStatus["FrameRequestLimit"] = -28] = "FrameRequestLimit";
|
|
6038
|
+
NativeStatus[NativeStatus["VideoFailed"] = -60] = "VideoFailed";
|
|
5835
6039
|
})(NativeStatus2 ||= {});
|
|
5836
6040
|
|
|
5837
6041
|
class NativeError2 extends Error {
|
|
@@ -5963,6 +6167,12 @@ registerEnvVar2({
|
|
|
5963
6167
|
type: "string",
|
|
5964
6168
|
required: false
|
|
5965
6169
|
});
|
|
6170
|
+
registerEnvVar2({
|
|
6171
|
+
name: "OPENTUI_EXPERIMENTAL_VIDEO_HWACCEL",
|
|
6172
|
+
description: "Experimental: decode video with VideoToolbox on macOS when set to exactly 1 or true; otherwise or on failure, decode in software",
|
|
6173
|
+
type: "string",
|
|
6174
|
+
required: false
|
|
6175
|
+
});
|
|
5966
6176
|
var CURSOR_STYLE_TO_ID = { block: 0, line: 1, underline: 2, default: 3 };
|
|
5967
6177
|
var CURSOR_ID_TO_STYLE = ["block", "line", "underline", "default"];
|
|
5968
6178
|
var PROGRAM_STATE_TO_ID = {
|
|
@@ -6019,7 +6229,18 @@ var MOUSE_STYLE_TO_ID = {
|
|
|
6019
6229
|
var SCENE_BORDER_STYLES = ["single", "double", "rounded", "heavy"];
|
|
6020
6230
|
var SCENE_TEXT_WRAP_MODES = ["none", "char", "word"];
|
|
6021
6231
|
var SCENE_TEXT_ALIGNS = ["left", "center", "right"];
|
|
6022
|
-
var SCENE_NODE_KINDS = [
|
|
6232
|
+
var SCENE_NODE_KINDS = [
|
|
6233
|
+
"root",
|
|
6234
|
+
"box",
|
|
6235
|
+
"text",
|
|
6236
|
+
"slider",
|
|
6237
|
+
"arrow",
|
|
6238
|
+
"editor",
|
|
6239
|
+
"custom",
|
|
6240
|
+
"text_view",
|
|
6241
|
+
"image",
|
|
6242
|
+
"video"
|
|
6243
|
+
];
|
|
6023
6244
|
var IMAGE_PROTOCOL_TO_ID = { auto: 0, kitty: 1, sixel: 2, blocks: 3 };
|
|
6024
6245
|
var IMAGE_FITS = ["fit", "cover", "fill"];
|
|
6025
6246
|
var BUFFER_DRAW_OPERATIONS = new Map([
|
|
@@ -6052,8 +6273,6 @@ function readFrameWork(layout, output, words) {
|
|
|
6052
6273
|
const result = {};
|
|
6053
6274
|
let counting = false;
|
|
6054
6275
|
for (const [field, { offset, type }] of Object.entries(layout.fields)) {
|
|
6055
|
-
if (field === "reserved")
|
|
6056
|
-
break;
|
|
6057
6276
|
counting ||= field === "work_frame_id";
|
|
6058
6277
|
if (!counting)
|
|
6059
6278
|
continue;
|
|
@@ -6101,6 +6320,11 @@ function toFFIBool(value, label) {
|
|
|
6101
6320
|
throw new TypeError(`${label} must be a boolean`);
|
|
6102
6321
|
return ffiBool(value);
|
|
6103
6322
|
}
|
|
6323
|
+
var SYNCHRONIZED_OUTPUT_FLAGS = {
|
|
6324
|
+
auto: 0,
|
|
6325
|
+
always: nativeConstants.OT_TERMINAL_SYNC_ALWAYS,
|
|
6326
|
+
never: nativeConstants.OT_TERMINAL_SYNC_NEVER
|
|
6327
|
+
};
|
|
6104
6328
|
function toFFIF32(value, label, allowNaN = false) {
|
|
6105
6329
|
if (allowNaN && Number.isNaN(value))
|
|
6106
6330
|
return value;
|
|
@@ -6393,8 +6617,8 @@ function encodeBufferDrawRecord(context, options, words, signed, colors, base, s
|
|
|
6393
6617
|
const fields = nativeLayouts.ot_buffer_draw_text_record.fields;
|
|
6394
6618
|
encodeDrawPosition(signed, fields, options, base);
|
|
6395
6619
|
words[word + fields.attributes.offset / 4] = toSafeFFIU32Length(options.attributes ?? 0, "Buffer attributes");
|
|
6396
|
-
|
|
6397
|
-
|
|
6620
|
+
words[word + fields.max_width.offset / 4] = toSafeFFIU32Length(options.maxWidth ?? 0, "Buffer text width");
|
|
6621
|
+
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);
|
|
6398
6622
|
break;
|
|
6399
6623
|
}
|
|
6400
6624
|
case "cell":
|
|
@@ -7229,7 +7453,7 @@ class NativePaintRecorder {
|
|
|
7229
7453
|
view(operation, source, x, y) {
|
|
7230
7454
|
this.transaction(() => {
|
|
7231
7455
|
const layout = nativeLayouts.ot_scene_record_view;
|
|
7232
|
-
const base = this.reserve(operation === "text" ? nativeConstants.OT_SCENE_RECORD_TEXT_VIEW : operation === "editor" ? nativeConstants.OT_SCENE_RECORD_EDITOR_VIEW : nativeConstants.
|
|
7456
|
+
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);
|
|
7233
7457
|
this.encodeHandle(source, base + layout.fields.source.offset);
|
|
7234
7458
|
this.signed[(base + layout.fields.x.offset) / 4] = toFFII32(x, "View x");
|
|
7235
7459
|
this.signed[(base + layout.fields.y.offset) / 4] = toFFII32(y, "View y");
|
|
@@ -7931,6 +8155,8 @@ class FFIRenderLib2 {
|
|
|
7931
8155
|
sceneFlushApplied = new Uint32Array(1);
|
|
7932
8156
|
editorSelectionRecord = createEditorSelectionRecord();
|
|
7933
8157
|
editorViewInfoRecord = createContextRecord(nativeLayouts.ot_editor_view_info);
|
|
8158
|
+
videoStateRecord = new Uint8Array(nativeLayouts.ot_video_state.size);
|
|
8159
|
+
videoStateView = new DataView(this.videoStateRecord.buffer);
|
|
7934
8160
|
selectionResetRecord = encodeEditorSelection({ operation: 2 /* Reset */ });
|
|
7935
8161
|
localSelectionResetRecord = encodeEditorSelection({
|
|
7936
8162
|
operation: 5 /* LocalReset */
|
|
@@ -8741,15 +8967,15 @@ class FFIRenderLib2 {
|
|
|
8741
8967
|
const pointer = this.nativeContextPointer(context, "ot_buffer_draw_editor_view");
|
|
8742
8968
|
nativeResult("ot_buffer_draw_editor_view", this.opentui.symbols.ot_buffer_draw_editor_view(pointer, destination, request, source, column, row));
|
|
8743
8969
|
}
|
|
8744
|
-
|
|
8970
|
+
contextDrawSceneBody({ context, target, frame }, node, x, y) {
|
|
8745
8971
|
this.getYogaHost().assertMutable();
|
|
8746
8972
|
const destination = encodeContextHandle(context, target);
|
|
8747
8973
|
const request = frame === null ? null : encodeSceneFrameRequest(context, frame);
|
|
8748
8974
|
const source = encodeContextHandle(context, node);
|
|
8749
|
-
const column = toFFII32(x, "Scene
|
|
8750
|
-
const row = toFFII32(y, "Scene
|
|
8751
|
-
const pointer = this.nativeContextPointer(context, "
|
|
8752
|
-
nativeResult("
|
|
8975
|
+
const column = toFFII32(x, "Scene body x");
|
|
8976
|
+
const row = toFFII32(y, "Scene body y");
|
|
8977
|
+
const pointer = this.nativeContextPointer(context, "ot_buffer_draw_scene_body");
|
|
8978
|
+
nativeResult("ot_buffer_draw_scene_body", this.opentui.symbols.ot_buffer_draw_scene_body(pointer, destination, request, source, column, row));
|
|
8753
8979
|
}
|
|
8754
8980
|
createContextEditBuffer(context, options = {}) {
|
|
8755
8981
|
const layout = nativeLayouts.ot_edit_buffer_options;
|
|
@@ -9276,6 +9502,129 @@ class FFIRenderLib2 {
|
|
|
9276
9502
|
nativeResult("ot_scene_set_image", this.opentui.symbols.ot_scene_set_image(pointer, handle, source, fitId, protocolId, storage));
|
|
9277
9503
|
});
|
|
9278
9504
|
}
|
|
9505
|
+
sceneSetVideo(context, node, fit, buffer) {
|
|
9506
|
+
const handle = encodeContextHandle(context, node);
|
|
9507
|
+
const storage = buffer === null ? null : encodeContextHandle(context, buffer);
|
|
9508
|
+
const fitId = IMAGE_FITS.indexOf(fit);
|
|
9509
|
+
if (fitId < 0)
|
|
9510
|
+
throw new TypeError("Unknown video fit");
|
|
9511
|
+
this.getYogaHost().runMutation(() => {
|
|
9512
|
+
const pointer = this.nativeContextPointer(context, "ot_scene_set_video");
|
|
9513
|
+
nativeResult("ot_scene_set_video", this.opentui.symbols.ot_scene_set_video(pointer, handle, fitId, storage));
|
|
9514
|
+
});
|
|
9515
|
+
}
|
|
9516
|
+
sceneSetCrop(context, node, crop) {
|
|
9517
|
+
const handle = encodeContextHandle(context, node);
|
|
9518
|
+
const { left = 0, top = 0, width = 0, height = 0 } = crop ?? {};
|
|
9519
|
+
this.getYogaHost().runMutation(() => {
|
|
9520
|
+
const pointer = this.nativeContextPointer(context, "ot_scene_set_crop");
|
|
9521
|
+
nativeResult("ot_scene_set_crop", this.opentui.symbols.ot_scene_set_crop(pointer, handle, left, top, width, height));
|
|
9522
|
+
});
|
|
9523
|
+
}
|
|
9524
|
+
videoOpen(context, node, path, audio) {
|
|
9525
|
+
const handle = encodeContextHandle(context, node);
|
|
9526
|
+
const bytes = path.length === 0 ? null : sessionBytes(this.encoder.encode(path), "Video path length");
|
|
9527
|
+
const layout = nativeLayouts.ot_video_info;
|
|
9528
|
+
const output = new Uint8Array(layout.size);
|
|
9529
|
+
const flags = audio ? 0 : nativeConstants.OT_VIDEO_OPEN_NO_AUDIO;
|
|
9530
|
+
this.getYogaHost().runMutation(() => {
|
|
9531
|
+
const pointer = this.nativeContextPointer(context, "ot_video_open");
|
|
9532
|
+
nativeResult("ot_video_open", this.opentui.symbols.ot_video_open(pointer, handle, bytes, bytes?.byteLength ?? 0, flags, output));
|
|
9533
|
+
});
|
|
9534
|
+
const view = new DataView(output.buffer);
|
|
9535
|
+
const fields = layout.fields;
|
|
9536
|
+
return {
|
|
9537
|
+
durationUs: view.getBigInt64(fields.duration_us.offset, true),
|
|
9538
|
+
width: view.getUint32(fields.width.offset, true),
|
|
9539
|
+
height: view.getUint32(fields.height.offset, true),
|
|
9540
|
+
fpsNum: view.getUint32(fields.fps_num.offset, true),
|
|
9541
|
+
fpsDen: view.getUint32(fields.fps_den.offset, true),
|
|
9542
|
+
hasAudio: view.getUint32(fields.has_audio.offset, true) !== 0
|
|
9543
|
+
};
|
|
9544
|
+
}
|
|
9545
|
+
videoCall(context, node, operation) {
|
|
9546
|
+
const handle = encodeContextHandle(context, node);
|
|
9547
|
+
this.getYogaHost().runMutation(() => {
|
|
9548
|
+
const pointer = this.nativeContextPointer(context, operation);
|
|
9549
|
+
nativeResult(operation, this.opentui.symbols[operation](pointer, handle));
|
|
9550
|
+
});
|
|
9551
|
+
}
|
|
9552
|
+
videoSeek(context, node, timeUs) {
|
|
9553
|
+
const handle = encodeContextHandle(context, node);
|
|
9554
|
+
this.getYogaHost().runMutation(() => {
|
|
9555
|
+
const pointer = this.nativeContextPointer(context, "ot_video_seek");
|
|
9556
|
+
nativeResult("ot_video_seek", this.opentui.symbols.ot_video_seek(pointer, handle, timeUs));
|
|
9557
|
+
});
|
|
9558
|
+
}
|
|
9559
|
+
videoSetLoop(context, node, loop) {
|
|
9560
|
+
const handle = encodeContextHandle(context, node);
|
|
9561
|
+
const value = toFFIBool(loop, "Video loop");
|
|
9562
|
+
this.getYogaHost().runMutation(() => {
|
|
9563
|
+
const pointer = this.nativeContextPointer(context, "ot_video_set_loop");
|
|
9564
|
+
nativeResult("ot_video_set_loop", this.opentui.symbols.ot_video_set_loop(pointer, handle, value));
|
|
9565
|
+
});
|
|
9566
|
+
}
|
|
9567
|
+
videoSetMuted(context, node, muted) {
|
|
9568
|
+
const handle = encodeContextHandle(context, node);
|
|
9569
|
+
const value = toFFIBool(muted, "Video muted");
|
|
9570
|
+
this.getYogaHost().runMutation(() => {
|
|
9571
|
+
const pointer = this.nativeContextPointer(context, "ot_video_set_muted");
|
|
9572
|
+
nativeResult("ot_video_set_muted", this.opentui.symbols.ot_video_set_muted(pointer, handle, value));
|
|
9573
|
+
});
|
|
9574
|
+
}
|
|
9575
|
+
videoSetVolume(context, node, volume) {
|
|
9576
|
+
const handle = encodeContextHandle(context, node);
|
|
9577
|
+
const value = toFFIF32(volume, "Video volume");
|
|
9578
|
+
this.getYogaHost().runMutation(() => {
|
|
9579
|
+
const pointer = this.nativeContextPointer(context, "ot_video_set_volume");
|
|
9580
|
+
nativeResult("ot_video_set_volume", this.opentui.symbols.ot_video_set_volume(pointer, handle, value));
|
|
9581
|
+
});
|
|
9582
|
+
}
|
|
9583
|
+
videoSetAvSyncOffset(context, node, offsetUs) {
|
|
9584
|
+
const handle = encodeContextHandle(context, node);
|
|
9585
|
+
this.getYogaHost().runMutation(() => {
|
|
9586
|
+
const pointer = this.nativeContextPointer(context, "ot_video_set_av_sync_offset");
|
|
9587
|
+
nativeResult("ot_video_set_av_sync_offset", this.opentui.symbols.ot_video_set_av_sync_offset(pointer, handle, offsetUs));
|
|
9588
|
+
});
|
|
9589
|
+
}
|
|
9590
|
+
videoSetMaxFps(context, node, fps) {
|
|
9591
|
+
const handle = encodeContextHandle(context, node);
|
|
9592
|
+
if (!isFFIU32(fps))
|
|
9593
|
+
throw new RangeError("Video maxFps must be a u32");
|
|
9594
|
+
this.getYogaHost().runMutation(() => {
|
|
9595
|
+
const pointer = this.nativeContextPointer(context, "ot_video_set_max_fps");
|
|
9596
|
+
nativeResult("ot_video_set_max_fps", this.opentui.symbols.ot_video_set_max_fps(pointer, handle, fps));
|
|
9597
|
+
});
|
|
9598
|
+
}
|
|
9599
|
+
videoGetState(context, node) {
|
|
9600
|
+
const handle = encodeContextHandle(context, node);
|
|
9601
|
+
const layout = nativeLayouts.ot_video_state;
|
|
9602
|
+
const output = this.videoStateRecord;
|
|
9603
|
+
this.getYogaHost().runMutation(() => {
|
|
9604
|
+
const pointer = this.nativeContextPointer(context, "ot_video_get_state");
|
|
9605
|
+
nativeResult("ot_video_get_state", this.opentui.symbols.ot_video_get_state(pointer, handle, output));
|
|
9606
|
+
});
|
|
9607
|
+
const view = this.videoStateView;
|
|
9608
|
+
const flags = view.getUint32(layout.fields.flags.offset, true);
|
|
9609
|
+
return {
|
|
9610
|
+
currentTimeUs: view.getBigInt64(layout.fields.current_time_us.offset, true),
|
|
9611
|
+
framePtsUs: view.getBigInt64(layout.fields.frame_pts_us.offset, true),
|
|
9612
|
+
playing: (flags & nativeConstants.OT_VIDEO_PLAYING) !== 0,
|
|
9613
|
+
ended: (flags & nativeConstants.OT_VIDEO_ENDED) !== 0,
|
|
9614
|
+
buffering: (flags & nativeConstants.OT_VIDEO_BUFFERING) !== 0,
|
|
9615
|
+
audio: (flags & nativeConstants.OT_VIDEO_AUDIO) !== 0,
|
|
9616
|
+
hasFrame: (flags & nativeConstants.OT_VIDEO_HAS_FRAME) !== 0,
|
|
9617
|
+
failed: (flags & nativeConstants.OT_VIDEO_ERROR) !== 0,
|
|
9618
|
+
qualityTier: view.getUint32(layout.fields.quality_tier.offset, true)
|
|
9619
|
+
};
|
|
9620
|
+
}
|
|
9621
|
+
videoGetError(context, node) {
|
|
9622
|
+
const handle = encodeContextHandle(context, node);
|
|
9623
|
+
return this.getYogaHost().runMutation(() => {
|
|
9624
|
+
const pointer = this.nativeContextPointer(context, "ot_video_get_error");
|
|
9625
|
+
return this.readText("ot_video_get_error", (bytes, capacity, count) => this.opentui.symbols.ot_video_get_error(pointer, handle, bytes, capacity, count));
|
|
9626
|
+
});
|
|
9627
|
+
}
|
|
9279
9628
|
contextDrawImage({ context, target, frame }, image, options) {
|
|
9280
9629
|
const layout = nativeLayouts.ot_image_draw_options;
|
|
9281
9630
|
const handle = encodeContextHandle(context, target);
|
|
@@ -9628,7 +9977,10 @@ class FFIRenderLib2 {
|
|
|
9628
9977
|
width: words[layout.fields.width.offset / 4],
|
|
9629
9978
|
height: words[layout.fields.height.offset / 4],
|
|
9630
9979
|
frameCount: output[layout.fields.frame_count.offset / 8],
|
|
9631
|
-
framePending: words[layout.fields.frame_pending.offset / 4] !== 0
|
|
9980
|
+
framePending: words[layout.fields.frame_pending.offset / 4] !== 0,
|
|
9981
|
+
imageUploadsPending: words[layout.fields.image_uploads_pending.offset / 4],
|
|
9982
|
+
droppedFrames: words[layout.fields.dropped_frames.offset / 4],
|
|
9983
|
+
droppedFrameBytes: words[layout.fields.dropped_frame_bytes.offset / 4]
|
|
9632
9984
|
};
|
|
9633
9985
|
}
|
|
9634
9986
|
sessionAcquireBufferLease(context, session, which) {
|
|
@@ -9705,8 +10057,12 @@ class FFIRenderLib2 {
|
|
|
9705
10057
|
sessionSetupTerminal(context, session, options = {}) {
|
|
9706
10058
|
const layout = nativeLayouts.ot_session_terminal_options;
|
|
9707
10059
|
const handle = encodeContextHandle(context, session);
|
|
10060
|
+
const synchronizedOutput = options.synchronizedOutput ?? "auto";
|
|
10061
|
+
if (!Object.hasOwn(SYNCHRONIZED_OUTPUT_FLAGS, synchronizedOutput)) {
|
|
10062
|
+
throw new TypeError("Session synchronizedOutput must be auto, always, or never");
|
|
10063
|
+
}
|
|
9708
10064
|
const flag = (value, label, bit) => toFFIBool(value ?? true, `Session ${label}`) ? bit : 0;
|
|
9709
|
-
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);
|
|
10065
|
+
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);
|
|
9710
10066
|
const record = createContextRecord(layout);
|
|
9711
10067
|
record[layout.fields.flags.offset / 4] = flags;
|
|
9712
10068
|
record[layout.fields.kitty_keyboard_flags.offset / 4] = toSafeFFIU32Length(options.kittyKeyboardFlags ?? 5, "Session kittyKeyboardFlags");
|
|
@@ -9840,6 +10196,7 @@ class FFIRenderLib2 {
|
|
|
9840
10196
|
break;
|
|
9841
10197
|
case "query-pixel-resolution":
|
|
9842
10198
|
record[kind] = nativeConstants.OT_CONTROL_QUERY_PIXEL_RESOLUTION;
|
|
10199
|
+
record[layout.fields.argument.offset / 4] = command.sentinel ? 1 : 0;
|
|
9843
10200
|
break;
|
|
9844
10201
|
case "query-theme-colors":
|
|
9845
10202
|
record[kind] = nativeConstants.OT_CONTROL_QUERY_THEME_COLORS;
|
|
@@ -10004,6 +10361,15 @@ class FFIRenderLib2 {
|
|
|
10004
10361
|
nativeResult("ot_session_drain_stdout", this.opentui.symbols.ot_session_drain_stdout(pointer, handle, limit, output));
|
|
10005
10362
|
return output[0];
|
|
10006
10363
|
}
|
|
10364
|
+
sessionPostStdout(context, session, maxBytes, wait) {
|
|
10365
|
+
const handle = encodeContextHandle(context, session);
|
|
10366
|
+
const limit = toSafeFFIU32Length(maxBytes, "Stdout byte limit");
|
|
10367
|
+
const state = new Uint32Array(1);
|
|
10368
|
+
const written = new Uint32Array(1);
|
|
10369
|
+
const pointer = this.nativeContextPointer(context, "ot_session_post_stdout");
|
|
10370
|
+
nativeResult("ot_session_post_stdout", this.opentui.symbols.ot_session_post_stdout(pointer, handle, limit, wait ? 1 : 0, state, written));
|
|
10371
|
+
return { written: written[0], inFlight: state[0] === 1 };
|
|
10372
|
+
}
|
|
10007
10373
|
sessionCompleteOutput(context, session, ticket, success) {
|
|
10008
10374
|
const layout = nativeLayouts.ot_output_ticket;
|
|
10009
10375
|
const written = toFFIBool(success, "Session output success");
|
|
@@ -10019,6 +10385,10 @@ class FFIRenderLib2 {
|
|
|
10019
10385
|
const handle = encodeContextHandle(context, session);
|
|
10020
10386
|
nativeResult("ot_session_close", this.opentui.symbols.ot_session_close(this.nativeContextPointer(context, "ot_session_close"), handle));
|
|
10021
10387
|
}
|
|
10388
|
+
sessionDropOutput(context, session) {
|
|
10389
|
+
const handle = encodeContextHandle(context, session);
|
|
10390
|
+
nativeResult("ot_session_drop_output", this.opentui.symbols.ot_session_drop_output(this.nativeContextPointer(context, "ot_session_drop_output"), handle));
|
|
10391
|
+
}
|
|
10022
10392
|
sessionCancel(context, session) {
|
|
10023
10393
|
const handle = encodeContextHandle(context, session);
|
|
10024
10394
|
nativeResult("ot_session_cancel", this.opentui.symbols.ot_session_cancel(this.nativeContextPointer(context, "ot_session_cancel"), handle));
|
|
@@ -10399,6 +10769,90 @@ class FFIRenderLib2 {
|
|
|
10399
10769
|
const pointer = this.nativeContextPointer(context, "ot_scene_set_arrow");
|
|
10400
10770
|
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));
|
|
10401
10771
|
}
|
|
10772
|
+
sceneSetScroll(context, node, options) {
|
|
10773
|
+
const layout = nativeLayouts.ot_scene_scroll_options;
|
|
10774
|
+
const bar = nativeLayouts.ot_scene_scroll_bar_options;
|
|
10775
|
+
this.getYogaHost().assertMutable();
|
|
10776
|
+
const handle = encodeContextHandle(context, node);
|
|
10777
|
+
const record = createContextRecord(layout);
|
|
10778
|
+
const floats = new Float32Array(record.buffer);
|
|
10779
|
+
const colors = new Uint16Array(record.buffer);
|
|
10780
|
+
const follow = SCENE_SCROLL_FOLLOW.indexOf(options.follow);
|
|
10781
|
+
if (follow < 0)
|
|
10782
|
+
throw new TypeError("Unknown scene scroll follow edge");
|
|
10783
|
+
const fields = layout.fields;
|
|
10784
|
+
record[fields.axes.offset / 4] = (options.scrollX ? nativeConstants.OT_SCENE_SCROLL_X : 0) | (options.scrollY ? nativeConstants.OT_SCENE_SCROLL_Y : 0);
|
|
10785
|
+
record[fields.follow.offset / 4] = follow;
|
|
10786
|
+
record[fields.culling.offset / 4] = toFFIBool(options.culling, "Scene scroll culling");
|
|
10787
|
+
for (let edge = 0;edge < 4; edge++)
|
|
10788
|
+
floats[fields.padding.offset / 4 + edge] = options.padding[edge];
|
|
10789
|
+
let fills = 0;
|
|
10790
|
+
for (const [index, field] of ["wrapper_background", "viewport_background", "content_background"].entries()) {
|
|
10791
|
+
const color = options.fills[index];
|
|
10792
|
+
if (!color)
|
|
10793
|
+
continue;
|
|
10794
|
+
fills |= 1 << index;
|
|
10795
|
+
contextBufferColor(color, colors, fields[field].offset / 2);
|
|
10796
|
+
}
|
|
10797
|
+
record[fields.fills.offset / 4] = fills;
|
|
10798
|
+
for (let axis = 0;axis < 2; axis++) {
|
|
10799
|
+
const base = fields.bars.offset + axis * bar.size;
|
|
10800
|
+
const value = options.bars[axis];
|
|
10801
|
+
const policy = SCENE_SCROLL_BAR_POLICY.indexOf(value.policy);
|
|
10802
|
+
if (policy < 0)
|
|
10803
|
+
throw new TypeError("Unknown scene scroll bar policy");
|
|
10804
|
+
record[(base + bar.fields.policy.offset) / 4] = policy;
|
|
10805
|
+
record[(base + bar.fields.placement.offset) / 4] = toFFIBool(value.overlay, "Scene scroll bar overlay");
|
|
10806
|
+
record[(base + bar.fields.thickness.offset) / 4] = toSafeFFIU32Length(value.thickness, "Scene scroll bar thickness");
|
|
10807
|
+
record[(base + bar.fields.gap.offset) / 4] = toSafeFFIU32Length(value.gap, "Scene scroll bar gap");
|
|
10808
|
+
record[(base + bar.fields.arrows.offset) / 4] = toFFIBool(value.arrows, "Scene scroll bar arrows");
|
|
10809
|
+
contextBufferColor(value.foregroundColor, colors, (base + bar.fields.track_foreground.offset) / 2);
|
|
10810
|
+
contextBufferColor(value.backgroundColor, colors, (base + bar.fields.track_background.offset) / 2);
|
|
10811
|
+
}
|
|
10812
|
+
const pointer = this.nativeContextPointer(context, "ot_scene_set_scroll");
|
|
10813
|
+
nativeResult("ot_scene_set_scroll", this.opentui.symbols.ot_scene_set_scroll(pointer, handle, record));
|
|
10814
|
+
}
|
|
10815
|
+
sceneSetScrollArrow(context, node, axis, end, options) {
|
|
10816
|
+
const layout = nativeLayouts.ot_scene_arrow_options;
|
|
10817
|
+
this.getYogaHost().assertMutable();
|
|
10818
|
+
const handle = encodeContextHandle(context, node);
|
|
10819
|
+
const record = createContextRecord(layout);
|
|
10820
|
+
record[layout.fields.attributes.offset / 4] = toSafeFFIU32Length(options.attributes, "Scene arrow attributes");
|
|
10821
|
+
const colors = new Uint16Array(record.buffer);
|
|
10822
|
+
contextBufferColor(options.foregroundColor, colors, layout.fields.foreground.offset / 2);
|
|
10823
|
+
contextBufferColor(options.backgroundColor, colors, layout.fields.background.offset / 2);
|
|
10824
|
+
const text = options.text;
|
|
10825
|
+
const bytes = text === undefined ? null : sessionBytes(this.encoder.encode(text), "Scene arrow text length");
|
|
10826
|
+
if (bytes && bytes.length > NATIVE_BUFFER_TEXT_BYTES_MAX2)
|
|
10827
|
+
throw new RangeError("Scene arrow text is too long");
|
|
10828
|
+
const pointer = this.nativeContextPointer(context, "ot_scene_set_scroll_arrow");
|
|
10829
|
+
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));
|
|
10830
|
+
}
|
|
10831
|
+
sceneScrollTo(context, node, x, y, relativeX, relativeY, reapply = false) {
|
|
10832
|
+
this.getYogaHost().assertMutable();
|
|
10833
|
+
const handle = encodeContextHandle(context, node);
|
|
10834
|
+
const output = createContextRecord(nativeLayouts.ot_scene_scroll_state);
|
|
10835
|
+
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);
|
|
10836
|
+
const pointer = this.nativeContextPointer(context, "ot_scene_scroll_to");
|
|
10837
|
+
nativeResult("ot_scene_scroll_to", this.opentui.symbols.ot_scene_scroll_to(pointer, handle, x, y, flags, output));
|
|
10838
|
+
return readSceneScrollState(output);
|
|
10839
|
+
}
|
|
10840
|
+
sceneScrollRequest(context, node, kind, target, align = "nearest", inset = 0) {
|
|
10841
|
+
this.getYogaHost().assertMutable();
|
|
10842
|
+
const handle = encodeContextHandle(context, node);
|
|
10843
|
+
const encodedTarget = target === null ? null : encodeContextHandle(context, target);
|
|
10844
|
+
const output = createContextRecord(nativeLayouts.ot_scene_scroll_state);
|
|
10845
|
+
const pointer = this.nativeContextPointer(context, "ot_scene_scroll_request");
|
|
10846
|
+
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));
|
|
10847
|
+
return readSceneScrollState(output);
|
|
10848
|
+
}
|
|
10849
|
+
sceneGetScroll(context, node) {
|
|
10850
|
+
const handle = encodeContextHandle(context, node);
|
|
10851
|
+
const output = createContextRecord(nativeLayouts.ot_scene_scroll_state);
|
|
10852
|
+
const pointer = this.nativeContextPointer(context, "ot_scene_get_scroll");
|
|
10853
|
+
nativeResult("ot_scene_get_scroll", this.opentui.symbols.ot_scene_get_scroll(pointer, handle, output));
|
|
10854
|
+
return readSceneScrollState(output);
|
|
10855
|
+
}
|
|
10402
10856
|
sceneSetTextOptions(context, node, options) {
|
|
10403
10857
|
const layout = nativeLayouts.ot_scene_text_options;
|
|
10404
10858
|
this.getYogaHost().assertMutable();
|
|
@@ -12815,7 +13269,7 @@ var Yoga = {
|
|
|
12815
13269
|
};
|
|
12816
13270
|
var yoga_default = Yoga;
|
|
12817
13271
|
|
|
12818
|
-
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 };
|
|
13272
|
+
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 };
|
|
12819
13273
|
|
|
12820
|
-
//# debugId=
|
|
12821
|
-
//# sourceMappingURL=chunk-bun-
|
|
13274
|
+
//# debugId=B045E4F588BC986E64756E2164756E21
|
|
13275
|
+
//# sourceMappingURL=chunk-bun-wdetc10w.js.map
|