@opentui/core 0.4.1 → 0.4.2

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.
@@ -1,4 +1,5 @@
1
1
  import {
2
+ Clipboard,
2
3
  InternalKeyHandler,
3
4
  KeyHandler,
4
5
  OptimizedBuffer,
@@ -38,7 +39,7 @@ import {
38
39
  toArrayBuffer,
39
40
  treeSitterToTextChunks,
40
41
  yoga_default
41
- } from "./index-pcvh9d34.js";
42
+ } from "./index-x7n320jr.js";
42
43
 
43
44
  // src/Renderable.ts
44
45
  import { EventEmitter } from "events";
@@ -6273,38 +6274,6 @@ var ANSI = {
6273
6274
  bracketedPasteEnd: "\x1B[201~"
6274
6275
  };
6275
6276
 
6276
- // src/lib/clipboard.ts
6277
- function encodeOsc52Payload(text, encoder = new TextEncoder) {
6278
- const base64 = Buffer.from(text).toString("base64");
6279
- return encoder.encode(base64);
6280
- }
6281
-
6282
- class Clipboard {
6283
- lib;
6284
- rendererPtr;
6285
- constructor(lib, rendererPtr) {
6286
- this.lib = lib;
6287
- this.rendererPtr = rendererPtr;
6288
- }
6289
- copyToClipboardOSC52(text, target = 0 /* Clipboard */) {
6290
- if (!this.isOsc52Supported()) {
6291
- return false;
6292
- }
6293
- const payload = encodeOsc52Payload(text, this.lib.encoder);
6294
- return this.lib.copyToClipboardOSC52(this.rendererPtr, target, payload);
6295
- }
6296
- clearClipboardOSC52(target = 0 /* Clipboard */) {
6297
- if (!this.isOsc52Supported()) {
6298
- return false;
6299
- }
6300
- return this.lib.clearClipboardOSC52(this.rendererPtr, target);
6301
- }
6302
- isOsc52Supported() {
6303
- const caps = this.lib.getTerminalCapabilities(this.rendererPtr);
6304
- return Boolean(caps?.osc52);
6305
- }
6306
- }
6307
-
6308
6277
  // src/renderer.ts
6309
6278
  import { EventEmitter as EventEmitter5 } from "events";
6310
6279
 
@@ -6437,6 +6406,9 @@ function isCapabilityResponse(sequence) {
6437
6406
  if (/\x1bP>\|[\s\S]*?\x1b\\/.test(sequence)) {
6438
6407
  return true;
6439
6408
  }
6409
+ if (/\x1bP(?:1\+r4d73(?:=[^\x1b]*)?|0\+r(?:4d73)?)\x1b\\/i.test(sequence)) {
6410
+ return true;
6411
+ }
6440
6412
  if (/\x1b_G[\s\S]*?\x1b\\/.test(sequence)) {
6441
6413
  return true;
6442
6414
  }
@@ -7497,6 +7469,8 @@ Captured external output:
7497
7469
  return "retryable-skip";
7498
7470
  }
7499
7471
  if (status === NATIVE_RENDER_STATUS_SKIPPED) {
7472
+ if (this._useThread && this._usesProcessStdout)
7473
+ return "backpressured";
7500
7474
  console.error("[CliRenderer] Native frame render unexpectedly skipped without a feed");
7501
7475
  return "failed";
7502
7476
  }
@@ -9232,7 +9206,7 @@ Captured external output:
9232
9206
  return this.clipboard.clearClipboardOSC52(target);
9233
9207
  }
9234
9208
  isOsc52Supported() {
9235
- return this._capabilities?.osc52 ?? this.clipboard.isOsc52Supported();
9209
+ return this._capabilities ? this._capabilities.osc52_support !== "unsupported" : this.clipboard.isOsc52Supported();
9236
9210
  }
9237
9211
  dumpHitGrid() {
9238
9212
  this.lib.dumpHitGrid(this.rendererPtr);
@@ -9592,6 +9566,7 @@ Captured external output:
9592
9566
  this.frameCount = 0;
9593
9567
  this.lastFpsTime = this.lastTime;
9594
9568
  this.currentFps = 0;
9569
+ this.renderStats.fps = 0;
9595
9570
  if (this.feedIdleRenderScheduled)
9596
9571
  return;
9597
9572
  this.loop();
@@ -9611,14 +9586,7 @@ Captured external output:
9611
9586
  const elapsed = this.getElapsedMs(now, this.lastTime);
9612
9587
  const deltaTime = elapsed;
9613
9588
  this.lastTime = now;
9614
- this.frameCount++;
9615
- if (this.getElapsedMs(now, this.lastFpsTime) >= 1000) {
9616
- this.currentFps = this.frameCount;
9617
- this.frameCount = 0;
9618
- this.lastFpsTime = now;
9619
- }
9620
9589
  this.renderStats.frameCount++;
9621
- this.renderStats.fps = this.currentFps;
9622
9590
  const overallStart = performance.now();
9623
9591
  const frameRequests = Array.from(this.animationRequest.values());
9624
9592
  this.animationRequest.clear();
@@ -9646,6 +9614,14 @@ Captured external output:
9646
9614
  this._console.renderToBuffer(this.nextRenderBuffer);
9647
9615
  if (!this._isDestroyed) {
9648
9616
  const nativeStatus = this.renderNative() ?? "rendered";
9617
+ if (nativeStatus === "rendered")
9618
+ this.frameCount++;
9619
+ if (this.getElapsedMs(now, this.lastFpsTime) >= 1000) {
9620
+ this.currentFps = this.frameCount;
9621
+ this.frameCount = 0;
9622
+ this.lastFpsTime = now;
9623
+ }
9624
+ this.renderStats.fps = this.currentFps;
9649
9625
  if (nativeStatus === "rendered") {
9650
9626
  if (this._useMouse && this.lib.getHitGridDirty(this.rendererPtr)) {
9651
9627
  this.recheckHoverState();
@@ -10054,5 +10030,5 @@ Captured external output:
10054
10030
 
10055
10031
  export { h, isVNode, maybeMakeRenderable, wrapWithDelegates, instantiate, delegate, LayoutEvents, RenderableEvents, isRenderable, BaseRenderable, Renderable, RootRenderable, TextBufferView, EditBuffer, EditorView, convertThemeToStyles, SyntaxStyle, ANSI, BoxRenderable, TextBufferRenderable, CodeRenderable, isTextNodeRenderable, TextNodeRenderable, RootTextNodeRenderable, TextRenderable, NativeSpanFeed, defaultKeyAliases, mergeKeyAliases, mergeKeyBindings, getKeyBindingAction, buildKeyBindingsMap, capture, ConsolePosition, TerminalConsole, getObjectsInViewport, EditBufferRenderableEvents, isEditBufferRenderable, EditBufferRenderable, buildKittyKeyboardFlags, MouseEvent, MouseButton, createCliRenderer, CliRenderEvents, RendererControlState, CliRenderer };
10056
10032
 
10057
- //# debugId=D566D64CFF69CBEF64756E2164756E21
10058
- //# sourceMappingURL=index-07zpr2dg.js.map
10033
+ //# debugId=4FDEA314173926CA64756E2164756E21
10034
+ //# sourceMappingURL=index-6xr3rbbe.js.map