@gridland/core 0.2.30 → 0.2.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.js +278 -404
- package/dist/browser.js.map +4 -4
- package/dist/index.js +165 -175
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -1558,8 +1558,8 @@ var require_react_reconciler_production = __commonJS({
|
|
|
1558
1558
|
currentEntangledActionThenable = {
|
|
1559
1559
|
status: "pending",
|
|
1560
1560
|
value: void 0,
|
|
1561
|
-
then: function(
|
|
1562
|
-
entangledListeners.push(
|
|
1561
|
+
then: function(resolve2) {
|
|
1562
|
+
entangledListeners.push(resolve2);
|
|
1563
1563
|
}
|
|
1564
1564
|
};
|
|
1565
1565
|
}
|
|
@@ -1582,8 +1582,8 @@ var require_react_reconciler_production = __commonJS({
|
|
|
1582
1582
|
status: "pending",
|
|
1583
1583
|
value: null,
|
|
1584
1584
|
reason: null,
|
|
1585
|
-
then: function(
|
|
1586
|
-
listeners.push(
|
|
1585
|
+
then: function(resolve2) {
|
|
1586
|
+
listeners.push(resolve2);
|
|
1587
1587
|
}
|
|
1588
1588
|
};
|
|
1589
1589
|
thenable.then(
|
|
@@ -8426,10 +8426,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
8426
8426
|
fiber = fiber.next, id--;
|
|
8427
8427
|
return fiber;
|
|
8428
8428
|
}
|
|
8429
|
-
function copyWithSetImpl(obj,
|
|
8430
|
-
if (index >=
|
|
8431
|
-
var key =
|
|
8432
|
-
updated[key] = copyWithSetImpl(obj[key],
|
|
8429
|
+
function copyWithSetImpl(obj, path, index, value) {
|
|
8430
|
+
if (index >= path.length) return value;
|
|
8431
|
+
var key = path[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
|
|
8432
|
+
updated[key] = copyWithSetImpl(obj[key], path, index + 1, value);
|
|
8433
8433
|
return updated;
|
|
8434
8434
|
}
|
|
8435
8435
|
function copyWithRename(obj, oldPath, newPath) {
|
|
@@ -8456,11 +8456,11 @@ var require_react_reconciler_development = __commonJS({
|
|
|
8456
8456
|
);
|
|
8457
8457
|
return updated;
|
|
8458
8458
|
}
|
|
8459
|
-
function copyWithDeleteImpl(obj,
|
|
8460
|
-
var key =
|
|
8461
|
-
if (index + 1 ===
|
|
8459
|
+
function copyWithDeleteImpl(obj, path, index) {
|
|
8460
|
+
var key = path[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
|
|
8461
|
+
if (index + 1 === path.length)
|
|
8462
8462
|
return isArrayImpl(updated) ? updated.splice(key, 1) : delete updated[key], updated;
|
|
8463
|
-
updated[key] = copyWithDeleteImpl(obj[key],
|
|
8463
|
+
updated[key] = copyWithDeleteImpl(obj[key], path, index + 1);
|
|
8464
8464
|
return updated;
|
|
8465
8465
|
}
|
|
8466
8466
|
function shouldSuspendImpl() {
|
|
@@ -10243,8 +10243,8 @@ var require_react_reconciler_development = __commonJS({
|
|
|
10243
10243
|
currentEntangledActionThenable = {
|
|
10244
10244
|
status: "pending",
|
|
10245
10245
|
value: void 0,
|
|
10246
|
-
then: function(
|
|
10247
|
-
entangledListeners.push(
|
|
10246
|
+
then: function(resolve2) {
|
|
10247
|
+
entangledListeners.push(resolve2);
|
|
10248
10248
|
}
|
|
10249
10249
|
};
|
|
10250
10250
|
}
|
|
@@ -10267,8 +10267,8 @@ var require_react_reconciler_development = __commonJS({
|
|
|
10267
10267
|
status: "pending",
|
|
10268
10268
|
value: null,
|
|
10269
10269
|
reason: null,
|
|
10270
|
-
then: function(
|
|
10271
|
-
listeners.push(
|
|
10270
|
+
then: function(resolve2) {
|
|
10271
|
+
listeners.push(resolve2);
|
|
10272
10272
|
}
|
|
10273
10273
|
};
|
|
10274
10274
|
thenable.then(
|
|
@@ -19845,29 +19845,29 @@ var require_react_reconciler_development = __commonJS({
|
|
|
19845
19845
|
var didWarnAboutNestedUpdates = false;
|
|
19846
19846
|
var didWarnAboutFindNodeInStrictMode = {};
|
|
19847
19847
|
var overrideHookState = null, overrideHookStateDeletePath = null, overrideHookStateRenamePath = null, overrideProps = null, overridePropsDeletePath = null, overridePropsRenamePath = null, scheduleUpdate = null, setErrorHandler = null, setSuspenseHandler = null;
|
|
19848
|
-
overrideHookState = function(fiber, id,
|
|
19848
|
+
overrideHookState = function(fiber, id, path, value) {
|
|
19849
19849
|
id = findHook(fiber, id);
|
|
19850
|
-
null !== id && (
|
|
19850
|
+
null !== id && (path = copyWithSetImpl(id.memoizedState, path, 0, value), id.memoizedState = path, id.baseState = path, fiber.memoizedProps = assign({}, fiber.memoizedProps), path = enqueueConcurrentRenderForLane(fiber, 2), null !== path && scheduleUpdateOnFiber(path, fiber, 2));
|
|
19851
19851
|
};
|
|
19852
|
-
overrideHookStateDeletePath = function(fiber, id,
|
|
19852
|
+
overrideHookStateDeletePath = function(fiber, id, path) {
|
|
19853
19853
|
id = findHook(fiber, id);
|
|
19854
|
-
null !== id && (
|
|
19854
|
+
null !== id && (path = copyWithDeleteImpl(id.memoizedState, path, 0), id.memoizedState = path, id.baseState = path, fiber.memoizedProps = assign({}, fiber.memoizedProps), path = enqueueConcurrentRenderForLane(fiber, 2), null !== path && scheduleUpdateOnFiber(path, fiber, 2));
|
|
19855
19855
|
};
|
|
19856
19856
|
overrideHookStateRenamePath = function(fiber, id, oldPath, newPath) {
|
|
19857
19857
|
id = findHook(fiber, id);
|
|
19858
19858
|
null !== id && (oldPath = copyWithRename(id.memoizedState, oldPath, newPath), id.memoizedState = oldPath, id.baseState = oldPath, fiber.memoizedProps = assign({}, fiber.memoizedProps), oldPath = enqueueConcurrentRenderForLane(fiber, 2), null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, 2));
|
|
19859
19859
|
};
|
|
19860
|
-
overrideProps = function(fiber,
|
|
19861
|
-
fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps,
|
|
19860
|
+
overrideProps = function(fiber, path, value) {
|
|
19861
|
+
fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path, 0, value);
|
|
19862
19862
|
fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
|
|
19863
|
-
|
|
19864
|
-
null !==
|
|
19863
|
+
path = enqueueConcurrentRenderForLane(fiber, 2);
|
|
19864
|
+
null !== path && scheduleUpdateOnFiber(path, fiber, 2);
|
|
19865
19865
|
};
|
|
19866
|
-
overridePropsDeletePath = function(fiber,
|
|
19867
|
-
fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps,
|
|
19866
|
+
overridePropsDeletePath = function(fiber, path) {
|
|
19867
|
+
fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path, 0);
|
|
19868
19868
|
fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
|
|
19869
|
-
|
|
19870
|
-
null !==
|
|
19869
|
+
path = enqueueConcurrentRenderForLane(fiber, 2);
|
|
19870
|
+
null !== path && scheduleUpdateOnFiber(path, fiber, 2);
|
|
19871
19871
|
};
|
|
19872
19872
|
overridePropsRenamePath = function(fiber, oldPath, newPath) {
|
|
19873
19873
|
fiber.pendingProps = copyWithRename(
|
|
@@ -20356,8 +20356,69 @@ var init_devtools = __esm({
|
|
|
20356
20356
|
}
|
|
20357
20357
|
});
|
|
20358
20358
|
|
|
20359
|
-
//
|
|
20360
|
-
|
|
20359
|
+
// ../web/src/shims/events-shim.ts
|
|
20360
|
+
var EventEmitter = class {
|
|
20361
|
+
_listeners = /* @__PURE__ */ new Map();
|
|
20362
|
+
on(event, listener) {
|
|
20363
|
+
const list = this._listeners.get(event) ?? [];
|
|
20364
|
+
list.push(listener);
|
|
20365
|
+
this._listeners.set(event, list);
|
|
20366
|
+
return this;
|
|
20367
|
+
}
|
|
20368
|
+
addListener(event, listener) {
|
|
20369
|
+
return this.on(event, listener);
|
|
20370
|
+
}
|
|
20371
|
+
off(event, listener) {
|
|
20372
|
+
return this.removeListener(event, listener);
|
|
20373
|
+
}
|
|
20374
|
+
removeListener(event, listener) {
|
|
20375
|
+
const list = this._listeners.get(event);
|
|
20376
|
+
if (list) {
|
|
20377
|
+
const idx = list.indexOf(listener);
|
|
20378
|
+
if (idx !== -1) list.splice(idx, 1);
|
|
20379
|
+
if (list.length === 0) this._listeners.delete(event);
|
|
20380
|
+
}
|
|
20381
|
+
return this;
|
|
20382
|
+
}
|
|
20383
|
+
removeAllListeners(event) {
|
|
20384
|
+
if (event) {
|
|
20385
|
+
this._listeners.delete(event);
|
|
20386
|
+
} else {
|
|
20387
|
+
this._listeners.clear();
|
|
20388
|
+
}
|
|
20389
|
+
return this;
|
|
20390
|
+
}
|
|
20391
|
+
emit(event, ...args) {
|
|
20392
|
+
const list = this._listeners.get(event);
|
|
20393
|
+
if (!list || list.length === 0) return false;
|
|
20394
|
+
for (const listener of [...list]) {
|
|
20395
|
+
listener(...args);
|
|
20396
|
+
}
|
|
20397
|
+
return true;
|
|
20398
|
+
}
|
|
20399
|
+
once(event, listener) {
|
|
20400
|
+
const wrapper = (...args) => {
|
|
20401
|
+
this.removeListener(event, wrapper);
|
|
20402
|
+
listener(...args);
|
|
20403
|
+
};
|
|
20404
|
+
return this.on(event, wrapper);
|
|
20405
|
+
}
|
|
20406
|
+
listenerCount(event) {
|
|
20407
|
+
return this._listeners.get(event)?.length ?? 0;
|
|
20408
|
+
}
|
|
20409
|
+
listeners(event) {
|
|
20410
|
+
return [...this._listeners.get(event) ?? []];
|
|
20411
|
+
}
|
|
20412
|
+
eventNames() {
|
|
20413
|
+
return [...this._listeners.keys()];
|
|
20414
|
+
}
|
|
20415
|
+
setMaxListeners(_n) {
|
|
20416
|
+
return this;
|
|
20417
|
+
}
|
|
20418
|
+
getMaxListeners() {
|
|
20419
|
+
return Infinity;
|
|
20420
|
+
}
|
|
20421
|
+
};
|
|
20361
20422
|
|
|
20362
20423
|
// ../../opentui/node_modules/.bun/yoga-layout@3.2.1/node_modules/yoga-layout/dist/src/index.js
|
|
20363
20424
|
var src_exports = {};
|
|
@@ -25894,24 +25955,39 @@ var ASCIIFontSelectionHelper = class {
|
|
|
25894
25955
|
}
|
|
25895
25956
|
};
|
|
25896
25957
|
|
|
25897
|
-
//
|
|
25898
|
-
|
|
25899
|
-
|
|
25900
|
-
|
|
25958
|
+
// ../web/src/shims/node-util.ts
|
|
25959
|
+
function inspect(obj, _options) {
|
|
25960
|
+
try {
|
|
25961
|
+
return JSON.stringify(obj, null, 2);
|
|
25962
|
+
} catch {
|
|
25963
|
+
return String(obj);
|
|
25964
|
+
}
|
|
25901
25965
|
}
|
|
25902
|
-
|
|
25903
|
-
|
|
25904
|
-
|
|
25966
|
+
function format(fmt, ...args) {
|
|
25967
|
+
let i = 0;
|
|
25968
|
+
return fmt.replace(/%[sdjifoO%]/g, (match) => {
|
|
25969
|
+
if (match === "%%") return "%";
|
|
25970
|
+
if (i >= args.length) return match;
|
|
25971
|
+
return String(args[i++]);
|
|
25972
|
+
});
|
|
25905
25973
|
}
|
|
25906
|
-
function
|
|
25907
|
-
return
|
|
25974
|
+
function promisify(fn) {
|
|
25975
|
+
return (...args) => new Promise((resolve2, reject) => {
|
|
25976
|
+
fn(...args, (err, result) => {
|
|
25977
|
+
if (err) reject(err);
|
|
25978
|
+
else resolve2(result);
|
|
25979
|
+
});
|
|
25980
|
+
});
|
|
25981
|
+
}
|
|
25982
|
+
function isDeepStrictEqual(a, b2) {
|
|
25983
|
+
return JSON.stringify(a) === JSON.stringify(b2);
|
|
25908
25984
|
}
|
|
25985
|
+
var node_util_default = { inspect, format, promisify, isDeepStrictEqual };
|
|
25909
25986
|
|
|
25910
25987
|
// ../../opentui/packages/core/src/renderables/composition/vnode.ts
|
|
25911
|
-
import util from "node:util";
|
|
25912
25988
|
var BrandedVNode = /* @__PURE__ */ Symbol.for("@opentui/core/VNode");
|
|
25913
25989
|
function isRenderableConstructor(value) {
|
|
25914
|
-
return typeof value === "function" && value.prototype &&
|
|
25990
|
+
return typeof value === "function" && value.prototype && Renderable3.prototype.isPrototypeOf(value.prototype);
|
|
25915
25991
|
}
|
|
25916
25992
|
function flattenChildren(children) {
|
|
25917
25993
|
const result = [];
|
|
@@ -25973,15 +26049,14 @@ function h(type, props, ...children) {
|
|
|
25973
26049
|
function isVNode(node) {
|
|
25974
26050
|
return node && node[BrandedVNode];
|
|
25975
26051
|
}
|
|
25976
|
-
function
|
|
25977
|
-
if (
|
|
26052
|
+
function maybeMakeRenderable(ctx, node) {
|
|
26053
|
+
if (isRenderable(node)) return node;
|
|
25978
26054
|
if (isVNode(node)) return instantiate(ctx, node);
|
|
25979
26055
|
if (process.env.NODE_ENV !== "production") {
|
|
25980
|
-
console.warn("maybeMakeRenderable received an invalid node",
|
|
26056
|
+
console.warn("maybeMakeRenderable received an invalid node", node_util_default.inspect(node, { depth: 2 }));
|
|
25981
26057
|
}
|
|
25982
26058
|
return null;
|
|
25983
26059
|
}
|
|
25984
|
-
registerMaybeMakeRenderable(maybeMakeRenderable2);
|
|
25985
26060
|
function wrapWithDelegates(instance, delegateMap) {
|
|
25986
26061
|
if (!delegateMap || Object.keys(delegateMap).length === 0) return instance;
|
|
25987
26062
|
const descendantCache = /* @__PURE__ */ new Map();
|
|
@@ -26025,7 +26100,7 @@ function wrapWithDelegates(instance, delegateMap) {
|
|
|
26025
26100
|
return proxy;
|
|
26026
26101
|
}
|
|
26027
26102
|
function instantiate(ctx, node) {
|
|
26028
|
-
if (
|
|
26103
|
+
if (isRenderable(node)) return node;
|
|
26029
26104
|
if (!node || typeof node !== "object") {
|
|
26030
26105
|
throw new TypeError("mount() received an invalid vnode");
|
|
26031
26106
|
}
|
|
@@ -26036,7 +26111,7 @@ function instantiate(ctx, node) {
|
|
|
26036
26111
|
if (isRenderableConstructor(type)) {
|
|
26037
26112
|
const instance = new type(ctx, props || {});
|
|
26038
26113
|
for (const child of children) {
|
|
26039
|
-
if (
|
|
26114
|
+
if (isRenderable(child)) {
|
|
26040
26115
|
instance.add(child);
|
|
26041
26116
|
} else {
|
|
26042
26117
|
const mounted = instantiate(ctx, child);
|
|
@@ -26063,7 +26138,7 @@ function instantiate(ctx, node) {
|
|
|
26063
26138
|
return wrapWithDelegates(inst, delegateMap);
|
|
26064
26139
|
}
|
|
26065
26140
|
function delegate(mapping, vnode) {
|
|
26066
|
-
if (
|
|
26141
|
+
if (isRenderable(vnode)) {
|
|
26067
26142
|
return wrapWithDelegates(vnode, mapping);
|
|
26068
26143
|
}
|
|
26069
26144
|
if (!vnode || typeof vnode !== "object") return vnode;
|
|
@@ -26071,11 +26146,39 @@ function delegate(mapping, vnode) {
|
|
|
26071
26146
|
return vnode;
|
|
26072
26147
|
}
|
|
26073
26148
|
|
|
26074
|
-
//
|
|
26075
|
-
|
|
26076
|
-
|
|
26077
|
-
|
|
26078
|
-
|
|
26149
|
+
// ../web/src/shims/node-buffer.ts
|
|
26150
|
+
var BrowserBuffer = {
|
|
26151
|
+
from(data, encoding) {
|
|
26152
|
+
if (typeof data === "string") {
|
|
26153
|
+
const encoder = new TextEncoder();
|
|
26154
|
+
return encoder.encode(data);
|
|
26155
|
+
}
|
|
26156
|
+
if (data instanceof ArrayBuffer) {
|
|
26157
|
+
return new Uint8Array(data);
|
|
26158
|
+
}
|
|
26159
|
+
if (data instanceof Uint8Array) {
|
|
26160
|
+
return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
|
|
26161
|
+
}
|
|
26162
|
+
return new Uint8Array(0);
|
|
26163
|
+
},
|
|
26164
|
+
alloc(size) {
|
|
26165
|
+
return new Uint8Array(size);
|
|
26166
|
+
},
|
|
26167
|
+
isBuffer(obj) {
|
|
26168
|
+
return obj instanceof Uint8Array;
|
|
26169
|
+
},
|
|
26170
|
+
concat(list, totalLength) {
|
|
26171
|
+
const length = totalLength ?? list.reduce((acc, buf) => acc + buf.byteLength, 0);
|
|
26172
|
+
const result = new Uint8Array(length);
|
|
26173
|
+
let offset = 0;
|
|
26174
|
+
for (const buf of list) {
|
|
26175
|
+
result.set(buf, offset);
|
|
26176
|
+
offset += buf.byteLength;
|
|
26177
|
+
}
|
|
26178
|
+
return result;
|
|
26179
|
+
}
|
|
26180
|
+
};
|
|
26181
|
+
var Buffer2 = BrowserBuffer;
|
|
26079
26182
|
|
|
26080
26183
|
// ../../opentui/packages/core/src/lib/parse.keypress-kitty.ts
|
|
26081
26184
|
var kittyKeyMap = {
|
|
@@ -26917,7 +27020,6 @@ var MacOSScrollAccel = class {
|
|
|
26917
27020
|
};
|
|
26918
27021
|
|
|
26919
27022
|
// ../../opentui/packages/core/src/lib/stdin-buffer.ts
|
|
26920
|
-
import { EventEmitter as EventEmitter2 } from "events";
|
|
26921
27023
|
var ESC = "\x1B";
|
|
26922
27024
|
var BRACKETED_PASTE_START = "\x1B[200~";
|
|
26923
27025
|
var BRACKETED_PASTE_END = "\x1B[201~";
|
|
@@ -27068,7 +27170,7 @@ function extractCompleteSequences(buffer) {
|
|
|
27068
27170
|
}
|
|
27069
27171
|
return { sequences, remainder: "" };
|
|
27070
27172
|
}
|
|
27071
|
-
var StdinBuffer = class extends
|
|
27173
|
+
var StdinBuffer = class extends EventEmitter {
|
|
27072
27174
|
buffer = "";
|
|
27073
27175
|
timeout = null;
|
|
27074
27176
|
timeoutMs;
|
|
@@ -27370,16 +27472,6 @@ function singleton(key, factory) {
|
|
|
27370
27472
|
}
|
|
27371
27473
|
return bag[key];
|
|
27372
27474
|
}
|
|
27373
|
-
function destroySingleton(key) {
|
|
27374
|
-
const bag = globalThis[singletonCacheSymbol];
|
|
27375
|
-
if (bag && key in bag) {
|
|
27376
|
-
delete bag[key];
|
|
27377
|
-
}
|
|
27378
|
-
}
|
|
27379
|
-
function hasSingleton(key) {
|
|
27380
|
-
const bag = globalThis[singletonCacheSymbol];
|
|
27381
|
-
return bag && key in bag;
|
|
27382
|
-
}
|
|
27383
27475
|
|
|
27384
27476
|
// ../../opentui/packages/core/src/lib/env.ts
|
|
27385
27477
|
var envRegistry = singleton("env-registry", () => ({}));
|
|
@@ -27561,10 +27653,56 @@ function resolveFiletype(_filename) {
|
|
|
27561
27653
|
return null;
|
|
27562
27654
|
}
|
|
27563
27655
|
|
|
27564
|
-
//
|
|
27565
|
-
|
|
27566
|
-
|
|
27567
|
-
|
|
27656
|
+
// ../web/src/shims/node-os.ts
|
|
27657
|
+
function homedir() {
|
|
27658
|
+
return "/home/user";
|
|
27659
|
+
}
|
|
27660
|
+
function tmpdir() {
|
|
27661
|
+
return "/tmp";
|
|
27662
|
+
}
|
|
27663
|
+
function platform() {
|
|
27664
|
+
return "browser";
|
|
27665
|
+
}
|
|
27666
|
+
function arch() {
|
|
27667
|
+
return "wasm";
|
|
27668
|
+
}
|
|
27669
|
+
var node_os_default = { homedir, tmpdir, platform, arch };
|
|
27670
|
+
|
|
27671
|
+
// ../web/src/shims/node-path.ts
|
|
27672
|
+
function join(...parts) {
|
|
27673
|
+
return parts.join("/").replace(/\/+/g, "/");
|
|
27674
|
+
}
|
|
27675
|
+
function resolve(...parts) {
|
|
27676
|
+
return join(...parts);
|
|
27677
|
+
}
|
|
27678
|
+
function dirname(p) {
|
|
27679
|
+
return p.split("/").slice(0, -1).join("/") || "/";
|
|
27680
|
+
}
|
|
27681
|
+
function basename(p, ext) {
|
|
27682
|
+
const base = p.split("/").pop() || "";
|
|
27683
|
+
if (ext && base.endsWith(ext)) return base.slice(0, -ext.length);
|
|
27684
|
+
return base;
|
|
27685
|
+
}
|
|
27686
|
+
function extname(p) {
|
|
27687
|
+
const base = basename(p);
|
|
27688
|
+
const idx = base.lastIndexOf(".");
|
|
27689
|
+
return idx >= 0 ? base.slice(idx) : "";
|
|
27690
|
+
}
|
|
27691
|
+
function parse(p) {
|
|
27692
|
+
const dir = dirname(p);
|
|
27693
|
+
const base = basename(p);
|
|
27694
|
+
const ext = extname(p);
|
|
27695
|
+
const name = ext ? base.slice(0, -ext.length) : base;
|
|
27696
|
+
return { root: p.startsWith("/") ? "/" : "", dir, base, ext, name };
|
|
27697
|
+
}
|
|
27698
|
+
function isAbsolute(p) {
|
|
27699
|
+
return p.startsWith("/");
|
|
27700
|
+
}
|
|
27701
|
+
function relative(from, to) {
|
|
27702
|
+
return to.replace(from, "").replace(/^\//, "");
|
|
27703
|
+
}
|
|
27704
|
+
var sep = "/";
|
|
27705
|
+
var node_path_default = { join, resolve, dirname, basename, extname, parse, isAbsolute, relative, sep };
|
|
27568
27706
|
|
|
27569
27707
|
// ../../opentui/packages/core/src/lib/validate-dir-name.ts
|
|
27570
27708
|
function isValidDirectoryName(name) {
|
|
@@ -27627,7 +27765,7 @@ registerEnvVar({
|
|
|
27627
27765
|
type: "string",
|
|
27628
27766
|
default: ""
|
|
27629
27767
|
});
|
|
27630
|
-
var DataPathsManager = class extends
|
|
27768
|
+
var DataPathsManager = class extends EventEmitter {
|
|
27631
27769
|
_appName;
|
|
27632
27770
|
_globalConfigPath;
|
|
27633
27771
|
_globalConfigFile;
|
|
@@ -27655,31 +27793,31 @@ var DataPathsManager = class extends EventEmitter3 {
|
|
|
27655
27793
|
}
|
|
27656
27794
|
get globalConfigPath() {
|
|
27657
27795
|
if (this._globalConfigPath === void 0) {
|
|
27658
|
-
const homeDir =
|
|
27796
|
+
const homeDir = node_os_default.homedir();
|
|
27659
27797
|
const xdgConfigHome = env.XDG_CONFIG_HOME;
|
|
27660
|
-
const baseConfigDir = xdgConfigHome ||
|
|
27661
|
-
this._globalConfigPath =
|
|
27798
|
+
const baseConfigDir = xdgConfigHome || node_path_default.join(homeDir, ".config");
|
|
27799
|
+
this._globalConfigPath = node_path_default.join(baseConfigDir, this._appName);
|
|
27662
27800
|
}
|
|
27663
27801
|
return this._globalConfigPath;
|
|
27664
27802
|
}
|
|
27665
27803
|
get globalConfigFile() {
|
|
27666
27804
|
if (this._globalConfigFile === void 0) {
|
|
27667
|
-
this._globalConfigFile =
|
|
27805
|
+
this._globalConfigFile = node_path_default.join(this.globalConfigPath, "init.ts");
|
|
27668
27806
|
}
|
|
27669
27807
|
return this._globalConfigFile;
|
|
27670
27808
|
}
|
|
27671
27809
|
get localConfigFile() {
|
|
27672
27810
|
if (this._localConfigFile === void 0) {
|
|
27673
|
-
this._localConfigFile =
|
|
27811
|
+
this._localConfigFile = node_path_default.join(process.cwd(), `.${this._appName}.ts`);
|
|
27674
27812
|
}
|
|
27675
27813
|
return this._localConfigFile;
|
|
27676
27814
|
}
|
|
27677
27815
|
get globalDataPath() {
|
|
27678
27816
|
if (this._globalDataPath === void 0) {
|
|
27679
|
-
const homeDir =
|
|
27817
|
+
const homeDir = node_os_default.homedir();
|
|
27680
27818
|
const xdgDataHome = env.XDG_DATA_HOME;
|
|
27681
|
-
const baseDataDir = xdgDataHome ||
|
|
27682
|
-
this._globalDataPath =
|
|
27819
|
+
const baseDataDir = xdgDataHome || node_path_default.join(homeDir, ".local/share");
|
|
27820
|
+
this._globalDataPath = node_path_default.join(baseDataDir, this._appName);
|
|
27683
27821
|
}
|
|
27684
27822
|
return this._globalDataPath;
|
|
27685
27823
|
}
|
|
@@ -28436,19 +28574,19 @@ var TerminalPalette = class {
|
|
|
28436
28574
|
const out = this.stdout;
|
|
28437
28575
|
const inp = this.stdin;
|
|
28438
28576
|
if (!out.isTTY || !inp.isTTY) return false;
|
|
28439
|
-
return new Promise((
|
|
28577
|
+
return new Promise((resolve2) => {
|
|
28440
28578
|
let buffer = "";
|
|
28441
28579
|
const onData = (chunk) => {
|
|
28442
28580
|
buffer += chunk.toString();
|
|
28443
28581
|
OSC4_RESPONSE.lastIndex = 0;
|
|
28444
28582
|
if (OSC4_RESPONSE.test(buffer)) {
|
|
28445
28583
|
cleanup();
|
|
28446
|
-
|
|
28584
|
+
resolve2(true);
|
|
28447
28585
|
}
|
|
28448
28586
|
};
|
|
28449
28587
|
const onTimeout = () => {
|
|
28450
28588
|
cleanup();
|
|
28451
|
-
|
|
28589
|
+
resolve2(false);
|
|
28452
28590
|
};
|
|
28453
28591
|
const cleanup = () => {
|
|
28454
28592
|
clearTimeout(timer);
|
|
@@ -28473,7 +28611,7 @@ var TerminalPalette = class {
|
|
|
28473
28611
|
if (!out.isTTY || !inp.isTTY) {
|
|
28474
28612
|
return results;
|
|
28475
28613
|
}
|
|
28476
|
-
return new Promise((
|
|
28614
|
+
return new Promise((resolve2) => {
|
|
28477
28615
|
let buffer = "";
|
|
28478
28616
|
let lastResponseTime = Date.now();
|
|
28479
28617
|
let idleTimer = null;
|
|
@@ -28490,19 +28628,19 @@ var TerminalPalette = class {
|
|
|
28490
28628
|
const done = [...results.values()].filter((v2) => v2 !== null).length;
|
|
28491
28629
|
if (done === results.size) {
|
|
28492
28630
|
cleanup();
|
|
28493
|
-
|
|
28631
|
+
resolve2(results);
|
|
28494
28632
|
return;
|
|
28495
28633
|
}
|
|
28496
28634
|
if (idleTimer) clearTimeout(idleTimer);
|
|
28497
28635
|
idleTimer = setTimeout(() => {
|
|
28498
28636
|
cleanup();
|
|
28499
|
-
|
|
28637
|
+
resolve2(results);
|
|
28500
28638
|
}, 150);
|
|
28501
28639
|
if (idleTimer) this.activeTimers.push(idleTimer);
|
|
28502
28640
|
};
|
|
28503
28641
|
const onTimeout = () => {
|
|
28504
28642
|
cleanup();
|
|
28505
|
-
|
|
28643
|
+
resolve2(results);
|
|
28506
28644
|
};
|
|
28507
28645
|
const cleanup = () => {
|
|
28508
28646
|
clearTimeout(timer);
|
|
@@ -28541,7 +28679,7 @@ var TerminalPalette = class {
|
|
|
28541
28679
|
if (!out.isTTY || !inp.isTTY) {
|
|
28542
28680
|
return results;
|
|
28543
28681
|
}
|
|
28544
|
-
return new Promise((
|
|
28682
|
+
return new Promise((resolve2) => {
|
|
28545
28683
|
let buffer = "";
|
|
28546
28684
|
let idleTimer = null;
|
|
28547
28685
|
const onData = (chunk) => {
|
|
@@ -28560,20 +28698,20 @@ var TerminalPalette = class {
|
|
|
28560
28698
|
const done = Object.values(results).filter((v2) => v2 !== null).length;
|
|
28561
28699
|
if (done === Object.keys(results).length) {
|
|
28562
28700
|
cleanup();
|
|
28563
|
-
|
|
28701
|
+
resolve2(results);
|
|
28564
28702
|
return;
|
|
28565
28703
|
}
|
|
28566
28704
|
if (!updated) return;
|
|
28567
28705
|
if (idleTimer) clearTimeout(idleTimer);
|
|
28568
28706
|
idleTimer = setTimeout(() => {
|
|
28569
28707
|
cleanup();
|
|
28570
|
-
|
|
28708
|
+
resolve2(results);
|
|
28571
28709
|
}, 150);
|
|
28572
28710
|
if (idleTimer) this.activeTimers.push(idleTimer);
|
|
28573
28711
|
};
|
|
28574
28712
|
const onTimeout = () => {
|
|
28575
28713
|
cleanup();
|
|
28576
|
-
|
|
28714
|
+
resolve2(results);
|
|
28577
28715
|
};
|
|
28578
28716
|
const cleanup = () => {
|
|
28579
28717
|
clearTimeout(timer);
|
|
@@ -28685,6 +28823,7 @@ function detectLinks(chunks, context) {
|
|
|
28685
28823
|
}
|
|
28686
28824
|
|
|
28687
28825
|
// ../../opentui/packages/core/src/Renderable.ts
|
|
28826
|
+
var BrandedRenderable = /* @__PURE__ */ Symbol.for("@opentui/core/Renderable");
|
|
28688
28827
|
var LayoutEvents = /* @__PURE__ */ ((LayoutEvents2) => {
|
|
28689
28828
|
LayoutEvents2["LAYOUT_CHANGED"] = "layout-changed";
|
|
28690
28829
|
LayoutEvents2["ADDED"] = "added";
|
|
@@ -28697,7 +28836,10 @@ var RenderableEvents = /* @__PURE__ */ ((RenderableEvents2) => {
|
|
|
28697
28836
|
RenderableEvents2["BLURRED"] = "blurred";
|
|
28698
28837
|
return RenderableEvents2;
|
|
28699
28838
|
})(RenderableEvents || {});
|
|
28700
|
-
|
|
28839
|
+
function isRenderable(obj) {
|
|
28840
|
+
return !!obj?.[BrandedRenderable];
|
|
28841
|
+
}
|
|
28842
|
+
var BaseRenderable = class _BaseRenderable extends EventEmitter {
|
|
28701
28843
|
[BrandedRenderable] = true;
|
|
28702
28844
|
static renderableNumber = 1;
|
|
28703
28845
|
_id;
|
|
@@ -29441,7 +29583,7 @@ var Renderable3 = class _Renderable extends BaseRenderable {
|
|
|
29441
29583
|
}
|
|
29442
29584
|
try {
|
|
29443
29585
|
const widthMethod = this._ctx.widthMethod;
|
|
29444
|
-
this.frameBuffer =
|
|
29586
|
+
this.frameBuffer = BrowserBuffer2.create(w2, h2, widthMethod, { respectAlpha: true, id: `framebuffer-${this.id}` });
|
|
29445
29587
|
} catch (error) {
|
|
29446
29588
|
console.error(`Failed to create frame buffer for ${this.id}:`, error);
|
|
29447
29589
|
this.frameBuffer = null;
|
|
@@ -33099,9 +33241,8 @@ var DiffRenderable = class extends Renderable3 {
|
|
|
33099
33241
|
};
|
|
33100
33242
|
|
|
33101
33243
|
// ../web/src/shims/edit-buffer-stub.ts
|
|
33102
|
-
import { EventEmitter as EventEmitter4 } from "events";
|
|
33103
33244
|
var nextId = 1;
|
|
33104
|
-
var EditBuffer = class _EditBuffer extends
|
|
33245
|
+
var EditBuffer = class _EditBuffer extends EventEmitter {
|
|
33105
33246
|
id;
|
|
33106
33247
|
ptr = 0;
|
|
33107
33248
|
// dummy pointer
|
|
@@ -37182,7 +37323,7 @@ var FrameBufferRenderable = class extends Renderable3 {
|
|
|
37182
37323
|
constructor(ctx, options) {
|
|
37183
37324
|
super(ctx, options);
|
|
37184
37325
|
this.respectAlpha = options.respectAlpha || false;
|
|
37185
|
-
this.frameBuffer =
|
|
37326
|
+
this.frameBuffer = BrowserBuffer2.create(options.width, options.height, this._ctx.widthMethod, {
|
|
37186
37327
|
respectAlpha: this.respectAlpha,
|
|
37187
37328
|
id: options.id || `framebufferrenderable-${this.id}`
|
|
37188
37329
|
});
|
|
@@ -40371,302 +40512,6 @@ var MarkdownRenderable = class extends Renderable3 {
|
|
|
40371
40512
|
}
|
|
40372
40513
|
};
|
|
40373
40514
|
|
|
40374
|
-
// ../web/src/browser-render-context.ts
|
|
40375
|
-
import { EventEmitter as EventEmitter5 } from "events";
|
|
40376
|
-
|
|
40377
|
-
// ../../opentui/packages/core/src/zig-registry.ts
|
|
40378
|
-
var LogLevel2 = /* @__PURE__ */ ((LogLevel4) => {
|
|
40379
|
-
LogLevel4[LogLevel4["Error"] = 0] = "Error";
|
|
40380
|
-
LogLevel4[LogLevel4["Warn"] = 1] = "Warn";
|
|
40381
|
-
LogLevel4[LogLevel4["Info"] = 2] = "Info";
|
|
40382
|
-
LogLevel4[LogLevel4["Debug"] = 3] = "Debug";
|
|
40383
|
-
return LogLevel4;
|
|
40384
|
-
})(LogLevel2 || {});
|
|
40385
|
-
var _renderLib;
|
|
40386
|
-
function registerRenderLib(lib) {
|
|
40387
|
-
_renderLib = lib;
|
|
40388
|
-
}
|
|
40389
|
-
function resolveRenderLib() {
|
|
40390
|
-
if (!_renderLib) {
|
|
40391
|
-
throw new Error("No RenderLib registered. In Bun, import '@opentui/core' or '@opentui/core/native' (which loads zig.ts). In browsers, call registerRenderLib() with a browser implementation.");
|
|
40392
|
-
}
|
|
40393
|
-
return _renderLib;
|
|
40394
|
-
}
|
|
40395
|
-
function hasRenderLib() {
|
|
40396
|
-
return _renderLib !== void 0;
|
|
40397
|
-
}
|
|
40398
|
-
if (typeof globalThis.Bun !== "undefined") {
|
|
40399
|
-
const zigPath = "./zig";
|
|
40400
|
-
try {
|
|
40401
|
-
await import(zigPath);
|
|
40402
|
-
} catch {
|
|
40403
|
-
}
|
|
40404
|
-
}
|
|
40405
|
-
|
|
40406
|
-
// ../../opentui/packages/core/src/console.ts
|
|
40407
|
-
import { EventEmitter as EventEmitter7 } from "events";
|
|
40408
|
-
import { Console } from "node:console";
|
|
40409
|
-
import fs from "node:fs";
|
|
40410
|
-
import path2 from "node:path";
|
|
40411
|
-
import util2 from "node:util";
|
|
40412
|
-
|
|
40413
|
-
// ../../opentui/packages/core/src/lib/output.capture.ts
|
|
40414
|
-
import { Writable } from "stream";
|
|
40415
|
-
import { EventEmitter as EventEmitter6 } from "events";
|
|
40416
|
-
var Capture = class extends EventEmitter6 {
|
|
40417
|
-
// TODO: Cache could rather be a buffer to avoid join()?
|
|
40418
|
-
output = [];
|
|
40419
|
-
constructor() {
|
|
40420
|
-
super();
|
|
40421
|
-
}
|
|
40422
|
-
get size() {
|
|
40423
|
-
return this.output.length;
|
|
40424
|
-
}
|
|
40425
|
-
write(stream, data) {
|
|
40426
|
-
this.output.push({ stream, output: data });
|
|
40427
|
-
this.emit("write", stream, data);
|
|
40428
|
-
}
|
|
40429
|
-
claimOutput() {
|
|
40430
|
-
const output = this.output.map((o) => o.output).join("");
|
|
40431
|
-
this.clear();
|
|
40432
|
-
return output;
|
|
40433
|
-
}
|
|
40434
|
-
clear() {
|
|
40435
|
-
this.output = [];
|
|
40436
|
-
}
|
|
40437
|
-
};
|
|
40438
|
-
var CapturedWritableStream = class extends Writable {
|
|
40439
|
-
constructor(stream, capture2) {
|
|
40440
|
-
super();
|
|
40441
|
-
this.stream = stream;
|
|
40442
|
-
this.capture = capture2;
|
|
40443
|
-
}
|
|
40444
|
-
isTTY = true;
|
|
40445
|
-
columns = process.stdout.columns || 80;
|
|
40446
|
-
rows = process.stdout.rows || 24;
|
|
40447
|
-
_write(chunk, encoding, callback) {
|
|
40448
|
-
const data = chunk.toString();
|
|
40449
|
-
this.capture.write(this.stream, data);
|
|
40450
|
-
callback();
|
|
40451
|
-
}
|
|
40452
|
-
getColorDepth() {
|
|
40453
|
-
return process.stdout.getColorDepth?.() || 8;
|
|
40454
|
-
}
|
|
40455
|
-
};
|
|
40456
|
-
|
|
40457
|
-
// ../../opentui/packages/core/src/console.ts
|
|
40458
|
-
function getCallerInfo() {
|
|
40459
|
-
const err = new Error();
|
|
40460
|
-
const stackLines = err.stack?.split("\n").slice(5) || [];
|
|
40461
|
-
if (!stackLines.length) return null;
|
|
40462
|
-
const callerLine = stackLines[0].trim();
|
|
40463
|
-
const regex = /at\s+(?:([\w$.<>]+)\s+\()?((?:\/|[A-Za-z]:\\)[^:]+):(\d+):(\d+)\)?/;
|
|
40464
|
-
const match = callerLine.match(regex);
|
|
40465
|
-
if (!match) return null;
|
|
40466
|
-
const functionName = match[1] || "<anonymous>";
|
|
40467
|
-
const fullPath = match[2];
|
|
40468
|
-
const fileName = fullPath.split(/[\\/]/).pop() || "<unknown>";
|
|
40469
|
-
const lineNumber = parseInt(match[3], 10) || 0;
|
|
40470
|
-
const columnNumber = parseInt(match[4], 10) || 0;
|
|
40471
|
-
return { functionName, fullPath, fileName, lineNumber, columnNumber };
|
|
40472
|
-
}
|
|
40473
|
-
var capture = singleton("ConsoleCapture", () => new Capture());
|
|
40474
|
-
registerEnvVar({
|
|
40475
|
-
name: "OTUI_USE_CONSOLE",
|
|
40476
|
-
description: "Whether to use the console. Will not capture console output if set to false.",
|
|
40477
|
-
type: "boolean",
|
|
40478
|
-
default: true
|
|
40479
|
-
});
|
|
40480
|
-
registerEnvVar({
|
|
40481
|
-
name: "SHOW_CONSOLE",
|
|
40482
|
-
description: "Show the console at startup if set to true.",
|
|
40483
|
-
type: "boolean",
|
|
40484
|
-
default: false
|
|
40485
|
-
});
|
|
40486
|
-
var TerminalConsoleCache = class extends EventEmitter7 {
|
|
40487
|
-
_cachedLogs = [];
|
|
40488
|
-
MAX_CACHE_SIZE = 1e3;
|
|
40489
|
-
_collectCallerInfo = false;
|
|
40490
|
-
_cachingEnabled = true;
|
|
40491
|
-
_originalConsole = null;
|
|
40492
|
-
get cachedLogs() {
|
|
40493
|
-
return this._cachedLogs;
|
|
40494
|
-
}
|
|
40495
|
-
constructor() {
|
|
40496
|
-
super();
|
|
40497
|
-
}
|
|
40498
|
-
activate() {
|
|
40499
|
-
if (!this._originalConsole) {
|
|
40500
|
-
this._originalConsole = global.console;
|
|
40501
|
-
}
|
|
40502
|
-
this.setupConsoleCapture();
|
|
40503
|
-
this.overrideConsoleMethods();
|
|
40504
|
-
}
|
|
40505
|
-
setupConsoleCapture() {
|
|
40506
|
-
if (!env.OTUI_USE_CONSOLE) return;
|
|
40507
|
-
const mockStdout = new CapturedWritableStream("stdout", capture);
|
|
40508
|
-
const mockStderr = new CapturedWritableStream("stderr", capture);
|
|
40509
|
-
global.console = new Console({
|
|
40510
|
-
stdout: mockStdout,
|
|
40511
|
-
stderr: mockStderr,
|
|
40512
|
-
colorMode: true,
|
|
40513
|
-
inspectOptions: {
|
|
40514
|
-
compact: false,
|
|
40515
|
-
breakLength: 80,
|
|
40516
|
-
depth: 2
|
|
40517
|
-
}
|
|
40518
|
-
});
|
|
40519
|
-
}
|
|
40520
|
-
overrideConsoleMethods() {
|
|
40521
|
-
console.log = (...args) => {
|
|
40522
|
-
this.appendToConsole("LOG" /* LOG */, ...args);
|
|
40523
|
-
};
|
|
40524
|
-
console.info = (...args) => {
|
|
40525
|
-
this.appendToConsole("INFO" /* INFO */, ...args);
|
|
40526
|
-
};
|
|
40527
|
-
console.warn = (...args) => {
|
|
40528
|
-
this.appendToConsole("WARN" /* WARN */, ...args);
|
|
40529
|
-
};
|
|
40530
|
-
console.error = (...args) => {
|
|
40531
|
-
this.appendToConsole("ERROR" /* ERROR */, ...args);
|
|
40532
|
-
};
|
|
40533
|
-
console.debug = (...args) => {
|
|
40534
|
-
this.appendToConsole("DEBUG" /* DEBUG */, ...args);
|
|
40535
|
-
};
|
|
40536
|
-
}
|
|
40537
|
-
setCollectCallerInfo(enabled) {
|
|
40538
|
-
this._collectCallerInfo = enabled;
|
|
40539
|
-
}
|
|
40540
|
-
clearConsole() {
|
|
40541
|
-
this._cachedLogs = [];
|
|
40542
|
-
}
|
|
40543
|
-
setCachingEnabled(enabled) {
|
|
40544
|
-
this._cachingEnabled = enabled;
|
|
40545
|
-
}
|
|
40546
|
-
deactivate() {
|
|
40547
|
-
this.restoreOriginalConsole();
|
|
40548
|
-
}
|
|
40549
|
-
restoreOriginalConsole() {
|
|
40550
|
-
if (this._originalConsole) {
|
|
40551
|
-
global.console = this._originalConsole;
|
|
40552
|
-
}
|
|
40553
|
-
this.setupConsoleCapture();
|
|
40554
|
-
}
|
|
40555
|
-
addLogEntry(level, ...args) {
|
|
40556
|
-
const callerInfo = this._collectCallerInfo ? getCallerInfo() : null;
|
|
40557
|
-
const logEntry = [/* @__PURE__ */ new Date(), level, args, callerInfo];
|
|
40558
|
-
if (this._cachingEnabled) {
|
|
40559
|
-
if (this._cachedLogs.length >= this.MAX_CACHE_SIZE) {
|
|
40560
|
-
this._cachedLogs.shift();
|
|
40561
|
-
}
|
|
40562
|
-
this._cachedLogs.push(logEntry);
|
|
40563
|
-
}
|
|
40564
|
-
return logEntry;
|
|
40565
|
-
}
|
|
40566
|
-
appendToConsole(level, ...args) {
|
|
40567
|
-
if (this._cachedLogs.length >= this.MAX_CACHE_SIZE) {
|
|
40568
|
-
this._cachedLogs.shift();
|
|
40569
|
-
}
|
|
40570
|
-
const entry = this.addLogEntry(level, ...args);
|
|
40571
|
-
this.emit("entry", entry);
|
|
40572
|
-
}
|
|
40573
|
-
destroy() {
|
|
40574
|
-
this.deactivate();
|
|
40575
|
-
}
|
|
40576
|
-
};
|
|
40577
|
-
var terminalConsoleCache = singleton("TerminalConsoleCache", () => {
|
|
40578
|
-
const terminalConsoleCache2 = new TerminalConsoleCache();
|
|
40579
|
-
process.on("exit", () => {
|
|
40580
|
-
terminalConsoleCache2.destroy();
|
|
40581
|
-
});
|
|
40582
|
-
return terminalConsoleCache2;
|
|
40583
|
-
});
|
|
40584
|
-
var DEFAULT_CONSOLE_OPTIONS = {
|
|
40585
|
-
position: "bottom" /* BOTTOM */,
|
|
40586
|
-
sizePercent: 30,
|
|
40587
|
-
zIndex: Infinity,
|
|
40588
|
-
colorInfo: "#00FFFF",
|
|
40589
|
-
// Cyan
|
|
40590
|
-
colorWarn: "#FFFF00",
|
|
40591
|
-
// Yellow
|
|
40592
|
-
colorError: "#FF0000",
|
|
40593
|
-
// Red
|
|
40594
|
-
colorDebug: "#808080",
|
|
40595
|
-
// Gray
|
|
40596
|
-
colorDefault: "#FFFFFF",
|
|
40597
|
-
// White
|
|
40598
|
-
backgroundColor: RGBA.fromValues(0.1, 0.1, 0.1, 0.7),
|
|
40599
|
-
startInDebugMode: false,
|
|
40600
|
-
title: "Console",
|
|
40601
|
-
titleBarColor: RGBA.fromValues(0.05, 0.05, 0.05, 0.7),
|
|
40602
|
-
titleBarTextColor: "#FFFFFF",
|
|
40603
|
-
cursorColor: "#00A0FF",
|
|
40604
|
-
maxStoredLogs: 2e3,
|
|
40605
|
-
maxDisplayLines: 3e3,
|
|
40606
|
-
onCopySelection: void 0,
|
|
40607
|
-
keyBindings: void 0,
|
|
40608
|
-
keyAliasMap: void 0,
|
|
40609
|
-
selectionColor: RGBA.fromValues(0.3, 0.5, 0.8, 0.5),
|
|
40610
|
-
copyButtonColor: "#00A0FF"
|
|
40611
|
-
};
|
|
40612
|
-
|
|
40613
|
-
// ../../opentui/packages/core/src/renderer.ts
|
|
40614
|
-
import { EventEmitter as EventEmitter8 } from "events";
|
|
40615
|
-
registerEnvVar({
|
|
40616
|
-
name: "OTUI_DUMP_CAPTURES",
|
|
40617
|
-
description: "Dump captured output when the renderer exits.",
|
|
40618
|
-
type: "boolean",
|
|
40619
|
-
default: false
|
|
40620
|
-
});
|
|
40621
|
-
registerEnvVar({
|
|
40622
|
-
name: "OTUI_NO_NATIVE_RENDER",
|
|
40623
|
-
description: "Disable native rendering. This will not actually output ansi and is useful for debugging.",
|
|
40624
|
-
type: "boolean",
|
|
40625
|
-
default: false
|
|
40626
|
-
});
|
|
40627
|
-
registerEnvVar({
|
|
40628
|
-
name: "OTUI_USE_ALTERNATE_SCREEN",
|
|
40629
|
-
description: "Whether to use the console. Will not capture console output if set to false.",
|
|
40630
|
-
type: "boolean",
|
|
40631
|
-
default: true
|
|
40632
|
-
});
|
|
40633
|
-
registerEnvVar({
|
|
40634
|
-
name: "OTUI_OVERRIDE_STDOUT",
|
|
40635
|
-
description: "Override the stdout stream. This is useful for debugging.",
|
|
40636
|
-
type: "boolean",
|
|
40637
|
-
default: true
|
|
40638
|
-
});
|
|
40639
|
-
registerEnvVar({
|
|
40640
|
-
name: "OTUI_DEBUG",
|
|
40641
|
-
description: "Enable debug mode to capture all raw input for debugging purposes.",
|
|
40642
|
-
type: "boolean",
|
|
40643
|
-
default: false
|
|
40644
|
-
});
|
|
40645
|
-
registerEnvVar({
|
|
40646
|
-
name: "OTUI_SHOW_STATS",
|
|
40647
|
-
description: "Show the debug overlay at startup.",
|
|
40648
|
-
type: "boolean",
|
|
40649
|
-
default: false
|
|
40650
|
-
});
|
|
40651
|
-
var rendererTracker = singleton("RendererTracker", () => {
|
|
40652
|
-
const renderers = /* @__PURE__ */ new Set();
|
|
40653
|
-
return {
|
|
40654
|
-
addRenderer: (renderer) => {
|
|
40655
|
-
renderers.add(renderer);
|
|
40656
|
-
},
|
|
40657
|
-
removeRenderer: (renderer) => {
|
|
40658
|
-
renderers.delete(renderer);
|
|
40659
|
-
if (renderers.size === 0) {
|
|
40660
|
-
process.stdin.pause();
|
|
40661
|
-
if (hasSingleton("tree-sitter-client")) {
|
|
40662
|
-
getTreeSitterClient().destroy();
|
|
40663
|
-
destroySingleton("tree-sitter-client");
|
|
40664
|
-
}
|
|
40665
|
-
}
|
|
40666
|
-
}
|
|
40667
|
-
};
|
|
40668
|
-
});
|
|
40669
|
-
|
|
40670
40515
|
// ../web/src/shims/timeline-stub.ts
|
|
40671
40516
|
var Timeline = class {
|
|
40672
40517
|
isPlaying = false;
|
|
@@ -42035,7 +41880,7 @@ var Justify2 = /* @__PURE__ */ (function(Justify3) {
|
|
|
42035
41880
|
Justify3[Justify3["SpaceEvenly"] = 5] = "SpaceEvenly";
|
|
42036
41881
|
return Justify3;
|
|
42037
41882
|
})({});
|
|
42038
|
-
var
|
|
41883
|
+
var LogLevel2 = /* @__PURE__ */ (function(LogLevel4) {
|
|
42039
41884
|
LogLevel4[LogLevel4["Error"] = 0] = "Error";
|
|
42040
41885
|
LogLevel4[LogLevel4["Warn"] = 1] = "Warn";
|
|
42041
41886
|
LogLevel4[LogLevel4["Info"] = 2] = "Info";
|
|
@@ -42129,12 +41974,12 @@ var constants2 = {
|
|
|
42129
41974
|
JUSTIFY_SPACE_BETWEEN: Justify2.SpaceBetween,
|
|
42130
41975
|
JUSTIFY_SPACE_AROUND: Justify2.SpaceAround,
|
|
42131
41976
|
JUSTIFY_SPACE_EVENLY: Justify2.SpaceEvenly,
|
|
42132
|
-
LOG_LEVEL_ERROR:
|
|
42133
|
-
LOG_LEVEL_WARN:
|
|
42134
|
-
LOG_LEVEL_INFO:
|
|
42135
|
-
LOG_LEVEL_DEBUG:
|
|
42136
|
-
LOG_LEVEL_VERBOSE:
|
|
42137
|
-
LOG_LEVEL_FATAL:
|
|
41977
|
+
LOG_LEVEL_ERROR: LogLevel2.Error,
|
|
41978
|
+
LOG_LEVEL_WARN: LogLevel2.Warn,
|
|
41979
|
+
LOG_LEVEL_INFO: LogLevel2.Info,
|
|
41980
|
+
LOG_LEVEL_DEBUG: LogLevel2.Debug,
|
|
41981
|
+
LOG_LEVEL_VERBOSE: LogLevel2.Verbose,
|
|
41982
|
+
LOG_LEVEL_FATAL: LogLevel2.Fatal,
|
|
42138
41983
|
MEASURE_MODE_UNDEFINED: MeasureMode3.Undefined,
|
|
42139
41984
|
MEASURE_MODE_EXACTLY: MeasureMode3.Exactly,
|
|
42140
41985
|
MEASURE_MODE_AT_MOST: MeasureMode3.AtMost,
|
|
@@ -42280,7 +42125,7 @@ function attributesWithLink2(baseAttributes, linkId) {
|
|
|
42280
42125
|
|
|
42281
42126
|
// ../web/src/browser-buffer.ts
|
|
42282
42127
|
var CONTINUATION = 3221225472;
|
|
42283
|
-
var
|
|
42128
|
+
var BrowserBuffer2 = class _BrowserBuffer {
|
|
42284
42129
|
id;
|
|
42285
42130
|
respectAlpha;
|
|
42286
42131
|
_width;
|
|
@@ -42904,6 +42749,35 @@ var VRenderable = class extends Renderable3 {
|
|
|
42904
42749
|
}
|
|
42905
42750
|
};
|
|
42906
42751
|
|
|
42752
|
+
// ../../opentui/packages/core/src/zig-registry.ts
|
|
42753
|
+
var LogLevel3 = /* @__PURE__ */ ((LogLevel4) => {
|
|
42754
|
+
LogLevel4[LogLevel4["Error"] = 0] = "Error";
|
|
42755
|
+
LogLevel4[LogLevel4["Warn"] = 1] = "Warn";
|
|
42756
|
+
LogLevel4[LogLevel4["Info"] = 2] = "Info";
|
|
42757
|
+
LogLevel4[LogLevel4["Debug"] = 3] = "Debug";
|
|
42758
|
+
return LogLevel4;
|
|
42759
|
+
})(LogLevel3 || {});
|
|
42760
|
+
var _renderLib;
|
|
42761
|
+
function registerRenderLib(lib) {
|
|
42762
|
+
_renderLib = lib;
|
|
42763
|
+
}
|
|
42764
|
+
function resolveRenderLib() {
|
|
42765
|
+
if (!_renderLib) {
|
|
42766
|
+
throw new Error("No RenderLib registered. In Bun, import '@opentui/core' or '@opentui/core/native' (which loads zig.ts). In browsers, call registerRenderLib() with a browser implementation.");
|
|
42767
|
+
}
|
|
42768
|
+
return _renderLib;
|
|
42769
|
+
}
|
|
42770
|
+
function hasRenderLib() {
|
|
42771
|
+
return _renderLib !== void 0;
|
|
42772
|
+
}
|
|
42773
|
+
if (typeof globalThis.Bun !== "undefined") {
|
|
42774
|
+
const zigPath = "./zig";
|
|
42775
|
+
try {
|
|
42776
|
+
await import(zigPath);
|
|
42777
|
+
} catch {
|
|
42778
|
+
}
|
|
42779
|
+
}
|
|
42780
|
+
|
|
42907
42781
|
// ../../opentui/packages/react/src/components/text.ts
|
|
42908
42782
|
var textNodeKeys = ["span", "b", "strong", "i", "em", "u", "br", "a"];
|
|
42909
42783
|
var SpanRenderable = class extends TextNodeRenderable {
|
|
@@ -43267,7 +43141,7 @@ function setProperty(instance, type, propKey, propValue, oldPropValue) {
|
|
|
43267
43141
|
}
|
|
43268
43142
|
break;
|
|
43269
43143
|
case "focused":
|
|
43270
|
-
if (
|
|
43144
|
+
if (isRenderable(instance)) {
|
|
43271
43145
|
if (!!propValue) {
|
|
43272
43146
|
instance.focus();
|
|
43273
43147
|
} else {
|
|
@@ -43595,7 +43469,7 @@ export {
|
|
|
43595
43469
|
BorderChars,
|
|
43596
43470
|
Box,
|
|
43597
43471
|
BoxRenderable,
|
|
43598
|
-
BrowserBuffer,
|
|
43472
|
+
BrowserBuffer2 as BrowserBuffer,
|
|
43599
43473
|
Code,
|
|
43600
43474
|
CodeRenderable,
|
|
43601
43475
|
DataPathsManager,
|
|
@@ -43617,11 +43491,11 @@ export {
|
|
|
43617
43491
|
LayoutEvents,
|
|
43618
43492
|
LineNumberRenderable,
|
|
43619
43493
|
LinearScrollAccel,
|
|
43620
|
-
|
|
43494
|
+
LogLevel3 as LogLevel,
|
|
43621
43495
|
MacOSScrollAccel,
|
|
43622
43496
|
MarkdownRenderable,
|
|
43623
43497
|
MouseParser,
|
|
43624
|
-
|
|
43498
|
+
BrowserBuffer2 as OptimizedBuffer,
|
|
43625
43499
|
PasteEvent,
|
|
43626
43500
|
RGBA,
|
|
43627
43501
|
Renderable3 as Renderable,
|
|
@@ -43726,7 +43600,7 @@ export {
|
|
|
43726
43600
|
hexToRgb,
|
|
43727
43601
|
hsvToRgb,
|
|
43728
43602
|
instantiate,
|
|
43729
|
-
|
|
43603
|
+
isRenderable,
|
|
43730
43604
|
isStyledText,
|
|
43731
43605
|
isTextNodeRenderable,
|
|
43732
43606
|
isVNode,
|
|
@@ -43734,7 +43608,7 @@ export {
|
|
|
43734
43608
|
italic,
|
|
43735
43609
|
link,
|
|
43736
43610
|
magenta,
|
|
43737
|
-
|
|
43611
|
+
maybeMakeRenderable,
|
|
43738
43612
|
measureText,
|
|
43739
43613
|
nonAlphanumericKeys,
|
|
43740
43614
|
parseAlign,
|