@opentui/core 0.5.11 → 0.5.12
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/{chunk-bun-37s3zwb6.js → chunk-bun-8f4q4e2m.js} +55 -5
- package/{chunk-bun-37s3zwb6.js.map → chunk-bun-8f4q4e2m.js.map} +5 -5
- package/{chunk-bun-bwjmgnxw.js → chunk-bun-91mz470w.js} +36 -6
- package/{chunk-bun-bwjmgnxw.js.map → chunk-bun-91mz470w.js.map} +7 -7
- package/{chunk-node-70eg2nhg.js → chunk-node-1zjyxy5y.js} +55 -5
- package/{chunk-node-70eg2nhg.js.map → chunk-node-1zjyxy5y.js.map} +5 -5
- package/{chunk-node-54dhb2fr.js → chunk-node-fyb4fckk.js} +36 -6
- package/{chunk-node-54dhb2fr.js.map → chunk-node-fyb4fckk.js.map} +7 -7
- package/editor-view.d.ts +1 -0
- package/index.bun.js +35 -3
- package/index.bun.js.map +5 -5
- package/index.node.js +35 -3
- package/index.node.js.map +5 -5
- package/node-assets.js +6 -2
- package/node-assets.js.map +3 -3
- package/package.json +9 -9
- package/parser.worker.js +1 -3
- package/parser.worker.js.map +3 -3
- package/renderables/EmbeddedTerminal.d.ts +4 -0
- package/renderables/TextBufferRenderable.d.ts +5 -0
- package/renderables/TextTable.d.ts +2 -0
- package/runtime-plugin.js +15 -4
- package/runtime-plugin.js.map +1 -1
- package/testing.bun.js +2 -2
- package/testing.js +2 -2
- package/text-buffer-view.d.ts +1 -0
- package/types.d.ts +1 -1
- package/yoga.bun.js +1 -1
- package/yoga.js +1 -1
- package/zig.d.ts +2 -0
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
NativeMeasureTargetKind2,
|
|
42
42
|
resolveRenderLib2,
|
|
43
43
|
yoga_default
|
|
44
|
-
} from "./chunk-node-
|
|
44
|
+
} from "./chunk-node-1zjyxy5y.js";
|
|
45
45
|
|
|
46
46
|
// src/syntax-style.ts
|
|
47
47
|
function convertThemeToStyles2(theme) {
|
|
@@ -1909,6 +1909,10 @@ class TextBufferView2 {
|
|
|
1909
1909
|
this.guard();
|
|
1910
1910
|
this.lib.textBufferViewSetWrapMode(this.viewPtr, mode);
|
|
1911
1911
|
}
|
|
1912
|
+
setTextAlign(alignment) {
|
|
1913
|
+
this.guard();
|
|
1914
|
+
this.lib.textBufferViewSetTextAlign(this.viewPtr, alignment);
|
|
1915
|
+
}
|
|
1912
1916
|
setFirstLineOffset(offset) {
|
|
1913
1917
|
this.guard();
|
|
1914
1918
|
this.lib.textBufferViewSetFirstLineOffset(this.viewPtr, offset);
|
|
@@ -2321,6 +2325,9 @@ class EditorView2 {
|
|
|
2321
2325
|
const viewPtr = lib.createEditorView(editBuffer.ptr, viewportWidth, viewportHeight);
|
|
2322
2326
|
return new EditorView2(lib, viewPtr, editBuffer);
|
|
2323
2327
|
}
|
|
2328
|
+
get isDestroyed() {
|
|
2329
|
+
return this._destroyed;
|
|
2330
|
+
}
|
|
2324
2331
|
guard() {
|
|
2325
2332
|
if (this._destroyed)
|
|
2326
2333
|
throw new Error("EditorView is destroyed");
|
|
@@ -2793,6 +2800,7 @@ class TextBufferRenderable2 extends Renderable2 {
|
|
|
2793
2800
|
_selectionBg;
|
|
2794
2801
|
_selectionFg;
|
|
2795
2802
|
_wrapMode = "word";
|
|
2803
|
+
_textAlign = "left";
|
|
2796
2804
|
lastLocalSelection = null;
|
|
2797
2805
|
_tabIndicator;
|
|
2798
2806
|
_tabIndicatorColor;
|
|
@@ -2812,6 +2820,7 @@ class TextBufferRenderable2 extends Renderable2 {
|
|
|
2812
2820
|
selectable: true,
|
|
2813
2821
|
attributes: 0,
|
|
2814
2822
|
wrapMode: "word",
|
|
2823
|
+
textAlign: "left",
|
|
2815
2824
|
tabIndicator: undefined,
|
|
2816
2825
|
tabIndicatorColor: undefined,
|
|
2817
2826
|
truncate: false
|
|
@@ -2825,6 +2834,7 @@ class TextBufferRenderable2 extends Renderable2 {
|
|
|
2825
2834
|
this._selectionFg = options.selectionFg ? parseColor2(options.selectionFg) : this._defaultOptions.selectionFg;
|
|
2826
2835
|
this.selectable = options.selectable ?? this._defaultOptions.selectable;
|
|
2827
2836
|
this._wrapMode = options.wrapMode ?? this._defaultOptions.wrapMode;
|
|
2837
|
+
this._textAlign = options.textAlign ?? this._defaultOptions.textAlign;
|
|
2828
2838
|
this._tabIndicator = options.tabIndicator ?? this._defaultOptions.tabIndicator;
|
|
2829
2839
|
this._tabIndicatorColor = options.tabIndicatorColor ? parseColor2(options.tabIndicatorColor) : this._defaultOptions.tabIndicatorColor;
|
|
2830
2840
|
this._truncate = options.truncate ?? this._defaultOptions.truncate;
|
|
@@ -2834,6 +2844,7 @@ class TextBufferRenderable2 extends Renderable2 {
|
|
|
2834
2844
|
this._textBufferSyntaxStyle = SyntaxStyle2.create();
|
|
2835
2845
|
this.textBuffer.setSyntaxStyle(this._textBufferSyntaxStyle);
|
|
2836
2846
|
this.textBufferView.setWrapMode(this._wrapMode);
|
|
2847
|
+
this.textBufferView.setTextAlign(this._textAlign);
|
|
2837
2848
|
this.textBufferView.setFirstLineOffset(this._firstLineOffset);
|
|
2838
2849
|
this.setupNativeRenderable();
|
|
2839
2850
|
this.textBuffer.setDefaultFg(this._defaultFg);
|
|
@@ -3024,6 +3035,16 @@ class TextBufferRenderable2 extends Renderable2 {
|
|
|
3024
3035
|
this.requestRender();
|
|
3025
3036
|
}
|
|
3026
3037
|
}
|
|
3038
|
+
get textAlign() {
|
|
3039
|
+
return this._textAlign;
|
|
3040
|
+
}
|
|
3041
|
+
set textAlign(value) {
|
|
3042
|
+
if (this._textAlign !== value) {
|
|
3043
|
+
this._textAlign = value;
|
|
3044
|
+
this.textBufferView.setTextAlign(this._textAlign);
|
|
3045
|
+
this.requestRender();
|
|
3046
|
+
}
|
|
3047
|
+
}
|
|
3027
3048
|
get tabIndicator() {
|
|
3028
3049
|
return this._tabIndicator;
|
|
3029
3050
|
}
|
|
@@ -5532,6 +5553,13 @@ class TerminalConsole2 extends EventEmitter4 {
|
|
|
5532
5553
|
|
|
5533
5554
|
// src/renderables/EditBufferRenderable.ts
|
|
5534
5555
|
var BrandedEditBufferRenderable = Symbol.for("@opentui/core/EditBufferRenderable");
|
|
5556
|
+
var emptyVisualCursor = Object.freeze({
|
|
5557
|
+
visualRow: 0,
|
|
5558
|
+
visualCol: 0,
|
|
5559
|
+
logicalRow: 0,
|
|
5560
|
+
logicalCol: 0,
|
|
5561
|
+
offset: 0
|
|
5562
|
+
});
|
|
5535
5563
|
var EditBufferRenderableEvents2;
|
|
5536
5564
|
((EditBufferRenderableEvents) => {
|
|
5537
5565
|
EditBufferRenderableEvents["TRAITS_CHANGED"] = "traits-changed";
|
|
@@ -5676,10 +5704,12 @@ class EditBufferRenderable2 extends Renderable2 {
|
|
|
5676
5704
|
return this.editBuffer.getCursorPosition();
|
|
5677
5705
|
}
|
|
5678
5706
|
get visualCursor() {
|
|
5707
|
+
if (this.editorView.isDestroyed)
|
|
5708
|
+
return emptyVisualCursor;
|
|
5679
5709
|
return this.editorView.getVisualCursor();
|
|
5680
5710
|
}
|
|
5681
5711
|
get cursorOffset() {
|
|
5682
|
-
return this.
|
|
5712
|
+
return this.visualCursor.offset;
|
|
5683
5713
|
}
|
|
5684
5714
|
set cursorOffset(offset) {
|
|
5685
5715
|
this.clearSelection();
|
|
@@ -6314,7 +6344,7 @@ class EditBufferRenderable2 extends Renderable2 {
|
|
|
6314
6344
|
renderCursor(buffer) {
|
|
6315
6345
|
if (!this._showCursor || !this._focused)
|
|
6316
6346
|
return;
|
|
6317
|
-
const visualCursor = this.
|
|
6347
|
+
const visualCursor = this.visualCursor;
|
|
6318
6348
|
const screenX = this._screenX;
|
|
6319
6349
|
const screenY = this._screenY;
|
|
6320
6350
|
const cursorX = screenX + visualCursor.visualCol + 1;
|
|
@@ -9507,7 +9537,7 @@ Captured external output:
|
|
|
9507
9537
|
if (splitFooterActive) {
|
|
9508
9538
|
let clearStart = null;
|
|
9509
9539
|
if (width < prevWidth && visiblePreviousSplitHeight > 0) {
|
|
9510
|
-
clearStart = Math.max(previousTerminalHeight - visiblePreviousSplitHeight * 2, 1);
|
|
9540
|
+
clearStart = Math.min(this.renderOffset + 1, Math.max(previousTerminalHeight - visiblePreviousSplitHeight * 2, 1));
|
|
9511
9541
|
}
|
|
9512
9542
|
if (pendingSplitFooterTransition !== null) {
|
|
9513
9543
|
clearStart = clearStart === null ? pendingSplitFooterTransition.sourceTopLine : Math.min(clearStart, pendingSplitFooterTransition.sourceTopLine);
|
|
@@ -10472,5 +10502,5 @@ Captured external output:
|
|
|
10472
10502
|
|
|
10473
10503
|
export { convertThemeToStyles2, SyntaxStyle2, h2, isVNode2, maybeMakeRenderable2, wrapWithDelegates2, instantiate2, delegate2, LayoutEvents2, RenderableEvents2, isRenderable2, BaseRenderable2, Renderable2, RootRenderable2, TextBufferView2, EditBuffer2, EditorView2, ANSI, BoxRenderable2, TextBufferRenderable2, CodeRenderable2, isTextNodeRenderable2, TextNodeRenderable2, RootTextNodeRenderable2, TextRenderable2, NativeSpanFeed2, defaultKeyAliases, mergeKeyAliases, mergeKeyBindings, getKeyBindingAction, buildKeyBindingsMap, capture2, ConsolePosition2, TerminalConsole2, getObjectsInViewport, EditBufferRenderableEvents2, isEditBufferRenderable2, EditBufferRenderable2, buildKittyKeyboardFlags2, MouseEvent2, MouseButton2, createCliRenderer2, CliRenderEvents2, RendererControlState2, CliRenderer2 };
|
|
10474
10504
|
|
|
10475
|
-
//# debugId=
|
|
10476
|
-
//# sourceMappingURL=chunk-node-
|
|
10505
|
+
//# debugId=47CBB6DA4E1BD0DC64756E2164756E21
|
|
10506
|
+
//# sourceMappingURL=chunk-node-fyb4fckk.js.map
|