@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
@@ -115,6 +115,24 @@ __export(exports_yoga, {
115
115
  });
116
116
 
117
117
  // src/native-abi.generated.ts
118
+ var OT_DISPLAY_FLEX = 0;
119
+ var OT_DISPLAY_NONE = 1;
120
+ var OT_DISPLAY_CONTENTS = 2;
121
+ var OT_YOGA_ERRATA_NONE = 0;
122
+ var OT_YOGA_ERRATA_STRETCH_FLEX_BASIS = 1;
123
+ var OT_YOGA_ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING = 2;
124
+ var OT_YOGA_ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE = 4;
125
+ var OT_YOGA_ERRATA_ALL = 2147483647;
126
+ var OT_YOGA_ERRATA_CLASSIC = 2147483646;
127
+ var OT_YOGA_EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS = 0;
128
+ var OT_YOGA_LOG_LEVEL_ERROR = 0;
129
+ var OT_YOGA_LOG_LEVEL_WARN = 1;
130
+ var OT_YOGA_LOG_LEVEL_INFO = 2;
131
+ var OT_YOGA_LOG_LEVEL_DEBUG = 3;
132
+ var OT_YOGA_LOG_LEVEL_VERBOSE = 4;
133
+ var OT_YOGA_LOG_LEVEL_FATAL = 5;
134
+ var OT_YOGA_NODE_TYPE_DEFAULT = 0;
135
+ var OT_YOGA_NODE_TYPE_TEXT = 1;
118
136
  var nativeSymbols = {
119
137
  ot_scene_set_hooks: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
120
138
  ot_scene_frame_step_with_geometry: {
@@ -126,9 +144,11 @@ var nativeSymbols = {
126
144
  ot_scene_create_node: { args: ["ptr", "buffer", "u32", "u32", "buffer"], returns: "i32" },
127
145
  ot_scene_destroy_node: { args: ["ptr", "buffer"], returns: "i32" },
128
146
  ot_scene_move_node: { args: ["ptr", "buffer", "ptr", "u32"], returns: "i32" },
147
+ ot_scene_clear_children: { args: ["ptr", "buffer"], returns: "i32" },
129
148
  ot_scene_set_measure: { args: ["ptr", "buffer", "ptr"], returns: "i32" },
130
149
  ot_scene_has_measure: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
131
150
  ot_scene_reaches_hooks: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
151
+ ot_scene_painted: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
132
152
  ot_scene_mark_dirty: { args: ["ptr", "buffer"], returns: "i32" },
133
153
  ot_scene_set_style: { args: ["ptr", "buffer", "u32", "u32", "u32", "u32", "f32", "u32"], returns: "i32" },
134
154
  ot_scene_get_style: { args: ["ptr", "buffer", "u32", "u32", "u32", "buffer"], returns: "i32" },
@@ -155,9 +175,11 @@ var nativeSymbols = {
155
175
  ot_scene_get_text: { args: ["ptr", "buffer", "ptr", "u32", "buffer"], returns: "i32" },
156
176
  ot_scene_get_text_info: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
157
177
  ot_scene_get_text_lines: { args: ["ptr", "buffer", "u32", "ptr", "u32", "buffer"], returns: "i32" },
178
+ ot_scene_get_text_byte_at: { args: ["ptr", "buffer", "i32", "i32", "buffer"], returns: "i32" },
158
179
  ot_scene_get_layout: { args: ["ptr", "buffer", "u32", "buffer"], returns: "i32" },
159
180
  ot_scene_paint: { args: ["ptr", "buffer", "buffer", "u32", "u32", "buffer"], returns: "i32" },
160
181
  ot_scene_hit_test: { args: ["ptr", "buffer", "i32", "i32", "buffer"], returns: "i32" },
182
+ ot_scene_hit_test_excluding: { args: ["ptr", "buffer", "i32", "i32", "u32", "buffer"], returns: "i32" },
161
183
  ot_scene_get_stats: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
162
184
  ot_scene_set_debug_flags: { args: ["ptr", "buffer", "u32"], returns: "i32" },
163
185
  ot_scene_get_cursor_state: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
@@ -213,6 +235,7 @@ var nativeSymbols = {
213
235
  args: ["ptr", "buffer", "u32", "u32", "u32", "u32", "u32", "ptr", "u32", "buffer"],
214
236
  returns: "i32"
215
237
  },
238
+ ot_edit_buffer_convert_offset: { args: ["ptr", "buffer", "u32", "u32", "buffer"], returns: "i32" },
216
239
  ot_edit_buffer_measure_text: { args: ["ptr", "buffer", "ptr", "u32", "buffer"], returns: "i32" },
217
240
  ot_edit_measure_text: { args: ["ptr", "ptr", "u32", "u32", "u32", "buffer"], returns: "i32" },
218
241
  ot_edit_buffer_set_defaults: { args: ["ptr", "buffer", "u32", "buffer"], returns: "i32" },
@@ -221,6 +244,24 @@ var nativeSymbols = {
221
244
  ot_syntax_style_get_count: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
222
245
  ot_edit_buffer_highlight: { args: ["ptr", "buffer", "u32", "u32", "ptr"], returns: "i32" },
223
246
  ot_edit_buffer_get_highlights: { args: ["ptr", "buffer", "u32", "ptr", "u32", "buffer"], returns: "i32" },
247
+ ot_context_group_set: { args: ["ptr", "buffer", "u32", "buffer", "u32", "buffer"], returns: "i32" },
248
+ ot_edit_buffer_set_layer: { args: ["ptr", "buffer", "u32", "u32", "u32", "ptr", "u32"], returns: "i32" },
249
+ ot_edit_buffer_mark: { args: ["ptr", "buffer", "u32", "ptr", "ptr"], returns: "i32" },
250
+ ot_edit_buffer_get_marks: { args: ["ptr", "buffer", "u32", "u32", "ptr", "u32", "buffer"], returns: "i32" },
251
+ ot_markdown_create: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
252
+ ot_markdown_destroy: { args: ["ptr", "buffer"], returns: "i32" },
253
+ ot_markdown_set_options: { args: ["ptr", "buffer", "buffer", "buffer"], returns: "i32" },
254
+ ot_markdown_append: { args: ["ptr", "buffer", "ptr", "u32", "buffer"], returns: "i32" },
255
+ ot_markdown_set: { args: ["ptr", "buffer", "ptr", "u32", "buffer"], returns: "i32" },
256
+ ot_markdown_finish: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
257
+ ot_markdown_get_source: { args: ["ptr", "buffer", "buffer", "buffer"], returns: "i32" },
258
+ ot_markdown_read_changes: { args: ["ptr", "buffer", "ptr", "u32", "buffer"], returns: "i32" },
259
+ ot_markdown_read_source: { args: ["ptr", "buffer", "u32", "ptr", "u32", "buffer"], returns: "i32" },
260
+ ot_markdown_read_leaf: {
261
+ args: ["ptr", "buffer", "u32", "ptr", "u32", "buffer", "ptr", "ptr", "u32", "buffer", "ptr", "u32", "buffer"],
262
+ returns: "i32"
263
+ },
264
+ ot_markdown_bind: { args: ["ptr", "buffer", "u32", "buffer"], returns: "i32" },
224
265
  ot_editor_view_set_viewport: { args: ["ptr", "buffer", "buffer", "u32", "u32"], returns: "i32" },
225
266
  ot_editor_view_get_viewport: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
226
267
  ot_editor_view_set_scroll_margin: { args: ["ptr", "buffer", "f32"], returns: "i32" },
@@ -307,8 +348,10 @@ var nativeSymbols = {
307
348
  ot_text_buffer_get_range: { args: ["ptr", "buffer", "u32", "u32", "ptr", "u32", "buffer"], returns: "i32" },
308
349
  ot_text_buffer_set_defaults: { args: ["ptr", "buffer", "u32", "buffer"], returns: "i32" },
309
350
  ot_text_buffer_set_tab_width: { args: ["ptr", "buffer", "u32"], returns: "i32" },
351
+ ot_text_buffer_set_width_method: { args: ["ptr", "buffer", "u32"], returns: "i32" },
310
352
  ot_text_buffer_highlight: { args: ["ptr", "buffer", "u32", "u32", "ptr"], returns: "i32" },
311
353
  ot_text_buffer_get_highlights: { args: ["ptr", "buffer", "u32", "ptr", "u32", "buffer"], returns: "i32" },
354
+ ot_text_buffer_set_layer: { args: ["ptr", "buffer", "u32", "u32", "u32", "ptr", "u32"], returns: "i32" },
312
355
  ot_text_buffer_view_set_viewport: { args: ["ptr", "buffer", "buffer", "u32"], returns: "i32" },
313
356
  ot_text_buffer_view_command: { args: ["ptr", "buffer", "u32", "u32"], returns: "i32" },
314
357
  ot_text_buffer_view_set_tab_color: { args: ["ptr", "buffer", "ptr"], returns: "i32" },
@@ -1015,7 +1058,7 @@ var nativeLayouts = {
1015
1058
  struct_size: { offset: 0, size: 4, alignment: 4, type: "u32" },
1016
1059
  abi_version: { offset: 4, size: 4, alignment: 4, type: "u32" },
1017
1060
  width_method: { offset: 8, size: 4, alignment: 4, type: "u32" },
1018
- reserved: { offset: 12, size: 4, alignment: 4, type: "u32" }
1061
+ flags: { offset: 12, size: 4, alignment: 4, type: "u32" }
1019
1062
  }
1020
1063
  },
1021
1064
  ot_edit_buffer_info: {
@@ -1085,6 +1128,71 @@ var nativeLayouts = {
1085
1128
  ref: { offset: 16, size: 4, alignment: 4, type: "u32" }
1086
1129
  }
1087
1130
  },
1131
+ ot_highlight_run: {
1132
+ size: 12,
1133
+ alignment: 4,
1134
+ fields: {
1135
+ start_byte: { offset: 0, size: 4, alignment: 4, type: "u32" },
1136
+ end_byte: { offset: 4, size: 4, alignment: 4, type: "u32" },
1137
+ group_set: { offset: 8, size: 4, alignment: 4, type: "u32" }
1138
+ }
1139
+ },
1140
+ ot_edit_mark: {
1141
+ size: 76,
1142
+ alignment: 4,
1143
+ fields: {
1144
+ struct_size: { offset: 0, size: 4, alignment: 4, type: "u32" },
1145
+ abi_version: { offset: 4, size: 4, alignment: 4, type: "u32" },
1146
+ id: { offset: 8, size: 4, alignment: 4, type: "u32" },
1147
+ kind: { offset: 12, size: 4, alignment: 4, type: "u32" },
1148
+ flags: { offset: 16, size: 4, alignment: 4, type: "u32" },
1149
+ style: { offset: 20, size: 4, alignment: 4, type: "u32" },
1150
+ value: { offset: 24, size: 32, alignment: 4, type: "ot_editor_style" },
1151
+ priority: { offset: 56, size: 4, alignment: 4, type: "u32" },
1152
+ start: { offset: 60, size: 4, alignment: 4, type: "u32" },
1153
+ end: { offset: 64, size: 4, alignment: 4, type: "u32" },
1154
+ start_byte: { offset: 68, size: 4, alignment: 4, type: "u32" },
1155
+ end_byte: { offset: 72, size: 4, alignment: 4, type: "u32" }
1156
+ }
1157
+ },
1158
+ ot_markdown_options: {
1159
+ size: 296,
1160
+ alignment: 8,
1161
+ fields: {
1162
+ struct_size: { offset: 0, size: 4, alignment: 4, type: "u32" },
1163
+ abi_version: { offset: 4, size: 4, alignment: 4, type: "u32" },
1164
+ flags: { offset: 8, size: 4, alignment: 4, type: "u32" },
1165
+ source_byte_limit: { offset: 12, size: 4, alignment: 4, type: "u32" },
1166
+ syntax_style: { offset: 16, size: 16, alignment: 8, type: "ot_handle" },
1167
+ hook_filter_byte_count: { offset: 32, size: 4, alignment: 4, type: "u32" },
1168
+ reserved: { offset: 36, size: 4, alignment: 4, type: "u32" },
1169
+ hook_filter: { offset: 40, size: 256, alignment: 1, type: "[256]u8" }
1170
+ }
1171
+ },
1172
+ ot_markdown_result: {
1173
+ size: 12,
1174
+ alignment: 4,
1175
+ fields: {
1176
+ changed_block_count: { offset: 0, size: 4, alignment: 4, type: "u32" },
1177
+ committed_top_level_count: { offset: 4, size: 4, alignment: 4, type: "u32" },
1178
+ removed_from_index: { offset: 8, size: 4, alignment: 4, type: "u32" }
1179
+ }
1180
+ },
1181
+ ot_markdown_block: {
1182
+ size: 32,
1183
+ alignment: 4,
1184
+ fields: {
1185
+ index: { offset: 0, size: 4, alignment: 4, type: "u32" },
1186
+ parent_index: { offset: 4, size: 4, alignment: 4, type: "u32" },
1187
+ kind: { offset: 8, size: 2, alignment: 2, type: "u16" },
1188
+ flags: { offset: 10, size: 2, alignment: 2, type: "u16" },
1189
+ source_start_byte: { offset: 12, size: 4, alignment: 4, type: "u32" },
1190
+ source_end_byte: { offset: 16, size: 4, alignment: 4, type: "u32" },
1191
+ info_start_byte: { offset: 20, size: 4, alignment: 4, type: "u32" },
1192
+ info_end_byte: { offset: 24, size: 4, alignment: 4, type: "u32" },
1193
+ number: { offset: 28, size: 4, alignment: 4, type: "u32" }
1194
+ }
1195
+ },
1088
1196
  ot_editor_viewport: {
1089
1197
  size: 24,
1090
1198
  alignment: 4,
@@ -1687,6 +1795,27 @@ var nativeLayouts = {
1687
1795
  foreground: { offset: 40, size: 8, alignment: 2, type: "[4]u16" },
1688
1796
  background: { offset: 48, size: 8, alignment: 2, type: "[4]u16" }
1689
1797
  }
1798
+ },
1799
+ ot_scene_cell: {
1800
+ size: 24,
1801
+ alignment: 4,
1802
+ fields: {
1803
+ character: { offset: 0, size: 4, alignment: 4, type: "u32" },
1804
+ attributes: { offset: 4, size: 4, alignment: 4, type: "u32" },
1805
+ foreground: { offset: 8, size: 8, alignment: 2, type: "[4]u16" },
1806
+ background: { offset: 16, size: 8, alignment: 2, type: "[4]u16" }
1807
+ }
1808
+ },
1809
+ ot_scene_record_cells: {
1810
+ size: 24,
1811
+ alignment: 4,
1812
+ fields: {
1813
+ header: { offset: 0, size: 8, alignment: 4, type: "ot_scene_record_header" },
1814
+ x: { offset: 8, size: 4, alignment: 4, type: "i32" },
1815
+ y: { offset: 12, size: 4, alignment: 4, type: "i32" },
1816
+ width: { offset: 16, size: 4, alignment: 4, type: "u32" },
1817
+ count: { offset: 20, size: 4, alignment: 4, type: "u32" }
1818
+ }
1690
1819
  }
1691
1820
  };
1692
1821
  var nativeConstants = {
@@ -1767,6 +1896,7 @@ var nativeConstants = {
1767
1896
  OT_STYLE_ENUM_OVERFLOW: 8,
1768
1897
  OT_STYLE_ENUM_DISPLAY: 9,
1769
1898
  OT_STYLE_ENUM_BOX_SIZING: 10,
1899
+ OT_STYLE_ENUM_LAYOUT_MODE: 11,
1770
1900
  OT_STYLE_FLOAT_FLEX: 0,
1771
1901
  OT_STYLE_FLOAT_FLEX_GROW: 1,
1772
1902
  OT_STYLE_FLOAT_FLEX_SHRINK: 2,
@@ -1836,6 +1966,24 @@ var nativeConstants = {
1836
1966
  OT_DISPLAY_NONE: 1,
1837
1967
  OT_BOX_SIZING_BORDER_BOX: 0,
1838
1968
  OT_BOX_SIZING_CONTENT_BOX: 1,
1969
+ OT_LAYOUT_MODE_FLEX: 0,
1970
+ OT_LAYOUT_MODE_LIST: 1,
1971
+ OT_DISPLAY_CONTENTS: 2,
1972
+ OT_YOGA_ERRATA_NONE: 0,
1973
+ OT_YOGA_ERRATA_STRETCH_FLEX_BASIS: 1,
1974
+ OT_YOGA_ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING: 2,
1975
+ OT_YOGA_ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE: 4,
1976
+ OT_YOGA_ERRATA_ALL: 2147483647,
1977
+ OT_YOGA_ERRATA_CLASSIC: 2147483646,
1978
+ OT_YOGA_EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: 0,
1979
+ OT_YOGA_LOG_LEVEL_ERROR: 0,
1980
+ OT_YOGA_LOG_LEVEL_WARN: 1,
1981
+ OT_YOGA_LOG_LEVEL_INFO: 2,
1982
+ OT_YOGA_LOG_LEVEL_DEBUG: 3,
1983
+ OT_YOGA_LOG_LEVEL_VERBOSE: 4,
1984
+ OT_YOGA_LOG_LEVEL_FATAL: 5,
1985
+ OT_YOGA_NODE_TYPE_DEFAULT: 0,
1986
+ OT_YOGA_NODE_TYPE_TEXT: 1,
1839
1987
  OT_STYLE_ENUM_DIRECTION_MAX: 2,
1840
1988
  OT_STYLE_ENUM_FLEX_DIRECTION_MAX: 3,
1841
1989
  OT_STYLE_ENUM_JUSTIFY_CONTENT_MAX: 5,
@@ -1847,12 +1995,14 @@ var nativeConstants = {
1847
1995
  OT_STYLE_ENUM_OVERFLOW_MAX: 2,
1848
1996
  OT_STYLE_ENUM_DISPLAY_MAX: 1,
1849
1997
  OT_STYLE_ENUM_BOX_SIZING_MAX: 1,
1998
+ OT_STYLE_ENUM_LAYOUT_MODE_MAX: 1,
1850
1999
  OT_MEASURE_UNDEFINED: 0,
1851
2000
  OT_MEASURE_EXACTLY: 1,
1852
2001
  OT_MEASURE_AT_MOST: 2,
1853
2002
  OT_LAYOUT_PUBLIC: 0,
1854
2003
  OT_LAYOUT_YOGA: 1,
1855
2004
  OT_LAYOUT_PAINT: 2,
2005
+ OT_LAYOUT_CONTENT: 3,
1856
2006
  OT_BORDER_NONE: 0,
1857
2007
  OT_BORDER_LEFT: 1,
1858
2008
  OT_BORDER_BOTTOM: 2,
@@ -1868,9 +2018,41 @@ var nativeConstants = {
1868
2018
  OT_COLOR_DEFAULT: 2,
1869
2019
  OT_COLOR_CHANNEL_MASK: 255,
1870
2020
  OT_COLOR_META_SHIFT: 8,
2021
+ OT_COLOR_ANSI_0: 0,
2022
+ OT_COLOR_ANSI_1: 8388608,
2023
+ OT_COLOR_ANSI_2: 32768,
2024
+ OT_COLOR_ANSI_3: 8421376,
2025
+ OT_COLOR_ANSI_4: 128,
2026
+ OT_COLOR_ANSI_5: 8388736,
2027
+ OT_COLOR_ANSI_6: 32896,
2028
+ OT_COLOR_ANSI_7: 12632256,
2029
+ OT_COLOR_ANSI_8: 8421504,
2030
+ OT_COLOR_ANSI_9: 16711680,
2031
+ OT_COLOR_ANSI_10: 65280,
2032
+ OT_COLOR_ANSI_11: 16776960,
2033
+ OT_COLOR_ANSI_12: 255,
2034
+ OT_COLOR_ANSI_13: 16711935,
2035
+ OT_COLOR_ANSI_14: 65535,
2036
+ OT_COLOR_ANSI_15: 16777215,
2037
+ OT_COLOR_CUBE_BASE: 55,
2038
+ OT_COLOR_CUBE_STEP: 40,
2039
+ OT_COLOR_GRAY_BASE: 8,
2040
+ OT_COLOR_GRAY_STEP: 10,
2041
+ OT_ATTR_BOLD: 1,
2042
+ OT_ATTR_DIM: 2,
2043
+ OT_ATTR_ITALIC: 4,
2044
+ OT_ATTR_UNDERLINE: 8,
2045
+ OT_ATTR_BLINK: 16,
2046
+ OT_ATTR_INVERSE: 32,
2047
+ OT_ATTR_HIDDEN: 64,
2048
+ OT_ATTR_STRIKETHROUGH: 128,
2049
+ OT_ATTR_BASE_MASK: 255,
2050
+ OT_ATTR_LINK_SHIFT: 8,
2051
+ OT_ATTR_LINK_MASK: 16777215,
1871
2052
  OT_SCENE_TEXT_SELECTION_RESET: 0,
1872
2053
  OT_SCENE_TEXT_SELECTION_SET: 1,
1873
2054
  OT_SCENE_TEXT_SELECTION_UPDATE: 2,
2055
+ OT_SCENE_TEXT_SELECTION_COLORS: 3,
1874
2056
  OT_SCENE_TEXT_SELECTION_CELL: 0,
1875
2057
  OT_SCENE_TEXT_SELECTION_WORD: 1,
1876
2058
  OT_SCENE_TEXT_SELECTION_LINE: 2,
@@ -1887,6 +2069,10 @@ var nativeConstants = {
1887
2069
  OT_SCENE_FULL_PATH_UNRETAINED: 16,
1888
2070
  OT_SCENE_FULL_PATH_OPTIONS: 32,
1889
2071
  OT_SCENE_FULL_PATH_NON_LOCAL: 64,
2072
+ OT_CURSOR_STYLE_BLOCK: 0,
2073
+ OT_CURSOR_STYLE_LINE: 1,
2074
+ OT_CURSOR_STYLE_UNDERLINE: 2,
2075
+ OT_CURSOR_STYLE_DEFAULT: 3,
1890
2076
  OT_SCENE_HOOK_UPDATE: 1,
1891
2077
  OT_SCENE_HOOK_RESIZE: 2,
1892
2078
  OT_SCENE_HOOK_LAYOUT_CHANGED: 4,
@@ -1942,6 +2128,7 @@ var nativeConstants = {
1942
2128
  OT_SCENE_SCROLL_ALIGN_NEAREST: 0,
1943
2129
  OT_SCENE_SCROLL_ALIGN_START: 1,
1944
2130
  OT_SCENE_SCROLL_ALIGN_END: 2,
2131
+ OT_SCENE_SCROLL_PADDING_MAX: 65535,
1945
2132
  OT_SCENE_SCROLL_CHANGED_OFFSET_X: 1,
1946
2133
  OT_SCENE_SCROLL_CHANGED_OFFSET_Y: 2,
1947
2134
  OT_SCENE_SCROLL_CHANGED_CONTENT: 4,
@@ -1963,6 +2150,7 @@ var nativeConstants = {
1963
2150
  OT_RENDER_PENDING: 1,
1964
2151
  OT_RENDER_SKIPPED: 2,
1965
2152
  OT_RENDER_FAILED: 3,
2153
+ OT_SPLIT_SNAPSHOTS_MAX: 64,
1966
2154
  OT_SESSION_BUFFER_CURRENT: 0,
1967
2155
  OT_SESSION_BUFFER_NEXT: 1,
1968
2156
  OT_WIDTH_METHOD_WCWIDTH: 0,
@@ -1970,10 +2158,38 @@ var nativeConstants = {
1970
2158
  OT_WIDTH_METHOD_NO_ZWJ: 2,
1971
2159
  OT_WIDTH_METHOD_UNICODE_WIDE: 3,
1972
2160
  OT_BUFFER_RESPECT_ALPHA: 1,
2161
+ OT_EMBEDDED_TERMINAL_CURSOR_BAR: 0,
2162
+ OT_EMBEDDED_TERMINAL_CURSOR_BLOCK: 1,
2163
+ OT_EMBEDDED_TERMINAL_CURSOR_UNDERLINE: 2,
2164
+ OT_EMBEDDED_TERMINAL_CURSOR_BLOCK_HOLLOW: 3,
2165
+ OT_EMBEDDED_TERMINAL_MOD_SHIFT: 1,
2166
+ OT_EMBEDDED_TERMINAL_MOD_CTRL: 2,
2167
+ OT_EMBEDDED_TERMINAL_MOD_ALT: 4,
2168
+ OT_EMBEDDED_TERMINAL_MOD_SUPER: 8,
2169
+ OT_EMBEDDED_TERMINAL_MOD_CAPS_LOCK: 16,
2170
+ OT_EMBEDDED_TERMINAL_MOD_NUM_LOCK: 32,
2171
+ OT_EMBEDDED_TERMINAL_KEY_RELEASE: 0,
2172
+ OT_EMBEDDED_TERMINAL_KEY_PRESS: 1,
2173
+ OT_EMBEDDED_TERMINAL_KEY_REPEAT: 2,
2174
+ OT_EMBEDDED_TERMINAL_MOUSE_PRESS: 0,
2175
+ OT_EMBEDDED_TERMINAL_MOUSE_RELEASE: 1,
2176
+ OT_EMBEDDED_TERMINAL_MOUSE_MOTION: 2,
2177
+ OT_EMBEDDED_TERMINAL_BUTTON_NONE: -1,
2178
+ OT_EMBEDDED_TERMINAL_BUTTON_UNKNOWN: 0,
2179
+ OT_EMBEDDED_TERMINAL_BUTTON_LEFT: 1,
2180
+ OT_EMBEDDED_TERMINAL_BUTTON_RIGHT: 2,
2181
+ OT_EMBEDDED_TERMINAL_BUTTON_MIDDLE: 3,
2182
+ OT_EMBEDDED_TERMINAL_BUTTON_FOUR: 4,
2183
+ OT_EMBEDDED_TERMINAL_BUTTON_FIVE: 5,
2184
+ OT_EMBEDDED_TERMINAL_BUTTON_SIX: 6,
2185
+ OT_EMBEDDED_TERMINAL_BUTTON_SEVEN: 7,
2186
+ OT_EMBEDDED_TERMINAL_INPUT_BYTES_MAX: 1048576,
1973
2187
  OT_EMBEDDED_TERMINAL_INVALIDATE: 0,
1974
2188
  OT_EMBEDDED_TERMINAL_SCROLL: 1,
1975
2189
  OT_EMBEDDED_TERMINAL_CLEAR_SELECTION: 2,
1976
2190
  OT_EMBEDDED_TERMINAL_SET_TRANSPARENT_BACKGROUND: 3,
2191
+ OT_EMBEDDED_TERMINAL_RESPONSE_BYTES_MAX: 1048576,
2192
+ OT_EDIT_BUFFER_FOLLOW_SESSION_WIDTH: 1,
1977
2193
  OT_EDIT_CURSOR_CHANGED: 1,
1978
2194
  OT_EDIT_CONTENT_CHANGED: 2,
1979
2195
  OT_EDIT_HISTORY_CURSOR_CHANGED: 4,
@@ -2028,6 +2244,9 @@ var nativeConstants = {
2028
2244
  OT_EDIT_CLEAR: 10,
2029
2245
  OT_EDIT_CLEAR_HISTORY: 11,
2030
2246
  OT_EDIT_DEBUG_ROPE: 12,
2247
+ OT_EDIT_CURSOR_OFFSET_ATOMIC: 13,
2248
+ OT_EDIT_KEEP_OUTSIDE: 14,
2249
+ OT_EDIT_ATOMIC: 1,
2031
2250
  OT_EDIT_POSITION_CURSOR: 0,
2032
2251
  OT_EDIT_POSITION_NEXT_WORD: 1,
2033
2252
  OT_EDIT_POSITION_PREV_WORD: 2,
@@ -2037,15 +2256,60 @@ var nativeConstants = {
2037
2256
  OT_EDIT_POSITION_LINE_START: 6,
2038
2257
  OT_EDIT_POSITION_END: 7,
2039
2258
  OT_EDIT_POSITION_PREV_CHAR: 8,
2259
+ OT_EDIT_BYTE_TO_CELL: 0,
2260
+ OT_EDIT_CELL_TO_BYTE: 1,
2261
+ OT_EDIT_UTF16_TO_CELL: 2,
2262
+ OT_EDIT_CELL_TO_UTF16: 3,
2040
2263
  OT_EDITOR_STYLE_FOREGROUND: 1,
2041
2264
  OT_EDITOR_STYLE_BACKGROUND: 2,
2042
2265
  OT_EDITOR_STYLE_ATTRIBUTES: 4,
2266
+ OT_EDITOR_STYLE_ATTRIBUTE_MASK: 8,
2043
2267
  OT_EDIT_HIGHLIGHT_ADD_LINE: 0,
2044
2268
  OT_EDIT_HIGHLIGHT_ADD_RANGE: 1,
2045
2269
  OT_EDIT_HIGHLIGHT_REMOVE_REF: 2,
2046
2270
  OT_EDIT_HIGHLIGHT_CLEAR_LINE: 3,
2047
2271
  OT_EDIT_HIGHLIGHT_CLEAR_ALL: 4,
2048
2272
  OT_STYLE_RUN_FLAG: 2147483648,
2273
+ OT_GROUP_SET_NAME_COUNT_MAX: 16,
2274
+ OT_GROUP_SET_NAME_BYTE_COUNT_MAX: 64,
2275
+ OT_EDIT_MARK_ADD: 0,
2276
+ OT_EDIT_MARK_REMOVE: 1,
2277
+ OT_EDIT_MARK_CLEAR: 2,
2278
+ OT_EDIT_MARK_ATOMIC: 1,
2279
+ OT_EDIT_MARK_STYLE_VALUE: 2,
2280
+ OT_EDIT_MARK_ANY_KIND: 4294967295,
2281
+ OT_MD_CONCEAL: 1,
2282
+ OT_MD_HYPERLINKS: 2,
2283
+ OT_MD_MATH: 4,
2284
+ OT_MD_HOOK: 8,
2285
+ OT_MD_HOOK_FILTER_BYTE_COUNT_MAX: 256,
2286
+ OT_MD_PARAGRAPH: 0,
2287
+ OT_MD_HEADING: 1,
2288
+ OT_MD_CODE: 2,
2289
+ OT_MD_HTML: 3,
2290
+ OT_MD_RULE: 4,
2291
+ OT_MD_TABLE: 5,
2292
+ OT_MD_TABLE_ROW: 6,
2293
+ OT_MD_TABLE_CELL: 7,
2294
+ OT_MD_QUOTE: 8,
2295
+ OT_MD_LIST: 9,
2296
+ OT_MD_ITEM: 10,
2297
+ OT_MD_BLOCK_CLOSED: 1,
2298
+ OT_MD_BLOCK_SETEXT: 2,
2299
+ OT_MD_BLOCK_ORDERED: 4,
2300
+ OT_MD_BLOCK_TIGHT: 8,
2301
+ OT_MD_BLOCK_TASK: 16,
2302
+ OT_MD_BLOCK_CHECKED: 32,
2303
+ OT_MD_BLOCK_BLANK_AFTER: 64,
2304
+ OT_MD_BLOCK_FENCED: 128,
2305
+ OT_MD_BLOCK_HOOKED: 256,
2306
+ OT_MD_BLOCK_MATH: 512,
2307
+ OT_MD_BLOCK_HEADER: 1024,
2308
+ OT_MD_BLOCK_OPEN: 2048,
2309
+ OT_MD_BLOCK_ALIGN_LEFT: 4096,
2310
+ OT_MD_BLOCK_ALIGN_RIGHT: 8192,
2311
+ OT_MD_SPAN_CODE: 1,
2312
+ OT_MD_SPAN_MATH: 2,
2049
2313
  OT_EDITOR_MOVE_UP: 0,
2050
2314
  OT_EDITOR_MOVE_DOWN: 1,
2051
2315
  OT_EDITOR_GOTO_LINE_END: 2,
@@ -2089,6 +2353,7 @@ var nativeConstants = {
2089
2353
  OT_IMAGE_PROTOCOL_BLOCKS: 3,
2090
2354
  OT_IMAGE_DRAW_SOURCE_WIDTH: 1,
2091
2355
  OT_IMAGE_DRAW_SOURCE_HEIGHT: 2,
2356
+ OT_IMAGE_ENCODED_BYTES_MAX: 67108864,
2092
2357
  OT_IMAGE_FORMAT_UNKNOWN: 0,
2093
2358
  OT_IMAGE_FORMAT_PNG: 1,
2094
2359
  OT_IMAGE_FORMAT_RGBA: 2,
@@ -2158,6 +2423,10 @@ var nativeConstants = {
2158
2423
  OT_BUFFER_STACK_CLEAR_OPACITY: 6,
2159
2424
  OT_BUFFER_GRID_INNER: 1,
2160
2425
  OT_BUFFER_GRID_OUTER: 2,
2426
+ OT_CELL_CHAR_KIND_MASK: 3221225472,
2427
+ OT_CELL_CHAR_IMAGE: 1073741824,
2428
+ OT_CELL_CHAR_GRAPHEME: 2147483648,
2429
+ OT_CELL_CHAR_CONTINUATION: 3221225472,
2161
2430
  OT_SESSION_CONTROL_PACKET_BYTES: 4096,
2162
2431
  OT_TERMINAL_ALTERNATE_SCREEN: 1,
2163
2432
  OT_TERMINAL_MOUSE: 2,
@@ -2167,6 +2436,12 @@ var nativeConstants = {
2167
2436
  OT_TERMINAL_SYNC_ALWAYS: 32,
2168
2437
  OT_TERMINAL_SYNC_NEVER: 64,
2169
2438
  OT_TERMINAL_HOST_MULTIPLEXER: 128,
2439
+ OT_KITTY_KEYBOARD_DISAMBIGUATE: 1,
2440
+ OT_KITTY_KEYBOARD_EVENT_TYPES: 2,
2441
+ OT_KITTY_KEYBOARD_ALTERNATE_KEYS: 4,
2442
+ OT_KITTY_KEYBOARD_ALL_KEYS_AS_ESCAPES: 8,
2443
+ OT_KITTY_KEYBOARD_REPORT_TEXT: 16,
2444
+ OT_KITTY_KEYBOARD_ALL: 31,
2170
2445
  OT_CONTROL_CAPABILITY_RESPONSE: 1,
2171
2446
  OT_CONTROL_TITLE: 2,
2172
2447
  OT_CONTROL_MOUSE: 3,
@@ -2178,6 +2453,7 @@ var nativeConstants = {
2178
2453
  OT_CONTROL_RESET_BACKGROUND: 9,
2179
2454
  OT_CONTROL_PALETTE_QUERY: 10,
2180
2455
  OT_CONTROL_PROGRAM_STATUS: 11,
2456
+ OT_CONTROL_END_REPLY_SENTINEL: 12,
2181
2457
  OT_CURSOR_POSITION: 1,
2182
2458
  OT_CURSOR_STYLE: 2,
2183
2459
  OT_CURSOR_BLINKING: 4,
@@ -2338,11 +2614,13 @@ var nativeConstants = {
2338
2614
  OT_INPUT_EXPECT_KITTY_KEYBOARD: 2,
2339
2615
  OT_INPUT_EXPECT_CURSOR_POSITION: 4,
2340
2616
  OT_INPUT_EXPECT_SENTINEL: 8,
2617
+ OT_INPUT_EXPECT_ESCAPE_PREFIX: 16,
2341
2618
  OT_INPUT_EVENTS_MIN: 4,
2342
2619
  OT_INPUT_PAYLOAD_BYTES_MIN: 4384,
2343
2620
  OT_INPUT_TIMEOUT_NS: 20000000,
2344
2621
  OT_DIAGNOSTIC_MESSAGE_BYTES: 4096,
2345
2622
  OT_DIAGNOSTIC_TRUNCATED: 1,
2623
+ OT_DIAGNOSTIC_QUEUE_MAX: 64,
2346
2624
  OT_SCENE_RECORD_BYTES_MAX: 67108864,
2347
2625
  OT_SCENE_RECORD_PHASE_BEFORE: 0,
2348
2626
  OT_SCENE_RECORD_PHASE_SELF: 1,
@@ -2360,6 +2638,7 @@ var nativeConstants = {
2360
2638
  OT_SCENE_RECORD_SCENE_BODY: 10,
2361
2639
  OT_SCENE_RECORD_IMAGE: 11,
2362
2640
  OT_SCENE_RECORD_UNICODE: 12,
2641
+ OT_SCENE_RECORD_CELLS: 13,
2363
2642
  OT_SCENE_RECORD_GRAYSCALE_FOREGROUND: 1,
2364
2643
  OT_SCENE_RECORD_GRAYSCALE_BACKGROUND: 2,
2365
2644
  OT_SCENE_RECORD_GRAYSCALE_SUPERSAMPLED: 4,
@@ -3553,19 +3832,20 @@ function setGlobalWorkerMessageHandler(handler) {
3553
3832
  import { existsSync as existsSync2, writeFileSync } from "fs";
3554
3833
 
3555
3834
  // src/types.ts
3835
+ var attributeBits = nativeConstants;
3556
3836
  var TextAttributes2 = {
3557
3837
  NONE: 0,
3558
- BOLD: 1 << 0,
3559
- DIM: 1 << 1,
3560
- ITALIC: 1 << 2,
3561
- UNDERLINE: 1 << 3,
3562
- BLINK: 1 << 4,
3563
- INVERSE: 1 << 5,
3564
- HIDDEN: 1 << 6,
3565
- STRIKETHROUGH: 1 << 7
3838
+ BOLD: attributeBits.OT_ATTR_BOLD,
3839
+ DIM: attributeBits.OT_ATTR_DIM,
3840
+ ITALIC: attributeBits.OT_ATTR_ITALIC,
3841
+ UNDERLINE: attributeBits.OT_ATTR_UNDERLINE,
3842
+ BLINK: attributeBits.OT_ATTR_BLINK,
3843
+ INVERSE: attributeBits.OT_ATTR_INVERSE,
3844
+ HIDDEN: attributeBits.OT_ATTR_HIDDEN,
3845
+ STRIKETHROUGH: attributeBits.OT_ATTR_STRIKETHROUGH
3566
3846
  };
3567
- var ATTRIBUTE_BASE_BITS2 = 8;
3568
- var ATTRIBUTE_BASE_MASK2 = 255;
3847
+ var ATTRIBUTE_BASE_BITS2 = nativeConstants.OT_ATTR_LINK_SHIFT;
3848
+ var ATTRIBUTE_BASE_MASK2 = nativeConstants.OT_ATTR_BASE_MASK;
3569
3849
  function getBaseAttributes2(attr) {
3570
3850
  return attr & ATTRIBUTE_BASE_MASK2;
3571
3851
  }
@@ -3586,29 +3866,15 @@ var TargetChannel2;
3586
3866
  // src/lib/RGBA.ts
3587
3867
  var DEFAULT_FOREGROUND_RGB2 = [255, 255, 255];
3588
3868
  var DEFAULT_BACKGROUND_RGB2 = [0, 0, 0];
3589
- var INTENT_RGB = 0;
3590
- var INTENT_INDEXED = 1;
3591
- var INTENT_DEFAULT = 2;
3869
+ var INTENT_RGB = nativeConstants.OT_COLOR_RGB;
3870
+ var INTENT_INDEXED = nativeConstants.OT_COLOR_INDEXED;
3871
+ var INTENT_DEFAULT = nativeConstants.OT_COLOR_DEFAULT;
3592
3872
  var ZERO_RGBA_BUFFER = new Uint16Array(4);
3593
- var ANSI16_RGB = [
3594
- [0, 0, 0],
3595
- [128, 0, 0],
3596
- [0, 128, 0],
3597
- [128, 128, 0],
3598
- [0, 0, 128],
3599
- [128, 0, 128],
3600
- [0, 128, 128],
3601
- [192, 192, 192],
3602
- [128, 128, 128],
3603
- [255, 0, 0],
3604
- [0, 255, 0],
3605
- [255, 255, 0],
3606
- [0, 0, 255],
3607
- [255, 0, 255],
3608
- [0, 255, 255],
3609
- [255, 255, 255]
3610
- ];
3611
- var ANSI_256_CUBE_LEVELS = [0, 95, 135, 175, 215, 255];
3873
+ var ANSI16_RGB = Array.from({ length: 16 }, (_, slot) => {
3874
+ const rgb = nativeConstants[`OT_COLOR_ANSI_${slot}`];
3875
+ return [rgb >>> 16, rgb >>> 8 & 255, rgb & 255];
3876
+ });
3877
+ 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);
3612
3878
  function packMeta(intent, slot = 0) {
3613
3879
  return (slot & 255 | (intent & 255) << 8) >>> 0;
3614
3880
  }
@@ -3648,7 +3914,7 @@ function ansi256IndexToRgb2(index) {
3648
3914
  const b = cubeIndex % 6;
3649
3915
  return [ANSI_256_CUBE_LEVELS[r], ANSI_256_CUBE_LEVELS[g], ANSI_256_CUBE_LEVELS[b]];
3650
3916
  }
3651
- const value = 8 + (normalizedIndex - 232) * 10;
3917
+ const value = nativeConstants.OT_COLOR_GRAY_BASE + (normalizedIndex - 232) * nativeConstants.OT_COLOR_GRAY_STEP;
3652
3918
  return [value, value, value];
3653
3919
  }
3654
3920
 
@@ -3895,9 +4161,9 @@ function createTextAttributes2({
3895
4161
  attributes |= TextAttributes2.STRIKETHROUGH;
3896
4162
  return attributes;
3897
4163
  }
3898
- var ATTRIBUTE_BASE_MASK = 255;
3899
- var LINK_ID_SHIFT = 8;
3900
- var LINK_ID_PAYLOAD_MASK = 16777215;
4164
+ var ATTRIBUTE_BASE_MASK = nativeConstants.OT_ATTR_BASE_MASK;
4165
+ var LINK_ID_SHIFT = nativeConstants.OT_ATTR_LINK_SHIFT;
4166
+ var LINK_ID_PAYLOAD_MASK = nativeConstants.OT_ATTR_LINK_MASK;
3901
4167
  function attributesWithLink2(baseAttributes, linkId) {
3902
4168
  const base = baseAttributes & ATTRIBUTE_BASE_MASK;
3903
4169
  const linkBits = (linkId & LINK_ID_PAYLOAD_MASK) << LINK_ID_SHIFT;
@@ -4062,7 +4328,8 @@ var YogaEnumKind = {
4062
4328
  FlexWrap: nativeConstants.OT_STYLE_ENUM_FLEX_WRAP,
4063
4329
  Overflow: nativeConstants.OT_STYLE_ENUM_OVERFLOW,
4064
4330
  Display: nativeConstants.OT_STYLE_ENUM_DISPLAY,
4065
- BoxSizing: nativeConstants.OT_STYLE_ENUM_BOX_SIZING
4331
+ BoxSizing: nativeConstants.OT_STYLE_ENUM_BOX_SIZING,
4332
+ LayoutMode: nativeConstants.OT_STYLE_ENUM_LAYOUT_MODE
4066
4333
  };
4067
4334
  var YogaFloatKind = {
4068
4335
  Flex: nativeConstants.OT_STYLE_FLOAT_FLEX,
@@ -5828,6 +6095,14 @@ function allocFFIStruct(structDefinition) {
5828
6095
  const storage = allocStruct(structDefinition);
5829
6096
  return { ...storage, ffiView: new Uint8Array(storage.buffer) };
5830
6097
  }
6098
+ function editBufferOptions(options, kind) {
6099
+ const layout = nativeLayouts.ot_edit_buffer_options;
6100
+ const record = createContextRecord(layout);
6101
+ record[layout.fields.width_method.offset / 4] = widthMethodId(options.widthMethod ?? "unicode", kind);
6102
+ if (options.followSessionWidth)
6103
+ record[layout.fields.flags.offset / 4] = nativeConstants.OT_EDIT_BUFFER_FOLLOW_SESSION_WIDTH;
6104
+ return record;
6105
+ }
5831
6106
  var NativeTextViewCommand2;
5832
6107
  ((NativeTextViewCommand) => {
5833
6108
  NativeTextViewCommand[NativeTextViewCommand["WrapWidth"] = 0] = "WrapWidth";
@@ -5852,7 +6127,10 @@ var NativeEditCommand2;
5852
6127
  NativeEditCommand[NativeEditCommand["Clear"] = 10] = "Clear";
5853
6128
  NativeEditCommand[NativeEditCommand["ClearHistory"] = 11] = "ClearHistory";
5854
6129
  NativeEditCommand[NativeEditCommand["DebugRope"] = 12] = "DebugRope";
6130
+ NativeEditCommand[NativeEditCommand["CursorOffsetAtomic"] = 13] = "CursorOffsetAtomic";
6131
+ NativeEditCommand[NativeEditCommand["KeepOutside"] = 14] = "KeepOutside";
5855
6132
  })(NativeEditCommand2 ||= {});
6133
+ var NativeEditAtomic = 1;
5856
6134
  var NativeEditPositionQuery2;
5857
6135
  ((NativeEditPositionQuery) => {
5858
6136
  NativeEditPositionQuery[NativeEditPositionQuery["Cursor"] = 0] = "Cursor";
@@ -6214,8 +6492,15 @@ registerEnvVar2({
6214
6492
  type: "string",
6215
6493
  required: false
6216
6494
  });
6217
- var CURSOR_STYLE_TO_ID = { block: 0, line: 1, underline: 2, default: 3 };
6218
- var CURSOR_ID_TO_STYLE = ["block", "line", "underline", "default"];
6495
+ var CURSOR_STYLE_TO_ID = {
6496
+ block: nativeConstants.OT_CURSOR_STYLE_BLOCK,
6497
+ line: nativeConstants.OT_CURSOR_STYLE_LINE,
6498
+ underline: nativeConstants.OT_CURSOR_STYLE_UNDERLINE,
6499
+ default: nativeConstants.OT_CURSOR_STYLE_DEFAULT
6500
+ };
6501
+ var CURSOR_ID_TO_STYLE = [];
6502
+ for (const [style, id] of Object.entries(CURSOR_STYLE_TO_ID))
6503
+ CURSOR_ID_TO_STYLE[id] = style;
6219
6504
  var PROGRAM_STATE_TO_ID = {
6220
6505
  idle: nativeConstants.OT_PROGRAM_STATE_IDLE,
6221
6506
  working: nativeConstants.OT_PROGRAM_STATE_WORKING,
@@ -6556,7 +6841,7 @@ function encodeDrawColors(colors, fields, options, base = 0) {
6556
6841
  contextBufferColor(background, colors, (base + fields.background.offset) / 2);
6557
6842
  return background !== undefined;
6558
6843
  }
6559
- var DIAGNOSTIC_QUEUE_MAX = 64;
6844
+ var DIAGNOSTIC_QUEUE_MAX = nativeConstants.OT_DIAGNOSTIC_QUEUE_MAX;
6560
6845
  var DIAGNOSTIC_BATCH = 8;
6561
6846
  function createDiagnosticDrainRecord() {
6562
6847
  const layout = nativeLayouts.ot_diagnostic_drain;
@@ -6737,7 +7022,28 @@ function encodeImageDrawOptions(options, words, signed, base) {
6737
7022
  function viewOrNull(value) {
6738
7023
  return value.byteLength === 0 ? null : value;
6739
7024
  }
6740
- var EMBEDDED_TERMINAL_IO_BYTES_MAX = 1024 * 1024;
7025
+ var EMBEDDED_TERMINAL_IO_BYTES_MAX = nativeConstants.OT_EMBEDDED_TERMINAL_INPUT_BYTES_MAX;
7026
+ var EMBEDDED_TERMINAL_KEY_ACTIONS = new Map([
7027
+ ["release", nativeConstants.OT_EMBEDDED_TERMINAL_KEY_RELEASE],
7028
+ ["press", nativeConstants.OT_EMBEDDED_TERMINAL_KEY_PRESS],
7029
+ ["repeat", nativeConstants.OT_EMBEDDED_TERMINAL_KEY_REPEAT]
7030
+ ]);
7031
+ var EMBEDDED_TERMINAL_MOUSE_ACTIONS = new Map([
7032
+ ["press", nativeConstants.OT_EMBEDDED_TERMINAL_MOUSE_PRESS],
7033
+ ["release", nativeConstants.OT_EMBEDDED_TERMINAL_MOUSE_RELEASE],
7034
+ ["motion", nativeConstants.OT_EMBEDDED_TERMINAL_MOUSE_MOTION]
7035
+ ]);
7036
+ var EMBEDDED_TERMINAL_BUTTONS = new Map([
7037
+ [undefined, nativeConstants.OT_EMBEDDED_TERMINAL_BUTTON_NONE],
7038
+ ["unknown", nativeConstants.OT_EMBEDDED_TERMINAL_BUTTON_UNKNOWN],
7039
+ ["left", nativeConstants.OT_EMBEDDED_TERMINAL_BUTTON_LEFT],
7040
+ ["right", nativeConstants.OT_EMBEDDED_TERMINAL_BUTTON_RIGHT],
7041
+ ["middle", nativeConstants.OT_EMBEDDED_TERMINAL_BUTTON_MIDDLE],
7042
+ ["four", nativeConstants.OT_EMBEDDED_TERMINAL_BUTTON_FOUR],
7043
+ ["five", nativeConstants.OT_EMBEDDED_TERMINAL_BUTTON_FIVE],
7044
+ ["six", nativeConstants.OT_EMBEDDED_TERMINAL_BUTTON_SIX],
7045
+ ["seven", nativeConstants.OT_EMBEDDED_TERMINAL_BUTTON_SEVEN]
7046
+ ]);
6741
7047
  function embeddedTerminalDimension(value, name) {
6742
7048
  if (!Number.isInteger(value) || value < 1 || value > 65535) {
6743
7049
  throw new RangeError(`Embedded terminal ${name} must be an integer between 1 and 65535`);
@@ -6757,7 +7063,9 @@ function contextBufferColor(value, color = new Uint16Array(4), offset = 0) {
6757
7063
  color[offset + index] = channel;
6758
7064
  }
6759
7065
  const intent = color[offset + 1] >>> 8;
6760
- if (color[offset + 2] > 255 || color[offset + 3] > 255 || intent > 2 || intent !== 1 && color[offset] > 255) {
7066
+ const indexed = intent === nativeConstants.OT_COLOR_INDEXED;
7067
+ const known = indexed || intent === nativeConstants.OT_COLOR_RGB || intent === nativeConstants.OT_COLOR_DEFAULT;
7068
+ if (color[offset + 2] > 255 || color[offset + 3] > 255 || !known || !indexed && color[offset] > 255) {
6761
7069
  throw new RangeError("Invalid terminal color intent");
6762
7070
  }
6763
7071
  return color;
@@ -7598,11 +7906,14 @@ function recordedPixels(data, length) {
7598
7906
  throw new RangeError("Pixel byte count exceeds the supplied view");
7599
7907
  return input.subarray(0, count);
7600
7908
  }
7909
+ function isAttributeByte(value) {
7910
+ return Number.isInteger(value) && value >= 0 && value <= 255;
7911
+ }
7601
7912
  function encodeEditorStyle(style) {
7602
7913
  const layout = nativeLayouts.ot_editor_style;
7603
7914
  const record = new Uint32Array(layout.size / 4);
7604
7915
  const colors = new Uint16Array(record.buffer);
7605
- const { fg, bg, attributes } = style;
7916
+ const { fg, bg, attributes, suppliedAttributes } = style;
7606
7917
  record[layout.fields.struct_size.offset / 4] = layout.size;
7607
7918
  record[layout.fields.abi_version.offset / 4] = nativeConstants.OT_CONTEXT_ABI_VERSION;
7608
7919
  if (fg != null) {
@@ -7617,6 +7928,13 @@ function encodeEditorStyle(style) {
7617
7928
  record[layout.fields.flags.offset / 4] |= 4 /* Attributes */;
7618
7929
  record[layout.fields.attributes.offset / 4] = toSafeFFIU32Length(attributes, "Editor style attributes");
7619
7930
  }
7931
+ if (suppliedAttributes != null) {
7932
+ if (!isAttributeByte(attributes) || !isAttributeByte(suppliedAttributes)) {
7933
+ throw new RangeError("Masked editor style attributes must be integers from 0 to 255");
7934
+ }
7935
+ record[layout.fields.flags.offset / 4] |= nativeConstants.OT_EDITOR_STYLE_ATTRIBUTE_MASK;
7936
+ record[layout.fields.attributes.offset / 4] |= suppliedAttributes << 16;
7937
+ }
7620
7938
  return record;
7621
7939
  }
7622
7940
  function drawTextString(text) {
@@ -7631,6 +7949,7 @@ function drawRecordBottomTitle(options) {
7631
7949
  return options.operation === "box" && options.bottomTitle ? drawTextString(options.bottomTitle) : "";
7632
7950
  }
7633
7951
  var drawTextEncoder = new TextEncoder;
7952
+ var markdownDecoder = new TextDecoder("utf-8", { ignoreBOM: true });
7634
7953
  function encodeDrawText(text, output) {
7635
7954
  if (text === "")
7636
7955
  return 0;
@@ -7729,9 +8048,9 @@ function widthMethodId(widthMethod, label) {
7729
8048
  return id;
7730
8049
  }
7731
8050
  function widthMethodFromCode(code) {
7732
- if (code === 0)
8051
+ if (code === nativeConstants.OT_WIDTH_METHOD_WCWIDTH)
7733
8052
  return "wcwidth";
7734
- return code === 3 ? "unicode-wide" : "unicode";
8053
+ return code === nativeConstants.OT_WIDTH_METHOD_UNICODE_WIDE ? "unicode-wide" : "unicode";
7735
8054
  }
7736
8055
  var yogaSymbols = {
7737
8056
  yogaConfigCreateChecked: { args: ["buffer"], returns: "u32" },
@@ -8201,6 +8520,7 @@ class FFIRenderLib2 {
8201
8520
  sceneFlushApplied = new Uint32Array(1);
8202
8521
  editorSelectionRecord = createEditorSelectionRecord();
8203
8522
  editorViewInfoRecord = createContextRecord(nativeLayouts.ot_editor_view_info);
8523
+ markRecords = new Uint32Array(16 * nativeLayouts.ot_edit_mark.size / 4);
8204
8524
  videoStateRecord = new Uint8Array(nativeLayouts.ot_video_state.size);
8205
8525
  videoStateView = new DataView(this.videoStateRecord.buffer);
8206
8526
  selectionResetRecord = encodeEditorSelection({ operation: 2 /* Reset */ });
@@ -8250,6 +8570,7 @@ class FFIRenderLib2 {
8250
8570
  encoder = new TextEncoder;
8251
8571
  emptyBytes = new Uint8Array(0);
8252
8572
  decoder = new TextDecoder;
8573
+ textDecoder = new TextDecoder("utf-8", { ignoreBOM: true });
8253
8574
  logCallbackWrapper = null;
8254
8575
  diagnosticDrain;
8255
8576
  nativeSpanFeedCallbackWrapper = null;
@@ -8309,11 +8630,8 @@ class FFIRenderLib2 {
8309
8630
  return count[0] === 0 ? "" : this.decoder.decode(bytes.subarray(0, count[0]));
8310
8631
  }
8311
8632
  createContextTextBuffer(context, options = {}) {
8312
- const layout = nativeLayouts.ot_edit_buffer_options;
8313
8633
  this.getYogaHost().assertMutable();
8314
- const widthMethod = widthMethodId(options.widthMethod ?? "unicode", "text");
8315
- const record = createContextRecord(layout);
8316
- record[layout.fields.width_method.offset / 4] = widthMethod;
8634
+ const record = editBufferOptions(options, "text");
8317
8635
  const output = new Uint32Array(handleWords);
8318
8636
  const pointer = this.nativeContextPointer(context, "ot_text_buffer_create");
8319
8637
  nativeResult("ot_text_buffer_create", this.opentui.symbols.ot_text_buffer_create(pointer, record, output));
@@ -8364,8 +8682,9 @@ class FFIRenderLib2 {
8364
8682
  const handle = encodeContextHandle(context, session);
8365
8683
  const ticket = frame ? encodeSceneFrameRequest(context, frame) : null;
8366
8684
  const count = toSafeFFIU32Length(snapshots.length, "Split snapshot count");
8367
- if (count > 64)
8368
- throw new RangeError("At most 64 split snapshots can be submitted together");
8685
+ const max = nativeConstants.OT_SPLIT_SNAPSHOTS_MAX;
8686
+ if (count > max)
8687
+ throw new RangeError(`At most ${max} split snapshots can be submitted together`);
8369
8688
  const records = new BigUint64Array(count * (layout.size / 8));
8370
8689
  const fields = new Uint32Array(records.buffer);
8371
8690
  for (let index = 0;index < count; index++) {
@@ -8602,9 +8921,8 @@ class FFIRenderLib2 {
8602
8921
  const layout = nativeLayouts.ot_embedded_terminal_key;
8603
8922
  this.getYogaHost().assertMutable();
8604
8923
  const handle = encodeContextHandle(context, terminal);
8605
- const action = key.action ?? "press";
8606
- const actionCode = ["release", "press", "repeat"].indexOf(action);
8607
- if (actionCode < 0)
8924
+ const actionCode = EMBEDDED_TERMINAL_KEY_ACTIONS.get(key.action ?? "press");
8925
+ if (actionCode === undefined)
8608
8926
  throw new TypeError("Unknown embedded terminal key action");
8609
8927
  const record = createContextRecord(layout);
8610
8928
  record[layout.fields.action.offset / 4] = actionCode;
@@ -8623,10 +8941,9 @@ class FFIRenderLib2 {
8623
8941
  const layout = nativeLayouts.ot_embedded_terminal_mouse;
8624
8942
  this.getYogaHost().assertMutable();
8625
8943
  const handle = encodeContextHandle(context, terminal);
8626
- const action = ["press", "release", "motion"].indexOf(mouse.action);
8627
- const buttonName = mouse.button;
8628
- const button = buttonName === undefined ? -1 : ["unknown", "left", "right", "middle", "four", "five", "six", "seven"].indexOf(buttonName);
8629
- if (action < 0 || buttonName !== undefined && button < 0)
8944
+ const action = EMBEDDED_TERMINAL_MOUSE_ACTIONS.get(mouse.action);
8945
+ const button = EMBEDDED_TERMINAL_BUTTONS.get(mouse.button);
8946
+ if (action === undefined || button === undefined)
8630
8947
  throw new TypeError("Unknown embedded terminal mouse action or button");
8631
8948
  const record = createContextRecord(layout);
8632
8949
  record[layout.fields.action.offset / 4] = action;
@@ -8660,7 +8977,7 @@ class FFIRenderLib2 {
8660
8977
  contextEmbeddedTerminalDrainResponses(context, terminal) {
8661
8978
  this.getYogaHost().assertMutable();
8662
8979
  const handle = encodeContextHandle(context, terminal);
8663
- const output = this.embeddedTerminalResponses ??= new Uint8Array(EMBEDDED_TERMINAL_IO_BYTES_MAX);
8980
+ const output = this.embeddedTerminalResponses ??= new Uint8Array(nativeConstants.OT_EMBEDDED_TERMINAL_RESPONSE_BYTES_MAX);
8664
8981
  const count = new Uint32Array(1);
8665
8982
  const pointer = this.nativeContextPointer(context, "ot_embedded_terminal_drain_responses");
8666
8983
  let status = this.opentui.symbols.ot_embedded_terminal_drain_responses(pointer, handle, output, output.length, count);
@@ -8820,7 +9137,7 @@ class FFIRenderLib2 {
8820
9137
  if (count[0] !== bytes.length) {
8821
9138
  throw new NativeError2(operation, -5 /* InternalError */);
8822
9139
  }
8823
- return this.decoder.decode(bytes);
9140
+ return this.textDecoder.decode(bytes);
8824
9141
  }
8825
9142
  contextTextBufferGetText(context, text) {
8826
9143
  const handle = encodeContextHandle(context, text);
@@ -8851,6 +9168,14 @@ class FFIRenderLib2 {
8851
9168
  nativeResult("ot_text_buffer_set_tab_width", this.opentui.symbols.ot_text_buffer_set_tab_width(pointer, handle, value));
8852
9169
  });
8853
9170
  }
9171
+ contextTextBufferSetWidthMethod(context, text, widthMethod) {
9172
+ const handle = encodeContextHandle(context, text);
9173
+ const method = widthMethodId(widthMethod, "text");
9174
+ this.getYogaHost().runMutation(() => {
9175
+ const pointer = this.nativeContextPointer(context, "ot_text_buffer_set_width_method");
9176
+ nativeResult("ot_text_buffer_set_width_method", this.opentui.symbols.ot_text_buffer_set_width_method(pointer, handle, method));
9177
+ });
9178
+ }
8854
9179
  contextTextBufferHighlight(context, text, operation, argument = 0, highlight) {
8855
9180
  const handle = encodeContextHandle(context, text);
8856
9181
  const selector = toSafeFFIU32Length(operation, "Text highlight operation");
@@ -8861,6 +9186,23 @@ class FFIRenderLib2 {
8861
9186
  nativeResult("ot_text_buffer_highlight", this.opentui.symbols.ot_text_buffer_highlight(pointer, handle, selector, value, record));
8862
9187
  });
8863
9188
  }
9189
+ contextGroupSet(context, names) {
9190
+ const encoded = names.map((name) => this.encoder.encode(name));
9191
+ const ends = new Uint32Array(encoded.length);
9192
+ const bytes = new Uint8Array(encoded.reduce((end, name, index) => ends[index] = end + name.length, 0));
9193
+ encoded.forEach((name, index) => bytes.set(name, ends[index] - name.length));
9194
+ const output = new Uint32Array(1);
9195
+ const pointer = this.nativeContextPointer(context, "ot_context_group_set");
9196
+ nativeResult("ot_context_group_set", this.opentui.symbols.ot_context_group_set(pointer, viewOrNull(bytes), bytes.length, viewOrNull(ends), ends.length, output));
9197
+ return output[0];
9198
+ }
9199
+ contextTextBufferSetLayer(context, text, layerId, start, end, runs) {
9200
+ const handle = encodeContextHandle(context, text);
9201
+ this.getYogaHost().runMutation(() => {
9202
+ const pointer = this.nativeContextPointer(context, "ot_text_buffer_set_layer");
9203
+ nativeResult("ot_text_buffer_set_layer", this.opentui.symbols.ot_text_buffer_set_layer(pointer, handle, layerId, start, end, viewOrNull(runs), runs.length / 3));
9204
+ });
9205
+ }
8864
9206
  contextTextBufferGetHighlights(context, text, line) {
8865
9207
  const handle = encodeContextHandle(context, text);
8866
9208
  const row = toSafeFFIU32Length(line, "Highlight line");
@@ -9036,11 +9378,8 @@ class FFIRenderLib2 {
9036
9378
  nativeResult("ot_buffer_draw_scene_body", this.opentui.symbols.ot_buffer_draw_scene_body(pointer, destination, request, source, column, row));
9037
9379
  }
9038
9380
  createContextEditBuffer(context, options = {}) {
9039
- const layout = nativeLayouts.ot_edit_buffer_options;
9040
9381
  this.getYogaHost().assertMutable();
9041
- const widthMethod = widthMethodId(options.widthMethod ?? "unicode", "editor");
9042
- const record = createContextRecord(layout);
9043
- record[layout.fields.width_method.offset / 4] = widthMethod;
9382
+ const record = editBufferOptions(options, "editor");
9044
9383
  const output = new Uint32Array(handleWords);
9045
9384
  const pointer = this.nativeContextPointer(context, "ot_edit_buffer_create");
9046
9385
  nativeResult("ot_edit_buffer_create", this.opentui.symbols.ot_edit_buffer_create(pointer, record, output));
@@ -9207,6 +9546,16 @@ class FFIRenderLib2 {
9207
9546
  const pointer = this.nativeContextPointer(context, "ot_edit_buffer_get_range");
9208
9547
  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));
9209
9548
  }
9549
+ contextEditBufferConvertOffset(context, editBuffer, value, toCell) {
9550
+ const operation = "ot_edit_buffer_convert_offset";
9551
+ const handle = encodeContextHandle(context, editBuffer);
9552
+ const input = toSafeFFIU32Length(value, "Edit buffer index or offset");
9553
+ const conversion = toCell ? nativeConstants.OT_EDIT_UTF16_TO_CELL : nativeConstants.OT_EDIT_CELL_TO_UTF16;
9554
+ const output = new Uint32Array(1);
9555
+ const pointer = this.nativeContextPointer(context, operation);
9556
+ nativeResult(operation, this.opentui.symbols.ot_edit_buffer_convert_offset(pointer, handle, conversion, input, output));
9557
+ return output[0];
9558
+ }
9210
9559
  contextEditBufferMeasureText(context, editBuffer, bytes) {
9211
9560
  const handle = encodeContextHandle(context, editBuffer);
9212
9561
  const input = sessionBytes(bytes, "Edit buffer measure length");
@@ -9290,6 +9639,62 @@ class FFIRenderLib2 {
9290
9639
  throw new NativeError2("ot_edit_buffer_get_highlights", -5 /* InternalError */);
9291
9640
  return decodeContextHighlights(records);
9292
9641
  }
9642
+ contextEditBufferMark(context, editBuffer, operation, mark) {
9643
+ const layout = nativeLayouts.ot_edit_mark;
9644
+ const handle = encodeContextHandle(context, editBuffer);
9645
+ const fields = layout.fields;
9646
+ let record = null;
9647
+ if (mark) {
9648
+ record = createContextRecord(layout);
9649
+ record[fields.id.offset / 4] = toSafeFFIU32Length(mark.id ?? 0, "Mark id");
9650
+ record[fields.kind.offset / 4] = toSafeFFIU32Length(mark.kind ?? 0, "Mark type id");
9651
+ record[fields.flags.offset / 4] = mark.atomic ? nativeConstants.OT_EDIT_MARK_ATOMIC : 0;
9652
+ record[fields.style.offset / 4] = toSafeFFIU32Length(mark.style ?? 0, "Mark style ID");
9653
+ record[fields.priority.offset / 4] = toSafeFFIU32Length(mark.priority ?? 0, "Mark priority");
9654
+ record[fields.start.offset / 4] = toSafeFFIU32Length(mark.start ?? 0, "Mark start");
9655
+ record[fields.end.offset / 4] = toSafeFFIU32Length(mark.end ?? 0, "Mark end");
9656
+ }
9657
+ const output = record && new Uint32Array(1);
9658
+ this.getYogaHost().runMutation(() => {
9659
+ const pointer = this.nativeContextPointer(context, "ot_edit_buffer_mark");
9660
+ nativeResult("ot_edit_buffer_mark", this.opentui.symbols.ot_edit_buffer_mark(pointer, handle, operation, record, output));
9661
+ });
9662
+ return output?.[0] ?? 0;
9663
+ }
9664
+ contextEditBufferGetMarks(context, editBuffer, id = 0, kind = nativeConstants.OT_EDIT_MARK_ANY_KIND) {
9665
+ const layout = nativeLayouts.ot_edit_mark;
9666
+ const handle = encodeContextHandle(context, editBuffer);
9667
+ const markId = toSafeFFIU32Length(id, "Mark id");
9668
+ const markKind = toSafeFFIU32Length(kind, "Mark type id");
9669
+ const count = new Uint32Array(1);
9670
+ const pointer = this.nativeContextPointer(context, "ot_edit_buffer_get_marks");
9671
+ const words = layout.size / 4;
9672
+ const copy = () => this.opentui.symbols.ot_edit_buffer_get_marks(pointer, handle, markId, markKind, this.markRecords, this.markRecords.length / words, count);
9673
+ let status = copy();
9674
+ if (status !== 0 /* Ok */) {
9675
+ nativeResult("ot_edit_buffer_get_marks", this.opentui.symbols.ot_edit_buffer_get_marks(pointer, handle, markId, markKind, null, 0, count));
9676
+ if (count[0] * words <= this.markRecords.length)
9677
+ nativeResult("ot_edit_buffer_get_marks", status);
9678
+ this.markRecords = new Uint32Array(count[0] * 2 * words);
9679
+ status = copy();
9680
+ nativeResult("ot_edit_buffer_get_marks", status);
9681
+ }
9682
+ const records = this.markRecords;
9683
+ const marks = [];
9684
+ for (let offset = 0;offset < count[0] * words; offset += words) {
9685
+ const field = (name) => records[offset + layout.fields[name].offset / 4];
9686
+ marks.push({
9687
+ id: field("id"),
9688
+ kind: field("kind"),
9689
+ atomic: (field("flags") & nativeConstants.OT_EDIT_MARK_ATOMIC) !== 0,
9690
+ style: field("style"),
9691
+ priority: field("priority"),
9692
+ start: field("start"),
9693
+ end: field("end")
9694
+ });
9695
+ }
9696
+ return marks;
9697
+ }
9293
9698
  contextEditorViewSetViewport(context, view, viewport, sizeOnly = false, moveCursor = false) {
9294
9699
  const layout = nativeLayouts.ot_editor_viewport;
9295
9700
  const handle = encodeContextHandle(context, view);
@@ -10123,7 +10528,7 @@ class FFIRenderLib2 {
10123
10528
  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);
10124
10529
  const record = createContextRecord(layout);
10125
10530
  record[layout.fields.flags.offset / 4] = flags;
10126
- record[layout.fields.kitty_keyboard_flags.offset / 4] = toSafeFFIU32Length(options.kittyKeyboardFlags ?? 5, "Session kittyKeyboardFlags");
10531
+ record[layout.fields.kitty_keyboard_flags.offset / 4] = toSafeFFIU32Length(options.kittyKeyboardFlags ?? nativeConstants.OT_KITTY_KEYBOARD_DISAMBIGUATE | nativeConstants.OT_KITTY_KEYBOARD_ALTERNATE_KEYS, "Session kittyKeyboardFlags");
10127
10532
  const pointer = this.nativeContextPointer(context, "ot_session_setup_terminal");
10128
10533
  nativeResult("ot_session_setup_terminal", this.opentui.symbols.ot_session_setup_terminal(pointer, handle, record));
10129
10534
  }
@@ -10219,6 +10624,7 @@ class FFIRenderLib2 {
10219
10624
  break;
10220
10625
  case "palette-query":
10221
10626
  record[kind] = nativeConstants.OT_CONTROL_PALETTE_QUERY;
10627
+ record[layout.fields.argument.offset / 4] = command.sentinel ? 1 : 0;
10222
10628
  bytes = sessionBytes(command.bytes, "Session palette query length");
10223
10629
  break;
10224
10630
  case "title": {
@@ -10258,10 +10664,14 @@ class FFIRenderLib2 {
10258
10664
  break;
10259
10665
  case "query-theme-colors":
10260
10666
  record[kind] = nativeConstants.OT_CONTROL_QUERY_THEME_COLORS;
10667
+ record[layout.fields.argument.offset / 4] = command.sentinel ? 1 : 0;
10261
10668
  break;
10262
10669
  case "reset-background":
10263
10670
  record[kind] = nativeConstants.OT_CONTROL_RESET_BACKGROUND;
10264
10671
  break;
10672
+ case "end-reply-sentinel":
10673
+ record[kind] = nativeConstants.OT_CONTROL_END_REPLY_SENTINEL;
10674
+ break;
10265
10675
  default:
10266
10676
  throw new TypeError("Unknown Session control kind");
10267
10677
  }
@@ -10567,6 +10977,13 @@ class FFIRenderLib2 {
10567
10977
  nativeResult("ot_scene_reaches_hooks", this.opentui.symbols.ot_scene_reaches_hooks(pointer, handle, output));
10568
10978
  return output[0] !== 0;
10569
10979
  }
10980
+ scenePainted(context, node) {
10981
+ const handle = encodeContextHandle(context, node);
10982
+ const output = new Uint32Array(1);
10983
+ const pointer = this.nativeContextPointer(context, "ot_scene_painted");
10984
+ nativeResult("ot_scene_painted", this.opentui.symbols.ot_scene_painted(pointer, handle, output));
10985
+ return output[0] !== 0;
10986
+ }
10570
10987
  sceneMarkDirty(context, node) {
10571
10988
  this.getYogaHost().assertMutable();
10572
10989
  const handle = encodeContextHandle(context, node);
@@ -10700,6 +11117,155 @@ class FFIRenderLib2 {
10700
11117
  const pointer = this.nativeContextPointer(context, "ot_scene_set_styled_text");
10701
11118
  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));
10702
11119
  }
11120
+ sceneGetTextByteAt(context, node, x, y) {
11121
+ const output = new Uint32Array(1);
11122
+ const pointer = this.nativeContextPointer(context, "ot_scene_get_text_byte_at");
11123
+ nativeResult("ot_scene_get_text_byte_at", this.opentui.symbols.ot_scene_get_text_byte_at(pointer, encodeContextHandle(context, node), x, y, output));
11124
+ return output[0] === 4294967295 ? undefined : output[0];
11125
+ }
11126
+ markdownOptions(context, options) {
11127
+ const { fields } = nativeLayouts.ot_markdown_options;
11128
+ const record = createContextRecord(nativeLayouts.ot_markdown_options);
11129
+ record[fields.flags.offset / 4] = options.flags;
11130
+ record[fields.source_byte_limit.offset / 4] = options.sourceByteLimit ?? 0;
11131
+ if (options.syntaxStyle)
11132
+ record.set(encodeContextHandle(context, options.syntaxStyle), fields.syntax_style.offset / 4);
11133
+ const filter = this.encoder.encode((options.hookFilter ?? []).join("\x00"));
11134
+ if (filter.length > fields.hook_filter.size)
11135
+ throw new RangeError("Markdown hook filter is too long");
11136
+ new Uint8Array(record.buffer, fields.hook_filter.offset).set(filter);
11137
+ record[fields.hook_filter_byte_count.offset / 4] = filter.length;
11138
+ return record;
11139
+ }
11140
+ markdownCall(context, operation, call) {
11141
+ const output = new Uint32Array(3);
11142
+ this.getYogaHost().runMutation(() => nativeResult(operation, call(this.nativeContextPointer(context, operation), output)));
11143
+ const removed = output[2];
11144
+ return { changed: output[0], committed: output[1], removedFrom: removed === 4294967295 ? undefined : removed };
11145
+ }
11146
+ markdownCreate(context, options) {
11147
+ const record = this.markdownOptions(context, options);
11148
+ const output = new Uint32Array(handleWords);
11149
+ this.getYogaHost().runMutation(() => {
11150
+ const pointer = this.nativeContextPointer(context, "ot_markdown_create");
11151
+ nativeResult("ot_markdown_create", this.opentui.symbols.ot_markdown_create(pointer, record, output));
11152
+ });
11153
+ return decodeContextHandle(context, output);
11154
+ }
11155
+ markdownDestroy(context, doc) {
11156
+ this.destroyContextObject(context, doc, "ot_markdown_destroy");
11157
+ }
11158
+ markdownSetOptions(context, doc, options) {
11159
+ const record = this.markdownOptions(context, options);
11160
+ const handle = encodeContextHandle(context, doc);
11161
+ return this.markdownCall(context, "ot_markdown_set_options", (pointer, output) => this.opentui.symbols.ot_markdown_set_options(pointer, handle, record, output));
11162
+ }
11163
+ markdownWrite(context, doc, bytes, replace) {
11164
+ const handle = encodeContextHandle(context, doc);
11165
+ const input = sessionBytes(bytes, "Markdown byte count");
11166
+ const operation = replace ? "ot_markdown_set" : "ot_markdown_append";
11167
+ return this.markdownCall(context, operation, (pointer, output) => this.opentui.symbols[operation](pointer, handle, viewOrNull(input), input.length, output));
11168
+ }
11169
+ markdownFinish(context, doc) {
11170
+ const handle = encodeContextHandle(context, doc);
11171
+ return this.markdownCall(context, "ot_markdown_finish", (pointer, output) => this.opentui.symbols.ot_markdown_finish(pointer, handle, output));
11172
+ }
11173
+ markdownGetSource(context, doc, start = 0, end) {
11174
+ const bytes = new BigUint64Array(1);
11175
+ const count = new Uint32Array(1);
11176
+ const pointer = this.nativeContextPointer(context, "ot_markdown_get_source");
11177
+ nativeResult("ot_markdown_get_source", this.opentui.symbols.ot_markdown_get_source(pointer, encodeContextHandle(context, doc), bytes, count));
11178
+ const to = Math.min(end ?? count[0], count[0]);
11179
+ if (to <= start)
11180
+ return "";
11181
+ return markdownDecoder.decode(new Uint8Array(toArrayBuffer(Number(bytes[0]), start, to - start)));
11182
+ }
11183
+ markdownReadChanges(context, doc, count) {
11184
+ const layout = nativeLayouts.ot_markdown_block;
11185
+ const words = new Uint32Array(count * layout.size / 4);
11186
+ const halves = new Uint16Array(words.buffer);
11187
+ const output = new Uint32Array(1);
11188
+ const handle = encodeContextHandle(context, doc);
11189
+ const pointer = this.nativeContextPointer(context, "ot_markdown_read_changes");
11190
+ nativeResult("ot_markdown_read_changes", this.opentui.symbols.ot_markdown_read_changes(pointer, handle, viewOrNull(words), count, output));
11191
+ if (output[0] > count)
11192
+ throw new NativeError2("ot_markdown_read_changes", -1 /* InvalidArgument */);
11193
+ const { fields: f } = layout;
11194
+ const blocks = [];
11195
+ for (let at = 0;at < output[0] * (layout.size / 4); at += layout.size / 4) {
11196
+ const parent = words[at + f.parent_index.offset / 4];
11197
+ blocks.push({
11198
+ index: words[at + f.index.offset / 4],
11199
+ parent: parent === 4294967295 ? undefined : parent,
11200
+ kind: halves[at * 2 + f.kind.offset / 2],
11201
+ flags: halves[at * 2 + f.flags.offset / 2],
11202
+ sourceStart: words[at + f.source_start_byte.offset / 4],
11203
+ sourceEnd: words[at + f.source_end_byte.offset / 4],
11204
+ infoStart: words[at + f.info_start_byte.offset / 4],
11205
+ infoEnd: words[at + f.info_end_byte.offset / 4],
11206
+ number: words[at + f.number.offset / 4]
11207
+ });
11208
+ }
11209
+ return blocks;
11210
+ }
11211
+ markdownReadSource(context, doc, block) {
11212
+ const handle = encodeContextHandle(context, doc);
11213
+ const count = new Uint32Array(1);
11214
+ const pointer = this.nativeContextPointer(context, "ot_markdown_read_source");
11215
+ nativeResult("ot_markdown_read_source", this.opentui.symbols.ot_markdown_read_source(pointer, handle, block, null, 0, count));
11216
+ if (count[0] === 0)
11217
+ return "";
11218
+ const bytes = new Uint8Array(count[0]);
11219
+ nativeResult("ot_markdown_read_source", this.opentui.symbols.ot_markdown_read_source(pointer, handle, block, bytes, bytes.length, count));
11220
+ return markdownDecoder.decode(bytes);
11221
+ }
11222
+ markdownReadLeaf(context, doc, block) {
11223
+ const handle = encodeContextHandle(context, doc);
11224
+ const counts = new Uint32Array(3);
11225
+ const [byteCount, chunkCount, urlCount] = [counts.subarray(0, 1), counts.subarray(1, 2), counts.subarray(2, 3)];
11226
+ const pointer = this.nativeContextPointer(context, "ot_markdown_read_leaf");
11227
+ 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));
11228
+ read(null, null, null, null);
11229
+ const layout = nativeLayouts.ot_styled_text_chunk;
11230
+ const stride = layout.size / 4;
11231
+ const bytes = new Uint8Array(byteCount[0]);
11232
+ const records = new Uint32Array(chunkCount[0] * stride);
11233
+ const spans = new Uint32Array(chunkCount[0]);
11234
+ const urls = new Uint8Array(urlCount[0]);
11235
+ if (chunkCount[0] > 0)
11236
+ read(viewOrNull(bytes), records, spans, viewOrNull(urls));
11237
+ const colors = new Uint16Array(records.buffer);
11238
+ const chunks = [];
11239
+ let at = 0;
11240
+ for (let index = 0;index < chunkCount[0]; index++) {
11241
+ const base = index * stride;
11242
+ const flags = records[base + layout.fields.flags.offset / 4];
11243
+ const end = at + records[base + layout.fields.byte_count.offset / 4];
11244
+ const color = (offset) => RGBA2.fromArray(colors.slice(base * 2 + offset / 2, base * 2 + offset / 2 + 4));
11245
+ const chunk = { __isChunk: true, text: markdownDecoder.decode(bytes.subarray(at, end)) };
11246
+ if (flags & nativeConstants.OT_SCENE_TEXT_FOREGROUND)
11247
+ chunk.fg = color(layout.fields.foreground.offset);
11248
+ if (flags & nativeConstants.OT_SCENE_TEXT_BACKGROUND)
11249
+ chunk.bg = color(layout.fields.background.offset);
11250
+ chunk.attributes = records[base + layout.fields.attributes.offset / 4];
11251
+ if (flags & nativeConstants.OT_SCENE_TEXT_LINK) {
11252
+ const offset = records[base + layout.fields.link_offset.offset / 4];
11253
+ const url = urls.subarray(offset, offset + records[base + layout.fields.link_byte_count.offset / 4]);
11254
+ chunk.link = { url: markdownDecoder.decode(url) };
11255
+ }
11256
+ chunks.push(chunk);
11257
+ at = end;
11258
+ }
11259
+ return { chunks, spans };
11260
+ }
11261
+ markdownBind(context, doc, block, node) {
11262
+ const handle = encodeContextHandle(context, doc);
11263
+ const target = encodeContextHandle(context, node);
11264
+ this.getYogaHost().runMutation(() => {
11265
+ const pointer = this.nativeContextPointer(context, "ot_markdown_bind");
11266
+ nativeResult("ot_markdown_bind", this.opentui.symbols.ot_markdown_bind(pointer, handle, block, target));
11267
+ });
11268
+ }
10703
11269
  encodeStyledText(content, allowLinks = true, preserveChunkOrdinals = false) {
10704
11270
  if (typeof content !== "object" || content === null || isStyledText2(content) !== true) {
10705
11271
  throw new TypeError("Native scene text requires a string or branded StyledText");
@@ -10963,7 +11529,7 @@ class FFIRenderLib2 {
10963
11529
  this.getYogaHost().assertMutable();
10964
11530
  const handle = encodeContextHandle(context, node);
10965
11531
  const record = createContextRecord(layout);
10966
- const operation = ["reset", "set", "update"].indexOf(options.operation);
11532
+ const operation = ["reset", "set", "update", "colors"].indexOf(options.operation);
10967
11533
  const behavior = ["cell", "word", "line"].indexOf(options.behavior);
10968
11534
  if (operation < 0 || behavior < 0)
10969
11535
  throw new TypeError("Unknown scene text selection operation or behavior");
@@ -11048,7 +11614,7 @@ class FFIRenderLib2 {
11048
11614
  this.sceneLayoutRecord = undefined;
11049
11615
  try {
11050
11616
  const handle = encodeContextHandle(context, node, scratch.handle.record, scratch.handle.words);
11051
- const mode = observation === "paint" ? nativeConstants.OT_LAYOUT_PAINT : toFFIBool(observation, "Scene Yoga layout observation") ? nativeConstants.OT_LAYOUT_YOGA : nativeConstants.OT_LAYOUT_PUBLIC;
11617
+ 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;
11052
11618
  const { output, values, coordinates } = scratch;
11053
11619
  output[layout.fields.struct_size.offset / 4] = layout.size;
11054
11620
  output[layout.fields.abi_version.offset / 4] = nativeConstants.OT_CONTEXT_ABI_VERSION;
@@ -11226,13 +11792,14 @@ class FFIRenderLib2 {
11226
11792
  const pointer = this.nativeContextPointer(context, "ot_scene_frame_cancel");
11227
11793
  nativeResult("ot_scene_frame_cancel", this.opentui.symbols.ot_scene_frame_cancel(pointer, handle, id));
11228
11794
  }
11229
- sceneHitTest(context, session, x, y) {
11795
+ sceneHitTest(context, session, x, y, excluded = 0) {
11230
11796
  const handle = encodeContextHandle(context, session);
11231
11797
  toFFII32(x, "Scene hit x");
11232
11798
  toFFII32(y, "Scene hit y");
11799
+ toSafeFFIU32Length(excluded, "Scene hit exclusion");
11233
11800
  const output = this.hitTestOutput;
11234
- const pointer = this.nativeContextPointer(context, "ot_scene_hit_test");
11235
- nativeResult("ot_scene_hit_test", this.opentui.symbols.ot_scene_hit_test(pointer, handle, x, y, output));
11801
+ const pointer = this.nativeContextPointer(context, "ot_scene_hit_test_excluding");
11802
+ nativeResult("ot_scene_hit_test_excluding", this.opentui.symbols.ot_scene_hit_test_excluding(pointer, handle, x, y, excluded, output));
11236
11803
  return output[0];
11237
11804
  }
11238
11805
  sceneSetDebugFlags(context, session, flags) {
@@ -12405,9 +12972,9 @@ var Direction2;
12405
12972
  })(Direction2 ||= {});
12406
12973
  var Display2;
12407
12974
  ((Display) => {
12408
- Display[Display["Flex"] = 0] = "Flex";
12409
- Display[Display["None"] = 1] = "None";
12410
- Display[Display["Contents"] = 2] = "Contents";
12975
+ Display[Display["Flex"] = OT_DISPLAY_FLEX] = "Flex";
12976
+ Display[Display["None"] = OT_DISPLAY_NONE] = "None";
12977
+ Display[Display["Contents"] = OT_DISPLAY_CONTENTS] = "Contents";
12411
12978
  })(Display2 ||= {});
12412
12979
  var Edge2;
12413
12980
  ((Edge) => {
@@ -12423,16 +12990,16 @@ var Edge2;
12423
12990
  })(Edge2 ||= {});
12424
12991
  var Errata2;
12425
12992
  ((Errata) => {
12426
- Errata[Errata["None"] = 0] = "None";
12427
- Errata[Errata["StretchFlexBasis"] = 1] = "StretchFlexBasis";
12428
- Errata[Errata["AbsolutePositionWithoutInsetsExcludesPadding"] = 2] = "AbsolutePositionWithoutInsetsExcludesPadding";
12429
- Errata[Errata["AbsolutePercentAgainstInnerSize"] = 4] = "AbsolutePercentAgainstInnerSize";
12430
- Errata[Errata["All"] = 2147483647] = "All";
12431
- Errata[Errata["Classic"] = 2147483646] = "Classic";
12993
+ Errata[Errata["None"] = OT_YOGA_ERRATA_NONE] = "None";
12994
+ Errata[Errata["StretchFlexBasis"] = OT_YOGA_ERRATA_STRETCH_FLEX_BASIS] = "StretchFlexBasis";
12995
+ Errata[Errata["AbsolutePositionWithoutInsetsExcludesPadding"] = OT_YOGA_ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING] = "AbsolutePositionWithoutInsetsExcludesPadding";
12996
+ Errata[Errata["AbsolutePercentAgainstInnerSize"] = OT_YOGA_ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE] = "AbsolutePercentAgainstInnerSize";
12997
+ Errata[Errata["All"] = OT_YOGA_ERRATA_ALL] = "All";
12998
+ Errata[Errata["Classic"] = OT_YOGA_ERRATA_CLASSIC] = "Classic";
12432
12999
  })(Errata2 ||= {});
12433
13000
  var ExperimentalFeature2;
12434
13001
  ((ExperimentalFeature) => {
12435
- ExperimentalFeature[ExperimentalFeature["WebFlexBasis"] = 0] = "WebFlexBasis";
13002
+ ExperimentalFeature[ExperimentalFeature["WebFlexBasis"] = OT_YOGA_EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS] = "WebFlexBasis";
12436
13003
  })(ExperimentalFeature2 ||= {});
12437
13004
  var FlexDirection2;
12438
13005
  ((FlexDirection) => {
@@ -12458,12 +13025,12 @@ var Justify2;
12458
13025
  })(Justify2 ||= {});
12459
13026
  var LogLevel3;
12460
13027
  ((LogLevel) => {
12461
- LogLevel[LogLevel["Error"] = 0] = "Error";
12462
- LogLevel[LogLevel["Warn"] = 1] = "Warn";
12463
- LogLevel[LogLevel["Info"] = 2] = "Info";
12464
- LogLevel[LogLevel["Debug"] = 3] = "Debug";
12465
- LogLevel[LogLevel["Verbose"] = 4] = "Verbose";
12466
- LogLevel[LogLevel["Fatal"] = 5] = "Fatal";
13028
+ LogLevel[LogLevel["Error"] = OT_YOGA_LOG_LEVEL_ERROR] = "Error";
13029
+ LogLevel[LogLevel["Warn"] = OT_YOGA_LOG_LEVEL_WARN] = "Warn";
13030
+ LogLevel[LogLevel["Info"] = OT_YOGA_LOG_LEVEL_INFO] = "Info";
13031
+ LogLevel[LogLevel["Debug"] = OT_YOGA_LOG_LEVEL_DEBUG] = "Debug";
13032
+ LogLevel[LogLevel["Verbose"] = OT_YOGA_LOG_LEVEL_VERBOSE] = "Verbose";
13033
+ LogLevel[LogLevel["Fatal"] = OT_YOGA_LOG_LEVEL_FATAL] = "Fatal";
12467
13034
  })(LogLevel3 ||= {});
12468
13035
  var MeasureMode2;
12469
13036
  ((MeasureMode) => {
@@ -12473,8 +13040,8 @@ var MeasureMode2;
12473
13040
  })(MeasureMode2 ||= {});
12474
13041
  var NodeType2;
12475
13042
  ((NodeType) => {
12476
- NodeType[NodeType["Default"] = 0] = "Default";
12477
- NodeType[NodeType["Text"] = 1] = "Text";
13043
+ NodeType[NodeType["Default"] = OT_YOGA_NODE_TYPE_DEFAULT] = "Default";
13044
+ NodeType[NodeType["Text"] = OT_YOGA_NODE_TYPE_TEXT] = "Text";
12478
13045
  })(NodeType2 ||= {});
12479
13046
  var Overflow2;
12480
13047
  ((Overflow) => {
@@ -12517,9 +13084,9 @@ var DIMENSION_HEIGHT2 = Dimension2.Height;
12517
13084
  var DIRECTION_INHERIT2 = Direction2.Inherit;
12518
13085
  var DIRECTION_LTR2 = Direction2.LTR;
12519
13086
  var DIRECTION_RTL2 = Direction2.RTL;
12520
- var DISPLAY_FLEX2 = 0 /* Flex */;
12521
- var DISPLAY_NONE2 = 1 /* None */;
12522
- var DISPLAY_CONTENTS2 = 2 /* Contents */;
13087
+ var DISPLAY_FLEX2 = Display2.Flex;
13088
+ var DISPLAY_NONE2 = Display2.None;
13089
+ var DISPLAY_CONTENTS2 = Display2.Contents;
12523
13090
  var EDGE_LEFT2 = Edge2.Left;
12524
13091
  var EDGE_TOP2 = Edge2.Top;
12525
13092
  var EDGE_RIGHT2 = Edge2.Right;
@@ -12529,13 +13096,13 @@ var EDGE_END2 = Edge2.End;
12529
13096
  var EDGE_HORIZONTAL2 = Edge2.Horizontal;
12530
13097
  var EDGE_VERTICAL2 = Edge2.Vertical;
12531
13098
  var EDGE_ALL2 = Edge2.All;
12532
- var ERRATA_NONE2 = 0 /* None */;
12533
- var ERRATA_STRETCH_FLEX_BASIS2 = 1 /* StretchFlexBasis */;
12534
- var ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING2 = 2 /* AbsolutePositionWithoutInsetsExcludesPadding */;
12535
- var ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE2 = 4 /* AbsolutePercentAgainstInnerSize */;
12536
- var ERRATA_ALL2 = 2147483647 /* All */;
12537
- var ERRATA_CLASSIC2 = 2147483646 /* Classic */;
12538
- var EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS2 = 0 /* WebFlexBasis */;
13099
+ var ERRATA_NONE2 = Errata2.None;
13100
+ var ERRATA_STRETCH_FLEX_BASIS2 = Errata2.StretchFlexBasis;
13101
+ var ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING2 = Errata2.AbsolutePositionWithoutInsetsExcludesPadding;
13102
+ var ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE2 = Errata2.AbsolutePercentAgainstInnerSize;
13103
+ var ERRATA_ALL2 = Errata2.All;
13104
+ var ERRATA_CLASSIC2 = Errata2.Classic;
13105
+ var EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS2 = ExperimentalFeature2.WebFlexBasis;
12539
13106
  var FLEX_DIRECTION_COLUMN2 = FlexDirection2.Column;
12540
13107
  var FLEX_DIRECTION_COLUMN_REVERSE2 = FlexDirection2.ColumnReverse;
12541
13108
  var FLEX_DIRECTION_ROW2 = FlexDirection2.Row;
@@ -12549,17 +13116,17 @@ var JUSTIFY_FLEX_END2 = Justify2.FlexEnd;
12549
13116
  var JUSTIFY_SPACE_BETWEEN2 = Justify2.SpaceBetween;
12550
13117
  var JUSTIFY_SPACE_AROUND2 = Justify2.SpaceAround;
12551
13118
  var JUSTIFY_SPACE_EVENLY2 = Justify2.SpaceEvenly;
12552
- var LOG_LEVEL_ERROR2 = 0 /* Error */;
12553
- var LOG_LEVEL_WARN2 = 1 /* Warn */;
12554
- var LOG_LEVEL_INFO2 = 2 /* Info */;
12555
- var LOG_LEVEL_DEBUG2 = 3 /* Debug */;
12556
- var LOG_LEVEL_VERBOSE2 = 4 /* Verbose */;
12557
- var LOG_LEVEL_FATAL2 = 5 /* Fatal */;
13119
+ var LOG_LEVEL_ERROR2 = LogLevel3.Error;
13120
+ var LOG_LEVEL_WARN2 = LogLevel3.Warn;
13121
+ var LOG_LEVEL_INFO2 = LogLevel3.Info;
13122
+ var LOG_LEVEL_DEBUG2 = LogLevel3.Debug;
13123
+ var LOG_LEVEL_VERBOSE2 = LogLevel3.Verbose;
13124
+ var LOG_LEVEL_FATAL2 = LogLevel3.Fatal;
12558
13125
  var MEASURE_MODE_UNDEFINED2 = MeasureMode2.Undefined;
12559
13126
  var MEASURE_MODE_EXACTLY2 = MeasureMode2.Exactly;
12560
13127
  var MEASURE_MODE_AT_MOST2 = MeasureMode2.AtMost;
12561
- var NODE_TYPE_DEFAULT2 = 0 /* Default */;
12562
- var NODE_TYPE_TEXT2 = 1 /* Text */;
13128
+ var NODE_TYPE_DEFAULT2 = NodeType2.Default;
13129
+ var NODE_TYPE_TEXT2 = NodeType2.Text;
12563
13130
  var OVERFLOW_VISIBLE2 = Overflow2.Visible;
12564
13131
  var OVERFLOW_HIDDEN2 = Overflow2.Hidden;
12565
13132
  var OVERFLOW_SCROLL2 = Overflow2.Scroll;
@@ -12716,7 +13283,7 @@ class Config2 {
12716
13283
  }
12717
13284
  getErrata() {
12718
13285
  if (this.freed)
12719
- return 0 /* None */;
13286
+ return Errata2.None;
12720
13287
  return this.renderLib.yogaConfigGetErrata(this.ptr);
12721
13288
  }
12722
13289
  setExperimentalFeatureEnabled(feature, enabled) {
@@ -12966,7 +13533,7 @@ class Node2 {
12966
13533
  this.setEnum(YogaEnumKind.Display, display);
12967
13534
  }
12968
13535
  getDisplay() {
12969
- return this.getEnum(YogaEnumKind.Display, 0 /* Flex */);
13536
+ return this.getEnum(YogaEnumKind.Display, Display2.Flex);
12970
13537
  }
12971
13538
  setBoxSizing(boxSizing) {
12972
13539
  this.setEnum(YogaEnumKind.BoxSizing, boxSizing);
@@ -13335,7 +13902,7 @@ var Yoga = {
13335
13902
  };
13336
13903
  var yoga_default = Yoga;
13337
13904
 
13338
- 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 };
13905
+ 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 };
13339
13906
 
13340
- //# debugId=F98B42DF31CEA78164756E2164756E21
13341
- //# sourceMappingURL=chunk-bun-dsfc571f.js.map
13907
+ //# debugId=9C4AF511A188811164756E2164756E21
13908
+ //# sourceMappingURL=chunk-bun-v1wzs0bj.js.map