@opentui/core 0.8.4 → 0.9.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.
Files changed (88) hide show
  1. package/NativeScene.d.ts +11 -3
  2. package/Renderable.d.ts +22 -6
  3. package/ansi.d.ts +1 -1
  4. package/{chunk-bun-dsfc571f.js → chunk-bun-v1wzs0bj.js} +679 -112
  5. package/chunk-bun-v1wzs0bj.js.map +35 -0
  6. package/{chunk-bun-83k2gdpc.js → chunk-bun-xartp4ps.js} +8718 -9733
  7. package/chunk-bun-xartp4ps.js.map +68 -0
  8. package/{chunk-node-3ssb37vb.js → chunk-node-5cqzgmq3.js} +8718 -9733
  9. package/chunk-node-5cqzgmq3.js.map +68 -0
  10. package/{chunk-node-5nvhjp1a.js → chunk-node-mcdre3zn.js} +679 -112
  11. package/chunk-node-mcdre3zn.js.map +34 -0
  12. package/edit-buffer.d.ts +47 -6
  13. package/editor-view.d.ts +28 -0
  14. package/index.bun.js +1355 -4789
  15. package/index.bun.js.map +18 -24
  16. package/index.node.js +1355 -4789
  17. package/index.node.js.map +19 -31
  18. package/lib/KeyHandler.d.ts +1 -1
  19. package/lib/extmarks.d.ts +15 -51
  20. package/lib/index.d.ts +1 -2
  21. package/lib/kitty-keys.d.ts +2 -0
  22. package/lib/parse.keypress.d.ts +8 -3
  23. package/lib/parse.mouse.d.ts +0 -13
  24. package/lib/stdin-parser-native.d.ts +36 -24
  25. package/lib/terminal-capability-detection.d.ts +3 -3
  26. package/lib/terminal-palette.d.ts +3 -0
  27. package/lib/tree-sitter/client.d.ts +14 -3
  28. package/lib/tree-sitter/types.d.ts +10 -0
  29. package/lib/tree-sitter-styled-text.d.ts +2 -0
  30. package/lib/yoga.options.d.ts +3 -0
  31. package/native-abi.generated.d.ts +1400 -1
  32. package/package.json +9 -10
  33. package/parser.worker.js +112 -29
  34. package/parser.worker.js.map +3 -3
  35. package/plugins/core-slot.d.ts +1 -1
  36. package/renderables/ASCIIFont.d.ts +5 -0
  37. package/renderables/Code.d.ts +25 -2
  38. package/renderables/Diff.d.ts +3 -1
  39. package/renderables/EditBufferRenderable.d.ts +30 -1
  40. package/renderables/EmbeddedTerminal.d.ts +1 -1
  41. package/renderables/Input.d.ts +6 -3
  42. package/renderables/LineNumberRenderable.d.ts +4 -0
  43. package/renderables/Markdown.d.ts +208 -124
  44. package/renderables/ScrollBox.d.ts +7 -2
  45. package/renderables/ScrollBoxParts.d.ts +4 -5
  46. package/renderables/Select.d.ts +2 -2
  47. package/renderables/TabSelect.d.ts +2 -2
  48. package/renderables/Text.d.ts +3 -1
  49. package/renderables/TextBufferRenderable.d.ts +4 -0
  50. package/renderables/TextTable.d.ts +22 -0
  51. package/renderables/Textarea.d.ts +2 -1
  52. package/renderables/__tests__/code-model-harness.d.ts +40 -0
  53. package/renderables/index.d.ts +1 -3
  54. package/renderables/markdown-document.d.ts +37 -0
  55. package/renderables/props.d.ts +10 -0
  56. package/renderer-theme-mode.d.ts +5 -1
  57. package/renderer.d.ts +23 -9
  58. package/runtime-plugin.js +32 -57
  59. package/runtime-plugin.js.map +1 -1
  60. package/syntax-style.d.ts +5 -0
  61. package/testing/mock-tree-sitter-client.d.ts +5 -0
  62. package/testing/model.d.ts +15 -0
  63. package/testing.bun.js +8 -31
  64. package/testing.bun.js.map +4 -4
  65. package/testing.js +8 -31
  66. package/testing.js.map +4 -4
  67. package/tests/shrink-same-check.d.ts +4 -0
  68. package/tests/yoga-upstream/tools/utils.d.ts +9 -2
  69. package/text-buffer-view.d.ts +4 -0
  70. package/text-buffer.d.ts +16 -1
  71. package/types.d.ts +2 -2
  72. package/yoga.bun.js +1 -1
  73. package/yoga.internal.d.ts +1 -0
  74. package/yoga.js +1 -1
  75. package/zig.d.ts +107 -6
  76. package/chunk-bun-83k2gdpc.js.map +0 -70
  77. package/chunk-bun-dsfc571f.js.map +0 -35
  78. package/chunk-node-3ssb37vb.js.map +0 -70
  79. package/chunk-node-5nvhjp1a.js.map +0 -34
  80. package/lib/debounce.d.ts +0 -42
  81. package/lib/extmarks-history.d.ts +0 -17
  82. package/lib/parse.keypress-kitty.d.ts +0 -5
  83. package/lib/queue.d.ts +0 -15
  84. package/lib/stdin-parser.d.ts +0 -97
  85. package/renderables/composition/VRenderable.d.ts +0 -16
  86. package/renderables/composition/constructs.d.ts +0 -35
  87. package/renderables/composition/vnode.d.ts +0 -46
  88. package/renderables/markdown-parser.d.ts +0 -12
@@ -153,6 +153,24 @@ __export(exports_yoga, {
153
153
  });
154
154
 
155
155
  // src/native-abi.generated.ts
