@opentui/core 0.6.0 → 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/{chunk-bun-tsc14mt5.js → chunk-bun-b3p27aka.js} +28 -5
- package/chunk-bun-b3p27aka.js.map +35 -0
- package/{chunk-bun-s01c2jyn.js → chunk-bun-ehstr7d7.js} +24 -67
- package/{chunk-node-hjr2tm60.js.map → chunk-bun-ehstr7d7.js.map} +6 -6
- package/{chunk-node-hjr2tm60.js → chunk-node-fs50qdd7.js} +24 -67
- package/{chunk-bun-s01c2jyn.js.map → chunk-node-fs50qdd7.js.map} +6 -6
- package/{chunk-node-df90qrqc.js → chunk-node-jt82vcf9.js} +28 -5
- package/chunk-node-jt82vcf9.js.map +34 -0
- package/edit-buffer.d.ts +15 -0
- package/index.bun.js +41 -7
- package/index.bun.js.map +5 -5
- package/index.node.js +41 -7
- package/index.node.js.map +5 -5
- package/native-abi.generated.d.ts +8 -0
- package/package.json +10 -11
- package/platform/runtime.d.ts +0 -1
- package/testing.bun.js +2 -2
- package/testing.js +2 -2
- package/yoga.bun.js +1 -1
- package/yoga.js +1 -1
- package/zig.d.ts +3 -0
- package/chunk-bun-tsc14mt5.js.map +0 -35
- package/chunk-node-df90qrqc.js.map +0 -34
package/edit-buffer.d.ts
CHANGED
|
@@ -72,6 +72,12 @@ export declare class EditBuffer extends EventEmitter {
|
|
|
72
72
|
} | null;
|
|
73
73
|
positionToOffset(row: number, col: number): number;
|
|
74
74
|
getLineStartOffset(row: number): number;
|
|
75
|
+
/**
|
|
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. Use
|
|
78
|
+
* `measureEditText()` to measure without a buffer.
|
|
79
|
+
*/
|
|
80
|
+
measureText(text: string): number;
|
|
75
81
|
getTextRange(startOffset: number, endOffset: number): string;
|
|
76
82
|
getTextRangeByCoords(startRow: number, startCol: number, endRow: number, endCol: number): string;
|
|
77
83
|
debugLogRope(): void;
|
|
@@ -95,3 +101,12 @@ export declare class EditBuffer extends EventEmitter {
|
|
|
95
101
|
clear(): void;
|
|
96
102
|
destroy(): void;
|
|
97
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-
|
|
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-
|
|
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",
|
|
@@ -8224,7 +8258,6 @@ function mouseButton(event) {
|
|
|
8224
8258
|
}
|
|
8225
8259
|
// src/renderables/Textarea.ts
|
|
8226
8260
|
var unsupportedKeyCharacters = /[\x00-\x1f\x7f-\x9f]/;
|
|
8227
|
-
var unsupportedPasteCharacters = /[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/g;
|
|
8228
8261
|
function clonePlaceholder(value) {
|
|
8229
8262
|
if (value === null || typeof value === "string")
|
|
8230
8263
|
return value;
|
|
@@ -8410,7 +8443,7 @@ class TextareaRenderable extends EditBufferRenderable2 {
|
|
|
8410
8443
|
]);
|
|
8411
8444
|
}
|
|
8412
8445
|
handlePaste(event) {
|
|
8413
|
-
this.insertText(stripAnsiSequences2(decodePasteBytes2(event.bytes))
|
|
8446
|
+
this.insertText(stripAnsiSequences2(decodePasteBytes2(event.bytes)));
|
|
8414
8447
|
}
|
|
8415
8448
|
handleKeyPress(key) {
|
|
8416
8449
|
if (this.traits.suspend !== true) {
|
|
@@ -8576,7 +8609,7 @@ class InputRenderable extends TextareaRenderable {
|
|
|
8576
8609
|
this._minLength = minLength;
|
|
8577
8610
|
this._lastCommittedValue = this.plainText;
|
|
8578
8611
|
if (initialValue) {
|
|
8579
|
-
this.cursorOffset =
|
|
8612
|
+
this.cursorOffset = this.editBuffer.getEOL().offset;
|
|
8580
8613
|
}
|
|
8581
8614
|
} catch (error) {
|
|
8582
8615
|
this.rollbackConstruction(error);
|
|
@@ -8608,7 +8641,7 @@ class InputRenderable extends TextareaRenderable {
|
|
|
8608
8641
|
if (currentValue !== newValue) {
|
|
8609
8642
|
this.runMutation(() => {
|
|
8610
8643
|
this.setText(newValue);
|
|
8611
|
-
this.cursorOffset =
|
|
8644
|
+
this.cursorOffset = this.editBuffer.getEOL().offset;
|
|
8612
8645
|
this.emit("input" /* INPUT */, newValue);
|
|
8613
8646
|
});
|
|
8614
8647
|
}
|
|
@@ -15349,6 +15382,7 @@ export {
|
|
|
15349
15382
|
link2 as link,
|
|
15350
15383
|
magenta2 as magenta,
|
|
15351
15384
|
maybeMakeRenderable2 as maybeMakeRenderable,
|
|
15385
|
+
measureEditText2 as measureEditText,
|
|
15352
15386
|
measureText2 as measureText,
|
|
15353
15387
|
nonAlphanumericKeys2 as nonAlphanumericKeys,
|
|
15354
15388
|
normalizeColorValue2 as normalizeColorValue,
|
|
@@ -15401,5 +15435,5 @@ export {
|
|
|
15401
15435
|
yellow2 as yellow
|
|
15402
15436
|
};
|
|
15403
15437
|
|
|
15404
|
-
//# debugId=
|
|
15438
|
+
//# debugId=1B5615355BC40CFF64756E2164756E21
|
|
15405
15439
|
//# sourceMappingURL=index.bun.js.map
|