@opentui/core 0.0.0-20251028-8f761bab → 0.0.0-20251029-f23e92a5
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/editor-view.d.ts +2 -0
- package/{index-nmrjz1q1.js → index-xn9k0wzm.js} +52 -2
- package/{index-nmrjz1q1.js.map → index-xn9k0wzm.js.map} +4 -4
- package/index.js +96 -4
- package/index.js.map +6 -6
- package/package.json +7 -7
- package/renderables/EditBufferRenderable.d.ts +10 -0
- package/renderables/TextBufferRenderable.d.ts +10 -0
- package/testing.js +1 -1
- package/text-buffer-view.d.ts +2 -0
- package/text-buffer.d.ts +2 -0
- package/zig.d.ts +6 -0
package/index.js
CHANGED
|
@@ -133,7 +133,7 @@ import {
|
|
|
133
133
|
white,
|
|
134
134
|
wrapWithDelegates,
|
|
135
135
|
yellow
|
|
136
|
-
} from "./index-
|
|
136
|
+
} from "./index-xn9k0wzm.js";
|
|
137
137
|
// src/text-buffer-view.ts
|
|
138
138
|
class TextBufferView {
|
|
139
139
|
lib;
|
|
@@ -222,6 +222,15 @@ class TextBufferView {
|
|
|
222
222
|
return "";
|
|
223
223
|
return this.lib.decoder.decode(plainBytes);
|
|
224
224
|
}
|
|
225
|
+
setTabIndicator(indicator) {
|
|
226
|
+
this.guard();
|
|
227
|
+
const codePoint = typeof indicator === "string" ? indicator.codePointAt(0) ?? 0 : indicator;
|
|
228
|
+
this.lib.textBufferViewSetTabIndicator(this.viewPtr, codePoint);
|
|
229
|
+
}
|
|
230
|
+
setTabIndicatorColor(color) {
|
|
231
|
+
this.guard();
|
|
232
|
+
this.lib.textBufferViewSetTabIndicatorColor(this.viewPtr, color);
|
|
233
|
+
}
|
|
225
234
|
destroy() {
|
|
226
235
|
if (this._destroyed)
|
|
227
236
|
return;
|
|
@@ -657,6 +666,15 @@ class EditorView {
|
|
|
657
666
|
this.guard();
|
|
658
667
|
this.lib.editorViewSetPlaceholderStyledText(this.viewPtr, chunks);
|
|
659
668
|
}
|
|
669
|
+
setTabIndicator(indicator) {
|
|
670
|
+
this.guard();
|
|
671
|
+
const codePoint = typeof indicator === "string" ? indicator.codePointAt(0) ?? 0 : indicator;
|
|
672
|
+
this.lib.editorViewSetTabIndicator(this.viewPtr, codePoint);
|
|
673
|
+
}
|
|
674
|
+
setTabIndicatorColor(color) {
|
|
675
|
+
this.guard();
|
|
676
|
+
this.lib.editorViewSetTabIndicatorColor(this.viewPtr, color);
|
|
677
|
+
}
|
|
660
678
|
destroy() {
|
|
661
679
|
if (this._destroyed)
|
|
662
680
|
return;
|
|
@@ -2338,6 +2356,8 @@ class TextBufferRenderable extends Renderable {
|
|
|
2338
2356
|
_selectionFg;
|
|
2339
2357
|
_wrapMode = "word";
|
|
2340
2358
|
lastLocalSelection = null;
|
|
2359
|
+
_tabIndicator;
|
|
2360
|
+
_tabIndicatorColor;
|
|
2341
2361
|
textBuffer;
|
|
2342
2362
|
textBufferView;
|
|
2343
2363
|
_lineInfo = { lineStarts: [], lineWidths: [], maxLineWidth: 0 };
|
|
@@ -2348,7 +2368,9 @@ class TextBufferRenderable extends Renderable {
|
|
|
2348
2368
|
selectionFg: undefined,
|
|
2349
2369
|
selectable: true,
|
|
2350
2370
|
attributes: 0,
|
|
2351
|
-
wrapMode: "word"
|
|
2371
|
+
wrapMode: "word",
|
|
2372
|
+
tabIndicator: undefined,
|
|
2373
|
+
tabIndicatorColor: undefined
|
|
2352
2374
|
};
|
|
2353
2375
|
constructor(ctx, options) {
|
|
2354
2376
|
super(ctx, options);
|
|
@@ -2359,6 +2381,8 @@ class TextBufferRenderable extends Renderable {
|
|
|
2359
2381
|
this._selectionFg = options.selectionFg ? parseColor(options.selectionFg) : this._defaultOptions.selectionFg;
|
|
2360
2382
|
this.selectable = options.selectable ?? this._defaultOptions.selectable;
|
|
2361
2383
|
this._wrapMode = options.wrapMode ?? this._defaultOptions.wrapMode;
|
|
2384
|
+
this._tabIndicator = options.tabIndicator ?? this._defaultOptions.tabIndicator;
|
|
2385
|
+
this._tabIndicatorColor = options.tabIndicatorColor ? parseColor(options.tabIndicatorColor) : this._defaultOptions.tabIndicatorColor;
|
|
2362
2386
|
this.textBuffer = TextBuffer.create(this._ctx.widthMethod);
|
|
2363
2387
|
this.textBufferView = TextBufferView.create(this.textBuffer);
|
|
2364
2388
|
const style = SyntaxStyle.create();
|
|
@@ -2368,6 +2392,12 @@ class TextBufferRenderable extends Renderable {
|
|
|
2368
2392
|
this.textBuffer.setDefaultFg(this._defaultFg);
|
|
2369
2393
|
this.textBuffer.setDefaultBg(this._defaultBg);
|
|
2370
2394
|
this.textBuffer.setDefaultAttributes(this._defaultAttributes);
|
|
2395
|
+
if (this._tabIndicator !== undefined) {
|
|
2396
|
+
this.textBufferView.setTabIndicator(this._tabIndicator);
|
|
2397
|
+
}
|
|
2398
|
+
if (this._tabIndicatorColor !== undefined) {
|
|
2399
|
+
this.textBufferView.setTabIndicatorColor(this._tabIndicatorColor);
|
|
2400
|
+
}
|
|
2371
2401
|
if (this._wrapMode !== "none" && this.width > 0) {
|
|
2372
2402
|
this.updateWrapWidth(this.width);
|
|
2373
2403
|
}
|
|
@@ -2454,6 +2484,31 @@ class TextBufferRenderable extends Renderable {
|
|
|
2454
2484
|
this.requestRender();
|
|
2455
2485
|
}
|
|
2456
2486
|
}
|
|
2487
|
+
get tabIndicator() {
|
|
2488
|
+
return this._tabIndicator;
|
|
2489
|
+
}
|
|
2490
|
+
set tabIndicator(value) {
|
|
2491
|
+
if (this._tabIndicator !== value) {
|
|
2492
|
+
this._tabIndicator = value;
|
|
2493
|
+
if (value !== undefined) {
|
|
2494
|
+
this.textBufferView.setTabIndicator(value);
|
|
2495
|
+
}
|
|
2496
|
+
this.requestRender();
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
get tabIndicatorColor() {
|
|
2500
|
+
return this._tabIndicatorColor;
|
|
2501
|
+
}
|
|
2502
|
+
set tabIndicatorColor(value) {
|
|
2503
|
+
const newColor = value ? parseColor(value) : undefined;
|
|
2504
|
+
if (this._tabIndicatorColor !== newColor) {
|
|
2505
|
+
this._tabIndicatorColor = newColor;
|
|
2506
|
+
if (newColor !== undefined) {
|
|
2507
|
+
this.textBufferView.setTabIndicatorColor(newColor);
|
|
2508
|
+
}
|
|
2509
|
+
this.requestRender();
|
|
2510
|
+
}
|
|
2511
|
+
}
|
|
2457
2512
|
onResize(width, height) {
|
|
2458
2513
|
this.textBufferView.setViewportSize(width, height);
|
|
2459
2514
|
if (this.lastLocalSelection) {
|
|
@@ -5026,6 +5081,8 @@ class EditBufferRenderable extends Renderable {
|
|
|
5026
5081
|
_showCursor = true;
|
|
5027
5082
|
_cursorColor;
|
|
5028
5083
|
lastLocalSelection = null;
|
|
5084
|
+
_tabIndicator;
|
|
5085
|
+
_tabIndicatorColor;
|
|
5029
5086
|
_cursorChangeListener = undefined;
|
|
5030
5087
|
_contentChangeListener = undefined;
|
|
5031
5088
|
editBuffer;
|
|
@@ -5040,7 +5097,9 @@ class EditBufferRenderable extends Renderable {
|
|
|
5040
5097
|
wrapMode: "word",
|
|
5041
5098
|
scrollMargin: 0.2,
|
|
5042
5099
|
showCursor: true,
|
|
5043
|
-
cursorColor: RGBA.fromValues(1, 1, 1, 1)
|
|
5100
|
+
cursorColor: RGBA.fromValues(1, 1, 1, 1),
|
|
5101
|
+
tabIndicator: undefined,
|
|
5102
|
+
tabIndicatorColor: undefined
|
|
5044
5103
|
};
|
|
5045
5104
|
constructor(ctx, options) {
|
|
5046
5105
|
super(ctx, options);
|
|
@@ -5054,6 +5113,8 @@ class EditBufferRenderable extends Renderable {
|
|
|
5054
5113
|
this._scrollMargin = options.scrollMargin ?? this._defaultOptions.scrollMargin;
|
|
5055
5114
|
this._showCursor = options.showCursor ?? this._defaultOptions.showCursor;
|
|
5056
5115
|
this._cursorColor = parseColor(options.cursorColor ?? this._defaultOptions.cursorColor);
|
|
5116
|
+
this._tabIndicator = options.tabIndicator ?? this._defaultOptions.tabIndicator;
|
|
5117
|
+
this._tabIndicatorColor = options.tabIndicatorColor ? parseColor(options.tabIndicatorColor) : this._defaultOptions.tabIndicatorColor;
|
|
5057
5118
|
this.editBuffer = EditBuffer.create(this._ctx.widthMethod);
|
|
5058
5119
|
this.editorView = EditorView.create(this.editBuffer, this.width || 80, this.height || 24);
|
|
5059
5120
|
this.editorView.setWrapMode(this._wrapMode);
|
|
@@ -5064,6 +5125,12 @@ class EditBufferRenderable extends Renderable {
|
|
|
5064
5125
|
if (options.syntaxStyle) {
|
|
5065
5126
|
this.editBuffer.setSyntaxStyle(options.syntaxStyle);
|
|
5066
5127
|
}
|
|
5128
|
+
if (this._tabIndicator !== undefined) {
|
|
5129
|
+
this.editorView.setTabIndicator(this._tabIndicator);
|
|
5130
|
+
}
|
|
5131
|
+
if (this._tabIndicatorColor !== undefined) {
|
|
5132
|
+
this.editorView.setTabIndicatorColor(this._tabIndicatorColor);
|
|
5133
|
+
}
|
|
5067
5134
|
this.setupMeasureFunc();
|
|
5068
5135
|
this.setupEventListeners(options);
|
|
5069
5136
|
}
|
|
@@ -5191,6 +5258,31 @@ class EditBufferRenderable extends Renderable {
|
|
|
5191
5258
|
this.requestRender();
|
|
5192
5259
|
}
|
|
5193
5260
|
}
|
|
5261
|
+
get tabIndicator() {
|
|
5262
|
+
return this._tabIndicator;
|
|
5263
|
+
}
|
|
5264
|
+
set tabIndicator(value) {
|
|
5265
|
+
if (this._tabIndicator !== value) {
|
|
5266
|
+
this._tabIndicator = value;
|
|
5267
|
+
if (value !== undefined) {
|
|
5268
|
+
this.editorView.setTabIndicator(value);
|
|
5269
|
+
}
|
|
5270
|
+
this.requestRender();
|
|
5271
|
+
}
|
|
5272
|
+
}
|
|
5273
|
+
get tabIndicatorColor() {
|
|
5274
|
+
return this._tabIndicatorColor;
|
|
5275
|
+
}
|
|
5276
|
+
set tabIndicatorColor(value) {
|
|
5277
|
+
const newColor = value ? parseColor(value) : undefined;
|
|
5278
|
+
if (this._tabIndicatorColor !== newColor) {
|
|
5279
|
+
this._tabIndicatorColor = newColor;
|
|
5280
|
+
if (newColor !== undefined) {
|
|
5281
|
+
this.editorView.setTabIndicatorColor(newColor);
|
|
5282
|
+
}
|
|
5283
|
+
this.requestRender();
|
|
5284
|
+
}
|
|
5285
|
+
}
|
|
5194
5286
|
onResize(width, height) {
|
|
5195
5287
|
this.editorView.setViewportSize(width, height);
|
|
5196
5288
|
if (this.lastLocalSelection) {
|
|
@@ -6022,5 +6114,5 @@ export {
|
|
|
6022
6114
|
ASCIIFont
|
|
6023
6115
|
};
|
|
6024
6116
|
|
|
6025
|
-
//# debugId=
|
|
6117
|
+
//# debugId=1F85D8F895EC38C664756E2164756E21
|
|
6026
6118
|
//# sourceMappingURL=index.js.map
|