@opentui/core 0.9.0 → 0.9.1
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/NativeScene.d.ts +1 -1
- package/Renderable.d.ts +6 -0
- package/{chunk-bun-ywheza3e.js → chunk-bun-v1wzs0bj.js} +25 -12
- package/chunk-bun-v1wzs0bj.js.map +35 -0
- package/{chunk-bun-rgb7yx3r.js → chunk-bun-xartp4ps.js} +41 -19
- package/{chunk-bun-rgb7yx3r.js.map → chunk-bun-xartp4ps.js.map} +9 -9
- package/{chunk-node-fcberveq.js → chunk-node-5cqzgmq3.js} +41 -19
- package/{chunk-node-fcberveq.js.map → chunk-node-5cqzgmq3.js.map} +9 -9
- package/{chunk-node-k5s8s41v.js → chunk-node-mcdre3zn.js} +25 -12
- package/chunk-node-mcdre3zn.js.map +34 -0
- package/edit-buffer.d.ts +7 -1
- package/index.bun.js +108 -4
- package/index.bun.js.map +3 -3
- package/index.node.js +108 -4
- package/index.node.js.map +3 -3
- package/native-abi.generated.d.ts +9 -1
- package/package.json +9 -9
- package/renderables/TextBufferRenderable.d.ts +2 -0
- package/renderables/TextTable.d.ts +16 -0
- package/testing.bun.js +2 -2
- package/testing.js +2 -2
- package/text-buffer-view.d.ts +4 -0
- package/text-buffer.d.ts +12 -1
- package/yoga.bun.js +1 -1
- package/yoga.js +1 -1
- package/zig.d.ts +4 -1
- package/chunk-bun-ywheza3e.js.map +0 -35
- package/chunk-node-k5s8s41v.js.map +0 -34
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
PositionType2,
|
|
70
70
|
Unit2,
|
|
71
71
|
Wrap2
|
|
72
|
-
} from "./chunk-node-
|
|
72
|
+
} from "./chunk-node-mcdre3zn.js";
|
|
73
73
|
|
|
74
74
|
// src/lib/border.ts
|
|
75
75
|
var VALID_BORDER_STYLES = ["single", "double", "rounded", "heavy"];
|
|
@@ -8253,7 +8253,17 @@ class Renderable2 extends BaseRenderable2 {
|
|
|
8253
8253
|
this._ctx.requestRender();
|
|
8254
8254
|
}
|
|
8255
8255
|
_needsLifecyclePass() {
|
|
8256
|
-
return this.onLifecyclePass !== null;
|
|
8256
|
+
return this.onLifecyclePass !== null || this._builtinLifecyclePass !== null;
|
|
8257
|
+
}
|
|
8258
|
+
_builtinLifecyclePass = null;
|
|
8259
|
+
setBuiltinLifecyclePass(pass) {
|
|
8260
|
+
this._builtinLifecyclePass = pass;
|
|
8261
|
+
this.syncLifecyclePass();
|
|
8262
|
+
}
|
|
8263
|
+
_runLifecyclePass() {
|
|
8264
|
+
this._builtinLifecyclePass?.call(this);
|
|
8265
|
+
if (!this._isDestroyed)
|
|
8266
|
+
this._hooks.onLifecyclePass?.call(this);
|
|
8257
8267
|
}
|
|
8258
8268
|
get translateX() {
|
|
8259
8269
|
return this._translateX;
|
|
@@ -8990,7 +9000,7 @@ class Renderable2 extends BaseRenderable2 {
|
|
|
8990
9000
|
const passes = previous._ctx.getLifecyclePasses();
|
|
8991
9001
|
lifecycle = new Map([[passes, false]]);
|
|
8992
9002
|
}
|
|
8993
|
-
if (typeof child.onLifecyclePass === "function") {
|
|
9003
|
+
if (typeof child.onLifecyclePass === "function" || child._builtinLifecyclePass) {
|
|
8994
9004
|
const passes = target._ctx.getLifecyclePasses();
|
|
8995
9005
|
lifecycle ??= new Map;
|
|
8996
9006
|
lifecycle.set(passes, true);
|
|
@@ -9197,7 +9207,7 @@ class Renderable2 extends BaseRenderable2 {
|
|
|
9197
9207
|
this.syncLifecyclePass();
|
|
9198
9208
|
}
|
|
9199
9209
|
syncLifecyclePass() {
|
|
9200
|
-
if (!this.onLifecyclePass)
|
|
9210
|
+
if (!this.onLifecyclePass && !this._builtinLifecyclePass)
|
|
9201
9211
|
this._ctx.unregisterLifecyclePass(this);
|
|
9202
9212
|
else if (this.parent)
|
|
9203
9213
|
this._ctx.registerLifecyclePass(this);
|
|
@@ -9763,13 +9773,13 @@ class TextBuffer2 {
|
|
|
9763
9773
|
this.native = { owner, handle };
|
|
9764
9774
|
this.updateLengths();
|
|
9765
9775
|
}
|
|
9766
|
-
static create(widthMethod, source) {
|
|
9776
|
+
static create(widthMethod, source, followSessionWidth = false) {
|
|
9767
9777
|
const owner = source?.resourceContext;
|
|
9768
9778
|
if (!owner)
|
|
9769
9779
|
throw new Error("TextBuffer requires an explicit resource owner: pass renderer.nativeScene, or a ResourceContext when there is no renderer");
|
|
9770
9780
|
owner.assertAlive();
|
|
9771
9781
|
const lib = owner.renderLib;
|
|
9772
|
-
const handle = lib.createContextTextBuffer(owner.context, { widthMethod });
|
|
9782
|
+
const handle = lib.createContextTextBuffer(owner.context, { widthMethod, followSessionWidth });
|
|
9773
9783
|
try {
|
|
9774
9784
|
return new TextBuffer2(lib, handle, owner);
|
|
9775
9785
|
} catch (error) {
|
|
@@ -9962,6 +9972,10 @@ class TextBuffer2 {
|
|
|
9962
9972
|
this.updateLengths();
|
|
9963
9973
|
});
|
|
9964
9974
|
}
|
|
9975
|
+
setWidthMethod(widthMethod) {
|
|
9976
|
+
this.guard();
|
|
9977
|
+
this.lib.contextTextBufferSetWidthMethod(this.native.handle.context, this.native.handle, widthMethod);
|
|
9978
|
+
}
|
|
9965
9979
|
getTabWidth() {
|
|
9966
9980
|
this.guard();
|
|
9967
9981
|
return this.lib.contextTextBufferGetInfo(this.native.handle.context, this.native.handle).tabWidth;
|
|
@@ -10062,6 +10076,9 @@ class TextBufferView2 {
|
|
|
10062
10076
|
setSelection(start, end, bgColor, fgColor) {
|
|
10063
10077
|
this.select({ operation: 0 /* Set */, start, end, bg: bgColor, fg: fgColor });
|
|
10064
10078
|
}
|
|
10079
|
+
_selectCharacter(offset) {
|
|
10080
|
+
this.select({ operation: 8 /* Inclusive */, start: offset, end: offset });
|
|
10081
|
+
}
|
|
10065
10082
|
updateSelection(end, bgColor, fgColor) {
|
|
10066
10083
|
this.select({ operation: 1 /* Update */, end, bg: bgColor, fg: fgColor });
|
|
10067
10084
|
}
|
|
@@ -10103,6 +10120,9 @@ class TextBufferView2 {
|
|
|
10103
10120
|
resetLocalSelection() {
|
|
10104
10121
|
this.reset(true);
|
|
10105
10122
|
}
|
|
10123
|
+
setSelectionColors(bgColor, fgColor) {
|
|
10124
|
+
this.select({ operation: 9 /* Colors */, bg: bgColor, fg: fgColor });
|
|
10125
|
+
}
|
|
10106
10126
|
setSelectionOccupancy(occupancy) {
|
|
10107
10127
|
this.guard();
|
|
10108
10128
|
this.lib.contextTextBufferViewSelect(this.native.handle.context, this.native.handle, {
|
|
@@ -10227,13 +10247,13 @@ class EditBuffer2 extends EventEmitter5 {
|
|
|
10227
10247
|
this.emit(name);
|
|
10228
10248
|
});
|
|
10229
10249
|
}
|
|
10230
|
-
static create(widthMethod, source) {
|
|
10250
|
+
static create(widthMethod, source, followSessionWidth = false) {
|
|
10231
10251
|
const owner = source?.resourceContext;
|
|
10232
10252
|
if (!owner)
|
|
10233
10253
|
throw new Error("EditBuffer requires an explicit resource owner: pass renderer.nativeScene, or a ResourceContext when there is no renderer");
|
|
10234
10254
|
owner.assertAlive();
|
|
10235
10255
|
const lib = owner.renderLib;
|
|
10236
|
-
const handle = lib.createContextEditBuffer(owner.context, { widthMethod });
|
|
10256
|
+
const handle = lib.createContextEditBuffer(owner.context, { widthMethod, followSessionWidth });
|
|
10237
10257
|
try {
|
|
10238
10258
|
return new EditBuffer2(lib, handle, owner);
|
|
10239
10259
|
} catch (error) {
|
|
@@ -11652,7 +11672,7 @@ class TextBufferRenderable2 extends Renderable2 {
|
|
|
11652
11672
|
this.setNativeSceneTextOptions();
|
|
11653
11673
|
return;
|
|
11654
11674
|
}
|
|
11655
|
-
textBuffer = TextBuffer2.create(this._ctx.widthMethod, ctx.nativeScene);
|
|
11675
|
+
textBuffer = TextBuffer2.create(this._ctx.widthMethod, ctx.nativeScene, true);
|
|
11656
11676
|
this.textBuffer = textBuffer;
|
|
11657
11677
|
textBufferView = TextBufferView2.create(textBuffer);
|
|
11658
11678
|
this.textBufferView = textBufferView;
|
|
@@ -11832,9 +11852,7 @@ class TextBufferRenderable2 extends Renderable2 {
|
|
|
11832
11852
|
const newColor = value ? RGBA2.clone(parseColor2(value)) : undefined;
|
|
11833
11853
|
if (this._selectionBg !== newColor) {
|
|
11834
11854
|
this.runMutation(() => {
|
|
11835
|
-
|
|
11836
|
-
this.updateLocalSelection(this.lastLocalSelection, true, { bg: newColor, fg: this._selectionFg });
|
|
11837
|
-
}
|
|
11855
|
+
this.setSelectionColors(newColor, this._selectionFg);
|
|
11838
11856
|
this._selectionBg = newColor;
|
|
11839
11857
|
this.requestRender();
|
|
11840
11858
|
});
|
|
@@ -11847,9 +11865,7 @@ class TextBufferRenderable2 extends Renderable2 {
|
|
|
11847
11865
|
const newColor = value ? RGBA2.clone(parseColor2(value)) : undefined;
|
|
11848
11866
|
if (this._selectionFg !== newColor) {
|
|
11849
11867
|
this.runMutation(() => {
|
|
11850
|
-
|
|
11851
|
-
this.updateLocalSelection(this.lastLocalSelection, true, { bg: this._selectionBg, fg: newColor });
|
|
11852
|
-
}
|
|
11868
|
+
this.setSelectionColors(this._selectionBg, newColor);
|
|
11853
11869
|
this._selectionFg = newColor;
|
|
11854
11870
|
this.requestRender();
|
|
11855
11871
|
});
|
|
@@ -11981,6 +11997,12 @@ class TextBufferRenderable2 extends Renderable2 {
|
|
|
11981
11997
|
}
|
|
11982
11998
|
return false;
|
|
11983
11999
|
}
|
|
12000
|
+
setSelectionColors(bg, fg) {
|
|
12001
|
+
if (this.nativeTextScene)
|
|
12002
|
+
this.nativeTextScene.setTextSelection(this, "colors", null, bg, fg);
|
|
12003
|
+
else
|
|
12004
|
+
this.textBufferView.setSelectionColors(bg, fg);
|
|
12005
|
+
}
|
|
11984
12006
|
updateLocalSelection(localSelection, isStart = true, colors) {
|
|
11985
12007
|
const bg = colors ? colors.bg : this._selectionBg;
|
|
11986
12008
|
const fg = colors ? colors.fg : this._selectionFg;
|
|
@@ -18086,7 +18108,7 @@ class EditBufferRenderable2 extends Renderable2 {
|
|
|
18086
18108
|
this._cursorStyle.color = RGBA2.clone(this._cursorStyle.color);
|
|
18087
18109
|
this._tabIndicator = options.tabIndicator ?? this._defaultOptions.tabIndicator;
|
|
18088
18110
|
this._tabIndicatorColor = options.tabIndicatorColor ? RGBA2.clone(parseColor2(options.tabIndicatorColor)) : this._defaultOptions.tabIndicatorColor;
|
|
18089
|
-
editBuffer = EditBuffer2.create(this._ctx.widthMethod, this._ctx.nativeScene);
|
|
18111
|
+
editBuffer = EditBuffer2.create(this._ctx.widthMethod, this._ctx.nativeScene, true);
|
|
18090
18112
|
this.editBuffer = editBuffer;
|
|
18091
18113
|
editorView = EditorView2.create(editBuffer, Math.max(1, Math.trunc(this.width || 80)), Math.max(1, Math.trunc(this.height || 24)));
|
|
18092
18114
|
this.editorView = editorView;
|
|
@@ -19455,7 +19477,7 @@ class NativeScene {
|
|
|
19455
19477
|
if (++visits > maxHostRequests)
|
|
19456
19478
|
throw new Error("Native scene lifecycle work limit exceeded");
|
|
19457
19479
|
if (!renderable.isDestroyed) {
|
|
19458
|
-
renderable.
|
|
19480
|
+
renderable._runLifecyclePass();
|
|
19459
19481
|
}
|
|
19460
19482
|
}
|
|
19461
19483
|
}
|
|
@@ -24440,5 +24462,5 @@ Captured external output:
|
|
|
24440
24462
|
|
|
24441
24463
|
export { isValidBorderStyle2, parseBorderStyle2, BorderChars2, getBorderFromSides2, getBorderSides2, borderCharsToArray2, BorderCharArrays2, KeyEvent2, PasteEvent2, KeyHandler2, InternalKeyHandler2, fonts2, measureText2, getCharacterPositions2, coordinateToCharacterIndex2, renderFontToFrameBuffer2, hastToStyledText2, SystemClock2, kittyKeyMap, terminalNamedSingleStrokeKeys2, parseKeypress2, LinearScrollAccel2, MacOSScrollAccel2, parseAlign2, parseAlignItems2, parseAlignContent2, parseBoxSizing2, parseDimension2, parseDirection2, parseDisplay2, parseEdge2, parseFlexDirection2, parseGutter2, parseJustify2, parseLayoutMode2, parseLogLevel2, parseMeasureMode2, parseOverflow2, parsePositionType2, parseUnit2, parseWrap2, Selection2, convertGlobalToLocalSelection2, ASCIIFontSelectionHelper2, addDefaultParsers2, TreeSitterClient2, treeSitterToTextChunks2, treeSitterToStyledText2, DataPathsManager2, getDataPaths2, extensionToFiletype2, basenameToFiletype2, extToFiletype2, pathToFiletype2, infoStringToFiletype2, getTreeSitterClient2, destroyTreeSitterClient2, ExtmarksController2, createExtmarksController2, TerminalPalette2, createTerminalPalette2, normalizeTerminalPalette2, buildTerminalPaletteSignature2, decodePasteBytes2, stripAnsiSequences2, createHostClipboard2, createClipboard2, ClipboardTarget2, createRendererClipboardAdapter2, detectLinks2, acquireSessionBufferLease2, ResourceContext2, OptimizedBuffer2, LayoutEvents2, RenderableEvents2, isRenderable2, BaseRenderable2, Renderable2, RootRenderable2, TextBuffer2, TextBufferView2, EditBuffer2, measureEditText2, EditorView2, Timeline2, engine2, getTimelineEngine2, createTimeline2, ANSI, BoxRenderable2, TextBufferRenderable2, SliderRenderable2, ScrollBarRenderable2, ArrowRenderable2, scrollUnitSize2, ScrollBoxWrapper2, ScrollBoxViewport2, ScrollBoxContent2, ScrollBoxBar2, ScrollBoxRenderable2, CodeRenderable2, ImageLoadError2, ImageError2, imageInfo2, NativeImage2, NativeImagePool2, resolveImageRenderProtocol2, checkCrop2, sameCrop2, ImageRenderable2, isTextNodeRenderable2, TextNodeRenderable2, RootTextNodeRenderable2, TextRenderable2, NativeSession2, defaultKeyAliases, mergeKeyAliases, mergeKeyBindings, getKeyBindingAction, buildKeyBindingsMap, capture2, ConsolePosition2, TerminalConsole2, EditBufferRenderableEvents2, isEditBufferRenderable2, EditBufferRenderable2, buildKittyKeyboardFlags2, MouseEvent2, MouseButton2, createCliRenderer2, CliRenderEvents2, RendererControlState2, CliRenderer2 };
|
|
24442
24464
|
|
|
24443
|
-
//# debugId=
|
|
24444
|
-
//# sourceMappingURL=chunk-node-
|
|
24465
|
+
//# debugId=7263C11C5CB1314264756E2164756E21
|
|
24466
|
+
//# sourceMappingURL=chunk-node-5cqzgmq3.js.map
|