@opentui/core 0.1.105 → 0.1.107
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/Renderable.d.ts +2 -1
- package/buffer.d.ts +2 -4
- package/console.d.ts +3 -1
- package/{index-exz3nyks.js → index-epp5y71w.js} +3 -3
- package/{index-3dgzz9vb.js → index-mch6dv67.js} +85 -60
- package/{index-3dgzz9vb.js.map → index-mch6dv67.js.map} +8 -8
- package/{index-07knw1vn.js → index-mw2x3082.js} +154 -186
- package/index-mw2x3082.js.map +76 -0
- package/index.js +7 -9
- package/index.js.map +1 -1
- package/lib/RGBA.d.ts +10 -17
- package/lib/parse.keypress-kitty.d.ts +1 -0
- package/lib/parse.keypress.d.ts +1 -0
- package/package.json +11 -8
- package/platform/ffi.d.ts +64 -0
- package/platform/runtime.d.ts +8 -0
- package/platform/worker.d.ts +4 -0
- package/renderables/Select.d.ts +3 -1
- package/renderables/TabSelect.d.ts +3 -1
- package/renderables/Textarea.d.ts +5 -3
- package/renderer.d.ts +1 -0
- package/runtime-plugin-support.js +3 -3
- package/runtime-plugin.js +3 -3
- package/syntax-style.d.ts +10 -2
- package/testing/test-recorder.d.ts +2 -2
- package/testing.js +4 -4
- package/testing.js.map +3 -3
- package/types.d.ts +1 -0
- package/zig-structs.d.ts +0 -6
- package/zig.d.ts +0 -2
- package/index-07knw1vn.js.map +0 -76
- /package/{index-exz3nyks.js.map → index-epp5y71w.js.map} +0 -0
- /package/lib/{keymapping.d.ts → keybinding.internal.d.ts} +0 -0
package/3d.js
CHANGED
package/Renderable.d.ts
CHANGED
package/buffer.d.ts
CHANGED
|
@@ -15,18 +15,16 @@ export declare class OptimizedBuffer {
|
|
|
15
15
|
private _widthMethod;
|
|
16
16
|
respectAlpha: boolean;
|
|
17
17
|
private _rawBuffers;
|
|
18
|
-
private _rawColorTags;
|
|
19
18
|
private _destroyed;
|
|
20
19
|
get ptr(): Pointer;
|
|
21
20
|
private guard;
|
|
22
21
|
private ensureRawBufferViews;
|
|
23
22
|
get buffers(): {
|
|
24
23
|
char: Uint32Array;
|
|
25
|
-
fg:
|
|
26
|
-
bg:
|
|
24
|
+
fg: Uint16Array;
|
|
25
|
+
bg: Uint16Array;
|
|
27
26
|
attributes: Uint32Array;
|
|
28
27
|
};
|
|
29
|
-
private get rawColorTags();
|
|
30
28
|
constructor(lib: RenderLib, ptr: Pointer, width: number, height: number, options: {
|
|
31
29
|
respectAlpha?: boolean;
|
|
32
30
|
id?: string;
|
package/console.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ import type { ColorInput } from "./lib/RGBA.js";
|
|
|
4
4
|
import { OptimizedBuffer } from "./buffer.js";
|
|
5
5
|
import { type Clock } from "./lib/clock.js";
|
|
6
6
|
import { Capture } from "./lib/output.capture.js";
|
|
7
|
-
import { type KeyBinding as BaseKeyBinding
|
|
7
|
+
import { type KeyBinding as BaseKeyBinding } from "./lib/keybinding.internal.js";
|
|
8
|
+
type KeyAliasMap = Record<string, string>;
|
|
8
9
|
export declare const capture: Capture;
|
|
9
10
|
export declare enum ConsolePosition {
|
|
10
11
|
TOP = "top",
|
|
@@ -142,3 +143,4 @@ export declare class TerminalConsole extends EventEmitter {
|
|
|
142
143
|
};
|
|
143
144
|
private saveLogsToFile;
|
|
144
145
|
}
|
|
146
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
exports_src
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-mch6dv67.js";
|
|
5
5
|
import {
|
|
6
6
|
__require
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-mw2x3082.js";
|
|
8
8
|
|
|
9
9
|
// src/runtime-plugin.ts
|
|
10
10
|
import { existsSync, readFileSync, realpathSync } from "fs";
|
|
@@ -408,4 +408,4 @@ function createRuntimePlugin(input = {}) {
|
|
|
408
408
|
export { isCoreRuntimeModuleSpecifier, runtimeModuleIdForSpecifier, createRuntimePlugin };
|
|
409
409
|
|
|
410
410
|
//# debugId=5D58E30F1E057B9664756E2164756E21
|
|
411
|
-
//# sourceMappingURL=index-
|
|
411
|
+
//# sourceMappingURL=index-epp5y71w.js.map
|
|
@@ -7,8 +7,6 @@ import {
|
|
|
7
7
|
BorderCharArrays,
|
|
8
8
|
BorderChars,
|
|
9
9
|
BoxRenderable,
|
|
10
|
-
COLOR_TAG_DEFAULT,
|
|
11
|
-
COLOR_TAG_RGB,
|
|
12
10
|
CliRenderEvents,
|
|
13
11
|
CliRenderer,
|
|
14
12
|
CodeRenderable,
|
|
@@ -97,7 +95,6 @@ import {
|
|
|
97
95
|
createTerminalPalette,
|
|
98
96
|
createTextAttributes,
|
|
99
97
|
cyan,
|
|
100
|
-
decodeColorTag,
|
|
101
98
|
decodePasteBytes,
|
|
102
99
|
defaultKeyAliases,
|
|
103
100
|
delegate,
|
|
@@ -177,6 +174,7 @@ import {
|
|
|
177
174
|
stringToStyledText,
|
|
178
175
|
stripAnsiSequences,
|
|
179
176
|
t,
|
|
177
|
+
terminalNamedSingleStrokeKeys,
|
|
180
178
|
treeSitterToStyledText,
|
|
181
179
|
treeSitterToTextChunks,
|
|
182
180
|
underline,
|
|
@@ -184,7 +182,7 @@ import {
|
|
|
184
182
|
white,
|
|
185
183
|
wrapWithDelegates,
|
|
186
184
|
yellow
|
|
187
|
-
} from "./index-
|
|
185
|
+
} from "./index-mw2x3082.js";
|
|
188
186
|
|
|
189
187
|
// src/index.ts
|
|
190
188
|
var exports_src2 = {};
|
|
@@ -198,6 +196,7 @@ __export(exports_src2, {
|
|
|
198
196
|
underline: () => underline,
|
|
199
197
|
treeSitterToTextChunks: () => treeSitterToTextChunks,
|
|
200
198
|
treeSitterToStyledText: () => treeSitterToStyledText,
|
|
199
|
+
terminalNamedSingleStrokeKeys: () => terminalNamedSingleStrokeKeys,
|
|
201
200
|
t: () => t,
|
|
202
201
|
stripAnsiSequences: () => stripAnsiSequences,
|
|
203
202
|
stringToStyledText: () => stringToStyledText,
|
|
@@ -272,8 +271,8 @@ __export(exports_src2, {
|
|
|
272
271
|
dim: () => dim,
|
|
273
272
|
detectLinks: () => detectLinks,
|
|
274
273
|
delegate: () => delegate,
|
|
274
|
+
defaultTextareaKeyBindings: () => defaultTextareaKeyBindings,
|
|
275
275
|
decodePasteBytes: () => decodePasteBytes,
|
|
276
|
-
decodeColorTag: () => decodeColorTag,
|
|
277
276
|
cyan: () => cyan,
|
|
278
277
|
createTimeline: () => createTimeline,
|
|
279
278
|
createTextAttributes: () => createTextAttributes,
|
|
@@ -418,8 +417,6 @@ __export(exports_src2, {
|
|
|
418
417
|
CliRenderer: () => CliRenderer,
|
|
419
418
|
CliRenderEvents: () => CliRenderEvents,
|
|
420
419
|
CRTRollingBarEffect: () => CRTRollingBarEffect,
|
|
421
|
-
COLOR_TAG_RGB: () => COLOR_TAG_RGB,
|
|
422
|
-
COLOR_TAG_DEFAULT: () => COLOR_TAG_DEFAULT,
|
|
423
420
|
BoxRenderable: () => BoxRenderable,
|
|
424
421
|
Box: () => Box,
|
|
425
422
|
BorderChars: () => BorderChars,
|
|
@@ -436,6 +433,20 @@ __export(exports_src2, {
|
|
|
436
433
|
});
|
|
437
434
|
|
|
438
435
|
// src/post/effects.ts
|
|
436
|
+
function toU8(value) {
|
|
437
|
+
return Math.round(Math.max(0, Math.min(1, Number.isFinite(value) ? value : 0)) * 255);
|
|
438
|
+
}
|
|
439
|
+
function channel(buffer, index) {
|
|
440
|
+
return (buffer[index] & 255) / 255;
|
|
441
|
+
}
|
|
442
|
+
function setRgb(buffer, base, r, g, b) {
|
|
443
|
+
const a = buffer[base + 3] & 255;
|
|
444
|
+
buffer[base] = toU8(r);
|
|
445
|
+
buffer[base + 1] = toU8(g);
|
|
446
|
+
buffer[base + 2] = toU8(b);
|
|
447
|
+
buffer[base + 3] = a;
|
|
448
|
+
}
|
|
449
|
+
|
|
439
450
|
class DistortionEffect {
|
|
440
451
|
glitchChancePerSecond = 0.5;
|
|
441
452
|
maxGlitchLines = 3;
|
|
@@ -499,8 +510,8 @@ class DistortionEffect {
|
|
|
499
510
|
if (glitch.type === "shift" || glitch.type === "flip") {
|
|
500
511
|
if (!tempChar) {
|
|
501
512
|
tempChar = new Uint32Array(width);
|
|
502
|
-
tempFg = new
|
|
503
|
-
tempBg = new
|
|
513
|
+
tempFg = new Uint16Array(width * 4);
|
|
514
|
+
tempBg = new Uint16Array(width * 4);
|
|
504
515
|
tempAttr = new Uint8Array(width);
|
|
505
516
|
}
|
|
506
517
|
try {
|
|
@@ -607,12 +618,8 @@ class DistortionEffect {
|
|
|
607
618
|
gBg = 1 - gFg;
|
|
608
619
|
bBg = 1 - bFg;
|
|
609
620
|
}
|
|
610
|
-
buf.fg
|
|
611
|
-
buf.
|
|
612
|
-
buf.fg[destColorIndex + 2] = bFg;
|
|
613
|
-
buf.bg[destColorIndex] = rBg;
|
|
614
|
-
buf.bg[destColorIndex + 1] = gBg;
|
|
615
|
-
buf.bg[destColorIndex + 2] = bBg;
|
|
621
|
+
setRgb(buf.fg, destColorIndex, rFg, gFg, bFg);
|
|
622
|
+
setRgb(buf.bg, destColorIndex, rBg, gBg, bBg);
|
|
616
623
|
}
|
|
617
624
|
}
|
|
618
625
|
}
|
|
@@ -877,9 +884,7 @@ class FlamesEffect {
|
|
|
877
884
|
g = flameIntensity * 0.5;
|
|
878
885
|
b = 0;
|
|
879
886
|
}
|
|
880
|
-
bg2
|
|
881
|
-
bg2[colorIndex + 1] = Math.max(bg2[colorIndex + 1], g * flameIntensity);
|
|
882
|
-
bg2[colorIndex + 2] = Math.max(bg2[colorIndex + 2], b * flameIntensity);
|
|
887
|
+
setRgb(bg2, colorIndex, Math.max(channel(bg2, colorIndex), r * flameIntensity), Math.max(channel(bg2, colorIndex + 1), g * flameIntensity), Math.max(channel(bg2, colorIndex + 2), b * flameIntensity));
|
|
883
888
|
}
|
|
884
889
|
}
|
|
885
890
|
}
|
|
@@ -945,12 +950,8 @@ class CRTRollingBarEffect {
|
|
|
945
950
|
const rowMultiplier = 1 + this._intensity * barFactor;
|
|
946
951
|
for (let x = 0;x < width; x++) {
|
|
947
952
|
const colorIndex = (y * width + x) * 4;
|
|
948
|
-
fg2
|
|
949
|
-
|
|
950
|
-
fg2[colorIndex + 2] = Math.min(1, fg2[colorIndex + 2] * rowMultiplier);
|
|
951
|
-
bg2[colorIndex] = Math.min(1, bg2[colorIndex] * rowMultiplier);
|
|
952
|
-
bg2[colorIndex + 1] = Math.min(1, bg2[colorIndex + 1] * rowMultiplier);
|
|
953
|
-
bg2[colorIndex + 2] = Math.min(1, bg2[colorIndex + 2] * rowMultiplier);
|
|
953
|
+
setRgb(fg2, colorIndex, Math.min(1, channel(fg2, colorIndex) * rowMultiplier), Math.min(1, channel(fg2, colorIndex + 1) * rowMultiplier), Math.min(1, channel(fg2, colorIndex + 2) * rowMultiplier));
|
|
954
|
+
setRgb(bg2, colorIndex, Math.min(1, channel(bg2, colorIndex) * rowMultiplier), Math.min(1, channel(bg2, colorIndex + 1) * rowMultiplier), Math.min(1, channel(bg2, colorIndex + 2) * rowMultiplier));
|
|
954
955
|
}
|
|
955
956
|
}
|
|
956
957
|
}
|
|
@@ -1049,23 +1050,34 @@ class RainbowTextEffect {
|
|
|
1049
1050
|
for (let y = 0;y < height; y++) {
|
|
1050
1051
|
for (let x = 0;x < width; x++) {
|
|
1051
1052
|
const colorIndex = (y * width + x) * 4;
|
|
1052
|
-
const r = fg2
|
|
1053
|
-
const g = fg2
|
|
1054
|
-
const b = fg2
|
|
1053
|
+
const r = channel(fg2, colorIndex);
|
|
1054
|
+
const g = channel(fg2, colorIndex + 1);
|
|
1055
|
+
const b = channel(fg2, colorIndex + 2);
|
|
1055
1056
|
if (r >= whiteThreshold && g >= whiteThreshold && b >= whiteThreshold) {
|
|
1056
1057
|
const projection = x * cosAngle + y * sinAngle;
|
|
1057
1058
|
const maxProjection = width * cosAngle + height * sinAngle;
|
|
1058
1059
|
const hue = (projection / maxProjection * repeats + this.time * 0.1) % 1;
|
|
1059
1060
|
const [newR, newG, newB] = this.hsvToRgb(hue, saturation, value);
|
|
1060
|
-
fg2
|
|
1061
|
-
fg2[colorIndex + 1] = newG;
|
|
1062
|
-
fg2[colorIndex + 2] = newB;
|
|
1061
|
+
setRgb(fg2, colorIndex, newR, newG, newB);
|
|
1063
1062
|
}
|
|
1064
1063
|
}
|
|
1065
1064
|
}
|
|
1066
1065
|
}
|
|
1067
1066
|
}
|
|
1068
1067
|
// src/post/filters.ts
|
|
1068
|
+
function toU82(value) {
|
|
1069
|
+
return Math.round(Math.max(0, Math.min(1, Number.isFinite(value) ? value : 0)) * 255);
|
|
1070
|
+
}
|
|
1071
|
+
function channel2(buffer, index) {
|
|
1072
|
+
return (buffer[index] & 255) / 255;
|
|
1073
|
+
}
|
|
1074
|
+
function setRgb2(buffer, base, r, g, b) {
|
|
1075
|
+
const a = buffer[base + 3] & 255;
|
|
1076
|
+
buffer[base] = toU82(r);
|
|
1077
|
+
buffer[base + 1] = toU82(g);
|
|
1078
|
+
buffer[base + 2] = toU82(b);
|
|
1079
|
+
buffer[base + 3] = a;
|
|
1080
|
+
}
|
|
1069
1081
|
function applyScanlines(buffer, strength = 0.8, step = 2) {
|
|
1070
1082
|
if (strength === 1 || step < 1)
|
|
1071
1083
|
return;
|
|
@@ -1165,7 +1177,7 @@ function applyNoise(buffer, strength = 0.1) {
|
|
|
1165
1177
|
function applyChromaticAberration(buffer, strength = 1) {
|
|
1166
1178
|
const width = buffer.width;
|
|
1167
1179
|
const height = buffer.height;
|
|
1168
|
-
const srcFg =
|
|
1180
|
+
const srcFg = Uint16Array.from(buffer.buffers.fg);
|
|
1169
1181
|
const destFg = buffer.buffers.fg;
|
|
1170
1182
|
const centerX = width / 2;
|
|
1171
1183
|
const centerY = height / 2;
|
|
@@ -1180,9 +1192,7 @@ function applyChromaticAberration(buffer, strength = 1) {
|
|
|
1180
1192
|
const gIndex = (y * width + x) * 4;
|
|
1181
1193
|
const bIndex = (y * width + bX) * 4;
|
|
1182
1194
|
const destIndex = (y * width + x) * 4;
|
|
1183
|
-
destFg
|
|
1184
|
-
destFg[destIndex + 1] = srcFg[gIndex + 1];
|
|
1185
|
-
destFg[destIndex + 2] = srcFg[bIndex + 2];
|
|
1195
|
+
setRgb2(destFg, destIndex, channel2(srcFg, rIndex), channel2(srcFg, gIndex + 1), channel2(srcFg, bIndex + 2));
|
|
1186
1196
|
}
|
|
1187
1197
|
}
|
|
1188
1198
|
}
|
|
@@ -1196,9 +1206,9 @@ function applyAsciiArt(buffer, ramp = ' .\'`^"",:;Il!i><~+_-?][}{1)(|\\/tfjrxnuv
|
|
|
1196
1206
|
for (let x = 0;x < width; x++) {
|
|
1197
1207
|
const index = y * width + x;
|
|
1198
1208
|
const colorIndex = index * 4;
|
|
1199
|
-
const bgR = bg2
|
|
1200
|
-
const bgG = bg2
|
|
1201
|
-
const bgB = bg2
|
|
1209
|
+
const bgR = channel2(bg2, colorIndex);
|
|
1210
|
+
const bgG = channel2(bg2, colorIndex + 1);
|
|
1211
|
+
const bgB = channel2(bg2, colorIndex + 2);
|
|
1202
1212
|
const lum = 0.299 * bgR + 0.587 * bgG + 0.114 * bgB;
|
|
1203
1213
|
const rampIndex = Math.min(rampLength - 1, Math.floor(lum * rampLength));
|
|
1204
1214
|
chars[index] = ramp[rampIndex].charCodeAt(0);
|
|
@@ -1379,16 +1389,16 @@ class BloomEffect {
|
|
|
1379
1389
|
return;
|
|
1380
1390
|
const width = buffer.width;
|
|
1381
1391
|
const height = buffer.height;
|
|
1382
|
-
const srcFg =
|
|
1383
|
-
const srcBg =
|
|
1392
|
+
const srcFg = Uint16Array.from(buffer.buffers.fg);
|
|
1393
|
+
const srcBg = Uint16Array.from(buffer.buffers.bg);
|
|
1384
1394
|
const destFg = buffer.buffers.fg;
|
|
1385
1395
|
const destBg = buffer.buffers.bg;
|
|
1386
1396
|
const brightPixels = [];
|
|
1387
1397
|
for (let y = 0;y < height; y++) {
|
|
1388
1398
|
for (let x = 0;x < width; x++) {
|
|
1389
1399
|
const index = (y * width + x) * 4;
|
|
1390
|
-
const fgLum = 0.299 * srcFg
|
|
1391
|
-
const bgLum = 0.299 * srcBg
|
|
1400
|
+
const fgLum = 0.299 * channel2(srcFg, index) + 0.587 * channel2(srcFg, index + 1) + 0.114 * channel2(srcFg, index + 2);
|
|
1401
|
+
const bgLum = 0.299 * channel2(srcBg, index) + 0.587 * channel2(srcBg, index + 1) + 0.114 * channel2(srcBg, index + 2);
|
|
1392
1402
|
const lum = Math.max(fgLum, bgLum);
|
|
1393
1403
|
if (lum > threshold) {
|
|
1394
1404
|
const intensity = (lum - threshold) / (1 - threshold + 0.000001);
|
|
@@ -1414,12 +1424,8 @@ class BloomEffect {
|
|
|
1414
1424
|
const falloff = 1 - distSq / radiusSq;
|
|
1415
1425
|
const bloomAmount = bright.intensity * strength * falloff;
|
|
1416
1426
|
const destIndex = (sampleY * width + sampleX) * 4;
|
|
1417
|
-
destFg
|
|
1418
|
-
|
|
1419
|
-
destFg[destIndex + 2] = Math.min(1, destFg[destIndex + 2] + bloomAmount);
|
|
1420
|
-
destBg[destIndex] = Math.min(1, destBg[destIndex] + bloomAmount);
|
|
1421
|
-
destBg[destIndex + 1] = Math.min(1, destBg[destIndex + 1] + bloomAmount);
|
|
1422
|
-
destBg[destIndex + 2] = Math.min(1, destBg[destIndex + 2] + bloomAmount);
|
|
1427
|
+
setRgb2(destFg, destIndex, Math.min(1, channel2(destFg, destIndex) + bloomAmount), Math.min(1, channel2(destFg, destIndex + 1) + bloomAmount), Math.min(1, channel2(destFg, destIndex + 2) + bloomAmount));
|
|
1428
|
+
setRgb2(destBg, destIndex, Math.min(1, channel2(destBg, destIndex) + bloomAmount), Math.min(1, channel2(destBg, destIndex + 1) + bloomAmount), Math.min(1, channel2(destBg, destIndex + 2) + bloomAmount));
|
|
1423
1429
|
}
|
|
1424
1430
|
}
|
|
1425
1431
|
}
|
|
@@ -4889,7 +4895,7 @@ class DiffRenderable extends Renderable {
|
|
|
4889
4895
|
}
|
|
4890
4896
|
}
|
|
4891
4897
|
// src/renderables/Textarea.ts
|
|
4892
|
-
var
|
|
4898
|
+
var defaultTextareaKeyBindings = [
|
|
4893
4899
|
{ name: "left", action: "move-left" },
|
|
4894
4900
|
{ name: "right", action: "move-right" },
|
|
4895
4901
|
{ name: "up", action: "move-up" },
|
|
@@ -4991,7 +4997,7 @@ class TextareaRenderable extends EditBufferRenderable {
|
|
|
4991
4997
|
this._placeholderColor = parseColor(options.placeholderColor ?? defaults.placeholderColor);
|
|
4992
4998
|
this._keyAliasMap = mergeKeyAliases(defaultKeyAliases, options.keyAliasMap || {});
|
|
4993
4999
|
this._keyBindings = options.keyBindings || [];
|
|
4994
|
-
const mergedBindings = mergeKeyBindings(
|
|
5000
|
+
const mergedBindings = mergeKeyBindings(defaultTextareaKeyBindings, this._keyBindings);
|
|
4995
5001
|
this._keyBindingsMap = buildKeyBindingsMap(mergedBindings, this._keyAliasMap);
|
|
4996
5002
|
this._actionHandlers = this.buildActionHandlers();
|
|
4997
5003
|
this._submitListener = options.onSubmit;
|
|
@@ -5059,11 +5065,13 @@ class TextareaRenderable extends EditBufferRenderable {
|
|
|
5059
5065
|
this.insertText(stripAnsiSequences(decodePasteBytes(event.bytes)));
|
|
5060
5066
|
}
|
|
5061
5067
|
handleKeyPress(key) {
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5068
|
+
if (this.traits.suspend !== true) {
|
|
5069
|
+
const action = getKeyBindingAction(this._keyBindingsMap, key);
|
|
5070
|
+
if (action) {
|
|
5071
|
+
const handler = this._actionHandlers.get(action);
|
|
5072
|
+
if (handler) {
|
|
5073
|
+
return handler();
|
|
5074
|
+
}
|
|
5067
5075
|
}
|
|
5068
5076
|
}
|
|
5069
5077
|
if (!key.ctrl && !key.meta && !key.super && !key.hyper) {
|
|
@@ -5177,12 +5185,12 @@ class TextareaRenderable extends EditBufferRenderable {
|
|
|
5177
5185
|
}
|
|
5178
5186
|
set keyBindings(bindings) {
|
|
5179
5187
|
this._keyBindings = bindings;
|
|
5180
|
-
const mergedBindings = mergeKeyBindings(
|
|
5188
|
+
const mergedBindings = mergeKeyBindings(defaultTextareaKeyBindings, bindings);
|
|
5181
5189
|
this._keyBindingsMap = buildKeyBindingsMap(mergedBindings, this._keyAliasMap);
|
|
5182
5190
|
}
|
|
5183
5191
|
set keyAliasMap(aliases) {
|
|
5184
5192
|
this._keyAliasMap = mergeKeyAliases(defaultKeyAliases, aliases);
|
|
5185
|
-
const mergedBindings = mergeKeyBindings(
|
|
5193
|
+
const mergedBindings = mergeKeyBindings(defaultTextareaKeyBindings, this._keyBindings);
|
|
5186
5194
|
this._keyBindingsMap = buildKeyBindingsMap(mergedBindings, this._keyAliasMap);
|
|
5187
5195
|
}
|
|
5188
5196
|
get extmarks() {
|
|
@@ -6141,7 +6149,15 @@ class TextTableRenderable extends Renderable {
|
|
|
6141
6149
|
for (let colIdx = 0;colIdx < this._columnCount; colIdx++) {
|
|
6142
6150
|
const cellX = (colOffsets[colIdx] ?? 0) + 1;
|
|
6143
6151
|
const colWidth = colWidths[colIdx] ?? 1;
|
|
6144
|
-
|
|
6152
|
+
if (this._backgroundColor.a < 1) {
|
|
6153
|
+
for (let y = cellY;y < cellY + rowHeight; y++) {
|
|
6154
|
+
for (let x = cellX;x < cellX + colWidth; x++) {
|
|
6155
|
+
buffer.setCell(x, y, " ", this._defaultFg, this._backgroundColor, this._defaultAttributes);
|
|
6156
|
+
}
|
|
6157
|
+
}
|
|
6158
|
+
} else {
|
|
6159
|
+
buffer.fillRect(cellX, cellY, colWidth, rowHeight, this._backgroundColor);
|
|
6160
|
+
}
|
|
6145
6161
|
}
|
|
6146
6162
|
}
|
|
6147
6163
|
}
|
|
@@ -6181,6 +6197,11 @@ class TextTableRenderable extends Renderable {
|
|
|
6181
6197
|
return { rowIdx, colIdx };
|
|
6182
6198
|
}
|
|
6183
6199
|
applySelectionToCells(localSelection, isStart) {
|
|
6200
|
+
if (localSelection.anchorX === localSelection.focusX && localSelection.anchorY === localSelection.focusY) {
|
|
6201
|
+
this.resetCellSelections();
|
|
6202
|
+
this._lastSelectionMode = null;
|
|
6203
|
+
return;
|
|
6204
|
+
}
|
|
6184
6205
|
const minSelY = Math.min(localSelection.anchorY, localSelection.focusY);
|
|
6185
6206
|
const maxSelY = Math.max(localSelection.anchorY, localSelection.focusY);
|
|
6186
6207
|
const firstRow = this.findRowForLocalY(minSelY);
|
|
@@ -6211,6 +6232,10 @@ class TextTableRenderable extends Renderable {
|
|
|
6211
6232
|
focusY: localSelection.focusY - cellTop
|
|
6212
6233
|
};
|
|
6213
6234
|
const isAnchorCell = selection.anchorCell !== null && selection.anchorCell.rowIdx === rowIdx && selection.anchorCell.colIdx === colIdx;
|
|
6235
|
+
if (selection.mode === "single-cell" && !isAnchorCell) {
|
|
6236
|
+
cell.textBufferView.resetLocalSelection();
|
|
6237
|
+
continue;
|
|
6238
|
+
}
|
|
6214
6239
|
const forceSet = isAnchorCell && selection.mode !== "single-cell";
|
|
6215
6240
|
if (forceSet) {
|
|
6216
6241
|
coords = this.getFullCellSelectionCoords(rowIdx, colIdx);
|
|
@@ -10747,7 +10772,7 @@ class TimeToFirstDrawRenderable extends Renderable {
|
|
|
10747
10772
|
return Math.max(0, Math.floor(value));
|
|
10748
10773
|
}
|
|
10749
10774
|
}
|
|
10750
|
-
export { DistortionEffect, VignetteEffect, CloudsEffect, FlamesEffect, CRTRollingBarEffect, RainbowTextEffect, applyScanlines, applyInvert, applyNoise, applyChromaticAberration, applyAsciiArt, applyBrightness, applyGain, applySaturation, BloomEffect, SEPIA_MATRIX, PROTANOPIA_SIM_MATRIX, DEUTERANOPIA_SIM_MATRIX, TRITANOPIA_SIM_MATRIX, ACHROMATOPSIA_MATRIX, PROTANOPIA_COMP_MATRIX, DEUTERANOPIA_COMP_MATRIX, TRITANOPIA_COMP_MATRIX, TECHNICOLOR_MATRIX, SOLARIZATION_MATRIX, SYNTHWAVE_MATRIX, GREENSCALE_MATRIX, GRAYSCALE_MATRIX, INVERT_MATRIX, Timeline, engine, createTimeline, SlotRegistry, createSlotRegistry, createCoreSlotRegistry, registerCorePlugin, resolveCoreSlot, SlotRenderable, NativeSpanFeed, FrameBufferRenderable, ASCIIFontRenderable, Generic, Box, Text, ASCIIFont, Input, Select, TabSelect, FrameBuffer, Code, ScrollBox, vstyles, VRenderable, LineNumberRenderable, DiffRenderable, TextareaRenderable, InputRenderableEvents, InputRenderable, TextTableRenderable, MarkdownRenderable, SliderRenderable, ScrollBarRenderable, ArrowRenderable, ScrollBoxRenderable, SelectRenderableEvents, SelectRenderable, TabSelectRenderableEvents, TabSelectRenderable, TimeToFirstDrawRenderable, exports_src2 as exports_src };
|
|
10775
|
+
export { DistortionEffect, VignetteEffect, CloudsEffect, FlamesEffect, CRTRollingBarEffect, RainbowTextEffect, applyScanlines, applyInvert, applyNoise, applyChromaticAberration, applyAsciiArt, applyBrightness, applyGain, applySaturation, BloomEffect, SEPIA_MATRIX, PROTANOPIA_SIM_MATRIX, DEUTERANOPIA_SIM_MATRIX, TRITANOPIA_SIM_MATRIX, ACHROMATOPSIA_MATRIX, PROTANOPIA_COMP_MATRIX, DEUTERANOPIA_COMP_MATRIX, TRITANOPIA_COMP_MATRIX, TECHNICOLOR_MATRIX, SOLARIZATION_MATRIX, SYNTHWAVE_MATRIX, GREENSCALE_MATRIX, GRAYSCALE_MATRIX, INVERT_MATRIX, Timeline, engine, createTimeline, SlotRegistry, createSlotRegistry, createCoreSlotRegistry, registerCorePlugin, resolveCoreSlot, SlotRenderable, NativeSpanFeed, FrameBufferRenderable, ASCIIFontRenderable, Generic, Box, Text, ASCIIFont, Input, Select, TabSelect, FrameBuffer, Code, ScrollBox, vstyles, VRenderable, LineNumberRenderable, DiffRenderable, defaultTextareaKeyBindings, TextareaRenderable, InputRenderableEvents, InputRenderable, TextTableRenderable, MarkdownRenderable, SliderRenderable, ScrollBarRenderable, ArrowRenderable, ScrollBoxRenderable, SelectRenderableEvents, SelectRenderable, TabSelectRenderableEvents, TabSelectRenderable, TimeToFirstDrawRenderable, exports_src2 as exports_src };
|
|
10751
10776
|
|
|
10752
|
-
//# debugId=
|
|
10753
|
-
//# sourceMappingURL=index-
|
|
10777
|
+
//# debugId=1EC456BC9A30AA3564756E2164756E21
|
|
10778
|
+
//# sourceMappingURL=index-mch6dv67.js.map
|