feat(ui): add docking, viewport controls and composed settings

Add shared dock layouts, navigation cube, range bands, progress actions and comparison surfaces. Extend toolbar menus and loading composition, and align tokens, registry entries, documentation and the living catalog.
This commit is contained in:
Codex
2026-10-29 09:38:25 +03:00
parent a6e6c8f2d9
commit cb534dbe39
51 changed files with 2273 additions and 336 deletions
+14
View File
@@ -0,0 +1,14 @@
import type { RectLike } from "./floating.js";
export type MenuPoint = {x:number;y:number};
/** Delay sibling activation only while the pointer advances through the corridor to the open menu. */
export function movingToMenu(origin:MenuPoint, previous:MenuPoint, current:MenuPoint, surface:RectLike):boolean {
const horizontal = origin.x < surface.left || origin.x > surface.right;
const edge = horizontal ? (origin.x < surface.left ? surface.left : surface.right) : (origin.y < surface.top ? surface.top : surface.bottom);
const a = horizontal ? {x:edge,y:surface.top-6} : {x:surface.left-6,y:edge};
const b = horizontal ? {x:edge,y:surface.bottom+6} : {x:surface.right+6,y:edge};
const cross=(p:MenuPoint,q:MenuPoint,v:MenuPoint)=>(q.x-p.x)*(v.y-p.y)-(q.y-p.y)*(v.x-p.x);
const signs=[cross(origin,a,current),cross(a,b,current),cross(b,origin,current)];
const inside=signs.every(v=>v>=-0.01)||signs.every(v=>v<=0.01);
const axis=horizontal?"x":"y";
return inside && Math.abs(current[axis]-edge)<Math.abs(previous[axis]-edge)-0.1;
}