@opentui/core 0.1.26 → 0.1.27

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.
@@ -27,7 +27,7 @@ var __export = (target, all) => {
27
27
  };
28
28
  var __require = import.meta.require;
29
29
 
30
- // ../../node_modules/yoga-layout/dist/src/index.js
30
+ // ../../node_modules/.bun/yoga-layout@3.2.1/node_modules/yoga-layout/dist/src/index.js
31
31
  var exports_src = {};
32
32
  __export(exports_src, {
33
33
  default: () => src_default,
@@ -51,7 +51,7 @@ __export(exports_src, {
51
51
  Align: () => Align
52
52
  });
53
53
 
54
- // ../../node_modules/yoga-layout/dist/binaries/yoga-wasm-base64-esm.js
54
+ // ../../node_modules/.bun/yoga-layout@3.2.1/node_modules/yoga-layout/dist/binaries/yoga-wasm-base64-esm.js
55
55
  var loadYoga = (() => {
56
56
  var _scriptDir = import.meta.url;
57
57
  return function(loadYoga2) {
@@ -1356,7 +1356,7 @@ var loadYoga = (() => {
1356
1356
  })();
1357
1357
  var yoga_wasm_base64_esm_default = loadYoga;
1358
1358
 
1359
- // ../../node_modules/yoga-layout/dist/src/generated/YGEnums.js
1359
+ // ../../node_modules/.bun/yoga-layout@3.2.1/node_modules/yoga-layout/dist/src/generated/YGEnums.js
1360
1360
  var Align = /* @__PURE__ */ function(Align2) {
1361
1361
  Align2[Align2["Auto"] = 0] = "Auto";
1362
1362
  Align2[Align2["FlexStart"] = 1] = "FlexStart";
@@ -1559,7 +1559,7 @@ var constants = {
1559
1559
  };
1560
1560
  var YGEnums_default = constants;
1561
1561
 
1562
- // ../../node_modules/yoga-layout/dist/src/wrapAssembly.js
1562
+ // ../../node_modules/.bun/yoga-layout@3.2.1/node_modules/yoga-layout/dist/src/wrapAssembly.js
1563
1563
  function wrapAssembly(lib) {
1564
1564
  function patch(prototype, name, fn) {
1565
1565
  const original = prototype[name];
@@ -1661,7 +1661,7 @@ function wrapAssembly(lib) {
1661
1661
  };
1662
1662
  }
1663
1663
 
1664
- // ../../node_modules/yoga-layout/dist/src/index.js
1664
+ // ../../node_modules/.bun/yoga-layout@3.2.1/node_modules/yoga-layout/dist/src/index.js
1665
1665
  var Yoga = wrapAssembly(await yoga_wasm_base64_esm_default());
1666
1666
  var src_default = Yoga;
1667
1667
 
@@ -2257,6 +2257,7 @@ class KeyHandler extends EventEmitter {
2257
2257
  listener;
2258
2258
  pasteMode = false;
2259
2259
  pasteBuffer = [];
2260
+ suspended = false;
2260
2261
  constructor(stdin, useKittyKeyboard = false) {
2261
2262
  super();
2262
2263
  this.stdin = stdin || process.stdin;
@@ -2296,6 +2297,18 @@ class KeyHandler extends EventEmitter {
2296
2297
  destroy() {
2297
2298
  this.stdin.removeListener("data", this.listener);
2298
2299
  }
2300
+ suspend() {
2301
+ if (!this.suspended) {
2302
+ this.suspended = true;
2303
+ this.stdin.removeListener("data", this.listener);
2304
+ }
2305
+ }
2306
+ resume() {
2307
+ if (this.suspended) {
2308
+ this.suspended = false;
2309
+ this.stdin.on("data", this.listener);
2310
+ }
2311
+ }
2299
2312
  }
2300
2313
 
2301
2314
  class InternalKeyHandler extends KeyHandler {
@@ -9815,6 +9828,16 @@ var CliRenderEvents;
9815
9828
  ((CliRenderEvents2) => {
9816
9829
  CliRenderEvents2["DEBUG_OVERLAY_TOGGLE"] = "debugOverlay:toggle";
9817
9830
  })(CliRenderEvents ||= {});
9831
+ var RendererControlState;
9832
+ ((RendererControlState2) => {
9833
+ RendererControlState2["IDLE"] = "idle";
9834
+ RendererControlState2["AUTO_STARTED"] = "auto_started";
9835
+ RendererControlState2["EXPLICIT_STARTED"] = "explicit_started";
9836
+ RendererControlState2["EXPLICIT_PAUSED"] = "explicit_paused";
9837
+ RendererControlState2["EXPLICIT_SUSPENDED"] = "explicit_suspended";
9838
+ RendererControlState2["EXPLICIT_STOPPED"] = "explicit_stopped";
9839
+ })(RendererControlState ||= {});
9840
+
9818
9841
  class CliRenderer extends EventEmitter7 {
9819
9842
  static animationFrameId = 0;
9820
9843
  lib;
@@ -9856,7 +9879,7 @@ class CliRenderer extends EventEmitter7 {
9856
9879
  immediateRerenderRequested = false;
9857
9880
  updateScheduled = false;
9858
9881
  liveRequestCounter = 0;
9859
- controlState = "idle" /* IDLE */;
9882
+ _controlState = "idle" /* IDLE */;
9860
9883
  frameCallbacks = [];
9861
9884
  renderStats = {
9862
9885
  frameCount: 0,
@@ -9877,6 +9900,8 @@ class CliRenderer extends EventEmitter7 {
9877
9900
  enableMouseMovement = false;
9878
9901
  _useMouse = true;
9879
9902
  _useAlternateScreen = env.OTUI_USE_ALTERNATE_SCREEN;
9903
+ _suspendedMouseEnabled = false;
9904
+ _previousControlState = "idle" /* IDLE */;
9880
9905
  capturedRenderable;
9881
9906
  lastOverRenderableNum = 0;
9882
9907
  lastOverRenderable;
@@ -9960,6 +9985,9 @@ Captured output:
9960
9985
  warningHandler = ((warning) => {
9961
9986
  console.warn(JSON.stringify(warning.message, null, 2));
9962
9987
  }).bind(this);
9988
+ get controlState() {
9989
+ return this._controlState;
9990
+ }
9963
9991
  constructor(lib, rendererPtr, stdin, stdout, width, height, config = {}) {
9964
9992
  super();
9965
9993
  rendererTracker.addRenderer(this);
@@ -10066,7 +10094,7 @@ Captured output:
10066
10094
  return this.realStdoutWrite.call(this.stdout, chunk, encoding, callback);
10067
10095
  }
10068
10096
  requestRender() {
10069
- if (!this.rendering && !this.updateScheduled && !this._isRunning) {
10097
+ if (!this.rendering && !this.updateScheduled && !this._isRunning && this._controlState !== "explicit_suspended" /* EXPLICIT_SUSPENDED */) {
10070
10098
  this.updateScheduled = true;
10071
10099
  process.nextTick(() => {
10072
10100
  this.loop();
@@ -10129,7 +10157,7 @@ Captured output:
10129
10157
  return this.liveRequestCounter;
10130
10158
  }
10131
10159
  get currentControlState() {
10132
- return this.controlState;
10160
+ return this._controlState;
10133
10161
  }
10134
10162
  get capabilities() {
10135
10163
  return this._capabilities;
@@ -10209,9 +10237,11 @@ Captured output:
10209
10237
  return true;
10210
10238
  }
10211
10239
  enableMouse() {
10240
+ this._useMouse = true;
10212
10241
  this.lib.enableMouse(this.rendererPtr, this.enableMouseMovement);
10213
10242
  }
10214
10243
  disableMouse() {
10244
+ this._useMouse = false;
10215
10245
  this.capturedRenderable = undefined;
10216
10246
  this.mouseParser.reset();
10217
10247
  this.lib.disableMouse(this.rendererPtr);
@@ -10568,24 +10598,24 @@ Captured output:
10568
10598
  }
10569
10599
  requestLive() {
10570
10600
  this.liveRequestCounter++;
10571
- if (this.controlState === "idle" /* IDLE */ && this.liveRequestCounter > 0) {
10572
- this.controlState = "auto_started" /* AUTO_STARTED */;
10601
+ if (this._controlState === "idle" /* IDLE */ && this.liveRequestCounter > 0) {
10602
+ this._controlState = "auto_started" /* AUTO_STARTED */;
10573
10603
  this.internalStart();
10574
10604
  }
10575
10605
  }
10576
10606
  dropLive() {
10577
10607
  this.liveRequestCounter = Math.max(0, this.liveRequestCounter - 1);
10578
- if (this.controlState === "auto_started" /* AUTO_STARTED */ && this.liveRequestCounter === 0) {
10579
- this.controlState = "idle" /* IDLE */;
10608
+ if (this._controlState === "auto_started" /* AUTO_STARTED */ && this.liveRequestCounter === 0) {
10609
+ this._controlState = "idle" /* IDLE */;
10580
10610
  this.internalPause();
10581
10611
  }
10582
10612
  }
10583
10613
  start() {
10584
- this.controlState = "explicit_started" /* EXPLICIT_STARTED */;
10614
+ this._controlState = "explicit_started" /* EXPLICIT_STARTED */;
10585
10615
  this.internalStart();
10586
10616
  }
10587
10617
  auto() {
10588
- this.controlState = this._isRunning ? "auto_started" /* AUTO_STARTED */ : "idle" /* IDLE */;
10618
+ this._controlState = this._isRunning ? "auto_started" /* AUTO_STARTED */ : "idle" /* IDLE */;
10589
10619
  }
10590
10620
  internalStart() {
10591
10621
  if (!this._isRunning && !this._isDestroyed) {
@@ -10597,14 +10627,40 @@ Captured output:
10597
10627
  }
10598
10628
  }
10599
10629
  pause() {
10600
- this.controlState = "explicit_paused" /* EXPLICIT_PAUSED */;
10630
+ this._controlState = "explicit_paused" /* EXPLICIT_PAUSED */;
10631
+ this.internalPause();
10632
+ }
10633
+ suspend() {
10634
+ this._previousControlState = this._controlState;
10635
+ this._controlState = "explicit_suspended" /* EXPLICIT_SUSPENDED */;
10601
10636
  this.internalPause();
10637
+ this._suspendedMouseEnabled = this._useMouse;
10638
+ this.disableMouse();
10639
+ this._keyHandler.suspend();
10640
+ if (this.stdin.setRawMode) {
10641
+ this.stdin.setRawMode(false);
10642
+ }
10643
+ this.stdin.pause();
10644
+ }
10645
+ resume() {
10646
+ if (this.stdin.setRawMode) {
10647
+ this.stdin.setRawMode(true);
10648
+ }
10649
+ this.stdin.resume();
10650
+ this._keyHandler.resume();
10651
+ if (this._suspendedMouseEnabled) {
10652
+ this.enableMouse();
10653
+ }
10654
+ this._controlState = this._previousControlState;
10655
+ if (this._previousControlState === "auto_started" /* AUTO_STARTED */ || this._previousControlState === "explicit_started" /* EXPLICIT_STARTED */) {
10656
+ this.internalStart();
10657
+ }
10602
10658
  }
10603
10659
  internalPause() {
10604
10660
  this._isRunning = false;
10605
10661
  }
10606
10662
  stop() {
10607
- this.controlState = "explicit_stopped" /* EXPLICIT_STOPPED */;
10663
+ this._controlState = "explicit_stopped" /* EXPLICIT_STOPPED */;
10608
10664
  this.internalStop();
10609
10665
  }
10610
10666
  internalStop() {
@@ -10881,7 +10937,7 @@ Captured output:
10881
10937
  }
10882
10938
  }
10883
10939
 
10884
- export { __toESM, __commonJS, __export, __require, Edge, Gutter, exports_src, BorderChars, getBorderFromSides, getBorderSides, borderCharsToArray, BorderCharArrays, nonAlphanumericKeys, parseKeypress, ANSI, KeyEvent, PasteEvent, KeyHandler, InternalKeyHandler, RGBA, hexToRgb, rgbToHex, hsvToRgb, parseColor, fonts, measureText, getCharacterPositions, coordinateToCharacterIndex, renderFontToFrameBuffer, TextAttributes, DebugOverlayCorner, createTextAttributes, visualizeRenderableTree, isStyledText, StyledText, stringToStyledText, black, red, green, yellow, blue, magenta, cyan, white, brightBlack, brightRed, brightGreen, brightYellow, brightBlue, brightMagenta, brightCyan, brightWhite, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bold, italic, underline, strikethrough, dim, reverse, blink, fg, bg, t, convertThemeToStyles, SyntaxStyle, hastToStyledText, LinearScrollAccel, MacOSScrollAccel, parseAlign, parseBoxSizing, parseDimension, parseDirection, parseDisplay, parseEdge, parseFlexDirection, parseGutter, parseJustify, parseLogLevel, parseMeasureMode, parseOverflow, parsePositionType, parseUnit, parseWrap, MouseParser, Selection, convertGlobalToLocalSelection, ASCIIFontSelectionHelper, envRegistry, registerEnvVar, clearEnvCache, generateEnvMarkdown, generateEnvColored, env, treeSitterToTextChunks, treeSitterToStyledText, addDefaultParsers, TreeSitterClient, DataPathsManager, getDataPaths, extToFiletype, pathToFiletype, main, getTreeSitterClient, TextBuffer, LogLevel2 as LogLevel, setRenderLibPath, resolveRenderLib, OptimizedBuffer, h, isVNode, maybeMakeRenderable, wrapWithDelegates, instantiate, delegate, isValidPercentage, LayoutEvents, RenderableEvents, isRenderable, BaseRenderable, Renderable, RootRenderable, capture, ConsolePosition, TerminalConsole, getObjectsInViewport, MouseEvent, MouseButton, createCliRenderer, CliRenderEvents, CliRenderer };
10940
+ export { __toESM, __commonJS, __export, __require, Edge, Gutter, exports_src, BorderChars, getBorderFromSides, getBorderSides, borderCharsToArray, BorderCharArrays, nonAlphanumericKeys, parseKeypress, ANSI, KeyEvent, PasteEvent, KeyHandler, InternalKeyHandler, RGBA, hexToRgb, rgbToHex, hsvToRgb, parseColor, fonts, measureText, getCharacterPositions, coordinateToCharacterIndex, renderFontToFrameBuffer, TextAttributes, DebugOverlayCorner, createTextAttributes, visualizeRenderableTree, isStyledText, StyledText, stringToStyledText, black, red, green, yellow, blue, magenta, cyan, white, brightBlack, brightRed, brightGreen, brightYellow, brightBlue, brightMagenta, brightCyan, brightWhite, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bold, italic, underline, strikethrough, dim, reverse, blink, fg, bg, t, convertThemeToStyles, SyntaxStyle, hastToStyledText, LinearScrollAccel, MacOSScrollAccel, parseAlign, parseBoxSizing, parseDimension, parseDirection, parseDisplay, parseEdge, parseFlexDirection, parseGutter, parseJustify, parseLogLevel, parseMeasureMode, parseOverflow, parsePositionType, parseUnit, parseWrap, MouseParser, Selection, convertGlobalToLocalSelection, ASCIIFontSelectionHelper, envRegistry, registerEnvVar, clearEnvCache, generateEnvMarkdown, generateEnvColored, env, treeSitterToTextChunks, treeSitterToStyledText, addDefaultParsers, TreeSitterClient, DataPathsManager, getDataPaths, extToFiletype, pathToFiletype, main, getTreeSitterClient, TextBuffer, LogLevel2 as LogLevel, setRenderLibPath, resolveRenderLib, OptimizedBuffer, h, isVNode, maybeMakeRenderable, wrapWithDelegates, instantiate, delegate, isValidPercentage, LayoutEvents, RenderableEvents, isRenderable, BaseRenderable, Renderable, RootRenderable, capture, ConsolePosition, TerminalConsole, getObjectsInViewport, MouseEvent, MouseButton, createCliRenderer, CliRenderEvents, RendererControlState, CliRenderer };
10885
10941
 
10886
- //# debugId=66FAF32C902A5E0B64756E2164756E21
10887
- //# sourceMappingURL=index-pxa2sv92.js.map
10942
+ //# debugId=4CAC9B07B4894E3E64756E2164756E21
10943
+ //# sourceMappingURL=index-zx1dwm33.js.map