@opentui/core 0.1.79 → 0.1.81
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/3d.js +1 -1
- package/NativeSpanFeed.d.ts +41 -0
- package/README.md +5 -2
- package/{index-zrvzvh6r.js → index-ve2seej0.js} +519 -209
- package/{index-zrvzvh6r.js.map → index-ve2seej0.js.map} +8 -8
- package/index.d.ts +1 -0
- package/index.js +367 -58
- package/index.js.map +10 -9
- package/lib/parse.mouse.d.ts +7 -0
- package/package.json +9 -9
- package/renderables/Diff.d.ts +7 -0
- package/renderables/LineNumberRenderable.d.ts +2 -0
- package/renderables/Textarea.d.ts +1 -1
- package/renderer.d.ts +6 -3
- package/testing.js +1 -1
- package/types.d.ts +7 -3
- package/zig-structs.d.ts +79 -0
- package/zig.d.ts +20 -2
|
@@ -6074,8 +6074,23 @@ function extractCompleteSequences(buffer) {
|
|
|
6074
6074
|
return { sequences, remainder: remaining };
|
|
6075
6075
|
}
|
|
6076
6076
|
} else {
|
|
6077
|
-
|
|
6078
|
-
|
|
6077
|
+
const code = remaining.charCodeAt(0);
|
|
6078
|
+
if (code >= 55296 && code <= 56319) {
|
|
6079
|
+
if (remaining.length === 1) {
|
|
6080
|
+
return { sequences, remainder: remaining };
|
|
6081
|
+
}
|
|
6082
|
+
const next = remaining.charCodeAt(1);
|
|
6083
|
+
if (next >= 56320 && next <= 57343) {
|
|
6084
|
+
sequences.push(remaining.slice(0, 2));
|
|
6085
|
+
pos += 2;
|
|
6086
|
+
} else {
|
|
6087
|
+
sequences.push(remaining[0]);
|
|
6088
|
+
pos++;
|
|
6089
|
+
}
|
|
6090
|
+
} else {
|
|
6091
|
+
sequences.push(remaining[0]);
|
|
6092
|
+
pos++;
|
|
6093
|
+
}
|
|
6079
6094
|
}
|
|
6080
6095
|
}
|
|
6081
6096
|
return { sequences, remainder: "" };
|
|
@@ -6499,95 +6514,168 @@ class MouseParser {
|
|
|
6499
6514
|
reset() {
|
|
6500
6515
|
this.mouseButtonsPressed.clear();
|
|
6501
6516
|
}
|
|
6517
|
+
decodeInput(data) {
|
|
6518
|
+
return data.toString();
|
|
6519
|
+
}
|
|
6502
6520
|
parseMouseEvent(data) {
|
|
6503
|
-
const str =
|
|
6504
|
-
const
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
const
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6521
|
+
const str = this.decodeInput(data);
|
|
6522
|
+
const parsed = this.parseMouseSequenceAt(str, 0);
|
|
6523
|
+
return parsed?.event ?? null;
|
|
6524
|
+
}
|
|
6525
|
+
parseAllMouseEvents(data) {
|
|
6526
|
+
const str = this.decodeInput(data);
|
|
6527
|
+
const events = [];
|
|
6528
|
+
let offset = 0;
|
|
6529
|
+
while (offset < str.length) {
|
|
6530
|
+
const parsed = this.parseMouseSequenceAt(str, offset);
|
|
6531
|
+
if (!parsed) {
|
|
6532
|
+
break;
|
|
6533
|
+
}
|
|
6534
|
+
events.push(parsed.event);
|
|
6535
|
+
offset += parsed.consumed;
|
|
6536
|
+
}
|
|
6537
|
+
return events;
|
|
6538
|
+
}
|
|
6539
|
+
parseMouseSequenceAt(str, offset) {
|
|
6540
|
+
if (!str.startsWith("\x1B[", offset))
|
|
6541
|
+
return null;
|
|
6542
|
+
const introducer = str[offset + 2];
|
|
6543
|
+
if (introducer === "<") {
|
|
6544
|
+
return this.parseSgrSequence(str, offset);
|
|
6545
|
+
}
|
|
6546
|
+
if (introducer === "M") {
|
|
6547
|
+
return this.parseBasicSequence(str, offset);
|
|
6548
|
+
}
|
|
6549
|
+
return null;
|
|
6550
|
+
}
|
|
6551
|
+
parseSgrSequence(str, offset) {
|
|
6552
|
+
let index = offset + 3;
|
|
6553
|
+
const values = [0, 0, 0];
|
|
6554
|
+
let part = 0;
|
|
6555
|
+
let hasDigit = false;
|
|
6556
|
+
while (index < str.length) {
|
|
6557
|
+
const char = str[index];
|
|
6558
|
+
const charCode = str.charCodeAt(index);
|
|
6559
|
+
if (charCode >= 48 && charCode <= 57) {
|
|
6560
|
+
hasDigit = true;
|
|
6561
|
+
values[part] = values[part] * 10 + (charCode - 48);
|
|
6562
|
+
index++;
|
|
6563
|
+
continue;
|
|
6564
|
+
}
|
|
6565
|
+
switch (char) {
|
|
6566
|
+
case ";": {
|
|
6567
|
+
if (!hasDigit || part >= 2)
|
|
6568
|
+
return null;
|
|
6569
|
+
part++;
|
|
6570
|
+
hasDigit = false;
|
|
6571
|
+
index++;
|
|
6572
|
+
break;
|
|
6533
6573
|
}
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6574
|
+
case "M":
|
|
6575
|
+
case "m": {
|
|
6576
|
+
if (!hasDigit || part !== 2)
|
|
6577
|
+
return null;
|
|
6578
|
+
return {
|
|
6579
|
+
event: this.decodeSgrEvent(values[0], values[1], values[2], char),
|
|
6580
|
+
consumed: index - offset + 1
|
|
6581
|
+
};
|
|
6540
6582
|
}
|
|
6583
|
+
default:
|
|
6584
|
+
return null;
|
|
6541
6585
|
}
|
|
6542
|
-
return {
|
|
6543
|
-
type,
|
|
6544
|
-
button: button === 3 ? 0 : button,
|
|
6545
|
-
x: parseInt(x) - 1,
|
|
6546
|
-
y: parseInt(y) - 1,
|
|
6547
|
-
modifiers,
|
|
6548
|
-
scroll: scrollInfo
|
|
6549
|
-
};
|
|
6550
6586
|
}
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6587
|
+
return null;
|
|
6588
|
+
}
|
|
6589
|
+
parseBasicSequence(str, offset) {
|
|
6590
|
+
if (offset + 6 > str.length)
|
|
6591
|
+
return null;
|
|
6592
|
+
const buttonByte = str.charCodeAt(offset + 3) - 32;
|
|
6593
|
+
const x = str.charCodeAt(offset + 4) - 33;
|
|
6594
|
+
const y = str.charCodeAt(offset + 5) - 33;
|
|
6595
|
+
return {
|
|
6596
|
+
event: this.decodeBasicEvent(buttonByte, x, y),
|
|
6597
|
+
consumed: 6
|
|
6598
|
+
};
|
|
6599
|
+
}
|
|
6600
|
+
decodeSgrEvent(rawButtonCode, wireX, wireY, pressRelease) {
|
|
6601
|
+
const button = rawButtonCode & 3;
|
|
6602
|
+
const isScroll = (rawButtonCode & 64) !== 0;
|
|
6603
|
+
const scrollDirection = !isScroll ? undefined : MouseParser.SCROLL_DIRECTIONS[button];
|
|
6604
|
+
const isMotion = (rawButtonCode & 32) !== 0;
|
|
6605
|
+
const modifiers = {
|
|
6606
|
+
shift: (rawButtonCode & 4) !== 0,
|
|
6607
|
+
alt: (rawButtonCode & 8) !== 0,
|
|
6608
|
+
ctrl: (rawButtonCode & 16) !== 0
|
|
6609
|
+
};
|
|
6610
|
+
let type;
|
|
6611
|
+
let scrollInfo;
|
|
6612
|
+
if (isScroll && pressRelease === "M") {
|
|
6613
|
+
type = "scroll";
|
|
6614
|
+
scrollInfo = {
|
|
6615
|
+
direction: scrollDirection,
|
|
6616
|
+
delta: 1
|
|
6563
6617
|
};
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
if (isScroll) {
|
|
6568
|
-
type = "scroll";
|
|
6569
|
-
actualButton = 0;
|
|
6570
|
-
scrollInfo = {
|
|
6571
|
-
direction: scrollDirection,
|
|
6572
|
-
delta: 1
|
|
6573
|
-
};
|
|
6574
|
-
} else if (isMotion) {
|
|
6618
|
+
} else if (isMotion) {
|
|
6619
|
+
const isDragging = this.mouseButtonsPressed.size > 0;
|
|
6620
|
+
if (button === 3) {
|
|
6575
6621
|
type = "move";
|
|
6576
|
-
|
|
6622
|
+
} else if (isDragging) {
|
|
6623
|
+
type = "drag";
|
|
6577
6624
|
} else {
|
|
6578
|
-
type =
|
|
6579
|
-
actualButton = button === 3 ? 0 : button;
|
|
6625
|
+
type = "move";
|
|
6580
6626
|
}
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6627
|
+
} else {
|
|
6628
|
+
type = pressRelease === "M" ? "down" : "up";
|
|
6629
|
+
if (type === "down" && button !== 3) {
|
|
6630
|
+
this.mouseButtonsPressed.add(button);
|
|
6631
|
+
} else if (type === "up") {
|
|
6632
|
+
this.mouseButtonsPressed.clear();
|
|
6633
|
+
}
|
|
6634
|
+
}
|
|
6635
|
+
return {
|
|
6636
|
+
type,
|
|
6637
|
+
button: button === 3 ? 0 : button,
|
|
6638
|
+
x: wireX - 1,
|
|
6639
|
+
y: wireY - 1,
|
|
6640
|
+
modifiers,
|
|
6641
|
+
scroll: scrollInfo
|
|
6642
|
+
};
|
|
6643
|
+
}
|
|
6644
|
+
decodeBasicEvent(buttonByte, x, y) {
|
|
6645
|
+
const button = buttonByte & 3;
|
|
6646
|
+
const isScroll = (buttonByte & 64) !== 0;
|
|
6647
|
+
const isMotion = (buttonByte & 32) !== 0;
|
|
6648
|
+
const scrollDirection = !isScroll ? undefined : MouseParser.SCROLL_DIRECTIONS[button];
|
|
6649
|
+
const modifiers = {
|
|
6650
|
+
shift: (buttonByte & 4) !== 0,
|
|
6651
|
+
alt: (buttonByte & 8) !== 0,
|
|
6652
|
+
ctrl: (buttonByte & 16) !== 0
|
|
6653
|
+
};
|
|
6654
|
+
let type;
|
|
6655
|
+
let actualButton;
|
|
6656
|
+
let scrollInfo;
|
|
6657
|
+
if (isScroll) {
|
|
6658
|
+
type = "scroll";
|
|
6659
|
+
actualButton = 0;
|
|
6660
|
+
scrollInfo = {
|
|
6661
|
+
direction: scrollDirection,
|
|
6662
|
+
delta: 1
|
|
6588
6663
|
};
|
|
6664
|
+
} else if (isMotion) {
|
|
6665
|
+
type = "move";
|
|
6666
|
+
actualButton = button === 3 ? -1 : button;
|
|
6667
|
+
} else {
|
|
6668
|
+
type = button === 3 ? "up" : "down";
|
|
6669
|
+
actualButton = button === 3 ? 0 : button;
|
|
6589
6670
|
}
|
|
6590
|
-
return
|
|
6671
|
+
return {
|
|
6672
|
+
type,
|
|
6673
|
+
button: actualButton,
|
|
6674
|
+
x,
|
|
6675
|
+
y,
|
|
6676
|
+
modifiers,
|
|
6677
|
+
scroll: scrollInfo
|
|
6678
|
+
};
|
|
6591
6679
|
}
|
|
6592
6680
|
}
|
|
6593
6681
|
|
|
@@ -10315,6 +10403,59 @@ var CursorStateStruct = defineStruct([
|
|
|
10315
10403
|
["b", "f32"],
|
|
10316
10404
|
["a", "f32"]
|
|
10317
10405
|
]);
|
|
10406
|
+
var CursorStyleOptionsStruct = defineStruct([
|
|
10407
|
+
["style", "u8", { default: 255 }],
|
|
10408
|
+
["blinking", "u8", { default: 255 }],
|
|
10409
|
+
[
|
|
10410
|
+
"color",
|
|
10411
|
+
"pointer",
|
|
10412
|
+
{
|
|
10413
|
+
optional: true,
|
|
10414
|
+
packTransform: rgbaPackTransform,
|
|
10415
|
+
unpackTransform: rgbaUnpackTransform
|
|
10416
|
+
}
|
|
10417
|
+
],
|
|
10418
|
+
["cursor", "u8", { default: 255 }]
|
|
10419
|
+
]);
|
|
10420
|
+
var GrowthPolicyEnum = defineEnum({ grow: 0, block: 1 }, "u8");
|
|
10421
|
+
var NativeSpanFeedOptionsStruct = defineStruct([
|
|
10422
|
+
["chunkSize", "u32", { default: 64 * 1024 }],
|
|
10423
|
+
["initialChunks", "u32", { default: 2 }],
|
|
10424
|
+
["maxBytes", "u64", { default: 0n }],
|
|
10425
|
+
["growthPolicy", GrowthPolicyEnum, { default: "grow" }],
|
|
10426
|
+
["autoCommitOnFull", "bool_u8", { default: true }],
|
|
10427
|
+
["spanQueueCapacity", "u32", { default: 0 }]
|
|
10428
|
+
]);
|
|
10429
|
+
var NativeSpanFeedStatsStruct = defineStruct([
|
|
10430
|
+
["bytesWritten", "u64"],
|
|
10431
|
+
["spansCommitted", "u64"],
|
|
10432
|
+
["chunks", "u32"],
|
|
10433
|
+
["pendingSpans", "u32"]
|
|
10434
|
+
]);
|
|
10435
|
+
var SpanInfoStruct = defineStruct([
|
|
10436
|
+
["chunkPtr", "pointer"],
|
|
10437
|
+
["offset", "u32"],
|
|
10438
|
+
["len", "u32"],
|
|
10439
|
+
["chunkIndex", "u32"],
|
|
10440
|
+
["reserved", "u32", { default: 0 }]
|
|
10441
|
+
], {
|
|
10442
|
+
reduceValue: (value) => ({
|
|
10443
|
+
chunkPtr: value.chunkPtr,
|
|
10444
|
+
offset: value.offset,
|
|
10445
|
+
len: value.len,
|
|
10446
|
+
chunkIndex: value.chunkIndex
|
|
10447
|
+
})
|
|
10448
|
+
});
|
|
10449
|
+
var ReserveInfoStruct = defineStruct([
|
|
10450
|
+
["ptr", "pointer"],
|
|
10451
|
+
["len", "u32"],
|
|
10452
|
+
["reserved", "u32", { default: 0 }]
|
|
10453
|
+
], {
|
|
10454
|
+
reduceValue: (value) => ({
|
|
10455
|
+
ptr: value.ptr,
|
|
10456
|
+
len: value.len
|
|
10457
|
+
})
|
|
10458
|
+
});
|
|
10318
10459
|
|
|
10319
10460
|
// src/zig.ts
|
|
10320
10461
|
var module = await import(`@opentui/core-${process.platform}-${process.arch}/index.ts`);
|
|
@@ -10361,9 +10502,24 @@ registerEnvVar({
|
|
|
10361
10502
|
type: "boolean",
|
|
10362
10503
|
default: false
|
|
10363
10504
|
});
|
|
10505
|
+
var CURSOR_STYLE_TO_ID = { block: 0, line: 1, underline: 2 };
|
|
10506
|
+
var CURSOR_ID_TO_STYLE = ["block", "line", "underline"];
|
|
10507
|
+
var MOUSE_STYLE_TO_ID = { default: 0, pointer: 1, text: 2, crosshair: 3, move: 4, "not-allowed": 5 };
|
|
10364
10508
|
var globalTraceSymbols = null;
|
|
10365
10509
|
var globalFFILogWriter = null;
|
|
10366
10510
|
var exitHandlerRegistered = false;
|
|
10511
|
+
function toPointer(value) {
|
|
10512
|
+
if (typeof value === "bigint") {
|
|
10513
|
+
if (value > BigInt(Number.MAX_SAFE_INTEGER)) {
|
|
10514
|
+
throw new Error("Pointer exceeds safe integer range");
|
|
10515
|
+
}
|
|
10516
|
+
return Number(value);
|
|
10517
|
+
}
|
|
10518
|
+
return value;
|
|
10519
|
+
}
|
|
10520
|
+
function toNumber(value) {
|
|
10521
|
+
return typeof value === "bigint" ? Number(value) : value;
|
|
10522
|
+
}
|
|
10367
10523
|
function getOpenTUILib(libPath) {
|
|
10368
10524
|
const resolvedLibPath = libPath || targetLibPath;
|
|
10369
10525
|
const rawSymbols = dlopen(resolvedLibPath, {
|
|
@@ -10523,10 +10679,6 @@ function getOpenTUILib(libPath) {
|
|
|
10523
10679
|
args: ["ptr", "i32", "i32", "bool"],
|
|
10524
10680
|
returns: "void"
|
|
10525
10681
|
},
|
|
10526
|
-
setCursorStyle: {
|
|
10527
|
-
args: ["ptr", "ptr", "u32", "bool"],
|
|
10528
|
-
returns: "void"
|
|
10529
|
-
},
|
|
10530
10682
|
setCursorColor: {
|
|
10531
10683
|
args: ["ptr", "ptr"],
|
|
10532
10684
|
returns: "void"
|
|
@@ -10535,6 +10687,10 @@ function getOpenTUILib(libPath) {
|
|
|
10535
10687
|
args: ["ptr", "ptr"],
|
|
10536
10688
|
returns: "void"
|
|
10537
10689
|
},
|
|
10690
|
+
setCursorStyleOptions: {
|
|
10691
|
+
args: ["ptr", "ptr"],
|
|
10692
|
+
returns: "void"
|
|
10693
|
+
},
|
|
10538
10694
|
setDebugOverlay: {
|
|
10539
10695
|
args: ["ptr", "bool", "u8"],
|
|
10540
10696
|
returns: "void"
|
|
@@ -11262,6 +11418,54 @@ function getOpenTUILib(libPath) {
|
|
|
11262
11418
|
bufferDrawChar: {
|
|
11263
11419
|
args: ["ptr", "u32", "u32", "u32", "ptr", "ptr", "u32"],
|
|
11264
11420
|
returns: "void"
|
|
11421
|
+
},
|
|
11422
|
+
createNativeSpanFeed: {
|
|
11423
|
+
args: ["ptr"],
|
|
11424
|
+
returns: "ptr"
|
|
11425
|
+
},
|
|
11426
|
+
attachNativeSpanFeed: {
|
|
11427
|
+
args: ["ptr"],
|
|
11428
|
+
returns: "i32"
|
|
11429
|
+
},
|
|
11430
|
+
destroyNativeSpanFeed: {
|
|
11431
|
+
args: ["ptr"],
|
|
11432
|
+
returns: "void"
|
|
11433
|
+
},
|
|
11434
|
+
streamWrite: {
|
|
11435
|
+
args: ["ptr", "ptr", "u64"],
|
|
11436
|
+
returns: "i32"
|
|
11437
|
+
},
|
|
11438
|
+
streamCommit: {
|
|
11439
|
+
args: ["ptr"],
|
|
11440
|
+
returns: "i32"
|
|
11441
|
+
},
|
|
11442
|
+
streamDrainSpans: {
|
|
11443
|
+
args: ["ptr", "ptr", "u32"],
|
|
11444
|
+
returns: "u32"
|
|
11445
|
+
},
|
|
11446
|
+
streamClose: {
|
|
11447
|
+
args: ["ptr"],
|
|
11448
|
+
returns: "i32"
|
|
11449
|
+
},
|
|
11450
|
+
streamReserve: {
|
|
11451
|
+
args: ["ptr", "u32", "ptr"],
|
|
11452
|
+
returns: "i32"
|
|
11453
|
+
},
|
|
11454
|
+
streamCommitReserved: {
|
|
11455
|
+
args: ["ptr", "u32"],
|
|
11456
|
+
returns: "i32"
|
|
11457
|
+
},
|
|
11458
|
+
streamSetOptions: {
|
|
11459
|
+
args: ["ptr", "ptr"],
|
|
11460
|
+
returns: "i32"
|
|
11461
|
+
},
|
|
11462
|
+
streamGetStats: {
|
|
11463
|
+
args: ["ptr", "ptr"],
|
|
11464
|
+
returns: "i32"
|
|
11465
|
+
},
|
|
11466
|
+
streamSetCallback: {
|
|
11467
|
+
args: ["ptr", "ptr"],
|
|
11468
|
+
returns: "void"
|
|
11265
11469
|
}
|
|
11266
11470
|
});
|
|
11267
11471
|
if (env.OTUI_DEBUG_FFI || env.OTUI_TRACE_FFI) {
|
|
@@ -11427,6 +11631,8 @@ class FFIRenderLib {
|
|
|
11427
11631
|
eventCallbackWrapper;
|
|
11428
11632
|
_nativeEvents = new EventEmitter5;
|
|
11429
11633
|
_anyEventHandlers = [];
|
|
11634
|
+
nativeSpanFeedCallbackWrapper = null;
|
|
11635
|
+
nativeSpanFeedHandlers = new Map;
|
|
11430
11636
|
constructor(libPath) {
|
|
11431
11637
|
this.opentui = getOpenTUILib(libPath);
|
|
11432
11638
|
this.setupLogging();
|
|
@@ -11516,6 +11722,25 @@ class FFIRenderLib {
|
|
|
11516
11722
|
}
|
|
11517
11723
|
this.setEventCallback(eventCallback.ptr);
|
|
11518
11724
|
}
|
|
11725
|
+
ensureNativeSpanFeedCallback() {
|
|
11726
|
+
if (this.nativeSpanFeedCallbackWrapper) {
|
|
11727
|
+
return this.nativeSpanFeedCallbackWrapper;
|
|
11728
|
+
}
|
|
11729
|
+
const callback = new JSCallback((streamPtr, eventId, arg0, arg1) => {
|
|
11730
|
+
const handler = this.nativeSpanFeedHandlers.get(toPointer(streamPtr));
|
|
11731
|
+
if (handler) {
|
|
11732
|
+
handler(eventId, arg0, arg1);
|
|
11733
|
+
}
|
|
11734
|
+
}, {
|
|
11735
|
+
args: ["ptr", "u32", "ptr", "u64"],
|
|
11736
|
+
returns: "void"
|
|
11737
|
+
});
|
|
11738
|
+
this.nativeSpanFeedCallbackWrapper = callback;
|
|
11739
|
+
if (!callback.ptr) {
|
|
11740
|
+
throw new Error("Failed to create native span feed callback");
|
|
11741
|
+
}
|
|
11742
|
+
return callback;
|
|
11743
|
+
}
|
|
11519
11744
|
setEventCallback(callbackPtr) {
|
|
11520
11745
|
this.opentui.symbols.setEventCallback(callbackPtr);
|
|
11521
11746
|
}
|
|
@@ -11683,10 +11908,6 @@ class FFIRenderLib {
|
|
|
11683
11908
|
setCursorPosition(renderer, x, y, visible) {
|
|
11684
11909
|
this.opentui.symbols.setCursorPosition(renderer, x, y, visible);
|
|
11685
11910
|
}
|
|
11686
|
-
setCursorStyle(renderer, style, blinking) {
|
|
11687
|
-
const stylePtr = this.encoder.encode(style);
|
|
11688
|
-
this.opentui.symbols.setCursorStyle(renderer, stylePtr, style.length, blinking);
|
|
11689
|
-
}
|
|
11690
11911
|
setCursorColor(renderer, color) {
|
|
11691
11912
|
this.opentui.symbols.setCursorColor(renderer, color.buffer);
|
|
11692
11913
|
}
|
|
@@ -11694,20 +11915,22 @@ class FFIRenderLib {
|
|
|
11694
11915
|
const cursorBuffer = new ArrayBuffer(CursorStateStruct.size);
|
|
11695
11916
|
this.opentui.symbols.getCursorState(renderer, ptr4(cursorBuffer));
|
|
11696
11917
|
const struct = CursorStateStruct.unpack(cursorBuffer);
|
|
11697
|
-
const styleMap = {
|
|
11698
|
-
0: "block",
|
|
11699
|
-
1: "line",
|
|
11700
|
-
2: "underline"
|
|
11701
|
-
};
|
|
11702
11918
|
return {
|
|
11703
11919
|
x: struct.x,
|
|
11704
11920
|
y: struct.y,
|
|
11705
11921
|
visible: struct.visible,
|
|
11706
|
-
style:
|
|
11922
|
+
style: CURSOR_ID_TO_STYLE[struct.style] ?? "block",
|
|
11707
11923
|
blinking: struct.blinking,
|
|
11708
11924
|
color: RGBA.fromValues(struct.r, struct.g, struct.b, struct.a)
|
|
11709
11925
|
};
|
|
11710
11926
|
}
|
|
11927
|
+
setCursorStyleOptions(renderer, options) {
|
|
11928
|
+
const style = options.style != null ? CURSOR_STYLE_TO_ID[options.style] : 255;
|
|
11929
|
+
const blinking = options.blinking != null ? options.blinking ? 1 : 0 : 255;
|
|
11930
|
+
const cursor = options.cursor != null ? MOUSE_STYLE_TO_ID[options.cursor] : 255;
|
|
11931
|
+
const buffer = CursorStyleOptionsStruct.pack({ style, blinking, color: options.color, cursor });
|
|
11932
|
+
this.opentui.symbols.setCursorStyleOptions(renderer, ptr4(buffer));
|
|
11933
|
+
}
|
|
11711
11934
|
render(renderer, force) {
|
|
11712
11935
|
this.opentui.symbols.render(renderer, force);
|
|
11713
11936
|
}
|
|
@@ -12547,6 +12770,73 @@ class FFIRenderLib {
|
|
|
12547
12770
|
bufferDrawChar(buffer, char, x, y, fg2, bg2, attributes = 0) {
|
|
12548
12771
|
this.opentui.symbols.bufferDrawChar(buffer, char, x, y, fg2.buffer, bg2.buffer, attributes);
|
|
12549
12772
|
}
|
|
12773
|
+
registerNativeSpanFeedStream(stream, handler) {
|
|
12774
|
+
const callback = this.ensureNativeSpanFeedCallback();
|
|
12775
|
+
this.nativeSpanFeedHandlers.set(toPointer(stream), handler);
|
|
12776
|
+
this.opentui.symbols.streamSetCallback(stream, callback.ptr);
|
|
12777
|
+
}
|
|
12778
|
+
unregisterNativeSpanFeedStream(stream) {
|
|
12779
|
+
this.opentui.symbols.streamSetCallback(stream, null);
|
|
12780
|
+
this.nativeSpanFeedHandlers.delete(toPointer(stream));
|
|
12781
|
+
}
|
|
12782
|
+
createNativeSpanFeed(options) {
|
|
12783
|
+
const optionsBuffer = options == null ? null : NativeSpanFeedOptionsStruct.pack(options);
|
|
12784
|
+
const streamPtr = this.opentui.symbols.createNativeSpanFeed(optionsBuffer ? ptr4(optionsBuffer) : null);
|
|
12785
|
+
if (!streamPtr) {
|
|
12786
|
+
throw new Error("Failed to create stream");
|
|
12787
|
+
}
|
|
12788
|
+
return toPointer(streamPtr);
|
|
12789
|
+
}
|
|
12790
|
+
attachNativeSpanFeed(stream) {
|
|
12791
|
+
return this.opentui.symbols.attachNativeSpanFeed(stream);
|
|
12792
|
+
}
|
|
12793
|
+
destroyNativeSpanFeed(stream) {
|
|
12794
|
+
this.opentui.symbols.destroyNativeSpanFeed(stream);
|
|
12795
|
+
this.nativeSpanFeedHandlers.delete(toPointer(stream));
|
|
12796
|
+
}
|
|
12797
|
+
streamWrite(stream, data) {
|
|
12798
|
+
const bytes = typeof data === "string" ? this.encoder.encode(data) : data;
|
|
12799
|
+
return this.opentui.symbols.streamWrite(stream, ptr4(bytes), bytes.length);
|
|
12800
|
+
}
|
|
12801
|
+
streamCommit(stream) {
|
|
12802
|
+
return this.opentui.symbols.streamCommit(stream);
|
|
12803
|
+
}
|
|
12804
|
+
streamDrainSpans(stream, outBuffer, maxSpans) {
|
|
12805
|
+
const count = this.opentui.symbols.streamDrainSpans(stream, ptr4(outBuffer), maxSpans);
|
|
12806
|
+
return toNumber(count);
|
|
12807
|
+
}
|
|
12808
|
+
streamClose(stream) {
|
|
12809
|
+
return this.opentui.symbols.streamClose(stream);
|
|
12810
|
+
}
|
|
12811
|
+
streamSetOptions(stream, options) {
|
|
12812
|
+
const optionsBuffer = NativeSpanFeedOptionsStruct.pack(options);
|
|
12813
|
+
return this.opentui.symbols.streamSetOptions(stream, ptr4(optionsBuffer));
|
|
12814
|
+
}
|
|
12815
|
+
streamGetStats(stream) {
|
|
12816
|
+
const statsBuffer = new ArrayBuffer(NativeSpanFeedStatsStruct.size);
|
|
12817
|
+
const status = this.opentui.symbols.streamGetStats(stream, ptr4(statsBuffer));
|
|
12818
|
+
if (status !== 0) {
|
|
12819
|
+
return null;
|
|
12820
|
+
}
|
|
12821
|
+
const stats = NativeSpanFeedStatsStruct.unpack(statsBuffer);
|
|
12822
|
+
return {
|
|
12823
|
+
bytesWritten: typeof stats.bytesWritten === "bigint" ? stats.bytesWritten : BigInt(stats.bytesWritten),
|
|
12824
|
+
spansCommitted: typeof stats.spansCommitted === "bigint" ? stats.spansCommitted : BigInt(stats.spansCommitted),
|
|
12825
|
+
chunks: stats.chunks,
|
|
12826
|
+
pendingSpans: stats.pendingSpans
|
|
12827
|
+
};
|
|
12828
|
+
}
|
|
12829
|
+
streamReserve(stream, minLen) {
|
|
12830
|
+
const reserveBuffer = new ArrayBuffer(ReserveInfoStruct.size);
|
|
12831
|
+
const status = this.opentui.symbols.streamReserve(stream, minLen, ptr4(reserveBuffer));
|
|
12832
|
+
if (status !== 0) {
|
|
12833
|
+
return { status, info: null };
|
|
12834
|
+
}
|
|
12835
|
+
return { status, info: ReserveInfoStruct.unpack(reserveBuffer) };
|
|
12836
|
+
}
|
|
12837
|
+
streamCommitReserved(stream, length) {
|
|
12838
|
+
return this.opentui.symbols.streamCommitReserved(stream, length);
|
|
12839
|
+
}
|
|
12550
12840
|
createSyntaxStyle() {
|
|
12551
12841
|
const stylePtr = this.opentui.symbols.createSyntaxStyle();
|
|
12552
12842
|
if (!stylePtr) {
|
|
@@ -15826,6 +16116,7 @@ class CliRenderer extends EventEmitter9 {
|
|
|
15826
16116
|
_latestPointer = { x: 0, y: 0 };
|
|
15827
16117
|
_hasPointer = false;
|
|
15828
16118
|
_lastPointerModifiers = { shift: false, alt: false, ctrl: false };
|
|
16119
|
+
_currentMousePointerStyle = undefined;
|
|
15829
16120
|
_currentFocusedRenderable = null;
|
|
15830
16121
|
lifecyclePasses = new Set;
|
|
15831
16122
|
_openConsoleOnError = true;
|
|
@@ -16410,127 +16701,135 @@ Captured output:
|
|
|
16410
16701
|
return event;
|
|
16411
16702
|
}
|
|
16412
16703
|
handleMouseData(data) {
|
|
16413
|
-
const
|
|
16414
|
-
if (
|
|
16415
|
-
|
|
16416
|
-
|
|
16417
|
-
|
|
16418
|
-
|
|
16419
|
-
|
|
16420
|
-
}
|
|
16421
|
-
this._latestPointer.x = mouseEvent.x;
|
|
16422
|
-
this._latestPointer.y = mouseEvent.y;
|
|
16423
|
-
this._hasPointer = true;
|
|
16424
|
-
this._lastPointerModifiers = mouseEvent.modifiers;
|
|
16425
|
-
if (this._console.visible) {
|
|
16426
|
-
const consoleBounds = this._console.bounds;
|
|
16427
|
-
if (mouseEvent.x >= consoleBounds.x && mouseEvent.x < consoleBounds.x + consoleBounds.width && mouseEvent.y >= consoleBounds.y && mouseEvent.y < consoleBounds.y + consoleBounds.height) {
|
|
16428
|
-
const event2 = new MouseEvent(null, mouseEvent);
|
|
16429
|
-
const handled = this._console.handleMouse(event2);
|
|
16430
|
-
if (handled)
|
|
16431
|
-
return true;
|
|
16432
|
-
}
|
|
16704
|
+
const mouseEvents = this.mouseParser.parseAllMouseEvents(data);
|
|
16705
|
+
if (mouseEvents.length === 0)
|
|
16706
|
+
return false;
|
|
16707
|
+
let anyHandled = false;
|
|
16708
|
+
for (const mouseEvent of mouseEvents) {
|
|
16709
|
+
if (this.processSingleMouseEvent(mouseEvent)) {
|
|
16710
|
+
anyHandled = true;
|
|
16433
16711
|
}
|
|
16434
|
-
|
|
16435
|
-
|
|
16436
|
-
|
|
16437
|
-
|
|
16438
|
-
|
|
16439
|
-
|
|
16440
|
-
|
|
16441
|
-
scrollTarget.processMouseEvent(event2);
|
|
16442
|
-
}
|
|
16443
|
-
return true;
|
|
16712
|
+
}
|
|
16713
|
+
return anyHandled;
|
|
16714
|
+
}
|
|
16715
|
+
processSingleMouseEvent(mouseEvent) {
|
|
16716
|
+
if (this._splitHeight > 0) {
|
|
16717
|
+
if (mouseEvent.y < this.renderOffset) {
|
|
16718
|
+
return false;
|
|
16444
16719
|
}
|
|
16445
|
-
|
|
16446
|
-
|
|
16447
|
-
|
|
16448
|
-
|
|
16449
|
-
|
|
16450
|
-
|
|
16451
|
-
|
|
16452
|
-
|
|
16720
|
+
mouseEvent.y -= this.renderOffset;
|
|
16721
|
+
}
|
|
16722
|
+
this._latestPointer.x = mouseEvent.x;
|
|
16723
|
+
this._latestPointer.y = mouseEvent.y;
|
|
16724
|
+
this._hasPointer = true;
|
|
16725
|
+
this._lastPointerModifiers = mouseEvent.modifiers;
|
|
16726
|
+
if (this._console.visible) {
|
|
16727
|
+
const consoleBounds = this._console.bounds;
|
|
16728
|
+
if (mouseEvent.x >= consoleBounds.x && mouseEvent.x < consoleBounds.x + consoleBounds.width && mouseEvent.y >= consoleBounds.y && mouseEvent.y < consoleBounds.y + consoleBounds.height) {
|
|
16729
|
+
const event2 = new MouseEvent(null, mouseEvent);
|
|
16730
|
+
const handled = this._console.handleMouse(event2);
|
|
16731
|
+
if (handled)
|
|
16453
16732
|
return true;
|
|
16454
|
-
}
|
|
16455
16733
|
}
|
|
16456
|
-
|
|
16457
|
-
|
|
16458
|
-
|
|
16459
|
-
|
|
16460
|
-
|
|
16461
|
-
|
|
16462
|
-
|
|
16734
|
+
}
|
|
16735
|
+
if (mouseEvent.type === "scroll") {
|
|
16736
|
+
const maybeRenderableId2 = this.hitTest(mouseEvent.x, mouseEvent.y);
|
|
16737
|
+
const maybeRenderable2 = Renderable.renderablesByNumber.get(maybeRenderableId2);
|
|
16738
|
+
const fallbackTarget = this._currentFocusedRenderable && !this._currentFocusedRenderable.isDestroyed && this._currentFocusedRenderable.focused ? this._currentFocusedRenderable : null;
|
|
16739
|
+
const scrollTarget = maybeRenderable2 ?? fallbackTarget;
|
|
16740
|
+
if (scrollTarget) {
|
|
16741
|
+
const event2 = new MouseEvent(scrollTarget, mouseEvent);
|
|
16742
|
+
scrollTarget.processMouseEvent(event2);
|
|
16463
16743
|
}
|
|
16464
|
-
|
|
16465
|
-
|
|
16466
|
-
|
|
16467
|
-
|
|
16468
|
-
|
|
16469
|
-
|
|
16744
|
+
return true;
|
|
16745
|
+
}
|
|
16746
|
+
const maybeRenderableId = this.hitTest(mouseEvent.x, mouseEvent.y);
|
|
16747
|
+
const sameElement = maybeRenderableId === this.lastOverRenderableNum;
|
|
16748
|
+
this.lastOverRenderableNum = maybeRenderableId;
|
|
16749
|
+
const maybeRenderable = Renderable.renderablesByNumber.get(maybeRenderableId);
|
|
16750
|
+
if (mouseEvent.type === "down" && mouseEvent.button === 0 /* LEFT */ && !this.currentSelection?.isDragging && !mouseEvent.modifiers.ctrl) {
|
|
16751
|
+
if (maybeRenderable && maybeRenderable.selectable && !maybeRenderable.isDestroyed && maybeRenderable.shouldStartSelection(mouseEvent.x, mouseEvent.y)) {
|
|
16752
|
+
this.startSelection(maybeRenderable, mouseEvent.x, mouseEvent.y);
|
|
16753
|
+
this.dispatchMouseEvent(maybeRenderable, mouseEvent);
|
|
16470
16754
|
return true;
|
|
16471
16755
|
}
|
|
16472
|
-
|
|
16473
|
-
|
|
16474
|
-
|
|
16475
|
-
|
|
16476
|
-
|
|
16477
|
-
|
|
16756
|
+
}
|
|
16757
|
+
if (mouseEvent.type === "drag" && this.currentSelection?.isDragging) {
|
|
16758
|
+
this.updateSelection(maybeRenderable, mouseEvent.x, mouseEvent.y);
|
|
16759
|
+
if (maybeRenderable) {
|
|
16760
|
+
const event2 = new MouseEvent(maybeRenderable, { ...mouseEvent, isDragging: true });
|
|
16761
|
+
maybeRenderable.processMouseEvent(event2);
|
|
16478
16762
|
}
|
|
16479
|
-
|
|
16480
|
-
|
|
16481
|
-
|
|
16482
|
-
|
|
16483
|
-
}
|
|
16484
|
-
|
|
16485
|
-
if (maybeRenderable) {
|
|
16486
|
-
const event2 = new MouseEvent(maybeRenderable, {
|
|
16487
|
-
...mouseEvent,
|
|
16488
|
-
type: "over",
|
|
16489
|
-
source: this.capturedRenderable
|
|
16490
|
-
});
|
|
16491
|
-
maybeRenderable.processMouseEvent(event2);
|
|
16492
|
-
}
|
|
16763
|
+
return true;
|
|
16764
|
+
}
|
|
16765
|
+
if (mouseEvent.type === "up" && this.currentSelection?.isDragging) {
|
|
16766
|
+
if (maybeRenderable) {
|
|
16767
|
+
const event2 = new MouseEvent(maybeRenderable, { ...mouseEvent, isDragging: true });
|
|
16768
|
+
maybeRenderable.processMouseEvent(event2);
|
|
16493
16769
|
}
|
|
16494
|
-
|
|
16495
|
-
|
|
16496
|
-
|
|
16770
|
+
this.finishSelection();
|
|
16771
|
+
return true;
|
|
16772
|
+
}
|
|
16773
|
+
if (mouseEvent.type === "down" && mouseEvent.button === 0 /* LEFT */ && this.currentSelection) {
|
|
16774
|
+
if (mouseEvent.modifiers.ctrl) {
|
|
16775
|
+
this.currentSelection.isDragging = true;
|
|
16776
|
+
this.updateSelection(maybeRenderable, mouseEvent.x, mouseEvent.y);
|
|
16497
16777
|
return true;
|
|
16498
16778
|
}
|
|
16499
|
-
|
|
16500
|
-
|
|
16501
|
-
|
|
16502
|
-
|
|
16503
|
-
|
|
16504
|
-
const event3 = new MouseEvent(maybeRenderable, {
|
|
16505
|
-
...mouseEvent,
|
|
16506
|
-
type: "drop",
|
|
16507
|
-
source: this.capturedRenderable
|
|
16508
|
-
});
|
|
16509
|
-
maybeRenderable.processMouseEvent(event3);
|
|
16510
|
-
}
|
|
16511
|
-
this.lastOverRenderable = this.capturedRenderable;
|
|
16512
|
-
this.lastOverRenderableNum = this.capturedRenderable.num;
|
|
16513
|
-
this.setCapturedRenderable(undefined);
|
|
16514
|
-
this.requestRender();
|
|
16779
|
+
}
|
|
16780
|
+
if (!sameElement && (mouseEvent.type === "drag" || mouseEvent.type === "move")) {
|
|
16781
|
+
if (this.lastOverRenderable && this.lastOverRenderable !== this.capturedRenderable) {
|
|
16782
|
+
const event2 = new MouseEvent(this.lastOverRenderable, { ...mouseEvent, type: "out" });
|
|
16783
|
+
this.lastOverRenderable.processMouseEvent(event2);
|
|
16515
16784
|
}
|
|
16516
|
-
|
|
16785
|
+
this.lastOverRenderable = maybeRenderable;
|
|
16517
16786
|
if (maybeRenderable) {
|
|
16518
|
-
|
|
16519
|
-
|
|
16520
|
-
|
|
16521
|
-
this.
|
|
16522
|
-
}
|
|
16523
|
-
|
|
16787
|
+
const event2 = new MouseEvent(maybeRenderable, {
|
|
16788
|
+
...mouseEvent,
|
|
16789
|
+
type: "over",
|
|
16790
|
+
source: this.capturedRenderable
|
|
16791
|
+
});
|
|
16792
|
+
maybeRenderable.processMouseEvent(event2);
|
|
16793
|
+
}
|
|
16794
|
+
}
|
|
16795
|
+
if (this.capturedRenderable && mouseEvent.type !== "up") {
|
|
16796
|
+
const event2 = new MouseEvent(this.capturedRenderable, mouseEvent);
|
|
16797
|
+
this.capturedRenderable.processMouseEvent(event2);
|
|
16798
|
+
return true;
|
|
16799
|
+
}
|
|
16800
|
+
if (this.capturedRenderable && mouseEvent.type === "up") {
|
|
16801
|
+
const event2 = new MouseEvent(this.capturedRenderable, { ...mouseEvent, type: "drag-end" });
|
|
16802
|
+
this.capturedRenderable.processMouseEvent(event2);
|
|
16803
|
+
this.capturedRenderable.processMouseEvent(new MouseEvent(this.capturedRenderable, mouseEvent));
|
|
16804
|
+
if (maybeRenderable) {
|
|
16805
|
+
const event3 = new MouseEvent(maybeRenderable, {
|
|
16806
|
+
...mouseEvent,
|
|
16807
|
+
type: "drop",
|
|
16808
|
+
source: this.capturedRenderable
|
|
16809
|
+
});
|
|
16810
|
+
maybeRenderable.processMouseEvent(event3);
|
|
16811
|
+
}
|
|
16812
|
+
this.lastOverRenderable = this.capturedRenderable;
|
|
16813
|
+
this.lastOverRenderableNum = this.capturedRenderable.num;
|
|
16814
|
+
this.setCapturedRenderable(undefined);
|
|
16815
|
+
this.requestRender();
|
|
16816
|
+
}
|
|
16817
|
+
let event;
|
|
16818
|
+
if (maybeRenderable) {
|
|
16819
|
+
if (mouseEvent.type === "drag" && mouseEvent.button === 0 /* LEFT */) {
|
|
16820
|
+
this.setCapturedRenderable(maybeRenderable);
|
|
16524
16821
|
} else {
|
|
16525
16822
|
this.setCapturedRenderable(undefined);
|
|
16526
|
-
this.lastOverRenderable = undefined;
|
|
16527
|
-
}
|
|
16528
|
-
if (!event?.defaultPrevented && mouseEvent.type === "down" && this.currentSelection) {
|
|
16529
|
-
this.clearSelection();
|
|
16530
16823
|
}
|
|
16531
|
-
|
|
16824
|
+
event = this.dispatchMouseEvent(maybeRenderable, mouseEvent);
|
|
16825
|
+
} else {
|
|
16826
|
+
this.setCapturedRenderable(undefined);
|
|
16827
|
+
this.lastOverRenderable = undefined;
|
|
16532
16828
|
}
|
|
16533
|
-
|
|
16829
|
+
if (!event?.defaultPrevented && mouseEvent.type === "down" && this.currentSelection) {
|
|
16830
|
+
this.clearSelection();
|
|
16831
|
+
}
|
|
16832
|
+
return true;
|
|
16534
16833
|
}
|
|
16535
16834
|
recheckHoverState() {
|
|
16536
16835
|
if (this._isDestroyed || !this._hasPointer)
|
|
@@ -16565,6 +16864,10 @@ Captured output:
|
|
|
16565
16864
|
hitRenderable.processMouseEvent(event);
|
|
16566
16865
|
}
|
|
16567
16866
|
}
|
|
16867
|
+
setMousePointer(style) {
|
|
16868
|
+
this._currentMousePointerStyle = style;
|
|
16869
|
+
this.lib.setCursorStyleOptions(this.rendererPtr, { cursor: style });
|
|
16870
|
+
}
|
|
16568
16871
|
hitTest(x, y) {
|
|
16569
16872
|
return this.lib.checkHit(this.rendererPtr, x, y);
|
|
16570
16873
|
}
|
|
@@ -16707,11 +17010,11 @@ Captured output:
|
|
|
16707
17010
|
const lib = resolveRenderLib();
|
|
16708
17011
|
lib.setCursorPosition(renderer.rendererPtr, x, y, visible);
|
|
16709
17012
|
}
|
|
16710
|
-
static setCursorStyle(renderer,
|
|
17013
|
+
static setCursorStyle(renderer, options) {
|
|
16711
17014
|
const lib = resolveRenderLib();
|
|
16712
|
-
lib.
|
|
16713
|
-
if (
|
|
16714
|
-
|
|
17015
|
+
lib.setCursorStyleOptions(renderer.rendererPtr, options);
|
|
17016
|
+
if (options.cursor !== undefined) {
|
|
17017
|
+
renderer._currentMousePointerStyle = options.cursor;
|
|
16715
17018
|
}
|
|
16716
17019
|
}
|
|
16717
17020
|
static setCursorColor(renderer, color) {
|
|
@@ -16721,10 +17024,10 @@ Captured output:
|
|
|
16721
17024
|
setCursorPosition(x, y, visible = true) {
|
|
16722
17025
|
this.lib.setCursorPosition(this.rendererPtr, x, y, visible);
|
|
16723
17026
|
}
|
|
16724
|
-
setCursorStyle(
|
|
16725
|
-
this.lib.
|
|
16726
|
-
if (
|
|
16727
|
-
this.
|
|
17027
|
+
setCursorStyle(options) {
|
|
17028
|
+
this.lib.setCursorStyleOptions(this.rendererPtr, options);
|
|
17029
|
+
if (options.cursor !== undefined) {
|
|
17030
|
+
this._currentMousePointerStyle = options.cursor;
|
|
16728
17031
|
}
|
|
16729
17032
|
}
|
|
16730
17033
|
setCursorColor(color) {
|
|
@@ -16824,6 +17127,13 @@ Captured output:
|
|
|
16824
17127
|
}
|
|
16825
17128
|
internalPause() {
|
|
16826
17129
|
this._isRunning = false;
|
|
17130
|
+
if (this.renderTimeout) {
|
|
17131
|
+
clearTimeout(this.renderTimeout);
|
|
17132
|
+
this.renderTimeout = null;
|
|
17133
|
+
}
|
|
17134
|
+
if (!this.rendering) {
|
|
17135
|
+
this.resolveIdleIfNeeded();
|
|
17136
|
+
}
|
|
16827
17137
|
}
|
|
16828
17138
|
stop() {
|
|
16829
17139
|
this._controlState = "explicit_stopped" /* EXPLICIT_STOPPED */;
|
|
@@ -17199,7 +17509,7 @@ Captured output:
|
|
|
17199
17509
|
}
|
|
17200
17510
|
}
|
|
17201
17511
|
|
|
17202
|
-
export { __toESM, __commonJS, __export, __require, Edge, Gutter, MeasureMode, exports_src, isValidBorderStyle, parseBorderStyle, BorderChars, getBorderFromSides, getBorderSides, borderCharsToArray, BorderCharArrays, nonAlphanumericKeys, parseKeypress, KeyEvent, PasteEvent, KeyHandler, InternalKeyHandler, RGBA, hexToRgb, rgbToHex, hsvToRgb, parseColor, fonts, measureText, getCharacterPositions, coordinateToCharacterIndex, renderFontToFrameBuffer, TextAttributes, ATTRIBUTE_BASE_BITS, ATTRIBUTE_BASE_MASK, getBaseAttributes, DebugOverlayCorner, createTextAttributes, attributesWithLink, getLinkId, 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, link, t, hastToStyledText, LinearScrollAccel, MacOSScrollAccel, StdinBuffer, parseAlign, parseAlignItems, 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, defaultKeyAliases, mergeKeyAliases, mergeKeyBindings, getKeyBindingKey, buildKeyBindingsMap, capture, ConsolePosition, TerminalConsole, getObjectsInViewport, buildKittyKeyboardFlags, MouseEvent, MouseButton, createCliRenderer, CliRenderEvents, RendererControlState, CliRenderer };
|
|
17512
|
+
export { __toESM, __commonJS, __export, __require, Edge, Gutter, MeasureMode, exports_src, isValidBorderStyle, parseBorderStyle, BorderChars, getBorderFromSides, getBorderSides, borderCharsToArray, BorderCharArrays, nonAlphanumericKeys, parseKeypress, KeyEvent, PasteEvent, KeyHandler, InternalKeyHandler, RGBA, hexToRgb, rgbToHex, hsvToRgb, parseColor, fonts, measureText, getCharacterPositions, coordinateToCharacterIndex, renderFontToFrameBuffer, TextAttributes, ATTRIBUTE_BASE_BITS, ATTRIBUTE_BASE_MASK, getBaseAttributes, DebugOverlayCorner, createTextAttributes, attributesWithLink, getLinkId, 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, link, t, hastToStyledText, LinearScrollAccel, MacOSScrollAccel, StdinBuffer, parseAlign, parseAlignItems, 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, SpanInfoStruct, LogLevel2 as LogLevel, setRenderLibPath, resolveRenderLib, OptimizedBuffer, h, isVNode, maybeMakeRenderable, wrapWithDelegates, instantiate, delegate, isValidPercentage, LayoutEvents, RenderableEvents, isRenderable, BaseRenderable, Renderable, RootRenderable, ANSI, defaultKeyAliases, mergeKeyAliases, mergeKeyBindings, getKeyBindingKey, buildKeyBindingsMap, capture, ConsolePosition, TerminalConsole, getObjectsInViewport, buildKittyKeyboardFlags, MouseEvent, MouseButton, createCliRenderer, CliRenderEvents, RendererControlState, CliRenderer };
|
|
17203
17513
|
|
|
17204
|
-
//# debugId=
|
|
17205
|
-
//# sourceMappingURL=index-
|
|
17514
|
+
//# debugId=EFA968BC34E6ECA564756E2164756E21
|
|
17515
|
+
//# sourceMappingURL=index-ve2seej0.js.map
|