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:
@@ -59,7 +59,7 @@ export function MaterialsApp() {
|
||||
useEffect(() => {
|
||||
const onKey = (e: KeyboardEvent) => {
|
||||
if (e.key === 'Escape') {
|
||||
if (overlay?.activeMaterialId) {
|
||||
if ((overlay?.activeMaterialIds?.length ?? 0) > 0) {
|
||||
void overlayApi.dispatch({ kind: 'hide' });
|
||||
return;
|
||||
}
|
||||
@@ -72,10 +72,10 @@ export function MaterialsApp() {
|
||||
};
|
||||
window.addEventListener('keydown', onKey);
|
||||
return () => window.removeEventListener('keydown', onKey);
|
||||
}, [overlay?.activeMaterialId, overlay?.zoomTool, overlayApi]);
|
||||
}, [overlay?.activeMaterialIds, overlay?.zoomTool, overlayApi]);
|
||||
|
||||
const materials = session?.project?.materials ?? [];
|
||||
const activeId = overlay?.activeMaterialId ?? null;
|
||||
const activeIds = overlay?.activeMaterialIds ?? [];
|
||||
const zoomTool = overlay?.zoomTool ?? null;
|
||||
|
||||
return (
|
||||
@@ -88,7 +88,7 @@ export function MaterialsApp() {
|
||||
materials={materials}
|
||||
selectedId={selectedId}
|
||||
onSelect={onSelect}
|
||||
activeMaterialId={activeId}
|
||||
activeMaterialIds={activeIds}
|
||||
onTileActivate={(id) => {
|
||||
const mat = materials.find((m) => m.id === id);
|
||||
void overlayApi.dispatch({
|
||||
@@ -99,7 +99,7 @@ export function MaterialsApp() {
|
||||
}}
|
||||
toolbar={
|
||||
<>
|
||||
<div className={matStyles.browserToolbarRow}>
|
||||
<div className={matStyles.browserToolbarZoomRow}>
|
||||
<Button
|
||||
variant={zoomTool === 'zoomIn' ? 'primary' : 'ghost'}
|
||||
iconOnly
|
||||
@@ -131,17 +131,19 @@ export function MaterialsApp() {
|
||||
<ZoomOutIcon />
|
||||
</Button>
|
||||
</div>
|
||||
{activeId ? (
|
||||
<Button
|
||||
title={t('materials.closeOverlay')}
|
||||
ariaLabel={t('materials.closeOverlay')}
|
||||
tooltipPlacement="bottom"
|
||||
onClick={() => {
|
||||
void overlayApi.dispatch({ kind: 'hide' });
|
||||
}}
|
||||
>
|
||||
{t('materials.closeOverlay')}
|
||||
</Button>
|
||||
{activeIds.length > 0 ? (
|
||||
<div className={matStyles.browserToolbarFullBtn}>
|
||||
<Button
|
||||
title={t('materials.closeOverlay')}
|
||||
ariaLabel={t('materials.closeOverlay')}
|
||||
tooltipPlacement="bottom"
|
||||
onClick={() => {
|
||||
void overlayApi.dispatch({ kind: 'hide' });
|
||||
}}
|
||||
>
|
||||
{t('materials.closeOverlay')}
|
||||
</Button>
|
||||
</div>
|
||||
) : null}
|
||||
<div className={matStyles.browserToolbarHint}>
|
||||
{zoomTool === 'zoomIn'
|
||||
|
||||
Reference in New Issue
Block a user