@opentui/core 0.0.0-20251201-fe4cc80e → 0.0.0-20251202-71dcabc4

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.
@@ -25,1109 +25,1190 @@ var __export = (target, all) => {
25
25
  set: (newValue) => all[name] = () => newValue
26
26
  });
27
27
  };
28
+ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
28
29
  var __require = import.meta.require;
29
30
 
30
31
  // ../../node_modules/bun-yoga/dist/darwin-arm64/libyoga.dylib
31
- var require_libyoga = __commonJS((exports, module) => {
32
- module.exports = "./libyoga-j5nt7np1.dylib";
32
+ var exports_libyoga = {};
33
+ __export(exports_libyoga, {
34
+ default: () => libyoga_default
33
35
  });
36
+ var libyoga_default = "./libyoga-j5nt7np1.dylib";
37
+ var init_libyoga = () => {};
34
38
 
35
39
  // ../../node_modules/bun-yoga/dist/darwin-x64/libyoga.dylib
36
- var require_libyoga2 = __commonJS((exports, module) => {
37
- module.exports = "./libyoga-2ksztx35.dylib";
40
+ var exports_libyoga2 = {};
41
+ __export(exports_libyoga2, {
42
+ default: () => libyoga_default2
38
43
  });
44
+ var libyoga_default2 = "./libyoga-2ksztx35.dylib";
45
+ var init_libyoga2 = () => {};
39
46
 
40
47
  // ../../node_modules/bun-yoga/dist/linux-x64/libyoga.so
41
- var require_libyoga3 = __commonJS((exports, module) => {
42
- module.exports = "./libyoga-wnbqxxhv.so";
48
+ var exports_libyoga3 = {};
49
+ __export(exports_libyoga3, {
50
+ default: () => libyoga_default3
43
51
  });
52
+ var libyoga_default3 = "./libyoga-wnbqxxhv.so";
53
+ var init_libyoga3 = () => {};
44
54
 
45
55
  // ../../node_modules/bun-yoga/dist/linux-arm64/libyoga.so
46
- var require_libyoga4 = __commonJS((exports, module) => {
47
- module.exports = "./libyoga-gh2tjwb7.so";
56
+ var exports_libyoga4 = {};
57
+ __export(exports_libyoga4, {
58
+ default: () => libyoga_default4
48
59
  });
60
+ var libyoga_default4 = "./libyoga-gh2tjwb7.so";
61
+ var init_libyoga4 = () => {};
49
62
 
50
63
  // ../../node_modules/bun-yoga/dist/windows-x64/yoga.dll
51
- var require_yoga = __commonJS((exports, module) => {
52
- module.exports = "./yoga-jkgc6c1f.dll";
64
+ var exports_yoga = {};
65
+ __export(exports_yoga, {
66
+ default: () => yoga_default
53
67
  });
68
+ var yoga_default = "./yoga-jkgc6c1f.dll";
69
+ var init_yoga = () => {};
54
70
 
55
71
  // ../../node_modules/bun-yoga/dist/index.js
56
- var exports_dist = {};
57
- __export(exports_dist, {
58
- default: () => dist_default,
59
- Wrap: () => Wrap,
60
- WRAP_WRAP_REVERSE: () => WRAP_WRAP_REVERSE,
61
- WRAP_WRAP: () => WRAP_WRAP,
62
- WRAP_NO_WRAP: () => WRAP_NO_WRAP,
63
- Unit: () => Unit,
64
- PositionType: () => PositionType,
65
- POSITION_TYPE_STATIC: () => POSITION_TYPE_STATIC,
66
- POSITION_TYPE_RELATIVE: () => POSITION_TYPE_RELATIVE,
67
- POSITION_TYPE_ABSOLUTE: () => POSITION_TYPE_ABSOLUTE,
68
- Overflow: () => Overflow,
69
- OVERFLOW_VISIBLE: () => OVERFLOW_VISIBLE,
70
- OVERFLOW_SCROLL: () => OVERFLOW_SCROLL,
71
- OVERFLOW_HIDDEN: () => OVERFLOW_HIDDEN,
72
- NodeType: () => NodeType,
73
- Node: () => Node,
74
- MeasureMode: () => MeasureMode,
75
- LogLevel: () => LogLevel,
76
- Justify: () => Justify,
77
- JUSTIFY_SPACE_EVENLY: () => JUSTIFY_SPACE_EVENLY,
78
- JUSTIFY_SPACE_BETWEEN: () => JUSTIFY_SPACE_BETWEEN,
79
- JUSTIFY_SPACE_AROUND: () => JUSTIFY_SPACE_AROUND,
80
- JUSTIFY_FLEX_START: () => JUSTIFY_FLEX_START,
81
- JUSTIFY_FLEX_END: () => JUSTIFY_FLEX_END,
82
- JUSTIFY_CENTER: () => JUSTIFY_CENTER,
83
- Gutter: () => Gutter,
84
- FlexDirection: () => FlexDirection,
85
- FLEX_DIRECTION_ROW_REVERSE: () => FLEX_DIRECTION_ROW_REVERSE,
86
- FLEX_DIRECTION_ROW: () => FLEX_DIRECTION_ROW,
87
- FLEX_DIRECTION_COLUMN_REVERSE: () => FLEX_DIRECTION_COLUMN_REVERSE,
88
- FLEX_DIRECTION_COLUMN: () => FLEX_DIRECTION_COLUMN,
89
- ExperimentalFeature: () => ExperimentalFeature,
90
- Errata: () => Errata,
91
- Edge: () => Edge,
92
- EDGE_VERTICAL: () => EDGE_VERTICAL,
93
- EDGE_TOP: () => EDGE_TOP,
94
- EDGE_START: () => EDGE_START,
95
- EDGE_RIGHT: () => EDGE_RIGHT,
96
- EDGE_LEFT: () => EDGE_LEFT,
97
- EDGE_HORIZONTAL: () => EDGE_HORIZONTAL,
98
- EDGE_END: () => EDGE_END,
99
- EDGE_BOTTOM: () => EDGE_BOTTOM,
100
- EDGE_ALL: () => EDGE_ALL,
101
- Display: () => Display,
102
- Direction: () => Direction,
103
- Dimension: () => Dimension,
104
- DISPLAY_NONE: () => DISPLAY_NONE,
105
- DISPLAY_FLEX: () => DISPLAY_FLEX,
106
- DIRECTION_RTL: () => DIRECTION_RTL,
107
- DIRECTION_LTR: () => DIRECTION_LTR,
108
- DIRECTION_INHERIT: () => DIRECTION_INHERIT,
109
- Config: () => Config,
110
- BoxSizing: () => BoxSizing,
111
- Align: () => Align,
112
- ALIGN_STRETCH: () => ALIGN_STRETCH,
113
- ALIGN_SPACE_EVENLY: () => ALIGN_SPACE_EVENLY,
114
- ALIGN_SPACE_BETWEEN: () => ALIGN_SPACE_BETWEEN,
115
- ALIGN_SPACE_AROUND: () => ALIGN_SPACE_AROUND,
116
- ALIGN_FLEX_START: () => ALIGN_FLEX_START,
117
- ALIGN_FLEX_END: () => ALIGN_FLEX_END,
118
- ALIGN_CENTER: () => ALIGN_CENTER,
119
- ALIGN_BASELINE: () => ALIGN_BASELINE,
120
- ALIGN_AUTO: () => ALIGN_AUTO
121
- });
122
- import { dlopen, suffix, JSCallback, FFIType } from "bun:ffi";
123
- import { join } from "path";
124
- import { existsSync } from "fs";
125
- import { arch, platform } from "os";
126
- function getPlatformTarget() {
127
- const p = platform();
128
- const a = arch();
129
- if (p === "darwin") {
130
- return a === "arm64" ? "darwin-arm64" : "darwin-x64";
131
- } else if (p === "linux") {
132
- return a === "arm64" ? "linux-arm64" : "linux-x64";
133
- } else if (p === "win32") {
134
- return "windows-x64";
135
- }
136
- throw new Error(`Unsupported platform: ${p}-${a}`);
137
- }
138
- function getEmbeddedLib() {
139
- const target = getPlatformTarget();
140
- try {
141
- switch (target) {
142
- case "darwin-arm64":
143
- return require_libyoga();
144
- case "darwin-x64":
145
- return require_libyoga2();
146
- case "linux-x64":
147
- return require_libyoga3();
148
- case "linux-arm64":
149
- return require_libyoga4();
150
- case "windows-x64":
151
- return require_yoga();
152
- default:
153
- return;
72
+ var require_dist = __commonJS((exports) => {
73
+ var __dirname = "/Users/runner/work/opentui/opentui/node_modules/bun-yoga/dist";
74
+ Object.defineProperty(exports, "__esModule", { value: true });
75
+ exports.OVERFLOW_VISIBLE = exports.WRAP_WRAP_REVERSE = exports.WRAP_WRAP = exports.WRAP_NO_WRAP = exports.ALIGN_SPACE_EVENLY = exports.ALIGN_SPACE_AROUND = exports.ALIGN_SPACE_BETWEEN = exports.ALIGN_BASELINE = exports.ALIGN_STRETCH = exports.ALIGN_FLEX_END = exports.ALIGN_CENTER = exports.ALIGN_FLEX_START = exports.ALIGN_AUTO = exports.JUSTIFY_SPACE_EVENLY = exports.JUSTIFY_SPACE_AROUND = exports.JUSTIFY_SPACE_BETWEEN = exports.JUSTIFY_FLEX_END = exports.JUSTIFY_CENTER = exports.JUSTIFY_FLEX_START = exports.FLEX_DIRECTION_ROW_REVERSE = exports.FLEX_DIRECTION_ROW = exports.FLEX_DIRECTION_COLUMN_REVERSE = exports.FLEX_DIRECTION_COLUMN = exports.EDGE_ALL = exports.EDGE_VERTICAL = exports.EDGE_HORIZONTAL = exports.EDGE_END = exports.EDGE_START = exports.EDGE_BOTTOM = exports.EDGE_RIGHT = exports.EDGE_TOP = exports.EDGE_LEFT = exports.Wrap = exports.Unit = exports.PositionType = exports.Overflow = exports.NodeType = exports.MeasureMode = exports.LogLevel = exports.Justify = exports.Gutter = exports.FlexDirection = exports.ExperimentalFeature = exports.Errata = exports.Edge = exports.Display = exports.Direction = exports.Dimension = exports.BoxSizing = exports.Align = undefined;
76
+ exports.Config = exports.Node = exports.DIRECTION_RTL = exports.DIRECTION_LTR = exports.DIRECTION_INHERIT = exports.POSITION_TYPE_ABSOLUTE = exports.POSITION_TYPE_RELATIVE = exports.POSITION_TYPE_STATIC = exports.DISPLAY_NONE = exports.DISPLAY_FLEX = exports.OVERFLOW_SCROLL = exports.OVERFLOW_HIDDEN = undefined;
77
+ var bun_ffi_1 = __require("bun:ffi");
78
+ var path_1 = __require("path");
79
+ var fs_1 = __require("fs");
80
+ function getEmbeddedLib() {
81
+ try {
82
+ if (process.platform === "darwin" && process.arch === "arm64") {
83
+ return __require.resolve("/Users/runner/work/opentui/opentui/node_modules/bun-yoga/dist/darwin-arm64/libyoga.dylib");
84
+ } else if (process.platform === "darwin" && process.arch === "x64") {
85
+ return __require.resolve("/Users/runner/work/opentui/opentui/node_modules/bun-yoga/dist/darwin-x64/libyoga.dylib");
86
+ } else if (process.platform === "linux" && process.arch === "x64") {
87
+ return __require.resolve("/Users/runner/work/opentui/opentui/node_modules/bun-yoga/dist/linux-x64/libyoga.so");
88
+ } else if (process.platform === "linux" && process.arch === "arm64") {
89
+ return __require.resolve("/Users/runner/work/opentui/opentui/node_modules/bun-yoga/dist/linux-arm64/libyoga.so");
90
+ } else if (process.platform === "win32") {
91
+ return __require.resolve("/Users/runner/work/opentui/opentui/node_modules/bun-yoga/dist/windows-x64/yoga.dll");
92
+ }
93
+ return;
94
+ } catch {
95
+ return;
154
96
  }
155
- } catch {
156
- return;
157
97
  }
158
- }
159
- function getLibPath() {
160
- const libName = platform() === "win32" ? `yoga.${suffix}` : `libyoga.${suffix}`;
161
- const target = getPlatformTarget();
162
- const devPath = join(import.meta.dir, "..", "zig-out", "lib", libName);
163
- if (existsSync(devPath)) {
164
- return devPath;
165
- }
166
- if (platform() === "win32") {
167
- const devPathBin = join(import.meta.dir, "..", "zig-out", "bin", libName);
168
- if (existsSync(devPathBin)) {
169
- return devPathBin;
98
+ function getLibPath() {
99
+ if (process.platform === "win32") {
100
+ if ((0, fs_1.existsSync)((0, path_1.join)(__dirname, "..", "zig-out", "lib", `yoga.${bun_ffi_1.suffix}`))) {
101
+ return (0, path_1.join)(__dirname, "..", "zig-out", "lib", `yoga.${bun_ffi_1.suffix}`);
102
+ }
103
+ if ((0, fs_1.existsSync)((0, path_1.join)(__dirname, "..", "zig-out", "bin", `yoga.${bun_ffi_1.suffix}`))) {
104
+ return (0, path_1.join)(__dirname, "..", "zig-out", "bin", `yoga.${bun_ffi_1.suffix}`);
105
+ }
106
+ } else {
107
+ if ((0, fs_1.existsSync)((0, path_1.join)(__dirname, "..", "zig-out", "lib", `libyoga.${bun_ffi_1.suffix}`))) {
108
+ return (0, path_1.join)(__dirname, "..", "zig-out", "lib", `libyoga.${bun_ffi_1.suffix}`);
109
+ }
170
110
  }
171
- }
172
- const embedded = getEmbeddedLib();
173
- if (embedded && existsSync(embedded)) {
174
- return embedded;
175
- }
176
- const distPath = join(import.meta.dir, "..", "dist", target, libName);
177
- if (existsSync(distPath)) {
178
- return distPath;
179
- }
180
- throw new Error(`Could not find native library ${libName}. ` + `Looked in:
181
- - ${devPath}
182
- - ${distPath}
111
+ const embedded = getEmbeddedLib();
112
+ if (embedded) {
113
+ return embedded;
114
+ }
115
+ if (process.platform === "darwin" && process.arch === "arm64") {
116
+ if ((0, fs_1.existsSync)((0, path_1.join)(__dirname, "..", "dist", "darwin-arm64", `libyoga.${bun_ffi_1.suffix}`))) {
117
+ return (0, path_1.join)(__dirname, "..", "dist", "darwin-arm64", `libyoga.${bun_ffi_1.suffix}`);
118
+ }
119
+ } else if (process.platform === "darwin" && process.arch === "x64") {
120
+ if ((0, fs_1.existsSync)((0, path_1.join)(__dirname, "..", "dist", "darwin-x64", `libyoga.${bun_ffi_1.suffix}`))) {
121
+ return (0, path_1.join)(__dirname, "..", "dist", "darwin-x64", `libyoga.${bun_ffi_1.suffix}`);
122
+ }
123
+ } else if (process.platform === "linux" && process.arch === "x64") {
124
+ if ((0, fs_1.existsSync)((0, path_1.join)(__dirname, "..", "dist", "linux-x64", `libyoga.${bun_ffi_1.suffix}`))) {
125
+ return (0, path_1.join)(__dirname, "..", "dist", "linux-x64", `libyoga.${bun_ffi_1.suffix}`);
126
+ }
127
+ } else if (process.platform === "linux" && process.arch === "arm64") {
128
+ if ((0, fs_1.existsSync)((0, path_1.join)(__dirname, "..", "dist", "linux-arm64", `libyoga.${bun_ffi_1.suffix}`))) {
129
+ return (0, path_1.join)(__dirname, "..", "dist", "linux-arm64", `libyoga.${bun_ffi_1.suffix}`);
130
+ }
131
+ } else if (process.platform === "win32") {
132
+ if ((0, fs_1.existsSync)((0, path_1.join)(__dirname, "..", "dist", "windows-x64", `yoga.${bun_ffi_1.suffix}`))) {
133
+ return (0, path_1.join)(__dirname, "..", "dist", "windows-x64", `yoga.${bun_ffi_1.suffix}`);
134
+ }
135
+ }
136
+ throw new Error(`Could not find native library. ` + `Platform: ${process.platform}-${process.arch}
183
137
  ` + `Make sure to run 'zig build' or install the package with binaries.`);
184
- }
185
- var Align = {
186
- Auto: 0,
187
- FlexStart: 1,
188
- Center: 2,
189
- FlexEnd: 3,
190
- Stretch: 4,
191
- Baseline: 5,
192
- SpaceBetween: 6,
193
- SpaceAround: 7,
194
- SpaceEvenly: 8
195
- };
196
- var BoxSizing = {
197
- BorderBox: 0,
198
- ContentBox: 1
199
- };
200
- var Dimension = {
201
- Width: 0,
202
- Height: 1
203
- };
204
- var Direction = {
205
- Inherit: 0,
206
- LTR: 1,
207
- RTL: 2
208
- };
209
- var Display = {
210
- Flex: 0,
211
- None: 1,
212
- Contents: 2
213
- };
214
- var Edge = {
215
- Left: 0,
216
- Top: 1,
217
- Right: 2,
218
- Bottom: 3,
219
- Start: 4,
220
- End: 5,
221
- Horizontal: 6,
222
- Vertical: 7,
223
- All: 8
224
- };
225
- var Errata = {
226
- None: 0,
227
- StretchFlexBasis: 1,
228
- AbsolutePositionWithoutInsetsExcludesPadding: 2,
229
- AbsolutePercentAgainstInnerSize: 4,
230
- All: 2147483647,
231
- Classic: 2147483646
232
- };
233
- var ExperimentalFeature = {
234
- WebFlexBasis: 0
235
- };
236
- var FlexDirection = {
237
- Column: 0,
238
- ColumnReverse: 1,
239
- Row: 2,
240
- RowReverse: 3
241
- };
242
- var Gutter = {
243
- Column: 0,
244
- Row: 1,
245
- All: 2
246
- };
247
- var Justify = {
248
- FlexStart: 0,
249
- Center: 1,
250
- FlexEnd: 2,
251
- SpaceBetween: 3,
252
- SpaceAround: 4,
253
- SpaceEvenly: 5
254
- };
255
- var LogLevel = {
256
- Error: 0,
257
- Warn: 1,
258
- Info: 2,
259
- Debug: 3,
260
- Verbose: 4,
261
- Fatal: 5
262
- };
263
- var MeasureMode = {
264
- Undefined: 0,
265
- Exactly: 1,
266
- AtMost: 2
267
- };
268
- var NodeType = {
269
- Default: 0,
270
- Text: 1
271
- };
272
- var Overflow = {
273
- Visible: 0,
274
- Hidden: 1,
275
- Scroll: 2
276
- };
277
- var PositionType = {
278
- Static: 0,
279
- Relative: 1,
280
- Absolute: 2
281
- };
282
- var Unit = {
283
- Undefined: 0,
284
- Point: 1,
285
- Percent: 2,
286
- Auto: 3
287
- };
288
- var Wrap = {
289
- NoWrap: 0,
290
- Wrap: 1,
291
- WrapReverse: 2
292
- };
293
- var EDGE_LEFT = Edge.Left;
294
- var EDGE_TOP = Edge.Top;
295
- var EDGE_RIGHT = Edge.Right;
296
- var EDGE_BOTTOM = Edge.Bottom;
297
- var EDGE_START = Edge.Start;
298
- var EDGE_END = Edge.End;
299
- var EDGE_HORIZONTAL = Edge.Horizontal;
300
- var EDGE_VERTICAL = Edge.Vertical;
301
- var EDGE_ALL = Edge.All;
302
- var FLEX_DIRECTION_COLUMN = FlexDirection.Column;
303
- var FLEX_DIRECTION_COLUMN_REVERSE = FlexDirection.ColumnReverse;
304
- var FLEX_DIRECTION_ROW = FlexDirection.Row;
305
- var FLEX_DIRECTION_ROW_REVERSE = FlexDirection.RowReverse;
306
- var JUSTIFY_FLEX_START = Justify.FlexStart;
307
- var JUSTIFY_CENTER = Justify.Center;
308
- var JUSTIFY_FLEX_END = Justify.FlexEnd;
309
- var JUSTIFY_SPACE_BETWEEN = Justify.SpaceBetween;
310
- var JUSTIFY_SPACE_AROUND = Justify.SpaceAround;
311
- var JUSTIFY_SPACE_EVENLY = Justify.SpaceEvenly;
312
- var ALIGN_AUTO = Align.Auto;
313
- var ALIGN_FLEX_START = Align.FlexStart;
314
- var ALIGN_CENTER = Align.Center;
315
- var ALIGN_FLEX_END = Align.FlexEnd;
316
- var ALIGN_STRETCH = Align.Stretch;
317
- var ALIGN_BASELINE = Align.Baseline;
318
- var ALIGN_SPACE_BETWEEN = Align.SpaceBetween;
319
- var ALIGN_SPACE_AROUND = Align.SpaceAround;
320
- var ALIGN_SPACE_EVENLY = Align.SpaceEvenly;
321
- var WRAP_NO_WRAP = Wrap.NoWrap;
322
- var WRAP_WRAP = Wrap.Wrap;
323
- var WRAP_WRAP_REVERSE = Wrap.WrapReverse;
324
- var OVERFLOW_VISIBLE = Overflow.Visible;
325
- var OVERFLOW_HIDDEN = Overflow.Hidden;
326
- var OVERFLOW_SCROLL = Overflow.Scroll;
327
- var DISPLAY_FLEX = Display.Flex;
328
- var DISPLAY_NONE = Display.None;
329
- var POSITION_TYPE_STATIC = PositionType.Static;
330
- var POSITION_TYPE_RELATIVE = PositionType.Relative;
331
- var POSITION_TYPE_ABSOLUTE = PositionType.Absolute;
332
- var DIRECTION_INHERIT = Direction.Inherit;
333
- var DIRECTION_LTR = Direction.LTR;
334
- var DIRECTION_RTL = Direction.RTL;
335
- function parseValue(value) {
336
- if (value === undefined) {
337
- return { unit: Unit.Undefined, asNumber: undefined };
338
- }
339
- if (value === "auto") {
340
- return { unit: Unit.Auto, asNumber: undefined };
341
138
  }
342
- if (typeof value === "string" && value.endsWith("%")) {
343
- return { unit: Unit.Percent, asNumber: parseFloat(value) };
344
- }
345
- return { unit: Unit.Point, asNumber: value };
346
- }
347
- function unpackValue(packed) {
348
- const p = BigInt(packed);
349
- const unit = Number(p & 0xffffffffn);
350
- const valueBits = Number(p >> 32n & 0xffffffffn);
351
- const buffer = new ArrayBuffer(4);
352
- const view = new DataView(buffer);
353
- view.setUint32(0, valueBits, true);
354
- const value = view.getFloat32(0, true);
355
- return { unit, value };
356
- }
357
- var lib = dlopen(getLibPath(), {
358
- ygConfigNew: { args: [], returns: "ptr" },
359
- ygConfigFree: { args: ["ptr"], returns: "void" },
360
- ygConfigGetDefault: { args: [], returns: "ptr" },
361
- ygConfigSetUseWebDefaults: { args: ["ptr", "bool"], returns: "void" },
362
- ygConfigGetUseWebDefaults: { args: ["ptr"], returns: "bool" },
363
- ygConfigSetPointScaleFactor: { args: ["ptr", "f32"], returns: "void" },
364
- ygConfigGetPointScaleFactor: { args: ["ptr"], returns: "f32" },
365
- ygConfigSetErrata: { args: ["ptr", "i32"], returns: "void" },
366
- ygConfigGetErrata: { args: ["ptr"], returns: "i32" },
367
- ygConfigSetExperimentalFeatureEnabled: {
368
- args: ["ptr", "i32", "bool"],
369
- returns: "void"
370
- },
371
- ygConfigIsExperimentalFeatureEnabled: {
372
- args: ["ptr", "i32"],
373
- returns: "bool"
374
- },
375
- ygNodeNew: { args: [], returns: "ptr" },
376
- ygNodeNewWithConfig: { args: ["ptr"], returns: "ptr" },
377
- ygNodeClone: { args: ["ptr"], returns: "ptr" },
378
- ygNodeFree: { args: ["ptr"], returns: "void" },
379
- ygNodeFreeRecursive: { args: ["ptr"], returns: "void" },
380
- ygNodeReset: { args: ["ptr"], returns: "void" },
381
- ygNodeCopyStyle: { args: ["ptr", "ptr"], returns: "void" },
382
- ygNodeSetIsReferenceBaseline: { args: ["ptr", "bool"], returns: "void" },
383
- ygNodeIsReferenceBaseline: { args: ["ptr"], returns: "bool" },
384
- ygNodeSetAlwaysFormsContainingBlock: {
385
- args: ["ptr", "bool"],
386
- returns: "void"
387
- },
388
- ygNodeInsertChild: { args: ["ptr", "ptr", "u64"], returns: "void" },
389
- ygNodeRemoveChild: { args: ["ptr", "ptr"], returns: "void" },
390
- ygNodeRemoveAllChildren: { args: ["ptr"], returns: "void" },
391
- ygNodeGetChild: { args: ["ptr", "u64"], returns: "ptr" },
392
- ygNodeGetChildCount: { args: ["ptr"], returns: "u64" },
393
- ygNodeGetParent: { args: ["ptr"], returns: "ptr" },
394
- ygNodeCalculateLayout: { args: ["ptr", "f32", "f32", "i32"], returns: "void" },
395
- ygNodeGetHasNewLayout: { args: ["ptr"], returns: "bool" },
396
- ygNodeSetHasNewLayout: { args: ["ptr", "bool"], returns: "void" },
397
- ygNodeMarkDirty: { args: ["ptr"], returns: "void" },
398
- ygNodeIsDirty: { args: ["ptr"], returns: "bool" },
399
- ygNodeLayoutGetLeft: { args: ["ptr"], returns: "f32" },
400
- ygNodeLayoutGetTop: { args: ["ptr"], returns: "f32" },
401
- ygNodeLayoutGetRight: { args: ["ptr"], returns: "f32" },
402
- ygNodeLayoutGetBottom: { args: ["ptr"], returns: "f32" },
403
- ygNodeLayoutGetWidth: { args: ["ptr"], returns: "f32" },
404
- ygNodeLayoutGetHeight: { args: ["ptr"], returns: "f32" },
405
- ygNodeLayoutGetBorder: { args: ["ptr", "i32"], returns: "f32" },
406
- ygNodeLayoutGetMargin: { args: ["ptr", "i32"], returns: "f32" },
407
- ygNodeLayoutGetPadding: { args: ["ptr", "i32"], returns: "f32" },
408
- ygNodeStyleSetDirection: { args: ["ptr", "i32"], returns: "void" },
409
- ygNodeStyleGetDirection: { args: ["ptr"], returns: "i32" },
410
- ygNodeStyleSetFlexDirection: { args: ["ptr", "i32"], returns: "void" },
411
- ygNodeStyleGetFlexDirection: { args: ["ptr"], returns: "i32" },
412
- ygNodeStyleSetJustifyContent: { args: ["ptr", "i32"], returns: "void" },
413
- ygNodeStyleGetJustifyContent: { args: ["ptr"], returns: "i32" },
414
- ygNodeStyleSetAlignContent: { args: ["ptr", "i32"], returns: "void" },
415
- ygNodeStyleGetAlignContent: { args: ["ptr"], returns: "i32" },
416
- ygNodeStyleSetAlignItems: { args: ["ptr", "i32"], returns: "void" },
417
- ygNodeStyleGetAlignItems: { args: ["ptr"], returns: "i32" },
418
- ygNodeStyleSetAlignSelf: { args: ["ptr", "i32"], returns: "void" },
419
- ygNodeStyleGetAlignSelf: { args: ["ptr"], returns: "i32" },
420
- ygNodeStyleSetPositionType: { args: ["ptr", "i32"], returns: "void" },
421
- ygNodeStyleGetPositionType: { args: ["ptr"], returns: "i32" },
422
- ygNodeStyleSetFlexWrap: { args: ["ptr", "i32"], returns: "void" },
423
- ygNodeStyleGetFlexWrap: { args: ["ptr"], returns: "i32" },
424
- ygNodeStyleSetOverflow: { args: ["ptr", "i32"], returns: "void" },
425
- ygNodeStyleGetOverflow: { args: ["ptr"], returns: "i32" },
426
- ygNodeStyleSetDisplay: { args: ["ptr", "i32"], returns: "void" },
427
- ygNodeStyleGetDisplay: { args: ["ptr"], returns: "i32" },
428
- ygNodeStyleSetBoxSizing: { args: ["ptr", "i32"], returns: "void" },
429
- ygNodeStyleGetBoxSizing: { args: ["ptr"], returns: "i32" },
430
- ygNodeStyleSetFlex: { args: ["ptr", "f32"], returns: "void" },
431
- ygNodeStyleGetFlex: { args: ["ptr"], returns: "f32" },
432
- ygNodeStyleSetFlexGrow: { args: ["ptr", "f32"], returns: "void" },
433
- ygNodeStyleGetFlexGrow: { args: ["ptr"], returns: "f32" },
434
- ygNodeStyleSetFlexShrink: { args: ["ptr", "f32"], returns: "void" },
435
- ygNodeStyleGetFlexShrink: { args: ["ptr"], returns: "f32" },
436
- ygNodeStyleSetFlexBasis: { args: ["ptr", "f32"], returns: "void" },
437
- ygNodeStyleSetFlexBasisPercent: { args: ["ptr", "f32"], returns: "void" },
438
- ygNodeStyleSetFlexBasisAuto: { args: ["ptr"], returns: "void" },
439
- ygNodeStyleSetPosition: { args: ["ptr", "i32", "f32"], returns: "void" },
440
- ygNodeStyleSetPositionPercent: { args: ["ptr", "i32", "f32"], returns: "void" },
441
- ygNodeStyleSetPositionAuto: { args: ["ptr", "i32"], returns: "void" },
442
- ygNodeStyleSetMargin: { args: ["ptr", "i32", "f32"], returns: "void" },
443
- ygNodeStyleSetMarginPercent: { args: ["ptr", "i32", "f32"], returns: "void" },
444
- ygNodeStyleSetMarginAuto: { args: ["ptr", "i32"], returns: "void" },
445
- ygNodeStyleSetPadding: { args: ["ptr", "i32", "f32"], returns: "void" },
446
- ygNodeStyleSetPaddingPercent: { args: ["ptr", "i32", "f32"], returns: "void" },
447
- ygNodeStyleSetBorder: { args: ["ptr", "i32", "f32"], returns: "void" },
448
- ygNodeStyleGetBorder: { args: ["ptr", "i32"], returns: "f32" },
449
- ygNodeStyleSetGap: { args: ["ptr", "i32", "f32"], returns: "void" },
450
- ygNodeStyleSetGapPercent: { args: ["ptr", "i32", "f32"], returns: "void" },
451
- ygNodeStyleSetWidth: { args: ["ptr", "f32"], returns: "void" },
452
- ygNodeStyleSetWidthPercent: { args: ["ptr", "f32"], returns: "void" },
453
- ygNodeStyleSetWidthAuto: { args: ["ptr"], returns: "void" },
454
- ygNodeStyleSetHeight: { args: ["ptr", "f32"], returns: "void" },
455
- ygNodeStyleSetHeightPercent: { args: ["ptr", "f32"], returns: "void" },
456
- ygNodeStyleSetHeightAuto: { args: ["ptr"], returns: "void" },
457
- ygNodeStyleSetMinWidth: { args: ["ptr", "f32"], returns: "void" },
458
- ygNodeStyleSetMinWidthPercent: { args: ["ptr", "f32"], returns: "void" },
459
- ygNodeStyleSetMinHeight: { args: ["ptr", "f32"], returns: "void" },
460
- ygNodeStyleSetMinHeightPercent: { args: ["ptr", "f32"], returns: "void" },
461
- ygNodeStyleSetMaxWidth: { args: ["ptr", "f32"], returns: "void" },
462
- ygNodeStyleSetMaxWidthPercent: { args: ["ptr", "f32"], returns: "void" },
463
- ygNodeStyleSetMaxHeight: { args: ["ptr", "f32"], returns: "void" },
464
- ygNodeStyleSetMaxHeightPercent: { args: ["ptr", "f32"], returns: "void" },
465
- ygNodeStyleSetAspectRatio: { args: ["ptr", "f32"], returns: "void" },
466
- ygNodeStyleGetAspectRatio: { args: ["ptr"], returns: "f32" },
467
- ygNodeSetContext: { args: ["ptr", "ptr"], returns: "void" },
468
- ygNodeGetContext: { args: ["ptr"], returns: "ptr" },
469
- ygNodeSetMeasureFunc: { args: ["ptr", "ptr"], returns: "void" },
470
- ygNodeUnsetMeasureFunc: { args: ["ptr"], returns: "void" },
471
- ygNodeHasMeasureFunc: { args: ["ptr"], returns: "bool" },
472
- ygNodeSetBaselineFunc: { args: ["ptr", "ptr"], returns: "void" },
473
- ygNodeUnsetBaselineFunc: { args: ["ptr"], returns: "void" },
474
- ygNodeHasBaselineFunc: { args: ["ptr"], returns: "bool" },
475
- ygNodeSetDirtiedFunc: { args: ["ptr", "ptr"], returns: "void" },
476
- ygNodeUnsetDirtiedFunc: { args: ["ptr"], returns: "void" },
477
- ygNodeGetDirtiedFunc: { args: ["ptr"], returns: "ptr" },
478
- ygCreateSize: { args: ["f32", "f32"], returns: "u64" },
479
- ygStoreMeasureResult: { args: ["f32", "f32"], returns: "void" },
480
- ygStoreBaselineResult: { args: ["f32"], returns: "void" },
481
- ygNodeSetMeasureFuncTrampoline: { args: ["ptr", "ptr"], returns: "void" },
482
- ygNodeUnsetMeasureFuncTrampoline: { args: ["ptr"], returns: "void" },
483
- ygNodeSetBaselineFuncTrampoline: { args: ["ptr", "ptr"], returns: "void" },
484
- ygNodeUnsetBaselineFuncTrampoline: { args: ["ptr"], returns: "void" },
485
- ygNodeFreeCallbacks: { args: ["ptr"], returns: "void" },
486
- ygNodeStyleGetWidthPacked: { args: ["ptr"], returns: "u64" },
487
- ygNodeStyleGetHeightPacked: { args: ["ptr"], returns: "u64" },
488
- ygNodeStyleGetMinWidthPacked: { args: ["ptr"], returns: "u64" },
489
- ygNodeStyleGetMinHeightPacked: { args: ["ptr"], returns: "u64" },
490
- ygNodeStyleGetMaxWidthPacked: { args: ["ptr"], returns: "u64" },
491
- ygNodeStyleGetMaxHeightPacked: { args: ["ptr"], returns: "u64" },
492
- ygNodeStyleGetMarginPacked: { args: ["ptr", "i32"], returns: "u64" },
493
- ygNodeStyleGetPaddingPacked: { args: ["ptr", "i32"], returns: "u64" },
494
- ygNodeStyleGetPositionPacked: { args: ["ptr", "i32"], returns: "u64" },
495
- ygNodeStyleGetGapPacked: { args: ["ptr", "i32"], returns: "u64" },
496
- ygNodeStyleGetFlexBasisPacked: { args: ["ptr"], returns: "u64" }
497
- });
498
- var yg = lib.symbols;
139
+ exports.Align = {
140
+ Auto: 0,
141
+ FlexStart: 1,
142
+ Center: 2,
143
+ FlexEnd: 3,
144
+ Stretch: 4,
145
+ Baseline: 5,
146
+ SpaceBetween: 6,
147
+ SpaceAround: 7,
148
+ SpaceEvenly: 8
149
+ };
150
+ exports.BoxSizing = {
151
+ BorderBox: 0,
152
+ ContentBox: 1
153
+ };
154
+ exports.Dimension = {
155
+ Width: 0,
156
+ Height: 1
157
+ };
158
+ exports.Direction = {
159
+ Inherit: 0,
160
+ LTR: 1,
161
+ RTL: 2
162
+ };
163
+ exports.Display = {
164
+ Flex: 0,
165
+ None: 1,
166
+ Contents: 2
167
+ };
168
+ exports.Edge = {
169
+ Left: 0,
170
+ Top: 1,
171
+ Right: 2,
172
+ Bottom: 3,
173
+ Start: 4,
174
+ End: 5,
175
+ Horizontal: 6,
176
+ Vertical: 7,
177
+ All: 8
178
+ };
179
+ exports.Errata = {
180
+ None: 0,
181
+ StretchFlexBasis: 1,
182
+ AbsolutePositionWithoutInsetsExcludesPadding: 2,
183
+ AbsolutePercentAgainstInnerSize: 4,
184
+ All: 2147483647,
185
+ Classic: 2147483646
186
+ };
187
+ exports.ExperimentalFeature = {
188
+ WebFlexBasis: 0
189
+ };
190
+ exports.FlexDirection = {
191
+ Column: 0,
192
+ ColumnReverse: 1,
193
+ Row: 2,
194
+ RowReverse: 3
195
+ };
196
+ exports.Gutter = {
197
+ Column: 0,
198
+ Row: 1,
199
+ All: 2
200
+ };
201
+ exports.Justify = {
202
+ FlexStart: 0,
203
+ Center: 1,
204
+ FlexEnd: 2,
205
+ SpaceBetween: 3,
206
+ SpaceAround: 4,
207
+ SpaceEvenly: 5
208
+ };
209
+ exports.LogLevel = {
210
+ Error: 0,
211
+ Warn: 1,
212
+ Info: 2,
213
+ Debug: 3,
214
+ Verbose: 4,
215
+ Fatal: 5
216
+ };
217
+ exports.MeasureMode = {
218
+ Undefined: 0,
219
+ Exactly: 1,
220
+ AtMost: 2
221
+ };
222
+ exports.NodeType = {
223
+ Default: 0,
224
+ Text: 1
225
+ };
226
+ exports.Overflow = {
227
+ Visible: 0,
228
+ Hidden: 1,
229
+ Scroll: 2
230
+ };
231
+ exports.PositionType = {
232
+ Static: 0,
233
+ Relative: 1,
234
+ Absolute: 2
235
+ };
236
+ exports.Unit = {
237
+ Undefined: 0,
238
+ Point: 1,
239
+ Percent: 2,
240
+ Auto: 3
241
+ };
242
+ exports.Wrap = {
243
+ NoWrap: 0,
244
+ Wrap: 1,
245
+ WrapReverse: 2
246
+ };
247
+ exports.EDGE_LEFT = exports.Edge.Left;
248
+ exports.EDGE_TOP = exports.Edge.Top;
249
+ exports.EDGE_RIGHT = exports.Edge.Right;
250
+ exports.EDGE_BOTTOM = exports.Edge.Bottom;
251
+ exports.EDGE_START = exports.Edge.Start;
252
+ exports.EDGE_END = exports.Edge.End;
253
+ exports.EDGE_HORIZONTAL = exports.Edge.Horizontal;
254
+ exports.EDGE_VERTICAL = exports.Edge.Vertical;
255
+ exports.EDGE_ALL = exports.Edge.All;
256
+ exports.FLEX_DIRECTION_COLUMN = exports.FlexDirection.Column;
257
+ exports.FLEX_DIRECTION_COLUMN_REVERSE = exports.FlexDirection.ColumnReverse;
258
+ exports.FLEX_DIRECTION_ROW = exports.FlexDirection.Row;
259
+ exports.FLEX_DIRECTION_ROW_REVERSE = exports.FlexDirection.RowReverse;
260
+ exports.JUSTIFY_FLEX_START = exports.Justify.FlexStart;
261
+ exports.JUSTIFY_CENTER = exports.Justify.Center;
262
+ exports.JUSTIFY_FLEX_END = exports.Justify.FlexEnd;
263
+ exports.JUSTIFY_SPACE_BETWEEN = exports.Justify.SpaceBetween;
264
+ exports.JUSTIFY_SPACE_AROUND = exports.Justify.SpaceAround;
265
+ exports.JUSTIFY_SPACE_EVENLY = exports.Justify.SpaceEvenly;
266
+ exports.ALIGN_AUTO = exports.Align.Auto;
267
+ exports.ALIGN_FLEX_START = exports.Align.FlexStart;
268
+ exports.ALIGN_CENTER = exports.Align.Center;
269
+ exports.ALIGN_FLEX_END = exports.Align.FlexEnd;
270
+ exports.ALIGN_STRETCH = exports.Align.Stretch;
271
+ exports.ALIGN_BASELINE = exports.Align.Baseline;
272
+ exports.ALIGN_SPACE_BETWEEN = exports.Align.SpaceBetween;
273
+ exports.ALIGN_SPACE_AROUND = exports.Align.SpaceAround;
274
+ exports.ALIGN_SPACE_EVENLY = exports.Align.SpaceEvenly;
275
+ exports.WRAP_NO_WRAP = exports.Wrap.NoWrap;
276
+ exports.WRAP_WRAP = exports.Wrap.Wrap;
277
+ exports.WRAP_WRAP_REVERSE = exports.Wrap.WrapReverse;
278
+ exports.OVERFLOW_VISIBLE = exports.Overflow.Visible;
279
+ exports.OVERFLOW_HIDDEN = exports.Overflow.Hidden;
280
+ exports.OVERFLOW_SCROLL = exports.Overflow.Scroll;
281
+ exports.DISPLAY_FLEX = exports.Display.Flex;
282
+ exports.DISPLAY_NONE = exports.Display.None;
283
+ exports.POSITION_TYPE_STATIC = exports.PositionType.Static;
284
+ exports.POSITION_TYPE_RELATIVE = exports.PositionType.Relative;
285
+ exports.POSITION_TYPE_ABSOLUTE = exports.PositionType.Absolute;
286
+ exports.DIRECTION_INHERIT = exports.Direction.Inherit;
287
+ exports.DIRECTION_LTR = exports.Direction.LTR;
288
+ exports.DIRECTION_RTL = exports.Direction.RTL;
289
+ function parseValue(value) {
290
+ if (value === undefined) {
291
+ return { unit: exports.Unit.Undefined, asNumber: undefined };
292
+ }
293
+ if (value === "auto") {
294
+ return { unit: exports.Unit.Auto, asNumber: undefined };
295
+ }
296
+ if (typeof value === "string" && value.endsWith("%")) {
297
+ return { unit: exports.Unit.Percent, asNumber: parseFloat(value) };
298
+ }
299
+ return { unit: exports.Unit.Point, asNumber: value };
300
+ }
301
+ function unpackValue(packed) {
302
+ const p = BigInt(packed);
303
+ const unit = Number(p & 0xffffffffn);
304
+ const valueBits = Number(p >> 32n & 0xffffffffn);
305
+ const buffer = new ArrayBuffer(4);
306
+ const view = new DataView(buffer);
307
+ view.setUint32(0, valueBits, true);
308
+ const value = view.getFloat32(0, true);
309
+ return { unit, value };
310
+ }
311
+ var lib = (0, bun_ffi_1.dlopen)(getLibPath(), {
312
+ ygConfigNew: { args: [], returns: "ptr" },
313
+ ygConfigFree: { args: ["ptr"], returns: "void" },
314
+ ygConfigGetDefault: { args: [], returns: "ptr" },
315
+ ygConfigSetUseWebDefaults: { args: ["ptr", "bool"], returns: "void" },
316
+ ygConfigGetUseWebDefaults: { args: ["ptr"], returns: "bool" },
317
+ ygConfigSetPointScaleFactor: { args: ["ptr", "f32"], returns: "void" },
318
+ ygConfigGetPointScaleFactor: { args: ["ptr"], returns: "f32" },
319
+ ygConfigSetErrata: { args: ["ptr", "i32"], returns: "void" },
320
+ ygConfigGetErrata: { args: ["ptr"], returns: "i32" },
321
+ ygConfigSetExperimentalFeatureEnabled: {
322
+ args: ["ptr", "i32", "bool"],
323
+ returns: "void"
324
+ },
325
+ ygConfigIsExperimentalFeatureEnabled: {
326
+ args: ["ptr", "i32"],
327
+ returns: "bool"
328
+ },
329
+ ygNodeNew: { args: [], returns: "ptr" },
330
+ ygNodeNewWithConfig: { args: ["ptr"], returns: "ptr" },
331
+ ygNodeClone: { args: ["ptr"], returns: "ptr" },
332
+ ygNodeFree: { args: ["ptr"], returns: "void" },
333
+ ygNodeFreeRecursive: { args: ["ptr"], returns: "void" },
334
+ ygNodeReset: { args: ["ptr"], returns: "void" },
335
+ ygNodeCopyStyle: { args: ["ptr", "ptr"], returns: "void" },
336
+ ygNodeSetIsReferenceBaseline: { args: ["ptr", "bool"], returns: "void" },
337
+ ygNodeIsReferenceBaseline: { args: ["ptr"], returns: "bool" },
338
+ ygNodeSetAlwaysFormsContainingBlock: {
339
+ args: ["ptr", "bool"],
340
+ returns: "void"
341
+ },
342
+ ygNodeInsertChild: { args: ["ptr", "ptr", "u64"], returns: "void" },
343
+ ygNodeRemoveChild: { args: ["ptr", "ptr"], returns: "void" },
344
+ ygNodeRemoveAllChildren: { args: ["ptr"], returns: "void" },
345
+ ygNodeGetChild: { args: ["ptr", "u64"], returns: "ptr" },
346
+ ygNodeGetChildCount: { args: ["ptr"], returns: "u64" },
347
+ ygNodeGetParent: { args: ["ptr"], returns: "ptr" },
348
+ ygNodeCalculateLayout: { args: ["ptr", "f32", "f32", "i32"], returns: "void" },
349
+ ygNodeGetHasNewLayout: { args: ["ptr"], returns: "bool" },
350
+ ygNodeSetHasNewLayout: { args: ["ptr", "bool"], returns: "void" },
351
+ ygNodeMarkDirty: { args: ["ptr"], returns: "void" },
352
+ ygNodeIsDirty: { args: ["ptr"], returns: "bool" },
353
+ ygNodeLayoutGetLeft: { args: ["ptr"], returns: "f32" },
354
+ ygNodeLayoutGetTop: { args: ["ptr"], returns: "f32" },
355
+ ygNodeLayoutGetRight: { args: ["ptr"], returns: "f32" },
356
+ ygNodeLayoutGetBottom: { args: ["ptr"], returns: "f32" },
357
+ ygNodeLayoutGetWidth: { args: ["ptr"], returns: "f32" },
358
+ ygNodeLayoutGetHeight: { args: ["ptr"], returns: "f32" },
359
+ ygNodeLayoutGetBorder: { args: ["ptr", "i32"], returns: "f32" },
360
+ ygNodeLayoutGetMargin: { args: ["ptr", "i32"], returns: "f32" },
361
+ ygNodeLayoutGetPadding: { args: ["ptr", "i32"], returns: "f32" },
362
+ ygNodeStyleSetDirection: { args: ["ptr", "i32"], returns: "void" },
363
+ ygNodeStyleGetDirection: { args: ["ptr"], returns: "i32" },
364
+ ygNodeStyleSetFlexDirection: { args: ["ptr", "i32"], returns: "void" },
365
+ ygNodeStyleGetFlexDirection: { args: ["ptr"], returns: "i32" },
366
+ ygNodeStyleSetJustifyContent: { args: ["ptr", "i32"], returns: "void" },
367
+ ygNodeStyleGetJustifyContent: { args: ["ptr"], returns: "i32" },
368
+ ygNodeStyleSetAlignContent: { args: ["ptr", "i32"], returns: "void" },
369
+ ygNodeStyleGetAlignContent: { args: ["ptr"], returns: "i32" },
370
+ ygNodeStyleSetAlignItems: { args: ["ptr", "i32"], returns: "void" },
371
+ ygNodeStyleGetAlignItems: { args: ["ptr"], returns: "i32" },
372
+ ygNodeStyleSetAlignSelf: { args: ["ptr", "i32"], returns: "void" },
373
+ ygNodeStyleGetAlignSelf: { args: ["ptr"], returns: "i32" },
374
+ ygNodeStyleSetPositionType: { args: ["ptr", "i32"], returns: "void" },
375
+ ygNodeStyleGetPositionType: { args: ["ptr"], returns: "i32" },
376
+ ygNodeStyleSetFlexWrap: { args: ["ptr", "i32"], returns: "void" },
377
+ ygNodeStyleGetFlexWrap: { args: ["ptr"], returns: "i32" },
378
+ ygNodeStyleSetOverflow: { args: ["ptr", "i32"], returns: "void" },
379
+ ygNodeStyleGetOverflow: { args: ["ptr"], returns: "i32" },
380
+ ygNodeStyleSetDisplay: { args: ["ptr", "i32"], returns: "void" },
381
+ ygNodeStyleGetDisplay: { args: ["ptr"], returns: "i32" },
382
+ ygNodeStyleSetBoxSizing: { args: ["ptr", "i32"], returns: "void" },
383
+ ygNodeStyleGetBoxSizing: { args: ["ptr"], returns: "i32" },
384
+ ygNodeStyleSetFlex: { args: ["ptr", "f32"], returns: "void" },
385
+ ygNodeStyleGetFlex: { args: ["ptr"], returns: "f32" },
386
+ ygNodeStyleSetFlexGrow: { args: ["ptr", "f32"], returns: "void" },
387
+ ygNodeStyleGetFlexGrow: { args: ["ptr"], returns: "f32" },
388
+ ygNodeStyleSetFlexShrink: { args: ["ptr", "f32"], returns: "void" },
389
+ ygNodeStyleGetFlexShrink: { args: ["ptr"], returns: "f32" },
390
+ ygNodeStyleSetFlexBasis: { args: ["ptr", "f32"], returns: "void" },
391
+ ygNodeStyleSetFlexBasisPercent: { args: ["ptr", "f32"], returns: "void" },
392
+ ygNodeStyleSetFlexBasisAuto: { args: ["ptr"], returns: "void" },
393
+ ygNodeStyleSetPosition: { args: ["ptr", "i32", "f32"], returns: "void" },
394
+ ygNodeStyleSetPositionPercent: { args: ["ptr", "i32", "f32"], returns: "void" },
395
+ ygNodeStyleSetPositionAuto: { args: ["ptr", "i32"], returns: "void" },
396
+ ygNodeStyleSetMargin: { args: ["ptr", "i32", "f32"], returns: "void" },
397
+ ygNodeStyleSetMarginPercent: { args: ["ptr", "i32", "f32"], returns: "void" },
398
+ ygNodeStyleSetMarginAuto: { args: ["ptr", "i32"], returns: "void" },
399
+ ygNodeStyleSetPadding: { args: ["ptr", "i32", "f32"], returns: "void" },
400
+ ygNodeStyleSetPaddingPercent: { args: ["ptr", "i32", "f32"], returns: "void" },
401
+ ygNodeStyleSetBorder: { args: ["ptr", "i32", "f32"], returns: "void" },
402
+ ygNodeStyleGetBorder: { args: ["ptr", "i32"], returns: "f32" },
403
+ ygNodeStyleSetGap: { args: ["ptr", "i32", "f32"], returns: "void" },
404
+ ygNodeStyleSetGapPercent: { args: ["ptr", "i32", "f32"], returns: "void" },
405
+ ygNodeStyleSetWidth: { args: ["ptr", "f32"], returns: "void" },
406
+ ygNodeStyleSetWidthPercent: { args: ["ptr", "f32"], returns: "void" },
407
+ ygNodeStyleSetWidthAuto: { args: ["ptr"], returns: "void" },
408
+ ygNodeStyleSetHeight: { args: ["ptr", "f32"], returns: "void" },
409
+ ygNodeStyleSetHeightPercent: { args: ["ptr", "f32"], returns: "void" },
410
+ ygNodeStyleSetHeightAuto: { args: ["ptr"], returns: "void" },
411
+ ygNodeStyleSetMinWidth: { args: ["ptr", "f32"], returns: "void" },
412
+ ygNodeStyleSetMinWidthPercent: { args: ["ptr", "f32"], returns: "void" },
413
+ ygNodeStyleSetMinHeight: { args: ["ptr", "f32"], returns: "void" },
414
+ ygNodeStyleSetMinHeightPercent: { args: ["ptr", "f32"], returns: "void" },
415
+ ygNodeStyleSetMaxWidth: { args: ["ptr", "f32"], returns: "void" },
416
+ ygNodeStyleSetMaxWidthPercent: { args: ["ptr", "f32"], returns: "void" },
417
+ ygNodeStyleSetMaxHeight: { args: ["ptr", "f32"], returns: "void" },
418
+ ygNodeStyleSetMaxHeightPercent: { args: ["ptr", "f32"], returns: "void" },
419
+ ygNodeStyleSetAspectRatio: { args: ["ptr", "f32"], returns: "void" },
420
+ ygNodeStyleGetAspectRatio: { args: ["ptr"], returns: "f32" },
421
+ ygNodeSetContext: { args: ["ptr", "ptr"], returns: "void" },
422
+ ygNodeGetContext: { args: ["ptr"], returns: "ptr" },
423
+ ygNodeSetMeasureFunc: { args: ["ptr", "ptr"], returns: "void" },
424
+ ygNodeUnsetMeasureFunc: { args: ["ptr"], returns: "void" },
425
+ ygNodeHasMeasureFunc: { args: ["ptr"], returns: "bool" },
426
+ ygNodeSetBaselineFunc: { args: ["ptr", "ptr"], returns: "void" },
427
+ ygNodeUnsetBaselineFunc: { args: ["ptr"], returns: "void" },
428
+ ygNodeHasBaselineFunc: { args: ["ptr"], returns: "bool" },
429
+ ygNodeSetDirtiedFunc: { args: ["ptr", "ptr"], returns: "void" },
430
+ ygNodeUnsetDirtiedFunc: { args: ["ptr"], returns: "void" },
431
+ ygNodeGetDirtiedFunc: { args: ["ptr"], returns: "ptr" },
432
+ ygCreateSize: { args: ["f32", "f32"], returns: "u64" },
433
+ ygStoreMeasureResult: { args: ["f32", "f32"], returns: "void" },
434
+ ygStoreBaselineResult: { args: ["f32"], returns: "void" },
435
+ ygNodeSetMeasureFuncTrampoline: { args: ["ptr", "ptr"], returns: "void" },
436
+ ygNodeUnsetMeasureFuncTrampoline: { args: ["ptr"], returns: "void" },
437
+ ygNodeSetBaselineFuncTrampoline: { args: ["ptr", "ptr"], returns: "void" },
438
+ ygNodeUnsetBaselineFuncTrampoline: { args: ["ptr"], returns: "void" },
439
+ ygNodeFreeCallbacks: { args: ["ptr"], returns: "void" },
440
+ ygNodeStyleGetWidthPacked: { args: ["ptr"], returns: "u64" },
441
+ ygNodeStyleGetHeightPacked: { args: ["ptr"], returns: "u64" },
442
+ ygNodeStyleGetMinWidthPacked: { args: ["ptr"], returns: "u64" },
443
+ ygNodeStyleGetMinHeightPacked: { args: ["ptr"], returns: "u64" },
444
+ ygNodeStyleGetMaxWidthPacked: { args: ["ptr"], returns: "u64" },
445
+ ygNodeStyleGetMaxHeightPacked: { args: ["ptr"], returns: "u64" },
446
+ ygNodeStyleGetMarginPacked: { args: ["ptr", "i32"], returns: "u64" },
447
+ ygNodeStyleGetPaddingPacked: { args: ["ptr", "i32"], returns: "u64" },
448
+ ygNodeStyleGetPositionPacked: { args: ["ptr", "i32"], returns: "u64" },
449
+ ygNodeStyleGetGapPacked: { args: ["ptr", "i32"], returns: "u64" },
450
+ ygNodeStyleGetFlexBasisPacked: { args: ["ptr"], returns: "u64" }
451
+ });
452
+ var yg = lib.symbols;
499
453
 
500
- class Node {
501
- ptr;
502
- measureCallback = null;
503
- baselineCallback = null;
504
- dirtiedCallback = null;
505
- constructor(ptr) {
506
- this.ptr = ptr;
507
- }
508
- static create(config) {
509
- const ptr = config ? yg.ygNodeNewWithConfig(config["ptr"]) : yg.ygNodeNew();
510
- if (!ptr)
511
- throw new Error("Failed to create node");
512
- return new Node(ptr);
513
- }
514
- static createDefault() {
515
- return Node.create();
516
- }
517
- static createWithConfig(config) {
518
- return Node.create(config);
519
- }
520
- static destroy(node) {
521
- node.free();
522
- }
523
- free() {
524
- this.unsetMeasureFunc();
525
- this.unsetBaselineFunc();
526
- this.unsetDirtiedFunc();
527
- yg.ygNodeFree(this.ptr);
528
- }
529
- freeRecursive() {
530
- this.cleanupCallbacks();
531
- yg.ygNodeFreeRecursive(this.ptr);
532
- }
533
- reset() {
534
- this.cleanupCallbacks();
535
- yg.ygNodeReset(this.ptr);
536
- }
537
- cleanupCallbacks() {
538
- if (this.measureCallback) {
539
- this.measureCallback.close();
540
- this.measureCallback = null;
454
+ class Node {
455
+ ptr;
456
+ _freed = false;
457
+ measureCallback = null;
458
+ baselineCallback = null;
459
+ dirtiedCallback = null;
460
+ constructor(ptr) {
461
+ this.ptr = ptr;
541
462
  }
542
- if (this.baselineCallback) {
543
- this.baselineCallback.close();
544
- this.baselineCallback = null;
463
+ isFreed() {
464
+ return this._freed;
545
465
  }
546
- if (this.dirtiedCallback) {
547
- this.dirtiedCallback.close();
548
- this.dirtiedCallback = null;
466
+ assertNotFreed() {
467
+ if (this._freed) {
468
+ throw new Error("Cannot access freed Yoga node");
469
+ }
549
470
  }
550
- }
551
- clone() {
552
- const ptr = yg.ygNodeClone(this.ptr);
553
- if (!ptr)
554
- throw new Error("Failed to clone node");
555
- return new Node(ptr);
556
- }
557
- copyStyle(node) {
558
- yg.ygNodeCopyStyle(this.ptr, node.ptr);
559
- }
560
- setIsReferenceBaseline(isReferenceBaseline) {
561
- yg.ygNodeSetIsReferenceBaseline(this.ptr, isReferenceBaseline);
562
- }
563
- isReferenceBaseline() {
564
- return yg.ygNodeIsReferenceBaseline(this.ptr);
565
- }
566
- setAlwaysFormsContainingBlock(alwaysFormsContainingBlock) {
567
- yg.ygNodeSetAlwaysFormsContainingBlock(this.ptr, alwaysFormsContainingBlock);
568
- }
569
- insertChild(child, index) {
570
- yg.ygNodeInsertChild(this.ptr, child.ptr, index);
571
- }
572
- removeChild(child) {
573
- yg.ygNodeRemoveChild(this.ptr, child.ptr);
574
- }
575
- removeAllChildren() {
576
- yg.ygNodeRemoveAllChildren(this.ptr);
577
- }
578
- getChild(index) {
579
- const ptr = yg.ygNodeGetChild(this.ptr, index);
580
- return ptr ? new Node(ptr) : null;
581
- }
582
- getChildCount() {
583
- return Number(yg.ygNodeGetChildCount(this.ptr));
584
- }
585
- getParent() {
586
- const ptr = yg.ygNodeGetParent(this.ptr);
587
- return ptr ? new Node(ptr) : null;
588
- }
589
- calculateLayout(width, height, direction = Direction.LTR) {
590
- const w = width === "auto" || width === undefined ? NaN : width;
591
- const h = height === "auto" || height === undefined ? NaN : height;
592
- yg.ygNodeCalculateLayout(this.ptr, w, h, direction);
593
- }
594
- hasNewLayout() {
595
- return yg.ygNodeGetHasNewLayout(this.ptr);
596
- }
597
- markLayoutSeen() {
598
- yg.ygNodeSetHasNewLayout(this.ptr, false);
599
- }
600
- markDirty() {
601
- yg.ygNodeMarkDirty(this.ptr);
602
- }
603
- isDirty() {
604
- return yg.ygNodeIsDirty(this.ptr);
605
- }
606
- getComputedLayout() {
607
- return {
608
- left: yg.ygNodeLayoutGetLeft(this.ptr),
609
- top: yg.ygNodeLayoutGetTop(this.ptr),
610
- right: yg.ygNodeLayoutGetRight(this.ptr),
611
- bottom: yg.ygNodeLayoutGetBottom(this.ptr),
612
- width: yg.ygNodeLayoutGetWidth(this.ptr),
613
- height: yg.ygNodeLayoutGetHeight(this.ptr)
614
- };
615
- }
616
- getComputedLeft() {
617
- return yg.ygNodeLayoutGetLeft(this.ptr);
618
- }
619
- getComputedTop() {
620
- return yg.ygNodeLayoutGetTop(this.ptr);
621
- }
622
- getComputedRight() {
623
- return yg.ygNodeLayoutGetRight(this.ptr);
624
- }
625
- getComputedBottom() {
626
- return yg.ygNodeLayoutGetBottom(this.ptr);
627
- }
628
- getComputedWidth() {
629
- return yg.ygNodeLayoutGetWidth(this.ptr);
630
- }
631
- getComputedHeight() {
632
- return yg.ygNodeLayoutGetHeight(this.ptr);
633
- }
634
- getComputedBorder(edge) {
635
- return yg.ygNodeLayoutGetBorder(this.ptr, edge);
636
- }
637
- getComputedMargin(edge) {
638
- return yg.ygNodeLayoutGetMargin(this.ptr, edge);
639
- }
640
- getComputedPadding(edge) {
641
- return yg.ygNodeLayoutGetPadding(this.ptr, edge);
642
- }
643
- setDirection(direction) {
644
- yg.ygNodeStyleSetDirection(this.ptr, direction);
645
- }
646
- getDirection() {
647
- return yg.ygNodeStyleGetDirection(this.ptr);
648
- }
649
- setFlexDirection(flexDirection) {
650
- yg.ygNodeStyleSetFlexDirection(this.ptr, flexDirection);
651
- }
652
- getFlexDirection() {
653
- return yg.ygNodeStyleGetFlexDirection(this.ptr);
654
- }
655
- setJustifyContent(justifyContent) {
656
- yg.ygNodeStyleSetJustifyContent(this.ptr, justifyContent);
657
- }
658
- getJustifyContent() {
659
- return yg.ygNodeStyleGetJustifyContent(this.ptr);
660
- }
661
- setAlignContent(alignContent) {
662
- yg.ygNodeStyleSetAlignContent(this.ptr, alignContent);
663
- }
664
- getAlignContent() {
665
- return yg.ygNodeStyleGetAlignContent(this.ptr);
666
- }
667
- setAlignItems(alignItems) {
668
- yg.ygNodeStyleSetAlignItems(this.ptr, alignItems);
669
- }
670
- getAlignItems() {
671
- return yg.ygNodeStyleGetAlignItems(this.ptr);
672
- }
673
- setAlignSelf(alignSelf) {
674
- yg.ygNodeStyleSetAlignSelf(this.ptr, alignSelf);
675
- }
676
- getAlignSelf() {
677
- return yg.ygNodeStyleGetAlignSelf(this.ptr);
678
- }
679
- setPositionType(positionType) {
680
- yg.ygNodeStyleSetPositionType(this.ptr, positionType);
681
- }
682
- getPositionType() {
683
- return yg.ygNodeStyleGetPositionType(this.ptr);
684
- }
685
- setFlexWrap(flexWrap) {
686
- yg.ygNodeStyleSetFlexWrap(this.ptr, flexWrap);
687
- }
688
- getFlexWrap() {
689
- return yg.ygNodeStyleGetFlexWrap(this.ptr);
690
- }
691
- setOverflow(overflow) {
692
- yg.ygNodeStyleSetOverflow(this.ptr, overflow);
693
- }
694
- getOverflow() {
695
- return yg.ygNodeStyleGetOverflow(this.ptr);
696
- }
697
- setDisplay(display) {
698
- yg.ygNodeStyleSetDisplay(this.ptr, display);
699
- }
700
- getDisplay() {
701
- return yg.ygNodeStyleGetDisplay(this.ptr);
702
- }
703
- setBoxSizing(boxSizing) {
704
- yg.ygNodeStyleSetBoxSizing(this.ptr, boxSizing);
705
- }
706
- getBoxSizing() {
707
- return yg.ygNodeStyleGetBoxSizing(this.ptr);
708
- }
709
- setFlex(flex) {
710
- yg.ygNodeStyleSetFlex(this.ptr, flex);
711
- }
712
- getFlex() {
713
- return yg.ygNodeStyleGetFlex(this.ptr);
714
- }
715
- setFlexGrow(flexGrow) {
716
- yg.ygNodeStyleSetFlexGrow(this.ptr, flexGrow);
717
- }
718
- getFlexGrow() {
719
- return yg.ygNodeStyleGetFlexGrow(this.ptr);
720
- }
721
- setFlexShrink(flexShrink) {
722
- yg.ygNodeStyleSetFlexShrink(this.ptr, flexShrink);
723
- }
724
- getFlexShrink() {
725
- return yg.ygNodeStyleGetFlexShrink(this.ptr);
726
- }
727
- setFlexBasis(flexBasis) {
728
- const { unit, asNumber } = parseValue(flexBasis);
729
- if (unit === Unit.Auto) {
730
- yg.ygNodeStyleSetFlexBasisAuto(this.ptr);
731
- } else if (unit === Unit.Percent) {
732
- yg.ygNodeStyleSetFlexBasisPercent(this.ptr, asNumber);
733
- } else if (unit === Unit.Point && asNumber !== undefined) {
734
- yg.ygNodeStyleSetFlexBasis(this.ptr, asNumber);
471
+ static create(config) {
472
+ const ptr = config ? yg.ygNodeNewWithConfig(config["ptr"]) : yg.ygNodeNew();
473
+ if (!ptr)
474
+ throw new Error("Failed to create node");
475
+ return new Node(ptr);
735
476
  }
736
- }
737
- setFlexBasisPercent(flexBasis) {
738
- if (flexBasis !== undefined) {
739
- yg.ygNodeStyleSetFlexBasisPercent(this.ptr, flexBasis);
477
+ static createDefault() {
478
+ return Node.create();
740
479
  }
741
- }
742
- setFlexBasisAuto() {
743
- yg.ygNodeStyleSetFlexBasisAuto(this.ptr);
744
- }
745
- setPosition(edge, position) {
746
- const { unit, asNumber } = parseValue(position);
747
- if (unit === Unit.Percent) {
748
- yg.ygNodeStyleSetPositionPercent(this.ptr, edge, asNumber);
749
- } else if (unit === Unit.Point && asNumber !== undefined) {
750
- yg.ygNodeStyleSetPosition(this.ptr, edge, asNumber);
480
+ static createWithConfig(config) {
481
+ return Node.create(config);
751
482
  }
752
- }
753
- setPositionPercent(edge, position) {
754
- if (position !== undefined) {
755
- yg.ygNodeStyleSetPositionPercent(this.ptr, edge, position);
483
+ static destroy(node) {
484
+ node.free();
756
485
  }
757
- }
758
- setPositionAuto(edge) {
759
- yg.ygNodeStyleSetPositionAuto(this.ptr, edge);
760
- }
761
- setMargin(edge, margin) {
762
- const { unit, asNumber } = parseValue(margin);
763
- if (unit === Unit.Auto) {
764
- yg.ygNodeStyleSetMarginAuto(this.ptr, edge);
765
- } else if (unit === Unit.Percent) {
766
- yg.ygNodeStyleSetMarginPercent(this.ptr, edge, asNumber);
767
- } else if (unit === Unit.Point && asNumber !== undefined) {
768
- yg.ygNodeStyleSetMargin(this.ptr, edge, asNumber);
486
+ free() {
487
+ if (this._freed)
488
+ return;
489
+ this.unsetMeasureFunc();
490
+ this.unsetBaselineFunc();
491
+ this.unsetDirtiedFunc();
492
+ yg.ygNodeFree(this.ptr);
493
+ this._freed = true;
494
+ }
495
+ freeRecursive() {
496
+ if (this._freed)
497
+ return;
498
+ this.cleanupCallbacks();
499
+ yg.ygNodeFreeRecursive(this.ptr);
500
+ this._freed = true;
501
+ }
502
+ reset() {
503
+ this.assertNotFreed();
504
+ this.cleanupCallbacks();
505
+ yg.ygNodeReset(this.ptr);
506
+ }
507
+ cleanupCallbacks() {
508
+ if (this.measureCallback) {
509
+ this.measureCallback.close();
510
+ this.measureCallback = null;
511
+ }
512
+ if (this.baselineCallback) {
513
+ this.baselineCallback.close();
514
+ this.baselineCallback = null;
515
+ }
516
+ if (this.dirtiedCallback) {
517
+ this.dirtiedCallback.close();
518
+ this.dirtiedCallback = null;
519
+ }
520
+ }
521
+ clone() {
522
+ this.assertNotFreed();
523
+ const ptr = yg.ygNodeClone(this.ptr);
524
+ if (!ptr)
525
+ throw new Error("Failed to clone node");
526
+ return new Node(ptr);
527
+ }
528
+ copyStyle(node) {
529
+ this.assertNotFreed();
530
+ yg.ygNodeCopyStyle(this.ptr, node.ptr);
531
+ }
532
+ setIsReferenceBaseline(isReferenceBaseline) {
533
+ this.assertNotFreed();
534
+ yg.ygNodeSetIsReferenceBaseline(this.ptr, isReferenceBaseline);
535
+ }
536
+ isReferenceBaseline() {
537
+ this.assertNotFreed();
538
+ return yg.ygNodeIsReferenceBaseline(this.ptr);
539
+ }
540
+ setAlwaysFormsContainingBlock(alwaysFormsContainingBlock) {
541
+ this.assertNotFreed();
542
+ yg.ygNodeSetAlwaysFormsContainingBlock(this.ptr, alwaysFormsContainingBlock);
543
+ }
544
+ insertChild(child, index) {
545
+ this.assertNotFreed();
546
+ yg.ygNodeInsertChild(this.ptr, child.ptr, index);
547
+ }
548
+ removeChild(child) {
549
+ this.assertNotFreed();
550
+ yg.ygNodeRemoveChild(this.ptr, child.ptr);
551
+ }
552
+ removeAllChildren() {
553
+ this.assertNotFreed();
554
+ yg.ygNodeRemoveAllChildren(this.ptr);
555
+ }
556
+ getChild(index) {
557
+ this.assertNotFreed();
558
+ const ptr = yg.ygNodeGetChild(this.ptr, index);
559
+ return ptr ? new Node(ptr) : null;
560
+ }
561
+ getChildCount() {
562
+ this.assertNotFreed();
563
+ return Number(yg.ygNodeGetChildCount(this.ptr));
564
+ }
565
+ getParent() {
566
+ this.assertNotFreed();
567
+ const ptr = yg.ygNodeGetParent(this.ptr);
568
+ return ptr ? new Node(ptr) : null;
569
+ }
570
+ calculateLayout(width, height, direction = exports.Direction.LTR) {
571
+ this.assertNotFreed();
572
+ const w = width === "auto" || width === undefined ? NaN : width;
573
+ const h = height === "auto" || height === undefined ? NaN : height;
574
+ yg.ygNodeCalculateLayout(this.ptr, w, h, direction);
575
+ }
576
+ hasNewLayout() {
577
+ this.assertNotFreed();
578
+ return yg.ygNodeGetHasNewLayout(this.ptr);
579
+ }
580
+ markLayoutSeen() {
581
+ this.assertNotFreed();
582
+ yg.ygNodeSetHasNewLayout(this.ptr, false);
583
+ }
584
+ markDirty() {
585
+ this.assertNotFreed();
586
+ yg.ygNodeMarkDirty(this.ptr);
587
+ }
588
+ isDirty() {
589
+ this.assertNotFreed();
590
+ return yg.ygNodeIsDirty(this.ptr);
591
+ }
592
+ getComputedLayout() {
593
+ this.assertNotFreed();
594
+ return {
595
+ left: yg.ygNodeLayoutGetLeft(this.ptr),
596
+ top: yg.ygNodeLayoutGetTop(this.ptr),
597
+ right: yg.ygNodeLayoutGetRight(this.ptr),
598
+ bottom: yg.ygNodeLayoutGetBottom(this.ptr),
599
+ width: yg.ygNodeLayoutGetWidth(this.ptr),
600
+ height: yg.ygNodeLayoutGetHeight(this.ptr)
601
+ };
769
602
  }
770
- }
771
- setMarginPercent(edge, margin) {
772
- if (margin !== undefined) {
773
- yg.ygNodeStyleSetMarginPercent(this.ptr, edge, margin);
603
+ getComputedLeft() {
604
+ this.assertNotFreed();
605
+ return yg.ygNodeLayoutGetLeft(this.ptr);
774
606
  }
775
- }
776
- setMarginAuto(edge) {
777
- yg.ygNodeStyleSetMarginAuto(this.ptr, edge);
778
- }
779
- setPadding(edge, padding) {
780
- const { unit, asNumber } = parseValue(padding);
781
- if (unit === Unit.Percent) {
782
- yg.ygNodeStyleSetPaddingPercent(this.ptr, edge, asNumber);
783
- } else if (unit === Unit.Point && asNumber !== undefined) {
784
- yg.ygNodeStyleSetPadding(this.ptr, edge, asNumber);
607
+ getComputedTop() {
608
+ this.assertNotFreed();
609
+ return yg.ygNodeLayoutGetTop(this.ptr);
785
610
  }
786
- }
787
- setPaddingPercent(edge, padding) {
788
- if (padding !== undefined) {
789
- yg.ygNodeStyleSetPaddingPercent(this.ptr, edge, padding);
611
+ getComputedRight() {
612
+ this.assertNotFreed();
613
+ return yg.ygNodeLayoutGetRight(this.ptr);
790
614
  }
791
- }
792
- setBorder(edge, border) {
793
- if (border !== undefined) {
794
- yg.ygNodeStyleSetBorder(this.ptr, edge, border);
615
+ getComputedBottom() {
616
+ this.assertNotFreed();
617
+ return yg.ygNodeLayoutGetBottom(this.ptr);
795
618
  }
796
- }
797
- getBorder(edge) {
798
- return yg.ygNodeStyleGetBorder(this.ptr, edge);
799
- }
800
- setGap(gutter, gap) {
801
- const { unit, asNumber } = parseValue(gap);
802
- if (unit === Unit.Percent) {
803
- yg.ygNodeStyleSetGapPercent(this.ptr, gutter, asNumber);
804
- } else if (unit === Unit.Point && asNumber !== undefined) {
805
- yg.ygNodeStyleSetGap(this.ptr, gutter, asNumber);
619
+ getComputedWidth() {
620
+ this.assertNotFreed();
621
+ return yg.ygNodeLayoutGetWidth(this.ptr);
806
622
  }
807
- }
808
- setGapPercent(gutter, gap) {
809
- if (gap !== undefined) {
810
- yg.ygNodeStyleSetGapPercent(this.ptr, gutter, gap);
623
+ getComputedHeight() {
624
+ this.assertNotFreed();
625
+ return yg.ygNodeLayoutGetHeight(this.ptr);
811
626
  }
812
- }
813
- setWidth(width) {
814
- const { unit, asNumber } = parseValue(width);
815
- if (unit === Unit.Auto) {
816
- yg.ygNodeStyleSetWidthAuto(this.ptr);
817
- } else if (unit === Unit.Percent) {
818
- yg.ygNodeStyleSetWidthPercent(this.ptr, asNumber);
819
- } else if (unit === Unit.Point && asNumber !== undefined) {
820
- yg.ygNodeStyleSetWidth(this.ptr, asNumber);
627
+ getComputedBorder(edge) {
628
+ this.assertNotFreed();
629
+ return yg.ygNodeLayoutGetBorder(this.ptr, edge);
821
630
  }
822
- }
823
- setWidthPercent(width) {
824
- if (width !== undefined) {
825
- yg.ygNodeStyleSetWidthPercent(this.ptr, width);
631
+ getComputedMargin(edge) {
632
+ this.assertNotFreed();
633
+ return yg.ygNodeLayoutGetMargin(this.ptr, edge);
826
634
  }
827
- }
828
- setWidthAuto() {
829
- yg.ygNodeStyleSetWidthAuto(this.ptr);
830
- }
831
- setHeight(height) {
832
- const { unit, asNumber } = parseValue(height);
833
- if (unit === Unit.Auto) {
834
- yg.ygNodeStyleSetHeightAuto(this.ptr);
835
- } else if (unit === Unit.Percent) {
836
- yg.ygNodeStyleSetHeightPercent(this.ptr, asNumber);
837
- } else if (unit === Unit.Point && asNumber !== undefined) {
838
- yg.ygNodeStyleSetHeight(this.ptr, asNumber);
635
+ getComputedPadding(edge) {
636
+ this.assertNotFreed();
637
+ return yg.ygNodeLayoutGetPadding(this.ptr, edge);
839
638
  }
840
- }
841
- setHeightPercent(height) {
842
- if (height !== undefined) {
843
- yg.ygNodeStyleSetHeightPercent(this.ptr, height);
639
+ setDirection(direction) {
640
+ this.assertNotFreed();
641
+ yg.ygNodeStyleSetDirection(this.ptr, direction);
844
642
  }
845
- }
846
- setHeightAuto() {
847
- yg.ygNodeStyleSetHeightAuto(this.ptr);
848
- }
849
- setMinWidth(minWidth) {
850
- const { unit, asNumber } = parseValue(minWidth);
851
- if (unit === Unit.Percent) {
852
- yg.ygNodeStyleSetMinWidthPercent(this.ptr, asNumber);
853
- } else if (unit === Unit.Point && asNumber !== undefined) {
854
- yg.ygNodeStyleSetMinWidth(this.ptr, asNumber);
643
+ getDirection() {
644
+ this.assertNotFreed();
645
+ return yg.ygNodeStyleGetDirection(this.ptr);
855
646
  }
856
- }
857
- setMinWidthPercent(minWidth) {
858
- if (minWidth !== undefined) {
859
- yg.ygNodeStyleSetMinWidthPercent(this.ptr, minWidth);
647
+ setFlexDirection(flexDirection) {
648
+ this.assertNotFreed();
649
+ yg.ygNodeStyleSetFlexDirection(this.ptr, flexDirection);
860
650
  }
861
- }
862
- setMinHeight(minHeight) {
863
- const { unit, asNumber } = parseValue(minHeight);
864
- if (unit === Unit.Percent) {
865
- yg.ygNodeStyleSetMinHeightPercent(this.ptr, asNumber);
866
- } else if (unit === Unit.Point && asNumber !== undefined) {
867
- yg.ygNodeStyleSetMinHeight(this.ptr, asNumber);
651
+ getFlexDirection() {
652
+ this.assertNotFreed();
653
+ return yg.ygNodeStyleGetFlexDirection(this.ptr);
868
654
  }
869
- }
870
- setMinHeightPercent(minHeight) {
871
- if (minHeight !== undefined) {
872
- yg.ygNodeStyleSetMinHeightPercent(this.ptr, minHeight);
655
+ setJustifyContent(justifyContent) {
656
+ this.assertNotFreed();
657
+ yg.ygNodeStyleSetJustifyContent(this.ptr, justifyContent);
658
+ }
659
+ getJustifyContent() {
660
+ this.assertNotFreed();
661
+ return yg.ygNodeStyleGetJustifyContent(this.ptr);
873
662
  }
874
- }
875
- setMaxWidth(maxWidth) {
876
- const { unit, asNumber } = parseValue(maxWidth);
877
- if (unit === Unit.Percent) {
878
- yg.ygNodeStyleSetMaxWidthPercent(this.ptr, asNumber);
879
- } else if (unit === Unit.Point && asNumber !== undefined) {
880
- yg.ygNodeStyleSetMaxWidth(this.ptr, asNumber);
663
+ setAlignContent(alignContent) {
664
+ this.assertNotFreed();
665
+ yg.ygNodeStyleSetAlignContent(this.ptr, alignContent);
881
666
  }
882
- }
883
- setMaxWidthPercent(maxWidth) {
884
- if (maxWidth !== undefined) {
885
- yg.ygNodeStyleSetMaxWidthPercent(this.ptr, maxWidth);
667
+ getAlignContent() {
668
+ this.assertNotFreed();
669
+ return yg.ygNodeStyleGetAlignContent(this.ptr);
886
670
  }
887
- }
888
- setMaxHeight(maxHeight) {
889
- const { unit, asNumber } = parseValue(maxHeight);
890
- if (unit === Unit.Percent) {
891
- yg.ygNodeStyleSetMaxHeightPercent(this.ptr, asNumber);
892
- } else if (unit === Unit.Point && asNumber !== undefined) {
893
- yg.ygNodeStyleSetMaxHeight(this.ptr, asNumber);
671
+ setAlignItems(alignItems) {
672
+ this.assertNotFreed();
673
+ yg.ygNodeStyleSetAlignItems(this.ptr, alignItems);
894
674
  }
895
- }
896
- setMaxHeightPercent(maxHeight) {
897
- if (maxHeight !== undefined) {
898
- yg.ygNodeStyleSetMaxHeightPercent(this.ptr, maxHeight);
675
+ getAlignItems() {
676
+ this.assertNotFreed();
677
+ return yg.ygNodeStyleGetAlignItems(this.ptr);
899
678
  }
900
- }
901
- setAspectRatio(aspectRatio) {
902
- if (aspectRatio !== undefined) {
903
- yg.ygNodeStyleSetAspectRatio(this.ptr, aspectRatio);
679
+ setAlignSelf(alignSelf) {
680
+ this.assertNotFreed();
681
+ yg.ygNodeStyleSetAlignSelf(this.ptr, alignSelf);
904
682
  }
905
- }
906
- getAspectRatio() {
907
- return yg.ygNodeStyleGetAspectRatio(this.ptr);
908
- }
909
- getWidth() {
910
- return unpackValue(yg.ygNodeStyleGetWidthPacked(this.ptr));
911
- }
912
- getHeight() {
913
- return unpackValue(yg.ygNodeStyleGetHeightPacked(this.ptr));
914
- }
915
- getMinWidth() {
916
- return unpackValue(yg.ygNodeStyleGetMinWidthPacked(this.ptr));
917
- }
918
- getMinHeight() {
919
- return unpackValue(yg.ygNodeStyleGetMinHeightPacked(this.ptr));
920
- }
921
- getMaxWidth() {
922
- return unpackValue(yg.ygNodeStyleGetMaxWidthPacked(this.ptr));
923
- }
924
- getMaxHeight() {
925
- return unpackValue(yg.ygNodeStyleGetMaxHeightPacked(this.ptr));
926
- }
927
- getMargin(edge) {
928
- return unpackValue(yg.ygNodeStyleGetMarginPacked(this.ptr, edge));
929
- }
930
- getPadding(edge) {
931
- return unpackValue(yg.ygNodeStyleGetPaddingPacked(this.ptr, edge));
932
- }
933
- getPosition(edge) {
934
- return unpackValue(yg.ygNodeStyleGetPositionPacked(this.ptr, edge));
935
- }
936
- getGap(gutter) {
937
- return unpackValue(yg.ygNodeStyleGetGapPacked(this.ptr, gutter));
938
- }
939
- getFlexBasis() {
940
- return unpackValue(yg.ygNodeStyleGetFlexBasisPacked(this.ptr));
941
- }
942
- setMeasureFunc(measureFunc) {
943
- this.unsetMeasureFunc();
944
- if (measureFunc) {
945
- this.measureCallback = new JSCallback((nodePtr, width, widthMode, height, heightMode) => {
946
- const result = measureFunc(width, widthMode, height, heightMode);
947
- yg.ygStoreMeasureResult(result.width, result.height);
948
- }, {
949
- args: [
950
- FFIType.ptr,
951
- FFIType.f32,
952
- FFIType.u32,
953
- FFIType.f32,
954
- FFIType.u32
955
- ],
956
- returns: FFIType.void
957
- });
958
- if (this.measureCallback.ptr) {
959
- yg.ygNodeSetMeasureFuncTrampoline(this.ptr, this.measureCallback.ptr);
683
+ getAlignSelf() {
684
+ this.assertNotFreed();
685
+ return yg.ygNodeStyleGetAlignSelf(this.ptr);
686
+ }
687
+ setPositionType(positionType) {
688
+ this.assertNotFreed();
689
+ yg.ygNodeStyleSetPositionType(this.ptr, positionType);
690
+ }
691
+ getPositionType() {
692
+ this.assertNotFreed();
693
+ return yg.ygNodeStyleGetPositionType(this.ptr);
694
+ }
695
+ setFlexWrap(flexWrap) {
696
+ this.assertNotFreed();
697
+ yg.ygNodeStyleSetFlexWrap(this.ptr, flexWrap);
698
+ }
699
+ getFlexWrap() {
700
+ this.assertNotFreed();
701
+ return yg.ygNodeStyleGetFlexWrap(this.ptr);
702
+ }
703
+ setOverflow(overflow) {
704
+ this.assertNotFreed();
705
+ yg.ygNodeStyleSetOverflow(this.ptr, overflow);
706
+ }
707
+ getOverflow() {
708
+ this.assertNotFreed();
709
+ return yg.ygNodeStyleGetOverflow(this.ptr);
710
+ }
711
+ setDisplay(display) {
712
+ this.assertNotFreed();
713
+ yg.ygNodeStyleSetDisplay(this.ptr, display);
714
+ }
715
+ getDisplay() {
716
+ this.assertNotFreed();
717
+ return yg.ygNodeStyleGetDisplay(this.ptr);
718
+ }
719
+ setBoxSizing(boxSizing) {
720
+ this.assertNotFreed();
721
+ yg.ygNodeStyleSetBoxSizing(this.ptr, boxSizing);
722
+ }
723
+ getBoxSizing() {
724
+ this.assertNotFreed();
725
+ return yg.ygNodeStyleGetBoxSizing(this.ptr);
726
+ }
727
+ setFlex(flex) {
728
+ this.assertNotFreed();
729
+ yg.ygNodeStyleSetFlex(this.ptr, flex);
730
+ }
731
+ getFlex() {
732
+ this.assertNotFreed();
733
+ return yg.ygNodeStyleGetFlex(this.ptr);
734
+ }
735
+ setFlexGrow(flexGrow) {
736
+ this.assertNotFreed();
737
+ yg.ygNodeStyleSetFlexGrow(this.ptr, flexGrow);
738
+ }
739
+ getFlexGrow() {
740
+ this.assertNotFreed();
741
+ return yg.ygNodeStyleGetFlexGrow(this.ptr);
742
+ }
743
+ setFlexShrink(flexShrink) {
744
+ this.assertNotFreed();
745
+ yg.ygNodeStyleSetFlexShrink(this.ptr, flexShrink);
746
+ }
747
+ getFlexShrink() {
748
+ this.assertNotFreed();
749
+ return yg.ygNodeStyleGetFlexShrink(this.ptr);
750
+ }
751
+ setFlexBasis(flexBasis) {
752
+ this.assertNotFreed();
753
+ const { unit, asNumber } = parseValue(flexBasis);
754
+ if (unit === exports.Unit.Auto) {
755
+ yg.ygNodeStyleSetFlexBasisAuto(this.ptr);
756
+ } else if (unit === exports.Unit.Percent) {
757
+ yg.ygNodeStyleSetFlexBasisPercent(this.ptr, asNumber);
758
+ } else if (unit === exports.Unit.Point && asNumber !== undefined) {
759
+ yg.ygNodeStyleSetFlexBasis(this.ptr, asNumber);
960
760
  }
961
761
  }
962
- }
963
- unsetMeasureFunc() {
964
- if (this.measureCallback) {
965
- this.measureCallback.close();
966
- this.measureCallback = null;
762
+ setFlexBasisPercent(flexBasis) {
763
+ this.assertNotFreed();
764
+ if (flexBasis !== undefined) {
765
+ yg.ygNodeStyleSetFlexBasisPercent(this.ptr, flexBasis);
766
+ }
967
767
  }
968
- yg.ygNodeUnsetMeasureFuncTrampoline(this.ptr);
969
- }
970
- hasMeasureFunc() {
971
- return yg.ygNodeHasMeasureFunc(this.ptr);
972
- }
973
- setBaselineFunc(baselineFunc) {
974
- this.unsetBaselineFunc();
975
- if (baselineFunc) {
976
- this.baselineCallback = new JSCallback((nodePtr, width, height) => {
977
- const result = baselineFunc(width, height);
978
- yg.ygStoreBaselineResult(result);
979
- }, {
980
- args: [FFIType.ptr, FFIType.f32, FFIType.f32],
981
- returns: FFIType.void
982
- });
983
- if (this.baselineCallback.ptr) {
984
- yg.ygNodeSetBaselineFuncTrampoline(this.ptr, this.baselineCallback.ptr);
768
+ setFlexBasisAuto() {
769
+ this.assertNotFreed();
770
+ yg.ygNodeStyleSetFlexBasisAuto(this.ptr);
771
+ }
772
+ setPosition(edge, position) {
773
+ this.assertNotFreed();
774
+ const { unit, asNumber } = parseValue(position);
775
+ if (unit === exports.Unit.Percent) {
776
+ yg.ygNodeStyleSetPositionPercent(this.ptr, edge, asNumber);
777
+ } else if (unit === exports.Unit.Point && asNumber !== undefined) {
778
+ yg.ygNodeStyleSetPosition(this.ptr, edge, asNumber);
985
779
  }
986
780
  }
987
- }
988
- unsetBaselineFunc() {
989
- if (this.baselineCallback) {
990
- this.baselineCallback.close();
991
- this.baselineCallback = null;
781
+ setPositionPercent(edge, position) {
782
+ this.assertNotFreed();
783
+ if (position !== undefined) {
784
+ yg.ygNodeStyleSetPositionPercent(this.ptr, edge, position);
785
+ }
992
786
  }
993
- yg.ygNodeUnsetBaselineFuncTrampoline(this.ptr);
994
- }
995
- hasBaselineFunc() {
996
- return yg.ygNodeHasBaselineFunc(this.ptr);
997
- }
998
- setDirtiedFunc(dirtiedFunc) {
999
- this.unsetDirtiedFunc();
1000
- if (dirtiedFunc) {
1001
- const node = this;
1002
- this.dirtiedCallback = new JSCallback((nodePtr) => {
1003
- dirtiedFunc(node);
1004
- }, {
1005
- args: [FFIType.ptr],
1006
- returns: FFIType.void
1007
- });
1008
- if (this.dirtiedCallback.ptr) {
1009
- yg.ygNodeSetDirtiedFunc(this.ptr, this.dirtiedCallback.ptr);
787
+ setPositionAuto(edge) {
788
+ this.assertNotFreed();
789
+ yg.ygNodeStyleSetPositionAuto(this.ptr, edge);
790
+ }
791
+ setMargin(edge, margin) {
792
+ this.assertNotFreed();
793
+ const { unit, asNumber } = parseValue(margin);
794
+ if (unit === exports.Unit.Auto) {
795
+ yg.ygNodeStyleSetMarginAuto(this.ptr, edge);
796
+ } else if (unit === exports.Unit.Percent) {
797
+ yg.ygNodeStyleSetMarginPercent(this.ptr, edge, asNumber);
798
+ } else if (unit === exports.Unit.Point && asNumber !== undefined) {
799
+ yg.ygNodeStyleSetMargin(this.ptr, edge, asNumber);
1010
800
  }
1011
801
  }
1012
- }
1013
- unsetDirtiedFunc() {
1014
- if (this.dirtiedCallback) {
1015
- this.dirtiedCallback.close();
1016
- this.dirtiedCallback = null;
802
+ setMarginPercent(edge, margin) {
803
+ this.assertNotFreed();
804
+ if (margin !== undefined) {
805
+ yg.ygNodeStyleSetMarginPercent(this.ptr, edge, margin);
806
+ }
807
+ }
808
+ setMarginAuto(edge) {
809
+ this.assertNotFreed();
810
+ yg.ygNodeStyleSetMarginAuto(this.ptr, edge);
811
+ }
812
+ setPadding(edge, padding) {
813
+ this.assertNotFreed();
814
+ const { unit, asNumber } = parseValue(padding);
815
+ if (unit === exports.Unit.Percent) {
816
+ yg.ygNodeStyleSetPaddingPercent(this.ptr, edge, asNumber);
817
+ } else if (unit === exports.Unit.Point && asNumber !== undefined) {
818
+ yg.ygNodeStyleSetPadding(this.ptr, edge, asNumber);
819
+ }
820
+ }
821
+ setPaddingPercent(edge, padding) {
822
+ this.assertNotFreed();
823
+ if (padding !== undefined) {
824
+ yg.ygNodeStyleSetPaddingPercent(this.ptr, edge, padding);
825
+ }
826
+ }
827
+ setBorder(edge, border) {
828
+ this.assertNotFreed();
829
+ if (border !== undefined) {
830
+ yg.ygNodeStyleSetBorder(this.ptr, edge, border);
831
+ }
832
+ }
833
+ getBorder(edge) {
834
+ this.assertNotFreed();
835
+ return yg.ygNodeStyleGetBorder(this.ptr, edge);
836
+ }
837
+ setGap(gutter, gap) {
838
+ this.assertNotFreed();
839
+ const { unit, asNumber } = parseValue(gap);
840
+ if (unit === exports.Unit.Percent) {
841
+ yg.ygNodeStyleSetGapPercent(this.ptr, gutter, asNumber);
842
+ } else if (unit === exports.Unit.Point && asNumber !== undefined) {
843
+ yg.ygNodeStyleSetGap(this.ptr, gutter, asNumber);
844
+ }
845
+ }
846
+ setGapPercent(gutter, gap) {
847
+ this.assertNotFreed();
848
+ if (gap !== undefined) {
849
+ yg.ygNodeStyleSetGapPercent(this.ptr, gutter, gap);
850
+ }
851
+ }
852
+ setWidth(width) {
853
+ this.assertNotFreed();
854
+ const { unit, asNumber } = parseValue(width);
855
+ if (unit === exports.Unit.Auto) {
856
+ yg.ygNodeStyleSetWidthAuto(this.ptr);
857
+ } else if (unit === exports.Unit.Percent) {
858
+ yg.ygNodeStyleSetWidthPercent(this.ptr, asNumber);
859
+ } else if (unit === exports.Unit.Point && asNumber !== undefined) {
860
+ yg.ygNodeStyleSetWidth(this.ptr, asNumber);
861
+ }
862
+ }
863
+ setWidthPercent(width) {
864
+ this.assertNotFreed();
865
+ if (width !== undefined) {
866
+ yg.ygNodeStyleSetWidthPercent(this.ptr, width);
867
+ }
868
+ }
869
+ setWidthAuto() {
870
+ this.assertNotFreed();
871
+ yg.ygNodeStyleSetWidthAuto(this.ptr);
872
+ }
873
+ setHeight(height) {
874
+ this.assertNotFreed();
875
+ const { unit, asNumber } = parseValue(height);
876
+ if (unit === exports.Unit.Auto) {
877
+ yg.ygNodeStyleSetHeightAuto(this.ptr);
878
+ } else if (unit === exports.Unit.Percent) {
879
+ yg.ygNodeStyleSetHeightPercent(this.ptr, asNumber);
880
+ } else if (unit === exports.Unit.Point && asNumber !== undefined) {
881
+ yg.ygNodeStyleSetHeight(this.ptr, asNumber);
882
+ }
883
+ }
884
+ setHeightPercent(height) {
885
+ this.assertNotFreed();
886
+ if (height !== undefined) {
887
+ yg.ygNodeStyleSetHeightPercent(this.ptr, height);
888
+ }
889
+ }
890
+ setHeightAuto() {
891
+ this.assertNotFreed();
892
+ yg.ygNodeStyleSetHeightAuto(this.ptr);
893
+ }
894
+ setMinWidth(minWidth) {
895
+ this.assertNotFreed();
896
+ const { unit, asNumber } = parseValue(minWidth);
897
+ if (unit === exports.Unit.Percent) {
898
+ yg.ygNodeStyleSetMinWidthPercent(this.ptr, asNumber);
899
+ } else if (unit === exports.Unit.Point && asNumber !== undefined) {
900
+ yg.ygNodeStyleSetMinWidth(this.ptr, asNumber);
901
+ }
902
+ }
903
+ setMinWidthPercent(minWidth) {
904
+ this.assertNotFreed();
905
+ if (minWidth !== undefined) {
906
+ yg.ygNodeStyleSetMinWidthPercent(this.ptr, minWidth);
907
+ }
908
+ }
909
+ setMinHeight(minHeight) {
910
+ this.assertNotFreed();
911
+ const { unit, asNumber } = parseValue(minHeight);
912
+ if (unit === exports.Unit.Percent) {
913
+ yg.ygNodeStyleSetMinHeightPercent(this.ptr, asNumber);
914
+ } else if (unit === exports.Unit.Point && asNumber !== undefined) {
915
+ yg.ygNodeStyleSetMinHeight(this.ptr, asNumber);
916
+ }
917
+ }
918
+ setMinHeightPercent(minHeight) {
919
+ this.assertNotFreed();
920
+ if (minHeight !== undefined) {
921
+ yg.ygNodeStyleSetMinHeightPercent(this.ptr, minHeight);
922
+ }
923
+ }
924
+ setMaxWidth(maxWidth) {
925
+ this.assertNotFreed();
926
+ const { unit, asNumber } = parseValue(maxWidth);
927
+ if (unit === exports.Unit.Percent) {
928
+ yg.ygNodeStyleSetMaxWidthPercent(this.ptr, asNumber);
929
+ } else if (unit === exports.Unit.Point && asNumber !== undefined) {
930
+ yg.ygNodeStyleSetMaxWidth(this.ptr, asNumber);
931
+ }
932
+ }
933
+ setMaxWidthPercent(maxWidth) {
934
+ this.assertNotFreed();
935
+ if (maxWidth !== undefined) {
936
+ yg.ygNodeStyleSetMaxWidthPercent(this.ptr, maxWidth);
937
+ }
938
+ }
939
+ setMaxHeight(maxHeight) {
940
+ this.assertNotFreed();
941
+ const { unit, asNumber } = parseValue(maxHeight);
942
+ if (unit === exports.Unit.Percent) {
943
+ yg.ygNodeStyleSetMaxHeightPercent(this.ptr, asNumber);
944
+ } else if (unit === exports.Unit.Point && asNumber !== undefined) {
945
+ yg.ygNodeStyleSetMaxHeight(this.ptr, asNumber);
946
+ }
947
+ }
948
+ setMaxHeightPercent(maxHeight) {
949
+ this.assertNotFreed();
950
+ if (maxHeight !== undefined) {
951
+ yg.ygNodeStyleSetMaxHeightPercent(this.ptr, maxHeight);
952
+ }
953
+ }
954
+ setAspectRatio(aspectRatio) {
955
+ this.assertNotFreed();
956
+ if (aspectRatio !== undefined) {
957
+ yg.ygNodeStyleSetAspectRatio(this.ptr, aspectRatio);
958
+ }
959
+ }
960
+ getAspectRatio() {
961
+ this.assertNotFreed();
962
+ return yg.ygNodeStyleGetAspectRatio(this.ptr);
963
+ }
964
+ getWidth() {
965
+ this.assertNotFreed();
966
+ return unpackValue(yg.ygNodeStyleGetWidthPacked(this.ptr));
967
+ }
968
+ getHeight() {
969
+ this.assertNotFreed();
970
+ return unpackValue(yg.ygNodeStyleGetHeightPacked(this.ptr));
971
+ }
972
+ getMinWidth() {
973
+ this.assertNotFreed();
974
+ return unpackValue(yg.ygNodeStyleGetMinWidthPacked(this.ptr));
975
+ }
976
+ getMinHeight() {
977
+ this.assertNotFreed();
978
+ return unpackValue(yg.ygNodeStyleGetMinHeightPacked(this.ptr));
979
+ }
980
+ getMaxWidth() {
981
+ this.assertNotFreed();
982
+ return unpackValue(yg.ygNodeStyleGetMaxWidthPacked(this.ptr));
983
+ }
984
+ getMaxHeight() {
985
+ this.assertNotFreed();
986
+ return unpackValue(yg.ygNodeStyleGetMaxHeightPacked(this.ptr));
987
+ }
988
+ getMargin(edge) {
989
+ this.assertNotFreed();
990
+ return unpackValue(yg.ygNodeStyleGetMarginPacked(this.ptr, edge));
991
+ }
992
+ getPadding(edge) {
993
+ this.assertNotFreed();
994
+ return unpackValue(yg.ygNodeStyleGetPaddingPacked(this.ptr, edge));
995
+ }
996
+ getPosition(edge) {
997
+ this.assertNotFreed();
998
+ return unpackValue(yg.ygNodeStyleGetPositionPacked(this.ptr, edge));
999
+ }
1000
+ getGap(gutter) {
1001
+ this.assertNotFreed();
1002
+ return unpackValue(yg.ygNodeStyleGetGapPacked(this.ptr, gutter));
1003
+ }
1004
+ getFlexBasis() {
1005
+ this.assertNotFreed();
1006
+ return unpackValue(yg.ygNodeStyleGetFlexBasisPacked(this.ptr));
1007
+ }
1008
+ setMeasureFunc(measureFunc) {
1009
+ this.assertNotFreed();
1010
+ this.unsetMeasureFunc();
1011
+ if (measureFunc) {
1012
+ this.measureCallback = new bun_ffi_1.JSCallback((nodePtr, width, widthMode, height, heightMode) => {
1013
+ const result = measureFunc(width, widthMode, height, heightMode);
1014
+ yg.ygStoreMeasureResult(result.width, result.height);
1015
+ }, {
1016
+ args: [
1017
+ bun_ffi_1.FFIType.ptr,
1018
+ bun_ffi_1.FFIType.f32,
1019
+ bun_ffi_1.FFIType.u32,
1020
+ bun_ffi_1.FFIType.f32,
1021
+ bun_ffi_1.FFIType.u32
1022
+ ],
1023
+ returns: bun_ffi_1.FFIType.void
1024
+ });
1025
+ if (this.measureCallback.ptr) {
1026
+ yg.ygNodeSetMeasureFuncTrampoline(this.ptr, this.measureCallback.ptr);
1027
+ }
1028
+ }
1029
+ }
1030
+ unsetMeasureFunc() {
1031
+ if (this._freed)
1032
+ return;
1033
+ if (this.measureCallback) {
1034
+ this.measureCallback.close();
1035
+ this.measureCallback = null;
1036
+ }
1037
+ yg.ygNodeUnsetMeasureFuncTrampoline(this.ptr);
1038
+ }
1039
+ hasMeasureFunc() {
1040
+ this.assertNotFreed();
1041
+ return yg.ygNodeHasMeasureFunc(this.ptr);
1042
+ }
1043
+ setBaselineFunc(baselineFunc) {
1044
+ this.assertNotFreed();
1045
+ this.unsetBaselineFunc();
1046
+ if (baselineFunc) {
1047
+ this.baselineCallback = new bun_ffi_1.JSCallback((nodePtr, width, height) => {
1048
+ const result = baselineFunc(width, height);
1049
+ yg.ygStoreBaselineResult(result);
1050
+ }, {
1051
+ args: [bun_ffi_1.FFIType.ptr, bun_ffi_1.FFIType.f32, bun_ffi_1.FFIType.f32],
1052
+ returns: bun_ffi_1.FFIType.void
1053
+ });
1054
+ if (this.baselineCallback.ptr) {
1055
+ yg.ygNodeSetBaselineFuncTrampoline(this.ptr, this.baselineCallback.ptr);
1056
+ }
1057
+ }
1058
+ }
1059
+ unsetBaselineFunc() {
1060
+ if (this._freed)
1061
+ return;
1062
+ if (this.baselineCallback) {
1063
+ this.baselineCallback.close();
1064
+ this.baselineCallback = null;
1065
+ }
1066
+ yg.ygNodeUnsetBaselineFuncTrampoline(this.ptr);
1067
+ }
1068
+ hasBaselineFunc() {
1069
+ this.assertNotFreed();
1070
+ return yg.ygNodeHasBaselineFunc(this.ptr);
1071
+ }
1072
+ setDirtiedFunc(dirtiedFunc) {
1073
+ this.assertNotFreed();
1074
+ this.unsetDirtiedFunc();
1075
+ if (dirtiedFunc) {
1076
+ const node = this;
1077
+ this.dirtiedCallback = new bun_ffi_1.JSCallback((nodePtr) => {
1078
+ dirtiedFunc(node);
1079
+ }, {
1080
+ args: [bun_ffi_1.FFIType.ptr],
1081
+ returns: bun_ffi_1.FFIType.void
1082
+ });
1083
+ if (this.dirtiedCallback.ptr) {
1084
+ yg.ygNodeSetDirtiedFunc(this.ptr, this.dirtiedCallback.ptr);
1085
+ }
1086
+ }
1087
+ }
1088
+ unsetDirtiedFunc() {
1089
+ if (this._freed)
1090
+ return;
1091
+ if (this.dirtiedCallback) {
1092
+ this.dirtiedCallback.close();
1093
+ this.dirtiedCallback = null;
1094
+ }
1095
+ yg.ygNodeUnsetDirtiedFunc(this.ptr);
1096
+ }
1097
+ hasDirtiedFunc() {
1098
+ this.assertNotFreed();
1099
+ return yg.ygNodeGetDirtiedFunc(this.ptr) !== null;
1017
1100
  }
1018
- yg.ygNodeUnsetDirtiedFunc(this.ptr);
1019
- }
1020
- hasDirtiedFunc() {
1021
- return yg.ygNodeGetDirtiedFunc(this.ptr) !== null;
1022
1101
  }
1023
- }
1102
+ exports.Node = Node;
1024
1103
 
1025
- class Config {
1026
- ptr;
1027
- constructor(ptr) {
1028
- this.ptr = ptr;
1029
- }
1030
- static create() {
1031
- const ptr = yg.ygConfigNew();
1032
- if (!ptr)
1033
- throw new Error("Failed to create config");
1034
- return new Config(ptr);
1035
- }
1036
- static destroy(config) {
1037
- config.free();
1038
- }
1039
- free() {
1040
- yg.ygConfigFree(this.ptr);
1041
- }
1042
- setUseWebDefaults(useWebDefaults) {
1043
- yg.ygConfigSetUseWebDefaults(this.ptr, useWebDefaults);
1044
- }
1045
- useWebDefaults() {
1046
- return yg.ygConfigGetUseWebDefaults(this.ptr);
1047
- }
1048
- setPointScaleFactor(pointScaleFactor) {
1049
- yg.ygConfigSetPointScaleFactor(this.ptr, pointScaleFactor);
1050
- }
1051
- getPointScaleFactor() {
1052
- return yg.ygConfigGetPointScaleFactor(this.ptr);
1053
- }
1054
- setErrata(errata) {
1055
- yg.ygConfigSetErrata(this.ptr, errata);
1056
- }
1057
- getErrata() {
1058
- return yg.ygConfigGetErrata(this.ptr);
1059
- }
1060
- setExperimentalFeatureEnabled(feature, enabled) {
1061
- yg.ygConfigSetExperimentalFeatureEnabled(this.ptr, feature, enabled);
1062
- }
1063
- isExperimentalFeatureEnabled(feature) {
1064
- return yg.ygConfigIsExperimentalFeatureEnabled(this.ptr, feature);
1065
- }
1066
- }
1067
- var dist_default = {
1068
- Node,
1069
- Config,
1070
- Align,
1071
- BoxSizing,
1072
- Dimension,
1073
- Direction,
1074
- Display,
1075
- Edge,
1076
- Errata,
1077
- ExperimentalFeature,
1078
- FlexDirection,
1079
- Gutter,
1080
- Justify,
1081
- LogLevel,
1082
- MeasureMode,
1083
- NodeType,
1084
- Overflow,
1085
- PositionType,
1086
- Unit,
1087
- Wrap,
1088
- EDGE_LEFT,
1089
- EDGE_TOP,
1090
- EDGE_RIGHT,
1091
- EDGE_BOTTOM,
1092
- EDGE_START,
1093
- EDGE_END,
1094
- EDGE_HORIZONTAL,
1095
- EDGE_VERTICAL,
1096
- EDGE_ALL,
1097
- FLEX_DIRECTION_COLUMN,
1098
- FLEX_DIRECTION_COLUMN_REVERSE,
1099
- FLEX_DIRECTION_ROW,
1100
- FLEX_DIRECTION_ROW_REVERSE,
1101
- JUSTIFY_FLEX_START,
1102
- JUSTIFY_CENTER,
1103
- JUSTIFY_FLEX_END,
1104
- JUSTIFY_SPACE_BETWEEN,
1105
- JUSTIFY_SPACE_AROUND,
1106
- JUSTIFY_SPACE_EVENLY,
1107
- ALIGN_AUTO,
1108
- ALIGN_FLEX_START,
1109
- ALIGN_CENTER,
1110
- ALIGN_FLEX_END,
1111
- ALIGN_STRETCH,
1112
- ALIGN_BASELINE,
1113
- ALIGN_SPACE_BETWEEN,
1114
- ALIGN_SPACE_AROUND,
1115
- ALIGN_SPACE_EVENLY,
1116
- WRAP_NO_WRAP,
1117
- WRAP_WRAP,
1118
- WRAP_WRAP_REVERSE,
1119
- OVERFLOW_VISIBLE,
1120
- OVERFLOW_HIDDEN,
1121
- OVERFLOW_SCROLL,
1122
- DISPLAY_FLEX,
1123
- DISPLAY_NONE,
1124
- POSITION_TYPE_STATIC,
1125
- POSITION_TYPE_RELATIVE,
1126
- POSITION_TYPE_ABSOLUTE,
1127
- DIRECTION_INHERIT,
1128
- DIRECTION_LTR,
1129
- DIRECTION_RTL
1130
- };
1104
+ class Config {
1105
+ ptr;
1106
+ constructor(ptr) {
1107
+ this.ptr = ptr;
1108
+ }
1109
+ static create() {
1110
+ const ptr = yg.ygConfigNew();
1111
+ if (!ptr)
1112
+ throw new Error("Failed to create config");
1113
+ return new Config(ptr);
1114
+ }
1115
+ static destroy(config) {
1116
+ config.free();
1117
+ }
1118
+ free() {
1119
+ yg.ygConfigFree(this.ptr);
1120
+ }
1121
+ setUseWebDefaults(useWebDefaults) {
1122
+ yg.ygConfigSetUseWebDefaults(this.ptr, useWebDefaults);
1123
+ }
1124
+ useWebDefaults() {
1125
+ return yg.ygConfigGetUseWebDefaults(this.ptr);
1126
+ }
1127
+ setPointScaleFactor(pointScaleFactor) {
1128
+ yg.ygConfigSetPointScaleFactor(this.ptr, pointScaleFactor);
1129
+ }
1130
+ getPointScaleFactor() {
1131
+ return yg.ygConfigGetPointScaleFactor(this.ptr);
1132
+ }
1133
+ setErrata(errata) {
1134
+ yg.ygConfigSetErrata(this.ptr, errata);
1135
+ }
1136
+ getErrata() {
1137
+ return yg.ygConfigGetErrata(this.ptr);
1138
+ }
1139
+ setExperimentalFeatureEnabled(feature, enabled) {
1140
+ yg.ygConfigSetExperimentalFeatureEnabled(this.ptr, feature, enabled);
1141
+ }
1142
+ isExperimentalFeatureEnabled(feature) {
1143
+ return yg.ygConfigIsExperimentalFeatureEnabled(this.ptr, feature);
1144
+ }
1145
+ }
1146
+ exports.Config = Config;
1147
+ exports.default = {
1148
+ Node,
1149
+ Config,
1150
+ Align: exports.Align,
1151
+ BoxSizing: exports.BoxSizing,
1152
+ Dimension: exports.Dimension,
1153
+ Direction: exports.Direction,
1154
+ Display: exports.Display,
1155
+ Edge: exports.Edge,
1156
+ Errata: exports.Errata,
1157
+ ExperimentalFeature: exports.ExperimentalFeature,
1158
+ FlexDirection: exports.FlexDirection,
1159
+ Gutter: exports.Gutter,
1160
+ Justify: exports.Justify,
1161
+ LogLevel: exports.LogLevel,
1162
+ MeasureMode: exports.MeasureMode,
1163
+ NodeType: exports.NodeType,
1164
+ Overflow: exports.Overflow,
1165
+ PositionType: exports.PositionType,
1166
+ Unit: exports.Unit,
1167
+ Wrap: exports.Wrap,
1168
+ EDGE_LEFT: exports.EDGE_LEFT,
1169
+ EDGE_TOP: exports.EDGE_TOP,
1170
+ EDGE_RIGHT: exports.EDGE_RIGHT,
1171
+ EDGE_BOTTOM: exports.EDGE_BOTTOM,
1172
+ EDGE_START: exports.EDGE_START,
1173
+ EDGE_END: exports.EDGE_END,
1174
+ EDGE_HORIZONTAL: exports.EDGE_HORIZONTAL,
1175
+ EDGE_VERTICAL: exports.EDGE_VERTICAL,
1176
+ EDGE_ALL: exports.EDGE_ALL,
1177
+ FLEX_DIRECTION_COLUMN: exports.FLEX_DIRECTION_COLUMN,
1178
+ FLEX_DIRECTION_COLUMN_REVERSE: exports.FLEX_DIRECTION_COLUMN_REVERSE,
1179
+ FLEX_DIRECTION_ROW: exports.FLEX_DIRECTION_ROW,
1180
+ FLEX_DIRECTION_ROW_REVERSE: exports.FLEX_DIRECTION_ROW_REVERSE,
1181
+ JUSTIFY_FLEX_START: exports.JUSTIFY_FLEX_START,
1182
+ JUSTIFY_CENTER: exports.JUSTIFY_CENTER,
1183
+ JUSTIFY_FLEX_END: exports.JUSTIFY_FLEX_END,
1184
+ JUSTIFY_SPACE_BETWEEN: exports.JUSTIFY_SPACE_BETWEEN,
1185
+ JUSTIFY_SPACE_AROUND: exports.JUSTIFY_SPACE_AROUND,
1186
+ JUSTIFY_SPACE_EVENLY: exports.JUSTIFY_SPACE_EVENLY,
1187
+ ALIGN_AUTO: exports.ALIGN_AUTO,
1188
+ ALIGN_FLEX_START: exports.ALIGN_FLEX_START,
1189
+ ALIGN_CENTER: exports.ALIGN_CENTER,
1190
+ ALIGN_FLEX_END: exports.ALIGN_FLEX_END,
1191
+ ALIGN_STRETCH: exports.ALIGN_STRETCH,
1192
+ ALIGN_BASELINE: exports.ALIGN_BASELINE,
1193
+ ALIGN_SPACE_BETWEEN: exports.ALIGN_SPACE_BETWEEN,
1194
+ ALIGN_SPACE_AROUND: exports.ALIGN_SPACE_AROUND,
1195
+ ALIGN_SPACE_EVENLY: exports.ALIGN_SPACE_EVENLY,
1196
+ WRAP_NO_WRAP: exports.WRAP_NO_WRAP,
1197
+ WRAP_WRAP: exports.WRAP_WRAP,
1198
+ WRAP_WRAP_REVERSE: exports.WRAP_WRAP_REVERSE,
1199
+ OVERFLOW_VISIBLE: exports.OVERFLOW_VISIBLE,
1200
+ OVERFLOW_HIDDEN: exports.OVERFLOW_HIDDEN,
1201
+ OVERFLOW_SCROLL: exports.OVERFLOW_SCROLL,
1202
+ DISPLAY_FLEX: exports.DISPLAY_FLEX,
1203
+ DISPLAY_NONE: exports.DISPLAY_NONE,
1204
+ POSITION_TYPE_STATIC: exports.POSITION_TYPE_STATIC,
1205
+ POSITION_TYPE_RELATIVE: exports.POSITION_TYPE_RELATIVE,
1206
+ POSITION_TYPE_ABSOLUTE: exports.POSITION_TYPE_ABSOLUTE,
1207
+ DIRECTION_INHERIT: exports.DIRECTION_INHERIT,
1208
+ DIRECTION_LTR: exports.DIRECTION_LTR,
1209
+ DIRECTION_RTL: exports.DIRECTION_RTL
1210
+ };
1211
+ });
1131
1212
 
1132
1213
  // src/lib/border.ts
1133
1214
  var BorderChars = {
@@ -5557,265 +5638,266 @@ class StdinBuffer extends EventEmitter2 {
5557
5638
  }
5558
5639
 
5559
5640
  // src/lib/yoga.options.ts
5641
+ var import_bun_yoga = __toESM(require_dist(), 1);
5560
5642
  function parseAlign(value) {
5561
5643
  if (value == null) {
5562
- return Align.Auto;
5644
+ return import_bun_yoga.Align.Auto;
5563
5645
  }
5564
5646
  switch (value.toLowerCase()) {
5565
5647
  case "auto":
5566
- return Align.Auto;
5648
+ return import_bun_yoga.Align.Auto;
5567
5649
  case "flex-start":
5568
- return Align.FlexStart;
5650
+ return import_bun_yoga.Align.FlexStart;
5569
5651
  case "center":
5570
- return Align.Center;
5652
+ return import_bun_yoga.Align.Center;
5571
5653
  case "flex-end":
5572
- return Align.FlexEnd;
5654
+ return import_bun_yoga.Align.FlexEnd;
5573
5655
  case "stretch":
5574
- return Align.Stretch;
5656
+ return import_bun_yoga.Align.Stretch;
5575
5657
  case "baseline":
5576
- return Align.Baseline;
5658
+ return import_bun_yoga.Align.Baseline;
5577
5659
  case "space-between":
5578
- return Align.SpaceBetween;
5660
+ return import_bun_yoga.Align.SpaceBetween;
5579
5661
  case "space-around":
5580
- return Align.SpaceAround;
5662
+ return import_bun_yoga.Align.SpaceAround;
5581
5663
  case "space-evenly":
5582
- return Align.SpaceEvenly;
5664
+ return import_bun_yoga.Align.SpaceEvenly;
5583
5665
  default:
5584
- return Align.Auto;
5666
+ return import_bun_yoga.Align.Auto;
5585
5667
  }
5586
5668
  }
5587
5669
  function parseBoxSizing(value) {
5588
5670
  if (value == null) {
5589
- return BoxSizing.BorderBox;
5671
+ return import_bun_yoga.BoxSizing.BorderBox;
5590
5672
  }
5591
5673
  switch (value.toLowerCase()) {
5592
5674
  case "border-box":
5593
- return BoxSizing.BorderBox;
5675
+ return import_bun_yoga.BoxSizing.BorderBox;
5594
5676
  case "content-box":
5595
- return BoxSizing.ContentBox;
5677
+ return import_bun_yoga.BoxSizing.ContentBox;
5596
5678
  default:
5597
- return BoxSizing.BorderBox;
5679
+ return import_bun_yoga.BoxSizing.BorderBox;
5598
5680
  }
5599
5681
  }
5600
5682
  function parseDimension(value) {
5601
5683
  if (value == null) {
5602
- return Dimension.Width;
5684
+ return import_bun_yoga.Dimension.Width;
5603
5685
  }
5604
5686
  switch (value.toLowerCase()) {
5605
5687
  case "width":
5606
- return Dimension.Width;
5688
+ return import_bun_yoga.Dimension.Width;
5607
5689
  case "height":
5608
- return Dimension.Height;
5690
+ return import_bun_yoga.Dimension.Height;
5609
5691
  default:
5610
- return Dimension.Width;
5692
+ return import_bun_yoga.Dimension.Width;
5611
5693
  }
5612
5694
  }
5613
5695
  function parseDirection(value) {
5614
5696
  if (value == null) {
5615
- return Direction.LTR;
5697
+ return import_bun_yoga.Direction.LTR;
5616
5698
  }
5617
5699
  switch (value.toLowerCase()) {
5618
5700
  case "inherit":
5619
- return Direction.Inherit;
5701
+ return import_bun_yoga.Direction.Inherit;
5620
5702
  case "ltr":
5621
- return Direction.LTR;
5703
+ return import_bun_yoga.Direction.LTR;
5622
5704
  case "rtl":
5623
- return Direction.RTL;
5705
+ return import_bun_yoga.Direction.RTL;
5624
5706
  default:
5625
- return Direction.LTR;
5707
+ return import_bun_yoga.Direction.LTR;
5626
5708
  }
5627
5709
  }
5628
5710
  function parseDisplay(value) {
5629
5711
  if (value == null) {
5630
- return Display.Flex;
5712
+ return import_bun_yoga.Display.Flex;
5631
5713
  }
5632
5714
  switch (value.toLowerCase()) {
5633
5715
  case "flex":
5634
- return Display.Flex;
5716
+ return import_bun_yoga.Display.Flex;
5635
5717
  case "none":
5636
- return Display.None;
5718
+ return import_bun_yoga.Display.None;
5637
5719
  case "contents":
5638
- return Display.Contents;
5720
+ return import_bun_yoga.Display.Contents;
5639
5721
  default:
5640
- return Display.Flex;
5722
+ return import_bun_yoga.Display.Flex;
5641
5723
  }
5642
5724
  }
5643
5725
  function parseEdge(value) {
5644
5726
  if (value == null) {
5645
- return Edge.All;
5727
+ return import_bun_yoga.Edge.All;
5646
5728
  }
5647
5729
  switch (value.toLowerCase()) {
5648
5730
  case "left":
5649
- return Edge.Left;
5731
+ return import_bun_yoga.Edge.Left;
5650
5732
  case "top":
5651
- return Edge.Top;
5733
+ return import_bun_yoga.Edge.Top;
5652
5734
  case "right":
5653
- return Edge.Right;
5735
+ return import_bun_yoga.Edge.Right;
5654
5736
  case "bottom":
5655
- return Edge.Bottom;
5737
+ return import_bun_yoga.Edge.Bottom;
5656
5738
  case "start":
5657
- return Edge.Start;
5739
+ return import_bun_yoga.Edge.Start;
5658
5740
  case "end":
5659
- return Edge.End;
5741
+ return import_bun_yoga.Edge.End;
5660
5742
  case "horizontal":
5661
- return Edge.Horizontal;
5743
+ return import_bun_yoga.Edge.Horizontal;
5662
5744
  case "vertical":
5663
- return Edge.Vertical;
5745
+ return import_bun_yoga.Edge.Vertical;
5664
5746
  case "all":
5665
- return Edge.All;
5747
+ return import_bun_yoga.Edge.All;
5666
5748
  default:
5667
- return Edge.All;
5749
+ return import_bun_yoga.Edge.All;
5668
5750
  }
5669
5751
  }
5670
5752
  function parseFlexDirection(value) {
5671
5753
  if (value == null) {
5672
- return FlexDirection.Column;
5754
+ return import_bun_yoga.FlexDirection.Column;
5673
5755
  }
5674
5756
  switch (value.toLowerCase()) {
5675
5757
  case "column":
5676
- return FlexDirection.Column;
5758
+ return import_bun_yoga.FlexDirection.Column;
5677
5759
  case "column-reverse":
5678
- return FlexDirection.ColumnReverse;
5760
+ return import_bun_yoga.FlexDirection.ColumnReverse;
5679
5761
  case "row":
5680
- return FlexDirection.Row;
5762
+ return import_bun_yoga.FlexDirection.Row;
5681
5763
  case "row-reverse":
5682
- return FlexDirection.RowReverse;
5764
+ return import_bun_yoga.FlexDirection.RowReverse;
5683
5765
  default:
5684
- return FlexDirection.Column;
5766
+ return import_bun_yoga.FlexDirection.Column;
5685
5767
  }
5686
5768
  }
5687
5769
  function parseGutter(value) {
5688
5770
  if (value == null) {
5689
- return Gutter.All;
5771
+ return import_bun_yoga.Gutter.All;
5690
5772
  }
5691
5773
  switch (value.toLowerCase()) {
5692
5774
  case "column":
5693
- return Gutter.Column;
5775
+ return import_bun_yoga.Gutter.Column;
5694
5776
  case "row":
5695
- return Gutter.Row;
5777
+ return import_bun_yoga.Gutter.Row;
5696
5778
  case "all":
5697
- return Gutter.All;
5779
+ return import_bun_yoga.Gutter.All;
5698
5780
  default:
5699
- return Gutter.All;
5781
+ return import_bun_yoga.Gutter.All;
5700
5782
  }
5701
5783
  }
5702
5784
  function parseJustify(value) {
5703
5785
  if (value == null) {
5704
- return Justify.FlexStart;
5786
+ return import_bun_yoga.Justify.FlexStart;
5705
5787
  }
5706
5788
  switch (value.toLowerCase()) {
5707
5789
  case "flex-start":
5708
- return Justify.FlexStart;
5790
+ return import_bun_yoga.Justify.FlexStart;
5709
5791
  case "center":
5710
- return Justify.Center;
5792
+ return import_bun_yoga.Justify.Center;
5711
5793
  case "flex-end":
5712
- return Justify.FlexEnd;
5794
+ return import_bun_yoga.Justify.FlexEnd;
5713
5795
  case "space-between":
5714
- return Justify.SpaceBetween;
5796
+ return import_bun_yoga.Justify.SpaceBetween;
5715
5797
  case "space-around":
5716
- return Justify.SpaceAround;
5798
+ return import_bun_yoga.Justify.SpaceAround;
5717
5799
  case "space-evenly":
5718
- return Justify.SpaceEvenly;
5800
+ return import_bun_yoga.Justify.SpaceEvenly;
5719
5801
  default:
5720
- return Justify.FlexStart;
5802
+ return import_bun_yoga.Justify.FlexStart;
5721
5803
  }
5722
5804
  }
5723
5805
  function parseLogLevel(value) {
5724
5806
  if (value == null) {
5725
- return LogLevel.Info;
5807
+ return import_bun_yoga.LogLevel.Info;
5726
5808
  }
5727
5809
  switch (value.toLowerCase()) {
5728
5810
  case "error":
5729
- return LogLevel.Error;
5811
+ return import_bun_yoga.LogLevel.Error;
5730
5812
  case "warn":
5731
- return LogLevel.Warn;
5813
+ return import_bun_yoga.LogLevel.Warn;
5732
5814
  case "info":
5733
- return LogLevel.Info;
5815
+ return import_bun_yoga.LogLevel.Info;
5734
5816
  case "debug":
5735
- return LogLevel.Debug;
5817
+ return import_bun_yoga.LogLevel.Debug;
5736
5818
  case "verbose":
5737
- return LogLevel.Verbose;
5819
+ return import_bun_yoga.LogLevel.Verbose;
5738
5820
  case "fatal":
5739
- return LogLevel.Fatal;
5821
+ return import_bun_yoga.LogLevel.Fatal;
5740
5822
  default:
5741
- return LogLevel.Info;
5823
+ return import_bun_yoga.LogLevel.Info;
5742
5824
  }
5743
5825
  }
5744
5826
  function parseMeasureMode(value) {
5745
5827
  if (value == null) {
5746
- return MeasureMode.Undefined;
5828
+ return import_bun_yoga.MeasureMode.Undefined;
5747
5829
  }
5748
5830
  switch (value.toLowerCase()) {
5749
5831
  case "undefined":
5750
- return MeasureMode.Undefined;
5832
+ return import_bun_yoga.MeasureMode.Undefined;
5751
5833
  case "exactly":
5752
- return MeasureMode.Exactly;
5834
+ return import_bun_yoga.MeasureMode.Exactly;
5753
5835
  case "at-most":
5754
- return MeasureMode.AtMost;
5836
+ return import_bun_yoga.MeasureMode.AtMost;
5755
5837
  default:
5756
- return MeasureMode.Undefined;
5838
+ return import_bun_yoga.MeasureMode.Undefined;
5757
5839
  }
5758
5840
  }
5759
5841
  function parseOverflow(value) {
5760
5842
  if (value == null) {
5761
- return Overflow.Visible;
5843
+ return import_bun_yoga.Overflow.Visible;
5762
5844
  }
5763
5845
  switch (value.toLowerCase()) {
5764
5846
  case "visible":
5765
- return Overflow.Visible;
5847
+ return import_bun_yoga.Overflow.Visible;
5766
5848
  case "hidden":
5767
- return Overflow.Hidden;
5849
+ return import_bun_yoga.Overflow.Hidden;
5768
5850
  case "scroll":
5769
- return Overflow.Scroll;
5851
+ return import_bun_yoga.Overflow.Scroll;
5770
5852
  default:
5771
- return Overflow.Visible;
5853
+ return import_bun_yoga.Overflow.Visible;
5772
5854
  }
5773
5855
  }
5774
5856
  function parsePositionType(value) {
5775
5857
  if (value == null) {
5776
- return PositionType.Relative;
5858
+ return import_bun_yoga.PositionType.Relative;
5777
5859
  }
5778
5860
  switch (value.toLowerCase()) {
5779
5861
  case "static":
5780
- return PositionType.Static;
5862
+ return import_bun_yoga.PositionType.Static;
5781
5863
  case "relative":
5782
- return PositionType.Relative;
5864
+ return import_bun_yoga.PositionType.Relative;
5783
5865
  case "absolute":
5784
- return PositionType.Absolute;
5866
+ return import_bun_yoga.PositionType.Absolute;
5785
5867
  default:
5786
- return PositionType.Static;
5868
+ return import_bun_yoga.PositionType.Static;
5787
5869
  }
5788
5870
  }
5789
5871
  function parseUnit(value) {
5790
5872
  if (value == null) {
5791
- return Unit.Point;
5873
+ return import_bun_yoga.Unit.Point;
5792
5874
  }
5793
5875
  switch (value.toLowerCase()) {
5794
5876
  case "undefined":
5795
- return Unit.Undefined;
5877
+ return import_bun_yoga.Unit.Undefined;
5796
5878
  case "point":
5797
- return Unit.Point;
5879
+ return import_bun_yoga.Unit.Point;
5798
5880
  case "percent":
5799
- return Unit.Percent;
5881
+ return import_bun_yoga.Unit.Percent;
5800
5882
  case "auto":
5801
- return Unit.Auto;
5883
+ return import_bun_yoga.Unit.Auto;
5802
5884
  default:
5803
- return Unit.Point;
5885
+ return import_bun_yoga.Unit.Point;
5804
5886
  }
5805
5887
  }
5806
5888
  function parseWrap(value) {
5807
5889
  if (value == null) {
5808
- return Wrap.NoWrap;
5890
+ return import_bun_yoga.Wrap.NoWrap;
5809
5891
  }
5810
5892
  switch (value.toLowerCase()) {
5811
5893
  case "no-wrap":
5812
- return Wrap.NoWrap;
5894
+ return import_bun_yoga.Wrap.NoWrap;
5813
5895
  case "wrap":
5814
- return Wrap.Wrap;
5896
+ return import_bun_yoga.Wrap.Wrap;
5815
5897
  case "wrap-reverse":
5816
- return Wrap.WrapReverse;
5898
+ return import_bun_yoga.Wrap.WrapReverse;
5817
5899
  default:
5818
- return Wrap.NoWrap;
5900
+ return import_bun_yoga.Wrap.NoWrap;
5819
5901
  }
5820
5902
  }
5821
5903
 
@@ -6666,7 +6748,7 @@ function getParsers() {
6666
6748
 
6667
6749
  // src/lib/tree-sitter/client.ts
6668
6750
  import { resolve as resolve2, isAbsolute } from "path";
6669
- import { existsSync as existsSync2 } from "fs";
6751
+ import { existsSync } from "fs";
6670
6752
  import { parse } from "path";
6671
6753
  registerEnvVar({
6672
6754
  name: "OTUI_TREE_SITTER_WORKER_PATH",
@@ -6727,7 +6809,7 @@ class TreeSitterClient extends EventEmitter3 {
6727
6809
  worker_path = this.options.workerPath;
6728
6810
  } else {
6729
6811
  worker_path = new URL("./parser.worker.js", import.meta.url).href;
6730
- if (!existsSync2(resolve2(import.meta.dirname, "parser.worker.js"))) {
6812
+ if (!existsSync(resolve2(import.meta.dirname, "parser.worker.js"))) {
6731
6813
  worker_path = new URL("./parser.worker.ts", import.meta.url).href;
6732
6814
  }
6733
6815
  }
@@ -8371,15 +8453,15 @@ class TerminalPalette {
8371
8453
  writeFn;
8372
8454
  activeListeners = [];
8373
8455
  activeTimers = [];
8374
- inTmux;
8375
- constructor(stdin, stdout, writeFn, isTmux) {
8456
+ inLegacyTmux;
8457
+ constructor(stdin, stdout, writeFn, isLegacyTmux) {
8376
8458
  this.stdin = stdin;
8377
8459
  this.stdout = stdout;
8378
8460
  this.writeFn = writeFn || ((data) => stdout.write(data));
8379
- this.inTmux = isTmux ?? false;
8461
+ this.inLegacyTmux = isLegacyTmux ?? false;
8380
8462
  }
8381
8463
  writeOsc(osc) {
8382
- const data = this.inTmux ? wrapForTmux(osc) : osc;
8464
+ const data = this.inLegacyTmux ? wrapForTmux(osc) : osc;
8383
8465
  return this.writeFn(data);
8384
8466
  }
8385
8467
  cleanup() {
@@ -8616,12 +8698,12 @@ class TerminalPalette {
8616
8698
  };
8617
8699
  }
8618
8700
  }
8619
- function createTerminalPalette(stdin, stdout, writeFn, isTmux) {
8620
- return new TerminalPalette(stdin, stdout, writeFn, isTmux);
8701
+ function createTerminalPalette(stdin, stdout, writeFn, isLegacyTmux) {
8702
+ return new TerminalPalette(stdin, stdout, writeFn, isLegacyTmux);
8621
8703
  }
8622
8704
  // src/zig.ts
8623
- import { dlopen as dlopen2, toArrayBuffer as toArrayBuffer4, JSCallback as JSCallback2, ptr as ptr3 } from "bun:ffi";
8624
- import { existsSync as existsSync3 } from "fs";
8705
+ import { dlopen, toArrayBuffer as toArrayBuffer4, JSCallback, ptr as ptr3 } from "bun:ffi";
8706
+ import { existsSync as existsSync2 } from "fs";
8625
8707
  import { EventEmitter as EventEmitter5 } from "events";
8626
8708
 
8627
8709
  // src/buffer.ts
@@ -8688,9 +8770,9 @@ class OptimizedBuffer {
8688
8770
  }
8689
8771
  return this._rawBuffers;
8690
8772
  }
8691
- constructor(lib2, ptr, width, height, options) {
8773
+ constructor(lib, ptr, width, height, options) {
8692
8774
  this.id = options.id || `fb_${OptimizedBuffer.fbIdCounter++}`;
8693
- this.lib = lib2;
8775
+ this.lib = lib;
8694
8776
  this.respectAlpha = options.respectAlpha || false;
8695
8777
  this._width = width;
8696
8778
  this._height = height;
@@ -8698,10 +8780,10 @@ class OptimizedBuffer {
8698
8780
  this.bufferPtr = ptr;
8699
8781
  }
8700
8782
  static create(width, height, widthMethod, options = {}) {
8701
- const lib2 = resolveRenderLib();
8783
+ const lib = resolveRenderLib();
8702
8784
  const respectAlpha = options.respectAlpha || false;
8703
8785
  const id = options.id && options.id.trim() !== "" ? options.id : "unnamed buffer";
8704
- const buffer = lib2.createOptimizedBuffer(width, height, widthMethod, respectAlpha, id);
8786
+ const buffer = lib.createOptimizedBuffer(width, height, widthMethod, respectAlpha, id);
8705
8787
  return buffer;
8706
8788
  }
8707
8789
  get widthMethod() {
@@ -9543,7 +9625,7 @@ var targetLibPath = module.default;
9543
9625
  if (/\$bunfs/.test(targetLibPath)) {
9544
9626
  targetLibPath = targetLibPath.replace("../", "");
9545
9627
  }
9546
- if (!existsSync3(targetLibPath)) {
9628
+ if (!existsSync2(targetLibPath)) {
9547
9629
  throw new Error(`opentui is not supported on the current platform: ${process.platform}-${process.arch}`);
9548
9630
  }
9549
9631
  registerEnvVar({
@@ -9572,7 +9654,7 @@ registerEnvVar({
9572
9654
  });
9573
9655
  function getOpenTUILib(libPath) {
9574
9656
  const resolvedLibPath = libPath || targetLibPath;
9575
- const rawSymbols = dlopen2(resolvedLibPath, {
9657
+ const rawSymbols = dlopen(resolvedLibPath, {
9576
9658
  setLogCallback: {
9577
9659
  args: ["ptr"],
9578
9660
  returns: "void"
@@ -10500,7 +10582,7 @@ class FFIRenderLib {
10500
10582
  if (this.logCallbackWrapper) {
10501
10583
  return;
10502
10584
  }
10503
- const logCallback = new JSCallback2((level, msgPtr, msgLenBigInt) => {
10585
+ const logCallback = new JSCallback((level, msgPtr, msgLenBigInt) => {
10504
10586
  try {
10505
10587
  const msgLen = typeof msgLenBigInt === "bigint" ? Number(msgLenBigInt) : msgLenBigInt;
10506
10588
  if (msgLen === 0 || !msgPtr) {
@@ -10545,7 +10627,7 @@ class FFIRenderLib {
10545
10627
  if (this.eventCallbackWrapper) {
10546
10628
  return;
10547
10629
  }
10548
- const eventCallback = new JSCallback2((namePtr, nameLenBigInt, dataPtr, dataLenBigInt) => {
10630
+ const eventCallback = new JSCallback((namePtr, nameLenBigInt, dataPtr, dataLenBigInt) => {
10549
10631
  try {
10550
10632
  const nameLen = typeof nameLenBigInt === "bigint" ? Number(nameLenBigInt) : nameLenBigInt;
10551
10633
  const dataLen = typeof dataLenBigInt === "bigint" ? Number(dataLenBigInt) : dataLenBigInt;
@@ -11558,13 +11640,13 @@ class TextBuffer {
11558
11640
  _textBytes;
11559
11641
  _memId;
11560
11642
  _appendedChunks = [];
11561
- constructor(lib2, ptr4) {
11562
- this.lib = lib2;
11643
+ constructor(lib, ptr4) {
11644
+ this.lib = lib;
11563
11645
  this.bufferPtr = ptr4;
11564
11646
  }
11565
11647
  static create(widthMethod) {
11566
- const lib2 = resolveRenderLib();
11567
- return lib2.createTextBuffer(widthMethod);
11648
+ const lib = resolveRenderLib();
11649
+ return lib.createTextBuffer(widthMethod);
11568
11650
  }
11569
11651
  guard() {
11570
11652
  if (this._destroyed)
@@ -11742,6 +11824,7 @@ class TextBuffer {
11742
11824
  }
11743
11825
 
11744
11826
  // src/Renderable.ts
11827
+ var import_bun_yoga2 = __toESM(require_dist(), 1);
11745
11828
  import { EventEmitter as EventEmitter6 } from "events";
11746
11829
 
11747
11830
  // src/lib/renderable.validations.ts
@@ -11872,7 +11955,7 @@ class BaseRenderable extends EventEmitter6 {
11872
11955
  this._visible = value;
11873
11956
  }
11874
11957
  }
11875
- var yogaConfig = dist_default.Config.create();
11958
+ var yogaConfig = import_bun_yoga2.default.Config.create();
11876
11959
  yogaConfig.setUseWebDefaults(false);
11877
11960
  yogaConfig.setPointScaleFactor(1);
11878
11961
 
@@ -11938,8 +12021,8 @@ class Renderable extends BaseRenderable {
11938
12021
  this.buffered = options.buffered ?? false;
11939
12022
  this._live = options.live ?? false;
11940
12023
  this._liveCount = this._live && this._visible ? 1 : 0;
11941
- this.yogaNode = dist_default.Node.create(yogaConfig);
11942
- this.yogaNode.setDisplay(this._visible ? Display.Flex : Display.None);
12024
+ this.yogaNode = import_bun_yoga2.default.Node.create(yogaConfig);
12025
+ this.yogaNode.setDisplay(this._visible ? import_bun_yoga2.Display.Flex : import_bun_yoga2.Display.None);
11943
12026
  this.setupYogaProperties(options);
11944
12027
  this.applyEventOptions(options);
11945
12028
  if (this.buffered) {
@@ -11974,7 +12057,7 @@ class Renderable extends BaseRenderable {
11974
12057
  return;
11975
12058
  const wasVisible = this._visible;
11976
12059
  this._visible = value;
11977
- this.yogaNode.setDisplay(value ? Display.Flex : Display.None);
12060
+ this.yogaNode.setDisplay(value ? import_bun_yoga2.Display.Flex : import_bun_yoga2.Display.None);
11978
12061
  if (this._live) {
11979
12062
  if (!wasVisible && value) {
11980
12063
  this.propagateLiveCount(1);
@@ -12293,40 +12376,40 @@ class Renderable extends BaseRenderable {
12293
12376
  setupMarginAndPadding(options) {
12294
12377
  const node = this.yogaNode;
12295
12378
  if (isMarginType(options.margin)) {
12296
- node.setMargin(Edge.Top, options.margin);
12297
- node.setMargin(Edge.Right, options.margin);
12298
- node.setMargin(Edge.Bottom, options.margin);
12299
- node.setMargin(Edge.Left, options.margin);
12379
+ node.setMargin(import_bun_yoga2.Edge.Top, options.margin);
12380
+ node.setMargin(import_bun_yoga2.Edge.Right, options.margin);
12381
+ node.setMargin(import_bun_yoga2.Edge.Bottom, options.margin);
12382
+ node.setMargin(import_bun_yoga2.Edge.Left, options.margin);
12300
12383
  }
12301
12384
  if (isMarginType(options.marginTop)) {
12302
- node.setMargin(Edge.Top, options.marginTop);
12385
+ node.setMargin(import_bun_yoga2.Edge.Top, options.marginTop);
12303
12386
  }
12304
12387
  if (isMarginType(options.marginRight)) {
12305
- node.setMargin(Edge.Right, options.marginRight);
12388
+ node.setMargin(import_bun_yoga2.Edge.Right, options.marginRight);
12306
12389
  }
12307
12390
  if (isMarginType(options.marginBottom)) {
12308
- node.setMargin(Edge.Bottom, options.marginBottom);
12391
+ node.setMargin(import_bun_yoga2.Edge.Bottom, options.marginBottom);
12309
12392
  }
12310
12393
  if (isMarginType(options.marginLeft)) {
12311
- node.setMargin(Edge.Left, options.marginLeft);
12394
+ node.setMargin(import_bun_yoga2.Edge.Left, options.marginLeft);
12312
12395
  }
12313
12396
  if (isPaddingType(options.padding)) {
12314
- node.setPadding(Edge.Top, options.padding);
12315
- node.setPadding(Edge.Right, options.padding);
12316
- node.setPadding(Edge.Bottom, options.padding);
12317
- node.setPadding(Edge.Left, options.padding);
12397
+ node.setPadding(import_bun_yoga2.Edge.Top, options.padding);
12398
+ node.setPadding(import_bun_yoga2.Edge.Right, options.padding);
12399
+ node.setPadding(import_bun_yoga2.Edge.Bottom, options.padding);
12400
+ node.setPadding(import_bun_yoga2.Edge.Left, options.padding);
12318
12401
  }
12319
12402
  if (isPaddingType(options.paddingTop)) {
12320
- node.setPadding(Edge.Top, options.paddingTop);
12403
+ node.setPadding(import_bun_yoga2.Edge.Top, options.paddingTop);
12321
12404
  }
12322
12405
  if (isPaddingType(options.paddingRight)) {
12323
- node.setPadding(Edge.Right, options.paddingRight);
12406
+ node.setPadding(import_bun_yoga2.Edge.Right, options.paddingRight);
12324
12407
  }
12325
12408
  if (isPaddingType(options.paddingBottom)) {
12326
- node.setPadding(Edge.Bottom, options.paddingBottom);
12409
+ node.setPadding(import_bun_yoga2.Edge.Bottom, options.paddingBottom);
12327
12410
  }
12328
12411
  if (isPaddingType(options.paddingLeft)) {
12329
- node.setPadding(Edge.Left, options.paddingLeft);
12412
+ node.setPadding(import_bun_yoga2.Edge.Left, options.paddingLeft);
12330
12413
  }
12331
12414
  }
12332
12415
  set position(positionType) {
@@ -12355,30 +12438,30 @@ class Renderable extends BaseRenderable {
12355
12438
  const { top, right, bottom, left } = position;
12356
12439
  if (isPositionType(top)) {
12357
12440
  if (top === "auto") {
12358
- node.setPositionAuto(Edge.Top);
12441
+ node.setPositionAuto(import_bun_yoga2.Edge.Top);
12359
12442
  } else {
12360
- node.setPosition(Edge.Top, top);
12443
+ node.setPosition(import_bun_yoga2.Edge.Top, top);
12361
12444
  }
12362
12445
  }
12363
12446
  if (isPositionType(right)) {
12364
12447
  if (right === "auto") {
12365
- node.setPositionAuto(Edge.Right);
12448
+ node.setPositionAuto(import_bun_yoga2.Edge.Right);
12366
12449
  } else {
12367
- node.setPosition(Edge.Right, right);
12450
+ node.setPosition(import_bun_yoga2.Edge.Right, right);
12368
12451
  }
12369
12452
  }
12370
12453
  if (isPositionType(bottom)) {
12371
12454
  if (bottom === "auto") {
12372
- node.setPositionAuto(Edge.Bottom);
12455
+ node.setPositionAuto(import_bun_yoga2.Edge.Bottom);
12373
12456
  } else {
12374
- node.setPosition(Edge.Bottom, bottom);
12457
+ node.setPosition(import_bun_yoga2.Edge.Bottom, bottom);
12375
12458
  }
12376
12459
  }
12377
12460
  if (isPositionType(left)) {
12378
12461
  if (left === "auto") {
12379
- node.setPositionAuto(Edge.Left);
12462
+ node.setPositionAuto(import_bun_yoga2.Edge.Left);
12380
12463
  } else {
12381
- node.setPosition(Edge.Left, left);
12464
+ node.setPosition(import_bun_yoga2.Edge.Left, left);
12382
12465
  }
12383
12466
  }
12384
12467
  this.requestRender();
@@ -12450,68 +12533,68 @@ class Renderable extends BaseRenderable {
12450
12533
  set margin(margin) {
12451
12534
  if (isMarginType(margin)) {
12452
12535
  const node = this.yogaNode;
12453
- node.setMargin(Edge.Top, margin);
12454
- node.setMargin(Edge.Right, margin);
12455
- node.setMargin(Edge.Bottom, margin);
12456
- node.setMargin(Edge.Left, margin);
12536
+ node.setMargin(import_bun_yoga2.Edge.Top, margin);
12537
+ node.setMargin(import_bun_yoga2.Edge.Right, margin);
12538
+ node.setMargin(import_bun_yoga2.Edge.Bottom, margin);
12539
+ node.setMargin(import_bun_yoga2.Edge.Left, margin);
12457
12540
  this.requestRender();
12458
12541
  }
12459
12542
  }
12460
12543
  set marginTop(margin) {
12461
12544
  if (isMarginType(margin)) {
12462
- this.yogaNode.setMargin(Edge.Top, margin);
12545
+ this.yogaNode.setMargin(import_bun_yoga2.Edge.Top, margin);
12463
12546
  this.requestRender();
12464
12547
  }
12465
12548
  }
12466
12549
  set marginRight(margin) {
12467
12550
  if (isMarginType(margin)) {
12468
- this.yogaNode.setMargin(Edge.Right, margin);
12551
+ this.yogaNode.setMargin(import_bun_yoga2.Edge.Right, margin);
12469
12552
  this.requestRender();
12470
12553
  }
12471
12554
  }
12472
12555
  set marginBottom(margin) {
12473
12556
  if (isMarginType(margin)) {
12474
- this.yogaNode.setMargin(Edge.Bottom, margin);
12557
+ this.yogaNode.setMargin(import_bun_yoga2.Edge.Bottom, margin);
12475
12558
  this.requestRender();
12476
12559
  }
12477
12560
  }
12478
12561
  set marginLeft(margin) {
12479
12562
  if (isMarginType(margin)) {
12480
- this.yogaNode.setMargin(Edge.Left, margin);
12563
+ this.yogaNode.setMargin(import_bun_yoga2.Edge.Left, margin);
12481
12564
  this.requestRender();
12482
12565
  }
12483
12566
  }
12484
12567
  set padding(padding) {
12485
12568
  if (isPaddingType(padding)) {
12486
12569
  const node = this.yogaNode;
12487
- node.setPadding(Edge.Top, padding);
12488
- node.setPadding(Edge.Right, padding);
12489
- node.setPadding(Edge.Bottom, padding);
12490
- node.setPadding(Edge.Left, padding);
12570
+ node.setPadding(import_bun_yoga2.Edge.Top, padding);
12571
+ node.setPadding(import_bun_yoga2.Edge.Right, padding);
12572
+ node.setPadding(import_bun_yoga2.Edge.Bottom, padding);
12573
+ node.setPadding(import_bun_yoga2.Edge.Left, padding);
12491
12574
  this.requestRender();
12492
12575
  }
12493
12576
  }
12494
12577
  set paddingTop(padding) {
12495
12578
  if (isPaddingType(padding)) {
12496
- this.yogaNode.setPadding(Edge.Top, padding);
12579
+ this.yogaNode.setPadding(import_bun_yoga2.Edge.Top, padding);
12497
12580
  this.requestRender();
12498
12581
  }
12499
12582
  }
12500
12583
  set paddingRight(padding) {
12501
12584
  if (isPaddingType(padding)) {
12502
- this.yogaNode.setPadding(Edge.Right, padding);
12585
+ this.yogaNode.setPadding(import_bun_yoga2.Edge.Right, padding);
12503
12586
  this.requestRender();
12504
12587
  }
12505
12588
  }
12506
12589
  set paddingBottom(padding) {
12507
12590
  if (isPaddingType(padding)) {
12508
- this.yogaNode.setPadding(Edge.Bottom, padding);
12591
+ this.yogaNode.setPadding(import_bun_yoga2.Edge.Bottom, padding);
12509
12592
  this.requestRender();
12510
12593
  }
12511
12594
  }
12512
12595
  set paddingLeft(padding) {
12513
12596
  if (isPaddingType(padding)) {
12514
- this.yogaNode.setPadding(Edge.Left, padding);
12597
+ this.yogaNode.setPadding(import_bun_yoga2.Edge.Left, padding);
12515
12598
  this.requestRender();
12516
12599
  }
12517
12600
  }
@@ -12927,10 +13010,10 @@ class RootRenderable extends Renderable {
12927
13010
  if (this.yogaNode) {
12928
13011
  this.yogaNode.free();
12929
13012
  }
12930
- this.yogaNode = dist_default.Node.create(yogaConfig);
13013
+ this.yogaNode = import_bun_yoga2.default.Node.create(yogaConfig);
12931
13014
  this.yogaNode.setWidth(ctx.width);
12932
13015
  this.yogaNode.setHeight(ctx.height);
12933
- this.yogaNode.setFlexDirection(FlexDirection.Column);
13016
+ this.yogaNode.setFlexDirection(import_bun_yoga2.FlexDirection.Column);
12934
13017
  this.calculateLayout();
12935
13018
  }
12936
13019
  render(buffer, deltaTime) {
@@ -12971,7 +13054,7 @@ class RootRenderable extends Renderable {
12971
13054
  }
12972
13055
  }
12973
13056
  calculateLayout() {
12974
- this.yogaNode.calculateLayout(this.width, this.height, Direction.LTR);
13057
+ this.yogaNode.calculateLayout(this.width, this.height, import_bun_yoga2.Direction.LTR);
12975
13058
  this.emit("layout-changed" /* LAYOUT_CHANGED */);
12976
13059
  }
12977
13060
  resize(width, height) {
@@ -14237,13 +14320,13 @@ Captured output:
14237
14320
  get controlState() {
14238
14321
  return this._controlState;
14239
14322
  }
14240
- constructor(lib2, rendererPtr, stdin, stdout, width, height, config = {}) {
14323
+ constructor(lib, rendererPtr, stdin, stdout, width, height, config = {}) {
14241
14324
  super();
14242
14325
  rendererTracker.addRenderer(this);
14243
14326
  this.stdin = stdin;
14244
14327
  this.stdout = stdout;
14245
14328
  this.realStdoutWrite = stdout.write;
14246
- this.lib = lib2;
14329
+ this.lib = lib;
14247
14330
  this._terminalWidth = stdout.columns;
14248
14331
  this._terminalHeight = stdout.rows;
14249
14332
  this.width = width;
@@ -14254,7 +14337,7 @@ Captured output:
14254
14337
  capture.on("write", this.captureCallback);
14255
14338
  this.renderOffset = height - this._splitHeight;
14256
14339
  this.height = this._splitHeight;
14257
- lib2.setRenderOffset(rendererPtr, this.renderOffset);
14340
+ lib.setRenderOffset(rendererPtr, this.renderOffset);
14258
14341
  }
14259
14342
  this.rendererPtr = rendererPtr;
14260
14343
  this.exitOnCtrlC = config.exitOnCtrlC === undefined ? true : config.exitOnCtrlC;
@@ -14848,19 +14931,19 @@ Captured output:
14848
14931
  this.lib.dumpStdoutBuffer(this.rendererPtr, timestamp);
14849
14932
  }
14850
14933
  static setCursorPosition(renderer, x, y, visible = true) {
14851
- const lib2 = resolveRenderLib();
14852
- lib2.setCursorPosition(renderer.rendererPtr, x, y, visible);
14934
+ const lib = resolveRenderLib();
14935
+ lib.setCursorPosition(renderer.rendererPtr, x, y, visible);
14853
14936
  }
14854
14937
  static setCursorStyle(renderer, style, blinking = false, color) {
14855
- const lib2 = resolveRenderLib();
14856
- lib2.setCursorStyle(renderer.rendererPtr, style, blinking);
14938
+ const lib = resolveRenderLib();
14939
+ lib.setCursorStyle(renderer.rendererPtr, style, blinking);
14857
14940
  if (color) {
14858
- lib2.setCursorColor(renderer.rendererPtr, color);
14941
+ lib.setCursorColor(renderer.rendererPtr, color);
14859
14942
  }
14860
14943
  }
14861
14944
  static setCursorColor(renderer, color) {
14862
- const lib2 = resolveRenderLib();
14863
- lib2.setCursorColor(renderer.rendererPtr, color);
14945
+ const lib = resolveRenderLib();
14946
+ lib.setCursorColor(renderer.rendererPtr, color);
14864
14947
  }
14865
14948
  setCursorPosition(x, y, visible = true) {
14866
14949
  this.lib.setCursorPosition(this.rendererPtr, x, y, visible);
@@ -15079,6 +15162,10 @@ Captured output:
15079
15162
  } catch (error) {
15080
15163
  console.error("Error in frame callback:", error);
15081
15164
  }
15165
+ if (this._isDestroyed) {
15166
+ this.rendering = false;
15167
+ return;
15168
+ }
15082
15169
  }
15083
15170
  const end = performance.now();
15084
15171
  this.renderStats.frameCallbackTime = end - start;
@@ -15281,8 +15368,8 @@ Captured output:
15281
15368
  return this._paletteDetectionPromise;
15282
15369
  }
15283
15370
  if (!this._paletteDetector) {
15284
- const isTmux = this.capabilities?.terminal?.name?.toLowerCase()?.includes("tmux");
15285
- this._paletteDetector = createTerminalPalette(this.stdin, this.stdout, this.writeOut.bind(this), isTmux);
15371
+ const isLegacyTmux = this.capabilities?.terminal?.name?.toLowerCase()?.includes("tmux") && this.capabilities?.terminal?.version?.localeCompare("3.6") < 0;
15372
+ this._paletteDetector = createTerminalPalette(this.stdin, this.stdout, this.writeOut.bind(this), isLegacyTmux);
15286
15373
  }
15287
15374
  this._paletteDetectionPromise = this._paletteDetector.detect(options).then((result) => {
15288
15375
  this._cachedPalette = result;
@@ -15293,7 +15380,7 @@ Captured output:
15293
15380
  }
15294
15381
  }
15295
15382
 
15296
- export { __toESM, __commonJS, __export, __require, Edge, Gutter, MeasureMode, exports_dist, BorderChars, getBorderFromSides, getBorderSides, borderCharsToArray, BorderCharArrays, nonAlphanumericKeys, parseKeypress, KeyEvent, PasteEvent, KeyHandler, InternalKeyHandler, RGBA, hexToRgb, rgbToHex, hsvToRgb, parseColor, fonts, measureText, getCharacterPositions, coordinateToCharacterIndex, renderFontToFrameBuffer, TextAttributes, DebugOverlayCorner, createTextAttributes, visualizeRenderableTree, isStyledText, StyledText, stringToStyledText, black, red, green, yellow, blue, magenta, cyan, white, brightBlack, brightRed, brightGreen, brightYellow, brightBlue, brightMagenta, brightCyan, brightWhite, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bold, italic, underline, strikethrough, dim, reverse, blink, fg, bg, t, hastToStyledText, LinearScrollAccel, MacOSScrollAccel, StdinBuffer, parseAlign, parseBoxSizing, parseDimension, parseDirection, parseDisplay, parseEdge, parseFlexDirection, parseGutter, parseJustify, parseLogLevel, parseMeasureMode, parseOverflow, parsePositionType, parseUnit, parseWrap, MouseParser, Selection, convertGlobalToLocalSelection, ASCIIFontSelectionHelper, envRegistry, registerEnvVar, clearEnvCache, generateEnvMarkdown, generateEnvColored, env, treeSitterToTextChunks, treeSitterToStyledText, addDefaultParsers, TreeSitterClient, DataPathsManager, getDataPaths, extToFiletype, pathToFiletype, main, getTreeSitterClient, ExtmarksController, createExtmarksController, TerminalPalette, createTerminalPalette, TextBuffer, LogLevel2 as LogLevel, setRenderLibPath, resolveRenderLib, OptimizedBuffer, h, isVNode, maybeMakeRenderable, wrapWithDelegates, instantiate, delegate, isValidPercentage, LayoutEvents, RenderableEvents, isRenderable, BaseRenderable, Renderable, RootRenderable, ANSI, capture, ConsolePosition, TerminalConsole, getObjectsInViewport, MouseEvent, MouseButton, createCliRenderer, CliRenderEvents, RendererControlState, CliRenderer };
15383
+ export { __toESM, __commonJS, __export, __require, require_dist, BorderChars, getBorderFromSides, getBorderSides, borderCharsToArray, BorderCharArrays, nonAlphanumericKeys, parseKeypress, KeyEvent, PasteEvent, KeyHandler, InternalKeyHandler, RGBA, hexToRgb, rgbToHex, hsvToRgb, parseColor, fonts, measureText, getCharacterPositions, coordinateToCharacterIndex, renderFontToFrameBuffer, TextAttributes, DebugOverlayCorner, createTextAttributes, visualizeRenderableTree, isStyledText, StyledText, stringToStyledText, black, red, green, yellow, blue, magenta, cyan, white, brightBlack, brightRed, brightGreen, brightYellow, brightBlue, brightMagenta, brightCyan, brightWhite, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bold, italic, underline, strikethrough, dim, reverse, blink, fg, bg, t, hastToStyledText, LinearScrollAccel, MacOSScrollAccel, StdinBuffer, parseAlign, parseBoxSizing, parseDimension, parseDirection, parseDisplay, parseEdge, parseFlexDirection, parseGutter, parseJustify, parseLogLevel, parseMeasureMode, parseOverflow, parsePositionType, parseUnit, parseWrap, MouseParser, Selection, convertGlobalToLocalSelection, ASCIIFontSelectionHelper, envRegistry, registerEnvVar, clearEnvCache, generateEnvMarkdown, generateEnvColored, env, treeSitterToTextChunks, treeSitterToStyledText, addDefaultParsers, TreeSitterClient, DataPathsManager, getDataPaths, extToFiletype, pathToFiletype, main, getTreeSitterClient, ExtmarksController, createExtmarksController, TerminalPalette, createTerminalPalette, TextBuffer, LogLevel2 as LogLevel, setRenderLibPath, resolveRenderLib, OptimizedBuffer, h, isVNode, maybeMakeRenderable, wrapWithDelegates, instantiate, delegate, isValidPercentage, LayoutEvents, RenderableEvents, isRenderable, BaseRenderable, Renderable, RootRenderable, ANSI, capture, ConsolePosition, TerminalConsole, getObjectsInViewport, MouseEvent, MouseButton, createCliRenderer, CliRenderEvents, RendererControlState, CliRenderer };
15297
15384
 
15298
- //# debugId=3153067811E5610D64756E2164756E21
15299
- //# sourceMappingURL=index-533e9nca.js.map
15385
+ //# debugId=4463EA6925DD17AC64756E2164756E21
15386
+ //# sourceMappingURL=index-r6acnfwr.js.map