diff --git a/src/components/dev/DevToolbar.tsx b/src/components/dev/DevToolbar.tsx index 6ac60fb1..a84f2585 100644 --- a/src/components/dev/DevToolbar.tsx +++ b/src/components/dev/DevToolbar.tsx @@ -14,7 +14,7 @@ * NEXT_PUBLIC_DEV_TOOLBAR_ENABLED=true */ -import { useState } from 'react'; +import { useState, useEffect, useCallback, useRef } from 'react'; import { usePathname, useRouter, useSearchParams } from 'next/navigation'; import { FileText, // 견적 @@ -39,6 +39,7 @@ import { PackageCheck, // 입고 // Dev 도구 아이콘 Layers, // 컴포넌트 레지스트리 + GripVertical, // 드래그 핸들 } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; @@ -102,6 +103,46 @@ const MATERIAL_STEPS: { type: DevFillPageType; label: string; icon: typeof FileT { type: 'receiving', label: '입고', icon: PackageCheck, path: '/material/receiving-management/new', fillEnabled: true }, ]; +// ===== 위치 관리 헬퍼 ===== +const POS_KEY_MINI = 'dev-toolbar-pos-mini'; +const POS_KEY_FULL = 'dev-toolbar-pos-full'; + +function loadPos(key: string): { x: number; y: number } | null { + if (typeof window === 'undefined') return null; + try { + const s = localStorage.getItem(key); + return s ? JSON.parse(s) : null; + } catch { return null; } +} + +function savePos(key: string, p: { x: number; y: number }) { + try { localStorage.setItem(key, JSON.stringify(p)); } catch { /* noop */ } +} + +function PositionGrid({ onSelect }: { onSelect: (id: string) => void }) { + const spots: [string, boolean, string][] = [ + ['tl', true, '좌상단'], ['', false, ''], ['tr', true, '우상단'], + ['', false, ''], ['c', true, '중앙'], ['', false, ''], + ['bl', true, '좌하단'], ['', false, ''], ['br', true, '우하단'], + ]; + return ( +
+ {spots.map(([id, active, title], i) => + active ? ( +