Repository navigation
Commit 123fecc
committed
Use position mapping to accurately locate symbol indices during click deletion
- if the text has 2 identical symbols, the first one deletes regardless of which one is actually intended to be deleted
└── packages
└── ui
└── src
└── components
└── editor
└── common
└── prompts
├── PromptField
│ ├── PromptField.module.scss
│ ├── PromptField.stories.tsx
│ ├── PromptField.tsx
│ ├── components
│ │ ├── Tooltip.module.scss
│ │ ├── Tooltip.tsx
│ │ └── index.ts
│ ├── hooks
│ │ ├── use-drag-drop.ts
│ │ ├── use-dropdown.ts
│ │ ├── use-ghost-text.ts
│ │ ├── use-handlers
│ │ │ ├── handle-copy.ts
│ │ │ ├── handle-cut.ts
│ │ │ ├── handle-input-change.ts
│ │ │ ├── handle-input-click.ts
│ │ │ ├── handle-key-down.ts
│ │ │ ├── handle-paste.ts
│ │ │ ├── handle-submit.ts
│ │ │ ├── index.ts
│ │ │ ├── types.ts
│ │ │ ├── use-handlers.ts
│ │ │ └── utils.ts
│ │ └── use-keyboard-shortcuts.ts
│ └── index.ts
├── Template
│ ├── Template.module.scss
│ ├── Template.tsx
│ └── index.ts
└── shared
└── symbols
├── caret.ts
├── get-highlighted-text.tsx
├── index.ts
├── position-mapping.ts
├── prompt-symbols.module.scss
├── reconstruct-raw-value.ts
└── use-symbol-deletion.ts1 parent 583e1ac commit 123fecc
1 file changed
Lines changed: 42 additions & 13 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
26 | 55 | | |
27 | 56 | | |
28 | 57 | | |
29 | 58 | | |
30 | 59 | | |
31 | 60 | | |
32 | 61 | | |
33 | | - | |
| 62 | + | |
34 | 63 | | |
35 | 64 | | |
36 | 65 | | |
| |||
40 | 69 | | |
41 | 70 | | |
42 | 71 | | |
43 | | - | |
| 72 | + | |
44 | 73 | | |
45 | 74 | | |
46 | 75 | | |
| |||
53 | 82 | | |
54 | 83 | | |
55 | 84 | | |
56 | | - | |
| 85 | + | |
57 | 86 | | |
58 | 87 | | |
59 | 88 | | |
60 | 89 | | |
61 | 90 | | |
62 | 91 | | |
63 | | - | |
| 92 | + | |
64 | 93 | | |
65 | 94 | | |
66 | 95 | | |
67 | 96 | | |
68 | 97 | | |
69 | 98 | | |
70 | | - | |
| 99 | + | |
71 | 100 | | |
72 | 101 | | |
73 | 102 | | |
| |||
87 | 116 | | |
88 | 117 | | |
89 | 118 | | |
90 | | - | |
| 119 | + | |
91 | 120 | | |
92 | 121 | | |
93 | 122 | | |
| |||
99 | 128 | | |
100 | 129 | | |
101 | 130 | | |
102 | | - | |
| 131 | + | |
103 | 132 | | |
104 | 133 | | |
105 | 134 | | |
| |||
124 | 153 | | |
125 | 154 | | |
126 | 155 | | |
127 | | - | |
| 156 | + | |
128 | 157 | | |
129 | 158 | | |
130 | 159 | | |
131 | | - | |
| 160 | + | |
132 | 161 | | |
133 | 162 | | |
134 | 163 | | |
| |||
139 | 168 | | |
140 | 169 | | |
141 | 170 | | |
142 | | - | |
| 171 | + | |
143 | 172 | | |
144 | 173 | | |
145 | 174 | | |
| |||
150 | 179 | | |
151 | 180 | | |
152 | 181 | | |
153 | | - | |
| 182 | + | |
154 | 183 | | |
155 | 184 | | |
156 | 185 | | |
| |||
160 | 189 | | |
161 | 190 | | |
162 | 191 | | |
163 | | - | |
| 192 | + | |
164 | 193 | | |
165 | 194 | | |
166 | 195 | | |
| |||
170 | 199 | | |
171 | 200 | | |
172 | 201 | | |
173 | | - | |
| 202 | + | |
174 | 203 | | |
175 | 204 | | |
176 | 205 | | |
| |||
0 commit comments