@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
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
NativeMeasureTargetKind2,
|
|
43
43
|
resolveRenderLib2,
|
|
44
44
|
yoga_default
|
|
45
|
-
} from "./chunk-bun-
|
|
45
|
+
} from "./chunk-bun-8f4q4e2m.js";
|
|
46
46
|
|
|
47
47
|
// src/syntax-style.ts
|
|
48
48
|
function convertThemeToStyles2(theme) {
|
|
@@ -1910,6 +1910,10 @@ class TextBufferView2 {
|
|
|
1910
1910
|
this.guard();
|
|
1911
1911
|
this.lib.textBufferViewSetWrapMode(this.viewPtr, mode);
|
|
1912
1912
|
}
|
|
1913
|
+
setTextAlign(alignment) {
|
|
1914
|
+
this.guard();
|
|
1915
|
+
this.lib.textBufferViewSetTextAlign(this.viewPtr, alignment);
|
|
1916
|
+
}
|
|
1913
1917
|
setFirstLineOffset(offset) {
|
|
1914
1918
|
this.guard();
|
|
1915
1919
|
this.lib.textBufferViewSetFirstLineOffset(this.viewPtr, offset);
|
|
@@ -2322,6 +2326,9 @@ class EditorView2 {
|
|
|
2322
2326
|
const viewPtr = lib.createEditorView(editBuffer.ptr, viewportWidth, viewportHeight);
|
|
2323
2327
|
return new EditorView2(lib, viewPtr, editBuffer);
|
|
2324
2328
|
}
|
|
2329
|
+
get isDestroyed() {
|
|
2330
|
+
return this._destroyed;
|
|
2331
|
+
}
|
|
2325
2332
|
guard() {
|
|
2326
2333
|
if (this._destroyed)
|
|
2327
2334
|
throw new Error("EditorView is destroyed");
|
|
@@ -2794,6 +2801,7 @@ class TextBufferRenderable2 extends Renderable2 {
|
|
|
2794
2801
|
_selectionBg;
|
|
2795
2802
|
_selectionFg;
|
|
2796
2803
|
_wrapMode = "word";
|
|
2804
|
+
_textAlign = "left";
|
|
2797
2805
|
lastLocalSelection = null;
|
|
2798
2806
|
_tabIndicator;
|
|
2799
2807
|
_tabIndicatorColor;
|
|
@@ -2813,6 +2821,7 @@ class TextBufferRenderable2 extends Renderable2 {
|
|
|
2813
2821
|
selectable: true,
|
|
2814
2822
|
attributes: 0,
|
|
2815
2823
|
wrapMode: "word",
|
|
2824
|
+
textAlign: "left",
|
|
2816
2825
|
tabIndicator: undefined,
|
|
2817
2826
|
tabIndicatorColor: undefined,
|
|
2818
2827
|
truncate: false
|
|
@@ -2826,6 +2835,7 @@ class TextBufferRenderable2 extends Renderable2 {
|
|
|
2826
2835
|
this._selectionFg = options.selectionFg ? parseColor2(options.selectionFg) : this._defaultOptions.selectionFg;
|
|
2827
2836
|
this.selectable = options.selectable ?? this._defaultOptions.selectable;
|
|
2828
2837
|
this._wrapMode = options.wrapMode ?? this._defaultOptions.wrapMode;
|
|
2838
|
+
this._textAlign = options.textAlign ?? this._defaultOptions.textAlign;
|
|
2829
2839
|
this._tabIndicator = options.tabIndicator ?? this._defaultOptions.tabIndicator;
|
|
2830
2840
|
this._tabIndicatorColor = options.tabIndicatorColor ? parseColor2(options.tabIndicatorColor) : this._defaultOptions.tabIndicatorColor;
|
|
2831
2841
|
this._truncate = options.truncate ?? this._defaultOptions.truncate;
|
|
@@ -2835,6 +2845,7 @@ class TextBufferRenderable2 extends Renderable2 {
|
|
|
2835
2845
|
this._textBufferSyntaxStyle = SyntaxStyle2.create();
|
|
2836
2846
|
this.textBuffer.setSyntaxStyle(this._textBufferSyntaxStyle);
|
|
2837
2847
|
this.textBufferView.setWrapMode(this._wrapMode);
|
|
2848
|
+
this.textBufferView.setTextAlign(this._textAlign);
|
|
2838
2849
|
this.textBufferView.setFirstLineOffset(this._firstLineOffset);
|
|
2839
2850
|
this.setupNativeRenderable();
|
|
2840
2851
|
this.textBuffer.setDefaultFg(this._defaultFg);
|
|
@@ -3025,6 +3036,16 @@ class TextBufferRenderable2 extends Renderable2 {
|
|
|
3025
3036
|
this.requestRender();
|
|
3026
3037
|
}
|
|
3027
3038
|
}
|
|
3039
|
+
get textAlign() {
|
|
3040
|
+
return this._textAlign;
|
|
3041
|
+
}
|
|
3042
|
+
set textAlign(value) {
|
|
3043
|
+
if (this._textAlign !== value) {
|
|
3044
|
+
this._textAlign = value;
|
|
3045
|
+
this.textBufferView.setTextAlign(this._textAlign);
|
|
3046
|
+
this.requestRender();
|
|
3047
|
+
}
|
|
3048
|
+
}
|
|
3028
3049
|
get tabIndicator() {
|
|
3029
3050
|
return this._tabIndicator;
|
|
3030
3051
|
}
|
|
@@ -5533,6 +5554,13 @@ class TerminalConsole2 extends EventEmitter4 {
|
|
|
5533
5554
|
|
|
5534
5555
|
// src/renderables/EditBufferRenderable.ts
|
|
5535
5556
|
var BrandedEditBufferRenderable = Symbol.for("@opentui/core/EditBufferRenderable");
|
|
5557
|
+
var emptyVisualCursor = Object.freeze({
|
|
5558
|
+
visualRow: 0,
|
|
5559
|
+
visualCol: 0,
|
|
5560
|
+
logicalRow: 0,
|
|
5561
|
+
logicalCol: 0,
|
|
5562
|
+
offset: 0
|
|
5563
|
+
});
|
|
5536
5564
|
var EditBufferRenderableEvents2;
|
|
5537
5565
|
((EditBufferRenderableEvents) => {
|
|
5538
5566
|
EditBufferRenderableEvents["TRAITS_CHANGED"] = "traits-changed";
|
|
@@ -5677,10 +5705,12 @@ class EditBufferRenderable2 extends Renderable2 {
|
|
|
5677
5705
|
return this.editBuffer.getCursorPosition();
|
|
5678
5706
|
}
|
|
5679
5707
|
get visualCursor() {
|
|
5708
|
+
if (this.editorView.isDestroyed)
|
|
5709
|
+
return emptyVisualCursor;
|
|
5680
5710
|
return this.editorView.getVisualCursor();
|
|
5681
5711
|
}
|
|
5682
5712
|
get cursorOffset() {
|
|
5683
|
-
return this.
|
|
5713
|
+
return this.visualCursor.offset;
|
|
5684
5714
|
}
|
|
5685
5715
|
set cursorOffset(offset) {
|
|
5686
5716
|
this.clearSelection();
|
|
@@ -6315,7 +6345,7 @@ class EditBufferRenderable2 extends Renderable2 {
|
|
|
6315
6345
|
renderCursor(buffer) {
|
|
6316
6346
|
if (!this._showCursor || !this._focused)
|
|
6317
6347
|
return;
|
|
6318
|
-
const visualCursor = this.
|
|
6348
|
+
const visualCursor = this.visualCursor;
|
|
6319
6349
|
const screenX = this._screenX;
|
|
6320
6350
|
const screenY = this._screenY;
|
|
6321
6351
|
const cursorX = screenX + visualCursor.visualCol + 1;
|
|
@@ -9508,7 +9538,7 @@ Captured external output:
|
|
|
9508
9538
|
if (splitFooterActive) {
|
|
9509
9539
|
let clearStart = null;
|
|
9510
9540
|
if (width < prevWidth && visiblePreviousSplitHeight > 0) {
|
|
9511
|
-
clearStart = Math.max(previousTerminalHeight - visiblePreviousSplitHeight * 2, 1);
|
|
9541
|
+
clearStart = Math.min(this.renderOffset + 1, Math.max(previousTerminalHeight - visiblePreviousSplitHeight * 2, 1));
|
|
9512
9542
|
}
|
|
9513
9543
|
if (pendingSplitFooterTransition !== null) {
|
|
9514
9544
|
clearStart = clearStart === null ? pendingSplitFooterTransition.sourceTopLine : Math.min(clearStart, pendingSplitFooterTransition.sourceTopLine);
|
|
@@ -10473,5 +10503,5 @@ Captured external output:
|
|
|
10473
10503
|
|
|
10474
10504
|
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 };
|
|
10475
10505
|
|
|
10476
|
-
//# debugId=
|
|
10477
|
-
//# sourceMappingURL=chunk-bun-
|
|
10506
|
+
//# debugId=445D1A23AA42892B64756E2164756E21
|
|
10507
|
+
//# sourceMappingURL=chunk-bun-91mz470w.js.map
|