feat(CAD): 337-1 가-1 옵션 틀 — 물음 꼴 · 친 글 사다리 한 곳 · 명령 끝 → 쉼 · 순서 엔진 v2 · 키보드 흠
- 새 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
This commit is contained in:
@@ -8,13 +8,13 @@ import {
|
||||
HtmlEvent,
|
||||
type Layer,
|
||||
type SnapPoint,
|
||||
type StateMetaData,
|
||||
} from './App.types';
|
||||
import type { ScreenCanvasDrawController } from './drawControllers/screenCanvas.drawController';
|
||||
import type { Entity } from './entities/Entity';
|
||||
import { bumpSceneVersion } from './helpers/scene-version';
|
||||
import { StateVariable, type UndoState, createStack } from './helpers/undo-stack';
|
||||
import type { InputController } from './inputController/input-controller.ts'; // state variables
|
||||
import { type PromptMeta, renderPrompt, rememberPoint, resolvePrompt } from './commands/prompt';
|
||||
|
||||
// state variables
|
||||
/**
|
||||
@@ -285,6 +285,11 @@ export const isOriginMarker = (): boolean => originMarker;
|
||||
export const setCanvas = (newCanvas: HTMLCanvasElement) => {
|
||||
canvas = newCanvas;
|
||||
};
|
||||
let commandEndHook: (() => void) | null = null;
|
||||
/** 도구 머신이 final 에 들 때 부를 것(한 곳) */
|
||||
export const setCommandEndHook = (hook: () => void) => {
|
||||
commandEndHook = hook;
|
||||
};
|
||||
export const setActiveToolActor = (
|
||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
||||
newToolActor: Actor<any>,
|
||||
@@ -297,8 +302,14 @@ export const setActiveToolActor = (
|
||||
activeToolActor.subscribe({
|
||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
||||
next: (state: MachineSnapshot<any, any, any, any, any, any, any, any>) => {
|
||||
const stateInstructions = Object.values(state?.getMeta() as Record<string, StateMetaData>)[0]
|
||||
?.instructions;
|
||||
// 명령 끝(final) → 쉬는 상태로(`tools/factories/end-command.ts` 가 갈고리를 붙임)
|
||||
if (state?.status === 'done') {
|
||||
if (activeToolActor === newToolActor) commandEndHook?.();
|
||||
return;
|
||||
}
|
||||
const meta = Object.values(state?.getMeta() as Record<string, PromptMeta>)[0];
|
||||
const prompt = resolvePrompt(meta?.prompt, state.context);
|
||||
const stateInstructions = prompt ? renderPrompt(prompt, meta?.kind) : meta?.instructions;
|
||||
|
||||
if (getLastStateInstructions() === stateInstructions) {
|
||||
return;
|
||||
@@ -418,6 +429,7 @@ export const setSnapPointOnAngleGuide = (newSnapPointOnAngleGuide: SnapPoint | n
|
||||
};
|
||||
export const setAngleGuideOriginPoint = (newAngleGuideOriginPoint: Point | null) => {
|
||||
angleGuideOriginPoint = newAngleGuideOriginPoint;
|
||||
if (newAngleGuideOriginPoint) rememberPoint(newAngleGuideOriginPoint); // LASTPOINT
|
||||
};
|
||||
export const setHoveredSnapPoints = (newHoveredSnapPoints: HoverPoint[]) => {
|
||||
hoveredSnapPoints = newHoveredSnapPoints;
|
||||
|
||||
Reference in New Issue
Block a user