@opentui/core 0.0.0-20251027-327d7e76 → 0.0.0-20251028-8f761bab

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
@@ -5,7 +5,7 @@ import {
5
5
  __export,
6
6
  __require,
7
7
  __toESM
8
- } from "./index-bsb3x2r3.js";
8
+ } from "./index-nmrjz1q1.js";
9
9
 
10
10
  // ../../node_modules/.bun/omggif@1.0.10/node_modules/omggif/omggif.js
11
11
  var require_omggif = __commonJS((exports) => {
package/edit-buffer.d.ts CHANGED
@@ -68,8 +68,6 @@ export declare class EditBuffer extends EventEmitter {
68
68
  setDefaultBg(bg: RGBA | null): void;
69
69
  setDefaultAttributes(attributes: number | null): void;
70
70
  resetDefaults(): void;
71
- setPlaceholder(text: string | null): void;
72
- setPlaceholderColor(color: RGBA): void;
73
71
  setSyntaxStyle(style: SyntaxStyle | null): void;
74
72
  getSyntaxStyle(): SyntaxStyle | null;
75
73
  addHighlight(lineIdx: number, highlight: Highlight): void;
package/editor-view.d.ts CHANGED
@@ -51,5 +51,11 @@ export declare class EditorView {
51
51
  getLineInfo(): LineInfo;
52
52
  getLogicalLineInfo(): LineInfo;
53
53
  get extmarks(): any;
54
+ setPlaceholderStyledText(chunks: {
55
+ text: string;
56
+ fg?: RGBA;
57
+ bg?: RGBA;
58
+ attributes?: number;
59
+ }[]): void;
54
60
  destroy(): void;
55
61
  }
@@ -1769,10 +1769,10 @@ import { Buffer as Buffer2 } from "buffer";
1769
1769
  var kittyKeyMap = {
1770
1770
  27: "escape",
1771
1771
  9: "tab",
1772
- 13: "enter",
1772
+ 13: "return",
1773
1773
  127: "backspace",
1774
1774
  57344: "escape",
1775
- 57345: "enter",
1775
+ 57345: "return",
1776
1776
  57346: "tab",
1777
1777
  57347: "backspace",
1778
1778
  57348: "insert",
@@ -2122,7 +2122,7 @@ var parseKeypress = (s = "", options = {}) => {
2122
2122
  } else if (s === `
2123
2123
  ` || s === `\x1B
2124
2124
  `) {
2125
- key.name = "enter";
2125
+ key.name = "linefeed";
2126
2126
  key.meta = s.length === 2;
2127
2127
  } else if (s === "\t") {
2128
2128
  key.name = "tab";
@@ -8169,6 +8169,14 @@ function getOpenTUILib(libPath) {
8169
8169
  args: ["ptr"],
8170
8170
  returns: "ptr"
8171
8171
  },
8172
+ editorViewGetLineInfoDirect: {
8173
+ args: ["ptr", "ptr", "ptr"],
8174
+ returns: "u32"
8175
+ },
8176
+ editorViewGetLogicalLineInfoDirect: {
8177
+ args: ["ptr", "ptr", "ptr"],
8178
+ returns: "u32"
8179
+ },
8172
8180
  createEditBuffer: {
8173
8181
  args: ["u8"],
8174
8182
  returns: "ptr"
@@ -8285,14 +8293,6 @@ function getOpenTUILib(libPath) {
8285
8293
  args: ["ptr"],
8286
8294
  returns: "void"
8287
8295
  },
8288
- editBufferSetPlaceholder: {
8289
- args: ["ptr", "ptr", "usize"],
8290
- returns: "void"
8291
- },
8292
- editBufferSetPlaceholderColor: {
8293
- args: ["ptr", "ptr"],
8294
- returns: "void"
8295
- },
8296
8296
  editBufferClear: {
8297
8297
  args: ["ptr"],
8298
8298
  returns: "void"
@@ -8385,6 +8385,10 @@ function getOpenTUILib(libPath) {
8385
8385
  args: ["ptr", "ptr"],
8386
8386
  returns: "void"
8387
8387
  },
8388
+ editorViewSetPlaceholderStyledText: {
8389
+ args: ["ptr", "ptr", "usize"],
8390
+ returns: "void"
8391
+ },
8388
8392
  getArenaAllocatedBytes: {
8389
8393
  args: [],
8390
8394
  returns: "usize"
@@ -9134,6 +9138,34 @@ class FFIRenderLib {
9134
9138
  }
9135
9139
  return result;
9136
9140
  }
9141
+ editorViewGetLineInfo(view) {
9142
+ const lineCount = this.editorViewGetVirtualLineCount(view);
9143
+ if (lineCount === 0) {
9144
+ return { lineStarts: [], lineWidths: [], maxLineWidth: 0 };
9145
+ }
9146
+ const lineStarts = new Uint32Array(lineCount);
9147
+ const lineWidths = new Uint32Array(lineCount);
9148
+ const maxLineWidth = this.opentui.symbols.editorViewGetLineInfoDirect(view, ptr3(lineStarts), ptr3(lineWidths));
9149
+ return {
9150
+ maxLineWidth,
9151
+ lineStarts: Array.from(lineStarts),
9152
+ lineWidths: Array.from(lineWidths)
9153
+ };
9154
+ }
9155
+ editorViewGetLogicalLineInfo(view) {
9156
+ const lineCount = this.editorViewGetVirtualLineCount(view);
9157
+ if (lineCount === 0) {
9158
+ return { lineStarts: [], lineWidths: [], maxLineWidth: 0 };
9159
+ }
9160
+ const lineStarts = new Uint32Array(lineCount);
9161
+ const lineWidths = new Uint32Array(lineCount);
9162
+ const maxLineWidth = this.opentui.symbols.editorViewGetLogicalLineInfoDirect(view, ptr3(lineStarts), ptr3(lineWidths));
9163
+ return {
9164
+ maxLineWidth,
9165
+ lineStarts: Array.from(lineStarts),
9166
+ lineWidths: Array.from(lineWidths)
9167
+ };
9168
+ }
9137
9169
  createEditBuffer(widthMethod) {
9138
9170
  const widthMethodCode = widthMethod === "wcwidth" ? 0 : 1;
9139
9171
  const bufferPtr = this.opentui.symbols.createEditBuffer(widthMethodCode);
@@ -9249,17 +9281,6 @@ class FFIRenderLib {
9249
9281
  editBufferClearHistory(buffer) {
9250
9282
  this.opentui.symbols.editBufferClearHistory(buffer);
9251
9283
  }
9252
- editBufferSetPlaceholder(buffer, text) {
9253
- if (text === null) {
9254
- this.opentui.symbols.editBufferSetPlaceholder(buffer, null, 0);
9255
- } else {
9256
- const textBytes = this.encoder.encode(text);
9257
- this.opentui.symbols.editBufferSetPlaceholder(buffer, textBytes, textBytes.length);
9258
- }
9259
- }
9260
- editBufferSetPlaceholderColor(buffer, color) {
9261
- this.opentui.symbols.editBufferSetPlaceholderColor(buffer, color.buffer);
9262
- }
9263
9284
  editBufferClear(buffer) {
9264
9285
  this.opentui.symbols.editBufferClear(buffer);
9265
9286
  }
@@ -9429,6 +9450,15 @@ class FFIRenderLib {
9429
9450
  const result = this.opentui.symbols.syntaxStyleGetStyleCount(style);
9430
9451
  return typeof result === "bigint" ? Number(result) : result;
9431
9452
  }
9453
+ editorViewSetPlaceholderStyledText(view, chunks) {
9454
+ const nonEmptyChunks = chunks.filter((c) => c.text.length > 0);
9455
+ if (nonEmptyChunks.length === 0) {
9456
+ this.opentui.symbols.editorViewSetPlaceholderStyledText(view, null, 0);
9457
+ return;
9458
+ }
9459
+ const chunksBuffer = StyledChunkStruct.packList(nonEmptyChunks);
9460
+ this.opentui.symbols.editorViewSetPlaceholderStyledText(view, ptr3(chunksBuffer), nonEmptyChunks.length);
9461
+ }
9432
9462
  onNativeEvent(name, handler) {
9433
9463
  this._nativeEvents.on(name, handler);
9434
9464
  }
@@ -13017,5 +13047,5 @@ Captured output:
13017
13047
 
13018
13048
  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, 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, ExtmarksController, createExtmarksController, 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 };
13019
13049
 
13020
- //# debugId=C1D0F4A11DB898E164756E2164756E21
13021
- //# sourceMappingURL=index-bsb3x2r3.js.map
13050
+ //# debugId=03F59729A316516364756E2164756E21
13051
+ //# sourceMappingURL=index-nmrjz1q1.js.map