@opentui/core 0.0.0-20251202-71dcabc4 → 0.0.0-20251202-52296102

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.
@@ -1,1214 +1,1285 @@
1
1
  // @bun
2
- var __create = Object.create;
3
- var __getProtoOf = Object.getPrototypeOf;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __toESM = (mod, isNodeMode, target) => {
8
- target = mod != null ? __create(__getProtoOf(mod)) : {};
9
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
- for (let key of __getOwnPropNames(mod))
11
- if (!__hasOwnProp.call(to, key))
12
- __defProp(to, key, {
13
- get: () => mod[key],
14
- enumerable: true
15
- });
16
- return to;
17
- };
18
- var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
19
- var __export = (target, all) => {
20
- for (var name in all)
21
- __defProp(target, name, {
22
- get: all[name],
23
- enumerable: true,
24
- configurable: true,
25
- set: (newValue) => all[name] = () => newValue
26
- });
27
- };
28
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
29
- var __require = import.meta.require;
30
-
31
- // ../../node_modules/bun-yoga/dist/darwin-arm64/libyoga.dylib
32
- var exports_libyoga = {};
33
- __export(exports_libyoga, {
34
- default: () => libyoga_default
35
- });
36
- var libyoga_default = "./libyoga-j5nt7np1.dylib";
37
- var init_libyoga = () => {};
38
-
39
- // ../../node_modules/bun-yoga/dist/darwin-x64/libyoga.dylib
40
- var exports_libyoga2 = {};
41
- __export(exports_libyoga2, {
42
- default: () => libyoga_default2
43
- });
44
- var libyoga_default2 = "./libyoga-2ksztx35.dylib";
45
- var init_libyoga2 = () => {};
46
-
47
- // ../../node_modules/bun-yoga/dist/linux-x64/libyoga.so
48
- var exports_libyoga3 = {};
49
- __export(exports_libyoga3, {
50
- default: () => libyoga_default3
51
- });
52
- var libyoga_default3 = "./libyoga-wnbqxxhv.so";
53
- var init_libyoga3 = () => {};
54
-
55
- // ../../node_modules/bun-yoga/dist/linux-arm64/libyoga.so
56
- var exports_libyoga4 = {};
57
- __export(exports_libyoga4, {
58
- default: () => libyoga_default4
59
- });
60
- var libyoga_default4 = "./libyoga-gh2tjwb7.so";
61
- var init_libyoga4 = () => {};
62
-
63
- // ../../node_modules/bun-yoga/dist/windows-x64/yoga.dll
64
- var exports_yoga = {};
65
- __export(exports_yoga, {
66
- default: () => yoga_default
67
- });
68
- var yoga_default = "./yoga-jkgc6c1f.dll";
69
- var init_yoga = () => {};
2
+ import {
3
+ __export,
4
+ __require,
5
+ __toESM
6
+ } from "./index-g8dczzvv.js";
70
7
 
71
8
  // ../../node_modules/bun-yoga/dist/index.js
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;
96
- }
97
- }
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
- }
110
- }
111
- const embedded = getEmbeddedLib();
112
- if (embedded) {
113
- return embedded;
114
- }
9
+ var exports_dist = {};
10
+ __export(exports_dist, {
11
+ default: () => dist_default,
12
+ Wrap: () => Wrap,
13
+ WRAP_WRAP_REVERSE: () => WRAP_WRAP_REVERSE,
14
+ WRAP_WRAP: () => WRAP_WRAP,
15
+ WRAP_NO_WRAP: () => WRAP_NO_WRAP,
16
+ Unit: () => Unit,
17
+ PositionType: () => PositionType,
18
+ POSITION_TYPE_STATIC: () => POSITION_TYPE_STATIC,
19
+ POSITION_TYPE_RELATIVE: () => POSITION_TYPE_RELATIVE,
20
+ POSITION_TYPE_ABSOLUTE: () => POSITION_TYPE_ABSOLUTE,
21
+ Overflow: () => Overflow,
22
+ OVERFLOW_VISIBLE: () => OVERFLOW_VISIBLE,
23
+ OVERFLOW_SCROLL: () => OVERFLOW_SCROLL,
24
+ OVERFLOW_HIDDEN: () => OVERFLOW_HIDDEN,
25
+ NodeType: () => NodeType,
26
+ Node: () => Node,
27
+ MeasureMode: () => MeasureMode,
28
+ LogLevel: () => LogLevel,
29
+ Justify: () => Justify,
30
+ JUSTIFY_SPACE_EVENLY: () => JUSTIFY_SPACE_EVENLY,
31
+ JUSTIFY_SPACE_BETWEEN: () => JUSTIFY_SPACE_BETWEEN,
32
+ JUSTIFY_SPACE_AROUND: () => JUSTIFY_SPACE_AROUND,
33
+ JUSTIFY_FLEX_START: () => JUSTIFY_FLEX_START,
34
+ JUSTIFY_FLEX_END: () => JUSTIFY_FLEX_END,
35
+ JUSTIFY_CENTER: () => JUSTIFY_CENTER,
36
+ Gutter: () => Gutter,
37
+ FlexDirection: () => FlexDirection,
38
+ FLEX_DIRECTION_ROW_REVERSE: () => FLEX_DIRECTION_ROW_REVERSE,
39
+ FLEX_DIRECTION_ROW: () => FLEX_DIRECTION_ROW,
40
+ FLEX_DIRECTION_COLUMN_REVERSE: () => FLEX_DIRECTION_COLUMN_REVERSE,
41
+ FLEX_DIRECTION_COLUMN: () => FLEX_DIRECTION_COLUMN,
42
+ ExperimentalFeature: () => ExperimentalFeature,
43
+ Errata: () => Errata,
44
+ Edge: () => Edge,
45
+ EDGE_VERTICAL: () => EDGE_VERTICAL,
46
+ EDGE_TOP: () => EDGE_TOP,
47
+ EDGE_START: () => EDGE_START,
48
+ EDGE_RIGHT: () => EDGE_RIGHT,
49
+ EDGE_LEFT: () => EDGE_LEFT,
50
+ EDGE_HORIZONTAL: () => EDGE_HORIZONTAL,
51
+ EDGE_END: () => EDGE_END,
52
+ EDGE_BOTTOM: () => EDGE_BOTTOM,
53
+ EDGE_ALL: () => EDGE_ALL,
54
+ Display: () => Display,
55
+ Direction: () => Direction,
56
+ Dimension: () => Dimension,
57
+ DISPLAY_NONE: () => DISPLAY_NONE,
58
+ DISPLAY_FLEX: () => DISPLAY_FLEX,
59
+ DIRECTION_RTL: () => DIRECTION_RTL,
60
+ DIRECTION_LTR: () => DIRECTION_LTR,
61
+ DIRECTION_INHERIT: () => DIRECTION_INHERIT,
62
+ Config: () => Config,
63
+ BoxSizing: () => BoxSizing,
64
+ Align: () => Align,
65
+ ALIGN_STRETCH: () => ALIGN_STRETCH,
66
+ ALIGN_SPACE_EVENLY: () => ALIGN_SPACE_EVENLY,
67
+ ALIGN_SPACE_BETWEEN: () => ALIGN_SPACE_BETWEEN,
68
+ ALIGN_SPACE_AROUND: () => ALIGN_SPACE_AROUND,
69
+ ALIGN_FLEX_START: () => ALIGN_FLEX_START,
70
+ ALIGN_FLEX_END: () => ALIGN_FLEX_END,
71
+ ALIGN_CENTER: () => ALIGN_CENTER,
72
+ ALIGN_BASELINE: () => ALIGN_BASELINE,
73
+ ALIGN_AUTO: () => ALIGN_AUTO
74
+ });
75
+ import { dlopen, suffix, JSCallback, FFIType } from "bun:ffi";
76
+ import { join } from "path";
77
+ import { existsSync } from "fs";
78
+ var __dirname = "/Users/runner/work/opentui/opentui/node_modules/bun-yoga/dist";
79
+ var embeddedLib = await (async () => {
80
+ try {
115
81
  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
- }
82
+ return (await import("./libyoga-m7gmcz0e.js", { with: { type: "file" } })).default;
119
83
  } 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
- }
84
+ return (await import("./libyoga-jkq1dr7g.js", { with: { type: "file" } })).default;
123
85
  } 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
- }
86
+ return (await import("./libyoga-zt51h244.js", { with: { type: "file" } })).default;
127
87
  } 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
- }
88
+ return (await import("./libyoga-jjdjx62k.js", { with: { type: "file" } })).default;
131
89
  } 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}
