()
| 240 | } |
| 241 | |
| 242 | render() { |
| 243 | return html` |
| 244 | <div class="app"> |
| 245 | <header> |
| 246 | <h1>Sequence Shortcut Settings</h1> |
| 247 | <p> |
| 248 | Customize Vim-style sequences. Click Edit, press each chord in |
| 249 | order, then press Enter to save. Escape cancels; Backspace removes |
| 250 | the last chord or clears when empty. |
| 251 | </p> |
| 252 | </header> |
| 253 | |
| 254 | <main> |
| 255 | <section class="demo-section"> |
| 256 | <h2>Shortcuts</h2> |
| 257 | <div class="shortcuts-list"> |
| 258 | ${this._shortcuts.map((shortcut) => { |
| 259 | const isEditing = this._editingId === shortcut.id |
| 260 | const displayName = isEditing ? this._draftName : shortcut.name |
| 261 | const displayDescription = isEditing |
| 262 | ? this._draftDescription |
| 263 | : shortcut.description |
| 264 | |
| 265 | return html` |
| 266 | <div class="shortcut-item ${isEditing ? 'recording' : ''}"> |
| 267 | <div class="shortcut-item-content"> |
| 268 | <div class="shortcut-action"> |
| 269 | ${isEditing |
| 270 | ? html` |
| 271 | <div class="editing-fields"> |
| 272 | <input |
| 273 | type="text" |
| 274 | class="edit-input edit-name" |
| 275 | .value=${displayName} |
| 276 | @input=${(e: InputEvent) => |
| 277 | (this._draftName = ( |
| 278 | e.target as HTMLInputElement |
| 279 | ).value)} |
| 280 | placeholder="Shortcut name" |
| 281 | /> |
| 282 | <input |
| 283 | type="text" |
| 284 | class="edit-input edit-description" |
| 285 | .value=${displayDescription} |
| 286 | @input=${(e: InputEvent) => |
| 287 | (this._draftDescription = ( |
| 288 | e.target as HTMLInputElement |
| 289 | ).value)} |
| 290 | placeholder="Description (optional)" |
| 291 | /> |
| 292 | </div> |
| 293 | ` |
| 294 | : html` |
| 295 | ${shortcut.name || |
| 296 | html`<span class="unnamed">Unnamed</span>`} |
| 297 | ${shortcut.description |
| 298 | ? html`<div class="shortcut-description"> |
| 299 | ${shortcut.description} |
nothing calls this directly
no test coverage detected