@opentui/core 0.1.29 → 0.1.30
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/edit-buffer.d.ts +4 -0
- package/editor-view.d.ts +3 -0
- package/{index-bztetjc3.js → index-0qmm1k4p.js} +80 -20
- package/{index-bztetjc3.js.map → index-0qmm1k4p.js.map} +4 -4
- package/index.js +284 -113
- package/index.js.map +8 -7
- package/lib/keymapping.d.ts +10 -0
- package/package.json +7 -7
- package/renderables/EditBufferRenderable.d.ts +8 -1
- package/renderables/Textarea.d.ts +43 -22
- package/testing/mock-keys.d.ts +29 -2
- package/testing.js +41 -4
- package/testing.js.map +3 -3
- package/zig-structs.d.ts +2 -0
- package/zig.d.ts +19 -0
package/3d.js
CHANGED
package/edit-buffer.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export declare class EditBuffer extends EventEmitter {
|
|
|
41
41
|
insertText(text: string): void;
|
|
42
42
|
deleteChar(): void;
|
|
43
43
|
deleteCharBackward(): void;
|
|
44
|
+
deleteRange(startLine: number, startCol: number, endLine: number, endCol: number): void;
|
|
44
45
|
newLine(): void;
|
|
45
46
|
deleteLine(): void;
|
|
46
47
|
moveCursorLeft(): void;
|
|
@@ -52,6 +53,9 @@ export declare class EditBuffer extends EventEmitter {
|
|
|
52
53
|
setCursorToLineCol(line: number, col: number): void;
|
|
53
54
|
setCursorByOffset(offset: number): void;
|
|
54
55
|
getCursorPosition(): CursorPosition;
|
|
56
|
+
getNextWordBoundary(): CursorPosition;
|
|
57
|
+
getPrevWordBoundary(): CursorPosition;
|
|
58
|
+
getEOL(): CursorPosition;
|
|
55
59
|
debugLogRope(): void;
|
|
56
60
|
undo(): string | null;
|
|
57
61
|
redo(): string | null;
|
package/editor-view.d.ts
CHANGED
|
@@ -44,6 +44,9 @@ export declare class EditorView {
|
|
|
44
44
|
moveDownVisual(): void;
|
|
45
45
|
deleteSelectedText(): void;
|
|
46
46
|
setCursorByOffset(offset: number): void;
|
|
47
|
+
getNextWordBoundary(): VisualCursor;
|
|
48
|
+
getPrevWordBoundary(): VisualCursor;
|
|
49
|
+
getEOL(): VisualCursor;
|
|
47
50
|
getLineInfo(): LineInfo;
|
|
48
51
|
getLogicalLineInfo(): LineInfo;
|
|
49
52
|
destroy(): void;
|
|
@@ -7014,6 +7014,18 @@ var HighlightStruct = defineStruct([
|
|
|
7014
7014
|
["priority", "u8", { default: 0 }],
|
|
7015
7015
|
["hlRef", "u16", { default: 0 }]
|
|
7016
7016
|
]);
|
|
7017
|
+
var LogicalCursorStruct = defineStruct([
|
|
7018
|
+
["row", "u32"],
|
|
7019
|
+
["col", "u32"],
|
|
7020
|
+
["offset", "u32"]
|
|
7021
|
+
]);
|
|
7022
|
+
var VisualCursorStruct = defineStruct([
|
|
7023
|
+
["visualRow", "u32"],
|
|
7024
|
+
["visualCol", "u32"],
|
|
7025
|
+
["logicalRow", "u32"],
|
|
7026
|
+
["logicalCol", "u32"],
|
|
7027
|
+
["offset", "u32"]
|
|
7028
|
+
]);
|
|
7017
7029
|
|
|
7018
7030
|
// src/zig.ts
|
|
7019
7031
|
var module = await import(`@opentui/core-${process.platform}-${process.arch}/index.ts`);
|
|
@@ -7507,6 +7519,10 @@ function getOpenTUILib(libPath) {
|
|
|
7507
7519
|
args: ["ptr"],
|
|
7508
7520
|
returns: "void"
|
|
7509
7521
|
},
|
|
7522
|
+
editBufferDeleteRange: {
|
|
7523
|
+
args: ["ptr", "u32", "u32", "u32", "u32"],
|
|
7524
|
+
returns: "void"
|
|
7525
|
+
},
|
|
7510
7526
|
editBufferNewLine: {
|
|
7511
7527
|
args: ["ptr"],
|
|
7512
7528
|
returns: "void"
|
|
@@ -7591,6 +7607,18 @@ function getOpenTUILib(libPath) {
|
|
|
7591
7607
|
args: ["ptr", "ptr"],
|
|
7592
7608
|
returns: "void"
|
|
7593
7609
|
},
|
|
7610
|
+
editBufferGetNextWordBoundary: {
|
|
7611
|
+
args: ["ptr", "ptr"],
|
|
7612
|
+
returns: "void"
|
|
7613
|
+
},
|
|
7614
|
+
editBufferGetPrevWordBoundary: {
|
|
7615
|
+
args: ["ptr", "ptr"],
|
|
7616
|
+
returns: "void"
|
|
7617
|
+
},
|
|
7618
|
+
editBufferGetEOL: {
|
|
7619
|
+
args: ["ptr", "ptr"],
|
|
7620
|
+
returns: "void"
|
|
7621
|
+
},
|
|
7594
7622
|
editorViewSetSelection: {
|
|
7595
7623
|
args: ["ptr", "u32", "u32", "ptr", "ptr"],
|
|
7596
7624
|
returns: "void"
|
|
@@ -7624,8 +7652,8 @@ function getOpenTUILib(libPath) {
|
|
|
7624
7652
|
returns: "usize"
|
|
7625
7653
|
},
|
|
7626
7654
|
editorViewGetVisualCursor: {
|
|
7627
|
-
args: ["ptr", "ptr"
|
|
7628
|
-
returns: "
|
|
7655
|
+
args: ["ptr", "ptr"],
|
|
7656
|
+
returns: "void"
|
|
7629
7657
|
},
|
|
7630
7658
|
editorViewMoveUpVisual: {
|
|
7631
7659
|
args: ["ptr"],
|
|
@@ -7643,6 +7671,18 @@ function getOpenTUILib(libPath) {
|
|
|
7643
7671
|
args: ["ptr", "u32"],
|
|
7644
7672
|
returns: "void"
|
|
7645
7673
|
},
|
|
7674
|
+
editorViewGetNextWordBoundary: {
|
|
7675
|
+
args: ["ptr", "ptr"],
|
|
7676
|
+
returns: "void"
|
|
7677
|
+
},
|
|
7678
|
+
editorViewGetPrevWordBoundary: {
|
|
7679
|
+
args: ["ptr", "ptr"],
|
|
7680
|
+
returns: "void"
|
|
7681
|
+
},
|
|
7682
|
+
editorViewGetEOL: {
|
|
7683
|
+
args: ["ptr", "ptr"],
|
|
7684
|
+
returns: "void"
|
|
7685
|
+
},
|
|
7646
7686
|
getArenaAllocatedBytes: {
|
|
7647
7687
|
args: [],
|
|
7648
7688
|
returns: "usize"
|
|
@@ -8431,6 +8471,9 @@ class FFIRenderLib {
|
|
|
8431
8471
|
editBufferDeleteCharBackward(buffer) {
|
|
8432
8472
|
this.opentui.symbols.editBufferDeleteCharBackward(buffer);
|
|
8433
8473
|
}
|
|
8474
|
+
editBufferDeleteRange(buffer, startLine, startCol, endLine, endCol) {
|
|
8475
|
+
this.opentui.symbols.editBufferDeleteRange(buffer, startLine, startCol, endLine, endCol);
|
|
8476
|
+
}
|
|
8434
8477
|
editBufferNewLine(buffer) {
|
|
8435
8478
|
this.opentui.symbols.editBufferNewLine(buffer);
|
|
8436
8479
|
}
|
|
@@ -8521,6 +8564,21 @@ class FFIRenderLib {
|
|
|
8521
8564
|
editBufferSetPlaceholderColor(buffer, color) {
|
|
8522
8565
|
this.opentui.symbols.editBufferSetPlaceholderColor(buffer, color.buffer);
|
|
8523
8566
|
}
|
|
8567
|
+
editBufferGetNextWordBoundary(buffer) {
|
|
8568
|
+
const cursorBuffer = new ArrayBuffer(LogicalCursorStruct.size);
|
|
8569
|
+
this.opentui.symbols.editBufferGetNextWordBoundary(buffer, ptr3(cursorBuffer));
|
|
8570
|
+
return LogicalCursorStruct.unpack(cursorBuffer);
|
|
8571
|
+
}
|
|
8572
|
+
editBufferGetPrevWordBoundary(buffer) {
|
|
8573
|
+
const cursorBuffer = new ArrayBuffer(LogicalCursorStruct.size);
|
|
8574
|
+
this.opentui.symbols.editBufferGetPrevWordBoundary(buffer, ptr3(cursorBuffer));
|
|
8575
|
+
return LogicalCursorStruct.unpack(cursorBuffer);
|
|
8576
|
+
}
|
|
8577
|
+
editBufferGetEOL(buffer) {
|
|
8578
|
+
const cursorBuffer = new ArrayBuffer(LogicalCursorStruct.size);
|
|
8579
|
+
this.opentui.symbols.editBufferGetEOL(buffer, ptr3(cursorBuffer));
|
|
8580
|
+
return LogicalCursorStruct.unpack(cursorBuffer);
|
|
8581
|
+
}
|
|
8524
8582
|
editorViewSetSelection(view, start, end, bgColor, fgColor) {
|
|
8525
8583
|
const bg2 = bgColor ? bgColor.buffer : null;
|
|
8526
8584
|
const fg2 = fgColor ? fgColor.buffer : null;
|
|
@@ -8569,22 +8627,9 @@ class FFIRenderLib {
|
|
|
8569
8627
|
return outBuffer.slice(0, len);
|
|
8570
8628
|
}
|
|
8571
8629
|
editorViewGetVisualCursor(view) {
|
|
8572
|
-
const
|
|
8573
|
-
|
|
8574
|
-
|
|
8575
|
-
const logicalCol = new Uint32Array(1);
|
|
8576
|
-
const offset = new Uint32Array(1);
|
|
8577
|
-
const success = this.opentui.symbols.editorViewGetVisualCursor(view, ptr3(visualRow), ptr3(visualCol), ptr3(logicalRow), ptr3(logicalCol), ptr3(offset));
|
|
8578
|
-
if (!success) {
|
|
8579
|
-
return { visualRow: 0, visualCol: 0, logicalRow: 0, logicalCol: 0, offset: 0 };
|
|
8580
|
-
}
|
|
8581
|
-
return {
|
|
8582
|
-
visualRow: visualRow[0],
|
|
8583
|
-
visualCol: visualCol[0],
|
|
8584
|
-
logicalRow: logicalRow[0],
|
|
8585
|
-
logicalCol: logicalCol[0],
|
|
8586
|
-
offset: offset[0]
|
|
8587
|
-
};
|
|
8630
|
+
const cursorBuffer = new ArrayBuffer(VisualCursorStruct.size);
|
|
8631
|
+
this.opentui.symbols.editorViewGetVisualCursor(view, ptr3(cursorBuffer));
|
|
8632
|
+
return VisualCursorStruct.unpack(cursorBuffer);
|
|
8588
8633
|
}
|
|
8589
8634
|
editorViewMoveUpVisual(view) {
|
|
8590
8635
|
this.opentui.symbols.editorViewMoveUpVisual(view);
|
|
@@ -8598,6 +8643,21 @@ class FFIRenderLib {
|
|
|
8598
8643
|
editorViewSetCursorByOffset(view, offset) {
|
|
8599
8644
|
this.opentui.symbols.editorViewSetCursorByOffset(view, offset);
|
|
8600
8645
|
}
|
|
8646
|
+
editorViewGetNextWordBoundary(view) {
|
|
8647
|
+
const cursorBuffer = new ArrayBuffer(VisualCursorStruct.size);
|
|
8648
|
+
this.opentui.symbols.editorViewGetNextWordBoundary(view, ptr3(cursorBuffer));
|
|
8649
|
+
return VisualCursorStruct.unpack(cursorBuffer);
|
|
8650
|
+
}
|
|
8651
|
+
editorViewGetPrevWordBoundary(view) {
|
|
8652
|
+
const cursorBuffer = new ArrayBuffer(VisualCursorStruct.size);
|
|
8653
|
+
this.opentui.symbols.editorViewGetPrevWordBoundary(view, ptr3(cursorBuffer));
|
|
8654
|
+
return VisualCursorStruct.unpack(cursorBuffer);
|
|
8655
|
+
}
|
|
8656
|
+
editorViewGetEOL(view) {
|
|
8657
|
+
const cursorBuffer = new ArrayBuffer(VisualCursorStruct.size);
|
|
8658
|
+
this.opentui.symbols.editorViewGetEOL(view, ptr3(cursorBuffer));
|
|
8659
|
+
return VisualCursorStruct.unpack(cursorBuffer);
|
|
8660
|
+
}
|
|
8601
8661
|
bufferPushScissorRect(buffer, x, y, width, height) {
|
|
8602
8662
|
this.opentui.symbols.bufferPushScissorRect(buffer, x, y, width, height);
|
|
8603
8663
|
}
|
|
@@ -12263,5 +12323,5 @@ Captured output:
|
|
|
12263
12323
|
|
|
12264
12324
|
export { __toESM, __commonJS, __export, __require, Edge, Gutter, exports_src, BorderChars, getBorderFromSides, getBorderSides, borderCharsToArray, BorderCharArrays, nonAlphanumericKeys, parseKeypress, ANSI, KeyEvent, PasteEvent, KeyHandler, InternalKeyHandler, RGBA, hexToRgb, rgbToHex, hsvToRgb, parseColor, fonts, measureText, getCharacterPositions, coordinateToCharacterIndex, renderFontToFrameBuffer, TextAttributes, DebugOverlayCorner, createTextAttributes, 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, t, hastToStyledText, LinearScrollAccel, MacOSScrollAccel, parseAlign, 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, TextBuffer, LogLevel2 as LogLevel, setRenderLibPath, resolveRenderLib, OptimizedBuffer, h, isVNode, maybeMakeRenderable, wrapWithDelegates, instantiate, delegate, isValidPercentage, LayoutEvents, RenderableEvents, isRenderable, BaseRenderable, Renderable, RootRenderable, capture, ConsolePosition, TerminalConsole, getObjectsInViewport, MouseEvent, MouseButton, createCliRenderer, CliRenderEvents, RendererControlState, CliRenderer };
|
|
12265
12325
|
|
|
12266
|
-
//# debugId=
|
|
12267
|
-
//# sourceMappingURL=index-
|
|
12326
|
+
//# debugId=19E28318FF03F69E64756E2164756E21
|
|
12327
|
+
//# sourceMappingURL=index-0qmm1k4p.js.map
|