@gridland/core 0.2.30 → 0.2.31
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 +255 -104
- 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
|
+
});
|
|
25908
25981
|
}
|
|
25982
|
+
function isDeepStrictEqual(a, b2) {
|
|
25983
|
+
return JSON.stringify(a) === JSON.stringify(b2);
|
|
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;
|
|
@@ -27561,10 +27663,56 @@ function resolveFiletype(_filename) {
|
|
|
27561
27663
|
return null;
|
|
27562
27664
|
}
|
|
27563
27665
|
|
|
27564
|
-
//
|
|
27565
|
-
|
|
27566
|
-
|
|
27567
|
-
|
|
27666
|
+
// ../web/src/shims/node-os.ts
|
|
27667
|
+
function homedir() {
|
|
27668
|
+
return "/home/user";
|
|
27669
|
+
}
|
|
27670
|
+
function tmpdir() {
|
|
27671
|
+
return "/tmp";
|
|
27672
|
+
}
|
|
27673
|
+
function platform() {
|
|
27674
|
+
return "browser";
|
|
27675
|
+
}
|
|
27676
|
+
function arch() {
|
|
27677
|
+
return "wasm";
|
|
27678
|
+
}
|
|
27679
|
+
var node_os_default = { homedir, tmpdir, platform, arch };
|
|
27680
|
+
|
|
27681
|
+
// ../web/src/shims/node-path.ts
|
|
27682
|
+
function join(...parts) {
|
|
27683
|
+
return parts.join("/").replace(/\/+/g, "/");
|
|
27684
|
+
}
|
|
27685
|
+
function resolve(...parts) {
|
|
27686
|
+
return join(...parts);
|
|
27687
|
+
}
|
|
27688
|
+
function dirname(p) {
|
|
27689
|
+
return p.split("/").slice(0, -1).join("/") || "/";
|
|
27690
|
+
}
|
|
27691
|
+
function basename(p, ext) {
|
|
27692
|
+
const base = p.split("/").pop() || "";
|
|
27693
|
+
if (ext && base.endsWith(ext)) return base.slice(0, -ext.length);
|
|
27694
|
+
return base;
|
|
27695
|
+
}
|
|
27696
|
+
function extname(p) {
|
|
27697
|
+
const base = basename(p);
|
|
27698
|
+
const idx = base.lastIndexOf(".");
|
|
27699
|
+
return idx >= 0 ? base.slice(idx) : "";
|
|
27700
|
+
}
|
|
27701
|
+
function parse(p) {
|
|
27702
|
+
const dir = dirname(p);
|
|
27703
|
+
const base = basename(p);
|
|
27704
|
+
const ext = extname(p);
|
|
27705
|
+
const name = ext ? base.slice(0, -ext.length) : base;
|
|
27706
|
+
return { root: p.startsWith("/") ? "/" : "", dir, base, ext, name };
|
|
27707
|
+
}
|
|
27708
|
+
function isAbsolute(p) {
|
|
27709
|
+
return p.startsWith("/");
|
|
27710
|
+
}
|
|
27711
|
+
function relative(from, to) {
|
|
27712
|
+
return to.replace(from, "").replace(/^\//, "");
|
|
27713
|
+
}
|
|
27714
|
+
var sep = "/";
|
|
27715
|
+
var node_path_default = { join, resolve, dirname, basename, extname, parse, isAbsolute, relative, sep };
|
|
27568
27716
|
|
|
27569
27717
|
// ../../opentui/packages/core/src/lib/validate-dir-name.ts
|
|
27570
27718
|
function isValidDirectoryName(name) {
|
|
@@ -27627,7 +27775,7 @@ registerEnvVar({
|
|
|
27627
27775
|
type: "string",
|
|
27628
27776
|
default: ""
|
|
27629
27777
|
});
|
|
27630
|
-
var DataPathsManager = class extends
|
|
27778
|
+
var DataPathsManager = class extends EventEmitter {
|
|
27631
27779
|
_appName;
|
|
27632
27780
|
_globalConfigPath;
|
|
27633
27781
|
_globalConfigFile;
|
|
@@ -27655,31 +27803,31 @@ var DataPathsManager = class extends EventEmitter3 {
|
|
|
27655
27803
|
}
|
|
27656
27804
|
get globalConfigPath() {
|
|
27657
27805
|
if (this._globalConfigPath === void 0) {
|
|
27658
|
-
const homeDir =
|
|
27806
|
+
const homeDir = node_os_default.homedir();
|
|
27659
27807
|
const xdgConfigHome = env.XDG_CONFIG_HOME;
|
|
27660
|
-
const baseConfigDir = xdgConfigHome ||
|
|
27661
|
-
this._globalConfigPath =
|
|
27808
|
+
const baseConfigDir = xdgConfigHome || node_path_default.join(homeDir, ".config");
|
|
27809
|
+
this._globalConfigPath = node_path_default.join(baseConfigDir, this._appName);
|
|
27662
27810
|
}
|
|
27663
27811
|
return this._globalConfigPath;
|
|
27664
27812
|
}
|
|
27665
27813
|
get globalConfigFile() {
|
|
27666
27814
|
if (this._globalConfigFile === void 0) {
|
|
27667
|
-
this._globalConfigFile =
|
|
27815
|
+
this._globalConfigFile = node_path_default.join(this.globalConfigPath, "init.ts");
|
|
27668
27816
|
}
|
|
27669
27817
|
return this._globalConfigFile;
|
|
27670
27818
|
}
|
|
27671
27819
|
get localConfigFile() {
|
|
27672
27820
|
if (this._localConfigFile === void 0) {
|
|
27673
|
-
this._localConfigFile =
|
|
27821
|
+
this._localConfigFile = node_path_default.join(process.cwd(), `.${this._appName}.ts`);
|
|
27674
27822
|
}
|
|
27675
27823
|
return this._localConfigFile;
|
|
27676
27824
|
}
|
|
27677
27825
|
get globalDataPath() {
|
|
27678
27826
|
if (this._globalDataPath === void 0) {
|
|
27679
|
-
const homeDir =
|
|
27827
|
+
const homeDir = node_os_default.homedir();
|
|
27680
27828
|
const xdgDataHome = env.XDG_DATA_HOME;
|
|
27681
|
-
const baseDataDir = xdgDataHome ||
|
|
27682
|
-
this._globalDataPath =
|
|
27829
|
+
const baseDataDir = xdgDataHome || node_path_default.join(homeDir, ".local/share");
|
|
27830
|
+
this._globalDataPath = node_path_default.join(baseDataDir, this._appName);
|
|
27683
27831
|
}
|
|
27684
27832
|
return this._globalDataPath;
|
|
27685
27833
|
}
|
|
@@ -28436,19 +28584,19 @@ var TerminalPalette = class {
|
|
|
28436
28584
|
const out = this.stdout;
|
|
28437
28585
|
const inp = this.stdin;
|
|
28438
28586
|
if (!out.isTTY || !inp.isTTY) return false;
|
|
28439
|
-
return new Promise((
|
|
28587
|
+
return new Promise((resolve2) => {
|
|
28440
28588
|
let buffer = "";
|
|
28441
28589
|
const onData = (chunk) => {
|
|
28442
28590
|
buffer += chunk.toString();
|
|
28443
28591
|
OSC4_RESPONSE.lastIndex = 0;
|
|
28444
28592
|
if (OSC4_RESPONSE.test(buffer)) {
|
|
28445
28593
|
cleanup();
|
|
28446
|
-
|
|
28594
|
+
resolve2(true);
|
|
28447
28595
|
}
|
|
28448
28596
|
};
|
|
28449
28597
|
const onTimeout = () => {
|
|
28450
28598
|
cleanup();
|
|
28451
|
-
|
|
28599
|
+
resolve2(false);
|
|
28452
28600
|
};
|
|
28453
28601
|
const cleanup = () => {
|
|
28454
28602
|
clearTimeout(timer);
|
|
@@ -28473,7 +28621,7 @@ var TerminalPalette = class {
|
|
|
28473
28621
|
if (!out.isTTY || !inp.isTTY) {
|
|
28474
28622
|
return results;
|
|
28475
28623
|
}
|
|
28476
|
-
return new Promise((
|
|
28624
|
+
return new Promise((resolve2) => {
|
|
28477
28625
|
let buffer = "";
|
|
28478
28626
|
let lastResponseTime = Date.now();
|
|
28479
28627
|
let idleTimer = null;
|
|
@@ -28490,19 +28638,19 @@ var TerminalPalette = class {
|
|
|
28490
28638
|
const done = [...results.values()].filter((v2) => v2 !== null).length;
|
|
28491
28639
|
if (done === results.size) {
|
|
28492
28640
|
cleanup();
|
|
28493
|
-
|
|
28641
|
+
resolve2(results);
|
|
28494
28642
|
return;
|
|
28495
28643
|
}
|
|
28496
28644
|
if (idleTimer) clearTimeout(idleTimer);
|
|
28497
28645
|
idleTimer = setTimeout(() => {
|
|
28498
28646
|
cleanup();
|
|
28499
|
-
|
|
28647
|
+
resolve2(results);
|
|
28500
28648
|
}, 150);
|
|
28501
28649
|
if (idleTimer) this.activeTimers.push(idleTimer);
|
|
28502
28650
|
};
|
|
28503
28651
|
const onTimeout = () => {
|
|
28504
28652
|
cleanup();
|
|
28505
|
-
|
|
28653
|
+
resolve2(results);
|
|
28506
28654
|
};
|
|
28507
28655
|
const cleanup = () => {
|
|
28508
28656
|
clearTimeout(timer);
|
|
@@ -28541,7 +28689,7 @@ var TerminalPalette = class {
|
|
|
28541
28689
|
if (!out.isTTY || !inp.isTTY) {
|
|
28542
28690
|
return results;
|
|
28543
28691
|
}
|
|
28544
|
-
return new Promise((
|
|
28692
|
+
return new Promise((resolve2) => {
|
|
28545
28693
|
let buffer = "";
|
|
28546
28694
|
let idleTimer = null;
|
|
28547
28695
|
const onData = (chunk) => {
|
|
@@ -28560,20 +28708,20 @@ var TerminalPalette = class {
|
|
|
28560
28708
|
const done = Object.values(results).filter((v2) => v2 !== null).length;
|
|
28561
28709
|
if (done === Object.keys(results).length) {
|
|
28562
28710
|
cleanup();
|
|
28563
|
-
|
|
28711
|
+
resolve2(results);
|
|
28564
28712
|
return;
|
|
28565
28713
|
}
|
|
28566
28714
|
if (!updated) return;
|
|
28567
28715
|
if (idleTimer) clearTimeout(idleTimer);
|
|
28568
28716
|
idleTimer = setTimeout(() => {
|
|
28569
28717
|
cleanup();
|
|
28570
|
-
|
|
28718
|
+
resolve2(results);
|
|
28571
28719
|
}, 150);
|
|
28572
28720
|
if (idleTimer) this.activeTimers.push(idleTimer);
|
|
28573
28721
|
};
|
|
28574
28722
|
const onTimeout = () => {
|
|
28575
28723
|
cleanup();
|
|
28576
|
-
|
|
28724
|
+
resolve2(results);
|
|
28577
28725
|
};
|
|
28578
28726
|
const cleanup = () => {
|
|
28579
28727
|
clearTimeout(timer);
|
|
@@ -28685,6 +28833,7 @@ function detectLinks(chunks, context) {
|
|
|
28685
28833
|
}
|
|
28686
28834
|
|
|
28687
28835
|
// ../../opentui/packages/core/src/Renderable.ts
|
|
28836
|
+
var BrandedRenderable = /* @__PURE__ */ Symbol.for("@opentui/core/Renderable");
|
|
28688
28837
|
var LayoutEvents = /* @__PURE__ */ ((LayoutEvents2) => {
|
|
28689
28838
|
LayoutEvents2["LAYOUT_CHANGED"] = "layout-changed";
|
|
28690
28839
|
LayoutEvents2["ADDED"] = "added";
|
|
@@ -28697,7 +28846,10 @@ var RenderableEvents = /* @__PURE__ */ ((RenderableEvents2) => {
|
|
|
28697
28846
|
RenderableEvents2["BLURRED"] = "blurred";
|
|
28698
28847
|
return RenderableEvents2;
|
|
28699
28848
|
})(RenderableEvents || {});
|
|
28700
|
-
|
|
28849
|
+
function isRenderable(obj) {
|
|
28850
|
+
return !!obj?.[BrandedRenderable];
|
|
28851
|
+
}
|
|
28852
|
+
var BaseRenderable = class _BaseRenderable extends EventEmitter {
|
|
28701
28853
|
[BrandedRenderable] = true;
|
|
28702
28854
|
static renderableNumber = 1;
|
|
28703
28855
|
_id;
|
|
@@ -29441,7 +29593,7 @@ var Renderable3 = class _Renderable extends BaseRenderable {
|
|
|
29441
29593
|
}
|
|
29442
29594
|
try {
|
|
29443
29595
|
const widthMethod = this._ctx.widthMethod;
|
|
29444
|
-
this.frameBuffer =
|
|
29596
|
+
this.frameBuffer = BrowserBuffer2.create(w2, h2, widthMethod, { respectAlpha: true, id: `framebuffer-${this.id}` });
|
|
29445
29597
|
} catch (error) {
|
|
29446
29598
|
console.error(`Failed to create frame buffer for ${this.id}:`, error);
|
|
29447
29599
|
this.frameBuffer = null;
|
|
@@ -33099,9 +33251,8 @@ var DiffRenderable = class extends Renderable3 {
|
|
|
33099
33251
|
};
|
|
33100
33252
|
|
|
33101
33253
|
// ../web/src/shims/edit-buffer-stub.ts
|
|
33102
|
-
import { EventEmitter as EventEmitter4 } from "events";
|
|
33103
33254
|
var nextId = 1;
|
|
33104
|
-
var EditBuffer = class _EditBuffer extends
|
|
33255
|
+
var EditBuffer = class _EditBuffer extends EventEmitter {
|
|
33105
33256
|
id;
|
|
33106
33257
|
ptr = 0;
|
|
33107
33258
|
// dummy pointer
|
|
@@ -37182,7 +37333,7 @@ var FrameBufferRenderable = class extends Renderable3 {
|
|
|
37182
37333
|
constructor(ctx, options) {
|
|
37183
37334
|
super(ctx, options);
|
|
37184
37335
|
this.respectAlpha = options.respectAlpha || false;
|
|
37185
|
-
this.frameBuffer =
|
|
37336
|
+
this.frameBuffer = BrowserBuffer2.create(options.width, options.height, this._ctx.widthMethod, {
|
|
37186
37337
|
respectAlpha: this.respectAlpha,
|
|
37187
37338
|
id: options.id || `framebufferrenderable-${this.id}`
|
|
37188
37339
|
});
|
|
@@ -40371,9 +40522,6 @@ var MarkdownRenderable = class extends Renderable3 {
|
|
|
40371
40522
|
}
|
|
40372
40523
|
};
|
|
40373
40524
|
|
|
40374
|
-
// ../web/src/browser-render-context.ts
|
|
40375
|
-
import { EventEmitter as EventEmitter5 } from "events";
|
|
40376
|
-
|
|
40377
40525
|
// ../../opentui/packages/core/src/zig-registry.ts
|
|
40378
40526
|
var LogLevel2 = /* @__PURE__ */ ((LogLevel4) => {
|
|
40379
40527
|
LogLevel4[LogLevel4["Error"] = 0] = "Error";
|
|
@@ -40403,17 +40551,21 @@ if (typeof globalThis.Bun !== "undefined") {
|
|
|
40403
40551
|
}
|
|
40404
40552
|
}
|
|
40405
40553
|
|
|
40406
|
-
//
|
|
40407
|
-
|
|
40408
|
-
|
|
40409
|
-
|
|
40410
|
-
|
|
40411
|
-
|
|
40554
|
+
// ../web/src/shims/console.ts
|
|
40555
|
+
var Console = globalThis.console.constructor;
|
|
40556
|
+
var console_default = globalThis.console;
|
|
40557
|
+
|
|
40558
|
+
// ../web/src/shims/node-stream.ts
|
|
40559
|
+
var Writable = class {
|
|
40560
|
+
write(_chunk) {
|
|
40561
|
+
return true;
|
|
40562
|
+
}
|
|
40563
|
+
end() {
|
|
40564
|
+
}
|
|
40565
|
+
};
|
|
40412
40566
|
|
|
40413
40567
|
// ../../opentui/packages/core/src/lib/output.capture.ts
|
|
40414
|
-
|
|
40415
|
-
import { EventEmitter as EventEmitter6 } from "events";
|
|
40416
|
-
var Capture = class extends EventEmitter6 {
|
|
40568
|
+
var Capture = class extends EventEmitter {
|
|
40417
40569
|
// TODO: Cache could rather be a buffer to avoid join()?
|
|
40418
40570
|
output = [];
|
|
40419
40571
|
constructor() {
|
|
@@ -40483,7 +40635,7 @@ registerEnvVar({
|
|
|
40483
40635
|
type: "boolean",
|
|
40484
40636
|
default: false
|
|
40485
40637
|
});
|
|
40486
|
-
var TerminalConsoleCache = class extends
|
|
40638
|
+
var TerminalConsoleCache = class extends EventEmitter {
|
|
40487
40639
|
_cachedLogs = [];
|
|
40488
40640
|
MAX_CACHE_SIZE = 1e3;
|
|
40489
40641
|
_collectCallerInfo = false;
|
|
@@ -40611,7 +40763,6 @@ var DEFAULT_CONSOLE_OPTIONS = {
|
|
|
40611
40763
|
};
|
|
40612
40764
|
|
|
40613
40765
|
// ../../opentui/packages/core/src/renderer.ts
|
|
40614
|
-
import { EventEmitter as EventEmitter8 } from "events";
|
|
40615
40766
|
registerEnvVar({
|
|
40616
40767
|
name: "OTUI_DUMP_CAPTURES",
|
|
40617
40768
|
description: "Dump captured output when the renderer exits.",
|
|
@@ -42280,7 +42431,7 @@ function attributesWithLink2(baseAttributes, linkId) {
|
|
|
42280
42431
|
|
|
42281
42432
|
// ../web/src/browser-buffer.ts
|
|
42282
42433
|
var CONTINUATION = 3221225472;
|
|
42283
|
-
var
|
|
42434
|
+
var BrowserBuffer2 = class _BrowserBuffer {
|
|
42284
42435
|
id;
|
|
42285
42436
|
respectAlpha;
|
|
42286
42437
|
_width;
|
|
@@ -43267,7 +43418,7 @@ function setProperty(instance, type, propKey, propValue, oldPropValue) {
|
|
|
43267
43418
|
}
|
|
43268
43419
|
break;
|
|
43269
43420
|
case "focused":
|
|
43270
|
-
if (
|
|
43421
|
+
if (isRenderable(instance)) {
|
|
43271
43422
|
if (!!propValue) {
|
|
43272
43423
|
instance.focus();
|
|
43273
43424
|
} else {
|
|
@@ -43595,7 +43746,7 @@ export {
|
|
|
43595
43746
|
BorderChars,
|
|
43596
43747
|
Box,
|
|
43597
43748
|
BoxRenderable,
|
|
43598
|
-
BrowserBuffer,
|
|
43749
|
+
BrowserBuffer2 as BrowserBuffer,
|
|
43599
43750
|
Code,
|
|
43600
43751
|
CodeRenderable,
|
|
43601
43752
|
DataPathsManager,
|
|
@@ -43621,7 +43772,7 @@ export {
|
|
|
43621
43772
|
MacOSScrollAccel,
|
|
43622
43773
|
MarkdownRenderable,
|
|
43623
43774
|
MouseParser,
|
|
43624
|
-
|
|
43775
|
+
BrowserBuffer2 as OptimizedBuffer,
|
|
43625
43776
|
PasteEvent,
|
|
43626
43777
|
RGBA,
|
|
43627
43778
|
Renderable3 as Renderable,
|
|
@@ -43726,7 +43877,7 @@ export {
|
|
|
43726
43877
|
hexToRgb,
|
|
43727
43878
|
hsvToRgb,
|
|
43728
43879
|
instantiate,
|
|
43729
|
-
|
|
43880
|
+
isRenderable,
|
|
43730
43881
|
isStyledText,
|
|
43731
43882
|
isTextNodeRenderable,
|
|
43732
43883
|
isVNode,
|
|
@@ -43734,7 +43885,7 @@ export {
|
|
|
43734
43885
|
italic,
|
|
43735
43886
|
link,
|
|
43736
43887
|
magenta,
|
|
43737
|
-
|
|
43888
|
+
maybeMakeRenderable,
|
|
43738
43889
|
measureText,
|
|
43739
43890
|
nonAlphanumericKeys,
|
|
43740
43891
|
parseAlign,
|