@opentui/core 0.5.6 → 0.5.8
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/README.md +44 -37
- package/{chunk-bun-9335djz2.js → chunk-bun-2956gvaq.js} +131 -57
- package/{chunk-bun-9335djz2.js.map → chunk-bun-2956gvaq.js.map} +8 -8
- package/{chunk-bun-da1keqyp.js → chunk-bun-b3exa82d.js} +132 -58
- package/chunk-bun-b3exa82d.js.map +32 -0
- package/{chunk-node-ks0581vk.js → chunk-node-kr27pp2p.js} +132 -58
- package/chunk-node-kr27pp2p.js.map +32 -0
- package/{chunk-node-2h23nsbj.js → chunk-node-mfda59vq.js} +131 -57
- package/{chunk-node-2h23nsbj.js.map → chunk-node-mfda59vq.js.map} +8 -8
- package/editor-view.d.ts +9 -2
- package/index.bun.js +4 -4
- package/index.bun.js.map +3 -3
- package/index.node.js +4 -4
- package/index.node.js.map +3 -3
- package/lib/selection.d.ts +4 -2
- package/package.json +9 -9
- package/renderables/EditBufferRenderable.d.ts +5 -1
- package/renderer.d.ts +5 -2
- package/testing.bun.js +2 -2
- package/testing.js +2 -2
- package/text-buffer-view.d.ts +5 -2
- package/types.d.ts +11 -2
- package/yoga.bun.js +1 -1
- package/yoga.js +1 -1
- package/zig-structs.d.ts +1 -0
- package/zig.d.ts +12 -5
- package/chunk-bun-da1keqyp.js.map +0 -32
- package/chunk-node-ks0581vk.js.map +0 -32
|
@@ -5996,7 +5996,7 @@ class MouseParser {
|
|
|
5996
5996
|
if (type === "down" && button !== 3) {
|
|
5997
5997
|
this.mouseButtonsPressed.add(button);
|
|
5998
5998
|
} else if (type === "up") {
|
|
5999
|
-
this.mouseButtonsPressed.
|
|
5999
|
+
this.mouseButtonsPressed.delete(button);
|
|
6000
6000
|
}
|
|
6001
6001
|
}
|
|
6002
6002
|
return {
|
|
@@ -6071,9 +6071,11 @@ class Selection {
|
|
|
6071
6071
|
_isActive = true;
|
|
6072
6072
|
_isDragging = true;
|
|
6073
6073
|
_isStart = false;
|
|
6074
|
-
|
|
6074
|
+
behavior;
|
|
6075
|
+
constructor(anchorRenderable, anchor, focus, behavior = "cell") {
|
|
6075
6076
|
this._anchor = new SelectionAnchor(anchorRenderable, anchor.x, anchor.y);
|
|
6076
6077
|
this._focus = { ...focus };
|
|
6078
|
+
this.behavior = behavior;
|
|
6077
6079
|
}
|
|
6078
6080
|
get isStart() {
|
|
6079
6081
|
return this._isStart;
|
|
@@ -6164,7 +6166,8 @@ function convertGlobalToLocalSelection(globalSelection, localX, localY) {
|
|
|
6164
6166
|
anchorY: globalSelection.anchor.y - localY,
|
|
6165
6167
|
focusX: globalSelection.focus.x - localX,
|
|
6166
6168
|
focusY: globalSelection.focus.y - localY,
|
|
6167
|
-
isActive: true
|
|
6169
|
+
isActive: true,
|
|
6170
|
+
behavior: globalSelection.behavior
|
|
6168
6171
|
};
|
|
6169
6172
|
}
|
|
6170
6173
|
|
|
@@ -6199,36 +6202,37 @@ class ASCIIFontSelectionHelper {
|
|
|
6199
6202
|
}
|
|
6200
6203
|
const text = this.getText();
|
|
6201
6204
|
const font = this.getFont();
|
|
6202
|
-
const
|
|
6203
|
-
const
|
|
6204
|
-
|
|
6205
|
+
const positions = getCharacterPositions(text, font);
|
|
6206
|
+
const minY = Math.min(localSelection.anchorY, localSelection.focusY);
|
|
6207
|
+
const maxY = Math.max(localSelection.anchorY, localSelection.focusY);
|
|
6208
|
+
if (maxY < 0 || minY > height - 1) {
|
|
6205
6209
|
this.localSelection = null;
|
|
6206
6210
|
return previousSelection !== null;
|
|
6207
6211
|
}
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6212
|
+
const indexAt = (x, y) => {
|
|
6213
|
+
if (y < 0)
|
|
6214
|
+
return 0;
|
|
6215
|
+
if (y > height - 1)
|
|
6216
|
+
return text.length;
|
|
6217
|
+
if (x < 0)
|
|
6218
|
+
return 0;
|
|
6219
|
+
if (x >= width)
|
|
6220
|
+
return text.length;
|
|
6221
|
+
for (let index = 1;index < positions.length; index += 1) {
|
|
6222
|
+
if (x < positions[index])
|
|
6223
|
+
return index - 1;
|
|
6216
6224
|
}
|
|
6217
|
-
|
|
6218
|
-
|
|
6225
|
+
return text.length;
|
|
6226
|
+
};
|
|
6227
|
+
const anchorIndex = indexAt(localSelection.anchorX, localSelection.anchorY);
|
|
6228
|
+
const focusIndex = indexAt(localSelection.focusX, localSelection.focusY);
|
|
6229
|
+
const start = Math.min(anchorIndex, focusIndex);
|
|
6230
|
+
const end = Math.min(Math.max(anchorIndex, focusIndex) + 1, text.length);
|
|
6231
|
+
const samePoint = localSelection.anchorX === localSelection.focusX && localSelection.anchorY === localSelection.focusY;
|
|
6232
|
+
if (samePoint || start >= end) {
|
|
6219
6233
|
this.localSelection = null;
|
|
6220
|
-
return previousSelection !== null;
|
|
6221
|
-
} else if (selEnd.y >= 0 && selEnd.y <= height - 1) {
|
|
6222
|
-
if (selEnd.x >= 0) {
|
|
6223
|
-
endCharIndex = coordinateToCharacterIndex(selEnd.x, text, font);
|
|
6224
|
-
} else {
|
|
6225
|
-
endCharIndex = 0;
|
|
6226
|
-
}
|
|
6227
|
-
}
|
|
6228
|
-
if (startCharIndex < endCharIndex && startCharIndex >= 0 && endCharIndex <= text.length) {
|
|
6229
|
-
this.localSelection = { start: startCharIndex, end: endCharIndex };
|
|
6230
6234
|
} else {
|
|
6231
|
-
this.localSelection =
|
|
6235
|
+
this.localSelection = { start, end };
|
|
6232
6236
|
}
|
|
6233
6237
|
return previousSelection?.start !== this.localSelection?.start || previousSelection?.end !== this.localSelection?.end;
|
|
6234
6238
|
}
|
|
@@ -13095,7 +13099,7 @@ var VisualCursorStruct = defineStruct([
|
|
|
13095
13099
|
["logicalCol", "u32"],
|
|
13096
13100
|
["offset", "u32"]
|
|
13097
13101
|
]);
|
|
13098
|
-
var UnicodeMethodEnum = defineEnum({ wcwidth: 0, unicode: 1 }, "u8");
|
|
13102
|
+
var UnicodeMethodEnum = defineEnum({ wcwidth: 0, unicode: 1, "unicode-wide": 3 }, "u8");
|
|
13099
13103
|
var TerminalMultiplexerEnum = defineEnum({ none: 0, tmux: 1, zellij: 2, screen: 3, unknown: 4 }, "u8");
|
|
13100
13104
|
var Osc52SupportEnum = defineEnum({ unknown: 0, supported: 1, unsupported: 2 }, "u8");
|
|
13101
13105
|
var ImageProtocolEnum = defineEnum({ auto: 0, kitty: 1, sixel: 2, blocks: 3 }, "u8");
|
|
@@ -13563,6 +13567,20 @@ function rgbaBuffer(value) {
|
|
|
13563
13567
|
function optionalRgbaBuffer(value) {
|
|
13564
13568
|
return value ? rgbaBuffer(value) : null;
|
|
13565
13569
|
}
|
|
13570
|
+
function selectionBehaviorByte(behavior) {
|
|
13571
|
+
return behavior === "word" ? 1 : behavior === "line" ? 2 : 0;
|
|
13572
|
+
}
|
|
13573
|
+
function editorLocalSelectionFlags(updateCursor, followCursor, behavior) {
|
|
13574
|
+
return ffiBool(updateCursor) | ffiBool(followCursor) << 1 | selectionBehaviorByte(behavior) << 2;
|
|
13575
|
+
}
|
|
13576
|
+
function widthMethodCode(widthMethod) {
|
|
13577
|
+
return widthMethod === "wcwidth" ? 0 : widthMethod === "unicode-wide" ? 3 : 1;
|
|
13578
|
+
}
|
|
13579
|
+
function widthMethodFromCode(code) {
|
|
13580
|
+
if (code === 0)
|
|
13581
|
+
return "wcwidth";
|
|
13582
|
+
return code === 3 ? "unicode-wide" : "unicode";
|
|
13583
|
+
}
|
|
13566
13584
|
function getOpenTUILib(libPath) {
|
|
13567
13585
|
const resolvedLibPath = libPath || targetLibPath;
|
|
13568
13586
|
if (!resolvedLibPath) {
|
|
@@ -13730,7 +13748,7 @@ function getOpenTUILib(libPath) {
|
|
|
13730
13748
|
returns: "u64"
|
|
13731
13749
|
},
|
|
13732
13750
|
commitSplitFooterSnapshot: {
|
|
13733
|
-
args: ["u32", "u32", "u32", "
|
|
13751
|
+
args: ["u32", "u32", "u32", "u8", "u32"],
|
|
13734
13752
|
returns: "u64"
|
|
13735
13753
|
},
|
|
13736
13754
|
getNextBuffer: {
|
|
@@ -13754,7 +13772,7 @@ function getOpenTUILib(libPath) {
|
|
|
13754
13772
|
returns: "void"
|
|
13755
13773
|
},
|
|
13756
13774
|
createOptimizedBuffer: {
|
|
13757
|
-
args: ["u32", "u32", "
|
|
13775
|
+
args: ["u32", "u32", "u8", "u8", "buffer", "u32"],
|
|
13758
13776
|
returns: "u32"
|
|
13759
13777
|
},
|
|
13760
13778
|
destroyOptimizedBuffer: {
|
|
@@ -13773,6 +13791,10 @@ function getOpenTUILib(libPath) {
|
|
|
13773
13791
|
args: ["u32"],
|
|
13774
13792
|
returns: "u32"
|
|
13775
13793
|
},
|
|
13794
|
+
getBufferWidthMethod: {
|
|
13795
|
+
args: ["u32"],
|
|
13796
|
+
returns: "u8"
|
|
13797
|
+
},
|
|
13776
13798
|
bufferClear: {
|
|
13777
13799
|
args: ["u32", "buffer"],
|
|
13778
13800
|
returns: "void"
|
|
@@ -13878,7 +13900,7 @@ function getOpenTUILib(libPath) {
|
|
|
13878
13900
|
returns: "void"
|
|
13879
13901
|
},
|
|
13880
13902
|
setDebugOverlay: {
|
|
13881
|
-
args: ["u32", "
|
|
13903
|
+
args: ["u32", "u8", "u8"],
|
|
13882
13904
|
returns: "void"
|
|
13883
13905
|
},
|
|
13884
13906
|
clearTerminal: {
|
|
@@ -14285,7 +14307,7 @@ function getOpenTUILib(libPath) {
|
|
|
14285
14307
|
returns: "u64"
|
|
14286
14308
|
},
|
|
14287
14309
|
textBufferViewSetLocalSelection: {
|
|
14288
|
-
args: ["u32", "i32", "i32", "i32", "i32", "ptr", "ptr"],
|
|
14310
|
+
args: ["u32", "i32", "i32", "i32", "i32", "ptr", "ptr", "u8"],
|
|
14289
14311
|
returns: "bool"
|
|
14290
14312
|
},
|
|
14291
14313
|
textBufferViewUpdateSelection: {
|
|
@@ -14293,13 +14315,21 @@ function getOpenTUILib(libPath) {
|
|
|
14293
14315
|
returns: "void"
|
|
14294
14316
|
},
|
|
14295
14317
|
textBufferViewUpdateLocalSelection: {
|
|
14296
|
-
args: ["u32", "i32", "i32", "i32", "i32", "ptr", "ptr"],
|
|
14318
|
+
args: ["u32", "i32", "i32", "i32", "i32", "ptr", "ptr", "u8"],
|
|
14297
14319
|
returns: "bool"
|
|
14298
14320
|
},
|
|
14299
14321
|
textBufferViewResetLocalSelection: {
|
|
14300
14322
|
args: ["u32"],
|
|
14301
14323
|
returns: "void"
|
|
14302
14324
|
},
|
|
14325
|
+
textBufferViewSetSelectionOccupancy: {
|
|
14326
|
+
args: ["u32", "u8"],
|
|
14327
|
+
returns: "void"
|
|
14328
|
+
},
|
|
14329
|
+
textBufferViewGetSelectionOccupancy: {
|
|
14330
|
+
args: ["u32"],
|
|
14331
|
+
returns: "u8"
|
|
14332
|
+
},
|
|
14303
14333
|
textBufferViewSetWrapWidth: {
|
|
14304
14334
|
args: ["u32", "u32"],
|
|
14305
14335
|
returns: "void"
|
|
@@ -14585,7 +14615,7 @@ function getOpenTUILib(libPath) {
|
|
|
14585
14615
|
returns: "u64"
|
|
14586
14616
|
},
|
|
14587
14617
|
editorViewSetLocalSelection: {
|
|
14588
|
-
args: ["u32", "i32", "i32", "i32", "i32", "ptr", "ptr", "
|
|
14618
|
+
args: ["u32", "i32", "i32", "i32", "i32", "ptr", "ptr", "u8"],
|
|
14589
14619
|
returns: "bool"
|
|
14590
14620
|
},
|
|
14591
14621
|
editorViewUpdateSelection: {
|
|
@@ -14593,13 +14623,29 @@ function getOpenTUILib(libPath) {
|
|
|
14593
14623
|
returns: "void"
|
|
14594
14624
|
},
|
|
14595
14625
|
editorViewUpdateLocalSelection: {
|
|
14596
|
-
args: ["u32", "i32", "i32", "i32", "i32", "ptr", "ptr", "
|
|
14626
|
+
args: ["u32", "i32", "i32", "i32", "i32", "ptr", "ptr", "u8"],
|
|
14597
14627
|
returns: "bool"
|
|
14598
14628
|
},
|
|
14599
14629
|
editorViewResetLocalSelection: {
|
|
14600
14630
|
args: ["u32"],
|
|
14601
14631
|
returns: "void"
|
|
14602
14632
|
},
|
|
14633
|
+
editorViewConvertSelectionToCell: {
|
|
14634
|
+
args: ["u32"],
|
|
14635
|
+
returns: "bool"
|
|
14636
|
+
},
|
|
14637
|
+
editorViewSetSelectionOccupancy: {
|
|
14638
|
+
args: ["u32", "u8"],
|
|
14639
|
+
returns: "void"
|
|
14640
|
+
},
|
|
14641
|
+
editorViewSetSelectionInclusive: {
|
|
14642
|
+
args: ["u32", "u32", "u32", "ptr", "ptr"],
|
|
14643
|
+
returns: "void"
|
|
14644
|
+
},
|
|
14645
|
+
editorViewSetSelectionColors: {
|
|
14646
|
+
args: ["u32", "ptr", "ptr"],
|
|
14647
|
+
returns: "void"
|
|
14648
|
+
},
|
|
14603
14649
|
editorViewGetSelectedTextBytes: {
|
|
14604
14650
|
args: ["u32", "ptr", "u32"],
|
|
14605
14651
|
returns: "u32"
|
|
@@ -14652,6 +14698,10 @@ function getOpenTUILib(libPath) {
|
|
|
14652
14698
|
args: ["u32", "ptr"],
|
|
14653
14699
|
returns: "void"
|
|
14654
14700
|
},
|
|
14701
|
+
editorViewGotoVisualLineEnd: {
|
|
14702
|
+
args: ["u32"],
|
|
14703
|
+
returns: "void"
|
|
14704
|
+
},
|
|
14655
14705
|
editorViewSetPlaceholderStyledText: {
|
|
14656
14706
|
args: ["u32", "ptr", "u32"],
|
|
14657
14707
|
returns: "void"
|
|
@@ -15096,7 +15146,7 @@ function getOpenTUILib(libPath) {
|
|
|
15096
15146
|
returns: "i32"
|
|
15097
15147
|
},
|
|
15098
15148
|
audioEnableTap: {
|
|
15099
|
-
args: ["u32", "
|
|
15149
|
+
args: ["u32", "u8", "u32"],
|
|
15100
15150
|
returns: "i32"
|
|
15101
15151
|
},
|
|
15102
15152
|
audioReadTap: {
|
|
@@ -15721,7 +15771,8 @@ class FFIRenderLib {
|
|
|
15721
15771
|
}
|
|
15722
15772
|
const width = this.opentui.symbols.getBufferWidth(bufferPtr);
|
|
15723
15773
|
const height = this.opentui.symbols.getBufferHeight(bufferPtr);
|
|
15724
|
-
|
|
15774
|
+
const widthMethod = widthMethodFromCode(this.opentui.symbols.getBufferWidthMethod(bufferPtr));
|
|
15775
|
+
return new OptimizedBuffer(this, bufferPtr, width, height, { id: "next buffer", widthMethod });
|
|
15725
15776
|
}
|
|
15726
15777
|
getCurrentBuffer(renderer) {
|
|
15727
15778
|
const bufferPtr = this.opentui.symbols.getCurrentBuffer(renderer);
|
|
@@ -15730,7 +15781,8 @@ class FFIRenderLib {
|
|
|
15730
15781
|
}
|
|
15731
15782
|
const width = this.opentui.symbols.getBufferWidth(bufferPtr);
|
|
15732
15783
|
const height = this.opentui.symbols.getBufferHeight(bufferPtr);
|
|
15733
|
-
|
|
15784
|
+
const widthMethod = widthMethodFromCode(this.opentui.symbols.getBufferWidthMethod(bufferPtr));
|
|
15785
|
+
return new OptimizedBuffer(this, bufferPtr, width, height, { id: "current buffer", widthMethod });
|
|
15734
15786
|
}
|
|
15735
15787
|
rendererSetPaletteState(renderer, palette, defaultForeground, defaultBackground, paletteEpoch) {
|
|
15736
15788
|
const paletteBuffer = new Uint16Array(palette.length * 4);
|
|
@@ -15927,16 +15979,16 @@ class FFIRenderLib {
|
|
|
15927
15979
|
return this.unpackRenderOperationResult(this.opentui.symbols.repaintSplitFooter(renderer, pinnedRenderOffset, ffiBool(force)));
|
|
15928
15980
|
}
|
|
15929
15981
|
commitSplitFooterSnapshot(renderer, snapshot, rowColumns, startOnNewLine, trailingNewline, pinnedRenderOffset, force, beginFrame = true, finalizeFrame = true) {
|
|
15930
|
-
|
|
15982
|
+
const flags = ffiBool(startOnNewLine) | ffiBool(trailingNewline) << 1 | ffiBool(force) << 2 | ffiBool(beginFrame) << 3 | ffiBool(finalizeFrame) << 4;
|
|
15983
|
+
return this.unpackRenderOperationResult(this.opentui.symbols.commitSplitFooterSnapshot(renderer, snapshot.ptr, rowColumns, flags, pinnedRenderOffset));
|
|
15931
15984
|
}
|
|
15932
15985
|
createOptimizedBuffer(width, height, widthMethod, respectAlpha = false, id) {
|
|
15933
15986
|
if (Number.isNaN(width) || Number.isNaN(height)) {
|
|
15934
15987
|
console.error(new Error(`Invalid dimensions for OptimizedBuffer: ${width}x${height}`).stack);
|
|
15935
15988
|
}
|
|
15936
|
-
const widthMethodCode = widthMethod === "wcwidth" ? 0 : 1;
|
|
15937
15989
|
const idToUse = id || "unnamed buffer";
|
|
15938
15990
|
const idBytes = this.encoder.encode(idToUse);
|
|
15939
|
-
const bufferPtr = this.opentui.symbols.createOptimizedBuffer(width, height, ffiBool(respectAlpha), widthMethodCode, idBytes, idBytes.byteLength);
|
|
15991
|
+
const bufferPtr = this.opentui.symbols.createOptimizedBuffer(width, height, ffiBool(respectAlpha), widthMethodCode(widthMethod), idBytes, idBytes.byteLength);
|
|
15940
15992
|
if (!bufferPtr) {
|
|
15941
15993
|
throw new Error(`Failed to create optimized buffer: ${width}x${height}`);
|
|
15942
15994
|
}
|
|
@@ -16326,8 +16378,7 @@ class FFIRenderLib {
|
|
|
16326
16378
|
});
|
|
16327
16379
|
}
|
|
16328
16380
|
createTextBuffer(widthMethod) {
|
|
16329
|
-
const
|
|
16330
|
-
const bufferPtr = this.opentui.symbols.createTextBuffer(widthMethodCode);
|
|
16381
|
+
const bufferPtr = this.opentui.symbols.createTextBuffer(widthMethodCode(widthMethod));
|
|
16331
16382
|
if (!bufferPtr) {
|
|
16332
16383
|
throw new Error(`Failed to create TextBuffer`);
|
|
16333
16384
|
}
|
|
@@ -16465,24 +16516,30 @@ class FFIRenderLib {
|
|
|
16465
16516
|
textBufferViewGetSelectionInfo(view) {
|
|
16466
16517
|
return this.opentui.symbols.textBufferViewGetSelectionInfo(view);
|
|
16467
16518
|
}
|
|
16468
|
-
textBufferViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor) {
|
|
16519
|
+
textBufferViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, behavior) {
|
|
16469
16520
|
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16470
16521
|
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16471
|
-
return Boolean(this.opentui.symbols.textBufferViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2));
|
|
16522
|
+
return Boolean(this.opentui.symbols.textBufferViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, selectionBehaviorByte(behavior)));
|
|
16472
16523
|
}
|
|
16473
16524
|
textBufferViewUpdateSelection(view, end, bgColor, fgColor) {
|
|
16474
16525
|
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16475
16526
|
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16476
16527
|
this.opentui.symbols.textBufferViewUpdateSelection(view, end, bg2, fg2);
|
|
16477
16528
|
}
|
|
16478
|
-
textBufferViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor) {
|
|
16529
|
+
textBufferViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, behavior) {
|
|
16479
16530
|
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16480
16531
|
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16481
|
-
return Boolean(this.opentui.symbols.textBufferViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2));
|
|
16532
|
+
return Boolean(this.opentui.symbols.textBufferViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, selectionBehaviorByte(behavior)));
|
|
16482
16533
|
}
|
|
16483
16534
|
textBufferViewResetLocalSelection(view) {
|
|
16484
16535
|
this.opentui.symbols.textBufferViewResetLocalSelection(view);
|
|
16485
16536
|
}
|
|
16537
|
+
textBufferViewSetSelectionOccupancy(view, occupancy) {
|
|
16538
|
+
this.opentui.symbols.textBufferViewSetSelectionOccupancy(view, occupancy === "boundary" ? 1 : 0);
|
|
16539
|
+
}
|
|
16540
|
+
textBufferViewGetSelectionOccupancy(view) {
|
|
16541
|
+
return this.opentui.symbols.textBufferViewGetSelectionOccupancy(view) === 1 ? "boundary" : "cell";
|
|
16542
|
+
}
|
|
16486
16543
|
textBufferViewSetWrapWidth(view, width) {
|
|
16487
16544
|
this.opentui.symbols.textBufferViewSetWrapWidth(view, width);
|
|
16488
16545
|
}
|
|
@@ -16723,8 +16780,7 @@ class FFIRenderLib {
|
|
|
16723
16780
|
};
|
|
16724
16781
|
}
|
|
16725
16782
|
createEditBuffer(widthMethod) {
|
|
16726
|
-
const
|
|
16727
|
-
const bufferPtr = this.opentui.symbols.createEditBuffer(widthMethodCode, this.eventSinkPtr ?? 0);
|
|
16783
|
+
const bufferPtr = this.opentui.symbols.createEditBuffer(widthMethodCode(widthMethod), this.eventSinkPtr ?? 0);
|
|
16728
16784
|
if (!bufferPtr) {
|
|
16729
16785
|
throw new Error("Failed to create EditBuffer");
|
|
16730
16786
|
}
|
|
@@ -16912,24 +16968,40 @@ class FFIRenderLib {
|
|
|
16912
16968
|
const end = Number(packedInfo & 0xffff_ffffn);
|
|
16913
16969
|
return { start, end };
|
|
16914
16970
|
}
|
|
16915
|
-
editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, updateCursor, followCursor) {
|
|
16971
|
+
editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, updateCursor, followCursor, behavior) {
|
|
16916
16972
|
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16917
16973
|
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16918
|
-
return Boolean(this.opentui.symbols.editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2,
|
|
16974
|
+
return Boolean(this.opentui.symbols.editorViewSetLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, editorLocalSelectionFlags(updateCursor, followCursor, behavior)));
|
|
16919
16975
|
}
|
|
16920
16976
|
editorViewUpdateSelection(view, end, bgColor, fgColor) {
|
|
16921
16977
|
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16922
16978
|
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16923
16979
|
this.opentui.symbols.editorViewUpdateSelection(view, end, bg2, fg2);
|
|
16924
16980
|
}
|
|
16925
|
-
editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, updateCursor, followCursor) {
|
|
16981
|
+
editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bgColor, fgColor, updateCursor, followCursor, behavior) {
|
|
16926
16982
|
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16927
16983
|
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16928
|
-
return Boolean(this.opentui.symbols.editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2,
|
|
16984
|
+
return Boolean(this.opentui.symbols.editorViewUpdateLocalSelection(view, anchorX, anchorY, focusX, focusY, bg2, fg2, editorLocalSelectionFlags(updateCursor, followCursor, behavior)));
|
|
16929
16985
|
}
|
|
16930
16986
|
editorViewResetLocalSelection(view) {
|
|
16931
16987
|
this.opentui.symbols.editorViewResetLocalSelection(view);
|
|
16932
16988
|
}
|
|
16989
|
+
editorViewConvertSelectionToCell(view) {
|
|
16990
|
+
return Boolean(this.opentui.symbols.editorViewConvertSelectionToCell(view));
|
|
16991
|
+
}
|
|
16992
|
+
editorViewSetSelectionOccupancy(view, occupancy) {
|
|
16993
|
+
this.opentui.symbols.editorViewSetSelectionOccupancy(view, occupancy === "boundary" ? 1 : 0);
|
|
16994
|
+
}
|
|
16995
|
+
editorViewSetSelectionInclusive(view, start, end, bgColor, fgColor) {
|
|
16996
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
16997
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
16998
|
+
this.opentui.symbols.editorViewSetSelectionInclusive(view, start, end, bg2, fg2);
|
|
16999
|
+
}
|
|
17000
|
+
editorViewSetSelectionColors(view, bgColor, fgColor) {
|
|
17001
|
+
const bg2 = optionalRgbaBuffer(bgColor);
|
|
17002
|
+
const fg2 = optionalRgbaBuffer(fgColor);
|
|
17003
|
+
this.opentui.symbols.editorViewSetSelectionColors(view, bg2, fg2);
|
|
17004
|
+
}
|
|
16933
17005
|
editorViewGetSelectedTextBytes(view, maxLength) {
|
|
16934
17006
|
const outBuffer = new Uint8Array(maxLength);
|
|
16935
17007
|
const actualLen = this.opentui.symbols.editorViewGetSelectedTextBytes(view, viewOrNull(outBuffer), maxLength);
|
|
@@ -17000,6 +17072,9 @@ class FFIRenderLib {
|
|
|
17000
17072
|
const cursor = VisualCursorStruct.unpackInto(storage.view, storage.result);
|
|
17001
17073
|
return { ...cursor };
|
|
17002
17074
|
}
|
|
17075
|
+
editorViewGotoVisualLineEnd(view) {
|
|
17076
|
+
this.opentui.symbols.editorViewGotoVisualLineEnd(view);
|
|
17077
|
+
}
|
|
17003
17078
|
bufferPushScissorRect(buffer, x, y, width, height) {
|
|
17004
17079
|
this.opentui.symbols.bufferPushScissorRect(buffer, x, y, width, height);
|
|
17005
17080
|
}
|
|
@@ -17060,10 +17135,9 @@ class FFIRenderLib {
|
|
|
17060
17135
|
}
|
|
17061
17136
|
encodeUnicode(text, widthMethod) {
|
|
17062
17137
|
const textBytes = this.encoder.encode(text);
|
|
17063
|
-
const widthMethodCode = widthMethod === "wcwidth" ? 0 : 1;
|
|
17064
17138
|
const outPtrBuffer = new ArrayBuffer(8);
|
|
17065
17139
|
const outLenBuffer = new ArrayBuffer(8);
|
|
17066
|
-
const success = this.opentui.symbols.encodeUnicode(viewOrNull(textBytes), textBytes.byteLength, outPtrBuffer, outLenBuffer, widthMethodCode);
|
|
17140
|
+
const success = this.opentui.symbols.encodeUnicode(viewOrNull(textBytes), textBytes.byteLength, outPtrBuffer, outLenBuffer, widthMethodCode(widthMethod));
|
|
17067
17141
|
if (!success) {
|
|
17068
17142
|
return null;
|
|
17069
17143
|
}
|
|
@@ -18514,5 +18588,5 @@ var yoga_default = Yoga;
|
|
|
18514
18588
|
|
|
18515
18589
|
export { toArrayBuffer, singleton, envRegistry, registerEnvVar, clearEnvCache, generateEnvMarkdown, generateEnvColored, env, sleep, stringWidth2 as stringWidth, resolveBundledFilePath, DEFAULT_FOREGROUND_RGB, DEFAULT_BACKGROUND_RGB, normalizeIndexedColorIndex, ansi256IndexToRgb, RGBA, normalizeColorValue, hexToRgb, rgbToHex, hsvToRgb, parseColor, isValidBorderStyle, parseBorderStyle, BorderChars, getBorderFromSides, getBorderSides, borderCharsToArray, BorderCharArrays, KeyEvent, PasteEvent, KeyHandler, InternalKeyHandler, fonts, measureText, getCharacterPositions, coordinateToCharacterIndex, renderFontToFrameBuffer, TextAttributes, ATTRIBUTE_BASE_BITS, ATTRIBUTE_BASE_MASK, getBaseAttributes, DebugOverlayCorner, TargetChannel, 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, SystemClock, nonAlphanumericKeys, terminalNamedSingleStrokeKeys, parseKeypress, LinearScrollAccel, MacOSScrollAccel, parseAlign, parseAlignItems, parseBoxSizing, parseDimension, parseDirection, parseDisplay, parseEdge, parseFlexDirection, parseGutter, parseJustify, parseLogLevel, parseMeasureMode, parseOverflow, parsePositionType, parseUnit, parseWrap, MouseParser, Selection, convertGlobalToLocalSelection, ASCIIFontSelectionHelper, StdinParser, treeSitterToTextChunks, treeSitterToStyledText, addDefaultParsers, TreeSitterClient, DataPathsManager, getDataPaths, extensionToFiletype, basenameToFiletype, extToFiletype, pathToFiletype, infoStringToFiletype, getTreeSitterClient, destroyTreeSitterClient, ExtmarksController, createExtmarksController, TerminalPalette, createTerminalPalette, normalizeTerminalPalette, buildTerminalPaletteSignature, decodePasteBytes, stripAnsiSequences, createHostClipboard, createClipboard, ClipboardTarget, createRendererClipboardAdapter, Clipboard, detectLinks, OptimizedBuffer, TextBuffer, SpanInfoStruct, NativeAudioStreamFormat, NativeAudioStreamState, NativeAudioStreamStateNames, NativeAudioStreamCloseReason, NativeAudioStreamState2 as NativeAudioStreamState1, NativeAudioStreamCloseReason2 as NativeAudioStreamCloseReason1, NativeAudioStreamFormat2 as NativeAudioStreamFormat1, NativeClipboardOperationStatus, NativeClipboardStartStatus, NativeClipboardCancelStatus, NativeClipboardCopyStatus, NativeClipboardDestroyStatus, NativeClipboardShutdownStatus, LogLevel2 as LogLevel, NativeMeasureTargetKind, setRenderLibPath, resolveRenderLib, Align, BoxSizing, Dimension, Direction, Display, Edge, Errata, ExperimentalFeature, FlexDirection, Gutter, Justify, LogLevel as LogLevel1, MeasureMode, NodeType, Overflow, PositionType, Unit, Wrap, ALIGN_AUTO, ALIGN_FLEX_START, ALIGN_CENTER, ALIGN_FLEX_END, ALIGN_STRETCH, ALIGN_BASELINE, ALIGN_SPACE_BETWEEN, ALIGN_SPACE_AROUND, ALIGN_SPACE_EVENLY, BOX_SIZING_BORDER_BOX, BOX_SIZING_CONTENT_BOX, DIMENSION_WIDTH, DIMENSION_HEIGHT, DIRECTION_INHERIT, DIRECTION_LTR, DIRECTION_RTL, DISPLAY_FLEX, DISPLAY_NONE, DISPLAY_CONTENTS, EDGE_LEFT, EDGE_TOP, EDGE_RIGHT, EDGE_BOTTOM, EDGE_START, EDGE_END, EDGE_HORIZONTAL, EDGE_VERTICAL, EDGE_ALL, ERRATA_NONE, ERRATA_STRETCH_FLEX_BASIS, ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING, ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE, ERRATA_ALL, ERRATA_CLASSIC, EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS, FLEX_DIRECTION_COLUMN, FLEX_DIRECTION_COLUMN_REVERSE, FLEX_DIRECTION_ROW, FLEX_DIRECTION_ROW_REVERSE, GUTTER_COLUMN, GUTTER_ROW, GUTTER_ALL, JUSTIFY_FLEX_START, JUSTIFY_CENTER, JUSTIFY_FLEX_END, JUSTIFY_SPACE_BETWEEN, JUSTIFY_SPACE_AROUND, JUSTIFY_SPACE_EVENLY, LOG_LEVEL_ERROR, LOG_LEVEL_WARN, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_VERBOSE, LOG_LEVEL_FATAL, MEASURE_MODE_UNDEFINED, MEASURE_MODE_EXACTLY, MEASURE_MODE_AT_MOST, NODE_TYPE_DEFAULT, NODE_TYPE_TEXT, OVERFLOW_VISIBLE, OVERFLOW_HIDDEN, OVERFLOW_SCROLL, POSITION_TYPE_STATIC, POSITION_TYPE_RELATIVE, POSITION_TYPE_ABSOLUTE, UNIT_UNDEFINED, UNIT_POINT, UNIT_PERCENT, UNIT_AUTO, WRAP_NO_WRAP, WRAP_WRAP, WRAP_WRAP_REVERSE, Config, Node, exports_yoga, yoga_default };
|
|
18516
18590
|
|
|
18517
|
-
//# debugId=
|
|
18518
|
-
//# sourceMappingURL=chunk-node-
|
|
18591
|
+
//# debugId=C4207D33D39A542764756E2164756E21
|
|
18592
|
+
//# sourceMappingURL=chunk-node-mfda59vq.js.map
|