137
- ` + `Make sure to run 'zig build' or install the package with binaries.`);
138
- }
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;
453
-
454
- class Node {
455
- ptr;
456
- _freed = false;
457
- measureCallback = null;
458
- baselineCallback = null;
459
- dirtiedCallback = null;
460
- constructor(ptr) {
461
- this.ptr = ptr;
462
- }
463
- isFreed() {
464
- return this._freed;
465
- }
466
- assertNotFreed() {
467
- if (this._freed) {
468
- throw new Error("Cannot access freed Yoga node");
469
- }
470
- }
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);
476
- }
477
- static createDefault() {
478
- return Node.create();
479
- }
480
- static createWithConfig(config) {
481
- return Node.create(config);
482
- }
483
- static destroy(node) {
484
- node.free();
485
- }
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
- };
602
- }
603
- getComputedLeft() {
604
- this.assertNotFreed();
605
- return yg.ygNodeLayoutGetLeft(this.ptr);
606
- }
607
- getComputedTop() {
608
- this.assertNotFreed();
609
- return yg.ygNodeLayoutGetTop(this.ptr);
610
- }
611
- getComputedRight() {
612
- this.assertNotFreed();
613
- return yg.ygNodeLayoutGetRight(this.ptr);
614
- }
615
- getComputedBottom() {
616
- this.assertNotFreed();
617
- return yg.ygNodeLayoutGetBottom(this.ptr);
618
- }
619
- getComputedWidth() {
620
- this.assertNotFreed();
621
- return yg.ygNodeLayoutGetWidth(this.ptr);
622
- }
623
- getComputedHeight() {
624
- this.assertNotFreed();
625
- return yg.ygNodeLayoutGetHeight(this.ptr);
626
- }
627
- getComputedBorder(edge) {
628
- this.assertNotFreed();
629
- return yg.ygNodeLayoutGetBorder(this.ptr, edge);
630
- }
631
- getComputedMargin(edge) {
632
- this.assertNotFreed();
633
- return yg.ygNodeLayoutGetMargin(this.ptr, edge);
634
- }
635
- getComputedPadding(edge) {
636
- this.assertNotFreed();
637
- return yg.ygNodeLayoutGetPadding(this.ptr, edge);
638
- }
639
- setDirection(direction) {
640
- this.assertNotFreed();
641
- yg.ygNodeStyleSetDirection(this.ptr, direction);
642
- }
643
- getDirection() {
644
- this.assertNotFreed();
645
- return yg.ygNodeStyleGetDirection(this.ptr);
646
- }
647
- setFlexDirection(flexDirection) {
648
- this.assertNotFreed();
649
- yg.ygNodeStyleSetFlexDirection(this.ptr, flexDirection);
650
- }
651
- getFlexDirection() {
652
- this.assertNotFreed();
653
- return yg.ygNodeStyleGetFlexDirection(this.ptr);
654
- }
655
- setJustifyContent(justifyContent) {
656
- this.assertNotFreed();
657
- yg.ygNodeStyleSetJustifyContent(this.ptr, justifyContent);
658
- }
659
- getJustifyContent() {
660
- this.assertNotFreed();
661
- return yg.ygNodeStyleGetJustifyContent(this.ptr);
90
+ return (await import("./yoga-merwjcba.js", { with: { type: "file" } })).default;
662
91
  }
663
- setAlignContent(alignContent) {
664
- this.assertNotFreed();
665
- yg.ygNodeStyleSetAlignContent(this.ptr, alignContent);
92
+ } catch {}
93
+ return;
94
+ })();
95
+ function getLibPath() {
96
+ if (process.platform === "win32") {
97
+ if (existsSync(join(__dirname, "..", "zig-out", "lib", `yoga.${suffix}`))) {
98
+ return join(__dirname, "..", "zig-out", "lib", `yoga.${suffix}`);
666
99
  }
667
- getAlignContent() {
668
- this.assertNotFreed();
669
- return yg.ygNodeStyleGetAlignContent(this.ptr);
100
+ if (existsSync(join(__dirname, "..", "zig-out", "bin", `yoga.${suffix}`))) {
101
+ return join(__dirname, "..", "zig-out", "bin", `yoga.${suffix}`);
670
102
  }
671
- setAlignItems(alignItems) {
672
- this.assertNotFreed();
673
- yg.ygNodeStyleSetAlignItems(this.ptr, alignItems);
674
- }
675
- getAlignItems() {
676
- this.assertNotFreed();
677
- return yg.ygNodeStyleGetAlignItems(this.ptr);
678
- }
679
- setAlignSelf(alignSelf) {
680
- this.assertNotFreed();
681
- yg.ygNodeStyleSetAlignSelf(this.ptr, alignSelf);
682
- }
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);
103
+ } else {
104
+ if (existsSync(join(__dirname, "..", "zig-out", "lib", `libyoga.${suffix}`))) {
105
+ return join(__dirname, "..", "zig-out", "lib", `libyoga.${suffix}`);
106
+ }
107
+ }
108
+ if (embeddedLib && existsSync(embeddedLib)) {
109
+ return embeddedLib;
110
+ }
111
+ throw new Error(`Could not find native library. Platform: ${process.platform}-${process.arch}
112
+ Make sure to run 'zig build' or install the package with binaries.`);
113
+ }
114
+ var Align = {
115
+ Auto: 0,
116
+ FlexStart: 1,
117
+ Center: 2,
118
+ FlexEnd: 3,
119
+ Stretch: 4,
120
+ Baseline: 5,
121
+ SpaceBetween: 6,
122
+ SpaceAround: 7,
123
+ SpaceEvenly: 8
124
+ };
125
+ var BoxSizing = {
126
+ BorderBox: 0,
127
+ ContentBox: 1
128
+ };
129
+ var Dimension = {
130
+ Width: 0,
131
+ Height: 1
132
+ };
133
+ var Direction = {
134
+ Inherit: 0,
135
+ LTR: 1,
136
+ RTL: 2
137
+ };
138
+ var Display = {
139
+ Flex: 0,
140
+ None: 1,
141
+ Contents: 2
142
+ };
143
+ var Edge = {
144
+ Left: 0,
145
+ Top: 1,
146
+ Right: 2,
147
+ Bottom: 3,
148
+ Start: 4,
149
+ End: 5,
150
+ Horizontal: 6,
151
+ Vertical: 7,
152
+ All: 8
153
+ };
154
+ var Errata = {
155
+ None: 0,
156
+ StretchFlexBasis: 1,
157
+ AbsolutePositionWithoutInsetsExcludesPadding: 2,
158
+ AbsolutePercentAgainstInnerSize: 4,
159
+ All: 2147483647,
160
+ Classic: 2147483646
161
+ };
162
+ var ExperimentalFeature = {
163
+ WebFlexBasis: 0
164
+ };
165
+ var FlexDirection = {
166
+ Column: 0,
167
+ ColumnReverse: 1,
168
+ Row: 2,
169
+ RowReverse: 3
170
+ };
171
+ var Gutter = {
172
+ Column: 0,
173
+ Row: 1,
174
+ All: 2
175
+ };
176
+ var Justify = {
177
+ FlexStart: 0,
178
+ Center: 1,
179
+ FlexEnd: 2,
180
+ SpaceBetween: 3,
181
+ SpaceAround: 4,
182
+ SpaceEvenly: 5
183
+ };
184
+ var LogLevel = {
185
+ Error: 0,
186
+ Warn: 1,
187
+ Info: 2,
188
+ Debug: 3,
189
+ Verbose: 4,
190
+ Fatal: 5
191
+ };
192
+ var MeasureMode = {
193
+ Undefined: 0,
194
+ Exactly: 1,
195
+ AtMost: 2
196
+ };
197
+ var NodeType = {
198
+ Default: 0,
199
+ Text: 1
200
+ };
201
+ var Overflow = {
202
+ Visible: 0,
203
+ Hidden: 1,
204
+ Scroll: 2
205
+ };
206
+ var PositionType = {
207
+ Static: 0,
208
+ Relative: 1,
209
+ Absolute: 2
210
+ };
211
+ var Unit = {
212
+ Undefined: 0,
213
+ Point: 1,
214
+ Percent: 2,
215
+ Auto: 3
216
+ };
217
+ var Wrap = {
218
+ NoWrap: 0,
219
+ Wrap: 1,
220
+ WrapReverse: 2
221
+ };
222
+ var EDGE_LEFT = Edge.Left;
223
+ var EDGE_TOP = Edge.Top;
224
+ var EDGE_RIGHT = Edge.Right;
225
+ var EDGE_BOTTOM = Edge.Bottom;
226
+ var EDGE_START = Edge.Start;
227
+ var EDGE_END = Edge.End;
228
+ var EDGE_HORIZONTAL = Edge.Horizontal;
229
+ var EDGE_VERTICAL = Edge.Vertical;
230
+ var EDGE_ALL = Edge.All;
231
+ var FLEX_DIRECTION_COLUMN = FlexDirection.Column;
232
+ var FLEX_DIRECTION_COLUMN_REVERSE = FlexDirection.ColumnReverse;
233
+ var FLEX_DIRECTION_ROW = FlexDirection.Row;
234
+ var FLEX_DIRECTION_ROW_REVERSE = FlexDirection.RowReverse;
235
+ var JUSTIFY_FLEX_START = Justify.FlexStart;
236
+ var JUSTIFY_CENTER = Justify.Center;
237
+ var JUSTIFY_FLEX_END = Justify.FlexEnd;
238
+ var JUSTIFY_SPACE_BETWEEN = Justify.SpaceBetween;
239
+ var JUSTIFY_SPACE_AROUND = Justify.SpaceAround;
240
+ var JUSTIFY_SPACE_EVENLY = Justify.SpaceEvenly;
241
+ var ALIGN_AUTO = Align.Auto;
242
+ var ALIGN_FLEX_START = Align.FlexStart;
243
+ var ALIGN_CENTER = Align.Center;
244
+ var ALIGN_FLEX_END = Align.FlexEnd;
245
+ var ALIGN_STRETCH = Align.Stretch;
246
+ var ALIGN_BASELINE = Align.Baseline;
247
+ var ALIGN_SPACE_BETWEEN = Align.SpaceBetween;
248
+ var ALIGN_SPACE_AROUND = Align.SpaceAround;
249
+ var ALIGN_SPACE_EVENLY = Align.SpaceEvenly;
250
+ var WRAP_NO_WRAP = Wrap.NoWrap;
251
+ var WRAP_WRAP = Wrap.Wrap;
252
+ var WRAP_WRAP_REVERSE = Wrap.WrapReverse;
253
+ var OVERFLOW_VISIBLE = Overflow.Visible;
254
+ var OVERFLOW_HIDDEN = Overflow.Hidden;
255
+ var OVERFLOW_SCROLL = Overflow.Scroll;
256
+ var DISPLAY_FLEX = Display.Flex;
257
+ var DISPLAY_NONE = Display.None;
258
+ var POSITION_TYPE_STATIC = PositionType.Static;
259
+ var POSITION_TYPE_RELATIVE = PositionType.Relative;
260
+ var POSITION_TYPE_ABSOLUTE = PositionType.Absolute;
261
+ var DIRECTION_INHERIT = Direction.Inherit;
262
+ var DIRECTION_LTR = Direction.LTR;
263
+ var DIRECTION_RTL = Direction.RTL;
264
+ function parseValue(value) {
265
+ if (value === undefined) {
266
+ return { unit: Unit.Undefined, asNumber: undefined };
267
+ }
268
+ if (value === "auto") {
269
+ return { unit: Unit.Auto, asNumber: undefined };
270
+ }
271
+ if (typeof value === "string" && value.endsWith("%")) {
272
+ return { unit: Unit.Percent, asNumber: parseFloat(value) };
273
+ }
274
+ return { unit: Unit.Point, asNumber: value };
275
+ }
276
+ var UNDEFINED_VALUE = { unit: Unit.Undefined, value: NaN };
277
+ function unpackValue(packed) {
278
+ const p = BigInt(packed);
279
+ const unit = Number(p & 0xffffffffn);
280
+ const valueBits = Number(p >> 32n & 0xffffffffn);
281
+ const buffer = new ArrayBuffer(4);
282
+ const view = new DataView(buffer);
283
+ view.setUint32(0, valueBits, true);
284
+ const value = view.getFloat32(0, true);
285
+ return { unit, value };
286
+ }
287
+ var lib = dlopen(getLibPath(), {
288
+ ygConfigNew: { args: [], returns: "ptr" },
289
+ ygConfigFree: { args: ["ptr"], returns: "void" },
290
+ ygConfigGetDefault: { args: [], returns: "ptr" },
291
+ ygConfigSetUseWebDefaults: { args: ["ptr", "bool"], returns: "void" },
292
+ ygConfigGetUseWebDefaults: { args: ["ptr"], returns: "bool" },
293
+ ygConfigSetPointScaleFactor: { args: ["ptr", "f32"], returns: "void" },
294
+ ygConfigGetPointScaleFactor: { args: ["ptr"], returns: "f32" },
295
+ ygConfigSetErrata: { args: ["ptr", "i32"], returns: "void" },
296
+ ygConfigGetErrata: { args: ["ptr"], returns: "i32" },
297
+ ygConfigSetExperimentalFeatureEnabled: {
298
+ args: ["ptr", "i32", "bool"],
299
+ returns: "void"
300
+ },
301
+ ygConfigIsExperimentalFeatureEnabled: {
302
+ args: ["ptr", "i32"],
303
+ returns: "bool"
304
+ },
305
+ ygNodeNew: { args: [], returns: "ptr" },
306
+ ygNodeNewWithConfig: { args: ["ptr"], returns: "ptr" },
307
+ ygNodeClone: { args: ["ptr"], returns: "ptr" },
308
+ ygNodeFree: { args: ["ptr"], returns: "void" },
309
+ ygNodeFreeRecursive: { args: ["ptr"], returns: "void" },
310
+ ygNodeReset: { args: ["ptr"], returns: "void" },
311
+ ygNodeCopyStyle: { args: ["ptr", "ptr"], returns: "void" },
312
+ ygNodeSetIsReferenceBaseline: { args: ["ptr", "bool"], returns: "void" },
313
+ ygNodeIsReferenceBaseline: { args: ["ptr"], returns: "bool" },
314
+ ygNodeSetAlwaysFormsContainingBlock: {
315
+ args: ["ptr", "bool"],
316
+ returns: "void"
317
+ },
318
+ ygNodeInsertChild: { args: ["ptr", "ptr", "u64"], returns: "void" },
319
+ ygNodeRemoveChild: { args: ["ptr", "ptr"], returns: "void" },
320
+ ygNodeRemoveAllChildren: { args: ["ptr"], returns: "void" },
321
+ ygNodeGetChild: { args: ["ptr", "u64"], returns: "ptr" },
322
+ ygNodeGetChildCount: { args: ["ptr"], returns: "u64" },
323
+ ygNodeGetParent: { args: ["ptr"], returns: "ptr" },
324
+ ygNodeCalculateLayout: { args: ["ptr", "f32", "f32", "i32"], returns: "void" },
325
+ ygNodeGetHasNewLayout: { args: ["ptr"], returns: "bool" },
326
+ ygNodeSetHasNewLayout: { args: ["ptr", "bool"], returns: "void" },
327
+ ygNodeMarkDirty: { args: ["ptr"], returns: "void" },
328
+ ygNodeIsDirty: { args: ["ptr"], returns: "bool" },
329
+ ygNodeLayoutGetLeft: { args: ["ptr"], returns: "f32" },
330
+ ygNodeLayoutGetTop: { args: ["ptr"], returns: "f32" },
331
+ ygNodeLayoutGetRight: { args: ["ptr"], returns: "f32" },
332
+ ygNodeLayoutGetBottom: { args: ["ptr"], returns: "f32" },
333
+ ygNodeLayoutGetWidth: { args: ["ptr"], returns: "f32" },
334
+ ygNodeLayoutGetHeight: { args: ["ptr"], returns: "f32" },
335
+ ygNodeLayoutGetBorder: { args: ["ptr", "i32"], returns: "f32" },
336
+ ygNodeLayoutGetMargin: { args: ["ptr", "i32"], returns: "f32" },
337
+ ygNodeLayoutGetPadding: { args: ["ptr", "i32"], returns: "f32" },
338
+ ygNodeStyleSetDirection: { args: ["ptr", "i32"], returns: "void" },
339
+ ygNodeStyleGetDirection: { args: ["ptr"], returns: "i32" },
340
+ ygNodeStyleSetFlexDirection: { args: ["ptr", "i32"], returns: "void" },
341
+ ygNodeStyleGetFlexDirection: { args: ["ptr"], returns: "i32" },
342
+ ygNodeStyleSetJustifyContent: { args: ["ptr", "i32"], returns: "void" },
343
+ ygNodeStyleGetJustifyContent: { args: ["ptr"], returns: "i32" },
344
+ ygNodeStyleSetAlignContent: { args: ["ptr", "i32"], returns: "void" },
345
+ ygNodeStyleGetAlignContent: { args: ["ptr"], returns: "i32" },
346
+ ygNodeStyleSetAlignItems: { args: ["ptr", "i32"], returns: "void" },
347
+ ygNodeStyleGetAlignItems: { args: ["ptr"], returns: "i32" },
348
+ ygNodeStyleSetAlignSelf: { args: ["ptr", "i32"], returns: "void" },
349
+ ygNodeStyleGetAlignSelf: { args: ["ptr"], returns: "i32" },
350
+ ygNodeStyleSetPositionType: { args: ["ptr", "i32"], returns: "void" },
351
+ ygNodeStyleGetPositionType: { args: ["ptr"], returns: "i32" },
352
+ ygNodeStyleSetFlexWrap: { args: ["ptr", "i32"], returns: "void" },
353
+ ygNodeStyleGetFlexWrap: { args: ["ptr"], returns: "i32" },
354
+ ygNodeStyleSetOverflow: { args: ["ptr", "i32"], returns: "void" },
355
+ ygNodeStyleGetOverflow: { args: ["ptr"], returns: "i32" },
356
+ ygNodeStyleSetDisplay: { args: ["ptr", "i32"], returns: "void" },
357
+ ygNodeStyleGetDisplay: { args: ["ptr"], returns: "i32" },
358
+ ygNodeStyleSetBoxSizing: { args: ["ptr", "i32"], returns: "void" },
359
+ ygNodeStyleGetBoxSizing: { args: ["ptr"], returns: "i32" },
360
+ ygNodeStyleSetFlex: { args: ["ptr", "f32"], returns: "void" },
361
+ ygNodeStyleGetFlex: { args: ["ptr"], returns: "f32" },
362
+ ygNodeStyleSetFlexGrow: { args: ["ptr", "f32"], returns: "void" },
363
+ ygNodeStyleGetFlexGrow: { args: ["ptr"], returns: "f32" },
364
+ ygNodeStyleSetFlexShrink: { args: ["ptr", "f32"], returns: "void" },
365
+ ygNodeStyleGetFlexShrink: { args: ["ptr"], returns: "f32" },
366
+ ygNodeStyleSetFlexBasis: { args: ["ptr", "f32"], returns: "void" },
367
+ ygNodeStyleSetFlexBasisPercent: { args: ["ptr", "f32"], returns: "void" },
368
+ ygNodeStyleSetFlexBasisAuto: { args: ["ptr"], returns: "void" },
369
+ ygNodeStyleSetPosition: { args: ["ptr", "i32", "f32"], returns: "void" },
370
+ ygNodeStyleSetPositionPercent: { args: ["ptr", "i32", "f32"], returns: "void" },
371
+ ygNodeStyleSetPositionAuto: { args: ["ptr", "i32"], returns: "void" },
372
+ ygNodeStyleSetMargin: { args: ["ptr", "i32", "f32"], returns: "void" },
373
+ ygNodeStyleSetMarginPercent: { args: ["ptr", "i32", "f32"], returns: "void" },
374
+ ygNodeStyleSetMarginAuto: { args: ["ptr", "i32"], returns: "void" },
375
+ ygNodeStyleSetPadding: { args: ["ptr", "i32", "f32"], returns: "void" },
376
+ ygNodeStyleSetPaddingPercent: { args: ["ptr", "i32", "f32"], returns: "void" },
377
+ ygNodeStyleSetBorder: { args: ["ptr", "i32", "f32"], returns: "void" },
378
+ ygNodeStyleGetBorder: { args: ["ptr", "i32"], returns: "f32" },
379
+ ygNodeStyleSetGap: { args: ["ptr", "i32", "f32"], returns: "void" },
380
+ ygNodeStyleSetGapPercent: { args: ["ptr", "i32", "f32"], returns: "void" },
381
+ ygNodeStyleSetWidth: { args: ["ptr", "f32"], returns: "void" },
382
+ ygNodeStyleSetWidthPercent: { args: ["ptr", "f32"], returns: "void" },
383
+ ygNodeStyleSetWidthAuto: { args: ["ptr"], returns: "void" },
384
+ ygNodeStyleSetHeight: { args: ["ptr", "f32"], returns: "void" },
385
+ ygNodeStyleSetHeightPercent: { args: ["ptr", "f32"], returns: "void" },
386
+ ygNodeStyleSetHeightAuto: { args: ["ptr"], returns: "void" },
387
+ ygNodeStyleSetMinWidth: { args: ["ptr", "f32"], returns: "void" },
388
+ ygNodeStyleSetMinWidthPercent: { args: ["ptr", "f32"], returns: "void" },
389
+ ygNodeStyleSetMinHeight: { args: ["ptr", "f32"], returns: "void" },
390
+ ygNodeStyleSetMinHeightPercent: { args: ["ptr", "f32"], returns: "void" },
391
+ ygNodeStyleSetMaxWidth: { args: ["ptr", "f32"], returns: "void" },
392
+ ygNodeStyleSetMaxWidthPercent: { args: ["ptr", "f32"], returns: "void" },
393
+ ygNodeStyleSetMaxHeight: { args: ["ptr", "f32"], returns: "void" },
394
+ ygNodeStyleSetMaxHeightPercent: { args: ["ptr", "f32"], returns: "void" },
395
+ ygNodeStyleSetAspectRatio: { args: ["ptr", "f32"], returns: "void" },
396
+ ygNodeStyleGetAspectRatio: { args: ["ptr"], returns: "f32" },
397
+ ygNodeSetContext: { args: ["ptr", "ptr"], returns: "void" },
398
+ ygNodeGetContext: { args: ["ptr"], returns: "ptr" },
399
+ ygNodeSetMeasureFunc: { args: ["ptr", "ptr"], returns: "void" },
400
+ ygNodeUnsetMeasureFunc: { args: ["ptr"], returns: "void" },
401
+ ygNodeHasMeasureFunc: { args: ["ptr"], returns: "bool" },
402
+ ygNodeSetBaselineFunc: { args: ["ptr", "ptr"], returns: "void" },
403
+ ygNodeUnsetBaselineFunc: { args: ["ptr"], returns: "void" },
404
+ ygNodeHasBaselineFunc: { args: ["ptr"], returns: "bool" },
405
+ ygNodeSetDirtiedFunc: { args: ["ptr", "ptr"], returns: "void" },
406
+ ygNodeUnsetDirtiedFunc: { args: ["ptr"], returns: "void" },
407
+ ygNodeGetDirtiedFunc: { args: ["ptr"], returns: "ptr" },
408
+ ygCreateSize: { args: ["f32", "f32"], returns: "u64" },
409
+ ygStoreMeasureResult: { args: ["f32", "f32"], returns: "void" },
410
+ ygStoreBaselineResult: { args: ["f32"], returns: "void" },
411
+ ygNodeSetMeasureFuncTrampoline: { args: ["ptr", "ptr"], returns: "void" },
412
+ ygNodeUnsetMeasureFuncTrampoline: { args: ["ptr"], returns: "void" },
413
+ ygNodeSetBaselineFuncTrampoline: { args: ["ptr", "ptr"], returns: "void" },
414
+ ygNodeUnsetBaselineFuncTrampoline: { args: ["ptr"], returns: "void" },
415
+ ygNodeFreeCallbacks: { args: ["ptr"], returns: "void" },
416
+ ygNodeStyleGetWidthPacked: { args: ["ptr"], returns: "u64" },
417
+ ygNodeStyleGetHeightPacked: { args: ["ptr"], returns: "u64" },
418
+ ygNodeStyleGetMinWidthPacked: { args: ["ptr"], returns: "u64" },
419
+ ygNodeStyleGetMinHeightPacked: { args: ["ptr"], returns: "u64" },
420
+ ygNodeStyleGetMaxWidthPacked: { args: ["ptr"], returns: "u64" },
421
+ ygNodeStyleGetMaxHeightPacked: { args: ["ptr"], returns: "u64" },
422
+ ygNodeStyleGetMarginPacked: { args: ["ptr", "i32"], returns: "u64" },
423
+ ygNodeStyleGetPaddingPacked: { args: ["ptr", "i32"], returns: "u64" },
424
+ ygNodeStyleGetPositionPacked: { args: ["ptr", "i32"], returns: "u64" },
425
+ ygNodeStyleGetGapPacked: { args: ["ptr", "i32"], returns: "u64" },
426
+ ygNodeStyleGetFlexBasisPacked: { args: ["ptr"], returns: "u64" }
427
+ });
428
+ var yg = lib.symbols;
429
+
430
+ class Node {
431
+ ptr;
432
+ _freed = false;
433
+ measureCallback = null;
434
+ baselineCallback = null;
435
+ dirtiedCallback = null;
436
+ constructor(ptr) {
437
+ this.ptr = ptr;
438
+ }
439
+ isFreed() {
440
+ return this._freed;
441
+ }
442
+ static create(config) {
443
+ const ptr = config ? yg.ygNodeNewWithConfig(config["ptr"]) : yg.ygNodeNew();
444
+ if (!ptr)
445
+ throw new Error("Failed to create node");
446
+ return new Node(ptr);
447
+ }
448
+ static createDefault() {
449
+ return Node.create();
450
+ }
451
+ static createWithConfig(config) {
452
+ return Node.create(config);
453
+ }
454
+ static destroy(node) {
455
+ node.free();
456
+ }
457
+ free() {
458
+ if (this._freed)
459
+ return;
460
+ this.unsetMeasureFunc();
461
+ this.unsetBaselineFunc();
462
+ this.unsetDirtiedFunc();
463
+ yg.ygNodeFree(this.ptr);
464
+ this._freed = true;
465
+ }
466
+ freeRecursive() {
467
+ if (this._freed)
468
+ return;
469
+ this.cleanupCallbacks();
470
+ yg.ygNodeFreeRecursive(this.ptr);
471
+ this._freed = true;
472
+ }
473
+ reset() {
474
+ if (this._freed)
475
+ return;
476
+ this.cleanupCallbacks();
477
+ yg.ygNodeReset(this.ptr);
478
+ }
479
+ cleanupCallbacks() {
480
+ if (this.measureCallback) {
481
+ this.measureCallback.close();
482
+ this.measureCallback = null;
742
483
  }
743
- setFlexShrink(flexShrink) {
744
- this.assertNotFreed();
745
- yg.ygNodeStyleSetFlexShrink(this.ptr, flexShrink);
484
+ if (this.baselineCallback) {
485
+ this.baselineCallback.close();
486
+ this.baselineCallback = null;
746
487
  }
747
- getFlexShrink() {
748
- this.assertNotFreed();
749
- return yg.ygNodeStyleGetFlexShrink(this.ptr);
488
+ if (this.dirtiedCallback) {
489
+ this.dirtiedCallback.close();
490
+ this.dirtiedCallback = null;
750
491
  }
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);
760
- }
492
+ }
493
+ clone() {
494
+ if (this._freed)
495
+ throw new Error("Cannot clone freed node");
496
+ const ptr = yg.ygNodeClone(this.ptr);
497
+ if (!ptr)
498
+ throw new Error("Failed to clone node");
499
+ return new Node(ptr);
500
+ }
501
+ copyStyle(node) {
502
+ if (this._freed)
503
+ return;
504
+ yg.ygNodeCopyStyle(this.ptr, node.ptr);
505
+ }
506
+ setIsReferenceBaseline(isReferenceBaseline) {
507
+ if (this._freed)
508
+ return;
509
+ yg.ygNodeSetIsReferenceBaseline(this.ptr, isReferenceBaseline);
510
+ }
511
+ isReferenceBaseline() {
512
+ if (this._freed)
513
+ return false;
514
+ return yg.ygNodeIsReferenceBaseline(this.ptr);
515
+ }
516
+ setAlwaysFormsContainingBlock(alwaysFormsContainingBlock) {
517
+ if (this._freed)
518
+ return;
519
+ yg.ygNodeSetAlwaysFormsContainingBlock(this.ptr, alwaysFormsContainingBlock);
520
+ }
521
+ insertChild(child, index) {
522
+ if (this._freed)
523
+ return;
524
+ yg.ygNodeInsertChild(this.ptr, child.ptr, index);
525
+ }
526
+ removeChild(child) {
527
+ if (this._freed)
528
+ return;
529
+ yg.ygNodeRemoveChild(this.ptr, child.ptr);
530
+ }
531
+ removeAllChildren() {
532
+ if (this._freed)
533
+ return;
534
+ yg.ygNodeRemoveAllChildren(this.ptr);
535
+ }
536
+ getChild(index) {
537
+ if (this._freed)
538
+ return null;
539
+ const ptr = yg.ygNodeGetChild(this.ptr, index);
540
+ return ptr ? new Node(ptr) : null;
541
+ }
542
+ getChildCount() {
543
+ if (this._freed)
544
+ return 0;
545
+ return Number(yg.ygNodeGetChildCount(this.ptr));
546
+ }
547
+ getParent() {
548
+ if (this._freed)
549
+ return null;
550
+ const ptr = yg.ygNodeGetParent(this.ptr);
551
+ return ptr ? new Node(ptr) : null;
552
+ }
553
+ calculateLayout(width, height, direction = Direction.LTR) {
554
+ if (this._freed)
555
+ return;
556
+ const w = width === "auto" || width === undefined ? NaN : width;
557
+ const h = height === "auto" || height === undefined ? NaN : height;
558
+ yg.ygNodeCalculateLayout(this.ptr, w, h, direction);
559
+ }
560
+ hasNewLayout() {
561
+ if (this._freed)
562
+ return false;
563
+ return yg.ygNodeGetHasNewLayout(this.ptr);
564
+ }
565
+ markLayoutSeen() {
566
+ if (this._freed)
567
+ return;
568
+ yg.ygNodeSetHasNewLayout(this.ptr, false);
569
+ }
570
+ markDirty() {
571
+ if (this._freed)
572
+ return;
573
+ yg.ygNodeMarkDirty(this.ptr);
574
+ }
575
+ isDirty() {
576
+ if (this._freed)
577
+ return true;
578
+ return yg.ygNodeIsDirty(this.ptr);
579
+ }
580
+ getComputedLayout() {
581
+ if (this._freed)
582
+ return { left: 0, top: 0, right: 0, bottom: 0, width: 0, height: 0 };
583
+ return {
584
+ left: yg.ygNodeLayoutGetLeft(this.ptr),
585
+ top: yg.ygNodeLayoutGetTop(this.ptr),
586
+ right: yg.ygNodeLayoutGetRight(this.ptr),
587
+ bottom: yg.ygNodeLayoutGetBottom(this.ptr),
588
+ width: yg.ygNodeLayoutGetWidth(this.ptr),
589
+ height: yg.ygNodeLayoutGetHeight(this.ptr)
590
+ };
591
+ }
592
+ getComputedLeft() {
593
+ if (this._freed)
594
+ return 0;
595
+ return yg.ygNodeLayoutGetLeft(this.ptr);
596
+ }
597
+ getComputedTop() {
598
+ if (this._freed)
599
+ return 0;
600
+ return yg.ygNodeLayoutGetTop(this.ptr);
601
+ }
602
+ getComputedRight() {
603
+ if (this._freed)
604
+ return 0;
605
+ return yg.ygNodeLayoutGetRight(this.ptr);
606
+ }
607
+ getComputedBottom() {
608
+ if (this._freed)
609
+ return 0;
610
+ return yg.ygNodeLayoutGetBottom(this.ptr);
611
+ }
612
+ getComputedWidth() {
613
+ if (this._freed)
614
+ return 0;
615
+ return yg.ygNodeLayoutGetWidth(this.ptr);
616
+ }
617
+ getComputedHeight() {
618
+ if (this._freed)
619
+ return 0;
620
+ return yg.ygNodeLayoutGetHeight(this.ptr);
621
+ }
622
+ getComputedBorder(edge) {
623
+ if (this._freed)
624
+ return 0;
625
+ return yg.ygNodeLayoutGetBorder(this.ptr, edge);
626
+ }
627
+ getComputedMargin(edge) {
628
+ if (this._freed)
629
+ return 0;
630
+ return yg.ygNodeLayoutGetMargin(this.ptr, edge);
631
+ }
632
+ getComputedPadding(edge) {
633
+ if (this._freed)
634
+ return 0;
635
+ return yg.ygNodeLayoutGetPadding(this.ptr, edge);
636
+ }
637
+ setDirection(direction) {
638
+ if (this._freed)
639
+ return;
640
+ yg.ygNodeStyleSetDirection(this.ptr, direction);
641
+ }
642
+ getDirection() {
643
+ if (this._freed)
644
+ return Direction.Inherit;
645
+ return yg.ygNodeStyleGetDirection(this.ptr);
646
+ }
647
+ setFlexDirection(flexDirection) {
648
+ if (this._freed)
649
+ return;
650
+ yg.ygNodeStyleSetFlexDirection(this.ptr, flexDirection);
651
+ }
652
+ getFlexDirection() {
653
+ if (this._freed)
654
+ return FlexDirection.Column;
655
+ return yg.ygNodeStyleGetFlexDirection(this.ptr);
656
+ }
657
+ setJustifyContent(justifyContent) {
658
+ if (this._freed)
659
+ return;
660
+ yg.ygNodeStyleSetJustifyContent(this.ptr, justifyContent);
661
+ }
662
+ getJustifyContent() {
663
+ if (this._freed)
664
+ return Justify.FlexStart;
665
+ return yg.ygNodeStyleGetJustifyContent(this.ptr);
666
+ }
667
+ setAlignContent(alignContent) {
668
+ if (this._freed)
669
+ return;
670
+ yg.ygNodeStyleSetAlignContent(this.ptr, alignContent);
671
+ }
672
+ getAlignContent() {
673
+ if (this._freed)
674
+ return Align.Auto;
675
+ return yg.ygNodeStyleGetAlignContent(this.ptr);
676
+ }
677
+ setAlignItems(alignItems) {
678
+ if (this._freed)
679
+ return;
680
+ yg.ygNodeStyleSetAlignItems(this.ptr, alignItems);
681
+ }
682
+ getAlignItems() {
683
+ if (this._freed)
684
+ return Align.Auto;
685
+ return yg.ygNodeStyleGetAlignItems(this.ptr);
686
+ }
687
+ setAlignSelf(alignSelf) {
688
+ if (this._freed)
689
+ return;
690
+ yg.ygNodeStyleSetAlignSelf(this.ptr, alignSelf);
691
+ }
692
+ getAlignSelf() {
693
+ if (this._freed)
694
+ return Align.Auto;
695
+ return yg.ygNodeStyleGetAlignSelf(this.ptr);
696
+ }
697
+ setPositionType(positionType) {
698
+ if (this._freed)
699
+ return;
700
+ yg.ygNodeStyleSetPositionType(this.ptr, positionType);
701
+ }
702
+ getPositionType() {
703
+ if (this._freed)
704
+ return PositionType.Static;
705
+ return yg.ygNodeStyleGetPositionType(this.ptr);
706
+ }
707
+ setFlexWrap(flexWrap) {
708
+ if (this._freed)
709
+ return;
710
+ yg.ygNodeStyleSetFlexWrap(this.ptr, flexWrap);
711
+ }
712
+ getFlexWrap() {
713
+ if (this._freed)
714
+ return Wrap.NoWrap;
715
+ return yg.ygNodeStyleGetFlexWrap(this.ptr);
716
+ }
717
+ setOverflow(overflow) {
718
+ if (this._freed)
719
+ return;
720
+ yg.ygNodeStyleSetOverflow(this.ptr, overflow);
721
+ }
722
+ getOverflow() {
723
+ if (this._freed)
724
+ return Overflow.Visible;
725
+ return yg.ygNodeStyleGetOverflow(this.ptr);
726
+ }
727
+ setDisplay(display) {
728
+ if (this._freed)
729
+ return;
730
+ yg.ygNodeStyleSetDisplay(this.ptr, display);
731
+ }
732
+ getDisplay() {
733
+ if (this._freed)
734
+ return Display.Flex;
735
+ return yg.ygNodeStyleGetDisplay(this.ptr);
736
+ }
737
+ setBoxSizing(boxSizing) {
738
+ if (this._freed)
739
+ return;
740
+ yg.ygNodeStyleSetBoxSizing(this.ptr, boxSizing);
741
+ }
742
+ getBoxSizing() {
743
+ if (this._freed)
744
+ return BoxSizing.BorderBox;
745
+ return yg.ygNodeStyleGetBoxSizing(this.ptr);
746
+ }
747
+ setFlex(flex) {
748
+ if (this._freed)
749
+ return;
750
+ yg.ygNodeStyleSetFlex(this.ptr, flex);
751
+ }
752
+ getFlex() {
753
+ if (this._freed)
754
+ return NaN;
755
+ return yg.ygNodeStyleGetFlex(this.ptr);
756
+ }
757
+ setFlexGrow(flexGrow) {
758
+ if (this._freed)
759
+ return;
760
+ yg.ygNodeStyleSetFlexGrow(this.ptr, flexGrow);
761
+ }
762
+ getFlexGrow() {
763
+ if (this._freed)
764
+ return NaN;
765
+ return yg.ygNodeStyleGetFlexGrow(this.ptr);
766
+ }
767
+ setFlexShrink(flexShrink) {
768
+ if (this._freed)
769
+ return;
770
+ yg.ygNodeStyleSetFlexShrink(this.ptr, flexShrink);
771
+ }
772
+ getFlexShrink() {
773
+ if (this._freed)
774
+ return NaN;
775
+ return yg.ygNodeStyleGetFlexShrink(this.ptr);
776
+ }
777
+ setFlexBasis(flexBasis) {
778
+ if (this._freed)
779
+ return;
780
+ const { unit, asNumber } = parseValue(flexBasis);
781
+ if (unit === Unit.Auto) {
782
+ yg.ygNodeStyleSetFlexBasisAuto(this.ptr);
783
+ } else if (unit === Unit.Percent) {
784
+ yg.ygNodeStyleSetFlexBasisPercent(this.ptr, asNumber);
785
+ } else if (unit === Unit.Point && asNumber !== undefined) {
786
+ yg.ygNodeStyleSetFlexBasis(this.ptr, asNumber);
761
787
  }
762
- setFlexBasisPercent(flexBasis) {
763
- this.assertNotFreed();
764
- if (flexBasis !== undefined) {
765
- yg.ygNodeStyleSetFlexBasisPercent(this.ptr, flexBasis);
766
- }
788
+ }
789
+ setFlexBasisPercent(flexBasis) {
790
+ if (this._freed)
791
+ return;
792
+ if (flexBasis !== undefined) {
793
+ yg.ygNodeStyleSetFlexBasisPercent(this.ptr, flexBasis);
767
794
  }
768
- setFlexBasisAuto() {
769
- this.assertNotFreed();
770
- yg.ygNodeStyleSetFlexBasisAuto(this.ptr);
795
+ }
796
+ setFlexBasisAuto() {
797
+ if (this._freed)
798
+ return;
799
+ yg.ygNodeStyleSetFlexBasisAuto(this.ptr);
800
+ }
801
+ setPosition(edge, position) {
802
+ if (this._freed)
803
+ return;
804
+ const { unit, asNumber } = parseValue(position);
805
+ if (unit === Unit.Percent) {
806
+ yg.ygNodeStyleSetPositionPercent(this.ptr, edge, asNumber);
807
+ } else if (unit === Unit.Point && asNumber !== undefined) {
808
+ yg.ygNodeStyleSetPosition(this.ptr, edge, asNumber);
771
809
  }
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);
779
- }
810
+ }
811
+ setPositionPercent(edge, position) {
812
+ if (this._freed)
813
+ return;
814
+ if (position !== undefined) {
815
+ yg.ygNodeStyleSetPositionPercent(this.ptr, edge, position);
780
816
  }
781
- setPositionPercent(edge, position) {
782
- this.assertNotFreed();
783
- if (position !== undefined) {
784
- yg.ygNodeStyleSetPositionPercent(this.ptr, edge, position);
785
- }
817
+ }
818
+ setPositionAuto(edge) {
819
+ if (this._freed)
820
+ return;
821
+ yg.ygNodeStyleSetPositionAuto(this.ptr, edge);
822
+ }
823
+ setMargin(edge, margin) {
824
+ if (this._freed)
825
+ return;
826
+ const { unit, asNumber } = parseValue(margin);
827
+ if (unit === Unit.Auto) {
828
+ yg.ygNodeStyleSetMarginAuto(this.ptr, edge);
829
+ } else if (unit === Unit.Percent) {
830
+ yg.ygNodeStyleSetMarginPercent(this.ptr, edge, asNumber);
831
+ } else if (unit === Unit.Point && asNumber !== undefined) {
832
+ yg.ygNodeStyleSetMargin(this.ptr, edge, asNumber);
786
833
  }
787
- setPositionAuto(edge) {
788
- this.assertNotFreed();
789
- yg.ygNodeStyleSetPositionAuto(this.ptr, edge);
834
+ }
835
+ setMarginPercent(edge, margin) {
836
+ if (this._freed)
837
+ return;
838
+ if (margin !== undefined) {
839
+ yg.ygNodeStyleSetMarginPercent(this.ptr, edge, margin);
790
840
  }
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);
800
- }
841
+ }
842
+ setMarginAuto(edge) {
843
+ if (this._freed)
844
+ return;
845
+ yg.ygNodeStyleSetMarginAuto(this.ptr, edge);
846
+ }
847
+ setPadding(edge, padding) {
848
+ if (this._freed)
849
+ return;
850
+ const { unit, asNumber } = parseValue(padding);
851
+ if (unit === Unit.Percent) {
852
+ yg.ygNodeStyleSetPaddingPercent(this.ptr, edge, asNumber);
853
+ } else if (unit === Unit.Point && asNumber !== undefined) {
854
+ yg.ygNodeStyleSetPadding(this.ptr, edge, asNumber);
801
855
  }
802
- setMarginPercent(edge, margin) {
803
- this.assertNotFreed();
804
- if (margin !== undefined) {
805
- yg.ygNodeStyleSetMarginPercent(this.ptr, edge, margin);
806
- }
856
+ }
857
+ setPaddingPercent(edge, padding) {
858
+ if (this._freed)
859
+ return;
860
+ if (padding !== undefined) {
861
+ yg.ygNodeStyleSetPaddingPercent(this.ptr, edge, padding);
807
862
  }
808
- setMarginAuto(edge) {
809
- this.assertNotFreed();
810
- yg.ygNodeStyleSetMarginAuto(this.ptr, edge);
863
+ }
864
+ setBorder(edge, border) {
865
+ if (this._freed)
866
+ return;
867
+ if (border !== undefined) {
868
+ yg.ygNodeStyleSetBorder(this.ptr, edge, border);
811
869
  }
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
- }
870
+ }
871
+ getBorder(edge) {
872
+ if (this._freed)
873
+ return NaN;
874
+ return yg.ygNodeStyleGetBorder(this.ptr, edge);
875
+ }
876
+ setGap(gutter, gap) {
877
+ if (this._freed)
878
+ return;
879
+ const { unit, asNumber } = parseValue(gap);
880
+ if (unit === Unit.Percent) {
881
+ yg.ygNodeStyleSetGapPercent(this.ptr, gutter, asNumber);
882
+ } else if (unit === Unit.Point && asNumber !== undefined) {
883
+ yg.ygNodeStyleSetGap(this.ptr, gutter, asNumber);
820
884
  }
821
- setPaddingPercent(edge, padding) {
822
- this.assertNotFreed();
823
- if (padding !== undefined) {
824
- yg.ygNodeStyleSetPaddingPercent(this.ptr, edge, padding);
825
- }
885
+ }
886
+ setGapPercent(gutter, gap) {
887
+ if (this._freed)
888
+ return;
889
+ if (gap !== undefined) {
890
+ yg.ygNodeStyleSetGapPercent(this.ptr, gutter, gap);
826
891
  }
827
- setBorder(edge, border) {
828
- this.assertNotFreed();
829
- if (border !== undefined) {
830
- yg.ygNodeStyleSetBorder(this.ptr, edge, border);
831
- }
892
+ }
893
+ setWidth(width) {
894
+ if (this._freed)
895
+ return;
896
+ const { unit, asNumber } = parseValue(width);
897
+ if (unit === Unit.Auto) {
898
+ yg.ygNodeStyleSetWidthAuto(this.ptr);
899
+ } else if (unit === Unit.Percent) {
900
+ yg.ygNodeStyleSetWidthPercent(this.ptr, asNumber);
901
+ } else if (unit === Unit.Point && asNumber !== undefined) {
902
+ yg.ygNodeStyleSetWidth(this.ptr, asNumber);
832
903
  }
833
- getBorder(edge) {
834
- this.assertNotFreed();
835
- return yg.ygNodeStyleGetBorder(this.ptr, edge);
904
+ }
905
+ setWidthPercent(width) {
906
+ if (this._freed)
907
+ return;
908
+ if (width !== undefined) {
909
+ yg.ygNodeStyleSetWidthPercent(this.ptr, width);
836
910
  }
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
- }
911
+ }
912
+ setWidthAuto() {
913
+ if (this._freed)
914
+ return;
915
+ yg.ygNodeStyleSetWidthAuto(this.ptr);
916
+ }
917
+ setHeight(height) {
918
+ if (this._freed)
919
+ return;
920
+ const { unit, asNumber } = parseValue(height);
921
+ if (unit === Unit.Auto) {
922
+ yg.ygNodeStyleSetHeightAuto(this.ptr);
923
+ } else if (unit === Unit.Percent) {
924
+ yg.ygNodeStyleSetHeightPercent(this.ptr, asNumber);
925
+ } else if (unit === Unit.Point && asNumber !== undefined) {
926
+ yg.ygNodeStyleSetHeight(this.ptr, asNumber);
845
927
  }
846
- setGapPercent(gutter, gap) {
847
- this.assertNotFreed();
848
- if (gap !== undefined) {
849
- yg.ygNodeStyleSetGapPercent(this.ptr, gutter, gap);
850
- }
928
+ }
929
+ setHeightPercent(height) {
930
+ if (this._freed)
931
+ return;
932
+ if (height !== undefined) {
933
+ yg.ygNodeStyleSetHeightPercent(this.ptr, height);
851
934
  }
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
- }
935
+ }
936
+ setHeightAuto() {
937
+ if (this._freed)
938
+ return;
939
+ yg.ygNodeStyleSetHeightAuto(this.ptr);
940
+ }
941
+ setMinWidth(minWidth) {
942
+ if (this._freed)
943
+ return;
944
+ const { unit, asNumber } = parseValue(minWidth);
945
+ if (unit === Unit.Percent) {
946
+ yg.ygNodeStyleSetMinWidthPercent(this.ptr, asNumber);
947
+ } else if (unit === Unit.Point && asNumber !== undefined) {
948
+ yg.ygNodeStyleSetMinWidth(this.ptr, asNumber);
862
949
  }
863
- setWidthPercent(width) {
864
- this.assertNotFreed();
865
- if (width !== undefined) {
866
- yg.ygNodeStyleSetWidthPercent(this.ptr, width);
867
- }
950
+ }
951
+ setMinWidthPercent(minWidth) {
952
+ if (this._freed)
953
+ return;
954
+ if (minWidth !== undefined) {
955
+ yg.ygNodeStyleSetMinWidthPercent(this.ptr, minWidth);
868
956
  }
869
- setWidthAuto() {
870
- this.assertNotFreed();
871
- yg.ygNodeStyleSetWidthAuto(this.ptr);
957
+ }
958
+ setMinHeight(minHeight) {
959
+ if (this._freed)
960
+ return;
961
+ const { unit, asNumber } = parseValue(minHeight);
962
+ if (unit === Unit.Percent) {
963
+ yg.ygNodeStyleSetMinHeightPercent(this.ptr, asNumber);
964
+ } else if (unit === Unit.Point && asNumber !== undefined) {
965
+ yg.ygNodeStyleSetMinHeight(this.ptr, asNumber);
872
966
  }
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
- }
967
+ }
968
+ setMinHeightPercent(minHeight) {
969
+ if (this._freed)
970
+ return;
971
+ if (minHeight !== undefined) {
972
+ yg.ygNodeStyleSetMinHeightPercent(this.ptr, minHeight);
883
973
  }
884
- setHeightPercent(height) {
885
- this.assertNotFreed();
886
- if (height !== undefined) {
887
- yg.ygNodeStyleSetHeightPercent(this.ptr, height);
888
- }
974
+ }
975
+ setMaxWidth(maxWidth) {
976
+ if (this._freed)
977
+ return;
978
+ const { unit, asNumber } = parseValue(maxWidth);
979
+ if (unit === Unit.Percent) {
980
+ yg.ygNodeStyleSetMaxWidthPercent(this.ptr, asNumber);
981
+ } else if (unit === Unit.Point && asNumber !== undefined) {
982
+ yg.ygNodeStyleSetMaxWidth(this.ptr, asNumber);
889
983
  }
890
- setHeightAuto() {
891
- this.assertNotFreed();
892
- yg.ygNodeStyleSetHeightAuto(this.ptr);
984
+ }
985
+ setMaxWidthPercent(maxWidth) {
986
+ if (this._freed)
987
+ return;
988
+ if (maxWidth !== undefined) {
989
+ yg.ygNodeStyleSetMaxWidthPercent(this.ptr, maxWidth);
893
990
  }
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
- }
991
+ }
992
+ setMaxHeight(maxHeight) {
993
+ if (this._freed)
994
+ return;
995
+ const { unit, asNumber } = parseValue(maxHeight);
996
+ if (unit === Unit.Percent) {
997
+ yg.ygNodeStyleSetMaxHeightPercent(this.ptr, asNumber);
998
+ } else if (unit === Unit.Point && asNumber !== undefined) {
999
+ yg.ygNodeStyleSetMaxHeight(this.ptr, asNumber);
902
1000
  }
903
- setMinWidthPercent(minWidth) {
904
- this.assertNotFreed();
905
- if (minWidth !== undefined) {
906
- yg.ygNodeStyleSetMinWidthPercent(this.ptr, minWidth);
907
- }
1001
+ }
1002
+ setMaxHeightPercent(maxHeight) {
1003
+ if (this._freed)
1004
+ return;
1005
+ if (maxHeight !== undefined) {
1006
+ yg.ygNodeStyleSetMaxHeightPercent(this.ptr, maxHeight);
908
1007
  }
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);
1008
+ }
1009
+ setAspectRatio(aspectRatio) {
1010
+ if (this._freed)
1011
+ return;
1012
+ if (aspectRatio !== undefined) {
1013
+ yg.ygNodeStyleSetAspectRatio(this.ptr, aspectRatio);
1014
+ }
1015
+ }
1016
+ getAspectRatio() {
1017
+ if (this._freed)
1018
+ return NaN;
1019
+ return yg.ygNodeStyleGetAspectRatio(this.ptr);
1020
+ }
1021
+ getWidth() {
1022
+ if (this._freed)
1023
+ return UNDEFINED_VALUE;
1024
+ return unpackValue(yg.ygNodeStyleGetWidthPacked(this.ptr));
1025
+ }
1026
+ getHeight() {
1027
+ if (this._freed)
1028
+ return UNDEFINED_VALUE;
1029
+ return unpackValue(yg.ygNodeStyleGetHeightPacked(this.ptr));
1030
+ }
1031
+ getMinWidth() {
1032
+ if (this._freed)
1033
+ return UNDEFINED_VALUE;
1034
+ return unpackValue(yg.ygNodeStyleGetMinWidthPacked(this.ptr));
1035
+ }
1036
+ getMinHeight() {
1037
+ if (this._freed)
1038
+ return UNDEFINED_VALUE;
1039
+ return unpackValue(yg.ygNodeStyleGetMinHeightPacked(this.ptr));
1040
+ }
1041
+ getMaxWidth() {
1042
+ if (this._freed)
1043
+ return UNDEFINED_VALUE;
1044
+ return unpackValue(yg.ygNodeStyleGetMaxWidthPacked(this.ptr));
1045
+ }
1046
+ getMaxHeight() {
1047
+ if (this._freed)
1048
+ return UNDEFINED_VALUE;
1049
+ return unpackValue(yg.ygNodeStyleGetMaxHeightPacked(this.ptr));
1050
+ }
1051
+ getMargin(edge) {
1052
+ if (this._freed)
1053
+ return UNDEFINED_VALUE;
1054
+ return unpackValue(yg.ygNodeStyleGetMarginPacked(this.ptr, edge));
1055
+ }
1056
+ getPadding(edge) {
1057
+ if (this._freed)
1058
+ return UNDEFINED_VALUE;
1059
+ return unpackValue(yg.ygNodeStyleGetPaddingPacked(this.ptr, edge));
1060
+ }
1061
+ getPosition(edge) {
1062
+ if (this._freed)
1063
+ return UNDEFINED_VALUE;
1064
+ return unpackValue(yg.ygNodeStyleGetPositionPacked(this.ptr, edge));
1065
+ }
1066
+ getGap(gutter) {
1067
+ if (this._freed)
1068
+ return UNDEFINED_VALUE;
1069
+ return unpackValue(yg.ygNodeStyleGetGapPacked(this.ptr, gutter));
1070
+ }
1071
+ getFlexBasis() {
1072
+ if (this._freed)
1073
+ return UNDEFINED_VALUE;
1074
+ return unpackValue(yg.ygNodeStyleGetFlexBasisPacked(this.ptr));
1075
+ }
1076
+ setMeasureFunc(measureFunc) {
1077
+ if (this._freed)
1078
+ return;
1079
+ this.unsetMeasureFunc();
1080
+ if (measureFunc) {
1081
+ this.measureCallback = new JSCallback((nodePtr, width, widthMode, height, heightMode) => {
1082
+ const result = measureFunc(width, widthMode, height, heightMode);
1083
+ yg.ygStoreMeasureResult(result.width, result.height);
1084
+ }, {
1085
+ args: [
1086
+ FFIType.ptr,
1087
+ FFIType.f32,
1088
+ FFIType.u32,
1089
+ FFIType.f32,
1090
+ FFIType.u32
1091
+ ],
1092
+ returns: FFIType.void
1093
+ });
1094
+ if (this.measureCallback.ptr) {
1095
+ yg.ygNodeSetMeasureFuncTrampoline(this.ptr, this.measureCallback.ptr);
916
1096
  }
917
1097
  }
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
- }
1098
+ }
1099
+ unsetMeasureFunc() {
1100
+ if (this._freed)
1101
+ return;
1102
+ if (this.measureCallback) {
1103
+ this.measureCallback.close();
1104
+ this.measureCallback = null;
1029
1105
  }
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
- }
1106
+ yg.ygNodeUnsetMeasureFuncTrampoline(this.ptr);
1107
+ }
1108
+ hasMeasureFunc() {
1109
+ if (this._freed)
1110
+ return false;
1111
+ return yg.ygNodeHasMeasureFunc(this.ptr);
1112
+ }
1113
+ setBaselineFunc(baselineFunc) {
1114
+ if (this._freed)
1115
+ return;
1116
+ this.unsetBaselineFunc();
1117
+ if (baselineFunc) {
1118
+ this.baselineCallback = new JSCallback((nodePtr, width, height) => {
1119
+ const result = baselineFunc(width, height);
1120
+ yg.ygStoreBaselineResult(result);
1121
+ }, {
1122
+ args: [FFIType.ptr, FFIType.f32, FFIType.f32],
1123
+ returns: FFIType.void
1124
+ });
1125
+ if (this.baselineCallback.ptr) {
1126
+ yg.ygNodeSetBaselineFuncTrampoline(this.ptr, this.baselineCallback.ptr);
1057
1127
  }
1058
1128
  }
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
- }
1129
+ }
1130
+ unsetBaselineFunc() {
1131
+ if (this._freed)
1132
+ return;
1133
+ if (this.baselineCallback) {
1134
+ this.baselineCallback.close();
1135
+ this.baselineCallback = null;
1087
1136
  }
1088
- unsetDirtiedFunc() {
1089
- if (this._freed)
1090
- return;
1091
- if (this.dirtiedCallback) {
1092
- this.dirtiedCallback.close();
1093
- this.dirtiedCallback = null;
1137
+ yg.ygNodeUnsetBaselineFuncTrampoline(this.ptr);
1138
+ }
1139
+ hasBaselineFunc() {
1140
+ if (this._freed)
1141
+ return false;
1142
+ return yg.ygNodeHasBaselineFunc(this.ptr);
1143
+ }
1144
+ setDirtiedFunc(dirtiedFunc) {
1145
+ if (this._freed)
1146
+ return;
1147
+ this.unsetDirtiedFunc();
1148
+ if (dirtiedFunc) {
1149
+ const node = this;
1150
+ this.dirtiedCallback = new JSCallback((nodePtr) => {
1151
+ dirtiedFunc(node);
1152
+ }, {
1153
+ args: [FFIType.ptr],
1154
+ returns: FFIType.void
1155
+ });
1156
+ if (this.dirtiedCallback.ptr) {
1157
+ yg.ygNodeSetDirtiedFunc(this.ptr, this.dirtiedCallback.ptr);
1094
1158
  }
1095
- yg.ygNodeUnsetDirtiedFunc(this.ptr);
1096
1159
  }
1097
- hasDirtiedFunc() {
1098
- this.assertNotFreed();
1099
- return yg.ygNodeGetDirtiedFunc(this.ptr) !== null;
1160
+ }
1161
+ unsetDirtiedFunc() {
1162
+ if (this._freed)
1163
+ return;
1164
+ if (this.dirtiedCallback) {
1165
+ this.dirtiedCallback.close();
1166
+ this.dirtiedCallback = null;
1100
1167
  }
1168
+ yg.ygNodeUnsetDirtiedFunc(this.ptr);
1169
+ }
1170
+ hasDirtiedFunc() {
1171
+ if (this._freed)
1172
+ return false;
1173
+ return yg.ygNodeGetDirtiedFunc(this.ptr) !== null;
1101
1174
  }
1102
- exports.Node = Node;
1175
+ }
1103
1176
 
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
- });
1177
+ class Config {
1178
+ ptr;
1179
+ constructor(ptr) {
1180
+ this.ptr = ptr;
1181
+ }
1182
+ static create() {
1183
+ const ptr = yg.ygConfigNew();
1184
+ if (!ptr)
1185
+ throw new Error("Failed to create config");
1186
+ return new Config(ptr);
1187
+ }
1188
+ static destroy(config) {
1189
+ config.free();
1190
+ }
1191
+ free() {
1192
+ yg.ygConfigFree(this.ptr);
1193
+ }
1194
+ setUseWebDefaults(useWebDefaults) {
1195
+ yg.ygConfigSetUseWebDefaults(this.ptr, useWebDefaults);
1196
+ }
1197
+ useWebDefaults() {
1198
+ return yg.ygConfigGetUseWebDefaults(this.ptr);
1199
+ }
1200
+ setPointScaleFactor(pointScaleFactor) {
1201
+ yg.ygConfigSetPointScaleFactor(this.ptr, pointScaleFactor);
1202
+ }
1203
+ getPointScaleFactor() {
1204
+ return yg.ygConfigGetPointScaleFactor(this.ptr);
1205
+ }
1206
+ setErrata(errata) {
1207
+ yg.ygConfigSetErrata(this.ptr, errata);
1208
+ }
1209
+ getErrata() {
1210
+ return yg.ygConfigGetErrata(this.ptr);
1211
+ }
1212
+ setExperimentalFeatureEnabled(feature, enabled) {
1213
+ yg.ygConfigSetExperimentalFeatureEnabled(this.ptr, feature, enabled);
1214
+ }
1215
+ isExperimentalFeatureEnabled(feature) {
1216
+ return yg.ygConfigIsExperimentalFeatureEnabled(this.ptr, feature);
1217
+ }
1218
+ }
1219
+ var dist_default = {
1220
+ Node,
1221
+ Config,
1222
+ Align,
1223
+ BoxSizing,
1224
+ Dimension,
1225
+ Direction,
1226
+ Display,
1227
+ Edge,
1228
+ Errata,
1229
+ ExperimentalFeature,
1230
+ FlexDirection,
1231
+ Gutter,
1232
+ Justify,
1233
+ LogLevel,
1234
+ MeasureMode,
1235
+ NodeType,
1236
+ Overflow,
1237
+ PositionType,
1238
+ Unit,
1239
+ Wrap,
1240
+ EDGE_LEFT,
1241
+ EDGE_TOP,
1242
+ EDGE_RIGHT,
1243
+ EDGE_BOTTOM,
1244
+ EDGE_START,
1245
+ EDGE_END,
1246
+ EDGE_HORIZONTAL,
1247
+ EDGE_VERTICAL,
1248
+ EDGE_ALL,
1249
+ FLEX_DIRECTION_COLUMN,
1250
+ FLEX_DIRECTION_COLUMN_REVERSE,
1251
+ FLEX_DIRECTION_ROW,
1252
+ FLEX_DIRECTION_ROW_REVERSE,
1253
+ JUSTIFY_FLEX_START,
1254
+ JUSTIFY_CENTER,
1255
+ JUSTIFY_FLEX_END,
1256
+ JUSTIFY_SPACE_BETWEEN,
1257
+ JUSTIFY_SPACE_AROUND,
1258
+ JUSTIFY_SPACE_EVENLY,
1259
+ ALIGN_AUTO,
1260
+ ALIGN_FLEX_START,
1261
+ ALIGN_CENTER,
1262
+ ALIGN_FLEX_END,
1263
+ ALIGN_STRETCH,
1264
+ ALIGN_BASELINE,
1265
+ ALIGN_SPACE_BETWEEN,
1266
+ ALIGN_SPACE_AROUND,
1267
+ ALIGN_SPACE_EVENLY,
1268
+ WRAP_NO_WRAP,
1269
+ WRAP_WRAP,
1270
+ WRAP_WRAP_REVERSE,
1271
+ OVERFLOW_VISIBLE,
1272
+ OVERFLOW_HIDDEN,
1273
+ OVERFLOW_SCROLL,
1274
+ DISPLAY_FLEX,
1275
+ DISPLAY_NONE,
1276
+ POSITION_TYPE_STATIC,
1277
+ POSITION_TYPE_RELATIVE,
1278
+ POSITION_TYPE_ABSOLUTE,
1279
+ DIRECTION_INHERIT,
1280
+ DIRECTION_LTR,
1281
+ DIRECTION_RTL
1282
+ };
1212
1283
 
1213
1284
  // src/lib/border.ts
1214
1285
  var BorderChars = {
@@ -5638,266 +5709,265 @@ class StdinBuffer extends EventEmitter2 {
5638
5709
  }
5639
5710
 
5640
5711
  // src/lib/yoga.options.ts
5641
- var import_bun_yoga = __toESM(require_dist(), 1);
5642
5712
  function parseAlign(value) {
5643
5713
  if (value == null) {
5644
- return import_bun_yoga.Align.Auto;
5714
+ return Align.Auto;
5645
5715
  }
5646
5716
  switch (value.toLowerCase()) {
5647
5717
  case "auto":
5648
- return import_bun_yoga.Align.Auto;
5718
+ return Align.Auto;
5649
5719
  case "flex-start":
5650
- return import_bun_yoga.Align.FlexStart;
5720
+ return Align.FlexStart;
5651
5721
  case "center":
5652
- return import_bun_yoga.Align.Center;
5722
+ return Align.Center;
5653
5723
  case "flex-end":
5654
- return import_bun_yoga.Align.FlexEnd;
5724
+ return Align.FlexEnd;
5655
5725
  case "stretch":
5656
- return import_bun_yoga.Align.Stretch;
5726
+ return Align.Stretch;
5657
5727
  case "baseline":
5658
- return import_bun_yoga.Align.Baseline;
5728
+ return Align.Baseline;
5659
5729
  case "space-between":
5660
- return import_bun_yoga.Align.SpaceBetween;
5730
+ return Align.SpaceBetween;
5661
5731
  case "space-around":
5662
- return import_bun_yoga.Align.SpaceAround;
5732
+ return Align.SpaceAround;
5663
5733
  case "space-evenly":
5664
- return import_bun_yoga.Align.SpaceEvenly;
5734
+ return Align.SpaceEvenly;
5665
5735
  default:
5666
- return import_bun_yoga.Align.Auto;
5736
+ return Align.Auto;
5667
5737
  }
5668
5738
  }
5669
5739
  function parseBoxSizing(value) {
5670
5740
  if (value == null) {
5671
- return import_bun_yoga.BoxSizing.BorderBox;
5741
+ return BoxSizing.BorderBox;
5672
5742
  }
5673
5743
  switch (value.toLowerCase()) {
5674
5744
  case "border-box":
5675
- return import_bun_yoga.BoxSizing.BorderBox;
5745
+ return BoxSizing.BorderBox;
5676
5746
  case "content-box":
5677
- return import_bun_yoga.BoxSizing.ContentBox;
5747
+ return BoxSizing.ContentBox;
5678
5748
  default:
5679
- return import_bun_yoga.BoxSizing.BorderBox;
5749
+ return BoxSizing.BorderBox;
5680
5750
  }
5681
5751
  }
5682
5752
  function parseDimension(value) {
5683
5753
  if (value == null) {
5684
- return import_bun_yoga.Dimension.Width;
5754
+ return Dimension.Width;
5685
5755
  }
5686
5756
  switch (value.toLowerCase()) {
5687
5757
  case "width":
5688
- return import_bun_yoga.Dimension.Width;
5758
+ return Dimension.Width;
5689
5759
  case "height":
5690
- return import_bun_yoga.Dimension.Height;
5760
+ return Dimension.Height;
5691
5761
  default:
5692
- return import_bun_yoga.Dimension.Width;
5762
+ return Dimension.Width;
5693
5763
  }
5694
5764
  }
5695
5765
  function parseDirection(value) {
5696
5766
  if (value == null) {
5697
- return import_bun_yoga.Direction.LTR;
5767
+ return Direction.LTR;
5698
5768
  }
5699
5769
  switch (value.toLowerCase()) {
5700
5770
  case "inherit":
5701
- return import_bun_yoga.Direction.Inherit;
5771
+ return Direction.Inherit;
5702
5772
  case "ltr":
5703
- return import_bun_yoga.Direction.LTR;
5773
+ return Direction.LTR;
5704
5774
  case "rtl":
5705
- return import_bun_yoga.Direction.RTL;
5775
+ return Direction.RTL;
5706
5776
  default:
5707
- return import_bun_yoga.Direction.LTR;
5777
+ return Direction.LTR;
5708
5778
  }
5709
5779
  }
5710
5780
  function parseDisplay(value) {
5711
5781
  if (value == null) {
5712
- return import_bun_yoga.Display.Flex;
5782
+ return Display.Flex;
5713
5783
  }
5714
5784
  switch (value.toLowerCase()) {
5715
5785
  case "flex":
5716
- return import_bun_yoga.Display.Flex;
5786
+ return Display.Flex;
5717
5787
  case "none":
5718
- return import_bun_yoga.Display.None;
5788
+ return Display.None;
5719
5789
  case "contents":
5720
- return import_bun_yoga.Display.Contents;
5790
+ return Display.Contents;
5721
5791
  default:
5722
- return import_bun_yoga.Display.Flex;
5792
+ return Display.Flex;
5723
5793
  }
5724
5794
  }
5725
5795
  function parseEdge(value) {
5726
5796
  if (value == null) {
5727
- return import_bun_yoga.Edge.All;
5797
+ return Edge.All;
5728
5798
  }
5729
5799
  switch (value.toLowerCase()) {
5730
5800
  case "left":
5731
- return import_bun_yoga.Edge.Left;
5801
+ return Edge.Left;
5732
5802
  case "top":
5733
- return import_bun_yoga.Edge.Top;
5803
+ return Edge.Top;
5734
5804
  case "right":
5735
- return import_bun_yoga.Edge.Right;
5805
+ return Edge.Right;
5736
5806
  case "bottom":
5737
- return import_bun_yoga.Edge.Bottom;
5807
+ return Edge.Bottom;
5738
5808
  case "start":
5739
- return import_bun_yoga.Edge.Start;
5809
+ return Edge.Start;
5740
5810
  case "end":
5741
- return import_bun_yoga.Edge.End;
5811
+ return Edge.End;
5742
5812
  case "horizontal":
5743
- return import_bun_yoga.Edge.Horizontal;
5813
+ return Edge.Horizontal;
5744
5814
  case "vertical":
5745
- return import_bun_yoga.Edge.Vertical;
5815
+ return Edge.Vertical;
5746
5816
  case "all":
5747
- return import_bun_yoga.Edge.All;
5817
+ return Edge.All;
5748
5818
  default:
5749
- return import_bun_yoga.Edge.All;
5819
+ return Edge.All;
5750
5820
  }
5751
5821
  }
5752
5822
  function parseFlexDirection(value) {
5753
5823
  if (value == null) {
5754
- return import_bun_yoga.FlexDirection.Column;
5824
+ return FlexDirection.Column;
5755
5825
  }
5756
5826
  switch (value.toLowerCase()) {
5757
5827
  case "column":
5758
- return import_bun_yoga.FlexDirection.Column;
5828
+ return FlexDirection.Column;
5759
5829
  case "column-reverse":
5760
- return import_bun_yoga.FlexDirection.ColumnReverse;
5830
+ return FlexDirection.ColumnReverse;
5761
5831
  case "row":
5762
- return import_bun_yoga.FlexDirection.Row;
5832
+ return FlexDirection.Row;
5763
5833
  case "row-reverse":
5764
- return import_bun_yoga.FlexDirection.RowReverse;
5834
+ return FlexDirection.RowReverse;
5765
5835
  default:
5766
- return import_bun_yoga.FlexDirection.Column;
5836
+ return FlexDirection.Column;
5767
5837
  }
5768
5838
  }
5769
5839
  function parseGutter(value) {
5770
5840
  if (value == null) {
5771
- return import_bun_yoga.Gutter.All;
5841
+ return Gutter.All;
5772
5842
  }
5773
5843
  switch (value.toLowerCase()) {
5774
5844
  case "column":
5775
- return import_bun_yoga.Gutter.Column;
5845
+ return Gutter.Column;
5776
5846
  case "row":
5777
- return import_bun_yoga.Gutter.Row;
5847
+ return Gutter.Row;
5778
5848
  case "all":
5779
- return import_bun_yoga.Gutter.All;
5849
+ return Gutter.All;
5780
5850
  default:
5781
- return import_bun_yoga.Gutter.All;
5851
+ return Gutter.All;
5782
5852
  }
5783
5853
  }
5784
5854
  function parseJustify(value) {
5785
5855
  if (value == null) {
5786
- return import_bun_yoga.Justify.FlexStart;
5856
+ return Justify.FlexStart;
5787
5857
  }
5788
5858
  switch (value.toLowerCase()) {
5789
5859
  case "flex-start":
5790
- return import_bun_yoga.Justify.FlexStart;
5860
+ return Justify.FlexStart;
5791
5861
  case "center":
5792
- return import_bun_yoga.Justify.Center;
5862
+ return Justify.Center;
5793
5863
  case "flex-end":
5794
- return import_bun_yoga.Justify.FlexEnd;
5864
+ return Justify.FlexEnd;
5795
5865
  case "space-between":
5796
- return import_bun_yoga.Justify.SpaceBetween;
5866
+ return Justify.SpaceBetween;
5797
5867
  case "space-around":
5798
- return import_bun_yoga.Justify.SpaceAround;
5868
+ return Justify.SpaceAround;
5799
5869
  case "space-evenly":
5800
- return import_bun_yoga.Justify.SpaceEvenly;
5870
+ return Justify.SpaceEvenly;
5801
5871
  default:
5802
- return import_bun_yoga.Justify.FlexStart;
5872
+ return Justify.FlexStart;
5803
5873
  }
5804
5874
  }
5805
5875
  function parseLogLevel(value) {
5806
5876
  if (value == null) {
5807
- return import_bun_yoga.LogLevel.Info;
5877
+ return LogLevel.Info;
5808
5878
  }
5809
5879
  switch (value.toLowerCase()) {
5810
5880
  case "error":
5811
- return import_bun_yoga.LogLevel.Error;
5881
+ return LogLevel.Error;
5812
5882
  case "warn":
5813
- return import_bun_yoga.LogLevel.Warn;
5883
+ return LogLevel.Warn;
5814
5884
  case "info":
5815
- return import_bun_yoga.LogLevel.Info;
5885
+ return LogLevel.Info;
5816
5886
  case "debug":
5817
- return import_bun_yoga.LogLevel.Debug;
5887
+ return LogLevel.Debug;
5818
5888
  case "verbose":
5819
- return import_bun_yoga.LogLevel.Verbose;
5889
+ return LogLevel.Verbose;
5820
5890
  case "fatal":
5821
- return import_bun_yoga.LogLevel.Fatal;
5891
+ return LogLevel.Fatal;
5822
5892
  default:
5823
- return import_bun_yoga.LogLevel.Info;
5893
+ return LogLevel.Info;
5824
5894
  }
5825
5895
  }
5826
5896
  function parseMeasureMode(value) {
5827
5897
  if (value == null) {
5828
- return import_bun_yoga.MeasureMode.Undefined;
5898
+ return MeasureMode.Undefined;
5829
5899
  }
5830
5900
  switch (value.toLowerCase()) {
5831
5901
  case "undefined":
5832
- return import_bun_yoga.MeasureMode.Undefined;
5902
+ return MeasureMode.Undefined;
5833
5903
  case "exactly":
5834
- return import_bun_yoga.MeasureMode.Exactly;
5904
+ return MeasureMode.Exactly;
5835
5905
  case "at-most":
5836
- return import_bun_yoga.MeasureMode.AtMost;
5906
+ return MeasureMode.AtMost;
5837
5907
  default:
5838
- return import_bun_yoga.MeasureMode.Undefined;
5908
+ return MeasureMode.Undefined;
5839
5909
  }
5840
5910
  }
5841
5911
  function parseOverflow(value) {
5842
5912
  if (value == null) {
5843
- return import_bun_yoga.Overflow.Visible;
5913
+ return Overflow.Visible;
5844
5914
  }
5845
5915
  switch (value.toLowerCase()) {
5846
5916
  case "visible":
5847
- return import_bun_yoga.Overflow.Visible;
5917
+ return Overflow.Visible;
5848
5918
  case "hidden":
5849
- return import_bun_yoga.Overflow.Hidden;
5919
+ return Overflow.Hidden;
5850
5920
  case "scroll":
5851
- return import_bun_yoga.Overflow.Scroll;
5921
+ return Overflow.Scroll;
5852
5922
  default:
5853
- return import_bun_yoga.Overflow.Visible;
5923
+ return Overflow.Visible;
5854
5924
  }
5855
5925
  }
5856
5926
  function parsePositionType(value) {
5857
5927
  if (value == null) {
5858
- return import_bun_yoga.PositionType.Relative;
5928
+ return PositionType.Relative;
5859
5929
  }
5860
5930
  switch (value.toLowerCase()) {
5861
5931
  case "static":
5862
- return import_bun_yoga.PositionType.Static;
5932
+ return PositionType.Static;
5863
5933
  case "relative":
5864
- return import_bun_yoga.PositionType.Relative;
5934
+ return PositionType.Relative;
5865
5935
  case "absolute":
5866
- return import_bun_yoga.PositionType.Absolute;
5936
+ return PositionType.Absolute;
5867
5937
  default:
5868
- return import_bun_yoga.PositionType.Static;
5938
+ return PositionType.Static;
5869
5939
  }
5870
5940
  }
5871
5941
  function parseUnit(value) {
5872
5942
  if (value == null) {
5873
- return import_bun_yoga.Unit.Point;
5943
+ return Unit.Point;
5874
5944
  }
5875
5945
  switch (value.toLowerCase()) {
5876
5946
  case "undefined":
5877
- return import_bun_yoga.Unit.Undefined;
5947
+ return Unit.Undefined;
5878
5948
  case "point":
5879
- return import_bun_yoga.Unit.Point;
5949
+ return Unit.Point;
5880
5950
  case "percent":
5881
- return import_bun_yoga.Unit.Percent;
5951
+ return Unit.Percent;
5882
5952
  case "auto":
5883
- return import_bun_yoga.Unit.Auto;
5953
+ return Unit.Auto;
5884
5954
  default:
5885
- return import_bun_yoga.Unit.Point;
5955
+ return Unit.Point;
5886
5956
  }
5887
5957
  }
5888
5958
  function parseWrap(value) {
5889
5959
  if (value == null) {
5890
- return import_bun_yoga.Wrap.NoWrap;
5960
+ return Wrap.NoWrap;
5891
5961
  }
5892
5962
  switch (value.toLowerCase()) {
5893
5963
  case "no-wrap":
5894
- return import_bun_yoga.Wrap.NoWrap;
5964
+ return Wrap.NoWrap;
5895
5965
  case "wrap":
5896
- return import_bun_yoga.Wrap.Wrap;
5966
+ return Wrap.Wrap;
5897
5967
  case "wrap-reverse":
5898
- return import_bun_yoga.Wrap.WrapReverse;
5968
+ return Wrap.WrapReverse;
5899
5969
  default:
5900
- return import_bun_yoga.Wrap.NoWrap;
5970
+ return Wrap.NoWrap;
5901
5971
  }
5902
5972
  }
5903
5973
 
@@ -6748,7 +6818,7 @@ function getParsers() {
6748
6818
 
6749
6819
  // src/lib/tree-sitter/client.ts
6750
6820
  import { resolve as resolve2, isAbsolute } from "path";
6751
- import { existsSync } from "fs";
6821
+ import { existsSync as existsSync2 } from "fs";
6752
6822
  import { parse } from "path";
6753
6823
  registerEnvVar({
6754
6824
  name: "OTUI_TREE_SITTER_WORKER_PATH",
@@ -6809,7 +6879,7 @@ class TreeSitterClient extends EventEmitter3 {
6809
6879
  worker_path = this.options.workerPath;
6810
6880
  } else {
6811
6881
  worker_path = new URL("./parser.worker.js", import.meta.url).href;
6812
- if (!existsSync(resolve2(import.meta.dirname, "parser.worker.js"))) {
6882
+ if (!existsSync2(resolve2(import.meta.dirname, "parser.worker.js"))) {
6813
6883
  worker_path = new URL("./parser.worker.ts", import.meta.url).href;
6814
6884
  }
6815
6885
  }
@@ -8702,8 +8772,8 @@ function createTerminalPalette(stdin, stdout, writeFn, isLegacyTmux) {
8702
8772
  return new TerminalPalette(stdin, stdout, writeFn, isLegacyTmux);
8703
8773
  }
8704
8774
  // src/zig.ts
8705
- import { dlopen, toArrayBuffer as toArrayBuffer4, JSCallback, ptr as ptr3 } from "bun:ffi";
8706
- import { existsSync as existsSync2 } from "fs";
8775
+ import { dlopen as dlopen2, toArrayBuffer as toArrayBuffer4, JSCallback as JSCallback2, ptr as ptr3 } from "bun:ffi";
8776
+ import { existsSync as existsSync3 } from "fs";
8707
8777
  import { EventEmitter as EventEmitter5 } from "events";
8708
8778
 
8709
8779
  // src/buffer.ts
@@ -8770,9 +8840,9 @@ class OptimizedBuffer {
8770
8840
  }
8771
8841
  return this._rawBuffers;
8772
8842
  }
8773
- constructor(lib, ptr, width, height, options) {
8843
+ constructor(lib2, ptr, width, height, options) {
8774
8844
  this.id = options.id || `fb_${OptimizedBuffer.fbIdCounter++}`;
8775
- this.lib = lib;
8845
+ this.lib = lib2;
8776
8846
  this.respectAlpha = options.respectAlpha || false;
8777
8847
  this._width = width;
8778
8848
  this._height = height;
@@ -8780,10 +8850,10 @@ class OptimizedBuffer {
8780
8850
  this.bufferPtr = ptr;
8781
8851
  }
8782
8852
  static create(width, height, widthMethod, options = {}) {
8783
- const lib = resolveRenderLib();
8853
+ const lib2 = resolveRenderLib();
8784
8854
  const respectAlpha = options.respectAlpha || false;
8785
8855
  const id = options.id && options.id.trim() !== "" ? options.id : "unnamed buffer";
8786
- const buffer = lib.createOptimizedBuffer(width, height, widthMethod, respectAlpha, id);
8856
+ const buffer = lib2.createOptimizedBuffer(width, height, widthMethod, respectAlpha, id);
8787
8857
  return buffer;
8788
8858
  }
8789
8859
  get widthMethod() {
@@ -9625,7 +9695,7 @@ var targetLibPath = module.default;
9625
9695
  if (/\$bunfs/.test(targetLibPath)) {
9626
9696
  targetLibPath = targetLibPath.replace("../", "");
9627
9697
  }
9628
- if (!existsSync2(targetLibPath)) {
9698
+ if (!existsSync3(targetLibPath)) {
9629
9699
  throw new Error(`opentui is not supported on the current platform: ${process.platform}-${process.arch}`);
9630
9700
  }
9631
9701
  registerEnvVar({
@@ -9654,7 +9724,7 @@ registerEnvVar({
9654
9724
  });
9655
9725
  function getOpenTUILib(libPath) {
9656
9726
  const resolvedLibPath = libPath || targetLibPath;
9657
- const rawSymbols = dlopen(resolvedLibPath, {
9727
+ const rawSymbols = dlopen2(resolvedLibPath, {
9658
9728
  setLogCallback: {
9659
9729
  args: ["ptr"],
9660
9730
  returns: "void"
@@ -10582,7 +10652,7 @@ class FFIRenderLib {
10582
10652
  if (this.logCallbackWrapper) {
10583
10653
  return;
10584
10654
  }
10585
- const logCallback = new JSCallback((level, msgPtr, msgLenBigInt) => {
10655
+ const logCallback = new JSCallback2((level, msgPtr, msgLenBigInt) => {
10586
10656
  try {
10587
10657
  const msgLen = typeof msgLenBigInt === "bigint" ? Number(msgLenBigInt) : msgLenBigInt;
10588
10658
  if (msgLen === 0 || !msgPtr) {
@@ -10627,7 +10697,7 @@ class FFIRenderLib {
10627
10697
  if (this.eventCallbackWrapper) {
10628
10698
  return;
10629
10699
  }
10630
- const eventCallback = new JSCallback((namePtr, nameLenBigInt, dataPtr, dataLenBigInt) => {
10700
+ const eventCallback = new JSCallback2((namePtr, nameLenBigInt, dataPtr, dataLenBigInt) => {
10631
10701
  try {
10632
10702
  const nameLen = typeof nameLenBigInt === "bigint" ? Number(nameLenBigInt) : nameLenBigInt;
10633
10703
  const dataLen = typeof dataLenBigInt === "bigint" ? Number(dataLenBigInt) : dataLenBigInt;
@@ -11640,13 +11710,13 @@ class TextBuffer {
11640
11710
  _textBytes;
11641
11711
  _memId;
11642
11712
  _appendedChunks = [];
11643
- constructor(lib, ptr4) {
11644
- this.lib = lib;
11713
+ constructor(lib2, ptr4) {
11714
+ this.lib = lib2;
11645
11715
  this.bufferPtr = ptr4;
11646
11716
  }
11647
11717
  static create(widthMethod) {
11648
- const lib = resolveRenderLib();
11649
- return lib.createTextBuffer(widthMethod);
11718
+ const lib2 = resolveRenderLib();
11719
+ return lib2.createTextBuffer(widthMethod);
11650
11720
  }
11651
11721
  guard() {
11652
11722
  if (this._destroyed)
@@ -11824,7 +11894,6 @@ class TextBuffer {
11824
11894
  }
11825
11895
 
11826
11896
  // src/Renderable.ts
11827
- var import_bun_yoga2 = __toESM(require_dist(), 1);
11828
11897
  import { EventEmitter as EventEmitter6 } from "events";
11829
11898
 
11830
11899
  // src/lib/renderable.validations.ts
@@ -11955,7 +12024,7 @@ class BaseRenderable extends EventEmitter6 {
11955
12024
  this._visible = value;
11956
12025
  }
11957
12026
  }
11958
- var yogaConfig = import_bun_yoga2.default.Config.create();
12027
+ var yogaConfig = dist_default.Config.create();
11959
12028
  yogaConfig.setUseWebDefaults(false);
11960
12029
  yogaConfig.setPointScaleFactor(1);
11961
12030
 
@@ -12021,8 +12090,8 @@ class Renderable extends BaseRenderable {
12021
12090
  this.buffered = options.buffered ?? false;
12022
12091
  this._live = options.live ?? false;
12023
12092
  this._liveCount = this._live && this._visible ? 1 : 0;
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);
12093
+ this.yogaNode = dist_default.Node.create(yogaConfig);
12094
+ this.yogaNode.setDisplay(this._visible ? Display.Flex : Display.None);
12026
12095
  this.setupYogaProperties(options);
12027
12096
  this.applyEventOptions(options);
12028
12097
  if (this.buffered) {
@@ -12057,7 +12126,7 @@ class Renderable extends BaseRenderable {
12057
12126
  return;
12058
12127
  const wasVisible = this._visible;
12059
12128
  this._visible = value;
12060
- this.yogaNode.setDisplay(value ? import_bun_yoga2.Display.Flex : import_bun_yoga2.Display.None);
12129
+ this.yogaNode.setDisplay(value ? Display.Flex : Display.None);
12061
12130
  if (this._live) {
12062
12131
  if (!wasVisible && value) {
12063
12132
  this.propagateLiveCount(1);
@@ -12376,40 +12445,40 @@ class Renderable extends BaseRenderable {
12376
12445
  setupMarginAndPadding(options) {
12377
12446
  const node = this.yogaNode;
12378
12447
  if (isMarginType(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);
12448
+ node.setMargin(Edge.Top, options.margin);
12449
+ node.setMargin(Edge.Right, options.margin);
12450
+ node.setMargin(Edge.Bottom, options.margin);
12451
+ node.setMargin(Edge.Left, options.margin);
12383
12452
  }
12384
12453
  if (isMarginType(options.marginTop)) {
12385
- node.setMargin(import_bun_yoga2.Edge.Top, options.marginTop);
12454
+ node.setMargin(Edge.Top, options.marginTop);
12386
12455
  }
12387
12456
  if (isMarginType(options.marginRight)) {
12388
- node.setMargin(import_bun_yoga2.Edge.Right, options.marginRight);
12457
+ node.setMargin(Edge.Right, options.marginRight);
12389
12458
  }
12390
12459
  if (isMarginType(options.marginBottom)) {
12391
- node.setMargin(import_bun_yoga2.Edge.Bottom, options.marginBottom);
12460
+ node.setMargin(Edge.Bottom, options.marginBottom);
12392
12461
  }
12393
12462
  if (isMarginType(options.marginLeft)) {
12394
- node.setMargin(import_bun_yoga2.Edge.Left, options.marginLeft);
12463
+ node.setMargin(Edge.Left, options.marginLeft);
12395
12464
  }
12396
12465
  if (isPaddingType(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);
12466
+ node.setPadding(Edge.Top, options.padding);
12467
+ node.setPadding(Edge.Right, options.padding);
12468
+ node.setPadding(Edge.Bottom, options.padding);
12469
+ node.setPadding(Edge.Left, options.padding);
12401
12470
  }
12402
12471
  if (isPaddingType(options.paddingTop)) {
12403
- node.setPadding(import_bun_yoga2.Edge.Top, options.paddingTop);
12472
+ node.setPadding(Edge.Top, options.paddingTop);
12404
12473
  }
12405
12474
  if (isPaddingType(options.paddingRight)) {
12406
- node.setPadding(import_bun_yoga2.Edge.Right, options.paddingRight);
12475
+ node.setPadding(Edge.Right, options.paddingRight);
12407
12476
  }
12408
12477
  if (isPaddingType(options.paddingBottom)) {
12409
- node.setPadding(import_bun_yoga2.Edge.Bottom, options.paddingBottom);
12478
+ node.setPadding(Edge.Bottom, options.paddingBottom);
12410
12479
  }
12411
12480
  if (isPaddingType(options.paddingLeft)) {
12412
- node.setPadding(import_bun_yoga2.Edge.Left, options.paddingLeft);
12481
+ node.setPadding(Edge.Left, options.paddingLeft);
12413
12482
  }
12414
12483
  }
12415
12484
  set position(positionType) {
@@ -12438,30 +12507,30 @@ class Renderable extends BaseRenderable {
12438
12507
  const { top, right, bottom, left } = position;
12439
12508
  if (isPositionType(top)) {
12440
12509
  if (top === "auto") {
12441
- node.setPositionAuto(import_bun_yoga2.Edge.Top);
12510
+ node.setPositionAuto(Edge.Top);
12442
12511
  } else {
12443
- node.setPosition(import_bun_yoga2.Edge.Top, top);
12512
+ node.setPosition(Edge.Top, top);
12444
12513
  }
12445
12514
  }
12446
12515
  if (isPositionType(right)) {
12447
12516
  if (right === "auto") {
12448
- node.setPositionAuto(import_bun_yoga2.Edge.Right);
12517
+ node.setPositionAuto(Edge.Right);
12449
12518
  } else {
12450
- node.setPosition(import_bun_yoga2.Edge.Right, right);
12519
+ node.setPosition(Edge.Right, right);
12451
12520
  }
12452
12521
  }
12453
12522
  if (isPositionType(bottom)) {
12454
12523
  if (bottom === "auto") {
12455
- node.setPositionAuto(import_bun_yoga2.Edge.Bottom);
12524
+ node.setPositionAuto(Edge.Bottom);
12456
12525
  } else {
12457
- node.setPosition(import_bun_yoga2.Edge.Bottom, bottom);
12526
+ node.setPosition(Edge.Bottom, bottom);
12458
12527
  }
12459
12528
  }
12460
12529
  if (isPositionType(left)) {
12461
12530
  if (left === "auto") {
12462
- node.setPositionAuto(import_bun_yoga2.Edge.Left);
12531
+ node.setPositionAuto(Edge.Left);
12463
12532
  } else {
12464
- node.setPosition(import_bun_yoga2.Edge.Left, left);
12533
+ node.setPosition(Edge.Left, left);
12465
12534
  }
12466
12535
  }
12467
12536
  this.requestRender();
@@ -12533,68 +12602,68 @@ class Renderable extends BaseRenderable {
12533
12602
  set margin(margin) {
12534
12603
  if (isMarginType(margin)) {
12535
12604
  const node = this.yogaNode;
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);
12605
+ node.setMargin(Edge.Top, margin);
12606
+ node.setMargin(Edge.Right, margin);
12607
+ node.setMargin(Edge.Bottom, margin);
12608
+ node.setMargin(Edge.Left, margin);
12540
12609
  this.requestRender();
12541
12610
  }
12542
12611
  }
12543
12612
  set marginTop(margin) {
12544
12613
  if (isMarginType(margin)) {
12545
- this.yogaNode.setMargin(import_bun_yoga2.Edge.Top, margin);
12614
+ this.yogaNode.setMargin(Edge.Top, margin);
12546
12615
  this.requestRender();
12547
12616
  }
12548
12617
  }
12549
12618
  set marginRight(margin) {
12550
12619
  if (isMarginType(margin)) {
12551
- this.yogaNode.setMargin(import_bun_yoga2.Edge.Right, margin);
12620
+ this.yogaNode.setMargin(Edge.Right, margin);
12552
12621
  this.requestRender();
12553
12622
  }
12554
12623
  }
12555
12624
  set marginBottom(margin) {
12556
12625
  if (isMarginType(margin)) {
12557
- this.yogaNode.setMargin(import_bun_yoga2.Edge.Bottom, margin);
12626
+ this.yogaNode.setMargin(Edge.Bottom, margin);
12558
12627
  this.requestRender();
12559
12628
  }
12560
12629
  }
12561
12630
  set marginLeft(margin) {
12562
12631
  if (isMarginType(margin)) {
12563
- this.yogaNode.setMargin(import_bun_yoga2.Edge.Left, margin);
12632
+ this.yogaNode.setMargin(Edge.Left, margin);
12564
12633
  this.requestRender();
12565
12634
  }
12566
12635
  }
12567
12636
  set padding(padding) {
12568
12637
  if (isPaddingType(padding)) {
12569
12638
  const node = this.yogaNode;
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);
12639
+ node.setPadding(Edge.Top, padding);
12640
+ node.setPadding(Edge.Right, padding);
12641
+ node.setPadding(Edge.Bottom, padding);
12642
+ node.setPadding(Edge.Left, padding);
12574
12643
  this.requestRender();
12575
12644
  }
12576
12645
  }
12577
12646
  set paddingTop(padding) {
12578
12647
  if (isPaddingType(padding)) {
12579
- this.yogaNode.setPadding(import_bun_yoga2.Edge.Top, padding);
12648
+ this.yogaNode.setPadding(Edge.Top, padding);
12580
12649
  this.requestRender();
12581
12650
  }
12582
12651
  }
12583
12652
  set paddingRight(padding) {
12584
12653
  if (isPaddingType(padding)) {
12585
- this.yogaNode.setPadding(import_bun_yoga2.Edge.Right, padding);
12654
+ this.yogaNode.setPadding(Edge.Right, padding);
12586
12655
  this.requestRender();
12587
12656
  }
12588
12657
  }
12589
12658
  set paddingBottom(padding) {
12590
12659
  if (isPaddingType(padding)) {
12591
- this.yogaNode.setPadding(import_bun_yoga2.Edge.Bottom, padding);
12660
+ this.yogaNode.setPadding(Edge.Bottom, padding);
12592
12661
  this.requestRender();
12593
12662
  }
12594
12663
  }
12595
12664
  set paddingLeft(padding) {
12596
12665
  if (isPaddingType(padding)) {
12597
- this.yogaNode.setPadding(import_bun_yoga2.Edge.Left, padding);
12666
+ this.yogaNode.setPadding(Edge.Left, padding);
12598
12667
  this.requestRender();
12599
12668
  }
12600
12669
  }
@@ -13010,10 +13079,10 @@ class RootRenderable extends Renderable {
13010
13079
  if (this.yogaNode) {
13011
13080
  this.yogaNode.free();
13012
13081
  }
13013
- this.yogaNode = import_bun_yoga2.default.Node.create(yogaConfig);
13082
+ this.yogaNode = dist_default.Node.create(yogaConfig);
13014
13083
  this.yogaNode.setWidth(ctx.width);
13015
13084
  this.yogaNode.setHeight(ctx.height);
13016
- this.yogaNode.setFlexDirection(import_bun_yoga2.FlexDirection.Column);
13085
+ this.yogaNode.setFlexDirection(FlexDirection.Column);
13017
13086
  this.calculateLayout();
13018
13087
  }
13019
13088
  render(buffer, deltaTime) {
@@ -13054,7 +13123,7 @@ class RootRenderable extends Renderable {
13054
13123
  }
13055
13124
  }
13056
13125
  calculateLayout() {
13057
- this.yogaNode.calculateLayout(this.width, this.height, import_bun_yoga2.Direction.LTR);
13126
+ this.yogaNode.calculateLayout(this.width, this.height, Direction.LTR);
13058
13127
  this.emit("layout-changed" /* LAYOUT_CHANGED */);
13059
13128
  }
13060
13129
  resize(width, height) {
@@ -14320,13 +14389,13 @@ Captured output:
14320
14389
  get controlState() {
14321
14390
  return this._controlState;
14322
14391
  }
14323
- constructor(lib, rendererPtr, stdin, stdout, width, height, config = {}) {
14392
+ constructor(lib2, rendererPtr, stdin, stdout, width, height, config = {}) {
14324
14393
  super();
14325
14394
  rendererTracker.addRenderer(this);
14326
14395
  this.stdin = stdin;
14327
14396
  this.stdout = stdout;
14328
14397
  this.realStdoutWrite = stdout.write;
14329
- this.lib = lib;
14398
+ this.lib = lib2;
14330
14399
  this._terminalWidth = stdout.columns;
14331
14400
  this._terminalHeight = stdout.rows;
14332
14401
  this.width = width;
@@ -14337,7 +14406,7 @@ Captured output:
14337
14406
  capture.on("write", this.captureCallback);
14338
14407
  this.renderOffset = height - this._splitHeight;
14339
14408
  this.height = this._splitHeight;
14340
- lib.setRenderOffset(rendererPtr, this.renderOffset);
14409
+ lib2.setRenderOffset(rendererPtr, this.renderOffset);
14341
14410
  }
14342
14411
  this.rendererPtr = rendererPtr;
14343
14412
  this.exitOnCtrlC = config.exitOnCtrlC === undefined ? true : config.exitOnCtrlC;
@@ -14931,19 +15000,19 @@ Captured output:
14931
15000
  this.lib.dumpStdoutBuffer(this.rendererPtr, timestamp);
14932
15001
  }
14933
15002
  static setCursorPosition(renderer, x, y, visible = true) {
14934
- const lib = resolveRenderLib();
14935
- lib.setCursorPosition(renderer.rendererPtr, x, y, visible);
15003
+ const lib2 = resolveRenderLib();
15004
+ lib2.setCursorPosition(renderer.rendererPtr, x, y, visible);
14936
15005
  }
14937
15006
  static setCursorStyle(renderer, style, blinking = false, color) {
14938
- const lib = resolveRenderLib();
14939
- lib.setCursorStyle(renderer.rendererPtr, style, blinking);
15007
+ const lib2 = resolveRenderLib();
15008
+ lib2.setCursorStyle(renderer.rendererPtr, style, blinking);
14940
15009
  if (color) {
14941
- lib.setCursorColor(renderer.rendererPtr, color);
15010
+ lib2.setCursorColor(renderer.rendererPtr, color);
14942
15011
  }
14943
15012
  }
14944
15013
  static setCursorColor(renderer, color) {
14945
- const lib = resolveRenderLib();
14946
- lib.setCursorColor(renderer.rendererPtr, color);
15014
+ const lib2 = resolveRenderLib();
15015
+ lib2.setCursorColor(renderer.rendererPtr, color);
14947
15016
  }
14948
15017
  setCursorPosition(x, y, visible = true) {
14949
15018
  this.lib.setCursorPosition(this.rendererPtr, x, y, visible);
@@ -15380,7 +15449,7 @@ Captured output:
15380
15449
  }
15381
15450
  }
15382
15451
 
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 };
15452
+ export { 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 };
15384
15453
 
15385
- //# debugId=4463EA6925DD17AC64756E2164756E21
15386
- //# sourceMappingURL=index-r6acnfwr.js.map
15454
+ //# debugId=1623532973D99D8964756E2164756E21
15455
+ //# sourceMappingURL=index-re80811e.js.map