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