feat(488-1 CAD 이름 · 안내 글): 도면층 → 레이어 · 선가중치 → 선 두께(CAD 안 글 · 툴팁 · 명령 목록 · 토씨 손봄 · 저장 열쇠 그대로) · 우측 위 안내 한 줄 「DWG · DXF 파일을 끌어다 놓거나 [삽입 → DWG 불러오기]」 · 시험 한 줄

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-19 22:07:07 +09:00
co-authored by Claude Opus 5.5
parent 37e3ee6126
commit add2887c30
18 changed files with 112 additions and 106 deletions
+1 -1
View File
@@ -540,7 +540,7 @@ body > canvas[data-id="canvas"] {
flex-direction: column;
align-items: flex-end;
gap: 2px;
max-width: 360px;
white-space: nowrap;
padding: 2px 4px;
border: 0;
background: transparent;
@@ -88,9 +88,9 @@
{"id": "PLACETABLE", "label": "표 놓기", "aliases": []},
{"id": "REVCLOUD", "label": "구름형 리비전", "aliases": []},
{"id": "ANNOSCALE", "label": "주석 축척", "aliases": []},
{"id": "LAYER", "label": "도면층 특성", "aliases": ["LA"]},
{"id": "LAYCURSET", "label": "현재 도면층 설정", "aliases": []},
{"id": "LAYOFF", "label": "도면층 끄기", "aliases": []},
{"id": "LAYER", "label": "레이어 특성", "aliases": ["LA"]},
{"id": "LAYCURSET", "label": "현재 레이어 설정", "aliases": []},
{"id": "LAYOFF", "label": "레이어 끄기", "aliases": []},
{"id": "LAYON", "label": "모두 켜기", "aliases": []},
{"id": "LAYFRZ", "label": "동결", "aliases": []},
{"id": "LAYTHW", "label": "동결 해제", "aliases": []},
@@ -99,16 +99,16 @@
{"id": "LAYISO", "label": "분리", "aliases": []},
{"id": "LAYUNISO", "label": "분리 해제", "aliases": []},
{"id": "LAYERP", "label": "이전 상태", "aliases": []},
{"id": "LAYERSTATE", "label": "도면층 상태 저장", "aliases": ["LAS"]},
{"id": "LAYERSTATERESTORE", "label": "도면층 상태 복원", "aliases": []},
{"id": "LAYMCH", "label": "도면층 일치", "aliases": []},
{"id": "LAYCUR", "label": "현재 도면층으로", "aliases": []},
{"id": "LAYMRG", "label": "도면층 병합", "aliases": []},
{"id": "LAYDEL", "label": "도면층 삭제", "aliases": []},
{"id": "LAYWALK", "label": "도면층 탐색", "aliases": []},
{"id": "LAYERSTATE", "label": "레이어 상태 저장", "aliases": ["LAS"]},
{"id": "LAYERSTATERESTORE", "label": "레이어 상태 복원", "aliases": []},
{"id": "LAYMCH", "label": "레이어 일치", "aliases": []},
{"id": "LAYCUR", "label": "현재 레이어로", "aliases": []},
{"id": "LAYMRG", "label": "레이어 병합", "aliases": []},
{"id": "LAYDEL", "label": "레이어 삭제", "aliases": []},
{"id": "LAYWALK", "label": "레이어 탐색", "aliases": []},
{"id": "COLOR", "label": "색상", "aliases": ["COL"]},
{"id": "LINETYPE", "label": "선종류", "aliases": ["LT"]},
{"id": "LWEIGHT", "label": "선가중치", "aliases": ["LW"]},
{"id": "LWEIGHT", "label": "선 두께", "aliases": ["LW"]},
{"id": "PROPERTIES", "label": "특성", "aliases": ["CH", "MO", "PR"]},
{"id": "QUICKPROPERTIES", "label": "빠른 특성", "aliases": ["QP"]},
{"id": "TRANSPARENCY", "label": "투명도", "aliases": []},
@@ -25,25 +25,25 @@ import {
export const LAYER_COMMANDS: CadCommand[] = [
{
id: 'LAYER',
label: '도면층 특성',
label: '레이어 특성',
aliases: ['LA'],
glyph: '▤',
hint: '도면층을 만들고 이름·표시·잠금을 관리한다',
hint: '레이어를 만들고 이름·표시·잠금을 관리한다',
run: openLayerManager,
},
{
id: 'LAYCURSET',
label: '현재 도면층 설정',
label: '현재 레이어 설정',
glyph: '◉',
hint: '선택한 객체의 도면층을 현재 도면층으로 지정한다',
hint: '선택한 객체의 레이어를 현재 레이어로 지정한다',
tool: Tool.LAYER_CURRENT,
machine: layerCurrentToolStateMachine,
},
{
id: 'LAYOFF',
label: '도면층 끄기',
label: '레이어 끄기',
glyph: '◐',
hint: '선택 객체가 속한 도면층을 숨긴다',
hint: '선택 객체가 속한 레이어를 숨긴다',
tool: Tool.LAYOFF,
machine: layerOffToolStateMachine,
},
@@ -51,14 +51,14 @@ export const LAYER_COMMANDS: CadCommand[] = [
id: 'LAYON',
label: '모두 켜기',
glyph: '◉',
hint: '모든 도면층을 표시한다',
hint: '모든 레이어를 표시한다',
run: turnAllLayersOn,
},
{
id: 'LAYFRZ',
label: '동결',
glyph: '❄',
hint: '도면층을 표시·재생성 대상에서 뺀다',
hint: '레이어를 표시·재생성 대상에서 뺀다',
tool: Tool.LAYFRZ,
machine: layerFreezeToolStateMachine,
},
@@ -66,14 +66,14 @@ export const LAYER_COMMANDS: CadCommand[] = [
id: 'LAYTHW',
label: '동결 해제',
glyph: '☀',
hint: '모든 도면층의 동결을 푼다',
hint: '모든 레이어의 동결을 푼다',
run: thawAllLayers,
},
{
id: 'LAYLCK',
label: '잠금',
glyph: '🔒',
hint: '도면층 객체를 편집할 수 없게 한다',
hint: '레이어 객체를 편집할 수 없게 한다',
tool: Tool.LAYLCK,
machine: layerLockToolStateMachine,
},
@@ -81,7 +81,7 @@ export const LAYER_COMMANDS: CadCommand[] = [
id: 'LAYULK',
label: '잠금 해제',
glyph: '🔓',
hint: '도면층 잠금을 푼다',
hint: '레이어 잠금을 푼다',
tool: Tool.LAYULK,
machine: layerUnlockToolStateMachine,
},
@@ -89,7 +89,7 @@ export const LAYER_COMMANDS: CadCommand[] = [
id: 'LAYISO',
label: '분리',
glyph: '◫',
hint: '선택 객체의 도면층만 남기고 나머지를 숨긴다',
hint: '선택 객체의 레이어만 남기고 나머지를 숨긴다',
tool: Tool.LAYISO,
machine: layerIsolateToolStateMachine,
},
@@ -97,70 +97,70 @@ export const LAYER_COMMANDS: CadCommand[] = [
id: 'LAYUNISO',
label: '분리 해제',
glyph: '◻',
hint: '도면층 분리 이전 상태로 되돌린다',
hint: '레이어 분리 이전 상태로 되돌린다',
run: unisolateLayers,
},
{
id: 'LAYERP',
label: '이전 상태',
glyph: '↺',
hint: '직전 도면층 설정으로 되돌린다',
hint: '직전 레이어 설정으로 되돌린다',
run: restorePreviousLayers,
},
{
id: 'LAYERSTATE',
label: '도면층 상태 저장',
label: '레이어 상태 저장',
aliases: ['LAS'],
glyph: '💾',
hint: '현재 도면층 설정을 이름으로 저장한다',
hint: '현재 레이어 설정을 이름으로 저장한다',
tool: Tool.LAYERSTATE,
machine: layerStateSaveToolStateMachine,
},
{
id: 'LAYERSTATERESTORE',
label: '도면층 상태 복원',
label: '레이어 상태 복원',
glyph: '⭯',
hint: '저장한 도면층 설정을 되돌린다',
hint: '저장한 레이어 설정을 되돌린다',
tool: Tool.LAYERSTATE_RESTORE,
machine: layerStateRestoreToolStateMachine,
},
{
id: 'LAYMCH',
label: '도면층 일치',
label: '레이어 일치',
glyph: '⇄',
hint: '선택 객체를 대상 객체의 도면층으로 옮긴다',
hint: '선택 객체를 대상 객체의 레이어로 옮긴다',
tool: Tool.LAYMCH,
machine: layerMatchToolStateMachine,
},
{
id: 'LAYCUR',
label: '현재 도면층으로',
label: '현재 레이어로',
glyph: '⇥',
hint: '선택 객체를 현재 도면층으로 옮긴다',
hint: '선택 객체를 현재 레이어로 옮긴다',
tool: Tool.LAYCUR,
machine: layerToCurrentToolStateMachine,
},
{
id: 'LAYMRG',
label: '도면층 병합',
label: '레이어 병합',
glyph: '⊎',
hint: '한 도면층의 객체를 다른 도면층으로 옮기고 원래 도면층을 지운다',
hint: '한 레이어의 객체를 다른 레이어로 옮기고 원래 레이어를 지운다',
tool: Tool.LAYMRG,
machine: layerMergeToolStateMachine,
},
{
id: 'LAYDEL',
label: '도면층 삭제',
label: '레이어 삭제',
glyph: '🗑',
hint: '선택한 도면층과 그 객체를 삭제한다',
hint: '선택한 레이어와 그 객체를 삭제한다',
tool: Tool.LAYDEL,
machine: layerDeleteToolStateMachine,
},
{
id: 'LAYWALK',
label: '도면층 탐색',
label: '레이어 탐색',
glyph: '👣',
hint: '부를 때마다 다음 도면층만 표시한다',
hint: '부를 때마다 다음 레이어만 표시한다',
run: walkLayers,
},
];
@@ -287,7 +287,7 @@ export const MODIFY_COMMANDS: CadCommand[] = [
id: 'SETBYLAYER',
label: 'ByLayer로',
glyph: '▤',
hint: '선택 객체의 특성을 도면층 값으로 되돌린다',
hint: '선택 객체의 특성을 레이어 값으로 되돌린다',
tool: Tool.SETBYLAYER,
machine: setByLayerToolStateMachine,
},
@@ -58,7 +58,7 @@ export const PROPERTY_COMMANDS: CadCommand[] = [
},
{
id: 'LWEIGHT',
label: '선가중치',
label: '선 두께',
aliases: ['LW'],
glyph: '▬',
hint: '선 굵기를 지정한다',
@@ -192,7 +192,7 @@ export const INQUIRY_COMMANDS: CadCommand[] = [
id: 'SELECTSIMILAR',
label: '유사 선택',
glyph: '⁝⁝',
hint: '같은 종류·색·도면층 객체를 모두 선택한다',
hint: '같은 종류·색·레이어 객체를 모두 선택한다',
tool: Tool.SELECTSIMILAR,
machine: selectSimilarToolStateMachine,
},
@@ -1,4 +1,4 @@
/** 화면 오른쪽 위 흐린 안내 — 오토캐드에서 저장한 파일을 끌어다 놓는 법 · 누르면 순서 (B07 · M02 양식 둘 다) */
/** 화면 오른쪽 위 흐린 안내 한 줄 — DWG · DXF 끌어다 놓기 · [삽입 → DWG 불러오기] · 누르면 순서 (B07 · M02 양식 둘 다) */
import { type FC, useState } from 'react';
import { isDrawingReadOnly } from '../state';
@@ -12,12 +12,12 @@ export const DropHint: FC = () => {
onClick={() => setOpen((value) => !value)}
title="오토캐드 도형을 이 화면에 붙이는 법"
>
오토캐드에서 WBLOCK(또는 DXFOUT)으로 저장 → 파일을 여기로 끌어다 놓기
DWG · DXF 파일을 끌어다 놓거나 [삽입 → DWG 불러오기]
{open && (
<span className="cad-drop-hint__steps">
<span>① 오토캐드에서 도형을 고르고 WBLOCK(또는 DXFOUT) 입력 → 파일 이름 정해 저장</span>
<span>② 저장한 파일(도면 파일 통째도 됨)을 이 화면으로 끌어다 놓기</span>
<span>③ 원래 좌표 · 도면층 그대로 붙고 골라진 상태 — 되돌리기 한 번에 빠짐</span>
<span>② 저장한 파일(도면 파일 통째도 됨)을 끌어다 놓기 · [삽입 → DWG 불러오기]</span>
<span>③ 원래 좌표 · 레이어 그대로 붙고 골라진 상태 — 되돌리기 한 번에 빠짐</span>
</span>
)}
</button>
@@ -40,7 +40,7 @@ export const InspectorPanel: FC<InspectorPanelProps> = ({ collapsed, onToggleCol
data-active={tab === 'layers'}
onClick={() => openInspector('layers')}
>
도면층
레이어
</button>
</div>
{tab === 'properties' ? (
@@ -161,9 +161,9 @@ export const LayerManager: FC<LayerManagerProps> = ({
))}
</div>
<Button
label="새 도면층"
label="새 레이어"
iconName={IconName.FolderPlus}
title="도면층을 새로 만든다"
title="레이어를 새로 만든다"
onClick={(evt) => handleCreateNewLayer(evt)}
className="w-full mt-2"
/>
@@ -49,7 +49,7 @@ export const PropertiesEditor: FC<PropertiesEditorProps> = ({ compact = false })
</label>
<label>
<span>선가중치</span>
<span>선 두께</span>
<select
value={first.lineWidth}
onChange={(event) =>
@@ -86,7 +86,7 @@ export const PropertiesEditor: FC<PropertiesEditorProps> = ({ compact = false })
</label>
<label>
<span>도면층</span>
<span>레이어</span>
<select
value={first.layerId}
onChange={(event) =>
@@ -82,8 +82,8 @@ export const PropertiesWidget: FC = () => {
}}
/>
</label>
<label className="cad-prop" title="선가중치 (LWEIGHT)">
<span>선가중치</span>
<label className="cad-prop" title="선 두께 (LWEIGHT)">
<span>선 두께</span>
<select
value={lineWidth}
onChange={(event) => {
@@ -130,10 +130,10 @@ export const LayersWidget: FC = () => {
return (
<div className="cad-ribbon-props">
<label className="cad-prop cad-prop--wide" title="현재 도면층">
<span>현재 도면층</span>
<label className="cad-prop cad-prop--wide" title="현재 레이어">
<span>현재 레이어</span>
<select value={activeLayerId} onChange={(event) => setActiveLayerId(event.target.value)}>
{/* 잠금 도면층(배경)은 고를 수 없으니 보여 주지 않는다. 현재 층이 잠금이면
{/* 잠금 레이어(배경)는 고를 수 없으니 보여 주지 않는다. 현재 층이 잠금이면
(전부 잠금인 도면) 표시가 비지 않게 그 항목만 남긴다. */}
{layers
.filter((layer) => !layer.isLocked || layer.id === activeLayerId)
@@ -148,11 +148,11 @@ export const LayersWidget: FC = () => {
type="button"
className="cad-tool"
data-size="small"
title="도면층 특성 관리자 (LAYER)"
title="레이어 특성 관리자 (LAYER)"
onClick={() => runCommandInput('LAYER')}
>
<span className="cad-tool__glyph">▤</span>
<span className="cad-tool__label">도면층</span>
<span className="cad-tool__label">레이어</span>
</button>
</div>
);
@@ -30,7 +30,7 @@ export function drawEntities(drawController: DrawController, entities: Entity[])
continue;
}
if (!layer?.isVisible || layer.isFrozen) {
continue; // 꺼졌거나 동결된 도면층은 그리지 않는다
continue; // 꺼졌거나 동결된 레이어는 그리지 않는다
}
if (isEntityHidden(entity)) {
continue; // ISOLATEOBJECTS·HIDEOBJECTS로 숨긴 객체
@@ -6,6 +6,6 @@ export function getNewLayer(): Layer {
id: crypto.randomUUID(),
isLocked: false,
isVisible: true,
name: `새 도면층 ${getLayers().length}${1}`,
name: `새 레이어 ${getLayers().length}${1}`,
};
}
@@ -86,7 +86,7 @@ export const RIBBON_TABS: RibbonTab[] = [
],
},
{
label: '도면층',
label: '레이어',
widget: 'layers',
overflow: [
'LAYCURSET',
@@ -62,7 +62,7 @@ const DISTANCE_PROMPT = (): PromptSpec => {
return {
text: '간격띄우기 거리 지정',
options: [THROUGH, option('ERASE', 'E', '지우기')],
absent: [option('LAYER', 'L', '도면층')],
absent: [option('LAYER', 'L', '레이어')],
default:
distance === null
? { kind: 'option', key: 'THROUGH' }
@@ -78,7 +78,7 @@ export const setByLayerToolStateMachine = createSequenceTool({
}
setEntities([...getEntities()], true);
setSelectedEntityIds([]);
toast.success(`${applied}개 객체를 도면층 특성으로 되돌렸습니다.`);
toast.success(`${applied}개 객체를 레이어 특성으로 되돌렸습니다.`);
},
});
@@ -35,145 +35,145 @@ const layerNameOf = (layerId: string): string =>
/** LAYER — 도면층 특성 관리자(좌측 팔레트)를 연다 */
export function openLayerManager(): string {
openInspector('layers');
return '도면층 관리자';
return '레이어 관리자';
}
export const layerCurrentToolStateMachine = createSequenceTool({
tool: Tool.LAYER_CURRENT,
helpers: false,
steps: [{ kind: 'entity', instructions: '현재 도면층으로 지정할 객체를 선택하십시오.' }],
steps: [{ kind: 'entity', instructions: '현재 레이어로 지정할 객체를 선택하십시오.' }],
commit: (input) => {
const layerId = input.entity(0).layerId;
setActiveLayerId(layerId);
toast.success(`현재 도면층: ${layerNameOf(layerId)}`);
toast.success(`현재 레이어: ${layerNameOf(layerId)}`);
},
});
export const layerOffToolStateMachine = createSequenceTool({
tool: Tool.LAYOFF,
helpers: false,
steps: [{ kind: 'entity', instructions: '끌 도면층의 객체를 선택하십시오.' }],
steps: [{ kind: 'entity', instructions: '끌 레이어의 객체를 선택하십시오.' }],
commit: (input) => {
const layerId = input.entity(0).layerId;
updateLayers((layers) =>
layers.map((layer) => (layer.id === layerId ? { ...layer, isVisible: false } : layer))
);
toast.info(`도면층 끄기: ${layerNameOf(layerId)}`);
toast.info(`레이어 끄기: ${layerNameOf(layerId)}`);
},
});
/** LAYON — 모든 도면층 켜기 */
export function turnAllLayersOn(): string {
updateLayers((layers) => layers.map((layer) => ({ ...layer, isVisible: true })));
toast.success('모든 도면층을 켰습니다.');
return '모든 도면층 켜기';
toast.success('모든 레이어를 켰습니다.');
return '모든 레이어 켜기';
}
export const layerFreezeToolStateMachine = createSequenceTool({
tool: Tool.LAYFRZ,
helpers: false,
steps: [{ kind: 'entity', instructions: '동결할 도면층의 객체를 선택하십시오.' }],
steps: [{ kind: 'entity', instructions: '동결할 레이어의 객체를 선택하십시오.' }],
commit: (input) => {
const layerId = input.entity(0).layerId;
if (layerId === getActiveLayerId()) {
toast.warn('현재 도면층은 동결할 수 없습니다.');
toast.warn('현재 레이어는 동결할 수 없습니다.');
return;
}
updateLayers((layers) =>
layers.map((layer) => (layer.id === layerId ? { ...layer, isFrozen: true } : layer))
);
toast.info(`도면층 동결: ${layerNameOf(layerId)}`);
toast.info(`레이어 동결: ${layerNameOf(layerId)}`);
},
});
/** LAYTHW — 모든 도면층 동결 해제 */
export function thawAllLayers(): string {
updateLayers((layers) => layers.map((layer) => ({ ...layer, isFrozen: false })));
toast.success('모든 도면층을 동결 해제했습니다.');
toast.success('모든 레이어를 동결 해제했습니다.');
return '동결 해제';
}
export const layerLockToolStateMachine = createSequenceTool({
tool: Tool.LAYLCK,
helpers: false,
steps: [{ kind: 'entity', instructions: '잠글 도면층의 객체를 선택하십시오.' }],
steps: [{ kind: 'entity', instructions: '잠글 레이어의 객체를 선택하십시오.' }],
commit: (input) => {
const layerId = input.entity(0).layerId;
updateLayers((layers) =>
layers.map((layer) => (layer.id === layerId ? { ...layer, isLocked: true } : layer))
);
toast.info(`도면층 잠금: ${layerNameOf(layerId)}`);
toast.info(`레이어 잠금: ${layerNameOf(layerId)}`);
},
});
export const layerUnlockToolStateMachine = createSequenceTool({
tool: Tool.LAYULK,
helpers: false,
steps: [{ kind: 'entity', instructions: '잠금 해제할 도면층의 객체를 선택하십시오.' }],
steps: [{ kind: 'entity', instructions: '잠금 해제할 레이어의 객체를 선택하십시오.' }],
commit: (input) => {
const layerId = input.entity(0).layerId;
updateLayers((layers) =>
layers.map((layer) => (layer.id === layerId ? { ...layer, isLocked: false } : layer))
);
toast.success(`도면층 잠금 해제: ${layerNameOf(layerId)}`);
toast.success(`레이어 잠금 해제: ${layerNameOf(layerId)}`);
},
});
export const layerIsolateToolStateMachine = createSequenceTool({
tool: Tool.LAYISO,
helpers: false,
steps: [{ kind: 'entity', instructions: '남길 도면층의 객체를 선택하십시오.' }],
steps: [{ kind: 'entity', instructions: '남길 레이어의 객체를 선택하십시오.' }],
commit: (input) => {
const layerId = input.entity(0).layerId;
updateLayers((layers) =>
layers.map((layer) => ({ ...layer, isVisible: layer.id === layerId }))
);
toast.info(`도면층 분리: ${layerNameOf(layerId)}`);
toast.info(`레이어 분리: ${layerNameOf(layerId)}`);
},
});
/** LAYUNISO — 도면층 분리 해제 */
export function unisolateLayers(): string {
updateLayers((layers) => layers.map((layer) => ({ ...layer, isVisible: true })));
toast.success('도면층 분리를 해제했습니다.');
return '도면층 분리 해제';
toast.success('레이어 분리를 해제했습니다.');
return '레이어 분리 해제';
}
/** LAYERP — 직전 도면층 상태로 되돌리기 */
export function restorePreviousLayers(): string {
const previous = popLayerHistory();
if (!previous) {
toast.info('되돌릴 도면층 상태가 없습니다.');
toast.info('되돌릴 레이어 상태가 없습니다.');
return '되돌릴 상태 없음';
}
setLayers(previous);
toast.success('직전 도면층 상태로 되돌렸습니다.');
return '직전 도면층 상태';
toast.success('직전 레이어 상태로 되돌렸습니다.');
return '직전 레이어 상태';
}
export const layerStateSaveToolStateMachine = createSequenceTool({
tool: Tool.LAYERSTATE,
helpers: false,
steps: [{ kind: 'text', instructions: '저장할 도면층 상태 이름을 입력하십시오.' }],
steps: [{ kind: 'text', instructions: '저장할 레이어 상태 이름을 입력하십시오.' }],
commit: (input) => {
saveLayerState(input.text(0), getLayers());
toast.success(`도면층 상태 저장: ${input.text(0)}`);
toast.success(`레이어 상태 저장: ${input.text(0)}`);
},
});
export const layerStateRestoreToolStateMachine = createSequenceTool({
tool: Tool.LAYERSTATE_RESTORE,
helpers: false,
steps: [{ kind: 'text', instructions: '복원할 도면층 상태 이름을 입력하십시오.' }],
steps: [{ kind: 'text', instructions: '복원할 레이어 상태 이름을 입력하십시오.' }],
commit: (input) => {
const restored = restoreLayerState(input.text(0));
if (!restored) {
toast.warn('그 이름으로 저장한 도면층 상태가 없습니다.');
toast.warn('그 이름으로 저장한 레이어 상태가 없습니다.');
return;
}
pushLayerHistory(getLayers());
setLayers(restored);
toast.success(`도면층 상태 복원: ${input.text(0)}`);
toast.success(`레이어 상태 복원: ${input.text(0)}`);
},
});
@@ -182,7 +182,7 @@ export const layerMatchToolStateMachine = createSequenceTool({
helpers: false,
steps: [
{ kind: 'selection', instructions: '옮길 객체를 선택한 뒤 ENTER.' },
{ kind: 'entity', instructions: '대상 도면층의 객체를 선택하십시오.' },
{ kind: 'entity', instructions: '대상 레이어의 객체를 선택하십시오.' },
],
commit: (input) => {
const layerId = input.entity(1).layerId;
@@ -198,7 +198,7 @@ export const layerMatchToolStateMachine = createSequenceTool({
export const layerToCurrentToolStateMachine = createSequenceTool({
tool: Tool.LAYCUR,
helpers: false,
steps: [{ kind: 'selection', instructions: '현재 도면층으로 옮길 객체를 선택한 뒤 ENTER.' }],
steps: [{ kind: 'selection', instructions: '현재 레이어로 옮길 객체를 선택한 뒤 ENTER.' }],
commit: (input) => {
const layerId = getActiveLayerId();
for (const entity of input.entities(0)) {
@@ -206,7 +206,7 @@ export const layerToCurrentToolStateMachine = createSequenceTool({
}
setEntities([...getEntities()], true);
setSelectedEntityIds([]);
toast.success(`${input.entities(0).length}개 객체를 현재 도면층으로 옮겼습니다.`);
toast.success(`${input.entities(0).length}개 객체를 현재 레이어로 옮겼습니다.`);
},
});
@@ -214,14 +214,14 @@ export const layerMergeToolStateMachine = createSequenceTool({
tool: Tool.LAYMRG,
helpers: false,
steps: [
{ kind: 'entity', instructions: '병합할(사라질) 도면층의 객체를 선택하십시오.' },
{ kind: 'entity', instructions: '대상 도면층의 객체를 선택하십시오.' },
{ kind: 'entity', instructions: '병합할(사라질) 레이어의 객체를 선택하십시오.' },
{ kind: 'entity', instructions: '대상 레이어의 객체를 선택하십시오.' },
],
commit: (input) => {
const sourceId = input.entity(0).layerId;
const targetId = input.entity(1).layerId;
if (sourceId === targetId) {
toast.warn('같은 도면층입니다.');
toast.warn('같은 레이어입니다.');
return;
}
for (const entity of getEntities()) {
@@ -230,25 +230,25 @@ export const layerMergeToolStateMachine = createSequenceTool({
setEntities([...getEntities()], true);
updateLayers((layers) => layers.filter((layer) => layer.id !== sourceId));
if (getActiveLayerId() === sourceId) setActiveLayerId(targetId);
toast.success(`도면층을 ${layerNameOf(targetId)}(으)로 병합했습니다.`);
toast.success(`레이어를 ${layerNameOf(targetId)}(으)로 병합했습니다.`);
},
});
export const layerDeleteToolStateMachine = createSequenceTool({
tool: Tool.LAYDEL,
helpers: false,
steps: [{ kind: 'entity', instructions: '삭제할 도면층의 객체를 선택하십시오.' }],
steps: [{ kind: 'entity', instructions: '삭제할 레이어의 객체를 선택하십시오.' }],
commit: (input) => {
const layerId = input.entity(0).layerId;
if (getLayers().length <= 1) {
toast.warn('마지막 도면층은 삭제할 수 없습니다.');
toast.warn('마지막 레이어는 삭제할 수 없습니다.');
return;
}
const doomed: Entity[] = getEntities().filter((entity) => entity.layerId === layerId);
deleteEntities(doomed, true);
updateLayers((layers) => layers.filter((layer) => layer.id !== layerId));
if (getActiveLayerId() === layerId) setActiveLayerId(getLayers()[0].id);
toast.success(`도면층과 객체 ${doomed.length}개를 삭제했습니다.`);
toast.success(`레이어와 객체 ${doomed.length}개를 삭제했습니다.`);
},
});
@@ -256,10 +256,10 @@ export const layerDeleteToolStateMachine = createSequenceTool({
let walkIndex = -1;
export function walkLayers(): string {
const layers = getLayers();
if (!layers.length) return '도면층 없음';
if (!layers.length) return '레이어 없음';
walkIndex = (walkIndex + 1) % layers.length;
const target = layers[walkIndex];
updateLayers((all) => all.map((layer) => ({ ...layer, isVisible: layer.id === target.id })));
toast.info(`도면층 탐색: ${target.name} (${walkIndex + 1}/${layers.length})`);
return `도면층 탐색 ${target.name}`;
toast.info(`레이어 탐색: ${target.name} (${walkIndex + 1}/${layers.length})`);
return `레이어 탐색 ${target.name}`;
}
@@ -100,7 +100,7 @@ export const lineWeightToolStateMachine = createSequenceTool({
tool: Tool.LWEIGHT,
helpers: false,
steps: [
{ kind: 'selection', instructions: '선가중치를 바꿀 객체를 선택한 뒤 ENTER.' },
{ kind: 'selection', instructions: '선 두께를 바꿀 객체를 선택한 뒤 ENTER.' },
{ kind: 'number', instructions: '선 굵기를 입력하십시오 <1>.', defaultValue: 1 },
],
commit: (input) => {
@@ -110,7 +110,7 @@ export const lineWeightToolStateMachine = createSequenceTool({
}
setEntities([...getEntities()], true);
setSelectedEntityIds([]);
toast.success(`선가중치 ${width}px`);
toast.success(`선 두께 ${width}px`);
},
});
@@ -31,4 +31,10 @@ describe("command-catalog.json", () => {
expect(owner("SE")).toBeUndefined();
expect(owner("ED")).toBe("TEXTEDIT");
});
it("488 — 이름 · 설명에 「도면층」 · 「선가중치」 없음(레이어 · 선 두께)", () => {
const words = getAllCommands().flatMap((c) => [c.label, c.hint ?? ""]);
expect(words.filter((w) => /도면층|선가중치/.test(w))).toEqual([]);
expect(catalog.find((c) => c.id === "LAYER")?.label).toContain("레이어");
});
});