@opentui/core 0.5.12 → 0.5.14

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.
@@ -41,7 +41,7 @@ import {
41
41
  NativeMeasureTargetKind2,
42
42
  resolveRenderLib2,
43
43
  yoga_default
44
- } from "./chunk-node-1zjyxy5y.js";
44
+ } from "./chunk-node-80p7e6t6.js";
45
45
 
46
46
  // src/syntax-style.ts
47
47
  function convertThemeToStyles2(theme) {
@@ -1110,8 +1110,8 @@ class Renderable2 extends BaseRenderable2 {
1110
1110
  const parentScreenY = this.parent ? this.parent._screenY : 0;
1111
1111
  this._screenX = parentScreenX + this._x + this._translateX;
1112
1112
  this._screenY = parentScreenY + this._y + this._translateY;
1113
- const newWidth = Math.max(layout.width, 1);
1114
- const newHeight = Math.max(layout.height, 1);
1113
+ const newWidth = Number.isNaN(layout.width) ? oldWidth : Math.max(layout.width, 1);
1114
+ const newHeight = Number.isNaN(layout.height) ? oldHeight : Math.max(layout.height, 1);
1115
1115
  const sizeChanged = oldWidth !== newWidth || oldHeight !== newHeight;
1116
1116
  this._widthValue = newWidth;
1117
1117
  this._heightValue = newHeight;
@@ -1843,6 +1843,7 @@ class TextBufferView2 {
1843
1843
  viewPtr;
1844
1844
  textBuffer;
1845
1845
  _destroyed = false;
1846
+ selectionClear = true;
1846
1847
  constructor(lib, ptr, textBuffer) {
1847
1848
  this.lib = lib;
1848
1849
  this.viewPtr = ptr;
@@ -1863,15 +1864,20 @@ class TextBufferView2 {
1863
1864
  }
1864
1865
  setSelection(start, end, bgColor, fgColor) {
1865
1866
  this.guard();
1867
+ this.selectionClear = false;
1866
1868
  this.lib.textBufferViewSetSelection(this.viewPtr, start, end, bgColor || null, fgColor || null);
1867
1869
  }
1868
1870
  updateSelection(end, bgColor, fgColor) {
1869
1871
  this.guard();
1872
+ this.selectionClear = false;
1870
1873
  this.lib.textBufferViewUpdateSelection(this.viewPtr, end, bgColor || null, fgColor || null);
1871
1874
  }
1872
1875
  resetSelection() {
1873
1876
  this.guard();
1877
+ if (this.selectionClear)
1878
+ return;
1874
1879
  this.lib.textBufferViewResetSelection(this.viewPtr);
1880
+ this.selectionClear = true;
1875
1881
  }
1876
1882
  getSelection() {
1877
1883
  this.guard();
@@ -1883,15 +1889,20 @@ class TextBufferView2 {
1883
1889
  }
1884
1890
  setLocalSelection(anchorX, anchorY, focusX, focusY, bgColor, fgColor, behavior = "cell") {
1885
1891
  this.guard();
1892
+ this.selectionClear = false;
1886
1893
  return this.lib.textBufferViewSetLocalSelection(this.viewPtr, anchorX, anchorY, focusX, focusY, bgColor || null, fgColor || null, behavior);
1887
1894
  }
1888
1895
  updateLocalSelection(anchorX, anchorY, focusX, focusY, bgColor, fgColor, behavior = "cell") {
1889
1896
  this.guard();
1897
+ this.selectionClear = false;
1890
1898
  return this.lib.textBufferViewUpdateLocalSelection(this.viewPtr, anchorX, anchorY, focusX, focusY, bgColor || null, fgColor || null, behavior);
1891
1899
  }
1892
1900
  resetLocalSelection() {
1893
1901
  this.guard();
1902
+ if (this.selectionClear)
1903
+ return;
1894
1904
  this.lib.textBufferViewResetLocalSelection(this.viewPtr);
1905
+ this.selectionClear = true;
1895
1906
  }
1896
1907
  setSelectionOccupancy(occupancy) {
1897
1908
  this.guard();
@@ -7242,6 +7253,7 @@ class CliRenderer2 extends EventEmitter5 {
7242
7253
  hasLoggedStdinParserError = false;
7243
7254
  animationRequest = new Map;
7244
7255
  resizeTimeoutId = null;
7256
+ pendingResizeSawDifferentSize = false;
7245
7257
  capabilityTimeoutId = null;
7246
7258
  kittyTransportTimer = null;
7247
7259
  kittyTransportMode;
@@ -9493,19 +9505,26 @@ Captured external output:
9493
9505
  handleResize(width, height) {
9494
9506
  if (this._isDestroyed)
9495
9507
  return;
9496
- if (this._splitHeight > 0) {
9497
- this.processResize(width, height);
9498
- return;
9499
- }
9508
+ if (width !== this._terminalWidth || height !== this._terminalHeight)
9509
+ this.pendingResizeSawDifferentSize = true;
9500
9510
  if (this.resizeTimeoutId !== null) {
9501
9511
  this.clock.clearTimeout(this.resizeTimeoutId);
9502
9512
  this.resizeTimeoutId = null;
9503
9513
  }
9514
+ if (this._splitHeight > 0) {
9515
+ this.applyPendingResize(width, height);
9516
+ return;
9517
+ }
9504
9518
  this.resizeTimeoutId = this.clock.setTimeout(() => {
9505
9519
  this.resizeTimeoutId = null;
9506
- this.processResize(width, height);
9520
+ this.applyPendingResize(width, height);
9507
9521
  }, this.resizeDebounceDelay);
9508
9522
  }
9523
+ applyPendingResize(width, height) {
9524
+ const sawDifferentSize = this.pendingResizeSawDifferentSize;
9525
+ this.pendingResizeSawDifferentSize = false;
9526
+ this.processResize(width, height, sawDifferentSize);
9527
+ }
9509
9528
  queryPixelResolution() {
9510
9529
  this.pixelResolutionRequeryPending = true;
9511
9530
  if (this._controlState === "explicit_suspended" /* EXPLICIT_SUSPENDED */ || this.waitingForPixelResolution)
@@ -9515,9 +9534,14 @@ Captured external output:
9515
9534
  this.updateStdinParserProtocolContext({ pixelResolutionQueryActive: true });
9516
9535
  this.lib.queryPixelResolution(this.rendererPtr);
9517
9536
  }
9518
- processResize(width, height) {
9519
- if (width === this._terminalWidth && height === this._terminalHeight)
9537
+ processResize(width, height, repaintIfUnchanged = false) {
9538
+ if (width === this._terminalWidth && height === this._terminalHeight) {
9539
+ if (repaintIfUnchanged) {
9540
+ this.forceFullRepaintRequested = true;
9541
+ this.requestRender();
9542
+ }
9520
9543
  return;
9544
+ }
9521
9545
  if (this._terminalIsSetup && this._controlState !== "explicit_suspended" /* EXPLICIT_SUSPENDED */ && !this.isSplitCursorSeedFrameBlocked()) {
9522
9546
  this.flushPendingSplitOutputBeforeTransition();
9523
9547
  }
@@ -10502,5 +10526,5 @@ Captured external output:
10502
10526
 
10503
10527
  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 };
10504
10528
 
10505
- //# debugId=47CBB6DA4E1BD0DC64756E2164756E21
10506
- //# sourceMappingURL=chunk-node-fyb4fckk.js.map
10529
+ //# debugId=C6D82E9092C3701764756E2164756E21
10530
+ //# sourceMappingURL=chunk-node-wp7ct2m6.js.map