@fairyhunter13/opentui-core 0.1.121 → 0.1.122

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/3d.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  __export,
7
7
  __require,
8
8
  __toESM
9
- } from "./index-7xsz0ndw.js";
9
+ } from "./index-c4vtensm.js";
10
10
 
11
11
  // ../../node_modules/.bun/omggif@1.0.10/node_modules/omggif/omggif.js
12
12
  var require_omggif = __commonJS((exports) => {
package/Renderable.d.ts CHANGED
@@ -122,6 +122,8 @@ export declare abstract class Renderable extends BaseRenderable {
122
122
  protected _translateY: number;
123
123
  protected _x: number;
124
124
  protected _y: number;
125
+ protected _screenX: number;
126
+ protected _screenY: number;
125
127
  protected _width: number | "auto" | `${number}%`;
126
128
  protected _height: number | "auto" | `${number}%`;
127
129
  protected _widthValue: number;
@@ -191,6 +193,8 @@ export declare abstract class Renderable extends BaseRenderable {
191
193
  set translateX(value: number);
192
194
  get translateY(): number;
193
195
  set translateY(value: number);
196
+ get screenX(): number;
197
+ get screenY(): number;
194
198
  get x(): number;
195
199
  set x(value: number);
196
200
  get top(): number | "auto" | `${number}%` | undefined;
@@ -266,6 +270,7 @@ export declare abstract class Renderable extends BaseRenderable {
266
270
  getChildrenCount(): number;
267
271
  updateLayout(deltaTime: number, renderList?: RenderCommand[]): void;
268
272
  render(buffer: OptimizedBuffer, deltaTime: number): void;
273
+ protected _hasVisibleChildFilter(): boolean;
269
274
  protected _getVisibleChildren(): number[];
270
275
  protected onUpdate(deltaTime: number): void;
271
276
  protected getScissorRect(): {
@@ -8468,7 +8468,19 @@ class ProcessQueue {
8468
8468
  }
8469
8469
 
8470
8470
  // src/lib/tree-sitter/default-parsers.ts
8471
+ import { resolve, dirname } from "path";
8471
8472
  import { fileURLToPath } from "url";
8473
+ import javascript_highlights from "./assets/javascript/highlights.scm" with { type: "file" };
8474
+ import javascript_language from "./assets/javascript/tree-sitter-javascript.wasm" with { type: "file" };
8475
+ import typescript_highlights from "./assets/typescript/highlights.scm" with { type: "file" };
8476
+ import typescript_language from "./assets/typescript/tree-sitter-typescript.wasm" with { type: "file" };
8477
+ import markdown_highlights from "./assets/markdown/highlights.scm" with { type: "file" };
8478
+ import markdown_language from "./assets/markdown/tree-sitter-markdown.wasm" with { type: "file" };
8479
+ import markdown_injections from "./assets/markdown/injections.scm" with { type: "file" };
8480
+ import markdown_inline_highlights from "./assets/markdown_inline/highlights.scm" with { type: "file" };
8481
+ import markdown_inline_language from "./assets/markdown_inline/tree-sitter-markdown_inline.wasm" with { type: "file" };
8482
+ import zig_highlights from "./assets/zig/highlights.scm" with { type: "file" };
8483
+ import zig_language from "./assets/zig/tree-sitter-zig.wasm" with { type: "file" };
8472
8484
  var _cachedParsers;
8473
8485
  function getParsers() {
8474
8486
  if (!_cachedParsers) {
@@ -8477,25 +8489,25 @@ function getParsers() {
8477
8489
  filetype: "javascript",
8478
8490
  aliases: ["javascriptreact"],
8479
8491
  queries: {
8480
- highlights: [fileURLToPath(new URL("./assets/javascript/highlights.scm", import.meta.url))]
8492
+ highlights: [resolve(dirname(fileURLToPath(import.meta.url)), javascript_highlights)]
8481
8493
  },
8482
- wasm: fileURLToPath(new URL("./assets/javascript/tree-sitter-javascript.wasm", import.meta.url))
8494
+ wasm: resolve(dirname(fileURLToPath(import.meta.url)), javascript_language)
8483
8495
  },
8484
8496
  {
8485
8497
  filetype: "typescript",
8486
8498
  aliases: ["typescriptreact"],
8487
8499
  queries: {
8488
- highlights: [fileURLToPath(new URL("./assets/typescript/highlights.scm", import.meta.url))]
8500
+ highlights: [resolve(dirname(fileURLToPath(import.meta.url)), typescript_highlights)]
8489
8501
  },
8490
- wasm: fileURLToPath(new URL("./assets/typescript/tree-sitter-typescript.wasm", import.meta.url))
8502
+ wasm: resolve(dirname(fileURLToPath(import.meta.url)), typescript_language)
8491
8503
  },
8492
8504
  {
8493
8505
  filetype: "markdown",
8494
8506
  queries: {
8495
- highlights: [fileURLToPath(new URL("./assets/markdown/highlights.scm", import.meta.url))],
8496
- injections: [fileURLToPath(new URL("./assets/markdown/injections.scm", import.meta.url))]
8507
+ highlights: [resolve(dirname(fileURLToPath(import.meta.url)), markdown_highlights)],
8508
+ injections: [resolve(dirname(fileURLToPath(import.meta.url)), markdown_injections)]
8497
8509
  },
8498
- wasm: fileURLToPath(new URL("./assets/markdown/tree-sitter-markdown.wasm", import.meta.url)),
8510
+ wasm: resolve(dirname(fileURLToPath(import.meta.url)), markdown_language),
8499
8511
  injectionMapping: {
8500
8512
  nodeTypes: {
8501
8513
  inline: "markdown_inline",
@@ -8518,16 +8530,16 @@ function getParsers() {
8518
8530
  {
8519
8531
  filetype: "markdown_inline",
8520
8532
  queries: {
8521
- highlights: [fileURLToPath(new URL("./assets/markdown_inline/highlights.scm", import.meta.url))]
8533
+ highlights: [resolve(dirname(fileURLToPath(import.meta.url)), markdown_inline_highlights)]
8522
8534
  },
8523
- wasm: fileURLToPath(new URL("./assets/markdown_inline/tree-sitter-markdown_inline.wasm", import.meta.url))
8535
+ wasm: resolve(dirname(fileURLToPath(import.meta.url)), markdown_inline_language)
8524
8536
  },
8525
8537
  {
8526
8538
  filetype: "zig",
8527
8539
  queries: {
8528
- highlights: [fileURLToPath(new URL("./assets/zig/highlights.scm", import.meta.url))]
8540
+ highlights: [resolve(dirname(fileURLToPath(import.meta.url)), zig_highlights)]
8529
8541
  },
8530
- wasm: fileURLToPath(new URL("./assets/zig/tree-sitter-zig.wasm", import.meta.url))
8542
+ wasm: resolve(dirname(fileURLToPath(import.meta.url)), zig_language)
8531
8543
  }
8532
8544
  ];
8533
8545
  }
@@ -8535,7 +8547,7 @@ function getParsers() {
8535
8547
  }
8536
8548
 
8537
8549
  // src/lib/tree-sitter/client.ts
8538
- import { resolve, isAbsolute, parse } from "path";
8550
+ import { resolve as resolve2, isAbsolute, parse } from "path";
8539
8551
  import { existsSync } from "fs";
8540
8552
 
8541
8553
  // src/lib/bunfs.ts
@@ -8608,7 +8620,7 @@ class TreeSitterClient extends EventEmitter2 {
8608
8620
  worker_path = this.options.workerPath;
8609
8621
  } else {
8610
8622
  worker_path = new URL("./parser.worker.js", import.meta.url).href;
8611
- if (!existsSync(resolve(import.meta.dirname, "parser.worker.js"))) {
8623
+ if (!existsSync(resolve2(import.meta.dirname, "parser.worker.js"))) {
8612
8624
  worker_path = new URL("./parser.worker.ts", import.meta.url).href;
8613
8625
  }
8614
8626
  }
@@ -8643,7 +8655,7 @@ class TreeSitterClient extends EventEmitter2 {
8643
8655
  if (this.initializePromise) {
8644
8656
  return this.initializePromise;
8645
8657
  }
8646
- this.initializePromise = new Promise((resolve2, reject) => {
8658
+ this.initializePromise = new Promise((resolve3, reject) => {
8647
8659
  const timeoutMs = this.options.initTimeout ?? 1e4;
8648
8660
  const timeoutId = setTimeout(() => {
8649
8661
  const error = new Error("Worker initialization timed out");
@@ -8651,7 +8663,7 @@ class TreeSitterClient extends EventEmitter2 {
8651
8663
  this.initializeResolvers = undefined;
8652
8664
  reject(error);
8653
8665
  }, timeoutMs);
8654
- this.initializeResolvers = { resolve: resolve2, reject, timeoutId };
8666
+ this.initializeResolvers = { resolve: resolve3, reject, timeoutId };
8655
8667
  this.worker?.postMessage({
8656
8668
  type: "INIT",
8657
8669
  dataPath: this.options.dataPath
@@ -8674,7 +8686,7 @@ class TreeSitterClient extends EventEmitter2 {
8674
8686
  return normalizeBunfsPath(parse(path).base);
8675
8687
  }
8676
8688
  if (!isAbsolute(path)) {
8677
- return resolve(path);
8689
+ return resolve2(path);
8678
8690
  }
8679
8691
  return path;
8680
8692
  }
@@ -8692,8 +8704,8 @@ class TreeSitterClient extends EventEmitter2 {
8692
8704
  }
8693
8705
  async getPerformance() {
8694
8706
  const messageId = `performance_${this.messageIdCounter++}`;
8695
- return new Promise((resolve2) => {
8696
- this.messageCallbacks.set(messageId, resolve2);
8707
+ return new Promise((resolve3) => {
8708
+ this.messageCallbacks.set(messageId, resolve3);
8697
8709
  this.worker?.postMessage({ type: "GET_PERFORMANCE", messageId });
8698
8710
  });
8699
8711
  }
@@ -8706,8 +8718,8 @@ class TreeSitterClient extends EventEmitter2 {
8706
8718
  }
8707
8719
  }
8708
8720
  const messageId = `oneshot_${this.messageIdCounter++}`;
8709
- return new Promise((resolve2) => {
8710
- this.messageCallbacks.set(messageId, resolve2);
8721
+ return new Promise((resolve3) => {
8722
+ this.messageCallbacks.set(messageId, resolve3);
8711
8723
  this.worker?.postMessage({
8712
8724
  type: "ONESHOT_HIGHLIGHT",
8713
8725
  content,
@@ -8816,8 +8828,8 @@ class TreeSitterClient extends EventEmitter2 {
8816
8828
  }
8817
8829
  async preloadParser(filetype) {
8818
8830
  const messageId = `has_parser_${this.messageIdCounter++}`;
8819
- const response = await new Promise((resolve2) => {
8820
- this.messageCallbacks.set(messageId, resolve2);
8831
+ const response = await new Promise((resolve3) => {
8832
+ this.messageCallbacks.set(messageId, resolve3);
8821
8833
  this.worker?.postMessage({
8822
8834
  type: "PRELOAD_PARSER",
8823
8835
  filetype,
@@ -8844,8 +8856,8 @@ class TreeSitterClient extends EventEmitter2 {
8844
8856
  }
8845
8857
  this.buffers.set(id, { id, content, filetype, version, hasParser: false });
8846
8858
  const messageId = `init_${this.messageIdCounter++}`;
8847
- const response = await new Promise((resolve2) => {
8848
- this.messageCallbacks.set(messageId, resolve2);
8859
+ const response = await new Promise((resolve3) => {
8860
+ this.messageCallbacks.set(messageId, resolve3);
8849
8861
  this.worker?.postMessage({
8850
8862
  type: "INITIALIZE_PARSER",
8851
8863
  bufferId: id,
@@ -8901,9 +8913,9 @@ class TreeSitterClient extends EventEmitter2 {
8901
8913
  this.editQueues.delete(bufferId);
8902
8914
  }
8903
8915
  if (this.worker) {
8904
- await new Promise((resolve2) => {
8916
+ await new Promise((resolve3) => {
8905
8917
  const messageId = `dispose_${bufferId}`;
8906
- this.messageCallbacks.set(messageId, resolve2);
8918
+ this.messageCallbacks.set(messageId, resolve3);
8907
8919
  try {
8908
8920
  this.worker.postMessage({
8909
8921
  type: "DISPOSE_BUFFER",
@@ -8911,13 +8923,13 @@ class TreeSitterClient extends EventEmitter2 {
8911
8923
  });
8912
8924
  } catch (error) {
8913
8925
  console.error("Error disposing buffer", error);
8914
- resolve2(false);
8926
+ resolve3(false);
8915
8927
  }
8916
8928
  setTimeout(() => {
8917
8929
  if (this.messageCallbacks.has(messageId)) {
8918
8930
  this.messageCallbacks.delete(messageId);
8919
8931
  console.warn({ bufferId }, "Timed out waiting for buffer to be disposed");
8920
- resolve2(false);
8932
+ resolve3(false);
8921
8933
  }
8922
8934
  }, 3000);
8923
8935
  });
@@ -8974,12 +8986,12 @@ class TreeSitterClient extends EventEmitter2 {
8974
8986
  this.options.dataPath = dataPath;
8975
8987
  if (this.initialized && this.worker) {
8976
8988
  const messageId = `update_datapath_${this.messageIdCounter++}`;
8977
- return new Promise((resolve2, reject) => {
8989
+ return new Promise((resolve3, reject) => {
8978
8990
  this.messageCallbacks.set(messageId, (response) => {
8979
8991
  if (response.error) {
8980
8992
  reject(new Error(response.error));
8981
8993
  } else {
8982
- resolve2();
8994
+ resolve3();
8983
8995
  }
8984
8996
  });
8985
8997
  this.worker.postMessage({
@@ -8995,12 +9007,12 @@ class TreeSitterClient extends EventEmitter2 {
8995
9007
  throw new Error("Cannot clear cache: client is not initialized");
8996
9008
  }
8997
9009
  const messageId = `clear_cache_${this.messageIdCounter++}`;
8998
- return new Promise((resolve2, reject) => {
9010
+ return new Promise((resolve3, reject) => {
8999
9011
  this.messageCallbacks.set(messageId, (response) => {
9000
9012
  if (response.error) {
9001
9013
  reject(new Error(response.error));
9002
9014
  } else {
9003
- resolve2();
9015
+ resolve3();
9004
9016
  }
9005
9017
  });
9006
9018
  this.worker.postMessage({
@@ -9526,13 +9538,26 @@ ${content}`);
9526
9538
  return "./" + path4.relative(path4.dirname(outputPath), queryPath);
9527
9539
  }
9528
9540
  async function generateDefaultParsersFile(parsers, outputPath) {
9541
+ const imports = parsers.map((parser) => {
9542
+ const safeFiletype = parser.filetype.replace(/[^a-zA-Z0-9]/g, "_");
9543
+ const lines = [
9544
+ `import ${safeFiletype}_highlights from "${parser.highlightsPath}" with { type: "file" }`,
9545
+ `import ${safeFiletype}_language from "${parser.languagePath}" with { type: "file" }`
9546
+ ];
9547
+ if (parser.injectionsPath) {
9548
+ lines.push(`import ${safeFiletype}_injections from "${parser.injectionsPath}" with { type: "file" }`);
9549
+ }
9550
+ return lines.join(`
9551
+ `);
9552
+ }).join(`
9553
+ `);
9529
9554
  const parserDefinitions = parsers.map((parser) => {
9530
9555
  const safeFiletype = parser.filetype.replace(/[^a-zA-Z0-9]/g, "_");
9531
9556
  const queriesLines = [
9532
- ` highlights: [fileURLToPath(new URL("${parser.highlightsPath}", import.meta.url))],`
9557
+ ` highlights: [resolve(dirname(fileURLToPath(import.meta.url)), ${safeFiletype}_highlights)],`
9533
9558
  ];
9534
9559
  if (parser.injectionsPath) {
9535
- queriesLines.push(` injections: [fileURLToPath(new URL("${parser.injectionsPath}", import.meta.url))],`);
9560
+ queriesLines.push(` injections: [resolve(dirname(fileURLToPath(import.meta.url)), ${safeFiletype}_injections)],`);
9536
9561
  }
9537
9562
  const injectionMappingLine = parser.injectionMapping ? ` injectionMapping: ${JSON.stringify(parser.injectionMapping, null, 10)},` : "";
9538
9563
  const aliasesLine = parser.aliases?.length ? ` aliases: ${JSON.stringify(parser.aliases)},` : "";
@@ -9543,7 +9568,7 @@ ${aliasesLine ? aliasesLine + `
9543
9568
  ${queriesLines.join(`
9544
9569
  `)}
9545
9570
  },
9546
- wasm: fileURLToPath(new URL("${parser.languagePath}", import.meta.url)),${injectionMappingLine ? `
9571
+ wasm: resolve(dirname(fileURLToPath(import.meta.url)), ${safeFiletype}_language),${injectionMappingLine ? `
9547
9572
  ` + injectionMappingLine : ""}
9548
9573
  }`;
9549
9574
  }).join(`,
@@ -9553,8 +9578,11 @@ ${queriesLines.join(`
9553
9578
  // Last generated: ${new Date().toISOString()}
9554
9579
 
9555
9580
  import type { FiletypeParserOptions } from "./types"
9581
+ import { resolve, dirname } from "path"
9556
9582
  import { fileURLToPath } from "url"
9557
9583
 
9584
+ ${imports}
9585
+
9558
9586
  // Cached parsers to avoid re-resolving paths on every call
9559
9587
  let _cachedParsers: FiletypeParserOptions[] | undefined
9560
9588
 
@@ -10446,7 +10474,7 @@ class TerminalPalette {
10446
10474
  const out = this.stdout;
10447
10475
  if (!out.isTTY || !this.stdin.isTTY)
10448
10476
  return false;
10449
- return new Promise((resolve3) => {
10477
+ return new Promise((resolve4) => {
10450
10478
  const session = this.createQuerySession();
10451
10479
  let buffer = "";
10452
10480
  let settled = false;
@@ -10455,7 +10483,7 @@ class TerminalPalette {
10455
10483
  return;
10456
10484
  settled = true;
10457
10485
  session.cleanup();
10458
- resolve3(supported);
10486
+ resolve4(supported);
10459
10487
  };
10460
10488
  const onData = (chunk) => {
10461
10489
  buffer += chunk.toString();
@@ -10478,7 +10506,7 @@ class TerminalPalette {
10478
10506
  if (!out.isTTY || !this.stdin.isTTY) {
10479
10507
  return results;
10480
10508
  }
10481
- return new Promise((resolve3) => {
10509
+ return new Promise((resolve4) => {
10482
10510
  const session = this.createQuerySession();
10483
10511
  let buffer = "";
10484
10512
  let idleTimer = null;
@@ -10488,7 +10516,7 @@ class TerminalPalette {
10488
10516
  return;
10489
10517
  settled = true;
10490
10518
  session.cleanup();
10491
- resolve3(results);
10519
+ resolve4(results);
10492
10520
  };
10493
10521
  const onData = (chunk) => {
10494
10522
  buffer += chunk.toString();
@@ -10529,7 +10557,7 @@ class TerminalPalette {
10529
10557
  if (!out.isTTY || !this.stdin.isTTY) {
10530
10558
  return results;
10531
10559
  }
10532
- return new Promise((resolve3) => {
10560
+ return new Promise((resolve4) => {
10533
10561
  const session = this.createQuerySession();
10534
10562
  let buffer = "";
10535
10563
  let idleTimer = null;
@@ -10539,7 +10567,7 @@ class TerminalPalette {
10539
10567
  return;
10540
10568
  settled = true;
10541
10569
  session.cleanup();
10542
- resolve3(results);
10570
+ resolve4(results);
10543
10571
  };
10544
10572
  const onData = (chunk) => {
10545
10573
  buffer += chunk.toString();
@@ -14621,6 +14649,8 @@ class Renderable extends BaseRenderable {
14621
14649
  _translateY = 0;
14622
14650
  _x = 0;
14623
14651
  _y = 0;
14652
+ _screenX = 0;
14653
+ _screenY = 0;
14624
14654
  _width;
14625
14655
  _height;
14626
14656
  _widthValue = 0;
@@ -14860,6 +14890,8 @@ class Renderable extends BaseRenderable {
14860
14890
  if (this._translateX === value)
14861
14891
  return;
14862
14892
  this._translateX = value;
14893
+ const parentScreenX = this.parent ? this.parent._screenX : 0;
14894
+ this._screenX = parentScreenX + this._x + this._translateX;
14863
14895
  if (this.parent)
14864
14896
  this.parent.childrenPrimarySortDirty = true;
14865
14897
  this.requestRender();
@@ -14871,10 +14903,20 @@ class Renderable extends BaseRenderable {
14871
14903
  if (this._translateY === value)
14872
14904
  return;
14873
14905
  this._translateY = value;
14906
+ const parentScreenY = this.parent ? this.parent._screenY : 0;
14907
+ this._screenY = parentScreenY + this._y + this._translateY;
14874
14908
  if (this.parent)
14875
14909
  this.parent.childrenPrimarySortDirty = true;
14876
14910
  this.requestRender();
14877
14911
  }
14912
+ get screenX() {
14913
+ const parentScreenX = this.parent ? this.parent._screenX : 0;
14914
+ return parentScreenX + this._x + this._translateX;
14915
+ }
14916
+ get screenY() {
14917
+ const parentScreenY = this.parent ? this.parent._screenY : 0;
14918
+ return parentScreenY + this._y + this._translateY;
14919
+ }
14878
14920
  get x() {
14879
14921
  if (this.parent) {
14880
14922
  return this.parent.x + this._x + this._translateX;
@@ -14982,8 +15024,8 @@ class Renderable extends BaseRenderable {
14982
15024
  const axis = dir === 2 || dir === 3 ? "x" : "y";
14983
15025
  const sorted = [...this._childrenInLayoutOrder];
14984
15026
  sorted.sort((a, b) => {
14985
- const va = axis === "y" ? a.y : a.x;
14986
- const vb = axis === "y" ? b.y : b.x;
15027
+ const va = axis === "y" ? a.screenY : a.screenX;
15028
+ const vb = axis === "y" ? b.screenY : b.screenX;
14987
15029
  return va - vb;
14988
15030
  });
14989
15031
  this.childrenSortedByPrimaryAxis = sorted;
@@ -15312,6 +15354,10 @@ class Renderable extends BaseRenderable {
15312
15354
  const oldHeight = this._heightValue;
15313
15355
  this._x = layout.left;
15314
15356
  this._y = layout.top;
15357
+ const parentScreenX = this.parent ? this.parent._screenX : 0;
15358
+ const parentScreenY = this.parent ? this.parent._screenY : 0;
15359
+ this._screenX = parentScreenX + this._x + this._translateX;
15360
+ this._screenY = parentScreenY + this._y + this._translateY;
15315
15361
  const newWidth = Math.max(layout.width, 1);
15316
15362
  const newHeight = Math.max(layout.height, 1);
15317
15363
  const sizeChanged = oldWidth !== newWidth || oldHeight !== newHeight;
@@ -15556,17 +15602,24 @@ class Renderable extends BaseRenderable {
15556
15602
  y: scissorRect.y,
15557
15603
  width: scissorRect.width,
15558
15604
  height: scissorRect.height,
15559
- screenX: this.x,
15560
- screenY: this.y
15605
+ screenX: this._screenX,
15606
+ screenY: this._screenY
15561
15607
  });
15562
15608
  }
15563
- const visibleChildren = this._getVisibleChildren();
15564
- for (const child of this._childrenInZIndexOrder) {
15565
- if (!visibleChildren.includes(child.num)) {
15566
- child.updateFromLayout();
15567
- continue;
15609
+ if (!this._hasVisibleChildFilter()) {
15610
+ for (const child of this._childrenInZIndexOrder) {
15611
+ child.updateLayout(deltaTime, renderList);
15612
+ }
15613
+ } else {
15614
+ const visibleChildren = this._getVisibleChildren();
15615
+ const visibleChildSet = new Set(visibleChildren);
15616
+ for (const child of this._childrenInZIndexOrder) {
15617
+ if (!visibleChildSet.has(child.num)) {
15618
+ child.updateFromLayout();
15619
+ continue;
15620
+ }
15621
+ child.updateLayout(deltaTime, renderList);
15568
15622
  }
15569
- child.updateLayout(deltaTime, renderList);
15570
15623
  }
15571
15624
  if (shouldPushScissor) {
15572
15625
  renderList.push({ action: "popScissorRect" });
@@ -15587,20 +15640,25 @@ class Renderable extends BaseRenderable {
15587
15640
  if (this.renderAfter) {
15588
15641
  this.renderAfter.call(this, renderBuffer, deltaTime);
15589
15642
  }
15643
+ const screenX = this._screenX;
15644
+ const screenY = this._screenY;
15590
15645
  this.markClean();
15591
- this._ctx.addToHitGrid(this.x, this.y, this.width, this.height, this.num);
15646
+ this._ctx.addToHitGrid(screenX, screenY, this.width, this.height, this.num);
15592
15647
  if (this.buffered && this.frameBuffer) {
15593
- buffer.drawFrameBuffer(this.x, this.y, this.frameBuffer);
15648
+ buffer.drawFrameBuffer(screenX, screenY, this.frameBuffer);
15594
15649
  }
15595
15650
  }
15651
+ _hasVisibleChildFilter() {
15652
+ return this._getVisibleChildren !== Renderable.prototype._getVisibleChildren;
15653
+ }
15596
15654
  _getVisibleChildren() {
15597
15655
  return this._childrenInZIndexOrder.map((child) => child.num);
15598
15656
  }
15599
15657
  onUpdate(deltaTime) {}
15600
15658
  getScissorRect() {
15601
15659
  return {
15602
- x: this.buffered ? 0 : this.x,
15603
- y: this.buffered ? 0 : this.y,
15660
+ x: this.buffered ? 0 : this._screenX,
15661
+ y: this.buffered ? 0 : this._screenY,
15604
15662
  width: this.width,
15605
15663
  height: this.height
15606
15664
  };
@@ -18389,8 +18447,10 @@ class EditBufferRenderable extends Renderable {
18389
18447
  return;
18390
18448
  if (this.isDestroyed)
18391
18449
  return;
18450
+ const screenX = this._screenX;
18451
+ const screenY = this._screenY;
18392
18452
  this.markClean();
18393
- this._ctx.addToHitGrid(this.x, this.y, this.width, this.height, this.num);
18453
+ this._ctx.addToHitGrid(screenX, screenY, this.width, this.height, this.num);
18394
18454
  this.renderSelf(buffer);
18395
18455
  this.renderCursor(buffer);
18396
18456
  }
@@ -18401,8 +18461,10 @@ class EditBufferRenderable extends Renderable {
18401
18461
  if (!this._showCursor || !this._focused)
18402
18462
  return;
18403
18463
  const visualCursor = this.editorView.getVisualCursor();
18404
- const cursorX = this.x + visualCursor.visualCol + 1;
18405
- const cursorY = this.y + visualCursor.visualRow + 1;
18464
+ const screenX = this._screenX;
18465
+ const screenY = this._screenY;
18466
+ const cursorX = screenX + visualCursor.visualCol + 1;
18467
+ const cursorY = screenY + visualCursor.visualRow + 1;
18406
18468
  this._ctx.setCursorPosition(cursorX, cursorY, true);
18407
18469
  this._ctx.setCursorStyle({ ...this._cursorStyle, color: this._cursorColor });
18408
18470
  }
@@ -18602,8 +18664,8 @@ function getObjectsInViewport(viewport, objects, direction = "column", padding =
18602
18664
  while (lo <= hi) {
18603
18665
  const mid = lo + hi >> 1;
18604
18666
  const c = children[mid];
18605
- const start = isRow ? c.x : c.y;
18606
- const end = isRow ? c.x + c.width : c.y + c.height;
18667
+ const start = isRow ? c.screenX : c.screenY;
18668
+ const end = isRow ? c.screenX + c.width : c.screenY + c.height;
18607
18669
  if (end < vpStart) {
18608
18670
  lo = mid + 1;
18609
18671
  } else if (start > vpEnd) {
@@ -18622,7 +18684,7 @@ function getObjectsInViewport(viewport, objects, direction = "column", padding =
18622
18684
  let gapCount = 0;
18623
18685
  while (left - 1 >= 0) {
18624
18686
  const prev = children[left - 1];
18625
- const prevEnd = isRow ? prev.x + prev.width : prev.y + prev.height;
18687
+ const prevEnd = isRow ? prev.screenX + prev.width : prev.screenY + prev.height;
18626
18688
  if (prevEnd <= vpStart) {
18627
18689
  gapCount++;
18628
18690
  if (gapCount >= maxLookBehind) {
@@ -18636,30 +18698,30 @@ function getObjectsInViewport(viewport, objects, direction = "column", padding =
18636
18698
  let right = candidate + 1;
18637
18699
  while (right < totalChildren) {
18638
18700
  const next = children[right];
18639
- if ((isRow ? next.x : next.y) >= vpEnd)
18701
+ if ((isRow ? next.screenX : next.screenY) >= vpEnd)
18640
18702
  break;
18641
18703
  right++;
18642
18704
  }
18643
18705
  for (let i = left;i < right; i++) {
18644
18706
  const child = children[i];
18645
- const start = isRow ? child.x : child.y;
18646
- const end = isRow ? child.x + child.width : child.y + child.height;
18707
+ const start = isRow ? child.screenX : child.screenY;
18708
+ const end = isRow ? child.screenX + child.width : child.screenY + child.height;
18647
18709
  if (end <= vpStart)
18648
18710
  continue;
18649
18711
  if (start >= vpEnd)
18650
18712
  break;
18651
18713
  if (isRow) {
18652
- const childBottom = child.y + child.height;
18714
+ const childBottom = child.screenY + child.height;
18653
18715
  if (childBottom < viewportTop)
18654
18716
  continue;
18655
- const childTop = child.y;
18717
+ const childTop = child.screenY;
18656
18718
  if (childTop > viewportBottom)
18657
18719
  continue;
18658
18720
  } else {
18659
- const childRight = child.x + child.width;
18721
+ const childRight = child.screenX + child.width;
18660
18722
  if (childRight < viewportLeft)
18661
18723
  continue;
18662
- const childLeft = child.x;
18724
+ const childLeft = child.screenX;
18663
18725
  if (childLeft > viewportRight)
18664
18726
  continue;
18665
18727
  }
@@ -18890,7 +18952,7 @@ var rendererTracker = singleton("RendererTracker", () => {
18890
18952
  });
18891
18953
  async function createCliRenderer(config = {}) {
18892
18954
  if (process.argv.includes("--delay-start")) {
18893
- await new Promise((resolve3) => setTimeout(resolve3, 5000));
18955
+ await new Promise((resolve4) => setTimeout(resolve4, 5000));
18894
18956
  }
18895
18957
  const stdin = config.stdin || process.stdin;
18896
18958
  const stdout = config.stdout || process.stdout;
@@ -19388,8 +19450,8 @@ Captured output:
19388
19450
  if (!this.isIdleNow())
19389
19451
  return;
19390
19452
  const resolvers = this.idleResolvers.splice(0);
19391
- for (const resolve3 of resolvers) {
19392
- resolve3();
19453
+ for (const resolve4 of resolvers) {
19454
+ resolve4();
19393
19455
  }
19394
19456
  }
19395
19457
  idle() {
@@ -19397,8 +19459,8 @@ Captured output:
19397
19459
  return Promise.resolve();
19398
19460
  if (this.isIdleNow())
19399
19461
  return Promise.resolve();
19400
- return new Promise((resolve3) => {
19401
- this.idleResolvers.push(resolve3);
19462
+ return new Promise((resolve4) => {
19463
+ this.idleResolvers.push(resolve4);
19402
19464
  });
19403
19465
  }
19404
19466
  get resolution() {
@@ -20670,5 +20732,5 @@ Captured output:
20670
20732
 
20671
20733
  export { __toESM, __commonJS, __export, __require, Edge, Gutter, MeasureMode, exports_src, isValidBorderStyle, parseBorderStyle, BorderChars, getBorderFromSides, getBorderSides, borderCharsToArray, BorderCharArrays, KeyEvent, PasteEvent, KeyHandler, InternalKeyHandler, RGBA, hexToRgb, rgbToHex, hsvToRgb, parseColor, fonts, measureText, getCharacterPositions, coordinateToCharacterIndex, renderFontToFrameBuffer, TextAttributes, ATTRIBUTE_BASE_BITS, ATTRIBUTE_BASE_MASK, getBaseAttributes, DebugOverlayCorner, TargetChannel, createTextAttributes, attributesWithLink, getLinkId, 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, link, t, hastToStyledText, SystemClock, nonAlphanumericKeys, parseKeypress, LinearScrollAccel, MacOSScrollAccel, parseAlign, parseAlignItems, parseBoxSizing, parseDimension, parseDirection, parseDisplay, parseEdge, parseFlexDirection, parseGutter, parseJustify, parseLogLevel, parseMeasureMode, parseOverflow, parsePositionType, parseUnit, parseWrap, MouseParser, Selection, convertGlobalToLocalSelection, ASCIIFontSelectionHelper, envRegistry, registerEnvVar, clearEnvCache, generateEnvMarkdown, generateEnvColored, env, StdinParser, treeSitterToTextChunks, treeSitterToStyledText, addDefaultParsers, TreeSitterClient, DataPathsManager, getDataPaths, extensionToFiletype, basenameToFiletype, extToFiletype, pathToFiletype, infoStringToFiletype, main, getTreeSitterClient, ExtmarksController, createExtmarksController, TerminalPalette, createTerminalPalette, decodePasteBytes, stripAnsiSequences, detectLinks, TextBuffer, SpanInfoStruct, LogLevel2 as LogLevel, setRenderLibPath, resolveRenderLib, OptimizedBuffer, h, isVNode, maybeMakeRenderable, wrapWithDelegates, instantiate, delegate, isValidPercentage, LayoutEvents, RenderableEvents, isRenderable, BaseRenderable, Renderable, RootRenderable, EditBuffer, EditorView, ANSI, defaultKeyAliases, mergeKeyAliases, mergeKeyBindings, getKeyBindingAction, buildKeyBindingsMap, capture, ConsolePosition, TerminalConsole, getObjectsInViewport, EditBufferRenderableEvents, isEditBufferRenderable, EditBufferRenderable, buildKittyKeyboardFlags, MouseEvent, MouseButton, createCliRenderer, CliRenderEvents, RendererControlState, CliRenderer };
20672
20734
 
20673
- //# debugId=4A1F7F558505C98564756E2164756E21
20674
- //# sourceMappingURL=index-7xsz0ndw.js.map
20735
+ //# debugId=F735FC939C22368E64756E2164756E21
20736
+ //# sourceMappingURL=index-c4vtensm.js.map