plantasia.space-design 0.89.0 → 0.89.2

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/dist/button.d.ts CHANGED
@@ -4,8 +4,8 @@ import { VariantProps } from 'class-variance-authority';
4
4
  import { ContentFit, GroupFit } from './content-fit.js';
5
5
 
6
6
  declare const buttonVariants: (props?: ({
7
- variant?: "default" | "link" | "destructive" | "destructiveFilled" | "success" | "successOutlined" | "outline" | "outlineAccent" | "secondary" | "ghost" | "ghostToggle" | null | undefined;
8
- size?: "default" | "sm" | "lg" | "icon" | null | undefined;
7
+ variant?: "link" | "default" | "destructive" | "destructiveFilled" | "success" | "successOutlined" | "outline" | "outlineAccent" | "secondary" | "ghost" | "ghostToggle" | null | undefined;
8
+ size?: "default" | "icon" | "sm" | "lg" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  declare function Button({ className, variant, size, fit, asChild, children, ...props }: Omit<React.ComponentProps<'button'>, 'size'> & VariantProps<typeof buttonVariants> & {
11
11
  asChild?: boolean;
@@ -16,6 +16,10 @@ import {
16
16
  insertLaneShape,
17
17
  shapeRange
18
18
  } from "./chunk-2MHM3HQ3.js";
19
+ import {
20
+ TIME_STEP_LADDER_SEC,
21
+ chooseLabelStep
22
+ } from "./chunk-2RVUGZGV.js";
19
23
  import {
20
24
  CLIP_MAX_BEATS,
21
25
  DEFAULT_CHANCE,
@@ -128,6 +132,13 @@ var EDIT_ACTIONS = [
128
132
  ];
129
133
  var LANES = [["velocity", "Velocity"], ["release", "Release"], ["chance", "Chance"]];
130
134
  var near = (a, b) => Math.abs(a - b) < 1e-6;
135
+ var barLadder = (beatsPerBar) => {
136
+ const bpb = Math.max(1, Math.round(beatsPerBar));
137
+ const out = [];
138
+ for (let d = 1; d < bpb; d += 1) if (bpb % d === 0) out.push(d);
139
+ for (let bars = 1; bars <= 1024; bars *= 2) out.push(bars * bpb);
140
+ return out;
141
+ };
131
142
  var clock = (s) => `${Math.floor(s / 60)}:${String(Math.floor(s % 60)).padStart(2, "0")}`;
132
143
  var MUTED_INK = "color-mix(in oklab, var(--foreground) 45%, transparent)";
133
144
  var IS_MAC = typeof navigator !== "undefined" && /Mac|iP(hone|ad|od)/.test(navigator.platform);
@@ -904,15 +915,15 @@ function PianoRoll(props) {
904
915
  const beat = near(b, Math.round(b));
905
916
  lines.push([b, bar ? 2 : beat ? 1 : 0]);
906
917
  }
907
- const ppb = gridW / view;
908
- const barStep = [1, 2, 4, 8, 16].find((x) => x * ppb >= 44) ?? 16;
918
+ const ppb = Math.max(1, gridW) / view;
919
+ const barStep = chooseLabelStep(ppb, barLadder(beatsPerBar), 44);
909
920
  const barLabels = [];
910
921
  for (let b = Math.ceil(origin / barStep) * barStep; b <= origin + view + 1e-6; b += barStep) {
911
922
  const strong = near(b % beatsPerBar, 0);
912
923
  barLabels.push({ b, strong, text: strong ? String(b / beatsPerBar + 1) : `${Math.floor(b / beatsPerBar) + 1}.${Math.floor(b % beatsPerBar) + 1}` });
913
924
  }
914
- const pps = gridW / (view * spb);
915
- const timeStep = [0.5, 1, 2, 5, 10, 15, 30].find((x) => x * pps >= 72) ?? 30;
925
+ const pps = Math.max(1, gridW) / (view * spb);
926
+ const timeStep = chooseLabelStep(pps, TIME_STEP_LADDER_SEC, 72);
916
927
  const timeLabels = [];
917
928
  for (let t = Math.ceil(origin * spb / timeStep) * timeStep; t <= (origin + view) * spb + 1e-6; t += timeStep) timeLabels.push(t);
918
929
  const visible = notes.filter((n) => n.start + n.length > origin && n.start < origin + view && rowOf.has(n.pitch));
@@ -1515,4 +1526,4 @@ function PianoRoll(props) {
1515
1526
  export {
1516
1527
  PianoRoll
1517
1528
  };
1518
- //# sourceMappingURL=chunk-OC2RDICA.js.map
1529
+ //# sourceMappingURL=chunk-DMULVPDE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/react/timeline/components/piano-roll.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from 'react'\n\nimport { cn } from '../../utils'\nimport { ActionButtonGroup, type ActionOption } from '../../action-button-group'\nimport { SurfaceTitle, TabButton, surfaceCaptionNode, surfaceTitleGroup, type SurfaceOption, type SurfacePick } from './surface-title'\nimport { FoldRow } from './fold-row'\nimport { Param } from '../../arrow/arrow-param'\nimport { colorSlots, startWindowDrag, makeDoublePress, type StopDrag } from '../../arrow/arrow-shared'\nimport { isInteractive, type ArrowGateProps } from '../../arrow/types'\nimport { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuTrigger } from '../../context-menu'\nimport { Icon } from '../../icons/Icon'\nimport {\n AutomationLane,\n AutomationShapeMenu,\n inSelection,\n EMPTY_AUTOMATION_LANE,\n insertLaneShape,\n shapeRange,\n type AutomationControl,\n type AutomationLaneValue,\n} from './automation-lane'\nimport { SNAP_PRESETS, quantizeStepBeats, type QuantizeGridId } from '../quantize'\nimport { chooseLabelStep, TIME_STEP_LADDER_SEC } from '../nice-step'\nimport {\n applyNoteAction,\n barBeatSixteenth,\n barsBeatsLength,\n clampPitch,\n clipExtent,\n duplicateAfter,\n editTargets,\n inScale,\n isBlackKey,\n laneRange,\n laneValue,\n moveNotes,\n newNoteId,\n noteName,\n pasteAt,\n toggleMute,\n type KeyName,\n visibleRows,\n CLIP_MAX_BEATS,\n DEFAULT_CHANCE,\n DEFAULT_RELEASE,\n type ClipLoop,\n type ClipNote,\n type NoteAction,\n type NoteLaneField,\n type NotesChangeReason,\n} from '../note-model'\n\n// ─────────────────────────────────────────────────────────────────────────────\n// PianoRoll — the note editor of Arrow Controls Spec 03 (Claude Design \"Piano Roll Editor\"). Notes in\n// beats with free start and length, a velocity / release / chance lane, the clip loop, and an\n// Envelopes tab that edits automation lanes (AutomationLane). GUI only: the host owns the transport\n// (it passes the position), the scale, loop on / off, the sound (onAudition) and what the lanes\n// drive. Controlled: notes, loop and lanes change live and commit once per gesture.\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type PianoRollTab = 'notes' | 'envelopes'\n\n/**\n * What the editor automates over when it isn't notes (a track's audio). Its first tab, labelled\n * `label`, is the same editor as Notes, with the same zoom, loop and seek rows, but `body` in place\n * of the note grid (drawn for the beats in view) and `toolbar` in place of the note tools. On\n * Envelopes, `backdrop` draws the same window under the lane, dimmed and read only.\n */\nexport interface PianoRollSource {\n label: string\n body: (window: { from: number; to: number }) => React.ReactNode\n toolbar?: React.ReactNode\n backdrop?: (window: { from: number; to: number }) => React.ReactNode\n}\nexport type PianoRollMode = 'draw' | 'select'\n\n/** The lane bar's height: one rail. */\nconst LANE_BAR_H = 44\n/** The notes tab's selection bar, px, and the room under it. */\nconst SELECTION_BAR_H = 52\nconst SELECTION_BAR_GAP = 4\n/** One rail of tools: the least it is; a rail that wraps (a host's second row) adds its own height. */\nconst TOOL_RAIL_H = 44\n/** The note lane when open, its picker included: one row. */\nconst LANE_H = 48\n/** The least grid a host's height may leave: four rows of a phone's roll, a short box's last resort. */\nconst GRID_FLOOR = 48\n/** The width the ruler's zoom mark covers at its left end (its box: the icon and its padding), px. */\nconst ZOOM_MARK_W = 24\n\nexport interface PianoRollProps extends ArrowGateProps {\n notes: ClipNote[]\n /** Live during a gesture. */\n onNotesChange?: (notes: ClipNote[], reason: NotesChangeReason) => void\n /** Once per gesture or action. */\n onNotesCommit?: (notes: ClipNote[], reason: NotesChangeReason) => void\n /** The clip loop, in beats. The piano roll owns it; the host plays it. */\n loop: ClipLoop\n onLoopChange?: (loop: ClipLoop) => void\n onLoopCommit?: (loop: ClipLoop) => void\n /** The timeline's length in beats when it runs past the clip and its loop (a track's): it scrolls to there. */\n length?: number\n /** Loop on / off is the host's: the band dims when off, and a tap on it asks to toggle. */\n loopActive?: boolean\n onLoopToggle?: () => void\n /** The transport position in beats (the playhead); null hides it. */\n position?: number | null\n /**\n * The transport position, read once per animation frame while `playing` (every 100 ms while not):\n * the playhead and the sounding notes follow it without re-rendering the editor, so the host never\n * has to render it for the position. Takes over from `position` when given.\n */\n readPosition?: () => number | null\n /** The transport runs: the notes under the playhead show as sounding. */\n playing?: boolean\n /** Click the loop row (or drag the playhead knob): seek intent, in beats. */\n onSeek?: (beat: number) => void\n /** What a key is called where the host says otherwise (a kit's \"Snare\"); null or absent: its note name. */\n keyNames?: (pitch: number) => KeyName | null\n /** A kit's keys: Fold shows them with the notes in use, and the roll opens folded while there are any. */\n kitKeys?: readonly number[]\n /** The host's scale: out-of-scale rows darken. Null: plain piano rows. */\n scale?: { root: number; intervals: readonly number[] } | null\n /** Beats per bar (default 4). */\n beatsPerBar?: number\n /** Tempo, for the clock row's labels and the zoom caption (default 120). */\n bpm?: number\n /** Controlled selection (note ids). Uncontrolled when absent. */\n selection?: string[]\n onSelectionChange?: (ids: string[]) => void\n /** A key tap or a note press: the host plays the sound. */\n onAudition?: (pitch: number, velocity: number, on: boolean) => void\n /** Ids for new notes (default a session-unique id). */\n makeNoteId?: () => string\n\n /** In place of the notes: another source the Envelopes tab automates over (a track's audio). */\n source?: PianoRollSource\n /** What the Envelopes tab can automate. None: the tab is hidden. */\n automationControls?: AutomationControl[]\n /** The lanes, by control id. */\n automation?: Record<string, AutomationLaneValue | undefined>\n onAutomationChange?: (controlId: string, lane: AutomationLaneValue) => void\n onAutomationCommit?: (controlId: string, lane: AutomationLaneValue) => void\n /** The control shown on Envelopes (uncontrolled when absent). */\n automationTarget?: string\n onAutomationTargetChange?: (controlId: string) => void\n /**\n * What is armed to record when the host's REC is on: Notes (what is played goes into the clip) and\n * Envelopes (the lane of every control a hand moves, several at once, each from its first move to\n * the take's end). An arm only marks a target; the host records, and draws its Arm (ModuleArmButton)\n * in the title row's left corner (`headStart`), as every module's beside its power.\n */\n armed?: { notes?: boolean; envelopes?: boolean }\n /** The host's REC is on: an armed tab records while the transport plays. */\n recording?: boolean\n /** The host's controls in the title row's left corner (its Arm), never folded. */\n headStart?: React.ReactNode\n /** The lanes the take is writing now (control ids): shown as recording. */\n recordingControls?: readonly string[]\n /** The tab shown (uncontrolled when absent). */\n tab?: PianoRollTab\n onTabChange?: (tab: PianoRollTab) => void\n /**\n * The host's input surfaces (this roll among them): the shown one is the block's title at the left of\n * its first row, a dropdown of the others when there are more; the roll's own views (Notes ·\n * Envelopes) sit at the row's right. The host swaps the editor on `onChange`.\n */\n surfaces?: SurfacePick\n /**\n * What the roll edits, in the host's words (\"World I · Lead\"): centred in the first row as its name\n * (SurfaceCaption), cut short with an ellipsis when the row runs out of room.\n */\n caption?: string\n /** The caption's icon in place of its dot (the body's glyph), 14 px. */\n captionIcon?: React.ReactNode\n /**\n * The host's own controls at the toolbar's right end, after the edit tools (a fold for a panel the\n * host shows with the roll), on every tab. Not over a `source`: its toolbar is the host's already.\n */\n toolbarEnd?: React.ReactNode\n\n defaultTab?: PianoRollTab\n defaultMode?: PianoRollMode\n defaultGrid?: QuantizeGridId\n defaultLane?: NoteLaneField\n /** Phone layout: taller rows, fewer of them, two bars in view, Start / Length on their own row.\n * 'auto' (default) follows the editor's own width. */\n compact?: boolean | 'auto'\n /**\n * The note grid's height in px (the keys beside it, and the Envelopes lane, follow). Default 352 in\n * the phone layout, 288 otherwise; a host with less room passes what it has (never below 48).\n */\n gridHeight?: number\n /** 'active; grid; dim' colour tokens. Active defaults to the ring colour; time chrome stays primary. */\n colors?: string\n /**\n * The surface level, as Panel's: \"solid\" (opaque, default), \"frosted\", \"glass\" or \"clear\" over a\n * live stage. Below solid the frame, the grid's rows and the bars let what is behind show through.\n */\n surface?: 'solid' | 'frosted' | 'glass' | 'clear'\n className?: string\n style?: React.CSSProperties\n}\n\n// Glyphs: Lucide-style paths at stroke 1.2, as drawn in the design.\nconst IC = {\n lanes: 'M3 20h18M6 20v-8M10 20v-12M14 20v-6M18 20v-10',\n draw: 'M17 3a2.85 2.85 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z',\n select: 'M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z',\n magnet: 'M6 15l-4-4 6.75-6.77a7.79 7.79 0 0 1 11 11L13 22l-4-4 6.39-6.36a2.14 2.14 0 0 0-3-3L6 15M5 8l4 4M12 15l4 4',\n fold: 'M12 22v-6M12 8V2M4 12H2M10 12H8M16 12h-2M22 12h-2M15 19l-3-3-3 3M15 5l-3 3-3-3',\n eye: 'M2 12s3-7 10-7 10 7 10 7-3 7-10 7S2 12 2 12zM12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6z',\n wand: 'M15 4V2M15 16v-2M8 9h2M20 9h2M17.8 11.8L19 13M17.8 6.2L19 5M3 21l9-9M12.2 6.2L11 5',\n up: 'M12 19V5M5 12l7-7 7 7',\n down: 'M12 5v14M19 12l-7 7-7-7',\n quantize: 'M3 3h18v18H3zM3 9h18M3 15h18M9 3v18M15 3v18',\n legato: 'M4 12h16M4 8v8M20 8v8',\n reverse: 'M8 3L4 7l4 4M4 7h16M16 21l4-4-4-4M20 17H4',\n invert: 'M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3M21 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3M4 12H2M10 12H8M16 12h-2M22 12h-2',\n dice: 'M4 4h16v16H4zM8.5 8.5h.01M15.5 15.5h.01M12 12h.01M15.5 8.5h.01M8.5 15.5h.01',\n trash: 'M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6M10 11v6M14 11v6',\n dup: 'M8 8h12v12H8zM4 16V4h12',\n close: 'M18 6L6 18M6 6l12 12',\n spline: 'M3 17c3-9 6-9 9-3s6 6 9-5',\n line: 'M3 18L9 8l6 6 6-9',\n step: 'M3 18h5v-7h6v-5h7',\n eraser: 'M7 21l-4.3-4.3a2.4 2.4 0 0 1 0-3.4l9.6-9.6a2.4 2.4 0 0 1 3.4 0l5.6 5.6a2.4 2.4 0 0 1 0 3.4L13 21M22 21H7M5 11l9 9',\n link: 'M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71',\n shape: 'M2 12c2.5-7 5-7 7.5 0s5 7 7.5 0 3.5-4 5-3',\n clear: 'M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6',\n}\n\nfunction Glyph({ d, size = 18 }: { d: string; size?: number }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.2} strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden style={{ display: 'block' }}>\n <path d={d} />\n </svg>\n )\n}\n\nconst EDIT_ACTIONS: ReadonlyArray<readonly [NoteAction | 'delete' | 'dup' | 'mute', string, string, string?]> = [\n ['delete', 'Delete', 'Delete the selected notes (Delete key, or double-tap a note)'],\n ['dup', 'Duplicate', 'Duplicate the selection after itself (Cmd / Ctrl + D)'],\n ['mute', 'Mute', 'Mute or unmute the selected notes (0)'],\n ['up', 'Up', 'Transpose up a semitone (Up arrow)'],\n ['down', 'Down', 'Transpose down a semitone (Down arrow)'],\n ['quantize', 'Quantize', 'Move starts onto the grid (Cmd / Ctrl + U)'],\n ['legato', 'Legato', 'Stretch each note to the next'],\n ['reverse', 'Reverse', 'Play backwards in time'],\n ['invert', 'Invert', 'Flip pitches upside down'],\n ['x2', 'Longer', 'Twice as long', '×2'],\n ['half', 'Shorter', 'Half as long', '÷2'],\n ['humanize', 'Randomize', 'Randomize velocity a little'],\n]\n\nconst LANES: ReadonlyArray<readonly [NoteLaneField, string]> = [['velocity', 'Velocity'], ['release', 'Release'], ['chance', 'Chance']]\nconst near = (a: number, b: number) => Math.abs(a - b) < 1e-6\n/** Beat steps for the bar.beat ruler: the beats that divide a bar, then 1, 2, 4… bars. */\nconst barLadder = (beatsPerBar: number): number[] => {\n const bpb = Math.max(1, Math.round(beatsPerBar))\n const out: number[] = []\n for (let d = 1; d < bpb; d += 1) if (bpb % d === 0) out.push(d)\n for (let bars = 1; bars <= 1024; bars *= 2) out.push(bars * bpb)\n return out\n}\nconst clock = (s: number) => `${Math.floor(s / 60)}:${String(Math.floor(s % 60)).padStart(2, '0')}`\nconst MUTED_INK = 'color-mix(in oklab, var(--foreground) 45%, transparent)'\nconst IS_MAC = typeof navigator !== 'undefined' && /Mac|iP(hone|ad|od)/.test(navigator.platform)\nconst MOD = IS_MAC ? '⌘' : 'Ctrl '\n/** A glyph as a cursor: a light halo under a dark stroke, so it reads on either theme. */\nconst glyphCursor = (d: string, x: number, y: number, fallback: string) =>\n `url(\"data:image/svg+xml,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke-linecap='round' stroke-linejoin='round'><path d='${d}' stroke='white' stroke-width='4'/><path d='${d}' stroke='black' stroke-width='1.6'/></svg>`)}\") ${x} ${y}, ${fallback}`\nconst PENCIL_CURSOR = glyphCursor(IC.draw, 2, 20, 'crosshair')\nconst ERASER_CURSOR = glyphCursor(IC.eraser, 4, 17, 'pointer')\n/** A note's edge, in px, that a press grabs to change its length. */\nconst EDGE_PX = 6\n/** Room above and below the lane's arrows, so the top and bottom values stay whole. */\nconst LANE_PAD = 6\n\n/**\n * A horizontal scrollbar for the time window: the thumb is the view's share of the clip. Drag it to\n * pan; press the track to jump there and keep dragging. For a pointer with no sideways wheel (a mouse,\n * a phone), where Shift + wheel or a trackpad swipe isn't at hand. Hidden when everything fits.\n */\nfunction TimeScrollbar({ origin, view, extent, onPan }: { origin: number; view: number; extent: number; onPan: (origin: number) => void }) {\n const trackRef = React.useRef<HTMLDivElement>(null)\n const dragRef = React.useRef<StopDrag | null>(null)\n React.useEffect(() => () => dragRef.current?.(), [])\n if (view >= extent - 1e-6) return null\n const thumb = Math.max(0.04, view / extent)\n const at = origin / extent\n const down = (e: React.PointerEvent<HTMLDivElement>) => {\n const el = trackRef.current\n if (!el || e.button !== 0) return\n e.preventDefault()\n const r = el.getBoundingClientRect()\n const onThumb = e.clientX - r.left >= at * r.width && e.clientX - r.left <= (at + thumb) * r.width\n const grab = onThumb ? (e.clientX - r.left) / r.width - at : thumb / 2\n const pan = (clientX: number) => onPan(Math.max(0, Math.min(extent - view, ((clientX - r.left) / r.width - grab) * extent)))\n if (!onThumb) pan(e.clientX)\n dragRef.current?.()\n dragRef.current = startWindowDrag((ev) => pan(ev.clientX), () => { dragRef.current = null }, e.pointerId)\n }\n return (\n <div ref={trackRef} data-slot=\"piano-roll-scrollbar\" role=\"scrollbar\" aria-orientation=\"horizontal\" aria-valuemin={0} aria-valuemax={Math.round(extent - view)} aria-valuenow={Math.round(origin)} onPointerDown={down} style={{ position: 'relative', height: 10, marginTop: 4, touchAction: 'none', cursor: 'pointer', background: 'color-mix(in oklab, var(--foreground) 4%, transparent)' }}>\n <span aria-hidden style={{ position: 'absolute', top: 2, bottom: 2, left: `${at * 100}%`, width: `${thumb * 100}%`, background: 'color-mix(in oklab, var(--foreground) 28%, transparent)', cursor: 'grab' }} />\n </div>\n )\n}\n\n/**\n * PianoRoll — see the file header. Two tools, B switches them. Select (the default): a double-click\n * on empty space adds a note one grid step long (keep dragging for its length), a drag there is a\n * marquee (Shift adds) and a click leaves the insert point Paste uses; on a note, a click selects\n * (Shift toggles), a drag moves the selection in time and pitch, Alt-drag duplicates, a double-click\n * deletes. Draw: a press on empty space draws a note (drag for its length), a press on a note\n * removes it. In both, either edge of a note drags its length, and the cursor shows which of these a\n * press would do. Cmd / Ctrl places freely. Keys: arrows move (Shift: octave up / down, length left\n * / right; Alt: a bar left / right), Delete, 0 mutes, Cmd / Ctrl + A / C / X / V / D / U, Esc clears. A right-click opens\n * the same edits as a menu.\n */\nexport function PianoRoll(props: PianoRollProps) {\n const {\n notes,\n onNotesChange,\n onNotesCommit,\n loop,\n onLoopChange,\n onLoopCommit,\n loopActive = true,\n length = 0,\n onLoopToggle,\n position = null,\n playing = false,\n onSeek,\n scale = null,\n keyNames,\n kitKeys,\n beatsPerBar = 4,\n bpm = 120,\n onAudition,\n makeNoteId = newNoteId,\n automationControls,\n automation,\n source,\n onAutomationChange,\n onAutomationCommit,\n armed,\n recording = false,\n recordingControls,\n onTabChange,\n headStart,\n defaultTab = 'notes',\n defaultMode = 'select',\n defaultGrid = '1/16',\n defaultLane = 'velocity',\n compact: compactProp = 'auto',\n gridHeight,\n surfaces: surfacePick,\n caption,\n captionIcon,\n toolbarEnd,\n colors,\n surface = 'solid',\n readOnly,\n disabled,\n locked,\n className,\n style,\n } = props\n const solid = surface === 'solid'\n /** A fill over the surface: opaque on a solid one, see-through otherwise. */\n const over = (percent: number) => `color-mix(in oklab, var(--foreground) ${percent}%, ${solid ? 'var(--background)' : 'transparent'})`\n const live = isInteractive({ readOnly, disabled, locked })\n const [activeSlot] = colorSlots(colors, ['var(--ring)'])\n const ink = disabled ? 'color-mix(in oklab, var(--foreground) 32%, var(--background))' : activeSlot\n const spb = 60 / Math.max(1, bpm)\n\n // ── size: the editor measures itself, not the screen ──────────────────────\n const rootRef = React.useRef<HTMLDivElement>(null)\n const gridRef = React.useRef<HTMLDivElement>(null)\n const laneRef = React.useRef<HTMLDivElement>(null)\n const [width, setWidth] = React.useState(960)\n React.useLayoutEffect(() => {\n const el = rootRef.current\n if (!el || typeof ResizeObserver === 'undefined') return\n setWidth(el.getBoundingClientRect().width || 960)\n const ro = new ResizeObserver((entries) => setWidth(entries[0]?.contentRect.width || el.getBoundingClientRect().width))\n ro.observe(el)\n return () => ro.disconnect()\n }, [])\n const compact = compactProp === 'auto' ? width < 560 : compactProp\n\n // ── view state ────────────────────────────────────────────────────────────\n const [tabState, setTabState] = React.useState<PianoRollTab>(defaultTab)\n const tab = props.tab ?? tabState\n const setTab = (next: PianoRollTab) => {\n if (props.tab === undefined) setTabState(next)\n onTabChange?.(next)\n }\n const [mode, setMode] = React.useState<PianoRollMode>(defaultMode)\n const [grid, setGrid] = React.useState<QuantizeGridId>(defaultGrid)\n const kit = (kitKeys?.length ?? 0) > 0\n const [fold, setFold] = React.useState(kit)\n // A kit arriving or leaving (the instrument changed) folds or unfolds the roll, in the same render:\n // no frame of the other rows first. While it stays, the player's Fold is left alone.\n const [foldedFor, setFoldedFor] = React.useState(kit)\n if (foldedFor !== kit) {\n setFoldedFor(kit)\n setFold(kit)\n }\n const nameOf = (pitch: number) => keyNames?.(pitch)?.name ?? noteName(pitch)\n const [lane, setLane] = React.useState<NoteLaneField>(defaultLane)\n // The note lane (velocity, release, chance) shows only when asked for: the grid keeps the room.\n const [lanesOpen, setLanesOpen] = React.useState(false)\n const [zoom, setZoom] = React.useState<[number, number]>(() => (compactProp === true ? [55, 71] : [50, 73]))\n const [origin, setOrigin] = React.useState(0)\n const [view, setView] = React.useState(() => (compactProp === true ? 8 : 16))\n const [selState, setSelState] = React.useState<string[]>([])\n const selection = props.selection ?? selState\n const setSelection = React.useCallback((ids: string[]) => {\n if (props.selection === undefined) setSelState(ids)\n props.onSelectionChange?.(ids)\n }, [props.selection, props.onSelectionChange]) // eslint-disable-line react-hooks/exhaustive-deps\n const [band, setBand] = React.useState<{ x0: number; x1: number; y0: number; y1: number } | null>(null)\n const [ghost, setGhostState] = React.useState<ClipNote[] | null>(null)\n const ghostRef = React.useRef<ClipNote[] | null>(null)\n const setGhost = (g: ClipNote[] | null) => {\n ghostRef.current = g\n setGhostState(g)\n }\n const [heard, setHeard] = React.useState<number | null>(null)\n const [status, setStatusText] = React.useState<string | null>(null)\n // A tick with every message, so the same words twice are said twice (to a screen reader).\n const [statusTick, setStatusTick] = React.useState(0)\n const setStatus = React.useCallback((next: string | null) => {\n setStatusText(next)\n if (next != null) setStatusTick((t) => t + 1)\n }, [])\n const [targetState, setTargetState] = React.useState<string | undefined>(undefined)\n const [envDraw, setEnvDraw] = React.useState(false)\n const [envRange, setEnvRange] = React.useState<{ from: number; to: number } | null>(null)\n const [shapeMenu, setShapeMenu] = React.useState<null | 'bar' | { x: number; y: number }>(null)\n const [shapeCycles, setShapeCycles] = React.useState(1)\n\n // A phone layout chosen by width starts closer in, once (a track's timeline keeps its whole length).\n const compactSeen = React.useRef(false)\n React.useEffect(() => {\n if (compactProp !== 'auto' || compactSeen.current || !compact) return\n compactSeen.current = true\n setZoom([55, 71])\n setView((v) => (length > 0 ? v : Math.min(v, 8)))\n }, [compact, compactProp]) // eslint-disable-line react-hooks/exhaustive-deps\n\n // The clip's extent grows with the loop and the notes; it never shrinks on its own, except that a new\n // timeline length (another track, or the real one once it loads) starts it over.\n const extentFloor = React.useRef(0)\n const lengthSeen = React.useRef(length)\n if (lengthSeen.current !== length) {\n lengthSeen.current = length\n extentFloor.current = 0\n }\n const extent = Math.max(extentFloor.current, clipExtent(notes, loop, beatsPerBar), length)\n extentFloor.current = extent\n const fitView = () => {\n setOrigin(0)\n setView(extent)\n }\n\n // A track's timeline opens on the whole of it, zoomed out, and again whenever its length changes (it\n // may arrive after the editor, or the track change under it). Before paint, so it never shows closer.\n React.useLayoutEffect(() => {\n if (length > 0) fitView()\n }, [length]) // eslint-disable-line react-hooks/exhaustive-deps\n\n const controls = automationControls ?? []\n const hasEnvelopes = controls.length > 0\n const isEnv = hasEnvelopes && tab === 'envelopes'\n const target = controls.find((c) => c.id === (props.automationTarget ?? targetState)) ?? controls[0]\n const setTarget = (id: string) => {\n if (props.automationTarget === undefined) setTargetState(id)\n props.onAutomationTargetChange?.(id)\n }\n const targetLane: AutomationLaneValue = (target && automation?.[target.id]) || { ...EMPTY_AUTOMATION_LANE, shape: target?.binary ? 'step' : 'line' }\n\n // ── grid ──────────────────────────────────────────────────────────────────\n const [gridW, setGridW] = React.useState(800)\n React.useLayoutEffect(() => {\n const el = gridRef.current\n if (!el || typeof ResizeObserver === 'undefined') return\n const ro = new ResizeObserver((entries) => setGridW(entries[0]?.contentRect.width || 800))\n ro.observe(el)\n return () => ro.disconnect()\n }, [isEnv])\n const stepBeats = React.useMemo((): number | null => {\n if (grid === 'none') return null\n if (grid === 'auto') {\n const ppb = gridW / view\n return [0.125, 0.25, 0.5, 1, 2, 4].find((x) => x * ppb >= 18) ?? 4\n }\n return quantizeStepBeats(grid, beatsPerBar)\n }, [grid, gridW, view, beatsPerBar])\n const snapD = (d: number, free: boolean) => (!stepBeats || free ? d : Math.round(d / stepBeats) * stepBeats)\n\n const rows = React.useMemo(() => visibleRows(notes, zoom, fold, kitKeys), [notes, zoom, fold, kitKeys])\n const rowOf = React.useMemo(() => new Map(rows.map((p, i) => [p, i])), [rows])\n const R = rows.length\n const rowH = 100 / R\n const pc = (b: number) => ((b - origin) / view) * 100\n\n const zoomAbout = React.useCallback((factor: number, frac: number) => {\n setView((v) => {\n const next = Math.max(1, Math.min(extent, v * factor))\n setOrigin((o) => Math.max(0, Math.min(extent - next, o + frac * v - frac * next)))\n return next\n })\n }, [extent])\n const scrollPitch = (d: number) => setZoom(([lo, hi]) => (lo + d < 0 || hi + d > 127 ? [lo, hi] : [lo + d, hi + d]))\n\n // Wheel on the grid: Ctrl / Alt / Cmd zooms time, Shift (or a sideways swipe) pans, plain scrolls pitch.\n const wheelAcc = React.useRef(0)\n const viewRef = React.useRef({ origin, view, extent })\n viewRef.current = { origin, view, extent }\n React.useEffect(() => {\n const el = gridRef.current\n if (!el) return\n const onWheel = (e: WheelEvent) => {\n const r = el.getBoundingClientRect()\n e.preventDefault()\n const v = viewRef.current\n if (e.ctrlKey || e.metaKey || e.altKey) zoomAbout(Math.exp(e.deltaY * 0.0015), (e.clientX - r.left) / r.width)\n else if (e.shiftKey || Math.abs(e.deltaX) > Math.abs(e.deltaY)) {\n const d = ((e.deltaX || e.deltaY) / r.width) * v.view\n setOrigin((o) => Math.max(0, Math.min(v.extent - v.view, o + d)))\n } else {\n wheelAcc.current += e.deltaY\n if (Math.abs(wheelAcc.current) > 30) {\n scrollPitch(wheelAcc.current > 0 ? -1 : 1)\n wheelAcc.current = 0\n }\n }\n }\n el.addEventListener('wheel', onWheel, { passive: false })\n return () => el.removeEventListener('wheel', onWheel)\n }, [zoomAbout, isEnv])\n\n // ── edits ─────────────────────────────────────────────────────────────────\n const dragRef = React.useRef<StopDrag | null>(null)\n React.useEffect(() => () => dragRef.current?.(), [])\n const follow = (e: React.PointerEvent, move: (ev: PointerEvent) => void, end?: (ev: PointerEvent | null) => void) => {\n dragRef.current?.()\n dragRef.current = startWindowDrag(move, (ev) => {\n dragRef.current = null\n end?.(ev)\n }, e.pointerId)\n }\n const change = (next: ClipNote[], reason: NotesChangeReason) => onNotesChange?.(next, reason)\n const commit = (next: ClipNote[], reason: NotesChangeReason) => {\n onNotesChange?.(next, reason)\n onNotesCommit?.(next, reason)\n }\n // The key being heard, in a ref: a gesture's handlers outlive the render they were made in, and\n // the off has to name the key the last on struck, or that note never ends.\n const heardRef = React.useRef<number | null>(null)\n const audition = (pitch: number | null, velocity = 100) => {\n const was = heardRef.current\n if (was === pitch) return\n if (was != null) onAudition?.(was, velocity, false)\n if (pitch != null) onAudition?.(pitch, velocity, true)\n heardRef.current = pitch\n setHeard(pitch)\n }\n // Leaving (or a gate closing mid-gesture) ends whatever is still heard.\n const onAuditionRef = React.useRef(onAudition)\n onAuditionRef.current = onAudition\n React.useEffect(() => () => {\n if (heardRef.current != null) onAuditionRef.current?.(heardRef.current, 0, false)\n }, [])\n const doublePress = React.useMemo(() => makeDoublePress(320), [])\n\n // What a press at a point would grab: a note (topmost first) and which part of it.\n const hitAt = (clientX: number, clientY: number) => {\n const r = gridRef.current!.getBoundingClientRect()\n // A point in the grid: fractions across and down, the beat, the row. Gestures map moves with it too.\n const at = (ev: { clientX: number; clientY: number }) => {\n const x = (ev.clientX - r.left) / r.width\n const y = (ev.clientY - r.top) / r.height\n return { x, y, b: origin + x * view, ri: Math.max(0, Math.min(R - 1, Math.floor(y * R))) }\n }\n const g = at({ clientX, clientY })\n // Topmost first: the last drawn note under the point.\n let hit: ClipNote | undefined\n for (let i = notes.length - 1; i >= 0; i--) {\n const n = notes[i]\n if (rowOf.get(n.pitch) === g.ri && g.b >= n.start && g.b <= n.start + n.length) {\n hit = n\n break\n }\n }\n let zone: 'start' | 'end' | 'body' | null = null\n if (hit) {\n const px = clientX - r.left\n const startPx = ((hit.start - origin) / view) * r.width\n const widthPx = (hit.length / view) * r.width\n if (px > startPx + widthPx - EDGE_PX && widthPx > 10) zone = 'end'\n else if (px < startPx + EDGE_PX && widthPx > EDGE_PX * 3) zone = 'start'\n else zone = 'body'\n }\n return { r, at, g, hit, zone }\n }\n const cursorFor = (zone: 'start' | 'end' | 'body' | null, copy: boolean) => {\n if (!live) return 'default'\n if (zone === 'start' || zone === 'end') return 'ew-resize'\n if (zone === 'body') return mode === 'draw' ? ERASER_CURSOR : copy ? 'copy' : 'grab'\n return mode === 'draw' ? PENCIL_CURSOR : 'default'\n }\n // Hover: the cursor says what a press would do. Straight on the element, no render.\n const gridHover = (e: React.PointerEvent<HTMLDivElement>) => {\n const el = gridRef.current\n if (!el || e.buttons) return\n el.style.cursor = cursorFor(hitAt(e.clientX, e.clientY).zone, e.altKey)\n }\n\n // A new note one grid step long where the press is; dragging on sets its length.\n const drawNote = (e: React.PointerEvent, b: number, ri: number, at: (ev: { clientX: number; clientY: number }) => { b: number }, free: (ev: { metaKey: boolean; ctrlKey: boolean }) => boolean) => {\n const step = stepBeats\n const len = step || 0.25\n let s0 = step && !free(e) ? Math.floor(b / step + 1e-6) * step : b\n s0 = Math.max(0, Math.min(CLIP_MAX_BEATS - len, s0))\n const note: ClipNote = { id: makeNoteId(), pitch: rows[ri], start: s0, length: len, velocity: 100, release: DEFAULT_RELEASE, chance: DEFAULT_CHANCE }\n const added = notes.concat(note)\n let latest = added\n change(added, 'add')\n setSelection([note.id])\n audition(note.pitch)\n setStatus(`Added ${nameOf(note.pitch)} at ${barBeatSixteenth(s0, beatsPerBar)}`)\n follow(e, (ev) => {\n let end = at(ev).b\n if (step && !free(ev)) end = Math.ceil(end / step - 1e-6) * step\n const length = Math.max(len, Math.min(CLIP_MAX_BEATS, end) - s0)\n latest = added.map((x) => (x.id === note.id ? { ...x, length } : x))\n change(latest, 'add')\n }, () => {\n audition(null)\n onNotesCommit?.(latest, 'add')\n })\n }\n\n // Where Paste puts notes: the last click on empty space (Select), else after what was copied.\n const insertRef = React.useRef<number | null>(null)\n const clipboardRef = React.useRef<ClipNote[]>([])\n\n const lastPointer = React.useRef('mouse')\n const gridDown = (e: React.PointerEvent<HTMLDivElement>) => {\n lastPointer.current = e.pointerType\n const el = gridRef.current\n if (!live || !el || e.button !== 0) return\n // On a Mac, Ctrl-click is a right-click: the menu opens, nothing is drawn.\n if (IS_MAC && e.ctrlKey && !e.metaKey) return\n rootRef.current?.focus({ preventScroll: true })\n e.preventDefault()\n const { at, g, hit, zone } = hitAt(e.clientX, e.clientY)\n const free = (ev: { metaKey: boolean; ctrlKey: boolean }) => ev.metaKey || ev.ctrlKey\n const pitchBy = (p: number, dRow: number) => {\n if (!fold) return clampPitch(p - dRow)\n const i = rowOf.get(p) ?? -1\n return rows[Math.max(0, Math.min(R - 1, i + dRow))]\n }\n\n // Draw: a press on a note's body removes it.\n if (hit && zone === 'body' && mode === 'draw') {\n commit(notes.filter((n) => n.id !== hit.id), 'delete')\n setSelection(selection.filter((i) => i !== hit.id))\n setStatus(`Removed ${nameOf(hit.pitch)}`)\n el.style.cursor = cursorFor(null, false)\n return\n }\n\n if (hit) {\n // A double-click on the body deletes; on an edge, two quick drags stay two resizes.\n if (mode === 'select' && zone === 'body' && doublePress(hit.id)) {\n commit(notes.filter((n) => n.id !== hit.id), 'delete')\n setSelection(selection.filter((i) => i !== hit.id))\n setStatus(`Deleted ${nameOf(hit.pitch)}`)\n el.style.cursor = cursorFor(null, false)\n return\n }\n let sel = selection\n if (e.shiftKey || (compact && mode === 'select')) sel = sel.includes(hit.id) ? sel.filter((i) => i !== hit.id) : sel.concat(hit.id)\n else if (!sel.includes(hit.id)) sel = [hit.id]\n const ids = sel.includes(hit.id) ? sel : [hit.id]\n const originals = notes.filter((n) => ids.includes(n.id))\n const dup = e.altKey && zone === 'body'\n setSelection(sel)\n setStatus(null)\n audition(hit.pitch, hit.velocity)\n el.style.cursor = zone === 'body' ? (dup ? 'copy' : 'grabbing') : 'ew-resize'\n let moved: ClipNote[] | null = null\n let reason: NotesChangeReason = 'move'\n follow(e, (ev) => {\n const g2 = at(ev)\n const d = snapD(g2.b - g.b, free(ev))\n if (zone === 'start' || zone === 'end') {\n // Either edge changes the length: the end moves the note's end, the start its start\n // (the end stays). Never shorter than a grid step (or the note, if it already is).\n const min = stepBeats || 0.125\n const next = notes.map((n) => {\n const o = originals.find((x) => x.id === n.id)\n if (!o) return n\n if (zone === 'end') return { ...n, length: Math.min(Math.max(Math.min(min, o.length), o.length + d), CLIP_MAX_BEATS - n.start) }\n const end = o.start + o.length\n const start = Math.max(0, Math.min(end - Math.min(min, o.length), o.start + d))\n return { ...n, start, length: end - start }\n })\n reason = 'length'\n moved = next\n change(next, 'length')\n const h = next.find((n) => n.id === hit.id)\n if (h) setStatus(zone === 'end' ? `Length ${+h.length.toFixed(3)} beats` : `Start ${barBeatSixteenth(h.start, beatsPerBar)} · length ${+h.length.toFixed(3)} beats`)\n return\n }\n const shifted = moveNotes(originals, d, (o) => pitchBy(o.pitch, g2.ri - g.ri))\n if (dup) {\n setGhost(shifted)\n return\n }\n const byId = new Map(shifted.map((m) => [m.id, m]))\n const next = notes.map((n) => byId.get(n.id) ?? n)\n moved = next\n change(next, 'move')\n const h = byId.get(hit.id)\n if (h) {\n audition(h.pitch, h.velocity)\n setStatus(`${nameOf(h.pitch)} at ${barBeatSixteenth(h.start, beatsPerBar)}`)\n }\n }, (ev) => {\n audition(null)\n el.style.cursor = cursorFor(zone, false)\n if (dup) {\n const gh = ghostRef.current\n setGhost(null)\n if (gh) {\n const copies = gh.map((o) => ({ ...o, id: makeNoteId() }))\n commit(notes.concat(copies), 'add')\n setSelection(copies.map((c) => c.id))\n setStatus(`${copies.length} duplicated`)\n }\n return\n }\n if (moved) onNotesCommit?.(moved, reason)\n })\n return\n }\n\n if (mode === 'draw') {\n drawNote(e, g.b, g.ri, at, free)\n return\n }\n\n // Select on empty space: a double press adds a note there; one press drags a marquee (Shift\n // adds to the selection), and a plain click clears it and leaves the insert point.\n const cell = `empty:${g.ri}:${Math.floor(g.b / (stepBeats || 0.25))}`\n if (doublePress(cell)) {\n drawNote(e, g.b, g.ri, at, free)\n return\n }\n const insertAt = stepBeats && !free(e) ? Math.floor(g.b / stepBeats + 1e-6) * stepBeats : g.b\n const base = e.shiftKey ? selection : []\n let dragged = false\n follow(e, (ev) => {\n if (!dragged && Math.hypot(ev.clientX - e.clientX, ev.clientY - e.clientY) < 3) return\n dragged = true\n const g2 = at(ev)\n const b0 = Math.min(g.b, g2.b)\n const b1 = Math.max(g.b, g2.b)\n const r0 = Math.min(g.ri, g2.ri)\n const r1 = Math.max(g.ri, g2.ri)\n const ids = notes.filter((n) => {\n const ri = rowOf.get(n.pitch) ?? -1\n return ri >= r0 && ri <= r1 && n.start < b1 && n.start + n.length > b0\n }).map((n) => n.id)\n setBand({ x0: Math.min(g.x, g2.x), x1: Math.max(g.x, g2.x), y0: Math.min(g.y, g2.y), y1: Math.max(g.y, g2.y) })\n setSelection(Array.from(new Set(base.concat(ids))))\n }, () => {\n // A plain click (not a marquee) leaves the insert point.\n if (!dragged) {\n setSelection(base)\n insertRef.current = insertAt\n }\n setBand(null)\n })\n }\n\n // The note lane: each value is an arrow as long as its note, at the value's height. With a\n // selection, only selected notes change; without one, the press grabs the arrow nearest in height\n // (one note of a chord), and sweeping sideways draws onto every note crossed.\n const laneDown = (e: React.PointerEvent<HTMLDivElement>) => {\n const el = laneRef.current\n if (!live || !el || e.button !== 0) return\n e.preventDefault()\n const r = el.getBoundingClientRect()\n const [lo0, max] = laneRange(lane)\n const tol = (6 / r.width) * view\n const beatAt = (ev: { clientX: number }) => origin + ((ev.clientX - r.left) / r.width) * view\n const valAt = (ev: { clientY: number }) => Math.max(lo0, Math.min(max, Math.round((1 - (ev.clientY - r.top - LANE_PAD) / (r.height - LANE_PAD * 2)) * max)))\n const under = (n: ClipNote, lo: number, hi: number) => n.start - tol <= hi && n.start + Math.max(n.length, tol) >= lo\n const b0 = beatAt(e)\n let grabbed: string | null = null\n if (!selection.length) {\n const y0 = (e.clientY - r.top - LANE_PAD) / (r.height - LANE_PAD * 2)\n const cands = notes.filter((n) => under(n, b0, b0))\n if (cands.length) grabbed = cands.reduce((best, n) => (Math.abs(1 - laneValue(n, lane) / max - y0) < Math.abs(1 - laneValue(best, lane) / max - y0) ? n : best)).id\n }\n let sweeping = false\n let prev = b0\n let latest = notes\n const names = { velocity: 'Velocity', release: 'Release velocity', chance: 'Chance' }\n const apply = (ev: { clientX: number; clientY: number }) => {\n const b = beatAt(ev)\n const val = valAt(ev)\n if (!sweeping && Math.abs(ev.clientX - e.clientX) > 8) sweeping = true\n const lo = Math.min(prev, b)\n const hi = Math.max(prev, b)\n prev = b\n const hits = (n: ClipNote) => (selection.length ? selection.includes(n.id) && under(n, lo, hi) : grabbed && !sweeping ? n.id === grabbed : under(n, lo, hi))\n latest = latest.map((n) => (hits(n) ? { ...n, [lane]: val } : n))\n change(latest, 'lane')\n setStatus(`${names[lane]} ${val}${lane === 'chance' ? ' %' : ''}`)\n }\n apply(e)\n follow(e, apply, () => onNotesCommit?.(latest, 'lane'))\n }\n\n // Hover on the lane: near an arrow the cursor says it moves up and down. Straight on the element.\n const laneHover = (e: React.PointerEvent<HTMLDivElement>) => {\n const el = laneRef.current\n if (!el || e.buttons) return\n const r = el.getBoundingClientRect()\n const b = origin + ((e.clientX - r.left) / r.width) * view\n const [, max] = laneRange(lane)\n const near = live && notes.some((n) => b >= n.start && b <= n.start + n.length && rowOf.has(n.pitch)\n && Math.abs(r.top + LANE_PAD + (1 - laneValue(n, lane) / max) * (r.height - LANE_PAD * 2) - e.clientY) <= 6)\n el.style.cursor = !live ? 'default' : near ? 'ns-resize' : 'crosshair'\n }\n\n const deleteSelection = () => {\n if (!live || !selection.length) return\n commit(notes.filter((n) => !selection.includes(n.id)), 'delete')\n setStatus(`${selection.length} ${selection.length === 1 ? 'note' : 'notes'} deleted`)\n setSelection([])\n }\n const duplicateSelection = () => {\n if (!live || !selection.length) return\n const copies = duplicateAfter(notes, selection, { makeId: makeNoteId })\n if (!copies.length) return\n commit(notes.concat(copies), 'add')\n setSelection(copies.map((c) => c.id))\n setStatus(`${copies.length} duplicated after`)\n }\n const runAction = (action: NoteAction) => {\n if (!live) return\n const ids = editTargets(notes, selection).map((n) => n.id)\n if (!ids.length) return\n commit(applyNoteAction(notes, ids, action, { step: stepBeats || 0.25 }), 'action')\n setStatus(`${action} · ${ids.length} notes`)\n }\n const muteSelection = () => {\n const ids = editTargets(notes, selection).map((n) => n.id)\n if (!live || !ids.length) return\n const next = toggleMute(notes, ids)\n commit(next, 'action')\n setStatus(`${ids.length} ${ids.length === 1 ? 'note' : 'notes'} ${next.find((n) => n.id === ids[0])?.muted ? 'muted' : 'unmuted'}`)\n }\n const copySelection = (cut: boolean) => {\n const picked = notes.filter((n) => selection.includes(n.id))\n if (!picked.length) return\n clipboardRef.current = picked\n // A new copy pastes right after itself until a click picks another place.\n insertRef.current = null\n if (cut && live) {\n commit(notes.filter((n) => !selection.includes(n.id)), 'delete')\n setSelection([])\n }\n setStatus(`${picked.length} ${picked.length === 1 ? 'note' : 'notes'} ${cut ? 'cut' : 'copied'}`)\n }\n // Paste at the insert point (or `at`), else right after what was copied; the next paste follows on.\n const paste = (at?: number) => {\n const copied = clipboardRef.current\n if (!live || !copied.length) return\n const s0 = Math.min(...copied.map((n) => n.start))\n const span = Math.max(...copied.map((n) => n.start + n.length)) - s0\n const where = at ?? insertRef.current ?? s0 + span\n const copies = pasteAt(copied, where, { makeId: makeNoteId })\n if (!copies.length) return\n commit(notes.concat(copies), 'add')\n setSelection(copies.map((c) => c.id))\n insertRef.current = where + span\n setStatus(`${copies.length} pasted at ${barBeatSixteenth(where, beatsPerBar)}`)\n }\n\n const onKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (!live) return\n // Envelopes: Delete removes the selected points, Escape lets the selection go.\n if (isEnv) {\n if ((e.target as HTMLElement).closest('input, [contenteditable]')) return\n if ((e.key === 'Delete' || e.key === 'Backspace') && envRange) {\n e.preventDefault()\n deleteEnvPoints()\n } else if (e.key === 'Escape') setEnvRange(null)\n return\n }\n if ((e.target as HTMLElement).closest('input, [contenteditable]')) return\n const k = e.key\n const mod = e.metaKey || e.ctrlKey\n const step = stepBeats || 0.25\n if (mod && (k === 'a' || k === 'A')) {\n e.preventDefault()\n setSelection(notes.map((n) => n.id))\n return\n }\n if (mod && (k === 'v' || k === 'V')) {\n e.preventDefault()\n paste()\n return\n }\n if (!mod && (k === 'b' || k === 'B')) {\n setMode((m) => (m === 'draw' ? 'select' : 'draw'))\n return\n }\n if (k === 'Escape') {\n setSelection([])\n return\n }\n // As the Edit group's Mute and Quantize: the selection, or every note without one.\n if (!mod && k === '0') {\n e.preventDefault()\n muteSelection()\n return\n }\n if (mod && (k === 'u' || k === 'U')) {\n e.preventDefault()\n runAction('quantize')\n return\n }\n if (!selection.length) return\n const ids = selection\n const update = (fn: (n: ClipNote) => Partial<ClipNote>, reason: NotesChangeReason = 'move') => commit(notes.map((n) => (ids.includes(n.id) ? { ...n, ...fn(n) } : n)), reason)\n if (k === 'Delete' || k === 'Backspace') {\n e.preventDefault()\n deleteSelection()\n } else if (k === 'ArrowUp' || k === 'ArrowDown') {\n e.preventDefault()\n const d = (k === 'ArrowUp' ? 1 : -1) * (e.shiftKey ? 12 : 1)\n update((n) => ({ pitch: clampPitch(n.pitch + d) }))\n } else if ((k === 'ArrowLeft' || k === 'ArrowRight') && e.shiftKey) {\n // Shift: the length, a grid step at a time, never below one.\n e.preventDefault()\n const d = k === 'ArrowRight' ? step : -step\n update((n) => ({ length: Math.max(Math.min(step, n.length), Math.min(CLIP_MAX_BEATS - n.start, n.length + d)) }), 'length')\n } else if (k === 'ArrowLeft' || k === 'ArrowRight') {\n // A grid step; Alt: a bar.\n e.preventDefault()\n const d = (k === 'ArrowRight' ? 1 : -1) * (e.altKey ? beatsPerBar : step)\n update((n) => ({ start: Math.max(0, Math.min(CLIP_MAX_BEATS - n.length, n.start + d)) }))\n } else if (mod && (k === 'd' || k === 'D')) {\n e.preventDefault()\n duplicateSelection()\n } else if (mod && (k === 'c' || k === 'C' || k === 'x' || k === 'X')) {\n e.preventDefault()\n copySelection(k === 'x' || k === 'X')\n }\n }\n\n // ── rulers, loop, playhead ────────────────────────────────────────────────\n const snapLoop = (x: number) => {\n const st = stepBeats || 1\n return Math.max(0, Math.min(CLIP_MAX_BEATS, Math.round(x / st) * st))\n }\n const setLoop = (next: ClipLoop, status?: string) => {\n onLoopChange?.(next)\n if (status) setStatus(status)\n }\n // A seek moves the playhead at once, without waiting for the host to render the editor again.\n const seek = (beat: number) => {\n onSeek?.(beat)\n requestAnimationFrame(() => placeRef.current())\n }\n const loopEnd = loop.start + loop.length\n // The rows above the grid, as the Track player's: zoom (drag up / down, double-click fits), loop\n // (drag empty space to draw it; on Envelopes, the range for shapes) and seek (press or drag).\n const zoomRowDown = (e: React.PointerEvent<HTMLDivElement>) => {\n if (e.button !== 0) return\n // A double tap fits (a touch does not always send dblclick); the mouse keeps onDoubleClick.\n if (e.pointerType === 'touch' && doublePress('ruler')) {\n fitView()\n return\n }\n const r = e.currentTarget.getBoundingClientRect()\n let y = e.clientY\n follow(e, (ev) => {\n // Down zooms in, up zooms out, about the pointer.\n zoomAbout(Math.exp(-(ev.clientY - y) * 0.012), (ev.clientX - r.left) / r.width)\n y = ev.clientY\n })\n }\n const loopRowDown = (e: React.PointerEvent<HTMLDivElement>) => {\n if (!live || e.button !== 0) return\n const r = e.currentTarget.getBoundingClientRect()\n const b0 = origin + ((e.clientX - r.left) / r.width) * view\n let drew = false\n let latest = loop\n follow(e, (ev) => {\n if (!drew && Math.abs(ev.clientX - e.clientX) < 3) return\n drew = true\n const b1 = origin + ((ev.clientX - r.left) / r.width) * view\n const a = snapLoop(Math.min(b0, b1))\n const z = snapLoop(Math.max(b0, b1))\n if (z <= a) return\n const span = `${barBeatSixteenth(a, beatsPerBar)} – ${barBeatSixteenth(z, beatsPerBar)}`\n latest = { start: a, length: z - a }\n setLoop(latest, `Loop ${span}`)\n }, () => {\n if (drew) {\n onLoopCommit?.(latest)\n if (!loopActive) onLoopToggle?.()\n }\n })\n }\n const seekRowDown = (e: React.PointerEvent<HTMLDivElement>) => {\n if (disabled || locked || e.button !== 0) return\n const r = e.currentTarget.getBoundingClientRect()\n // The view as it is now: playing, it can follow the playhead mid-drag.\n const at = (ev: { clientX: number }) => {\n const v = viewRef.current\n return Math.max(0, Math.min(v.extent, v.origin + ((ev.clientX - r.left) / r.width) * v.view))\n }\n seek(at(e))\n follow(e, (ev) => seek(at(ev)))\n }\n const loopBodyDown = (e: React.PointerEvent<HTMLDivElement>) => {\n e.stopPropagation()\n if (!live || e.button !== 0) return\n const r = (e.currentTarget.parentElement as HTMLElement).getBoundingClientRect()\n const at = (ev: { clientX: number }) => origin + ((ev.clientX - r.left) / r.width) * view\n const b0 = at(e)\n const L = { ...loop }\n let moved = false\n let latest = loop\n follow(e, (ev) => {\n if (Math.abs(ev.clientX - e.clientX) < 3 && !moved) return\n moved = true\n let d = snapD(at(ev) - b0, ev.metaKey || ev.ctrlKey)\n d = Math.max(-L.start, Math.min(CLIP_MAX_BEATS - (L.start + L.length), d))\n latest = { start: L.start + d, length: L.length }\n setLoop(latest, `Loop ${barBeatSixteenth(latest.start, beatsPerBar)} – ${barBeatSixteenth(latest.start + latest.length, beatsPerBar)}`)\n }, () => {\n if (moved) onLoopCommit?.(latest)\n else onLoopToggle?.()\n })\n }\n const loopEdgeDown = (edge: 'start' | 'end') => (e: React.PointerEvent<HTMLSpanElement>) => {\n e.stopPropagation()\n if (!live || e.button !== 0) return\n const r = (e.currentTarget.parentElement?.parentElement as HTMLElement).getBoundingClientRect()\n const min = stepBeats || 1\n let latest = loop\n follow(e, (ev) => {\n const b = snapLoop(origin + ((ev.clientX - r.left) / r.width) * view)\n if (edge === 'start') {\n const a = Math.max(0, Math.min(b, loopEnd - min))\n latest = { start: a, length: loopEnd - a }\n } else {\n const z = Math.min(CLIP_MAX_BEATS, Math.max(b, loop.start + min))\n latest = { start: loop.start, length: z - loop.start }\n }\n setLoop(latest, `Loop ${barBeatSixteenth(latest.start, beatsPerBar)} – ${barBeatSixteenth(latest.start + latest.length, beatsPerBar)}`)\n }, () => onLoopCommit?.(latest))\n }\n const knobDown = (e: React.PointerEvent<HTMLSpanElement>) => {\n e.stopPropagation()\n const p0 = readRef.current()\n if (disabled || locked || p0 == null) return\n const r = (e.currentTarget.parentElement as HTMLElement).getBoundingClientRect()\n const x0 = e.clientX\n follow(e, (ev) => seek(Math.max(0, Math.min(extent, p0 + ((ev.clientX - x0) / r.width) * viewRef.current.view))))\n }\n // Keyboard column: drag sideways to zoom pitch, up / down to scroll, tap a key to hear it.\n const keysDown = (e: React.PointerEvent<HTMLDivElement>) => {\n if (disabled || locked || e.button !== 0) return\n const x0 = e.clientX\n const y0 = e.clientY\n const z0 = zoom\n const box = e.currentTarget.getBoundingClientRect()\n const pitch = rows[Math.max(0, Math.min(R - 1, Math.floor(((e.clientY - box.top) / box.height) * R)))]\n let moved = false\n audition(pitch)\n follow(e, (ev) => {\n if (fold) return\n if (!moved && Math.hypot(ev.clientX - x0, ev.clientY - y0) < 4) return\n if (!moved) audition(null)\n moved = true\n const grow = Math.round((ev.clientX - x0) / 14)\n const shift = Math.round((ev.clientY - y0) / (box.height / (z0[1] - z0[0] + 1)))\n let lo = z0[0] - grow + shift\n let hi = z0[1] + grow + shift\n if (hi - lo < 11) {\n const c = (lo + hi) / 2\n lo = Math.round(c - 5.5)\n hi = lo + 11\n }\n if (hi - lo > 47) {\n const c = (lo + hi) / 2\n lo = Math.round(c - 23.5)\n hi = lo + 47\n }\n if (lo < 0) {\n hi -= lo\n lo = 0\n }\n if (hi > 127) {\n lo -= hi - 127\n hi = 127\n }\n setZoom([lo, hi])\n setStatus(`Pitch view ${nameOf(lo)} – ${nameOf(hi)}`)\n }, () => {\n if (!moved) {\n audition(null)\n setStatus(`Heard ${nameOf(pitch)}`)\n }\n })\n }\n\n // ── derived view ──────────────────────────────────────────────────────────\n let lineStep = stepBeats || 0.25\n while (view / lineStep > 128) lineStep *= 2\n const lines: Array<readonly [number, number]> = []\n for (let b = Math.ceil(origin / lineStep - 1e-6) * lineStep; b <= origin + view + 1e-6; b += lineStep) {\n const bar = near(b / beatsPerBar, Math.round(b / beatsPerBar))\n const beat = near(b, Math.round(b))\n lines.push([b, bar ? 2 : beat ? 1 : 0])\n }\n const ppb = Math.max(1, gridW) / view\n // Label steps come from the zoom, with no top rung: a long clip zoomed out labels every 8, 16, 64\n // bars… rather than piling the densest capped step into one smear. Beats that divide the bar, then\n // whole bars doubling, so every label still sits on a bar or a beat. An unmeasured (0 px) grid\n // counts as 1 px, so it labels sparsely rather than every beat.\n const barStep = chooseLabelStep(ppb, barLadder(beatsPerBar), 44)\n const barLabels: Array<{ b: number; text: string; strong: boolean }> = []\n for (let b = Math.ceil(origin / barStep) * barStep; b <= origin + view + 1e-6; b += barStep) {\n const strong = near(b % beatsPerBar, 0)\n barLabels.push({ b, strong, text: strong ? String(b / beatsPerBar + 1) : `${Math.floor(b / beatsPerBar) + 1}.${Math.floor(b % beatsPerBar) + 1}` })\n }\n const pps = Math.max(1, gridW) / (view * spb)\n // Whole seconds and up: the clock reads m:ss, so a half-second step would print each second twice.\n const timeStep = chooseLabelStep(pps, TIME_STEP_LADDER_SEC, 72)\n const timeLabels: number[] = []\n for (let t = Math.ceil((origin * spb) / timeStep) * timeStep; t <= (origin + view) * spb + 1e-6; t += timeStep) timeLabels.push(t)\n\n const visible = notes.filter((n) => n.start + n.length > origin && n.start < origin + view && rowOf.has(n.pitch))\n const dimStyle: React.CSSProperties = { position: 'absolute', top: 0, bottom: 0, pointerEvents: 'none', background: 'color-mix(in oklab, var(--background) 55%, transparent)', zIndex: 5 }\n const loopA = Math.max(0, Math.min(100, pc(loop.start)))\n const loopB = Math.max(0, Math.min(100, pc(loopEnd)))\n const dims = loopActive ? (\n <>\n <span aria-hidden style={{ ...dimStyle, left: 0, width: `${loopA}%` }} />\n <span aria-hidden style={{ ...dimStyle, left: `${loopB}%`, right: 0 }} />\n </>\n ) : null\n // The playhead's spans are placed by `place` below (hidden until then), not by the render.\n const hasHead = props.readPosition != null || position != null\n const playhead = hasHead ? <span aria-hidden data-slot=\"piano-roll-playhead\" data-playhead=\"\" style={{ position: 'absolute', top: 0, bottom: 0, left: 0, visibility: 'hidden', width: 2, marginLeft: -1, background: 'var(--primary)', pointerEvents: 'none', zIndex: 20 }} /> : null\n const vlines = (sub: boolean) => lines.filter(([, w]) => sub || w > 0).map(([b, w]) => (\n <span key={b} aria-hidden style={{ position: 'absolute', top: 0, bottom: 0, width: 1, pointerEvents: 'none', left: `${pc(b)}%`, background: `color-mix(in oklab, var(--foreground) ${w === 2 ? 22 : w === 1 ? 10 : 4}%, transparent)` }} />\n ))\n\n // ── playhead and sounding notes, straight on the DOM ──────────────────────\n // Playing, they move every frame: done as a render of the whole editor (every note, the rulers),\n // that is what made playback stutter. Here a render only collects the elements; `place` reads the\n // position and moves them, after each render and, with `readPosition`, on every frame while playing.\n const readRef = React.useRef<() => number | null>(() => null)\n readRef.current = props.readPosition ?? (() => position)\n const playingRef = React.useRef(playing)\n playingRef.current = playing\n const headEls = React.useRef<HTMLElement[]>([])\n const soundEls = React.useRef<HTMLElement[]>([])\n const noteById = React.useRef(new Map<string, ClipNote>())\n noteById.current = React.useMemo(() => new Map(notes.map((n) => [n.id, n])), [notes])\n const place = React.useCallback(() => {\n const beat = readRef.current()\n const on = playingRef.current\n const v = viewRef.current\n // The view follows the transport off-screen.\n if (beat != null && on && (beat > v.origin + v.view || beat < v.origin)) {\n const next = Math.max(0, Math.min(v.extent - v.view, beat))\n viewRef.current = { ...v, origin: next }\n setOrigin(next)\n }\n const { origin: o, view: w } = viewRef.current\n const x = beat == null ? -1 : ((beat - o) / w) * 100\n const shown = x >= 0 && x <= 100\n for (const el of headEls.current) {\n el.style.visibility = shown ? 'visible' : 'hidden'\n if (shown) el.style.left = `${x}%`\n }\n for (const el of soundEls.current) {\n const n = noteById.current.get(el.dataset.soundId ?? '')\n const sounds = !!n && on && beat != null && !n.muted && beat >= n.start && beat < n.start + n.length\n if ((el.dataset.sounding === '1') === sounds) continue\n if (sounds) {\n el.dataset.sounding = '1'\n el.style.setProperty('--pr-sound', 'var(--foreground)')\n } else {\n delete el.dataset.sounding\n el.style.removeProperty('--pr-sound')\n }\n }\n }, [])\n const placeRef = React.useRef(place)\n placeRef.current = place\n React.useLayoutEffect(() => {\n const root = rootRef.current\n if (!root) return\n headEls.current = Array.from(root.querySelectorAll<HTMLElement>('[data-playhead]'))\n soundEls.current = Array.from(root.querySelectorAll<HTMLElement>('[data-sound-id]'))\n place()\n })\n const reading = props.readPosition != null\n React.useEffect(() => {\n if (!reading) return\n // Stopped, a seek from elsewhere (another device in a room, the host's own transport) still\n // moves the playhead: a slower check, still no render.\n if (!playing) {\n const timer = window.setInterval(place, 100)\n return () => window.clearInterval(timer)\n }\n let frame = 0\n const tick = () => {\n place()\n frame = requestAnimationFrame(tick)\n }\n frame = requestAnimationFrame(tick)\n return () => cancelAnimationFrame(frame)\n }, [playing, reading, place])\n\n const selected = notes.filter((n) => selection.includes(n.id))\n let readout = status ?? (isEnv\n ? 'Click the line to add a point, drag a point to move it, double-click it to remove · drag empty space to select'\n : mode === 'draw'\n ? 'Draw: click to add a note, click a note to remove it · B for Select'\n : 'Double-click to add a note, drag notes or an edge, drag empty space to select · B for Draw')\n if (!isEnv && selected.length === 1) {\n const n = selected[0]\n readout = `${nameOf(n.pitch)} · ${barBeatSixteenth(n.start, beatsPerBar)} · ${+n.length.toFixed(3)} beats · velocity ${n.velocity} · release ${n.release ?? DEFAULT_RELEASE} · chance ${n.chance ?? DEFAULT_CHANCE} %`\n } else if (!isEnv && selected.length > 1) {\n readout = `${selected.length} notes selected · ${nameOf(Math.min(...selected.map((n) => n.pitch)))}–${nameOf(Math.max(...selected.map((n) => n.pitch)))}`\n }\n if (!live) readout = readOnly ? 'Read-only: plays and seeks, no editing' : locked ? 'Locked' : 'Disabled'\n // The source's own tab: its editor says what it does, the roll's lines say nothing.\n const onSource = !!source && !isEnv\n if (onSource) readout = ''\n // The tab shown is armed: what REC does there, while it holds.\n // What the tab shown records into, while armed: the notes on Notes, the picked control's lane on Envelopes.\n const tabArmed = (isEnv ? !!target && !!armed?.envelopes : !onSource && !!armed?.notes)\n const recState = !tabArmed ? null : !recording ? 'armed · REC records' : playing ? '● recording' : 'REC on · play to record'\n const editTarget = isEnv && target\n ? recState\n ? `${recState} ${recordingControls?.length ? controls.filter((c) => recordingControls.includes(c.id)).map((c) => c.label).join(', ') : 'the controls you move'}`\n : `${target.group} · ${target.label}${targetLane.linked ? (source ? ' · linked to the loop' : ' · linked to clip loop') : ` · own length ${targetLane.lengthBeats ?? 6} beats`}`\n : recState ? `${recState} the notes you play` : `Edit → ${selection.length ? `${selection.length} selected` : 'all notes'}`\n\n // Without a status line (a phone; a desktop whose head is the surface title and the views) what it\n // carried that is not a hint shows over the editing area instead: the lock\n // state and the recording state as long as they hold.\n const noStatusLine = compact || !!surfacePick || !!caption\n // The phone layout's decisions (the editor narrower than 560 px), in one place: what goes, what\n // folds into a menu, what shrinks. The render reads these, never the breakpoint again.\n const phone = {\n toolRails: compact ? 2 : 1,\n gridH: compact ? 352 : 288,\n /** The ruler row: it holds no buttons (its drag zooms), so no finger row. */\n zoomH: compact ? 20 : 16,\n /** The loop and seek rows: finger-sized on a phone. */\n rowH: compact ? 32 : 24,\n /** The left column: the keys alone on a phone, the icons' width otherwise. */\n gutterW: compact ? 40 : 56,\n /** The loop band's handles: wide for a thumb. */\n handleW: compact ? 24 : 12,\n /** The Envelopes tab's lane bar; a phone names the envelope in Control and over the lane. */\n laneBar: !compact,\n /** The lane's value axis over the plot instead of beside it. */\n axisOver: compact,\n /** View (Fold, Lanes) and Shape (Line, Step) fold into menus so the toolbar holds two rows. */\n foldView: compact,\n foldShape: compact,\n /** The toolbar's rows spread their items evenly; wide, the last menu sits at the right. */\n toolbarSpread: compact,\n toolbarGap: compact ? 2 : 10,\n loopFieldGap: compact ? 8 : 6,\n headPad: '4px 8px 0 4px',\n bodyPad: compact ? '2px 8px 6px' : '4px 8px 6px',\n /** The view tabs: the small ones on a phone. */\n bigTabs: !compact,\n }\n // Over the grid only a state that holds (locked, recording): what an edit did is never said there,\n // it is in the roll itself.\n const phoneNote = noStatusLine ? (!live ? readout : recState ? editTarget : null) : null\n\n // How the chrome collapses, from the editor's own width (the design's breakpoints).\n // A host's controls at the toolbar's end take their room too (about a labelled button each).\n const avail = width - (isEnv ? 180 : 140) - (toolbarEnd ? 64 : 0)\n const collapse = { mode: avail < 640, edit: avail < 1180, envtools: avail < 1000, shape: avail < 900 }\n // The selection bar: by the notes tab's width on every tab (on a source's tab its row is the body's; on\n // Envelopes the chips' or the plot's), so switching tabs never changes the editor's height; never in\n // an editor that cannot select.\n const selectionBar = !readOnly && !disabled && (compact || width - 140 < 1180)\n const notesTab = !isEnv && !onSource\n // On Envelopes the selection bar's row is the envelope chips' (no empty row under them), or, where\n // there are no chips (a phone), the plot's: the editor keeps the notes tab's height either way.\n const laneInSlot = selectionBar && phone.laneBar\n const anySelected = notesTab && selection.length > 0\n // The tool rails: one wide, two in the phone layout, the same on every tab.\n const toolRails = phone.toolRails\n const gridH = gridHeight != null && Number.isFinite(gridHeight) ? Math.max(GRID_FLOOR, Math.round(gridHeight)) : phone.gridH\n const envPlotH = gridH + (selectionBar && !phone.laneBar ? SELECTION_BAR_H + SELECTION_BAR_GAP : 0) - (!selectionBar && phone.laneBar ? LANE_BAR_H : 0)\n // A source's tab has nothing to select: the selection bar's row goes to its body (the waveform), as\n // Envelopes gives it to its plot, so the editor keeps the notes tab's height with no empty row in it.\n const sourceH = gridH + (selectionBar ? SELECTION_BAR_H + SELECTION_BAR_GAP : 0)\n // The rows above the grid: finger-sized on a phone.\n // On a phone the ruler holds no buttons (drag ↕ zooms, a double tap fits), so it needs no finger row.\n const zoomH = phone.zoomH\n const stripStyle: React.CSSProperties = { position: 'relative', height: phone.rowH, overflow: 'hidden', fontSize: 9, color: 'var(--muted-foreground)', fontVariantNumeric: 'tabular-nums', background: 'color-mix(in oklab, var(--foreground) 4%, transparent)', borderBottom: '1px solid color-mix(in oklab, var(--foreground) 10%, transparent)', boxSizing: 'border-box' }\n const rowIcon: React.CSSProperties = { display: 'flex', alignItems: 'center', justifyContent: 'center', height: phone.rowH }\n // The icon column beside the rows is the keys' width: Notes needs it. A track has no keys, and the\n // column took a sixth of a phone's width from the waveform: a track's editor (its Audio and its\n // Envelopes tab alike, so switching never moves the rows) has the rows take the whole width, the\n // zoom, loop and seek marks over their rows' left ends, as the Track player drew them. The marks sit\n // above the loop band and the dims and take no pointer. On a phone the Envelopes tab of a notes\n // editor is gutterless too (the lane keeps the width, its axis drawn over it), and the Notes tab\n // keeps only the keys: a narrow column.\n const gutter = !source && !(phone.axisOver && isEnv)\n const gutterW = phone.gutterW\n const rowOverlay: React.CSSProperties = { position: 'absolute', top: 0, bottom: 0, left: 0, zIndex: 11, display: 'flex', alignItems: 'center', padding: '0 4px 0 5px', background: over(3), pointerEvents: 'none' }\n // The ruler says what it does as the loop and seek rows do, one way on every tab and every size: a\n // zoom mark at its left, in the gutter or over the row. No buttons on the ruler: its drag ↕ zooms\n // time (double-click / double tap fits), Ctrl / Cmd + wheel too, and Notes' keys zoom pitch. The mark\n // takes no pointer, so a drag that starts on it still zooms.\n const zoomMark = <span role=\"img\" aria-label=\"Zoom: drag the ruler up or down\" data-hint=\"Drag ↕ to zoom\" className=\"text-muted-foreground\" style={{ display: 'flex', alignItems: 'center' }}><Icon name=\"zoom-in\" style={{ width: 14, height: 14 }} /></span>\n const zoomOverlay = !gutter\n\n const gridOption = (id: QuantizeGridId) => SNAP_PRESETS.find((p) => p.id === id)\n const gridGroup = (\n <ActionButtonGroup\n labeled\n caption=\"Grid\"\n triggerText={grid === 'none' ? 'Off' : gridOption(grid)?.label}\n triggerIcon={<Glyph d={IC.magnet} />}\n placement=\"top\"\n align=\"start\"\n value={grid}\n onChange={(v) => setGrid(v as QuantizeGridId)}\n options={SNAP_PRESETS.map((p) => ({ value: p.id, label: p.id === 'none' ? 'Off' : p.label }))}\n style={{ ['--abg-active' as string]: ink }}\n />\n )\n const abgStyle = { ['--abg-active' as string]: ink } as React.CSSProperties\n const modeGroup = (\n <ActionButtonGroup\n labeled\n expandable\n collapsed={collapse.mode}\n caption={mode === 'draw' ? 'Draw' : 'Select'}\n placement=\"top\"\n align=\"start\"\n value={mode}\n onChange={(v) => setMode(v as PianoRollMode)}\n options={[\n { value: 'draw', label: 'Draw notes (B)', short: 'Draw', icon: <Glyph d={IC.draw} /> },\n { value: 'select', label: 'Select notes (B)', short: 'Select', icon: <Glyph d={IC.select} /> },\n ]}\n style={abgStyle}\n />\n )\n const viewOptions: ActionOption[] = [\n { value: 'fold', label: kit ? \"Fold to the kit's keys and the notes in use\" : 'Fold to the notes in use', short: 'Fold', kind: 'toggle', checked: fold, icon: <Glyph d={IC.fold} /> },\n { value: 'lanes', label: 'Show the lane: velocity, release or chance of each note', short: 'Lanes', kind: 'toggle', checked: lanesOpen, icon: <Glyph d={IC.lanes} /> },\n ]\n const viewToggle = (v: string) => (v === 'lanes' ? setLanesOpen((o) => !o) : setFold((f) => !f))\n // On a phone the toolbar is two rows at most: the view toggles fold into one View menu, the shape\n // into the Tools menu.\n const viewGroup = (\n <ActionButtonGroup\n labeled\n expandable\n collapsed={phone.foldView}\n caption=\"View\"\n triggerIcon={<Glyph d={IC.lanes} />}\n placement=\"top\"\n onToggle={viewToggle}\n options={viewOptions}\n style={abgStyle}\n />\n )\n const editIcons: Record<string, string> = { delete: IC.trash, dup: IC.dup, humanize: IC.dice }\n const editGroup = (\n <ActionButtonGroup\n labeled\n expandable\n collapsed={collapse.edit}\n caption=\"Edit\"\n triggerIcon={<Glyph d={IC.wand} />}\n placement=\"top\"\n align=\"end\"\n onTrigger={(v) => {\n if (v === 'delete') deleteSelection()\n else if (v === 'dup') duplicateSelection()\n else if (v === 'mute') muteSelection()\n else runAction(v as NoteAction)\n }}\n options={EDIT_ACTIONS.map(([k, short, label, glyph]): ActionOption => ({ value: k, label, short, glyph, kind: 'action', disabled: !live, icon: k === 'mute' ? <Icon name=\"module-mute\" style={{ width: 18, height: 18 }} /> : <Glyph d={editIcons[k] ?? (IC as Record<string, string>)[k] ?? ''} /> }))}\n style={abgStyle}\n />\n )\n\n // Envelopes tab: its own tool groups.\n const changeLane = (next: AutomationLaneValue) => target && onAutomationChange?.(target.id, next)\n const commitLane = (next: AutomationLaneValue) => {\n if (!target) return\n onAutomationChange?.(target.id, next)\n onAutomationCommit?.(target.id, next)\n }\n const controlGroup = target && (\n <ActionButtonGroup\n labeled\n caption=\"Control\"\n triggerText={target.label}\n triggerIcon={<Glyph d={IC.spline} />}\n placement=\"top\"\n align=\"start\"\n value={target.id}\n onChange={setTarget}\n options={controls.map((c) => ({ value: c.id, label: `${c.group} · ${c.label}${automation?.[c.id]?.keyframes.length ? ' ●' : ''}` }))}\n style={abgStyle}\n />\n )\n const shapeOptions: ActionOption[] = [\n { value: 'line', label: 'Ramps between points', short: 'Line', icon: <Glyph d={IC.line} /> },\n { value: 'step', label: 'Hold until the next point', short: 'Step', icon: <Glyph d={IC.step} /> },\n ]\n const setShape = (v: string) => commitLane({ ...targetLane, shape: v as AutomationLaneValue['shape'] })\n const shapeGroup = target && !target.binary && !phone.foldShape && (\n <ActionButtonGroup\n labeled\n expandable\n collapsed={collapse.shape}\n caption=\"Shape\"\n placement=\"top\"\n value={targetLane.shape}\n onChange={setShape}\n options={shapeOptions}\n style={abgStyle}\n />\n )\n /** The points of the shown lane inside the selection, taken out. */\n function deleteEnvPoints() {\n if (!target || !envRange) return\n const kept = targetLane.keyframes.filter((k) => !inSelection(targetLane, envRange, k.t))\n const gone = targetLane.keyframes.length - kept.length\n commitLane({ ...targetLane, keyframes: kept })\n setStatus(gone ? `${gone} ${gone === 1 ? 'point' : 'points'} removed` : 'No points in the selection')\n }\n const envTools = target && (\n <ActionButtonGroup\n labeled\n expandable\n collapsed={collapse.envtools}\n caption=\"Tools\"\n triggerIcon={<Glyph d={IC.draw} />}\n placement=\"top\"\n align=\"end\"\n value={targetLane.shape}\n onChange={setShape}\n onToggle={(v) => {\n if (v === 'draw') setEnvDraw((d) => !d)\n else if (v === 'linked') commitLane({ ...targetLane, linked: !targetLane.linked, lengthBeats: targetLane.lengthBeats ?? 6 })\n }}\n onTrigger={(v) => {\n if (v === 'shape') setShapeMenu((m) => (m ? null : 'bar'))\n else if (v === 'delete') deleteEnvPoints()\n else if (v === 'clear') {\n commitLane({ ...targetLane, keyframes: [] })\n setStatus(`${target.label} cleared`)\n }\n }}\n options={([\n ...(phone.foldShape && !target.binary ? shapeOptions : []),\n { value: 'draw', label: 'Draw freehand, one value per grid step', short: 'Draw', kind: 'toggle', checked: envDraw, icon: <Glyph d={IC.draw} /> },\n { value: 'linked', label: 'Follow the clip loop (off: own length, loops independently)', short: 'Linked', kind: 'toggle', checked: targetLane.linked, icon: <Glyph d={IC.link} /> },\n { value: 'shape', label: 'Insert a shape over the selection or loop (or right-click the envelope)', short: 'Shape', kind: 'action', icon: <Glyph d={IC.shape} /> },\n { value: 'delete', label: 'Delete the selected points (Delete key)', short: 'Delete', kind: 'action', icon: <Glyph d={IC.trash} />, needsSelection: true },\n { value: 'clear', label: 'Clear this envelope', short: 'Clear', kind: 'action', icon: <Glyph d={IC.clear} /> },\n ] as Array<ActionOption & { needsSelection?: boolean }>).map(({ needsSelection, ...o }) => ({ ...o, disabled: !live || (needsSelection === true && !envRange) }))}\n style={abgStyle}\n />\n )\n\n const range = target ? shapeRange(targetLane, envRange, loop) : null\n const shapeMenuEl = isEnv && shapeMenu && target && range ? (\n <AutomationShapeMenu\n rangeLabel={`${range.source === 'selection' ? 'Selection' : range.source === 'loop' ? 'Loop' : 'Envelope'} · ${barBeatSixteenth(range.from, beatsPerBar)} – ${barBeatSixteenth(range.to, beatsPerBar)}`}\n cycles={shapeCycles}\n onCyclesChange={setShapeCycles}\n binary={target.binary}\n onPick={(id) => {\n commitLane(insertLaneShape(targetLane, id, range, shapeCycles))\n setShapeMenu(null)\n setStatus(`${id} · ${shapeCycles} ${shapeCycles > 1 ? 'cycles' : 'cycle'} · ${barBeatSixteenth(range.from, beatsPerBar)} – ${barBeatSixteenth(range.to, beatsPerBar)}`)\n }}\n hint={`${envRange ? 'Replaces the points in the selection.' : `No selection: fills the ${targetLane.linked ? 'loop' : 'envelope length'}. Drag empty space in the lane to pick a range.`} Bend a line by dragging its middle handle, or Alt-drag the line.`}\n style={shapeMenu === 'bar'\n ? { position: 'absolute', zIndex: 70, left: '50%', transform: 'translateX(-50%)', bottom: 66 }\n : { position: 'absolute', zIndex: 70, left: Math.max(8, Math.min(width - 272, shapeMenu.x + 68)), top: Math.max(8, shapeMenu.y + 60) }}\n />\n ) : null\n // Close the shape menu on a press outside it.\n React.useEffect(() => {\n if (!shapeMenu) return\n const close = (e: PointerEvent) => {\n if (!(e.target as HTMLElement).closest?.('[data-slot=\"automation-shape-menu\"], [data-slot=\"action-button-group-item\"]')) setShapeMenu(null)\n }\n document.addEventListener('pointerdown', close, true)\n return () => document.removeEventListener('pointerdown', close, true)\n }, [shapeMenu])\n\n const loopFields = (\n // In the toolbar's row with the tools: the row wraps only when its items don't fit, so vertical\n // space (scarce where the editor lives) is spent last.\n <span data-slot=\"piano-roll-loop-fields\" style={{ display: 'flex', alignItems: 'center', gap: phone.loopFieldGap, padding: '0 6px 0 0' }}>\n {[\n ['Start', loop.start, 0, CLIP_MAX_BEATS - (stepBeats || 0.25), (b: number) => barBeatSixteenth(b, beatsPerBar), (v: number) => {\n const a = Math.max(0, Math.min(CLIP_MAX_BEATS - loop.length, v))\n const next = { start: a, length: loop.length }\n setLoop(next, `Loop ${barBeatSixteenth(a, beatsPerBar)}`)\n onLoopCommit?.(next)\n }],\n ['Length', loop.length, stepBeats || 0.25, CLIP_MAX_BEATS - loop.start, (b: number) => barsBeatsLength(b, beatsPerBar), (v: number) => {\n const next = { start: loop.start, length: Math.min(CLIP_MAX_BEATS - loop.start, Math.max(stepBeats || 0.25, v)) }\n setLoop(next, `Length ${+(next.length / beatsPerBar).toFixed(2)} bars`)\n onLoopCommit?.(next)\n }],\n ...(isEnv && !targetLane.linked ? [['Env length', targetLane.lengthBeats ?? 6, stepBeats || 0.25, extent, (b: number) => barsBeatsLength(b, beatsPerBar), (v: number) => commitLane({ ...targetLane, lengthBeats: Math.max(0.25, Math.min(extent, v)) })] as const] : []),\n ].map(([label, value, min, max, format, set]) => (\n <span key={label as string} style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 4 }}>\n {/* A fixed width keeps the row still as a value grows; the value is centred in it, under its caption. */}\n <Param variant=\"ghost\" value={value as number} min={min as number} max={max as number} step={stepBeats || 0.25} precision={2} format={format as (x: number) => string} onValueCommit={set as (v: number) => void} readOnly={!live} width={56} />\n <span style={{ fontSize: 10, lineHeight: 1, color: 'var(--muted-foreground)' }}>{label as string}</span>\n </span>\n ))}\n </span>\n )\n\n // The block's title row: the surfaces at the left, this surface's views (Notes · Envelopes) at the\n // right. Each side is a row of tabs while it fits and a title with a dropdown when not, the views\n // folding first: FoldRow measures, so three surfaces fold where one does not.\n const views: ReadonlyArray<SurfaceOption> = [{ value: 'notes', label: source?.label ?? 'Notes' }, { value: 'envelopes', label: 'Envelopes' }]\n const viewTabs = (big: boolean) => hasEnvelopes ? (\n <span data-slot=\"piano-roll-views\" style={{ gridArea: 't', flex: 'none', display: 'flex', alignItems: 'center', gap: 2 }}>\n {views.map((v) => (\n <TabButton key={v.value} big={big} ink={ink} on={tab === v.value} onClick={() => setTab(v.value as PianoRollTab)}>{v.label}</TabButton>\n ))}\n </span>\n ) : null\n const tabs = viewTabs(phone.bigTabs)\n // The head row's ladder (big tabs → small tabs → views folded → both folded) is measured, never the\n // breakpoint's: a pixel more room never folds more.\n const headGroups = React.useMemo(() => surfacePick || caption || headStart ? [\n surfacePick ? surfaceTitleGroup(surfacePick, ink) : { full: null, folded: null },\n ...(hasEnvelopes ? [{\n full: viewTabs(true),\n small: viewTabs(false),\n folded: <SurfaceTitle options={views} value={tab} onChange={(v) => setTab(v as PianoRollTab)} ink={ink} />,\n probe: <SurfaceTitle options={views} value={tab} onChange={() => {}} probe />,\n }] : []),\n ] : null,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [surfacePick?.options, surfacePick?.value, surfacePick?.onChange, surfacePick?.tabs, !!caption, !!headStart, hasEnvelopes, tab, ink, source?.label])\n const headRow = headGroups ? <FoldRow slot=\"piano-roll-head\" style={{ padding: phone.headPad }} groups={headGroups} center={surfaceCaptionNode(caption, captionIcon, ink)} start={headStart} /> : null\n\n // Right-click: the common edits on a note (it joins or becomes the selection), Paste on empty space.\n const [menuAt, setMenuAt] = React.useState<{ onNote: boolean; beat: number } | null>(null)\n const gridContext = (e: React.MouseEvent<HTMLDivElement>) => {\n // A touch long-press has already been a press (drawn, moved, removed): no menu on top of it.\n // Phones have the selection bar and the Edit group.\n if (lastPointer.current === 'touch') {\n e.preventDefault()\n return\n }\n if (!live || !gridRef.current) return\n const { g, hit } = hitAt(e.clientX, e.clientY)\n if (hit && !selection.includes(hit.id)) setSelection([hit.id])\n setMenuAt({ onNote: !!hit, beat: stepBeats ? Math.floor(g.b / stepBeats + 1e-6) * stepBeats : g.b })\n }\n const allMuted = selected.length > 0 && selected.every((n) => n.muted)\n const menuItem = (label: string, run: () => void, keys?: string, destructive?: boolean, off?: boolean) => (\n <ContextMenuItem key={label} variant={destructive ? 'destructive' : 'default'} disabled={off} onSelect={run}>\n {label}\n {keys && <ContextMenuShortcut>{keys}</ContextMenuShortcut>}\n </ContextMenuItem>\n )\n const gridMenu = (\n <ContextMenuContent data-slot=\"piano-roll-menu\" className=\"min-w-[13rem]\" onCloseAutoFocus={(e) => {\n e.preventDefault()\n rootRef.current?.focus({ preventScroll: true })\n }}>\n {menuAt?.onNote ? (\n <>\n {menuItem('Cut', () => copySelection(true), `${MOD}X`)}\n {menuItem('Copy', () => copySelection(false), `${MOD}C`)}\n {menuItem('Duplicate', duplicateSelection, `${MOD}D`)}\n <ContextMenuSeparator />\n {menuItem(allMuted ? 'Unmute' : 'Mute', muteSelection, '0')}\n {menuItem('Quantize', () => runAction('quantize'), `${MOD}U`)}\n <ContextMenuSeparator />\n {menuItem('Delete', deleteSelection, '⌫', true)}\n </>\n ) : (\n <>\n {menuItem('Paste here', () => paste(menuAt?.beat), `${MOD}V`, false, !clipboardRef.current.length)}\n {menuItem('Select all', () => setSelection(notes.map((n) => n.id)), `${MOD}A`, false, !notes.length)}\n </>\n )}\n </ContextMenuContent>\n )\n\n const loopBand = (\n <div onPointerDown={loopBodyDown} onDoubleClick={(e) => e.stopPropagation()} data-slot=\"piano-roll-loop\" style={{ position: 'absolute', top: 3, bottom: 3, zIndex: 10, left: `${pc(loop.start)}%`, width: `${(loop.length / view) * 100}%`, background: `color-mix(in oklab, ${ink} 38%, transparent)`, boxShadow: `inset 1px 0 ${ink}, inset -1px 0 ${ink}`, cursor: 'grab', touchAction: 'none', opacity: loopActive ? 1 : 0.4 }}>\n {(['start', 'end'] as const).map((edge) => (\n <span key={edge} onPointerDown={loopEdgeDown(edge)} style={{ position: 'absolute', top: 0, bottom: 0, [edge === 'start' ? 'left' : 'right']: -phone.handleW / 2, width: phone.handleW, display: 'flex', alignItems: 'center', justifyContent: 'center', cursor: 'ew-resize', touchAction: 'none', color: 'var(--foreground)' }}>\n {/* ▶ at the start, ◀ at the end, as the Track player's band */}\n <svg width=\"6\" height=\"8\" viewBox=\"0 0 10 12\" aria-hidden style={{ display: 'block', transform: edge === 'end' ? 'scaleX(-1)' : undefined }}><path d=\"M0 0L10 6L0 12Z\" fill=\"currentColor\" /></svg>\n </span>\n ))}\n </div>\n )\n\n return (\n <div\n ref={rootRef}\n tabIndex={0}\n onKeyDown={onKeyDown}\n data-slot=\"piano-roll\"\n data-compact={compact || undefined}\n className={cn('relative flex w-full flex-col outline-none select-none', !solid && `surface-${surface}`, className)}\n style={{ boxSizing: 'border-box', ...(solid ? { background: over(3) } : {}), color: 'var(--foreground)', fontFamily: 'var(--font-sans)', ...style }}\n >\n {/* Top bar: the surfaces and the views (headRow) stay on top at every size: on a phone they are\n small, the status line goes (the hints are the controls' tooltips, the edit target is\n the toolbar's Control entry, and a row of small text took a row from the grid). */}\n {headRow\n ? headRow\n : compact\n ? tabs && <div style={{ display: 'flex', justifyContent: 'center', padding: '4px 8px 0' }}>{tabs}</div>\n : <div style={{ display: 'grid', gridTemplateColumns: 'minmax(0,1fr) auto minmax(0,1fr)', gridTemplateAreas: \"'r t e'\", alignItems: 'center', gap: 12, padding: '4px 8px 0', minHeight: 18 }}>\n <span data-slot=\"piano-roll-status\" style={{ gridArea: 'r', minWidth: 0, fontSize: 11, fontVariantNumeric: 'tabular-nums', color: 'color-mix(in oklab, var(--foreground) 60%, transparent)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{readout}</span>\n {tabs}\n <span style={{ gridArea: 'e', minWidth: 0, textAlign: 'right', fontSize: 11, fontVariantNumeric: 'tabular-nums', color: MUTED_INK, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{onSource ? '' : editTarget}</span>\n </div>}\n\n <div style={{ position: 'relative', padding: phone.bodyPad }}>\n {/* What an edit did is not shown over the grid, but it is still said to a screen reader. */}\n {noStatusLine && <span role=\"status\" className=\"sr-only\">{status ? `${status}${statusTick % 2 ? '\\u200b' : ''}` : ''}</span>}\n {phoneNote && (\n <span data-slot=\"piano-roll-note\" role=\"status\" style={{ position: 'absolute', left: 12 + (gutter ? gutterW : 0), bottom: 14, zIndex: 23, maxWidth: 'calc(100% - 24px)', padding: '2px 6px', fontSize: 11, fontVariantNumeric: 'tabular-nums', color: 'var(--foreground)', background: over(10), pointerEvents: 'none', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{phoneNote}</span>\n )}\n <div style={{ display: 'grid', gridTemplateColumns: gutter ? `${gutterW}px minmax(0,1fr)` : 'minmax(0,1fr)' }}>\n {/* The rows above the grid, as the Track player's: an icon at the left says what each does. */}\n {/* Zoom: drag the bar.beat ruler up / down, double-click to fit. */}\n {gutter && <span style={{ ...rowIcon, height: zoomH }}>{zoomMark}</span>}\n <div onPointerDown={zoomRowDown} onDoubleClick={() => { if (lastPointer.current !== 'touch') fitView() }} data-slot=\"piano-roll-zoom-row\" data-hint=\"Drag ↕ to zoom · double-click to fit\" style={{ position: 'relative', height: zoomH, overflow: 'hidden', cursor: 'zoom-in', touchAction: 'none', fontSize: 9, color: 'var(--muted-foreground)', fontVariantNumeric: 'tabular-nums' }}>\n {/* The mark's box in the loop and seek marks' shade (their row's 4 % under their box's 3 %): the\n ruler row has no shade of its own, so one column of marks reads as one. */}\n {zoomOverlay && <span style={{ ...rowOverlay, background: over(7) }}>{zoomMark}</span>}\n {barLabels.map((l) => (\n <span key={l.b} style={{ position: 'absolute', top: 0, bottom: 0, left: `${pc(l.b)}%`, color: l.strong ? 'var(--foreground)' : undefined }}>\n {/* A label under the zoom mark is left out, not moved: a moved number would sit off its bar. */}\n {!(zoomOverlay && (pc(l.b) / 100) * width < ZOOM_MARK_W) && (\n <span style={{ position: 'absolute', bottom: 0, left: 4, whiteSpace: 'nowrap' }}>{l.text}</span>\n )}\n <span style={{ position: 'absolute', bottom: 0, left: 0, height: 4, width: 1, background: `color-mix(in oklab, var(--border) ${l.strong ? 100 : 50}%, transparent)` }} />\n </span>\n ))}\n </div>\n <>\n {/* Loop: drag empty space to draw it, drag the band to move it, its ends to resize, tap it to\n switch it on or off. On Envelopes the band only shows: the whole row draws the range for\n shapes (tap clears). */}\n {gutter && <span aria-label=\"Loop\" data-hint=\"Loop\" className=\"text-muted-foreground\" style={rowIcon}><Icon name=\"loop-2\" style={{ width: 14, height: 14 }} /></span>}\n <div onPointerDown={loopRowDown} data-slot=\"piano-roll-loop-row\" data-hint=\"Drag to draw the loop\" style={{ ...stripStyle, cursor: live ? 'ew-resize' : 'default', touchAction: 'none' }}>\n {loopBand}\n {!gutter && <span aria-label=\"Loop\" className=\"text-muted-foreground\" style={rowOverlay}><Icon name=\"loop-2\" style={{ width: 14, height: 14 }} /></span>}\n </div>\n {/* Seek: press or drag to move the playhead; the clock reads along it. */}\n {gutter && <span aria-label=\"Seek to\" data-hint=\"Seek to\" className=\"text-muted-foreground\" style={rowIcon}><Icon name=\"seek-to\" style={{ width: 14, height: 14 }} /></span>}\n <div onPointerDown={seekRowDown} data-slot=\"piano-roll-seek-row\" data-hint=\"Press or drag to seek\" style={{ ...stripStyle, cursor: disabled || locked ? 'default' : 'text', touchAction: 'none' }}>\n {!gutter && <span aria-label=\"Seek to\" className=\"text-muted-foreground\" style={rowOverlay}><Icon name=\"seek-to\" style={{ width: 14, height: 14 }} /></span>}\n {timeLabels.map((t) => (\n <span key={t} style={{ position: 'absolute', top: 0, bottom: 0, left: `${pc(t / spb)}%` }}>\n {/* The label at the row's left edge starts after the seek icon drawn over it. */}\n <span style={{ position: 'absolute', bottom: 3, left: !gutter && pc(t / spb) < 0.5 ? 24 : 4, whiteSpace: 'nowrap' }}>{clock(t)}</span>\n <span style={{ position: 'absolute', bottom: 0, left: 0, height: 4, width: 1, background: 'var(--border)' }} />\n </span>\n ))}\n {playhead}\n {hasHead && (\n <span onPointerDown={knobDown} data-playhead=\"\" data-hint=\"Drag to scrub\" style={{ position: 'absolute', top: 0, bottom: 0, left: 0, visibility: 'hidden', width: 16, marginLeft: -8, display: 'flex', justifyContent: 'center', alignItems: 'flex-end', cursor: 'grab', zIndex: 21, touchAction: 'none' }}>\n {/* the diamond, as the Track player's playhead */}\n <span style={{ width: 8, height: 8, marginBottom: 3, transform: 'rotate(45deg)', background: 'var(--primary)' }} />\n </span>\n )}\n </div>\n </>\n\n {onSource && (\n <>\n {/* As tall as the note grid with its lane closed, so switching tabs never moves the toolbar. */}\n <div ref={gridRef} data-slot=\"piano-roll-source\" style={{ position: 'relative', height: sourceH, boxSizing: 'border-box', overflow: 'hidden' }}>\n {source.body({ from: origin, to: origin + view })}\n {vlines(false)}\n {dims}\n {playhead}\n </div>\n <TimeScrollbar origin={origin} view={view} extent={extent} onPan={setOrigin} />\n </>\n )}\n\n {!isEnv && !onSource && (\n <>\n {/* Keyboard column */}\n <div onPointerDown={keysDown} data-hint=\"Drag sideways to zoom, up / down to scroll, tap to hear\" data-slot=\"piano-roll-keys\" style={{ position: 'relative', height: gridH, boxSizing: 'border-box', overflow: 'hidden', touchAction: 'none', cursor: 'ew-resize' }}>\n {rows.map((p, ri) => {\n const black = isBlackKey(p)\n const lit = heard === p\n const named = keyNames?.(p) ?? null\n if (black && !fold) return <span key={p} title={named?.name} style={{ position: 'absolute', left: 0, width: '60%', top: `${ri * rowH}%`, height: `${rowH}%`, background: lit ? ink : 'var(--foreground)', zIndex: 2 }} />\n const up = !fold && isBlackKey(p + 1) ? 0.5 : 0\n const dn = !fold && isBlackKey(p - 1) ? 0.5 : 0\n return (\n <span key={p} style={{ position: 'absolute', left: 0, right: 0, top: `${(ri - up) * rowH}%`, height: `${(1 + up + dn) * rowH}%`, boxSizing: 'border-box', borderBottom: '1px solid var(--border)', background: lit ? ink : 'var(--background)' }}>\n {(named || p % 12 === 0 || fold) && (\n <span title={named?.name} style={{ position: 'absolute', right: 4, bottom: 1, maxWidth: 'calc(100% - 6px)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', fontSize: 8.5, opacity: named?.silent ? 0.45 : 1, color: lit ? 'var(--background)' : 'var(--muted-foreground)' }}>\n {named ? named.short ?? named.name : noteName(p)}\n </span>\n )}\n </span>\n )\n })}\n </div>\n {/* Note grid */}\n <ContextMenu>\n <ContextMenuTrigger asChild disabled={!live} onContextMenu={gridContext}>\n <div ref={gridRef} onPointerDown={gridDown} onPointerMove={gridHover} data-slot=\"piano-roll-grid\" style={{ position: 'relative', height: gridH, boxSizing: 'border-box', overflow: 'hidden', touchAction: 'none', cursor: !live ? 'default' : mode === 'draw' ? 'crosshair' : 'default' }}>\n <div style={{ position: 'absolute', inset: 0, display: 'flex', flexDirection: 'column', pointerEvents: 'none' }}>\n {rows.map((p) => {\n const dark = scale ? !inScale(p, scale) : isBlackKey(p)\n return <span key={p} style={{ flex: 1, minHeight: 0, background: dark ? over(scale ? 9 : 5) : solid ? 'var(--background)' : 'transparent', borderBottom: `1px solid color-mix(in oklab, var(--foreground) ${p % 12 === 0 ? 18 : 6}%, transparent)` }} />\n })}\n </div>\n {vlines(true)}\n {dims}\n {visible.map((n) => {\n const ri = rowOf.get(n.pitch) ?? -1\n const sel = selection.includes(n.id)\n // --pr-sound is set on the element while the note sounds (see `place`).\n const fill = `var(--pr-sound, ${disabled ? ink : `color-mix(in oklab, ${ink} ${Math.round(45 + (n.velocity / 127) * 55)}%, var(--background))`})`\n return (\n <span\n key={n.id}\n data-note-id={n.id}\n data-sound-id={n.id}\n style={{\n position: 'absolute', boxSizing: 'border-box', pointerEvents: 'none',\n left: `calc(${pc(n.start)}% + 1px)`, width: `max(3px, calc(${(n.length / view) * 100}% - 2px))`,\n top: `calc(${ri * rowH}% + 1px)`, height: `calc(${rowH}% - 2px)`,\n background: n.muted ? 'transparent' : fill,\n border: n.muted ? `1px solid ${fill}` : undefined,\n outline: sel ? '1px solid var(--primary)' : undefined, zIndex: sel ? 3 : 2,\n borderRight: !n.muted && (n.chance ?? DEFAULT_CHANCE) < 100 ? '2px solid color-mix(in oklab, var(--background) 60%, transparent)' : undefined,\n }}\n />\n )\n })}\n {ghost?.map((n) => {\n const ri = rowOf.get(n.pitch) ?? -1\n return ri < 0 ? null : <span key={n.id} aria-hidden style={{ position: 'absolute', boxSizing: 'border-box', pointerEvents: 'none', zIndex: 4, opacity: 0.5, border: '1px dashed var(--primary)', left: `${pc(n.start)}%`, width: `${(n.length / view) * 100}%`, top: `${ri * rowH}%`, height: `${rowH}%` }} />\n })}\n {band && <span aria-hidden data-slot=\"piano-roll-marquee\" style={{ position: 'absolute', zIndex: 22, pointerEvents: 'none', border: '1px solid color-mix(in oklab, var(--primary) 70%, transparent)', background: 'color-mix(in oklab, var(--primary) 10%, transparent)', left: `${band.x0 * 100}%`, width: `${(band.x1 - band.x0) * 100}%`, top: `${band.y0 * 100}%`, height: `${(band.y1 - band.y0) * 100}%` }} />}\n {playhead}\n </div>\n </ContextMenuTrigger>\n {gridMenu}\n </ContextMenu>\n {/* Note lane, when open: one row, the lane it shows picked in its own gutter. */}\n {lanesOpen && (\n <>\n <span role=\"tablist\" aria-label=\"Lane\" style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center', gap: 1, height: LANE_H, boxSizing: 'border-box', paddingTop: 4, fontSize: 9 }}>\n {LANES.map(([k, label]) => (\n <button key={k} type=\"button\" role=\"tab\" aria-selected={lane === k} onClick={() => setLane(k)} title={k === 'chance' ? `${label} · 0–100 %` : `${label} · ${k === 'velocity' ? '1–127' : '0–127'}`}\n style={{ height: 13, maxWidth: '100%', padding: '0 0 0 4px', border: 'none', background: 'transparent', font: 'inherit', textAlign: 'left', cursor: 'pointer', fontWeight: lane === k ? 700 : 400, color: lane === k ? 'var(--foreground)' : MUTED_INK, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>\n {label}\n </button>\n ))}\n </span>\n <div ref={laneRef} onPointerDown={laneDown} onPointerMove={laneHover} data-slot=\"piano-roll-lane\" style={{ position: 'relative', height: LANE_H - 4, marginTop: 4, background: 'color-mix(in oklab, var(--foreground) 4%, transparent)', boxSizing: 'border-box', overflow: 'hidden', touchAction: 'none', cursor: 'crosshair' }}>\n {vlines(false)}\n {visible.slice().sort((a, b) => Number(selection.includes(a.id)) - Number(selection.includes(b.id))).map((n) => {\n // An arrow as long as the note, at its value: the ▶ marks where the note starts.\n const [, max] = laneRange(lane)\n const y = `calc(${LANE_PAD}px + ${(1 - laneValue(n, lane) / max) * 100}% - ${(1 - laneValue(n, lane) / max) * LANE_PAD * 2}px)`\n const sel = selection.includes(n.id)\n const ink2 = `var(--pr-sound, ${sel ? 'var(--primary)' : ink})`\n return (\n <span key={n.id} data-sound-id={n.id} data-lane-note={n.id} style={{ position: 'absolute', top: 0, bottom: 0, pointerEvents: 'none', zIndex: sel ? 2 : 1, opacity: n.muted ? 0.4 : 1, left: `calc(${pc(n.start)}% + 1px)`, width: `max(3px, calc(${(n.length / view) * 100}% - 2px))` }}>\n <span style={{ position: 'absolute', left: 0, right: 0, top: y, height: 2, transform: 'translateY(-50%)', background: ink2 }} />\n <svg width=\"8\" height=\"10\" viewBox=\"0 0 10 12\" aria-hidden style={{ position: 'absolute', left: 0, top: y, transform: 'translateY(-50%)', display: 'block', color: ink2 }}>\n <path d=\"M0 0L10 6L0 12Z\" fill=\"currentColor\" />\n </svg>\n </span>\n )\n })}\n {dims}\n {playhead}\n </div>\n </>\n )}\n <span aria-hidden />\n <TimeScrollbar origin={origin} view={view} extent={extent} onPan={setOrigin} />\n </>\n )}\n\n {isEnv && target && (\n <div ref={gridRef} style={{ gridColumn: '1 / -1' }}>\n <AutomationLane\n value={targetLane}\n onChange={changeLane}\n onCommit={commitLane}\n control={target}\n origin={origin}\n view={view}\n extent={extent}\n gridStep={stepBeats}\n draw={envDraw}\n recording={!!armed?.envelopes && recording && playing}\n backdrop={source?.backdrop?.({ from: origin, to: origin + view })}\n selection={envRange}\n onSelectionChange={setEnvRange}\n onShapeMenu={(at) => setShapeMenu(at)}\n timing={visible.map((n) => [n.start, n.length, ((rowOf.get(n.pitch) ?? -1) + 0.5) / R] as const)}\n gridLines={lines}\n // The plot under the rows above: where they have no gutter (a track, a phone) the axis\n // is drawn over the plot, so a beat sits under the same beat above.\n axisOver={phone.axisOver || !gutter}\n height={Math.max(GRID_FLOOR, envPlotH)}\n colors={ink}\n onStatus={setStatus}\n formatBeat={(b) => barBeatSixteenth(b, beatsPerBar)}\n readOnly={readOnly}\n disabled={disabled}\n locked={locked}\n >\n {dims}\n {playhead}\n </AutomationLane>\n </div>\n )}\n {isEnv && target && (\n <>\n {gutter && <span aria-hidden />}\n <TimeScrollbar origin={origin} view={view} extent={extent} onPan={setOrigin} />\n </>\n )}\n </div>\n </div>\n\n {/* Envelopes' bar: the envelope chips, one rail; chips past its width scroll. Not on a phone: the\n toolbar's Control entry and the lane's own name say which envelope this is. */}\n {isEnv && phone.laneBar && (\n <div data-slot=\"piano-roll-lane-bar\" style={{ display: 'flex', flexWrap: 'nowrap', alignItems: 'center', gap: 12, height: laneInSlot ? SELECTION_BAR_H : LANE_BAR_H, marginBottom: laneInSlot ? SELECTION_BAR_GAP : undefined, boxSizing: 'border-box', padding: '0 12px', overflowX: 'auto', overflowY: 'hidden' }}>\n <span style={{ display: 'flex', flexWrap: 'nowrap', alignItems: 'center', flex: 'none' }}>\n {controls.filter((c) => automation?.[c.id]?.keyframes.length || c.id === target?.id).map((c) => {\n const has = !!automation?.[c.id]?.keyframes.length\n return (\n <TabButton key={c.id} ink={ink} on={c.id === target?.id} onClick={() => setTarget(c.id)} title={`${c.group} · ${c.label}`}>\n <span aria-hidden style={{ width: 6, height: 6, flex: 'none', background: has ? ink : 'transparent', boxShadow: `inset 0 0 0 1px ${ink}` }} />\n {c.label}\n </TabButton>\n )\n })}\n </span>\n </div>\n )}\n\n {/* Selection bar: phones have no Delete key. A fixed row on the notes tab (a source's tab gives its\n row to its body, Envelopes to its chips or its plot), so a note made or selected never grows\n the editor and moves the roll: only its buttons follow the selection. */}\n {selectionBar && notesTab && (\n <div data-slot=\"piano-roll-selection-bar\" style={{ display: 'flex', alignItems: 'center', gap: 4, height: SELECTION_BAR_H, margin: `0 12px ${SELECTION_BAR_GAP}px`, padding: '0 4px 0 12px', background: 'color-mix(in oklab, var(--foreground) 4%, transparent)' }}>\n <span style={{ flex: 1, fontSize: 12, fontWeight: 700, fontVariantNumeric: 'tabular-nums', color: anySelected ? undefined : MUTED_INK }}>{anySelected ? `${selection.length} ${selection.length === 1 ? 'note selected' : 'notes selected'}` : 'No notes selected'}</span>\n {([['Delete', IC.trash, deleteSelection, 'var(--destructive)'], ['Duplicate', IC.dup, duplicateSelection, ''], ['Deselect', IC.close, () => setSelection([]), '']] as const).map(([label, icon, run, col]) => (\n <button key={label} type=\"button\" onClick={run} disabled={!anySelected || (label !== 'Deselect' && !live)} className=\"hover:text-foreground disabled:opacity-40 disabled:cursor-default\" style={{ display: 'inline-flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: 4, minWidth: 56, height: SELECTION_BAR_H, padding: '0 6px', border: 'none', background: 'transparent', font: 'inherit', cursor: 'pointer', color: col || 'var(--muted-foreground)' }}>\n <Glyph d={icon} />\n <span style={{ fontSize: 10, lineHeight: 1 }}>{label}</span>\n </button>\n ))}\n </div>\n )}\n\n {/* Toolbar, at the bottom; menus open upward. At least as many rails on every tab (by the editor's\n width alone), so switching tabs never moves the grid above it; what a host's toolbar wraps onto\n a second row (the track's loop sizes) adds its height, never cut. The padding holds what a button\n draws past its own box (its corner brackets, 4 px out, and its caption). */}\n <div data-slot=\"piano-roll-toolbar\" data-rails={toolRails} style={{ display: 'flex', alignItems: 'center', alignContent: 'center', justifyContent: phone.toolbarSpread ? 'space-evenly' : undefined, gap: phone.toolbarGap, minHeight: toolRails * TOOL_RAIL_H, boxSizing: 'border-box', padding: '4px 6px 6px', flexWrap: 'wrap', background: 'color-mix(in oklab, var(--foreground) 4%, transparent)' }}>\n {onSource ? source.toolbar : (\n <>\n {isEnv ? controlGroup : modeGroup}\n {gridGroup}\n {loopFields}\n {isEnv ? shapeGroup : viewGroup}\n {/* On a phone the rows spread their items evenly (Bruna, 21 Oct: the bar read unevenly spread). */}\n <span style={{ marginLeft: phone.toolbarSpread ? undefined : 'auto', display: 'flex' }}>{isEnv ? envTools : editGroup}</span>\n {toolbarEnd ? <span data-slot=\"piano-roll-toolbar-end\" style={{ display: 'flex' }}>{toolbarEnd}</span> : null}\n </>\n )}\n </div>\n {shapeMenuEl}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,YAAY,WAAW;AA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,UAAU,gBAAgB,UAAU,KAAK,GAAG,UAAU,IAAI,QAAQ,iBAAiB,SAAS,SAAS,QAAQ,QAAQ,YAAY,eAAe,MAAM,WAAW,QAAQ,WAAW,OAAO,OAAO,0BAA0B,GACzd;AAAA,gCAAC,SAAM,GAAG,MAAM;AAAA,YAChB,oBAAC,UAAK,OAAO,EAAE,UAAU,IAAI,YAAY,EAAE,GAAI,iBAAM;AAAA,eAF1C,KAGb,CACD;AAAA,WACH;AAAA,QAOJ,oBAAC,SAAI,aAAU,sBAAqB,cAAY,WAAW,OAAO,EAAE,SAAS,QAAQ,YAAY,UAAU,cAAc,UAAU,gBAAgB,MAAM,gBAAgB,iBAAiB,QAAW,KAAK,MAAM,YAAY,WAAW,YAAY,aAAa,WAAW,cAAc,SAAS,eAAe,UAAU,QAAQ,YAAY,yDAAyD,GACrY,qBAAW,OAAO,UACjB,iCACG;AAAA,kBAAQ,eAAe;AAAA,UACvB;AAAA,UACA;AAAA,UACA,QAAQ,aAAa;AAAA,UAEtB,oBAAC,UAAK,OAAO,EAAE,YAAY,MAAM,gBAAgB,SAAY,QAAQ,SAAS,OAAO,GAAI,kBAAQ,WAAW,WAAU;AAAA,UACrH,aAAa,oBAAC,UAAK,aAAU,0BAAyB,OAAO,EAAE,SAAS,OAAO,GAAI,sBAAW,IAAU;AAAA,WAC3G,GAEJ;AAAA,QACC;AAAA;AAAA;AAAA,EACH;AAEJ;","names":["ppb","length","next","h","near","status"]}
package/dist/command.d.ts CHANGED
@@ -34,7 +34,7 @@ declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<
34
34
  ref?: React.Ref<HTMLInputElement>;
35
35
  } & {
36
36
  asChild?: boolean;
37
- }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "value" | "onChange" | "type"> & {
37
+ }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
38
38
  value?: string;
39
39
  onValueChange?: (search: string) => void;
40
40
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -60,7 +60,7 @@ declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
60
60
  ref?: React.Ref<HTMLDivElement>;
61
61
  } & {
62
62
  asChild?: boolean;
63
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "heading"> & {
63
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "heading" | "value"> & {
64
64
  heading?: React.ReactNode;
65
65
  value?: string;
66
66
  forceMount?: boolean;
@@ -78,7 +78,7 @@ declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
78
78
  ref?: React.Ref<HTMLDivElement>;
79
79
  } & {
80
80
  asChild?: boolean;
81
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "disabled" | "onSelect"> & {
81
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "onSelect" | "disabled" | "value"> & {
82
82
  disabled?: boolean;
83
83
  onSelect?: (value: string) => void;
84
84
  value?: string;
@@ -32,7 +32,7 @@ declare function canvasToPngBlob(canvas: HTMLCanvasElement): Promise<Blob>;
32
32
  */
33
33
  declare function renderSectionQr(url: string, colorHex: string, size?: number): Promise<Blob>;
34
34
 
35
- declare const PLANTASIA_LOGO_SVG = "<svg width=\"512\" height=\"512\" viewBox=\"0 0 512 512\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M120.945 112.863C135.62 109.653 153.052 107.73 169.442 109.599C185.836 111.468 201.08 117.115 211.542 128.937C220.226 138.755 221.523 151.53 222.247 164.864C222.963 178.067 223.108 191.875 229.948 203.012L229.949 203.013C232.134 206.565 234.88 209.406 237.742 212.052C240.57 214.667 243.43 217.026 246.141 219.779C246.389 220.894 246.278 221.362 246.189 221.521C246.152 221.587 246.056 221.725 245.516 221.739C244.967 221.754 244.263 221.626 243.404 221.454C242.601 221.293 241.66 221.092 240.815 221.054H240.816C238.333 220.938 234.998 220.858 232.495 221.056C231.039 221.169 229.406 221.602 227.962 221.933C226.445 222.28 225.118 222.521 224.038 222.406H224.036C223.431 222.343 222.441 222.058 221.163 221.593C219.911 221.137 218.467 220.541 216.987 219.908C214.066 218.66 210.951 217.243 209.116 216.603H209.115C199.953 213.386 191.032 211.176 181.369 209.665H181.37C162.498 206.69 143.894 205.762 125.295 211.41L125.407 213.351L141.812 216.33C144.544 217.04 151.333 218.498 157.827 220.364C161.075 221.298 164.185 222.317 166.589 223.366C167.793 223.892 168.79 224.411 169.529 224.914C170.295 225.436 170.664 225.861 170.791 226.15C171.155 226.984 171.187 228.123 170.895 229.548C170.606 230.958 170.026 232.53 169.308 234.148C168.592 235.761 167.758 237.379 166.978 238.888C166.304 240.191 165.661 241.435 165.193 242.489L165.004 242.93C158.09 259.623 159.613 276.105 169.457 291.379L169.458 291.38C170.28 292.653 171.166 293.682 171.921 294.558C172.699 295.46 173.289 296.149 173.662 296.833C174.008 297.469 174.138 298.052 174.004 298.744C173.86 299.482 173.398 300.443 172.339 301.765C168.059 307.079 160.634 310.583 152.453 312.579C144.297 314.569 135.554 315.02 128.826 314.357H128.825C104.297 311.957 81.6452 299.494 62.8248 282.409C44.0066 265.326 29.0777 243.674 19.9977 223.019C11.5193 203.713 6.7716 185.975 19.4401 167.703L19.441 167.702C29.4943 153.18 46.1403 141.369 64.694 132.226C83.2327 123.09 103.586 116.662 120.945 112.863Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-width=\"2\"/>\n<path d=\"M342.543 109.61C358.93 107.739 376.361 109.661 391.046 112.881L391.047 112.882C408.406 116.681 428.759 123.107 447.298 132.243C465.852 141.386 482.498 153.198 492.551 167.721C504.824 185.441 500.771 202.624 492.78 221.23L491.995 223.036C482.915 243.691 467.986 265.345 449.167 282.428C430.347 299.512 407.695 311.974 383.167 314.374H383.166C376.428 315.037 367.685 314.583 359.532 312.591C351.353 310.592 343.932 307.087 339.652 301.782V301.781L339.28 301.304C338.476 300.227 338.105 299.413 337.98 298.769C337.845 298.08 337.974 297.497 338.322 296.859C338.696 296.174 339.288 295.483 340.068 294.579C340.824 293.702 341.712 292.672 342.534 291.398V291.397C352.378 276.123 353.902 259.641 346.988 242.948V242.947C346.515 241.806 345.783 240.396 345.013 238.908C344.233 237.401 343.4 235.785 342.684 234.173C341.966 232.556 341.385 230.985 341.097 229.574C340.805 228.148 340.836 227.006 341.201 226.167L341.202 226.166C341.261 226.03 341.423 225.804 341.776 225.505C342.117 225.214 342.577 224.903 343.144 224.579C344.277 223.931 345.741 223.284 347.298 222.679C350.405 221.471 353.754 220.48 355.288 220.026L355.289 220.027C365.385 217.065 375.943 214.998 386.466 213.828H387.263L387.411 213.005C387.488 212.577 387.397 212.133 387.086 211.782C386.824 211.487 386.491 211.356 386.287 211.292C386.072 211.224 385.843 211.184 385.699 211.157C385.52 211.124 385.444 211.107 385.402 211.093L385.373 211.083L384.219 210.737C359.838 203.653 326.554 208.376 303.24 216.485C301.364 217.136 298.169 218.586 295.172 219.866C293.654 220.514 292.173 221.126 290.891 221.593C289.585 222.068 288.576 222.36 287.962 222.424C286.866 222.531 285.529 222.288 284.014 221.943C282.568 221.614 280.942 221.187 279.498 221.074C277.308 220.901 274.48 220.941 272.144 221.031L271.176 221.072C270.336 221.11 269.397 221.312 268.596 221.472C267.738 221.645 267.033 221.772 266.483 221.758C265.941 221.743 265.842 221.605 265.804 221.537C265.715 221.378 265.602 220.911 265.85 219.798C268.563 217.053 271.421 214.695 274.25 212.077C277.112 209.428 279.858 206.582 282.043 203.03H282.044C288.884 191.893 289.028 178.085 289.745 164.883C290.469 151.548 291.766 138.772 300.45 128.954L300.449 128.953C310.911 117.131 326.152 111.481 342.543 109.61Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-width=\"2\"/>\n<path d=\"M255.869 11.6735C258.905 11.5737 263.622 12.6493 268.401 14.1686C273.147 15.677 277.809 17.5733 280.684 19.0182V19.0192C291.208 24.3258 304.017 34.9608 314.954 47.112C325.902 59.2758 334.84 72.8095 337.77 83.8542V83.8561C338.329 85.9548 338.558 87.142 338.319 88.0983C338.103 88.9654 337.434 89.8392 335.507 91.0495C332.81 92.7346 328.688 94.174 324.265 95.612C319.907 97.0287 315.275 98.4386 311.772 100.059C301.289 104.893 293.893 110.821 288.582 117.582C283.274 124.339 280.084 131.881 277.949 139.892C275.818 147.89 274.729 156.394 273.645 165.06C272.558 173.748 271.475 182.61 269.365 191.433V191.435C268.575 194.76 267.531 199.171 265.621 202.843C263.714 206.511 261.065 209.216 257.144 209.541C254.668 209.746 252.691 209.223 251.072 208.247C249.44 207.262 248.116 205.78 247.021 203.987C244.813 200.371 243.643 195.685 242.71 191.817C240.576 182.975 239.485 174.085 238.397 165.364C237.311 156.665 236.229 148.123 234.103 140.087C231.973 132.037 228.787 124.456 223.473 117.665C218.155 110.87 210.743 104.912 200.225 100.059H200.224C196.721 98.4487 192.085 97.038 187.724 95.6188C183.575 94.2685 179.693 92.9158 177.011 91.3639L176.49 91.0504C174.562 89.8398 173.893 88.9656 173.677 88.0983C173.438 87.142 173.668 85.9548 174.227 83.8561V83.8551C177.883 70.0784 190.429 52.2723 206.105 37.7448C221.794 23.2046 240.348 12.2002 255.868 11.6725L255.869 11.6735Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-width=\"2\"/>\n<path d=\"M200.535 314.596C201.853 314.315 203.437 314.692 205.225 315.362C206.105 315.692 206.975 316.068 207.859 316.435C208.726 316.796 209.605 317.147 210.439 317.39H210.441C216.808 319.232 223.429 320.67 230.078 321.448C231.778 321.647 233.304 321.663 234.49 321.701C235.094 321.72 235.596 321.745 236.013 321.795C236.438 321.845 236.704 321.915 236.865 321.991C237 322.054 237.011 322.095 237.014 322.102C237.028 322.134 237.073 322.274 237.01 322.631C236.878 323.377 236.366 324.597 235.263 326.572C224.883 345.127 206.527 360.655 185.31 371.794C164.099 382.929 140.112 389.634 118.571 390.609C113.45 390.841 105.402 391.244 97.9133 390.433C94.1701 390.028 90.6143 389.323 87.6604 388.167C84.7007 387.008 82.436 385.431 81.1379 383.339L81.137 383.339C79.0293 379.946 77.9953 375.201 77.8528 369.7C77.7107 364.215 78.4568 358.073 79.8235 351.967C82.5654 339.719 87.7512 327.829 93.0227 321.806L93.0237 321.807C93.9513 320.75 94.5729 320.204 95.0276 319.945C95.4129 319.725 95.6361 319.731 95.8811 319.802C96.239 319.907 96.6404 320.154 97.3743 320.607C98.0641 321.033 98.9403 321.562 100.102 322.05L100.103 322.051C118.054 329.56 141.858 330.371 160.554 324.763C162.329 324.231 163.932 323.454 165.396 322.822C166.818 322.208 168.155 321.706 169.613 321.515C169.673 321.543 169.714 321.568 169.739 321.588C169.776 321.617 169.786 321.637 169.79 321.646C169.802 321.671 169.845 321.806 169.745 322.141C169.54 322.834 168.907 323.801 167.995 324.885C166.211 327.006 163.753 329.122 163.144 329.612L163.143 329.613C161.903 330.615 160.462 331.495 158.964 332.422C157.493 333.334 155.966 334.292 154.678 335.412C153.501 336.431 152.669 337.341 152.18 338.166C151.694 338.985 151.458 339.881 151.8 340.728C152.132 341.548 152.883 342.008 153.604 342.272C154.345 342.544 155.248 342.684 156.194 342.746C159.954 342.991 165.405 342.05 167.785 341.387L167.784 341.386C175.817 339.163 184.87 332.501 190.34 326.686L190.341 326.684C190.95 326.034 191.787 324.943 192.703 323.72C193.636 322.475 194.671 321.063 195.716 319.704C196.761 318.344 197.791 317.07 198.695 316.112C199.147 315.632 199.55 315.251 199.893 314.983C200.258 314.697 200.465 314.611 200.532 314.597L200.535 314.596Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-width=\"2\"/>\n<path d=\"M310.087 314.502C310.472 314.475 310.824 314.481 311.203 314.541L311.49 314.595L311.5 314.597C311.57 314.611 311.779 314.698 312.145 314.983C312.489 315.252 312.893 315.632 313.345 316.111C314.25 317.069 315.277 318.343 316.321 319.703C317.364 321.062 318.397 322.473 319.329 323.719C320.243 324.942 321.08 326.033 321.689 326.683L321.691 326.685C324.964 330.158 329.475 333.908 334.414 336.911C339.341 339.907 344.773 342.207 349.877 342.689H349.878C351.097 342.803 353.85 343.068 356.153 342.785C357.281 342.647 358.477 342.359 359.32 341.718C359.763 341.38 360.134 340.925 360.313 340.333C360.491 339.744 360.451 339.115 360.249 338.481C360.103 338.026 359.787 337.608 359.472 337.261C359.138 336.892 358.717 336.507 358.25 336.12C357.317 335.344 356.126 334.496 354.914 333.674C353.7 332.85 352.433 332.03 351.355 331.321C350.257 330.599 349.38 330.008 348.886 329.611C348.277 329.121 345.819 327.005 344.035 324.884C343.122 323.799 342.49 322.832 342.285 322.14C342.186 321.804 342.228 321.671 342.24 321.645C342.244 321.636 342.253 321.617 342.292 321.587C342.316 321.567 342.357 321.542 342.417 321.515C343.874 321.705 345.212 322.207 346.634 322.821C348.098 323.453 349.701 324.23 351.476 324.763H351.477C370.152 330.351 393.955 329.559 411.926 322.051L411.925 322.05C413.088 321.566 413.964 321.04 414.655 320.615C415.39 320.163 415.791 319.913 416.151 319.807C416.397 319.735 416.62 319.73 417.003 319.947C417.457 320.205 418.079 320.749 419.006 321.807C424.277 327.819 429.465 339.708 432.207 351.96C433.573 358.067 434.319 364.21 434.177 369.696C434.035 375.199 433.001 379.946 430.893 383.338L430.892 383.339C429.594 385.43 427.328 387.005 424.367 388.163C421.411 389.318 417.854 390.02 414.11 390.425C406.619 391.233 398.571 390.83 393.458 390.608H393.459C352.08 388.732 307.06 367.778 282.694 335.526L282.692 335.524L282.37 335.088C281.5 333.891 279.863 331.508 278.331 329.129C277.456 327.772 276.625 326.431 275.996 325.325C275.68 324.771 275.422 324.287 275.236 323.895C275.036 323.477 274.959 323.245 274.945 323.165L274.944 323.164L274.914 322.929C274.898 322.716 274.923 322.567 274.958 322.465C275.002 322.334 275.08 322.222 275.214 322.113C275.522 321.866 276.086 321.673 276.927 321.569C277.741 321.469 278.659 321.468 279.56 321.48C280.413 321.492 281.321 321.52 281.965 321.448L281.969 321.447C288.6 320.689 295.243 319.25 301.612 317.389V317.39C302.875 317.021 304.298 316.366 305.588 315.815C306.936 315.24 308.155 314.771 309.183 314.628L310.087 314.502Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-width=\"2\"/>\n<path d=\"M230.442 234.708C240.828 233.168 248.214 237.783 255.116 244.894L255.344 245.128L255.665 245.183C255.933 245.229 256.165 245.177 256.312 245.131C256.468 245.082 256.612 245.012 256.733 244.944C256.976 244.809 257.23 244.624 257.475 244.429C257.969 244.034 258.54 243.5 259.091 242.965C259.643 242.428 260.209 241.857 260.677 241.392C261.169 240.903 261.521 240.566 261.704 240.424V240.423C271.185 233.048 281.048 233.165 288.03 237.617C294.928 242.015 299.19 250.751 297.474 261.197L297.387 261.696C296.044 269.065 290.7 277.987 283.967 286.225C277.253 294.439 269.277 301.828 262.85 306.143L262.849 306.144C261.003 307.387 259.645 308.265 258.519 308.831C257.405 309.39 256.599 309.602 255.853 309.583C255.102 309.563 254.292 309.307 253.178 308.707C252.334 308.252 251.368 307.63 250.167 306.823L248.884 305.954L248.241 305.512C241.56 300.841 233.335 293.084 226.61 284.46C219.86 275.802 214.758 266.441 214.085 258.559L214.034 257.801C213.815 253.297 215.404 247.866 218.354 243.367C221.306 238.867 225.52 235.445 230.443 234.711L230.442 234.708Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-width=\"2\"/>\n<path d=\"M256.171 328.728C256.237 328.748 256.353 328.805 256.513 328.957C256.52 328.968 256.53 328.983 256.542 329.004C256.583 329.075 256.636 329.179 256.702 329.32C256.832 329.6 256.988 329.98 257.163 330.441C257.511 331.359 257.916 332.542 258.316 333.767C259.114 336.211 259.88 338.778 260.13 339.64V339.641C263.39 350.927 264.469 362.479 265.001 374.174C265.532 385.828 265.521 397.708 266.622 409.435V409.436C267.794 421.911 270.093 434.7 272.209 447.412C274.329 460.145 276.268 472.814 276.749 485.136V485.137C276.819 486.925 276.848 488.811 276.545 490.576C276.244 492.332 275.625 493.892 274.456 495.084L274.455 495.085C271.669 497.934 266.493 499.547 260.836 500.107C255.223 500.662 249.406 500.154 245.568 499.005H245.567C241.126 497.679 238.56 496.286 237.089 494.303C235.627 492.331 235.105 489.578 235.284 485.138V485.136C235.764 472.814 237.703 460.145 239.823 447.412C241.939 434.7 244.238 421.911 245.411 409.436C246.511 397.775 246.504 385.969 247.025 374.378C247.531 363.111 248.536 351.97 251.508 341.058L251.801 340.003C252.169 338.715 252.766 336.515 253.426 334.377C254.099 332.198 254.789 330.254 255.314 329.398C255.593 328.951 255.856 328.771 256.003 328.727C256.061 328.71 256.111 328.709 256.171 328.728Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-width=\"2\"/>\n<path d=\"M199.508 226.875C202.714 226.464 204.169 226.99 204.792 227.645C205.396 228.28 205.557 229.405 205.149 231.166C204.752 232.875 203.896 234.852 202.963 236.831C202.054 238.76 201.051 240.73 200.478 242.27C192.49 263.725 199.666 282.972 216.214 297.876V297.877C216.875 298.472 217.699 299.043 218.489 299.587C219.3 300.146 220.09 300.687 220.781 301.264C222.158 302.413 222.818 303.439 222.629 304.599C222.621 304.609 222.614 304.625 222.597 304.641C222.549 304.686 222.462 304.749 222.317 304.817C222.019 304.956 221.57 305.076 220.965 305.155C219.76 305.312 218.16 305.282 216.452 305.14C213.046 304.856 209.449 304.145 208.216 303.798C199.268 301.239 190.468 295.891 183.892 288.843C177.316 281.795 173.017 273.108 172.929 263.868C172.86 256.575 175.356 247.82 179.986 240.627C184.614 233.435 191.287 227.934 199.509 226.876L199.508 226.875Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-width=\"2\"/>\n<path d=\"M309.039 226.722C310.645 226.553 312.541 226.819 314.478 227.352C316.724 227.969 318.921 228.916 320.599 229.811V229.81C329.46 234.55 335.264 243.383 337.596 253.159C339.929 262.939 338.758 273.547 333.809 281.752C330.254 287.635 323.191 294.139 315.106 298.84C307.257 303.403 298.649 306.15 291.535 305.155L290.851 305.048C290.016 304.901 289.547 304.701 289.303 304.53C289.098 304.386 289.094 304.297 289.091 304.258C289.085 304.158 289.12 303.942 289.334 303.579C289.54 303.228 289.864 302.827 290.287 302.39C291.132 301.515 292.261 300.612 293.318 299.81C294.322 299.05 295.349 298.321 295.818 297.898C312.109 283.227 319.295 264.347 311.917 243.296L311.554 242.291C311.169 241.251 310.589 240.017 309.982 238.734C309.367 237.434 308.713 236.063 308.144 234.694C307.574 233.324 307.105 231.995 306.851 230.787C306.595 229.568 306.579 228.566 306.818 227.804C306.84 227.735 306.968 227.534 307.312 227.299C307.633 227.08 307.991 226.934 308.231 226.887L309.039 226.728V226.722Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-width=\"2\"/>\n<path d=\"M192.37 382.762C194.014 382.425 196.295 382.469 199.415 383.004H199.416C206.346 384.186 214.007 387.663 220.263 392.603C226.527 397.549 231.27 403.87 232.559 410.685V410.686C232.731 411.59 232.712 412.138 232.634 412.442C232.569 412.695 232.489 412.713 232.464 412.723C232.366 412.761 232.125 412.792 231.662 412.681C231.218 412.574 230.677 412.361 230.064 412.058C228.84 411.451 227.468 410.557 226.206 409.694C224.989 408.863 223.812 408.015 223.102 407.608L223.1 407.607L221.616 406.762C220.095 405.899 218.464 405.008 216.779 404.276C214.78 403.409 212.647 402.741 210.444 402.609L210.439 402.585H209.609L209.611 403.589L208.657 403.799C210.054 410.191 214.694 415.758 219.328 420.033C219.811 420.479 220.67 421.147 221.623 421.888C222.597 422.645 223.711 423.509 224.763 424.382C225.819 425.26 226.78 426.121 227.459 426.87C227.799 427.246 228.042 427.565 228.19 427.82C228.312 428.029 228.33 428.128 228.334 428.141C228.304 428.428 228.204 428.605 228.066 428.738C227.909 428.891 227.646 429.04 227.23 429.149C226.379 429.373 225.155 429.359 223.748 429.169C220.964 428.793 217.906 427.795 216.757 427.357V427.357L216.146 427.118C209.843 424.592 203.711 420.125 198.835 414.646C193.957 409.164 190.386 402.727 189.123 396.296L189.009 395.674C188.558 393.059 188.273 390.815 188.28 388.946C188.288 387.069 188.59 385.685 189.21 384.708C189.803 383.773 190.762 383.091 192.37 382.762Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-width=\"2\"/>\n<path d=\"M312.6 383.002C315.87 382.442 318.224 382.387 319.896 382.72C321.528 383.046 322.456 383.727 323.011 384.65C323.596 385.625 323.853 387.012 323.816 388.908C323.78 390.792 323.458 393.047 323.006 395.672V395.673C321.784 402.785 316.767 411.127 309.993 417.767C303.214 424.413 294.866 429.168 287.126 429.389C285.738 429.429 284.838 429.317 284.292 429.139C284.025 429.053 283.882 428.962 283.81 428.901C283.747 428.848 283.736 428.815 283.732 428.801C283.717 428.747 283.698 428.524 283.961 428.037C284.211 427.574 284.634 427.024 285.203 426.412C286.337 425.191 287.901 423.878 289.353 422.719C290.751 421.603 292.124 420.574 292.709 420.03L292.708 420.029C297.342 415.753 301.982 410.189 303.378 403.797L303.643 402.584H302.381C297.426 402.565 292.699 405.439 288.896 407.605C288.255 407.969 287.422 408.543 286.547 409.147C285.653 409.764 284.684 410.434 283.716 411.037C282.743 411.642 281.81 412.154 280.998 412.467C280.145 412.796 279.617 412.829 279.345 412.742H279.346C279.344 412.742 279.348 412.754 279.332 412.721C279.299 412.654 279.254 412.497 279.254 412.203C279.253 411.609 279.432 410.779 279.733 409.833C280.329 407.963 281.283 405.991 281.635 405.24L281.636 405.238C286.992 393.724 299.592 385.229 312.6 383.002Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-width=\"2\"/>\n</svg>";
35
+ declare const PLANTASIA_LOGO_SVG = "<svg width=\"512\" height=\"512\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M18.251 13.7952C18.0325 14.0384 17.8159 14.2658 17.6094 14.4739C17.6056 14.4777 17.6015 14.4819 17.5977 14.4856L13.7539 18.2317L13.7529 18.2307C13.5405 18.4596 13.288 18.6481 13.0039 18.7795C12.694 18.9229 12.3563 18.9981 12.0146 19.0002C11.6731 19.0024 11.3351 18.9316 11.0234 18.7922C10.7337 18.6627 10.4749 18.4749 10.2578 18.2444V18.2454L6.40137 14.4846C6.39777 14.4811 6.39417 14.4774 6.39062 14.4739C6.18402 14.2657 5.96764 14.0383 5.74902 13.7952C7.52419 14.1301 9.67799 14.3274 12 14.3274C14.322 14.3274 16.4758 14.1301 18.251 13.7952ZM11.0605 17.636C11.0804 17.6541 11.1022 17.6698 11.123 17.6868C11.0933 17.6626 11.0642 17.6377 11.0361 17.6116L11.0605 17.636ZM4 10.0002C4 10.0134 4.00244 10.0263 4.00293 10.0393C4.00578 10.1297 4.01169 10.2188 4.01953 10.3069C3.30578 10.5291 2.76639 10.768 2.40625 11.0002C2.16055 11.1587 2.06013 11.2711 2.02051 11.3274C2.06018 11.3837 2.16065 11.4962 2.40625 11.6545C2.84099 11.9348 3.53686 12.225 4.48535 12.4836C4.58935 12.512 4.69604 12.5385 4.80469 12.5657C5.08654 13.0215 5.41864 13.4278 5.74902 13.7952C2.87993 13.2538 1.00019 12.3509 1 11.3274C1 10.5302 2.14025 9.80607 4 9.2688V10.0002ZM20 9.2688C21.8597 9.80607 23 10.5302 23 11.3274C22.9998 12.3509 21.1201 13.2538 18.251 13.7952C18.5804 13.4283 18.9092 13.0211 19.1904 12.5667C19.3007 12.539 19.4091 12.5124 19.5146 12.4836C20.4631 12.225 21.159 11.9348 21.5938 11.6545C21.8387 11.4966 21.9386 11.3839 21.9785 11.3274C21.9387 11.271 21.8388 11.1583 21.5938 11.0002C21.2332 10.7677 20.6926 10.5293 19.9775 10.3069C19.9842 10.2327 19.993 10.1581 19.9961 10.0823V10.0393C19.9966 10.0263 20 10.0134 20 10.0002V9.2688ZM17.2676 13.3899L16.9004 13.7688C17.0244 13.6438 17.1472 13.5155 17.2695 13.386C17.2686 13.387 17.2685 13.3889 17.2676 13.3899ZM14.0098 5.13892C14.9671 4.90416 15.9729 4.9684 16.8926 5.32349C17.8122 5.67859 18.6016 6.30757 19.1562 7.12427C19.7096 7.93936 20.0036 8.90394 20 9.88989L19.9961 10.0393C19.9925 10.1294 19.9799 10.2166 19.9541 10.2991C19.962 10.3015 19.9697 10.3044 19.9775 10.3069C19.9007 11.1648 19.595 11.913 19.1904 12.5667C17.3326 13.0315 14.808 13.3274 12 13.3274C9.18954 13.3274 6.66293 13.0312 4.80469 12.5657C4.40147 11.9136 4.096 11.1655 4.01953 10.3069C4.02796 10.3043 4.03644 10.3017 4.04492 10.2991C4.01917 10.2167 4.00632 10.1294 4.00293 10.0393C4.00137 9.98985 4 9.94006 4 9.88989C4.00011 8.9048 4.29675 7.94213 4.85156 7.12915C5.40668 6.31588 6.19508 5.69037 7.1123 5.33618C8.02953 4.98205 9.03199 4.9159 9.9873 5.14771C10.7328 5.32862 11.4202 5.68551 11.998 6.18188C12.5752 5.68195 13.263 5.32209 14.0098 5.13892ZM19 9.88989L18.9932 9.63208C18.9924 9.62034 18.9911 9.60865 18.9902 9.59692C18.9971 9.69418 19.0005 9.7919 19 9.88989ZM18.3291 7.68579L18.1777 7.47778C18.1733 7.47213 18.1685 7.4668 18.1641 7.46118C18.2214 7.53383 18.2768 7.60879 18.3291 7.68579Z\" fill=\"currentColor\"/>\n</svg>";
36
36
  /** The mark with every currentColor fill and stroke set to `colorHex`. */
37
37
  declare function tintedLogoSvg(colorHex: string): string;
38
38