MCPcopy Create free account
hub / github.com/TanStack/hotkeys / render

Method render

examples/lit/hotkey-sequence-recorder/src/app.ts:242–514  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls 6

_handleSaveEditingMethod · 0.95
_handleCancelMethod · 0.95
_handleEditMethod · 0.95
_handleDeleteMethod · 0.95
_handleCreateNewMethod · 0.95
formatForDisplayFunction · 0.85

Tested by

no test coverage detected