/* Console 2.0 — The Console: right-edge 48px dock rail + one mutually-exclusive
drawer with three depth states (Peek 320 / Expand 520 / Full modal). */
function ModeSwitcher({ modes, modeId, setModeId }) {
const [open, setOpen] = React.useState(false);
const active = modes.find((m) => m.id === modeId) || modes[0];
const classes = ['Synth', 'Sequencer', 'Controller', 'Visual'];
return (
{open && (
{classes.map((cls) => {
const items = modes.filter((m) => m.cls === cls);
if (!items.length) return null;
return (
{cls}
{items.map((m) => (
))}
);
})}
)}
);
}
function Dock({ ctx, active, setActive, depth, setDepth }) {
const sections = window.DRAWERS;
const order = ['shape', 'feel', 'route', 'health', 'help'];
const iconBtn = (key) => {
const s = sections[key];
const on = active === key;
return (
);
};
const width = depth === 'expand' ? 520 : 320;
const full = depth === 'full';
const section = active ? sections[active] : null;
return (
{/* drawer */}
{section && (
)}
{/* rail */}
);
}
const dockMini = { width: 26, height: 24, borderRadius: 'var(--r-1)', border: '1px solid var(--line)', background: 'var(--bg-2)', color: 'var(--fg-mute)', cursor: 'pointer', fontSize: 11, lineHeight: 1 };
window.Dock = Dock;