156
+ var OT_DISPLAY_FLEX = 0;
157
+ var OT_DISPLAY_NONE = 1;
158
+ var OT_DISPLAY_CONTENTS = 2;
159
+ var OT_YOGA_ERRATA_NONE = 0;
160
+ var OT_YOGA_ERRATA_STRETCH_FLEX_BASIS = 1;
161
+ var OT_YOGA_ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING = 2;
162
+ var OT_YOGA_ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE = 4;
163
+ var OT_YOGA_ERRATA_ALL = 2147483647;
164
+ var OT_YOGA_ERRATA_CLASSIC = 2147483646;
165
+ var OT_YOGA_EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS = 0;
166
+ var OT_YOGA_LOG_LEVEL_ERROR = 0;
167
+ var OT_YOGA_LOG_LEVEL_WARN = 1;
168
+ var OT_YOGA_LOG_LEVEL_INFO = 2;
169
+ var OT_YOGA_LOG_LEVEL_DEBUG = 3;
170
+ var OT_YOGA_LOG_LEVEL_VERBOSE = 4;
171
+ var OT_YOGA_LOG_LEVEL_FATAL = 5;
172
+ var OT_YOGA_NODE_TYPE_DEFAULT = 0;
173
+ var OT_YOGA_NODE_TYPE_TEXT = 1;
156
174
  var nativeSymbols = {
157
175
  ot_scene_set_hooks: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
158
176
  ot_scene_frame_step_with_geometry: {
@@ -164,9 +182,11 @@ var nativeSymbols = {
164
182
  ot_scene_create_node: { args: ["ptr", "buffer", "u32", "u32", "buffer"], returns: "i32" },
165
183
  ot_scene_destroy_node: { args: ["ptr", "buffer"], returns: "i32" },
166
184
  ot_scene_move_node: { args: ["ptr", "buffer", "ptr", "u32"], returns: "i32" },
185
+ ot_scene_clear_children: { args: ["ptr", "buffer"], returns: "i32" },
167
186
  ot_scene_set_measure: { args: ["ptr", "buffer", "ptr"], returns: "i32" },
168
187
  ot_scene_has_measure: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
169
188
  ot_scene_reaches_hooks: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
189
+ ot_scene_painted: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
170
190
  ot_scene_mark_dirty: { args: ["ptr", "buffer"], returns: "i32" },
171
191
  ot_scene_set_style: { args: ["ptr", "buffer", "u32", "u32", "u32", "u32", "f32", "u32"], returns: "i32" },
172
192
  ot_scene_get_style: { args: ["ptr", "buffer", "u32", "u32", "u32", "buffer"], returns: "i32" },
@@ -193,9 +213,11 @@ var nativeSymbols = {
193
213
  ot_scene_get_text: { args: ["ptr", "buffer", "ptr", "u32", "buffer"], returns: "i32" },
194
214
  ot_scene_get_text_info: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
195
215
  ot_scene_get_text_lines: { args: ["ptr", "buffer", "u32", "ptr", "u32", "buffer"], returns: "i32" },
216
+ ot_scene_get_text_byte_at: { args: ["ptr", "buffer", "i32", "i32", "buffer"], returns: "i32" },
196
217
  ot_scene_get_layout: { args: ["ptr", "buffer", "u32", "buffer"], returns: "i32" },
197
218
  ot_scene_paint: { args: ["ptr", "buffer", "buffer", "u32", "u32", "buffer"], returns: "i32" },
198
219
  ot_scene_hit_test: { args: ["ptr", "buffer", "i32", "i32", "buffer"], returns: "i32" },
220
+ ot_scene_hit_test_excluding: { args: ["ptr", "buffer", "i32", "i32", "u32", "buffer"], returns: "i32" },
199
221
  ot_scene_get_stats: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
200
222
  ot_scene_set_debug_flags: { args: ["ptr", "buffer", "u32"], returns: "i32" },
201
223
  ot_scene_get_cursor_state: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
@@ -251,6 +273,7 @@ var nativeSymbols = {
251
273
  args: ["ptr", "buffer", "u32", "u32", "u32", "u32", "u32", "ptr", "u32", "buffer"],
252
274
  returns: "i32"
253
275
  },
276
+ ot_edit_buffer_convert_offset: { args: ["ptr", "buffer", "u32", "u32", "buffer"], returns: "i32" },
254
277
  ot_edit_buffer_measure_text: { args: ["ptr", "buffer", "ptr", "u32", "buffer"], returns: "i32" },
255
278
  ot_edit_measure_text: { args: ["ptr", "ptr", "u32", "u32", "u32", "buffer"], returns: "i32" },
256
279
  ot_edit_buffer_set_defaults: { args: ["ptr", "buffer", "u32", "buffer"], returns: "i32" },
@@ -259,6 +282,24 @@ var nativeSymbols = {
259
282
  ot_syntax_style_get_count: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
260
283
  ot_edit_buffer_highlight: { args: ["ptr", "buffer", "u32", "u32", "ptr"], returns: "i32" },
261
284
  ot_edit_buffer_get_highlights: { args: ["ptr", "buffer", "u32", "ptr", "u32", "buffer"], returns: "i32" },
285
+ ot_context_group_set: { args: ["ptr", "buffer", "u32", "buffer", "u32", "buffer"], returns: "i32" },
286
+ ot_edit_buffer_set_layer: { args: ["ptr", "buffer", "u32", "u32", "u32", "ptr", "u32"], returns: "i32" },
287
+ ot_edit_buffer_mark: { args: ["ptr", "buffer", "u32", "ptr", "ptr"], returns: "i32" },
288
+ ot_edit_buffer_get_marks: { args: ["ptr", "buffer", "u32", "u32", "ptr", "u32", "buffer"], returns: "i32" },
289
+ ot_markdown_create: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
290
+ ot_markdown_destroy: { args: ["ptr", "buffer"], returns: "i32" },
291
+ ot_markdown_set_options: { args: ["ptr", "buffer", "buffer", "buffer"], returns: "i32" },
292
+ ot_markdown_append: { args: ["ptr", "buffer", "ptr", "u32", "buffer"], returns: "i32" },
293
+ ot_markdown_set: { args: ["ptr", "buffer", "ptr", "u32", "buffer"], returns: "i32" },
294
+ ot_markdown_finish: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
295
+ ot_markdown_get_source: { args: ["ptr", "buffer", "buffer", "buffer"], returns: "i32" },
296
+ ot_markdown_read_changes: { args: ["ptr", "buffer", "ptr", "u32", "buffer"], returns: "i32" },
297
+ ot_markdown_read_source: { args: ["ptr", "buffer", "u32", "ptr", "u32", "buffer"], returns: "i32" },
298
+ ot_markdown_read_leaf: {
299
+ args: ["ptr", "buffer", "u32", "ptr", "u32", "buffer", "ptr", "ptr", "u32", "buffer", "ptr", "u32", "buffer"],
300
+ returns: "i32"
301
+ },
302
+ ot_markdown_bind: { args: ["ptr", "buffer", "u32", "buffer"], returns: "i32" },
262
303
  ot_editor_view_set_viewport: { args: ["ptr", "buffer", "buffer", "u32", "u32"], returns: "i32" },
263
304
  ot_editor_view_get_viewport: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
264
305
  ot_editor_view_set_scroll_margin: { args: ["ptr", "buffer", "f32"], returns: "i32" },
@@ -345,8 +386,10 @@ var nativeSymbols = {
345
386
  ot_text_buffer_get_range: { args: ["ptr", "buffer", "u32", "u32", "ptr", "u32", "buffer"], returns: "i32" },
346
387
  ot_text_buffer_set_defaults: { args: ["ptr", "buffer", "u32", "buffer"], returns: "i32" },
347
388
  ot_text_buffer_set_tab_width: { args: ["ptr", "buffer", "u32"], returns: "i32" },
389
+ ot_text_buffer_set_width_method: { args: ["ptr", "buffer", "u32"], returns: "i32" },
348
390
  ot_text_buffer_highlight: { args: ["ptr", "buffer", "u32", "u32", "ptr"], returns: "i32" },
349
391
  ot_text_buffer_get_highlights: { args: ["ptr", "buffer", "u32", "ptr", "u32", "buffer"], returns: "i32" },
392
+ ot_text_buffer_set_layer: { args: ["ptr", "buffer", "u32", "u32", "u32", "ptr", "u32"], returns: "i32" },
350
393
  ot_text_buffer_view_set_viewport: { args: ["ptr", "buffer", "buffer", "u32"], returns: "i32" },
351
394
  ot_text_buffer_view_command: { args: ["ptr", "buffer", "u32", "u32"], returns: "i32" },
352
395
  ot_text_buffer_view_set_tab_color: { args: ["ptr", "buffer", "ptr"], returns: "i32" },
@@ -1053,7 +1096,7 @@ var nativeLayouts = {
1053
1096
  struct_size: { offset: 0, size: 4, alignment: 4, type: "u32" },
1054
1097
  abi_version: { offset: 4, size: 4, alignment: 4, type: "u32" },
1055
1098
  width_method: { offset: 8, size: 4, alignment: 4, type: "u32" },
1056
- reserved: { offset: 12, size: 4, alignment: 4, type: "u32" }
1099
+ flags: { offset: 12, size: 4, alignment: 4, type: "u32" }
1057
1100
  }
1058
1101
  },
1059
1102
  ot_edit_buffer_info: {
@@ -1123,6 +1166,71 @@ var nativeLayouts = {
1123
1166
  ref: { offset: 16, size: 4, alignment: 4, type: "u32" }
1124
1167
  }
1125
1168
  },
1169
+ ot_highlight_run: {
1170
+ size: 12,
1171
+ alignment: 4,
1172
+ fields: {
1173
+ start_byte: { offset: 0, size: 4, alignment: 4, type: "u32" },
1174
+ end_byte: { offset: 4, size: 4, alignment: 4, type: "u32" },
1175
+ group_set: { offset: 8, size: 4, alignment: 4, type: "u32" }
1176
+ }
1177
+ },
1178
+ ot_edit_mark: {
1179
+ size: 76,
1180
+ alignment: 4,
1181
+ fields: {
1182
+ struct_size: { offset: 0, size: 4, alignment: 4, type: "u32" },
1183
+ abi_version: { offset: 4, size: 4, alignment: 4, type: "u32" },
1184
+ id: { offset: 8, size: 4, alignment: 4, type: "u32" },
1185
+ kind: { offset: 12, size: 4, alignment: 4, type: "u32" },
1186
+ flags: { offset: 16, size: 4, alignment: 4, type: "u32" },
1187
+ style: { offset: 20, size: 4, alignment: 4, type: "u32" },
1188
+ value: { offset: 24, size: 32, alignment: 4, type: "ot_editor_style" },
1189
+ priority: { offset: 56, size: 4, alignment: 4, type: "u32" },
1190
+ start: { offset: 60, size: 4, alignment: 4, type: "u32" },
1191
+ end: { offset: 64, size: 4, alignment: 4, type: "u32" },
1192
+ start_byte: { offset: 68, size: 4, alignment: 4, type: "u32" },
1193
+ end_byte: { offset: 72, size: 4, alignment: 4, type: "u32" }
1194
+ }
1195
+ },
1196
+ ot_markdown_options: {
1197
+ size: 296,
1198
+ alignment: 8,
1199
+ fields: {
1200
+ struct_size: { offset: 0, size: 4, alignment: 4, type: "u32" },
1201
+ abi_version: { offset: 4, size: 4, alignment: 4, type: "u32" },
1202
+ flags: { offset: 8, size: 4, alignment: 4, type: "u32" },
1203
+ source_byte_limit: { offset: 12, size: 4, alignment: 4, type: "u32" },
1204
+ syntax_style: { offset: 16, size: 16, alignment: 8, type: "ot_handle" },
1205
+ hook_filter_byte_count: { offset: 32, size: 4, alignment: 4, type: "u32" },
1206
+ reserved: { offset: 36, size: 4, alignment: 4, type: "u32" },
1207
+ hook_filter: { offset: 40, size: 256, alignment: 1, type: "[256]u8" }
1208
+ }
1209
+ },
1210
+ ot_markdown_result: {
1211
+ size: 12,
1212
+ alignment: 4,
1213
+ fields: {
1214
+ changed_block_count: { offset: 0, size: 4, alignment: 4, type: "u32" },
1215
+ committed_top_level_count: { offset: 4, size: 4, alignment: 4, type: "u32" },
1216
+ removed_from_index: { offset: 8, size: 4, alignment: 4, type: "u32" }
1217
+ }
1218
+ },
1219
+ ot_markdown_block: {
1220
+ size: 32,
1221
+ alignment: 4,
1222
+ fields: {
1223
+ index: { offset: 0, size: 4, alignment: 4, type: "u32" },
1224
+ parent_index: { offset: 4, size: 4, alignment: 4, type: "u32" },
1225
+ kind: { offset: 8, size: 2, alignment: 2, type: "u16" },
1226
+ flags: { offset: 10, size: 2, alignment: 2, type: "u16" },
1227
+ source_start_byte: { offset: 12, size: 4, alignment: 4, type: "u32" },
1228
+ source_end_byte: { offset: 16, size: 4, alignment: 4, type: "u32" },
1229
+ info_start_byte: { offset: 20, size: 4, alignment: 4, type: "u32" },
1230
+ info_end_byte: { offset: 24, size: 4, alignment: 4, type: "u32" },
1231
+ number: { offset: 28, size: 4, alignment: 4, type: "u32" }
1232
+ }
1233
+ },
1126
1234
  ot_editor_viewport: {
1127
1235
  size: 24,
1128
1236
  alignment: 4,
@@ -1725,6 +1833,27 @@ var nativeLayouts = {
1725
1833
  foreground: { offset: 40, size: 8, alignment: 2, type: "[4]u16" },
1726
1834
  background: { offset: 48, size: 8, alignment: 2, type: "[4]u16" }
1727
1835
  }
1836
+ },
1837
+ ot_scene_cell: {
1838
+ size: 24,
1839
+ alignment: 4,
1840
+ fields: {
1841
+ character: { offset: 0, size: 4, alignment: 4, type: "u32" },
1842
+ attributes: { offset: 4, size: 4, alignment: 4, type: "u32" },
1843
+ foreground: { offset: 8, size: 8, alignment: 2, type: "[4]u16" },
1844
+ background: { offset: 16, size: 8, alignment: 2, type: "[4]u16" }
1845
+ }
1846
+ },
1847
+ ot_scene_record_cells: {
1848
+ size: 24,
1849
+ alignment: 4,
1850
+ fields: {
1851
+ header: { offset: 0, size: 8, alignment: 4, type: "ot_scene_record_header" },
1852
+ x: { offset: 8, size: 4, alignment: 4, type: "i32" },
1853
+ y: { offset: 12, size: 4, alignment: 4, type: "i32" },
1854
+ width: { offset: 16, size: 4, alignment: 4, type: "u32" },
1855
+ count: { offset: 20, size: 4, alignment: 4, type: "u32" }
1856
+ }
1728
1857
  }
1729
1858
  };
1730
1859
  var nativeConstants = {
@@ -1805,6 +1934,7 @@ var nativeConstants = {
1805
1934
  OT_STYLE_ENUM_OVERFLOW: 8,
1806
1935
  OT_STYLE_ENUM_DISPLAY: 9,
1807
1936
  OT_STYLE_ENUM_BOX_SIZING: 10,
1937
+ OT_STYLE_ENUM_LAYOUT_MODE: 11,
1808
1938
  OT_STYLE_FLOAT_FLEX: 0,
1809
1939
  OT_STYLE_FLOAT_FLEX_GROW: 1,
1810
1940
  OT_STYLE_FLOAT_FLEX_SHRINK: 2,
@@ -1874,6 +2004,24 @@ var nativeConstants = {
1874
2004
  OT_DISPLAY_NONE: 1,
1875
2005
  OT_BOX_SIZING_BORDER_BOX: 0,
1876
2006
  OT_BOX_SIZING_CONTENT_BOX: 1,
2007
+ OT_LAYOUT_MODE_FLEX: 0,
2008
+ OT_LAYOUT_MODE_LIST: 1,
2009
+ OT_DISPLAY_CONTENTS: 2,
2010
+ OT_YOGA_ERRATA_NONE: 0,
2011
+ OT_YOGA_ERRATA_STRETCH_FLEX_BASIS: 1,
2012
+ OT_YOGA_ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING: 2,
2013
+ OT_YOGA_ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE: 4,
2014
+ OT_YOGA_ERRATA_ALL: 2147483647,
2015
+ OT_YOGA_ERRATA_CLASSIC: 2147483646,
2016
+ OT_YOGA_EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: 0,
2017
+ OT_YOGA_LOG_LEVEL_ERROR: 0,
2018
+ OT_YOGA_LOG_LEVEL_WARN: 1,
2019
+ OT_YOGA_LOG_LEVEL_INFO: 2,
2020
+ OT_YOGA_LOG_LEVEL_DEBUG: 3,
2021
+ OT_YOGA_LOG_LEVEL_VERBOSE: 4,
2022
+ OT_YOGA_LOG_LEVEL_FATAL: 5,
2023
+ OT_YOGA_NODE_TYPE_DEFAULT: 0,
2024
+ OT_YOGA_NODE_TYPE_TEXT: 1,
1877
2025
  OT_STYLE_ENUM_DIRECTION_MAX: 2,
1878
2026
  OT_STYLE_ENUM_FLEX_DIRECTION_MAX: 3,
1879
2027
  OT_STYLE_ENUM_JUSTIFY_CONTENT_MAX: 5,
@@ -1885,12 +2033,14 @@ var nativeConstants = {
1885
2033
  OT_STYLE_ENUM_OVERFLOW_MAX: 2,
1886
2034
  OT_STYLE_ENUM_DISPLAY_MAX: 1,
1887
2035
  OT_STYLE_ENUM_BOX_SIZING_MAX: 1,
2036
+ OT_STYLE_ENUM_LAYOUT_MODE_MAX: 1,
1888
2037
  OT_MEASURE_UNDEFINED: 0,
1889
2038
  OT_MEASURE_EXACTLY: 1,
1890
2039
  OT_MEASURE_AT_MOST: 2,
1891
2040
  OT_LAYOUT_PUBLIC: 0,
1892
2041
  OT_LAYOUT_YOGA: 1,
1893
2042
  OT_LAYOUT_PAINT: 2,
2043
+ OT_LAYOUT_CONTENT: 3,
1894
2044
  OT_BORDER_NONE: 0,
1895
2045
  OT_BORDER_LEFT: 1,
1896
2046
  OT_BORDER_BOTTOM: 2,
@@ -1906,9 +2056,41 @@ var nativeConstants = {
1906
2056
  OT_COLOR_DEFAULT: 2,
1907
2057
  OT_COLOR_CHANNEL_MASK: 255,
1908
2058
  OT_COLOR_META_SHIFT: 8,
2059
+ OT_COLOR_ANSI_0: 0,
2060
+ OT_COLOR_ANSI_1: 8388608,
2061
+ OT_COLOR_ANSI_2: 32768,
2062
+ OT_COLOR_ANSI_3: 8421376,
2063
+ OT_COLOR_ANSI_4: 128,
2064
+ OT_COLOR_ANSI_5: 8388736,
2065
+ OT_COLOR_ANSI_6: 32896,
2066
+ OT_COLOR_ANSI_7: 12632256,
2067
+ OT_COLOR_ANSI_8: 8421504,
2068
+ OT_COLOR_ANSI_9: 16711680,
2069
+ OT_COLOR_ANSI_10: 65280,
2070
+ OT_COLOR_ANSI_11: 16776960,
2071
+ OT_COLOR_ANSI_12: 255,
2072
+ OT_COLOR_ANSI_13: 16711935,
2073
+ OT_COLOR_ANSI_14: 65535,
2074
+ OT_COLOR_ANSI_15: 16777215,
2075
+ OT_COLOR_CUBE_BASE: 55,
2076
+ OT_COLOR_CUBE_STEP: 40,
2077
+ OT_COLOR_GRAY_BASE: 8,
2078
+ OT_COLOR_GRAY_STEP: 10,
2079
+ OT_ATTR_BOLD: 1,
2080
+ OT_ATTR_DIM: 2,
2081
+ OT_ATTR_ITALIC: 4,
2082
+ OT_ATTR_UNDERLINE: 8,
2083
+ OT_ATTR_BLINK: 16,
2084
+ OT_ATTR_INVERSE: 32,
2085
+ OT_ATTR_HIDDEN: 64,
2086
+ OT_ATTR_STRIKETHROUGH: 128,
2087
+ OT_ATTR_BASE_MASK: 255,
2088
+ OT_ATTR_LINK_SHIFT: 8,
2089
+ OT_ATTR_LINK_MASK: 16777215,
1909
2090
  OT_SCENE_TEXT_SELECTION_RESET: 0,
1910
2091
  OT_SCENE_TEXT_SELECTION_SET: 1,
1911
2092
  OT_SCENE_TEXT_SELECTION_UPDATE: 2,
2093
+ OT_SCENE_TEXT_SELECTION_COLORS: 3,
1912
2094
  OT_SCENE_TEXT_SELECTION_CELL: 0,
1913
2095
  OT_SCENE_TEXT_SELECTION_WORD: 1,
1914
2096
  OT_SCENE_TEXT_SELECTION_LINE: 2,
@@ -1925,6 +2107,10 @@ var nativeConstants = {
1925
2107
  OT_SCENE_FULL_PATH_UNRETAINED: 16,
1926
2108
  OT_SCENE_FULL_PATH_OPTIONS: 32,
1927
2109
  OT_SCENE_FULL_PATH_NON_LOCAL: 64,
2110
+ OT_CURSOR_STYLE_BLOCK: 0,
2111
+ OT_CURSOR_STYLE_LINE: 1,
2112
+ OT_CURSOR_STYLE_UNDERLINE: 2,
2113
+ OT_CURSOR_STYLE_DEFAULT: 3,
1928
2114
  OT_SCENE_HOOK_UPDATE: 1,
1929
2115
  OT_SCENE_HOOK_RESIZE: 2,
1930
2116
  OT_SCENE_HOOK_LAYOUT_CHANGED: 4,
@@ -1980,6 +2166,7 @@ var nativeConstants = {
1980
2166
  OT_SCENE_SCROLL_ALIGN_NEAREST: 0,
1981
2167
  OT_SCENE_SCROLL_ALIGN_START: 1,
1982
2168
  OT_SCENE_SCROLL_ALIGN_END: 2,
2169
+ OT_SCENE_SCROLL_PADDING_MAX: 65535,
1983
2170
  OT_SCENE_SCROLL_CHANGED_OFFSET_X: 1,
1984
2171
  OT_SCENE_SCROLL_CHANGED_OFFSET_Y: 2,
1985
2172
  OT_SCENE_SCROLL_CHANGED_CONTENT: 4,
@@ -2001,6 +2188,7 @@ var nativeConstants = {
2001
2188
  OT_RENDER_PENDING: 1,
2002
2189
  OT_RENDER_SKIPPED: 2,
2003
2190
  OT_RENDER_FAILED: 3,
2191
+ OT_SPLIT_SNAPSHOTS_MAX: 64,
2004
2192
  OT_SESSION_BUFFER_CURRENT: 0,
2005
2193
  OT_SESSION_BUFFER_NEXT: 1,
2006
2194
  OT_WIDTH_METHOD_WCWIDTH: 0,
@@ -2008,10 +2196,38 @@ var nativeConstants = {
2008
2196
  OT_WIDTH_METHOD_NO_ZWJ: 2,
2009
2197
  OT_WIDTH_METHOD_UNICODE_WIDE: 3,
2010
2198
  OT_BUFFER_RESPECT_ALPHA: 1,
2199
+ OT_EMBEDDED_TERMINAL_CURSOR_BAR: 0,
2200
+ OT_EMBEDDED_TERMINAL_CURSOR_BLOCK: 1,
2201
+ OT_EMBEDDED_TERMINAL_CURSOR_UNDERLINE: 2,
2202
+ OT_EMBEDDED_TERMINAL_CURSOR_BLOCK_HOLLOW: 3,
2203
+ OT_EMBEDDED_TERMINAL_MOD_SHIFT: 1,
2204
+ OT_EMBEDDED_TERMINAL_MOD_CTRL: 2,
2205
+ OT_EMBEDDED_TERMINAL_MOD_ALT: 4,
2206
+ OT_EMBEDDED_TERMINAL_MOD_SUPER: 8,
2207
+ OT_EMBEDDED_TERMINAL_MOD_CAPS_LOCK: 16,
2208
+ OT_EMBEDDED_TERMINAL_MOD_NUM_LOCK: 32,
2209
+ OT_EMBEDDED_TERMINAL_KEY_RELEASE: 0,
2210
+ OT_EMBEDDED_TERMINAL_KEY_PRESS: 1,
2211
+ OT_EMBEDDED_TERMINAL_KEY_REPEAT: 2,
2212
+ OT_EMBEDDED_TERMINAL_MOUSE_PRESS: 0,
2213
+ OT_EMBEDDED_TERMINAL_MOUSE_RELEASE: 1,
2214
+ OT_EMBEDDED_TERMINAL_MOUSE_MOTION: 2,
2215
+ OT_EMBEDDED_TERMINAL_BUTTON_NONE: -1,
2216
+ OT_EMBEDDED_TERMINAL_BUTTON_UNKNOWN: 0,
2217
+ OT_EMBEDDED_TERMINAL_BUTTON_LEFT: 1,
2218
+ OT_EMBEDDED_TERMINAL_BUTTON_RIGHT: 2,
2219
+ OT_EMBEDDED_TERMINAL_BUTTON_MIDDLE: 3,
2220
+ OT_EMBEDDED_TERMINAL_BUTTON_FOUR: 4,
2221
+ OT_EMBEDDED_TERMINAL_BUTTON_FIVE: 5,
2222
+ OT_EMBEDDED_TERMINAL_BUTTON_SIX: 6,
2223
+ OT_EMBEDDED_TERMINAL_BUTTON_SEVEN: 7,
2224
+ OT_EMBEDDED_TERMINAL_INPUT_BYTES_MAX: 1048576,
2011
2225
  OT_EMBEDDED_TERMINAL_INVALIDATE: 0,
2012
2226
  OT_EMBEDDED_TERMINAL_SCROLL: 1,
2013
2227
  OT_EMBEDDED_TERMINAL_CLEAR_SELECTION: 2,
2014
2228
  OT_EMBEDDED_TERMINAL_SET_TRANSPARENT_BACKGROUND: 3,
2229
+ OT_EMBEDDED_TERMINAL_RESPONSE_BYTES_MAX: 1048576,
2230
+ OT_EDIT_BUFFER_FOLLOW_SESSION_WIDTH: 1,
2015
2231
  OT_EDIT_CURSOR_CHANGED: 1,
2016
2232
  OT_EDIT_CONTENT_CHANGED: 2,
2017
2233
  OT_EDIT_HISTORY_CURSOR_CHANGED: 4,
@@ -2066,6 +2282,9 @@ var nativeConstants = {
2066
2282
  OT_EDIT_CLEAR: 10,
2067
2283
  OT_EDIT_CLEAR_HISTORY: 11,
2068
2284
  OT_EDIT_DEBUG_ROPE: 12,
2285
+ OT_EDIT_CURSOR_OFFSET_ATOMIC: 13,
2286
+ OT_EDIT_KEEP_OUTSIDE: 14,
2287
+ OT_EDIT_ATOMIC: 1,
2069
2288
  OT_EDIT_POSITION_CURSOR: 0,
2070
2289
  OT_EDIT_POSITION_NEXT_WORD: 1,
2071
2290
  OT_EDIT_POSITION_PREV_WORD: 2,
@@ -2075,15 +2294,60 @@ var nativeConstants = {
2075
2294
  OT_EDIT_POSITION_LINE_START: 6,
2076
2295
  OT_EDIT_POSITION_END: 7,
2077
2296
  OT_EDIT_POSITION_PREV_CHAR: 8,
2297
+ OT_EDIT_BYTE_TO_CELL: 0,
2298
+ OT_EDIT_CELL_TO_BYTE: 1,
2299
+ OT_EDIT_UTF16_TO_CELL: 2,
2300
+ OT_EDIT_CELL_TO_UTF16: 3,
2078
2301
  OT_EDITOR_STYLE_FOREGROUND: 1,
2079
2302
  OT_EDITOR_STYLE_BACKGROUND: 2,
2080
2303
  OT_EDITOR_STYLE_ATTRIBUTES: 4,
2304
+ OT_EDITOR_STYLE_ATTRIBUTE_MASK: 8,
2081
2305
  OT_EDIT_HIGHLIGHT_ADD_LINE: 0,
2082
2306
  OT_EDIT_HIGHLIGHT_ADD_RANGE: 1,
2083
2307
  OT_EDIT_HIGHLIGHT_REMOVE_REF: 2,
2084
2308
  OT_EDIT_HIGHLIGHT_CLEAR_LINE: 3,
2085
2309
  OT_EDIT_HIGHLIGHT_CLEAR_ALL: 4,
2086
2310
  OT_STYLE_RUN_FLAG: 2147483648,
2311
+ OT_GROUP_SET_NAME_COUNT_MAX: 16,
2312
+ OT_GROUP_SET_NAME_BYTE_COUNT_MAX: 64,
2313
+ OT_EDIT_MARK_ADD: 0,
2314
+ OT_EDIT_MARK_REMOVE: 1,
2315
+ OT_EDIT_MARK_CLEAR: 2,
2316
+ OT_EDIT_MARK_ATOMIC: 1,
2317
+ OT_EDIT_MARK_STYLE_VALUE: 2,
2318
+ OT_EDIT_MARK_ANY_KIND: 4294967295,
2319
+ OT_MD_CONCEAL: 1,
2320
+ OT_MD_HYPERLINKS: 2,
2321
+ OT_MD_MATH: 4,
2322
+ OT_MD_HOOK: 8,
2323
+ OT_MD_HOOK_FILTER_BYTE_COUNT_MAX: 256,
2324
+ OT_MD_PARAGRAPH: 0,
2325
+ OT_MD_HEADING: 1,
2326
+ OT_MD_CODE: 2,
2327
+ OT_MD_HTML: 3,
2328
+ OT_MD_RULE: 4,
2329
+ OT_MD_TABLE: 5,
2330
+ OT_MD_TABLE_ROW: 6,
2331
+ OT_MD_TABLE_CELL: 7,
2332
+ OT_MD_QUOTE: 8,
2333
+ OT_MD_LIST: 9,
2334
+ OT_MD_ITEM: 10,
2335
+ OT_MD_BLOCK_CLOSED: 1,
2336
+ OT_MD_BLOCK_SETEXT: 2,
2337
+ OT_MD_BLOCK_ORDERED: 4,
2338
+ OT_MD_BLOCK_TIGHT: 8,
2339
+ OT_MD_BLOCK_TASK: 16,
2340
+ OT_MD_BLOCK_CHECKED: 32,
2341
+ OT_MD_BLOCK_BLANK_AFTER: 64,
2342
+ OT_MD_BLOCK_FENCED: 128,
2343
+ OT_MD_BLOCK_HOOKED: 256,
2344
+ OT_MD_BLOCK_MATH: 512,
2345
+ OT_MD_BLOCK_HEADER: 1024,
2346
+ OT_MD_BLOCK_OPEN: 2048,
2347
+ OT_MD_BLOCK_ALIGN_LEFT: 4096,
2348
+ OT_MD_BLOCK_ALIGN_RIGHT: 8192,
2349
+ OT_MD_SPAN_CODE: 1,
2350
+ OT_MD_SPAN_MATH: 2,
2087
2351
  OT_EDITOR_MOVE_UP: 0,
2088
2352
  OT_EDITOR_MOVE_DOWN: 1,
2089
2353
  OT_EDITOR_GOTO_LINE_END: 2,
@@ -2127,6 +2391,7 @@ var nativeConstants = {
2127
2391
  OT_IMAGE_PROTOCOL_BLOCKS: 3,
2128
2392
  OT_IMAGE_DRAW_SOURCE_WIDTH: 1,
2129
2393
  OT_IMAGE_DRAW_SOURCE_HEIGHT: 2,
2394
+ OT_IMAGE_ENCODED_BYTES_MAX: 67108864,
2130
2395
  OT_IMAGE_FORMAT_UNKNOWN: 0,
2131
2396
  OT_IMAGE_FORMAT_PNG: 1,
2132
2397
  OT_IMAGE_FORMAT_RGBA: 2,
@@ -2196,6 +2461,10 @@ var nativeConstants = {
2196
2461
  OT_BUFFER_STACK_CLEAR_OPACITY: 6,
2197
2462
  OT_BUFFER_GRID_INNER: 1,
2198
2463
  OT_BUFFER_GRID_OUTER: 2,
2464
+ OT_CELL_CHAR_KIND_MASK: 3221225472,
2465
+ OT_CELL_CHAR_IMAGE: 1073741824,
2466
+ OT_CELL_CHAR_GRAPHEME: 2147483648,
2467
+ OT_CELL_CHAR_CONTINUATION: 3221225472,
2199
2468
  OT_SESSION_CONTROL_PACKET_BYTES: 4096,
2200
2469
  OT_TERMINAL_ALTERNATE_SCREEN: 1,
2201
2470
  OT_TERMINAL_MOUSE: 2,
@@ -2205,6 +2474,12 @@ var nativeConstants = {
2205
2474
  OT_TERMINAL_SYNC_ALWAYS: 32,
2206
2475
  OT_TERMINAL_SYNC_NEVER: 64,
2207
2476
  OT_TERMINAL_HOST_MULTIPLEXER: 128,
2477
+ OT_KITTY_KEYBOARD_DISAMBIGUATE: 1,
2478
+ OT_KITTY_KEYBOARD_EVENT_TYPES: 2,
2479
+ OT_KITTY_KEYBOARD_ALTERNATE_KEYS: 4,
2480
+ OT_KITTY_KEYBOARD_ALL_KEYS_AS_ESCAPES: 8,
2481
+ OT_KITTY_KEYBOARD_REPORT_TEXT: 16,
2482
+ OT_KITTY_KEYBOARD_ALL: 31,
2208
2483
  OT_CONTROL_CAPABILITY_RESPONSE: 1,
2209
2484
  OT_CONTROL_TITLE: 2,
2210
2485
  OT_CONTROL_MOUSE: 3,
@@ -2216,6 +2491,7 @@ var nativeConstants = {
2216
2491
  OT_CONTROL_RESET_BACKGROUND: 9,
2217
2492
  OT_CONTROL_PALETTE_QUERY: 10,
2218
2493
  OT_CONTROL_PROGRAM_STATUS: 11,
2494
+ OT_CONTROL_END_REPLY_SENTINEL: 12,
2219
2495
  OT_CURSOR_POSITION: 1,
2220
2496
  OT_CURSOR_STYLE: 2,
2221
2497
  OT_CURSOR_BLINKING: 4,
@@ -2376,11 +2652,13 @@ var nativeConstants = {
2376
2652
  OT_INPUT_EXPECT_KITTY_KEYBOARD: 2,
2377
2653
  OT_INPUT_EXPECT_CURSOR_POSITION: 4,
2378
2654
  OT_INPUT_EXPECT_SENTINEL: 8,
2655
+ OT_INPUT_EXPECT_ESCAPE_PREFIX: 16,
2379
2656
  OT_INPUT_EVENTS_MIN: 4,
2380
2657
  OT_INPUT_PAYLOAD_BYTES_MIN: 4384,
2381
2658
  OT_INPUT_TIMEOUT_NS: 20000000,
2382
2659
  OT_DIAGNOSTIC_MESSAGE_BYTES: 4096,
2383
2660
  OT_DIAGNOSTIC_TRUNCATED: 1,
2661
+ OT_DIAGNOSTIC_QUEUE_MAX: 64,
2384
2662
  OT_SCENE_RECORD_BYTES_MAX: 67108864,
2385
2663
  OT_SCENE_RECORD_PHASE_BEFORE: 0,
2386
2664
  OT_SCENE_RECORD_PHASE_SELF: 1,
@@ -2398,6 +2676,7 @@ var nativeConstants = {
2398
2676
  OT_SCENE_RECORD_SCENE_BODY: 10,
2399
2677
  OT_SCENE_RECORD_IMAGE: 11,
2400
2678
  OT_SCENE_RECORD_UNICODE: 12,
2679
+ OT_SCENE_RECORD_CELLS: 13,
2401
2680
  OT_SCENE_RECORD_GRAYSCALE_FOREGROUND: 1,
2402
2681
  OT_SCENE_RECORD_GRAYSCALE_BACKGROUND: 2,
2403
2682
  OT_SCENE_RECORD_GRAYSCALE_SUPERSAMPLED: 4,
@@ -3587,19 +3866,20 @@ function setGlobalWorkerMessageHandler(handler) {
3587
3866
  import { existsSync as existsSync2, writeFileSync } from "fs";
3588
3867
 
3589
3868
  // src/types.ts
3869
+ var attributeBits = nativeConstants;
3590
3870
  var TextAttributes2 = {
3591
3871
  NONE: 0,
3592
- BOLD: 1 << 0,
3593
- DIM: 1 << 1,
3594
- ITALIC: 1 << 2,
3595
- UNDERLINE: 1 << 3,
3596
- BLINK: 1 << 4,
3597
- INVERSE: 1 << 5,
3598
- HIDDEN: 1 << 6,
3599
- STRIKETHROUGH: 1 << 7
3872
+ BOLD: attributeBits.OT_ATTR_BOLD,
3873
+ DIM: attributeBits.OT_ATTR_DIM,
3874
+ ITALIC: attributeBits.OT_ATTR_ITALIC,
3875
+ UNDERLINE: attributeBits.OT_ATTR_UNDERLINE,
3876
+ BLINK: attributeBits.OT_ATTR_BLINK,
3877
+ INVERSE: attributeBits.OT_ATTR_INVERSE,
3878
+ HIDDEN: attributeBits.OT_ATTR_HIDDEN,
3879
+ STRIKETHROUGH: attributeBits.OT_ATTR_STRIKETHROUGH
3600
3880
  };
3601
- var ATTRIBUTE_BASE_BITS2 = 8;
3602
- var ATTRIBUTE_BASE_MASK2 = 255;
3881
+ var ATTRIBUTE_BASE_BITS2 = nativeConstants.OT_ATTR_LINK_SHIFT;
3882
+ var ATTRIBUTE_BASE_MASK2 = nativeConstants.OT_ATTR_BASE_MASK;
3603
3883
  function getBaseAttributes2(attr) {
3604
3884
  return attr & ATTRIBUTE_BASE_MASK2;
3605
3885
  }
@@ -3620,29 +3900,15 @@ var TargetChannel2;
3620
3900
  // src/lib/RGBA.ts
3621
3901
  var DEFAULT_FOREGROUND_RGB2 = [255, 255, 255];
3622
3902
  var DEFAULT_BACKGROUND_RGB2 = [0, 0, 0];
3623
- var INTENT_RGB = 0;
3624
- var INTENT_INDEXED = 1;
3625
- var INTENT_DEFAULT = 2;
3903
+ var INTENT_RGB = nativeConstants.OT_COLOR_RGB;
3904
+ var INTENT_INDEXED = nativeConstants.OT_COLOR_INDEXED;
3905
+ var INTENT_DEFAULT = nativeConstants.OT_COLOR_DEFAULT;
3626
3906
  var ZERO_RGBA_BUFFER = new Uint16Array(4);
3627
- var ANSI16_RGB = [
3628
- [0, 0, 0],
3629
- [128, 0, 0],
3630
- [0, 128, 0],
3631
- [128, 128, 0],
3632
- [0, 0, 128],
3633
- [128, 0, 128],
3634
- [0, 128, 128],
3635
- [192, 192, 192],
3636
- [128, 128, 128],
3637
- [255, 0, 0],
3638
- [0, 255, 0],
3639
- [255, 255, 0],
3640
- [0, 0, 255],
3641
- [255, 0, 255],
3642
- [0, 255, 255],
3643
- [255, 255, 255]
3644
- ];
3645
- var ANSI_256_CUBE_LEVELS = [0, 95, 135, 175, 215, 255];
3907
+ var ANSI16_RGB = Array.from({ length: 16 }, (_, slot) => {
3908
+ const rgb = nativeConstants[`OT_COLOR_ANSI_${slot}`];
3909
+ return [rgb >>> 16, rgb >>> 8 & 255, rgb & 255];
3910
+ });
3911
+ var ANSI_256_CUBE_LEVELS = [0, 1, 2, 3, 4, 5].map((level) => level === 0 ? 0 : nativeConstants.OT_COLOR_CUBE_BASE + nativeConstants.OT_COLOR_CUBE_STEP * level);
3646
3912
  function packMeta(intent, slot = 0) {
3647
3913
  return (slot & 255 | (intent & 255) << 8) >>> 0;
3648
3914
  }
@@ -3682,7 +3948,7 @@ function ansi256IndexToRgb2(index) {
3682
3948
  const b = cubeIndex % 6;
3683
3949
  return [ANSI_256_CUBE_LEVELS[r], ANSI_256_CUBE_LEVELS[g], ANSI_256_CUBE_LEVELS[b]];
3684
3950
  }
3685
- const value = 8 + (normalizedIndex - 232) * 10;
3951
+ const value = nativeConstants.OT_COLOR_GRAY_BASE + (normalizedIndex - 232) * nativeConstants.OT_COLOR_GRAY_STEP;
3686
3952
  return [value, value, value];
3687
3953
  }
3688
3954
 
@@ -3929,9 +4195,9 @@ function createTextAttributes2({
3929
4195
  attributes |= TextAttributes2.STRIKETHROUGH;
3930
4196
  return attributes;
3931
4197
  }
3932
- var ATTRIBUTE_BASE_MASK = 255;
3933
- var LINK_ID_SHIFT = 8;
3934
- var LINK_ID_PAYLOAD_MASK = 16777215;
4198
+ var ATTRIBUTE_BASE_MASK = nativeConstants.OT_ATTR_BASE_MASK;
4199
+ var LINK_ID_SHIFT = nativeConstants.OT_ATTR_LINK_SHIFT;
4200
+ var LINK_ID_PAYLOAD_MASK = nativeConstants.OT_ATTR_LINK_MASK;
3935
4201
  function attributesWithLink2(baseAttributes, linkId) {
3936
4202
  const base = baseAttributes & ATTRIBUTE_BASE_MASK;
3937
4203
  const linkBits = (linkId & LINK_ID_PAYLOAD_MASK) << LINK_ID_SHIFT;
@@ -4096,7 +4362,8 @@ var YogaEnumKind = {
4096
4362
  FlexWrap: nativeConstants.OT_STYLE_ENUM_FLEX_WRAP,
4097
4363
  Overflow: nativeConstants.OT_STYLE_ENUM_OVERFLOW,
4098
4364
  Display: nativeConstants.OT_STYLE_ENUM_DISPLAY,
4099
- BoxSizing: nativeConstants.OT_STYLE_ENUM_BOX_SIZING
4365
+ BoxSizing: nativeConstants.OT_STYLE_ENUM_BOX_SIZING,
4366
+ LayoutMode: nativeConstants.OT_STYLE_ENUM_LAYOUT_MODE
4100
4367
  };
4101
4368
  var YogaFloatKind = {
4102
4369
  Flex: nativeConstants.OT_STYLE_FLOAT_FLEX,
@@ -5808,6 +6075,14 @@ function allocFFIStruct(structDefinition) {
5808
6075
  const storage = allocStruct(structDefinition);
5809
6076
  return { ...storage, ffiView: new Uint8Array(storage.buffer) };
5810
6077
  }
6078
+ function editBufferOptions(options, kind) {
6079
+ const layout = nativeLayouts.ot_edit_buffer_options;
6080
+ const record = createContextRecord(layout);
6081
+ record[layout.fields.width_method.offset / 4] = widthMethodId(options.widthMethod ?? "unicode", kind);
6082
+ if (options.followSessionWidth)
6083
+ record[layout.fields.flags.offset / 4] = nativeConstants.OT_EDIT_BUFFER_FOLLOW_SESSION_WIDTH;
6084
+ return record;
6085
+ }
5811
6086
  var NativeTextViewCommand2;
5812
6087
  ((NativeTextViewCommand) => {
5813
6088
  NativeTextViewCommand[NativeTextViewCommand["WrapWidth"] = 0] = "WrapWidth";
@@ -5832,7 +6107,10 @@ var NativeEditCommand2;
5832
6107
  NativeEditCommand[NativeEditCommand["Clear"] = 10] = "Clear";
5833
6108
  NativeEditCommand[NativeEditCommand["ClearHistory"] = 11] = "ClearHistory";
5834
6109
  NativeEditCommand[NativeEditCommand["DebugRope"] = 12] = "DebugRope";
6110
+ NativeEditCommand[NativeEditCommand["CursorOffsetAtomic"] = 13] = "CursorOffsetAtomic";
6111
+ NativeEditCommand[NativeEditCommand["KeepOutside"] = 14] = "KeepOutside";
5835
6112
  })(NativeEditCommand2 ||= {});
6113
+ var NativeEditAtomic = 1;
5836
6114
  var NativeEditPositionQuery2;
5837
6115
  ((NativeEditPositionQuery) => {
5838
6116
  NativeEditPositionQuery[NativeEditPositionQuery["Cursor"] = 0] = "Cursor";
@@ -6194,8 +6472,15 @@ registerEnvVar2({
6194
6472
  type: "string",
6195
6473
  required: false
6196
6474
  });
6197
- var CURSOR_STYLE_TO_ID = { block: 0, line: 1, underline: 2, default: 3 };
6198
- var CURSOR_ID_TO_STYLE = ["block", "line", "underline", "default"];
6475
+ var CURSOR_STYLE_TO_ID = {
6476
+ block: nativeConstants.OT_CURSOR_STYLE_BLOCK,
6477
+ line: nativeConstants.OT_CURSOR_STYLE_LINE,
6478
+ underline: nativeConstants.OT_CURSOR_STYLE_UNDERLINE,
6479
+ default: nativeConstants.OT_CURSOR_STYLE_DEFAULT
6480
+ };
6481
+ var CURSOR_ID_TO_STYLE = [];
6482
+ for (const [style, id] of Object.entries(CURSOR_STYLE_TO_ID))
6483
+ CURSOR_ID_TO_STYLE[id] = style;
6199
6484
  var PROGRAM_STATE_TO_ID = {
6200
6485
  idle: nativeConstants.OT_PROGRAM_STATE_IDLE,
6201
6486
  working: nativeConstants.OT_PROGRAM_STATE_WORKING,
@@ -6536,7 +6821,7 @@ function encodeDrawColors(colors, fields, options, base = 0) {
6536
6821
  contextBufferColor(background, colors, (base + fields.background.offset) / 2);
6537
6822
  return background !== undefined;
6538
6823
  }
6539
- var DIAGNOSTIC_QUEUE_MAX = 64;
6824
+ var DIAGNOSTIC_QUEUE_MAX = nativeConstants.OT_DIAGNOSTIC_QUEUE_MAX;
6540
6825
  var DIAGNOSTIC_BATCH = 8;
6541
6826
  function createDiagnosticDrainRecord() {
6542
6827
  const layout = nativeLayouts.ot_diagnostic_drain;
@@ -6717,7 +7002,28 @@ function encodeImageDrawOptions(options, words, signed, base) {
6717
7002
  function viewOrNull(value) {
6718
7003
  return value.byteLength === 0 ? null : value;
6719
7004
  }
6720
- var EMBEDDED_TERMINAL_IO_BYTES_MAX = 1024 * 1024;
7005
+ var EMBEDDED_TERMINAL_IO_BYTES_MAX = nativeConstants.OT_EMBEDDED_TERMINAL_INPUT_BYTES_MAX;
7006
+ var EMBEDDED_TERMINAL_KEY_ACTIONS = new Map([
7007
+ ["release", nativeConstants.OT_EMBEDDED_TERMINAL_KEY_RELEASE],
7008
+ ["press", nativeConstants.OT_EMBEDDED_TERMINAL_KEY_PRESS],
7009
+ ["repeat", nativeConstants.OT_EMBEDDED_TERMINAL_KEY_REPEAT]
7010
+ ]);
7011
+ var EMBEDDED_TERMINAL_MOUSE_ACTIONS = new Map([
7012
+ ["press", nativeConstants.OT_EMBEDDED_TERMINAL_MOUSE_PRESS],
7013
+ ["release", nativeConstants.OT_EMBEDDED_TERMINAL_MOUSE_RELEASE],
7014
+ ["motion", nativeConstants.OT_EMBEDDED_TERMINAL_MOUSE_MOTION]
7015
+ ]);
7016
+ var EMBEDDED_TERMINAL_BUTTONS = new Map([
7017
+ [undefined, nativeConstants.OT_EMBEDDED_TERMINAL_BUTTON_NONE],
7018
+ ["unknown", nativeConstants.OT_EMBEDDED_TERMINAL_BUTTON_UNKNOWN],
7019
+ ["left", nativeConstants.OT_EMBEDDED_TERMINAL_BUTTON_LEFT],
7020
+ ["right", nativeConstants.OT_EMBEDDED_TERMINAL_BUTTON_RIGHT],
7021
+ ["middle", nativeConstants.OT_EMBEDDED_TERMINAL_BUTTON_MIDDLE],
7022
+ ["four", nativeConstants.OT_EMBEDDED_TERMINAL_BUTTON_FOUR],
7023
+ ["five", nativeConstants.OT_EMBEDDED_TERMINAL_BUTTON_FIVE],
7024
+ ["six", nativeConstants.OT_EMBEDDED_TERMINAL_BUTTON_SIX],
7025
+ ["seven", nativeConstants.OT_EMBEDDED_TERMINAL_BUTTON_SEVEN]
7026
+ ]);
6721
7027
  function embeddedTerminalDimension(value, name) {
6722
7028
  if (!Number.isInteger(value) || value < 1 || value > 65535) {
6723
7029
  throw new RangeError(`Embedded terminal ${name} must be an integer between 1 and 65535`);
@@ -6737,7 +7043,9 @@ function contextBufferColor(value, color = new Uint16Array(4), offset = 0) {
6737
7043
  color[offset + index] = channel;
6738
7044
  }
6739
7045
  const intent = color[offset + 1] >>> 8;
6740
- if (color[offset + 2] > 255 || color[offset + 3] > 255 || intent > 2 || intent !== 1 && color[offset] > 255) {
7046
+ const indexed = intent === nativeConstants.OT_COLOR_INDEXED;
7047
+ const known = indexed || intent === nativeConstants.OT_COLOR_RGB || intent === nativeConstants.OT_COLOR_DEFAULT;
7048
+ if (color[offset + 2] > 255 || color[offset + 3] > 255 || !known || !indexed && color[offset] > 255) {
6741
7049
  throw new RangeError("Invalid terminal color intent");
6742
7050
  }
6743
7051
  return color;
@@ -7578,11 +7886,14 @@ function recordedPixels(data, length) {
7578
7886
  throw new RangeError("Pixel byte count exceeds the supplied view");
7579
7887
  return input.subarray(0, count);
7580
7888
  }
7889
+ function isAttributeByte(value) {
7890
+ return Number.isInteger(value) && value >= 0 && value <= 255;
7891
+ }
7581
7892
  function encodeEditorStyle(style) {
7582
7893
  const layout = nativeLayouts.ot_editor_style;
7583
7894
  const record = new Uint32Array(layout.size / 4);
7584
7895
  const colors = new Uint16Array(record.buffer);
7585
- const { fg, bg, attributes } = style;
7896
+ const { fg, bg, attributes, suppliedAttributes } = style;
7586
7897
  record[layout.fields.struct_size.offset / 4] = layout.size;
7587
7898
  record[layout.fields.abi_version.offset / 4] = nativeConstants.OT_CONTEXT_ABI_VERSION;
7588
7899
  if (fg != null) {
@@ -7597,6 +7908,13 @@ function encodeEditorStyle(style) {
7597
7908
  record[layout.fields.flags.offset / 4] |= 4 /* Attributes */;
7598
7909
  record[layout.fields.attributes.offset / 4] = toSafeFFIU32Length(attributes, "Editor style attributes");
7599
7910
  }
7911
+ if (suppliedAttributes != null) {
7912
+ if (!isAttributeByte(attributes) || !isAttributeByte(suppliedAttributes)) {
7913
+ throw new RangeError("Masked editor style attributes must be integers from 0 to 255");
7914
+ }
7915
+ record[layout.fields.flags.offset / 4] |= nativeConstants.OT_EDITOR_STYLE_ATTRIBUTE_MASK;
7916
+ record[layout.fields.attributes.offset / 4] |= suppliedAttributes << 16;
7917
+ }
7600
7918
  return record;
7601
7919
  }
7602
7920
  function drawTextString(text) {
@@ -7611,6 +7929,7 @@ function drawRecordBottomTitle(options) {
7611
7929
  return options.operation === "box" && options.bottomTitle ? drawTextString(options.bottomTitle) : "";
7612
7930
  }
7613
7931
  var drawTextEncoder = new TextEncoder;
7932
+ var markdownDecoder = new TextDecoder("utf-8", { ignoreBOM: true });
7614
7933
  function encodeDrawText(text, output) {
7615
7934
  if (text === "")
7616
7935
  return 0;
@@ -7709,9 +8028,9 @@ function widthMethodId(widthMethod, label) {
7709
8028
  return id;
7710
8029
  }
7711
8030
  function widthMethodFromCode(code) {
7712
- if (code === 0)
8031
+ if (code === nativeConstants.OT_WIDTH_METHOD_WCWIDTH)
7713
8032
  return "wcwidth";
7714
- return code === 3 ? "unicode-wide" : "unicode";
8033
+ return code === nativeConstants.OT_WIDTH_METHOD_UNICODE_WIDE ? "unicode-wide" : "unicode";
7715
8034
  }
7716
8035
  var yogaSymbols = {
7717
8036
  yogaConfigCreateChecked: { args: ["buffer"], returns: "u32" },
@@ -8181,6 +8500,7 @@ class FFIRenderLib2 {
8181
8500
  sceneFlushApplied = new Uint32Array(1);
8182
8501
  editorSelectionRecord = createEditorSelectionRecord();
8183
8502
  editorViewInfoRecord = createContextRecord(nativeLayouts.ot_editor_view_info);
8503
+ markRecords = new Uint32Array(16 * nativeLayouts.ot_edit_mark.size / 4);
8184
8504
  videoStateRecord = new Uint8Array(nativeLayouts.ot_video_state.size);
8185
8505
  videoStateView = new DataView(this.videoStateRecord.buffer);
8186
8506
  selectionResetRecord = encodeEditorSelection({ operation: 2 /* Reset */ });
@@ -8230,6 +8550,7 @@ class FFIRenderLib2 {
8230
8550
  encoder = new TextEncoder;
8231
8551
  emptyBytes = new Uint8Array(0);
8232
8552
  decoder = new TextDecoder;
8553
+ textDecoder = new TextDecoder("utf-8", { ignoreBOM: true });
8233
8554
  logCallbackWrapper = null;
8234
8555
  diagnosticDrain;
8235
8556
  nativeSpanFeedCallbackWrapper = null;
@@ -8289,11 +8610,8 @@ class FFIRenderLib2 {
8289
8610
  return count[0] === 0 ? "" : this.decoder.decode(bytes.subarray(0, count[0]));
8290
8611
  }
8291
8612
  createContextTextBuffer(context, options = {}) {
8292
- const layout = nativeLayouts.ot_edit_buffer_options;
8293
8613
  this.getYogaHost().assertMutable();
8294
- const widthMethod = widthMethodId(options.widthMethod ?? "unicode", "text");
8295
- const record = createContextRecord(layout);
8296
- record[layout.fields.width_method.offset / 4] = widthMethod;
8614
+ const record = editBufferOptions(options, "text");
8297
8615
  const output = new Uint32Array(handleWords);
8298
8616
  const pointer = this.nativeContextPointer(context, "ot_text_buffer_create");
8299
8617
  nativeResult("ot_text_buffer_create", this.opentui.symbols.ot_text_buffer_create(pointer, record, output));
@@ -8344,8 +8662,9 @@ class FFIRenderLib2 {
8344
8662
  const handle = encodeContextHandle(context, session);
8345
8663
  const ticket = frame ? encodeSceneFrameRequest(context, frame) : null;
8346
8664
  const count = toSafeFFIU32Length(snapshots.length, "Split snapshot count");
8347
- if (count > 64)
8348
- throw new RangeError("At most 64 split snapshots can be submitted together");
8665
+ const max = nativeConstants.OT_SPLIT_SNAPSHOTS_MAX;
8666
+ if (count > max)
8667
+ throw new RangeError(`At most ${max} split snapshots can be submitted together`);
8349
8668
  const records = new BigUint64Array(count * (layout.size / 8));
8350
8669
  const fields = new Uint32Array(records.buffer);
8351
8670
  for (let index = 0;index < count; index++) {
@@ -8582,9 +8901,8 @@ class FFIRenderLib2 {
8582
8901
  const layout = nativeLayouts.ot_embedded_terminal_key;
8583
8902
  this.getYogaHost().assertMutable();
8584
8903
  const handle = encodeContextHandle(context, terminal);
8585
- const action = key.action ?? "press";
8586
- const actionCode = ["release", "press", "repeat"].indexOf(action);
8587
- if (actionCode < 0)
8904
+ const actionCode = EMBEDDED_TERMINAL_KEY_ACTIONS.get(key.action ?? "press");
8905
+ if (actionCode === undefined)
8588
8906
  throw new TypeError("Unknown embedded terminal key action");
8589
8907
  const record = createContextRecord(layout);
8590
8908
  record[layout.fields.action.offset / 4] = actionCode;
@@ -8603,10 +8921,9 @@ class FFIRenderLib2 {
8603
8921
  const layout = nativeLayouts.ot_embedded_terminal_mouse;
8604
8922
  this.getYogaHost().assertMutable();
8605
8923
  const handle = encodeContextHandle(context, terminal);
8606
- const action = ["press", "release", "motion"].indexOf(mouse.action);
8607
- const buttonName = mouse.button;
8608
- const button = buttonName === undefined ? -1 : ["unknown", "left", "right", "middle", "four", "five", "six", "seven"].indexOf(buttonName);
8609
- if (action < 0 || buttonName !== undefined && button < 0)
8924
+ const action = EMBEDDED_TERMINAL_MOUSE_ACTIONS.get(mouse.action);
8925
+ const button = EMBEDDED_TERMINAL_BUTTONS.get(mouse.button);
8926
+ if (action === undefined || button === undefined)
8610
8927
  throw new TypeError("Unknown embedded terminal mouse action or button");
8611
8928
  const record = createContextRecord(layout);
8612
8929
  record[layout.fields.action.offset / 4] = action;
@@ -8640,7 +8957,7 @@ class FFIRenderLib2 {
8640
8957
  contextEmbeddedTerminalDrainResponses(context, terminal) {
8641
8958
  this.getYogaHost().assertMutable();
8642
8959
  const handle = encodeContextHandle(context, terminal);
8643
- const output = this.embeddedTerminalResponses ??= new Uint8Array(EMBEDDED_TERMINAL_IO_BYTES_MAX);
8960
+ const output = this.embeddedTerminalResponses ??= new Uint8Array(nativeConstants.OT_EMBEDDED_TERMINAL_RESPONSE_BYTES_MAX);
8644
8961
  const count = new Uint32Array(1);
8645
8962
  const pointer = this.nativeContextPointer(context, "ot_embedded_terminal_drain_responses");
8646
8963
  let status = this.opentui.symbols.ot_embedded_terminal_drain_responses(pointer, handle, output, output.length, count);
@@ -8800,7 +9117,7 @@ class FFIRenderLib2 {
8800
9117
  if (count[0] !== bytes.length) {
8801
9118
  throw new NativeError2(operation, -5 /* InternalError */);
8802
9119
  }
8803
- return this.decoder.decode(bytes);
9120
+ return this.textDecoder.decode(bytes);
8804
9121
  }
8805
9122
  contextTextBufferGetText(context, text) {
8806
9123
  const handle = encodeContextHandle(context, text);
@@ -8831,6 +9148,14 @@ class FFIRenderLib2 {
8831
9148
  nativeResult("ot_text_buffer_set_tab_width", this.opentui.symbols.ot_text_buffer_set_tab_width(pointer, handle, value));
8832
9149
  });
8833
9150
  }
9151
+ contextTextBufferSetWidthMethod(context, text, widthMethod) {
9152
+ const handle = encodeContextHandle(context, text);
9153
+ const method = widthMethodId(widthMethod, "text");
9154
+ this.getYogaHost().runMutation(() => {
9155
+ const pointer = this.nativeContextPointer(context, "ot_text_buffer_set_width_method");
9156
+ nativeResult("ot_text_buffer_set_width_method", this.opentui.symbols.ot_text_buffer_set_width_method(pointer, handle, method));
9157
+ });
9158
+ }
8834
9159
  contextTextBufferHighlight(context, text, operation, argument = 0, highlight) {
8835
9160
  const handle = encodeContextHandle(context, text);
8836
9161
  const selector = toSafeFFIU32Length(operation, "Text highlight operation");
@@ -8841,6 +9166,23 @@ class FFIRenderLib2 {
8841
9166
  nativeResult("ot_text_buffer_highlight", this.opentui.symbols.ot_text_buffer_highlight(pointer, handle, selector, value, record));
8842
9167
  });
8843
9168
  }
9169
+ contextGroupSet(context, names) {
9170
+ const encoded = names.map((name) => this.encoder.encode(name));
9171
+ const ends = new Uint32Array(encoded.length);
9172
+ const bytes = new Uint8Array(encoded.reduce((end, name, index) => ends[index] = end + name.length, 0));
9173
+ encoded.forEach((name, index) => bytes.set(name, ends[index] - name.length));
9174
+ const output = new Uint32Array(1);
9175
+ const pointer = this.nativeContextPointer(context, "ot_context_group_set");
9176
+ nativeResult("ot_context_group_set", this.opentui.symbols.ot_context_group_set(pointer, viewOrNull(bytes), bytes.length, viewOrNull(ends), ends.length, output));
9177
+ return output[0];
9178
+ }
9179
+ contextTextBufferSetLayer(context, text, layerId, start, end, runs) {
9180
+ const handle = encodeContextHandle(context, text);
9181
+ this.getYogaHost().runMutation(() => {
9182
+ const pointer = this.nativeContextPointer(context, "ot_text_buffer_set_layer");
9183
+ nativeResult("ot_text_buffer_set_layer", this.opentui.symbols.ot_text_buffer_set_layer(pointer, handle, layerId, start, end, viewOrNull(runs), runs.length / 3));
9184
+ });
9185
+ }
8844
9186
  contextTextBufferGetHighlights(context, text, line) {
8845
9187
  const handle = encodeContextHandle(context, text);
8846
9188
  const row = toSafeFFIU32Length(line, "Highlight line");
@@ -9016,11 +9358,8 @@ class FFIRenderLib2 {
9016
9358
  nativeResult("ot_buffer_draw_scene_body", this.opentui.symbols.ot_buffer_draw_scene_body(pointer, destination, request, source, column, row));
9017
9359
  }
9018
9360
  createContextEditBuffer(context, options = {}) {
9019
- const layout = nativeLayouts.ot_edit_buffer_options;
9020
9361
  this.getYogaHost().assertMutable();
9021
- const widthMethod = widthMethodId(options.widthMethod ?? "unicode", "editor");
9022
- const record = createContextRecord(layout);
9023
- record[layout.fields.width_method.offset / 4] = widthMethod;
9362
+ const record = editBufferOptions(options, "editor");
9024
9363
  const output = new Uint32Array(handleWords);
9025
9364
  const pointer = this.nativeContextPointer(context, "ot_edit_buffer_create");
9026
9365
  nativeResult("ot_edit_buffer_create", this.opentui.symbols.ot_edit_buffer_create(pointer, record, output));
@@ -9187,6 +9526,16 @@ class FFIRenderLib2 {
9187
9526
  const pointer = this.nativeContextPointer(context, "ot_edit_buffer_get_range");
9188
9527
  return this.readText("ot_edit_buffer_get_range", (bytes, capacity, count) => this.opentui.symbols.ot_edit_buffer_get_range(pointer, handle, coords, rowStart, colStart, rowEnd, colEnd, bytes, capacity, count));
9189
9528
  }
9529
+ contextEditBufferConvertOffset(context, editBuffer, value, toCell) {
9530
+ const operation = "ot_edit_buffer_convert_offset";
9531
+ const handle = encodeContextHandle(context, editBuffer);
9532
+ const input = toSafeFFIU32Length(value, "Edit buffer index or offset");
9533
+ const conversion = toCell ? nativeConstants.OT_EDIT_UTF16_TO_CELL : nativeConstants.OT_EDIT_CELL_TO_UTF16;
9534
+ const output = new Uint32Array(1);
9535
+ const pointer = this.nativeContextPointer(context, operation);
9536
+ nativeResult(operation, this.opentui.symbols.ot_edit_buffer_convert_offset(pointer, handle, conversion, input, output));
9537
+ return output[0];
9538
+ }
9190
9539
  contextEditBufferMeasureText(context, editBuffer, bytes) {
9191
9540
  const handle = encodeContextHandle(context, editBuffer);
9192
9541
  const input = sessionBytes(bytes, "Edit buffer measure length");
@@ -9270,6 +9619,62 @@ class FFIRenderLib2 {
9270
9619
  throw new NativeError2("ot_edit_buffer_get_highlights", -5 /* InternalError */);
9271
9620
  return decodeContextHighlights(records);
9272
9621
  }
9622
+ contextEditBufferMark(context, editBuffer, operation, mark) {
9623
+ const layout = nativeLayouts.ot_edit_mark;
9624
+ const handle = encodeContextHandle(context, editBuffer);
9625
+ const fields = layout.fields;
9626
+ let record = null;
9627
+ if (mark) {
9628
+ record = createContextRecord(layout);
9629
+ record[fields.id.offset / 4] = toSafeFFIU32Length(mark.id ?? 0, "Mark id");
9630
+ record[fields.kind.offset / 4] = toSafeFFIU32Length(mark.kind ?? 0, "Mark type id");
9631
+ record[fields.flags.offset / 4] = mark.atomic ? nativeConstants.OT_EDIT_MARK_ATOMIC : 0;
9632
+ record[fields.style.offset / 4] = toSafeFFIU32Length(mark.style ?? 0, "Mark style ID");
9633
+ record[fields.priority.offset / 4] = toSafeFFIU32Length(mark.priority ?? 0, "Mark priority");
9634
+ record[fields.start.offset / 4] = toSafeFFIU32Length(mark.start ?? 0, "Mark start");
9635
+ record[fields.end.offset / 4] = toSafeFFIU32Length(mark.end ?? 0, "Mark end");
9636
+ }
9637
+ const output = record && new Uint32Array(1);
9638
+ this.getYogaHost().runMutation(() => {
9639
+ const pointer = this.nativeContextPointer(context, "ot_edit_buffer_mark");
9640
+ nativeResult("ot_edit_buffer_mark", this.opentui.symbols.ot_edit_buffer_mark(pointer, handle, operation, record, output));
9641
+ });
9642
+ return output?.[0] ?? 0;
9643
+ }
9644
+ contextEditBufferGetMarks(context, editBuffer, id = 0, kind = nativeConstants.OT_EDIT_MARK_ANY_KIND) {
9645
+ const layout = nativeLayouts.ot_edit_mark;
9646
+ const handle = encodeContextHandle(context, editBuffer);
9647
+ const markId = toSafeFFIU32Length(id, "Mark id");
9648
+ const markKind = toSafeFFIU32Length(kind, "Mark type id");
9649
+ const count = new Uint32Array(1);
9650
+ const pointer = this.nativeContextPointer(context, "ot_edit_buffer_get_marks");
9651
+ const words = layout.size / 4;
9652
+ const copy = () => this.opentui.symbols.ot_edit_buffer_get_marks(pointer, handle, markId, markKind, this.markRecords, this.markRecords.length / words, count);
9653
+ let status = copy();
9654
+ if (status !== 0 /* Ok */) {
9655
+ nativeResult("ot_edit_buffer_get_marks", this.opentui.symbols.ot_edit_buffer_get_marks(pointer, handle, markId, markKind, null, 0, count));
9656
+ if (count[0] * words <= this.markRecords.length)
9657
+ nativeResult("ot_edit_buffer_get_marks", status);
9658
+ this.markRecords = new Uint32Array(count[0] * 2 * words);
9659
+ status = copy();
9660
+ nativeResult("ot_edit_buffer_get_marks", status);
9661
+ }
9662
+ const records = this.markRecords;
9663
+ const marks = [];
9664
+ for (let offset = 0;offset < count[0] * words; offset += words) {
9665
+ const field = (name) => records[offset + layout.fields[name].offset / 4];
9666
+ marks.push({
9667
+ id: field("id"),
9668
+ kind: field("kind"),
9669
+ atomic: (field("flags") & nativeConstants.OT_EDIT_MARK_ATOMIC) !== 0,
9670
+ style: field("style"),
9671
+ priority: field("priority"),
9672
+ start: field("start"),
9673
+ end: field("end")
9674
+ });
9675
+ }
9676
+ return marks;
9677
+ }
9273
9678
  contextEditorViewSetViewport(context, view, viewport, sizeOnly = false, moveCursor = false) {
9274
9679
  const layout = nativeLayouts.ot_editor_viewport;
9275
9680
  const handle = encodeContextHandle(context, view);
@@ -10103,7 +10508,7 @@ class FFIRenderLib2 {
10103
10508
  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);
10104
10509
  const record = createContextRecord(layout);
10105
10510
  record[layout.fields.flags.offset / 4] = flags;
10106
- record[layout.fields.kitty_keyboard_flags.offset / 4] = toSafeFFIU32Length(options.kittyKeyboardFlags ?? 5, "Session kittyKeyboardFlags");
10511
+ record[layout.fields.kitty_keyboard_flags.offset / 4] = toSafeFFIU32Length(options.kittyKeyboardFlags ?? nativeConstants.OT_KITTY_KEYBOARD_DISAMBIGUATE | nativeConstants.OT_KITTY_KEYBOARD_ALTERNATE_KEYS, "Session kittyKeyboardFlags");
10107
10512
  const pointer = this.nativeContextPointer(context, "ot_session_setup_terminal");
10108
10513
  nativeResult("ot_session_setup_terminal", this.opentui.symbols.ot_session_setup_terminal(pointer, handle, record));
10109
10514
  }
@@ -10199,6 +10604,7 @@ class FFIRenderLib2 {
10199
10604
  break;
10200
10605
  case "palette-query":
10201
10606
  record[kind] = nativeConstants.OT_CONTROL_PALETTE_QUERY;
10607
+ record[layout.fields.argument.offset / 4] = command.sentinel ? 1 : 0;
10202
10608
  bytes = sessionBytes(command.bytes, "Session palette query length");
10203
10609
  break;
10204
10610
  case "title": {
@@ -10238,10 +10644,14 @@ class FFIRenderLib2 {
10238
10644
  break;
10239
10645
  case "query-theme-colors":
10240
10646
  record[kind] = nativeConstants.OT_CONTROL_QUERY_THEME_COLORS;
10647
+ record[layout.fields.argument.offset / 4] = command.sentinel ? 1 : 0;
10241
10648
  break;
10242
10649
  case "reset-background":
10243
10650
  record[kind] = nativeConstants.OT_CONTROL_RESET_BACKGROUND;
10244
10651
  break;
10652
+ case "end-reply-sentinel":
10653
+ record[kind] = nativeConstants.OT_CONTROL_END_REPLY_SENTINEL;
10654
+ break;
10245
10655
  default:
10246
10656
  throw new TypeError("Unknown Session control kind");
10247
10657
  }
@@ -10547,6 +10957,13 @@ class FFIRenderLib2 {
10547
10957
  nativeResult("ot_scene_reaches_hooks", this.opentui.symbols.ot_scene_reaches_hooks(pointer, handle, output));
10548
10958
  return output[0] !== 0;
10549
10959
  }
10960
+ scenePainted(context, node) {
10961
+ const handle = encodeContextHandle(context, node);
10962
+ const output = new Uint32Array(1);
10963
+ const pointer = this.nativeContextPointer(context, "ot_scene_painted");
10964
+ nativeResult("ot_scene_painted", this.opentui.symbols.ot_scene_painted(pointer, handle, output));
10965
+ return output[0] !== 0;
10966
+ }
10550
10967
  sceneMarkDirty(context, node) {
10551
10968
  this.getYogaHost().assertMutable();
10552
10969
  const handle = encodeContextHandle(context, node);
@@ -10680,6 +11097,155 @@ class FFIRenderLib2 {
10680
11097
  const pointer = this.nativeContextPointer(context, "ot_scene_set_styled_text");
10681
11098
  nativeResult("ot_scene_set_styled_text", this.opentui.symbols.ot_scene_set_styled_text(pointer, handle, viewOrNull(bytes), bytes.length, count === 0 ? null : records, count, viewOrNull(urlBytes), urlBytes.length));
10682
11099
  }
11100
+ sceneGetTextByteAt(context, node, x, y) {
11101
+ const output = new Uint32Array(1);
11102
+ const pointer = this.nativeContextPointer(context, "ot_scene_get_text_byte_at");
11103
+ nativeResult("ot_scene_get_text_byte_at", this.opentui.symbols.ot_scene_get_text_byte_at(pointer, encodeContextHandle(context, node), x, y, output));
11104
+ return output[0] === 4294967295 ? undefined : output[0];
11105
+ }
11106
+ markdownOptions(context, options) {
11107
+ const { fields } = nativeLayouts.ot_markdown_options;
11108
+ const record = createContextRecord(nativeLayouts.ot_markdown_options);
11109
+ record[fields.flags.offset / 4] = options.flags;
11110
+ record[fields.source_byte_limit.offset / 4] = options.sourceByteLimit ?? 0;
11111
+ if (options.syntaxStyle)
11112
+ record.set(encodeContextHandle(context, options.syntaxStyle), fields.syntax_style.offset / 4);
11113
+ const filter = this.encoder.encode((options.hookFilter ?? []).join("\x00"));
11114
+ if (filter.length > fields.hook_filter.size)
11115
+ throw new RangeError("Markdown hook filter is too long");
11116
+ new Uint8Array(record.buffer, fields.hook_filter.offset).set(filter);
11117
+ record[fields.hook_filter_byte_count.offset / 4] = filter.length;
11118
+ return record;
11119
+ }
11120
+ markdownCall(context, operation, call) {
11121
+ const output = new Uint32Array(3);
11122
+ this.getYogaHost().runMutation(() => nativeResult(operation, call(this.nativeContextPointer(context, operation), output)));
11123
+ const removed = output[2];
11124
+ return { changed: output[0], committed: output[1], removedFrom: removed === 4294967295 ? undefined : removed };
11125
+ }
11126
+ markdownCreate(context, options) {
11127
+ const record = this.markdownOptions(context, options);
11128
+ const output = new Uint32Array(handleWords);
11129
+ this.getYogaHost().runMutation(() => {
11130
+ const pointer = this.nativeContextPointer(context, "ot_markdown_create");
11131
+ nativeResult("ot_markdown_create", this.opentui.symbols.ot_markdown_create(pointer, record, output));
11132
+ });
11133
+ return decodeContextHandle(context, output);
11134
+ }
11135
+ markdownDestroy(context, doc) {
11136
+ this.destroyContextObject(context, doc, "ot_markdown_destroy");
11137
+ }
11138
+ markdownSetOptions(context, doc, options) {
11139
+ const record = this.markdownOptions(context, options);
11140
+ const handle = encodeContextHandle(context, doc);
11141
+ return this.markdownCall(context, "ot_markdown_set_options", (pointer, output) => this.opentui.symbols.ot_markdown_set_options(pointer, handle, record, output));
11142
+ }
11143
+ markdownWrite(context, doc, bytes, replace) {
11144
+ const handle = encodeContextHandle(context, doc);
11145
+ const input = sessionBytes(bytes, "Markdown byte count");
11146
+ const operation = replace ? "ot_markdown_set" : "ot_markdown_append";
11147
+ return this.markdownCall(context, operation, (pointer, output) => this.opentui.symbols[operation](pointer, handle, viewOrNull(input), input.length, output));
11148
+ }
11149
+ markdownFinish(context, doc) {
11150
+ const handle = encodeContextHandle(context, doc);
11151
+ return this.markdownCall(context, "ot_markdown_finish", (pointer, output) => this.opentui.symbols.ot_markdown_finish(pointer, handle, output));
11152
+ }
11153
+ markdownGetSource(context, doc, start = 0, end) {
11154
+ const bytes = new BigUint64Array(1);
11155
+ const count = new Uint32Array(1);
11156
+ const pointer = this.nativeContextPointer(context, "ot_markdown_get_source");
11157
+ nativeResult("ot_markdown_get_source", this.opentui.symbols.ot_markdown_get_source(pointer, encodeContextHandle(context, doc), bytes, count));
11158
+ const to = Math.min(end ?? count[0], count[0]);
11159
+ if (to <= start)
11160
+ return "";
11161
+ return markdownDecoder.decode(new Uint8Array(toArrayBuffer(Number(bytes[0]), start, to - start)));
11162
+ }
11163
+ markdownReadChanges(context, doc, count) {
11164
+ const layout = nativeLayouts.ot_markdown_block;
11165
+ const words = new Uint32Array(count * layout.size / 4);
11166
+ const halves = new Uint16Array(words.buffer);
11167
+ const output = new Uint32Array(1);
11168
+ const handle = encodeContextHandle(context, doc);
11169
+ const pointer = this.nativeContextPointer(context, "ot_markdown_read_changes");
11170
+ nativeResult("ot_markdown_read_changes", this.opentui.symbols.ot_markdown_read_changes(pointer, handle, viewOrNull(words), count, output));
11171
+ if (output[0] > count)
11172
+ throw new NativeError2("ot_markdown_read_changes", -1 /* InvalidArgument */);
11173
+ const { fields: f } = layout;
11174
+ const blocks = [];
11175
+ for (let at = 0;at < output[0] * (layout.size / 4); at += layout.size / 4) {
11176
+ const parent = words[at + f.parent_index.offset / 4];
11177
+ blocks.push({
11178
+ index: words[at + f.index.offset / 4],
11179
+ parent: parent === 4294967295 ? undefined : parent,
11180
+ kind: halves[at * 2 + f.kind.offset / 2],
11181
+ flags: halves[at * 2 + f.flags.offset / 2],
11182
+ sourceStart: words[at + f.source_start_byte.offset / 4],
11183
+ sourceEnd: words[at + f.source_end_byte.offset / 4],
11184
+ infoStart: words[at + f.info_start_byte.offset / 4],
11185
+ infoEnd: words[at + f.info_end_byte.offset / 4],
11186
+ number: words[at + f.number.offset / 4]
11187
+ });
11188
+ }
11189
+ return blocks;
11190
+ }
11191
+ markdownReadSource(context, doc, block) {
11192
+ const handle = encodeContextHandle(context, doc);
11193
+ const count = new Uint32Array(1);
11194
+ const pointer = this.nativeContextPointer(context, "ot_markdown_read_source");
11195
+ nativeResult("ot_markdown_read_source", this.opentui.symbols.ot_markdown_read_source(pointer, handle, block, null, 0, count));
11196
+ if (count[0] === 0)
11197
+ return "";
11198
+ const bytes = new Uint8Array(count[0]);
11199
+ nativeResult("ot_markdown_read_source", this.opentui.symbols.ot_markdown_read_source(pointer, handle, block, bytes, bytes.length, count));
11200
+ return markdownDecoder.decode(bytes);
11201
+ }
11202
+ markdownReadLeaf(context, doc, block) {
11203
+ const handle = encodeContextHandle(context, doc);
11204
+ const counts = new Uint32Array(3);
11205
+ const [byteCount, chunkCount, urlCount] = [counts.subarray(0, 1), counts.subarray(1, 2), counts.subarray(2, 3)];
11206
+ const pointer = this.nativeContextPointer(context, "ot_markdown_read_leaf");
11207
+ const read = (bytes, chunks, spans, urls) => nativeResult("ot_markdown_read_leaf", this.opentui.symbols.ot_markdown_read_leaf(pointer, handle, block, bytes, bytes?.length ?? 0, byteCount, chunks, spans, spans?.length ?? 0, chunkCount, urls, urls?.length ?? 0, urlCount));
11208
+ read(null, null, null, null);
11209
+ const layout = nativeLayouts.ot_styled_text_chunk;
11210
+ const stride = layout.size / 4;
11211
+ const bytes = new Uint8Array(byteCount[0]);
11212
+ const records = new Uint32Array(chunkCount[0] * stride);
11213
+ const spans = new Uint32Array(chunkCount[0]);
11214
+ const urls = new Uint8Array(urlCount[0]);
11215
+ if (chunkCount[0] > 0)
11216
+ read(viewOrNull(bytes), records, spans, viewOrNull(urls));
11217
+ const colors = new Uint16Array(records.buffer);
11218
+ const chunks = [];
11219
+ let at = 0;
11220
+ for (let index = 0;index < chunkCount[0]; index++) {
11221
+ const base = index * stride;
11222
+ const flags = records[base + layout.fields.flags.offset / 4];
11223
+ const end = at + records[base + layout.fields.byte_count.offset / 4];
11224
+ const color = (offset) => RGBA2.fromArray(colors.slice(base * 2 + offset / 2, base * 2 + offset / 2 + 4));
11225
+ const chunk = { __isChunk: true, text: markdownDecoder.decode(bytes.subarray(at, end)) };
11226
+ if (flags & nativeConstants.OT_SCENE_TEXT_FOREGROUND)
11227
+ chunk.fg = color(layout.fields.foreground.offset);
11228
+ if (flags & nativeConstants.OT_SCENE_TEXT_BACKGROUND)
11229
+ chunk.bg = color(layout.fields.background.offset);
11230
+ chunk.attributes = records[base + layout.fields.attributes.offset / 4];
11231
+ if (flags & nativeConstants.OT_SCENE_TEXT_LINK) {
11232
+ const offset = records[base + layout.fields.link_offset.offset / 4];
11233
+ const url = urls.subarray(offset, offset + records[base + layout.fields.link_byte_count.offset / 4]);
11234
+ chunk.link = { url: markdownDecoder.decode(url) };
11235
+ }
11236
+ chunks.push(chunk);
11237
+ at = end;
11238
+ }
11239
+ return { chunks, spans };
11240
+ }
11241
+ markdownBind(context, doc, block, node) {
11242
+ const handle = encodeContextHandle(context, doc);
11243
+ const target = encodeContextHandle(context, node);
11244
+ this.getYogaHost().runMutation(() => {
11245
+ const pointer = this.nativeContextPointer(context, "ot_markdown_bind");
11246
+ nativeResult("ot_markdown_bind", this.opentui.symbols.ot_markdown_bind(pointer, handle, block, target));
11247
+ });
11248
+ }
10683
11249
  encodeStyledText(content, allowLinks = true, preserveChunkOrdinals = false) {
10684
11250
  if (typeof content !== "object" || content === null || isStyledText2(content) !== true) {
10685
11251
  throw new TypeError("Native scene text requires a string or branded StyledText");
@@ -10943,7 +11509,7 @@ class FFIRenderLib2 {
10943
11509
  this.getYogaHost().assertMutable();
10944
11510
  const handle = encodeContextHandle(context, node);
10945
11511
  const record = createContextRecord(layout);
10946
- const operation = ["reset", "set", "update"].indexOf(options.operation);
11512
+ const operation = ["reset", "set", "update", "colors"].indexOf(options.operation);
10947
11513
  const behavior = ["cell", "word", "line"].indexOf(options.behavior);
10948
11514
  if (operation < 0 || behavior < 0)
10949
11515
  throw new TypeError("Unknown scene text selection operation or behavior");
@@ -11028,7 +11594,7 @@ class FFIRenderLib2 {
11028
11594
  this.sceneLayoutRecord = undefined;
11029
11595
  try {
11030
11596
  const handle = encodeContextHandle(context, node, scratch.handle.record, scratch.handle.words);
11031
- const mode = observation === "paint" ? nativeConstants.OT_LAYOUT_PAINT : toFFIBool(observation, "Scene Yoga layout observation") ? nativeConstants.OT_LAYOUT_YOGA : nativeConstants.OT_LAYOUT_PUBLIC;
11597
+ const mode = observation === "paint" ? nativeConstants.OT_LAYOUT_PAINT : observation === "content" ? nativeConstants.OT_LAYOUT_CONTENT : toFFIBool(observation, "Scene Yoga layout observation") ? nativeConstants.OT_LAYOUT_YOGA : nativeConstants.OT_LAYOUT_PUBLIC;
11032
11598
  const { output, values, coordinates } = scratch;
11033
11599
  output[layout.fields.struct_size.offset / 4] = layout.size;
11034
11600
  output[layout.fields.abi_version.offset / 4] = nativeConstants.OT_CONTEXT_ABI_VERSION;
@@ -11206,13 +11772,14 @@ class FFIRenderLib2 {
11206
11772
  const pointer = this.nativeContextPointer(context, "ot_scene_frame_cancel");
11207
11773
  nativeResult("ot_scene_frame_cancel", this.opentui.symbols.ot_scene_frame_cancel(pointer, handle, id));
11208
11774
  }
11209
- sceneHitTest(context, session, x, y) {
11775
+ sceneHitTest(context, session, x, y, excluded = 0) {
11210
11776
  const handle = encodeContextHandle(context, session);
11211
11777
  toFFII32(x, "Scene hit x");
11212
11778
  toFFII32(y, "Scene hit y");
11779
+ toSafeFFIU32Length(excluded, "Scene hit exclusion");
11213
11780
  const output = this.hitTestOutput;
11214
- const pointer = this.nativeContextPointer(context, "ot_scene_hit_test");
11215
- nativeResult("ot_scene_hit_test", this.opentui.symbols.ot_scene_hit_test(pointer, handle, x, y, output));
11781
+ const pointer = this.nativeContextPointer(context, "ot_scene_hit_test_excluding");
11782
+ nativeResult("ot_scene_hit_test_excluding", this.opentui.symbols.ot_scene_hit_test_excluding(pointer, handle, x, y, excluded, output));
11216
11783
  return output[0];
11217
11784
  }
11218
11785
  sceneSetDebugFlags(context, session, flags) {
@@ -12385,9 +12952,9 @@ var Direction2;
12385
12952
  })(Direction2 ||= {});
12386
12953
  var Display2;
12387
12954
  ((Display) => {
12388
- Display[Display["Flex"] = 0] = "Flex";
12389
- Display[Display["None"] = 1] = "None";
12390
- Display[Display["Contents"] = 2] = "Contents";
12955
+ Display[Display["Flex"] = OT_DISPLAY_FLEX] = "Flex";
12956
+ Display[Display["None"] = OT_DISPLAY_NONE] = "None";
12957
+ Display[Display["Contents"] = OT_DISPLAY_CONTENTS] = "Contents";
12391
12958
  })(Display2 ||= {});
12392
12959
  var Edge2;
12393
12960
  ((Edge) => {
@@ -12403,16 +12970,16 @@ var Edge2;
12403
12970
  })(Edge2 ||= {});
12404
12971
  var Errata2;
12405
12972
  ((Errata) => {
12406
- Errata[Errata["None"] = 0] = "None";
12407
- Errata[Errata["StretchFlexBasis"] = 1] = "StretchFlexBasis";
12408
- Errata[Errata["AbsolutePositionWithoutInsetsExcludesPadding"] = 2] = "AbsolutePositionWithoutInsetsExcludesPadding";
12409
- Errata[Errata["AbsolutePercentAgainstInnerSize"] = 4] = "AbsolutePercentAgainstInnerSize";
12410
- Errata[Errata["All"] = 2147483647] = "All";
12411
- Errata[Errata["Classic"] = 2147483646] = "Classic";
12973
+ Errata[Errata["None"] = OT_YOGA_ERRATA_NONE] = "None";
12974
+ Errata[Errata["StretchFlexBasis"] = OT_YOGA_ERRATA_STRETCH_FLEX_BASIS] = "StretchFlexBasis";
12975
+ Errata[Errata["AbsolutePositionWithoutInsetsExcludesPadding"] = OT_YOGA_ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING] = "AbsolutePositionWithoutInsetsExcludesPadding";
12976
+ Errata[Errata["AbsolutePercentAgainstInnerSize"] = OT_YOGA_ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE] = "AbsolutePercentAgainstInnerSize";
12977
+ Errata[Errata["All"] = OT_YOGA_ERRATA_ALL] = "All";
12978
+ Errata[Errata["Classic"] = OT_YOGA_ERRATA_CLASSIC] = "Classic";
12412
12979
  })(Errata2 ||= {});
12413
12980
  var ExperimentalFeature2;
12414
12981
  ((ExperimentalFeature) => {
12415
- ExperimentalFeature[ExperimentalFeature["WebFlexBasis"] = 0] = "WebFlexBasis";
12982
+ ExperimentalFeature[ExperimentalFeature["WebFlexBasis"] = OT_YOGA_EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS] = "WebFlexBasis";
12416
12983
  })(ExperimentalFeature2 ||= {});
12417
12984
  var FlexDirection2;
12418
12985
  ((FlexDirection) => {
@@ -12438,12 +13005,12 @@ var Justify2;
12438
13005
  })(Justify2 ||= {});
12439
13006
  var LogLevel3;
12440
13007
  ((LogLevel) => {
12441
- LogLevel[LogLevel["Error"] = 0] = "Error";
12442
- LogLevel[LogLevel["Warn"] = 1] = "Warn";
12443
- LogLevel[LogLevel["Info"] = 2] = "Info";
12444
- LogLevel[LogLevel["Debug"] = 3] = "Debug";
12445
- LogLevel[LogLevel["Verbose"] = 4] = "Verbose";
12446
- LogLevel[LogLevel["Fatal"] = 5] = "Fatal";
13008
+ LogLevel[LogLevel["Error"] = OT_YOGA_LOG_LEVEL_ERROR] = "Error";
13009
+ LogLevel[LogLevel["Warn"] = OT_YOGA_LOG_LEVEL_WARN] = "Warn";
13010
+ LogLevel[LogLevel["Info"] = OT_YOGA_LOG_LEVEL_INFO] = "Info";
13011
+ LogLevel[LogLevel["Debug"] = OT_YOGA_LOG_LEVEL_DEBUG] = "Debug";
13012
+ LogLevel[LogLevel["Verbose"] = OT_YOGA_LOG_LEVEL_VERBOSE] = "Verbose";
13013
+ LogLevel[LogLevel["Fatal"] = OT_YOGA_LOG_LEVEL_FATAL] = "Fatal";
12447
13014
  })(LogLevel3 ||= {});
12448
13015
  var MeasureMode2;
12449
13016
  ((MeasureMode) => {
@@ -12453,8 +13020,8 @@ var MeasureMode2;
12453
13020
  })(MeasureMode2 ||= {});
12454
13021
  var NodeType2;
12455
13022
  ((NodeType) => {
12456
- NodeType[NodeType["Default"] = 0] = "Default";
12457
- NodeType[NodeType["Text"] = 1] = "Text";
13023
+ NodeType[NodeType["Default"] = OT_YOGA_NODE_TYPE_DEFAULT] = "Default";
13024
+ NodeType[NodeType["Text"] = OT_YOGA_NODE_TYPE_TEXT] = "Text";
12458
13025
  })(NodeType2 ||= {});
12459
13026
  var Overflow2;
12460
13027
  ((Overflow) => {
@@ -12497,9 +13064,9 @@ var DIMENSION_HEIGHT2 = Dimension2.Height;
12497
13064
  var DIRECTION_INHERIT2 = Direction2.Inherit;
12498
13065
  var DIRECTION_LTR2 = Direction2.LTR;
12499
13066
  var DIRECTION_RTL2 = Direction2.RTL;
12500
- var DISPLAY_FLEX2 = 0 /* Flex */;
12501
- var DISPLAY_NONE2 = 1 /* None */;
12502
- var DISPLAY_CONTENTS2 = 2 /* Contents */;
13067
+ var DISPLAY_FLEX2 = Display2.Flex;
13068
+ var DISPLAY_NONE2 = Display2.None;
13069
+ var DISPLAY_CONTENTS2 = Display2.Contents;
12503
13070
  var EDGE_LEFT2 = Edge2.Left;
12504
13071
  var EDGE_TOP2 = Edge2.Top;
12505
13072
  var EDGE_RIGHT2 = Edge2.Right;
@@ -12509,13 +13076,13 @@ var EDGE_END2 = Edge2.End;
12509
13076
  var EDGE_HORIZONTAL2 = Edge2.Horizontal;
12510
13077
  var EDGE_VERTICAL2 = Edge2.Vertical;
12511
13078
  var EDGE_ALL2 = Edge2.All;
12512
- var ERRATA_NONE2 = 0 /* None */;
12513
- var ERRATA_STRETCH_FLEX_BASIS2 = 1 /* StretchFlexBasis */;
12514
- var ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING2 = 2 /* AbsolutePositionWithoutInsetsExcludesPadding */;
12515
- var ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE2 = 4 /* AbsolutePercentAgainstInnerSize */;
12516
- var ERRATA_ALL2 = 2147483647 /* All */;
12517
- var ERRATA_CLASSIC2 = 2147483646 /* Classic */;
12518
- var EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS2 = 0 /* WebFlexBasis */;
13079
+ var ERRATA_NONE2 = Errata2.None;
13080
+ var ERRATA_STRETCH_FLEX_BASIS2 = Errata2.StretchFlexBasis;
13081
+ var ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING2 = Errata2.AbsolutePositionWithoutInsetsExcludesPadding;
13082
+ var ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE2 = Errata2.AbsolutePercentAgainstInnerSize;
13083
+ var ERRATA_ALL2 = Errata2.All;
13084
+ var ERRATA_CLASSIC2 = Errata2.Classic;
13085
+ var EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS2 = ExperimentalFeature2.WebFlexBasis;
12519
13086
  var FLEX_DIRECTION_COLUMN2 = FlexDirection2.Column;
12520
13087
  var FLEX_DIRECTION_COLUMN_REVERSE2 = FlexDirection2.ColumnReverse;
12521
13088
  var FLEX_DIRECTION_ROW2 = FlexDirection2.Row;
@@ -12529,17 +13096,17 @@ var JUSTIFY_FLEX_END2 = Justify2.FlexEnd;
12529
13096
  var JUSTIFY_SPACE_BETWEEN2 = Justify2.SpaceBetween;
12530
13097
  var JUSTIFY_SPACE_AROUND2 = Justify2.SpaceAround;
12531
13098
  var JUSTIFY_SPACE_EVENLY2 = Justify2.SpaceEvenly;
12532
- var LOG_LEVEL_ERROR2 = 0 /* Error */;
12533
- var LOG_LEVEL_WARN2 = 1 /* Warn */;
12534
- var LOG_LEVEL_INFO2 = 2 /* Info */;
12535
- var LOG_LEVEL_DEBUG2 = 3 /* Debug */;
12536
- var LOG_LEVEL_VERBOSE2 = 4 /* Verbose */;
12537
- var LOG_LEVEL_FATAL2 = 5 /* Fatal */;
13099
+ var LOG_LEVEL_ERROR2 = LogLevel3.Error;
13100
+ var LOG_LEVEL_WARN2 = LogLevel3.Warn;
13101
+ var LOG_LEVEL_INFO2 = LogLevel3.Info;
13102
+ var LOG_LEVEL_DEBUG2 = LogLevel3.Debug;
13103
+ var LOG_LEVEL_VERBOSE2 = LogLevel3.Verbose;
13104
+ var LOG_LEVEL_FATAL2 = LogLevel3.Fatal;
12538
13105
  var MEASURE_MODE_UNDEFINED2 = MeasureMode2.Undefined;
12539
13106
  var MEASURE_MODE_EXACTLY2 = MeasureMode2.Exactly;
12540
13107
  var MEASURE_MODE_AT_MOST2 = MeasureMode2.AtMost;
12541
- var NODE_TYPE_DEFAULT2 = 0 /* Default */;
12542
- var NODE_TYPE_TEXT2 = 1 /* Text */;
13108
+ var NODE_TYPE_DEFAULT2 = NodeType2.Default;
13109
+ var NODE_TYPE_TEXT2 = NodeType2.Text;
12543
13110
  var OVERFLOW_VISIBLE2 = Overflow2.Visible;
12544
13111
  var OVERFLOW_HIDDEN2 = Overflow2.Hidden;
12545
13112
  var OVERFLOW_SCROLL2 = Overflow2.Scroll;
@@ -12696,7 +13263,7 @@ class Config2 {
12696
13263
  }
12697
13264
  getErrata() {
12698
13265
  if (this.freed)
12699
- return 0 /* None */;
13266
+ return Errata2.None;
12700
13267
  return this.renderLib.yogaConfigGetErrata(this.ptr);
12701
13268
  }
12702
13269
  setExperimentalFeatureEnabled(feature, enabled) {
@@ -12946,7 +13513,7 @@ class Node2 {
12946
13513
  this.setEnum(YogaEnumKind.Display, display);
12947
13514
  }
12948
13515
  getDisplay() {
12949
- return this.getEnum(YogaEnumKind.Display, 0 /* Flex */);
13516
+ return this.getEnum(YogaEnumKind.Display, Display2.Flex);
12950
13517
  }
12951
13518
  setBoxSizing(boxSizing) {
12952
13519
  this.setEnum(YogaEnumKind.BoxSizing, boxSizing);
@@ -13315,7 +13882,7 @@ var Yoga = {
13315
13882
  };
13316
13883
  var yoga_default = Yoga;
13317
13884
 
13318
- 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 };
13885
+ 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, NativeEditAtomic, 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 };
13319
13886
 
13320
- //# debugId=F76C3A6CAD2EAF8D64756E2164756E21
13321
- //# sourceMappingURL=chunk-node-5nvhjp1a.js.map
13887
+ //# debugId=A73B90C38AB354F364756E2164756E21
13888
+ //# sourceMappingURL=chunk-node-mcdre3zn.js.map