@opentui/core 0.6.1 → 0.6.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.
package/edit-buffer.d.ts CHANGED
@@ -74,7 +74,8 @@ export declare class EditBuffer extends EventEmitter {
74
74
  getLineStartOffset(row: number): number;
75
75
  /**
76
76
  * Returns the global display offset at the end of `text` as this buffer would lay it out, without storing it: its
77
- * cells under this buffer's width method, tab width, and control notation, plus one per line break.
77
+ * cells under this buffer's width method, tab width, and control notation, plus one per line break. Use
78
+ * `measureEditText()` to measure without a buffer.
78
79
  */
79
80
  measureText(text: string): number;
80
81
  getTextRange(startOffset: number, endOffset: number): string;
@@ -100,3 +101,12 @@ export declare class EditBuffer extends EventEmitter {
100
101
  clear(): void;
101
102
  destroy(): void;
102
103
  }
104
+ /**
105
+ * Returns the editor offset at the end of `text` as an edit buffer with these settings lays it out, without an edit
106
+ * buffer: its cells under `widthMethod`, `tabWidth`, and control notation, plus one per line break. `tabWidth` defaults
107
+ * to the tab width of a new edit buffer and rounds as in `EditBuffer.setTabWidth()`.
108
+ */
109
+ export declare function measureEditText(text: string, options: {
110
+ widthMethod: WidthMethod;
111
+ tabWidth?: number;
112
+ }): number;
package/index.bun.js CHANGED
@@ -110,7 +110,7 @@ import {
110
110
  resolveRenderLib2,
111
111
  MeasureMode2,
112
112
  exports_yoga
113
- } from "./chunk-bun-wsqkxxm5.js";
113
+ } from "./chunk-bun-b3p27aka.js";
114
114
  import {
115
115
  isValidBorderStyle2,
116
116
  parseBorderStyle2,
@@ -203,6 +203,7 @@ import {
203
203
  TextBuffer2,
204
204
  TextBufferView2,
205
205
  EditBuffer2,
206
+ measureEditText2,
206
207
  EditorView2,
207
208
  Timeline2,
208
209
  engine2,
@@ -241,7 +242,7 @@ import {
241
242
  CliRenderEvents2,
242
243
  RendererControlState2,
243
244
  CliRenderer2
244
- } from "./chunk-bun-ww65h9av.js";
245
+ } from "./chunk-bun-ehstr7d7.js";
245
246
  // src/post/effects.ts
246
247
  function toU8(value) {
247
248
  return Math.round(Math.max(0, Math.min(1, Number.isFinite(value) ? value : 0)) * 255);
@@ -8167,9 +8168,42 @@ function physicalKey(key) {
8167
8168
  return `Digit${name}`;
8168
8169
  if (/^f([1-9]|1[0-9]|2[0-5])$/i.test(key.name))
8169
8170
  return key.name.toUpperCase();
8171
+ if (/^kp[0-9]$/i.test(key.name))
8172
+ return `Numpad${key.name.slice(2)}`;
8170
8173
  return {
8171
8174
  backspace: "Backspace",
8172
8175
  clear: "NumpadBegin",
8176
+ kpdecimal: "NumpadDecimal",
8177
+ kpdivide: "NumpadDivide",
8178
+ kpmultiply: "NumpadMultiply",
8179
+ kpminus: "NumpadSubtract",
8180
+ kpplus: "NumpadAdd",
8181
+ kpenter: "NumpadEnter",
8182
+ kpequal: "NumpadEqual",
8183
+ kpseparator: "NumpadSeparator",
8184
+ kpleft: "NumpadLeft",
8185
+ kpright: "NumpadRight",
8186
+ kpup: "NumpadUp",
8187
+ kpdown: "NumpadDown",
8188
+ kppageup: "NumpadPageUp",
8189
+ kppagedown: "NumpadPageDown",
8190
+ kphome: "NumpadHome",
8191
+ kpend: "NumpadEnd",
8192
+ kpinsert: "NumpadInsert",
8193
+ kpdelete: "NumpadDelete",
8194
+ capslock: "CapsLock",
8195
+ scrolllock: "ScrollLock",
8196
+ numlock: "NumLock",
8197
+ printscreen: "PrintScreen",
8198
+ pause: "Pause",
8199
+ leftshift: "ShiftLeft",
8200
+ leftctrl: "ControlLeft",
8201
+ leftalt: "AltLeft",
8202
+ leftsuper: "MetaLeft",
8203
+ rightshift: "ShiftRight",
8204
+ rightctrl: "ControlRight",
8205
+ rightalt: "AltRight",
8206
+ rightsuper: "MetaRight",
8173
8207
  enter: "Enter",
8174
8208
  return: "Enter",
8175
8209
  space: "Space",
@@ -15348,6 +15382,7 @@ export {
15348
15382
  link2 as link,
15349
15383
  magenta2 as magenta,
15350
15384
  maybeMakeRenderable2 as maybeMakeRenderable,
15385
+ measureEditText2 as measureEditText,
15351
15386
  measureText2 as measureText,
15352
15387
  nonAlphanumericKeys2 as nonAlphanumericKeys,
15353
15388
  normalizeColorValue2 as normalizeColorValue,
@@ -15400,5 +15435,5 @@ export {
15400
15435
  yellow2 as yellow
15401
15436
  };
15402
15437
 
15403
- //# debugId=94D06A29A58A1FB064756E2164756E21
15438
+ //# debugId=1B5615355BC40CFF64756E2164756E21
15404
15439
  //# sourceMappingURL=index.bun.js.map