@suds-cli/textinput 0.0.0 → 0.1.0-alpha.1
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/README.md +13 -17
- package/dist/index.cjs +665 -0
- package/dist/index.cjs.map +1 -0
- package/dist/{model.d.ts → index.d.cts} +93 -6
- package/dist/index.d.ts +173 -4
- package/dist/index.js +649 -3
- package/dist/index.js.map +1 -1
- package/package.json +31 -18
- package/dist/index.d.ts.map +0 -1
- package/dist/messages.d.ts +0 -26
- package/dist/messages.d.ts.map +0 -1
- package/dist/messages.js +0 -40
- package/dist/messages.js.map +0 -1
- package/dist/model.d.ts.map +0 -1
- package/dist/model.js +0 -619
- package/dist/model.js.map +0 -1
- package/dist/types.d.ts +0 -63
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -33
- package/dist/types.js.map +0 -1
package/dist/model.js
DELETED
|
@@ -1,619 +0,0 @@
|
|
|
1
|
-
var _a;
|
|
2
|
-
import { Style, width as stringWidth, clampWidth } from "@suds-cli/chapstick";
|
|
3
|
-
import { CursorModel, CursorMode } from "@suds-cli/cursor";
|
|
4
|
-
import { matches } from "@suds-cli/key";
|
|
5
|
-
import { batch, KeyMsg, KeyType } from "@suds-cli/tea";
|
|
6
|
-
import { newSanitizer } from "@suds-cli/runeutil";
|
|
7
|
-
import GraphemeSplitter from "grapheme-splitter";
|
|
8
|
-
import { PasteErrorMsg, PasteMsg, pasteCommand } from "./messages.js";
|
|
9
|
-
import { EchoMode, defaultKeyMap, } from "./types.js";
|
|
10
|
-
const splitter = new GraphemeSplitter();
|
|
11
|
-
const sanitizer = newSanitizer({ replaceNewLine: " ", replaceTab: " " });
|
|
12
|
-
/**
|
|
13
|
-
* Single-line text input model with cursor control and clipboard support.
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
export class TextInputModel {
|
|
17
|
-
value;
|
|
18
|
-
position;
|
|
19
|
-
focused;
|
|
20
|
-
placeholder;
|
|
21
|
-
echoMode;
|
|
22
|
-
echoCharacter;
|
|
23
|
-
charLimit;
|
|
24
|
-
width;
|
|
25
|
-
prompt;
|
|
26
|
-
promptStyle;
|
|
27
|
-
textStyle;
|
|
28
|
-
placeholderStyle;
|
|
29
|
-
cursorStyle;
|
|
30
|
-
validateFn;
|
|
31
|
-
keyMap;
|
|
32
|
-
cursor;
|
|
33
|
-
error;
|
|
34
|
-
constructor(state) {
|
|
35
|
-
this.value = state.value;
|
|
36
|
-
this.position = state.position;
|
|
37
|
-
this.focused = state.focused;
|
|
38
|
-
this.placeholder = state.placeholder;
|
|
39
|
-
this.echoMode = state.echoMode;
|
|
40
|
-
this.echoCharacter = state.echoCharacter;
|
|
41
|
-
this.charLimit = state.charLimit;
|
|
42
|
-
this.width = state.width;
|
|
43
|
-
this.prompt = state.prompt;
|
|
44
|
-
this.promptStyle = state.promptStyle;
|
|
45
|
-
this.textStyle = state.textStyle;
|
|
46
|
-
this.placeholderStyle = state.placeholderStyle;
|
|
47
|
-
this.cursorStyle = state.cursorStyle;
|
|
48
|
-
this.validateFn = state.validateFn;
|
|
49
|
-
this.keyMap = state.keyMap;
|
|
50
|
-
this.cursor = state.cursor;
|
|
51
|
-
this.error = state.error;
|
|
52
|
-
}
|
|
53
|
-
/** Create a new text input model. */
|
|
54
|
-
static new(options = {}) {
|
|
55
|
-
const sanitized = clampToLimit(sanitizeValue(options.value ?? ""), options.charLimit ?? 0);
|
|
56
|
-
const baseTextStyle = options.textStyle ?? new Style();
|
|
57
|
-
const cursorMode = options.cursorMode ?? CursorMode.Blink;
|
|
58
|
-
const cursor = new CursorModel({
|
|
59
|
-
style: options.cursorStyle ?? new Style(),
|
|
60
|
-
textStyle: baseTextStyle,
|
|
61
|
-
mode: cursorMode,
|
|
62
|
-
focused: false,
|
|
63
|
-
char: " ",
|
|
64
|
-
});
|
|
65
|
-
const model = new _a({
|
|
66
|
-
value: sanitized,
|
|
67
|
-
position: runeCount(sanitized),
|
|
68
|
-
focused: false,
|
|
69
|
-
placeholder: options.placeholder ?? "",
|
|
70
|
-
echoMode: options.echoMode ?? EchoMode.Normal,
|
|
71
|
-
echoCharacter: options.echoCharacter ?? "•",
|
|
72
|
-
charLimit: options.charLimit ?? 0,
|
|
73
|
-
width: options.width ?? 0,
|
|
74
|
-
prompt: options.prompt ?? "> ",
|
|
75
|
-
promptStyle: options.promptStyle ?? new Style(),
|
|
76
|
-
textStyle: baseTextStyle,
|
|
77
|
-
placeholderStyle: options.placeholderStyle ?? new Style(),
|
|
78
|
-
cursorStyle: options.cursorStyle ?? new Style(),
|
|
79
|
-
validateFn: options.validate,
|
|
80
|
-
keyMap: options.keyMap ?? defaultKeyMap,
|
|
81
|
-
cursor,
|
|
82
|
-
error: null,
|
|
83
|
-
});
|
|
84
|
-
return model.#withError(model.#runValidation(sanitized));
|
|
85
|
-
}
|
|
86
|
-
/** Initial command (none needed by default). */
|
|
87
|
-
init() {
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
/** Current value. */
|
|
91
|
-
valueOf() {
|
|
92
|
-
return this.value;
|
|
93
|
-
}
|
|
94
|
-
/** Length in graphemes. */
|
|
95
|
-
length() {
|
|
96
|
-
return runeCount(this.value);
|
|
97
|
-
}
|
|
98
|
-
/** True if no content. */
|
|
99
|
-
isEmpty() {
|
|
100
|
-
return this.length() === 0;
|
|
101
|
-
}
|
|
102
|
-
/** Cursor position in graphemes. */
|
|
103
|
-
cursorPosition() {
|
|
104
|
-
return this.position;
|
|
105
|
-
}
|
|
106
|
-
/** Focus the input (shows cursor, enables key handling). */
|
|
107
|
-
focus() {
|
|
108
|
-
if (this.focused) {
|
|
109
|
-
return [this, null];
|
|
110
|
-
}
|
|
111
|
-
const [cursor, cmd] = this.cursor.focus();
|
|
112
|
-
const next = this.#with({ focused: true, cursor });
|
|
113
|
-
return [next, cmd];
|
|
114
|
-
}
|
|
115
|
-
/** Blur the input (hides cursor, ignores key handling). */
|
|
116
|
-
blur() {
|
|
117
|
-
if (!this.focused) {
|
|
118
|
-
return this;
|
|
119
|
-
}
|
|
120
|
-
return this.#with({ focused: false, cursor: this.cursor.blur() });
|
|
121
|
-
}
|
|
122
|
-
/** Move cursor to start. */
|
|
123
|
-
cursorStart() {
|
|
124
|
-
return this.#withPosition(0);
|
|
125
|
-
}
|
|
126
|
-
/** Move cursor to end. */
|
|
127
|
-
cursorEnd() {
|
|
128
|
-
return this.#withPosition(this.length());
|
|
129
|
-
}
|
|
130
|
-
/** Move cursor left by n (default 1). */
|
|
131
|
-
cursorLeft(n = 1) {
|
|
132
|
-
return this.#withPosition(Math.max(0, this.position - Math.max(1, n)));
|
|
133
|
-
}
|
|
134
|
-
/** Move cursor right by n (default 1). */
|
|
135
|
-
cursorRight(n = 1) {
|
|
136
|
-
return this.#withPosition(Math.min(this.length(), this.position + Math.max(1, n)));
|
|
137
|
-
}
|
|
138
|
-
/** Move cursor one word to the left. */
|
|
139
|
-
wordLeft() {
|
|
140
|
-
if (this.position === 0 || this.isEmpty()) {
|
|
141
|
-
return this;
|
|
142
|
-
}
|
|
143
|
-
if (this.echoMode !== EchoMode.Normal) {
|
|
144
|
-
return this.cursorStart();
|
|
145
|
-
}
|
|
146
|
-
const graphemes = splitGraphemes(this.value);
|
|
147
|
-
let i = this.position - 1;
|
|
148
|
-
while (i >= 0) {
|
|
149
|
-
const g = graphemes[i];
|
|
150
|
-
if (g && isWhitespace(g)) {
|
|
151
|
-
i--;
|
|
152
|
-
continue;
|
|
153
|
-
}
|
|
154
|
-
break;
|
|
155
|
-
}
|
|
156
|
-
while (i >= 0) {
|
|
157
|
-
const g = graphemes[i];
|
|
158
|
-
if (g && !isWhitespace(g)) {
|
|
159
|
-
i--;
|
|
160
|
-
continue;
|
|
161
|
-
}
|
|
162
|
-
break;
|
|
163
|
-
}
|
|
164
|
-
return this.#withPosition(Math.max(0, i + 1));
|
|
165
|
-
}
|
|
166
|
-
/** Move cursor one word to the right. */
|
|
167
|
-
wordRight() {
|
|
168
|
-
if (this.position >= this.length() || this.isEmpty()) {
|
|
169
|
-
return this;
|
|
170
|
-
}
|
|
171
|
-
if (this.echoMode !== EchoMode.Normal) {
|
|
172
|
-
return this.cursorEnd();
|
|
173
|
-
}
|
|
174
|
-
const graphemes = splitGraphemes(this.value);
|
|
175
|
-
let i = this.position;
|
|
176
|
-
while (i < graphemes.length) {
|
|
177
|
-
const g = graphemes[i];
|
|
178
|
-
if (g && isWhitespace(g)) {
|
|
179
|
-
i++;
|
|
180
|
-
continue;
|
|
181
|
-
}
|
|
182
|
-
break;
|
|
183
|
-
}
|
|
184
|
-
while (i < graphemes.length) {
|
|
185
|
-
const g = graphemes[i];
|
|
186
|
-
if (g && !isWhitespace(g)) {
|
|
187
|
-
i++;
|
|
188
|
-
continue;
|
|
189
|
-
}
|
|
190
|
-
break;
|
|
191
|
-
}
|
|
192
|
-
return this.#withPosition(Math.min(this.length(), i));
|
|
193
|
-
}
|
|
194
|
-
/** Insert runes at the cursor position. */
|
|
195
|
-
insertRunes(runes) {
|
|
196
|
-
if (!runes) {
|
|
197
|
-
return this;
|
|
198
|
-
}
|
|
199
|
-
const sanitized = sanitizeValue(runes);
|
|
200
|
-
if (!sanitized) {
|
|
201
|
-
return this;
|
|
202
|
-
}
|
|
203
|
-
const before = sliceGraphemes(this.value, 0, this.position);
|
|
204
|
-
const after = sliceGraphemes(this.value, this.position);
|
|
205
|
-
const insertion = clampGraphemes(sanitized, this.#remainingCapacity(before + after));
|
|
206
|
-
const nextValue = before + insertion + after;
|
|
207
|
-
const nextPos = this.position + runeCount(insertion);
|
|
208
|
-
return this.#withValue(nextValue, nextPos);
|
|
209
|
-
}
|
|
210
|
-
/** Delete up to n runes to the left of the cursor. */
|
|
211
|
-
deleteLeft(n = 1) {
|
|
212
|
-
if (this.position === 0 || n <= 0) {
|
|
213
|
-
return this;
|
|
214
|
-
}
|
|
215
|
-
const remove = Math.min(n, this.position);
|
|
216
|
-
const before = sliceGraphemes(this.value, 0, this.position - remove);
|
|
217
|
-
const after = sliceGraphemes(this.value, this.position);
|
|
218
|
-
return this.#withValue(before + after, this.position - remove);
|
|
219
|
-
}
|
|
220
|
-
/** Delete up to n runes to the right of the cursor. */
|
|
221
|
-
deleteRight(n = 1) {
|
|
222
|
-
if (this.position >= this.length() || n <= 0) {
|
|
223
|
-
return this;
|
|
224
|
-
}
|
|
225
|
-
const before = sliceGraphemes(this.value, 0, this.position);
|
|
226
|
-
const after = sliceGraphemes(this.value, this.position + Math.max(1, n));
|
|
227
|
-
return this.#withValue(before + after, this.position);
|
|
228
|
-
}
|
|
229
|
-
/** Delete the word to the left of the cursor. */
|
|
230
|
-
deleteWordLeft() {
|
|
231
|
-
if (this.position === 0 || this.isEmpty()) {
|
|
232
|
-
return this;
|
|
233
|
-
}
|
|
234
|
-
if (this.echoMode !== EchoMode.Normal) {
|
|
235
|
-
return this.deleteToStart();
|
|
236
|
-
}
|
|
237
|
-
const graphemes = splitGraphemes(this.value);
|
|
238
|
-
let start = this.position;
|
|
239
|
-
// Walk left over whitespace
|
|
240
|
-
while (start > 0) {
|
|
241
|
-
const g = graphemes[start - 1];
|
|
242
|
-
if (g && isWhitespace(g)) {
|
|
243
|
-
start--;
|
|
244
|
-
continue;
|
|
245
|
-
}
|
|
246
|
-
break;
|
|
247
|
-
}
|
|
248
|
-
// Walk left over word
|
|
249
|
-
while (start > 0) {
|
|
250
|
-
const g = graphemes[start - 1];
|
|
251
|
-
if (g && !isWhitespace(g)) {
|
|
252
|
-
start--;
|
|
253
|
-
continue;
|
|
254
|
-
}
|
|
255
|
-
break;
|
|
256
|
-
}
|
|
257
|
-
const before = graphemes.slice(0, start).join("");
|
|
258
|
-
const after = graphemes.slice(this.position).join("");
|
|
259
|
-
return this.#withValue(before + after, start);
|
|
260
|
-
}
|
|
261
|
-
/** Delete the word to the right of the cursor. */
|
|
262
|
-
deleteWordRight() {
|
|
263
|
-
if (this.position >= this.length() || this.isEmpty()) {
|
|
264
|
-
return this;
|
|
265
|
-
}
|
|
266
|
-
if (this.echoMode !== EchoMode.Normal) {
|
|
267
|
-
return this.deleteToEnd();
|
|
268
|
-
}
|
|
269
|
-
const graphemes = splitGraphemes(this.value);
|
|
270
|
-
let end = this.position;
|
|
271
|
-
while (end < graphemes.length) {
|
|
272
|
-
const g = graphemes[end];
|
|
273
|
-
if (g && isWhitespace(g)) {
|
|
274
|
-
end++;
|
|
275
|
-
continue;
|
|
276
|
-
}
|
|
277
|
-
break;
|
|
278
|
-
}
|
|
279
|
-
while (end < graphemes.length) {
|
|
280
|
-
const g = graphemes[end];
|
|
281
|
-
if (g && !isWhitespace(g)) {
|
|
282
|
-
end++;
|
|
283
|
-
continue;
|
|
284
|
-
}
|
|
285
|
-
break;
|
|
286
|
-
}
|
|
287
|
-
const before = graphemes.slice(0, this.position).join("");
|
|
288
|
-
const after = graphemes.slice(end).join("");
|
|
289
|
-
return this.#withValue(before + after, this.position);
|
|
290
|
-
}
|
|
291
|
-
/** Delete everything before the cursor. */
|
|
292
|
-
deleteToStart() {
|
|
293
|
-
const after = sliceGraphemes(this.value, this.position);
|
|
294
|
-
return this.#withValue(after, 0);
|
|
295
|
-
}
|
|
296
|
-
/** Delete everything after the cursor. */
|
|
297
|
-
deleteToEnd() {
|
|
298
|
-
const before = sliceGraphemes(this.value, 0, this.position);
|
|
299
|
-
return this.#withValue(before, before.length === 0 ? 0 : runeCount(before));
|
|
300
|
-
}
|
|
301
|
-
/** Reset to empty value and cursor at start. */
|
|
302
|
-
reset() {
|
|
303
|
-
return this.#withValue("", 0);
|
|
304
|
-
}
|
|
305
|
-
/** Replace the value and re-run validation. */
|
|
306
|
-
setValue(value) {
|
|
307
|
-
const sanitized = clampToLimit(sanitizeValue(value), this.charLimit);
|
|
308
|
-
return this.#withValue(sanitized, Math.min(this.position, runeCount(sanitized)));
|
|
309
|
-
}
|
|
310
|
-
/** Run validation and return the error (if any). */
|
|
311
|
-
validate() {
|
|
312
|
-
return this.#runValidation(this.value);
|
|
313
|
-
}
|
|
314
|
-
/** Set a new validation function (re-validates current value). */
|
|
315
|
-
setValidateFunc(fn) {
|
|
316
|
-
const next = this.#with({ validateFn: fn });
|
|
317
|
-
return next.#withError(next.#runValidation(next.value));
|
|
318
|
-
}
|
|
319
|
-
/** Command to paste from the clipboard. */
|
|
320
|
-
paste() {
|
|
321
|
-
return [this, pasteCommand()];
|
|
322
|
-
}
|
|
323
|
-
/** Handle Tea messages (keys, cursor, paste). */
|
|
324
|
-
update(msg) {
|
|
325
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
326
|
-
let model = this;
|
|
327
|
-
const cmds = [];
|
|
328
|
-
if (msg instanceof KeyMsg) {
|
|
329
|
-
if (model.focused) {
|
|
330
|
-
const [nextModel, keyCmd] = model.#handleKey(msg);
|
|
331
|
-
model = nextModel;
|
|
332
|
-
if (keyCmd) {
|
|
333
|
-
cmds.push(keyCmd);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
else if (msg instanceof PasteMsg) {
|
|
338
|
-
model = model.insertRunes(msg.text);
|
|
339
|
-
}
|
|
340
|
-
else if (msg instanceof PasteErrorMsg) {
|
|
341
|
-
model = model.#withError(asError(msg.error));
|
|
342
|
-
}
|
|
343
|
-
const [cursor, cursorCmd] = model.cursor.update(msg);
|
|
344
|
-
model = model.#with({ cursor });
|
|
345
|
-
if (cursorCmd) {
|
|
346
|
-
cmds.push(cursorCmd);
|
|
347
|
-
}
|
|
348
|
-
return [model, batch(...cmds)];
|
|
349
|
-
}
|
|
350
|
-
/** Render the input with prompt, text, and cursor. */
|
|
351
|
-
view() {
|
|
352
|
-
const promptRendered = this.promptStyle.inline(true).render(this.prompt);
|
|
353
|
-
const availableWidth = this.width > 0
|
|
354
|
-
? Math.max(0, this.width - stringWidth(promptRendered))
|
|
355
|
-
: Number.POSITIVE_INFINITY;
|
|
356
|
-
if (this.isEmpty() && this.placeholder) {
|
|
357
|
-
const placeholder = this.#placeholderView(availableWidth);
|
|
358
|
-
return promptRendered + placeholder;
|
|
359
|
-
}
|
|
360
|
-
const rendered = this.#valueView(availableWidth);
|
|
361
|
-
return promptRendered + rendered;
|
|
362
|
-
}
|
|
363
|
-
#handleKey(msg) {
|
|
364
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
365
|
-
let next = this;
|
|
366
|
-
let cmd = null;
|
|
367
|
-
const keyMap = this.keyMap;
|
|
368
|
-
switch (true) {
|
|
369
|
-
case matches(msg, keyMap.deleteWordBackward):
|
|
370
|
-
next = next.deleteWordLeft();
|
|
371
|
-
break;
|
|
372
|
-
case matches(msg, keyMap.deleteCharacterBackward):
|
|
373
|
-
next = next.deleteLeft();
|
|
374
|
-
break;
|
|
375
|
-
case matches(msg, keyMap.wordBackward):
|
|
376
|
-
next = next.wordLeft();
|
|
377
|
-
break;
|
|
378
|
-
case matches(msg, keyMap.characterBackward):
|
|
379
|
-
next = next.cursorLeft();
|
|
380
|
-
break;
|
|
381
|
-
case matches(msg, keyMap.wordForward):
|
|
382
|
-
next = next.wordRight();
|
|
383
|
-
break;
|
|
384
|
-
case matches(msg, keyMap.characterForward):
|
|
385
|
-
next = next.cursorRight();
|
|
386
|
-
break;
|
|
387
|
-
case matches(msg, keyMap.lineStart):
|
|
388
|
-
next = next.cursorStart();
|
|
389
|
-
break;
|
|
390
|
-
case matches(msg, keyMap.deleteCharacterForward):
|
|
391
|
-
next = next.deleteRight();
|
|
392
|
-
break;
|
|
393
|
-
case matches(msg, keyMap.lineEnd):
|
|
394
|
-
next = next.cursorEnd();
|
|
395
|
-
break;
|
|
396
|
-
case matches(msg, keyMap.deleteAfterCursor):
|
|
397
|
-
next = next.deleteToEnd();
|
|
398
|
-
break;
|
|
399
|
-
case matches(msg, keyMap.deleteBeforeCursor):
|
|
400
|
-
next = next.deleteToStart();
|
|
401
|
-
break;
|
|
402
|
-
case matches(msg, keyMap.paste):
|
|
403
|
-
cmd = pasteCommand();
|
|
404
|
-
break;
|
|
405
|
-
case matches(msg, keyMap.deleteWordForward):
|
|
406
|
-
next = next.deleteWordRight();
|
|
407
|
-
break;
|
|
408
|
-
default:
|
|
409
|
-
if ((msg.key.type === KeyType.Runes || msg.key.type === KeyType.Space) &&
|
|
410
|
-
!msg.key.alt) {
|
|
411
|
-
next = next.insertRunes(msg.key.runes);
|
|
412
|
-
}
|
|
413
|
-
break;
|
|
414
|
-
}
|
|
415
|
-
return [next, cmd];
|
|
416
|
-
}
|
|
417
|
-
#placeholderView(availableWidth) {
|
|
418
|
-
const graphemes = splitGraphemes(this.placeholder);
|
|
419
|
-
const cursorChar = graphemes[0] ?? " ";
|
|
420
|
-
const rest = graphemes.slice(1).join("");
|
|
421
|
-
const budget = Number.isFinite(availableWidth)
|
|
422
|
-
? Math.max(0, availableWidth - stringWidth(cursorChar))
|
|
423
|
-
: undefined;
|
|
424
|
-
const visibleRest = budget === undefined ? rest : clampWidth(rest, budget);
|
|
425
|
-
const cursorView = this.cursor.withChar(cursorChar || " ").view();
|
|
426
|
-
const styledRest = this.placeholderStyle.inline(true).render(visibleRest);
|
|
427
|
-
const usedWidth = stringWidth(cursorChar + visibleRest);
|
|
428
|
-
const padding = Number.isFinite(availableWidth) && availableWidth > 0
|
|
429
|
-
? Math.max(0, availableWidth - usedWidth)
|
|
430
|
-
: 0;
|
|
431
|
-
return cursorView + styledRest + " ".repeat(padding);
|
|
432
|
-
}
|
|
433
|
-
#valueView(availableWidth) {
|
|
434
|
-
const graphemes = splitGraphemes(this.value);
|
|
435
|
-
const displayGraphemes = graphemes.map((g) => this.#echoTransform(g));
|
|
436
|
-
const widths = displayGraphemes.map((g) => stringWidth(g));
|
|
437
|
-
const [start, end] = visibleRange(widths, this.position, availableWidth);
|
|
438
|
-
const slice = displayGraphemes.slice(start, end);
|
|
439
|
-
const cursorOffset = clamp(this.position - start, 0, slice.length);
|
|
440
|
-
const before = slice.slice(0, cursorOffset).join("");
|
|
441
|
-
const after = cursorOffset < slice.length
|
|
442
|
-
? slice.slice(cursorOffset + 1).join("")
|
|
443
|
-
: "";
|
|
444
|
-
const cursorChar = cursorOffset < slice.length
|
|
445
|
-
? slice[cursorOffset] ?? " "
|
|
446
|
-
: " ";
|
|
447
|
-
const beforeStyled = this.textStyle.inline(true).render(before);
|
|
448
|
-
const afterStyled = this.textStyle.inline(true).render(after);
|
|
449
|
-
const cursorView = this.cursor.withChar(cursorChar || " ").view();
|
|
450
|
-
const usedWidth = stringWidth(before) +
|
|
451
|
-
stringWidth(cursorChar || " ") +
|
|
452
|
-
stringWidth(after);
|
|
453
|
-
const padding = Number.isFinite(availableWidth) && availableWidth > 0
|
|
454
|
-
? Math.max(0, availableWidth - usedWidth)
|
|
455
|
-
: 0;
|
|
456
|
-
return beforeStyled + cursorView + afterStyled + " ".repeat(padding);
|
|
457
|
-
}
|
|
458
|
-
#echoTransform(s) {
|
|
459
|
-
switch (this.echoMode) {
|
|
460
|
-
case EchoMode.Password:
|
|
461
|
-
return this.echoCharacter.repeat(Math.max(0, runeCount(s)));
|
|
462
|
-
case EchoMode.None:
|
|
463
|
-
return "";
|
|
464
|
-
case EchoMode.Normal:
|
|
465
|
-
default:
|
|
466
|
-
return s;
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
#withPosition(position) {
|
|
470
|
-
const clamped = clamp(position, 0, this.length());
|
|
471
|
-
if (clamped === this.position) {
|
|
472
|
-
return this;
|
|
473
|
-
}
|
|
474
|
-
return this.#with({ position: clamped });
|
|
475
|
-
}
|
|
476
|
-
#withValue(value, position) {
|
|
477
|
-
const clamped = clampToLimit(value, this.charLimit);
|
|
478
|
-
const pos = clamp(position ?? this.position, 0, runeCount(clamped));
|
|
479
|
-
const next = this.#with({ value: clamped, position: pos });
|
|
480
|
-
return next.#withError(next.#runValidation(clamped));
|
|
481
|
-
}
|
|
482
|
-
#withError(error) {
|
|
483
|
-
if (error === this.error) {
|
|
484
|
-
return this;
|
|
485
|
-
}
|
|
486
|
-
return this.#with({ error });
|
|
487
|
-
}
|
|
488
|
-
#with(patch) {
|
|
489
|
-
return new _a({
|
|
490
|
-
value: this.value,
|
|
491
|
-
position: this.position,
|
|
492
|
-
focused: this.focused,
|
|
493
|
-
placeholder: this.placeholder,
|
|
494
|
-
echoMode: this.echoMode,
|
|
495
|
-
echoCharacter: this.echoCharacter,
|
|
496
|
-
charLimit: this.charLimit,
|
|
497
|
-
width: this.width,
|
|
498
|
-
prompt: this.prompt,
|
|
499
|
-
promptStyle: this.promptStyle,
|
|
500
|
-
textStyle: this.textStyle,
|
|
501
|
-
placeholderStyle: this.placeholderStyle,
|
|
502
|
-
cursorStyle: this.cursorStyle,
|
|
503
|
-
validateFn: this.validateFn,
|
|
504
|
-
keyMap: this.keyMap,
|
|
505
|
-
cursor: this.cursor,
|
|
506
|
-
error: this.error,
|
|
507
|
-
...patch,
|
|
508
|
-
});
|
|
509
|
-
}
|
|
510
|
-
#runValidation(value) {
|
|
511
|
-
return this.validateFn ? this.validateFn(value) : null;
|
|
512
|
-
}
|
|
513
|
-
#remainingCapacity(current) {
|
|
514
|
-
if (this.charLimit <= 0) {
|
|
515
|
-
return Number.POSITIVE_INFINITY;
|
|
516
|
-
}
|
|
517
|
-
const remaining = this.charLimit - runeCount(current);
|
|
518
|
-
return Math.max(0, remaining);
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
_a = TextInputModel;
|
|
522
|
-
function sanitizeValue(value) {
|
|
523
|
-
return sanitizer.sanitize(value ?? "");
|
|
524
|
-
}
|
|
525
|
-
function clampToLimit(value, charLimit) {
|
|
526
|
-
if (charLimit <= 0) {
|
|
527
|
-
return value;
|
|
528
|
-
}
|
|
529
|
-
return clampGraphemes(value, charLimit);
|
|
530
|
-
}
|
|
531
|
-
function clampGraphemes(value, limit) {
|
|
532
|
-
if (limit <= 0) {
|
|
533
|
-
return "";
|
|
534
|
-
}
|
|
535
|
-
const graphemes = splitGraphemes(value);
|
|
536
|
-
if (graphemes.length <= limit) {
|
|
537
|
-
return graphemes.join("");
|
|
538
|
-
}
|
|
539
|
-
return graphemes.slice(0, limit).join("");
|
|
540
|
-
}
|
|
541
|
-
function splitGraphemes(value) {
|
|
542
|
-
return splitter.splitGraphemes(value ?? "");
|
|
543
|
-
}
|
|
544
|
-
function sliceGraphemes(value, start, end) {
|
|
545
|
-
const graphemes = splitGraphemes(value);
|
|
546
|
-
return graphemes.slice(start, end).join("");
|
|
547
|
-
}
|
|
548
|
-
function runeCount(value) {
|
|
549
|
-
return splitter.countGraphemes(value ?? "");
|
|
550
|
-
}
|
|
551
|
-
function clamp(value, min, max) {
|
|
552
|
-
const lower = Math.min(min, max);
|
|
553
|
-
const upper = Math.max(min, max);
|
|
554
|
-
return Math.min(upper, Math.max(lower, value));
|
|
555
|
-
}
|
|
556
|
-
function isWhitespace(grapheme) {
|
|
557
|
-
return /^\s+$/.test(grapheme);
|
|
558
|
-
}
|
|
559
|
-
function visibleRange(widths, position, maxWidth) {
|
|
560
|
-
const len = widths.length;
|
|
561
|
-
if (!Number.isFinite(maxWidth) || maxWidth <= 0) {
|
|
562
|
-
return [0, len];
|
|
563
|
-
}
|
|
564
|
-
if (len === 0) {
|
|
565
|
-
return [0, 0];
|
|
566
|
-
}
|
|
567
|
-
const widthAt = (i) => (i >= 0 && i < len ? widths[i] ?? 0 : 0);
|
|
568
|
-
const budget = maxWidth;
|
|
569
|
-
let start = Math.min(position, len);
|
|
570
|
-
let end = start;
|
|
571
|
-
let current = 0;
|
|
572
|
-
if (position < len) {
|
|
573
|
-
current = widthAt(position);
|
|
574
|
-
start = position;
|
|
575
|
-
end = position + 1;
|
|
576
|
-
}
|
|
577
|
-
else {
|
|
578
|
-
// Cursor is at the end - reserve 1 cell for the cursor space character
|
|
579
|
-
current = 1;
|
|
580
|
-
}
|
|
581
|
-
while (start > 0) {
|
|
582
|
-
const w = widthAt(start - 1);
|
|
583
|
-
if (current > 0 && current + w > budget) {
|
|
584
|
-
break;
|
|
585
|
-
}
|
|
586
|
-
start--;
|
|
587
|
-
current += w;
|
|
588
|
-
if (current >= budget) {
|
|
589
|
-
break;
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
while (end < len) {
|
|
593
|
-
const w = widthAt(end);
|
|
594
|
-
if (current > 0 && current + w > budget) {
|
|
595
|
-
break;
|
|
596
|
-
}
|
|
597
|
-
end++;
|
|
598
|
-
current += w;
|
|
599
|
-
if (current >= budget) {
|
|
600
|
-
break;
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
while (current > budget && start < end) {
|
|
604
|
-
current -= widthAt(start);
|
|
605
|
-
start++;
|
|
606
|
-
}
|
|
607
|
-
return [start, end];
|
|
608
|
-
}
|
|
609
|
-
function asError(err) {
|
|
610
|
-
if (err instanceof Error) {
|
|
611
|
-
return err;
|
|
612
|
-
}
|
|
613
|
-
if (typeof err === "string")
|
|
614
|
-
return new Error(err);
|
|
615
|
-
if (typeof err === "number" || typeof err === "boolean")
|
|
616
|
-
return new Error(String(err));
|
|
617
|
-
return new Error("clipboard error");
|
|
618
|
-
}
|
|
619
|
-
//# sourceMappingURL=model.js.map
|
package/dist/model.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,IAAI,WAAW,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,EAAsB,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,gBAAgB,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EACL,QAAQ,EAIR,aAAa,GACd,MAAM,YAAY,CAAC;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