- 새 src/commands/prompt.ts — PromptSpec · renderPrompt(키워드 물음은 「또는」 없음) · matchOption(initget 줄임) · 세션 기억 · OPT · SELECT_OBJECTS - 새 inputController/prompt-input.ts — routeTyped 사다리(점 · 옵션 묻는 중 명령 이름 거절 · 식 · 단위 거절 · 투명 ') · 알림 줄 · 덧물음 · cancelActiveCommand · undoCommand - 새 tools/factories/end-command.ts — final(END) 갈고리 → 같은 틱 선택 도구 · state.ts 갈고리 · LASTPOINT - sequence-tool v2 — ROUTE · id · prompt · when · next · options · keyword · loopFrom · escCommits · pickfirst · 확정 뒤 기본 끝 · Esc 늘 끝 - 흠 — N1 ②③ · N5 · N6 · N11 · N18(앞글자 실행 없앰) · H1(Ctrl · Alt 글자 안 쌓음 · Ctrl+C · X · Shift+C · Shift+V · 1) · 우클릭 = 쉴 때 반복 · SE 뺌 · ED 더함 - 시험 — cad-drive 도우미 · prompt-frame · prompt-contract · 옛 시험 손질(keyboard-chain · ime-sink · command-catalog · input-prefs-cad · eraser 녹화) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QfHKQs7J3hQELKMWQMUJEy
120 lines
3.1 KiB
TypeScript
120 lines
3.1 KiB
TypeScript
/** 빠른 실행 도구막대 · 출력 탭 명령 (파일 수명주기) */
|
|
import { toast } from 'react-toastify';
|
|
import { clearRecovery, restoreRecovery } from '../helpers/autosave';
|
|
import { exportEntitiesToJsonFile } from '../helpers/import-export-handlers/export-entities-to-json';
|
|
import { exportEntitiesToLocalStorage } from '../helpers/import-export-handlers/export-entities-to-local-storage';
|
|
import { requestDrawingExport, requestHostSave } from '../integration/aislo-drawing-bridge';
|
|
import { runSendSelectionTable } from '../integration/aislo-table-export';
|
|
import { exportEntitiesToPngFile } from '../helpers/import-export-handlers/export-entities-to-png';
|
|
import { exportEntitiesToSvgFile } from '../helpers/import-export-handlers/export-entities-to-svg';
|
|
import { redoCommand, undoCommand } from '../inputController/prompt-input';
|
|
import { isHostSave } from '../state';
|
|
import type { CadCommand } from './command.types';
|
|
|
|
export const FILE_COMMANDS: CadCommand[] = [
|
|
{
|
|
id: 'QSAVE',
|
|
label: '저장',
|
|
aliases: ['SAVE'],
|
|
glyph: '💾',
|
|
hint: '현재 도면을 브라우저에 저장한다',
|
|
run: () => {
|
|
if (isHostSave()) {
|
|
requestHostSave();
|
|
return '양식 저장 요청';
|
|
}
|
|
void exportEntitiesToLocalStorage().then(() => {
|
|
clearRecovery();
|
|
toast.success('도면을 저장했습니다.');
|
|
});
|
|
return '도면 저장';
|
|
},
|
|
},
|
|
{
|
|
id: 'RECOVER',
|
|
label: '백업 복구',
|
|
glyph: '⟲',
|
|
hint: '자동 백업된 마지막 편집을 되살린다',
|
|
run: () => {
|
|
void restoreRecovery();
|
|
return '백업 복구';
|
|
},
|
|
},
|
|
{
|
|
id: 'EXPORT',
|
|
label: 'JSON 내보내기',
|
|
aliases: ['EXP'],
|
|
glyph: '⭳',
|
|
hint: '도면을 JSON 파일로 내보낸다',
|
|
run: () => {
|
|
void exportEntitiesToJsonFile();
|
|
return 'JSON 내보내기';
|
|
},
|
|
},
|
|
{
|
|
id: 'EXPORTDXF',
|
|
label: 'DXF 내보내기',
|
|
glyph: '📐',
|
|
hint: '지금 도면을 DXF 파일로 내려받는다',
|
|
run: () => {
|
|
requestDrawingExport('dxf');
|
|
return 'DXF 내보내기';
|
|
},
|
|
},
|
|
{
|
|
id: 'EXPORTDWG',
|
|
label: 'DWG 내보내기',
|
|
glyph: '📁',
|
|
hint: '지금 도면을 DWG 파일로 내려받는다 (서버에 변환기가 있을 때)',
|
|
run: () => {
|
|
requestDrawingExport('dwg');
|
|
return 'DWG 내보내기';
|
|
},
|
|
},
|
|
{
|
|
id: 'EXPORTSVG',
|
|
label: 'SVG 내보내기',
|
|
glyph: '🖼',
|
|
run: () => {
|
|
exportEntitiesToSvgFile();
|
|
return 'SVG 내보내기';
|
|
},
|
|
},
|
|
{
|
|
id: 'EXPORTPNG',
|
|
label: 'PNG 내보내기',
|
|
glyph: '🏞',
|
|
run: () => {
|
|
void exportEntitiesToPngFile();
|
|
return 'PNG 내보내기';
|
|
},
|
|
},
|
|
{
|
|
id: 'TOAREA',
|
|
label: '면적산출로 보내기',
|
|
glyph: '▦',
|
|
hint: '고른 범위(표 · 선 표 · 글)를 면적산출 새 시트로 한 번 옮긴다',
|
|
needsSelection: true,
|
|
run: runSendSelectionTable,
|
|
},
|
|
{
|
|
id: 'UNDO',
|
|
label: '실행 취소',
|
|
aliases: ['U'],
|
|
glyph: '↶',
|
|
run: () => {
|
|
undoCommand(); // 끊고 뒤 되돌림 — Ctrl+Z 와 한 길
|
|
return '실행 취소';
|
|
},
|
|
},
|
|
{
|
|
id: 'REDO',
|
|
label: '다시 실행',
|
|
glyph: '↷',
|
|
run: () => {
|
|
redoCommand();
|
|
return '다시 실행';
|
|
},
|
|
},
|
|
];
|