@testany/hephos 0.3.15 → 0.3.16
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/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
diff --git a/node_modules/ink-text-input/build/index.js b/node_modules/ink-text-input/build/index.js
|
|
2
|
-
index ada7cdc..
|
|
2
|
+
index ada7cdc..0cf95d2 100644
|
|
3
3
|
--- a/node_modules/ink-text-input/build/index.js
|
|
4
4
|
+++ b/node_modules/ink-text-input/build/index.js
|
|
5
|
-
@@ -73,11 +73,
|
|
5
|
+
@@ -73,11 +73,32 @@ function TextInput({ value: originalValue, placeholder = '', focus = true, mask,
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
else if (key.backspace || key.delete) {
|
|
@@ -11,14 +11,16 @@ index ada7cdc..5605141 100644
|
|
|
11
11
|
- originalValue.slice(0, cursorOffset - 1) +
|
|
12
12
|
- originalValue.slice(cursorOffset, originalValue.length);
|
|
13
13
|
- nextCursorOffset--;
|
|
14
|
-
+ //
|
|
15
|
-
+ //
|
|
16
|
-
+ //
|
|
14
|
+
+ // Normalize Backspace vs Delete using raw sequence (similar to Gemini's approach)
|
|
15
|
+
+ //
|
|
16
|
+
+ // - Terminals often send DEL (0x7f) for Backspace; ink may label it as delete
|
|
17
|
+
+ // - Real Delete key usually sends ESC [3~
|
|
18
|
+
+ // - Ctrl+H maps to key.backspace
|
|
17
19
|
+ const sequence = key.sequence || input || '';
|
|
18
|
-
+ const
|
|
19
|
-
+ const
|
|
20
|
+
+ const isBackspace = key.backspace === true || sequence === '\x7f'; // delete left
|
|
21
|
+
+ const isDelete = key.delete === true || sequence === '\x1b[3~'; // delete right
|
|
20
22
|
+
|
|
21
|
-
+ if (
|
|
23
|
+
+ if (isBackspace) {
|
|
22
24
|
+ // Backspace: delete character BEFORE cursor
|
|
23
25
|
+ if (cursorOffset > 0) {
|
|
24
26
|
+ nextValue =
|
|
@@ -27,8 +29,8 @@ index ada7cdc..5605141 100644
|
|
|
27
29
|
+ nextCursorOffset--;
|
|
28
30
|
+ }
|
|
29
31
|
+ }
|
|
30
|
-
+ else if (
|
|
31
|
-
+ //
|
|
32
|
+
+ else if (isDelete) {
|
|
33
|
+
+ // Delete: delete character AT cursor position
|
|
32
34
|
+ if (cursorOffset < originalValue.length) {
|
|
33
35
|
+ nextValue =
|
|
34
36
|
+ originalValue.slice(0, cursorOffset) +
|