feat: multi-material overlays, presentation guides, and release prebuilds

Align control/presentation with presentation screen rect and darkness z-order; sync window titles and session window cleanup. Pack Win/Mac/Linux with npmRebuild disabled and release-native-prep for classic-level and sharp.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ivan Fontosh
2026-08-03 11:28:18 +08:00
parent 61446dacfc
commit 2979d06f1c
41 changed files with 1060 additions and 252 deletions
+23 -8
View File
@@ -14,13 +14,14 @@ export type MaterialsOverlayLayout = {
export type MaterialsZoomTool = 'zoomIn' | 'zoomOut' | null;
/** Session-only: какой материал сейчас показан поверх сцены. */
/** Session-only: какие материалы сейчас показаны поверх сцены. */
export type MaterialsOverlayState = {
revision: number;
activeMaterialId: MaterialId | null;
layout: MaterialsOverlayLayout;
/** Раскладка блока описаний легенды (если материал с легендой). */
legendLayout: MaterialsOverlayLayout;
activeMaterialIds: MaterialId[];
layouts: Record<string, MaterialsOverlayLayout>;
/** Раскладка блока описаний легенды по materialId. */
legendLayouts: Record<string, MaterialsOverlayLayout>;
focusMaterialId: MaterialId | null;
zoomTool: MaterialsZoomTool;
};
@@ -35,10 +36,10 @@ export type MaterialsOverlayEvent =
| { kind: 'show'; materialId: MaterialId; rotationDeg?: number }
| { kind: 'hide' }
| { kind: 'toggle'; materialId: MaterialId; rotationDeg?: number }
| { kind: 'layout.set'; layout: MaterialsOverlayLayout }
| { kind: 'legendLayout.set'; layout: MaterialsOverlayLayout }
| { kind: 'layout.set'; materialId: MaterialId; layout: MaterialsOverlayLayout }
| { kind: 'legendLayout.set'; materialId: MaterialId; layout: MaterialsOverlayLayout }
| { kind: 'zoomTool.set'; tool: MaterialsZoomTool }
| { kind: 'zoomAt'; nx: number; ny: number };
| { kind: 'zoomAt'; nx: number; ny: number; materialId?: MaterialId };
/** Нормализация угла в диапазон [0, 360). */
export function normalizeMaterialsRotation(deg: number): number {
@@ -73,3 +74,17 @@ export function zoomMaterialsLayoutAt(
scale: clamped.scale,
});
}
function initialLegendLayout(): MaterialsOverlayLayout {
return clampMaterialsLayout({
...DEFAULT_MATERIALS_OVERLAY_LAYOUT,
cx: 0.82,
cy: 0.5,
scale: 0.85,
rotationDeg: 0,
});
}
export function defaultLegendLayoutForMaterial(): MaterialsOverlayLayout {
return initialLegendLayout();
}