@molecule/app-feature-piano-roll-angular 0.0.1-stage → 1.1.0

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.
Files changed (2) hide show
  1. package/README.md +592 -4
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,11 +1,599 @@
1
+ <!--
2
+ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
+ Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
+ Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
+ To change this document, edit the module-level JSDoc in src/index.ts.
6
+ Generated: 2026-11-21T12:46:32.110Z
7
+ -->
8
+
1
9
  # @molecule/app-feature-piano-roll-angular
2
10
 
3
- MIDI piano roll editor — note grid with vertical piano keys + horizontal time grid + draggable/resizable note rectangles for music-daw
11
+ Angular piano roll — MIDI note-grid editor for music-daw and other
12
+ DAW-style surfaces. Renders a vertical piano keyboard on the left, a
13
+ horizontal time grid on the right, and draggable / resizable note rectangles
14
+ on top.
15
+
16
+ Angular counterpart of `@molecule/app-feature-piano-roll-react`: the same
17
+ props (React names), the same DOM for the same input, and the same callback
18
+ calls, so an app switches framework by changing only the package name it
19
+ imports.
20
+
21
+ > **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
22
+ > It is written to be read by coding agents as much as by people, and is generated from this
23
+ > package's source — edit `src/index.ts` JSDoc, not this file.
24
+
25
+ ## Quick Start
26
+
27
+ ```ts
28
+ import { Component } from '@angular/core'
29
+ import { PianoRoll, type MidiNote } from '@molecule/app-feature-piano-roll-angular'
30
+
31
+ @Component({
32
+ selector: 'app-roll',
33
+ standalone: true,
34
+ imports: [PianoRoll],
35
+ template: `
36
+ <div
37
+ mol-piano-roll
38
+ [notes]="notes"
39
+ snap="1/16"
40
+ [onNoteAdd]="addNote"
41
+ [onNoteMove]="moveNote"
42
+ [onNoteResize]="resizeNote"
43
+ [onNoteDelete]="deleteNote"
44
+ ></div>
45
+ `,
46
+ })
47
+ export class Roll {
48
+ notes: MidiNote[] = []
49
+ addNote = (note: MidiNote): void => {
50
+ this.notes = [...this.notes, note]
51
+ }
52
+ moveNote = (noteId: string, startBeat: number, pitch: number): void => {
53
+ this.notes = this.notes.map((n) => (n.id === noteId ? { ...n, startBeat, pitch } : n))
54
+ }
55
+ resizeNote = (noteId: string, durationBeats: number): void => {
56
+ this.notes = this.notes.map((n) => (n.id === noteId ? { ...n, durationBeats } : n))
57
+ }
58
+ deleteNote = (noteId: string): void => {
59
+ this.notes = this.notes.filter((n) => n.id !== noteId)
60
+ }
61
+ }
62
+ ```
63
+
64
+ ## Type
65
+
66
+ `feature`
67
+
68
+ ## Installation
69
+
70
+ ```bash
71
+ npm install @molecule/app-feature-piano-roll-angular @angular/common @angular/core @angular/platform-browser @molecule/app-angular @molecule/app-ui @molecule/app-ui-angular
72
+ ```
73
+
74
+ ## API
75
+
76
+ ### Interfaces
77
+
78
+ #### `MidiNote`
79
+
80
+ A single MIDI note rendered on the piano roll. `pitch` is a standard MIDI
81
+ pitch number in the closed interval `[0, 127]` where `60` represents middle C
82
+ (`C4`). `startBeat` is the note's start position on the time grid, and
83
+ `durationBeats` is its length in beats. `id` is a stable identifier used as
84
+ the row key and as the argument passed back to all event handlers.
85
+ `velocity` is an optional MIDI velocity in the closed interval `[0, 127]`
86
+ (defaults to a neutral mid-range).
87
+
88
+ ```typescript
89
+ interface MidiNote {
90
+ /** Stable identifier for the note (used as the row key + handler arg). */
91
+ id: string
92
+ /** MIDI pitch number, `0..127`. `60` is middle C. */
93
+ pitch: number
94
+ /** Start beat on the timeline (>= 0). */
95
+ startBeat: number
96
+ /** Duration in beats (always positive — minimum is enforced). */
97
+ durationBeats: number
98
+ /** Optional MIDI velocity, `0..127`. */
99
+ velocity?: number
100
+ }
101
+ ```
102
+
103
+ #### `PianoRollProps`
104
+
105
+ Props accepted by the {@link PianoRoll} component.
106
+
107
+ ```typescript
108
+ interface PianoRollProps {
109
+ /** MIDI notes rendered on the grid. Order is preserved as-is. */
110
+ notes: MidiNote[]
111
+ /** Horizontal scale: pixels rendered per musical beat. Defaults to `80`. */
112
+ pixelsPerBeat?: number
113
+ /** Vertical row height per pitch in pixels. Defaults to `20`. */
114
+ noteHeight?: number
115
+ /** Lowest visible pitch (top-most row excluded — see `highestPitch`). Defaults to `21` (A0). */
116
+ lowestPitch?: number
117
+ /** Highest visible pitch (top-most row inclusive). Defaults to `108` (C8). */
118
+ highestPitch?: number
119
+ /** Snap resolution applied to clicks, drags, and resizes. Defaults to `'1/16'`. */
120
+ snap?: PianoRollSnap
121
+ /**
122
+ * Total beats rendered in the time grid. When omitted, the grid extends to
123
+ * cover all notes plus a small trailing pad (minimum 16 beats so empty rolls
124
+ * are still usable).
125
+ */
126
+ beatsCount?: number
127
+ /**
128
+ * Called with a freshly-created note when the user paints an empty cell — by
129
+ * clicking it, or via the keyboard cell cursor (arrow keys to move, Enter /
130
+ * Space to paint).
131
+ */
132
+ onNoteAdd?: (note: MidiNote) => void
133
+ /** Called with the updated note when a note is dragged horizontally / vertically. */
134
+ onNoteMove?: (noteId: string, startBeat: number, pitch: number) => void
135
+ /** Called with the updated duration when a note's right-edge handle is dragged. */
136
+ onNoteResize?: (noteId: string, durationBeats: number) => void
137
+ /** Called when the user right-clicks a note. */
138
+ onNoteDelete?: (noteId: string) => void
139
+ /** Extra classes merged onto the root element. */
140
+ className?: string
141
+ }
142
+ ```
143
+
144
+ ### Types
145
+
146
+ #### `PianoRollSnap`
147
+
148
+ Snap resolution for note placement / movement / resize. Each value is a
149
+ fraction of a beat: `'1/16'` is sixteenth-notes (a quarter of a beat), `'1/4'`
150
+ is quarter-notes (one beat), `'1'` snaps to whole beats with no
151
+ sub-divisions, etc.
152
+
153
+ ```typescript
154
+ type PianoRollSnap = '1/16' | '1/8' | '1/4' | '1/2' | '1'
155
+ ```
156
+
157
+ ### Classes
158
+
159
+ #### `PianoRoll`
160
+
161
+ PianoRoll component.
162
+
163
+ The host IS React's root `<div>` (`div[mol-piano-roll]`), matching React's
164
+ root exactly. Renders a vertical piano keyboard on the left, a horizontal
165
+ time grid on the right, and draggable / resizable note rectangles on top.
166
+ Click an empty cell to paint a new note, drag a note body to move it
167
+ (snapped), drag the right-edge handle to resize, right-click a note to
168
+ delete it.
169
+
170
+ Keyboard users get the same paint action: focus the grid (Tab), move the
171
+ cell cursor with the arrow keys, and press Enter or Space to paint a new note
172
+ at the cursor cell.
173
+
174
+ ```typescript
175
+ @Component({
176
+ selector: 'div[mol-piano-roll]',
177
+ standalone: true,
178
+ inputs: [
179
+ 'notes',
180
+ 'pixelsPerBeat',
181
+ 'noteHeight',
182
+ 'lowestPitch',
183
+ 'highestPitch',
184
+ 'snap',
185
+ 'beatsCount',
186
+ 'onNoteAdd',
187
+ 'onNoteMove',
188
+ 'onNoteResize',
189
+ 'onNoteDelete',
190
+ 'className',
191
+ ],
192
+ host: {
193
+ role: 'region',
194
+ 'data-mol-id': 'piano-roll',
195
+ '[attr.aria-label]': 'rollLabel()',
196
+ '[class]': 'classes()',
197
+ '[style]': 'rootStyle',
198
+ },
199
+ template: `<div role="list" [attr.aria-label]="keysLabel()" data-mol-id="piano-roll-keys" [style]="keysColumnStyle()">@for (pitch of rows(); track pitch) {<div role="listitem" data-mol-id="piano-roll-key" [attr.data-pitch]="pitch" [attr.data-key-color]="isBlackKey(pitch) ? 'black' : 'white'" [style]="keyStyle(isBlackKey(pitch))">@if (isC(pitch)) {<span data-mol-id="piano-roll-key-label" [class]="keyLabelClasses()">{{ pitchLabel(pitch) }}</span>}</div>}</div><div #grid role="application" [attr.aria-label]="gridLabel()" [attr.aria-describedby]="gridHelpId" data-mol-id="piano-roll-grid" [attr.data-snap]="snapValue()" [style]="gridSurfaceStyle()" tabindex="0" (click)="handleGridClick($event)" (keydown)="handleGridKeyDown($event)" (focusin)="setGridFocused(true)" (focusout)="setGridFocused(false)">@for (pitch of rows(); track pitch) {<div data-mol-id="piano-roll-row" [attr.data-pitch]="pitch" [attr.data-key-color]="isBlackKey(pitch) ? 'black' : 'white'" [style]="rowStyle(pitch)"></div>}@for (beat of beatLines(); track beat) {<div data-mol-id="piano-roll-beat-line" [attr.data-beat]="beat" [attr.data-bar]="beat % 4 === 0 ? 'true' : 'false'" [style]="lineStyle(beat)"></div>}@if (showsCursor()) {<div data-mol-id="piano-roll-cell-cursor" aria-hidden="true" [style]="cursorStyle()"></div>}<div [attr.id]="gridHelpId" [class]="srOnlyClass()">{{ gridHelpLabel() }}</div>@if (showsStatus()) {<div role="status" [class]="srOnlyClass()">{{ cursorLabel() }}</div>}@for (note of notes; track note.id) {<div role="button" tabindex="0" [attr.aria-label]="noteAria(note)" data-mol-id="piano-roll-note" [attr.data-note-id]="note.id" [attr.data-pitch]="note.pitch" [attr.data-start-beat]="note.startBeat" [attr.data-duration-beats]="note.durationBeats" [class]="noteClasses()" [style]="noteStyle(note)" (pointerdown)="beginDrag($event, note, 'move')" (contextmenu)="handleNoteContextMenu($event, note)"><div role="separator" [attr.aria-label]="resizeLabel()" data-mol-id="piano-roll-note-handle" [style]="handleStyle" (pointerdown)="beginDrag($event, note, 'resize')"></div></div>}</div>`,
200
+ })
201
+ export class PianoRoll implements OnInit, OnDestroy {
202
+ notes: MidiNote[] = []
203
+ pixelsPerBeat?: number
204
+ noteHeight?: number
205
+ lowestPitch?: number
206
+ highestPitch?: number
207
+ snap?: PianoRollSnap
208
+ beatsCount?: number
209
+ onNoteAdd?: PianoRollProps['onNoteAdd']
210
+ onNoteMove?: PianoRollProps['onNoteMove']
211
+ onNoteResize?: PianoRollProps['onNoteResize']
212
+ onNoteDelete?: PianoRollProps['onNoteDelete']
213
+ className?: string
214
+
215
+ @ViewChild('grid') gridRef?: ElementRef<HTMLDivElement>
216
+
217
+ readonly gridHelpId = `piano-roll-grid-help-${nextGridHelpId++}`
218
+
219
+ private readonly i18n = useTranslation()
220
+
221
+ private drag: DragState | null = null
222
+
223
+ private readonly rawCursor = signal({ beat: 0, pitch: 108 })
224
+
225
+ private readonly gridFocused = signal(false)
226
+
227
+ readonly rootStyle: Record<string, string> = {
228
+ display: 'flex',
229
+ 'align-items': 'stretch',
230
+ width: '100%',
231
+ overflow: 'auto',
232
+ position: 'relative',
233
+ }
234
+
235
+ readonly handleStyle: Record<string, string> = {
236
+ position: 'absolute',
237
+ top: '0px',
238
+ right: '0px',
239
+ bottom: '0px',
240
+ width: '6px',
241
+ cursor: 'ew-resize',
242
+ 'touch-action': 'none',
243
+ }
244
+
245
+ ngOnInit(): void {
246
+ this.rawCursor.set({ beat: 0, pitch: this.highestPitch ?? 108 })
247
+ window.addEventListener('pointermove', this.onMove)
248
+ window.addEventListener('pointerup', this.onUp)
249
+ window.addEventListener('pointercancel', this.onUp)
250
+ }
251
+
252
+ ngOnDestroy(): void {
253
+ window.removeEventListener('pointermove', this.onMove)
254
+ window.removeEventListener('pointerup', this.onUp)
255
+ window.removeEventListener('pointercancel', this.onUp)
256
+ }
257
+
258
+ cm(): UIClassMap {
259
+ return getClassMap()
260
+ }
261
+
262
+ classes(): string {
263
+ return this.cm().cn(this.className)
264
+ }
265
+
266
+ keyLabelClasses(): string {
267
+ return this.cm().cn(this.cm().textSize('xs'))
268
+ }
269
+
270
+ noteClasses(): string {
271
+ return this.cm().cn(this.cm().cursorPointer)
272
+ }
273
+
274
+ srOnlyClass(): string {
275
+ return this.cm().cn(this.cm().srOnly)
276
+ }
277
+
278
+ geometry(): Geometry {
279
+ const pixelsPerBeat = this.pixelsPerBeat ?? 80
280
+ const noteHeight = this.noteHeight ?? 20
281
+ const lowestPitch = this.lowestPitch ?? 21
282
+ const highestPitch = this.highestPitch ?? 108
283
+ const snap = this.snap ?? '1/16'
284
+ const safeHighest = Math.max(highestPitch, lowestPitch)
285
+ const safeLowest = Math.min(highestPitch, lowestPitch)
286
+ const rowCount = safeHighest - safeLowest + 1
287
+ const gridHeight = rowCount * noteHeight
288
+ const computedBeats =
289
+ this.beatsCount ??
290
+ Math.max(
291
+ 16,
292
+ Math.ceil(
293
+ this.notes.reduce(
294
+ (max, n) => Math.max(max, (n.startBeat ?? 0) + (n.durationBeats ?? 0)),
295
+ 0,
296
+ ) + 4,
297
+ ),
298
+ )
299
+ return {
300
+ pixelsPerBeat,
301
+ noteHeight,
302
+ snap,
303
+ safeHighest,
304
+ safeLowest,
305
+ rowCount,
306
+ gridHeight,
307
+ computedBeats,
308
+ }
309
+ }
310
+
311
+ cursor(): { beat: number; pitch: number } {
312
+ const grid = this.geometry()
313
+ const raw = this.rawCursor()
314
+ return {
315
+ beat: Math.max(0, Math.min(raw.beat, grid.computedBeats)),
316
+ pitch: Math.max(grid.safeLowest, Math.min(grid.safeHighest, raw.pitch)),
317
+ }
318
+ }
319
+
320
+ snapValue(): PianoRollSnap {
321
+ return this.snap ?? '1/16'
322
+ }
323
+
324
+ rows(): number[] {
325
+ const grid = this.geometry()
326
+ const list: number[] = []
327
+ for (let pitch = grid.safeHighest; pitch >= grid.safeLowest; pitch--) list.push(pitch)
328
+ return list
329
+ }
330
+
331
+ beatLines(): number[] {
332
+ return Array.from(
333
+ { length: Math.max(0, this.geometry().computedBeats) + 1 },
334
+ (_v, beat) => beat,
335
+ )
336
+ }
337
+
338
+ isC(pitch: number): boolean {
339
+ return ((pitch % 12) + 12) % 12 === 0
340
+ }
341
+
342
+ isBlackKey(pitch: number): boolean {
343
+ return isBlackKey(pitch)
344
+ }
345
+
346
+ pitchLabel(pitch: number): string {
347
+ return pitchLabel(pitch)
348
+ }
349
+
350
+ showsCursor(): boolean {
351
+ return !!this.onNoteAdd && this.gridFocused()
352
+ }
353
+
354
+ showsStatus(): boolean {
355
+ return !!this.onNoteAdd
356
+ }
357
+
358
+ setGridFocused(focused: boolean): void {
359
+ this.gridFocused.set(focused)
360
+ }
361
+
362
+ rollLabel(): string {
363
+ return this.i18n.t('pianoRoll.aria.roll', {}, { defaultValue: 'Piano roll' })
364
+ }
365
+
366
+ keysLabel(): string {
367
+ return this.i18n.t('pianoRoll.aria.keys', {}, { defaultValue: 'Piano keys' })
368
+ }
369
+
370
+ gridLabel(): string {
371
+ return this.i18n.t('pianoRoll.aria.grid', {}, { defaultValue: 'Note grid' })
372
+ }
373
+
374
+ gridHelpLabel(): string {
375
+ return this.i18n.t(
376
+ 'pianoRoll.aria.gridHelp',
377
+ {},
378
+ { defaultValue: 'The arrow keys move the cell cursor, Enter or Space paints a note at it.' },
379
+ )
380
+ }
381
+
382
+ resizeLabel(): string {
383
+ return this.i18n.t('pianoRoll.aria.resize', {}, { defaultValue: 'Resize note' })
384
+ }
385
+
386
+ cursorLabel(): string {
387
+ const cursor = this.cursor()
388
+ return this.i18n.t(
389
+ 'pianoRoll.aria.cursor',
390
+ { pitch: pitchLabel(cursor.pitch), beat: cursor.beat.toFixed(2) },
391
+ { defaultValue: 'Cursor on {{pitch}} at beat {{beat}}' },
392
+ )
393
+ }
394
+
395
+ noteAria(note: MidiNote): string {
396
+ return this.i18n.t(
397
+ 'pianoRoll.aria.note',
398
+ {
399
+ pitch: pitchLabel(note.pitch),
400
+ startBeat: note.startBeat.toFixed(2),
401
+ durationBeats: note.durationBeats.toFixed(2),
402
+ },
403
+ { defaultValue: 'Note {{pitch}} starting at beat {{startBeat}} for {{durationBeats}} beats' },
404
+ )
405
+ }
406
+ // … truncated — 14 more members: keysColumnStyle, keyStyle, rowStyle, lineStyle, cursorStyle, gridSurfaceStyle, noteStyle, paintNoteAt, handleGridClick, handleGridKeyDown, handleNoteContextMenu, beginDrag, onMove, onUp; the full declaration is in node_modules/@molecule/app-feature-piano-roll-angular/dist/piano-roll.component.d.ts
407
+ ```
408
+
409
+ _(Member comments are left out to fit; the full declaration is in `node_modules/@molecule/app-feature-piano-roll-angular/dist/piano-roll.component.d.ts`.)_
410
+
411
+ ### Functions
412
+
413
+ #### `snapToBeats(snap)`
414
+
415
+ Convert a snap setting to its size in beats.
416
+
417
+ ```typescript
418
+ function snapToBeats(snap: PianoRollSnap): number
419
+ ```
420
+
421
+ - `snap` — Snap resolution.
422
+
423
+ **Returns:** Snap step size in beats.
424
+
425
+ #### `snapBeat(beat, snap)`
426
+
427
+ Snap a beat value to the nearest multiple of the snap step (rounding down).
428
+
429
+ ```typescript
430
+ function snapBeat(beat: number, snap: PianoRollSnap): number
431
+ ```
432
+
433
+ - `beat` — Raw beat value (may be fractional).
434
+ - `snap` — Snap resolution.
435
+
436
+ **Returns:** The floored snapped beat (>= 0).
437
+
438
+ #### `snapBeatRound(beat, snap)`
439
+
440
+ Round a beat value to the nearest snap step.
441
+
442
+ ```typescript
443
+ function snapBeatRound(beat: number, snap: PianoRollSnap): number
444
+ ```
445
+
446
+ - `beat` — Raw beat value (may be fractional).
447
+ - `snap` — Snap resolution.
448
+
449
+ **Returns:** The rounded snapped beat (>= 0).
450
+
451
+ #### `pixelsToBeats(pixels, pixelsPerBeat)`
452
+
453
+ Convert a pixel offset into beats given the horizontal scale.
454
+
455
+ ```typescript
456
+ function pixelsToBeats(pixels: number, pixelsPerBeat: number): number
457
+ ```
458
+
459
+ - `pixels` — Offset in pixels.
460
+ - `pixelsPerBeat` — Horizontal scale.
461
+
462
+ **Returns:** Beats represented by the offset (may be negative).
463
+
464
+ #### `beatsToPixels(beats, pixelsPerBeat)`
465
+
466
+ Convert a beat value into pixels given the horizontal scale.
467
+
468
+ ```typescript
469
+ function beatsToPixels(beats: number, pixelsPerBeat: number): number
470
+ ```
471
+
472
+ - `beats` — Beat value.
473
+ - `pixelsPerBeat` — Horizontal scale.
474
+
475
+ **Returns:** Pixel offset.
476
+
477
+ #### `yToPitch(y, noteHeight, highestPitch, lowestPitch)`
478
+
479
+ Convert a vertical pixel offset into a MIDI pitch. Higher pitches sit at the
480
+ top, so `y = 0` maps to `highestPitch`.
481
+
482
+ ```typescript
483
+ function yToPitch(y: number, noteHeight: number, highestPitch: number, lowestPitch: number): number
484
+ ```
485
+
486
+ - `y` — Vertical pixel offset from the top of the grid.
487
+ - `noteHeight` — Row height per pitch.
488
+ - `highestPitch` — Top-most pitch in the visible range.
489
+ - `lowestPitch` — Bottom-most pitch in the visible range.
490
+
491
+ **Returns:** A MIDI pitch clamped into `[lowestPitch, highestPitch]`.
492
+
493
+ #### `pitchToY(pitch, noteHeight, highestPitch)`
494
+
495
+ Convert a MIDI pitch into the vertical pixel offset of its row.
496
+
497
+ ```typescript
498
+ function pitchToY(pitch: number, noteHeight: number, highestPitch: number): number
499
+ ```
500
+
501
+ - `pitch` — MIDI pitch number.
502
+ - `noteHeight` — Row height per pitch.
503
+ - `highestPitch` — Top-most pitch in the visible range.
504
+
505
+ **Returns:** Vertical pixel offset for the pitch's row.
506
+
507
+ #### `isBlackKey(pitch)`
508
+
509
+ Determine whether a MIDI pitch corresponds to a black key on a piano
510
+ keyboard.
511
+
512
+ ```typescript
513
+ function isBlackKey(pitch: number): boolean
514
+ ```
515
+
516
+ - `pitch` — MIDI pitch number.
517
+
518
+ **Returns:** `true` if the pitch is a black key.
519
+
520
+ #### `pitchLabel(pitch)`
521
+
522
+ Format a MIDI pitch as a scientific-pitch-notation label.
523
+
524
+ ```typescript
525
+ function pitchLabel(pitch: number): string
526
+ ```
527
+
528
+ - `pitch` — MIDI pitch number.
529
+
530
+ **Returns:** Formatted label.
531
+
532
+ ### Constants
533
+
534
+ #### `PIANO_KEYS_WIDTH_PX`
535
+
536
+ Pixel width of the leading piano-keys column.
4
537
 
538
+ ```typescript
539
+ const PIANO_KEYS_WIDTH_PX: 56
5
540
  ```
6
- npm install @molecule/app-feature-piano-roll-angular
541
+
542
+ #### `MIN_NOTE_DURATION_BEATS`
543
+
544
+ Minimum note duration in beats — notes can't be resized below this.
545
+
546
+ ```typescript
547
+ const MIN_NOTE_DURATION_BEATS: number
548
+ ```
549
+
550
+ #### `DRAG_DISTANCE_THRESHOLD_PX`
551
+
552
+ Pointer-distance threshold (px) before a press becomes a drag.
553
+
554
+ ```typescript
555
+ const DRAG_DISTANCE_THRESHOLD_PX: 3
556
+ ```
557
+
558
+ #### `DEFAULT_NOTE_VELOCITY`
559
+
560
+ Default MIDI velocity assigned to freshly-painted notes.
561
+
562
+ ```typescript
563
+ const DEFAULT_NOTE_VELOCITY: 96
7
564
  ```
8
565
 
9
- Part of the [Molecule](https://www.molecule.dev) package fleet. This page carries the manifest summary; the full generated documentation ships with the package's first committed version.
566
+ ## Injection Notes
567
+
568
+ ### Requirements
569
+
570
+ Peer dependencies:
571
+
572
+ - `@angular/common` ^22.0.0
573
+ - `@angular/core` ^22.0.0
574
+ - `@angular/platform-browser` ^22.0.0
575
+ - `@molecule/app-angular` ^3.5.0
576
+ - `@molecule/app-ui` ^1.0.1
577
+ - `@molecule/app-ui-angular` ^1.1.0
578
+
579
+ ### Runtime Dependencies
580
+
581
+ - `@angular/common`
582
+ - `@angular/core`
583
+ - `@angular/platform-browser`
584
+ - `@molecule/app-angular`
585
+ - `@molecule/app-ui`
586
+ - `@molecule/app-ui-angular`
587
+
588
+ - Requires a bonded ClassMap (`cm.cn`, `cm.cursorPointer`, …) — rendering
589
+ throws otherwise. No router dependency.
590
+ - The host IS React's root `<div>` (`div[mol-piano-roll]`).
591
+ - Every visible string comes from `useTranslation()` (`pianoRoll.aria.*`)
592
+ via the companion `@molecule/app-locales-feature-piano-roll` locale bond,
593
+ so a locale switch re-renders it.
594
+ - The grid is focusable and paints from the keyboard (arrow keys move the
595
+ cell cursor, Enter / Space paints), exactly as React's.
596
+
597
+ ## Translations
10
598
 
11
- License: Apache-2.0
599
+ Translation strings are provided by `@molecule/app-locales-feature-piano-roll`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-feature-piano-roll-angular",
3
- "version": "0.0.1-stage",
3
+ "version": "1.1.0",
4
4
  "description": "MIDI piano roll editor — note grid with vertical piano keys + horizontal time grid + draggable/resizable note rectangles for music-daw",
5
5
  "homepage": "https://www.molecule.dev/packages/app-feature-piano-roll-angular",
6
6
  "type": "module",
@@ -59,12 +59,12 @@
59
59
  "@angular/compiler-cli": "22.2.3",
60
60
  "@angular/core": "22.2.3",
61
61
  "@angular/platform-browser": "22.2.3",
62
- "@molecule/app-angular": "3.7.2",
62
+ "@molecule/app-angular": "3.9.0",
63
63
  "@molecule/app-framework-conformance": "0.0.0",
64
64
  "@molecule/app-i18n": "1.2.2",
65
65
  "@molecule/app-icons": "1.0.4",
66
- "@molecule/app-ui": "1.4.0",
67
- "@molecule/app-ui-angular": "1.2.1",
66
+ "@molecule/app-ui": "1.5.0",
67
+ "@molecule/app-ui-angular": "1.3.1",
68
68
  "@types/node": "26.6.5",
69
69
  "jsdom": "30.1.3",
70
70
  "rxjs": "7.8.2",