- inspectorCollapsed 시작값 true · 펼치기 단추 그대로 - 새로 열 때 data-collapsed=true · 패널 폭 0 · 펼치기 300px 확인 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013rJwJMVL4EE31y77TB11AP
58 lines
1.8 KiB
TypeScript
58 lines
1.8 KiB
TypeScript
/**
|
|
* 화면 표시 상태 — 명령(레지스트리)에서도 팔레트를 열 수 있어야 해서
|
|
* 리액트 컴포넌트 바깥에 둔다. 값이 바뀌면 UPDATE_STATE로 다시 그린다.
|
|
*/
|
|
import { HtmlEvent } from '../App.types';
|
|
import { notifyWindow } from '../state';
|
|
|
|
export type InspectorTab = 'properties' | 'layers';
|
|
|
|
let inspectorTab: InspectorTab = 'layers';
|
|
/** 특성·도면층 패널은 닫힌 채 시작 — 펼치기 단추로 연다. */
|
|
let inspectorCollapsed = true;
|
|
let quickPropertiesVisible = false;
|
|
let activeRibbonTab = 'home';
|
|
let blockLibraryVisible = false;
|
|
/** 호스트(M02)가 처음부터 접어 실을 때 true — 탭을 누르면 펼침(`setActiveRibbonTab`). */
|
|
let ribbonCollapsed = false;
|
|
|
|
const notify = () => notifyWindow(HtmlEvent.UPDATE_STATE);
|
|
|
|
export const getInspectorTab = () => inspectorTab;
|
|
export const isInspectorCollapsed = () => inspectorCollapsed;
|
|
export const isQuickPropertiesVisible = () => quickPropertiesVisible;
|
|
export const getActiveRibbonTab = () => activeRibbonTab;
|
|
export const isBlockLibraryVisible = () => blockLibraryVisible;
|
|
export const isRibbonCollapsed = () => ribbonCollapsed;
|
|
|
|
export function setActiveRibbonTab(tabId: string): void {
|
|
activeRibbonTab = tabId;
|
|
notify();
|
|
}
|
|
|
|
export function setRibbonCollapsed(collapsed: boolean): void {
|
|
ribbonCollapsed = collapsed;
|
|
notify();
|
|
}
|
|
|
|
export function openInspector(tab: InspectorTab): void {
|
|
inspectorTab = tab;
|
|
inspectorCollapsed = false;
|
|
notify();
|
|
}
|
|
|
|
export function setInspectorCollapsed(collapsed: boolean): void {
|
|
inspectorCollapsed = collapsed;
|
|
notify();
|
|
}
|
|
|
|
export function setQuickPropertiesVisible(visible: boolean): void {
|
|
quickPropertiesVisible = visible;
|
|
notify();
|
|
}
|
|
|
|
export function setBlockLibraryVisible(visible: boolean): void {
|
|
blockLibraryVisible = visible;
|
|
notify();
|
|
}
|